Fixed bug 27392 Totals Amounts with incorrect values when filtering
authorSandra Huguet <sandra.huguet@openbravo.com>
Wed, 20 Aug 2014 14:55:02 +0200
changeset 24288 69c68601b870
parent 24287 ac87554c1c5d
child 24289 12574ebf963a
child 24292 47d6ad291870
Fixed bug 27392 Totals Amounts with incorrect values when filtering
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 Aug 21 02:33:20 2014 +0000
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Wed Aug 20 14:55:02 2014 +0200
@@ -420,12 +420,12 @@
 OB.APRM.AddPayment.updateInvOrderTotal = function (form, grid) {
   var totalAmt = BigDecimal.prototype.ZERO,
       amountField = grid.getFieldByColumnName('amount'),
-      selectedRecords = grid.getSelectedRecords(),
+      selectedRecords = grid.selectedIds,
       invOrdTotalItem = form.getItem('amount_inv_ords'),
       amt, i, bdAmt;
 
   for (i = 0; i < selectedRecords.length; i++) {
-    amt = grid.getEditedCell(grid.getRecordIndex(selectedRecords[i]), amountField);
+    amt = grid.getEditedCell(grid.getRecordIndex(grid.data.localData.find('id', grid.selectedIds[i])), amountField);
     bdAmt = new BigDecimal(String(amt));
     totalAmt = totalAmt.add(bdAmt);
   }