From 6d9548e7d4d9221c031deddf985fcb674fa680d2 Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期三, 13 十一月 2024 10:05:38 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev

---
 _Main/BL/Type_FinancialProductionReport/Method_GenerateColumn.qbl  |    2 +-
 _Main/BL/Type_FinancialSalesReport/Method_GenerateColumn.qbl       |    2 +-
 _Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl   |    2 +-
 _Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl |   21 ++++++++++++---------
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/_Main/BL/Type_FinancialProductionReport/Method_GenerateColumn.qbl b/_Main/BL/Type_FinancialProductionReport/Method_GenerateColumn.qbl
index f7f8483..85b473e 100644
--- a/_Main/BL/Type_FinancialProductionReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_FinancialProductionReport/Method_GenerateColumn.qbl
@@ -11,7 +11,7 @@
     startofyear               := startofplanning.StartOfYear();
     startofnextyear           := startofplanning.StartOfNextYear();
     
-    for( start := startofyear; start < startofnextyear; start := start.StartOfMonth() ){
+    for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){
       periodtime := start.Date();
       periodname := periodtime.Format( "M2/D2/Y" );
       this.FinancialProductionColumn( relnew, Name := periodname, Period := periodtime );
diff --git a/_Main/BL/Type_FinancialSalesReport/Method_GenerateColumn.qbl b/_Main/BL/Type_FinancialSalesReport/Method_GenerateColumn.qbl
index 592acd8..8aed8c8 100644
--- a/_Main/BL/Type_FinancialSalesReport/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_FinancialSalesReport/Method_GenerateColumn.qbl
@@ -11,7 +11,7 @@
     startofyear               := startofplanning.StartOfYear();
     startofnextyear           := startofplanning.StartOfNextYear();
     
-    for( start := startofyear; start < startofnextyear; start := start.StartOfMonth() ){
+    for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){
       periodtime := start.Date();
       periodname := periodtime.Format( "M2/D2/Y" );
       this.FinancialSalesColumn( relnew, Name := periodname, Period := periodtime );
diff --git a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
index 4231dde..4d34c0d 100644
--- a/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -93,7 +93,7 @@
       isccorigin             := originspid.StartsWith( '闀挎槬' ) or originspid.StartsWith( 'CC' );
       //璧峰鍦版槸澶ц繛
       isdlorigin             :=  originspid.StartsWith( '澶ц繛' ) or originspid.StartsWith( 'DL' );
-      if( isccorigin and isdlorigin ){
+      if( isccorigin or isdlorigin ){
         traverse( laneleg, Trip, trip, trip.LeadTime().Days() > 1 ){
           for( transferdate := trip.Departure() + Duration::Days( 1 ); transferdate < trip.Arrival(); transferdate := transferdate + Duration::Days( 1 ) ){
             daycolumn        := selectobject( table, InventorySummaryColumn, column, column.StartDate() = transferdate.Date(), column.TimeUnit() = Translations::MP_GlobalParameters_Day() );
diff --git a/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl b/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
index 392964d..812c079 100644
--- a/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
+++ b/_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -81,21 +81,24 @@
     traverse( owner, Unit.Lane.LaneLeg, laneleg ){
       originspid             := laneleg.OriginStockingPointID();
       destinationspid        := laneleg.DestinationStockingPointID();
-      //CC to DL 闀挎槬鍘傚唴搴撳埌澶ц繛澶栫搴�
-      iscctodl               := originspid.EndsWith( '鍘傚唴搴�' ) and ( originspid.StartsWith( '闀挎槬' ) or originspid.StartsWith( 'CC' ) ) and destinationspid = '澶ц繛澶栫搴�';
+      //CC to DL 闀挎槬宸ュ巶鍒板ぇ杩炲伐鍘�
+      iscctodl               := ( originspid.StartsWith( '闀挎槬' ) or originspid.StartsWith( 'CC' ) ) and ( destinationspid.StartsWith( '澶ц繛' ) or destinationspid.StartsWith( 'DL' ) );
       //DL to CC 澶ц繛鍘傚唴搴撳埌澶ц繛鍙戝姩鏈虹殑闀挎槬澶栫搴�
       isdltocc               := originspid.EndsWith( '鍘傚唴搴�' ) and ( originspid.StartsWith( '澶ц繛' ) or originspid.StartsWith( 'DL' ) ) and destinationspid = '澶ц繛鍙戝姩鏈虹殑闀挎槬澶栫搴�';
-      if( iscctodl and isdltocc ){
-        traverse( table, Column, column){//, column.StartDate().Month() = 1 
-          alltrips           := selectset( laneleg, Trip, trip, ( trip.Arrival().Date() < column.StartDate().StartOfNextMonth() and trip.Arrival().Date() >= column.StartDate() )
-                                           or ( trip.Departure().Date() < column.StartDate().StartOfNextMonth() and trip.Departure().Date() >= column.StartDate() ) );
+      if( iscctodl or isdltocc ){
+    //    info( '------iscctodl------', originspid, destinationspid, iscctodl );
+        traverse( table, Column, column  ){//, column.StartDate().Month() = 1
+          alltrips           := selectset( laneleg, Trip, trip, trip.Arrival().Date() = column.StartDate()
+                                           or trip.Departure().Date() = column.StartDate() );
           producttrips      := selectuniquevalues( alltrips, Elements.ProductInTrip, pit, pit.Quantity() <> 0 and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent ), pit.ProductID() );
-          traverse( producttrips, Elements, producttrip ){//, producttrip = '6912'
+    //      info( '---------Column----------', alltrips.Size(), producttrips.Size(), column.StartDate() );
+          traverse( producttrips, Elements, producttrip ){//, producttrip = '06K103011CP'
             row             := table.GetRow( producttrip );
             product         := selectobject( owner, Product_MP, product, product.ID() = producttrip );
             products.Add( product );
-            departureqty    := sum( alltrips, Elements.ProductInTrip, pit, ( pit.Trip().Departure().Date() < column.StartDate().StartOfNextMonth() and pit.Trip().Departure().Date() >= column.StartDate() ) and pit.Product_MP() = product, pit.Quantity() );
-            arrivalqty      := sum( alltrips, Elements.ProductInTrip, pit, ( pit.Trip().Arrival().Date() < column.StartDate().StartOfNextMonth() and pit.Trip().Arrival().Date() >= column.StartDate() ) and pit.Product_MP() = product, pit.Quantity() );
+            departureqty    := sum( alltrips, Elements.ProductInTrip, pit, pit.Trip().Departure().Date() = column.StartDate() and pit.Product_MP() = product, pit.Quantity() );
+            arrivalqty      := sum( alltrips, Elements.ProductInTrip, pit, pit.Trip().Arrival().Date() = column.StartDate() and pit.Product_MP() = product, pit.Quantity() );
+    //        info( '---------***************8---------', departureqty, arrivalqty, column.StartDate() );
             row.SetDepartureAndArrivalValue( column, iscctodl, departureqty, arrivalqty );
           }
         }

--
Gitblit v1.9.3