Technical documentation

How accounting and payroll work in Macct

Macct handles accounting and payroll under Norwegian rules — NS 4102, the Bookkeeping Act, the Accounting Act, NRS, the Tax Act, the National Insurance Act and the A-melding standard. Every krone can be traced from a report down to a voucher line and back. This page shows how: the calculations, the controls and the postings — with real examples.

Double-entry bookkeeping NS 4102 chart of accounts SAF-T export VAT return Business specification / tax return A-melding Audit trail

Deterministic accounting rules — not "magic AI"

First things first: no posting in Macct is guessed by an AI. Artificial intelligence is used to suggest account coding, read receipts (OCR) and automate routine work — but the accounting itself follows fixed, deterministic rules. A suggestion never becomes a posting until a human approves it, and once it is posted it is the same double-entry logic as in any serious accounting system.

The guarantees underneath it all:
  • Double-entry bookkeeping is enforced. Every voucher must balance (sum of debits = sum of credits) and have at least two lines — the system refuses to save anything else. This is not a warning, it is a hard block.
  • AI suggests, the human decides. Coding suggestions (rule-based or model-based) are presented for approval. Account, VAT code and amount are shown before anything is posted.
  • Everything is traceable and explainable. Every posting has a voucher with a date, voucher number, counterparty, who entered it and when. Posted vouchers are immutable (Bookkeeping Act § 9) — corrections are made by reversal, not deletion.
  • Everything can be inspected. From a report line the path leads to the general ledger, to the voucher, to the individual voucher line. Payroll calculations show each component.
  • Controls and validations prevent classic errors. Period locks, VAT term locks, balance enforcement, reconciliation jobs and preflight checks before submission stop errors before they become accounting records.
Part 1 · Accounting

1. Double-entry bookkeeping — the foundation

Everything in Macct is built on double-entry bookkeeping. A voucher consists of two or more lines, each line is posted to one general-ledger account (NS 4102), and the sum of debits always equals the sum of credits. The voucher nets to zero. The system enforces this at several levels — in the application, and with a database trigger that blocks unbalanced vouchers and any change to posted vouchers.

Control: a voucher that does not balance cannot be saved. Amounts in foreign currency are converted to NOK (rate × amount ÷ conversion factor) and the NOK twin is stored pre-calculated, so the general ledger is always in NOK.

Each voucher line carries a general-ledger account, an amount (debit or credit), an optional VAT code, and optionally a cost center and project. VAT is calculated deterministically from the VAT code — never guessed.

2. General ledger, sub-ledgers and reports all connect

The vouchers are the single source of truth. Everything else is a view of the same postings:

Voucherdebit = credit
→
General ledgerper account
→
Trial balanceall accounts
→
Income statement & balance sheetNS 4102 sections

The sub-ledgers (customers on 1500, suppliers on 2400) are per-partner views of the same voucher lines. A nightly reconciliation job compares the sum of open items per partner against the balance in the general ledger — if they drift apart, it is flagged.

Control: sub-ledger = general ledger. The discrepancy job runs automatically every night, and can be triggered manually. Realised exchange differences (agio/disagio) are handled as separate lines (8040/8150) when a foreign-currency invoice is paid at a different rate than it was booked at.

What is a sub-ledger?

A sub-ledger is one general-ledger account specified per counterparty. The general ledger says receivables are NOK 240,000; the customer sub-ledger says which customers they are spread across, which invoices are open, and for how long. Macct has three sub-ledgers, built on the same principle:

Customers
→
Customer sub-ledgeraccount 1500, per customer
→
General ledgerthe total
Suppliers
→
Supplier sub-ledgeraccount 2400, per supplier
→
General ledgerthe total
Employees
→
Employee sub-ledger2930 / 2940 / 2600, per employee
→
General ledgerthe total

The employee sub-ledger is built on the same premise as the other two: the payroll voucher is posted per employee on salary owed (2930), holiday pay owed (2940) and tax withholding (2600), and the sub-ledger reads the general ledger back per person — what the company owes each individual, and what has been withheld from them. The payment debits the same accounts per employee, so the balance reaches zero for the person who actually received the money. A separate nightly job checks that the entire account balance is allocated to a named employee.

3. Accruals and provisions

Costs and revenues belong in the period they relate to. Provisions whose pattern the system knows — holiday pay, employer's national insurance contributions and tax — Macct calculates and posts automatically (see payroll and year-end closing below). Plain accruals, such as a prepaid insurance, are entered as ordinary vouchers on the same principle:

Example: prepaid insurance

A company pays NOK 12,000 for a full year's insurance in January. The cost belongs to twelve months, not to January alone.

EventAccountDebitCredit
Payment (January)1700 Prepaid cost12 000
1920 Bank12 000
Accrual (each month × 12)6300 Insurance premium1 000
1700 Prepaid cost1 000

