Fixed bug 21587 Show error message when the amount is greater than the payment
authorSandra Huguet <sandra.huguet@openbravo.com>
Tue, 11 Sep 2012 17:45:40 +0200
changeset 17933 2f153dab63f0
parent 17932 f7ba1706a864
child 17934 c010adeccdd2
Fixed bug 21587 Show error message when the amount is greater than the payment
In Add payment from invoice and add payment from transaction when the amount
is greater than the payment using multicurrency and process show the error message.
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.html
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.html	Wed Sep 12 17:50:05 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.html	Tue Sep 11 17:45:40 2012 +0200
@@ -56,6 +56,17 @@
 function validate(action) {
   var frm = document.frmMain;
   if (action=='openprocess') {
+	if (isMulticurrencyTxn()) {
+	  if (frm.inpActualConverted.value==null || frm.inpActualConverted.value=="") {
+	   setWindowElementFocus(frm.inpActualConverted);
+	   showJSMessage(7);
+	   return false;
+	  } else if (frm.inpExchangeRate.value==null || frm.inpExchangeRate.value=="") {
+	   setWindowElementFocus(frm.inpExchangeRate);
+	   showJSMessage(7);
+	   return false;
+	   }
+	 }
     if (frm.inpDocNumber.value==null || frm.inpDocNumber.value=="") {
       setWindowElementFocus(frm.inpDocNumber);
       showJSMessage(7);
@@ -84,16 +95,6 @@
       setWindowElementFocus(frm.inpPaymentDate);
       showJSMessage(7);
       return false;
-    } else if (isMulticurrencyTxn()) {
-      if (frm.inpActualConverted.value==null || frm.inpActualConverted.value=="") {
-        setWindowElementFocus(frm.inpActualConverted);
-        showJSMessage(7);
-        return false;
-      } else if (frm.inpExchangeRate.value==null || frm.inpExchangeRate.value=="") {
-        setWindowElementFocus(frm.inpExchangeRate);
-        showJSMessage(7);
-        return false;
-      }
     } else {
       var diffAction = frm.inpDifferenceAction,
           i,
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html	Wed Sep 12 17:50:05 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html	Tue Sep 11 17:45:40 2012 +0200
@@ -369,6 +369,17 @@
 function validate(action) {
   var frm = document.frmMain;
   if (action === 'openprocess') {
+	if (isMulticurrencyTxn()) {
+	  if (frm.inpActualConverted.value==null || frm.inpActualConverted.value=="") {
+	    setWindowElementFocus(frm.inpActualConverted);
+	    showJSMessage(7);
+	    return false;
+	  } else if (frm.inpExchangeRate.value==null || frm.inpExchangeRate.value=="") {
+	    setWindowElementFocus(frm.inpExchangeRate);
+	    showJSMessage(7);
+	     return false;
+	  }
+	}
     if (frm.inpActualPayment.value === null || frm.inpActualPayment.value === '') {
       setWindowElementFocus(frm.inpActualPayment);
       showJSMessage(7);
@@ -389,17 +400,7 @@
       setWindowElementFocus(frm.inpPaymentDate);
       showJSMessage(7);
       return false;
-    } else if (isMulticurrencyTxn()) {
-      if (frm.inpActualConverted.value==null || frm.inpActualConverted.value=="") {
-        setWindowElementFocus(frm.inpActualConverted);
-        showJSMessage(7);
-        return false;
-      } else if (frm.inpExchangeRate.value==null || frm.inpExchangeRate.value=="") {
-        setWindowElementFocus(frm.inpExchangeRate);
-        showJSMessage(7);
-        return false;
-      }
-    } else {
+    }  else {
       var diffAction = frm.inpDifferenceAction,
           selectedAction = null, i, actionSelected = false;
       for (i = 0; i < diffAction.length; i++) {