From 9114e6d212617a2b12f19dc37d697b24d9efb1a0 Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期一, 28 十月 2024 18:33:41 +0800
Subject: [PATCH] 包装计划优化

---
 _Main/UI/MacroPlannerWebApp/Views/PackagingPlan.vw                  |  109 ++++++++++++++++++++++++++++++++++++
 _Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl     |    7 +
 _Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl |    9 +-
 3 files changed, 119 insertions(+), 6 deletions(-)

diff --git a/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl b/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
index 628ac49..c4e2762 100644
--- a/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/Function_CalcPackagingInventory.qbl
@@ -8,10 +8,11 @@
     
     value := ifexpr( this.PackagingPlanRow().Factory() = "闀挎槬宸ュ巶", this.CC_PackagingInventory(),
                      this.InitialPackagingInventory() + guard( this.Previous().PackagingInventory()                 + 
-                                                       guard( this.Package(), 0.0 )                         -  
-                                                       ifexpr( this.TransferIn() > 0.0, 0, this.Unpacking() ), 
-                                                       0.0 )
-                                              - this.Out()
+                                                               this.TransferIn()                                    +
+                                                               guard( this.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/StaticMethod_GenerateReport.qbl b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
index 4e84001..e45b9e4 100644
--- a/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
+++ b/_Main/BL/Type_PackagingPlanCell/StaticMethod_GenerateReport.qbl
@@ -65,14 +65,12 @@
           // 鍑�闇�姹�&鍓╀綑搴撳瓨&渚涘簲閲�
           cell.NetDemand( cell.NetDemand() + pispipl.DependentDemandAndSalesDemandQuantity() );
           cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
-          cell.NewSupply( cell.NewSupply() + pispipl.NewSupplyQuantity() );
         }
         
         // 闀挎槬宸ュ巶璁剧疆鍊�
         if ( factory = "闀挎槬宸ュ巶" ) {
           // 鍓╀綑搴撳瓨&渚涘簲閲�
           cell.EndingInventory( cell.EndingInventory() + pispipl.InventoryLevelEnd() );
-          cell.NewSupply( cell.NewSupply() + pispipl.NewSupplyQuantity() );
           
           // 鍑�闇�姹傘�愬彧鍙栫嚎杈瑰簱銆�&鍖呰搴撳瓨&闈炲寘瑁呭簱瀛�
           if ( pisp.StockingPointID().Regex( "澶栫搴�" ) ) {
@@ -83,6 +81,11 @@
           }
         }
         
+        // 璁剧疆New Supply锛岀函鐢熶骇鍊�
+        traverse ( pispipl, NewSupply, ns, ns.PeriodTask_MP().istype( PeriodTaskOperation ) ) {
+          cell.NewSupply( cell.NewSupply() + ns.Quantity() );
+        }
+        
         // 璁剧疆鍓嶄竴澶╁簱瀛�
         if ( pispipl.Start().Date() = macroPlan.StartOfPlanning().Date() ) {
           prePISPIPL  := pispipl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf ); // 鍓嶄竴涓猵ispippl
diff --git a/_Main/UI/MacroPlannerWebApp/Views/PackagingPlan.vw b/_Main/UI/MacroPlannerWebApp/Views/PackagingPlan.vw
index 84e6ea8..72d0f28 100644
--- a/_Main/UI/MacroPlannerWebApp/Views/PackagingPlan.vw
+++ b/_Main/UI/MacroPlannerWebApp/Views/PackagingPlan.vw
@@ -27,6 +27,115 @@
           {
             sizeRatio: 1
           }
+          FormPackagingPlan_MatrixEditor493
+          {
+            gridColor: '#c4c4c4'
+            totalHeaderWidth: 224
+            attributeHeaderWidthRatio: 0.6
+            nameHeaderWidthRatio: 0.4
+            columnWidth: 100
+            horizontalGrid: true
+            verticalGrid: true
+            backendState
+            {
+              componentId: 'QMacroPlanner::FormPackagingPlan.MatrixEditor493'
+              state
+              {
+                cells
+                {
+                  attributes
+                  {
+                    attribute_NetDemand
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 0
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'NetDemand'
+                    }
+                    attribute_NewSupply
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 1
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'NewSupply'
+                    }
+                    attribute_EndingInventory
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 2
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'EndingInventory'
+                    }
+                    attribute_Out
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 3
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'Out'
+                    }
+                    attribute_TransferIn
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 4
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'TransferIn'
+                    }
+                    attribute_UnpackagedInventory
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 5
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'UnpackagedInventory'
+                    }
+                    attribute_PackagingInventory
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 6
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'PackagingInventory'
+                    }
+                    attribute_Package
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 7
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'Package'
+                    }
+                    attribute_Unpacking
+                    {
+                      type: 'MatrixEditorWebApiCellDataModelInterest'
+                      index: 8
+                      rowsubtotal: ''
+                      columnsubtotal: ''
+                      attribute: 'Unpacking'
+                    }
+                  }
+                }
+                columns
+                {
+                  sorting
+                  {
+                    criteria: "datamember:'StartDate'"
+                  }
+                }
+                rows
+                {
+                  sorting
+                  {
+                    criteria: "datamember:'ProductID';datamember:'StockingPointID'"
+                  }
+                }
+              }
+            }
+          }
         }
       }
       form_FormGeneralSettings

--
Gitblit v1.9.3