The income statement is charged NOK 1,000 per month; the remainder sits as an asset (prepaid) until it is expensed.

The matching principle, Accounting Act § 4-1. Provisions per generally accepted accounting principles (NRS 8 for small entities).

4. VAT reconciliation and term settlement

VAT is calculated per voucher line from the VAT code (SAF-T standard codes). Output VAT is booked split by rate — 2710 (25%), 2711 (15%), 2712 (12%) — and input VAT on 1610. The VAT return is code-based: basis and tax are summed per code for the term, the way the Norwegian Tax Administration expects.

Example: VAT settlement for a term
ItemAmount
Output VAT, 25% (account 2710)50 000
Input VAT, deduction (account 1610)− 12 000
To pay (VAT payable)38 000

The settlement zeroes the VAT accounts for the term and posts the net against the settlement account 2740:

AccountDebitCredit
2710 Output VAT50 000
1610 Input VAT12 000
2740 VAT settlement account (payable)38 000
Total50 00050 000
Control — VAT term lock: once the settlement for a term is posted, the term is locked. New vouchers with a VAT code in the settled months are rejected — otherwise the VAT basis would change after the return has been filed. If the settlement is reversed, the lock is lifted automatically so the term can be run again. SAF-T import also respects this lock.

The VAT Act; bimonthly reporting (6 terms/year) as the general rule.

5. Bank reconciliation

Bank transactions are imported (CSV/PDF, or automatically via PSD2) and matched against the accounting records. Macct suggests coding based on reconciliation rules — the transaction text, direction (in/out) and amount range — but never posts automatically: the suggestion goes to the inbox for approval. Unambiguous matches (a KID or invoice number that matches an open invoice, with the right amount) are proposed as a payment and reconciled against the sub-ledger on approval.

Control: bank import always produces suggestions, not finished postings. The currency is read per transaction and the NOK amount is calculated using Norges Bank's rate for the transaction date. This way the reconciliation catches everything that lacks a voucher.

6. Year-end closing and period locks

Year-end closing is a fixed routine with controls at every step — not a "press the button and hope" operation:

NRS 8 validationChecks that the entity is within the thresholds for small entities.
Depreciation checkBlocks if fixed assets have a depreciation basis that has not been posted.
Calculate resultThe income statement for the year.
Tax expense22% for an AS, from the taxable basis (see below).
AllocationResult to equity (8800 → 2050), and any dividend (2800).
Lock periodsAll 12 periods are set to "closed".
Control — period lock: a closed period is blocked for new vouchers (enforced by a database trigger). Reopening is blocked once the tax return or annual accounts for the year have been filed, and is recorded in the security log. The opening balance for the new year is generated from last year's closing balance, with a reconciliation check.

NRS 8 (generally accepted accounting principles for small entities); Companies Act § 8-1 for dividends; Accounting Act § 4-3 (congruence) for opening/closing balances.

7. Tax expense, tax payable and differences

For a limited company (AS) the tax is calculated on the taxable result — not the accounting result. The difference consists of permanent and temporary items, tracked in the business specification. Macct calculates and posts tax payable (8300 → 2500) from this basis.

Example: tax calculation at year-end closing (AS)
ItemAmount
Profit before tax (accounting)500 000
+ Permanent difference (non-deductible, e.g. entertainment over the limit)20 000
− Temporary difference (excess tax depreciation, declining balance > straight-line)− 50 000
= Taxable result (basis for tax payable)470 000
Tax payable, 22%103 400

Posting:

AccountDebitCredit
8300 Tax expense103 400
2500 Tax payable103 400

Temporary differences and deferred tax

The temporary difference of NOK 50,000 (tax depreciates more this year, but the difference reverses later) represents a deferred tax of 22% = NOK 11,000. Macct tracks all temporary differences in the business specification, so they are visible and verifiable. The posting of deferred tax / deferred tax assets itself is an accounting judgement that small entities can often simplify (NRS 8) — so Macct posts tax payable and keeps the differences visible in the basis, rather than guessing at a balance-sheet entry that has not been decided. The differences are laid out when they need to be assessed.

The Tax Act (ordinary corporate tax 22%); NRS 8 and Accounting Act § 6-2 on simplification for small entities.

8. Business specification and tax return

The business specification and the company's tax return are built from the posted figures — the accounts are mapped to the tax-return fields via an explicit mapping (never guessed). The flow is a strict four-eyes workflow with an integrity check:

DRAFTA draft is generated from the accounting records + the business specification.
READYMarked ready for review.
APPROVEDApproved (with a justification) by a human.
SUBMITTEDSent to Altinn — manually only, never automatically.
Control: at every step a SHA-256 hash of the data basis is verified, so nothing changes unseen between approval and submission. A preflight check runs before submission (status APPROVED, approval and justification in place, valid org. number, and the accounting year closed). Unmapped accounts with a balance are logged as a warning — they do not disappear silently. The tax return is never submitted automatically.

