Kind: Class
Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-currency-rate/mrm-currency-rate.component.ts (line 77)
Part of: Pams
MrmCurrencyRateComponent is an Angular dashboard widget that retrieves, initializes, and saves currency-rate dashboard data. It responds to lifecycle changes, calculates totals by year and month, translates month names, and cleans up when the component is destroyed.
Methods
| Method | Signature | Returns |
|---|---|---|
GetAuthorizationAccess | GetAuthorizationAccess(url: string) | void |
ngOnInit | ngOnInit() | void |
ngOnChanges | ngOnChanges() | void |
ngOnDestroy | ngOnDestroy() | void |
getDashboardData | getDashboardData() | void |
initalizingData | initalizingData(value: BranchData[]) | void |
saveDashboardData | saveDashboardData() | void |
calculateSumByYear | calculateSumByYear() | void |
calculateSumByMonth | calculateSumByMonth(monthIndex: number) | void |
translateMonthName | translateMonthName(month: BranchData) | string |
getpriceFormatted | getpriceFormatted(x: undefined) | string |
onResize | onResize() | void |
setChaching | setChaching() | void |
getChaching | getChaching() | void |
switchChartTypeHandler | switchChartTypeHandler() | void |
switchBasedOnTendencyHandler | switchBasedOnTendencyHandler() | void |
comparingWithPrevMonth | comparingWithPrevMonth(month: BranchData, bIndex: number, propertyName: string) | string |
comparingBookingWithPrevSumm | comparingBookingWithPrevSumm(month: MonthsSum, index: number, propertyName: string) | string |
isCurrentMonth | isCurrentMonth(month: MonthData) | boolean |
getpriceForecastAmount | getpriceForecastAmount(month: MonthData) | number |
expectedCurrencyChange | expectedCurrencyChange(e: undefined) | void |
selectText | selectText(e: undefined) | void |
editSelectedMonthPrepare | editSelectedMonthPrepare(month: MonthData, supplierId: number) | void |
openPopup | openPopup(n: string, t: string, i: string, btnTxt: string) | void |
savePopup | savePopup() | void |
ClosewithDonotSave | ClosewithDonotSave() | void |
OnOpenedPopup | OnOpenedPopup() | void |
closePopup | closePopup() | void |
Properties
| Property | Type |
|---|---|
sharedPopup | SharedPopupComponent |
_widget | Widget |
_widgetType | string |
withoutOptionBar | boolean |
editMode | boolean |
bookingOrSales | number |
withNominal | boolean |
selectedTeam | number |
forecastRuleId | number |
allowedtoEdit | boolean |
allowedtoEnableEdting | boolean |
widgetEditRequest | any |
widgetEditEnd | any |
forecastRules | any[] |
selectedYear | number |
numYearsDatasource | any[] |
todayWidgetsEnum | any |
cachingWidgetData | CachingWidgetData |
data | BranchData[] |
originalData | BranchData[] |
selectedData | BranchData[] |
singleMonths | MonthData |
branchCurrency | any |
basedOnTendency | boolean |
subscription | Subscription |
SeriseRange | any[] |
echartsIntance | any |
totalBookingMonths | MonthsSum[] |
tempMonthSum | MonthsSum |
totalTargets | number |
yearBooking | number |
totalForecasts | number |
tempTotalTarget | TotalTargets |
totalPercentageUsedBudget | number |
popup | any |
searchText | string |
Where it refuses work
MrmCurrencyRateComponentstops the work with an early return whenmonth.MonthId == 12.MrmCurrencyRateComponentstops the work with an early return whenmonth[propertyName] < this.data[bIndex - 1][propertyName].MrmCurrencyRateComponentstops the work with an early return whenmonth[propertyName] < this.totalBookingMonths[index - 1][propertyName].MrmCurrencyRateComponentstops the work with an early return whenthis.allowedtoEnableEdting.MrmCurrencyRateComponentstops the work with an early return whenthis.allowedtoEdit.
Diagram
mermaidgraph LR A[Angular Lifecycle] --> B[ngOnInit] A --> C[ngOnChanges] A --> D[ngOnDestroy] B --> E[GetAuthorizationAccess] E --> F[getDashboardData] F --> G[initalizingData] G --> H[calculateSumByYear] G --> I[calculateSumByMonth] G --> J[translateMonthName] G --> K[saveDashboardData]
Usage
tsimport { MrmCurrencyRateComponent } from './mrm-currency-rate.component';
export function refreshCurrencyRateWidget(
widget: MrmCurrencyRateComponent,
) {
widget.GetAuthorizationAccess();
widget.getDashboardData();
const yearlyTotal = widget.calculateSumByYear();
const monthlyTotal = widget.calculateSumByMonth();
const monthName = widget.translateMonthName();
widget.saveDashboardData();
return {
yearlyTotal,
monthlyTotal,
monthName,
};
}
AI Coding Instructions
- Let Angular call
ngOnInit,ngOnChanges, andngOnDestroy; avoid calling lifecycle hooks from application code. - Keep the existing
initalizingData()method name when changing related code, including its current spelling. - Fetch and initialize dashboard data before calling
calculateSumByYear()orcalculateSumByMonth(). - Keep authorization checks in
GetAuthorizationAccess()aligned with dashboard data access behavior. - Add cleanup for subscriptions, timers, or other resources in
ngOnDestroy()when extending data-loading logic.
Used by
3 references from 3 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (3)
TranslateHandler—Pams/Web/Pams.Web/Client/app/app.module.ts:1DashboardTabComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/dashboard-tab/dashboard-tab.component.ts:1ReportsTabComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/reports-library/reports-tab/reports-tab.component.ts:1
Was this page helpful?