Finance · Monthly results

Automated P&L (DRE)

The month's management P&L built from ERP entries, using finance's chart of accounts, matching the official close and without closing the month by hand.

UsageWidely used
EffortMedium
ForFinance, controllership and leadership at companies that close the month's results in a spreadsheet built from the ERP.
Source

ERP entries, categories and cost centers

Rule

Mapping to the management chart, sign, allocation and status

Outcome

Monthly P&L with margins and EBITDA

Activation

Month-end close, budget vs actual and AI agent

What it solves

  • The month's P&L builds itself and matches the number finance presents.
  • Every real booked in the ERP lands on a management line, and anything unclassified shows up instead of disappearing.
  • Accrual and cash stop being mixed in the same report.

Business questions it answers

Ask your agent these questions once the case is live.

What were net revenue, gross margin and EBITDA in the last closed month?
Why did the margin drop compared with the previous month?
How much did we spend on people, technology and marketing per month this year?
Which entries still have no management classification?
How does the quarter's actual compare with the budget?

What you need

  • Finance ERP connected to Nekt (entries, categories and cost centers)
  • Finance's management chart of accounts and the mapping from each ERP category to a P&L line
  • One closed reference month to validate the number

What you get

  • A table per entry and allocation, already classified on its management line
  • The monthly P&L with margins, EBITDA and comparison with the previous month and the budget
  • A to-do list of whatever still has no mapping
  • An AI agent that answers about results using finance's rules

Where to activate

Month-end close

Monthly P&L with comparisons and the classification to-do list before closing.

AI agent via MCP

Answers about results and margins using closed months only and finance's rules.

Alerts

Notice when an entry lands in Unclassified or when a line deviates from budget beyond the limit.

Ready to build?

The rules are well known, but the chart of accounts mapping has to be built once with finance and validated against a closed month. The detailed view has the business rules, the pitfalls and the acceptance test. Or send everything straight to your agent with the Nekt MCP.

The problem

The ERP has entries with category, nature and status, but not the P&L leadership uses. Whoever sums by ERP category mixes accrual with cash, counts cancelled and replaced bills as expenses, multiplies values when opening allocations and treats transfers between accounts as results. The month closes with a margin different from the one finance presents, and nobody knows which is right.

How it is usually done, and the rule

Each row is a mistake that already happened in practice.

The common wayThe rule
01
Adding the accrual view and the cash view in the same report.
The P&L is on accrual, cash is on payment

The P&L uses the entry's accrual date (or the bill's issue date). The cash flow uses the date of the actual settlement. They are two tables and two different questions, never added together. If the ERP has no reliable accrual date, choose which date replaces it (issue or due date), write the choice in the context document and keep the criterion every month.

02
Using the P&L configured in the ERP or grouping by parent category without validating.
The management chart comes from the mapping, not the ERP structure

Each ERP category points to a management line (gross revenue, deductions, costs, variable expenses, operating expenses, financial result) in a mapping table kept by finance, usually a connected spreadsheet. The P&L structure configured inside the ERP is often outdated or was never used. When there is an official P&L made by controllership or an outside consultancy, the automation reproduces that number and does not invent new criteria.

03
Filtering out unmapped entries or letting the join drop the row.
Anything without a mapping shows up, never disappears

A new or unmapped category lands on an Unclassified line, visible in the P&L, and goes to a to-do list with amount and description. The transformation does not fail and does not drop the entry. The goal is a zero line at close.

04
Flipping the sign in the transformation and again in the dashboard.
Sign applied once

Revenue positive, cost and expense negative, applied from the entry's nature (in Omie, R adds and P subtracts). If the column already comes signed, do not flip it again. The month's result is the sum of all lines for that accrual month.

05
Exploding the category list and summing the full amount on each one.
Allocate by percentage, one line per allocation

An entry can be split across several categories and cost centers. Create one line per allocation with amount = entry amount x percentage / 100; a null percentage counts as 100%. The allocation lines must add back to the entry amount. Opening the category list without the percentage repeats the full amount on every line.

06
Summing every bill and every settlement in the period.
Status and operation type decide what counts

Cancelled is out. A renegotiated bill that the ERP zeroes and replaces with new installments is out, and the new installments are in. For expenses, actual is the paid amount, not the bill's total. Bill movements such as replacement, cancellation and rescheduling are not costs: only payment and advance count. Summing every operation type inflated paid expenses by 30% to 50% in real cases.

07
Classifying transfers, contributions and loans as revenue or expense.
Moving money is not a result

Transfers between own accounts, investments and redemptions, shareholder contributions, loans taken or repaid, advances and the corporate card bill payment change cash, but are not revenue or expense. They stay out of the P&L and appear only in the cash flow. Movements between bank and investment accounts must be computed per entry so both sides cancel out.

08
Adding ERP revenue to gateway revenue.
One source per revenue

Define which system is the revenue source: the ERP, the billing system or the invoice. Payment gateways and platforms are collection channels and only serve as a check. Adding ERP revenue to gateway payments counts the same sale twice.

