details: https://code.openbravo.com/erp/devel/pi/rev/03bb4bfa60a1 changeset: 30058:03bb4bfa60a1 user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Mon Sep 12 10:24:52 2016 +0200 summary: Related to issue 33831: Duplicate getPaymentDetailWriteOffAndAmount method
Duplicate getPaymentDetailWriteOffAndAmount method using List<String> as parameter instead of List<FIN_PaymentDetail>, in order to improve performance. diffstat: src/org/openbravo/erpCommon/ad_forms/AcctServer.java | 39 +++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) diffs (63 lines): diff -r 2bfe9822cba8 -r 03bb4bfa60a1 src/org/openbravo/erpCommon/ad_forms/AcctServer.java --- a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java Fri Sep 09 18:12:39 2016 +0000 +++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java Mon Sep 12 10:24:52 2016 +0200 @@ -2911,7 +2911,9 @@ * Returns the writeoff and the amount of a Payment Detail. In case the related Payment Schedule * Detail was generated for compensate the difference between an Order and a related Invoice, it * merges it's amount with the next Payment Schedule Detail. Issue 19567: - * https://issues.openbravo.com/view.php?id=19567 + * https://issues.openbravo.com/view.php?id=19567. Use + * {@link #getPaymentDetailIdWriteOffAndAmount(List, FIN_PaymentSchedule, FIN_PaymentSchedule, FIN_PaymentSchedule, int)} + * instead * * @param paymentDetails * List of payment Details @@ -2924,6 +2926,7 @@ * @param currentPaymentDetailIndex * Index */ + @Deprecated public HashMap<String, BigDecimal> getPaymentDetailWriteOffAndAmount( List<FIN_PaymentDetail> paymentDetails, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, FIN_PaymentSchedule pso, int currentPaymentDetailIndex) { @@ -2935,6 +2938,40 @@ * Returns the writeoff and the amount of a Payment Detail. In case the related Payment Schedule * Detail was generated for compensate the difference between an Order and a related Invoice, it * merges it's amount with the next Payment Schedule Detail. Issue 19567: + * https://issues.openbravo.com/view.php?id=19567 + * + * @param paymentDetailsIds + * List of payment Details Ids + * @param ps + * Previous Payment Schedule + * @param psi + * Invoice Payment Schedule of actual Payment Detail + * @param pso + * Order Payment Schedule of actual Payment Detail + * @param currentPaymentDetailIndex + * Index + */ + public HashMap<String, BigDecimal> getPaymentDetailIdWriteOffAndAmount( + List<String> paymentDetailsIds, FIN_PaymentSchedule ps, FIN_PaymentSchedule psi, + FIN_PaymentSchedule pso, int currentPaymentDetailIndex) { + FIN_PaymentDetail paymentDetail = OBDal.getInstance().get(FIN_PaymentDetail.class, + paymentDetailsIds.get(currentPaymentDetailIndex)); + String paymentDetailNextId = null; + String paymentDetailPreviousId = null; + if (currentPaymentDetailIndex < paymentDetailsIds.size() - 1) { + paymentDetailNextId = paymentDetailsIds.get(currentPaymentDetailIndex + 1); + } + if (currentPaymentDetailIndex > 0) { + paymentDetailPreviousId = paymentDetailsIds.get(currentPaymentDetailIndex - 1); + } + return getPaymentDetailWriteOffAndAmount(paymentDetail, paymentDetailNextId, + paymentDetailPreviousId, ps, psi, pso, null); + } + + /** + * Returns the writeoff and the amount of a Payment Detail. In case the related Payment Schedule + * Detail was generated for compensate the difference between an Order and a related Invoice, it + * merges it's amount with the next Payment Schedule Detail. Issue 19567: * https://issues.openbravo.com/view.php?id=19567 <br /> * It does exactly the same as the * {@link #getPaymentDetailWriteOffAndAmount(List, FIN_PaymentSchedule, FIN_PaymentSchedule, FIN_PaymentSchedule, int)} ------------------------------------------------------------------------------ _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits