From ae9e8bebf79b54a003ce474d82a942f6a58433fa Mon Sep 17 00:00:00 2001
From: hongjli <3117313295@qq.com>
Date: 星期四, 14 九月 2023 12:30:45 +0800
Subject: [PATCH] 物料标签

---
 _Main/BL/Type_PanelMaterialVehicle/Attribute_ProductID.qbl                                                                                                       |    7 +
 _Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlActions_btnOk_OnClick.def                                            |    9 +
 _Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnCreated.def              |   26 ++++
 _Main/BL/Type_PanelMaterialVehicle/StaticMethod_ReceiveDataGeneration.qbl                                                                                        |   29 +++-
 _Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_VerificationData.qbl                                                                                 |   25 ++++
 _Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_SynchronizeData.qbl                                                                                  |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonSynchronizeInventoryTargets_.def   |    8 +
 _Main/BL/Type_PanelMaterialVehicle/Attribute_Quantity.qbl                                                                                                        |    7 +
 _Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonPullData_OnClick.def               |   16 ++
 _Main/BL/Relations/Relation_PanelMaterialVehicle_PanelMaterialAll_PanelMaterialAll_PanelMateria.qbl                                                              |   23 +++
 _Main/BL/Type_PanelMaterialAll/Attribute_ScenarioName.qbl                                                                                                        |    7 +
 _Main/BL/Type_PanelMaterialAll/Attribute_BusinessType.qbl                                                                                                        |    7 +
 _Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnUserSelectionChanged.def |   25 ++++
 /dev/null                                                                                                                                                        |   23 ---
 _Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Component_PanelMaterialExportAndImport#136.def                                     |   15 ++
 _Main/BL/Relations/Relation_PanelMaterialAll_GlobalOTDTable_GlobalOTDTable_PanelMaterialAll.qbl                                                                  |   23 +++
 _Main/BL/Type_PanelMaterialAll/_ROOT_Type_PanelMaterialAll.qbl                                                                                                   |    9 +
 _Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_CreateOrUpdateData.qbl                                                                               |   89 ++++++++++++++
 _Main/BL/Type_PanelMaterialAll/Attribute_releaseDate.qbl                                                                                                         |    7 +
 _Main/UI/MacroPlannerWebApp/_ROOT_Project_MacroPlannerWebApp.qp                                                                                                  |    2 
 20 files changed, 324 insertions(+), 35 deletions(-)

