From fd58c70e0631bdd09806ead43a573ced43f704f1 Mon Sep 17 00:00:00 2001
From: limj <limj@taizhitech.com>
Date: 星期日, 08 十月 2023 19:57:43 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lmj

---
 _Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_ListInterfaceTest_MenuCreateShowData_OnClick.def                |   10 
 _Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Response_pnlActions_btnOk_OnClick.def                           |    4 
 _Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Component_pnlContent.def                                        |   41 +
 _Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_PanelInterfaceTest_ButtonSynchronizeDataToMacroPlan_OnClick.def |    4 
 _Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetUnitOfMeasure_MP.qbl                                                     |   16 
 _Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Response_Panel391_Button655_OnClick.def                                       |   39 ++
 _Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetSalesSegment_MP.qbl                                                      |   16 
 _Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetStockingPoing_MP.qbl                                                     |   17 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl                                                                 |  181 ++++++++++
 _Main/BL/Type_Global_MappingCustomOrder/StaticMethod_CreateCustomOrder.qbl                                                       |   45 ++
 _Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_List710.def                                                         |    2 
 _Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl                                                                      |   18 
 _Main/UI/MacroPlannerWebApp/Component_FormFillingCapacityOrder/Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick.def       |   20 +
 _Main/UI/MacroPlannerWebApp/Views/Test.vw                                                                                        |  521 ----------------------------
 _Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetCurrency_MP.qbl                                                          |   16 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl                                                                |   12 
 _Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan#127.qbl                                                           |    8 
 _Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl                                                |   30 +
 _Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Order/Response_OnCreated.def                                    |   10 
 _Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_Panel391.def                                                        |   24 +
 _Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetProduct_MP.qbl                                                           |   17 
 _Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/_ROOT_Component_FrmErrorLogs.def                                              |    3 
 _Main/BL/Type_FillingCapacityOrder/Attribute_CurrencyID.qbl                                                                      |    7 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl                                                        |    2 
 _Main/BL/Type_FillingCapacityOrder/Attribute_UnitOfMeasure_MPID.qbl                                                              |    7 
 25 files changed, 515 insertions(+), 555 deletions(-)

diff --git a/_Main/BL/Type_FillingCapacityOrder/Attribute_CurrencyID.qbl b/_Main/BL/Type_FillingCapacityOrder/Attribute_CurrencyID.qbl
new file mode 100644
index 0000000..5a202bb
--- /dev/null
+++ b/_Main/BL/Type_FillingCapacityOrder/Attribute_CurrencyID.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute CurrencyID
+{
+  #keys: '3[414502.0.397320037][414502.0.397320036][414502.0.397320038]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_FillingCapacityOrder/Attribute_UnitOfMeasure_MPID.qbl b/_Main/BL/Type_FillingCapacityOrder/Attribute_UnitOfMeasure_MPID.qbl
new file mode 100644
index 0000000..938000c
--- /dev/null
+++ b/_Main/BL/Type_FillingCapacityOrder/Attribute_UnitOfMeasure_MPID.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute UnitOfMeasure_MPID
+{
+  #keys: '3[414502.0.397254634][414502.0.397254633][414502.0.397254635]'
+  ValueType: String
+}
diff --git "a/_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan\043127.qbl" "b/_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan\043127.qbl"
index c1d4c3f..ff774ec 100644
--- "a/_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan\043127.qbl"
+++ "b/_Main/BL/Type_GlobalDTOTable/Method_SynchronizeDataToMacroPlan\043127.qbl"
@@ -2,7 +2,9 @@
 #parent: #root
 Method SynchronizeDataToMacroPlan (
   MacroPlan macroPlan,
-  Boolean isUnitOfMeasure_MP
+  String executionUser,
+  Boolean isUnitOfMeasure_MP,
+  Boolean isCustomOrder
 )
 {
   TextBody:
@@ -10,5 +12,9 @@
     if ( isUnitOfMeasure_MP ) {
       Global_MappingUnitOfMeasure_MP::SynchronizeMacroPlanData( this, macroPlan );
     }
+    
+    if ( isCustomOrder ) {
+      Global_MappingCustomOrder::SynchronizeMacroPlanData( this, macroPlan, executionUser );
+    }
   *]
 }
