From 5b24f1bd3c5acc9fd200f0384495adb8bb8e512f Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 26 Sep 2007 17:41:09 +0000 Subject: 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 --- LedgerSMB/DBObject/Payment.pm | 30 ++++++++++++++++++++++++++---- 1 file 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; -- cgit v1.2.3