Kevin Kok Khah Whey
2023-11-07 5ae534ab606e6f2ba5ea60914224d665b0447d5a
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
48
49
50
51
52
53
54
Quintiq file version 2.0
#parent: #root
Method CapacityAndSaleBudgeCompare (
  MacroPlans macroPlans,
  CapacityAndSaleBudgeFilterItems items,
  CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays casbfpopoas,
  CapacityAndSaleBudgeFilterBusinessTypes casbfbts,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months,
  const GlobalOTDTable globalOTDTable
) as stream[GlobalOTDSOP]
{
  Description: 'todo : mappingParent改为mpSync, random删了'
  TextBody:
  [*
    this.CapacityAndSaleBudgeCompareItemRow( relflush );
    this.CapacityAndSaleBudgeCompareItemColumn( relflush );
    
    //CapacityAndSaleBudgeCompareItemCell::SetFilterCriteria( this, &items, &casbfpopoas, &casbfbts, &years, &months );
    //---------------------------------------------------------------------------
    if ( items.Size() = 0 ) {
      items := selectset( this, CapacityAndSaleBudgeFilterItem, tempCASBFI, tempCASBFI.ItemName() = "销售额" );
    }
    
    if ( casbfpopoas.Size() = 0 ) {
      casbfpopoas := selectset( this, CapacityAndSaleBudgeFilterPlaceOfProductionOfArray, tempCASBFPOPOA, true );
    }
    
    if ( casbfbts.Size() = 0 ) {
      casbfbts := selectset( this, CapacityAndSaleBudgeFilterBusinessType, tempCASBFBT, true );
    }
    
    if ( years.Size() = 0 ) {
      years := selectset( this, CapacityAndSaleBudgeFilterYear, tempCASBFY, tempCASBFY.YearNo() = Date::ActualDate().Year() );
    } else {
      years := selectsortedset( years, Elements, tempCASBFY, true, tempCASBFY.YearNo() );
    }
    
    if ( months.Size() = 0 ) {
      months := selectsortedset( this, CapacityAndSaleBudgeFilterMonth, tempCASBFM, true, tempCASBFM.MonthNo() );
    } else {
      months := selectsortedset( months, Elements, tempCASBFM, true, tempCASBFM.MonthNo() );
    }
    //---------------------------------------------------------------------------
    
    CapacityAndSaleBudgeCompareItemCell::GenerateBasicDataBasedOnFilteringCriteria( this, globalOTDTable, items, casbfpopoas, casbfbts );
    
    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeData( macroPlans, globalOTDTable, this, items, years, months );
    
    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocation( macroPlans, globalOTDTable, this, items, years, months );
    
    return emit( this );
  *]
}