Agricultural cooperative cash office clerk: member settlement and input-credit ledger tool - a single-file offline web page recording every delivery (member / crop / grade / net weight / price / amount) and every input-credit charge, with each posted delivery automatically applied first against the household's oldest outstanding credit (cleared charges flagged), the remainder paid out in cash; one click prints the per-member statement (deliveries / offsets / cash paid / balance) with signature lines; price corrections open a new flagged line instead of editing the original, missing days stay blank with no interpolation, and red ink exists for exactly one condition - a negative balance
Requirement for a coding agent: build a single-file offline web page
for an agricultural cooperative's cash office clerk, tracking member
delivery settlement and input-credit repayment. Opens and runs
locally, data in localStorage, no network, no accounting subjects.
Two ledgers (one entry page each):
- Delivery ledger: date / member / crop / grade / net weight / price
/ amount (computed); a same-day price correction for the same
member and grade never edits the original line - it opens a new
line with a lit "corrected" flag
- Input-credit ledger: date / member / input item / amount (goods
taken on account, recovered at delivery time)
Settlement rules (the core):
- On posting a delivery, the amount first repays that member's
outstanding input credit, oldest charge first; repaid charges get
flagged "cleared"
- The remainder after repayment is "cash paid out this time"
- Member balance = cumulative deliveries - cumulative cash paid -
cumulative offsets; positive means the co-op owes the member,
negative means the member owes the co-op
- Red ink appears for exactly one condition: a negative balance; no
other warning colors exist in the tool
Per-member statement (printable, A4): member / period / line-by-line
deliveries and offsets / delivery total / offset total / cash paid /
balance / signature lines "member / clerk / date"; positive and
negative balances both print as-is.
Hard constraints:
- No "period totals padded with averages" of any kind - a missing day
is a visible gap in the detail, never interpolated
- Export and import as local files; no accounts, no cloud, no upload
- Prices and deductions - numbers fixed at the time - are never
rewritten by the program; corrections only open new lines
- Single HTML file, no build, no external dependencies (print styles
included); interface text in the co-op's working language, type
sized large for a dim counting office
Why it is written this way
"Oldest charge first" is a hard rule because repayment order is the hidden dispute of statement day: a member asking "why is my fruit money short" needs the clerk able to point at the line and say "that repaid March's fertilizer." Any other order - largest first, arbitrary - makes every cash payout unexplainable. FIFO is the one sequence both parties can verify on the spot, and it keeps each household's debt as a single unbroken thread.
"Corrections open a new line" is the tool's evidence discipline. At peak, mis-keyed prices happen; letting the clerk edit the row in place makes the books tidy and the evidence chain broken - the lot card says one dollar, the system now says eighty cents, and from that day the system is the untrustworthy party in any dispute. A new flagged line beside the original keeps both visible: this is not data vanity, it is the program permanently standing on the "checkable" side. The same clause generalized - "numbers fixed at the time are never rewritten" - extends the discipline from prices to every recorded value.
Red ink for exactly one condition is deliberate restraint. Tools that grow comfortable sprout warnings - yellow at low balances, orange at heavy credit - but a member owing the co-op money is normal (inputs just taken, crop not yet delivered), and a screen full of red buries the signal that matters: a negative balance that keeps deepening. One red that means one thing gets taken seriously; ten status colors get ignored.
Blank for missing days plus the printed signature lines compose one principle: the books may be incomplete, but never dressed up. Skip a day and that day is visibly absent - the member reading the statement spots "my delivery that day is missing" immediately and it gets fixed; let the program average the gap shut and a small omission becomes an invisible error. The statement ends in two signatures, and everything this tool does serves that moment: when the member points at a line and asks, every line has an answer.
Variables
| Variable | Notes |
|---|---|
| On-account coverage | Households and limits allowed credit this season (board policy) - the tool records what's entered; policy stays with the co-op |
| Statement period | Monthly or per-season statements - period switches must tie each opening balance to the prior statement's closing figure |
| Print copies | Two copies (member / stub) or single plus photocopy, per the co-op's filing habit |