details: https://code.openbravo.com/erp/devel/pi/rev/79530e9c288f changeset: 33214:79530e9c288f user: Nono Carballo <nonofce <at> gmail.com> date: Mon Jan 22 12:12:44 2018 +0100 summary: Fixes issue 34840: Movement Qty column info not updated once a product with stock is selected in Goods Shipment if Alt UOM Preference is enable.
Operative Quantity field isautomatically populated if the selected product do not have a default Alternative UOM configured and the product has quantity on hand. details: https://code.openbravo.com/erp/devel/pi/rev/85c01f98ce20 changeset: 33215:85c01f98ce20 user: David Miguelez <david.miguelez <at> openbravo.com> date: Mon Jan 22 12:30:04 2018 +0100 summary: Related to issue 34840: Code Review changes * Added final modifier to product object again * Removed unused methods * When setting the AUM, set also the Quantity expresed in AUM and for that, convert the original quantity to the AUM equivalent. details: https://code.openbravo.com/erp/devel/pi/rev/208045acad06 changeset: 33216:208045acad06 user: Nono Carballo <nonofce <at> gmail.com> date: Mon Jan 22 12:49:49 2018 +0100 summary: Fixes issue 34841: RTV shipment (Pick/Edit Lines) not properly working if Returned UOM is changed from Unit to Pallet. When changing Ship Qty and then returned Uom, just pending field is updated, showing the pending quantity expressed in returned Uom. Same behaviour in Return Material Receipt window. details: https://code.openbravo.com/erp/devel/pi/rev/889d74074bf0 changeset: 33217:889d74074bf0 user: David Miguelez <david.miguelez <at> openbravo.com> date: Wed Jan 24 16:21:27 2018 +0100 summary: Related to Issue 34840. Change done to reload the qty in stock for a product instead of 0 after the line has been saved diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js | 12 +++--- src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java | 19 +++++++-- 2 files changed, 21 insertions(+), 10 deletions(-) diffs (99 lines): diff -r b39a4d259c57 -r 889d74074bf0 modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js Wed Jan 24 13:09:52 2018 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js Wed Jan 24 16:21:27 2018 +0100 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2011-2016 Openbravo SLU + * All portions are Copyright (C) 2011-2017 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -242,8 +242,6 @@ record = grid.getSelectedRecord(); } if (item.pickList.getSelection()[0].id !== item.getValue()) { - grid.setEditValue(item.grid.getEditRow(), 'movementQuantity', record.pendingQtyInAUM); - record.movementQuantity = record.pendingQtyInAUM; var pending = record.pending; grid.setEditValue(item.grid.getEditRow(), 'pending', record.pendingQtyInAUM); record.pending = record.pendingQtyInAUM; @@ -252,7 +250,7 @@ grid.setEditValue(item.grid.getEditRow(), 'availableQty', record.availableQtyInAUM); record.availableQty = record.availableQtyInAUM; record.availableQtyInAUM = availableQty; - grid.setEditValue(item.grid.getEditRow(), 'returnedUOM', record.pendingQtyInAUM); + grid.setEditValue(item.grid.getEditRow(), 'returnedUOM', item.pickList.getSelection()[0].id); record.returnedUOM = item.pickList.getSelection()[0].id; } }; @@ -262,13 +260,15 @@ */ OB.RM.RMReceiptQtyValuesChange = function (item, view, form, grid) { var record = grid.getSelectionObject().lastSelectionItem; + if (typeof record === 'undefined') { + record = grid.getSelectedRecord(); + } if (item.pickList.getSelection()[0].id !== item.getValue()) { - grid.setEditValue(item.grid.getEditRow(), 'receiving', record.pendingQtyInAUM); - record.receiving = record.pendingQtyInAUM; var pending = record.pending; grid.setEditValue(item.grid.getEditRow(), 'pending', record.pendingQtyInAUM); record.pending = record.pendingQtyInAUM; record.pendingQtyInAUM = pending; + grid.setEditValue(item.grid.getEditRow(), 'returnedUOM', item.pickList.getSelection()[0].id); record.returnedUOM = item.pickList.getSelection()[0].id; } }; \ No newline at end of file diff -r b39a4d259c57 -r 889d74074bf0 src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java --- a/src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java Wed Jan 24 13:09:52 2018 +0100 +++ b/src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java Wed Jan 24 16:21:27 2018 +0100 @@ -105,17 +105,18 @@ // However, if the delivery-note doesn't come from an order, it modifies // the quantity field with the quantity in the warehouse. - boolean isUomManagementEnabled = UOMUtil.isUomManagementEnabled(); + BigDecimal qty = BigDecimal.ZERO; String fromOrder = SLInOutLineProductData.fromOrder(this, strmInoutlineId); if (fromOrder.equals("0")) { BigDecimal qtyOrder = StringUtils.isNotEmpty(strQtyOrder) ? new BigDecimal(strQtyOrder) : null; - BigDecimal qty = StringUtils.isNotEmpty(strQty) ? new BigDecimal(strQty) : null; + qty = StringUtils.isNotEmpty(strQty) ? new BigDecimal(strQty) : null; info.addResult("inpquantityorder", qtyOrder); info.addResult("inpmovementqty", qty); } - if (isUomManagementEnabled && "".equals(strUOMProduct)) { + boolean isUomManagementEnabled = UOMUtil.isUomManagementEnabled(); + if (isUomManagementEnabled && productIsNotUsingSecondaryUom(strUOMProduct)) { // Set AUM based on default try { OBContext.setAdminMode(); @@ -123,8 +124,10 @@ info.vars.getStringParameter("inpmInoutId")); String finalAUM = UOMUtil.getDefaultAUMForDocument(strMProductID, mInOut.getDocumentType() .getId()); - if (finalAUM != null) { + if (isValidUom(finalAUM)) { info.addResult("inpcAum", finalAUM); + qty = StringUtils.isNotEmpty(strQty) ? new BigDecimal(strQty) : null; + info.addResult("inpaumqty", UOMUtil.getConvertedAumQty(strMProductID, qty, finalAUM)); } } finally { OBContext.restorePreviousMode(); @@ -169,4 +172,12 @@ info.addResult("inpcUomId", info.vars.getStringParameter("inpmProductId_UOM")); } + + private boolean isValidUom(final String finalAUM) { + return finalAUM != null; + } + + private boolean productIsNotUsingSecondaryUom(final String strUOMProduct) { + return "".equals(strUOMProduct); + } } ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits