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

SF.net SVN: ledger-smb:[4186] branches/1.3/scripts/payment.pl



Revision: 4186
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4186&view=rev
Author:   tshvr
Date:     2011-12-09 14:37:54 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
avoid duplicate vars,error Not a CODE reference in payment1_5 if array_options>1

Modified Paths:
--------------
    branches/1.3/scripts/payment.pl

Modified: branches/1.3/scripts/payment.pl
===================================================================
--- branches/1.3/scripts/payment.pl	2011-12-09 14:05:49 UTC (rev 4185)
+++ branches/1.3/scripts/payment.pl	2011-12-09 14:37:54 UTC (rev 4186)
@@ -657,7 +657,7 @@
 
 sub payment {
  my ($request)    = @_;  
- my $locale       = $request->{_locale};
+ #my $locale       = $request->{_locale};
  my $dbPayment = LedgerSMB::DBObject::Payment->new({'base' => $request});
  my $Settings = LedgerSMB::Setting->new({'base' => $request});
 # Lets get the project data... 
@@ -689,7 +689,7 @@
  }
 # Lets build filter by period
 my $date = LedgerSMB::DBObject::Date->new({base => $request});
-   $date->build_filter_by_period($locale);
+   $date->build_filter_by_period($request->{_locale});
 # Lets set the data in a hash for the template system. :)    
 my $select = {
   stylesheet => $request->{_user}->{stylesheet},
@@ -733,7 +733,7 @@
   action => {
     name => 'action',
     value => 'payment1_5', 
-    text => $locale->text("Continue"),
+    text => $request->{_locale}->text("Continue"),
   }
 };
 
@@ -767,6 +767,7 @@
 my  $dbPayment = LedgerSMB::DBObject::Payment->new({'base' => $request});
 #print STDERR localtime()." payment.pl payment1_5 dbPayment=".Data::Dumper::Dumper(\$dbPayment)."\n";
 my @array_options = $dbPayment->get_entity_credit_account();
+#print STDERR localtime()." payment.pl payment1_5 \$\#array_options=".Data::Dumper::Dumper(..hidden..)."\n";
 if ($#array_options == -1) { 
    &payment($request);   
 } elsif ($#array_options == 0) {
@@ -803,7 +804,7 @@
                        value => $request->{type}},
     action       => {  name => 'action',
                        value => 'payment2', 
-                       text =>  $request->{_locale}("Continue")}
+                       text =>  $request->{_locale}->text("Continue")}
     };
     my $template;
      $template = LedgerSMB::Template->new(
@@ -815,9 +816,10 @@
      try {$template->render($select); }
      catch CancelFurtherProcessing with {
        my $ex = shift;
+       print STDERR localtime()." payment.pl payment1_5 \$ex=".Data::Dumper::Dumper(\$ex)."\n";
        throw $ex;
      }
-     otherwise { $request->error("$@"); }; # PRINT ERRORS ON THE UI
+     otherwise {print STDERR localtime()." payment.pl payment1_5 ..hidden..".Data::Dumper::Dumper(\$@)."\n"; $request->error("$@"); }; # PRINT ERRORS ON THE UI
  }
 
 }

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