hongji.li
2023-11-03 d6bd7a69bc31efa79b21c7be12ba9547a921c251
年度产销预算BUG修改
已重命名1个文件
已添加23个文件
已修改12个文件
已删除3个文件
1472 ■■■■ 文件已修改
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_Create.qbl 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateData.qbl 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByHalfAYear.qbl 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByMonth.qbl 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByQuarter.qbl 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByYear.qbl 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_FilterCalculationRows.qbl 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_GetQuantity.qbl 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_SelectGenerateChartRows.qbl 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateData.qbl 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreatePanelAllocation.qbl 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreatePanelAllocationDataForBudget.qbl 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreatePanelAllocationDataForScenario.qbl 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateSalesVolumeData.qbl 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateSalesVolumeDataForBudget.qbl 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateSalesVolumeDataForScenario.qbl 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_GenerateBasicDataBasedOnFilteringCriteria.qbl 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_GetAnnualSalesQuantity.qbl 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_GetPanelAllocationQuantityForBudget.qbl 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_SetFilterCriteria.qbl 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_ColumnType.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_Month.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_ScenarioName.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_Year.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeFilterBusinessType/StaticMethod_InitializedData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeFilterPlaceOfProductionOfArray/StaticMethod_InitializedData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_CreateCapacityAndSaleBudgeTestData#500.qbl 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_InitTestData#12.qbl 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalDTOTable/Method_InitTestData.qbl 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalOTDSOP/Method_CapacityAndSaleBudgeChart.qbl 497 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_GlobalOTDSOP/Method_CapacityAndSaleBudgeCompare.qbl 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_pButton_ButtonCreateData_OnClick.def 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_pButton_ButtonGenerateTestData_OnClick#19.def 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Component_ChartCapacityAndSaleBudgeChart.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_pFilterCriteria_ButtonCapacityAndSaleBudgeChartTest_OnClick#603.def 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeCompare/Response_pButton_ButtonCapacityAndSaleBudgeCompare_OnClick#231.def 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/Pegging分析.vw 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Views/年度产销复盘.vw 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_var/_Main/ProjSettings/MacroPlanner/Views/X_分析视图_[414702.1.50321581].vw 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_Create.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Create (
  GlobalOTDSOP this,
  String businessTypeOrPlaceOfProductionOfArray,
  String timeStringAndScenarioName,
  Real quantity
)
{
  TextBody:
  [*
    this.CapacityAndSaleBudgeChartElement( relnew,
                                           BusinessTypeOrPlaceOfProductionOfArray := businessTypeOrPlaceOfProductionOfArray,
                                           TimeStringAndScenarioName := timeStringAndScenarioName,
                                           Quantity := quantity
                                          );
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateData (
  GlobalOTDSOP this,
  MacroPlans macroPlans,
  CapacityAndSaleBudgeCompareItemRows casbcirs,
  String popoa,
  String groupBy,
  String saleOrCapacity,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    //info( "产能/销售额:", saleOrCapacity, "    æ—¶é—´åˆ†ç»„:", groupBy, "    åŸºåœ°/事业部:", popoa );
    if ( groupBy = "å¹´" ) {
      CapacityAndSaleBudgeChartElement::CreateDataByYear( this, macroPlans, casbcirs, popoa, saleOrCapacity, years, months );
    } else if ( groupBy = "月" ) {
      CapacityAndSaleBudgeChartElement::CreateDataByMonth( this, macroPlans, casbcirs, popoa, saleOrCapacity, years, months );
    } else if ( groupBy = "季度" ) {
      CapacityAndSaleBudgeChartElement::CreateDataByQuarter( this, macroPlans, casbcirs, popoa, saleOrCapacity, years, months );
    } else if ( groupBy = "半年" ) {
      CapacityAndSaleBudgeChartElement::CreateDataByHalfAYear( this, macroPlans, casbcirs, popoa, saleOrCapacity, years, months );
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByHalfAYear.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateDataByHalfAYear (
  GlobalOTDSOP this,
  MacroPlans macroPlans,
  CapacityAndSaleBudgeCompareItemRows casbcirs,
  String popoa,
  String saleOrCapacity,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    calculationConditions := ifexpr( saleOrCapacity = "产能", "PanelAllocation", "SalesVolume" );
    categories := construct( Strings );
    if ( popoa = "面板基地" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.PlaceOfProductionOfArray() );
    } else if ( popoa = "事业部" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.BusinessType() );
    }
    traverse ( years, Elements, y ) {
      traverse ( categories, Elements, c ) {
        for ( i := 0; i < 2; i ++ ) {
          timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + ifexpr( i = 0, "上半年", "下半年" ) + "-" + "目标";
          targetMonth               := selectset( months, Elements, tempM, tempM.MonthNo() >= ( ( i * 6 ) + 1  ) and
                                                  tempM.MonthNo() <= ( ( i + 1 ) * 6 ) );
          filterCASBCIR             := CapacityAndSaleBudgeChartElement::FilterCalculationRows( casbcirs, c, popoa );
          quantity                  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, "", y.YearNo(), targetMonth );
          CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
          traverse ( macroPlans, Elements, mp ) {
            timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + ifexpr( i = 0, "上半年", "下半年" ) + "-" + mp.ScenarioName();
            quantity                  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, mp.ScenarioName(), y.YearNo(), targetMonth );
            CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
          }
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByMonth.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateDataByMonth (
  GlobalOTDSOP this,
  MacroPlans macroPlans,
  CapacityAndSaleBudgeCompareItemRows casbcirs,
  String popoa,
  String saleOrCapacity,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    calculationConditions := ifexpr( saleOrCapacity = "产能", "PanelAllocation", "SalesVolume" );
    categories := construct( Strings );
    if ( popoa = "面板基地" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.PlaceOfProductionOfArray() );
    } else if ( popoa = "事业部" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.BusinessType() );
    }
    traverse ( years, Elements, y ) {
      traverse ( categories, Elements, c ) {
        traverse ( months, Elements, m ) {
          filterCASBCIR := CapacityAndSaleBudgeChartElement::FilterCalculationRows( casbcirs, c, popoa );
          timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + [String]m.MonthNo() + "月" + "-" + "目标";
          targetMonths := construct( CapacityAndSaleBudgeFilterMonths );
          targetMonths.Add( m );
          quantity  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, "", y.YearNo(), targetMonths );
          CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
          traverse ( macroPlans, Elements, mp ) {
            timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + [String]m.MonthNo() + "月" + "-" + mp.ScenarioName();
            quantity                  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, mp.ScenarioName(), y.YearNo(), targetMonths );
            CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
          }
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByQuarter.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateDataByQuarter (
  GlobalOTDSOP this,
  MacroPlans macroPlans,
  CapacityAndSaleBudgeCompareItemRows casbcirs,
  String popoa,
  String saleOrCapacity,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    calculationConditions := ifexpr( saleOrCapacity = "产能", "PanelAllocation", "SalesVolume" );
    categories := construct( Strings );
    if ( popoa = "面板基地" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.PlaceOfProductionOfArray() );
    } else if ( popoa = "事业部" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.BusinessType() );
    }
    traverse ( years, Elements, y ) {
      traverse ( categories, Elements, c ) {
        for ( i := 1; i < 5; i ++ ) {
          targetMonth := selectset( months, Elements, tempM, tempM.MonthNo() >= ( ( i - 1 ) * 3 + 1  ) and
                                    tempM.MonthNo() <= ( i * 3 ) );
          if ( targetMonth.Size() > 0 ) {
            timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + "第" + [String]i + "季度" + "-" + "目标";
            info( targetMonth.Size() );
            filterCASBCIR             := CapacityAndSaleBudgeChartElement::FilterCalculationRows( casbcirs, c, popoa );
            quantity                  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, "", y.YearNo(), targetMonth );
            CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
            traverse ( macroPlans, Elements, mp ) {
              timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + "第" + [String]i + "季度" + "-" + mp.ScenarioName();
              quantity                  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, mp.ScenarioName(), y.YearNo(), targetMonth );
              CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
            }
          }
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_CreateDataByYear.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateDataByYear (
  GlobalOTDSOP this,
  MacroPlans macroPlans,
  CapacityAndSaleBudgeCompareItemRows casbcirs,
  String popoa,
  String saleOrCapacity,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    calculationConditions := ifexpr( saleOrCapacity = "产能", "PanelAllocation", "SalesVolume" );
    categories := construct( Strings );
    if ( popoa = "面板基地" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.PlaceOfProductionOfArray() );
    } else if ( popoa = "事业部" ) {
      categories := selectuniquevalues( casbcirs, Elements, tempCASBCIR, true, tempCASBCIR.BusinessType() );
    }
    traverse ( years, Elements, y ) {
      traverse ( categories, Elements, c ) {
        timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + "目标";
        filterCASBCIR             := CapacityAndSaleBudgeChartElement::FilterCalculationRows( casbcirs, c, popoa );
        quantity                  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, "", y.YearNo(), months );
        CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
        traverse ( macroPlans, Elements, mp ) {
          timeStringAndScenarioName := [String]y.YearNo() + "å¹´" + "-" + mp.ScenarioName();
          quantity                  := CapacityAndSaleBudgeChartElement::GetQuantity( filterCASBCIR, calculationConditions, mp.ScenarioName(), y.YearNo(), months );
          CapacityAndSaleBudgeChartElement::Create( this, c, timeStringAndScenarioName, quantity );
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_FilterCalculationRows.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FilterCalculationRows (
  CapacityAndSaleBudgeCompareItemRows casbcirs,
  String category,
  String popoa
) as owning CapacityAndSaleBudgeCompareItemRows
{
  TextBody:
  [*
    resultCASBCIR := construct( CapacityAndSaleBudgeCompareItemRows );
    if ( popoa = "面板基地" ) {
      resultCASBCIR := selectset( casbcirs, Elements, tempCASBCIR, tempCASBCIR.PlaceOfProductionOfArray() = category );
    } else if ( popoa = "事业部" ) {
      resultCASBCIR := selectset( casbcirs, Elements, tempCASBCIR, tempCASBCIR.BusinessType() = category );
    }
    return &resultCASBCIR;
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_GetQuantity.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetQuantity (
  CapacityAndSaleBudgeCompareItemRows casbcirs,
  String calculationConditions,
  String scenarioName,
  Number year,
  CapacityAndSaleBudgeFilterMonths months
) as Real
{
  TextBody:
  [*
    total := 0.0;
    total := sum( casbcirs, Elements.CapacityAndSaleBudgeCompareItemCell, tempCASBCIC,
                  tempCASBCIC.CapacityAndSaleBudgeCompareItemColumn().ColumnType() = calculationConditions and
                  tempCASBCIC.CapacityAndSaleBudgeCompareItemColumn().ScenarioName() = scenarioName        and
                  tempCASBCIC.CapacityAndSaleBudgeCompareItemColumn().Year() = year                        and
                  exists( months, Elements, tempM, tempM.MonthNo() = tempCASBCIC.CapacityAndSaleBudgeCompareItemColumn().Month() ),
                  [Real]tempCASBCIC.CellContent()
                 );
    return total;
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeChartElement/StaticMethod_SelectGenerateChartRows.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SelectGenerateChartRows (
  GlobalOTDSOP this,
  owning CapacityAndSaleBudgeFilterItems items,
  owning CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays casbfpopoas,
  owning CapacityAndSaleBudgeFilterBusinessTypes casbfbts,
  owning CapacityAndSaleBudgeFilterYears years,
  owning CapacityAndSaleBudgeFilterMonths months
) as owning CapacityAndSaleBudgeCompareItemRows
{
  TextBody:
  [*
    casbcirs := construct( CapacityAndSaleBudgeCompareItemRows );
    CapacityAndSaleBudgeCompareItemCell::SetFilterCriteria( this, &items, &casbfpopoas, &casbfbts, &years, &months );
    casbcirs := selectset( this, CapacityAndSaleBudgeCompareItemRow, tempCASBCIR,
                           exists( casbfpopoas, Elements, tempCASBFPOPOA, tempCASBFPOPOA.PlaceOfProductionOfArray() = tempCASBCIR.PlaceOfProductionOfArray() ) and
                           exists( casbfbts, Elements, tempCASBFBT, tempCASBFBT.BusinessType() = tempCASBCIR.BusinessType() )
                          );
    return &casbcirs;
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateData.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreatePanelAllocation.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreatePanelAllocation (
  MacroPlans macroPlans,
  const GlobalOTDTable globalOTDTable,
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterItems capacityAndSaleBudgeFilterItems,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationDataForBudget( globalOTDTable, this, capacityAndSaleBudgeFilterItems, years, months );
    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationDataForScenario( macroPlans, this, capacityAndSaleBudgeFilterItems, years, months );
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreatePanelAllocationDataForBudget.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreatePanelAllocationDataForBudget (
  const GlobalOTDTable globalOTDTable,
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterItems capacityAndSaleBudgeFilterItems,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    if ( exists( capacityAndSaleBudgeFilterItems, Elements, tempCASBFI, tempCASBFI.ItemName() = "面板分配量" ) ) {
      columnNo := max( this, CapacityAndSaleBudgeCompareItemColumn, tempCASBCIC, true, tempCASBCIC.ColumnNo() ) + 1;
      traverse ( years, Elements, y ) {
        traverse ( months, Elements, m ) {
          columnMonthName  := "面板分配量" + "-" + [String]y.YearNo() + "å¹´" + "-" + [String]m.MonthNo() + "月" + "-" + "年度预算";
          columnMonth      := this.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := columnMonthName, ColumnNo := columnNo, Year := y.YearNo(), Month := m.MonthNo(), ColumnType := "PanelAllocation" );
          traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) {
    //        info( "当前行:", casbcir.RowNo(), "    è¡Œç»„织:", casbcir.PlaceOfProductionOfArray(), "    è¡Œäº‹ä¸šéƒ¨ï¼š", casbcir.BusinessType() );
            annualPanelAllocationQuantity := CapacityAndSaleBudgeCompareItemCell::GetPanelAllocationQuantityForBudget( globalOTDTable,
                                                                                                                       y.YearNo(),
                                                                                                                       m.MonthNo(),
                                                                                                                       casbcir.PlaceOfProductionOfArray(),
                                                                                                                       casbcir.BusinessType()
                                                                                                                      );
            monthCell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]annualPanelAllocationQuantity );
            monthCell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
          }
          columnNo++;
        }
        columnYearName  := "面板分配量" + "-" + [String]y.YearNo() + "å¹´" + "-" + "total" + "-" + "年度预算";
        columnYear      := this.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := columnYearName, ColumnNo := columnNo, Year := y.YearNo(), ColumnType := "PanelAllocation" );
        traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir  ) {
          annualPanelAllocationQuantity := CapacityAndSaleBudgeCompareItemCell::GetPanelAllocationQuantityForBudget( globalOTDTable,
                                                                                                                     y.YearNo(),
                                                                                                                     0,
                                                                                                                     casbcir.PlaceOfProductionOfArray(),
                                                                                                                     casbcir.BusinessType()
                                                                                                                    );
          yearCell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]annualPanelAllocationQuantity );
          yearCell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreatePanelAllocationDataForScenario.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreatePanelAllocationDataForScenario (
  MacroPlans macroPlans,
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterItems capacityAndSaleBudgeFilterItems,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateSalesVolumeData.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateSalesVolumeData (
  MacroPlans macroPlans,
  const GlobalOTDTable globalOTDTable,
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterItems capacityAndSaleBudgeFilterItems,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeDataForBudget( globalOTDTable, this, capacityAndSaleBudgeFilterItems, years, months );
    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeDataForScenario( macroPlans, this, capacityAndSaleBudgeFilterItems, years, months );
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateSalesVolumeDataForBudget.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateSalesVolumeDataForBudget (
  const GlobalOTDTable globalOTDTable,
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterItems capacityAndSaleBudgeFilterItems,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    if ( exists( capacityAndSaleBudgeFilterItems, Elements, tempCASBFI, tempCASBFI.ItemName() = "销售额" ) ) {
      columnNo := max( this, CapacityAndSaleBudgeCompareItemColumn, tempCASBCIC, true, tempCASBCIC.ColumnNo() ) + 1;
      traverse ( years, Elements, y ) {
        traverse ( months, Elements, m ) {
          columnMonthName  := "对外销售额" + "-" + [String]y.YearNo() + "å¹´" + "-" + [String]m.MonthNo() + "月" + "-" + "年度预算";
          columnMonth      := this.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := columnMonthName, ColumnNo := columnNo, Year := y.YearNo(), Month := m.MonthNo(), ColumnType := "SalesVolume" );
          traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) {
    //        info( "当前行:", casbcir.RowNo(), "    è¡Œç»„织:", casbcir.PlaceOfProductionOfArray(), "    è¡Œäº‹ä¸šéƒ¨ï¼š", casbcir.BusinessType() );
            annualSalesQuantity := CapacityAndSaleBudgeCompareItemCell::GetAnnualSalesQuantity( globalOTDTable,
                                                                                                y.YearNo(),
                                                                                                m.MonthNo(),
                                                                                                casbcir.PlaceOfProductionOfArray(),
                                                                                                casbcir.BusinessType()
                                                                                               );
            monthCell := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]annualSalesQuantity );
            monthCell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
          }
          columnNo++;
        }
        columnYearName  := "对外销售额" + "-" + [String]y.YearNo() + "å¹´" + "-" + "total" + "-" + "年度预算";
        columnYear      := this.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := columnYearName, ColumnNo := columnNo, Year := y.YearNo(), ColumnType := "SalesVolume" );
        traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir  ) {
          annualSalesQuantity := CapacityAndSaleBudgeCompareItemCell::GetAnnualSalesQuantity( globalOTDTable,
                                                                                              y.YearNo(),
                                                                                              0,
                                                                                              casbcir.PlaceOfProductionOfArray(),
                                                                                              casbcir.BusinessType()
                                                                                             );
          yearCell := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]annualSalesQuantity );
          yearCell.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
        }
        columnNo++;
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_CreateSalesVolumeDataForScenario.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateSalesVolumeDataForScenario (
  MacroPlans macroPlans,
  GlobalOTDSOP this,
  CapacityAndSaleBudgeFilterItems capacityAndSaleBudgeFilterItems,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    if ( exists( capacityAndSaleBudgeFilterItems, Elements, tempCASBFI, tempCASBFI.ItemName() = "销售额" ) ) {
      columnNo := max( this, CapacityAndSaleBudgeCompareItemColumn, tempCASBCIC, true, tempCASBCIC.ColumnNo() ) + 1;
      traverse ( macroPlans, Elements, mp ) {
        traverse ( years, Elements, y ) {
          traverse ( months, Elements, m ) {
            columnMonthName  := "对外销售额" + "-" + [String]y.YearNo() + "å¹´" + "-" + [String]m.MonthNo() + "月" + "-" + mp.ScenarioName();
            columnMonth      := this.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := columnMonthName, ColumnNo := columnNo, Year := y.YearNo(), Month := m.MonthNo(), ColumnType := "SalesVolume", ScenarioName := mp.ScenarioName() );
            traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) {
              productIDs := selectuniquevalues( casbcir, CapacityAndSaleBudgeCompareItemRowProduct, tempCASBCIRP, true, tempCASBCIRP.ProductCode() );
              total      := sum( mp, SalesDemand, tempSD, productIDs.Find( tempSD.ProductID() ) >= 0       and
                                                          tempSD.StartDate().Year()  = [Number]y.YearNo()  and
                                                          tempSD.StartDate().Month() = [Number]m.MonthNo(),
                                                          tempSD.Quantity() * tempSD.Price() );
              cellMonth := columnMonth.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total );
              cellMonth.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
              columnNo++;
            }
          }
          columnMonthName  := "对外销售额" + "-" + [String]y.YearNo() + "å¹´" + "-" + "total" + "-" + mp.ScenarioName();
          columnYear       := this.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := columnMonthName, ColumnNo := columnNo, Year := y.YearNo(), ColumnType := "SalesVolume", ScenarioName := mp.ScenarioName() );
          traverse ( this, CapacityAndSaleBudgeCompareItemRow, casbcir ) {
            productIDs := selectuniquevalues( casbcir, CapacityAndSaleBudgeCompareItemRowProduct, tempCASBCIRP, true, tempCASBCIRP.ProductCode() );
            total := sum( mp, SalesDemand, tempSD, productIDs.Find( tempSD.ProductID() ) >= 0       and
                                                   tempSD.StartDate().Year()  = [Number]y.YearNo(),
                                                   tempSD.Quantity() * tempSD.Price() );
            cellYear := columnYear.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := [String]total );
            cellYear.CapacityAndSaleBudgeCompareItemRow( relset, casbcir );
          }
          columnNo++;
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_GenerateBasicDataBasedOnFilteringCriteria.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GenerateBasicDataBasedOnFilteringCriteria (
  GlobalOTDSOP globalOTDSOP,
  const GlobalOTDTable globalOTDTable,
  CapacityAndSaleBudgeFilterItems items,
  CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays casbfpopoas,
  CapacityAndSaleBudgeFilterBusinessTypes casbfbts
)
{
  TextBody:
  [*
    columnPOPOA := globalOTDSOP.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := "面板基地", ColumnNo := 0 );
    columnBT    := globalOTDSOP.CapacityAndSaleBudgeCompareItemColumn( relnew, ColumnName := "事业部", ColumnNo := 1 );
    rowNr := 0;
    info( "组织基地个数:", casbfpopoas.Size(), "    äº‹ä¸šéƒ¨ä¸ªæ•°ï¼š", casbfbts.Size() );
    traverse ( casbfpopoas, Elements, casbfpopoa ) {
      traverse ( casbfbts, Elements, casbfbt ) {
        targetGlobal_MappingAnnualBudgetData := selectset( globalOTDTable, Global_MappingAnnualBudgetData, tempGMABD, tempGMABD.OrganCode() = casbfpopoa.PlaceOfProductionOfArray() and
                                                           tempGMABD.BusinessType() = casbfbt.BusinessType() );
        if ( targetGlobal_MappingAnnualBudgetData.Size() > 0 ) {
          targetCapacityAndSaleBudgeCompareItemRow := globalOTDSOP.CapacityAndSaleBudgeCompareItemRow( relnew,
                                                      PlaceOfProductionOfArray := casbfpopoa.PlaceOfProductionOfArray(),
                                                      BusinessType             := casbfbt.BusinessType(),
                                                      RowNo                    := rowNr );
          rowNr++;
          traverse ( targetGlobal_MappingAnnualBudgetData, Elements, gmabd ) {
            targetCapacityAndSaleBudgeCompareItemRow.CapacityAndSaleBudgeCompareItemRowProduct( relnew, ProductCode := gmabd.ProductID() );
          }
          cellPOPOA := columnPOPOA.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := casbfpopoa.PlaceOfProductionOfArray() );
          cellBT    := columnBT.CapacityAndSaleBudgeCompareItemCell( relnew, CellContent := casbfbt.BusinessType() );
          cellPOPOA.CapacityAndSaleBudgeCompareItemRow( relset, targetCapacityAndSaleBudgeCompareItemRow );
          cellBT.CapacityAndSaleBudgeCompareItemRow( relset, targetCapacityAndSaleBudgeCompareItemRow );
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_GetAnnualSalesQuantity.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetAnnualSalesQuantity (
  const GlobalOTDTable globalOTDTable,
  Number year,
  Number month,
  String placeOfProductionOfArray,
  String businessType
) as Real
{
  TextBody:
  [*
    total := 0.0;
    targetGlobal_MappingAnnualBudgetDatas := selectset( globalOTDTable, Global_MappingAnnualBudgetData, tempGMABD,
                                                        tempGMABD.YearNo()       = [String]year             and
                                                        tempGMABD.OrganCode()    = placeOfProductionOfArray and
                                                        tempGMABD.BusinessType() = businessType
                                                       );
    if ( month = 0 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales1() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales2() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales3() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales4() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales5() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales6() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales7() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales8() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales9() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales10() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales11() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales12() );
    } else if ( month = 1 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales1() );
    } else if ( month = 2 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales2() );
    } else if ( month = 3 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales3() );
    } else if ( month = 4 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales4() );
    } else if ( month = 5 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales5() );
    } else if ( month = 6 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales6() );
    } else if ( month = 7 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales7() );
    } else if ( month = 8 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales8() );
    } else if ( month = 9 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales9() );
    } else if ( month = 10 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales10() );
    } else if ( month = 11 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales11() );
    } else if ( month = 12 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySales12() );
    }
    return total;
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_GetPanelAllocationQuantityForBudget.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GetPanelAllocationQuantityForBudget (
  const GlobalOTDTable globalOTDTable,
  Number year,
  Number month,
  String placeOfProductionOfArray,
  String businessType
) as Real
{
  TextBody:
  [*
    total := 0.0;
    targetGlobal_MappingAnnualBudgetDatas := selectset( globalOTDTable, Global_MappingAnnualBudgetData, tempGMABD,
                                                        tempGMABD.YearNo()       = [String]year             and
                                                        tempGMABD.OrganCode()    = placeOfProductionOfArray and
                                                        tempGMABD.BusinessType() = businessType
                                                       );
    if ( month = 0 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity1() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity2() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity3() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity4() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity5() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity6() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity7() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity8() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity9() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity10() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity11() )
             + sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity12() );
    } else if ( month = 1 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity1() );
    } else if ( month = 2 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity2() );
    } else if ( month = 3 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity3() );
    } else if ( month = 4 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity4() );
    } else if ( month = 5 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity5() );
    } else if ( month = 6 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity6() );
    } else if ( month = 7 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity7() );
    } else if ( month = 8 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity8() );
    } else if ( month = 9 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity9() );
    } else if ( month = 10 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity10() );
    } else if ( month = 11 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity11() );
    } else if ( month = 12 ) {
      total := sum( targetGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, true, [Real]tempGMABD.MonthlySheetCapacity12() );
    }
    return total;
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemCell/StaticMethod_SetFilterCriteria.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
Quintiq file version 2.0
#parent: #root
StaticMethod SetFilterCriteria (
  GlobalOTDSOP this,
  output owning CapacityAndSaleBudgeFilterItems items,
  output owning CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays casbfpopoas,
  output owning CapacityAndSaleBudgeFilterBusinessTypes casbfbts,
  output owning CapacityAndSaleBudgeFilterYears years,
  output owning CapacityAndSaleBudgeFilterMonths months
)
{
  TextBody:
  [*
    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() );
    }
  *]
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_ColumnType.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute ColumnType
{
  #keys: '3[414702.1.340387451][414702.1.340387450][414702.1.340387452]'
  ValueType: String
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_Month.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Month
{
  #keys: '3[414702.1.339609433][414702.1.339609432][414702.1.339609434]'
  ValueType: Number
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_ScenarioName.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute ScenarioName
{
  #keys: '3[414702.1.339085005][414702.1.339085004][414702.1.339085006]'
  ValueType: String
}
_Main/BL/Type_CapacityAndSaleBudgeCompareItemColumn/Attribute_Year.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Year
{
  #keys: '3[414702.1.339609423][414702.1.339609422][414702.1.339609424]'
  ValueType: Number
}
_Main/BL/Type_CapacityAndSaleBudgeFilterBusinessType/StaticMethod_InitializedData.qbl
@@ -9,7 +9,7 @@
  [*
    globalOTDSOP.CapacityAndSaleBudgeFilterBusinessType( relflush );
    
    businessTypes := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, tempGMPMP, true, tempGMPMP.BusinessType() );
    businessTypes := selectuniquevalues( globalOTDTable, Global_MappingAnnualBudgetData, tempGMABD, true, tempGMABD.BusinessType() );
    
    traverse ( businessTypes, Elements, bt ) {
      globalOTDSOP.CapacityAndSaleBudgeFilterBusinessType( relnew, BusinessType := bt );
_Main/BL/Type_CapacityAndSaleBudgeFilterPlaceOfProductionOfArray/StaticMethod_InitializedData.qbl
@@ -9,7 +9,7 @@
  [*
    globalOTDSOP.CapacityAndSaleBudgeFilterPlaceOfProductionOfArray( relflush );
    
    organCodes := selectuniquevalues( globalOTDTable, Global_MappingOperation, tempGMO, true, tempGMO.OrganCode() );
    organCodes := selectuniquevalues( globalOTDTable, Global_MappingAnnualBudgetData, tempGMABD, true, tempGMABD.OrganCode() );
    
    traverse ( organCodes, Elements, oc ) {
      globalOTDSOP.CapacityAndSaleBudgeFilterPlaceOfProductionOfArray( relnew, PlaceOfProductionOfArray := oc );
_Main/BL/Type_GlobalDTOTable/Method_CreateCapacityAndSaleBudgeTestData#500.qbl
ÎļþÃû´Ó _Main/BL/Type_GlobalDTOTable/Method_InitTestDataByYear.qbl ÐÞ¸Ä
@@ -1,38 +1,29 @@
Quintiq file version 2.0
#parent: #root
Method InitTestDataByYear (
  MacroPlan macroPlan,
Method CreateCapacityAndSaleBudgeTestData (
  GlobalOTDSOP globalOTDSOP,
  const GlobalOTDTable globalOTDTable,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterBusinessTypes businessTypes,
  CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays placeOfProductionOfArrays,
  Product_MPs product_MPs
)
{
  TextBody:
  [*
    product_MPs := selectset( product_MPs, Elements, tempPMP, tempPMP.IsLeaf() and not tempPMP.IsSystem() );
    this.Global_MappingAnnualBudgetData( relflush );
    
    product_MPs := selectset( product_MPs, Elements, tempPMP, tempPMP.IsLeaf() and not tempPMP.IsSystem() );
    if ( years.Size() = 0 ) {
      years := selectset( globalOTDSOP, CapacityAndSaleBudgeFilterYear, tempCASBFY, 
                          tempCASBFY.YearNo() = Date::ActualDate().Year()     or
                          tempCASBFY.YearNo() = Date::ActualDate().Year() - 1 or
                          tempCASBFY.YearNo() = Date::ActualDate().Year() + 1
                          tempCASBFY.YearNo() = Date::ActualDate().Year()
                         );
    }
    if ( businessTypes.Size() = 0 ) {
      businessTypes := selectset( globalOTDSOP, CapacityAndSaleBudgeFilterBusinessType, tempCASBFBT, true );
    }
    if ( placeOfProductionOfArrays.Size() = 0 ) {
      placeOfProductionOfArrays := selectset( globalOTDSOP, CapacityAndSaleBudgeFilterPlaceOfProductionOfArray, tempCASBFPOPOA, true );
    }
    businessTypes             := selectuniquevalues( globalOTDTable, Global_MappingProduct_MP, tempGMPMP, true, tempGMPMP.BusinessType() );
    placeOfProductionOfArrays := selectuniquevalues( globalOTDTable, Global_MappingOperation, tempGMO, true, tempGMO.OrganCode() );
    
    traverse ( years, Elements, year ) {
    traverse ( years, Elements, year, businessTypes.Size() > 0 and placeOfProductionOfArrays.Size() > 0 ) {
      traverse ( product_MPs, Elements, pmp ) {
        businessType             := businessTypes.Element( Number::Random( 0, businessTypes.Size() - 1 ) ).BusinessType();
        placeOfProductionOfArray := placeOfProductionOfArrays.Element( Number::Random( 0, placeOfProductionOfArrays.Size() - 1 ) ).PlaceOfProductionOfArray();
        businessType             := businessTypes.Element( Number::Random( 0, businessTypes.Size() - 1 ) );
        placeOfProductionOfArray := placeOfProductionOfArrays.Element( Number::Random( 0, placeOfProductionOfArrays.Size() - 1 ) );
        mappingAnnualBudget := this.Global_MappingAnnualBudgetData( relnew, 
                                                                    ID           := OS::GenerateGUIDAsString(),
                                                                    YearNo       := [String]year.YearNo(),
_Main/BL/Type_GlobalDTOTable/Method_InitTestData#12.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_GlobalDTOTable/Method_InitTestData.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_GlobalOTDSOP/Method_CapacityAndSaleBudgeChart.qbl
@@ -4,263 +4,268 @@
  MacroPlans macroPlans,
  String saleOrCapacity,
  String groupBy,
  String byBusinessTypeOrByOrgCode,
  CapacityAndSaleBudgeFilterBusinessTypes businessTypes,
  CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays placeOfProductionOfArrays,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months,
  String popoa,
  owning CapacityAndSaleBudgeFilterItems items,
  owning CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays placeOfProductionOfArrays,
  owning CapacityAndSaleBudgeFilterBusinessTypes businessTypes,
  owning CapacityAndSaleBudgeFilterYears years,
  owning CapacityAndSaleBudgeFilterMonths months,
  GlobalOTDTable otdTable
)
{
  Description: '按入参处理数据,产生需要的CapacityAndSaleBudgeChartElement'
  TextBody:
  [*
    info( "产能/销售额:", saleOrCapacity, "    æ—¶é—´åˆ†ç»„:", groupBy, "    åŸºåœ°/事业部:", byBusinessTypeOrByOrgCode );
    // å¹´ä»½ä¸é€‰æ—¶å…¨é€‰
    if ( years.Size() = 0 ) {
      years := selectset( this, CapacityAndSaleBudgeFilterYear, tempCASBFY, tempCASBFY.YearNo() = Date::ActualDate().Year() );
    }
    // æœˆä»½ä¸é€‰æ—¶å…¨é€‰
    if ( months.Size() = 0 ) {
      months := selectsortedset( this, CapacityAndSaleBudgeFilterMonth, item, true, item.MonthNo() );
    }
    // ====清理旧数据====
    this.CapacityAndSaleBudgeChartRow( relflush );
    this.CapacityAndSaleBudgeChartElement( relflush );
    
    // ====按面板基地和事业部对产品进行筛选分组====
    targeGlobal_MappingAnnualBudgetDatas := selectset( otdTable, Global_MappingAnnualBudgetData, tempGMABD, true );
    if ( businessTypes.Size() > 0 ) {
      businessTypeStrings := selectuniquevalues( businessTypes, Elements, item, true, item.BusinessType() );
      targeGlobal_MappingAnnualBudgetDatas := selectset( targeGlobal_MappingAnnualBudgetDatas, Elements, item, businessTypeStrings.Find( item.BusinessType() ) > -1 );
    }
    if ( placeOfProductionOfArrays.Size() > 0 ) {
      placeOfProductionOfArrayStrings := selectuniquevalues( placeOfProductionOfArrays, Elements, item, true, item.PlaceOfProductionOfArray() );
      targeGlobal_MappingAnnualBudgetDatas := selectset( targeGlobal_MappingAnnualBudgetDatas, Elements, item, placeOfProductionOfArrayStrings.Find( item.OrganCode() ) > -1 );
    }
    info( "选中的个数:", targeGlobal_MappingAnnualBudgetDatas.Size() );
    casbcirs := CapacityAndSaleBudgeChartElement::SelectGenerateChartRows( this, &items, &placeOfProductionOfArrays, &businessTypes, &years, &months );
    
    traverse ( targeGlobal_MappingAnnualBudgetDatas, Elements, gmabd ) {
      row := CapacityAndSaleBudgeChartRow::CreateIfNotExist( this, gmabd.BusinessType(), gmabd.OrganCode() );
      // è®°å½•每行包含哪些product
      CapacityAndSaleBudgeChartRowProduct::CreateIfNotExist( row, gmabd.ProductID() );
    }
    CapacityAndSaleBudgeChartElement::CreateData( this, macroPlans, casbcirs, popoa, groupBy, saleOrCapacity, years, months );
    
    rows := selectset( this, CapacityAndSaleBudgeChartRow, item, true );
    placeOfProductionOfArrayList := selectuniquevalues( targeGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, tempGMABD.OrganCode() );
    businessTypeList := selectuniquevalues( targeGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, tempGMABD.BusinessType() );
    // ç”Ÿæˆå›¾è¡¨å…ƒç´ 
    traverse ( years, Elements, year ) {
      if ( byBusinessTypeOrByOrgCode = "面板基地" and groupBy = "å¹´" ) {
        // ç›®æ ‡
        traverse ( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
          this.CapacityAndSaleBudgeChartElement( relnew,
                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-目标",
                                                 BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                     Global_MappingAnnualBudgetData::GetSaleByYear( productCodeList, otdTable, year.YearNo() ),
                                                                     Global_MappingForecast::GetQuantityByYear( productCodeList, otdTable, year.YearNo() ) )
                                                );
          // S&OP
          traverse ( macroPlans, Elements, macroPlan ) {
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName(),
                                                   BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Forecast::GetFulfilledBalanceByYear( productCodeList, macroPlan, year.YearNo() ),
                                                                       Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, year.YearNo() )
                                                                       )
                                                   );
          }
        }
      }
      if ( byBusinessTypeOrByOrgCode = "面板基地" and groupBy = "半年" ) {
        for( halfNo := 1; halfNo <= 2; halfNo := halfNo + 1 ) {
          traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
            productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-目标",
                                                   BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Global_MappingAnnualBudgetData::GetSaleByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ),
                                                                       Global_MappingForecast::GetQuantityByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ) )
                                                   );
            // S&OP
            traverse( macroPlans, Elements, macroPlan ) {
              this.CapacityAndSaleBudgeChartElement( relnew,
                                                     TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-" + macroPlan.ScenarioName(),
                                                     BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                     Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                         Forecast::GetFulfilledBalanceByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo ),
                                                                         Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo )
                                                                         )
                                                     );
            }
          }
        }
      }
      if ( byBusinessTypeOrByOrgCode = "面板基地" and groupBy = "季度" ) {
        for( seasonNo := 1; seasonNo <= 4; seasonNo := seasonNo + 1 ) {
          traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
            productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-目标",
                                                   BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Global_MappingAnnualBudgetData::GetSaleBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ),
                                                                       Global_MappingForecast::GetQuantityBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ) )
                                                   );
      //      info( "productCodeList : " + [String]productCodeList.Size() );
            // S&OP
            traverse( macroPlans, Elements, macroPlan ) {
              this.CapacityAndSaleBudgeChartElement( relnew,
                                                     TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-" + macroPlan.ScenarioName(),
                                                     BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                     Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                         Forecast::GetFulfilledBalanceBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo ) ,
                                                                         Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo )
                                                                         )
                                                     );
            }
          }
        }
      }
      if ( byBusinessTypeOrByOrgCode = "面板基地" and groupBy = "月" ) {
        traverse( months, Elements, month ) {
    //      info( "process month start : " + [String]month.MonthNo() );
          monthNoString := ifexpr( month.MonthNo() <= 9, "0" + [String]month.MonthNo(), [String]month.MonthNo() );
          traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
            productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-目标",
                                                   BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Global_MappingAnnualBudgetData::GetSaleByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ),
                                                                       Global_MappingForecast::GetQuantityByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ) )
                                                   );
            // S&OP
            traverse( macroPlans, Elements, macroPlan ) {
              this.CapacityAndSaleBudgeChartElement( relnew,
                                                     TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-" + macroPlan.ScenarioName(),
                                                     BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
                                                     Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                         Forecast::GetFulfilledBalanceByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() ),
                                                                         Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() )
                                                                         )
                                                     );
            }
          }
    //      info( "process month end : " + [String]month.MonthNo() );
        }
      }
      if( byBusinessTypeOrByOrgCode = "事业部" and groupBy = "å¹´" ) {
        // ç›®æ ‡
        traverse( businessTypeList, Elements, businessType ) {
          productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
          this.CapacityAndSaleBudgeChartElement( relnew,
                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-目标",
                                                 BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                     Global_MappingAnnualBudgetData::GetSaleByYear( productCodeList, otdTable, year.YearNo() ),
                                                                     Global_MappingForecast::GetQuantityByYear( productCodeList, otdTable, year.YearNo() ) )
                                                 );
          // S&OP
          traverse( macroPlans, Elements, macroPlan ) {
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName(),
                                                   BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Forecast::GetFulfilledBalanceByYear( productCodeList, macroPlan, year.YearNo() ) ,
                                                                       Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, year.YearNo() )
                                                                       )
                                                   );
          }
        }
      }
      if ( byBusinessTypeOrByOrgCode = "事业部" and groupBy = "半年" ) {
        for( halfNo := 1; halfNo <= 2; halfNo := halfNo + 1 ) {
          traverse( businessTypeList, Elements, businessType ) {
            productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-目标",
                                                   BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Global_MappingAnnualBudgetData::GetSaleByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ),
                                                                       Global_MappingForecast::GetQuantityByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ) )
                                                   );
            // S&OP
            traverse( macroPlans, Elements, macroPlan ) {
              this.CapacityAndSaleBudgeChartElement( relnew,
                                                     TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-" + macroPlan.ScenarioName(),
                                                     BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                     Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                         Forecast::GetFulfilledBalanceByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo ) ,
                                                                         Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo )
                                                                         )
                                                     );
            }
          }
        }
      }
      if ( byBusinessTypeOrByOrgCode = "事业部" and groupBy = "季度" ) {
        for( seasonNo := 1; seasonNo <= 4; seasonNo := seasonNo + 1 ) {
    //      debuginfo( "process season start : " + [String]seasonNo );
          traverse( businessTypeList, Elements, businessType ) {
            productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-目标",
                                                   BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Global_MappingAnnualBudgetData::GetSaleBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ),
                                                                       Global_MappingForecast::GetQuantityBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ) )
                                                   );
            // S&OP
            traverse( macroPlans, Elements, macroPlan ) {
              this.CapacityAndSaleBudgeChartElement( relnew,
                                                     TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-" + macroPlan.ScenarioName(),
                                                     BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                     Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                         Forecast::GetFulfilledBalanceBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo ),
                                                                         Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo )
                                                                         )
                                                     );
            }
          }
    //      info( "process season end : " + [String]seasonNo );
        }
      }
      if ( byBusinessTypeOrByOrgCode = "事业部" and groupBy = "月" ) {
        traverse( months, Elements, month ) {
    //      debuginfo( "process month start : " + [String]month.MonthNo() );
          monthNoString := ifexpr( month.MonthNo() <= 9, "0" + [String]month.MonthNo(), [String]month.MonthNo() );
          traverse( businessTypeList, Elements, businessType ) {
            productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
            this.CapacityAndSaleBudgeChartElement( relnew,
                                                   TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-目标",
                                                   BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                   Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                       Global_MappingAnnualBudgetData::GetSaleByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ),
                                                                       Global_MappingForecast::GetQuantityByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ) )
                                                   );
            // S&OP
            traverse( macroPlans, Elements, macroPlan ) {
              this.CapacityAndSaleBudgeChartElement( relnew,
                                                     TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-" + macroPlan.ScenarioName(),
                                                     BusinessTypeOrPlaceOfProductionOfArray := businessType,
                                                     Quantity := ifexpr( saleOrCapacity = "销售额",
                                                                         Forecast::GetFulfilledBalanceByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() ) ,
                                                                         Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() )
                                                                         )
                                                     );
            }
          }
    //      debuginfo( "process month end : " + [String]month.MonthNo() );
        }
      }
    }
    //// å¹´ä»½ä¸é€‰æ—¶å…¨é€‰
    //if ( years.Size() = 0 ) {
    //  years := selectset( this, CapacityAndSaleBudgeFilterYear, tempCASBFY, tempCASBFY.YearNo() = Date::ActualDate().Year() );
    //}
    //// æœˆä»½ä¸é€‰æ—¶å…¨é€‰
    //if ( months.Size() = 0 ) {
    //  months := selectsortedset( this, CapacityAndSaleBudgeFilterMonth, item, true, item.MonthNo() );
    //}
    //
    //// ====清理旧数据====
    //
    //// ====按面板基地和事业部对产品进行筛选分组====
    //targeGlobal_MappingAnnualBudgetDatas := selectset( otdTable, Global_MappingAnnualBudgetData, tempGMABD, true );
    //if ( businessTypes.Size() > 0 ) {
    //  businessTypeStrings := selectuniquevalues( businessTypes, Elements, item, true, item.BusinessType() );
    //  targeGlobal_MappingAnnualBudgetDatas := selectset( targeGlobal_MappingAnnualBudgetDatas, Elements, item, businessTypeStrings.Find( item.BusinessType() ) > -1 );
    //}
    //if ( placeOfProductionOfArrays.Size() > 0 ) {
    //  placeOfProductionOfArrayStrings := selectuniquevalues( placeOfProductionOfArrays, Elements, item, true, item.PlaceOfProductionOfArray() );
    //  targeGlobal_MappingAnnualBudgetDatas := selectset( targeGlobal_MappingAnnualBudgetDatas, Elements, item, placeOfProductionOfArrayStrings.Find( item.OrganCode() ) > -1 );
    //}
    ////info( "选中的个数:", targeGlobal_MappingAnnualBudgetDatas.Size() );
    //
    //traverse ( targeGlobal_MappingAnnualBudgetDatas, Elements, gmabd ) {
    //  row := CapacityAndSaleBudgeChartRow::CreateIfNotExist( this, gmabd.BusinessType(), gmabd.OrganCode() );
    //  // è®°å½•每行包含哪些product
    //  CapacityAndSaleBudgeChartRowProduct::CreateIfNotExist( row, gmabd.ProductID() );
    //}
    //
    //rows := selectset( this, CapacityAndSaleBudgeChartRow, item, true );
    //placeOfProductionOfArrayList := selectuniquevalues( targeGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, tempGMABD.OrganCode() );
    //businessTypeList := selectuniquevalues( targeGlobal_MappingAnnualBudgetDatas, Elements, tempGMABD, tempGMABD.BusinessType() );
    //
    //// ç”Ÿæˆå›¾è¡¨å…ƒç´ 
    //traverse ( years, Elements, year ) {
    //  if ( popoa = "面板基地" and groupBy = "å¹´" ) {
    //    // ç›®æ ‡
    //    traverse ( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
    //      productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
    //      this.CapacityAndSaleBudgeChartElement( relnew,
    //                                             TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-目标",
    //                                             BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                             Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                 Global_MappingAnnualBudgetData::GetSaleByYear( productCodeList, otdTable, year.YearNo() ),
    //                                                                 Global_MappingForecast::GetQuantityByYear( productCodeList, otdTable, year.YearNo() ) )
    //                                            );
    //      // S&OP
    //      traverse ( macroPlans, Elements, macroPlan ) {
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName(),
    //                                               BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Forecast::GetFulfilledBalanceByYear( productCodeList, macroPlan, year.YearNo() ),
    //                                                                   Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, year.YearNo() )
    //                                                                   )
    //                                               );
    //      }
    //    }
    //  }
    //  if ( popoa = "面板基地" and groupBy = "半年" ) {
    //    for( halfNo := 1; halfNo <= 2; halfNo := halfNo + 1 ) {
    //      traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
    //        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-目标",
    //                                               BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Global_MappingAnnualBudgetData::GetSaleByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ),
    //                                                                   Global_MappingForecast::GetQuantityByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ) )
    //                                               );
    //        // S&OP
    //        traverse( macroPlans, Elements, macroPlan ) {
    //          this.CapacityAndSaleBudgeChartElement( relnew,
    //                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-" + macroPlan.ScenarioName(),
    //                                                 BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                     Forecast::GetFulfilledBalanceByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo ),
    //                                                                     Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo )
    //                                                                     )
    //                                                 );
    //        }
    //      }
    //    }
    //  }
    //  if ( popoa = "面板基地" and groupBy = "季度" ) {
    //    for( seasonNo := 1; seasonNo <= 4; seasonNo := seasonNo + 1 ) {
    //      traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
    //        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-目标",
    //                                               BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Global_MappingAnnualBudgetData::GetSaleBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ),
    //                                                                   Global_MappingForecast::GetQuantityBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ) )
    //                                               );
    //  //      info( "productCodeList : " + [String]productCodeList.Size() );
    //        // S&OP
    //        traverse( macroPlans, Elements, macroPlan ) {
    //          this.CapacityAndSaleBudgeChartElement( relnew,
    //                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-" + macroPlan.ScenarioName(),
    //                                                 BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                     Forecast::GetFulfilledBalanceBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo ) ,
    //                                                                     Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo )
    //                                                                     )
    //                                                 );
    //        }
    //      }
    //    }
    //  }
    //  if ( popoa = "面板基地" and groupBy = "月" ) {
    //    traverse( months, Elements, month ) {
    ////      info( "process month start : " + [String]month.MonthNo() );
    //      monthNoString := ifexpr( month.MonthNo() <= 9, "0" + [String]month.MonthNo(), [String]month.MonthNo() );
    //      traverse( placeOfProductionOfArrayList, Elements, placeOfProductionOfArray ) {
    //        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByPlaceOfProductionOfArray( rows, placeOfProductionOfArray );
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-目标",
    //                                               BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Global_MappingAnnualBudgetData::GetSaleByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ),
    //                                                                   Global_MappingForecast::GetQuantityByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ) )
    //                                               );
    //        // S&OP
    //        traverse( macroPlans, Elements, macroPlan ) {
    //          this.CapacityAndSaleBudgeChartElement( relnew,
    //                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-" + macroPlan.ScenarioName(),
    //                                                 BusinessTypeOrPlaceOfProductionOfArray := placeOfProductionOfArray,
    //                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                     Forecast::GetFulfilledBalanceByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() ),
    //                                                                     Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() )
    //                                                                     )
    //                                                 );
    //        }
    //      }
    ////      info( "process month end : " + [String]month.MonthNo() );
    //    }
    //  }
    //  if( popoa = "事业部" and groupBy = "å¹´" ) {
    //    // ç›®æ ‡
    //    traverse( businessTypeList, Elements, businessType ) {
    //      productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
    //      this.CapacityAndSaleBudgeChartElement( relnew,
    //                                             TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-目标",
    //                                             BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                             Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                 Global_MappingAnnualBudgetData::GetSaleByYear( productCodeList, otdTable, year.YearNo() ),
    //                                                                 Global_MappingForecast::GetQuantityByYear( productCodeList, otdTable, year.YearNo() ) )
    //                                             );
    //      // S&OP
    //      traverse( macroPlans, Elements, macroPlan ) {
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + macroPlan.ScenarioName(),
    //                                               BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Forecast::GetFulfilledBalanceByYear( productCodeList, macroPlan, year.YearNo() ) ,
    //                                                                   Product_MP::GetNewSupplyByYear( productCodeList, macroPlan, year.YearNo() )
    //                                                                   )
    //                                               );
    //      }
    //    }
    //  }
    //  if ( popoa = "事业部" and groupBy = "半年" ) {
    //    for( halfNo := 1; halfNo <= 2; halfNo := halfNo + 1 ) {
    //      traverse( businessTypeList, Elements, businessType ) {
    //        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-目标",
    //                                               BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Global_MappingAnnualBudgetData::GetSaleByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ),
    //                                                                   Global_MappingForecast::GetQuantityByHalfYear( productCodeList, otdTable, year.YearNo(), halfNo ) )
    //                                               );
    //        // S&OP
    //        traverse( macroPlans, Elements, macroPlan ) {
    //          this.CapacityAndSaleBudgeChartElement( relnew,
    //                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-" + ifexpr( halfNo = 1, "上", "下" ) + "半年-" + macroPlan.ScenarioName(),
    //                                                 BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                     Forecast::GetFulfilledBalanceByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo ) ,
    //                                                                     Product_MP::GetNewSupplyByHalfYear( productCodeList, macroPlan, year.YearNo(), halfNo )
    //                                                                     )
    //                                                 );
    //        }
    //      }
    //    }
    //  }
    //  if ( popoa = "事业部" and groupBy = "季度" ) {
    //    for( seasonNo := 1; seasonNo <= 4; seasonNo := seasonNo + 1 ) {
    ////      debuginfo( "process season start : " + [String]seasonNo );
    //      traverse( businessTypeList, Elements, businessType ) {
    //        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-目标",
    //                                               BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Global_MappingAnnualBudgetData::GetSaleBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ),
    //                                                                   Global_MappingForecast::GetQuantityBySeason( productCodeList, otdTable, year.YearNo(), seasonNo ) )
    //                                               );
    //        // S&OP
    //        traverse( macroPlans, Elements, macroPlan ) {
    //          this.CapacityAndSaleBudgeChartElement( relnew,
    //                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + [String]seasonNo + "季度-" + macroPlan.ScenarioName(),
    //                                                 BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                     Forecast::GetFulfilledBalanceBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo ),
    //                                                                     Product_MP::GetNewSupplyBySeason( productCodeList, macroPlan, year.YearNo(), seasonNo )
    //                                                                     )
    //                                                 );
    //        }
    //      }
    ////      info( "process season end : " + [String]seasonNo );
    //    }
    //  }
    //  if ( popoa = "事业部" and groupBy = "月" ) {
    //    traverse( months, Elements, month ) {
    ////      debuginfo( "process month start : " + [String]month.MonthNo() );
    //      monthNoString := ifexpr( month.MonthNo() <= 9, "0" + [String]month.MonthNo(), [String]month.MonthNo() );
    //      traverse( businessTypeList, Elements, businessType ) {
    //        productCodeList := CapacityAndSaleBudgeChartRow::GetProductCodesByBusinessType( rows, businessType );
    //        this.CapacityAndSaleBudgeChartElement( relnew,
    //                                               TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-目标",
    //                                               BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                               Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                   Global_MappingAnnualBudgetData::GetSaleByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ),
    //                                                                   Global_MappingForecast::GetQuantityByMonth( productCodeList, otdTable, year.YearNo(), month.MonthNo() ) )
    //                                               );
    //        // S&OP
    //        traverse( macroPlans, Elements, macroPlan ) {
    //          this.CapacityAndSaleBudgeChartElement( relnew,
    //                                                 TimeStringAndScenarioName := [String]year.YearNo() + "å¹´-第" + monthNoString + "月-" + macroPlan.ScenarioName(),
    //                                                 BusinessTypeOrPlaceOfProductionOfArray := businessType,
    //                                                 Quantity := ifexpr( saleOrCapacity = "销售额",
    //                                                                     Forecast::GetFulfilledBalanceByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() ) ,
    //                                                                     Product_MP::GetNewSupplyByMonth( productCodeList, macroPlan, year.YearNo(), month.MonthNo() )
    //                                                                     )
    //                                                 );
    //        }
    //      }
    ////      debuginfo( "process month end : " + [String]month.MonthNo() );
    //    }
    //  }
    //}
    ////info( "CapacityAndSaleBudgeChartElement : " + [String]selectset( this, CapacityAndSaleBudgeChartElement, item, true ).Size() );
    ////traverse( this, CapacityAndSaleBudgeChartRow, row ) {
    ////  info( "==↓==" );
