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

SF.net SVN: ledger-smb:[6243] trunk



Revision: 6243
          http://sourceforge.net/p/ledger-smb/code/6243
Author:   einhverfr
Date:     2013-11-07 12:03:36 +0000 (Thu, 07 Nov 2013)
Log Message:
-----------
More fixes to stored procedures for overpayment reversal.

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

Modified: trunk/LedgerSMB/Scripts/reports.pm
===================================================================
--- trunk/LedgerSMB/Scripts/reports.pm	2013-11-07 11:16:25 UTC (rev 6242)
+++ trunk/LedgerSMB/Scripts/reports.pm	2013-11-07 12:03:36 UTC (rev 6243)
@@ -23,6 +23,7 @@
 use LedgerSMB::Report::Listings::Warehouse;
 use LedgerSMB::Report::Listings::Language;
 use LedgerSMB::Report::Listings::SIC;
+use LedgerSMB::Report::Listings::Overpayments;
 use strict;
 
 =pod
@@ -165,6 +166,17 @@
     $report->render($request);
 }
 
+=item search_overpayments
+
+Searches overpayments based on inputs.
+
+=cut
+
+sub search_overpayments {
+    my ($request) = @_;
+    LedgerSMB::Report::Listings::Overpayments->new(%$request)->render($request);
+}
+
 =back
 
 =head1 Copyright (C) 2007 The LedgerSMB Core Team

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2013-11-07 11:16:25 UTC (rev 6242)
+++ trunk/sql/modules/Payment.sql	2013-11-07 12:03:36 UTC (rev 6243)
@@ -1487,13 +1487,19 @@
 $$;
 
 CREATE OR REPLACE FUNCTION payment__reverse_overpayment
-(in_payment_id int, in_batch_id int, in_account_class int) 
+(in_payment_id int, in_batch_id int) 
 RETURNS voucher LANGUAGE PLPGSQL AS
 $$
 DECLARE retval voucher;
         t_batch_class int;
         t_gl_id int;
+      in_account_class int;
 BEGIN
+    SELECT entity_class INTO in_account_class 
+      FROM entity_credit_account
+     WHERE id = (select entity_credit_id FROM overpayments 
+                  WHERE payment_id = in_payment_id);
+
     IF in_account_class = 1 THEN
        t_batch_class := 4;
     ELSIF in_account_class = 2 THEN
@@ -1523,7 +1529,7 @@
 END;
 $$;
 
-DROP TYPE IF EXISTS overpayment_list_item;
+DROP TYPE IF EXISTS overpayment_list_item CASCADE;
 CREATE TYPE overpayment_list_item AS (
   payment_id int,
   entity_name text,

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


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits