You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2013/10/18 18:50:33 UTC
svn commit: r1533554 - in /ofbiz/branches/release12.04: ./
applications/manufacturing/servicedef/services_production_run.xml
applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Author: jleroux
Date: Fri Oct 18 16:50:32 2013
New Revision: 1533554
URL: http://svn.apache.org/r1533554
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/release12.04/ (props changed)
ofbiz/branches/release12.04/applications/manufacturing/servicedef/services_production_run.xml
ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1518336
Modified: ofbiz/branches/release12.04/applications/manufacturing/servicedef/services_production_run.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/manufacturing/servicedef/services_production_run.xml?rev=1533554&r1=1533553&r2=1533554&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/manufacturing/servicedef/services_production_run.xml (original)
+++ ofbiz/branches/release12.04/applications/manufacturing/servicedef/services_production_run.xml Fri Oct 18 16:50:32 2013
@@ -230,6 +230,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"/>
@@ -243,6 +244,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/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1533554&r1=1533553&r2=1533554&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Fri Oct 18 16:50:32 2013
@@ -1547,6 +1547,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");
@@ -1668,6 +1669,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");
@@ -1702,6 +1704,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);
}
@@ -1836,6 +1839,7 @@ public class ProductionRunServices {
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
@@ -1864,7 +1868,8 @@ public class ProductionRunServices {
serviceContext.put("unitCost", unitCost);
serviceContext.put("currencyUomId", currencyUomId);
}
- serviceContext.put("lotId", lotId);
+ serviceContext.put("lotId", lotId);
+ serviceContext.put("uomId", uomId);
serviceContext.put("userLogin", userLogin);
serviceContext.put("isReturned", isReturned);
Map<String, Object> resultService = dispatcher.runSync("createInventoryItem", serviceContext);
@@ -1904,6 +1909,7 @@ public class ProductionRunServices {
serviceContext.put("currencyUomId", currencyUomId);
}
serviceContext.put("lotId", lotId);
+ serviceContext.put("uomId",uomId);
serviceContext.put("userLogin", userLogin);
serviceContext.put("isReturned", isReturned);
Map<String, Object> resultService = dispatcher.runSync("createInventoryItem", serviceContext);
@@ -1945,6 +1951,7 @@ public class ProductionRunServices {
// Optional input fields
BigDecimal quantity = (BigDecimal)context.get("quantity");
String lotId = (String)context.get("lotId");
+ String uomId = (String) context.get("quantityUomId");
Locale locale = (Locale) context.get("locale");
if (quantity == null || quantity.compareTo(ZERO) == 0) {
return ServiceUtil.returnSuccess();
@@ -1985,7 +1992,7 @@ public class ProductionRunServices {
try {
Map<String, Object> inventoryResult = dispatcher.runSync("productionRunTaskProduce",
UtilMisc.<String, Object>toMap("workEffortId", productionRunTaskId,
- "productId", productId, "quantity", quantity, "lotId", lotId, "isReturned", "Y",
+ "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));