[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1668] trunk/LedgerSMB/DBObject/Payment.pm



Revision: 1668
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1668&view=rev
Author:   einhverfr
Date:     2007-09-26 10:41:09 -0700 (Wed, 26 Sep 2007)

Log Message:
-----------
Applying (and cleaning up) David Mora's patches to Payment.pm

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Payment.pm

Modified: trunk/LedgerSMB/DBObject/Payment.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Payment.pm	2007-09-26 17:05:44 UTC (rev 1667)
+++ trunk/LedgerSMB/DBObject/Payment.pm	2007-09-26 17:41:09 UTC (rev 1668)
@@ -166,9 +166,8 @@
 
 =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 @@
 
 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 => ..hidden..
+  );
+  return @{$self->{departments}};
+}
+
 1;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.