Author: sichen
Date: Fri Aug 4 12:33:23 2006
New Revision: 428853
URL: http://svn.apache.org/viewvc?rev=428853&view=rev
Log:
More comments about how standard cost services and the decompose inventory item
service costing work
Modified:
incubator/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
incubator/ofbiz/trunk/applications/product/servicedef/services_cost.xml
Modified:
incubator/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml?rev=428853&r1=428852&r2=428853&view=diff
==============================================================================
---
incubator/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
(original)
+++
incubator/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
Fri Aug 4 12:33:23 2006
@@ -195,6 +195,7 @@
<description>
Create a decompose work effort, issue the inventory item (or part
of it), and put in warehouse its components.
It is intended to be called when a marketing package is received
into warehouse (e.g. from a return).
+ The components will be returned to inventory at ((Marketing
Package Actual Inventory Unit Cost) / (Marketing Package Standard Cost)) *
(Component Standard Cost)
</description>
<attribute name="inventoryItemId" type="String" mode="IN"
optional="false"/>
<attribute name="quantity" type="Double" mode="IN" optional="true"/>
Modified:
incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=428853&r1=428852&r2=428853&view=diff
==============================================================================
---
incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
(original)
+++
incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Fri Aug 4 12:33:23 2006
@@ -2348,7 +2348,8 @@
if (issuedQuantity.doubleValue() == 0) {
return ServiceUtil.returnError("Error decomposing inventory
item: no marketing packages found in inventory item [" +
inventoryItem.getString("inventoryItemId") + "].");
}
- // get the package's unit cost
+ // get the package's unit cost to compute a cost coefficient ratio
which is the marketing package's actual unit cost divided by its standard cost
+ // this ratio will be used to determine the cost of the marketing
package components when they are returned to inventory
serviceContext.clear();
serviceContext = UtilMisc.toMap("productId",
inventoryItem.getString("productId"),
"currencyUomId",
inventoryItem.getString("currencyUomId"),
@@ -2378,7 +2379,7 @@
Iterator componentsIt = components.iterator();
while (componentsIt.hasNext()) {
Map component = (Map)componentsIt.next();
- // get the component's unit cost
+ // get the component's standard cost
serviceContext.clear();
serviceContext = UtilMisc.toMap("productId",
((GenericValue)component.get("product")).getString("productId"),
"currencyUomId",
inventoryItem.getString("currencyUomId"),
@@ -2386,6 +2387,8 @@
"userLogin", userLogin);
resultService = dispatcher.runSync("getProductCost",
serviceContext);
Double componentCost =
(Double)resultService.get("productCost");
+
+ // return the component to inventory at its standard cost
multiplied by the cost coefficient from above
Double componentInventoryItemCost = new
Double(costCoefficient.doubleValue() * componentCost.doubleValue());
serviceContext.clear();
serviceContext = UtilMisc.toMap("productId",
((GenericValue)component.get("product")).getString("productId"),
Modified:
incubator/ofbiz/trunk/applications/product/servicedef/services_cost.xml
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/servicedef/services_cost.xml?rev=428853&r1=428852&r2=428853&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/product/servicedef/services_cost.xml
(original)
+++ incubator/ofbiz/trunk/applications/product/servicedef/services_cost.xml Fri
Aug 4 12:33:23 2006
@@ -73,7 +73,7 @@
</service>
<service name="calculateProductCosts" engine="simple" auth="true"
location="org/ofbiz/product/cost/CostServices.xml"
invoke="calculateProductCosts">
- <description>Calculates the product's costs</description>
+ <description>Calculates the product's costs. If the product does not
cost component defined, will use the BOM to calculate the cost.</description>
<attribute mode="IN" name="productId" optional="false" type="String"/>
<attribute mode="IN" name="currencyUomId" optional="false"
type="String"/>
<attribute mode="IN" name="costComponentTypePrefix" optional="false"
type="String"/>