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
Quintiq file version 2.0
#parent: #root
StaticMethod CreatePanelAllocationByScenario (
  MacroPlans macroPlans,
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterMonths months,
  CapacityAndSaleBudgeFilterYear year
)
{
  TextBody:
  [*
    traverse ( macroPlans, Elements, mp ) {
      traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) {
        total := 0.0;
        traverse ( months, Elements, m ) {
          columnName  := "面板分配量-" + [String]year.YearNo() + "年-" + [String]m.MonthNo() + "月-" + mp.ScenarioName();
          columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, columnName );
          cellReal    := Product_MP::GetNewSupplyByMonth( casbcir.GetProductCodes(), mp, year.YearNo(), m.MonthNo() );
          cell        := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
          total       := total + cellReal;
          cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
        }
        columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "面板分配量-" + [String]year.YearNo() + "年-total-" + mp.ScenarioName() );
        cell       := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total );
        columnYear.TotalIdentification( year.YearNo() );
        cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
      }
    }
  *]
}