From a96e212c56f0706c653e911fcb4f8a61f593bf72 Mon Sep 17 00:00:00 2001
From: lihongji <3117313295@qq.com>
Date: 星期五, 26 七月 2024 16:44:03 +0800
Subject: [PATCH] 包装计划

---
 _Main/BL/Type_PackagingPlanRow/Method_FilterProduct.qbl                                              |   13 +
 _Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl                                      |  100 ++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixEditorActionBarPage529.def   |   10 +
 _Main/BL/Type_PackagingPlanRow/Attribute_Category.qbl                                                |    8 +
 _Main/UI/MacroPlannerWebApp/Component_FormPR_PP_Budget/Component_List531.def                         |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pContent.def                       |    4 
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bDownload_OnClick.def       |   12 +
 _Main/BL/Type_PackagingPlanRow/Attribute_FactoryAbbreviation.qbl                                     |    7 
 _Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl                                 |   13 +
 _Main/BL/Type_PackagingPlanCell/Attribute_InitialPackagingInventory.qbl                              |    7 
 _Main/BL/Type_PackagingPlanRow/Attribute_Name.qbl                                                    |    7 
 _Main/BL/Relations/Relation_PackagingPlanRow_PackagingPlanCell_PackagingPlanCell_PackagingPlanR.qbl  |   11 +
 _Main/BL/Type_PackagingPlanRow/Attribute_Factory.qbl                                                 |    8 +
 _Main/UI/MacroPlannerWebApp/Component_Form989/Component_List531.def                                  |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def                        |   12 +
 _Main/BL/Type_PackagingPlanCell/StaticMethod_CalculationPackagingPlanProperties.qbl                  |   11 +
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixeditorContextMenu812.def     |   10 +
 _Main/BL/Type_InventoryInterfaceData/StaticMethod_Test.qbl                                           |    1 
 _Main/BL/Type_PackagingPlanCell/Function_CalcStartDate.qbl                                           |   13 +
 _Main/BL/Type_PackagingPlanCell/Attribute_StartDate.qbl                                              |    7 
 _Main/BL/Type_PackagingPlanRow/Attribute_StockingPointID.qbl                                         |    7 
 _Main/BL/Type_PackagingPlanRow/Function_CalcName.qbl                                                 |   13 +
 _Main/BL/Type_PackagingPlanRow/Function_CalcFactoryAbbreviation.qbl                                  |   13 +
 _Main/UI/MacroPlannerWebApp/Component_FormSixDigitCode/Component_List531#836.def                     |    2 
 _Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl                                  |   17 ++
 _var/_Main/ProjSettings/EditorTC/Views/班次时间分析_[413988.0.1367211460].vw                               |    2 
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def                |  100 ++++++++++++
 _Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def |   22 ++
 28 files changed, 429 insertions(+), 5 deletions(-)

