Fixes Issue 32678:Wrong schedule details when purchase order is not fully
authorAtul Gaware <atul.gaware@openbravo.com>
Wed, 11 May 2016 21:13:35 +0530
changeset 29507 7eb95ad4b19b
parent 29506 9f9148601089
child 29508 4451654b2b92
child 29547 b3f3e3f7e65e
Fixes Issue 32678:Wrong schedule details when purchase order is not fully
invoiced and related invoices have partial payment terms

While getting related order schedule, sign of quantity is checked
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	Sun May 15 21:28:20 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml	Wed May 11 21:13:35 2016 +0530
@@ -238,6 +238,7 @@
         AND fin_payment_scheduledetail.fin_payment_schedule_invoice is null
         AND fin_payment_scheduledetail.ISCANCELED <> 'Y'
         AND c_invoiceline.c_invoice_id = invoice_id
+        AND sign(c_invoiceline.qtyinvoiced) = sign(c_orderline.qtyordered)
       ORDER BY CASE WHEN fin_payment_scheduledetail.fin_payment_detail_id is not null THEN 0 ELSE 1 END, c_orderline.c_order_id;
       order_schdet cur_order_schdet%ROWTYPE;