details: https://code.openbravo.com/erp/devel/pi/rev/6ce7922086d7 changeset: 34831:6ce7922086d7 user: Sandra Huguet <sandra.huguet <at> openbravo.com> date: Wed Oct 03 17:18:12 2018 +0200 summary: related to issue 39318 set a properly name to variable and function
diffstat: modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diffs (33 lines): diff -r 5170d62ca42f -r 6ce7922086d7 modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java --- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java Wed Oct 03 10:21:31 2018 +0200 +++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java Wed Oct 03 17:18:12 2018 +0200 @@ -132,24 +132,24 @@ private void updateDoubtfulDebtScheduleDetails(FIN_PaymentSchedule salesInvoicePaymentSchedule, BigDecimal debtAmount) { - BigDecimal debtAmountAux = debtAmount; + BigDecimal pendingDebtAmount = debtAmount; for (FIN_PaymentScheduleDetail psd : salesInvoicePaymentSchedule .getFINPaymentScheduleDetailInvoicePaymentScheduleList()) { if (psd.getPaymentDetails() == null) { // Pending amount should be greater or equals than the doubtful debt amount - if (psd.getAmount().compareTo(debtAmountAux) >= 0) { - psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().add(debtAmountAux)); + if (psd.getAmount().compareTo(pendingDebtAmount) >= 0) { + psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().add(pendingDebtAmount)); OBDal.getInstance().save(psd); } else { psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().add(psd.getAmount())); - debtAmountAux = getDifferenceOrZero(debtAmountAux, psd); + pendingDebtAmount = getDifferenceOfAmountsOrZero(pendingDebtAmount, psd); OBDal.getInstance().save(psd); } } } } - private BigDecimal getDifferenceOrZero(BigDecimal debtAmountAux, FIN_PaymentScheduleDetail psd) { + private BigDecimal getDifferenceOfAmountsOrZero(BigDecimal debtAmountAux, FIN_PaymentScheduleDetail psd) { return debtAmountAux.subtract(psd.getAmount()).compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : debtAmountAux.subtract(psd.getAmount()); } _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits