What a point-of-sale receipt posts to the ledger
In ERES every report, from the trial balance to the P&L, is built from postings. A sale does not just insert a row in a sales table; it writes a voucher whose debits equal its credits. If they do not, the sale is refused.
One sale, four lines
Take a counter sale of goods priced at 1,000 with 18% sales tax, paid in cash, where the goods cost 600 to buy. The voucher looks like this:
Account Debit Credit
Cash in hand 1,180
Sales revenue 1,000
Sales tax payable 180
Cost of goods sold 600
Inventory 600
------ ------
1,780 1,780The customer side (cash against revenue and tax) and the stock side (cost of goods against inventory) both balance, so the voucher balances. The cost comes from the batch the stock left, first in, first out.
Why the reports read only postings
- A refund, a discount or a stock adjustment posts its own voucher, so history is never rewritten.
- The P&L and the balance sheet cannot disagree, because they sum the same lines.
- An auditor can follow any figure on a report back to the voucher that made it.
The rule costs a little more code at the start. It saves the month-end hunt for why the stock report and the balance sheet show different inventory.