From fac42cac462a926494eabc6ac7be78837931d5a4 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期四, 07 十一月 2024 12:07:52 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev

---
 _Main/BL/Type_InventoryPlanArchiveVersion/Method_Clear.qbl                                                          |   15 +++++
 _Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_OnCreated.def                               |   17 +++++
 _Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_PanelOperation_414_ButtonSearch_OnClick.def |   18 ++++++
 _Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_GenerateData.qbl                                             |   13 ++--
 _Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelHeader#503.def                        |    2 
 _Main/BL/Type_InventoryPlanArchiveVersion/Method_Generate.qbl                                                       |   37 ++++++++++++
 _Main/BL/Type_InventoryPlanArchiveVersion/Method_GenerateColumn.qbl                                                 |    3 
 _Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/_ROOT_Component_FormInventoryPlanArchive.def         |   12 +++
 _Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_InitiateSearch.qbl                                           |   28 +++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_MatrixEditorTable#791.def                  |   22 +++----
 _Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelTable#881.def                         |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelOperation#414.def                     |    1 
 _Main/UI/MacroPlannerWebApp/Component_DialogCustomerDemandPPAIDS/Method_OnOK.def                                    |    2 
 13 files changed, 147 insertions(+), 25 deletions(-)

diff --git a/_Main/BL/Type_InventoryPlanArchiveVersion/Method_Clear.qbl b/_Main/BL/Type_InventoryPlanArchiveVersion/Method_Clear.qbl
new file mode 100644
index 0000000..83d7a64
--- /dev/null
+++ b/_Main/BL/Type_InventoryPlanArchiveVersion/Method_Clear.qbl
@@ -0,0 +1,15 @@
+Quintiq file version 2.0
+#parent: #root
+Method Clear (
+  Dates periods
+)
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Jun-25-2024 (created) 
+    this.Column( relflush );
+    this.Row( relflush );
+    
+    this.GenerateColumn( periods, true );
+  *]
+}
diff --git a/_Main/BL/Type_InventoryPlanArchiveVersion/Method_Generate.qbl b/_Main/BL/Type_InventoryPlanArchiveVersion/Method_Generate.qbl
new file mode 100644
index 0000000..52dc1a3
--- /dev/null
+++ b/_Main/BL/Type_InventoryPlanArchiveVersion/Method_Generate.qbl
@@ -0,0 +1,37 @@
+Quintiq file version 2.0
+#parent: #root
+Method Generate (
+  InventoryPlanArchiveVersionSearch search
+)
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Jun-25-2024 (created)
+    info( '-----------Search start-------' );
+    table                   := selectobject( this,InterfaceDataset.InventoryPlanArchiveVersion, report, not report.IsShow() );
+    //娓呯┖涔嬪墠瀛樺偍鐨勬樉绀烘暟鎹�
+    aopcolumns              := selectuniquevalues(  table, Column, aopcolumn, aopcolumn.TimeUnit() = search.TimeUnit() and aopcolumn.StartDate() >= search.StartDate() and aopcolumn.StartDate() <= search.EndDate(), aopcolumn.StartDate() );
+    this.Clear( aopcolumns );
+    traverse( table, Row, row, ( search.Unit() = FinancialProductionReport::GetDefaultAllUnit() or row.Unit() = search.Unit() ) 
+              and ( search.Product() = FinancialProductionReport::GetDefaultAllUnit() or search.Product() = row.Name() )){
+      
+      showrow               := selectobject( this, Row, showrow, showrow.Name() = row.Name() and showrow.Unit() = search.Unit() );
+      if( isnull( showrow ) ){
+        showrow             := this.Row( relnew, Name := row.Name(), ProductID := row.ProductID(), Unit := search.Unit() );
+      }
+      traverse( row, Cell, cell, cell.Column().TimeUnit() = search.TimeUnit() ){
+        column              := selectobject( this, Column, column, column.Name() = cell.Column().Name() );
+        if( not isnull( column ) ){
+          showcell          := selectobject( showrow, Cell, showcell, showcell.Column() = column );
+          if( isnull( showcell ) ){
+            showcell        := showrow.Cell( relnew, PlanQuantity := 0, ActualQuantity := 0 );
+            column.Cell( relinsert, showcell );
+          }
+          showcell.PlanQuantity( cell.PlanQuantity() + showcell.PlanQuantity() );
+          showcell.ActualQuantity( cell.ActualQuantity() + showcell.ActualQuantity() );
+        }
+      }
+    }
+    info( '-----------Search end-------' );
+  *]
+}
diff --git a/_Main/BL/Type_InventoryPlanArchiveVersion/Method_GenerateColumn.qbl b/_Main/BL/Type_InventoryPlanArchiveVersion/Method_GenerateColumn.qbl
index 7a591b4..6647fa0 100644
--- a/_Main/BL/Type_InventoryPlanArchiveVersion/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_InventoryPlanArchiveVersion/Method_GenerateColumn.qbl
@@ -1,7 +1,8 @@
 Quintiq file version 2.0
 #parent: #root
 Method GenerateColumn (
-  Dates periods
+  Dates periods,
+  Boolean isshow
 )
 {
   Description: '鐢熸垚鏃ユ湡鍒�'
diff --git a/_Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_GenerateData.qbl b/_Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_GenerateData.qbl
index 33f3c3f..9909a0e 100644
--- a/_Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_GenerateData.qbl
+++ b/_Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_GenerateData.qbl
@@ -12,18 +12,18 @@
     info( '-------------------------Start---------------------');
     allunit                := AssemblyOnlinePlanVersion::GetDefaultAllUnit();
     name                   := InventoryPlanArchiveVersion::GetDefaultName();
-    interfaceDataset.InventoryPlanArchiveVersionSearch( relnew, Product := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );
+    search                 := interfaceDataset.InventoryPlanArchiveVersionSearch( relnew, Product := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );
     table                  := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, not version.IsShow() );
     if( isnull( table ) ){
       table                := interfaceDataset.InventoryPlanArchiveVersion( relnew, ID := name, Name := name );
     }