09
Booking the month's merchandise purchases as cost.
Cost of goods enters in the month of sale

In retail and manufacturing, COGS is the cost of the items sold in the month (quantity sold x item cost), not the month's purchases, which go to inventory. In services, the cost of services follows the service's accrual month. Payment fees, commissions and freight are variable expenses and sit between gross margin and contribution margin.

10
Comparing the partial current month with closed months or recalculating the past on every run.
A closed month is flagged and does not change

Each month has a closed flag, set when finance finishes the close. Actuals, comparisons and board reports use closed months only; the open month is partial and labeled provisional. Once closed, the month is stored in a version that is not recalculated, and adjustments found later go into the month in which they were found.

The management P&L structure

Each ERP category points to one of these lines through finance's mapping.

Sales, services and recurring revenue, on accrualGross revenue
Sales taxes, returns and cancellationsDeductionsnet revenue = gross - deductions
Cost of items sold or services renderedCOGS or cost of servicesgross margin = net - COGS
Commissions, freight, payment fees, mediaVariable expensescontribution margin
People, admin, technology, fixed marketingOperating expensesEBITDA
Interest, investment income, bank feesFinancial resultprofit before taxes
Category without a mappingUnclassifiedgoal: zero at close
Transfers, investments, contributions, loansOutside the P&L, cash only

Definitions

Gross revenue
sum of operating revenue entries mapped to gross revenue, by accrual month, excluding cancelled
Net revenue
gross revenue minus deductions (sales taxes, returns and cancellations) in the same accrual month
COGS or cost of services
cost of the items sold in the month (quantity x item cost at sale) or cost of services rendered with accrual in the month
Gross margin
net revenue minus COGS or cost of services; as a percentage, divide by net revenue after summing the period
Contribution margin
gross margin minus variable expenses (commissions, freight, payment fees, media), per month
EBITDA
contribution margin minus operating expenses, before depreciation, interest and income taxes, by accrual month
Profit before taxes
EBITDA plus financial income minus financial expenses; if income taxes (IRPJ and CSLL) are not computed, the figure is always labeled as before taxes
Unclassified
sum of the month's entries with no mapping to a management line; goal is zero at close

Pitfalls that already happened

The ERP's P&L was never used

The P&L structure configured in the ERP had the average cost line set to hidden and purchases tied to the cost line. Showing both would count cost twice.

Reproduce finance's official P&L and treat the ERP's only as a reference.

Opened categories multiplied expenses

Entries with three or four categories were opened without the allocation percentage, and each category got the entry's full amount.

Use the allocation percentage and test that the lines add back to the entry amount.

Replacements counted as cost

Bill replacement and cancellation settlements were summed as payments, and paid cost per cost center came out 30% to 50% above the ERP report.

Count only payment and advance as paid expense.

Revenue counted twice

Revenue came from one system and gateway payments were added to it, as if they were more revenue.

Declare the official revenue source and use the gateway only as a check.

Current month with a high margin

The cost of services is booked after the month in which the service happened, and for about 30 days the current month's P&L showed low cost and a high margin.

Flag the month as provisional until close and compare closed months only.

Invoice tax duplicated across items

Tax totals come at invoice level. Working at item grain, the invoice total repeated on every item and inflated deductions.

Sum invoice-level values at invoice grain, and only then join with items.

Acceptance test

The case is done when every item passes.

Agent package

Paste into Claude, ChatGPT or any client with the Nekt MCP connected.

Full Markdown
Management P&L (DRE)
- The P&L is on accrual (accrual date or, if missing, <declared date>). Cash flow is by payment date and lives in another table. Never add the two views.
- Structure: gross revenue, deductions, net revenue, COGS or cost of services, gross margin, variable expenses, contribution margin, operating expenses, EBITDA, financial result, profit before taxes.
- Each ERP category goes to a line through finance's mapping. Unmapped categories go to Unclassified; mention that line whenever it is not zero.
- Sign: revenue positive, cost and expense negative, applied once.
- Allocation: amount x percentage / 100 per category and cost center; a null percentage counts as 100%.
- Excluded from sums: cancelled, renegotiated bills that were replaced, replacement and cancellation settlements.
- Transfers between accounts, investments, contributions and loans are not results.
- Official revenue comes from <source>. The payment gateway only checks.
- Use only months flagged as closed for actuals and comparisons. The open month is provisional and must be called that.
- Margins and percentages: sum the period and divide once; never average monthly percentages.
- If income taxes are not computed, say profit before taxes.
Client exceptions:
- <client>: the official P&L is the one from consultancy <name>; reproduce its number.
- <client>: category <category> is allocated across business units by <driver>.

Variations

Several companies

One ERP connection per CNPJ (company tax ID), joined with a company column and with transfers between group companies eliminated.

Budget vs actual

The budget comes in as a table by month and management line, with the budget version frozen and its source declared.

Finance outsourcing

The same model replicated per client, with each client's connection declared in the context document.