details:   https://code.openbravo.com/erp/devel/pi/rev/e8725afe1d6a
changeset: 13684:e8725afe1d6a
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Fri Sep 09 13:14:48 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
 |  12 +++++----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (22 lines):

diff -r 55f31472ff1f -r e8725afe1d6a 
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 13:08:41 2011 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
     Fri Sep 09 13:14:48 2011 +0200
@@ -511,11 +511,13 @@
                     }
                   }
                   // Create merged Payment Schedule Detail with the pending to 
be paid amount
-                  final FIN_PaymentScheduleDetail mergedScheduleDetail = dao
-                      .getNewPaymentScheduleDetail(payment.getOrganization(), 
outStandingAmt);
-                  
mergedScheduleDetail.setInvoicePaymentSchedule(paymentScheduleDetail
-                      .getInvoicePaymentSchedule());
-                  OBDal.getInstance().save(mergedScheduleDetail);
+                  if (outStandingAmt.compareTo(BigDecimal.ZERO) != 0) {
+                    final FIN_PaymentScheduleDetail mergedScheduleDetail = dao
+                        
.getNewPaymentScheduleDetail(payment.getOrganization(), outStandingAmt);
+                    
mergedScheduleDetail.setInvoicePaymentSchedule(paymentScheduleDetail
+                        .getInvoicePaymentSchedule());
+                    OBDal.getInstance().save(mergedScheduleDetail);
+                  }
                 } else if (paymentScheduleDetail.getOrderPaymentSchedule() != 
null) {
                   // Related to orders
                   for (final FIN_PaymentScheduleDetail ordScheDetail : 
paymentScheduleDetail

------------------------------------------------------------------------------
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