[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [905] trunk/LedgerSMB.pm
- Subject: SF.net SVN: ledger-smb: [905] trunk/LedgerSMB.pm
- From: ..hidden..
- Date: Wed, 14 Mar 2007 20:42:37 -0700
Revision: 905
http://svn.sourceforge.net/ledger-smb/?rev=905&view=rev
Author: einhverfr
Date: 2007-03-14 20:42:37 -0700 (Wed, 14 Mar 2007)
Log Message:
-----------
Updated LedgerSMB.pm
Modified Paths:
--------------
trunk/LedgerSMB.pm
Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm 2007-03-15 03:08:34 UTC (rev 904)
+++ trunk/LedgerSMB.pm 2007-03-15 03:42:37 UTC (rev 905)
@@ -1,10 +1,11 @@
=head1 NAME
-LedgerSMB::DBObject - LedgerSMB class for building objects from db relations
+LedgerSMB The Base class for many LedgerSMB objects, including DBObject.
=head1 SYOPSIS
-This module creates object instances based on LedgerSMB's in-database ORM.
+This module creates a basic request handler with utility functions available
+in database objects (LedgerSMB::DBObject)
=head1 METHODS
@@ -24,6 +25,15 @@
This function returns the $string encoded using %hexhex using ordinary notation.
+=item format_amount (user => $LedgerSMB::User::hash, amount => $string, precision => $integer, neg_format => (-|DRCR));
+
+The function takes a monetary amount and formats it according to the user
+preferences, the negative format (- or DR/CR).
+
+=item format_fields (fields => ..hidden..);
+This function converts fields to their appropriate representation in
+HTML/SGML/XML or LaTeX.
+
=item is_blank (msg=> $string, name => $string)
This function invokes self->error($msg) if the property contains no
non-whitespace characters.
@@ -211,7 +221,8 @@
}
sub format_fields {
- # We should look at moving this into LedgerSMB::Template. Chris
+ # We should look at moving this into LedgerSMB::Template.
+ # And cleaning it up...... Chris
my $self = shift @_;
my %args = @_;
@@ -250,10 +261,16 @@
}
+# TODO: Either we should have an amount class with formats and such attached
+# Or maybe we should move this into the user class...
sub format_amount {
+ my $self = shift @_;
+ my %args = @_;
+ my $myconfig = $args{user};
+ my $amount = $args{amount};
+ my $places = $args{precision};
+ my $dash = $args{neg_format};
- my ($self, $myconfig, $amount, $places, $dash) = @_;
-
my $negative ;
if ($amount){
$amount = $self->parse_amount($myconfig, $amount);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.