From b2a7528d89d6e01276b2667f6620ee709ac3281b Mon Sep 17 00:00:00 2001
From: xiaoding721 <33130084+xiaoding721@users.noreply.github.com>
Date: 星期四, 29 八月 2024 16:56:00 +0800
Subject: [PATCH] 修复计划汇总报表的一些bug

---
 _Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl b/_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl
index cc699fc..3f4b090 100644
--- a/_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl
+++ b/_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl
@@ -15,7 +15,8 @@
     table := owner.MP_Table( relnew,Name := MP_Cell_ScheduleSummary::GetTableName());
     
     startDate := owner.StartOfPlanning().Date();
-    endDate := startDate + 7;
+    
+    endDate := maxselect( owner,Unit.UnitPeriod.astype( UnitPeriodTime ).Period_MP,period,period.TimeUnit() = Translations::MP_GlobalParameters_Day(),period.EndDate()).EndDate();
     
     columns := construct( MP_Columns );
     columnIndexTree := NamedValueTree::Create();
@@ -54,7 +55,14 @@
             capacity := workDay * throughput * workHours.Capacity().HoursAsReal()
           }
           
+          isFirstWeekData := true;
+          
+          if( column.CustomDate() > startDate + 7 ){
+            isFirstWeekData := false; 
+          }
+          
           row.MP_Cell( relnew,MP_Cell_ScheduleSummary,MP_Column := column,
+                       IsFristWeekData := isFirstWeekData,
                        ShiftPattern := unitPeriodTime.ShiftPatternName(),
                        WorkingDay := workDay,
                        Capacity := capacity,
@@ -62,7 +70,9 @@
         }
       }
     }
-    
+    traverse( table,MP_Column,column,column.MP_Cell( relsize ) = 0 ){
+      column.Delete(); 
+    }
     return table;
   *]
 }

--
Gitblit v1.9.3