R31356-18 Work Order Item - Produced Quantity Base Changed
Code | 31356-18 |
Entity | Production.ShopFloor.WorkOrderItems Entity |
Name | ProducedQuantityBaseChanged |
Attribute | Ingredient.UsedQuantity, Operation.RunTimeMinutes |
Layer | Front-End |
Events | AttributeChanged(ProducedQuantity) |
Priority | Normal |
Modify | YES |
Applicable Legislations | ALL // no condition needed |
Action | oldProducedQuantity = oldProducedQuantity (if null then 0);
coef = newProducedQuantity;
if (oldProducedQuantity != 0) coef = coef / oldProducedQuantity;
foreach (Ingredients) { if (Ingredient.UsedQuantity !=null) Ingredient.UsedQuantity = new Quantity(Math.Round(Ingredient.FixedScrapQuantity + (Ingredients.UsedQuantity - Ingredients.FixedScrapQuantity) * coef, 3), Unit); } foreach (Operations) { Operation.RunTimeMinutes = (Operation.RunTimeMinutes * coef); } |
Description | When Produced Quantity is changed, the ratio between the new and the old value is used to recalculate Used Quantity is Ingredients and Run time Minutes in Operation in order to change them with the same ratio. |
Message | |
Version | Introduced: 21
Updated: - |
Revocable | YES |
* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.