private void AddToObjectiveQuarters(CommonRawData rawDataItem) { if (rawDataItem.Date.Year == _endYear && rawDataItem.Date.Month <= _endMonth) { if (DBUtils.Is_Objective_Value(rawDataItem.Date, Utils.GetBrandCode(_productBrand),_regionType, rawDataItem.IsBudget, rawDataItem.IsF1, rawDataItem.IsF2)) { if (rawDataItem.Date.Month <= 3) { _objectiveQ1Qty[0].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _objectiveQ1Val[0].YAxisValue += rawDataItem.VAL; } else if (rawDataItem.Date.Month >= 4 && rawDataItem.Date.Month <= 6) { _objectiveQ2Qty[0].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _objectiveQ2Val[0].YAxisValue += rawDataItem.VAL; } else if (rawDataItem.Date.Month >= 7 && rawDataItem.Date.Month <= 9) { _objectiveQ3Qty[0].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _objectiveQ3Val[0].YAxisValue += rawDataItem.VAL; } else if (rawDataItem.Date.Month >= 10) { _objectiveQ4Qty[0].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _objectiveQ4Val[0].YAxisValue += rawDataItem.VAL; } } } }
private void AddToYearChartItemSources(CommonRawData rawDataItem) { // We take the ytg of this year from objectives (even if we have the data for this year) if (rawDataItem.Date.Year == _endYear && rawDataItem.Date.Month <= _endMonth) { _thisYearColQty[0].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _thisYearColVal[0].YAxisValue += rawDataItem.VAL; } if (rawDataItem.Date.Year == (_endYear - 1) && rawDataItem.Date.Month <= _endMonth) { _lastYearColQty[0].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _lastYearColVal[0].YAxisValue += rawDataItem.VAL; } if (rawDataItem.Date.Year == (_endYear - 1) && rawDataItem.Date.Month > _endMonth) { _lastYearColQty[1].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _lastYearColVal[1].YAxisValue += rawDataItem.VAL; } }
private void AddToActualQ4ItemSource(CommonRawData rawDataItem) { if (rawDataItem.Date.Year == _endYear && rawDataItem.Date.Month >= 10) { _actualQ4Qty[0].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); _actualQ4Val[0].YAxisValue += rawDataItem.VAL; if (_objectiveQ4Qty[0].YAxisValue != 0) _actualQ4Qty[0].LeftSideLabel = "Var: " + Utils.GetVarValue(_objectiveQ4Qty[0].YAxisValue, _actualQ4Qty[0].YAxisValue) + "%"; if (_objectiveQ4Val[0].YAxisValue != 0) _actualQ4Val[0].LeftSideLabel = "Var: " + Utils.GetVarValue(_objectiveQ4Val[0].YAxisValue, _actualQ4Val[0].YAxisValue) + "%"; } }
public static void Add_To_ActualMatOut_Chart_ItemSource(CommonRawData dataItem, int endYear, SanofiRegionTypes regionType, ObservableCollection<DateDoubleChartObj> actualMatOut_ChartItemSource_QTY, ObservableCollection<DateDoubleChartObj> actualMatOut_ChartItemSource_VAL) { List<int> actualMatIndexes = Utils.Get_ActualMatOut_Indices(dataItem.Date.Month, dataItem.Date.Year, endYear, regionType, actualMatOut_ChartItemSource_QTY.Count); foreach (int ind in actualMatIndexes) { actualMatOut_ChartItemSource_QTY[ind].Value += dataItem.QTY; actualMatOut_ChartItemSource_VAL[ind].Value += dataItem.VAL; } }
private void AddToBudgetF1F2Sums(CommonRawData dataItem) { // These variables are used to set YTG if (dataItem.Date.Year == _endYear && dataItem.IsF2) { _f02SumQty += dataItem.QTY; _f02SumVal += dataItem.VAL; } if (dataItem.Date.Year == _endYear && dataItem.IsF1) { _f01SumQty += dataItem.QTY; _f01SumVal += dataItem.VAL; } if (dataItem.Date.Year == _endYear && dataItem.IsBudget) { _budgetSumQty += dataItem.QTY; _budgetSumVal += dataItem.VAL; } }
private void Add_To_PinkTable_Variables_SalesIn(CommonRawData dataItem) { if (dataItem.IsSalesIn && dataItem.Date.Year == _endYear && dataItem.Date.Month == _endMonth) { _endMonthSalesInValueVal += dataItem.VAL; _endMonthSalesInValueQty += 0; } if (dataItem.IsSalesIn && dataItem.Date.Year == (_endYear - 1) && dataItem.Date.Month == _endMonth) { _endMonthValueLastYearSalesInQty += 0; _endMonthValueLastYearSalesInVal += dataItem.VAL; } if (dataItem.IsSalesIn && dataItem.Date.Year == _endYear - 1 && dataItem.Date.Month > _endMonth) { _ytgLastYearSalesInQty = 0; _ytgLastYearSalesInVal += dataItem.VAL; } if (dataItem.IsSalesIn && dataItem.Date.Year == _endYear && dataItem.Date.Month <= _endMonth) { _ytdSalesInQty += 0; _ytdSalesInVal += dataItem.VAL; } if (dataItem.IsSalesIn && dataItem.Date.Year == (_endYear - 1) && dataItem.Date.Month <= _endMonth) { _ytdSalesInLastYearQty += 0; _ytdSalesInLastYearVal += dataItem.VAL; } }
public static void Add_To_ActaulSales_Chart_ItemSource(CommonRawData dataItem, int endYear, int endMonth, ObservableCollection<DateDoubleChartObj> actualSales_ChartItemSource_QTY, ObservableCollection<DateDoubleChartObj> actualSales_ChartItemSource_VAL) { int index = Utils.Get_ActualSales_ItemSource_Index(dataItem.Date.Month, dataItem.Date.Year, endMonth, endYear); if (index != -1) { actualSales_ChartItemSource_QTY[index].Value += dataItem.QTY; actualSales_ChartItemSource_VAL[index].Value += dataItem.VAL; } }
private void Add_To_BudgetMatOut_Chart_ItemSource_ForObjective(CommonRawData dataItem) { if (dataItem.IsBudget) { List<int> budgetMatIndexes = GetObjectiveMatOutIndex_ForObjectiveData(dataItem.Date.Month, dataItem.Date.Year, 1, false); foreach (int ind in budgetMatIndexes) { _budgetMatOut_ChartItemSource_QTY[ind].Value += dataItem.QTY; _budgetMatOut_ChartItemSource_VAL[ind].Value += dataItem.VAL; } } }
private void Add_To_F02MatOut_Chart_ItemSource_ForObjective(CommonRawData dataItem) { if (dataItem.IsF2) { List<int> f02MatIndexes = GetObjectiveMatOutIndex_ForObjectiveData(dataItem.Date.Month, dataItem.Date.Year, DBUtils.Get_F2_StartMonth(_endYear), true); foreach (int ind in f02MatIndexes) { _f02MatOut_ChartItemSource_QTY[ind].Value += dataItem.QTY; _f02MatOut_ChartItemSource_VAL[ind].Value += dataItem.VAL; } } }
private void Add_To_Objective_Chart_ItemSource(CommonRawData dataItem) { int index = Get_Objective_ItemSource_Index(dataItem.Date.Month, dataItem.Date.Year); if (index != -1 && DBUtils.Is_Objective_Value(dataItem.Date, Utils.GetBrandCode(_productBrand),_regionType,dataItem.IsBudget,dataItem.IsF1,dataItem.IsF2)) { _objective_ChartItemSource_QTY[index].Value += dataItem.QTY; _objective_ChartItemSource_VAL[index].Value += dataItem.VAL; } }
private void Add_To_Budget_Chart_ItemSource(CommonRawData dataItem) { if (dataItem.IsBudget) { int index = Get_Budget_ItemSource_Index(dataItem.Date.Month, dataItem.Date.Year); if (index != -1) { _budget_ChartItemSource_QTY[index].Value += dataItem.QTY; _budget_ChartItemSource_VAL[index].Value += dataItem.VAL; } } }
private void Add_To_SalesInObjectiveMat_Chart_ItemSource(CommonRawData dataItem) { List<int> salesInMatObjIndexes = GetSalesInObjectiveMatIndex_ForSalesInObjective(dataItem.Date.Month, dataItem.Date.Year); foreach (int index in salesInMatObjIndexes) { _salesInObjectiveMat_ChartItemSource_VAL[index].Value += dataItem.VAL; _salesInObjectiveMat_ChartItemSource_QTY[index].Value += 0; } }
private void Add_To_SalesIn_Chart_ItemSource(CommonRawData dataItem) { int index = GetSalesInItemSourceIndex(dataItem.Date.Month, dataItem.Date.Year); if (index < _salesIn_ChartItemSource_VAL.Count && index != -1) { _salesIn_ChartItemSource_VAL[index].Value += dataItem.VAL; _salesIn_ChartItemSource_QTY[index].Value += 0; if (_minY > dataItem.VAL) _minY = dataItem.VAL; } }
private void Add_To_PinkTable_Variables_SalesInObjective(CommonRawData dataItem) { if (dataItem.IsSalesInObjective && dataItem.Date.Year == _endYear && dataItem.Date.Month == _endMonth) { _endMonthSalesInObjectiveVal += dataItem.VAL; _endMonthSalesInObjectiveQty += 0; } if (dataItem.IsSalesInObjective && dataItem.Date.Year == _endYear && dataItem.Date.Month > _endMonth) { _ytgSalesInQty = 0; _ytgSalesInVal += dataItem.VAL; } if (dataItem.IsSalesInObjective && dataItem.Date.Year == _endYear && dataItem.Date.Month <= _endMonth) { _ytdSalesInObjectiveQty += 0; _ytdSalesInObjectiveVal += dataItem.VAL; } /*if (dataItem.IsSalesIn && dataItem.Date.Year == _endYear - 1 && dataItem.Date.Month > _endMonth) { _ytgLastYearSalesInQty = 0; _ytgLastYearSalesInVal += dataItem.VAL; }*/ }
private void AddToThisYearYtg(CommonRawData rawDataItem) { if (rawDataItem.Date.Year == _endYear && rawDataItem.Date.Month > _endMonth) { if (DBUtils.Is_Objective_Value(rawDataItem.Date, Utils.GetBrandCode(_productBrand),_regionType, rawDataItem.IsBudget, rawDataItem.IsF1, rawDataItem.IsF2)) { this._thisYearColQty[1].YAxisValue += Utils.Round_to_One_Fraction_Except_Zero(rawDataItem.QTY); this._thisYearColVal[1].YAxisValue += rawDataItem.VAL; } } }
private void Add_To_PinkTable_EndMonth_Variables_ForObjective(CommonRawData dataItem) { if (dataItem.Date.Year == _endYear && dataItem.Date.Month == _endMonth && dataItem.IsBudget) { _endMonthBudgetQty += dataItem.QTY; _endMonthBudgetVal += dataItem.VAL; } if (_endMonth < DBUtils.Get_F2_StartMonth(_endYear)) { if (dataItem.Date.Year == _endYear && dataItem.IsF1) { if (dataItem.Date.Month == _endMonth) { _endMonthFQty += dataItem.QTY; _endMonthFVal += dataItem.VAL; } } } if (_endMonth >= DBUtils.Get_F2_StartMonth(_endYear)) { if (dataItem.Date.Year == _endYear && dataItem.IsF2) { if (dataItem.Date.Month == _endMonth) { _endMonthFQty += dataItem.QTY; _endMonthFVal += dataItem.VAL; } } } }
private void AddToYtdYtgVariablesForActual(CommonRawData dataItem) { if (dataItem.IsActual) { if (dataItem.Date.Year == _endYear && dataItem.Date.Month <= _endMonth) { _ytdQty += dataItem.QTY; _ytdVal += dataItem.VAL; } if (dataItem.Date.Year == (_endYear - 1) && dataItem.Date.Month <= _endMonth) { _ytdLastYearQty += dataItem.QTY; _ytdLastYearVal += dataItem.VAL; } if (dataItem.Date.Year == (_endYear - 1) && dataItem.Date.Month > _endMonth) { _ytgLastYearQty += dataItem.QTY; _ytgLastYearVal += dataItem.VAL; } } }
private void Add_To_PinkTable_EndMonth_Variables_ForActual(CommonRawData dataItem) { if (dataItem.IsActual && dataItem.Date.Year == _endYear && dataItem.Date.Month == _endMonth) { _endMonthValueQty += dataItem.QTY; _endMonthValueVal += dataItem.VAL; } if (dataItem.IsActual && dataItem.Date.Year == (_endYear - 1) && dataItem.Date.Month == _endMonth) { _endMonthValueLastYearQty += dataItem.QTY; _endMonthValueLastYearVal += dataItem.VAL; } }