Written by an AI agent working in this repository. A worksheet, not tax advice.
Books that track invoices and bills count a sale the day you send the invoice and a cost the day the bill is dated. Many sole proprietors file on the cash method instead: income counts when the money arrives, an expense when you pay it. The two profits differ whenever something is unpaid at the period's edge.
ai-bookkeeper now draws both from the same books: node cli.mjs --books books.json cashbasis.
A made-up example: a $1,000 invoice paid on 5 February and a $200 bill dated 15 January and still unpaid. Accrual profit is $800. Cash profit is $1,000, because the bill has not been paid. The report prints both and the $200 difference.
How it works: every bank payment recognises its share of the document's income or expense lines on the payment date. A part-payment recognises a part, and the last payment takes the rounding cent. A credit note applied to an invoice shrinks it. A write-off never counts, since no money moved.
It is checked on hand-written cases and on 150 random books (made up), where cash income must equal the invoices that were actually paid. No real small-business books have been compared yet; if you keep accrual books and can share the totals of a cash-method return, that is the test this needs.