diff --git a/_Main/BL/Relations/Relation_PanelMaterialAll_GlobalOTDTable_GlobalOTDTable_PanelMaterialAll.qbl b/_Main/BL/Relations/Relation_PanelMaterialAll_GlobalOTDTable_GlobalOTDTable_PanelMaterialAll.qbl
new file mode 100644
index 0000000..f2cc83e
--- /dev/null
+++ b/_Main/BL/Relations/Relation_PanelMaterialAll_GlobalOTDTable_GlobalOTDTable_PanelMaterialAll.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation PanelMaterialAll_GlobalOTDTable_GlobalOTDTable_PanelMaterialAll
+{
+  #keys: '1[414702.0.196798981]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide GlobalOTDTable
+  {
+    #keys: '3[414702.0.196798983][414702.0.196798982][414702.0.196798984]'
+    Cardinality: '0to1'
+    ObjectDefinition: PanelMaterialAll
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide PanelMaterialAll
+  {
+    #keys: '3[414702.0.196798986][414702.0.196798985][414702.0.196798987]'
+    Cardinality: '1toN'
+    ObjectDefinition: GlobalOTDTable
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Relations/Relation_PanelMaterialVehicle_GlobalOTDTable_GlobalOTDTable_PanelMaterialVeh.qbl b/_Main/BL/Relations/Relation_PanelMaterialVehicle_GlobalOTDTable_GlobalOTDTable_PanelMaterialVeh.qbl
deleted file mode 100644
index 10bb53d..0000000
--- a/_Main/BL/Relations/Relation_PanelMaterialVehicle_GlobalOTDTable_GlobalOTDTable_PanelMaterialVeh.qbl
+++ /dev/null
@@ -1,23 +0,0 @@
-Quintiq file version 2.0
-#parent: #root
-Relation PanelMaterialVehicle_GlobalOTDTable_GlobalOTDTable_PanelMaterialVehicle
-{
-  #keys: '1[414702.0.185221277]'
-  DefaultRelationStrategy
-  {
-  }
-  RelationSide.LeftSide GlobalOTDTable
-  {
-    #keys: '3[414702.0.185221279][414702.0.185221278][414702.0.185221280]'
-    Cardinality: '0to1'
-    ObjectDefinition: PanelMaterialVehicle
-    OwningSide: 'Reference'
-  }
-  RelationSide.RightSide PanelMaterialVehicle
-  {
-    #keys: '3[414702.0.185221282][414702.0.185221281][414702.0.185221283]'
-    Cardinality: '1toN'
-    ObjectDefinition: GlobalOTDTable
-    OwningSide: 'Owned'
-  }
-}
diff --git a/_Main/BL/Relations/Relation_PanelMaterialVehicle_PanelMaterialAll_PanelMaterialAll_PanelMateria.qbl b/_Main/BL/Relations/Relation_PanelMaterialVehicle_PanelMaterialAll_PanelMaterialAll_PanelMateria.qbl
new file mode 100644
index 0000000..97ca6e2
--- /dev/null
+++ b/_Main/BL/Relations/Relation_PanelMaterialVehicle_PanelMaterialAll_PanelMaterialAll_PanelMateria.qbl
@@ -0,0 +1,23 @@
+Quintiq file version 2.0
+#parent: #root
+Relation PanelMaterialVehicle_PanelMaterialAll_PanelMaterialAll_PanelMaterialVehicle
+{
+  #keys: '1[414702.0.196801391]'
+  DefaultRelationStrategy
+  {
+  }
+  RelationSide.LeftSide PanelMaterialAll
+  {
+    #keys: '3[414702.0.196801393][414702.0.196801392][414702.0.196801394]'
+    Cardinality: '0to1'
+    ObjectDefinition: PanelMaterialVehicle
+    OwningSide: 'Reference'
+  }
+  RelationSide.RightSide PanelMaterialVehicle
+  {
+    #keys: '3[414702.0.196801396][414702.0.196801395][414702.0.196801397]'
+    Cardinality: '1toN'
+    ObjectDefinition: PanelMaterialAll
+    OwningSide: 'Owned'
+  }
+}
diff --git a/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_CreateOrUpdateData.qbl b/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_CreateOrUpdateData.qbl
index 6d76f0a..15d22df 100644
--- a/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_CreateOrUpdateData.qbl
+++ b/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_CreateOrUpdateData.qbl
@@ -30,10 +30,97 @@
     //    finishedProductDeliveryMinLTDays  := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "鎴愬搧浜や粯Min-LT锛堝ぉ锛�" ).value();
         longAndShortCycleLabels           := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "闀跨煭鍛ㄦ湡鏍囩" ).value();
         genericSpecialLabels              := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "閫氱敤涓撶敤鏍囩" ).value();
-    //    automaticMaterialPlanningPolicies := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "鑷姩鐗╂枡璁″垝绛栫暐" ).value();
+        automaticMaterialPlanningPolicies := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "鑷姩鐗╂枡璁″垝绛栫暐" ).value();
         usersManuallySchedulePolicies     := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "鐢ㄦ埛鎵嬪姩璁″垝绛栫暐" ).value();
         minimumNumberOfDaysInStock        := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "搴撳瓨鏈�灏忓ぉ鏁�" ).value();
         maximumNumberOfDaysInInventory    := select( masapsdr, MatAttrSettingAndPlanStrategyDataCell, tempMASAPSDC, tempMASAPSDC.MatAttrSettingAndPlanStrategyDataColumn().name() = "搴撳瓨鏈�澶уぉ鏁�" ).value();
