From 2709b3e28de35a866a65fa72f589d38a43d5045b Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期日, 24 九月 2023 18:47:20 +0800
Subject: [PATCH] Merge branch 'dev_cyy' into dev

---
 _Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Response_PanelHedgingOfLog593_93_btn_Query_FHO_OnClick.def |   19 
 _Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase354.def                 |   26 +
 _Main/UI/MacroPlannerWebApp/Component_Frm_TEST/_ROOT_Component_Frm_TEST.def                                       |   61 ++
 _Main/BL/Type_H_MaterialInfo/Attribute_MaterialName.qbl                                                           |    8 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetBOMBySKU.qbl                                                     |   18 
 _Main/BL/Type_H_MaterialInfo/Attribute_NeedDate.qbl                                                               |    8 
 _Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord243.def                        |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_PanelReleaseRecord423.def                       |   26 +
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl                                                    |   22 +
 _Main/BL/Type_H_MaterialInfo/Attribute_ID.qbl                                                                     |    8 
 _Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_List212.def                                              |   41 +
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetProductInfo#1.qbl                                                |   19 
 _Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_liH_Forecast_OnDoubleClick.def                    |   21 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetALlBOM.qbl                                                       |   27 +
 _Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/_ROOT_Component_FormReleaseRecord.def                     |   12 
 _Main/BL/Type_H_MaterialInfo/Attribute_SKU.qbl                                                                    |    8 
 _Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick#975.def                    |   32 +
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastData.qbl                                              |   50 ++
 _Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_ListHedgingOfLog.def                             |    4 
 _Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_OnCreated.def                                          |    5 
 _Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord.def                           |    2 
 _Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_OrderH_FOF_OnClick.def               |   16 
 _Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_Panel224.def                                            |    1 
 _Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog221.def                         |   26 +
 _Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Material/Response_OnCreated.def                  |   20 
 _Main/BL/Type_H_MaterialInfo/Attribute_MaterialType.qbl                                                           |    8 
 _Main/UI/MacroPlannerWebApp/Component_FrmMaterial/_ROOT_Component_FrmMaterial.def                                 |    7 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastDataEx.qbl                                            |  120 +++++
 _Main/BL/Type_H_MaterialInfo/Attribute_VCode.qbl                                                                  |    8 
 _Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_List696.def                                             |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog593#93.def                      |   38 +
 _Main/BL/Type_H_MaterialInfo/_ROOT_Type_H_MaterialInfo.qbl                                                        |   10 
 _Main/BL/Type_H_Forecast/Attribute_StockingPointID.qbl                                                            |    8 
 _Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button687_OnClick.def                                     |   16 
 _Main/BL/Type_H_MaterialInfo/Attribute_ParentSKU.qbl                                                              |    8 
 _Main/BL/Type_H_MaterialInfo/Attribute_StockPoint.qbl                                                             |    8 
 _Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_List832.def                                           |    4 
 _Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listContextMenu182.def                                   |   10 
 _Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/_ROOT_Component_FormHedgingOfLog.def                       |   12 
 _Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel351.def                                     |   12 
 _Main/BL/Type_H_MaterialInfo/Attribute_NeedQty.qbl                                                                |    8 
 _Main/UI/MacroPlannerWebApp/Component_FrmOrderResult/Component_List782.def                                        |    2 
 _Main/BL/Type_H_MaterialInfo/Attribute_ForecastID.qbl                                                             |    8 
 _Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_Panel418.def                                          |   16 
 _Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Material_FOF503_OnClick#222.def  |   21 
 _Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Query_FM_OnClick.def                      |   15 
 _Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listActionBarPage441.def                                 |   10 
 _Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog.def                            |    6 
 _Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase.def                    |    4 
 /dev/null                                                                                                         |   20 
 _Main/BL/Relations/Relation_H_MaterialInfo_MacroPlan_MacroPlan_H_MaterialInfo.qbl                                 |   23 +
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl                                                 |  104 ++++
 _Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_ListReleaseRecord_OnSelectionChanged.def         |   10 
 _Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl                                                    |  200 +++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/_ROOT_Component_FormMaterialPurchase.def               |   12 
 _Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnDoubleClick.def                              |   44 ++
 _Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button593_OnClick.def                                     |   24 +
 _Main/BL/Type_H_MaterialInfo/Attribute_OrgCode.qbl                                                                |    8 
 _Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_ListMaterialPurchase.def                     |    3 
 _Main/BL/Type_H_MaterialInfo/Attribute_Unit.qbl                                                                   |    8 
 _Main/BL/Type_H_FunctionClass/_ROOT_Type_H_FunctionClass.qbl                                                      |    2 
 _Main/UI/MacroPlannerWebApp/Component_Form234/Component_List174.def                                               |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_OnCreated.def                                    |    2 
 63 files changed, 1,197 insertions(+), 108 deletions(-)

