If you build a finance dashboard on top of an accounting system, the first serious question from a user will be: "Why does your gross profit not match my P&L?" You need an answer that is better than "timing". The reliable way to reconcile KPI with profit and loss figures is to stop comparing totals and start comparing accounts .
This post walks through an account-by-account reconciliation in Python (with a Django flavor): fetch both sides, normalize them, diff with Decimal , roll the diff up to KPI lines, and classify the causes.
Why totals-only checks fail
Comparing "our gross profit" with "their gross profit" tells you that something is wrong, not what. A difference of 350 could be one missing invoice, a deleted transaction you still hold, a timezone edge, or two larger errors cancelling out. Two errors of +900 and −900 even produce a perfect match on totals.
An account-level diff fixes that.…