From f9c8e9e3438d19dc7a3ee087b631dbe593663112 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期三, 09 十月 2024 11:34:43 +0800
Subject: [PATCH] 机加管线报表的数据bug

---
 _Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl |   32 ++++++++++----------------------
 1 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl b/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
index 07abf2d..9d3c315 100644
--- a/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -9,9 +9,6 @@
     // 鐢勫叞楦� Jun-24-2024 (created)
     owner.FinancialProductionSource( relflush );
     productparent             := MachiningPipelineReport::GetDefaultProductParent();
-    //ccunit                    := MachiningPipelineReport::GetDefaultCCUnit();
-    //dlunit                    := MachiningPipelineReport::GetDefaultDLUnit();
-    //allunit                   := EnginePipelineReport::GetDefaultAllUnit();
     source                    := owner.MachiningPipelineSource( relnew, Name := MachiningPipelineReport::GetDefaultName() );
     table                     := source.Report( relnew, ID := source.Name(), Name := source.Name() );
     showtable                 := source.Report( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsShow := true );
@@ -31,23 +28,15 @@
       iscc                    := stockingpoint.ID().StartsWith( 'CC' ) or unit.ID().StartsWith( 'CC' ) or exists( parentunits, Elements, punit, punit.ID().StartsWith( 'CC' ) );//unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit );
       //鏄惁灞炰簬澶ц繛宸ュ巶
       isdl                    := stockingpoint.ID().StartsWith( 'DL' ) or unit.ID().StartsWith( 'DL' ) or exists( parentunits, Elements, punit, punit.ID().StartsWith( 'DL' ) );//unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit );
-      //鏄惁灞炰簬闀挎槬瑁呴厤绾緾C鍘傚唴搴�
-    //  isccassemnly            := stockingpoint.ID().EndsWith( '鍘傚唴搴�' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( '闀挎槬' ) );//unit.ID() = MachiningPipelineReport::GetDefaultCCAssemnlyUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultCCAssemnlyUnit() );
-      //鏄惁灞炰簬澶ц繛瑁呴厤绾緿L鍘傚唴搴�
-    //  isdlassemnly            := stockingpoint.ID().EndsWith( '鍘傚唴搴�' ) and ( stockingpoint.ID().StartsWith( 'DL' ) or stockingpoint.ID().StartsWith( '澶ц繛' ) );//unit.ID() = MachiningPipelineReport::GetDefaultDLAssemnlyUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultDLAssemnlyUnit() );
-      //鏄惁灞炰簬闀挎槬鏈哄姞浜х嚎
-      isccproduction          := stockingpoint.ID().EndsWith( '绾胯竟搴�' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( '闀挎槬' ) );//unit.ID() = MachiningPipelineReport::GetDefaultCCProductionUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultCCProductionUnit() );
-      //鏄惁灞炰簬澶ц繛鏈哄姞浜х嚎
-      isdlproduction          := unit.ID().EndsWith( 'MoMo' ) and unit.ID().StartsWith( 'DL' );//unit.ID() = MachiningPipelineReport::GetDefaultDLProductionUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultDLProductionUnit() );
       if( iscc or isdl ){
-        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() and not pisp.IsSystem() 
+        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() and not pisp.IsSystem()// and pisp.ProductID() = '06K103011CM'
                   and exists( pisp.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent ) 
                   and exists( 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 ) ) ){
           isccassemnly        := stockingpoint.ID().EndsWith( pisp.Product_MP().ParentID() + '绾胯竟搴�' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( '闀挎槬' ) );
           isdlassemnly        := stockingpoint.ID().EndsWith( pisp.Product_MP().ParentID() ) and ( stockingpoint.ID().StartsWith( 'DL' ) or stockingpoint.ID().StartsWith( '澶ц繛' ) );
           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 ){
+          traverse( pispips, Elements, pispip){//, pispip.Start().Month() = 1 and pispip.Start().Day() = 2
             products.Add( pisp.Product_MP() );
             
             //澶�
@@ -57,18 +46,17 @@
             
             row               := table.GetRow( pisp.ProductID() );
               
-            //瑁呴厤绾�
+            
             if( isccassemnly or isdlassemnly ){
+              //瑁呴厤绾�
               quantity        := [Number]pispip.DependentDemandAndSalesDemandQuantity();//鍥涜垗浜斿叆
-              row.SetCellProductionValue( daycolumn, isccassemnly, [Real]quantity );
-              row.SetCellProductionValue( weekcolumn, isccassemnly, [Real]quantity );
-            }
-              
-            //鏈哄姞绾�
-            if( isccproduction or isdlproduction ){
+              row.SetAssemblyPlanValue(  daycolumn, isccassemnly, [Real]quantity );
+              row.SetAssemblyPlanValue( weekcolumn, isccassemnly, [Real]quantity );
+              //鐢熶骇
               supplyqty       := [Number]pispip.NewSupplyQuantity();//鍥涜垗浜斿叆
-              row.SetCellProductionValue( daycolumn, isccproduction, [Real]supplyqty );
-              row.SetCellProductionValue( weekcolumn, isccproduction, [Real]supplyqty );
+    //          info( '****************', quantity, supplyqty );
+              row.SetCellProductionValue( daycolumn, isccassemnly, [Real]supplyqty );
+              row.SetCellProductionValue( weekcolumn, isccassemnly, [Real]supplyqty );
             }
             
             //搴撳瓨

--
Gitblit v1.9.3