diff --git a/_Main/BL/Relations/Relation_H_MaterialInfo_MacroPlan_MacroPlan_H_MaterialInfo.qbl b/_Main/BL/Relations/Relation_H_MaterialInfo_MacroPlan_MacroPlan_H_MaterialInfo.qbl
new file mode 100644
index 0000000..075c195
--- /dev/null
+++ b/_Main/BL/Relations/Relation_H_MaterialInfo_MacroPlan_MacroPlan_H_MaterialInfo.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation H_MaterialInfo_MacroPlan_MacroPlan_H_MaterialInfo
+{
+  #keys: '1[414724.0.142347478]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide MacroPlan
+  {
+    #keys: '3[414724.0.142347480][414724.0.142347479][414724.0.142347481]'
+    Cardinality: '0to1'
+    ObjectDefinition: H_MaterialInfo
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide H_MaterialInfo
+  {
+    #keys: '3[414724.0.142347483][414724.0.142347482][414724.0.142347484]'
+    Cardinality: '1toN'
+    ObjectDefinition: MacroPlan
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Type_H_Forecast/Attribute_StockingPointID.qbl b/_Main/BL/Type_H_Forecast/Attribute_StockingPointID.qbl
new file mode 100644
index 0000000..62a27b5
--- /dev/null
+++ b/_Main/BL/Type_H_Forecast/Attribute_StockingPointID.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute StockingPointID
+{
+  #keys: '3[414724.0.149657552][414724.0.149657551][414724.0.149657553]'
+  Description: '搴撳瓨鐐�'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetALlBOM.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetALlBOM.qbl
new file mode 100644
index 0000000..5ab9f90
--- /dev/null
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetALlBOM.qbl
@@ -0,0 +1,27 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_GetALlBOM (
+  MacroPlan Owner,
+  MappingBOM Material
+) as Number
+{
+  Description: '鏍规嵁SKU鑾峰彇鏈熸牴閮ㄦ墍鏈夋暟鎹�'
+  TextBody:
+  [*
+    AllMaterials := selectset( Owner,MappingBOM,Obj,Obj.ComponentCode()=Material.ProductCode())
+    if( AllMaterials.Size()>0) 
+    {
+          traverse( AllMaterials,Elements,Obj,not isnull( Obj))
+         {
+              H_FunctionClass::SM_GetALlBOM( Owner,Obj);
+         }   
+    }
+    else
+    {
+        Owner.H_MaterialInfo(relnew,ID := H_FunctionClass::SM_GenerateID( "BM")
+                                    ,MaterialName := Material.ComponentType()  );
+      
+    }
+    return 0;
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetBOMBySKU.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetBOMBySKU.qbl
new file mode 100644
index 0000000..a10fbae
--- /dev/null
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetBOMBySKU.qbl
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_GetBOMBySKU (
+  MacroPlan Owner,
+  String SKU
+) as MappingBOM
+{
+  Description: '鏍规嵁SKU鑾峰彇BOM'
+  TextBody:
+  [*
+    Obj :=null( MappingBOM,constcontent );
+    if( not isnull( Owner) and SKU.Length()>0)
+    {
+      Obj := select( Owner,MappingBOM,ObjM,ObjM.ProductCode()=SKU);
+    }
+    return Obj;
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
new file mode 100644
index 0000000..3edc063
--- /dev/null
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
@@ -0,0 +1,104 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_GetMaterialData (
+  MacroPlan Owner,
+  String ParentSKU,
+  Number ProductQty,
+  String ForecastId,
+  String VCode,
+  Date NDate
+) as owning JSON
+{
+  Description: '鑾峰彇鐗╂枡淇℃伅'
+  TextBody:
+  [*
+    /**********************************鍒濆鍖栫墿鏂欎俊鎭�***************************************
+    *鍒涘缓浜猴細yunying
+    *鍒涘缓鏃ユ湡锛�2023-09-21 
+    *鎻忚堪锛氭牴鎹甋KU鑾峰彇涓嬩竴灞傜墿鏂欐暟鎹�,杩欓噷涓嶆槸閬嶅巻寰楀埌鎵�鏈夛紝鏃惰Е鍙戜竴娆″緱鍒颁竴灞傦紝骞剁疮璁�
+    *鍙傛暟锛�
+    *****************************************************************************************/
+    // 鍒濆鍖栫粨鏋�
+    bStatus := false;
+    strMsg :="";
+    
+    try{
+      if( Owner.MappingBOM(relsize )>0)
+      {
+        // 寰楀埌涓嬩竴绾ф暟鎹�
+        AllData:= selectset( Owner, MappingBOM,object,object.ComponentCode()=ParentSKU);
+        ObjProduct := null( MappingProduct,constcontent );
+        ObjUnit := null( Unit,constcontent );
+        MaterialType:="";
+        MaterialName:="-";
+        StockPoint := "";
+        NRate:=1.0;
+        NComponentsUsed :=0.0;
+        ObjBOM := H_FunctionClass::SM_GetBOMBySKU( Owner,ParentSKU);
+        if(not isnull( ObjBOM))
+        {
+          NRate := ObjBOM.ComponentOutputRate();
+          NComponentsUsed := ObjBOM.UnitUsageOfComponents();
+          // 浜у嚭姣斿紓甯告寜 100%浜у嚭璁$畻
+          if( NRate <=0.0)
+          {
+            NRate :=1.0;
+          }
+        }
+        if( AllData.Size()>0)
+        {
+          traverse( AllData,Elements,Obj,not isnull( Obj))
+          {
+            // 寰楀埌褰撳墠宸插瓨鍦ㄧ殑鐗╂枡淇℃伅锛堣鍗旾D + SKU锛�
+            ObjMaterial := select( Owner,H_MaterialInfo,ObjM,ObjM.ForecastID()=ForecastId and ObjM.SKU()=Obj.ProductCode());
+            if( isnull( ObjMaterial))
+            {
+              // 鐗╂枡绫诲瀷
+              MaterialType := Obj.ProductType();
+              // 寰楀埌鐗╂枡淇℃伅
+              ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner, Obj.ProductCode());
+              if( not isnull( ObjProduct))
+              {
+                MaterialType:= ObjProduct.ProductMajorType();
+                MaterialName:=ObjProduct.Name();
+              }
+              ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ProductCode());
+              if( not isnull( ObjUnit))
+              {
+                StockPoint:= ObjUnit.Name();
+              }
+              Owner.H_MaterialInfo(relnew,ParentSKU := Obj.ComponentCode(),SKU := Obj.ProductCode(),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 );
+            }
+            else
+            {
+              // 鑰冭檻鏄惁瑕佹洿鏂版暟鎹紝鏆備笉澶勭悊
+            }
+          }
+        }
+      }
+      // 娌℃湁BOM 娣诲姞娴嬭瘯鏁版嵁
+      else
+      {
+        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
+                                    ,NeedQty := [Number](ProductQty*0.8).Round( 0),Unit := "PCS"
+                                    ,StockPoint :="娴嬭瘯",MaterialName := "娴嬭瘯鏁版嵁" );
+      }
+      bStatus := true;
+      strMsg :="";
+    }
+    onerror
+    {
+      strMsg :="鍔犺浇鐗╂枡澶辫触锛岃鑱旂郴绯荤粺绠$悊鍛橈紒";
+      Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_InitialForcastData",
+                         DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
+                         GeneralInformation := e.GeneralInformation());                
+    }
+    return JSON::Object().Add( "Status",bStatus)
+                         .Add( "Msg",strMsg).Build();
+  *]
+}
diff --git "a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetProductInfo\0431.qbl" "b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetProductInfo\0431.qbl"
new file mode 100644
index 0000000..2b1ed8f
--- /dev/null
+++ "b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetProductInfo\0431.qbl"
@@ -0,0 +1,19 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_GetProductInfo (
+  MacroPlan Owner,
+  String SKU
+) as MappingProduct
+{
+  Description: '鏍规嵁SKU鑾峰彇鐗╂枡淇℃伅'
+  TextBody:
+  [*
+    // 鏍规嵁SKU鑾峰彇鐗╂枡淇℃伅
+    Obj := null( MappingProduct,constcontent );
+    if( not isnull( Owner) and SKU.Length()>0)
+    {
+      Obj:= select( Owner,MappingProduct,ObjMP,ObjMP.ID()=SKU);
+    }
+    return Obj;
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl
new file mode 100644
index 0000000..cfa808a
--- /dev/null
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl
@@ -0,0 +1,22 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_GetUnitBySKU (
+  MacroPlan Owner,
+  String SKU
+) as Unit
+{
+  Description: '閫氳繃SKU鑾峰彇搴撳瓨鐐逛俊鎭�'
+  TextBody:
+  [*
+    Obj :=null( Unit,constcontent );
+    if( not isnull( Owner) and SKU.Length()>0)
+    {
+      OrgCode := select( Owner,MappingBOM,ObjM,ObjM.ProductCode()=SKU);
+      if( not isnull( OrgCode))
+      {
+        Obj := select( Owner,Unit,ObjU,ObjU.ID()=  OrgCode.OrganCode());
+      }
+    }
+    return Obj;
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastData.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastData.qbl
index 5bf028e..edf6c16 100644
--- a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastData.qbl
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastData.qbl
@@ -17,7 +17,7 @@
     strMsg :="";
     
     try{
-      // 棰勬祴鏁版嵁2姝ゅ鐞嗭紙绛涢��+瀹㈡埛鍚嶇О鎻愬彇锛�
+      // 娓呴櫎鏃ф暟鎹紝閲嶆柊鎷夊彇
       if(Owner.H_Forecast(relget ).Size()>0)
       {
         traverse( Owner,H_Forecast,Obj,not isnull( Obj))
@@ -25,6 +25,8 @@
           Owner.H_Forecast(reldelete, Obj);
         }
       }
+      
+      // 鑾峰彇棰勬祴璁㈠崟锛氬綋鏈堝拰涔嬪悗鐨�3涓湀棰勬祴鏁版嵁 涓旈娴嬫暟閲�>0鐨�
       AllData:= selectset( Owner, Product_MP.SalesDemand.astype( Forecast ),object,object.EndDate().DateTime().Date() >= Date::ActualDate().StartOfMonth() 
                            and object.EndDate().DateTime().Date() <= Date::ActualDate().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth()
                            and object.Quantity()>0 );
@@ -32,8 +34,13 @@
       CustomName:="";
       DepartMent:="";
       idx:=0;
+      strOrderCode:="";
+      RQty:=0;
+      ObjOrderRealQty:=null( H_OrderForecastRealQty,constcontent );
+    //  ObjPruduct :=null( MappingProduct,constcontent );
       traverse( AllData,Elements,Obj,not isnull(Obj))
       {
+        // 杩欓噷鐢ㄦ煡鎵惧悗鎴彇锛屽洜涓轰笉纭畾鏈夊嚑涓í绾匡紝浠ョ涓�涓负鍑�
         idx:=Obj.SalesSegmentName().FindString( "-",0);
         if(idx>0)
         {
@@ -43,18 +50,51 @@
         else
         {
           CustomName :=Obj.SalesSegmentName();
-          DepartMent := Obj.SalesSegmentName();
+          DepartMent := "閮ㄩ棬鏁版嵁鑾峰彇澶辫触锛�"
         }
-        
-         Owner.H_Forecast(relnew,OrderCode := H_FunctionClass::SM_GenerateID( "OF"),
+    //    // 浠庣墿鏂欒〃鑾峰彇鐗╂枡淇℃伅
+    //    ObjPruduct := H_FunctionClass::SM_GetProductInfo( Owner,Obj.ProductID());
+    //    if( not isnull( ObjPruduct))
+    //    {
+    //      
+    //    }
+         // 鍐欏叆棰勬祴璁㈠崟淇℃伅琛�
+         strOrderCode:=H_FunctionClass::SM_GenerateID( "OF");
+         Owner.H_Forecast(relnew,OrderCode := strOrderCode,
                                 SKU := Obj.ProductID(),
-                                CustomCode := CustomName,
+                               CustomCode := CustomName,
                                CustomName := CustomName,
                                Util:=Obj.UnitOfMeasureName(),
                                NeedTime:=Obj.EndDate(),
                                ForecastQty:=[Number]Obj.Quantity().Round( 0),
+                               StockingPointID := Obj.StockingPointID(),
                                Department:=DepartMent);
+         // 鍐欏叆棰勬祴瀹炴椂淇℃伅
+         ObjOrderRealQty := select( Owner,H_OrderForecastRealQty,ObjO,ObjO.CustomID()=CustomName and ObjO.SKU()=Obj.ProductID() 
+                                    and ObjO.Month().StartOfMonth() = Obj.EndDate().StartOfMonth() )
+         if( isnull( ObjOrderRealQty))
+         {
+             Owner.H_OrderForecastRealQty(relnew,CustomID := CustomName,CustomName := CustomName,ForecatsQty := [Number]Obj.Quantity().Round( 0)
+                                           ,ForecatsRealQty := [Number]Obj.Quantity().Round( 0),ID := H_FunctionClass::SM_GenerateID( "OR")
+                                           ,Month := Obj.EndDate(),OrderCode := strOrderCode,SKU := Obj.ProductID(),Unit := Obj.UnitOfMeasureName());
+         }
+         else
+         {
+            if( [Number]Obj.Quantity().Round( 0)<> ObjOrderRealQty.ForecatsQty())
+            {
+                  RQty := [Number]Obj.Quantity().Round( 0) - ObjOrderRealQty.ForecatsQty();
+                  RQty := ObjOrderRealQty.ForecatsRealQty() + RQty;
+                  if( RQty<0)
+                  {
+                      RQty :=0;
+                  }
+                  ObjOrderRealQty.ForecatsQty([Number]Obj.Quantity().Round( 0));
+                  ObjOrderRealQty.ForecatsRealQty(RQty);
+            }
+         }
       }
+     
+      
       bStatus := true;
       strMsg :="璁㈠崟棰勬祴鍒濆鍖栨垚鍔�!";
     }
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastDataEx.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastDataEx.qbl
new file mode 100644
index 0000000..524b723
--- /dev/null
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_InitialForcastDataEx.qbl
@@ -0,0 +1,120 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_InitialForcastDataEx (
+  MacroPlan Owner,
+  Boolean IsNew
+) as owning JSON
+{
+  Description: '鍒濆鍖栬鍗曢娴嬩俊鎭�'
+  TextBody:
+  [*
+    /**********************************鍒濆鍖栬鍗曢娴嬩俊鎭�***************************************
+    *娉細鏈‘瀹氫笂娓搁娴嬭鍗曟洿鏂伴�昏緫鍜屾暟鎹湁鏁堟�э紝杩欓噷杩涜浜屾澶勭悊锛屾柊鐢熸垚涓�涓垪琛紝閬垮厤涓婃父淇℃伅鍙樺姩涓ラ噸
+    *    褰卞搷鍔熻兘
+    *
+    *****************************************************************************************/
+    // 鍒濆鍖栫粨鏋�
+    bStatus := false;
+    strMsg :="";
+    
+    try{
+      // 娓呴櫎鏃ф暟鎹紝閲嶆柊鎷夊彇
+      if(Owner.H_Forecast(relget ).Size()>0)
+      {
+        traverse( Owner,H_Forecast,Obj,not isnull( Obj))
+        {
+          Owner.H_Forecast(reldelete, Obj);
+        }
+      }
+      
+      // 鑾峰彇棰勬祴璁㈠崟锛氬綋鏈堝拰涔嬪悗鐨�3涓湀棰勬祴鏁版嵁 涓旈娴嬫暟閲�>0鐨�
+      AllData:= selectset( Owner, Product_MP.SalesDemand.astype( Forecast ),object,object.EndDate().DateTime().Date() >= Date::ActualDate().StartOfMonth() 
+                           and object.EndDate().DateTime().Date() <= Date::ActualDate().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth().StartOfNextMonth()
+                           and object.Quantity()>0 );
+      
+      CustomName:="";
+      DepartMent:="";
+      idx:=0;
+      strOrderCode:="";
+      RQty:=0;
+      ObjOrderRealQty:=null( H_OrderForecastRealQty,constcontent );
+    //  ObjPruduct :=null( MappingProduct,constcontent );
+      traverse( AllData,Elements,Obj,not isnull(Obj))
+      {
+        // 杩欓噷鐢ㄦ煡鎵惧悗鎴彇锛屽洜涓轰笉纭畾鏈夊嚑涓í绾匡紝浠ョ涓�涓负鍑�
+        idx:=Obj.SalesSegmentName().FindString( "-",0);
+        if(idx>0)
+        {
+          DepartMent:=Obj.SalesSegmentName().SubString( 0,idx);
+          CustomName := Obj.SalesSegmentName().SubString( idx+1, Obj.SalesSegmentName().Length() - (idx+1));
+        }
+        else
+        {
+          CustomName :=Obj.SalesSegmentName();
+          DepartMent := "閮ㄩ棬鏁版嵁鑾峰彇澶辫触锛�"
+        }
+    //    // 浠庣墿鏂欒〃鑾峰彇鐗╂枡淇℃伅
+    //    ObjPruduct := H_FunctionClass::SM_GetProductInfo( Owner,Obj.ProductID());
+    //    if( not isnull( ObjPruduct))
+    //    {
+    //      
+    //    }
+         // 鍐欏叆棰勬祴璁㈠崟淇℃伅琛�
+         strOrderCode:=H_FunctionClass::SM_GenerateID( "OF");
+         Owner.H_Forecast(relnew,OrderCode := strOrderCode,
+                                SKU := Obj.ProductID(),
+                               CustomCode := CustomName,
+                               CustomName := CustomName,
+                               Util:=Obj.UnitOfMeasureName(),
+                               NeedTime:=Obj.EndDate(),
+                               ForecastQty:=[Number]Obj.Quantity().Round( 0),
+                               StockingPointID := Obj.StockingPointID(),
+                               Department:=DepartMent);
+         // 鍐欏叆棰勬祴瀹炴椂淇℃伅
+         ObjOrderRealQty := select( Owner,H_OrderForecastRealQty,ObjO,ObjO.CustomID()=CustomName and ObjO.SKU()=Obj.ProductID() 
+                                    and ObjO.Month().StartOfMonth() = Obj.EndDate().StartOfMonth() )
+         if( isnull( ObjOrderRealQty))
+         {
+             Owner.H_OrderForecastRealQty(relnew,CustomID := CustomName,CustomName := CustomName,ForecatsQty := [Number]Obj.Quantity().Round( 0)
+                                           ,ForecatsRealQty := [Number]Obj.Quantity().Round( 0),ID := H_FunctionClass::SM_GenerateID( "OR")
+                                           ,Month := Obj.EndDate(),OrderCode := strOrderCode,SKU := Obj.ProductID(),Unit := Obj.UnitOfMeasureName());
+         }
+         else
+         {
+           if( IsNew)
+           {
+              ObjOrderRealQty.ForecatsQty([Number]Obj.Quantity().Round( 0));
+              ObjOrderRealQty.ForecatsRealQty([Number]Obj.Quantity().Round( 0));
+           }
+           else
+           {
+              if( [Number]Obj.Quantity().Round( 0)<> ObjOrderRealQty.ForecatsQty())
+              {
+                    RQty := [Number]Obj.Quantity().Round( 0) - ObjOrderRealQty.ForecatsQty();
+                    RQty := ObjOrderRealQty.ForecatsRealQty() + RQty;
+                    if( RQty<0)
+                    {
+                        RQty :=0;
+                    }
+                    ObjOrderRealQty.ForecatsQty([Number]Obj.Quantity().Round( 0));
+                    ObjOrderRealQty.ForecatsRealQty(RQty);
+              }
+           }
+         }
+      }
+     
+      
+      bStatus := true;
+      strMsg :="璁㈠崟棰勬祴鍒濆鍖栨垚鍔�!";
+    }
+    onerror
+    {
+      strMsg :="璁㈠崟棰勬祴鍒濆鍖栧け璐ワ紝鍙兘褰卞搷鍐插噺璁$畻锛岃鑱旂郴绯荤粺绠$悊鍛橈紒";
+      Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_InitialForcastData",
+                         DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
+                         GeneralInformation := e.GeneralInformation());                
+    }
+    return JSON::Object().Add( "Status",bStatus)
+                         .Add( "Msg",strMsg).Build();
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl
new file mode 100644
index 0000000..c4c2894
--- /dev/null
+++ b/_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl
@@ -0,0 +1,200 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod SM_OrderHedging (
+  MacroPlan Owner,
+  Boolean IsNew,
+  String Operator,
+  String OperatorType
+) as owning JSON
+{
+  Description: '璁㈠崟鍐插噺璋冪敤鍑芥暟'
+  TextBody:
+  [*
+    /************************************璁㈠崟鍐插噺璋冪敤******************************
+    *鍑芥暟鍚嶏細SM_OrderHedging
+    *鍒涘缓浜猴細yunying
+    *鍒涘缓鏃堕棿锛�20230-09-24
+    *鎻忚堪锛氱郴缁熷唴璁㈠崟鍐插噺璋冪敤鍑芥暟锛孖sNew=true鏃讹紝閲嶆柊澶勭悊棰勬祴淇℃伅锛孖sNew=false鏃讹紝鐢ㄩ娴嬬疮璁′俊鎭��
+    *****************************************************************************/
+    // 鍒濆鍖栫粨鏋�
+    bStatus := false;
+    strMsg :="";
+    // 鑾峰彇鐗堟湰鍙�,杩欓噷鏄惁闇�瑕佸拰鐗堟湰鍙峰姛鑳藉鎺�
+    VCode :=H_FunctionClass::SM_GenerateID("VC");
+    
+    try{
+      if( not isnull( Owner))
+      {
+        // 鍒濆鍖栭娴嬩俊鎭�
+        JResult := H_FunctionClass::SM_InitialForcastDataEx( Owner,IsNew);
+        if( JResult.Get( "Status").GetBoolean())
+        {
+          traverse( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder,not isnull( ObjOrder))
+          {
+            //----------------------------------------浠ヤ笅鍚庡幓棰勬祴 鍙嶇 鎺堟潈鏁版嵁淇℃伅----------------
+            nForecastQtyOld := 0; //鍘熼娴嬫暟閲�
+            nReverseQtyOld :=0;   //鍘熷弽绛炬暟閲�
+            nAuthorizeQtyOld :=0; //鍘熸巿鏉冩暟閲�
+            nForecastQtyNew :=0;  //璁$畻鍚庣殑棰勬祴鏁伴噺
+            nReverseQtyNew :=0;   //璁$畻鍚庣殑鍙嶇鏁伴噺
+            nAuthorizeQtyNew :=0; //璁$畻鍚庣殑鎺堟潈鏁伴噺
+            nHaveForecastQty :=0; //鏈夐娴嬫暟閲�
+            nNoHaveForecastQty:=0;//浜旈娴嬫暟閲�
+            OrderQuantity := 0;   //鍓╀綑璁㈠崟鏁伴噺
+           
+            // 鑾峰彇棰勬祴鏁伴噺锛堝鎴�+SKU+鏈堜唤 鐞嗚鏄病鏈夌墿鏂欓娴嬶級
+            OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
+                                                  and Obj.CustomID() = ObjOrder.CustomerName() 
+                                                  and Obj.Month().Format( "YM2") =ObjOrder.EndDate().Format( "YM2"));
+            if ( not isnull(OrderForecast))
+            {
+                nForecastQtyOld := OrderForecast.ForecatsRealQty();
+                nForecastQtyNew := nForecastQtyOld;
+            }
+            
+            // 鑾峰彇鍙嶇鏁伴噺锛堝彧鍒ゆ柇SKU锛�
+            ObjReverse := select(Owner, H_ReverseRealQty , Obj, Obj.SKU() = ObjOrder.ProductID());
+            if ( not isnull(ObjReverse))
+            {
+                nReverseQtyOld := ObjReverse.ReverseRealQty();
+                nReverseQtyNew := nReverseQtyOld;
+            }
+            
+            // 鑾峰彇鎺堟潈鏁伴噺锛堝鎴稩D+SKU锛�
+            ObjAuthorize := select(Owner, H_AuthorizeRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
+                                                                    and Obj.CustomID() = ObjOrder.CustomerName());
+            if ( not isnull(ObjAuthorize))
+            {
+                nAuthorizeQtyOld := ObjAuthorize.AuthorizeRealQty();
+                nAuthorizeQtyNew :=nAuthorizeQtyOld;
+            }
+            //-----------------------------浠ヤ笅璁㈠崟鍐插噺--------------------
+            // 鎺堟潈璁板綍ID
+            AQID := H_FunctionClass::SM_GenerateID( "AQ");
+            // 璁㈠崟鍓╀綑鏁伴噺
+            OrderQuantity := [Number]ObjOrder.Quantity().Round( 0);
+            // 1 鍏堝啿鎺堟潈
+            if( OrderQuantity>0 and nAuthorizeQtyOld>0)
+            { 
+               OrderQuantity := OrderQuantity-nAuthorizeQtyOld;
+               nAuthorizeQtyNew :=0; 
+               if( OrderQuantity<0)
+               {
+                 nAuthorizeQtyNew := abs(OrderQuantity);
+                 OrderQuantity :=0;
+               }
+            }
+            // 2 鍐嶅啿鍙嶇
+            if( OrderQuantity>0 and nReverseQtyOld>0)
+            { 
+               OrderQuantity := OrderQuantity-nReverseQtyOld;
+               nReverseQtyNew :=0; 
+               if( OrderQuantity<0)
+               {
+                 nReverseQtyNew := abs(OrderQuantity);
+                 OrderQuantity :=0;
+               }
+            }
+            // 3 鏈�鍚庡啿棰勬祴
+            if( OrderQuantity>0 and nForecastQtyOld>0)
+            { 
+               //榛樿璁㈠崟鏁伴噺>棰勬祴鏁伴噺
+               OrderQuantity := OrderQuantity-nForecastQtyOld;
+               nForecastQtyNew :=0;
+               nHaveForecastQty := nForecastQtyOld;
+               nNoHaveForecastQty := OrderQuantity; 
+               if( OrderQuantity<0)
+               {
+                 nForecastQtyNew := abs(OrderQuantity);
+                 OrderQuantity :=0;
+                 nHaveForecastQty := nForecastQtyOld - nForecastQtyNew;
+                 nNoHaveForecastQty := 0;
+               }
+            }
+            // 璁板綍鍔ㄤ綔
+            Owner.H_OrderRecord(relnew,
+                                   ID := AQID,
+                                   VCode:=VCode,
+                                   SKU:=ObjOrder.ProductID(),
+                                   ReverseQty := nReverseQtyNew,
+                                   CustomerCode := ObjOrder.CustomerName(),
+                                   CustomerName := ObjOrder.CustomerName(),
+                                   ForecastQty := nForecastQtyNew,
+                                   OrderDateTime := ObjOrder.EndDate(),
+                                   OrderQty := [Number]ObjOrder.Quantity().Round( 0),
+                                   OrderCode:=ObjOrder.OrderID(),
+                                   AuthorizeQty := nAuthorizeQtyNew,
+                                   ReverseDeductQty := nReverseQtyOld - nReverseQtyNew,
+                                   AuthorizeDeductQty := 0,
+                                   ForecastHitQty :=nHaveForecastQty,
+                                   ForecastNoHitQty :=nNoHaveForecastQty,
+                                   OperateType := OperatorType,
+                                   Operator := Operator,
+                                   Unit := ObjOrder.UnitOfMeasureName(),
+                                   OperateQty := [Number]ObjOrder.Quantity().Round( 0),
+                                   OperateTime := DateTime::ActualTime());
+                                   
+            // 鏇存柊褰撳墠鍙嶇鏁伴噺
+            if( not isnull( ObjReverse))
+            {
+              ObjReverse.ReverseRealQty(nReverseQtyNew);
+            }
+            else
+            {
+              Owner.H_ReverseRealQty(relnew,ID := H_FunctionClass::SM_GenerateID( "RQ"),SKU := ObjOrder.ProductID(),Unit := ObjOrder.UnitOfMeasureName()
+                                      ,ReverseRealQty := nReverseQtyNew);
+            } 
+            // 鏇存柊鎺堟潈
+            if( not isnull( ObjAuthorize))
+            {
+              ObjAuthorize.AuthorizeRealQty(nAuthorizeQtyNew);
+            }
+            else
+            {
+              Owner.H_AuthorizeRealQty(relnew,ID := H_FunctionClass::SM_GenerateID( "AR"),SKU := ObjOrder.ProductID(),
+                                                                                              Month := ObjOrder.EndDate(),
+                                                                                              CustomID := ObjOrder.CustomerName(),
+                                                                                              CustomName := ObjOrder.CustomerName(),
+                                                                                              OrderCode := "-",
+                                                                                              AuthorizeRealQty :=nAuthorizeQtyNew,
+                                                                                              Unit := ObjOrder.UnitOfMeasureName());
+            } 
+            // 鏇存柊棰勬祴
+            if( not isnull( OrderForecast))
+            {
+              OrderForecast.ForecatsRealQty(nForecastQtyNew);
+            }
+            else
+            {
+              Owner.H_OrderForecastRealQty(relnew,ID := H_FunctionClass::SM_GenerateID( "OF"),SKU := ObjOrder.ProductID(),
+                                                                                              Month := ObjOrder.EndDate(),
+                                                                                              CustomID := ObjOrder.CustomerName(),
+                                                                                              CustomName := ObjOrder.CustomerName(),
+                                                                                              OrderCode := "-",
+                                                                                              ForecatsQty :=0,
+                                                                                              ForecatsRealQty :=nForecastQtyNew,
+                                                                                              Unit := ObjOrder.UnitOfMeasureName());
+            } 
+          }
+        }
+        else
+        {
+          strMsg:="棰勬祴璁㈠崟淇℃伅鍔犺浇澶辫触锛岃鑱旂郴绯荤粺绠$悊鍛橈紒";
+        }    
+      }
+    }
+    onerror
+    {
+      strMsg :="璁㈠崟鍐插噺鍙戠敓閿欒锛岃鑱旂郴绯荤粺绠$悊鍛橈紒";
+      // 杩欓噷鏄惁瑕佸垹闄ゅ凡鍒涘缓鐨勬暟鎹紵寰呭畾锛屽鏋滄寜鐗堟湰鍙峰彲浠ヤ笉鍒犻櫎
+      
+      // 璁板綍閿欒鏃ュ織
+      Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_InitialForcastData",
+                         DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
+                         GeneralInformation := e.GeneralInformation());                
+    }
+    return JSON::Object().Add( "Status",bStatus)
+                         .Add( "VersionCode",VCode)
+                         .Add( "Msg",strMsg).Build();
+  *]
+}
diff --git a/_Main/BL/Type_H_FunctionClass/_ROOT_Type_H_FunctionClass.qbl b/_Main/BL/Type_H_FunctionClass/_ROOT_Type_H_FunctionClass.qbl
index 6cb0560..b6727c8 100644
--- a/_Main/BL/Type_H_FunctionClass/_ROOT_Type_H_FunctionClass.qbl
+++ b/_Main/BL/Type_H_FunctionClass/_ROOT_Type_H_FunctionClass.qbl
@@ -5,6 +5,6 @@
 {
   #keys: '5[414724.0.53669729][414724.0.53669727][0.0.0][414724.0.53669728][414724.0.53669730]'
   BaseType: Object
-  Description: '鍐插噺鎿嶄綔绫�'
+  Description: '鍐插噺鎿嶄綔鍏敤绫�'
   StructuredName: 'H_FunctionClasss'
 }
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_ForecastID.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_ForecastID.qbl
new file mode 100644
index 0000000..5c39ed3
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_ForecastID.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ForecastID
+{
+  #keys: '3[414724.0.150662643][414724.0.150662642][414724.0.150662644]'
+  Description: '棰勬祴ID'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_ID.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_ID.qbl
new file mode 100644
index 0000000..4115813
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_ID.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ID
+{
+  #keys: '3[414724.0.142347495][414724.0.142347494][414724.0.142347496]'
+  Description: '涓婚敭ID'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_MaterialName.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_MaterialName.qbl
new file mode 100644
index 0000000..90613a7
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_MaterialName.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute MaterialName
+{
+  #keys: '3[414724.0.142347535][414724.0.142347534][414724.0.142347536]'
+  Description: '鐗╂枡鍚嶇О'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_MaterialType.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_MaterialType.qbl
new file mode 100644
index 0000000..908d0f3
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_MaterialType.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute MaterialType
+{
+  #keys: '3[414724.0.142347525][414724.0.142347524][414724.0.142347526]'
+  Description: '鐗╂枡绫诲瀷锛氭垚鍝併�佸崐鎴愬搧銆佸師鏉愭枡锛燂紵锛燂紵'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_NeedDate.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_NeedDate.qbl
new file mode 100644
index 0000000..8be7117
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_NeedDate.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute NeedDate
+{
+  #keys: '3[414724.0.143344655][414724.0.143344654][414724.0.143344656]'
+  Description: '闇�姹傛椂闂�'
+  ValueType: Date
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_NeedQty.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_NeedQty.qbl
new file mode 100644
index 0000000..e0c3a06
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_NeedQty.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute NeedQty
+{
+  #keys: '3[414724.0.142347555][414724.0.142347554][414724.0.142347556]'
+  Description: '闇�姹傛暟閲�'
+  ValueType: Number
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_OrgCode.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_OrgCode.qbl
new file mode 100644
index 0000000..f8a06f0
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_OrgCode.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute OrgCode
+{
+  #keys: '3[414724.0.142347565][414724.0.142347564][414724.0.142347566]'
+  Description: '缁勭粐浠g爜'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_ParentSKU.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_ParentSKU.qbl
new file mode 100644
index 0000000..9c6d50d
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_ParentSKU.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ParentSKU
+{
+  #keys: '3[414724.0.142347515][414724.0.142347514][414724.0.142347516]'
+  Description: '鐖剁墿鏂橲KU'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_SKU.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_SKU.qbl
new file mode 100644
index 0000000..2299346
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_SKU.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute SKU
+{
+  #keys: '3[414724.0.142347505][414724.0.142347504][414724.0.142347506]'
+  Description: 'SKU(浜у搧銆佸崐鎴愬搧銆佺墿鏂欙級'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_StockPoint.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_StockPoint.qbl
new file mode 100644
index 0000000..1a3655c
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_StockPoint.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute StockPoint
+{
+  #keys: '3[414724.0.142347575][414724.0.142347574][414724.0.142347576]'
+  Description: '搴撳瓨鐐�'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_Unit.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_Unit.qbl
new file mode 100644
index 0000000..2ec2674
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_Unit.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Unit
+{
+  #keys: '3[414724.0.142347545][414724.0.142347544][414724.0.142347546]'
+  Description: '鍗曚綅'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/Attribute_VCode.qbl b/_Main/BL/Type_H_MaterialInfo/Attribute_VCode.qbl
new file mode 100644
index 0000000..66f81ea
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/Attribute_VCode.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute VCode
+{
+  #keys: '3[414724.0.142347585][414724.0.142347584][414724.0.142347586]'
+  Description: '鐗堟湰鍙�'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_H_MaterialInfo/_ROOT_Type_H_MaterialInfo.qbl b/_Main/BL/Type_H_MaterialInfo/_ROOT_Type_H_MaterialInfo.qbl
new file mode 100644
index 0000000..d2309be
--- /dev/null
+++ b/_Main/BL/Type_H_MaterialInfo/_ROOT_Type_H_MaterialInfo.qbl
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type H_MaterialInfo
+{
+  #keys: '5[414724.0.142347475][414724.0.142347473][0.0.0][414724.0.142347474][414724.0.142347476]'
+  BaseType: Object
+  Description: '鐗╂枡淇℃伅'
+  StructuredName: 'H_MaterialInfos'
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Form234/Component_List174.def b/_Main/UI/MacroPlannerWebApp/Component_Form234/Component_List174.def
index 66db189..4b16da7 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_Form234/Component_List174.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_Form234/Component_List174.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderCode","title":"OrderCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderDateTime","title":"OrderDateTime","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderDateTime"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderQty","title":"OrderQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastHitQty","title":"ForecastHitQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastNoHitQty","title":"ForecastNoHitQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastNoHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"Unit","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"CustomerName","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerCode","title":"CustomerCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerCode"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderCode","title":"璁㈠崟缂栧彿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU缂栫爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderQty","title":"鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderDateTime","title":"闇�姹傛椂闂�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderDateTime"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastHitQty","title":"鏈夐娴�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastNoHitQty","title":"鏃犻娴�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastNoHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"鍗曚綅","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"瀹㈡埛鍚嶇О","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerCode","title":"瀹㈡埛ID","subtotals":"","tooltip":"","width":-1,"display":"hidden","editable":false,"attribute":"CustomerCode"}}]'
         ContextMenu: 'listContextMenu108'
         SortCriteria: 'OperateTime'
         Taborder: 2
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_ListHedgingOfLog.def b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_ListHedgingOfLog.def
index 6795199..c7d0922 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_ListHedgingOfLog.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_ListHedgingOfLog.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Serial","title":"Serial","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Serial"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastQty","title":"ForecastQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ReverseQty","title":"ReverseQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ReverseQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"AuthorizeQty","title":"AuthorizeQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"AuthorizeQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OperateQty","title":"OperateQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OperateQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OperateType","title":"OperateType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OperateType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Operator","title":"Operator","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Operator"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OperateTime","title":"OperateTime","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OperateTime"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Serial","title":"搴忓彿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Serial"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU缂栧彿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastQty","title":"棰勬祴鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ReverseQty","title":"鍙嶇鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ReverseQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"AuthorizeQty","title":"鎺堟潈鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"AuthorizeQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OperateQty","title":"鍔ㄤ綔鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OperateQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OperateType","title":"鍔ㄤ綔绫诲瀷","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OperateType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Operator","title":"鎿嶄綔浜�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Operator"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OperateTime","title":"鎿嶄綔鏃堕棿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OperateTime"}}]'
         ContextMenu: 'listContextMenuHedgingOfLog'
         Taborder: 2
       ]
@@ -36,6 +36,6 @@
   ]
   Properties:
   [
-    Taborder: 3
+    Taborder: 1
   ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog.def b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog.def
index ed7d295..b86fdcd 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog.def
@@ -27,15 +27,13 @@
       ]
       Properties:
       [
-        Taborder: 2
+        Taborder: 0
       ]
     }
     #child: ListHedgingOfLog
-    #child: PanelHedgingOfLog761
-    #child: PanelHedgingOfLog593
   ]
   Properties:
   [
-    Taborder: 0
+    Taborder: 2
   ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog221.def b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog221.def
new file mode 100644
index 0000000..655b205
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog221.def
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+Component PanelHedgingOfLog221
+{
+  #keys: '[414724.0.149787927]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component LabelHedgingOfLog id:LabelHedgingOfLog_298
+    {
+      #keys: '[414724.0.149788086]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        FixedSize: false
+        Taborder: 0
+        Text: '鏃ュ織椤甸潰'
+      ]
+    }
+  ]
+  Properties:
+  [
+    Border: true
+    FixedSize: true
+    Taborder: 0
+  ]
+}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog593\04393.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog593\04393.def"
new file mode 100644
index 0000000..e38df06
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog593\04393.def"
@@ -0,0 +1,38 @@
+Quintiq file version 2.0
+Component PanelHedgingOfLog593 id:PanelHedgingOfLog593_93
+{
+  #keys: '[414724.0.152989129]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component txt_QueryContent_FHO
+    {
+      #keys: '[414724.0.152989222]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        PlaceHolder: '妯$硦鎼滅储'
+        Taborder: 0
+      ]
+    }
+    Component btn_Query_FHO
+    {
+      #keys: '[414724.0.152920619]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        ButtonSize: 'compact'
+        Image: 'VIEW'
+        Label: '鏌ヨ'
+        Taborder: 1
+      ]
+    }
+  ]
+  Properties:
+  [
+    Alignment: 'trailing'
+    FixedSize: true
+    Orientation: 'horizontal'
+    Taborder: 1
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog593.def b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog593.def
deleted file mode 100644
index 58cf03b..0000000
--- a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog593.def
+++ /dev/null
@@ -1,24 +0,0 @@
-Quintiq file version 2.0
-Component PanelHedgingOfLog593
-{
-  #keys: '[414724.0.32210907]'
-  BaseType: 'WebPanel'
-  Children:
-  [
-    Component lb_SKUCode
-    {
-      #keys: '[414724.0.32210935]'
-      BaseType: 'WebLabel'
-      Properties:
-      [
-        Taborder: 0
-        Text: 'SKU缂栫爜锛欰AAAAAAAA'
-      ]
-    }
-  ]
-  Properties:
-  [
-    FixedSize: true
-    Taborder: 1
-  ]
-}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog761.def b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog761.def
deleted file mode 100644
index dded053..0000000
--- a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Component_PanelHedgingOfLog761.def
+++ /dev/null
@@ -1,28 +0,0 @@
-Quintiq file version 2.0
-Component PanelHedgingOfLog761
-{
-  #keys: '[414724.0.26973497]'
-  BaseType: 'WebPanel'
-  Children:
-  [
-    Component LabelHedgingOfLog
-    {
-      #keys: '[414724.0.26973515]'
-      BaseType: 'WebLabel'
-      Properties:
-      [
-        FixedSize: false
-        Taborder: 0
-        Text: '鏃ュ織椤甸潰'
-      ]
-    }
-  ]
-  Properties:
-  [
-    FixedSize: true
-    Orientation: 'horizontal'
-    Padding: 'true'
-    Style: 'content'
-    Taborder: 0
-  ]
-}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Response_PanelHedgingOfLog593_93_btn_Query_FHO_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Response_PanelHedgingOfLog593_93_btn_Query_FHO_OnClick.def
new file mode 100644
index 0000000..4bc548f
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/Response_PanelHedgingOfLog593_93_btn_Query_FHO_OnClick.def
@@ -0,0 +1,19 @@
+Quintiq file version 2.0
+#parent: PanelHedgingOfLog593_93/btn_Query_FHO
+Response OnClick () id:Response_PanelHedgingOfLog593_93_btn_Query_FHO_OnClick
+{
+  #keys: '[414724.0.152920798]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      DataExtractorHedgingOfLog.FixedFilter(  "object.SKU().LikeUserLocale( " + txt_QueryContent_FHO.Text().AsQUILL() + " )" 
+                                               + " or " + "object.OperateType().LikeUserLocale( " + txt_QueryContent_FHO.Text().AsQUILL() + " )" 
+                                               + " or " + "object.Operator().LikeUserLocale( " + txt_QueryContent_FHO.Text().AsQUILL() + " )" 
+                                           );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/_ROOT_Component_FormHedgingOfLog.def b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/_ROOT_Component_FormHedgingOfLog.def
index 1e88a95..f7142b9 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/_ROOT_Component_FormHedgingOfLog.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormHedgingOfLog/_ROOT_Component_FormHedgingOfLog.def
@@ -8,16 +8,8 @@
   Children:
   [
     #child: PanelHedgingOfLog
-    Component lb_ForecastQty
-    {
-      #keys: '[414724.0.31031550]'
-      BaseType: 'WebLabel'
-      Properties:
-      [
-        Taborder: 1
-        Text: '鍘熸潗鏂欑殑棰勬祴鏁伴噺锛�0'
-      ]
-    }
+    #child: PanelHedgingOfLog221
+    #child: PanelHedgingOfLog593_93
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_ListMaterialPurchase.def b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_ListMaterialPurchase.def
index a9fc454..2d1eebd 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_ListMaterialPurchase.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_ListMaterialPurchase.def
@@ -12,6 +12,7 @@
       Properties:
       [
         DataType: 'structured[H_MaterialPurchase]'
+        FixedFilter: 'object.Status()="鏈彂甯�"'
         Source: 'DataHolderMaterialPurchase'
         Taborder: 0
         Transformation: 'Elements'
@@ -28,7 +29,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSubclassType","title":"ProductSubclassType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductSubclassType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Qty","title":"Qty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Qty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"Unit","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrgCode","title":"OrgCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrgCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WarehouseCode","title":"WarehouseCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WarehouseCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"DemandTime","title":"DemandTime","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"DemandTime"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU缂栫爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSubclassType","title":"绫诲瀷","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductSubclassType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Qty","title":"鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Qty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"鍗曚綅","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrgCode","title":"缁勭粐浠g爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrgCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WarehouseCode","title":"浠撳簱浠g爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WarehouseCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"DemandTime","title":"闇�姹傛椂闂�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"DemandTime"}}]'
         ContextMenu: 'listContextMenuMaterialPurchase'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase.def b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase.def
index 228bfb8..5e51ffa 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase.def
@@ -11,15 +11,17 @@
       BaseType: 'WebLabel'
       Properties:
       [
-        NumberOfColumns: 50
+        NumberOfColumns: 30
         Taborder: 0
         Text: '寮�濮嬫椂闂达細2023-03-26 12:24:46'
+        Visible: false
       ]
     }
     #child: PanelMaterialPurchase613
   ]
   Properties:
   [
+    Alignment: 'trailing'
     FixedSize: true
     Orientation: 'horizontal'
     Taborder: 1
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase354.def b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase354.def
new file mode 100644
index 0000000..043567d
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/Component_PanelMaterialPurchase354.def
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+Component PanelMaterialPurchase354
+{
+  #keys: '[414724.0.149784759]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component lb_Title208
+    {
+      #keys: '[414724.0.149784840]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        Description: '鎺堟潈/鍙嶇鐗╂枡閲囪喘鏄庣粏閲婃斁'
+        Taborder: 0
+        Text: '鎺堟潈/鍙嶇鐗╂枡閲囪喘鏄庣粏閲婃斁'
+      ]
+    }
+  ]
+  Properties:
+  [
+    Border: true
+    FixedSize: true
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/_ROOT_Component_FormMaterialPurchase.def b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/_ROOT_Component_FormMaterialPurchase.def
index 88640ec..a2af624 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/_ROOT_Component_FormMaterialPurchase.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialPurchase/_ROOT_Component_FormMaterialPurchase.def
@@ -7,17 +7,6 @@
   BaseType: 'WebForm'
   Children:
   [
-    Component lb_Title
-    {
-      #keys: '[414724.0.32644779]'
-      BaseType: 'WebLabel'
-      Properties:
-      [
-        Description: '鎺堟潈/鍙嶇鐗╂枡閲囪喘鏄庣粏閲婃斁'
-        Taborder: 0
-        Text: '鎺堟潈/鍙嶇鐗╂枡閲囪喘鏄庣粏閲婃斁'
-      ]
-    }
     #child: PanelMaterialPurchase
     Component DataHolderMaterialPurchase
     {
@@ -45,6 +34,7 @@
       ]
     }
     #child: ListMaterialPurchase
+    #child: PanelMaterialPurchase354
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord.def b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord.def
index fbb5054..ab6d309 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ID","title":"ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Issuer","title":"Issuer","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Issuer"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IssuingDate","title":"IssuingDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IssuingDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FinishDate","title":"FinishDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"FinishDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Status","title":"Status","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Status"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"VCode","title":"VCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"VCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Serial","title":"Serial","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Serial"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ID","title":"ID","subtotals":"","tooltip":"","width":-1,"display":"hidden","editable":false,"attribute":"ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Serial","title":"搴忓彿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Serial"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IssuingDate","title":"鍙戝竷鏃堕棿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IssuingDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"FinishDate","title":"缁撴潫鏃堕棿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"FinishDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Issuer","title":"鍙戝竷浜�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Issuer"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Status","title":"鐘舵��","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Status"}}]'
         ContextMenu: 'listContextMenuReleaseRecord'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord243.def b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord243.def
index 6ef25a7..4f4cedb 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord243.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_ListReleaseRecord243.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"H_ReleaseRecord_ID","title":"H_ReleaseRecord_ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"H_ReleaseRecord_ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"H_HedgingRecord_ID","title":"H_HedgingRecord_ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"H_HedgingRecord_ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ID","title":"ID","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Qty","title":"Qty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Qty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Status","title":"Status","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Status"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IssuingDate","title":"IssuingDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IssuingDate"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"鐗╂枡缂栧彿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSubclassType","title":"绫诲瀷","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductSubclassType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Qty","title":"鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Qty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"鍗曚綅","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrgCode","title":"缁勭粐浠g爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrgCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"WarehouseCode","title":"浠撳簱浠g爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"WarehouseCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"DemandTime","title":"闇�姹傛椂闂�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"DemandTime"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IssuingDate","title":"鍙戝竷鏃堕棿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IssuingDate"}}]'
         ContextMenu: 'listContextMenuReleaseRecord690'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_PanelReleaseRecord423.def b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_PanelReleaseRecord423.def
new file mode 100644
index 0000000..6d2fc94
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Component_PanelReleaseRecord423.def
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+Component PanelReleaseRecord423
+{
+  #keys: '[414724.0.149784904]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component LabelReleaseRecord id:LabelReleaseRecord_296
+    {
+      #keys: '[414724.0.149784974]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        NumberOfColumns: 20
+        Taborder: 0
+        Text: '鍙嶇/鎺堟潈鐗╂枡鍙戝竷鐗堟湰鏄庣粏'
+      ]
+    }
+  ]
+  Properties:
+  [
+    Border: true
+    FixedSize: true
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_ListReleaseRecord_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_ListReleaseRecord_OnSelectionChanged.def
index f4cc29c..9e293a9 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_ListReleaseRecord_OnSelectionChanged.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_ListReleaseRecord_OnSelectionChanged.def
@@ -11,7 +11,15 @@
   {
     Body:
     [*
-      DataExtractorReleaseRecord661.FixedFilter( "object.H_ReleaseRecord_ID() = " + selection.ID().AsQUILL());
+      // 鍙戝竷ID
+      H_ReleaseRecord_ID := "-1";
+      H_Status:="宸插彂甯�";
+      if( not isnull( selection))
+      {
+        H_ReleaseRecord_ID :=  selection.ID();
+      }
+      DataExtractorReleaseRecord661.FixedFilter( "object.H_ReleaseRecord_ID() = " + H_ReleaseRecord_ID.AsQUILL()
+                                                 + " and " + "object.Status() = " + H_Status.AsQUILL());
     *]
     GroupServerCalls: false
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_OnCreated.def
index 5fc1173..75b080a 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/Response_OnCreated.def
@@ -5,12 +5,12 @@
   #keys: '[414724.0.37110847]'
   CanBindMultiple: false
   DefinitionID: 'Responsedef_WebComponent_OnCreated'
-  GroupServerCalls: true
   QuillAction
   {
     Body:
     [*
       dtMonth.Date(Date::Today());
     *]
+    GroupServerCalls: false
   }
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/_ROOT_Component_FormReleaseRecord.def b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/_ROOT_Component_FormReleaseRecord.def
index 9a61137..675a452 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/_ROOT_Component_FormReleaseRecord.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormReleaseRecord/_ROOT_Component_FormReleaseRecord.def
@@ -7,20 +7,10 @@
   BaseType: 'WebForm'
   Children:
   [
-    Component LabelReleaseRecord
-    {
-      #keys: '[414724.0.36933216]'
-      BaseType: 'WebLabel'
-      Properties:
-      [
-        NumberOfColumns: 20
-        Taborder: 0
-        Text: '鍙嶇/鎺堟潈鐗╂枡鍙戝竷鐗堟湰鏄庣粏'
-      ]
-    }
     #child: PanelReleaseRecord
     #child: PanelReleaseRecord108
     #child: PanelReleaseRecord527
+    #child: PanelReleaseRecord423
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Material/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Material/Response_OnCreated.def
index a76472b..1b87aa1 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Material/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmAuthorizeAndCountersign_Material/Response_OnCreated.def
@@ -17,22 +17,16 @@
       SelectItem := select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmMaterial" and Obj.ItemKey()="ListSelect");
       if(not isnull( SelectItem))
       {
-        if(SelectItem.Value().Length()>0)
+        if(SelectItem.ValueJsonString().Length()>0)
         {
-          StrValue := SelectItem.Value().Tokenize( ";");
-          lb_SUK_FAACM.Text(StrValue.Element( 0));
-          lb_MaterialCode_FAACM.Text(StrValue.Element( 1));
-          lb_Unit_FAACM.Text(StrValue.Element( 2));
+          JInfo := JSON::Parse( SelectItem.ValueJsonString());
+          lb_SUK_FAACM.Text(JInfo.Get( "ParentSKU").GetString());
+          lb_MaterialCode_FAACM.Text(JInfo.Get( "SKU").GetString());
+          lb_Unit_FAACM.Text(JInfo.Get( "Unit").GetString());
           lb_Operator_FAACM.Text(ApplicationMacroPlanner.GetUserName());
+          txt_CustomID_FAACM.Text(JInfo.Get( "CustomCode").GetString());
+          txt_CustomName_FAACM.Text(JInfo.Get( "CustomName").GetString());
         }
-      }
-      // 鑾峰彇閫夋嫨鍚庣殑SKU
-      SelectItem := select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmOrderForecast" and Obj.ItemKey()="ListSelect");
-      if(not isnull( SelectItem) and SelectItem.Value().Length()>0)
-      {
-        StrValue := SelectItem.Value().Tokenize( ";");
-        txt_CustomID_FAACM.Text(StrValue.Element( 2));
-        txt_CustomName_FAACM.Text(StrValue.Element( 3));
       }
     *]
     GroupServerCalls: false
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_List832.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_List832.def
index f24ffbd..f4e6b0e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_List832.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_List832.def
@@ -11,7 +11,7 @@
       BaseType: 'WebDataExtractor'
       Properties:
       [
-        DataType: 'structured[Product_MP]'
+        DataType: 'structured[H_MaterialInfo]'
         Source: 'dh_FM_PruductMP'
         Taborder: 0
         Transformation: 'Elements'
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ID","title":"ID","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"TotalInventoryLevels","title":"TotalInventoryLevels","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"TotalInventoryLevels"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Level","title":"Level","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"Level"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsProductCategory","title":"IsProductCategory","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"IsProductCategory"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"鐗╂枡缂栫爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaterialType","title":"鐗╂枡绫诲瀷","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaterialType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MaterialName","title":"鐗╂枡鍚嶇О","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MaterialName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"鍗曚綅","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"NeedQty","title":"闇�姹傛暟閲�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"NeedQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"NeedDate","title":"闇�姹傛椂闂�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"NeedDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrgCode","title":"缁勭粐浠g爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrgCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"StockPoint","title":"搴撳瓨鐐�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"StockPoint"}}]'
         ContextMenu: 'listContextMenu892'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_Panel418.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_Panel418.def
index efb0178..a9de040 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_Panel418.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Component_Panel418.def
@@ -24,7 +24,7 @@
       [
         NumberOfColumns: 15
         PlaceHolder: '妯$硦鎼滅储'
-        Taborder: 1
+        Taborder: 2
       ]
     }
     Component btn_Query_FM
@@ -35,7 +35,7 @@
       [
         Image: 'VIEW'
         Label: '鏌ヨ'
-        Taborder: 2
+        Taborder: 3
       ]
     }
     Component btn_Add_FM
@@ -46,7 +46,7 @@
       [
         Image: 'ADD2'
         Label: '鏂板鍙嶇/鎺堟潈'
-        Taborder: 3
+        Taborder: 4
       ]
       ResponseDefinitions:
       [
@@ -66,6 +66,16 @@
         }
       ]
     }