Submission via Altinn 3 / Maskinporten. The XML is validated against the Norwegian Tax Administration's official XSDs per income year.

9. Traceability and audit trail

  • Immutability: posted vouchers cannot be changed or deleted (Bookkeeping Act § 9) — enforced by a database trigger. Corrections are made by reversal, which mirrors the original voucher with the opposite sign and links the two together.
  • Consecutive voucher numbers per company and year, with no gaps.
  • Security log: sensitive events (reopening a period, replacing the opening balance, IDOR attempts) are written to an audit log that the database refuses to change or delete (append-only, also when the other triggers are bypassed with replication mode).
  • Event log on the tax return and annual accounts: who did what, when, and the data hash at each step.
  • SAF-T export (Financial v1.40) with real opening and closing balances per account and partner — ready for a tax audit.
Part 2 · Payroll

10. Payroll run step by step

A payroll run is deterministic: the same basis yields the same figures, every time. The run is idempotent per company, year and month.

BasisActive employees, fixed salary, tax card, contribution zone, pension setup.
VariableOvertime, bonus, benefits in kind and approved travel expenses are pulled in.
Calculate per employeeGross → tax withholding → net, holiday pay, employer's contributions, OTP.
PostOne balanced payroll voucher is generated automatically.
A-meldingBuilt for manual submission to Altinn.

Each pay slip shows the components individually, so the calculation is verifiable down to the krone.

Employee
→
Payrollgross → net
→
Postingone voucher, per employee
→
Employee sub-ledgerbalance per employee
→
Paymentthe balance reaches zero

The employee sub-ledger gives an overview of the money between the business and each employee: salary, holiday pay, travel expenses and deductions go in, the payment goes out, and the balance per employee shows what remains — per date, with the history behind it.

11. Tax withholding

The withholding follows the employee's tax card:

  • Percentage card (prosentkort): the same percentage every month, including June and December.
  • Table card (tabellkort): withholding per the Norwegian Tax Administration's official withholding table (the withholding routine), with a withholding-free June and half the rate in December.
  • Exemption card (frikort): 0% withholding up to the exemption card's amount limit. The limit is read from the tax card; when the year's accumulated pay passes it, 50% (the missing-tax-card rate) is withheld on the excess, with an alert to obtain a new tax card.
Control: the tax withholding can never exceed the cash salary (Tax Payment Act § 5-10) — benefits in kind inflate the withholding basis, but the withholding is capped so net pay does not go negative.

The Tax Payment Act; withholding tables from the Norwegian Tax Administration. The June/December adjustment applies only to table cards (Tax Payment Regulation § 5-7-1).

And afterwards: on Deductions and payments, Macct shows what the Norwegian Tax Administration has registered as open — withholding tax, employer contributions and other claims, with due dates, estimated interest and remaining balance, fetched directly from the Tax Administration. When the Tax Administration has allocated your payment, the claim drops off the list.

12. Employer's national insurance contributions

Employer's contributions (AGA) are calculated on the contribution basis — cash salary + holiday pay + benefits in kind + the employer's pension premium (National Insurance Act § 23-2) — at the rate for the employee's zone. The rates are date-driven and read from a versioned, approved rule set. Zone 1a uses the exemption-amount tier: a low rate until the contributions saved compared with the zone 1 rate reach the exemption amount, then the zone 1 rate — accumulated correctly across the year and across payroll runs.

How are employer's national insurance contributions calculated? Zone 1 (Oslo/central areas) has a rate of 14.1%. Basis NOK 56,000 × 14.1% = NOK 7,896. In district zones the rate is lower, and in the incentive zone (zone 5) it is 0%. The contribution is reported on an ongoing basis; holiday pay is included in the basis in the accrual year (the provision method, which the Norwegian Tax Administration allows).

13. Holiday pay

