summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-26 17:41:09 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-26 17:41:09 +0000
commit5b24f1bd3c5acc9fd200f0384495adb8bb8e512f (patch)
treef103db24d48c3e662322519114a6c3520b0a3b24 /LedgerSMB
parentd6b8b1b013f35294da2b035c9ce8cf6d44ec3ddc (diff)
Applying (and cleaning up) David Mora's patches to Payment.pm
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1668 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/DBObject/Payment.pm30
1 files changed, 26 insertions, 4 deletions
diff --git a/LedgerSMB/DBObject/Payment.pm b/LedgerSMB/DBObject/Payment.pm
index 79dfc129..8ee92792 100644
--- a/LedgerSMB/DBObject/Payment.pm
+++ b/LedgerSMB/DBObject/Payment.pm
@@ -166,9 +166,8 @@ sub get_all_contact_invoices {
=item list_open_projects
-This method uses the $payment->{date} attribute, and provides a list of open
-projects. The list is attached to $payment->{projects} and returned by the
-function.
+This method gets the current date attribute, and provides a list of open
+projects. The list is attached to $self->{projects} and returned.
=back
@@ -176,8 +175,31 @@ function.
sub list_open_projects {
my ($self) = @_;
- @{$self->{projects}} = $self->exec_method('project_list_open');
+ my ($date) = $self->{dbh}->selectrow_array('select current_date');
+ @{$self->{projects}} = $self->call_procedure(
+ procname => 'project_list_open', args => [$date]
+ );
return @{$self->{projects}};
}
+=over
+=item list_open_projects
+
+This method gets the type of document as a parameter, and provides a list of departments
+of the required type.
+The list is attached to $self->{departments} and returned.
+
+=back
+=cut
+
+sub list_departments {
+ my ($self) = shift @_;
+ my @args = @_;
+ @{$self->{departments}} = $self->call_procedure(
+ procname => 'department_list',
+ args => \@args
+ );
+ return @{$self->{departments}};
+}
+
1;