details:   https://code.openbravo.com/erp/devel/pi/rev/774cff79b78d
changeset: 32444:774cff79b78d
user:      Prakash M <prakash <at> qualiantech.com>
date:      Tue Jul 11 10:46:15 2017 +0530
summary:   Fixed Issue 36308: Used separate list for cancel and replace payment 
schedule detail

diffstat:

 src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java |  9 
+++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 43ba9a3ad9e9 -r 774cff79b78d 
src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java
--- a/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java    
Mon Jul 10 15:08:05 2017 -0400
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java    
Tue Jul 11 10:46:15 2017 +0530
@@ -1129,13 +1129,15 @@
     // There should be only one with null paymentDetails
     paymentScheduleDetailCriteria.add(Restrictions
         .isNull(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS));
-    List<FIN_PaymentScheduleDetail> paymentScheduleDetailList = 
paymentScheduleDetailCriteria
+    List<FIN_PaymentScheduleDetail> pendingPaymentScheduleDetailList = 
paymentScheduleDetailCriteria
         .list();
 
+    List<FIN_PaymentScheduleDetail> paymentScheduleDetailList = new 
ArrayList<FIN_PaymentScheduleDetail>();
     HashMap<String, BigDecimal> paymentScheduleDetailAmount = new 
HashMap<String, BigDecimal>();
     FIN_PaymentScheduleDetail paymentScheduleDetail = null;
-    if (paymentScheduleDetailList.size() != 0
-        && paymentScheduleDetailList.get(0).getAmount().compareTo(amount) == 
0) {
+    if (pendingPaymentScheduleDetailList.size() != 0
+        && 
pendingPaymentScheduleDetailList.get(0).getAmount().compareTo(amount) == 0) {
+      paymentScheduleDetailList.addAll(pendingPaymentScheduleDetailList);
       paymentScheduleDetail = paymentScheduleDetailList.get(0);
       paymentScheduleDetailAmount.put(paymentScheduleDetail.getId(), amount);
     } else {
@@ -1145,7 +1147,6 @@
       // null payment detail is missing
       // Lets assume that in this point the payment was created trough Web POS
       // Create missing payment schedule detail
-      paymentScheduleDetailList.clear();
       paymentScheduleDetail = 
OBProvider.getInstance().get(FIN_PaymentScheduleDetail.class);
       paymentScheduleDetail.setOrganization(order.getOrganization());
       paymentScheduleDetail.setOrderPaymentSchedule(paymentSchedule);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to