Skip to content

MrmCashFlowForecastedComponent

reference
3 min readUpdated

Kind: Class

Source: Frontend/src/app/components/dashboard/dashboard-libary/widgets/mrm-cash-flow-forecasted/mrm-cash-flow-forecasted.component.ts (line 187)

Part of: Frontend

MrmCashFlowForecastedComponent manages forecasted cash-flow data for the dashboard widget. It loads report settings and dashboard data, prepares monthly summaries, prevents edits for previous months, and saves user changes when the feature subscription permits access.

Extends: BaseWidgetComponent

Methods

MethodSignatureReturns
checkFeatureSubscriptioncheckFeatureSubscription()boolean
ngOnInitngOnInit()void
ngOnChangesngOnChanges()void
getDashboardDataByMonthgetDashboardDataByMonth()void
getDashboardDatagetDashboardData()void
getReportSettinggetReportSetting()void
fillMonthsSummeryfillMonthsSummery()void
initalizingDatainitalizingData(value: BranchData)void
disableEditingInPrevMonthsdisableEditingInPrevMonths()void
saveDashboardDatasaveDashboardData()void
saveDashboardDataForNotForecastsaveDashboardDataForNotForecast()void
calculateSumByYearcalculateSumByYear()void
calculateSumByMonthcalculateSumByMonth(monthIndex: number)void
getCurrencyRateFromHeadergetCurrencyRateFromHeader(currencyCode: string)number
setCurrencyTotalToHeadersetCurrencyTotalToHeader(cashFlowObjIndex: number, currencyCode: string, amount: number)void
resetCurrencyTotalresetCurrencyTotal(cashFlowObjIndex: number)void
calculateEditingSumByMonthcalculateEditingSumByMonth(cashFlowObjIndex: number, itemIndex: number, currencyIndex: number, monthIndex: number)void
translateMonthNametranslateMonthName(MonthId: number)string
getpriceFormattedgetpriceFormatted(x: undefined)string
onResizeonResize()void
setChachingsetChaching()void
getChachinggetChaching()void
switchVendorTypeIdHandlerswitchVendorTypeIdHandler()void
switchByGroupsHandlerswitchByGroupsHandler()void
switchBasedOnTendencyHandlerswitchBasedOnTendencyHandler()void
comparingWithPrevMonthcomparingWithPrevMonth(month: CashFlowItemMonthlyDetail, cashFlowObjIndex: number, monthIndex: number, propertyName: string)string
comparingSummeryWithPrevMonthcomparingSummeryWithPrevMonth(month: MonthsSum, monthIndex: number, propertyName: string)string
isForecastedMonthisForecastedMonth(YearId: number, MonthId: number)boolean
isCurrentMonthisCurrentMonth(YearId: number, MonthId: number)boolean
expectedCurrencyChangeexpectedCurrencyChange(e: undefined)void
selectTextselectText(e: undefined)void
editSelectedMonthPrepareeditSelectedMonthPrepare(month: MonthsSum)void
viewSelectedMonthPrepareviewSelectedMonthPrepare(month: MonthsSum, supplierId: number)void
fromNowfromNow(DateTime: any)void
calculateRowSpanCountcalculateRowSpanCount(itemNum: number)number
mouseoverRowSpanmouseoverRowSpan(e: undefined, bIndex: number)void
mouseoutRowSpanmouseoutRowSpan(e: undefined, bIndex: number)void
toggolePurchaseInvoicesDropdowntoggolePurchaseInvoicesDropdown()void
closePurchaseInvoicesDropdownclosePurchaseInvoicesDropdown()void
toggoleSalesInvoicesDropdowntoggoleSalesInvoicesDropdown()void
closeSalesInvoicesDropdowncloseSalesInvoicesDropdown()void
toggoleCommInvoicesDropdowntoggoleCommInvoicesDropdown()void
closeCommInvoicesDropdowncloseCommInvoicesDropdown()void
toggoleOverdueDelayDropdowntoggoleOverdueDelayDropdown()void
closeOverdueDelayDropdowncloseOverdueDelayDropdown()void
closeDropdowncloseDropdown(e: undefined)void
traceInvoicesDropdownPeriodtraceInvoicesDropdownPeriod(periodId: number)string
keyDownkeyDown(e: DxNumberBoxTypes.KeyDownEvent)void
submitChangessubmitChanges()void
saveBookingRulesInConfigurationsaveBookingRulesInConfiguration()void

