From af8d4a0e9a8236e8a2e579a8dbf0b2a2a014a2d7 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期三, 19 六月 2024 15:13:05 +0800
Subject: [PATCH] 产品Product添加字段Generation、MQB/MLB、Power

---
 _Main/BL/Type_Product_MP/Method_Update.qbl                                                                |   79 ++++++
 _Main/BL/Type_Product_MP/StaticMethod_Update.qbl                                                          |  156 +++++++++++++
 _Main/BL/Type_Product_MP/Attribute_MQBMLB.qbl                                                             |    8 
 _Main/UI/MacroPlannerWebApp/Component_FormProducts/_ROOT_Component_FormProducts.def                       |   10 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelPower.def                    |   36 +++
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneral.def                  |   10 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelMQBMLB.def                   |   36 +++
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/_ROOT_Component_DialogCreateEditProduct.def |   10 
 _Main/BL/Type_Product_MP/Attribute_Power.qbl                                                              |    8 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneration.def               |   36 +++
 LibMacroPlanner/BL/Type_Product_MP/Method_SetDefaultManufacturedDateActualForShelfLife.qbl                |    1 
 _Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_PanelList.def                                |    8 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_OnOK.def                             |   58 ++++
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_pnlContent.def                    |    8 
 _Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_UIShowHideComponentForBatchEdit.def  |  114 +++++++++
 _Main/BL/Type_Product_MP/Attribute_Generation.qbl                                                         |    8 
 _Main/BL/Type_Product_MP/Method_Update#587.qbl                                                            |   63 +++++
 _Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_ListProduct#844.def                          |   24 ++
 18 files changed, 672 insertions(+), 1 deletions(-)

diff --git a/LibMacroPlanner/BL/Type_Product_MP/Method_SetDefaultManufacturedDateActualForShelfLife.qbl b/LibMacroPlanner/BL/Type_Product_MP/Method_SetDefaultManufacturedDateActualForShelfLife.qbl
index 6b77fd5..c9a492f 100644
--- a/LibMacroPlanner/BL/Type_Product_MP/Method_SetDefaultManufacturedDateActualForShelfLife.qbl
+++ b/LibMacroPlanner/BL/Type_Product_MP/Method_SetDefaultManufacturedDateActualForShelfLife.qbl
@@ -15,5 +15,4 @@
       }
     }
   *]
-  InterfaceProperties { Accessibility: 'Module' }
 }