+    Component ds_Month_FM
+    {
+      #keys: '[414724.0.148121614]'
+      BaseType: 'WebDateSelector'
+      Properties:
+      [
+        DateFormat: 'YMM'
+        Taborder: 1
+      ]
+    }
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnDoubleClick.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnDoubleClick.def
new file mode 100644
index 0000000..b04f7cf
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnDoubleClick.def
@@ -0,0 +1,44 @@
+Quintiq file version 2.0
+#parent: List832
+Response OnDoubleClick (
+  H_MaterialInfo selection
+) id:Response_List832_OnDoubleClick
+{
+  #keys: '[414724.0.160542461]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebList_OnDoubleClick'
+  QuillAction
+  {
+    Body:
+    [*
+      if( not isnull( selection))
+      {
+        if(selection.MaterialType()="鍗婃垚鍝�")
+        {
+          OrderCode:="";
+          if( txtSaveForecastData_FM.Text().Length()>0)
+          {
+            JForecast := JSON::Parse( txtSaveForecastData_FM.Text());
+            OrderCode := JForecast.Get( "OrderCode").GetString();
+          }
+         jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.NeedQty(), OrderCode,"-",selection.NeedDate());
+          if(jResult.Get( "Status").GetBoolean())
+          {
+                de_dh_FM_ProductMP.FixedFilter( "object.ParentSKU() = " +  selection.SKU().AsQUILL()
+                                                + " and object.ForecastID() = " + OrderCode.AsQUILL()
+                                                );
+          }
+          else
+          {
+            WebMessageBox::Warning( jResult.Get( "Msg").GetString());
+          }
+        }
+        else
+        {
+            // 寮瑰嚭鐗╂枡鍙嶇鎺堟潈
+        }
+      }
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnSelectionChanged.def
deleted file mode 100644
index 4b24dec..0000000
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_List832_OnSelectionChanged.def
+++ /dev/null
@@ -1,23 +0,0 @@
-Quintiq file version 2.0
-#parent: List832
-Response OnSelectionChanged (
-  Product_MP selection
-) id:Response_List832_OnSelectionChanged
-{
-  #keys: '[414724.0.113297034]'
-  CanBindMultiple: false
-  DefinitionID: 'Responsedef_WebList_OnSelectionChanged'
-  QuillAction
-  {
-    Body:
-    [*
-      SelectItem :=  select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmMaterial" and Obj.ItemKey()="ListSelect");
-      if( isnull( SelectItem))
-      {
-         MacroPlan.H_MessagePassing(relnew,FKey :="FrmMaterial",ItemKey := "ListSelect",Value := "");
-      }
-      SelectItem.Value(lb_SUK_FM.Text()+";"+ selection.ID() +";"+selection.UnitOfMeasureName()+";");
-    *]
-    GroupServerCalls: false
-  }
-}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_OnCreated.def
index 04a54ea..c3a42c1 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_OnCreated.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_OnCreated.def
@@ -9,6 +9,7 @@
   {
     Body:
     [*
+      ds_Month_FM.Date(Date::ActualDate());
       txtSaveForecastData_FM.Text("");
       // 鑾峰彇閫夋嫨鍚庣殑SKU
       SelectItem := select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmOrderForecast" and Obj.ItemKey()="ListSelect");
@@ -19,7 +20,9 @@
           txtSaveForecastData_FM.Text(  SelectItem.ValueJsonString());
           JSelect := JSON::Parse( SelectItem.ValueJsonString());
           lb_SUK_FM.Text(JSelect.Get( "SKU").GetString());
-          de_dh_FM_ProductMP.FixedFilter( "object.ID() = " + JSelect.Get( "SKU").GetString().AsQUILL());
+          de_dh_FM_ProductMP.FixedFilter( "object.ParentSKU() = " + JSelect.Get( "SKU").GetString().AsQUILL()
+                                          + " and object.ForecastID() = " + JSelect.Get( "OrderCode").GetString().AsQUILL()
+                                          );
         }
       }
     *]
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick\043975.def" "b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick\043975.def"
index 0912867..dd32915 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick\043975.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick\043975.def"
@@ -1,6 +1,8 @@
 Quintiq file version 2.0
 #parent: Panel418/btn_Add_FM
-Response OnClick () id:Response_Panel418_btn_Add_FM_OnClick_975
+Response OnClick (
+  H_MaterialInfo selection
+) id:Response_Panel418_btn_Add_FM_OnClick_975
 {
   #keys: '[414724.0.145238844]'
   CanBindMultiple: false
@@ -14,14 +16,38 @@
     Body:
     [*
       SelectItem :=  select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmMaterial" and Obj.ItemKey()="ListSelect");
+      CustomCode:="";
+      CustomName:="";
+      SValue:="";
+      SValueJsonString:="";
+      // 鑾峰彇瀹㈡埛鍚嶇О鍜屽鎴稩D
+      if(txtSaveForecastData_FM.Text().Length()>0)
+      {
+         jForecast := JSON::Parse( txtSaveForecastData_FM.Text());
+         CustomCode := jForecast.Get( "CustomCode").GetString();
+         CustomName := jForecast.Get( "CustomName").GetString();
+      }
+      if(not isnull(selection))
+      {
+        SValueJsonString:= JSON::Object().Add( "SKU",selection.SKU())
+                    .Add( "MaterialName",selection.MaterialName())
+                    .Add( "MaterialType",selection.MaterialType())
+                    .Add( "OrgCode",selection.OrgCode())
+                    .Add( "Unit",selection.Unit())
+                    .Add( "CustomCode",CustomCode)
+                    .Add( "ParentSKU",lb_SUK_FM.Text())
+                    .Add( "CustomName",CustomName).Build().AsString();
+      }
       if( isnull( SelectItem))
       {
-         MacroPlan.H_MessagePassing(relnew,FKey :="FrmMaterial",ItemKey := "ListSelect",Value := "");
+        MacroPlan.H_MessagePassing(relnew,FKey := "FrmMaterial",ItemKey := "ListSelect", Value:=SValue,ValueJsonString:=SValueJsonString);
       }
       else
       {
-        //SelectItem.ValueJsonString()
+        SelectItem.Value(SValue);
+        SelectItem.ValueJsonString( SValueJsonString);
       }
+      Application.OpenForm( "FrmAuthorizeAndCountersign_Material","modal");
     *]
     GroupServerCalls: false
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick.def
deleted file mode 100644
index 75a8322..0000000
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Add_FM_OnClick.def
+++ /dev/null
@@ -1,20 +0,0 @@
-Quintiq file version 2.0
-#parent: Panel418/btn_Add_FM
-Response OnClick () id:Response_Panel418_btn_Add_FM_OnClick
-{
-  #keys: '[414724.0.93205915]'
-  CanBindMultiple: false
-  DefinitionID: 'Responsedef_WebButton_OnClick'
-  Precondition:
-  [*
-    return not isnull( MacroPlan);
-  *]
-  QuillAction
-  {
-    Body:
-    [*
-      Application.OpenForm( "FrmAuthorizeAndCountersign_Material","modal");
-    *]
-    GroupServerCalls: false
-  }
-}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Query_FM_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Query_FM_OnClick.def
index 822a47c..d0ec30d 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Query_FM_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/Response_Panel418_btn_Query_FM_OnClick.def
@@ -9,10 +9,17 @@
   {
     Body:
     [*
-      de_dh_FM_ProductMP.FixedFilter( "object.ID().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )" );
-      //                                             + " or " + "object.SKU().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )"  
-      //                                             + " or " + "object.CustomerCode().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )" 
-      //                                             + " or " + "object.CustomerName().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )" );
+      de_dh_FM_ProductMP.FixedFilter( "( object.SKU().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )"
+                                                   + " or " + "object.MaterialType().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )"  
+                                                   + " or " + "object.MaterialName().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )" 
+                                                   + " or " + "object.Unit().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )" 
+                                                   + " or " + "object.OrgCode().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )" 
+                                                   + " or " + "object.StockPoint().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " )" 
+                                                   + " or " + "object.Unit().LikeUserLocale( " + txt_QueryContent_FM.Text().AsQUILL() + " ))" 
+                                                   + " and " + "( object.NeedDate() < " + ds_Month_FM.Date().StartOfNextMonth().AsQUILL()  
+                                                   + " and " + "object.NeedDate() >= " + ds_Month_FM.Date().StartOfMonth().AsQUILL() + " )"
+                                      
+                                      );
     *]
     GroupServerCalls: false
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/_ROOT_Component_FrmMaterial.def b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/_ROOT_Component_FrmMaterial.def
index a356ac2..d1b24d6 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/_ROOT_Component_FrmMaterial.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmMaterial/_ROOT_Component_FrmMaterial.def
@@ -14,7 +14,7 @@
     {
       #keys: '[414724.0.53475285]'
       BaseType: 'WebDataHolder'
-      Databinding: 'structured[Product_MP]*'
+      Databinding: 'structured[H_MaterialInfo]*'
       Children:
       [
         Component de_dh_FM_ProductMP
@@ -26,7 +26,7 @@
             DataType: 'MacroPlan'
             Source: 'MacroPlan'
             Taborder: 0
-            Transformation: 'Product_MP'
+            Transformation: 'H_MaterialInfo'
           ]
         }
       ]
@@ -53,7 +53,8 @@
   [
     Description: '鍘熸枡鍒楄〃椤�'
     Image: 'NAV_REDO_LIGHT_BLUE'
-    MinimumRows: 50
+    MinimumColumns: 80
+    MinimumRows: 40
     Title: '鍘熸枡鍒楄〃椤�'
   ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel351.def b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel351.def
index 8801397..c6fbad5 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel351.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Component_Panel351.def
@@ -73,6 +73,18 @@
         Visible: false
       ]
     }
