From d5e46a7a9f2cb9123b9aafb39a20e14059faa2e4 Mon Sep 17 00:00:00 2001
From: Kevin Kok Khah Whey <khahwhey.kok@3ds.com>
Date: 星期三, 18 十月 2023 10:55:59 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_Kevin

---
 _Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration3.qbl |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration3.qbl b/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration3.qbl
index a3edaf0..a10d437 100644
--- a/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration3.qbl
+++ b/_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration3.qbl
@@ -1,9 +1,13 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod IterativeGeneration3 (
+  MacroPlan macroPlan,
+  GlobalOTDSOP globalOTDSOP,
   Supply_MP smp,
+  Supply_MP firstSMP,
   Number numberOfPlies,
-  Real fulfillmentQuantity
+  Real fulfillmentQuantity,
+  CapacityAllocationResultsRuleConfiguration capacityAllocationResultsRuleConfiguration
 )
 {
   TextBody:
@@ -20,10 +24,12 @@
               traverse ( dd, Fulfillment, f ) {
                 smp1 := f.Supply_MP();
                 numberOfPlies++;
+                fulfillmentQuantity := ( dd.Quantity() / ns.Quantity() ) * fulfillmentQuantity;
                 info( "--------------------------------------------------------------" );
-                fulfillmentQuantity := fulfillmentQuantity * ns.ProcessOutput().astype( OperationOutput ).Quantity() *
-                                                             dd.ProcessInput().astype( OperationInput ).Quantity();
-                CapacityAllocationResults::IterativeGeneration3( smp1, numberOfPlies, fulfillmentQuantity );
+                if ( not isnull( capacityAllocationResultsRuleConfiguration ) ) {
+                  CapacityAllocationResults::CreateDate1( macroPlan, globalOTDSOP, dd, ns, firstSMP, capacityAllocationResultsRuleConfiguration, fulfillmentQuantity );
+                }
+                CapacityAllocationResults::IterativeGeneration3( macroPlan, globalOTDSOP, smp1, firstSMP, numberOfPlies, fulfillmentQuantity, capacityAllocationResultsRuleConfiguration );
                 numberOfPlies--;
               }
             }
@@ -33,14 +39,17 @@
             targetDependentDemand := select( ptll, DependentDemand, dd, dd.ProcessInput().ProductInStockingPoint_MP().ProductID() = ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() and
                                              dd.Quantity() = ns.Quantity() );
             info( "杞﹂亾鍛ㄦ湡浠诲姟    ", "渚涘簲鏃堕棿锛�", ns.Start().Format( "Y-M2-D2" ), "    鍛ㄦ湡浠诲姟KEY锛�", ptll.Key(), "    ", 
-                  targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name() );
+                  ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name() );
             traverse ( targetDependentDemand, Fulfillment, f ) {
               smp1 := f.Supply_MP();
               numberOfPlies++;
               info( "--------------------------------------------------------------" );
-              CapacityAllocationResults::IterativeGeneration3( smp1, numberOfPlies, f.Quantity() );
+              if ( not isnull( capacityAllocationResultsRuleConfiguration ) ) {
+                CapacityAllocationResults::CreateDate1( macroPlan, globalOTDSOP, targetDependentDemand, ns, firstSMP, capacityAllocationResultsRuleConfiguration, f.Quantity() );
+              }
+              CapacityAllocationResults::IterativeGeneration3( macroPlan, globalOTDSOP, smp1, firstSMP, numberOfPlies, f.Quantity(), capacityAllocationResultsRuleConfiguration );
               numberOfPlies--;
-            } 
+            }
           }
         }
       }

--
Gitblit v1.9.3