Dinar POS · project status · 10 September 2026, early morning

Customers and credit, 10 September

The second milestone is built: customers with a credit account, the A4 facture at the till, credit notes, payments and the account statement. All nine tasks are merged and reviewed, and the milestone branch is on main since 03:36. This page says what a shop can do with it, what the reviews caught, and what needs a decision.

Branch m2/2026-09-09
nine tasks merged · branch merged into main
how the work runs
9 / 9
tasks merged, branch on main
4
printed papers: ticket, facture, statement, debt slip
568
Rust tests on main, 250 added this milestone
green
every check on every merged task

What a shop can do today

A shop keeps a file on each customer: a private person or a company, with the identifiers a facture needs, a credit limit and a warning threshold. At the till the cashier picks the customer, sees how much they owe and how close they are to their limit, and sells on credit. A sale past the limit is refused with the two amounts on screen; the owner can force it, and the decision is written to the log. Every sale that names a customer records what they owed before, what this paper leaves unpaid, and what they owe after, and prints those three figures on the ticket.

With one switch the same sale becomes a numbered A4 facture (A5 on demand), in its own series beside the tickets. The software checks both parties' identifiers before it takes a number: the shop's own RC and NIS, a company customer's RC and NIS, a private customer's name and address. A missing one refuses the facture and sends the cashier to the right screen; no number is burnt.

Money comes back through payments on the customer's file: each payment settles the oldest papers first, a payment above the debt is refused, and every paper shows what is still unpaid on it. A credit note (avoir) gives goods back, in part or in whole, with its own number and its own lines; the stock returns and the debt falls, and what exceeds the debt becomes credit the customer spends on their next purchase. Cancelling a facture keeps its number, marks it annulée and issues the credit note for it. A proforma quotes a basket without moving stock or debt.

Two papers describe the account: an A4 statement for any range of days, with the opening balance, every movement and the closing balance in words, and an 80 mm debt slip the cashier hands over at the counter. A documents screen lists every ticket, facture, credit note and proforma, opens each one, reprints it, and carries the credit-note and cancel actions. All of it in French, English and Arabic.

The nine tasks

TaskStatusWhat it is
Customer modeldoneThe customer file, the debt ledger that is never edited, only appended, and the three balance figures on every paper.
Customers screendoneThe list with debt and limit, the file, the ledger with its running balance, a correction with a reason.
Credit saledoneThe till sells on credit: limit, warning, refusal with the figures, the owner's override in the log.
Facture at the tilldoneOne switch turns the sale into a numbered facture; both parties' identifiers checked first.
Facture templatedoneThe A4 and A5 paper, the amount in words, one reference file per language; its credit-note, proforma and cancelled faces.
Credit notes, cancellation, proformadoneGoods back in part or whole, stock and debt reversed together; a cancelled facture keeps its number; a quote that moves nothing.
Payments and statementdoneOldest paper settled first, never more than is owed, the A4 statement for a range of days.
Debt slip and closing passdoneThe 80 mm slip for the counter, the spec brought up to date, the fixes from the review of the whole milestone.
PrinterblockedStill waits on the thermal printer being at Samir's laptop (carried from the first milestone).

Reviewed before merge

Each task went through the three passes (money, reach, test quality) before it landed, then the whole milestone went through them again for what no single task could show. Each finding shipped with a test that fails without its fix, and the money rules are also checked by tests that generate thousands of random sequences of sales, corrections, payments and credit notes against a real database file.

Open for Anouar and the comptable

Decided along the way

Next