Agricultural cooperative purchasing: member input-order rounding tool - a single-file offline web page where each household's request (entered as package counts directly, or as acreage times a per-acre rate the buyer types in) rounds up to whole bags and whole cases, the slack from rounding rolls into one separate line of co-op buffer stock instead of any member's account, and one click prints both deliverables: the supplier purchase order and the per-member pickup slip; on-account members are flagged 'credit' and excluded from the cash total, pickup slips carry signature lines, and households with incomplete requests show red and stay off both sheets - no built-in per-acre rates for any crop or input, no estimating missing numbers
Requirement for a coding agent: build a single-file offline web page
for an agricultural cooperative's purchasing clerk, turning member
input requests into two printable sheets - a supplier purchase order
and per-member pickup slips. Opens and runs locally, data in
localStorage, no network.
Input (form entry, household by household):
- Member name, acreage planted
- Per item, one of two entry modes: direct package count, or "acres x
per-acre rate" converted by the tool
- Settlement method for the household: cash / on account (credit
recovered from delivery proceeds at harvest)
Computation rules:
- An "acres x rate" result rounds UP to the smallest sales package
(3.2 bags -> 4 bags); round up always, never round-to-nearest
- Per-acre rates are typed by the clerk item by item; the tool ships
with no suggested rates for any crop or input, and offers no
plausibility hints
- Where a household's request doesn't fill a whole package: the whole
package goes on their pickup slip, annotated "includes X buffer"
(package minus request); all buffer rolls into one line, "co-op
buffer stock," on no member's account
- On-account members get a "credit" flag after the amount on their
slip, excluded from the cash total; the page shows a separate
credit total line
Two printable pages (A4 portrait):
- Supplier purchase order: item / spec / package count / notes,
footer with total packages and total amount (unit prices optional -
totals only when filled in)
- Per-member pickup slip: household / item / packages / amount or
credit flag / buffer note; footer signature lines "picked up by /
date"
Hard constraints:
- A household with an incomplete request shows red and appears on
neither sheet - missing values are never estimated
- Data lives in localStorage only, with "export to file / import from
file" buttons; no upload, no accounts, no cloud sync
- No built-in per-acre rates, no online lookup, no maps; a fixed
banner at the top reads "enter per-acre rates exactly as your
agronomist provided"
- Single HTML file, no build step, no external dependencies (print
styles included)
Why it is written this way
Round-up is locked in as the only rounding rule because slack handling is the invisible trap of group orders: round-to-nearest gives the member who asked for 2.5 bags a full 3 while the one asking 2.4 gets 2 - same generosity of slack, opposite outcomes, and an argument at the counter. Always round up and no member ever loses; all slack lands in the one "co-op buffer" line, giving the remainder a single address. Season-end buffer stock even doubles as a check on request accuracy. The tool declines the "smarter-looking" rounding because a rule with one case is a rule anyone can audit.
"No built-in per-acre rates" is the hardest constraint in the requirement. Most farm-input software ships recommendation tables; for a co-op that is overreach - the rate is the agronomist's authority and responsibility, and a tool-supplied "suggested value" invites the clerk to copy it, spreading the liability thin. The fixed banner carving "rates come from your agronomist" onto the interface draws the jurisdiction in permanent ink: the tool does arithmetic, not agronomy.
On-account members flagged "credit" rather than mixed into the cash total is designed backward from harvest: credit gets recovered from delivery proceeds, and taking cash now would sever that line. The "credit" flag on the pickup slip is the starting evidence for the finance-side offset - one signature at pickup, one reconciliation against that signature at harvest, and the two ledgers connect.
"Incomplete requests stay off the sheets entirely" - no helpful estimates - plus export/import buttons close the responsibility chain: missing numbers get phoned in and re-entered, and every figure on either printed sheet traces to a household's request or to the one rounding rule. That is how group purchasing earns trust - members check their slip, every line matches, and next season they cooperate.
Variables
| Variable | Notes |
|---|---|
| Per-acre rates | Typed per item, sourced from the agronomist's plan - the tool neither supplies nor checks them |
| Smallest sales package | One value per item (bag / case / bottle) - the rounding base |
| On-account roster | Households allowed credit this season - policy set by the board; the tool only sorts by flag |