details:   https://code.openbravo.com/erp/devel/pi/rev/aa9bbdcfead5
changeset: 15808:aa9bbdcfead5
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Wed Mar 14 17:36:05 2012 +0100
summary:   Fixes issue 0020020: Discards canceled Payments of an Order

details:   https://code.openbravo.com/erp/devel/pi/rev/872bbf30468c
changeset: 15809:872bbf30468c
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Wed Mar 14 17:36:39 2012 +0100
summary:   Fixes issue 0020017: Checks if the amount is Zero before saving the 
line.

diffstat:

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

diffs (34 lines):

diff -r da0842b08a52 -r 872bbf30468c 
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
     Wed Mar 14 16:17:54 2012 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
     Wed Mar 14 17:36:39 2012 +0100
@@ -202,6 +202,7 @@
         AND c_orderline.c_order_id = fin_payment_schedule.c_order_id
         AND fin_payment_schedule.fin_payment_schedule_id = 
fin_payment_scheduledetail.fin_payment_schedule_order
         AND fin_payment_scheduledetail.fin_payment_schedule_invoice is null
+        AND fin_payment_scheduledetail.ISCANCELED <> 'Y'
         AND c_invoiceline.c_invoice_id = invoice_id
       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;
@@ -380,6 +381,7 @@
               WHERE ps_inv.fin_payment_schedule_id = 
psd.fin_payment_schedule_invoice
                 AND psd.fin_payment_schedule_order = 
ps_ord.fin_payment_schedule_id
                 AND ps_inv.c_invoice_id = p_record_id
+                AND psd.ISCANCELED <> 'Y'
                 AND ps_ord.c_order_id = order_schdet.order_id;
 
               -- substract previously assigned amount
diff -r da0842b08a52 -r 872bbf30468c 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
 Wed Mar 14 16:17:54 2012 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
 Wed Mar 14 17:36:39 2012 +0100
@@ -163,6 +163,11 @@
         }
         BigDecimal paymentDetailAmount = selectedPaymentScheduleDetailsAmounts
             .get(paymentScheduleDetail.getId());
+        // If detail to be added is zero amount, skip it
+        if (paymentDetailAmount.signum() == 0
+            && paymentScheduleDetail.getWriteoffAmount().signum() == 0 && 
paymentScheduleDetail.getWriteoffAmount().signum()==0) {
+          continue;
+        }
         BigDecimal amountDifference = 
paymentScheduleDetail.getAmount().subtract(
             paymentDetailAmount);
         if (amountDifference.compareTo(BigDecimal.ZERO) != 0) {

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to