details:   https://code.openbravo.com/erp/devel/pi/rev/2d5e6e678e93
changeset: 16770:2d5e6e678e93
user:      Sandra Huguet <sandra.huguet <at> openbravo.com>
date:      Mon May 21 13:53:12 2012 +0200
summary:   Fixed bug 19427 Change behavior in multiple Payment Plan lines and 
negative values
Change behavior in multiple Payment Plan lines and negative values
in Add Payment process.

details:   https://code.openbravo.com/erp/devel/pi/rev/a44a29d2a0c0
changeset: 16771:a44a29d2a0c0
user:      Mikel Irurita <mikel.irurita <at> openbravo.com>
date:      Thu Jun 07 13:17:39 2012 +0200
summary:   Related to issue 19427: missing flow. Fixed issue 20041.

diffstat:

 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
 |  20 ++++++++--
 1 files changed, 16 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r b6e90bb4d2a2 -r a44a29d2a0c0 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
--- 
a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
    Wed Jun 06 16:56:58 2012 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
    Thu Jun 07 13:17:39 2012 +0200
@@ -496,8 +496,14 @@
   } else if (!chk.length) {
     scheduledPaymentDetailId = frm.inpRecordId0.value;
     outstandingAmount = frm.elements["inpRecordAmt" + 
scheduledPaymentDetailId].value;
-    if (compare(outstandingAmount, '>', amount)) {
-      outstandingAmount = amount;
+    if (compare(outstandingAmount, '<', 0) && compare(amount, '<', 0)) {
+      if (compare(abs(outstandingAmount), '>', abs(amount))) {
+        outstandingAmount = amount;
+      }
+    } else {
+      if (compare(outstandingAmount, '>', amount)) {
+        outstandingAmount = amount;
+      }
     }
     frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value = 
outstandingAmount;
     if (!chk.checked) {
@@ -509,8 +515,14 @@
     for (i = 0; i < total; i++) {
       scheduledPaymentDetailId = frm.elements["inpRecordId" + i].value;
       outstandingAmount = frm.elements["inpRecordAmt" + 
scheduledPaymentDetailId].value;
-      if (compare(outstandingAmount, '>', amount)) {
-        outstandingAmount = amount;
+      if (compare(outstandingAmount, '<', 0) && compare(amount, '<', 0)) {
+        if (compare(abs(outstandingAmount), '>', abs(amount))) {
+          outstandingAmount = amount;
+        }
+      } else {
+        if (compare(outstandingAmount, '>', amount)) {
+          outstandingAmount = amount;
+        }
       }
       if (compare(amount, '==', 0)) {
         frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value = "";

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to