+    Component btn_OrderH_FOF
+    {
+      #keys: '[414724.0.165490408]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Description: 'ERO璁㈠崟鍐插噺'
+        Image: 'AMMUNITION_BOX_CLOSED'
+        Label: 'ERP璁㈠崟鍐插噺'
+        Taborder: 3
+      ]
+    }
   ]
   Properties:
   [
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Material_FOF503_OnClick\043222.def" "b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Material_FOF503_OnClick\043222.def"
index 7f7d6a1..0f50e1f 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Material_FOF503_OnClick\043222.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_Add_Material_FOF503_OnClick\043222.def"
@@ -21,7 +21,10 @@
                                        ValueJsonString := JSON::Object().Add( "SKU",selection.SKU())
                                                                          .Add( "Util",selection.Util())
                                                                          .Add( "CustomCode",selection.CustomCode())
-                                                                         .Add( "CustomName",selection.CustomName()).Build().AsString());
+                                                                         .Add( "CustomName",selection.CustomName())
+                                                                         .Add( "ForecastQty",selection.ForecastQty())
+                                                                         .Add( "NeedTime",selection.NeedTime().AsQUILL())
+                                                                         .Add( "OrderCode",selection.OrderCode()).Build().AsString());
         }
         else
         {
@@ -29,9 +32,21 @@
           SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU())
                                    .Add( "Util",selection.Util())
                                    .Add( "CustomCode",selection.CustomCode())