-    //showtable              := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, version.IsShow() );
-    //if( isnull( table ) ){ 
-    //  showtable               := interfaceDataset.AssemblyOnlinePlanVersion( relnew, ID := name, Name := name, IsShow := true );
-    //}
+    showtable              := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, version.IsShow() );
+    if( isnull( table ) ){ 
+      showtable               := interfaceDataset.InventoryPlanArchiveVersion( relnew, ID := name, Name := name, IsShow := true );
+    }
     periods                := selectuniquevalues(  macroPlan, Period_MP, period, not period.IsHistorical() and period.TimeUnit() = Translations::MP_GlobalParameters_Day()
                                                    and not exists( table, Column, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() = period.StartDate() ), period.StartDate() );
-    table.GenerateColumn( periods );
+    table.GenerateColumn( periods, false );
     actinventorytree       := NamedValueTree::Create();
     inventoryqrys          := construct( Reals );
     inventoryindex         := 0;
@@ -68,5 +68,6 @@
     }
     
     info( '-------------------------End---------------------');
+    showtable.Generate( search );
   *]
 }
diff --git a/_Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_InitiateSearch.qbl b/_Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_InitiateSearch.qbl
new file mode 100644
index 0000000..46683f7
--- /dev/null
+++ b/_Main/BL/Type_InventoryPlanArchiveVersion/StaticMethod_InitiateSearch.qbl
@@ -0,0 +1,28 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod InitiateSearch (
+  InterfaceDataset owner
+) as InventoryPlanArchiveVersion
+{
+  TextBody:
+  [*
+    // 鐢勫叞楦� Sep-29-2024 (created) 
+    allunit                   := FinancialProductionReport::GetDefaultAllUnit();
+    search                    := owner.InventoryPlanArchiveVersionSearch();
+    if( isnull( owner.InventoryPlanArchiveVersionSearch() ) ){
+      search                  := owner.InventoryPlanArchiveVersionSearch( relnew, Product := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );
+    }else{
+      search                  := owner.InventoryPlanArchiveVersionSearch();
+      search.Product( allunit );
+      search.TimeUnit(  Translations::MP_GlobalParameters_Day() );
+      search.Unit( allunit );
+      search.StartDate( Date::MinDate() );
+      search.EndDate( Date::MaxDate() );
+    }
+    table                     := selectobject( owner, InventoryPlanArchiveVersion, table, table.IsShow() );
+    if( not isnull( table ) ){
+      table.Generate( search);
+    }
+    return table;
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_DialogCustomerDemandPPAIDS/Method_OnOK.def b/_Main/UI/MacroPlannerWebApp/Component_DialogCustomerDemandPPAIDS/Method_OnOK.def
index 0840c40..dbb4b14 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_DialogCustomerDemandPPAIDS/Method_OnOK.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_DialogCustomerDemandPPAIDS/Method_OnOK.def
@@ -14,7 +14,7 @@
       CustomerDemandPPAIDS::GenerateData( InterfaceDataset, MacroPlan, currentuser );
     }
     if( efInterfacename.Text() = Translations::InterfaceDataset_AssemblyOnlinePlanPPPSPush_Name()){//瑁呴厤涓婄嚎
-      AssemblyOnlinePlanPPPSPush::GenerateData( MacroPlan, InterfaceDataset, currentuser, isactive );
+      AssemblyOnlinePlanPPPSPush::GenerateData( InterfaceDataset, MacroPlan, currentuser );
     }
     
     WebMessageBox::Success( "鎺ㄩ�佹垚鍔燂紒" );
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_MatrixEditorTable\043791.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_MatrixEditorTable\043791.def"
index 769d2c7..e3eff31 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_MatrixEditorTable\043791.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_MatrixEditorTable\043791.def"
@@ -17,12 +17,10 @@
           BaseType: 'WebDataExtractor'
           Properties:
           [
-            DataType: 'InterfaceDataset'
-            FilterArguments: 'search:QMacroPlanner::FormAssemblyOnlinePlanVersion.dhSearch'
-            FixedFilter: 'object.Column().TimeUnit() = search.TimeUnit() and object.Column().StartDate() >= search.StartDate() and object.Column().StartDate() <= search.EndDate()'
-            Source: 'InterfaceDataset'
+            DataType: 'InventoryPlanArchiveVersion'
+            Source: 'DataHolderTable'
             Taborder: 0
-            Transformation: 'InventoryPlanArchiveVersion.Row.Cell'
+            Transformation: 'Row.Cell'
           ]
         }
       ]
