You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/09/27 10:49:36 UTC
svn commit: r579947 - in /ofbiz/trunk/applications/manufacturing: config/
script/org/ofbiz/manufacturing/jobshopmgt/ servicedef/
webapp/manufacturing/jobshopmgt/
Author: jacopoc
Date: Thu Sep 27 01:49:35 2007
New Revision: 579947
URL: http://svn.apache.org/viewvc?rev=579947&view=rev
Log:
Iissuance of materials for productions: added ability to specify a secondary location; added flag to return an error message if materials are not available.
Modified:
ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties
ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels_it.properties
ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml
ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
Modified: ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties?rev=579947&r1=579946&r2=579947&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties (original)
+++ ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels.properties Thu Sep 27 01:49:35 2007
@@ -128,6 +128,7 @@
ManufacturingMandatoryWorkEfforts=Mandatory Production Runs
ManufacturingManufacturingRules=Manufacturing Rules
ManufacturingMaterials=Materials
+ManufacturingMaterialsNotAvailable=Materials Not Available in Warehouse
ManufacturingMaterialsRequiredByRunningTask=Materials Required By The Running Task
ManufacturingMrp=MRP
ManufacturingMrpJobLastExecuted=Last Job
Modified: ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels_it.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels_it.properties?rev=579947&r1=579946&r2=579947&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels_it.properties (original)
+++ ofbiz/trunk/applications/manufacturing/config/ManufacturingUiLabels_it.properties Thu Sep 27 01:49:35 2007
@@ -128,6 +128,7 @@
ManufacturingMandatoryWorkEfforts=Cicli Produzione Obbligatori
ManufacturingManufacturingRules=Regole Produzione
ManufacturingMaterials=Materiali
+ManufacturingMaterialsNotAvailable=Materiali Non Disponibili a Magazzino
ManufacturingMrp=MRP
ManufacturingMrpJobLastExecuted=Ultimo Lavoro
ManufacturingMrpJobIsRunning=Un Lavoro MRP \u00e8 in esecuzione
Modified: ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml?rev=579947&r1=579946&r2=579947&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml (original)
+++ ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml Thu Sep 27 01:49:35 2007
@@ -40,6 +40,7 @@
<set-service-fields to-map-name="callSvcMap" service-name="issueProductionRunTaskComponent" map-name="component"/>
<set from-field="reserveOrderEnumId" field="callSvcMap.reserveOrderEnumId"/>
<set field="callSvcMap.description" value="BOM Part"/>
+ <set field="callSvcMap.failIfItemsAreNotAvailable" value="Y"/>
<call-service service-name="issueProductionRunTaskComponent" in-map-name="callSvcMap"/>
</if-not-empty>
</iterate>
@@ -93,10 +94,20 @@
<field-to-list field-name="orderByString" list-name="orderByList"/>
<set from-field="productId" field="lookupFieldMap.productId"/>
<set from-field="workEffort.facilityId" field="lookupFieldMap.facilityId"/>
+ <!-- if locationSeqId is passed, then only the inventory items in the location are considered -->
<if-not-empty field-name="parameters.locationSeqId">
<set from-field="parameters.locationSeqId" field="lookupFieldMap.locationSeqId"/>
</if-not-empty>
- <find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="inventoryItemList" order-by-list-name="orderByList"/>
+ <find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="primaryInventoryItemList" order-by-list-name="orderByList"/>
+ <!-- if secondaryLocationSeqId is also passed, then also the inventory items in the secondary location are considered, after the ones in the main location -->
+ <if-not-empty field-name="parameters.locationSeqId">
+ <if-not-empty field-name="parameters.secondaryLocationSeqId">
+ <set from-field="parameters.secondaryLocationSeqId" field="lookupFieldMap.locationSeqId"/>
+ </if-not-empty>
+ </if-not-empty>
+ <find-by-and entity-name="InventoryItem" map-name="lookupFieldMap" list-name="secondaryInventoryItemList" order-by-list-name="orderByList"/>
+ <set from-field="primaryInventoryItemList" field="inventoryItemList"/>
+ <list-to-list list-name="secondaryInventoryItemList" to-list-name="inventoryItemList"/>
<set from-field="estimatedQuantity" field="parameters.quantityNotIssued"/>
@@ -107,6 +118,11 @@
<!-- if quantityNotIssued is not 0, then pull it from the last non-serialized inventory item found, in the quantityNotIssued field -->
<if-compare field-name="parameters.quantityNotIssued" operator="not-equals" value="0" type="Double">
+ <if-compare field-name="parameters.failIfItemsAreNotAvailable" operator="equals" value="Y" type="String">
+ <add-error><fail-property property="ManufacturingMaterialsNotAvailable" resource="ManufacturingUiLabels"/></add-error>
+ <add-error><fail-message message=" ${productId}: ${parameters.quantityNotIssued}"/></add-error>
+ </if-compare>
+ <check-errors/>
<if-not-empty field-name="lastNonSerInventoryItem">
<!-- create ItemIssuance record -->
<set from-field="parameters.workEffortId" field="issuanceCreateMap.workEffortId"/>
@@ -141,7 +157,7 @@
<call-service service-name="createInventoryItem" in-map-name="createInvItemInMap">
<result-to-field result-name="inventoryItemId" field-name="createInvItemOutMap.inventoryItemId"/>
</call-service>
-
+
<!-- create ItemIssuance record -->
<set field="issuanceCreateMap.workEffortId" from-field="parameters.workEffortId"/>
<set field="issuanceCreateMap.inventoryItemId" from-field="createInvItemOutMap.inventoryItemId"/>
@@ -166,7 +182,6 @@
<clear-field field-name="createDetailMap"/>
</else>
</if-not-empty>
-
<calculate field-name="quantityNotIssued" map-name="parameters"><number value="0"/></calculate>
</if-compare>
<if-not-empty field-name="workEffortGoodStandard">
Modified: ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml?rev=579947&r1=579946&r2=579947&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml (original)
+++ ofbiz/trunk/applications/manufacturing/servicedef/services_production_run.xml Thu Sep 27 01:49:35 2007
@@ -148,14 +148,18 @@
If fromDate is passed, then the WorkEffortGoodStandard record with pk composed of (workEffortId|productId|fromDate)
with type PRUNT_PROD_NEEDED is retrieved and used to get the quantity; its status is also updated to COMPLETED after
the issuance is done.
- If locationSeqId is provided, then the items are only issued from the inventory items associated to the location.
+ If locationSeqIds are provided, then the items are only issued from the inventory items associated to the locations.
+ If failIfItemsAreNotAvailable is set to "Y" (the default is "N") then the service fails if there isn not enough inventory:
+ no items with negative qoh will be created.
</description>
<attribute name="workEffortId" type="String" mode="IN" optional="false"/>
<attribute name="productId" type="String" mode="IN" optional="false"/>
<attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
<attribute name="quantity" type="Double" mode="IN" optional="true"/>
+ <attribute name="failIfItemsAreNotAvailable" type="String" mode="IN" optional="true"/>
<attribute name="reserveOrderEnumId" type="String" mode="IN" optional="true"/>
<attribute name="locationSeqId" type="String" mode="IN" optional="true"/>
+ <attribute name="secondaryLocationSeqId" type="String" mode="IN" optional="true"/>
<attribute name="reasonEnumId" type="String" mode="IN" optional="true"/>
<attribute name="description" type="String" mode="IN" optional="true"/>
</service>
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml?rev=579947&r1=579946&r2=579947&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml Thu Sep 27 01:49:35 2007
@@ -273,6 +273,7 @@
<field name="productionRunId"><hidden/></field>
<field name="workEffortId"><hidden/></field>
<field name="fromDate"><hidden/></field>
+ <field name="failIfItemsAreNotAvailable"><hidden value="Y"/></field>
<field name="task" entry-name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}">
<display description="${workEffortName} [${workEffortId}]"/>
</field>
@@ -284,6 +285,14 @@
<field name="locationSeqId">
<drop-down allow-empty="true">
<entity-options entity-name="ProductFacilityLocation" description="${locationSeqId}">
+ <entity-constraint name="productId" env-name="productId"/>
+ <entity-constraint name="facilityId" env-name="facilityId"/>
+ </entity-options>
+ </drop-down>
+ </field>
+ <field name="secondaryLocationSeqId">
+ <drop-down allow-empty="true">
+ <entity-options entity-name="ProductFacilityLocation" description="${locationSeqId}" key-field-name="locationSeqId">
<entity-constraint name="productId" env-name="productId"/>
<entity-constraint name="facilityId" env-name="facilityId"/>
</entity-options>