Skip to content

MrmBookingSupplierComponent

reference
2 min readUpdated

Kind: Class

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

Part of: Pams

MrmBookingSupplierComponent is an Angular dashboard widget for displaying MRM booking supplier data. It loads and initializes dashboard state, calculates performance values, formats month and price output, and coordinates scroll and resize 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
syncScrollsyncScroll(e: undefined)void
onResizeonResize()void
setChachingsetChaching()void
getChachinggetChaching()void
onValueChangedonValueChanged(e: undefined)void
onChartInitonChartInit(e: any, index: number)void
switchChartTypeHandlerswitchChartTypeHandler()void
switchBasedOnTendencyHandlerswitchBasedOnTendencyHandler()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
selectTextselectText(e: undefined)void
sortingsorting(propertyName: string, propertyType: string, monthIndex: number)void

Properties

PropertyType
scrollOneElementRef
scrollTwoElementRef
scrollThreeElementRef
_widgetWidget
_widgetTypestring
withoutOptionBarboolean
bookingOrSalesnumber
withNominalboolean
selectedTeamnumber
forecastRuleIdnumber
allowedtoEditboolean
allowedtoEnableEdtingboolean
forecastRulesany[]
selectedYearnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
dataBranchData[]
originalDataBranchData[]
singleMonthsMonthData
branchCurrencyany
basedOnTendencyboolean
subscriptionSubscription
SeriseRangeany[]
echartsIntanceany
totalBookingMonthsTotalBookingMonths[]
tempTotalMonthTotalBookingMonths
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets
searchTextstring
sortingDirectionnumber

Where it refuses work

  • MrmBookingSupplierComponent stops the work with an early return when a[propertyName] < b[propertyName], in 2 places.
  • MrmBookingSupplierComponent stops the work with an early return when a[propertyName] > b[propertyName], in 2 places.
  • MrmBookingSupplierComponent stops the work with an early return when month.MonthId == 12.
  • MrmBookingSupplierComponent stops the work with an early return when month.TotalValue < this.data[bIndex].MrmBooking[index - 1].TotalValue.
  • MrmBookingSupplierComponent stops the work with an early return when month.TotalBookingMonth < this.totalBookingMonths[index - 1].TotalBookingMonth.
  • MrmBookingSupplierComponent stops the work with an early return when month.TotalForecastMonth < this.totalBookingMonths[index - 1].TotalForecastMonth.

Diagram

mermaid
graph LR
  Angular[Angular lifecycle] --> Init[ngOnInit]
  Angular --> Changes[ngOnChanges]
  Angular --> Destroy[ngOnDestroy]

  Init --> Load[getDashboardData]
  Changes --> Load
  Load --> Initialize[initalizingData]

  Initialize --> Performance[calculatePerformancePer]
  Initialize --> Month[translateMonthName]
  Initialize --> Price[getpriceFormatted]

  Scroll[syncScroll] --> Widget[MrmBookingSupplierComponent]
  Resize[onResize] --> Widget

Usage

ts
import { TestBed } from '@angular/core/testing';
import { MrmBookingSupplierComponent } from './mrm-booking-supplier.component';

const fixture = TestBed.createComponent(MrmBookingSupplierComponent);
fixture.detectChanges();

const widget = fixture.componentInstance;

// Refresh dashboard data when required by the host view.
widget.getDashboardData();

// Keep related scroll areas aligned.
widget.syncScroll();

AI Coding Instructions

  • Keep dashboard data retrieval inside getDashboardData() and state preparation inside initalizingData().
  • Preserve Angular lifecycle behavior in ngOnInit(), ngOnChanges(), and ngOnDestroy() when adding subscriptions or event listeners.
  • Keep display calculations in calculatePerformancePer(), translateMonthName(), and getpriceFormatted() rather than placing formatting logic in templates.
  • Update syncScroll() and onResize() together when changing the widget layout or scrollable DOM elements.

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