diff --git a/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_CreateCustomOrder.qbl b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_CreateCustomOrder.qbl
new file mode 100644
index 0000000..f07437b
--- /dev/null
+++ b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_CreateCustomOrder.qbl
@@ -0,0 +1,45 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod CreateCustomOrder (
+  GlobalOTDTable globalOTDTable,
+  MacroPlan macroPlan
+)
+{
+  TextBody:
+  [*
+    traverse ( globalOTDTable, Global_MappingCustomOrder, gmco ) {
+      targetProduct_MP := Global_MappingCustomOrder::GetProduct_MP( macroPlan, gmco );
+      targetStockingPoint_MP := Global_MappingCustomOrder::GetStockingPoing_MP( macroPlan, gmco );
+      Global_MappingCustomOrder::GetSalesSegment_MP( macroPlan, gmco );
+      Global_MappingCustomOrder::GetCurrency_MP( macroPlan, gmco );
+      Global_MappingCustomOrder::GetUnitOfMeasure_MP( macroPlan, gmco );
+      
+      targetCustomerOrder := CustomerOrder::Create( targetProduct_MP,
+                                                    targetStockingPoint_MP,
+                                                    gmco.ID(),
+                                                    gmco.OrderDate(),
+                                                    gmco.Quantity(),
+                                                    gmco.Price(),
+                                                    "Normal",
+                                                    gmco.SalesSegmentName(),
+                                                    gmco.CurrencyID(),
+                                                    gmco.UnitOfMeasureName(),
+                                                    false,
+                                                    gmco.Customer(),
+                                                    gmco.CustomerID(),
+                                                    gmco.OrderID(),
+                                                    gmco.OrderLineID(),
+                                                    true,
+                                                    true,
+                                                    false
+                                                   );
+      targetCustomerOrder.BusinessType( gmco.BusinessType() );
+      targetCustomerOrder.OrderType( gmco.OrderType() );
+      targetCustomerOrder.IsAvailable( gmco.IsAvailable() );
+      targetCustomerOrder.ProductGrade( gmco.ProductGrade() );
+      targetCustomerOrder.SegmentPriority( gmco.SegmentPriority() );
+      targetCustomerOrder.SheetProfitability( gmco.SheetProfitability() );
+      targetCustomerOrder.OrderTime( gmco.OrderTime() );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetCurrency_MP.qbl b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetCurrency_MP.qbl
new file mode 100644
index 0000000..f4d504d
--- /dev/null
+++ b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetCurrency_MP.qbl
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetCurrency_MP (
+  MacroPlan macroPlan,
+  Global_MappingCustomOrder gmco
+)
+{
+  TextBody:
+  [*
+    isExists := exists( macroPlan, Currency_MP, tempCMP, tempCMP.ID() = gmco.CurrencyID() );
+    
+    if ( not isExists ) {
+      Currency_MP::Create( gmco.CurrencyID(), macroPlan, gmco.CurrencyID(), "", false, false );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetProduct_MP.qbl b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetProduct_MP.qbl
new file mode 100644
index 0000000..ba6e469
--- /dev/null
+++ b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetProduct_MP.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetProduct_MP (
+  MacroPlan macroPlan,
+  Global_MappingCustomOrder gmco
+) as Product_MP
+{
+  TextBody:
+  [*
+    targetProduct_MP := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = gmco.ProductID() );
+    if ( isnull( targetProduct_MP ) ) {
+      targetProduct_MP := Product_MP::Create( gmco.ProductID(), macroPlan, null( Product_MP ), gmco.ProductID(), null( SupplyChainView ), 0, 0, false );
+    }
+    
+    return targetProduct_MP;
+  *]
+}
diff --git a/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetSalesSegment_MP.qbl b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetSalesSegment_MP.qbl
new file mode 100644
index 0000000..2e2e473
--- /dev/null
+++ b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetSalesSegment_MP.qbl
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetSalesSegment_MP (
+  MacroPlan macroPlan,
+  Global_MappingCustomOrder gmco
+)
+{
+  TextBody:
+  [*
+    isExists := exists( macroPlan, SalesSegment_MP, tempSSMP, tempSSMP.Name() = gmco.SalesSegmentName() );
+    
+    if ( not isExists ) {
+      SalesSegment_MP::Create( macroPlan, "", gmco.SalesSegmentName(), 0, false );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetStockingPoing_MP.qbl b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetStockingPoing_MP.qbl
new file mode 100644
index 0000000..37d8b42
--- /dev/null
+++ b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetStockingPoing_MP.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetStockingPoing_MP (
+  MacroPlan macroPlan,
+  Global_MappingCustomOrder gmco
+) as StockingPoint_MP
+{
+  TextBody:
+  [*
+    targetStockingPoint_MP := select( macroPlan, StockingPoint_MP, tempSPMP, tempSPMP.ID() = gmco.StockingPointID() );
+    if ( isnull( targetStockingPoint_MP ) ) {
+      targetStockingPoint_MP := StockingPoint_MP::Create( gmco.StockingPointID(), macroPlan, null( Unit ), gmco.StockingPointID(), null( SupplyChainView ), 0, 0, false );
+    }
+    
+    return targetStockingPoint_MP;
+  *]
+}
diff --git a/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetUnitOfMeasure_MP.qbl b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetUnitOfMeasure_MP.qbl
new file mode 100644
index 0000000..b85c24d
--- /dev/null
+++ b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_GetUnitOfMeasure_MP.qbl
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GetUnitOfMeasure_MP (
+  MacroPlan macroPlan,
+  Global_MappingCustomOrder gmco
+)
+{
+  TextBody:
+  [*
+    isExists := exists( macroPlan, UnitOfMeasure_MP, tempUOMMP, tempUOMMP.Name() = gmco.UnitOfMeasureName() );
+    
+    if ( not isExists ) {
+      UnitOfMeasure_MP::Create( macroPlan, gmco.UnitOfMeasureName(), false, false );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl
new file mode 100644
index 0000000..5365af6
--- /dev/null
+++ b/_Main/BL/Type_Global_MappingCustomOrder/StaticMethod_SynchronizeMacroPlanData.qbl
@@ -0,0 +1,30 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SynchronizeMacroPlanData (
+  GlobalOTDTable globalOTDTable,
+  MacroPlan macroPlan,
+  String executionUser
+)
+{
+  TextBody:
+  [*
+    global_BrokerExecuteLog := globalOTDTable.Global_BrokerExecuteLog( relnew,
+                                                                       Name        := "鍚屾璁㈠崟鏁版嵁",
+                                                                       IsSuccess   := true,
+                                                                       ExecuteUser := executionUser
+                                                                      );
+                                            
+      Global_MappingCustomOrder::CreateCustomOrder( globalOTDTable, macroPlan );
+    try {
+      
+      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
+      global_BrokerExecuteLog.SuccessDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
+    } onerror {
+      global_BrokerExecuteLog.IsSuccess( false );
+      global_BrokerExecuteLog.ErrorNo( e.ErrorNr() );
+      global_BrokerExecuteLog.ErrorMessage( e.GeneralInformation() );
+      global_BrokerExecuteLog.ErrorDateTime( DateTime::ActualTime().Format( "Y-M-D H2:m:s" ) );
+      global_BrokerExecuteLog.ExecutionStatus( "Complete" );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
index 850417c..2f75b5f 100644
--- a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
@@ -24,10 +24,10 @@
     strMsg :="";
     
     try{
-      if( Owner.MappingBOM(relsize )>0)
+      if( GlobData.Global_MappingOperationBOM(relsize )>0)
       {
         // 寰楀埌涓嬩竴绾ф暟鎹�
-        AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ComponentCode()=ParentSKU);
+        AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ProductCode()=ParentSKU);
         ObjProduct := null( Product_MP,constcontent );
         ObjUnit := null( Unit,constcontent );
         MaterialType:="";
@@ -51,24 +51,24 @@
           traverse( AllData,Elements,Obj,not isnull( Obj))
           {
             // 寰楀埌褰撳墠宸插瓨鍦ㄧ殑鐗╂枡淇℃伅锛堣鍗旾D + SKU锛�
-            ObjMaterial := select( Owner,H_MaterialInfo,ObjM,ObjM.ForecastID()=ForecastId and ObjM.SKU()=Obj.ProductCode());
+            ObjMaterial := select( Owner,H_MaterialInfo,ObjM,ObjM.ForecastID()=ForecastId and ObjM.SKU()=Obj.ComponentCode());
             if( isnull( ObjMaterial))
             {
               // 鐗╂枡绫诲瀷
               MaterialType := Obj.ProductType();
               // 寰楀埌鐗╂枡淇℃伅
-              ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner,Obj.ProductCode());
+              ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner,Obj.ComponentCode());
               if( not isnull( ObjProduct))
               {
                 MaterialType:= ObjProduct.ParentID();
                 MaterialName:=ObjProduct.Name();
               }
-              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ProductCode());
+              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ComponentCode());
               if( not isnull( ObjUnit))
               {
                 StockPoint:= ObjUnit.Name();
               }
-              Owner.H_MaterialInfo(relnew,ParentSKU := Obj.ComponentCode(),SKU := Obj.ProductCode(),ForecastID := ForecastId,OrgCode := Obj.OrganCode(),VCode := VCode
+              Owner.H_MaterialInfo(relnew,ParentSKU := ParentSKU,SKU := Obj.ComponentCode(),ForecastID := ForecastId,OrgCode := Obj.OrganCode(),VCode := VCode
                                     ,ID := H_FunctionClass::SM_GenerateID( "MI"),MaterialType := MaterialType,NeedDate := NDate
                                     ,NeedQty := [Number](ProductQty/NRate*NComponentsUsed).Round( 0),Unit := Obj.UnitOfMeasureName()
                                     ,StockPoint :=StockPoint,MaterialName := MaterialName );
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl
new file mode 100644
index 0000000..4379bdc
--- /dev/null
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl
@@ -0,0 +1,181 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_OrderHedgingEx (
+  MacroPlan Owner,
+  String Operator
+) as owning JSON
+{
+  Description: '濉骇鍚庡啿鍑�'
+  TextBody:
+  [*
+    /*******************************濉骇鍚庤鍗曞啿鍑�***********************
+    *鍑芥暟鍚嶇О锛歋M_OrderHedgingEx
+    *鍒� 寤� 浜猴細yunying
+    *鍒涘缓鏃堕棿锛�2023-09-27
+    *鎻�    杩帮細濉骇鍚庤鍗曞啿鍑�,濉骇鍚庣殑琛細Owner.FillingCapacityOrder
+    *鍙�    鏁帮細Operator 鎿嶄綔浜�
+    *杩� 鍥� 鍊硷細JSON {Status: true 鎴愬姛/false 澶辫触,Msg:"鎻愮ず娑堟伅",Count: 0锛堝啿鍑忚鍗曠殑鏁伴噺锛墋
+    *******************************************************************/
+    // 鍒濆鍖栫粨鏋�
+    bStatus := false;
+    strMsg :="";
+    // 鍐插噺鎴愬姛鏉℃暟
+    nCount:=0;
+    try
+    {
+      if(not isnull( Owner))
+      {
+        // 鑾峰彇鎿嶄綔璁㈠崟
+        NewOrders := selectset( Owner,FillingCapacityOrder,Obj,Obj.State() = "鏈啿鍑�" or Obj.State() ="");
+        if(NewOrders.Size()>0)
+        {
+          // 鏂拌鍗曚笌鍘熻鍗曞啿鍑�
+          traverse( NewOrders,Elements,Obj)
+          {
+            if( (Obj.OrderType()="鍙嶇" or Obj.OrderType()="鎺堟潈") and Obj.Quantity()>0 )
+            {
+              // 寰楀埌鎿嶄綔鐩稿叧鐨勫弽绛捐鍗�
+              ROrders:= select( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder,
+                                   ObjOrder.CustomerName() = Obj.Customer() 
+                                   and ObjOrder.ProductID()=Obj.ProductID() 
+                                   and ObjOrder.OrderTag() ="鍙嶇"
+                                   );
+              // 鍙嶇鏃犲啿鍑忥紝鐩存帴鍚戣鍗曚腑鍔犲叆鍙嶇鏁版嵁
+              if( Obj.OrderType()="鍙嶇")
+              {
+                if( not isnull( ROrders))
+                {
+                  ROrders.Quantity(ROrders.Quantity()+Obj.Quantity());
+                }
+                else
+                {
+                  // 鏂板璁㈠崟
+                  error( "----------------璇峰疄鐜版柊澧炲弽绛捐鍗曞姛鑳戒唬鐮�---------------------");
+                  // 璁㈠崟蹇呰淇℃伅濡備笅锛�
+                  // OrderTag = "鍙嶇"
+                  // Quantity = Obj.Quantity()
+                  // 鍏朵粬淇℃伅缁ф壙褰撳墠鐨勮鍗�
+                }
+              }
+              else if(Obj.OrderType()="鎺堟潈")
+              {
+                // 寰楀埌鎿嶄綔鐩稿叧鐨勬巿鏉冭鍗�
+                AOrders:= select( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder,
+                                   ObjOrder.CustomerName() = Obj.Customer() 
+                                   and ObjOrder.ProductID()=Obj.ProductID() 
+                                   and ObjOrder.OrderTag() ="鎺堟潈"
+                                   );
+                if( not isnull( ROrders))
+                {
+                  // 褰撳墠鍙嶇鏁伴噺
+                  RQty:=ROrders.Quantity();
+                  // 璁$畻鏂扮殑鎺堟潈鏁伴噺
+                  AQty:= Obj.Quantity() - ROrders.Quantity();
+                  // 鎺堟潈澶т簬0锛屽弽绛捐鍐叉病,鍚﹀垯鎺堟潈琚啿锛屽弽绛剧瓑浜嶢Qty鐨勭粷瀵瑰��
+                  if( AQty>=0)
+                  {
+                    RQty:=0;
+                  }
+                  else
+                  {
+                    RQty :=ROrders.Quantity() - Obj.Quantity();
+                    AQty :=0;
+                  }
+                  // 鏇存柊鍙嶇鏁版嵁
+                  if( RQty>=0)
+                  {
+                    ROrders.Quantity(RQty);
+                  }
+                  else
+                  {
+                    ROrders.Delete();
+                  }
+                  // 鏇存柊鎺堟潈鏁版嵁
+                  if(AQty>0 )
+                  {
+                    if( not isnull( AOrders))
+                    {
+                      AOrders.Quantity(AOrders.Quantity()+AQty);
+                    }
+                    // 鏂板鎺堟潈璁㈠崟
+                    // error( "----------------璇峰疄鐜版柊澧炴巿鏉冭鍗曞姛鑳戒唬鐮�---------------------");
+                    customOrder := CustomerOrder::Create( select( Owner, Product_MP, tmepPMP, tmepPMP.ID() = Obj.ProductID() ),
+                                                          select( Owner, StockingPoint_MP, tempSPMP, tempSPMP.ID() = Obj.StockingPointID() ),
+                                                          OS::GenerateGUIDAsString(),
+                                                          Obj.OrderDate(),
+                                                          AQty,
+                                                          0.0,
+                                                          "Normal",
+                                                          Obj.SalesSegmentName(),
+                                                          Obj.CurrencyID(),
+                                                          Obj.UnitOfMeasureName(),
+                                                          false,
+                                                          Obj.Customer(),
+                                                          Obj.CustomerID(),
+                                                          "",
+                                                          "",
+                                                          true,
+                                                          true,
+                                                          false
+                                                         );
+                    customOrder.OrderTag( "鎺堟潈" );
+                    // 璁㈠崟蹇呰淇℃伅濡備笅锛�
+                    // OrderTag = "鎺堟潈"
+                    // Quantity = AQty
+                    // 鍏朵粬淇℃伅缁ф壙褰撳墠鐨勮鍗�  
+                  }
+                }
+                else
+                {
+                  // 灏嗘柊鎺堟潈鏁版嵁绱姞鍒拌鍗曚腑
+                  if( not isnull( AOrders))
+                  {
+                    AOrders.Quantity(AOrders.Quantity()+Obj.Quantity());
+                  }
+                  else
+                  {
+                    // 鏂板鎺堟潈璁㈠崟
+                    error( "----------------璇峰疄鐜版柊澧炴巿鏉冭鍗曞姛鑳戒唬鐮�---------------------");
+                    // 璁㈠崟蹇呰淇℃伅濡備笅锛�
+                    // OrderTag = "鎺堟潈"
+                    // Quantity = Obj.Quantity()
+                    // 鍏朵粬淇℃伅缁ф壙褰撳墠鐨勮鍗�
+                  }
+                }
+              }
+              // 鏇存柊鍐插噺鐘舵��
+              Obj.State("宸插啿鍑�");
+              nCount++;
+            }
+            else
+            {
+              // 鏃犳硶璇嗗埆鐨勭被鍨嬶紝鎴栨暟閲忎负0鏃舵殏涓嶅鐞�
+              //strMsg :="璁㈠崟绫诲瀷锛�" + Obj.OrderType() + "鏃犳硶鍐插噺锛�";
+            }
+          }
+          bStatus:=true;
+          strMsg :="濉骇鍚庡啿鍑忓畬鎴愶紒";
+        }
+        else
+        {
+          strMsg :="鏃犲彲鍐插噺鐨勬暟鎹紒";
+        }
+      }
+      else
+      {
+        strMsg :="鍔犺浇鏁版嵁澶辫触锛岃鍒涘缓鎴栭�夋嫨鍦烘櫙鍚庡啀鎿嶄綔锛�";
+      }
+    }
+    onerror
+    {
+      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());                
+    }
+    return JSON::Object().Add( "Status",bStatus)
+                         .Add( "Count",nCount)
+                         .Add( "Msg",strMsg).Build();
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl
index a74b90f..2b201ca 100644
--- a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderReverseOrAuthorize.qbl
@@ -39,7 +39,7 @@
         nReverseQtyNew :=0;   //璁$畻鍚庣殑鍙嶇鏁伴噺
         nAuthorizeQtyNew :=0; //璁$畻鍚庣殑鎺堟潈鏁伴噺
         nHaveForecastQty :=0; //鏈夐娴嬫暟閲�
-        nNoHaveForecastQty:=0;//浜旈娴嬫暟閲�
+        nNoHaveForecastQty:=0;//鏃犻娴嬫暟閲�
         // 鑾峰彇棰勬祴鏁伴噺锛堝鎴�+SKU+鏈堜唤 鐞嗚鏄病鏈夌墿鏂欓娴嬶級
         OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = SKU 
                                               and Obj.CustomCode() = CustomerCode 
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
index 9a458dd..219bbfc 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationCostData.qbl
@@ -10,24 +10,22 @@
   [*
     // Administrator Aug-21-2023 (created)
     // list to deal
-    listtodeal := construct( structured[MappingOperation] );
+    listtodeal := construct( structured[Global_MappingOperation] );
     
     if( isnull( businesstypes ) or businesstypes.Size() = 0 ) {
-        listtodeal := selectset( this, MappingOperation, item, true );
+        listtodeal := selectset( globalOTDTable, Global_MappingOperation, item, true );
     } else {
         organcodelist := selectvalues( globalOTDTable, BusinessType.OrganCode, organ, businesstypes.Find( organ.BusinessType().BusinessTypeName() ) <> -1, organ.OrganCodeName() );
-        listtodeal := selectset( this, 
-                                 MappingOperation, 
+        listtodeal := selectset( globalOTDTable, Global_MappingOperation, 
                                  item, 
                                  ( businesstypes.Find( item.BusinessType() ) <> -1 ) and 
                                  ( organcodelist.Find( item.OrganCode() ) >= 0 ) );
     }
     
     // Get the list to deal with max sequence number
-    listtodealwithmaxsn := construct( structured[MappingOperation] );
+    listtodealwithmaxsn := construct( structured[Global_MappingOperation] );
     traverse( listtodeal, Elements, item ){
-      maxsn := maxselect( this, 
-                          MappingOperation, 
+      maxsn := maxselect( globalOTDTable, Global_MappingOperation, 
                           moperation, 
                           moperation.OrganCode() = item.OrganCode(), 
                           moperation.ProductID() = item.ProductID(), 
@@ -47,7 +45,7 @@
       if( count - [Number](count/1000) * 1000 = 0 or count = totalcount ){
         info( "Now is dealing with the " + count.AsQUILL() + "OperationCost " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" );
         }
-      id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection();
+      id := item.OrganCode() + "_" + item.ProductID() + "_" + item.ProcessSection()+"_" + [String]item.SequenceNumber();
       if( guard( item.Line(), "" ).Length() > 0 ) {
           id := id + "_" + item.Line();
         }
@@ -56,8 +54,8 @@
       isfromdb := false;
       existoperationcost := OperationCost::FindOperationCostTypeIndex( id );
       if( isnull( existoperationcost ) ){
-        connecteditem := select( this, 
-                                 MappingOperationCost, 
+        connecteditem := select( globalOTDTable, 
+                                 Global_MappingOperationCost,
                                  moperationcost, 
                                  moperationcost.OrgCode() = item.OrganCode(), 
                                  moperationcost.ProductID() = item.ProductID() );
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Component_pnlContent.def b/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Component_pnlContent.def
index 911ba95..f2ee867 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Component_pnlContent.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Component_pnlContent.def
@@ -70,7 +70,7 @@
         DataBinding: 'DataHolderFillingCapacityOrder.Data.Quantity'
         Label: '鏁伴噺'
         Mask: 'REAL'
-        Taborder: 12
+        Taborder: 13
       ]
     }
     Component dropDownStringListUnitOfMeasureName id:dropDownStringListUnitOfMeasureName_750
@@ -97,7 +97,7 @@
         DataBinding: 'DataHolderFillingCapacityOrder.Data.SalesAmount'
         Label: '閿�鍞'
         Mask: 'NUMBER'
-        Taborder: 13
+        Taborder: 14
       ]
     }
     Component dsDemandDate
@@ -108,7 +108,7 @@
       [
         DataBinding: 'DataHolderFillingCapacityOrder.Data.DemandDate'
         Label: '闇�姹傛棩鏈�'
-        Taborder: 15
+        Taborder: 16
       ]
     }
     Component dsForecastDemandDate
@@ -119,7 +119,7 @@
       [
         DataBinding: 'DataHolderFillingCapacityOrder.Data.ForecastDemandDate'
         Label: '棰勬湡闇�姹傛棩鏈�'
-        Taborder: 14
+        Taborder: 15
       ]
     }
     Component ddlSalesSegment
@@ -268,7 +268,7 @@
       [
         DataBinding: 'DataHolderFillingCapacityOrder.Data.Customer'
         Label: 'Customer name'
-        Taborder: 10
+        Taborder: 11
       ]
     }
     Component efCustomID
@@ -278,7 +278,7 @@
       Properties:
       [
         Label: 'Customer ID'
-        Taborder: 11
+        Taborder: 12
       ]
     }
     Component ddslOrderType
@@ -290,7 +290,34 @@
         DataBinding: 'DataHolderFillingCapacityOrder.Data.OrderType'
         Label: '璁㈠崟绫诲瀷'
         Strings: '鍙嶇;鎺堟潈'
-        Taborder: 16
+        Taborder: 17
+      ]
+    }
+    Component ddlCurrency_MP
+    {
+      #keys: '[414502.0.395021898]'
+      BaseType: 'WebDropDownList'
+      Databinding: 'Currency_MP'
+      Children:
+      [
+        Component deContent593
+        {
+          #keys: '[414502.0.395021900]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'MacroPlan'
+            Source: 'MacroPlan'
+            Taborder: 0
+            Transformation: 'Currency_MP'
+          ]
+        }
+      ]
+      Properties:
+      [
+        DisplayField: 'Name'
+        Label: '璐у竵'
+        Taborder: 10
       ]
     }
   ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Response_pnlActions_btnOk_OnClick.def
index 184dfb0..bf61706 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Response_pnlActions_btnOk_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogFillingCapacityOrder/Response_pnlActions_btnOk_OnClick.def
@@ -35,7 +35,8 @@
                                         ForecastDemandDate := dsForecastDemandDate.Date(),
                                         DemandDate         := dsDemandDate.Date(),
                                         OrderType          := ddslOrderType.Text(),
-                                        SalesAmount        := [Number]edtSalesAmount.Text()
+                                        SalesAmount        := [Number]edtSalesAmount.Text(),
+                                        CurrencyID         := ddlCurrency_MP.Data().ID()
                                        );
       } else {
         data.ProductID( guard( ddlProduct_MP.Data().ID(), "null" ) );
@@ -49,6 +50,7 @@
         data.DemandDate( dsDemandDate.Date() );
         data.OrderType( ddslOrderType.Text() );
         data.SalesAmount( [Number]edtSalesAmount.Text() );
+        data.CurrencyID( ddlCurrency_MP.Data().ID() );
       }
       
       Form.Close();
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormFillingCapacityOrder/Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormFillingCapacityOrder/Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick.def
new file mode 100644
index 0000000..1ea13f8
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormFillingCapacityOrder/Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick.def
@@ -0,0 +1,20 @@
+Quintiq file version 2.0
+#parent: PanelFillingCapacityOrder/ButtonDeduct
+Response OnClick () id:Response_PanelFillingCapacityOrder_ButtonDeduct_OnClick
+{
+  #keys: '[414502.0.395021805]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  Precondition:
+  [*
+    return not isnull( MacroPlan );
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      H_FunctionClass::SM_OrderHedgingEx( MacroPlan, ApplicationMacroPlanner.GetUserName() );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_ListInterfaceTest_MenuCreateShowData_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_ListInterfaceTest_MenuCreateShowData_OnClick.def
index 052d40d..afeef73 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_ListInterfaceTest_MenuCreateShowData_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_ListInterfaceTest_MenuCreateShowData_OnClick.def
@@ -8,6 +8,16 @@
   CanBindMultiple: false
   DefinitionID => /ListInterfaceTest/Responsedef_ListInterfaceTest_WebMenu_OnClick
   Initiator: 'MenuCreateShowData'
+  Precondition:
+  [*
+    flag := selection.BrokerName() = "GlobalOTDTable_CustomOrder"
+    
+    if ( not flag ) {
+      feedback := "鏆備笉鏀寔锛侊紒锛�";
+    }
+      
+    return flag;
+  *]
   QuillAction
   {
     Body:
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_PanelInterfaceTest_ButtonSynchronizeDataToMacroPlan_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_PanelInterfaceTest_ButtonSynchronizeDataToMacroPlan_OnClick.def
index 0b714ed..4596f3c 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_PanelInterfaceTest_ButtonSynchronizeDataToMacroPlan_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInterfaceTest/Response_PanelInterfaceTest_ButtonSynchronizeDataToMacroPlan_OnClick.def
@@ -14,7 +14,9 @@
     Body:
     [*
       GlobalOTDTable.SynchronizeDataToMacroPlan( MacroPlan, 
-                                                 CheckboxUnitOfMeasure_MP.Checked()
+                                                 ApplicationMacroPlanner.GetUserName(),
+                                                 CheckboxUnitOfMeasure_MP.Checked(),
+                                                 CheckboxCustomOrder.Checked()
                                                 );
       
       WebMessageBox::Success( "鍚屾鎴愬姛锛�", true );
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Order/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Order/Response_OnCreated.def
index 7c4d5f5..76d2c45 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Order/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Order/Response_OnCreated.def
@@ -23,18 +23,10 @@
           lb_SKUCode_FAAC.Text(SelForecast.Get( "SKU").GetString());
           lb_SKUName_FAAC.Text("浜у搧");
           lb_Util_FAAC.Text(SelForecast.Get( "Util").GetString());
+          lb_SKUName_FAAC.Text(SelForecast.Get( "SKUName").GetString());
           txt_CustomID_FAAC.Text(SelForecast.Get( "CustomCode").GetString());
           txt_CustomName_FAAC.Text(SelForecast.Get( "CustomName").GetString());
           lb_Operator_FAAC.Text(ApplicationMacroPlanner.GetUserName());
-          
-      //    StrValue := SelectItem.Value().Tokenize( ";");
-      //    lb_SKUCode_FAAC.Text(StrValue.Element( 0));
-      //    lb_SKUName_FAAC.Text("浜у搧");
-      //    lb_Operator_FAAC.Text("");
-      //    lb_Util_FAAC.Text(StrValue.Element( 1));
-      //    txt_CustomID_FAAC.Text(StrValue.Element( 2));
-      //    txt_CustomName_FAAC.Text(StrValue.Element( 3));
-      //    lb_Operator_FAAC.Text(ApplicationMacroPlanner.GetUserName());
         }
       }
     *]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_List710.def b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_List710.def
index 975cea9..bd6d61d 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_List710.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_List710.def
@@ -36,6 +36,6 @@
   ]
   Properties:
   [
-    Taborder: 1
+    Taborder: 2
   ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_Panel391.def b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_Panel391.def
new file mode 100644
index 0000000..c27e0ed
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Component_Panel391.def
@@ -0,0 +1,24 @@
+Quintiq file version 2.0
+Component Panel391
+{
+  #keys: '[414724.0.193860534]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component Button655
+    {
+      #keys: '[414724.0.193860558]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'BULL'
+        Label: '濉骇鍐插噺'
+        Taborder: 0
+      ]
+    }
+  ]
+  Properties:
+  [
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Response_Panel391_Button655_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Response_Panel391_Button655_OnClick.def
new file mode 100644
index 0000000..821d8ed
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/Response_Panel391_Button655_OnClick.def
@@ -0,0 +1,39 @@
+Quintiq file version 2.0
+#parent: Panel391/Button655
+Response OnClick () id:Response_Panel391_Button655_OnClick
+{
+  #keys: '[414724.0.194975663]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  Precondition:
+  [*
+    return not isnull( MacroPlan);
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      HResult := H_FunctionClass::SM_OrderHedgingEx( MacroPlan,"娴嬭瘯鐢ㄦ埛" );
+      Msg := HResult.Get( "Msg").GetString();
+      if( HResult.Get( "Status").GetBoolean())
+      {
+        if( Msg.Length()>0)
+        {
+          WebMessageBox::Information(Msg); 
+        }
+      }
+      else
+      {
+        if( Msg.Length()>0)
+        {
+          WebMessageBox::Warning(Msg);
+        }
+        else
+        {
+          WebMessageBox::Information("杩愯閿欒锛�"); 
+        }
+      }
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/_ROOT_Component_FrmErrorLogs.def b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/_ROOT_Component_FrmErrorLogs.def
index 23776ce..81eec9c 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/_ROOT_Component_FrmErrorLogs.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmErrorLogs/_ROOT_Component_FrmErrorLogs.def
@@ -30,9 +30,10 @@
       ]
       Properties:
       [
-        Taborder: 0
+        Taborder: 1
       ]
     }
+    #child: Panel391
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Views/Test.vw b/_Main/UI/MacroPlannerWebApp/Views/Test.vw
index 36dff5d..1a6fe97 100644
--- a/_Main/UI/MacroPlannerWebApp/Views/Test.vw
+++ b/_Main/UI/MacroPlannerWebApp/Views/Test.vw
@@ -310,6 +310,10 @@
         }
         components
         {
+          FormFillingCapacityOrder_PanelFillingCapacityOrder
+          {
+            sizeRatio: 1
+          }
           FormFillingCapacityOrder_ListFillingCapacityOrder
           {
           }
@@ -430,523 +434,6 @@
               dataPath: 'OrderType'
               dataType: 'string'
               index: 12
-              subtotals: ''
-              width: 150
-            }
-          }
-        }
-      }
-      form_FormPriorityPolicy
-      {
-        title: 'QTIANMA_JITUAN::FormPriorityPolicy'
-        shown: true
-        componentID: 'QTIANMA_JITUAN::FormPriorityPolicy'
-        layout
-        {
-          mode: 'open'
-          rowPosition: 32
-          rowSpan: 13
-          columnPosition: 5
-          columnSpan: 8
-        }
-        components
-        {
-          FormPriorityPolicy_ListPriorityPolicy
-          {
-          }
-          FormPriorityPolicy_DataSetLevelPriorityPolicy
-          {
-            groupDepth: -1
-            column_Name
-            {
-              columnId: 'Name'
-              dataPath: 'Name'
-              dataType: 'string'
-              index: 0
-              subtotals: ''
-              width: 150
-            }
-            column_Formula
-            {
-              columnId: 'Formula'
-              dataPath: 'Formula'
-              dataType: 'string'
-              index: 1
-              subtotals: ''
-              width: 150
-            }
-            column_CalculateValue
-            {
-              columnId: 'CalculateValue'
-              dataPath: 'CalculateValue'
-              dataType: 'string'
-              index: 2
-              subtotals: ''
-              width: 150
-            }
-            column_Desc
-            {
-              columnId: 'Desc'
-              dataPath: 'Desc'
-              dataType: 'string'
-              index: 3
-              subtotals: ''
-              width: 150
-            }
-          }
-          FormPriorityPolicy_PanelPriorityPolicyOperation
-          {
-            sizeRatio: 1
-          }
-          FormPriorityPolicy_PanelPriorityPolicyOperationButton
-          {
-            sizeRatio: 1
-          }
-          FormPriorityPolicy_PanelPriorityPolicyCoefficient
-          {
-            sizeRatio: 1
-          }
-        }
-      }
-      form_FormPriorityResult
-      {
-        title: 'QTIANMA_JITUAN::FormPriorityResult'
-        shown: true
-        componentID: 'QTIANMA_JITUAN::FormPriorityResult'
-        layout
-        {
-          mode: 'open'
-          rowPosition: 45
-          rowSpan: 17
-          columnPosition: 1
-          columnSpan: 12
-        }
-        components
-        {
-          FormPriorityResult_PanelPriorityResult
-          {
-            sizeRatio: 1
-          }
-          FormPriorityResult_ListPriorityResult
-          {
-          }
-          FormPriorityResult_DataSetLevelPriorityResult
-          {
-            groupDepth: -1
-            column_SalesSegmentName
-            {
-              columnId: 'SalesSegmentName'
-              dataPath: 'SalesSegmentName'
-              dataType: 'string'
-              index: 0
-              subtotals: ''
-              width: 150
-            }
-            column_ProductID
-            {
-              columnId: 'ProductID'
-              dataPath: 'ProductID'
-              dataType: 'string'
-              index: 1
-              subtotals: ''
-              width: 150
-            }
-            column_StockingPointID
-            {
-              columnId: 'StockingPointID'
-              dataPath: 'StockingPointID'
-              dataType: 'string'
-              index: 2
-              subtotals: ''
-              width: 150
-            }
-            column_Customer
-            {
-              columnId: 'Customer'
-              dataPath: 'Customer'
-              dataType: 'string'
-              index: 3
-              subtotals: ''
-              width: 150
-            }
-            column_BusinessType
-            {
-              columnId: 'BusinessType'
-              dataPath: 'BusinessType'
-              dataType: 'string'
-              index: 4
-              subtotals: ''
-              width: 150
-            }
-            column_Quantity
-            {
-              columnId: 'Quantity'
-              dataPath: 'Quantity'
-              dataType: 'real'
-              index: 5
-              subtotals: ''
-              width: 150
-            }
-            column_UnitOfMeasureName
-            {
-              columnId: 'UnitOfMeasureName'
-              dataPath: 'UnitOfMeasureName'
-              dataType: 'string'
-              index: 6
-              subtotals: ''
-              width: 150
-            }
-            column_DemandDate
-            {
-              columnId: 'DemandDate'
-              dataPath: 'DemandDate'
-              dataType: 'date'
-              index: 7
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityResultScore
-            {
-              columnId: 'PriorityResultScore'
-              dataPath: 'PriorityResultScore'
-              dataType: 'real'
-              index: 8
-              subtotals: ''
-              width: 150
-            }
-          }
-          FormPriorityResult_PanelPriorityResultDetails
-          {
-            sizeRatio: 1
-          }
-          FormPriorityResult_ListPriorityResultBusinessTypeDetails
-          {
-          }
-          FormPriorityResult_DataSetLevelPriorityResultDetails
-          {
-            groupDepth: -1
-            column_SalesSegmentName
-            {
-              columnId: 'SalesSegmentName'
-              dataPath: 'SalesSegmentName'
-              dataType: 'string'
-              index: 0
-              subtotals: ''
-              width: 150
-            }
-            column_StockingPointID
-            {
-              columnId: 'StockingPointID'
-              dataPath: 'StockingPointID'
-              dataType: 'string'
-              index: 1
-              subtotals: ''
-              width: 150
-            }
-            column_Customer
-            {
-              columnId: 'Customer'
-              dataPath: 'Customer'
-              dataType: 'string'
-              index: 2
-              subtotals: ''
-              width: 150
-            }
-            column_BusinessType
-            {
-              columnId: 'BusinessType'
-              dataPath: 'BusinessType'
-              dataType: 'string'
-              index: 3
-              subtotals: ''
-              width: 150
-            }
-            column_Quantity
-            {
-              columnId: 'Quantity'
-              dataPath: 'Quantity'
-              dataType: 'real'
-              index: 4
-              subtotals: ''
-              width: 150
-            }
-            column_UnitOfMeasureName
-            {
-              columnId: 'UnitOfMeasureName'
-              dataPath: 'UnitOfMeasureName'
-              dataType: 'string'
-              index: 5
-              subtotals: ''
-              width: 150
-            }
-            column_DemandDate
-            {
-              columnId: 'DemandDate'
-              dataPath: 'DemandDate'
-              dataType: 'date'
-              index: 6
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityResultScore
-            {
-              columnId: 'PriorityResultScore'
-              dataPath: 'PriorityResultScore'
-              dataType: 'real'
-              index: 7
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityPolicyName
-            {
-              columnId: 'PriorityPolicyName'
-              dataPath: 'PriorityPolicyName'
-              dataType: 'string'
-              index: 8
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityFactorName
-            {
-              columnId: 'PriorityFactorName'
-              dataPath: 'PriorityFactorName'
-              dataType: 'string'
-              index: 9
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityFactorGradingName
-            {
-              columnId: 'PriorityFactorGradingName'
-              dataPath: 'PriorityFactorGradingName'
-              dataType: 'string'
-              index: 10
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityTotalScore
-            {
-              columnId: 'PriorityTotalScore'
-              dataPath: 'PriorityTotalScore'
-              dataType: 'real'
-              index: 11
-              subtotals: ''
-              width: 150
-            }
-          }
-          FormPriorityResult_ListPriorityResultGroupDetails
-          {
-          }
-          FormPriorityResult_DataSetLevelPriorityResultDetails872
-          {
-            groupDepth: -1
-            column_SalesSegmentName
-            {
-              columnId: 'SalesSegmentName'
-              dataPath: 'SalesSegmentName'
-              dataType: 'string'
-              index: 0
-              subtotals: ''
-              width: 150
-            }
-            column_StockingPointID
-            {
-              columnId: 'StockingPointID'
-              dataPath: 'StockingPointID'
-              dataType: 'string'
-              index: 1
-              subtotals: ''
-              width: 150
-            }
-            column_Customer
-            {
-              columnId: 'Customer'
-              dataPath: 'Customer'
-              dataType: 'string'
-              index: 2
-              subtotals: ''
-              width: 150
-            }
-            column_BusinessType
-            {
-              columnId: 'BusinessType'
-              dataPath: 'BusinessType'
-              dataType: 'string'
-              index: 3
-              subtotals: ''
-              width: 150
-            }
-            column_Quantity
-            {
-              columnId: 'Quantity'
-              dataPath: 'Quantity'
-              dataType: 'real'
-              index: 4
-              subtotals: ''
-              width: 150
-            }
-            column_UnitOfMeasureName
-            {
-              columnId: 'UnitOfMeasureName'
-              dataPath: 'UnitOfMeasureName'
-              dataType: 'string'
-              index: 5
-              subtotals: ''
-              width: 150
-            }
-            column_DemandDate
-            {
-              columnId: 'DemandDate'
-              dataPath: 'DemandDate'
-              dataType: 'date'
-              index: 6
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityResultScore
-            {
-              columnId: 'PriorityResultScore'
-              dataPath: 'PriorityResultScore'
-              dataType: 'real'
-              index: 7
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityPolicyName
-            {
-              columnId: 'PriorityPolicyName'
-              dataPath: 'PriorityPolicyName'
-              dataType: 'string'
-              index: 8
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityFactorName
-            {
-              columnId: 'PriorityFactorName'
-              dataPath: 'PriorityFactorName'
-              dataType: 'string'
-              index: 9
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityFactorGradingName
-            {
-              columnId: 'PriorityFactorGradingName'
-              dataPath: 'PriorityFactorGradingName'
-              dataType: 'string'
-              index: 10
-              subtotals: ''
-              width: 150
-            }
-            column_PriorityTotalScore
-            {
-              columnId: 'PriorityTotalScore'
-              dataPath: 'PriorityTotalScore'
-              dataType: 'real'
-              index: 11
-              subtotals: ''
-              width: 150
-            }
-          }
-        }
-      }
-      form_FormPriorityFactor
-      {
-        title: 'QTIANMA_JITUAN::FormPriorityFactor'
-        shown: true
-        componentID: 'QTIANMA_JITUAN::FormPriorityFactor'
-        layout
-        {
-          mode: 'open'
-          rowPosition: 37
-          rowSpan: 8
-          columnPosition: 1
-          columnSpan: 4
-        }
-        components
-        {
-          FormPriorityFactor_ListPriorityFactor
-          {
-          }
-          FormPriorityFactor_DataSetLevelPriorityFactor
-          {
-            groupDepth: -1
-            column_Name
-            {
-              columnId: 'Name'
-              dataPath: 'Name'
-              dataType: 'string'
-              index: 0
-              subtotals: ''
-              width: 150
-            }
-            column_Coefficient
-            {
-              columnId: 'Coefficient'
-              dataPath: 'Coefficient'
-              dataType: 'real'
-              index: 1
-              subtotals: ''
-              width: 150
-            }
-            column_Desc
-            {
-              columnId: 'Desc'
-              dataPath: 'Desc'
-              dataType: 'string'
-              index: 2
-              subtotals: ''
-              width: 150
-            }
-          }
-        }
-      }
-      form_FormPriorityFactorGrading
-      {
-        title: 'QTIANMA_JITUAN::FormPriorityFactorGrading'
-        shown: true
-        componentID: 'QTIANMA_JITUAN::FormPriorityFactorGrading'
-        layout
-        {
-          mode: 'open'
-          rowPosition: 32
-          rowSpan: 5
-          columnPosition: 1
-          columnSpan: 4
-        }
-        components
-        {
-          FormPriorityFactorGrading_ListPriorityFactorGrading
-          {
-          }
-          FormPriorityFactorGrading_DataSetLevelPriorityFactorGrading
-          {
-            groupDepth: -1
-            column_GradingName
-            {
-              columnId: 'GradingName'
-              dataPath: 'GradingName'
-              dataType: 'string'
-              index: 0
-              subtotals: ''
-              width: 150
-            }
-            column_GradeValueStr
-            {
-              columnId: 'GradeValueStr'
-              dataPath: 'GradeValueStr'
-              dataType: 'string'
-              index: 1
-              subtotals: ''
-              width: 150
-            }
-            column_GradeDesc
-            {
-              columnId: 'GradeDesc'
-              dataPath: 'GradeDesc'
-              dataType: 'string'
-              index: 2
               subtotals: ''
               width: 150
             }

--
Gitblit v1.9.3