details:   https://code.openbravo.com/erp/devel/pi/rev/9533b8021a33
changeset: 13431:9533b8021a33
user:      Mikel Irurita <mikel.irurita <at> openbravo.com>
date:      Thu Aug 04 14:12:00 2011 +0200
summary:   Fixes issue 18198: remove GLItem updates actual payment in APFT - 
MUIBS

details:   https://code.openbravo.com/erp/devel/pi/rev/70ff55cea872
changeset: 13432:70ff55cea872
user:      Mikel Irurita <mikel.irurita <at> openbravo.com>
date:      Thu Aug 04 15:31:22 2011 +0200
summary:   Related to issue 18198: remove all GL in APFT not working

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html
 |  10 +++++++---
 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
                               |   6 +++++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diffs (64 lines):

diff -r 380344cd3377 -r 70ff55cea872 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html
      Tue Aug 02 09:23:52 2011 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromTransaction.html
      Thu Aug 04 15:31:22 2011 +0200
@@ -156,6 +156,8 @@
   table.innerHTML = '';
   if (glitemCount === 0) {
     OB.APRM.HasGLItems = false;
+    OB.APRM.APFT_GLItems = [];
+    updateTotal();
     return;
   }
   OB.APRM.HasGLItems = true;
@@ -186,7 +188,7 @@
     }
     cellRemoveButton = row.insertCell(3);
     cellRemoveButton.innerHTML = '<div><button type="button" 
id="buttonRemoveGLItem"'
-        + ' class="ButtonLink_focus" onclick="removeGLItem(' + i + ', ' + 
glitemAmount + ');return false;"'
+        + ' class="ButtonLink_focus" onclick="removeGLItem(' + i + ', ' + 
applyFormatOBMaskedToJS(glitemAmount) + ');return false;"'
         + ' onfocus="buttonEvent(\'onfocus\', this); window.status=\'OK\'; 
return true;"'
         + ' onblur="buttonEvent(\'onblur\', this);"'
         + '  onkeyup="buttonEvent(\'onkeyup\', this);"'
@@ -255,7 +257,9 @@
   loadGLItemList();
 }
 function removeGLItem(key, removedAmount) {
-  if (!isTrue('isReceipt')){
+  var isInheritedActualPayment = 
(document.getElementById('paramInheritedActualPayment').value === 'Y'),
+      removedAmount = applyFormatJSToOBMasked(removedAmount);
+  if (!isTrue('isReceipt') && !isInheritedActualPayment) {
     if ( compare(document.frmMain.inpActualPayment.value, '>', removedAmount) 
) {
       document.frmMain.inpActualPayment.value = 
subtract(document.frmMain.inpActualPayment.value, removedAmount);
     } else {
@@ -483,7 +487,7 @@
     return refreshExchangeRate();
   } else {
     // Reset currency
-    changeClass('paramCurrencyId', 'ComboKey dojoValidateValid required ', 
'ComboKeyReadOnly ')
+    changeClass('paramCurrencyId', 'ComboKey dojoValidateValid required ', 
'ComboKeyReadOnly ');
     selectCombo(document.getElementById('paramCurrencyId'), 
document.getElementById('paramFinancialAccountCurrencyId').value);
     document.getElementById('paramExchangeRate').value='1';
     updateConvertedAmounts();
diff -r 380344cd3377 -r 70ff55cea872 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
--- 
a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
    Tue Aug 02 09:23:52 2011 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
    Thu Aug 04 15:31:22 2011 +0200
@@ -87,6 +87,10 @@
                                           globalGroupSeparator, 
globalGroupInterval);
 }
 
+function applyFormatOBMaskedToJS(number) {
+  return OB.Utilities.Number.OBMaskedToJS(number, globalDecSeparator, 
globalGroupSeparator);
+}
+
 
 /**
 * Function to operate with formatted number
@@ -382,7 +386,7 @@
     }
     updateDifference();
     if (OB.APRM.HasGLItems === 'undefined' || !OB.APRM.HasGLItems) {
-      return;
+      //return;
     }
   } else if (!chk.length) {
     scheduledPaymentDetailId = frm.inpRecordId0.value;

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to