summaryrefslogtreecommitdiff
path: root/LedgerSMB.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-15 05:21:31 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-15 05:21:31 +0000
commitb058034becbabad46381db6c2e1f588283fced26 (patch)
treec59bf613813320231e26e70288273488476ed303 /LedgerSMB.pm
parent9846397cb1c8a1a9ac86a8a305de0b2af32f890d (diff)
Adding ledgersmb.conf.default
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@908 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-xLedgerSMB.pm35
1 files changed, 27 insertions, 8 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index a7a34db6..3a38fef3 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -12,6 +12,10 @@ in database objects (LedgerSMB::DBObject)
=item new ()
This method creates a new base request instance.
+=item date_to_number (user => $LedgerSMB::User, date => $string);
+This function takes the date in the format provided and returns a numeric
+string in YYMMDD format. This may be moved to User in the future.
+
=item debug (file => $path);
This dumps the current object to the file if that is defined and otherwise to
@@ -28,7 +32,12 @@ 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).
+preferences, the negative format (- or DR/CR). Note that it may move to
+LedgerSMB::User at some point in the future.
+
+=item parse_amount (user => $LedgerSMB::User::hash, amount => $variable);
+If $amount is a Bigfloat, it is returned as is. If it is a string, it is
+parsed according to the user preferences stored in the LedgerSMB::User object.
=item format_fields (fields => \@array);
This function converts fields to their appropriate representation in
@@ -368,10 +377,12 @@ sub format_amount {
$amount;
}
-
+# This should probably go to the User object too.
sub parse_amount {
-
- my ($self, $myconfig, $amount) = @_;
+ my $self = shift @_;
+ my %args = @_;
+ my $myconfig = $args{user};
+ my $amount = $args{amount};
if ($amount eq '' or $amount == undef){
return 0;
@@ -447,9 +458,12 @@ sub call_procedure {
@results;
}
-sub datetonum {
-
- my ($self, $myconfig, $date, $picture) = @_;
+# This should probably be moved to User too...
+sub date_to_number {
+ my $self = shift @_;
+ my %args = @_;
+ my $myconfig = $args{user};
+ my $date = $args{date};
my ($yy, $mm, $dd);
if ($date && $date =~ /\D/) {
@@ -483,7 +497,10 @@ sub datetonum {
# Database routines used throughout
sub db_init {
- my ($self, $myconfig) = @_;
+ my $self = shift @_;
+ my %args = @_;
+ my $myconfig = $args{user};
+
$self->{dbh} = $self->dbconnect_noauto($myconfig) || $self->dberror();
my $query =
@@ -501,6 +518,8 @@ sub db_init {
}
}
+# Will merge this into db_init in the future.
+# Deprecated and hence undocumented. Chris.
sub dbconnect_noauto {
my ($self, $myconfig) = @_;
dd'>tags/a5/1d/20171117120240.126821C116@jawa.homebase.dk/hb0
-rw-r--r--tags/a5/1d/20171117120240.126821C116@jawa.homebase.dk/sys0
-rw-r--r--tags/a5/1d/20171117120240.126821C116@jawa.homebase.dk/unread0
-rw-r--r--tags/a5/1d/20180616190002.10CB41CD0FA@lxp5.free-owl.de/sys0
-rw-r--r--tags/a5/1d/20180616190002.10CB41CD0FA@lxp5.free-owl.de/unread0
-rw-r--r--tags/a5/1d/20181218061836.4D72C896@xayide.jones.dk/jones0
-rw-r--r--tags/a5/1d/20181218061836.4D72C896@xayide.jones.dk/sys0
-rw-r--r--tags/a5/1d/20181218061836.4D72C896@xayide.jones.dk/unread0
-rw-r--r--tags/a5/1d/20190918090001.AE73B1CD9C2@lxp5.free-owl.de/sys0
-rw-r--r--tags/a5/1d/20190918090001.AE73B1CD9C2@lxp5.free-owl.de/unread0
-rw-r--r--tags/a5/1d/59354004.gnUzfTn8tA@tonks/debian0
-rw-r--r--tags/a5/1d/59354004.gnUzfTn8tA@tonks/signed0
-rw-r--r--tags/a5/1d/59354004.gnUzfTn8tA@tonks/unread0
-rw-r--r--tags/a5/1d/84aaxrgu79.fsf@sauna.l.org/openmoko0
-rw-r--r--tags/a5/1d/CAJ+iPVSrauoHRMtD3oFnkgBkGgHVb51UsY8sYqSOmx1ecLBhUg@mail.gmail.com/sugar0
-rw-r--r--tags/a5/1d/CAJ+iPVSrauoHRMtD3oFnkgBkGgHVb51UsY8sYqSOmx1ecLBhUg@mail.gmail.com/unread0
-rw-r--r--tags/a5/1d/CAKNHny_ee---6SU3dt+uEQXrw_sSxAYyTsgY7YVCosi3o-aU=w@mail.gmail.com/unread0
-rw-r--r--tags/a5/1d/E1MoZmu-000122-Qb@maintainer.skolelinux.no/debian0
-rw-r--r--tags/a5/1d/NEBBJIJCOLFPEHOGNCAMEECECKAA.jgh@jones.dk/inbox0
-rw-r--r--tags/a5/1d/NEBBJIJCOLFPEHOGNCAMEECECKAA.jgh@jones.dk/old0
-rw-r--r--tags/a5/1d/YzKIZd6A5%2f7Mc4iS@an3as.eu/debian0
-rw-r--r--tags/a5/1d/YzKIZd6A5%2f7Mc4iS@an3as.eu/unread0
38 files changed, 0 insertions, 0 deletions