details:   https://code.openbravo.com/erp/devel/pi/rev/55f31472ff1f
changeset: 13683:55f31472ff1f
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Fri Sep 09 13:08:41 2011 +0200
summary:   Issue 18477:
When voiding a payment, we ensure no Payment Schedule Detail is created in case
the calculated outstanding amount is 0

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
 |  14 +++++----
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r 20b8dd209bc0 -r 55f31472ff1f 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
     Fri Sep 09 12:01:35 2011 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
     Fri Sep 09 13:08:41 2011 +0200
@@ -38,8 +38,8 @@
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.ConversionRateDoc;
 import org.openbravo.model.common.invoice.Invoice;
-import org.openbravo.model.common.currency.ConversionRateDoc;
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentDetail;
@@ -530,11 +530,13 @@
                     }
                   }
                   // Create merged Payment Schedule Detail with the pending to 
be paid amount
-                  final FIN_PaymentScheduleDetail mergedScheduleDetail = dao
-                      .getNewPaymentScheduleDetail(payment.getOrganization(), 
outStandingAmt);
-                  
mergedScheduleDetail.setOrderPaymentSchedule(paymentScheduleDetail
-                      .getOrderPaymentSchedule());
-                  OBDal.getInstance().save(mergedScheduleDetail);
+                  if (outStandingAmt.compareTo(BigDecimal.ZERO) != 0) {
+                    final FIN_PaymentScheduleDetail mergedScheduleDetail = dao
+                        
.getNewPaymentScheduleDetail(payment.getOrganization(), outStandingAmt);
+                    
mergedScheduleDetail.setOrderPaymentSchedule(paymentScheduleDetail
+                        .getOrderPaymentSchedule());
+                    OBDal.getInstance().save(mergedScheduleDetail);
+                  }
                 } else if (paymentScheduleDetail.getOrderPaymentSchedule() == 
null
                     && paymentScheduleDetail.getInvoicePaymentSchedule() == 
null) {
                   // Credit payment

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to