Related to issue 26674
authorSandra Huguet <sandra.huguet@openbravo.com>
Mon, 26 May 2014 10:42:33 +0200
changeset 23507 9a7fa5b162f7
parent 23506 becefb2fba2b
child 23508 c6129853e0cd
Related to issue 26674
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Fri May 23 11:46:00 2014 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Mon May 26 10:42:33 2014 +0200
@@ -182,6 +182,9 @@
             paymentRunPayment.getPayment().setPosted("N");
             try {
               for (FIN_PaymentDetail pd : payment.getFINPaymentDetailList()) {
+                if (pd.getGLItem() != null) {
+                  continue;
+                }
                 for (FIN_PaymentScheduleDetail psd : pd.getFINPaymentScheduleDetailList()) {
                   if (psd.isInvoicePaid()
                       && FIN_Utility.isAutomaticDepositWithdrawn(paymentRunPayment.getPayment())
@@ -208,6 +211,9 @@
           try {
             OBContext.setAdminMode(true);
             for (FIN_PaymentDetail pd : payment.getFINPaymentDetailList()) {
+              if (pd.getGLItem() != null) {
+                continue;
+              }
               for (FIN_PaymentScheduleDetail psd : pd.getFINPaymentScheduleDetailList()) {
                 if (psd.isInvoicePaid()) {
                   updatePaymentAmounts(paymentRunPayment.getPayment());