details: https://code.openbravo.com/erp/devel/pi/rev/9a1c5f99b2d1 changeset: 34226:9a1c5f99b2d1 user: Atul Gaware <atul.gaware <at> openbravo.com> date: Fri Jun 22 01:56:11 2018 +0530 summary: Fixes Issue 0038657: Wrong cashvat posting when several orders are partially invoiced in same invoice and invoice is fully paid
Along with BigDecimal.ONE value check for merged payment detail, NotEmpty check for MergedPaymentDetailId is done while posting Payment, Financial Account Transaction and Reconciliation diffstat: src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java | 3 ++- src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java | 3 ++- src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diffs (39 lines): diff -r 5756317d93ad -r 9a1c5f99b2d1 src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java --- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Thu Jun 21 18:48:23 2018 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Fri Jun 22 01:56:11 2018 +0530 @@ -168,7 +168,8 @@ psId = psi != null ? psi.getId() : null; continue; } else { - if (amountAndWriteOff.get("merged").compareTo(BigDecimal.ONE) == 0) { + if (amountAndWriteOff.get("merged").compareTo(BigDecimal.ONE) == 0 + && StringUtils.isNotEmpty(data[i].getField("MergedPaymentDetailId"))) { // keeps only the current line while merging the amounts data[i - 1] = null; totalAmount = totalAmount.add(amount); diff -r 5756317d93ad -r 9a1c5f99b2d1 src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java --- a/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java Thu Jun 21 18:48:23 2018 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java Fri Jun 22 01:56:11 2018 +0530 @@ -140,7 +140,8 @@ psId = psi != null ? psi.getId() : null; continue; } else { - if (amountAndWriteOff.get("merged").compareTo(BigDecimal.ONE) == 0) { + if (amountAndWriteOff.get("merged").compareTo(BigDecimal.ONE) == 0 + && StringUtils.isNotEmpty(data[i].getField("MergedPaymentDetailId"))) { // keeps only the current line while merging the amounts data[i - 1] = null; totalAmount = totalAmount.add(amount); diff -r 5756317d93ad -r 9a1c5f99b2d1 src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java --- a/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java Thu Jun 21 18:48:23 2018 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java Fri Jun 22 01:56:11 2018 +0530 @@ -214,7 +214,8 @@ ps = psi; continue; } else { - if (amountAndWriteOff.get("merged").compareTo(BigDecimal.ONE) == 0) { + if (amountAndWriteOff.get("merged").compareTo(BigDecimal.ONE) == 0 + && StringUtils.isNotEmpty(data[i].getField("MergedPaymentDetailId"))) { // keeps only the current line while merging the amounts data[i - 1] = null; totalAmount = totalAmount.add(amount); ------------------------------------------------------------------------------ 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