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

SF.net SVN: ledger-smb:[6821] trunk/LedgerSMB



Revision: 6821
          http://sourceforge.net/p/ledger-smb/code/6821
Author:   einhverfr
Date:     2014-02-10 08:36:11 +0000 (Mon, 10 Feb 2014)
Log Message:
-----------
More fixes for overpayment reversal

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

Modified: trunk/LedgerSMB/DBObject/Payment.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Payment.pm	2014-02-10 05:27:05 UTC (rev 6820)
+++ trunk/LedgerSMB/DBObject/Payment.pm	2014-02-10 08:36:11 UTC (rev 6821)
@@ -816,8 +816,8 @@
 
 sub overpayment_reverse {
     my ($self, $payment, $batch_id) = @_;
-    __PACKAGE__->call_procedure({procname => 'payment__reverse_overpayment',
-                                     args => [] });
+    __PACKAGE__->call_procedure(procname => 'payment__reverse_overpayment',
+                                     args => [] );
 }
 
 =item init

Modified: trunk/LedgerSMB/Scripts/reports.pm
===================================================================
--- trunk/LedgerSMB/Scripts/reports.pm	2014-02-10 05:27:05 UTC (rev 6820)
+++ trunk/LedgerSMB/Scripts/reports.pm	2014-02-10 08:36:11 UTC (rev 6821)
@@ -24,6 +24,7 @@
 use LedgerSMB::Report::Listings::Language;
 use LedgerSMB::Report::Listings::SIC;
 use LedgerSMB::Report::Listings::Overpayments;
+use LedgerSMB::DBObject::Payment; # To move this off after rewriting payments
 use strict;
 
 =pod
@@ -192,6 +193,19 @@
     LedgerSMB::Report::Listings::Overpayments->new(%$request)->render($request);
 }
 
+sub reverse_overpayment {
+    my ($request) = @_;
+    for my $rc (1 .. $request->{rowcount_}){
+        next unless $request->{"select_$rc"};
+        LedgerSMB::DBObject::Payment->overpayment_reverse(
+             $request->{"select_$rc"}, $request->{batch_id}
+        );
+    }
+    $request->{report_name} = 'overpayments';
+    start_report($request);
+}
+
+
 =back
 
 =head1 Copyright (C) 2007 The LedgerSMB Core Team

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


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits