Kind: Class
Source: Frontend/src/app/components/dashboard/dashboard-libary/widgets/mrm-account-payable/mrm-account-payable.component.ts (line 76)
Part of: Frontend
MrmAccountPayableComponent is a dashboard widget component that loads, initializes, saves, and aggregates account payable data. It also manages available currencies and checks whether the current feature subscription allows the widget to be used.
Extends: BaseWidgetComponent
Methods
| Method | Signature | Returns |
|---|---|---|
checkFeatureSubscription | checkFeatureSubscription() | boolean |
getCurrencies | getCurrencies() | void |
ngOnInit | ngOnInit() | void |
ngOnChanges | ngOnChanges() | void |
getDashboardData | getDashboardData() | void |
initalizingData | initalizingData(value: BranchData) | void |
saveDashboardData | saveDashboardData() | void |
calculateSumByYear | calculateSumByYear() | void |
calculateSumByMonth | calculateSumByMonth(monthIndex: number) | void |
AddNewCurrency | AddNewCurrency(account: number, SalesCom: number) | void |
onCurrencyChanged | onCurrencyChanged(e: undefined, account: number, SalesCom: number, currencyIndex: number) | void |
translateMonthName | translateMonthName(MonthId: number) | string |
getpriceFormatted | getpriceFormatted(x: undefined) | string |
onResize | onResize() | void |
setChaching | setChaching() | void |
getChaching | getChaching() | void |
switchByGroupsHandler | switchByGroupsHandler() | void |
switchBasedOnTendencyHandler | switchBasedOnTendencyHandler() | void |
comparingWithPrevMonth | comparingWithPrevMonth(month: MonthData, accountIndex: number, salesComIndex: number, currencyIndex: number, monthIndex: number, propertyName: string) | string |
comparingSummeryWithPrevMonth | comparingSummeryWithPrevMonth(month: MonthData, monthIndex: 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 |
mouseoverRowSpan | mouseoverRowSpan(e: undefined, bIndex: number) | void |
mouseoutRowSpan | mouseoutRowSpan(e: undefined, bIndex: 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 |
yearId | number |
periodId | number |
countOfEditablePrevMonths | number |
withoutOptionBar | boolean |
editMode | boolean |
bookingOrSales | number |
byGroups | boolean |
selectedTeam | number |
forecastRuleId | number |
data | BranchData |
allowedtoEdit | boolean |
allowedtoEnableEdting | boolean |
widgetEditRequest | any |
widgetEditEnd | any |
forecastRules | any[] |
currencies | CompanyCurrency[] |
selectedYear | number |
currentMonthIndex | number |
numYearsDatasource | any[] |
todayWidgetsEnum | any |
cachingWidgetData | CachingWidgetData |
originalData | BranchData |
selectedData | BranchData |
singleMonths | MonthData |
monthsSummery | MonthsSum[] |
nonGroupAccountReceivables | MonthData[] |
branchCurrency | any |
basedOnTendency | boolean |
SeriseRange | any[] |
echartsIntance | any |
totalTargets | number |
yearBooking | number |
totalForecasts | number |
tempTotalTarget | TotalTargets |
totalProfitAndLossAmount | number |
totalOthers | number |
totalTotalSGAndA | number |
totalFORX | number |
totalTotal | number |
totalCumulative | number |
totalPercentageUsedBudget | number |
popup | any |
searchText | string |
urrenFeature | number |
Where it refuses work
MrmAccountPayableComponentstops the work with an early return whenthis.dashboardLibraryService.checkFeatureSubscription(this.widget.chartEnumId).MrmAccountPayableComponentstops the work with an early return whenMonthId == 12.MrmAccountPayableComponentstops the work with an early return whenmonth[propertyName] < this.data.Products.Currencies[currencyIndex].Details[monthIndex - 1….MrmAccountPayableComponentstops the work with an early return whenmonth[propertyName] < this.data.Scrap.Currencies[currencyIndex].Details[monthIndex - 1][p….MrmAccountPayableComponentstops the work with an early return whenmonth[propertyName] < this.monthsSummery[monthIndex - 1][propertyName].MrmAccountPayableComponentstops the work with an early return whenAppSettings.calculateMonthsBeforeToday(month.YearId, month.MonthId -1) == 0 || AppSetting….
Diagram
mermaidgraph LR A[Angular lifecycle] --> B[ngOnInit] A --> C[ngOnChanges] B --> D[checkFeatureSubscription] D --> E[getCurrencies] D --> F[getDashboardData] F --> G[initalizingData] G --> H[calculateSumByYear] G --> I[calculateSumByMonth] G --> J[saveDashboardData] E --> K[AddNewCurrency] K --> J
Usage
tsimport { MrmAccountPayableComponent } from './mrm-account-payable.component';
// Angular creates the component and runs lifecycle hooks.
// Call dashboard actions from event handlers or surrounding dashboard logic.
function refreshPayables(
component: MrmAccountPayableComponent
): void {
if (!component.checkFeatureSubscription()) {
return;
}
component.getCurrencies();
component.getDashboardData();
component.calculateSumByYear();
component.calculateSumByMonth();
}
// Example action for adding a currency through the widget.
function addCurrency(component: MrmAccountPayableComponent): void {
component.AddNewCurrency();
component.saveDashboardData();
}
AI Coding Instructions
- Keep subscription validation through
checkFeatureSubscription()before loading or editing account payable widget data. - Use
ngOnInit()for initial widget setup andngOnChanges()when input-driven dashboard state changes. - Preserve the existing initialization flow: load dashboard data, run
initalizingData(), then calculate yearly and monthly totals. - Call
saveDashboardData()after changes that should persist, including currency updates fromAddNewCurrency(). - Keep currency retrieval in
getCurrencies()so dashboard currency state remains managed by the component.
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)
DashboardTabComponent—Frontend/src/app/components/dashboard/dashboard-libary/dashboard-tab/dashboard-tab.component.ts:1DashboardWidgetsModule—Frontend/src/app/components/dashboard/dashboard-widgets.module.ts:1ReportsTabComponent—Frontend/src/app/components/reports/reports-library/reports-tab/reports-tab.component.ts:1
Was this page helpful?