-                                   .Add( "CustomName",selection.CustomName()).Build().AsString());
+                                   .Add( "CustomName",selection.CustomName())
+                                   .Add( "ForecastQty",selection.ForecastQty())
+                                   .Add( "NeedTime",selection.NeedTime().AsQUILL())
+                                   .Add( "OrderCode",selection.OrderCode()).Build().AsString());
         }
-        Application.OpenForm( "FrmMaterial","popout");
+        
+        jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.OrderCode(),"-",selection.NeedTime());
+        if(jResult.Get( "Status").GetBoolean())
+        {
+            Application.OpenForm( "FrmMaterial","popout");
+        }
+        else
+        {
+          WebMessageBox::Warning( jResult.Get( "Msg").GetString());
+        }
       }
       else
       {
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_OrderH_FOF_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_OrderH_FOF_OnClick.def
new file mode 100644
index 0000000..4aa4c40
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_Panel351_btn_OrderH_FOF_OnClick.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: Panel351/btn_OrderH_FOF
+Response OnClick () id:Response_Panel351_btn_OrderH_FOF_OnClick
+{
+  #keys: '[414724.0.166610329]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      H_FunctionClass::SM_OrderHedging( MacroPlan,true,"System","ERP璁㈠崟");
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_liH_Forecast_OnDoubleClick.def b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_liH_Forecast_OnDoubleClick.def
index 4333154..991029e 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_liH_Forecast_OnDoubleClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_liH_Forecast_OnDoubleClick.def
@@ -19,7 +19,10 @@
                                      ValueJsonString := JSON::Object().Add( "SKU",selection.SKU())
                                                                        .Add( "Util",selection.Util())
                                                                        .Add( "CustomCode",selection.CustomCode())
-                                                                       .Add( "CustomName",selection.CustomName()).Build().AsString());
+                                                                       .Add( "CustomName",selection.CustomName())
+                                                                       .Add( "ForecastQty",selection.ForecastQty())
+                                                                       .Add( "NeedTime",selection.NeedTime().AsQUILL())
+                                                                       .Add( "OrderCode",selection.OrderCode()).Build().AsString());
       }
       else
       {
@@ -27,9 +30,21 @@
         SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU())
                                  .Add( "Util",selection.Util())
                                  .Add( "CustomCode",selection.CustomCode())