_Main/BL/Type_GlobalOTDSOP/Method_CapacityAndSaleBudgeCompare.qbl
@@ -2,40 +2,41 @@
#parent: #root
Method CapacityAndSaleBudgeCompare (
  MacroPlans macroPlans,
  CapacityAndSaleBudgeFilterItems items,
  CapacityAndSaleBudgeFilterYears years,
  CapacityAndSaleBudgeFilterMonths months,
  owning CapacityAndSaleBudgeFilterItems items,
  owning CapacityAndSaleBudgeFilterPlaceOfProductionOfArrays casbfpopoas,
  owning CapacityAndSaleBudgeFilterBusinessTypes casbfbts,
  owning CapacityAndSaleBudgeFilterYears years,
  owning CapacityAndSaleBudgeFilterMonths months,
  const GlobalOTDTable globalOTDTable
)
{
  Description: 'todo : mappingParent改为mpSync, random删了'
  TextBody:
  [*
    if ( years.Size() = 0 ) {
      years := selectset( this, CapacityAndSaleBudgeFilterYear, tempCASBFY, tempCASBFY.YearNo() = Date::ActualDate().Year() );
    }
    if ( months.Size() = 0 ) {
      months := selectsortedset( this, CapacityAndSaleBudgeFilterMonth, item, item.MonthNo() );
    }
    this.CapacityAndSaleBudgeCompareItemRow( relflush );
    this.CapacityAndSaleBudgeCompareItemColumn( relflush );
    
    CapacityAndSaleBudgeCompareItemCell::CreateData( globalOTDTable, this );
    CapacityAndSaleBudgeCompareItemCell::SetFilterCriteria( this, &items, &casbfpopoas, &casbfbts, &years, &months );
    
    if ( CapacityAndSaleBudgeFilterItem::Contains( items, "面板分配量" ) ) {
      traverse ( years, Elements, year ) {
        CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationBudget( this, months, year, globalOTDTable );
        CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationByScenario( macroPlans, this, months, year );
      }
    }
    CapacityAndSaleBudgeCompareItemCell::GenerateBasicDataBasedOnFilteringCriteria( this, globalOTDTable, items, casbfpopoas, casbfbts );
    
    if ( CapacityAndSaleBudgeFilterItem::Contains( items, "销售额" ) ) {
      traverse ( years, Elements, year ) {
        CapacityAndSaleBudgeCompareItemCell::CreateSalesVolume( this, months, year, globalOTDTable );
        CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeByScenario( macroPlans, this, months, year );
      }
    }
    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeData( macroPlans, globalOTDTable, this, items, years, months );
    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocation( macroPlans, globalOTDTable, this, items, years, months );
    //if ( CapacityAndSaleBudgeFilterItem::Contains( items, "面板分配量" ) ) {
    //  traverse ( years, Elements, year ) {
    //    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationBudget( this, months, year, globalOTDTable );
    //    CapacityAndSaleBudgeCompareItemCell::CreatePanelAllocationByScenario( macroPlans, this, months, year );
    //  }
    //}
    //
    //if ( CapacityAndSaleBudgeFilterItem::Contains( items, "销售额" ) ) {
    //  traverse ( years, Elements, year ) {
    //    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolume( this, months, year, globalOTDTable );
    //    CapacityAndSaleBudgeCompareItemCell::CreateSalesVolumeByScenario( macroPlans, this, months, year );
    //  }
    //}
    
    // å¤§å¼ ç›ˆåˆ©é¢
    //traverse ( years, Elements, year ) {
@@ -74,16 +75,16 @@
    //}
    
    // è®¾ç½®rowNo和columnNo
    rowNo := 1;
    rowSorted := selectsortedset( this, CapacityAndSaleBudgeCompareItemRow, item, item.PlaceOfProductionOfArray() + "_" + item.BusinessType() );
    traverse( rowSorted, Elements, item ) {
      item.RowNo( rowNo );
      rowNo := rowNo + 1;
    }
    columnNo := 1;
    traverse( this, CapacityAndSaleBudgeCompareItemColumn, item ) {
      item.ColumnNo( columnNo );
      columnNo := columnNo + 1;
    }
    //rowNo := 1;
    //rowSorted := selectsortedset( this, CapacityAndSaleBudgeCompareItemRow, item, item.PlaceOfProductionOfArray() + "_" + item.BusinessType() );
    //traverse( rowSorted, Elements, item ) {
    //  item.RowNo( rowNo );
    //  rowNo := rowNo + 1;
    //}
    //columnNo := 1;
    //traverse( this, CapacityAndSaleBudgeCompareItemColumn, item ) {
    //  item.ColumnNo( columnNo );
    //  columnNo := columnNo + 1;
    //}
  *]
}
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_pButton_ButtonCreateData_OnClick.def
@@ -7,13 +7,7 @@
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    flag := true;
    flag := GlobalOTDSOP.CapacityAndSaleBudgeFilterYear( relsize ) > 0                     and
            GlobalOTDSOP.CapacityAndSaleBudgeFilterBusinessType( relsize ) > 0             and
            GlobalOTDSOP.CapacityAndSaleBudgeFilterPlaceOfProductionOfArray( relsize ) > 0;
    return flag;
    return not isnull( GlobalOTDSOP ) and not isnull( GlobalOTDTable );
  *]
  QuillAction
  {
@@ -27,12 +21,10 @@
        if ( DataHolderCheckedProduct.Data().Size() = 0 ) {
          WebMessageBox::Error( "请先在左侧导航栏选择要生成测试数据的产品!", true );
        } else {
          GlobalOTDTable.InitTestDataByYear( MacroPlan,
                                             GlobalOTDSOP,
                                             DataHolderCapacityAndSaleBudgeFilterYear.Data(),
                                             DataHolderCapacityAndSaleBudgeFilterBusinessType.Data(),
                                             DataHolderCapacityAndSaleBudgeFilterPlaceOfProductionOfArray.Data(),
                                             DataHolderCheckedProduct.Data() );
          GlobalOTDTable.CreateCapacityAndSaleBudgeTestData( GlobalOTDSOP,
                                                             GlobalOTDTable,
                                                             DataHolderCapacityAndSaleBudgeFilterYear.Data(),
                                                             DataHolderCheckedProduct.Data() );
        }
      }
    *]
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudge/Response_pButton_ButtonGenerateTestData_OnClick#19.def
@@ -18,8 +18,6 @@
      CapacityAndSaleBudgeFilterMonth::InitializedData( GlobalOTDSOP );
      CapacityAndSaleBudgeFilterBusinessType::InitializedData( GlobalOTDSOP, GlobalOTDTable );
      CapacityAndSaleBudgeFilterPlaceOfProductionOfArray::InitializedData( GlobalOTDSOP, GlobalOTDTable );
      GlobalOTDTable.Global_MappingAnnualBudgetData( relflush );
    *]
    GroupServerCalls: false
  }
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Component_ChartCapacityAndSaleBudgeChart.def
@@ -81,5 +81,6 @@
  [
    ContextMenu: 'chartContextMenuCapacityAndSaleBudge'
    Taborder: 4
    Title: '年度产销预算复盘'
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeChart/Response_pFilterCriteria_ButtonCapacityAndSaleBudgeChartTest_OnClick#603.def
@@ -9,17 +9,32 @@
  {
    Body:
    [*
      //CapacityAndSaleBudgeChartElement::TestData( GlobalOTDTable );
      targetCapacityAndSaleBudgeFilterItem := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterItem, tempCASBFI,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterItem.Data(), Elements, tempCASBFI1, tempCASBFI1 = tempCASBFI ) );
      targetCapacityAndSaleBudgeFilterPlaceOfProductionOfArray := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterPlaceOfProductionOfArray, tempCASBFPOPOA,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterPlaceOfProductionOfArray.Data(), Elements, tempCASBFPOPOA1, tempCASBFPOPOA1 = tempCASBFPOPOA ) );
      targetCapacityAndSaleBudgeFilterBusinessType := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterBusinessType, tempCASBFBT,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterBusinessType.Data(), Elements, tempCASBFBT1, tempCASBFBT1 = tempCASBFBT ) );
      targetCapacityAndSaleBudgeFilterYear := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterYear, tempCASBFY,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterYear.Data(), Elements, tempCASBFY1, tempCASBFY1 = tempCASBFY ) );
      targetCapacityAndSaleBudgeFilterMonth := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterMonth, tempCASBFM,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterMonth.Data(), Elements, tempCASBFM1, tempCASBFM1 = tempCASBFM ) );
      
      GlobalOTDSOP.CapacityAndSaleBudgeChart( DataHolderMacroPlansForScenarioComparison.Data(), 
                                              DropDownSaleOrCapacity.Text(),
                                              DropDownTimeGroup.Text(),
                                              DropDownByBusinessTypeOrByOrgCode.Text(),
                                              DataHolderCapacityAndSaleBudgeFilterBusinessType.Data(),
                                              DataHolderCapacityAndSaleBudgeFilterPlaceOfProductionOfArray.Data(),
                                              DataHolderCapacityAndSaleBudgeFilterYear.Data(),
                                              DataHolderCapacityAndSaleBudgeFilterMonth.Data(),
                                              GlobalOTDTable );
                                              &targetCapacityAndSaleBudgeFilterItem,
                                              &targetCapacityAndSaleBudgeFilterPlaceOfProductionOfArray,
                                              &targetCapacityAndSaleBudgeFilterBusinessType,
                                              &targetCapacityAndSaleBudgeFilterYear,
                                              &targetCapacityAndSaleBudgeFilterMonth,
                                              GlobalOTDTable
                                             );
    *]
    GroupServerCalls: false
  }
