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
Quintiq file version 2.0
#parent: #root
StaticMethod CreatePanelAllocationBudget (
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterMonths months,
  CapacityAndSaleBudgeFilterYear year,
  const GlobalOTDTable globalOTDTable
)
{
  TextBody:
  [*
    traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) {
      total := 0.0;
      traverse ( months, Elements, m ) {
        columnName  := "面板分配量-" + [String]year.YearNo() + "年-" + [String]m.MonthNo() + "月-年度预算";
        columnMonth := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, columnName );
        cellReal    := Global_MappingForecast::GetQuantityByMonth( casbcir.GetProductCodes(), globalOTDTable, DateTime::Now().Year(), m.MonthNo() );
        cell        := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]cellReal );
        total       := total + cellReal;
        cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
      }
      columnYear := CapacityAndSaleBudgeCompareItemColumn::CreateIfNotExist( this, "面板分配量-" + [String]year.YearNo() + "年-total-年度预算" );
      cell       := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total );
      columnYear.TotalIdentification( year.YearNo() );
      cell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
    }
  *]
}