-                                 .Add( "CustomName",selection.CustomName()).Build().AsString());
+                                 .Add( "CustomName",selection.CustomName())
+                                 .Add( "ForecastQty",selection.ForecastQty())
+                                 .Add( "NeedTime",selection.NeedTime().AsQUILL())
+                                 .Add( "OrderCode",selection.OrderCode()).Build().AsString());
       }
-      Application.OpenForm( "FrmMaterial","popout");
+      
+      jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.OrderCode(),"-",selection.NeedTime());
+      if(jResult.Get( "Status").GetBoolean())
+      {
+        Application.OpenForm( "FrmMaterial","popout");
+      }
+      else
+      {
+        WebMessageBox::Warning( jResult.Get( "Msg").GetString());
+      }
     *]
     GroupServerCalls: false
   }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderResult/Component_List782.def b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderResult/Component_List782.def
index 8a9e630..915ae2c 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmOrderResult/Component_List782.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmOrderResult/Component_List782.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderCode","title":"OrderCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderQty","title":"OrderQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ReverseQty","title":"ReverseQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ReverseQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"AuthorizeQty","title":"AuthorizeQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"AuthorizeQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastQty","title":"ForecastQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastHitQty","title":"ForecastHitQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastNoHitQty","title":"ForecastNoHitQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastNoHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"CustomerName","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerCode","title":"CustomerCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerCode"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderCode","title":"璁㈠崟缂栧彿","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU缂栫爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"OrderQty","title":"鏂板璁㈠崟","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"OrderQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ReverseQty","title":"鍙嶇","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ReverseQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"AuthorizeQty","title":"鎺堟潈","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"AuthorizeQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastQty","title":"棰勬祴","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastHitQty","title":"鏈夐娴�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ForecastNoHitQty","title":"鏃犻娴�","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ForecastNoHitQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"瀹㈡埛鍚嶇О","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerCode","title":"瀹㈡埛ID","subtotals":"","tooltip":"","width":-1,"display":"hidden","editable":false,"attribute":"CustomerCode"}}]'
         ContextMenu: 'listContextMenu526'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_List696.def b/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_List696.def