Properties

PropertyType
sharedPopupSharedPopupComponent
PurchaseInvoicesDropdownElementRef
SalesInvoicesDropdownElementRef
CommInvoicesDropdownElementRef
OverdueDelayDropdownElementRef
_widgetWidget
_widgetTypestring
yearIdnumber
periodIdnumber
countOfEditablePrevMonthsnumber
withoutOptionBarboolean
editModeboolean
viewModeIdnumber
viewModeEnumany
cashFlowDisplaynumber
bookingOrSalesnumber
byGroupsboolean
isPamsDataboolean
selectedTeamnumber
CashFlowYearIdnumber
CashFlowMonthIdnumber
forecastRuleIdnumber
dataBranchData
allowedtoEditboolean
allowedtoEnableEdtingboolean
widgetEditRequestany
widgetViewRequestany
widgetEditEndany
forecastRulesany[]
currenciesCompanyCurrency[]
selectedYearnumber
currentMonthIndexnumber
diffnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
originalDataBranchData
selectedDataBranchData
monthsSummeryMonthsSum[]
branchCurrencyany
salesCurrencyany
basedOnTendencyboolean
SeriseRangeany[]
echartsIntanceany
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets
totalProfitAndLossAmountnumber
totalOthersnumber

Where it refuses work

  • MrmCashFlowForecastedComponent stops the work with an early return when this.dashboardLibraryService.checkFeatureSubscription(this.widget.chartEnumId).
  • MrmCashFlowForecastedComponent stops the work with an early return when findMonthIndex > -1.
  • MrmCashFlowForecastedComponent stops the work with an early return when MonthId == 12.
  • MrmCashFlowForecastedComponent stops the work with an early return when month[propertyName] < this.data.BanksSummary[monthIndex - 1][propertyName].
  • MrmCashFlowForecastedComponent stops the work with an early return when month[propertyName] < this.data.ReceivablesSummary[monthIndex - 1][propertyName].
  • MrmCashFlowForecastedComponent stops the work with an early return when month[propertyName] < this.data.PayablesSummary[monthIndex - 1][propertyName].

Diagram

mermaid
graph LR
  A[ngOnInit / ngOnChanges] --> B[checkFeatureSubscription]
  B --> C[getReportSetting]
  C --> D[getDashboardData]
  D --> E[getDashboardDataByMonth]
  E --> F[fillMonthsSummery]
  F --> G[initalizingData]
  G --> H[disableEditingInPrevMonths]
  H --> I[saveDashboardData]

Usage

ts
import { MrmCashFlowForecastedComponent } from './mrm-cash-flow-forecasted.component';

// Example from an Angular test or configured component fixture.
const component = fixture.componentInstance as MrmCashFlowForecastedComponent;

component.ngOnInit();

if (component.checkFeatureSubscription()) {
  component.getDashboardDataByMonth();

  // After updating forecast values through the widget UI:
  component.saveDashboardData();
}

AI Coding Instructions

  • Keep dashboard loading logic aligned with ngOnInit and ngOnChanges so the widget refreshes when its inputs change.
  • Check checkFeatureSubscription() before requesting or saving forecast data that depends on subscription access.
  • Call getReportSetting() before preparing data that depends on report configuration.
  • Preserve the edit restrictions applied by disableEditingInPrevMonths() when changing month or forecast input behavior.
  • Update monthly summary data through fillMonthsSummery() after loading or changing dashboard values.

Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (2)

  • DashboardWidgetsModuleFrontend/src/app/components/dashboard/dashboard-widgets.module.ts:1
  • ReportsTabComponentFrontend/src/app/components/reports/reports-library/reports-tab/reports-tab.component.ts:1

Was this page helpful?

Download as PDF