Holiday pay is accrued on an ongoing basis from the holiday-pay basis — 12% by default (4 weeks' holiday + the collectively agreed week), per employee. The provision is booked as a cost (5020) against holiday pay owed (2940), and is included in the contribution basis in the accrual year. When the holiday pay is paid out the following year, the provision is settled.

Control: table-card holiday pay from previous years is withholding-free (Tax Payment Regulation § 5-7-1), but percentage cards must have withholding on holiday pay too, and a same-year payout (typically on termination) is subject to withholding. Macct handles each case correctly.

14. OTP basis (occupational pension)

When mandatory occupational pension (OTP) is enabled, the premium is calculated from the pension basis per employee (with optional inclusion of holiday pay), and booked as an employer cost. The employer's pension premium is part of the contribution basis (National Insurance Act § 23-2 fourth paragraph) — both when posting and in the A-melding. Employees who are not pension members are flagged in the run.

15. Benefits in kind, travel expenses and outlays

Benefits in kind

Taxable benefits in kind (a company car, free phone and the like) increase the withholding and contribution basis, but are not paid out in cash. The valuation comes from an approved rule set — if the rate is not approved, a manual amount is required.

Travel expenses and outlays

Travel expenses are handled per the government rates (subsistence and mileage), and split into a withholding-free part (paid out tax-free, increasing net pay) and a withholding-liable part (the difference against the tax-free rate — into the tax and contribution basis, but not the holiday-pay basis). Approved travel expense claims are pulled into the payroll run automatically — whether payroll is run directly or via the draft flow — and marked consumed when posted so they are not included twice.

16. Sick pay and the employer period

In the event of sick leave, Macct calculates the employer period of 16 calendar days (National Insurance Act § 8-19): the first 16 days are covered by the employer, days beyond that are NAV's responsibility and eligible for reimbursement. Sick-pay reimbursement from NAV is booked (debit 1575 / credit 5800), so the payroll cost in the accounts reflects what the employer actually bears.

National Insurance Act § 8-19 (the employer period).

17. Postings from a payroll run — a complete example

Here is how a payroll run fits together, end to end. One employee, fixed monthly salary NOK 50,000, percentage card 30%, zone 1:

Calculation per employee
ComponentAmountBasis / rate
Gross salary50 000Fixed monthly salary
Tax withholding− 15 000Percentage card 30%
Net salary (paid out)35 000
Holiday pay provision6 00012% of 50 000
Employer's contributions7 89614.1% of (50 000 + 6 000)
The payroll voucher generated automatically
AccountTextDebitCredit
5000Salary50 000
2600Tax withholding (owed)15 000
2930Salary owed (net)35 000
5400Employer's contributions7 896
2670Employer's contributions owed7 896
5020Holiday pay provision6 000
2940Holiday pay owed6 000
Total (the voucher balances)63 89663 896

Voucher type "manuell", generated in full by the payroll run. Every line can be inspected, and the slip shows the components per employee.

Control: the payroll voucher always balances (here 63,896 = 63,896). Tax withholding, employer's contributions and holiday pay stand as owed until they are settled — net to the employee (2930), withholding and contributions at the term settlement (the 15th of the following month), holiday pay the following year.

18. A-melding, term settlement and reconciliation against the accounts

A-melding

The A-melding is built from the payroll run — income per recipient, tax withholding and employer's contributions per zone — ready for submission to Altinn. It is never submitted automatically. A step-by-step guide shows the flow: download → altinn.no → upload → check and send.

Term settlement

Employer's contributions are paid on the 15th of the month after the end of the term (Tax Payment Act § 10-10). From 1 January 2026, withheld tax is paid directly to the Tax Administration no later than the first business day after the salary payment (the separate withholding account is abolished). These, and the VAT and advance-tax deadlines, are in the deadline calendar.

The payment itself is made in your online bank, with a KID to the Tax Administration's account 7694 05 24802. Macct computes the KID following the Tax Administration's structure (a new KID per month for withheld tax, one per term for employer's contributions) and puts the amount, KID, account and due date ready under «Deductions and settlement» — with a copy button. When the bank row arrives, the payment is registered and reconciled against the voucher in one click, and accounts 2600 and 2670 net to zero. The a-melding feedback is used to check that the KID matches the Tax Administration's.

Reconciling payroll against the accounts

Because the payroll voucher is generated directly from the run, payroll and accounting agree by construction: gross salary on 5000, tax withholding on 2600, employer's contributions on 5400/2670, holiday pay on 5020/2940. The totals on the payroll run are the same as in the A-melding and in the general ledger — there is no "shadow ledger".

The same holds per employee: the employee sub-ledger reads 2930, 2940 and 2600 back from the general ledger, person by person, and shows how much of the account balance is allocated to an employee — and how much is not.

Which accounts does the payroll module use?
AccountUse
5000Salary (cost)
5020Holiday pay provision (cost)
5400Employer's contributions (cost)
2600Tax withholding owed
2670Employer's contributions owed
2930Salary owed (net)
2940Holiday pay owed
1575 / 5800Sick-pay reimbursement from NAV

A complete Norwegian accounting and payroll system

Macct covers journal entries, invoicing, VAT, banking, year-end closing, the tax return, payroll and the A-melding — with the same controls a serious accounting system demands. AI gives you speed; the rules keep the accounts safe.

Try free for 30 days See the demo

Read also: Accounting deadlines · What is a voucher? · Meets the legal requirements · Rules & laws · Keep the books yourself