DECCF · Cash Flow Modeler and Calculator

Compose a business base forecast with function methods

The Business base forecast pack composes reusable sections under a shared owner, schedule, and optional trigger. It provides sales and operating-cost accruals plus opening-asset depreciation. See the pack reference for the complete options and account roles.

The named openingEquipment section inherits the company, monthly schedule, and SIE trigger. Its life estimate uses account history gathered internally after the trigger. No caller-created history argument is needed.

Choose a ready-made calculation

Use the formulas collection when a standard rule fits. Formula methods take their configuration once and return a function that receives one enriched context. The context carries the engine readers and context.forecast facts such as the owner, section, accounts, history, and current period values.

The collection also contains reusable methods for VAT splitting, day-based working-capital targets, settling receivables and payables, capital expenditure, facility funding, interest, and tax. These methods take period data from context.forecast.values; for example, receivable settlement expects openingReceivables, invoices, and receivableTarget. Each input reference used by a formula is exposed as a precondition and appears under the named section in the model input schema.

Forecast from monthly history

For methods based on posted account activity, use the trend formulas. They read actual monthly account postings from the selected owner's forecast history, so there is no separate history argument to build.

weightedMovingAverage() emphasizes recent months and uses linear weights by default. linearRegression() extends a fitted line into the forecast period. linearOrWeightedAverage() accepts the trend only when its in-window normalized RMSE is within the configured limit; it otherwise uses the weighted average. The default threshold is 20% of mean absolute activity. Regression requires six non-zero observations by default; the weighted fallback requires three, controlled separately by minimumObservations and minimumWeightedObservations. exponentialSmoothing() is useful when recent levels matter more than a fitted trend, while seasonalSameMonthAverage() uses prior values from the same calendar month.

All trend methods take an account-plan role and a window length. They require multiple non-zero observations; sparse periods, including a single annual snapshot, fall back to the average over the covered history. The history view reports actual monthly postings and does not fill missing months or invent a seasonal pattern. These methods are starting points; compare the selected method with the source accounts and the business's known seasonality before using the forecast.

Add a custom calculation method

Method choice is expressed as a function. For example, use the selected asset-account balance and annualized depreciation expense, with a fallback when the source does not contain depreciation postings:

An input.integer(5) can be used directly for a simple fixed useful life. The input then appears automatically under the section's dotted name, such as forecast.openingEquipment.openingAssets.remainingLifeYears. The built-in estimator also exposes an input used for fallbackYears. A custom method that reads inputs through context.get() can list those references under openingAssets.preconditions; functions' closed-over values cannot be inferred from JavaScript source.

The built-in remainingLifeFromHistoricalDepreciation() applies the same portfolio-level idea with configurable minimum, maximum, and fallback years. It does not replace an asset register; assets with different expected lives should use separate named sections or a custom method that distinguishes them.

Choose a complete forecast template

businessForecast() creates an account-plan-based forecast component with standard sales and cost sections. The model can start from a straightforward average, editable growth assumptions, a downside case, a historical trend, an automatic history-based choice, or an industry profile.

The template can be straightforward, growth, downside, historical, automatic, or industry. Growth and downside templates accept growth and costGrowth as numbers or rate inputs. The automatic template uses linear regression when at least six non-zero months exist and normalized RMSE is no more than 20%; it falls back to a weighted average with at least three non-zero months, then to 2% annual growth when history is too sparse.

For an industry-based starting point, choose industry. The SNI 2025 input is a dropdown of two-digit main groups. It defaults from company.attributes.sni when supplied. Leave it blank to infer a broad profile from the company's historical account mix, or set an explicit starting value with input.sni("47"). Current profiles cover retail and wholesale, real estate, professional services, and manufacturing, with other groups using general business rules. This is a broad forecast heuristic; review the resulting assumptions for the specific company.

The component supplies common sales, cost-of-goods, premises, other operating-cost, and personnel sections. It finds matching owner accounts or creates accounts from standard account codes, so the model does not need to declare them unless it needs opening balances or custom names. sections can replace any default section or add another named section. The component also takes schedule and optional triggeredBy, so a historical statement can activate the whole forecast. For full account selection behavior and examples, see the Business base forecast pack reference.