@@ -46,10 +44,10 @@
           BaseType: 'WebDataExtractor'
           Properties:
           [
-            DataType: 'InterfaceDataset'
-            Source: 'InterfaceDataset'
+            DataType: 'InventoryPlanArchiveVersion'
+            Source: 'DataHolderTable'
             Taborder: 0
-            Transformation: 'InventoryPlanArchiveVersion.Row'
+            Transformation: 'Row'
           ]
         }
       ]
@@ -72,12 +70,10 @@
           BaseType: 'WebDataExtractor'
           Properties:
           [
-            DataType: 'InterfaceDataset'
-            FilterArguments: 'search:QMacroPlanner::FormAssemblyOnlinePlanVersion.dhSearch'
-            FixedFilter: 'object.TimeUnit() = search.TimeUnit() and  ( search.StartDate().IsMinInfinity() or object.StartDate() >= search.StartDate() )  and ( search.EndDate().IsMaxInfinity() or object.StartDate() <= search.EndDate() )'
-            Source: 'InterfaceDataset'
+            DataType: 'InventoryPlanArchiveVersion'
+            Source: 'DataHolderTable'
             Taborder: 0
-            Transformation: 'InventoryPlanArchiveVersion.Column'
+            Transformation: 'Column'
           ]
         }
       ]
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelHeader\043503.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelHeader\043503.def"
index 3996feb..ca35885 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelHeader\043503.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelHeader\043503.def"
@@ -15,6 +15,6 @@
   [
     FixedSize: true
     Orientation: 'horizontal'
-    Taborder: 1
+    Taborder: 2
   ]
 }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelOperation\043414.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelOperation\043414.def"
index 2b58ea0..a48a72b 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelOperation\043414.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelOperation\043414.def"
@@ -19,6 +19,5 @@
   Properties:
   [
     Taborder: 4
-    Visible: false
   ]
 }
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelTable\043881.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelTable\043881.def"
index e265e3f..b2daea8 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelTable\043881.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Component_PanelTable\043881.def"
@@ -9,6 +9,6 @@
   ]
   Properties:
   [
-    Taborder: 2
+    Taborder: 3
   ]
 }
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_OnCreated.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_OnCreated.def
new file mode 100644
index 0000000..f80537b
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_OnCreated.def
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+Response OnCreated () id:Response_FormInventoryPlanArchive_OnCreated
+{
+  #keys: '[415136.0.1285201938]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebComponent_OnCreated'
+  QuillAction
+  {
+    Body:
+    [*
+      table := InventoryPlanArchiveVersion::InitiateSearch( InterfaceDataset ); 
+      DataHolderTable.Data( table );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_PanelOperation_414_ButtonSearch_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_PanelOperation_414_ButtonSearch_OnClick.def
new file mode 100644
index 0000000..ff0e907
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/Response_PanelOperation_414_ButtonSearch_OnClick.def
@@ -0,0 +1,18 @@
+Quintiq file version 2.0
+#parent: PanelOperation_414/ButtonSearch
+Response OnClick () id:Response_PanelOperation_414_ButtonSearch_OnClick
+{
+  #keys: '[415136.0.1285202243]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    Body:
+    [*
+      if( not isnull( DataHolderTable.Data() ) ){ 
+        DataHolderTable.Data().Generate( dhSearch.Data() );
+      }
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/_ROOT_Component_FormInventoryPlanArchive.def b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/_ROOT_Component_FormInventoryPlanArchive.def
index 0df74a2..84a1cee 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/_ROOT_Component_FormInventoryPlanArchive.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormInventoryPlanArchive/_ROOT_Component_FormInventoryPlanArchive.def
@@ -29,11 +29,21 @@
       ]
       Properties:
       [
-        Taborder: 0
+        Taborder: 1
       ]
     }
     #child: PanelHeader_503
     #child: PanelTable_881
+    Component DataHolderTable
+    {
+      #keys: '[415136.0.1285202011]'
+      BaseType: 'WebDataHolder'
+      Databinding: 'InventoryPlanArchiveVersion'
+      Properties:
+      [
+        Taborder: 0
+      ]
+    }
   ]
   Properties:
   [

--
Gitblit v1.9.3