_Main/UI/MacroPlannerWebApp/Component_FormCapacityAndSaleBudgeCompare/Response_pButton_ButtonCapacityAndSaleBudgeCompare_OnClick#231.def
@@ -9,10 +9,28 @@
  {
    Body:
    [*
      targetCapacityAndSaleBudgeFilterItem := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterItem, tempCASBFI,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterItem.Data(), Elements, tempCASBFI1, tempCASBFI1 = tempCASBFI ) );
      targetCapacityAndSaleBudgeFilterPlaceOfProductionOfArray := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterPlaceOfProductionOfArray, tempCASBFPOPOA,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterPlaceOfProductionOfArray.Data(), Elements, tempCASBFPOPOA1, tempCASBFPOPOA1 = tempCASBFPOPOA ) );
      targetCapacityAndSaleBudgeFilterBusinessType := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterBusinessType, tempCASBFBT,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterBusinessType.Data(), Elements, tempCASBFBT1, tempCASBFBT1 = tempCASBFBT ) );
      targetCapacityAndSaleBudgeFilterYear := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterYear, tempCASBFY,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterYear.Data(), Elements, tempCASBFY1, tempCASBFY1 = tempCASBFY ) );
      targetCapacityAndSaleBudgeFilterMonth := selectset( GlobalOTDSOP, CapacityAndSaleBudgeFilterMonth, tempCASBFM,
                                                         exists( DataHolderCapacityAndSaleBudgeFilterMonth.Data(), Elements, tempCASBFM1, tempCASBFM1 = tempCASBFM ) );
      GlobalOTDSOP.CapacityAndSaleBudgeCompare( DataHolderMacroPlansForScenarioComparison.Data(), 
                                                DataHolderCapacityAndSaleBudgeFilterItem.Data(),
                                                DataHolderCapacityAndSaleBudgeFilterYear.Data(),
                                                DataHolderCapacityAndSaleBudgeFilterMonth.Data(),
                                                &targetCapacityAndSaleBudgeFilterItem,
                                                &targetCapacityAndSaleBudgeFilterPlaceOfProductionOfArray,
                                                &targetCapacityAndSaleBudgeFilterBusinessType,
                                                &targetCapacityAndSaleBudgeFilterYear,
                                                &targetCapacityAndSaleBudgeFilterMonth,
                                                GlobalOTDTable );
    *]
    GroupServerCalls: false