index 8ba9e27..efcc861 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_List696.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_List696.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MType","title":"MType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ReverseQty","title":"ReverseQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ReverseQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"AuthorizeQty","title":"AuthorizeQty","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"AuthorizeQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"Unit","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"CustomerName","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"SKU","title":"SKU缂栫爜","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"SKU"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MType","title":"绫诲瀷","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ReverseQty","title":"棰勬祴鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ReverseQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"AuthorizeQty","title":"鎺堟潈鏁伴噺","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"AuthorizeQty"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Unit","title":"鍗曚綅","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Unit"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CustomerName","title":"瀹㈡埛鍚嶇О","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CustomerName"}}]'
         ContextMenu: 'listContextMenu660'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_Panel224.def b/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_Panel224.def
index 652ca4c..f95c042 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_Panel224.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FrmRAShow/Component_Panel224.def
@@ -32,6 +32,7 @@
       BaseType: 'WebButton'
       Properties:
       [
+        ButtonSize: 'compact'
         Image: 'VIEW'
         Label: '鏌ヨ'
         Taborder: 2
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_List212.def b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_List212.def
new file mode 100644
index 0000000..d04a4cb
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_List212.def
@@ -0,0 +1,41 @@
+Quintiq file version 2.0
+Component List212
+{
+  #keys: '[414724.0.153225431]'
+  BaseType: 'WebList'
+  Children:
+  [
+    Component DataExtractor924
+    {
+      #keys: '[414724.0.153225432]'
+      BaseType: 'WebDataExtractor'
+      Properties:
+      [
+        DataType: 'MacroPlan'
+        Source: 'MacroPlan'
+        Taborder: 0
+        Transformation: 'MappingProduct'
+      ]
+    }
+    #child: listActionBarPage441
+    Component DataSetLevel622
+    {
+      #keys: '[414724.0.153225437]'
+      BaseType: 'WebDataSetLevel'
+      Children:
+      [
+        #child: listContextMenu182
+      ]
+      Properties:
+      [
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"BusinessType","title":"BusinessType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"BusinessType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"CommonBusiness","title":"CommonBusiness","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"CommonBusiness"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EndDate","title":"EndDate","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EndDate"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ID","title":"ID","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ID"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"IsCommon","title":"IsCommon","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"IsCommon"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"KeyProduct","title":"KeyProduct","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"KeyProduct"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Name","title":"Name","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Notes","title":"Notes","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Notes"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductMajorType","title":"ProductMajorType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductMajorType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProductSubclassType","title":"ProductSubclassType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProductSubclassType"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ShelfLife","title":"ShelfLife","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ShelfLife"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasureName","title":"UnitOfMeasureName","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"UnitOfMeasureName"}}]'
+        ContextMenu: 'listContextMenu182'
+        Taborder: 2
+      ]
+    }
+  ]
+  Properties:
+  [
+    Taborder: 1
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listActionBarPage441.def b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listActionBarPage441.def
new file mode 100644
index 0000000..bb08f37
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listActionBarPage441.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component listActionBarPage441
+{
+  #keys: '[414724.0.153225434]'
+  BaseType: 'listActionBarPage'
+  Properties:
+  [
+    Taborder: 1
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listContextMenu182.def b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listContextMenu182.def
new file mode 100644
index 0000000..e5e38ee
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Component_listContextMenu182.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component listContextMenu182
+{
+  #keys: '[414724.0.153225439]'
+  BaseType: 'listContextMenu'
+  Properties:
+  [
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button593_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button593_OnClick.def
new file mode 100644
index 0000000..d37a96f
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button593_OnClick.def
@@ -0,0 +1,24 @@
+Quintiq file version 2.0
+#parent: Button593
+Response OnClick () id:Response_Frm_TEST_Button593_OnClick
+{
+  #keys: '[414724.0.153411735]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      HObj := H_FunctionClass::SM_GetProductInfo( MacroPlan,"");
+      if( not isnull( HObj))
+      {
+        WebMessageBox::Information( HObj.BusinessType());  
+      }
+      else
+      {
+        WebMessageBox::Information( "寰楀埌鐨勭┖鍊�");  
+      }
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button687_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button687_OnClick.def
new file mode 100644
index 0000000..6698b0e
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/Response_Button687_OnClick.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: Button687
+Response OnClick () id:Response_Frm_TEST_Button687_OnClick
+{
+  #keys: '[414724.0.164341791]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      H_FunctionClass::SM_OrderHedging( MacroPlan,true,"System","ERP璁㈠崟");
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/_ROOT_Component_Frm_TEST.def b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/_ROOT_Component_Frm_TEST.def
new file mode 100644
index 0000000..7f726bf
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_Frm_TEST/_ROOT_Component_Frm_TEST.def
@@ -0,0 +1,61 @@
+Quintiq file version 2.0
+#root
+#parent: MacroPlannerWebApp
+OrphanComponent Frm_TEST
+{
+  #keys: '[414724.0.153225415]'
+  BaseType: 'WebForm'
+  Children:
+  [
+    #child: List212
+    Component DataHolder417
+    {
+      #keys: '[414724.0.153253171]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'structured[MappingProduct]*'
+      Children:
+      [
+        Component DataExtractor742
+        {
+          #keys: '[414724.0.153253184]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'MacroPlan'
+            Source: 'MacroPlan'
+            Taborder: 0
+            Transformation: 'MappingProduct'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Taborder: 2
+      ]
+    }
+    Component Button593
+    {
+      #keys: '[414724.0.153411711]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'MONITOR_RGB'
+        Label: '娴嬭瘯'
+        Taborder: 0
+      ]
+    }
+    Component Button687
+    {
+      #keys: '[414724.0.164341716]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Taborder: 3
+      ]
+    }
+  ]
+  Properties:
+  [
+    Title: '娴嬭瘯椤甸潰'
+  ]
+}

--
Gitblit v1.9.3