From 59a8fe7a013435dee9d81c65bc289af35e79a7fd Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期五, 13 十月 2023 11:52:16 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lhj

---
 _Main/BL/Type_GlobalDTOTable/Method_InitTestDataByYear.qbl                                                   |   67 ++++++
 _Main/BL/Type_MacroPlan/Method_MappingUnitOfMeasureData.qbl                                                  |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ButtonLoad_OnClick#417.def                  |   20 ++
 _Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate.qbl                                    |   11 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def                               |    4 
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_OnCreated.def                        |    2 
 _Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate0.qbl                                   |   13 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl                                               |    5 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl                                             |    6 
 _Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl                                                   |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Component_ListCapacityAndSaleBudge.def        |    2 
 _Main/BL/Type_ManufactureLTImputation/StaticMethod_Apply.qbl                                                 |    5 
 _Main/BL/Type_GlobalDTOTable/Method_InitTestData#12.qbl                                                      |    1 
 _Main/BL/Type_ManufactureLTImputation/StaticMethod_Refresh.qbl                                               |    5 
 _Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply#202.qbl                                         |    7 
 _Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Component_ListManufactureLT#943.def                  |    6 
 _Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply.qbl                                             |    5 
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonGenerateTestData_OnClick.def   |   21 ++
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/_ROOT_Component_FormCapacityAndSaleBudge.def  |   15 +
 _var/_Main/ProjSettings/MacroPlannerWebApp/Views/ManufactureLT.vw                                            |  239 +++++++++++++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonExportDetail_OnClick.def       |    2 
 /dev/null                                                                                                    |   14 -
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl                                            |    3 
 _Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer#25.qbl                                           |   15 +
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl                                               |   12 
 _Main/BL/Type_ManufactureLTImputation/StaticMethod_CreateOrUpdate.qbl                                        |    6 
 _Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl                                                   |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ListManufactureLT_943_MenuApply_OnClick.def |   23 ++
 _Main/BL/Relations/Relation_ManufactureLTImputation_GlobalOTDTable_GlobalOTDTable_ManufactureLT.qbl          |   23 ++
 _Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/_ROOT_Component_FormManufactureLT.def                |   11 +
 30 files changed, 489 insertions(+), 60 deletions(-)

