admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Quintiq file version 2.0
#parent: #root
Method GenerateColumn (
  Dates periods,
  Boolean isshow
)
{
  TextBody:
  [*
    // 甄兰鸽 Jun-25-2024 (created)
    //timeunit              := guard( this.InterfaceDataset().CustomerDemandIDSSearch().TimeUnit(), Translations::MP_GlobalParameters_Day() ) ;
    //weekstart             := periods.Element( 0 );
    //
    //monthstart            := periods.Element( 0 );
    traverse( periods, Elements, periodtime ){
    //  if( not isshow or timeunit = Translations::MP_GlobalParameters_Day() ){
        periodname        := periodtime.Format( "M2/D2/Y" );
        
        this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime );//, TimeUnit := Translations::MP_GlobalParameters_Day()
    //  }
    //  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, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart.StartOfNextWeek() - Duration::Days( 1 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() );
    //      
    //    }
    //    weekstart         := periodtime.StartOfNextWeek();
    //  }
    //  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, Name := monthperiodname, StartDate := monthstart, EndDate := enddate, TimeUnit := Translations::MP_GlobalParameters_Month() );
    //      
    //    }
    //    monthstart        := periodtime.StartOfNextMonth();
    //  }
    }
  *]
}