details:   /erp/devel/pi/rev/150efbeebc39
changeset: 10787:150efbeebc39
user:      Mikel Irurita <mikel.irurita <at> openbravo.com>
date:      Fri Feb 18 13:16:15 2011 +0100
summary:   Fixes issue 16005: Processing invoice not generating correct payment 
plan lines

diffstat:

 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
 |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r b54c2d74dfd8 -r 150efbeebc39 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
     Fri Feb 18 12:34:59 2011 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
     Fri Feb 18 13:16:15 2011 +0100
@@ -251,6 +251,13 @@
             WHERE c_invoiceline.c_orderline_id = c_orderline.c_orderline_id
               AND c_invoiceline.c_invoice_id = p_record_id
               AND c_orderline.c_order_id = order_schdet.order_id;
+            
+            -- invoiced amount for the order plan cannot be higher than total 
order plan amount.
+            -- sometimes there is a difference due to taxes. that amount will 
be compensated at the end.
+            IF (v_invoicedamount > order_schdet.amount) THEN
+              v_invoicedamount := order_schdet.amount;
+            END IF;
+            
             -- substract previously assigned amount
             SELECT SUM(psd.amount) INTO v_assignedamount
             FROM fin_payment_schedule ps_inv, fin_payment_scheduledetail psd,

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to