Fixes issue 30095: BP current balance not properly updated
authorAlvaro Ferraz <alvaro.ferraz@openbravo.com>
Thu, 04 Jun 2015 17:47:14 +0200
changeset 26925 195dff675189
parent 26924 10264719816a
child 26927 420fd55d666d
Fixes issue 30095: BP current balance not properly updated

Change condition in FIN_PaymentProcess to take into account when the paymend does not have order nor invoice related (when it only has a g/l item, when we are genereting credit or when we are refunding amount).
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	Tue Jun 09 08:07:43 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Thu Jun 04 17:47:14 2015 +0200
@@ -394,6 +394,8 @@
                 // Payment = 0 when the payment is generated by a invoice that consume credit
                 if ((invoicePaidAmounts && paymentScheduleDetail.getInvoicePaymentSchedule() != null)
                     || (paymentScheduleDetail.getOrderPaymentSchedule() != null)
+                    || (paymentScheduleDetail.getInvoicePaymentSchedule() == null && paymentScheduleDetail
+                        .getOrderPaymentSchedule() == null)
                     || (payment.getAmount().compareTo(new BigDecimal("0.00")) == 0)) {
                   if (paymentScheduleDetail.getInvoicePaymentSchedule() != null) {
                     // BP SO_CreditUsed