Courier station cash office clerk - payroll and fine-deduction calculation tool, single file - the clerk answers for arithmetic only: piece-count needs a reporting source, fines need a ticket number and an attribution entry, and money without complete paperwork never enters the deduction column, it enters the pending list; inputs are the staff roster, piece-count reports (with reporter), fine records, and attendance and departure flags; outputs are the payroll plus five checks: evidence-less fines blocked, per-person deduction-cap alert, month-over-month piece-count anomaly, same-day departure settlement list, and version stamping with silent retro-edits banned; rates and thresholds stay blank, income tax and social insurance stay outside the tool, and no characterizations ever appear on the sheet
You are a coding agent building an internal tool for a courier
station. Build a single-file HTML tool (HTML, CSS, and JS all
inline; no external dependencies, no network requests; opens
in a browser on double-click) for the cash office clerk to
calculate monthly payroll and fine deductions. Core stance:
the clerk answers for arithmetic only - whether a piece count
is true and whether a fine belongs to a given person must rest
on paperwork with a source; a number with incomplete paper-
work never enters the deduction column. The tool's job is to
keep deductions of unclear provenance outside the payroll.
Input areas (manual entry, saveable and exportable):
A. Staff roster: name / post / base pay / piece-rate schedule
(separate rates for scan count and delivery count - rate
parameters left blank for self-entry)
B. Piece-count reports: each person's monthly count / report-
er / report date - the reporter field is mandatory; a
count with no reporter does not participate in calcula-
tion
C. Fine records: ticket number / date / amount / carrier /
attribution (to a person, or station-shared - exactly one
of the two)
D. Attendance and departure: unpaid-leave days / departure
flag with last working day
Output areas:
1. Payroll: gross (base + piece pay) / deductions (fines
with complete paperwork, unpaid leave) / net
2. Validation report (the tool's core output):
- Paperwork block: a fine record missing its ticket num-
ber, or with an empty attribution, is automatically
kicked out of the deduction column into the pending
list - pending money lands in nobody's net pay
- Deduction cap: any person whose monthly deduction total
exceeds the parameter share of gross turns red, with
the note "may only be included after written confir-
mation per local rules and station policy"
- Piece-count anomaly: any person whose count deviates
beyond the parameter threshold month-over-month turns
yellow for re-verification - a mistyped zero in the
report is the most frequent error here
- Departure settlement: the departure flag triggers a
same-day settlement list - unsettled piece pay, depos-
it refunds, and deductions already taken this month,
item by item
- Version stamping: every calculation run gets a version
number; re-issuing after any change requires a version
bump, with old versions kept retrievable - silently
retro-editing an issued payroll is banned
3. Pending list: a separate page listing every blocked de-
duction and the paperwork item it is missing
Usage boundaries (in the tool's page footer):
- The tool computes no income tax or social insurance -
blank columns are left for the clerk to fill per local
rules
- The tool judges no one: neither payroll nor validation
report contains characterizations ("poor performer,"
"at fault") - numbers, rule names, and paperwork status
only
- Data stays in the local browser; nothing uploads
Prohibitions:
- Piece rates, deduction-cap share, deviation thresholds,
and all other parameters stay blank - no "suggested val-
ues" pre-filled; every station and every locality differs,
and pre-fills get read as authoritative defaults
- No inputs for performance scores or fault history - rat-
ing people is the station manager's job; the clerk's sheet
recognizes money and paperwork only
- When a check triggers, the tool offers fixed exits only
(supply the paperwork / obtain written confirmation / re-
turn the figure to the reporter for re-submission) - no
"include anyway" shortcut button
Why it is written this way
The number-one payroll dispute at a station is not an arithmetic error but a deduction nobody can explain. A fine arrives on the carrier's settlement statement, attribution happens verbally in the manager's office, and by the time it reaches the clerk it is just a number subtracted from someone's pay - ask "on what grounds?" and no one produces a chain of evidence. Making "ticket number plus attribution" the minimum paperwork bar for entering the deduction column - and a hard block rather than a soft reminder - is the tool's whole reason to exist: reminders get skipped when time is short, blocks do not.
The reporter field on piece-count reports looks redundant and is actually a hinge of accountability. A clerk transcribing a verbal count from the manager owns the error when the number turns out wrong - "the sheet is yours." With the reporter as an in-table field, responsibility for the count's truth sits in the reporting step, and the clerk's liability retreats to arithmetic. That protects the clerk and disciplines the reporting step: a name printed on the sheet gets a second look at transcription time.
Version stamping defends against "edit after issuing." Payrolls get photographed and kept by employees; the moment a station can silently revise one, the employee's old copy and the station's new copy talk past each other, and every dispute becomes a he-said-she-said. Re-issuing requires a version bump and old versions stay retrievable, so a dispute always has an arbiter - a discipline the tool enforces far more reliably than good intentions.
Blank parameters and outsourced tax math share one kind of caution. Piece rates and deduction caps differ per station and per locality; pre-filling a "suggested value" instantly turns it into an authoritative default, promoting the tool from calculator to backer of someone's wrong policy. Income tax and social insurance rules shift by region and by year - hard-coded, they are guaranteed to rot; a blank column the clerk fills per local rule can't be wrong the way a dead-coded one can.
Variables
| Variable | Description |
|---|---|
| Piece rates | Per-piece rate for scan count and delivery count - this station's agreement with its staff, allowed to differ per person |
| Deduction-cap share | Red-line share of gross pay for one person's monthly deduction total - per local rules and station policy; above it, red flag and written confirmation |
| Deviation threshold | Month-over-month piece-count line for re-verification - beyond it, yellow flag and return to the reporter before calculating |