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

SF.net SVN: ledger-smb:[4478] trunk/LedgerSMB/Scripts/payment.pm



Revision: 4478
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4478&view=rev
Author:   einhverfr
Date:     2012-03-16 01:51:52 +0000 (Fri, 16 Mar 2012)
Log Message:
-----------
Cash payment interface no longer errors.

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/payment.pm

Modified: trunk/LedgerSMB/Scripts/payment.pm
===================================================================
--- trunk/LedgerSMB/Scripts/payment.pm	2012-03-15 10:58:03 UTC (rev 4477)
+++ trunk/LedgerSMB/Scripts/payment.pm	2012-03-16 01:51:52 UTC (rev 4478)
@@ -664,26 +664,10 @@
  #my $locale       = $request->{_locale};
  my $dbPayment = LedgerSMB::DBObject::Payment->new({'base' => $request});
  my $Settings = LedgerSMB::Setting->new({'base' => $request});
-# Lets get the project data... 
- my  @projectOptions; 
- my  @arrayOptions  = $dbPayment->list_open_projects();
-  push @projectOptions, {}; #A blank field on the select box 
- for my $ref (0 .. $#arrayOptions) {
-       push @projectOptions, { value => $arrayOptions[$ref]->{id}."--".$arrayOptions[$ref]->{projectnumber}."--".$arrayOptions[$ref]->{description},
-                                text => $arrayOptions[$ref]->{projectnumber}."--".$arrayOptions[$ref]->{description}};
- }
 
-# Lets get the departments data...
-  my @departmentOptions;
-  my $role =  $request->{type} eq 'receipt' ? 'P' : 'C';
-  @arrayOptions = $dbPayment->list_departments($role);
-  push @departmentOptions, {}; # A blank field on the select box
-  for my $ref (0 .. $#arrayOptions) {
-      push @departmentOptions, {  value => $arrayOptions[$ref]->{id}."--".$arrayOptions[$ref]->{description},
-                                  text => $arrayOptions[$ref]->{description}};
-  }
 # Lets get the currencies (this uses the $dbPayment->{account_class} property)
  my @currOptions;
+ my @arrayOptions;
  @arrayOptions = $Settings->get_currencies();
 
  for my $ref (0 .. $#arrayOptions) {
@@ -699,14 +683,6 @@
   stylesheet => $request->{_user}->{stylesheet},
   login    => { name  => 'login', 
                 value => $request->{_user}->{login}   },
-  projects => {
-    name => 'projects',
-    options => ..hidden..
-  },
-  department => {
-    name => 'department',
-    options => ..hidden..
-  },
   curr => {
     name => 'curr',
     options => ..hidden..
@@ -843,6 +819,26 @@
 my @department;
 my @currency_options;
 my $exchangerate;
+my $module;
+my $b_units;
+if ($request->{account_class} == 2){
+    $module = 'AR';
+} elsif ($request->{account_class} == 1){
+    $module = 'AP';
+}
+
+my @b_classes = $request->call_procedure(
+                        procname => 'business_unit__list_classes',
+                            args => ['1', $module]);
+
+for my $cls (@b_classes){
+   my @units = $request->call_procedure(
+                        procname => 'business_unit__list_by_class',
+                            args => [$cls->{id}, $request->{transdate}, 
+                                     $request->{credit_id}, '0'],
+   );
+   $b_units->{$cls->{id}} = ..hidden..;
+}
 # LETS GET THE CUSTOMER/VENDOR INFORMATION	
 
 ($Payment->{entity_credit_id}, $Payment->{company_name}) = split /--/ , $request->{'vendor-customer'};

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