Skip to content

MrmBacklogProductTypesComponent

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-backlog-product-types/mrm-backlog-product-types.component.ts (line 45)

Part of: Pams

MrmBacklogProductTypesComponent manages dashboard data for the MRM backlog product-types widget. It coordinates Angular lifecycle events, data initialization and retrieval, display formatting, resize handling, and caching behavior.

Methods

MethodSignatureReturns
ngOnInitngOnInit()void
ngOnChangesngOnChanges()void
ngOnDestroyngOnDestroy()void
getDashboardDatagetDashboardData()void
initalizingDatainitalizingData(value: BranchData[])void
calculatePerformancePercalculatePerformancePer(month: MonthData)number
translateMonthNametranslateMonthName(month: MonthData)string
getpriceFormattedgetpriceFormatted(x: undefined)string
onResizeonResize()void
setChachingsetChaching()void
getChachinggetChaching()void
onValueChangedonValueChanged(e: undefined)void
onChartInitonChartInit(e: any, index: number)void
switchChartTypeHandlerswitchChartTypeHandler()void
switchVendorTypeIdHandlerswitchVendorTypeIdHandler(vendorTypeId: number)void
comparingWithPrevMonthcomparingWithPrevMonth(month: MonthData, bIndex: number, index: number)string
comparingBookingWithPrevSummcomparingBookingWithPrevSumm(month: TotalBookingMonths, index: number)string
comparingForecastWithPrevSummcomparingForecastWithPrevSumm(month: TotalBookingMonths, index: number)string
setValuesetValue(value: number)void
setForecastValuesetForecastValue(value: number)void
setMarginAvaragesetMarginAvarage(value: number)void
isForecastisForecast(month: MonthData)boolean
isAchievedOrCurrentisAchievedOrCurrent(month: MonthData)boolean
getpriceForecastAmountgetpriceForecastAmount(month: MonthData)number
expectedCurrencyChangeexpectedCurrencyChange(e: undefined)void

Properties

PropertyType
_widgetWidget
_widgetTypestring
withoutOptionBarboolean
withNominalboolean
allowedtoEditboolean
allowedtoEnableEdtingboolean
selectedYearnumber
vendorTypeEnumany
vendorTypeIdany
cachingWidgetDataCachingWidgetData
dataBranchData[]
originalDataBranchData[]
singleMonthsMonthData
branchNamestring
branchCurrencyany
subscriptionSubscription
SeriseRangeany[]
echartsIntanceany
totalBookingMonthsTotalBookingMonths[]
tempTotalMonthTotalBookingMonths
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets

Where it refuses work

  • MrmBacklogProductTypesComponent stops the work with an early return when month.MonthId == 12.
  • MrmBacklogProductTypesComponent stops the work with an early return when month.TotalValue < this.data[bIndex].MrmBooking[index - 1].TotalValue.
  • MrmBacklogProductTypesComponent stops the work with an early return when month.TotalBookingMonth < this.totalBookingMonths[index - 1].TotalBookingMonth.
  • MrmBacklogProductTypesComponent stops the work with an early return when month.TotalForecastMonth < this.totalBookingMonths[index - 1].TotalForecastMonth.
  • MrmBacklogProductTypesComponent stops the work with an early return when month.MonthId >= new Date().getMonth() + 1.
  • MrmBacklogProductTypesComponent stops the work with an early return when month.MonthId <= new Date().getMonth() + 1.

Diagram

mermaid
graph LR
    A[Angular lifecycle] --> B[ngOnInit]
    A --> C[ngOnChanges]
    A --> D[ngOnDestroy]

    B --> E[initalizingData]
    C --> E
    E --> F[getDashboardData]
    F --> G[Dashboard widget state]

    G --> H[calculatePerformancePer]
    G --> I[translateMonthName]
    G --> J[getpriceFormatted]

    K[Window resize] --> L[onResize]
    L --> G

    G --> M[setChaching]

Usage

ts
import { MrmBacklogProductTypesComponent } from './mrm-backlog-product-types.component';

function refreshProductTypesWidget(
  widget: MrmBacklogProductTypesComponent,
): void {
  widget.getDashboardData();

  const performance = widget.calculatePerformancePer();
  const monthName = widget.translateMonthName();
  const formattedPrice = widget.getpriceFormatted();

  console.log({
    performance,
    monthName,
    formattedPrice,
  });
}

AI Coding Instructions

  • Let Angular invoke ngOnInit, ngOnChanges, and ngOnDestroy; do not call lifecycle hooks directly from application code.
  • Keep data loading flows centered on initalizingData() and getDashboardData() so widget state is updated through one path.
  • Preserve the existing method names, including initalizingData() and setChaching(), when changing related call sites.
  • Use calculatePerformancePer(), translateMonthName(), and getpriceFormatted() for display values instead of duplicating formatting logic in templates.
  • Keep resize-related state updates inside onResize() and cleanup work inside ngOnDestroy().

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1

Was this page helpful?

Download as PDF