diff --git a/_Main/BL/Type_Product_MP/Attribute_Generation.qbl b/_Main/BL/Type_Product_MP/Attribute_Generation.qbl
new file mode 100644
index 0000000..556db90
--- /dev/null
+++ b/_Main/BL/Type_Product_MP/Attribute_Generation.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Generation
+{
+  #keys: '3[415136.0.823981334][415136.0.823981333][415136.0.823981335]'
+  Description: '浠�'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_Product_MP/Attribute_MQBMLB.qbl b/_Main/BL/Type_Product_MP/Attribute_MQBMLB.qbl
new file mode 100644
index 0000000..63d0c61
--- /dev/null
+++ b/_Main/BL/Type_Product_MP/Attribute_MQBMLB.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute MQBMLB
+{
+  #keys: '3[415136.0.823981341][415136.0.823981340][415136.0.823981342]'
+  Description: 'MQB/MLB'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_Product_MP/Attribute_Power.qbl b/_Main/BL/Type_Product_MP/Attribute_Power.qbl
new file mode 100644
index 0000000..afbff25
--- /dev/null
+++ b/_Main/BL/Type_Product_MP/Attribute_Power.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Power
+{
+  #keys: '3[415136.0.823981348][415136.0.823981347][415136.0.823981349]'
+  Description: '鍔熺巼'
+  ValueType: String
+}
diff --git "a/_Main/BL/Type_Product_MP/Method_Update\043587.qbl" "b/_Main/BL/Type_Product_MP/Method_Update\043587.qbl"
new file mode 100644
index 0000000..8e532b1
--- /dev/null
+++ "b/_Main/BL/Type_Product_MP/Method_Update\043587.qbl"
@@ -0,0 +1,63 @@
+Quintiq file version 2.0
+#parent: #root
+Method Update (
+  String id,
+  String name,
+  Product_MP parent,
+  String unitofmeasurename,
+  String generation,
+  String mqbmlb,
+  String power,
+  Boolean isbyproduct,
+  Number gridx,
+  Number gridy,
+  String iconname,
+  Boolean isuservisible,
+  String namedisplaybehavior,
+  String textcolor,
+  ViewBase view,
+  String notes,
+  Boolean hasshelflife,
+  Real shelflife,
+  Boolean hasmaturation,
+  Real maturationdays,
+  Boolean isexcludedfromoptimization,
+  Boolean isplannedafteroptimization,
+  Boolean isexcludedfromfulfilmentkpis,
+  Boolean isfromdb
+)
+{
+  Description: 'Update product and node'
+  TextBody:
+  [*
+    //Update product
+    parentproductid := guard( parent.ID(), '' );
+    
+    this.Update( id,
+                 name,
+                 parentproductid,
+                 unitofmeasurename,
+                 generation,
+                 mqbmlb,
+                 power,
+                 isbyproduct,
+                 iconname,
+                 notes,
+                 hasshelflife,
+                 shelflife,
+                 hasmaturation,
+                 maturationdays,
+                 isexcludedfromoptimization,
+                 isplannedafteroptimization,
+                 isexcludedfromfulfilmentkpis,
+                 isfromdb);
+    
+    //Update product node
+    node := select( this, ProductNode, n, n.ViewBase() = view );
+    
+    if( not isnull( node ) )
+    {
+      node.Update( gridx, gridy, isuservisible, namedisplaybehavior, textcolor, iconname );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_Product_MP/Method_Update.qbl b/_Main/BL/Type_Product_MP/Method_Update.qbl
new file mode 100644
index 0000000..f93b554
--- /dev/null
+++ b/_Main/BL/Type_Product_MP/Method_Update.qbl
@@ -0,0 +1,79 @@
+Quintiq file version 2.0
+#parent: #root
+Method Update (
+  String id,
+  String name,
+  String parentid,
+  String unitofmeasurename,
+  String generation,
+  String mqbmlb,
+  String power,
+  Boolean isbyproduct,
+  String iconname,
+  String notes,
+  Boolean hasshelflife,
+  Real shelflife,
+  Boolean hasmaturation,
+  Real maturationdays,
+  Boolean isexcludedfromoptimization,
+  Boolean isplannedafteroptimization,
+  Boolean isexcludedfromfulfilmentkpis,
+  Boolean isfromdb
+)
+{
+  Description: 'This update method is used to update product parameters that takes only non object arguments'
+  TextBody:
+  [*
+    // Store the previous parent for recreating pispips
+    oldParent := this.Parent();
+    
+    hasnewparent := guard( this.Parent().ID(),'' ) <> parentid;
+    
+    parent := Product_MP::FindProductTypeIndex( parentid );
+    isroot := isnull( parent );
+    
+    this.UpdateTypeIndex( id );
+    this.Name( name );
+    this.Generation( generation );
+    this.MQBMLB( mqbmlb );
+    this.Power( power );
+    this.UnitOfMeasureName( unitofmeasurename );
+    this.IsByProduct( isbyproduct );
+    this.IconName( iconname );
+    this.Notes( notes );
+    this.IsManuallyConfigured( not isfromdb );
+    
+    this.HasShelfLife( hasshelflife );
+    if( not hasshelflife )
+    {
+      shelflife := 0.0;
+    }
+    this.ShelfLife( shelflife );
+    this.SetDefaultManufacturedDateActualForShelfLife( hasshelflife );
+    
+    this.HasMaturation( hasmaturation );
+    if( not hasmaturation ) 
+    {
+      maturationdays := 0.0;
+    }  
+    this.MaturationDays( maturationdays );
+    
+    this.IsExcludedFromOptimization( isexcludedfromoptimization );
+    this.IsPlannedAfterOptimization( isplannedafteroptimization );
+    this.IsExcludedFromFulfillmentKPI( isexcludedfromfulfilmentkpis );
+    
+    
+    //Update the parent relations
+    if( hasnewparent )
+    {
+      this.AssignParent( parent );
+    }
+    else if( isroot )
+    {
+      this.SetRootProduct();
+    }
+    
+    // Resync pispips
+    this.RecreatePISPIPs( oldParent );
+  *]
+}
diff --git a/_Main/BL/Type_Product_MP/StaticMethod_Update.qbl b/_Main/BL/Type_Product_MP/StaticMethod_Update.qbl
new file mode 100644
index 0000000..d745013
--- /dev/null
+++ b/_Main/BL/Type_Product_MP/StaticMethod_Update.qbl
@@ -0,0 +1,156 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod Update (
+  Product_MPs products_i,
+  Boolean isBatchEditParent,
+  Boolean isBatchEditUOM,
+  Boolean isBatchEditShelfLife,
+  Boolean isBatchEditMaturation,
+  Boolean isBatchEditByProduct,
+  Boolean isBatchEditOptimization,
+  Boolean isbatcheditExcludeFulfillmentKPI,
+  Boolean isBatchEditNote,
+  String id,
+  String name,
+  Product_MP parent,
+  UnitOfMeasure_MP unitOfMeasure,
+  String generation,
+  String mqbmlb,
+  String power,
+  Boolean hasShelfLife,
+  Real shelfLife,
+  Boolean hasMaturation,
+  Real maturationdays,
+  Boolean isByProduct,
+  Boolean isExcludedFromOptimization,
+  Boolean isPlannedAfterOptimization,
+  Boolean isExcludedFromFulfillmentKPI,
+  String notes,
+  ViewBase scView
+)
+{
+  Description:
+  [*
+    This is meant for webclient
+    Combined (1)edit + (2)batch edit for product(s), for web client product dialog.
+  *]
+  TextBody:
+  [*
+    // Traverse the selected set of Product_MPs for batch update
+    
+    gridx               := Number::MinNumber();
+    gridy               := Number::MinNumber();
+    iconname            := "";
+    isuservisible       := false;
+    namedisplaybehavior := "";
+    textcolor           := "";
+    
+    traverse( products_i, Elements, product )
+    { 
+      if( products_i.Size() > 1 ) //isBatch
+      {
+        // attributes that has no change on batch editing
+        id        := product.ID();
+        name      := product.Name();
+    //    generation:= product.Generation();
+    //    mqbmlb    := product.MQBMLB();
+    //    power     := product.Power();
+    
+        
+        //if no batch edit, set it with original unit's value, else, follow the screen value
+        if( not isBatchEditParent )
+        {
+          parent := product.Parent();
+        }
+        
+        if(  not isBatchEditUOM )
+        {
+          unitOfMeasure := product.UnitOfMeasure_MP();
+        }
+        
+        if(  not isBatchEditShelfLife )
+        {
+          hasShelfLife  := product.HasShelfLife();
+          shelfLife     := product.ShelfLife();
+        }
+        
+        if(  not isBatchEditMaturation )
+        {
+          hasMaturation  := product.HasMaturation();
+          maturationdays := product.MaturationDays();
+        }  
+        
+      
+        if(  not isBatchEditByProduct )
+        {
+          isByProduct   := product.IsByProduct();
+        }
+        
+        if(  not isBatchEditOptimization )
+        {
+          isExcludedFromOptimization := product.IsExcludedFromOptimization();
+          isPlannedAfterOptimization := product.IsPlannedAfterOptimization();
+        }
+        
+        if(  not isbatcheditExcludeFulfillmentKPI )
+        {
+          isExcludedFromFulfillmentKPI := product.IsExcludedFromFulfillmentKPI();
+        }
+        
+        if(  not isBatchEditNote )
+        {
+          notes := product.Notes();
+        }
+      }
+      
+      // Populate variables with default values
+      gridx               := GlobalParameters_MP::GetDefaultGridX();
+      gridy               := GlobalParameters_MP::GetDefaultGridY();
+      isuservisible       := true;
+      namedisplaybehavior := '';
+      textcolor           := 'Black';
+      iconname            := GlobalParameters_MP::GetDefaultProductIcon();
+    
+      // Get ProductNode
+      productnode := select( product, ProductNode, n, n.ViewBase() = scView );
+    
+      // If ProductNode is found, update the variables with data in the ProductNode
+      if( not isnull( productnode ) )
+      {
+        gridx               := productnode.GridX();
+        gridy               := productnode.GridY();
+        iconname            := productnode.IconName();
+        isuservisible       := productnode.IsUserVisible();
+        namedisplaybehavior := productnode.NameDisplayBehavior();
+        textcolor           := productnode.TextColor();
+      }
+      
+      // Update current Product_MP
+      product.Update( id,
+                      name,
+                      parent,
+                      guard( unitOfMeasure.Name(), "" ),
+                      generation,
+                      mqbmlb,
+                      power,
+                      isByProduct,
+                      gridx,
+                      gridy,
+                      iconname,
+                      isuservisible,
+                      namedisplaybehavior,
+                      textcolor,
+                      scView,
+                      notes,
+                      hasShelfLife, 
+                      shelfLife,
+                      hasMaturation,
+                      maturationdays,                  
+                      isExcludedFromOptimization,
+                      isPlannedAfterOptimization,
+                      isExcludedFromFulfillmentKPI,
+                      false 
+                     );
+    }
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneral.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneral.def
new file mode 100644
index 0000000..dabff29
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneral.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component PanelGeneral #extension
+{
+  Children:
+  [
+    #child: PanelGeneration
+    #child: PanelMQBMLB
+    #child: PanelPower
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneration.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneration.def
new file mode 100644
index 0000000..3f2910e
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelGeneration.def
@@ -0,0 +1,36 @@
+Quintiq file version 2.0
+Component PanelGeneration
+{
+  #keys: '[415136.0.825312166]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component LabelBatchEditSpacerGeneration
+    {
+      #keys: '[415136.0.825312187]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        NumberOfColumns: 4
+        Taborder: 0
+      ]
+    }
+    Component EditFieldGeneration
+    {
+      #keys: '[415136.0.825312322]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'DataHolderDialogData.Data.Generation'
+        FixedSize: false
+        Label: '聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Generation'
+        Taborder: 1
+      ]
+    }
+  ]
+  Properties:
+  [
+    Orientation: 'horizontal'
+    Taborder: 4
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelMQBMLB.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelMQBMLB.def
new file mode 100644
index 0000000..7ef4ce3
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelMQBMLB.def
@@ -0,0 +1,36 @@
+Quintiq file version 2.0
+Component PanelMQBMLB
+{
+  #keys: '[415136.0.827111683]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component LabelBatchEditSpacerMQBMLB
+    {
+      #keys: '[415136.0.827111733]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        NumberOfColumns: 4
+        Taborder: 0
+      ]
+    }
+    Component EditFieldMQBMLB
+    {
+      #keys: '[415136.0.827111803]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'DataHolderDialogData.Data.MQBMLB'
+        FixedSize: false
+        Label: '聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽MQB/MLB'
+        Taborder: 1
+      ]
+    }
+  ]
+  Properties:
+  [
+    Orientation: 'horizontal'
+    Taborder: 5
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelPower.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelPower.def
new file mode 100644
index 0000000..78a8831
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_PanelPower.def
@@ -0,0 +1,36 @@
+Quintiq file version 2.0
+Component PanelPower
+{
+  #keys: '[415136.0.827111860]'
+  BaseType: 'WebPanel'
+  Children:
+  [
+    Component LabelBatchEditSpacerPower
+    {
+      #keys: '[415136.0.827111909]'
+      BaseType: 'WebLabel'
+      Properties:
+      [
+        NumberOfColumns: 4
+        Taborder: 0
+      ]
+    }
+    Component EditFieldPower
+    {
+      #keys: '[415136.0.827111928]'
+      BaseType: 'WebEditField'
+      Properties:
+      [
+        DataBinding: 'DataHolderDialogData.Data.Power'
+        FixedSize: false
+        Label: '聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Power'
+        Taborder: 1
+      ]
+    }
+  ]
+  Properties:
+  [
+    Orientation: 'horizontal'
+    Taborder: 6
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_pnlContent.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_pnlContent.def
new file mode 100644
index 0000000..92726f6
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Component_pnlContent.def
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+Component pnlContent #extension
+{
+  Children:
+  [
+    #child: PanelGeneral
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_OnOK.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_OnOK.def
new file mode 100644
index 0000000..3e4e74a
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_OnOK.def
@@ -0,0 +1,58 @@
+Quintiq file version 2.0
+#parent: #root
+Method OnOK () id:Method_DialogCreateEditProduct_OnOK #extension
+{
+  Body:
+  [*
+    // onOK for ProductDialog
+    // When the user clicks ok,       
+    // we either create or edit the data
+    this.ApplyChanges();
+    this.SetAttributeAfterApplyData();
+    
+    data := DataHolderDialogData.Data();
+    
+    if( isnull( data.WrappedInstance() ) ) // New
+    {
+      // When create product, parent relation must be null (as server method has logic to detect parent change using this relation)
+      data.Parent( relflush );
+      data.Commit();
+      DataHolderForm.Data().ListProduct().SelectByKey( data.WrappedInstance().Key() );
+    } 
+    else
+    { 
+      supplyChainView := select( MacroPlan, ViewBase.astype( SupplyChainView ), scv, true );  //TODO!! handling of current SupplyChainView
+      
+      Product_MP::Update(  DataHolderDialogDatas.Data()
+                          ,CheckBoxBatchEditParent.Checked()
+                          ,CheckBoxBatchEditUOM.Checked()
+                          ,CheckBoxBatchEditShelfLife.Checked()
+                          ,CheckBoxBatchEditMaturation.Checked() 
+                          ,CheckBoxBatchEditByProduct.Checked()
+                          ,CheckBoxBatchEditExcludeFromOptimizer.Checked()
+                          ,CheckboxBatchEditExcludeFromFulfillmentKPI.Checked()
+                          ,CheckBoxBatchEditNote.Checked()
+                          ,EditFieldID.Text()
+                          ,EditFieldName.Text()
+                          ,guard( selParentProduct.Data(), null(  Product_MP ) )
+                          ,guard( DropDownListUOM.Data(), null( UnitOfMeasure_MP ) )
+                          ,EditFieldGeneration.Text()
+                          ,EditFieldMQBMLB.Text()
+                          ,EditFieldPower.Text()
+                          ,data.HasShelfLife()
+                          ,data.ShelfLife()
+                          ,data.HasMaturation()
+                          ,data.MaturationDays()  
+                          ,data.IsByProduct()
+                          ,data.IsExcludedFromOptimization()
+                          ,data.IsPlannedAfterOptimization()
+                          ,ifexpr( CheckboxIsExcludedFromFulfillmentKPI.Enabled(), 
+                                   data.IsDerivedExcludeFromFulfillmentKPI(), 
+                                   data.IsExcludedFromFulfillmentKPI() )
+                          ,data.Notes()
+                          ,supplyChainView );
+    }
+    
+    this.Close();
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_UIShowHideComponentForBatchEdit.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_UIShowHideComponentForBatchEdit.def
new file mode 100644
index 0000000..26d41c1
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/Method_UIShowHideComponentForBatchEdit.def
@@ -0,0 +1,114 @@
+Quintiq file version 2.0
+#parent: #root
+Method UIShowHideComponentForBatchEdit (
+  Boolean isInit,
+  Boolean isBatchEdit
+) id:Method_DialogCreateEditProduct_UIShowHideComponentForBatchEdit #extension
+{
+  Body:
+  [*
+    // Handles the toggling of the batch related component
+    if(  isInit )
+    {
+      //for initialize, control batch checkboxes visibility
+      
+      CheckBoxBatchEditParent.Visible( isBatchEdit );  
+      CheckBoxBatchEditUOM.Visible( isBatchEdit );  
+        
+      CheckBoxBatchEditShelfLife.Visible( isBatchEdit );  
+      CheckBoxBatchEditMaturation.Visible( isBatchEdit );
+      CheckBoxBatchEditByProduct.Visible( isBatchEdit );  
+      CheckBoxBatchEditExcludeFromOptimizer.Visible( isBatchEdit );  
+      CheckboxBatchEditExcludeFromFulfillmentKPI.Visible( isBatchEdit );
+      
+      CheckBoxBatchEditNote.Visible( isBatchEdit );  
+      
+      LabelBatchEditSpacerName.Visible( isBatchEdit );  
+      LabelBatchEditSpacerID.Visible( isBatchEdit );  
+      LabelBatchEditSpacerGeneration.Visible( isBatchEdit );  
+      LabelBatchEditSpacerMQBMLB.Visible( isBatchEdit );  
+      LabelBatchEditSpacerPower.Visible( isBatchEdit );  
+      
+      //disable all other component  
+      if( isBatchEdit )
+      {
+        disableText := Translations::MP_Product_DialogCreateEdit_DisableForBatchEdit();
+        disableFlag := false;
+        
+        selParentProduct.Enabled( disableFlag, disableText );
+        EditFieldID.Enabled( disableFlag, disableText );
+        EditFieldName.Enabled( disableFlag, disableText );
+        EditFieldGeneration.Enabled( disableFlag, disableText );
+        EditFieldMQBMLB.Enabled( disableFlag, disableText );
+        EditFieldPower.Enabled( disableFlag, disableText );
+      }
+    }
+    
+    //batch parent
+    batchParentActive := ifexpr( isInit
+                                 ,not isBatchEdit //when isBatchEdit,default=disable all
+                                 ,CheckBoxBatchEditParent.Checked() 
+                                ); 
+    selParentProduct.Enabled( batchParentActive, "" );
+    
+    //batch UOM
+    batchUOMActive := ifexpr(  isInit
+                              ,not isBatchEdit //when isBatchEdit,default=disable all
+                              ,CheckBoxBatchEditUOM.Checked() 
+                             ); 
+    DropDownListUOM.Enabled( batchUOMActive, "" );
+    
+    //batch shelf life
+    batchShelfLifeActive := ifexpr( isInit
+                                   ,not isBatchEdit //when isBatchEdit,default=disable all
+                                   ,CheckBoxBatchEditShelfLife.Checked() 
+                                  );
+    CheckBoxHasShelfLife.Enabled( batchShelfLifeActive, "" );
+    EditFieldShelfLife.Enabled( batchShelfLifeActive
+                                and CheckBoxHasShelfLife.Checked()
+                                , "" );
+    //batch maturation
+    batchMaturationActive := ifexpr( isInit
+                                   ,not isBatchEdit //when isBatchEdit,default=disable all
+                                   ,CheckBoxBatchEditMaturation.Checked() 
+                                  );
+    CheckBoxHasMaturation.Enabled( batchMaturationActive, "" );
+    EditFieldMaturation.Enabled( batchMaturationActive
+                                and CheckBoxHasMaturation.Checked()
+                                , "" );
+    
+    //batch by-product
+    batchByProductActive := ifexpr( isInit
+                                   ,not isBatchEdit //when isBatchEdit,default=disable all
+                                   ,CheckBoxBatchEditByProduct.Checked() 
+                                  );
+    CheckBoxIsByProduct.Enabled( batchByProductActive, "" );
+    
+    
+    //batch exclude optimizer
+    batchExcludeOptiActive := ifexpr( isInit
+                                     ,not isBatchEdit //when isBatchEdit,default=disable all
+                                     ,CheckBoxBatchEditExcludeFromOptimizer.Checked() 
+                                    );
+    CheckBoxExcludeFromOptimizer.Enabled( batchExcludeOptiActive
+                                          and not CheckBoxIsPlannedAfterOptimization.Checked()
+                                          , "" );
+    CheckBoxIsPlannedAfterOptimization.Enabled( batchExcludeOptiActive
+                                                and CheckBoxExcludeFromOptimizer.Checked()
+                                                , "" );
+    
+    //batch isexcludedfromfulfillmentkpi
+    batchByIsExcludedFulfillmentKPIActive := ifexpr( isInit
+                                                     ,not isBatchEdit //when isBatchEdit,default=disable all
+                                                     ,CheckboxBatchEditExcludeFromFulfillmentKPI.Checked() 
+                                                    );
+    CheckboxIsExcludedFromFulfillmentKPI.Enabled( batchByIsExcludedFulfillmentKPIActive, "" );
+    
+    //batch Note
+    batchNoteActive:= ifexpr( isInit
+                              ,not isBatchEdit //when sBatchEdit,default=disable all
+                              ,CheckBoxBatchEditNote.Checked() 
+                            ); 
+    EditFieldNotes.Enabled( batchNoteActive, "" );
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/_ROOT_Component_DialogCreateEditProduct.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/_ROOT_Component_DialogCreateEditProduct.def
new file mode 100644
index 0000000..2ffb3c6
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditProduct/_ROOT_Component_DialogCreateEditProduct.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: LibMacroPlannerWebUI
+OrphanComponent DialogCreateEditProduct #extension
+{
+  Children:
+  [
+    #child: pnlContent
+  ]
+}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_ListProduct\043844.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_ListProduct\043844.def"
new file mode 100644
index 0000000..5cb823f
--- /dev/null
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_ListProduct\043844.def"
@@ -0,0 +1,24 @@
+Quintiq file version 2.0
+Component ListProduct id:ListProduct_844 #extension
+{
+  Children:
+  [
+    Component DataSetLevelRootProduct #extension
+    {
+      Children:
+      [
+        Component DataSetLevelChildProduct #extension
+        {
+          Properties:
+          [
+            Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":-1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Name","title":"Name","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasureName","title":"UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"UnitOfMeasureName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Generation","title":"Generation","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Generation"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MQBMLB","title":"MQBMLB","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MQBMLB"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Power","title":"Power","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Power"}}]'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeAllConstraint","columnid":"All constraints","title":"All constraints","subtotals":"","tooltip":"","width":-1,"display":"shown"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Name","title":"Name","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Name"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"UnitOfMeasureName","title":"UoM","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"UnitOfMeasureName"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Generation","title":"Generation","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Generation"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"MQBMLB","title":"MQBMLB","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"MQBMLB"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Power","title":"Power","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Power"}}]'
+      ]
+    }
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_PanelList.def b/_Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_PanelList.def
new file mode 100644
index 0000000..907c5e6
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormProducts/Component_PanelList.def
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+Component PanelList #extension
+{
+  Children:
+  [
+    #child: ListProduct_844
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormProducts/_ROOT_Component_FormProducts.def b/_Main/UI/MacroPlannerWebApp/Component_FormProducts/_ROOT_Component_FormProducts.def
new file mode 100644
index 0000000..c44a756
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormProducts/_ROOT_Component_FormProducts.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+#root
+#parent: LibMacroPlannerWebUI
+OrphanComponent FormProducts #extension
+{
+  Children:
+  [
+    #child: PanelList
+  ]
+}

--
Gitblit v1.9.3