related to issue 29145
authorSandra Huguet <sandra.huguet@openbravo.com>
Fri, 20 Mar 2015 09:32:09 +0100
changeset 26211 601513f5d35e
parent 26210 ddd1f777209c
child 26212 a670497786d1
related to issue 29145
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Thu Mar 12 10:13:51 2015 +0100
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Fri Mar 20 09:32:09 2015 +0100
@@ -1109,8 +1109,7 @@
     view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_CreditWithNegativeAmt'));
     return false;
   }
-
-  if (actualPayment.compareTo(total) > 0 && totalOustandingAmount.compareTo(amountInvOrds.add(totalWriteOffAmount)) > 0) {
+  if (actualPayment.compareTo(total.subtract(creditTotalItem)) > 0 && totalOustandingAmount.compareTo(amountInvOrds.add(totalWriteOffAmount)) > 0) {
     // Not all the payment amount has been allocated
     view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_JSNOTALLAMOUTALLOCATED'));
     return false;