Author: jacopoc
Date: Wed Aug 23 08:14:12 2006 New Revision: 434062 URL: http://svn.apache.org/viewvc?rev=434062&view=rev Log: In the (long and slow) process of reviewing the design decisions taken when the manufacturing component was very young, I've removed now the two special types for the requirements generated by MRP. Using the existing ones: *) PRODUCT_REQUIREMENT for purchasing needs *) INTERNAL_REQUIREMENT for production run needs is a better way to go (better integration with the rest of the system etc...). Modified: incubator/ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml incubator/ofbiz/trunk/applications/manufacturing/servicedef/secas.xml incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java incubator/ofbiz/trunk/applications/order/config/OrderEntityLabels.properties incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml Modified: incubator/ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml?rev=434062&r1=434061&r2=434062&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml (original) +++ incubator/ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml Wed Aug 23 08:14:12 2006 @@ -17,9 +17,6 @@ --> <entity-engine-xml> - <RequirementType description="ProductionRun proposed by the MRP process" hasTable="N" parentTypeId="" requirementTypeId="MRP_PRO_PROD_ORDER"/> - <RequirementType description="Purchase Order proposed by the MRP process" hasTable="N" parentTypeId="" requirementTypeId="MRP_PRO_PURCH_ORDER"/> - <InventoryEventPlannedType inventoryEventPlanTypeId="MRP_REQUIREMENT" description="Mrp requirement" inOut="-"/> <InventoryEventPlannedType inventoryEventPlanTypeId="MANUF_ORDER_RECP" description="Manufacturing Order receipt" inOut="+"/> <InventoryEventPlannedType inventoryEventPlanTypeId="MANUF_ORDER_REQ" description="Manufacturing Order requirement" inOut="-"/> Modified: incubator/ofbiz/trunk/applications/manufacturing/servicedef/secas.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/servicedef/secas.xml?rev=434062&r1=434061&r2=434062&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/manufacturing/servicedef/secas.xml (original) +++ incubator/ofbiz/trunk/applications/manufacturing/servicedef/secas.xml Wed Aug 23 08:14:12 2006 @@ -19,13 +19,13 @@ <service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-eca.xsd"> <eca service="updateRequirement" event="commit"> - <condition field-name="requirementTypeId" operator="equals" value="MRP_PRO_PROD_ORDER"/> + <condition field-name="requirementTypeId" operator="equals" value="INTERNAL_REQUIREMENT"/> <condition field-name="statusId" operator="equals" value="REQ_APPROVED"/> <condition field-name="oldStatusId" operator="not-equals" value="REQ_APPROVED"/> <action service="createProductionRunFromRequirement" mode="sync"/> </eca> <eca service="createRequirement" event="commit"> - <condition field-name="requirementTypeId" operator="equals" value="MRP_PRO_PROD_ORDER"/> + <condition field-name="requirementTypeId" operator="equals" value="INTERNAL_REQUIREMENT"/> <condition field-name="statusId" operator="equals" value="REQ_APPROVED"/> <action service="createProductionRunFromRequirement" mode="sync"/> </eca> 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=434062&r1=434061&r2=434062&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 Wed Aug 23 08:14:12 2006 @@ -1772,9 +1772,7 @@ if (requirement == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRequirementNotExists", locale)); } - // TODO: fix the allowed types - if (!"MRP_PRO_PROD_ORDER".equals(requirement.getString("requirementTypeId")) && - !"WORK_REQUIREMENT".equals(requirement.getString("requirementTypeId"))) { + if (!"INTERNAL_REQUIREMENT".equals(requirement.getString("requirementTypeId"))) { return ServiceUtil.returnSuccess(); } Modified: incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java?rev=434062&r1=434061&r2=434062&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java (original) +++ incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java Wed Aug 23 08:14:12 2006 @@ -105,12 +105,13 @@ } } - // MRP proposed requirements are deleted - // TODO: is it correct? - + // Proposed requirements are deleted + // TODO: is it not correct. Two actions should be done here: + // 1) the approved requirements should be taken into account + // 2) we have to find a way (a new status REQ_PROPOSED?) to recognize the requirements automatically created by the MRP process listResult = null; try{ - listResult = delegator.findByAnd("Requirement", UtilMisc.toMap("requirementTypeId", "MRP_PRO_PURCH_ORDER", "statusId", "REQ_CREATED")); + listResult = delegator.findByAnd("Requirement", UtilMisc.toMap("requirementTypeId", "PRODUCT_REQUIREMENT", "statusId", "REQ_CREATED")); } catch(GenericEntityException e) { return ServiceUtil.returnError("Problem, we can not find all the items of InventoryEventPlanned, for more detail look at the log"); } @@ -123,7 +124,7 @@ } listResult = null; try{ - listResult = delegator.findByAnd("Requirement", UtilMisc.toMap("requirementTypeId", "MRP_PRO_PROD_ORDER", "statusId", "REQ_CREATED")); + listResult = delegator.findByAnd("Requirement", UtilMisc.toMap("requirementTypeId", "INTERNAL_REQUIREMENT", "statusId", "REQ_CREATED")); } catch(GenericEntityException e) { return ServiceUtil.returnError("Problem, we can not find all the items of InventoryEventPlanned, for more detail look at the log"); } Modified: incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java?rev=434062&r1=434061&r2=434062&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java (original) +++ incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java Wed Aug 23 08:14:12 2006 @@ -213,7 +213,7 @@ parameters.put("requiredByDate", requiredByDate); parameters.put("requirementStartDate", requirementStartDate); parameters.put("quantity", new Double(quantity)); - parameters.put("requirementTypeId", (isbuild? "MRP_PRO_PROD_ORDER" : "MRP_PRO_PURCH_ORDER")); + parameters.put("requirementTypeId", (isbuild? "INTERNAL_REQUIREMENT" : "PRODUCT_REQUIREMENT")); if (mrpName != null) { parameters.put("description", "MRP_" + mrpName); } else { Modified: incubator/ofbiz/trunk/applications/order/config/OrderEntityLabels.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/config/OrderEntityLabels.properties?rev=434062&r1=434061&r2=434062&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/config/OrderEntityLabels.properties (original) +++ incubator/ofbiz/trunk/applications/order/config/OrderEntityLabels.properties Wed Aug 23 08:14:12 2006 @@ -59,8 +59,6 @@ RequirementType.description.INTERNAL_REQUIREMENT=Internal Requirement RequirementType.description.PRODUCT_REQUIREMENT=Product Requirement RequirementType.description.WORK_REQUIREMENT=Work Requirement -RequirementType.description.MRP_PRO_PROD_ORDER=ProductionRun proposed by the MRP process -RequirementType.description.MRP_PRO_PURCH_ORDER=Purchase Order proposed by the MRP process <!-- Return Reasons --> ReturnReason.description.RTN_NOT_WANT=Did Not Want Item Modified: incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml?rev=434062&r1=434061&r2=434062&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml (original) +++ incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/requirement/RequirementServices.xml Wed Aug 23 08:14:12 2006 @@ -69,10 +69,7 @@ <condition-list> <condition-object field-name="parameters.requirementConditions"/> <condition-expr field-name="statusId" value="REQ_APPROVED"/> - <condition-list combine="or"> - <condition-expr field-name="requirementTypeId" value="MRP_PRO_PURCH_ORDER"/> - <condition-expr field-name="requirementTypeId" value="PRODUCT_REQUIREMENT"/> - </condition-list> + <condition-expr field-name="requirementTypeId" value="PRODUCT_REQUIREMENT"/> </condition-list> </entity-condition> <field-to-result field-name="requirementsForSupplier" result-name="requirementsForSupplier"/> |
Free forum by Nabble | Edit this page |