diff --git a/_Main/BL/Relations/Relation_PackagingPlanRow_PackagingPlanCell_PackagingPlanCell_PackagingPlanR.qbl b/_Main/BL/Relations/Relation_PackagingPlanRow_PackagingPlanCell_PackagingPlanCell_PackagingPlanR.qbl
index 5ce8e77..fe0fd66 100644
--- a/_Main/BL/Relations/Relation_PackagingPlanRow_PackagingPlanCell_PackagingPlanCell_PackagingPlanR.qbl
+++ b/_Main/BL/Relations/Relation_PackagingPlanRow_PackagingPlanCell_PackagingPlanCell_PackagingPlanR.qbl
@@ -3,8 +3,17 @@
 Relation PackagingPlanRow_PackagingPlanCell_PackagingPlanCell_PackagingPlanRow
 {
   #keys: '1[413988.0.1393320049]'
-  DefaultRelationStrategy
+  DeclarativeSequenceRelationStrategy
   {
+    #keys: '13[0.0.0][413988.0.1425205687][413988.0.1425205681][413988.0.1425205688][413988.0.1425205682][413988.0.1425205689][413988.0.1425205683][413988.0.1425205690][413988.0.1425205684][413988.0.1425205691][413988.0.1425205685][413988.0.1425205692][413988.0.1425205686]'
+    SortAttributes:
+    [
+      DeclarativeSequenceRelationSortAttribute
+      {
+        #keys: '1[413988.0.1425205694]'
+        Attribute: 'StartDate'
+      }
+    ]
   }
   RelationSide.LeftSide PackagingPlanCell
   {
diff --git a/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Test.qbl b/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Test.qbl
index 6c9a968..fff6a04 100644
--- a/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Test.qbl
+++ b/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Test.qbl
@@ -10,6 +10,7 @@
     interfaceDataset.InventoryPointSelection( relflush );
     
     iid1 := interfaceDataset.InventoryInterfaceData( relnew, Date := Date::Construct( 2020, 1, 28 ), PartNumber := "BLEU EV2 Sports" );
+    
     iid1.InventoryInterfaceDataDetail( relnew, Date := Date::Construct( 2020, 1, 28 ), PartNumber := "BLEU EV2 Sports", InventoryPoint := "PXSN", Quantity := 900 );
     iid1.InventoryInterfaceDataDetail( relnew, Date := Date::Construct( 2020, 1, 28 ), PartNumber := "BLEU EV2 Sports", InventoryPoint := "LPLE", Quantity := 800 );
     iid1.InventoryInterfaceDataDetail( relnew, Date := Date::Construct( 2020, 1, 28 ), PartNumber := "BLEU EV2 Sports", InventoryPoint := "3PLE", Quantity := 3100 );
diff --git a/_Main/BL/Type_PackagingPlanCell/Attribute_InitialPackagingInventory.qbl b/_Main/BL/Type_PackagingPlanCell/Attribute_InitialPackagingInventory.qbl
new file mode 100644
index 0000000..01a05f9
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/Attribute_InitialPackagingInventory.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute InitialPackagingInventory
+{
+  #keys: '3[413988.0.1427999378][413988.0.1427999377][413988.0.1427999379]'
+  ValueType: Real
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/Attribute_StartDate.qbl b/_Main/BL/Type_PackagingPlanCell/Attribute_StartDate.qbl
new file mode 100644
index 0000000..2ed47c7
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/Attribute_StartDate.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute StartDate
+{
+  #keys: '3[413988.0.1425205668][413988.0.1425205667][413988.0.1425205669]'
+  ValueType: Date
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl b/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
new file mode 100644
index 0000000..37445f4
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
@@ -0,0 +1,17 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcPackagingInventory
+{
+  TextBody:
+  [*
+    // lihongji Jul-26-2024 (created)
+    
+    value := this.InitialPackagingInventory() + guard( this.Previous().PackagingInventory()                 + 
+                                                       guard( this.Previous().Package(), 0.0 )              -  
+                                                       ifexpr( this.TransferIn() > 0.0, 0, this.Unpacking() ), 
+                                                       0.0 )
+                                              - this.Out();
+    
+    this.PackagingInventory( value );
+  *]
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/Function_CalcStartDate.qbl b/_Main/BL/Type_PackagingPlanCell/Function_CalcStartDate.qbl
new file mode 100644
index 0000000..0ebdc57
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/Function_CalcStartDate.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcStartDate
+{
+  TextBody:
+  [*
+    // lihongji Jul-26-2024 (created)
+    
+    value := guard( this.PackagingPlanColumn().StartDate(), Date::MinDate() );
+    
+    this.StartDate( value );
+  *]
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl b/_Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl
new file mode 100644
index 0000000..f1ca4e3
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/Function_CalcUnpackagedInventory.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcUnpackagedInventory
+{
+  TextBody:
+  [*
+    // lihongji Jul-24-2024 (created)
+    
+    value := guard( this.EndingInventory() - this.PackagingInventory(), 0.0 );
+    
+    this.UnpackagedInventory( value );
+  *]
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_CalculationPackagingPlanProperties.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_CalculationPackagingPlanProperties.qbl
new file mode 100644
index 0000000..07379b6
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_CalculationPackagingPlanProperties.qbl
@@ -0,0 +1,11 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod CalculationPackagingPlanProperties
+{
+  TextBody:
+  [*
+    Transaction::Transaction().Propagate( attribute( PackagingPlanCell, PackagingInventory ) );
+    Transaction::Transaction().Propagate( attribute( PackagingPlanCell, StartDate ) );
+    Transaction::Transaction().Propagate( attribute( PackagingPlanCell, UnpackagedInventory ) );
+  *]
+}
diff --git a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
new file mode 100644
index 0000000..f56c666
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -0,0 +1,100 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod GenerateReport (
+  MacroPlan macroPlan
+)
+{
+  TextBody:
+  [*
+    macroPlan.PackagingPlanRow( relflush );
+    macroPlan.PackagingPlanColumn( relflush );
+    
+    // 鍒涘缓璁″垝鍓嶄竴澶╁垪
+    planPre     := macroPlan.PackagingPlanColumn( relnew, StartDate := macroPlan.StartOfPlanning().Date() - 1 );
+    
+    // 鐢熸垚鎶ヨ〃
+    traverse ( macroPlan, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsLeaf() and not pisp.IsSystem() ) {
+      // 鍒涘缓琛�
+      ppr := select( macroPlan, PackagingPlanRow, tempPPR, tempPPR.ProductID() = pisp.ProductID() and tempPPR.StockingPointID() = pisp.StockingPointID() );
+      if ( isnull( ppr ) ) {
+        ppr := macroPlan.PackagingPlanRow( relnew, ProductID := pisp.ProductID(), StockingPointID := pisp.StockingPointID(), Factory := "澶ц繛宸ュ巶", Category := "ZKG" );
+      }
+      
+      // 鍒涘缓璁″垝鍓嶄竴澶╂牸瀛�
+      planPreCell      := ppr.PackagingPlanCell( relnew, PackagingPlanColumn := planPre, InitialPackagingInventory := 200 );
+      
+      // 鍑哄彂鍦板簱瀛樼偣Trip
+      originTrips      := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID() = pisp.StockingPointID() );
+      // 鐩殑鍦板簱瀛樼偣Trip
+      destinationTrips := selectset( macroPlan, Unit.Lane.LaneLeg.Trip, tempT, tempT.LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = pisp.StockingPointID() );
+      
+      traverse ( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispipl, not pispipl.IsPeriodFrozen() ) {
+        // 鍒涘缓鍒�
+        ppc := select( macroPlan, PackagingPlanColumn, tempPPC, tempPPC.StartDate() = pispipl.Start().Date() );
+        if ( isnull( ppc ) ) {
+          ppc := macroPlan.PackagingPlanColumn( relnew, StartDate := pispipl.Start().Date() );
+        }
+        
+        // 鍒涘缓鍗曞厓鏍�
+        cell := select( ppr, PackagingPlanCell, tempPPCell, tempPPCell.PackagingPlanColumn() = ppc );
+        if ( isnull( cell ) ) {
+          cell := ppr.PackagingPlanCell( relnew, NetDemand := pispipl.DependentDemandAndSalesDemandQuantity() - pispipl.NewSupplyQuantity(), EndingInventory := pispipl.InventoryLevelEnd() );
+          cell.PackagingPlanColumn( relset, ppc );
+        }
+        
+        // 璁剧疆璋冨嚭&璋冭繘
+        outs := selectset( originTrips, Elements, tempT, tempT.Departure().Date() = pispipl.Start().Date() );
+        traverse ( outs, Elements, out ) {
+          cell.Out( cell.Out() + out.Quantity() );
+        }
+        
+        transferIns := selectset( destinationTrips, Elements, tempT, tempT.Arrival().Date() = pispipl.Start().Date() );
+        traverse ( transferIns, Elements, ti ) {
+          cell.TransferIn( cell.TransferIn() + ti.Quantity() );
+        }
+        
+        // 璁剧疆鍓嶄竴澶╁簱瀛�
+        if ( pispipl.Start().Date() = macroPlan.StartOfPlanning().Date() ) {
+    //      prePISPIPL := pispipl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );
+          planPreCell.EndingInventory( 2000 );
+        }
+      }
+    }
+    
+    Transaction::Transaction().Propagate( attribute( PackagingPlanRow, FactoryAbbreviation ) );
+    PackagingPlanCell::CalculationPackagingPlanProperties();
+    Transaction::Transaction().Propagate( relation( PackagingPlanCell, Next ) );
+    
+    // 璁剧疆鍖呰&鎷嗗寘-鏁伴噺
+    traverse ( macroPlan, PackagingPlanRow, ppr, ppr.ProductID() = "Windshield" and ppr.StockingPointID() = "Bosch" ) {
+      traverse ( ppr, PackagingPlanCell, ppc/*, ppc.StartDate() = Date::Construct( 2020, 4, 1 )*/ ) {
+        // 璁剧疆鍖呰鏁伴噺
+        if ( ppc.PackagingInventory() < ppc.Out() ) { // 鍖呰搴撳瓨鏄惁灏忎簬璋冨嚭
+          prePPC                := ppc.Previous();
+          needPackagingQuantity := ppc.Out() - prePPC.PackagingInventory();
+          while ( not isnull( prePPC ) and needPackagingQuantity > 0.0 ) {
+            // 鑾峰彇鍖呰lotsize
+            ppls                   := select( macroPlan, PackagingPlanLotSize, tempPPLS, tempPPLS.Factory() =  ppc.PackagingPlanRow().Factory()    and 
+                                                                                        tempPPLS.ProductID() = ppc.PackagingPlanRow().ProductID() );
+            
+            // 鑾峰彇鏈�澶у寘瑁呮暟閲�
+            maxPackageReflection   := Reflection::FindAttribute( "PackagingPlanCapability", ppc.PackagingPlanRow().FactoryAbbreviation() + "_" + ppc.PackagingPlanRow().Category() + "_Package" );
+            maxPackageQuantity     := maxPackageReflection.GetNumber( macroPlan.PackagingPlanCapability() );
+            
+            // 鑾峰彇鏈�缁堝寘瑁呮暟閲�
+            finalPackagingQuantity := minvalue( ceil( needPackagingQuantity / ppls.LotSize() ), ceil( ( maxPackageQuantity - prePPC.Package() ) / ppls.LotSize() ) ) * ppls.LotSize();
+            needPackagingQuantity  := needPackagingQuantity - finalPackagingQuantity;
+            
+            // 璁剧疆鍖呰鍊�
+            prePPC.Package( prePPC.Package() + finalPackagingQuantity );
+            
+            //debuginfo( "闇�瑕佸寘瑁呮暟閲忥細", needPackagingQuantity, "    lotsize: ", ppls.LotSize(), "    鏈�澶у寘瑁呮暟閲忥細", maxPackageQuantity, "    鏈�缁堣ˉ鐨勬暟閲忥細", finalPackagingQuantity );
+            PackagingPlanCell::CalculationPackagingPlanProperties();
+          
+            prePPC := prePPC.Previous();
+          }
+        }
+      }
+    }
+  *]
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Attribute_Category.qbl b/_Main/BL/Type_PackagingPlanRow/Attribute_Category.qbl
new file mode 100644
index 0000000..4e36ba5
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Attribute_Category.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Category
+{
+  #keys: '3[413988.0.1430706337][413988.0.1430706336][413988.0.1430706338]'
+  Description: '澶х被'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Attribute_Factory.qbl b/_Main/BL/Type_PackagingPlanRow/Attribute_Factory.qbl
new file mode 100644
index 0000000..e5e8503
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Attribute_Factory.qbl
@@ -0,0 +1,8 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Factory
+{
+  #keys: '3[413988.0.1404590967][413988.0.1404590966][413988.0.1404590968]'
+  Description: '宸ュ巶'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Attribute_FactoryAbbreviation.qbl b/_Main/BL/Type_PackagingPlanRow/Attribute_FactoryAbbreviation.qbl
new file mode 100644
index 0000000..d423886
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Attribute_FactoryAbbreviation.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute FactoryAbbreviation
+{
+  #keys: '3[413988.0.1430706347][413988.0.1430706346][413988.0.1430706348]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Attribute_Name.qbl b/_Main/BL/Type_PackagingPlanRow/Attribute_Name.qbl
new file mode 100644
index 0000000..b308198
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Attribute_Name.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute Name
+{
+  #keys: '3[413988.0.1416083784][413988.0.1416083783][413988.0.1416083785]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Attribute_StockingPointID.qbl b/_Main/BL/Type_PackagingPlanRow/Attribute_StockingPointID.qbl
new file mode 100644
index 0000000..88a5a73
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Attribute_StockingPointID.qbl
@@ -0,0 +1,7 @@
+Quintiq file version 2.0
+#parent: #root
+Attribute StockingPointID
+{
+  #keys: '3[413988.0.1407361446][413988.0.1407361445][413988.0.1407361447]'
+  ValueType: String
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Function_CalcFactoryAbbreviation.qbl b/_Main/BL/Type_PackagingPlanRow/Function_CalcFactoryAbbreviation.qbl
new file mode 100644
index 0000000..d7563fb
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Function_CalcFactoryAbbreviation.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcFactoryAbbreviation
+{
+  TextBody:
+  [*
+    // lihongji Jul-26-2024 (created)
+    
+    value := ifexpr( this.Factory() = "澶ц繛宸ュ巶", "DL", "CC" );
+    
+    this.FactoryAbbreviation( value );
+  *]
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Function_CalcName.qbl b/_Main/BL/Type_PackagingPlanRow/Function_CalcName.qbl
new file mode 100644
index 0000000..e7b2259
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Function_CalcName.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Function CalcName
+{
+  TextBody:
+  [*
+    // lihongji Jul-24-2024 (created)
+    
+    value := guard( this.ProductID() + " in " + this.StockingPointID(), this.ProductID() );
+    
+    this.Name( value );
+  *]
+}
diff --git a/_Main/BL/Type_PackagingPlanRow/Method_FilterProduct.qbl b/_Main/BL/Type_PackagingPlanRow/Method_FilterProduct.qbl
new file mode 100644
index 0000000..7d7fb98
--- /dev/null
+++ b/_Main/BL/Type_PackagingPlanRow/Method_FilterProduct.qbl
@@ -0,0 +1,13 @@
+Quintiq file version 2.0
+#parent: #root
+Method FilterProduct (
+  Product_MPs products
+) declarative remote as Boolean
+{
+  TextBody:
+  [*
+    flag := exists( products, Elements, tempP, tempP.ID() = this.ProductID() );
+    
+    return flag;
+  *]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_Form989/Component_List531.def b/_Main/UI/MacroPlannerWebApp/Component_Form989/Component_List531.def
index e67c89d..aa87fe7 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_Form989/Component_List531.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_Form989/Component_List531.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Code","title":"Code","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Code"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"VehicleModel","title":"VehicleModel","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"VehicleModel"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Code","title":"Code","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Code"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"VehicleModel","title":"AutoType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"VehicleModel"}}]'
         ContextMenu: 'listContextMenu852'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPR_PP_Budget/Component_List531.def b/_Main/UI/MacroPlannerWebApp/Component_FormPR_PP_Budget/Component_List531.def
index 742cf8b..39fe6c3 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormPR_PP_Budget/Component_List531.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPR_PP_Budget/Component_List531.def
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Model","title":"Model","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Model"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ModelCode","title":"ModelCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ModelCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Engine","title":"Engine","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Engine"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProducingArea","title":"ProducingArea","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"ProducingArea"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"VehicleModel","title":"VehicleModel","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"VehicleModel"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EnginePartNumber","title":"EnginePartNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EnginePartNumber"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EngineFourDigitCode","title":"EngineFourDigitCode","subtotals":"","tooltip":"","width":-1,"display":"shown","attribute":"EngineFourDigitCode"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Model","title":"Model","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Model"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ModelCode","title":"ModelCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ModelCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Engine","title":"Engine","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Engine"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProducingArea","title":"ProducingArea","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProducingArea"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"VehicleModel","title":"AutoType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"VehicleModel"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EnginePartNumber","title":"EngineNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EnginePartNumber"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EngineFourDigitCode","title":"EngineFourDigitCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EngineFourDigitCode"}}]'
         ContextMenu: 'listContextMenu852'
         Taborder: 2
       ]
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def
new file mode 100644
index 0000000..153bc7a
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_MatrixEditor493.def
@@ -0,0 +1,100 @@
+Quintiq file version 2.0
+Component MatrixEditor493
+{
+  #keys: '[413988.0.1409905016]'
+  BaseType: 'WebMatrixEditor'
+  Children:
+  [
+    Component MatrixEditorCell367
+    {
+      #keys: '[413988.0.1409905017]'
+      BaseType: 'WebMatrixEditorCell'
+      Children:
+      [
+        Component DataExtractor902
+        {
+          #keys: '[413988.0.1409905018]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'MacroPlan'
+            Source: 'MacroPlan'
+            Taborder: 0
+            Transformation: 'PackagingPlanRow.PackagingPlanCell'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Attributes: 'NetDemand;EndingInventory;UnpackagedInventory;PackagingInventory;Out;TransferIn;Package;Unpacking'
+        Column: 'PackagingPlanColumn'
+        Row: 'PackagingPlanRow'
+        Taborder: 0
+      ]
+    }
+    Component MatrixEditorRows151
+    {
+      #keys: '[413988.0.1409905021]'
+      BaseType: 'WebMatrixEditorHeaderLevel'
+      Children:
+      [
+        Component DataExtractor967
+        {
+          #keys: '[413988.0.1409905022]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'MacroPlan'
+            FilterArguments: 'products:QLibMacroPlannerWebUI::ApplicationMacroPlanner.DataHolderCheckedProduct'
+            FixedFilter: 'object.FilterProduct( products )'
+            Source: 'MacroPlan'
+            Taborder: 0
+            Transformation: 'PackagingPlanRow'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Legend: 'Name'
+        SortCriteria: 'ProductID;StockingPointID'
+        Taborder: 1
+      ]
+    }
+    Component MatrixEditorColumns345
+    {
+      #keys: '[413988.0.1409905025]'
+      BaseType: 'WebMatrixEditorHeaderLevel'
+      Children:
+      [
+        Component DataExtractor445
+        {
+          #keys: '[413988.0.1409905026]'
+          BaseType: 'WebDataExtractor'
+          Properties:
+          [
+            DataType: 'MacroPlan'
+            Source: 'MacroPlan'
+            Taborder: 0
+            Transformation: 'PackagingPlanColumn'
+          ]
+        }
+      ]
+      Properties:
+      [
+        Legend: 'StartDate'
+        SortCriteria: 'StartDate'
+        Taborder: 2
+      ]
+    }
+    #child: matrixEditorActionBarPage529
+    #child: matrixeditorContextMenu812
+  ]
+  Properties:
+  [
+    AllowMultipleAttributes: true
+    Columns: 'MatrixEditorColumns345'
+    ContextMenu: 'matrixeditorContextMenu812'
+    Rows: 'MatrixEditorRows151'
+    Taborder: 0
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixEditorActionBarPage529.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixEditorActionBarPage529.def
new file mode 100644
index 0000000..bcfc108
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixEditorActionBarPage529.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component matrixEditorActionBarPage529
+{
+  #keys: '[413988.0.1409905029]'
+  BaseType: 'matrixEditorActionBarPage'
+  Properties:
+  [
+    Taborder: 3
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixeditorContextMenu812.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixeditorContextMenu812.def
new file mode 100644
index 0000000..2291c55
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_matrixeditorContextMenu812.def
@@ -0,0 +1,10 @@
+Quintiq file version 2.0
+Component matrixeditorContextMenu812
+{
+  #keys: '[413988.0.1409905032]'
+  BaseType: 'matrixeditorContextMenu'
+  Properties:
+  [
+    Taborder: 4
+  ]
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pContent.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pContent.def
index d51dd19..2748802 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pContent.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pContent.def
@@ -3,6 +3,10 @@
 {
   #keys: '[413988.0.1400730424]'
   BaseType: 'WebPanel'
+  Children:
+  [
+    #child: MatrixEditor493
+  ]
   Properties:
   [
     Taborder: 1
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
index ef58a48..77e28f7 100644
--- a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Component_pHeader.def
@@ -55,6 +55,18 @@
         Taborder: 4
       ]
     }
+    Component ddslFactorySelection
+    {
+      #keys: '[413988.0.1407075301]'
+      BaseType: 'WebDropDownStringList'
+      Properties:
+      [
+        Label: '宸ュ巶'
+        Sorting: 'none'
+        Strings: '澶ц繛宸ュ巶;闀挎槬宸ュ巶'
+        Taborder: 5
+      ]
+    }
   ]
   Properties:
   [
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bDownload_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bDownload_OnClick.def
new file mode 100644
index 0000000..bab8a27
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bDownload_OnClick.def
@@ -0,0 +1,12 @@
+Quintiq file version 2.0
+#parent: pHeader/bDownload
+Response OnClick () id:Response_pHeader_bDownload_OnClick
+{
+  #keys: '[413988.0.1428111923]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  QuillAction
+  {
+    GroupServerCalls: false
+  }
+}
diff --git a/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def
new file mode 100644
index 0000000..8ac7a05
--- /dev/null
+++ b/_Main/UI/MacroPlannerWebApp/Component_FormPackagingPlan/Response_pHeader_bGenerateReport_OnClick.def
@@ -0,0 +1,22 @@
+Quintiq file version 2.0
+#parent: pHeader/bGenerateReport
+Response OnClick () id:Response_pHeader_bGenerateReport_OnClick
+{
+  #keys: '[413988.0.1409976006]'
+  CanBindMultiple: false
+  DefinitionID: 'Responsedef_WebButton_OnClick'
+  Precondition:
+  [*
+    return not isnull( MacroPlan );
+  *]
+  QuillAction
+  {
+    Body:
+    [*
+      PackagingPlanCell::GenerateReport( MacroPlan );
+      
+      WebMessageBox::Success( Translations::A_VWED_Success() );
+    *]
+    GroupServerCalls: false
+  }
+}
diff --git "a/_Main/UI/MacroPlannerWebApp/Component_FormSixDigitCode/Component_List531\043836.def" "b/_Main/UI/MacroPlannerWebApp/Component_FormSixDigitCode/Component_List531\043836.def"
index 5e5e4ca..86f8a26 100644
--- "a/_Main/UI/MacroPlannerWebApp/Component_FormSixDigitCode/Component_List531\043836.def"
+++ "b/_Main/UI/MacroPlannerWebApp/Component_FormSixDigitCode/Component_List531\043836.def"
@@ -28,7 +28,7 @@
       ]
       Properties:
       [
-        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Code","title":"Code","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Code"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Curve","title":"Curve","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Curve"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"VehicleModel","title":"VehicleModel","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"VehicleModel"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProducingArea","title":"ProducingArea","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProducingArea"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Engine","title":"Engine","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Engine"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Power","title":"Power","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Power"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EnginePartNumber","title":"EnginePartNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EnginePartNumber"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EngineFourDigitCode","title":"EngineFourDigitCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EngineFourDigitCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Remarks","title":"Remarks","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Remarks"}}]'
+        Columns: '[{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Code","title":"Code","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Code"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Curve","title":"Curve","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Curve"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"VehicleModel","title":"AutoType","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"VehicleModel"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"ProducingArea","title":"ProducingArea","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"ProducingArea"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Engine","title":"Engine","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Engine"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Power","title":"Power","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Power"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EnginePartNumber","title":"EngineNumber","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EnginePartNumber"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"EngineFourDigitCode","title":"EngineFourDigitCode","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"EngineFourDigitCode"}},{"attribute":{"classtype":"WebApiDefinitionAttributeDataMember","columnid":"Remarks","title":"Notes","subtotals":"","tooltip":"","width":-1,"display":"shown","editable":false,"attribute":"Remarks"}}]'
         ContextMenu: 'listContextMenu852'
         Taborder: 2
       ]
diff --git "a/_var/_Main/ProjSettings/EditorTC/Views/\347\217\255\346\254\241\346\227\266\351\227\264\345\210\206\346\236\220_\133413988.0.1367211460\135.vw" "b/_var/_Main/ProjSettings/EditorTC/Views/\347\217\255\346\254\241\346\227\266\351\227\264\345\210\206\346\236\220_\133413988.0.1367211460\135.vw"
index 4f89ad5..372d6ab 100644
--- "a/_var/_Main/ProjSettings/EditorTC/Views/\347\217\255\346\254\241\346\227\266\351\227\264\345\210\206\346\236\220_\133413988.0.1367211460\135.vw"
+++ "b/_var/_Main/ProjSettings/EditorTC/Views/\347\217\255\346\254\241\346\227\266\351\227\264\345\210\206\346\236\220_\133413988.0.1367211460\135.vw"
@@ -17,7 +17,7 @@
   CREATIONUSER 'quintiq/lihongji'
   UPDATEDATETIME '2024-07-16T11:47:37'
   UPDATEUSER 'quintiq/lihongji'
-  LASTACCESSDATE '2024-07-19'
+  LASTACCESSDATE '2024-07-26'
   VIEWSCOPE 0
 }
 AUTHORIZATIONS

--
Gitblit v1.9.3