From 4419b51e5cfed824ca592ae5cba7654994ee005d Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期二, 29 十月 2024 17:30:24 +0800
Subject: [PATCH] 下线计划存档前端

---
 _Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl b/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
index 1d0e66d..7fa7381 100644
--- a/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
+++ b/_Main/BL/Type_FinancialSalesSource/StaticMethod_InitializeNew.qbl
@@ -13,7 +13,6 @@
     }
     owner.FSImportData( relflush );
     productids                := construct( Strings );
-    //allunit                   := FinancialSalesReport::GetDefaultAllUnit();
     ccunit                    := FinancialSalesReport::GetDefaultCCUnit();
     dlunit                    := FinancialSalesReport::GetDefaultDLUnit();
     ccsalessegment            := FinancialSalesReport::GetSalesSegmentCC();
@@ -32,7 +31,7 @@
     table.GenerateColumn( owner );
     
     //棣栧厛鍦╢orecast鐣岄潰鏌ユ壘sales segment涓洪暱鏄ョ殑鎵�鏈夐渶姹傦紝璇嗗埆鍑篗LB鐨勬墍鏈変骇鍝侊紝姣忎釜浜у搧鎸夋湀姹囨�婚渶姹傛暟閲�
-    traverse( owner, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.SalesSegment_MP() ) and forecast.StartDate() <= startofnextyear and forecast.Quantity() <> 0 
+    traverse( owner, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.SalesSegment_MP() ) and ( forecast.StartDate() + Duration::Days( 1 ) ).Date() < startofnextyear and forecast.Quantity() <> 0 
               and exists( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 ) ){
       salessegment            := forecast.SalesSegment_MP();
       parentsalessegments     := salessegment.GetAllParent();
@@ -47,17 +46,14 @@
       //Forecast鐨凷ales Segment涓洪暱鏄ワ紝璇嗗埆鍑篗LB鐨勬墍鏈変骇鍝佹眹鎬�
       //澶ц繛璐㈠姟閿�閲忥細棣栧厛鍦╢orecast鐣岄潰鏌ユ壘Sales Segment鏄ぉ娲ュ拰浣涘北鐨勬墍鏈夐渶姹傦紝姣忎釜浜у搧鎸夋湀姹囨�婚渶姹傛暟閲� and forecast.Product_MP().MQBMLB() = 'MLB' ) 
       if( ( iscc and product.MQBMLB() = 'MLB' ) or ( isccrent and product.MQBMLB() = 'MQB' ) or isdl ){
-        
-        //鑾峰彇鍚堣琛�
-    //    allrow               := table.GetRow( allunit, product );
         //鑾峰彇宸ュ巶琛�
         factoryrow           := table.GetRow( ifexpr( isdl, dlunit, ccunit ), product );
       
         productids.Add( forecast.ProductID() );
-        traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 ){
-          dayperiodtime      := psdip.StartDate();
+        traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 and ( psdip.StartDate() + Duration::Days( 1 ) ).Date() < startofnextyear ){
+          dayperiodtime      := ( psdip.StartDate() + Duration::Days( 1 ) ).Date();//psdip.StartDate();
           dayperiodname      := dayperiodtime.Format( "M2/D2/Y" );
-          periodtime         := psdip.StartDate().StartOfMonth();
+          periodtime         := dayperiodtime.StartOfMonth();
           periodname         := periodtime.Format( "M2/D2/Y" );
     //      info( '-------------------------', periodname, periodtime );
           daycolumn          := selectobject( table, FinancialSalesColumn, column, column.Name() = dayperiodname and column.Period() = dayperiodtime and column.IsDay() );
@@ -67,23 +63,21 @@
           
           factoryrow.Initialize( column, quantity );
           factoryrow.Initialize( daycolumn, quantity );
-    //      allrow.Initialize( column, quantity );
         }
       }
     }
     //浠嶱roduct planning鏌ユ壘搴撳瓨鐐逛负澶ц繛鍙戝姩鏈虹殑闀挎槬澶栫搴擄紝鍙朜ew supply瀛楁鎸夋湀姹囨�婚渶姹傛暟閲�
     traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID() = '澶ц繛鍙戝姩鏈虹殑闀挎槬澶栫搴�' ){
         traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf()
-                  and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear 
+                  and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and ( pispip.Start() + Duration::Days( 1 ) ).Date() < startofnextyear 
                               and ( pispip.DependentDemandAndSalesDemandQuantity() <> 0 or pispip.NewSupplyQuantity() <> 0 ) ) ){//浜у搧涓篗QB
           product           := pisp.Product_MP();
-    //      allrow            := table.GetRow( allunit, product );
           factoryrow        := table.GetRow( dlunit, product );
           productids.Add( pisp.ProductID() );
           traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical()
-                    and pispip.Period_MP().StartDate() < startofnextyear 
+                    and ( pispip.Start() + Duration::Days( 1 ) ).Date() < startofnextyear 
                     and ( pispip.DependentDemandAndSalesDemandQuantity() <> 0 or pispip.NewSupplyQuantity() <> 0 ) ){
-            dayperiodtime   := pispip.Start().Date();
+            dayperiodtime   := ( pispip.Start() + Duration::Days( 1 ) ).Date();//pispip.Start().Date();
             dayperiodname   := dayperiodtime.Format( "M2/D2/Y" );
             periodtime      := dayperiodtime.StartOfMonth();
             periodname      := periodtime.Format( "M2/D2/Y" );
@@ -93,7 +87,6 @@
             
             factoryrow.Initialize( column, quantity );//鍙朤otal Demand瀛楁鎸夋湀姹囨�婚渶姹傛暟閲�
             factoryrow.Initialize( daycolumn, quantity );
-    //        allrow.Initialize( column, quantity );
           }
         }
     //  }

--
Gitblit v1.9.3