Skip to content

MrmAccountPayableComponent

reference
2 min readUpdated

Kind: Class

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

Part of: Pams

MrmAccountPayableComponent is an Angular dashboard widget for displaying accounts payable data. It retrieves currency and authorization information, loads and saves dashboard data, and calculates payable totals by year and month.

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

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

Diagram

mermaid
graph LR
    A[Angular Lifecycle] --> B[MrmAccountPayableComponent]
    B --> C[getCurrencies]
    B --> D[GetAuthorizationAccess]
    B --> E[getDashboardData]
    B --> F[initalizingData]
    B --> G[saveDashboardData]
    E --> H[calculateSumByYear]
    E --> I[calculateSumByMonth]
    B --> J[ngOnDestroy]

Usage

ts
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MrmAccountPayableComponent } from './mrm-account-payable.component';

describe('MrmAccountPayableComponent', () => {
  let fixture: ComponentFixture<MrmAccountPayableComponent>;
  let component: MrmAccountPayableComponent;

  beforeEach(() => {
    fixture = TestBed.createComponent(MrmAccountPayableComponent);
    component = fixture.componentInstance;

    fixture.detectChanges();
  });

  it('loads payable dashboard data', () => {
    component.GetAuthorizationAccess();
    component.getCurrencies();
    component.getDashboardData();

    expect(component).toBeTruthy();
  });
});

AI Coding Instructions

  • Keep data loading inside the existing initialization and lifecycle flow rather than calling dashboard APIs from templates.
  • Call GetAuthorizationAccess() before exposing or saving payable dashboard data that depends on user permissions.
  • Keep currency retrieval through getCurrencies() so payable values use the component’s configured currency data.
  • Update both calculateSumByYear() and calculateSumByMonth() when changing the payable data structure or aggregation rules.
  • Release subscriptions, timers, or other resources in ngOnDestroy() when adding asynchronous behavior.

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