diff --git a/_Main/BL/Relations/Relation_ManufactureLTImputation_GlobalOTDTable_GlobalOTDTable_ManufactureLT.qbl b/_Main/BL/Relations/Relation_ManufactureLTImputation_GlobalOTDTable_GlobalOTDTable_ManufactureLT.qbl
new file mode 100644
index 0000000..3a23be5
--- /dev/null
+++ b/_Main/BL/Relations/Relation_ManufactureLTImputation_GlobalOTDTable_GlobalOTDTable_ManufactureLT.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation ManufactureLTImputation_GlobalOTDTable_GlobalOTDTable_ManufactureLTImputation
+{
+  #keys: '1[414384.0.964611377]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide GlobalOTDTable
+  {
+    #keys: '3[414384.0.964611379][414384.0.964611378][414384.0.964611380]'
+    Cardinality: '0to1'
+    ObjectDefinition: ManufactureLTImputation
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide ManufactureLTImputation
+  {
+    #keys: '3[414384.0.964611382][414384.0.964611381][414384.0.964611383]'
+    Cardinality: '1toN'
+    ObjectDefinition: GlobalOTDTable
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_ManufactureLTImputation_MacroPlan_MacroPlan_ManufactureLTImputation.qbl b/_Main/BL/Relations/Relation_ManufactureLTImputation_MacroPlan_MacroPlan_ManufactureLTImputation.qbl
deleted file mode 100644
index 7aa6d28..0000000
--- a/_Main/BL/Relations/Relation_ManufactureLTImputation_MacroPlan_MacroPlan_ManufactureLTImputation.qbl
+++ /dev/null
@@ -1,23 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Relation ManufactureLTImputation_MacroPlan_MacroPlan_ManufactureLTImputation
-{
-  #keys: '1[414384.0.697090694]'
-  DefaultRelationStrategy
-  {
-  }
-  RelationSide.LeftSide MacroPlan
-  {
-    #keys: '3[414384.0.697090696][414384.0.697090695][414384.0.697090697]'
-    Cardinality: '0to1'
-    ObjectDefinition: ManufactureLTImputation
-    OwningSide: 'Reference'
-  }
-  RelationSide.RightSide ManufactureLTImputation
-  {
-    #keys: '3[414384.0.697090699][414384.0.697090698][414384.0.697090700]'
-    Cardinality: '1toN'
-    ObjectDefinition: MacroPlan
-    OwningSide: 'Owned'
-  }
-}
diff --git "a/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl" "b/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl"
index f59360c..274df0b 100644
--- "a/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl"
+++ "b/_Main/BL/Type_GlobalDTOTable/Method_InitTestData\04312.qbl"
@@ -10,6 +10,7 @@
     productCodeList := selectuniquevalues( macroPlan, Product_MP, item, item.ID() );
     debuginfo( "productCodeList : " + [String]productCodeList.Size() );
     
+    this.Global_MappingAnnualBudgetData( relflush );
     if( this.Global_MappingAnnualBudgetData( relsize ) = 0 ) {
       debuginfo( "create Global_MappingAnnualBudgetData test data" );
       id := 1;
diff --git a/_Main/BL/Type_GlobalDTOTable/Method_InitTestDataByYear.qbl b/_Main/BL/Type_GlobalDTOTable/Method_InitTestDataByYear.qbl
new file mode 100644
index 0000000..4223466
--- /dev/null
+++ b/_Main/BL/Type_GlobalDTOTable/Method_InitTestDataByYear.qbl
@@ -0,0 +1,67 @@
+Quintiq file version 2.0
+#parent: #root
+Method InitTestDataByYear (
+  MacroPlan macroPlan,
+  CapacityAndSaleBudgeFilterYears years
+)
+{
+  TextBody:
+  [*
+    // yypsybs Oct-7-2023 (created)
+    productCodeList := selectuniquevalues( macroPlan, Product_MP, item, item.ID() );
+    debuginfo( "productCodeList : " + [String]productCodeList.Size() );
+    
+    this.Global_MappingAnnualBudgetData( relflush );
+    debuginfo( "create Global_MappingAnnualBudgetData test data" );
+    id := 1;
+    traverse( years, Elements, year ) {
+      for( i := 1; i <= productCodeList.Size(); i := i + 1 ) {
+        productCode := productCodeList.Element( i - 1 );
+        mappingAnnualBudget := this.Global_MappingAnnualBudgetData( relnew, 
+                                                                    ID := [String]id,
+                                                                    YearNo := [String]year.YearNo(),
+                                                                    BusinessType := "浜嬩笟閮�" + [String](productCode.Length() mod 3),
+                                                                    ProductID := productCode);
+        id := id + 1;
+        mappingAnnualBudget.MonthlyModCapacity1( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity2( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity3( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity4( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity5( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity6( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity7( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity8( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity9( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity10( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity11( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlyModCapacity12( [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity1(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity2(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity3(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity4(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity5(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity6(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity7(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity8(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity9(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity10(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity11(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySheetCapacity12(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales1(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales2(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales3(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales4(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales5(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales6(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales7(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales8(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales9(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales10(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales11(  [String]Real::Random( 20000.0, 30000.0 ) );
+        mappingAnnualBudget.MonthlySales12(  [String]Real::Random( 20000.0, 30000.0 ) );
+      }
+    }
+    result2 := selectset( this, Global_MappingAnnualBudgetData, item, true );
+    debuginfo( "test MappingAnnualBudget size : " + [String]result2.Size() );
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
index 2f75b5f..4cc3e53 100644
--- a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
@@ -63,7 +63,7 @@
                 MaterialType:= ObjProduct.ParentID();
                 MaterialName:=ObjProduct.Name();
               }
-              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ComponentCode());
+              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ComponentCode(),GlobData);
               if( not isnull( ObjUnit))
               {
                 StockPoint:= ObjUnit.Name();
@@ -83,6 +83,7 @@
       // 娌℃湁BOM 娣诲姞娴嬭瘯鏁版嵁
       else
       {
+        //error( "BOM 鏁版嵁鑾峰彇澶辫触锛屾棤娉曟墿灞曞師鏉愭枡淇℃伅锛�");
         nCount :=Owner.H_MaterialInfo(relsize );
         Owner.H_MaterialInfo(relnew,ParentSKU := ParentSKU,SKU := "SKU"+ nCount.AsQUILL() ,ForecastID := ForecastId,OrgCode := "ORG_000",VCode := VCode
                                     ,ID := H_FunctionClass::SM_GenerateID( "MI"),MaterialType := "鍘熸潗鏂�",NeedDate := NDate
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl
index cfa808a..1be87a9 100644
--- a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl
@@ -2,7 +2,8 @@
 #parent: #root
 StaticMethod SM_GetUnitBySKU (
   MacroPlan Owner,
-  String SKU
+  String SKU,
+  GlobalOTDTable GlobData
 ) as Unit
 {
   Description: '閫氳繃SKU鑾峰彇搴撳瓨鐐逛俊鎭�'
@@ -11,7 +12,7 @@
     Obj :=null( Unit,constcontent );
     if( not isnull( Owner) and SKU.Length()>0)
     {
-      OrgCode := select( Owner,MappingBOM,ObjM,ObjM.ProductCode()=SKU);
+      OrgCode := select( GlobData,Global_MappingOperationBOM,ObjM,ObjM.ProductCode()=SKU);
       if( not isnull( OrgCode))
       {
         Obj := select( Owner,Unit,ObjU,ObjU.ID()=  OrgCode.OrganCode());
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl
index 88c8f1d..02a2296 100644
--- a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl
@@ -15,6 +15,10 @@
     *鍒涘缓浜猴細yunying
     *鍒涘缓鏃堕棿锛�20230-09-24
     *鎻忚堪锛氱郴缁熷唴璁㈠崟鍐插噺璋冪敤鍑芥暟锛孖sNew=true鏃讹紝閲嶆柊澶勭悊棰勬祴淇℃伅锛孖sNew=false鏃讹紝鐢ㄩ娴嬬疮璁′俊鎭��
+    *鍙傛暟锛欼sNew 鏄惁鏃舵柊鐨勮绠楄〃绀�
+    *     Operator 鎿嶄綔浜�
+    *     OperatorType 鎿嶄綔绫诲瀷[鍙嶇,鎺堟潈,ERP璁㈠崟]锛岃繖閲屽簲璇ユ槸ERP璁㈠崟
+    *澶囨敞锛氬鎴峰叏閮ㄤ娇鐢ㄥ鎴峰悕绉帮紝涓嶈浣跨敤瀹㈡埛ID锛岄娴嬪師濮嬫暟鎹病鏈夊鎴稩D淇℃伅
     *****************************************************************************/
     // 鍒濆鍖栫粨鏋�
     bStatus := false;
@@ -58,9 +62,9 @@
               nHaveForecastQty :=0; //鏈夐娴嬫暟閲�
               nNoHaveForecastQty:=0;//浜旈娴嬫暟閲�
               OrderQuantity := 0;   //鍓╀綑璁㈠崟鏁伴噺
-              // 鑾峰彇棰勬祴鏁伴噺锛堝鎴�+SKU+鏈堜唤 鐞嗚鏄病鏈夌墿鏂欓娴嬶級
+              // 鑾峰彇棰勬祴鏁伴噺锛堝鎴峰悕绉�+SKU+鏈堜唤 鐞嗚鏄病鏈夌墿鏂欓娴嬶級
               OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
-                                                    and Obj.CustomCode() = ObjOrder.CustomerName() 
+                                                    and Obj.CustomName() = ObjOrder.CustomerName() 
                                                     and Obj.Month().Format( "YM2") =ObjOrder.EndDate().Format( "YM2"));
               if ( not isnull(OrderForecast))
               {
@@ -74,9 +78,9 @@
                   nReverseQtyOld := ObjReverse.ReverseRealQty();
                   nReverseQtyNew := nReverseQtyOld;
               }
-              // 鑾峰彇鎺堟潈鏁伴噺锛堝鎴稩D+SKU锛�
+              // 鑾峰彇鎺堟潈鏁伴噺锛堝鎴峰悕绉�+SKU锛�
               ObjAuthorize := select(Owner, H_AuthorizeRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
-                                                                      and Obj.CustomID() = ObjOrder.CustomerName());
+                                                                      and Obj.CustomName() = ObjOrder.CustomerName());
               if ( not isnull(ObjAuthorize))
               {
                   nAuthorizeQtyOld := ObjAuthorize.AuthorizeRealQty();
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl
index 4379bdc..1143233 100644
--- a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl
@@ -170,9 +170,9 @@
     {
       strMsg :="濉骇鍚庤鍗曞啿鍑忓彂鐢熼敊璇紝璇疯仈绯荤郴缁熺鐞嗗憳锛�";
       // 璁板綍閿欒鏃ュ織
-    //  Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_OrderHedgingEx",
-    //                     DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
-    //                     GeneralInformation := e.GeneralInformation());                
+      Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_OrderHedgingEx",
+                         DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
+                         GeneralInformation := e.GeneralInformation());                
     }
     return JSON::Object().Add( "Status",bStatus)
                          .Add( "Count",nCount)
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl
index 9385366..a8db6ce 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl
@@ -24,7 +24,7 @@
       if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){
         info( "Now is dealing with the " + count.AsQUILL() + "ActualPISPIP " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
         }
-      product := select( this,MappingProduct,product,product.ID() = actual.ProductID() and product.KeyProduct() = nuclear,true);
+      product := select( globalOTDTable,Global_MappingProduct_MP,product,product.ID() = actual.ProductID() and product.KeyProduct() = nuclear,true);
       if( not isnull( product)){
       if( not isnull(businessTypes)){
       
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
index 208a5e8..6dd9ddc 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
@@ -76,7 +76,7 @@
     }
     if( createPurchaseSupplyMaterial ) {
         toCreateBomList := selectuniquevalues( bomList, Elements, item, 
-                                               item.ComponentType() = "P", item.OrganCode() + item.ComponentCode());
+                                               item.ComponentType() = "P" and keyProductList.Find( item.ComponentCode())>=0, item.OrganCode() + item.ComponentCode());
         traverse( toCreateBomList, Elements, key ) {
             boms := selectset( bomList, Elements, item, item.ComponentType() = "P" and item.OrganCode() + item.ComponentCode() = key );
             bom := boms.First();
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingUnitOfMeasureData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingUnitOfMeasureData.qbl
index f3118cb..05f843b 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingUnitOfMeasureData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingUnitOfMeasureData.qbl
@@ -10,7 +10,7 @@
     // yypsybs Aug-15-2023 (created)
     
     defaultOld := UnitOfMeasure_MP::FindDefault( this );
-    defaultNew := select( this, MappingUnitOfMeasure, item, true, item.IsDefault() );
+    defaultNew := select( globalotdtable, Global_MappingUnitOfMeasure_MP, item, true, item.IsDefault() );
     
     if( not isnull( defaultOld ) and not isnull( defaultNew )
         and defaultOld.Name() <> defaultNew.Name() ) {
diff --git a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Apply.qbl b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Apply.qbl
index 8e7f10e..12288b1 100644
--- a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Apply.qbl
+++ b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Apply.qbl
@@ -1,7 +1,8 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod Apply (
-  ManufactureLTImputations toApply
+  ManufactureLTImputations toApply,
+  MacroPlan macroPlan
 )
 {
   TextBody:
@@ -9,7 +10,7 @@
     // yypsybs Aug-28-2023 (created)
     traverse( toApply, Elements, parent ) {
       traverse( parent, ManufactureLTProcessSection, child ) {
-        ManufactureLTProcessSection::Apply( child );  
+        ManufactureLTProcessSection::Apply( child, macroPlan );  
       }
     }
   *]
diff --git a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_CreateOrUpdate.qbl b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_CreateOrUpdate.qbl
index 3190688..27fc818 100644
--- a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_CreateOrUpdate.qbl
+++ b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_CreateOrUpdate.qbl
@@ -1,7 +1,7 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod CreateOrUpdate (
-  MacroPlan macroPlan,
+  GlobalOTDTable parent,
   String orgCode,
   String productId,
   String desc
@@ -10,9 +10,9 @@
   TextBody:
   [*
     // yypsybs Aug-25-2023 (created)
-    value := select( macroPlan, ManufactureLTImputation, item, item.OrgCode() = orgCode and item.SkuID() = productId );
+    value := select( parent, ManufactureLTImputation, item, item.OrgCode() = orgCode and item.SkuID() = productId );
     if( isnull( value ) ) {
-        value := macroPlan.ManufactureLTImputation( relnew, OrgCode := orgCode, SkuID := productId, Describe := desc );
+        value := parent.ManufactureLTImputation( relnew, OrgCode := orgCode, SkuID := productId, Describe := desc );
     } else {
         value.Describe( desc );  
     }
diff --git a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_NewStaticMethod.qbl b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_NewStaticMethod.qbl
deleted file mode 100644
index 5884b30..0000000
--- a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_NewStaticMethod.qbl
+++ /dev/null
@@ -1,9 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-StaticMethod NewStaticMethod
-{
-  TextBody:
-  [*
-    // yypsybs Sep-19-2023 (created)
-  *]
-}
diff --git a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Refresh.qbl b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Refresh.qbl
index 90c199f..c36ff8f 100644
--- a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Refresh.qbl
+++ b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Refresh.qbl
@@ -1,7 +1,8 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod Refresh (
-  ManufactureLTImputations toRefresh
+  ManufactureLTImputations toRefresh,
+  MacroPlan macroPlan
 )
 {
   TextBody:
@@ -9,7 +10,7 @@
     // yypsybs Aug-28-2023 (created)
     traverse( toRefresh, Elements, parent ) {
       traverse( parent, ManufactureLTProcessSection, child ) {
-        ManufactureLTProcessSection::Apply( child );  
+        ManufactureLTProcessSection::Apply( child, macroPlan );  
       }
     }
   *]
diff --git "a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer\04325.qbl" "b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer\04325.qbl"
new file mode 100644
index 0000000..2845682
--- /dev/null
+++ "b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer\04325.qbl"
@@ -0,0 +1,15 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Transfer (
+  MacroPlan macroPlan,
+  GlobalOTDTable parent
+)
+{
+  TextBody:
+  [*
+    // yypsybs Oct-11-2023 (created)
+    traverse( macroPlan, Routing.RoutingStep.Operation, item ) {
+         ManufactureLTProcessSection::CreateOrUpdate( item, parent );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer.qbl b/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer.qbl
deleted file mode 100644
index ae70b83..0000000
--- a/_Main/BL/Type_ManufactureLTImputation/StaticMethod_Transfer.qbl
+++ /dev/null
@@ -1,33 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-StaticMethod Transfer (
-  MacroPlan oldMP,
-  MacroPlan newMP
-)
-{
-  Description: '绉讳氦鎺у埗鏉�'
-  TextBody:
-  [*
-    //// yypsybs Aug-25-2023 (created)
-    //if( isnull( oldMP ) ) {
-    //    info( "========transfer ManufactureLTImputations to macroPlan " + [String]newMP.MDSID() + "========" );
-    //} else {
-    //    info( "========transfer ManufactureLTImputations from macroPlan " + [String]oldMP.MDSID() + " to macroPlan " + [String]newMP.MDSID() + "========" );
-    //}
-    //// 娓呯┖鏂扮殑锛岃�佺殑澶嶅埗鍒版柊鐨勶紝娓呯┖鑰佺殑
-    //if( not isnull( oldMP ) and not isnull( newMP ) ) {
-    //    info( "old ManufactureLTImputation size : " + [String]oldMP.ManufactureLTImputation( relsize ) )
-    //    traverse( oldMP, ManufactureLTImputation, parent, true ) {
-    //        traverse( parent, ManufactureLTProcessSection, child, true ) {
-    //              ManufactureLTProcessSection::CreateOrUpdate( newMP, parent.OrgCode(), parent.SkuID(), parent.Describe(), 
-    //                                                            child.ProcessSection(), child.Sequence(), child.Line(), child.SystemLT(),
-    //                                                           child.Edited(), child.EditLT(), child.Describe() );
-    //        }
-    //    }  
-    //}
-    //// 澶勭悊鏂扮殑鐨刼peration
-    //traverse( newMP, Routing.RoutingStep.Operation, item ) {
-    //     ManufactureLTProcessSection::CreateOrUpdate( item );
-    //}
-  *]
-}
diff --git "a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply\043202.qbl" "b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply\043202.qbl"
index 502281f..278b5f3 100644
--- "a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply\043202.qbl"
+++ "b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply\043202.qbl"
@@ -1,14 +1,15 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod Apply (
-  ManufactureLTProcessSection toApply
+  ManufactureLTProcessSection toApply,
+  MacroPlan macroPlan
 )
 {
   TextBody:
   [*
     // yypsybs Aug-28-2023 (created)
     parent := toApply.ManufactureLTImputation();
-    toUpdate := select( toApply, ManufactureLTImputation.MacroPlan.Routing.RoutingStep.Operation, op,
+    toUpdate := select( macroPlan, Routing.RoutingStep.Operation, op,
                         op.RoutingID() = parent.OrgCode() + "_" + parent.SkuID() 
                         and op.RoutingStepName() = toApply.ProcessSection() + "_" + toApply.Sequence()
                         and op.Name() = ifexpr( toApply.Line() <> "", 
@@ -18,7 +19,7 @@
       toUpdate.UserLeadTime( Duration::Days( toApply.EditLT() ) );
       toApply.SystemLT( toApply.EditLT() );
     } else {
-      info( "operation to update not found" );  
+      debuginfo(  "operation to update not found" );  
     }
   *]
 }
diff --git a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply.qbl b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply.qbl
index 2b410b4..7f69c3f 100644
--- a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply.qbl
+++ b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Apply.qbl
@@ -1,14 +1,15 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod Apply (
-  ManufactureLTProcessSections toApply
+  ManufactureLTProcessSections toApply,
+  MacroPlan macroPlan
 )
 {
   TextBody:
   [*
     // yypsybs Aug-28-2023 (created)
     traverse( toApply, Elements, child ) {
-      ManufactureLTProcessSection::Apply( child );
+      ManufactureLTProcessSection::Apply( child, macroPlan );
     }
   *]
 }
diff --git a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate.qbl b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate.qbl
index fe55479..662ef7e 100644
--- a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate.qbl
+++ b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate.qbl
@@ -1,7 +1,8 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod CreateOrUpdate (
-  Operation op
+  Operation op,
+  GlobalOTDTable parent
 ) as ManufactureLTProcessSection
 {
   TextBody:
@@ -31,9 +32,11 @@
     }
     child := null( ManufactureLTProcessSection );
     //if( orgCode <> "" and productId <> "" and processStep <> "" and sequence <> "" ) {
-    //    parent := ManufactureLTImputation::CreateOrUpdate( op.RoutingStep().Routing().MacroPlan(), orgCode, productId, "" );
-    //    info( "DaysAsReal : " + [String]op.UserLeadTime().DaysAsReal() );
-    //    child := ManufactureLTProcessSection::CreateOrUpdate( parent, processStep, false, sequence, line, op.UserLeadTime().DaysAsReal(), 0.0, "" );
+      ltParent := ManufactureLTImputation::CreateOrUpdate( parent, orgCode, productId, "" );
+      info( "DaysAsReal : " + [String]op.UserLeadTime().DaysAsReal() );
+      child := ManufactureLTProcessSection::CreateOrUpdate( ltParent, processStep, false, sequence, line, op.UserLeadTime().DaysAsReal(), 0.0, "" );
+    //} else {
+    //  info( "skip operation" );
     //}
     return child;
   *]
diff --git a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate0.qbl b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate0.qbl
index b18ed17..533457a 100644
--- a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate0.qbl
+++ b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_CreateOrUpdate0.qbl
@@ -1,6 +1,7 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod CreateOrUpdate (
+  GlobalOTDTable parent,
   MacroPlan macroPlan,
   String orgCode,
   String productId,
@@ -17,15 +18,15 @@
   TextBody:
   [*
     // yypsybs Aug-25-2023 (created)
-    parent := select( macroPlan, ManufactureLTImputation, item, item.OrgCode() = orgCode and item.SkuID() = productId );
-    if( isnull( parent ) ) {
-        parent := macroPlan.ManufactureLTImputation( relnew, OrgCode := orgCode, SkuID := productId, Describe := parentDesc );
+    ltParent := select( parent, ManufactureLTImputation, item, item.OrgCode() = orgCode and item.SkuID() = productId );
+    if( isnull( ltParent ) ) {
+        ltParent := parent.ManufactureLTImputation( relnew, OrgCode := orgCode, SkuID := productId, Describe := parentDesc );
     } else {
-        parent.Describe( parentDesc );  
+        ltParent.Describe( parentDesc );  
     }
-    child := select( parent, ManufactureLTProcessSection, item, item.ProcessSection() = processSection and item.Sequence() = seq and item.Line() = line );
+    child := select( ltParent, ManufactureLTProcessSection, item, item.ProcessSection() = processSection and item.Sequence() = seq and item.Line() = line );
     if( isnull( child ) ) {
-        child := parent.ManufactureLTProcessSection( relnew, 
+        child := ltParent.ManufactureLTProcessSection( relnew, 
                                                      ProcessSection := processSection, Sequence := seq, Line := line, SystemLT := systemLt, 
                                                      Edited := edited, EditLT := editLt, Describe := childDesc );
     } else {
diff --git "a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Refresh\0431.qbl" "b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Refresh\0431.qbl"
deleted file mode 100644
index 069eb30..0000000
--- "a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Refresh\0431.qbl"
+++ /dev/null
@@ -1,23 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-StaticMethod Refresh (
-  ManufactureLTProcessSection toRefresh
-)
-{
-  TextBody:
-  [*
-    // yypsybs Aug-28-2023 (created)
-    parent := toRefresh.ManufactureLTImputation();
-    toUpdate := select( toRefresh, ManufactureLTImputation.MacroPlan.Routing.RoutingStep.Operation, op,
-                        op.RoutingID() = parent.OrgCode() + "_" + parent.SkuID() 
-                        and op.RoutingStepName() = toRefresh.ProcessSection() + "_" + toRefresh.Sequence()
-                        and op.Name() = ifexpr( toRefresh.Line() <> "", 
-                                                parent.OrgCode() + "_" + toRefresh.ProcessSection() + "_" + toRefresh.Line(),
-                                                parent.OrgCode() + "_" + toRefresh.ProcessSection() ) );
-    if( not isnull( toUpdate ) ) {
-      toRefresh.SystemLT( toUpdate.UserLeadTime().DaysAsReal() );
-    } else {
-      info( "operation to refresh not found" );  
-    }
-  *]
-}
diff --git a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Refresh.qbl b/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Refresh.qbl
deleted file mode 100644
index b39c91c..0000000
--- a/_Main/BL/Type_ManufactureLTProcessSection/StaticMethod_Refresh.qbl
+++ /dev/null
@@ -1,14 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-StaticMethod Refresh (
-  ManufactureLTProcessSections toApply
-)
-{
-  TextBody:
-  [*
-    // yypsybs Aug-28-2023 (created)
-    traverse( toApply, Elements, child ) {
-      ManufactureLTProcessSection::Refresh( child );
-    }
-  *]
-}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
index 66ea53b..d2fe1c9 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
@@ -6,7 +6,7 @@
   [*
     // Disabled button to prevent the possibility of multiple firing
     
-    macroPlanOld := MacroPlan;
+    //macroPlanOld := MacroPlan;
     
     btnOK.Enabled( false, '' )
     
@@ -110,7 +110,7 @@
     }
     
     macroPlanNew := MacroPlan;
-    ManufactureLTImputation::Transfer( macroPlanOld, macroPlanNew );
+    //ManufactureLTImputation::Transfer( macroPlanOld, macroPlanNew );
     
     // sync data
     if( data.EnableSync() ) {
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Component_ListCapacityAndSaleBudge.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Component_ListCapacityAndSaleBudge.def
index 4af954a..a0f1d91 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Component_ListCapacityAndSaleBudge.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Component_ListCapacityAndSaleBudge.def
@@ -38,6 +38,6 @@
   ]
   Properties:
   [
-    Taborder: 2
+    Taborder: 3
   ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonExportDetail_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonExportDetail_OnClick.def
index 6ff9db2..e09f8c8 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonExportDetail_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonExportDetail_OnClick.def
@@ -7,7 +7,7 @@
   DefinitionID: 'Responsedef_WebButton_OnClick'
   Precondition:
   [*
-    return not isnull( MPSync );
+    return not isnull( GlobalOTDTable );
   *]
   QuillAction
   {
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonGenerateTestData_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonGenerateTestData_OnClick.def
new file mode 100644
index 0000000..ca24ac8
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_ButtonGenerateTestData_OnClick.def
@@ -0,0 +1,21 @@
+Quintiq file version 2.0
+#parent: ButtonGenerateTestData
+Response OnClick () id:Response_FormCapacityAndSaleBudge_ButtonGenerateTestData_OnClick
+{
+  #keys: '[414384.0.971540692]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  Precondition:
+  [*
+    return not isnull( MacroPlan );
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      GlobalOTDTable.InitTestDataByYear( MacroPlan, DataHolderCapacityAndSaleBudgeFilterYear.Data() );
+      Global_MappingAnnualBudgetData::SetOrgCodeFromForecast( GlobalOTDTable );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_OnCreated.def
index e0e1268..8a33617 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_OnCreated.def
@@ -12,8 +12,6 @@
     [*
       MPSync::TestData( MPSync, MacroPlan );
       GlobalOTDTable.InitTestData();
-      GlobalOTDTable.InitTestData( MacroPlan );
-      Global_MappingAnnualBudgetData::SetOrgCodeFromForecast( GlobalOTDTable );
       GlobalOTDTable.RefreshCapacityAndSaleBudgeFilter( true );
     *]
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/_ROOT_Component_FormCapacityAndSaleBudge.def b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/_ROOT_Component_FormCapacityAndSaleBudge.def
index c2687d8..995281a 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/_ROOT_Component_FormCapacityAndSaleBudge.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/_ROOT_Component_FormCapacityAndSaleBudge.def
@@ -16,7 +16,7 @@
       [
         Image: 'EXPORT1'
         Label: '瀵煎嚭'
-        Taborder: 0
+        Taborder: 1
       ]
     }
     Component ButtonExportTest
@@ -27,10 +27,21 @@
       [
         Image: 'EXPORT1'
         Label: '瀵煎嚭娴嬭瘯'
-        Taborder: 1
+        Taborder: 2
         Visible: false
       ]
     }
+    Component ButtonGenerateTestData
+    {
+      #keys: '[414384.0.971540693]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'IMPORT1'
+        Label: '鏍规嵁绛涢�夋湀浠界敓鎴愭祴璇曟暟鎹�'
+        Taborder: 0
+      ]
+    }
   ]
   Properties:
   [
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Component_ListManufactureLT\043943.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Component_ListManufactureLT\043943.def"
index c2d85db..d71a6ee 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Component_ListManufactureLT\043943.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Component_ListManufactureLT\043943.def"
@@ -11,8 +11,8 @@
       BaseType: 'WebDataExtractor'
       Properties:
       [
-        DataType: 'MacroPlan'
-        Source: 'MacroPlan'
+        DataType: 'GlobalOTDTable'
+        Source: 'GlobalOTDTable'
         Taborder: 0
         Transformation: 'ManufactureLTImputation'
       ]
@@ -37,7 +37,7 @@
   ]
   Properties:
   [
-    Taborder: 0
+    Taborder: 1
   ]
   ResponseDefinitions:
   [
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ButtonLoad_OnClick\043417.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ButtonLoad_OnClick\043417.def"
new file mode 100644
index 0000000..fca0b35
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ButtonLoad_OnClick\043417.def"
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: ButtonLoad_657
+Response OnClick () id:Response_PanelPRDataButton_ButtonLoad_OnClick_417
+{
+  #keys: '[414384.0.967076760]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  Precondition:
+  [*
+    return not isnull( MacroPlan );
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      ManufactureLTImputation::Transfer( MacroPlan, GlobalOTDTable );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ListManufactureLT_943_MenuApply_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ListManufactureLT_943_MenuApply_OnClick.def
new file mode 100644
index 0000000..facd5e2
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/Response_ListManufactureLT_943_MenuApply_OnClick.def
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: ListManufactureLT_943
+Response OnClick (
+  structured[ManufactureLTImputation] selection
+) id:Response_ListManufactureLT_943_MenuApply_OnClick
+{
+  #keys: '[414384.0.967590502]'
+  CanBindMultiple: false
+  DefinitionID => /ListManufactureLT_943/Responsedef_ListManufactureLT_943_WebMenu_OnClick
+  GroupServerCalls: true
+  Initiator: 'MenuApply'
+  Precondition:
+  [*
+    return not isnull( MacroPlan );
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      ManufactureLTImputation::Apply( selection, MacroPlan );
+    *]
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/_ROOT_Component_FormManufactureLT.def b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/_ROOT_Component_FormManufactureLT.def
index a35f176..a5790c1 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/_ROOT_Component_FormManufactureLT.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormManufactureLT/_ROOT_Component_FormManufactureLT.def
@@ -8,6 +8,17 @@
   Children:
   [
     #child: ListManufactureLT_943
+    Component ButtonLoad id:ButtonLoad_657
+    {
+      #keys: '[414384.0.967076761]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'THICK_ARROW_DOWN_BLUE'
+        Label: '閲嶆柊鍔犺浇'
+        Taborder: 0
+      ]
+    }
   ]
   Properties:
   [
diff --git a/_var/_Main/ProjSettings/MacroPlannerWebApp/Views/ManufactureLT.vw b/_var/_Main/ProjSettings/MacroPlannerWebApp/Views/ManufactureLT.vw
new file mode 100644
index 0000000..76e471c
--- /dev/null
+++ b/_var/_Main/ProjSettings/MacroPlannerWebApp/Views/ManufactureLT.vw
@@ -0,0 +1,239 @@
+Quintiq file version 2.0
+{
+  viewcontents
+  {
+    forms
+    {
+      form_legacy_1
+      {
+        title: 'Scenario manager'
+        shown: true
+        componentID: 'FormScenarioManager'
+        layout
+        {
+          mode: 'open'
+          rowPosition: 1
+          rowSpan: 8
+          columnPosition: 1
+          columnSpan: 5
+        }
+        components
+        {
+          FormScenarioManager_ListScenario
+          {
+          }
+          FormScenarioManager_DataSetLevelScenario
+          {
+            groupDepth: -1
+            column_All_constraints
+            {
+              columnId: 'All constraints'
+              dataPath: 'All constraints'
+              dataType: 'string'
+              title: 'All constraints'
+              index: 0
+              subtotals: ''
+              width: 90
+            }
+            column_Name
+            {
+              columnId: 'Name'
+              dataPath: 'Name'
+              dataType: 'string'
+              title: '鍚嶇О'
+              index: 1
+              subtotals: ''
+              width: 197
+            }
+            column_ChangedBy
+            {
+              columnId: 'ChangedBy'
+              dataPath: 'ChangedBy'
+              dataType: 'string'
+              title: 'Changed by'
+              index: 2
+              subtotals: ''
+              width: 91
+            }
+            column_ChangedOn
+            {
+              columnId: 'ChangedOn'
+              dataPath: 'ChangedOn'
+              dataType: 'datetime'
+              title: 'Changed on'
+              index: 3
+              subtotals: ''
+              width: 99
+            }
+            column_StorageMode
+            {
+              columnId: 'StorageMode'
+              dataPath: 'StorageMode'
+              dataType: 'string'
+              title: 'StorageMode'
+              index: 4
+              subtotals: ''
+              width: 40
+            }
+          }
+        }
+      }
+      form_FormOptimizerPuzzles
+      {
+        title: 'Optimizer Puzzles'
+        shown: false
+        componentID: 'FormOptimizerPuzzles'
+        layout
+        {
+          mode: 'dockright'
+          index: 0
+        }
+        components
+        {
+          FormOptimizerPuzzles_ListOptimizerPuzzles
+          {
+          }
+          FormOptimizerPuzzles_DataSetLevelOptimizerPuzzles
+          {
+            groupDepth: -1
+            column_All_constraints
+            {
+              columnId: 'All constraints'
+              dataPath: 'All constraints'
+              dataType: 'string'
+              title: 'All constraints'
+              index: 0
+              subtotals: ''
+              width: 32
+            }
+            column_Name
+            {
+              columnId: 'Name'
+              dataPath: 'Name'
+              dataType: 'string'
+              title: '鍚嶇О'
+              index: 1
+              subtotals: ''
+              width: 109
+            }
+            column_Description
+            {
+              columnId: 'Description'
+              dataPath: 'Description'
+              dataType: 'string'
+              title: '鎻忚堪'
+              index: 2
+              subtotals: ''
+              width: 207
+            }
+          }
+        }
+      }
+      form_FormKPI
+      {
+        title: 'KPI Dashboard'
+        shown: false
+        componentID: 'FormKPI'
+        layout
+        {
+          mode: 'dockright'
+          index: 1
+        }
+        components
+        {
+          FormKPI_PanelKPI
+          {
+            sizeRatio: 1
+            activeChild: 'PanelKPISelection'
+          }
+          FormKPI_PanelKPIDashboard
+          {
+            sizeRatio: 1
+          }
+          FormKPI_PanelKPISelection
+          {
+            sizeRatio: 1
+          }
+          FormKPI_ListKPISelection
+          {
+            QuillViewData
+            {
+              Food_KPISetting: 'Cost of sales;Fulfillment;Fulfillment target;Inventory holding cost;Labor cost;Margin;Safety stock;Sales;Sourcing cost;Total CO2 emission;Transportation cost;Volume'
+            }
+          }
+          FormKPI_DataSetLevelKPISelection
+          {
+            groupDepth: -1
+            column_All_constraints
+            {
+              columnId: 'All constraints'
+              dataPath: 'All constraints'
+              dataType: 'string'
+              title: 'All constraints'
+              index: 0
+              subtotals: ''
+              width: 32
+            }
+            column_Name
+            {
+              columnId: 'Name'
+              dataPath: 'Name'
+              dataType: 'string'
+              title: '鍚嶇О'
+              index: 1
+              subtotals: ''
+              width: 200
+            }
+          }
+        }
+      }
+      form_SWF_DialogWorkflowParameter
+      {
+        title: 'S&OP Workflow Parameters'
+        shown: true
+        componentID: 'SWF_DialogWorkflowParameter'
+        layout
+        {
+          mode: 'dockright'
+          index: 2
+        }
+        components
+        {
+          SWF_DialogWorkflowParameter_PanelCurrentDate
+          {
+            sizeRatio: 1
+          }
+          SWF_DialogWorkflowParameter_PanelIntegration
+          {
+            sizeRatio: 1
+          }
+          SWF_DialogWorkflowParameter_PanelSynchronizeRoles
+          {
+            sizeRatio: 1
+          }
+          SWF_DialogWorkflowParameter_PanelRequestDatasetSync
+          {
+            sizeRatio: 1
+          }
+          SWF_DialogWorkflowParameter_PanelKickQueues
+          {
+            sizeRatio: 1
+          }
+        }
+      }
+    }
+    userconfigurableinformation
+    {
+    }
+    page: 'ActionBarPageData'
+    group: ''
+    index: 1
+    image: 'CODE_LINE'
+    description: '鍒堕�燣T'
+  }
+  formatversion: 2
+  id: 'ManufactureLT'
+  name: 'ManufactureLT'
+  isglobal: false
+  isroot: true
+}

--
Gitblit v1.9.3