_Main/UI/MacroPlannerWebApp/Views/Pegging·ÖÎö.vw
@@ -239,7 +239,7 @@
          FormPeggingAllResult_DataSetLevelPeggingAllResult
          {
            groupDepth: 2
            sort: 'StartDate'
            sort: 'ProductID,StockingPointID,StartDate'
            column_PeggingProductInSalesDemandBase_SalesDemandBaseID
            {
              columnId: 'PeggingProductInSalesDemandBase.SalesDemandBaseID'
@@ -328,10 +328,10 @@
    userconfigurableinformation
    {
    }
    image: 'VIEW'
    page: ''
    group: ''
    index: 0
    image: 'VIEW'
    description: ''
  }
  formatversion: 2
_Main/UI/MacroPlannerWebApp/Views/Äê¶È²úÏú¸´ÅÌ.vw
@@ -156,7 +156,7 @@
          FormCapacityAndSaleBudgeFilterItem_DataSetLevelCapacityAndSaleBudgeFilterItem
          {
            groupDepth: -1
            sort: 'ItemName'
            sort: 'DESC:ItemName'
            column_ItemName
            {
              columnId: 'ItemName'
@@ -221,6 +221,7 @@
          FormCapacityAndSaleBudgeFilterPlaceOfProductionOfArray_DataSetLevelCapacityAndSaleBudgeFilterPlaceOfProductionOfArray
          {
            groupDepth: -1
            sort: 'DESC:PlaceOfProductionOfArray'
            column_PlaceOfProductionOfArray
            {
              columnId: 'PlaceOfProductionOfArray'
@@ -287,6 +288,7 @@
          FormCapacityAndSaleBudgeFilterBusinessType_DataSetLevelCapacityAndSaleBudgeFilterBusinessType
          {
            groupDepth: -1
            sort: 'DESC:BusinessType'
            column_BusinessType
            {
              columnId: 'BusinessType'
@@ -369,10 +371,10 @@
    userconfigurableinformation
    {
    }
    image: 'PIG'
    page: ''
    group: ''
    index: 0
    image: 'PIG'
    description: ''
  }
  formatversion: 2
_var/_Main/ProjSettings/MacroPlanner/Views/X_·ÖÎöÊÓͼ_[414702.1.50321581].vw
@@ -16,7 +16,7 @@
  CREATIONUSER 'quintiq/hongjli'
  UPDATEDATETIME '2023-11-01T11:42:14'
  UPDATEUSER 'quintiq/hongjli'
  LASTACCESSDATE '2023-11-02'
  LASTACCESSDATE '2023-11-03'
  VIEWSCOPE 0
}
AUTHORIZATIONS