From 7a55464720fcef69fc4362dcb570dff763ff026b Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期四, 07 十一月 2024 17:00:05 +0800
Subject: [PATCH] 下线计划不显示bug

---
 _Main/BL/Type_OfflinePlanArchiveVersion/Method_GenerateColumn.qbl |   52 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/_Main/BL/Type_OfflinePlanArchiveVersion/Method_GenerateColumn.qbl b/_Main/BL/Type_OfflinePlanArchiveVersion/Method_GenerateColumn.qbl
index 5e80a3f..2a3b3f3 100644
--- a/_Main/BL/Type_OfflinePlanArchiveVersion/Method_GenerateColumn.qbl
+++ b/_Main/BL/Type_OfflinePlanArchiveVersion/Method_GenerateColumn.qbl
@@ -1,40 +1,48 @@
 Quintiq file version 2.0
 #parent: #root
 Method GenerateColumn (
-  Dates periods
+  Dates periods,
+  Boolean isshow
 )
 {
+  Description: '鐢熸垚鏃ユ湡鍒�'
   TextBody:
   [*
-    // 鐢勫叞楦� Jun-25-2024 (created) 
+    // 鐢勫叞楦� Jun-25-2024 (created)
+    timeunit              := guard( this.InterfaceDataset().AssemblyOnlinePlanVersionSearch().TimeUnit(), Translations::MP_GlobalParameters_Day() ) ;
     weekstart             := periods.Element( 0 );
     
     monthstart            := periods.Element( 0 );
     traverse( periods, Elements, periodtime ){
-      periodname          := periodtime.Format( "M2/D2/Y" );
-      
-      this.Column( relnew, ColumnName := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
-      
-      weekend             := ( weekstart + Duration::Days( 6 ) ).Date();
-      if( ( weekend.Year() <> periodtime.Year() and weekend.Month() > 1 ) or ( abs( weekstart.Week() - periodtime.Week() ) > 1 and weekend.Year() = periodtime.Year() ) ){
-        weekstart         := periodtime;
-      }
-      if( periodtime = weekstart ){
-        weekperiodname    := weekstart.Format( "M2/D2/Y" );
-        this.Column( relnew, ColumnName := weekperiodname, StartDate := weekstart, EndDate := ( weekstart.StartOfNextWeek() - Duration::Days( 1 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() );
+      if( not isshow or timeunit = Translations::MP_GlobalParameters_Day() ){
+        periodname        := periodtime.Format( "M2/D2/Y" );
         
+        this.Column( relnew, ColumnName := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
       }
-      if( ( monthstart.Year() <> periodtime.Year() and abs( monthstart.Month() - periodtime.Month() ) <> 11 ) or ( abs( monthstart.Month() - periodtime.Month() ) > 1 and monthstart.Year() = periodtime.Year() ) ){
-        monthstart        := periodtime;
+      if( not isshow or timeunit = Translations::MP_GlobalParameters_Week() ){
+        weekend           := ( weekstart + Duration::Days( 6 ) ).Date();
+        if( ( weekend.Year() <> periodtime.Year() and weekend.Month() > 1 ) or ( abs( weekstart.Week() - periodtime.Week() ) > 1 and weekend.Year() = periodtime.Year() ) ){
+          weekstart       := periodtime;
+        }
+        if( periodtime = weekstart ){
+          weekperiodname  := weekstart.Format( "M2/D2/Y" );
+          this.Column( relnew, ColumnName := weekperiodname, StartDate := weekstart, EndDate := ( weekstart.StartOfNextWeek() - Duration::Days( 1 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() );
+          
+        }
+        weekstart         := periodtime.StartOfNextWeek();
       }
-      if( periodtime = monthstart ){
-        monthperiodname   := monthstart.Format( "M2/D2/Y" );
-        enddate           := ( monthstart.StartOfNextMonth() - Duration::Days( 1 ) ).Date();
-        this.Column( relnew, ColumnName := monthperiodname, StartDate := monthstart, EndDate := enddate, TimeUnit := Translations::MP_GlobalParameters_Month() );
-        
+      if( not isshow or timeunit = Translations::MP_GlobalParameters_Month() ){
+        if( ( monthstart.Year() <> periodtime.Year() and abs( monthstart.Month() - periodtime.Month() ) <> 11 ) or ( abs( monthstart.Month() - periodtime.Month() ) > 1 and monthstart.Year() = periodtime.Year() ) ){
+          monthstart      := periodtime;
+        }
+        if( periodtime = monthstart ){
+          monthperiodname := monthstart.Format( "M2/D2/Y" );
+          enddate         := ( monthstart.StartOfNextMonth() - Duration::Days( 1 ) ).Date();
+          this.Column( relnew, ColumnName := monthperiodname, StartDate := monthstart, EndDate := enddate, TimeUnit := Translations::MP_GlobalParameters_Month() );
+          
+        }
+        monthstart        := periodtime.StartOfNextMonth();
       }
-      weekstart         := periodtime.StartOfNextWeek();
-      monthstart        := periodtime.StartOfNextMonth();
     }
   *]
 }

--
Gitblit v1.9.3