From ed070d695972cadcf9b6bbfe9e779aa5a0850125 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期三, 09 十月 2024 09:15:28 +0800
Subject: [PATCH] 库存汇总报表数据逻辑bug

---
 _Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl |   52 +++++++++++++++++++++-------------------------------
 1 files changed, 21 insertions(+), 31 deletions(-)

diff --git a/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl b/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
index ca7ed85..843e310 100644
--- a/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -48,43 +48,37 @@
           pispips             := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() 
                                                   and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 or pispip.DependentDemandAndSalesDemandQuantity() <> 0 ), pispip.Start() );
           traverse( pispips, Elements, pispip ){
-            supplyquantity    := [Number]pispip.NewSupplyQuantity();//鍥涜垗浜斿叆
+            products.Add( pisp.Product_MP() );
+            
             //澶�
             daycolumn         := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), pispip.Start().Date() );
             //鍛�
             weekcolumn        := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), pispip.Start().Date() );
             
+            product           := pisp.Product_MP();
+            productparents    := product.GetAllParent();
+            row               := table.GetRow( pisp.ProductID() );
+              
             //瑁呴厤绾�
             if( isccassemnly or isdlassemnly ){
               quantity        := [Number]pispip.DependentDemandAndSalesDemandQuantity();//鍥涜垗浜斿叆
-              if( isccassemnly ){
-                daycolumn.CCAssemblyPlanQty( daycolumn.CCAssemblyPlanQty() + quantity );
-                weekcolumn.CCAssemblyPlanQty( weekcolumn.CCAssemblyPlanQty() + quantity );
-              } else {
-                daycolumn.DLAssemblyPlanQty( daycolumn.DLAssemblyPlanQty() + quantity );
-                weekcolumn.DLAssemblyPlanQty( weekcolumn.DLAssemblyPlanQty() + quantity );
-              } 
+              row.SetCellProductionValue( daycolumn, isccassemnly, [Real]quantity );
+              row.SetCellProductionValue( weekcolumn, isccassemnly, [Real]quantity );
+            }
+              
+            //鏈哄姞绾�
+            if( isccproduction or isdlproduction ){
+              supplyqty       := [Number]pispip.NewSupplyQuantity();//鍥涜垗浜斿叆
+              row.SetCellProductionValue( daycolumn, isccproduction, [Real]supplyqty );
+              row.SetCellProductionValue( weekcolumn, isccproduction, [Real]supplyqty );
             }
             
-            product           := pisp.Product_MP();
-            productparents    := product.GetAllParent();
-            if( exists( productparents, Elements, e, e.ID() = productparent ) ){//鏌ヨ浜у搧绫诲瀷鏄彂鍔ㄦ満
-              row             := table.GetRow( pisp.ProductID() );
-              products.Add( pisp.Product_MP() );
-    
-              inventoryquantity:= [Number]pispip.PlannedInventoryLevelEnd();//鍥涜垗浜斿叆
-              
-              //鏈哄姞绾�
-              if( isccproduction or isdlproduction ){
-                row.SetCellProductionValue( daycolumn, isccproduction, [Real]supplyquantity );
-                row.SetCellProductionValue( weekcolumn, isccproduction, [Real]supplyquantity );
-              }
-              //搴撳瓨
-              if( iscc or isdl ){
-                row.SetCellInventoryValue( daycolumn, iscc, [Real]inventoryquantity );
-                if( weekcolumn.EndDate() = pispip.Start().Date() or pispip.Period_MP() = endperiod ){
-                  row.SetCellInventoryValue( weekcolumn, iscc, [Real]inventoryquantity );
-                }
+            //搴撳瓨
+            if( iscc or isdl ){
+              inventoryqty    := [Number]pispip.PlannedInventoryLevelEnd();//鍥涜垗浜斿叆
+              row.SetCellInventoryValue( daycolumn, iscc, [Real]inventoryqty );
+              if( weekcolumn.EndDate() = pispip.Start().Date() or pispip.Period_MP() = endperiod ){
+                row.SetCellInventoryValue( weekcolumn, iscc, [Real]inventoryqty );
               }
             }
           }
@@ -132,10 +126,6 @@
     i    := 0;
     traverse( rows, Elements, e ){
       e.RowNr( i );
-      traverse( e, Cell, cell ){
-        cell.CCAssemblyPlanQty( cell.Column().CCAssemblyPlanQty() );
-        cell.DLAssemblyPlanQty( cell.Column().DLAssemblyPlanQty() );
-      }
       i := i + 1;
     }
     showtable.Generate( search, products );

--
Gitblit v1.9.3