Skip to content

MrmAccountReceivableComponent

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-account-receivable/mrm-account-receivable.component.ts (line 74)

Part of: Pams

MrmAccountReceivableComponent is an Angular dashboard widget for presenting and maintaining MRM account-receivable dashboard data. It retrieves authorization and currency data, initializes or loads dashboard state, calculates totals by year and month, and saves dashboard updates.

Methods

MethodSignatureReturns
getCurrenciesgetCurrencies()void
GetAuthorizationAccessGetAuthorizationAccess(url: string)void
ngOnInitngOnInit()void
ngOnChangesngOnChanges()void
ngOnDestroyngOnDestroy()void
getDashboardDatagetDashboardData()void
initalizingDatainitalizingData(value: BranchData)void
saveDashboardDatasaveDashboardData()void
calculateSumByYearcalculateSumByYear()void
calculateSumByMonthcalculateSumByMonth(monthIndex: number)void
AddNewCurrencyAddNewCurrency(account: number, SalesCom: number)void
onCurrencyChangedonCurrencyChanged(e: undefined, account: number, SalesCom: number, currencyIndex: number)void
translateMonthNametranslateMonthName(MonthId: number)string
getpriceFormattedgetpriceFormatted(x: undefined)string
onResizeonResize()void
setChachingsetChaching()void
getChachinggetChaching()void
switchByGroupsHandlerswitchByGroupsHandler()void
switchBasedOnTendencyHandlerswitchBasedOnTendencyHandler()void
comparingWithPrevMonthcomparingWithPrevMonth(month: MonthData, accountIndex: number, salesComIndex: number, currencyIndex: number, monthIndex: number, propertyName: string)string
comparingSummeryWithPrevMonthcomparingSummeryWithPrevMonth(month: MonthData, monthIndex: number, propertyName: string)string
isCurrentMonthisCurrentMonth(month: MonthData)boolean
getpriceForecastAmountgetpriceForecastAmount(month: MonthData)number
expectedCurrencyChangeexpectedCurrencyChange(e: undefined)void
selectTextselectText(e: undefined)void
editSelectedMonthPrepareeditSelectedMonthPrepare(month: MonthData, supplierId: number)void
mouseoverRowSpanmouseoverRowSpan(e: undefined, bIndex: number)void
mouseoutRowSpanmouseoutRowSpan(e: undefined, bIndex: number)void
openPopupopenPopup(n: string, t: string, i: string, btnTxt: string)void
savePopupsavePopup()void
ClosewithDonotSaveClosewithDonotSave()void
OnOpenedPopupOnOpenedPopup()void
closePopupclosePopup()void

Properties

PropertyType
sharedPopupSharedPopupComponent
_widgetWidget
_widgetTypestring
withoutOptionBarboolean
editModeboolean
bookingOrSalesnumber
byGroupsboolean
selectedTeamnumber
forecastRuleIdnumber
dataBranchData
allowedtoEditboolean
allowedtoEnableEdtingboolean
widgetEditRequestany
widgetEditEndany
forecastRulesany[]
currenciesCompanyCurrency[]
selectedYearnumber
currentMonthIndexnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
originalDataBranchData
selectedDataBranchData
singleMonthsMonthData
monthsSummeryMonthsSum[]
nonGroupAccountReceivablesMonthData[]
branchCurrencyany
basedOnTendencyboolean
subscriptionSubscription
SeriseRangeany[]
echartsIntanceany
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets
totalProfitAndLossAmountnumber
totalOthersnumber
totalTotalSGAndAnumber
totalFORXnumber
totalTotalnumber
totalCumulativenumber
totalPercentageUsedBudgetnumber
popupany
searchTextstring

Where it refuses work

  • MrmAccountReceivableComponent stops the work with an early return when MonthId == 12.
  • MrmAccountReceivableComponent stops the work with an early return when month[propertyName] < this.data.Products.Sales[currencyIndex].Details[monthIndex - 1][pro….
  • MrmAccountReceivableComponent stops the work with an early return when month[propertyName] < this.data.Products.Commission[currencyIndex].Details[monthIndex - 1….
  • MrmAccountReceivableComponent stops the work with an early return when month[propertyName] < this.data.Scrap.Sales[currencyIndex].Details[monthIndex - 1][proper….
  • MrmAccountReceivableComponent stops the work with an early return when month[propertyName] < this.data.Scrap.Commission[currencyIndex].Details[monthIndex - 1][p….
  • MrmAccountReceivableComponent stops the work with an early return when month[propertyName] < this.monthsSummery[monthIndex - 1][propertyName].

Diagram

mermaid
graph LR
    Lifecycle[Angular lifecycle] --> Init[ngOnInit]
    Lifecycle --> Changes[ngOnChanges]
    Init --> Authorization[GetAuthorizationAccess]
    Init --> Currencies[getCurrencies]
    Authorization --> Data[getDashboardData]
    Currencies --> Data
    Data --> Initialize[initalizingData]
    Initialize --> YearTotals[calculateSumByYear]
    Initialize --> MonthTotals[calculateSumByMonth]
    YearTotals --> Save[saveDashboardData]
    MonthTotals --> Save
    Lifecycle --> Destroy[ngOnDestroy]

Usage

typescript
import { Component, ViewChild } from '@angular/core';
import { MrmAccountReceivableComponent } from './mrm-account-receivable.component';

@Component({
  selector: 'app-dashboard-page',
  template: `
    <!-- Render MrmAccountReceivableComponent in this dashboard view -->
  `
})
export class DashboardPageComponent {
  @ViewChild(MrmAccountReceivableComponent)
  accountReceivableWidget?: MrmAccountReceivableComponent;

  refreshAccountReceivableData(): void {
    this.accountReceivableWidget?.getDashboardData();
  }

  saveAccountReceivableData(): void {
    this.accountReceivableWidget?.saveDashboardData();
  }
}

AI Coding Instructions

  • Let Angular manage ngOnInit, ngOnChanges, and ngOnDestroy; avoid invoking lifecycle methods directly from application code.
  • Keep authorization and currency retrieval within the existing initialization flow before processing dashboard data.
  • Update calculateSumByYear and calculateSumByMonth together when changing account-receivable aggregation rules.
  • Route persisted dashboard changes through saveDashboardData rather than adding separate save paths.
  • Preserve cleanup behavior in ngOnDestroy when adding subscriptions, timers, or other component resources.

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)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1
  • DashboardTabComponentPams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/dashboard-tab/dashboard-tab.component.ts:1
  • ReportsTabComponentPams/Web/Pams.Web/Client/app/components/dashboard/reports-library/reports-tab/reports-tab.component.ts:1

Was this page helpful?

Download as PDF