Skip to content
Fin Pünjer AI Workflow Consulting

AI automation

AI in Bookkeeping: Why My AI Classifies but Never Posts

How an AI-supported bookkeeping system for a Spanish S.L.U. is built: the AI reads and categorises, a deterministic engine posts, and a human confirms every entry.

Fin Pünjer By Fin Pünjer · 5 min read

Bookkeeping is the textbook example of AI automation: lots of documents, recurring patterns, clear rules. That is exactly why it is also a good example of where the line should be drawn.

For my own company, a Spanish S.L.U. in Mallorca, I replaced standard accounting software with my own AI-supported tool: Puenjer Books. It follows the Spanish chart of accounts for small and medium-sized companies (PGC Pymes) and has been in production since Q2 2026.

The most important design principle is written as a comment in the code: the AI classifies, the engine posts.

Note: this article describes the architecture of a tool. It is not tax advice.

The pipeline in six stages

Every receipt goes through the same chain:

  1. Capture – the receipt is read in, as a PDF or photo.
  2. Classification – a language model reads the receipt and proposes account, tax type and contra account.
  3. Posting – a deterministic engine creates the journal entry from the proposal. Every entry must balance debit and credit, otherwise it is rejected.
  4. Reconciliation – bank transactions and payment providers are matched against the entries.
  5. Review – a review agent looks for errors and inconsistencies.
  6. Tax preparation – the Spanish tax forms 303, 390, 111, 347, 349 and 200 are prepared for self-filing.

For classification I use a Claude Opus model at maximum reasoning effort, with structured output following a fixed schema. The model does not answer in free text but in precisely defined fields.

And crucially: nothing is posted without human confirmation. The AI proposes, a human approves. Automatic approval for very confident cases above a threshold is planned, but deliberately not yet active.

Lesson 1: Every receipt is its own truth

The obvious idea would be to store a default per supplier: this supplier is always posted like this. Convenient – and dangerous.

A real example: a software provider charged Spanish VAT until October 2025. From November 2025 it switched to reverse charge, with no VAT on the invoice. A supplier default would have posted the new invoices incorrectly.

So the rule is: the individual invoice is always the truth. If VAT is shown on the receipt, it is posted as such; if not, it counts as reverse charge. If a receipt deviates from the supplier’s history, the system flags it for review – but it never overwrites the receipt with the history.

Lesson 2: Code checks contradictions, not the model

Whether a receipt is internally consistent can often be checked purely logically. No language model needed.

The code compares the fields it has read against each other, for example:

  • tax type “Spanish VAT”, but zero VAT shown
  • tax type “reverse charge”, but VAT on the receipt
  • marked “no VAT”, but posted to an input tax account
  • EU reverse charge for an issuer outside the EU

If any of these rules hits, the receipt cannot be posted until a human has resolved it. The key is the approach: the check looks at the receipt’s fields, not at assumptions about countries or suppliers.

Lesson 3: Two reviewers – code for the maths, the model for judgement

The review agent works in two stages with clearly separated tasks.

Checked by code Checked by the language model
Debit equals credit, balance sheet adds up Is the tax logic plausible?
Accounts exist in the chart of accounts Do name, tax ID, country and tax type fit together?
No entries in locked periods Is the exchange rate plausible?
Reverse charge posted tax-neutrally Any outliers or an unsuitable expense account?
No duplicate revenue, required fields complete Is an expense private or business?
A PDF exists for every entry Are recurring costs missing?

The review agent never changes anything itself. Every finding comes with evidence and a note on whether it came from a rule or from the model. A period only counts as ready to close with zero errors.

Lesson 4: The database protects itself

Closed periods must not be changed. That rule is not only in the application code but as a trigger directly in the database. It fires on every insert, update or delete of entries in a locked period – regardless of which code is writing.

It is the same idea as with AI agents: what must never happen is prevented at the deepest possible level.

Lesson 5: Legacy data is rarely as clean as you think

When moving off the old accounting software, I had the AI re-read 67 migrated receipts and compared them with the stored data. The result was sobering:

Finding in the legacy data Count
Contra account empty 66
Net or total amount differs from the receipt 29
US dollar amounts stored as euros 20
Wrong tax type 8

In seven of the eight wrong tax types, Spanish VAT was on the receipt, but non-EU reverse charge was stored.

The lesson: if you build AI automation on existing data, check that data first. AI is a very good tool for this, because it re-reads every receipt without bias. In one run in July 2026, I had 106 receipts re-read completely.

Lesson 6: A good tool knows its limits

Puenjer Books does not replace a tax adviser. Special cases are confirmed by the gestoría, the Spanish tax advisory firm – for example questions about input tax deduction under certain EU special schemes or about withholdings. The old software is now only connected read-only.

The result of this cautious approach is measurable: in September 2026, the revenue account matched the total of 108 outgoing invoices exactly, without a single unbalanced entry.

What this means for your business

AI in finance processes works when the roles are clearly assigned. These five rules have proven themselves:

  1. The AI reads and proposes; binding results come from deterministic code.
  2. A human confirms – at least until a measured error rate justifies automatic approval.
  3. Every document is judged on its own, not via defaults.
  4. Reviews are split in two: hard rules in code, plausibility in the model. Nothing is ever changed silently.
  5. Locks belong in the database, not just in the application.

If you are considering automating receipt processing, reporting or reconciliations with AI, get in touch. My AI workflow consulting starts with exactly this question: what may the AI decide, and what not?

More articles

All articles

Ready to streamline your processes with AI?

In a no-obligation first call we look at how your business runs today and identify the two or three places where AI pays for itself fastest.