Home / Sankhya work

Controlling, Oracle PL/SQL, 2026

Management P&L inside the ERP

Controlling built the income statement outside the system because the standard report did not compare years, forecast or drill from an account down to entries. I built the P&L as a Sankhya dashboard, in two versions for different clients: a professional services firm, with comparison and forecasting, and a company that sells goods, with cost of goods sold and a choice between cash and accrual basis.

2implementations
Oracle PL/SQLRecursive CTE, analytic functions, dashboards
CodeAccountAmountShare
1000Net income (=)R$ 84,210.008.42%
1100Gross profit (=)R$ 312,540.0031.25%
1110Net revenue (=)R$ 1,000,120.00100.00%
1120COGS (−)R$ −691,900.0069.18%
1200Operating expenses (−)R$ −228,330.0022.83%
1210AdministrativeR$ −131,050.0013.10%
1220SellingR$ −97,280.009.73%

Illustrative amounts and chart of accounts. Each line opens a second level with the receivables, payables and invoices behind it.

What the P&L does

Structure

P&L structure as master data, with drill-down

Accounts and their links to expense categories and cost centers live in tables the users maintain themselves. New accounts are added through the screen, without touching the query. Any line opens the documents behind it, and the detail adds up to the total clicked.

Comparison

Two years side by side and a forecast for the next

Actuals for two fiscal years with vertical and horizontal analysis, plus a monthly view with month-over-month change. The forecast uses a percentage over the prior year or an entered amount, and totals roll up already calculated.

Basis

Cash or accrual without distorting operations

Switching the basis changes expenses, which follow the payment or transaction date, but keeps revenue, returns and COGS. Gross profit stays stable.

Cost

COGS for sales and returns per invoice

Cost comes from confirmed invoices, using the cost type chosen in the dashboard (average, replacement, management). Rounding is done per invoice, so the levels add up without cent differences.

Consistency

Each entry lands in a single account

When the expense category and cost center pointed to different accounts, the same amount was counted twice. A priority rule now picks a single destination for each entry, including allocated ones.

Validation

Reconciled with tax records and accounting

The P&L went through external validation. The gap with the tax ledger was traced to entries classified under the wrong category, fixed at the source rather than hidden in the query. Actuals were checked against the revenue report the company already used.

  • A checklist of six queries the client's IT team runs; the expected result is zero for all of them.
  • Technical documentation, a report for management and accounting, and an adjustment guide for the internal team.

Results

What the dashboard guarantees today.

Totals that add up

The detail sum equals the dashboard line, including COGS.

No double counting

Every entry, allocated or not, lands in a single account.

Consistent basis

Cash and accrual change expenses and keep gross profit intact.

Off the spreadsheet

Comparison, forecasting and monthly analysis come straight from the ERP.