Author: jleroux
Date: Fri Oct 18 16:50:34 2013 New Revision: 1533555 URL: http://svn.apache.org/r1533555 Log: "Applied fix from trunk for revision: 1518336" ------------------------------------------------------------------------ r1518336 | jleroux | 2013-08-28 21:34:02 +0200 (mer. 28 août 2013) | 5 lignes A patch from Pierre Smits for "ProductionRunServices doens't set UoM of goods in inventoryItems" https://issues.apache.org/jira/browse/OFBIZ-5300 When releasing a good to inventory from a production run (both declare and return material) the uom of the good returned isn't set in the inventory item. ------------------------------------------------------------------------ Modified: ofbiz/branches/release11.04/ (props changed) ofbiz/branches/release11.04/applications/manufacturing/servicedef/services_production_run.xml ofbiz/branches/release11.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Propchange: ofbiz/branches/release11.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1518336 Modified: ofbiz/branches/release11.04/applications/manufacturing/servicedef/services_production_run.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/manufacturing/servicedef/services_production_run.xml?rev=1533555&r1=1533554&r2=1533555&view=diff ============================================================================== --- ofbiz/branches/release11.04/applications/manufacturing/servicedef/services_production_run.xml (original) +++ ofbiz/branches/release11.04/applications/manufacturing/servicedef/services_production_run.xml Fri Oct 18 16:50:34 2013 @@ -228,6 +228,7 @@ under the License. <attribute name="workEffortId" type="String" mode="IN" optional="false"/> <attribute name="inventoryItemIds" type="List" mode="OUT" optional="false"/> <attribute name="quantity" type="BigDecimal" mode="INOUT" optional="true"/> + <attribute name="quantityUomId" type="String" mode="IN" optional="true"/> <attribute name="inventoryItemTypeId" type="String" mode="IN" optional="true"/> <attribute name="lotId" type="String" mode="IN" optional="true"/> <attribute name="createLotIfNeeded" type="Boolean" mode="IN" optional="true"/> @@ -241,6 +242,7 @@ under the License. <attribute name="workEffortId" type="String" mode="IN" optional="false"/> <attribute name="inventoryItemIds" type="List" mode="OUT" optional="false"/> <attribute name="quantity" type="BigDecimal" mode="INOUT" optional="false"/> + <attribute name="quantityUomId" type="String" mode="IN" optional="true"/> <attribute name="inventoryItemTypeId" type="String" mode="IN" optional="true"/> <attribute name="lotId" type="String" mode="IN" optional="true"/> <attribute name="createLotIfNeeded" type="Boolean" mode="IN" optional="true"/> Modified: ofbiz/branches/release11.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1533555&r1=1533554&r2=1533555&view=diff ============================================================================== --- ofbiz/branches/release11.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original) +++ ofbiz/branches/release11.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Fri Oct 18 16:50:34 2013 @@ -1578,6 +1578,7 @@ public class ProductionRunServices { BigDecimal quantity = (BigDecimal) context.get("quantity"); String inventoryItemTypeId = (String)context.get("inventoryItemTypeId"); String lotId = (String)context.get("lotId"); + String uomId = (String) context.get("quantityUomId"); Boolean createLotIfNeeded = (Boolean)context.get("createLotIfNeeded"); Boolean autoCreateLot = (Boolean)context.get("autoCreateLot"); @@ -1699,6 +1700,7 @@ public class ProductionRunServices { } //serviceContext.put("serialNumber", productionRunId); serviceContext.put("lotId", lotId); + serviceContext.put("uomId",uomId); serviceContext.put("userLogin", userLogin); Map<String, Object> resultService = dispatcher.runSync("createInventoryItem", serviceContext); String inventoryItemId = (String)resultService.get("inventoryItemId"); @@ -1733,6 +1735,7 @@ public class ProductionRunServices { serviceContext.put("datetimeManufactured", UtilDateTime.nowTimestamp()); serviceContext.put("comments", "Created by production run " + productionRunId); serviceContext.put("lotId", lotId); + serviceContext.put("uomId",uomId); if (unitCost.compareTo(ZERO) != 0) { serviceContext.put("unitCost", unitCost); } @@ -1866,6 +1869,9 @@ public class ProductionRunServices { String currencyUomId = (String)context.get("currencyUomId"); BigDecimal unitCost = (BigDecimal)context.get("unitCost"); String inventoryItemTypeId = (String)context.get("inventoryItemTypeId"); + String lotId = (String)context.get("lotId"); + String uomId = (String) context.get("quantityUomId"); + String isReturned = (String)context.get("isReturned"); // The default is non-serialized inventory item if (UtilValidate.isEmpty(inventoryItemTypeId)) { @@ -1893,6 +1899,8 @@ public class ProductionRunServices { serviceContext.put("unitCost", unitCost); serviceContext.put("currencyUomId", currencyUomId); } + serviceContext.put("lotId", lotId); + serviceContext.put("uomId", uomId); serviceContext.put("userLogin", userLogin); Map<String, Object> resultService = dispatcher.runSync("createInventoryItem", serviceContext); String inventoryItemId = (String)resultService.get("inventoryItemId"); @@ -1930,6 +1938,7 @@ public class ProductionRunServices { serviceContext.put("unitCost", unitCost); serviceContext.put("currencyUomId", currencyUomId); } + serviceContext.put("uomId",uomId); serviceContext.put("userLogin", userLogin); Map<String, Object> resultService = dispatcher.runSync("createInventoryItem", serviceContext); String inventoryItemId = (String)resultService.get("inventoryItemId"); @@ -1969,6 +1978,7 @@ public class ProductionRunServices { String productId = (String)context.get("productId"); // Optional input fields BigDecimal quantity = (BigDecimal)context.get("quantity"); + String uomId = (String) context.get("quantityUomId"); Locale locale = (Locale) context.get("locale"); if (quantity == null || quantity.compareTo(ZERO) == 0) { return ServiceUtil.returnSuccess(); @@ -2013,7 +2023,7 @@ public class ProductionRunServices { try { Map<String, Object> inventoryResult = dispatcher.runSync("productionRunTaskProduce", UtilMisc.<String, Object>toMap("workEffortId", productionRunTaskId, - "productId", productId, "quantity", quantity, + "productId", productId, "quantity", quantity, "lotId", lotId, "uomId", uomId, "isReturned", "Y", "inventoryItemTypeId", inventoryItemTypeId, "userLogin", userLogin)); if (ServiceUtil.isError(inventoryResult)) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunTaskProduceError" + ServiceUtil.getErrorMessage(inventoryResult), locale)); |
Free forum by Nabble | Edit this page |