+        if ( businessType = "闆嗗洟闈㈡澘" ) {
+          if ( createItemCode.StartsWith( "103" ) ) {
+            if( longAndShortCycleLabels = "闀垮懆鏈�" ) {
+              if ( genericSpecialLabels = "涓撶敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else if ( genericSpecialLabels = "閫氱敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "瀹夊叏搴撳瓨" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else {
+                error( "涓撻�氱敤鏍囩鐨勫�煎嚭閿欙細", createItemCode );
+              }
+            } else if ( longAndShortCycleLabels = "鐭懆鏈�" ) {
+              if ( genericSpecialLabels = "涓撶敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else if ( genericSpecialLabels = "閫氱敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "瀹夊叏搴撳瓨" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else {
+                error( "涓撻�氱敤鏍囩鐨勫�煎嚭閿欙細", createItemCode );
+              }
+            } else {
+              error( "闀跨煭鍛ㄦ湡鐨勫�煎嚭閿欙細", createItemCode );
+            }
+          } else {
+            if( longAndShortCycleLabels = "闀垮懆鏈�" ) {
+              if ( genericSpecialLabels = "涓撶敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else if ( genericSpecialLabels = "閫氱敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else {
+                error( "涓撻�氱敤鏍囩鐨勫�煎嚭閿欙細", createItemCode );
+              }
+            } else if ( longAndShortCycleLabels = "鐭懆鏈�" ) {
+              if ( genericSpecialLabels = "涓撶敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else if ( genericSpecialLabels = "閫氱敤" ) {
+                if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                  error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+                }
+              } else {
+                error( "涓撻�氱敤鏍囩鐨勫�煎嚭閿欙細", createItemCode );
+              }
+            } else {
+              error( "闀跨煭鍛ㄦ湡鐨勫�煎嚭閿欙細", createItemCode );
+            }
+          }
+        } else {
+          if( longAndShortCycleLabels = "闀垮懆鏈�" ) {
+            if ( genericSpecialLabels = "涓撶敤" ) {
+              if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+              }
+            } else if ( genericSpecialLabels = "閫氱敤" ) {
+              if ( automaticMaterialPlanningPolicies <> "瀹夊叏搴撳瓨" ) {
+                error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+              }
+            } else {
+              error( "涓撻�氱敤鏍囩鐨勫�煎嚭閿欙細", createItemCode );
+            }
+          } else if ( longAndShortCycleLabels = "鐭懆鏈�" ) {
+            if ( genericSpecialLabels = "涓撶敤" ) {
+              if ( automaticMaterialPlanningPolicies <> "JIT" ) {
+                error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+              }
+            } else if ( genericSpecialLabels = "閫氱敤" ) {
+              if ( automaticMaterialPlanningPolicies <> "VMI" ) {
+                error( "瀵煎叆鐨勮嚜鍔ㄨ鍒掔瓥鐣ュ�煎嚭閿欙細", createItemCode );
+              }
+            } else {
+              error( "涓撻�氱敤鏍囩鐨勫�煎嚭閿欙細", createItemCode );
+            }
+          } else {
+            error( "闀跨煭鍛ㄦ湡鐨勫�煎嚭閿欙細", createItemCode );
+          }
+        }
         try {
           matAttrSettingAndPlanStrategy := globalOTDTable.MatAttrSettingAndPlanStrategy( relnew,
                                                                                          BusinessType := businessType,
diff --git a/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_SynchronizeData.qbl b/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_SynchronizeData.qbl
index c88a29b..624f54f 100644
--- a/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_SynchronizeData.qbl
+++ b/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_SynchronizeData.qbl
@@ -11,5 +11,7 @@
     this.CheckThePrecedingColumn( globalOTDTable );
     
     this.CreateOrUpdateData( globalOTDTable );
+    
+    this.VerificationData( globalOTDTable );
   *]
 }
diff --git a/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_VerificationData.qbl b/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_VerificationData.qbl
new file mode 100644
index 0000000..d09c337
--- /dev/null
+++ b/_Main/BL/Type_MatAttrSettingAndPlanStrategyDataTable/Method_VerificationData.qbl
@@ -0,0 +1,25 @@
+Quintiq file version 2.0
+#parent: #root
+Method VerificationData (
+  GlobalOTDTable globalOTDTable
+)
+{
+  TextBody:
+  [*
+    info( "绛栫暐涓暟锛�", globalOTDTable.MatAttrSettingAndPlanStrategy( relsize ) );
+    traverse ( globalOTDTable, MatAttrSettingAndPlanStrategy, masaps ) {
+      if ( masaps.PlanningStrategyCustom() <> "瀹夊叏搴撳瓨" and masaps.PlanningStrategyCustom() <> "JIT" and masaps.PlanningStrategyCustom() <> "M/A" and
+           masaps.PlanningStrategyCustom() <> "PO鎷夋枡" and masaps.PlanningStrategyCustom() <> "VMI" ) {
+        error( "鎵嬪姩璁剧疆绛栫暐閿欒锛�", masaps.MatCode() );     
+      }
+      
+      if ( ( masaps.PlanningStrategyAuto() <> ""   and masaps.PlanningStrategyAuto() = "JIT" )  or 
+           ( masaps.PlanningStrategyCustom() <> "" and masaps.PlanningStrategyCustom() = "JIT" ) 
+          ) {
+        if ( masaps.MinimumNumberOfDaysInStock() > 0 or masaps.MaximumNumberOfDaysInInventory() > 0 ) {
+          error( "JIT绛栫暐瀛樺湪鏈�灏忓拰鏈�澶у簱瀛樺ぉ鏁帮細", masaps.MatCode() );
+        }
+      }
+    }
+  *]
+}
diff --git a/_Main/BL/Type_PanelMaterialAll/Attribute_BusinessType.qbl b/_Main/BL/Type_PanelMaterialAll/Attribute_BusinessType.qbl
new file mode 100644
index 0000000..f22c4f3
--- /dev/null
+++ b/_Main/BL/Type_PanelMaterialAll/Attribute_BusinessType.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute BusinessType
+{
+  #keys: '3[414702.0.196801424][414702.0.196801423][414702.0.196801425]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PanelMaterialAll/Attribute_ScenarioName.qbl b/_Main/BL/Type_PanelMaterialAll/Attribute_ScenarioName.qbl
new file mode 100644
index 0000000..e737a6c
--- /dev/null
+++ b/_Main/BL/Type_PanelMaterialAll/Attribute_ScenarioName.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ScenarioName
+{
+  #keys: '3[414702.0.196801434][414702.0.196801433][414702.0.196801435]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PanelMaterialAll/Attribute_releaseDate.qbl b/_Main/BL/Type_PanelMaterialAll/Attribute_releaseDate.qbl
new file mode 100644
index 0000000..2e6a274
--- /dev/null
+++ b/_Main/BL/Type_PanelMaterialAll/Attribute_releaseDate.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ReleaseDate
+{
+  #keys: '3[414702.0.196801411][414702.0.196801410][414702.0.196801412]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PanelMaterialAll/_ROOT_Type_PanelMaterialAll.qbl b/_Main/BL/Type_PanelMaterialAll/_ROOT_Type_PanelMaterialAll.qbl
new file mode 100644
index 0000000..b1b5b06
--- /dev/null
+++ b/_Main/BL/Type_PanelMaterialAll/_ROOT_Type_PanelMaterialAll.qbl
@@ -0,0 +1,9 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type PanelMaterialAll
+{
+  #keys: '5[414702.0.196801373][414702.0.196801371][0.0.0][414702.0.196801372][414702.0.196801374]'
+  BaseType: Object
+  StructuredName: 'PanelMaterialAlls'
+}
diff --git a/_Main/BL/Type_PanelMaterialVehicle/Attribute_ProductID.qbl b/_Main/BL/Type_PanelMaterialVehicle/Attribute_ProductID.qbl
new file mode 100644
index 0000000..647a657
--- /dev/null
+++ b/_Main/BL/Type_PanelMaterialVehicle/Attribute_ProductID.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute ProductID
+{
+  #keys: '3[414702.0.196801332][414702.0.196801331][414702.0.196801333]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PanelMaterialVehicle/Attribute_Quantity.qbl b/_Main/BL/Type_PanelMaterialVehicle/Attribute_Quantity.qbl
new file mode 100644
index 0000000..1a67884
--- /dev/null
+++ b/_Main/BL/Type_PanelMaterialVehicle/Attribute_Quantity.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Quantity
+{
+  #keys: '3[414702.0.196801342][414702.0.196801341][414702.0.196801343]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PanelMaterialVehicle/StaticMethod_ReceiveDataGeneration.qbl b/_Main/BL/Type_PanelMaterialVehicle/StaticMethod_ReceiveDataGeneration.qbl
index 438d7cd..3a64a54 100644
--- a/_Main/BL/Type_PanelMaterialVehicle/StaticMethod_ReceiveDataGeneration.qbl
+++ b/_Main/BL/Type_PanelMaterialVehicle/StaticMethod_ReceiveDataGeneration.qbl
@@ -25,6 +25,16 @@
     businessTypeNameValue := restPayloadNameValue.Child( businessTypeHandle );
     scenarioNameNameValue := restPayloadNameValue.Child( scenarioNameHandle );
     
+    panelMaterialAll := select( globalOTDTable, PanelMaterialAll, tempPMA, tempPMA.ScenarioName() = scenarioNameNameValue.GetValueAsString() );
+    if ( not isnull( panelMaterialAll ) ) {
+      panelMaterialAll.Delete();
+    }
+    panelMaterialAll := globalOTDTable.PanelMaterialAll( relnew, 
+                                                         ReleaseDate  := releaseDateNameValue.GetValueAsString(),
+                                                         BusinessType := businessTypeNameValue.GetValueAsString(),
+                                                         ScenarioName := scenarioNameNameValue.GetValueAsString()
+                                                        );
+    
     panelMaterialsHandle := requestnvt.GetHandle( "panelMaterials" );
     panelMaterialsNameValue := restPayloadNameValue.Child( panelMaterialsHandle );
     childPanelMaterialsNameValue := panelMaterialsNameValue.Children();
@@ -32,17 +42,24 @@
     productDescriptionHandle := requestnvt.GetHandle( "productDescription" );
     startDateHandle := requestnvt.GetHandle( "startDate" );
     quantityHandle := requestnvt.GetHandle( "quantity" );
+    
+    cnv2 := StringToDate::StandardConverter();
+    cnv2.SetCustomConversion();
+    cnv2.CustomFormatString( 'yyyy-MM-dd' );
+    
     traverse ( childPanelMaterialsNameValue, Elements, cpmnv ) {
       info( "浜у搧锛�", cpmnv.Child( productIDHandle ).GetValueAsString() );
       info( "浜у搧鎻忚堪锛�", cpmnv.Child( productDescriptionHandle ).GetValueAsString() );
       info( "寮�濮嬫椂闂达細", cpmnv.Child( startDateHandle ).GetValueAsString() );
       info( "鏁伴噺锛�", cpmnv.Child( quantityHandle ).GetValueAsString() );
-    //  globalOTDTable.PanelMaterialVehicle( relnew,
-    //                                       Customer := businessTypeNameValue.GetValueAsString(),
-    //                                       ID := OS::GenerateGUIDAsString(),
-    //                                       OrderDate := cpmnv.Child( startDateHandle ).GetValueAsString(),
-                                           
-                                           
+      panelMaterialAll.PanelMaterialVehicle( relnew,
+                                           Customer         := businessTypeNameValue.GetValueAsString(),
+                                           ID               := OS::GenerateGUIDAsString(),
+                                           OrderDate        := cnv2.Convert( cpmnv.Child( startDateHandle ).GetValueAsString() ),
+                                           ProductID        := cpmnv.Child( productIDHandle ).GetValueAsString(),
+                                           Quantity         := cpmnv.Child( quantityHandle ).GetValueAsString(),
+                                           SalesSegmentName := businessTypeNameValue.GetValueAsString()
+                                          );                                   
     }
   *]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlActions_btnOk_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlActions_btnOk_OnClick.def
index 8f6e89a..f8d2a3d 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlActions_btnOk_OnClick.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlActions_btnOk_OnClick.def
@@ -4,13 +4,20 @@
 {
   #keys: '[414702.0.131771253]'
   DefinitionID: 'Responsedef_WebButton_OnClick'
-  GroupServerCalls: true
   QuillAction
   {
     Body:
     [*
       Form.ApplyChanges();
+      
+      data := DataHolderDialogData.Data();
+      if ( data.PlanningStrategyCustom() = "JIT" ) {
+        data.MinimumNumberOfDaysInStock( 0 );
+        data.MaximumNumberOfDaysInInventory( 0 );
+      }
+      
       Form.Close();
     *]
+    GroupServerCalls: false
   }
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnCreated.def
new file mode 100644
index 0000000..215ed5c
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnCreated.def
@@ -0,0 +1,26 @@
+Quintiq file version 2.0
+#parent: pnlGeneral/ddslMaterialPlanningPolicyChanges
+Response OnCreated () id:Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnCreated
+{
+  #keys: '[414702.0.199501073]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  QuillAction
+  {
+    Body:
+    [*
+      data := DataHolderDialogData.Data();
+      if ( data.PlanningStrategyCustom() <> "" and data.PlanningStrategyCustom() = "JIT" ) {
+        efTheMinimumNumberOfDaysForAnItemToBeInventoried.Visible( false );
+        efTheMaximumNumberOfDaysThatTheItemIsInStock.Visible( false );
+      } else if ( data.PlanningStrategyAuto() <> "" and data.PlanningStrategyAuto() = "JIT" ) {
+        efTheMinimumNumberOfDaysForAnItemToBeInventoried.Visible( false );
+        efTheMaximumNumberOfDaysThatTheItemIsInStock.Visible( false );
+      } else {
+        efTheMinimumNumberOfDaysForAnItemToBeInventoried.Visible( true );
+        efTheMaximumNumberOfDaysThatTheItemIsInStock.Visible( true );
+      }
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnUserSelectionChanged.def b/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnUserSelectionChanged.def
new file mode 100644
index 0000000..eaf8b6a
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogMaterialLabelingAndPlanningStrategy/Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnUserSelectionChanged.def
@@ -0,0 +1,25 @@
+Quintiq file version 2.0
+#parent: pnlGeneral/ddslMaterialPlanningPolicyChanges
+Response OnUserSelectionChanged () id:Response_pnlGeneral_ddslMaterialPlanningPolicyChanges_OnUserSelectionChanged
+{
+  #keys: '[414702.0.198291344]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebDropDownStringList_OnUserSelectionChanged'
+  QuillAction
+  {
+    Body:
+    [*
+      if ( selection <> "" and selection = "JIT" ) {
+        efTheMinimumNumberOfDaysForAnItemToBeInventoried.Visible( false );
+        efTheMaximumNumberOfDaysThatTheItemIsInStock.Visible( false );
+      } else if ( selection <> "" and selection = "JIT" ) {
+        efTheMinimumNumberOfDaysForAnItemToBeInventoried.Visible( false );
+        efTheMaximumNumberOfDaysThatTheItemIsInStock.Visible( false );
+      } else {
+        efTheMinimumNumberOfDaysForAnItemToBeInventoried.Visible( true );
+        efTheMaximumNumberOfDaysThatTheItemIsInStock.Visible( true );
+      }
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Component_PanelMaterialExportAndImport\043136.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Component_PanelMaterialExportAndImport\043136.def"
index eb69dc7..7519c89 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Component_PanelMaterialExportAndImport\043136.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Component_PanelMaterialExportAndImport\043136.def"
@@ -13,7 +13,7 @@
       [
         Image: 'EXPORT1'
         Label: '鏁版嵁瀵煎嚭'
-        Taborder: 1
+        Taborder: 2
       ]
     }
     Component ButtonMaterialExportAndImport
@@ -24,7 +24,7 @@
       [
         Image: 'IMPORT1'
         Label: '鏁版嵁瀵煎叆'
-        Taborder: 2
+        Taborder: 3
       ]
     }
     Component ButtonSynchronizeInventoryTargets
@@ -38,6 +38,17 @@
         Taborder: 0
       ]
     }
+    Component ButtonPullData
+    {
+      #keys: '[414702.0.199743004]'
+      BaseType: 'WebButton'
+      Properties:
+      [
+        Image: 'TRACTOR'
+        Label: '鎷夊彇鏁版嵁'
+        Taborder: 1
+      ]
+    }
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonPullData_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonPullData_OnClick.def
new file mode 100644
index 0000000..b0f98a4
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonPullData_OnClick.def
@@ -0,0 +1,16 @@
+Quintiq file version 2.0
+#parent: PanelMaterialExportAndImport_136/ButtonPullData
+Response OnClick () id:Response_PanelMaterialExportAndImport_136_ButtonPullData_OnClick
+{
+  #keys: '[414702.0.198246056]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      WebMessageBox::Error( "鏁版嵁婀栬繛鎺ュけ璐�", true );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonSynchronizeInventoryTargets_.def b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonSynchronizeInventoryTargets_.def
index 072efb9..5b1c51b 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonSynchronizeInventoryTargets_.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormMaterialLabelingAndPlanningStrategy/Response_PanelMaterialExportAndImport_136_ButtonSynchronizeInventoryTargets_.def
@@ -7,7 +7,13 @@
   DefinitionID: 'Responsedef_WebButton_OnClick'
   Precondition:
   [*
-    return not isnull( GlobalOTDTable ) and not isnull( MacroPlan );
+    flag := not isnull( GlobalOTDTable ) and not isnull( MacroPlan );
+    
+    if ( not flag ) {
+      feedback := "褰撳墠娌℃湁婵�娲荤殑鐗堟湰";
+    }
+    
+    return flag;
   *]
   QuillAction
   {
diff --git a/_Main/UI/MacroPlannerWebApp/_ROOT_Project_MacroPlannerWebApp.qp b/_Main/UI/MacroPlannerWebApp/_ROOT_Project_MacroPlannerWebApp.qp
index cb94597..27e4778 100644
--- a/_Main/UI/MacroPlannerWebApp/_ROOT_Project_MacroPlannerWebApp.qp
+++ b/_Main/UI/MacroPlannerWebApp/_ROOT_Project_MacroPlannerWebApp.qp
@@ -5,7 +5,7 @@
   ProjectProperties
   {
     ApplicationComponentName: 'ApplicationMacroPlanner'
-    BuildVersion: '2022.3.0.32'
+    BuildVersion: '2022.3.0.52'
     Description: 'Quintiq Macro Planner'
     ProjectKind: 'WebClient'
   }

--
Gitblit v1.9.3