PrimaHQ Claims — New-Client Build Prompt (paste this at the start of the next chat)
You are helping LTT Outsourced CFO Sdn. Bhd. build a "PrimaHQ Claims" expense-claim app for a NEW client, matching our existing internal standard. Do NOT invent a new design — reuse our template and conventions exactly. I will upload a starter kit (template + build spec + helper). Follow it.
What to produce
A single self-contained offline .html app (double-click to run, no server) plus a separate receipts pack .json, identical in structure/behaviour to our current build. Same five tabs: Dashboard · Expenses · Excluded · Export · Settings, an Entity dropdown in the top bar, the SparkReceipt-style branded per-month report, Bukku full-year export, direct PDF/HTML export, and a Google-Sheets master.
Files I will give you (the starter kit)
app2_template.html— the reusable engine with four inject placeholders:__DATASET__,__SEEDCATS__,__CLIENTDEFAULTS__,__LTTLOGO__. Reuse this; do not rebuild the UI from scratch.PrimaHQClaims_BuildSpec-Handoff-260624.md— the full spec (data model, rules, formats, gotchas). Read it first.gen_receipts_hq.py— the receipts-pack generator (renders receipt pages to a keyed base64 JSON, in batches)._ltt_logo_datauri.txt— the LTT app-mark data URI for__LTTLOGO__.
What I will provide for the client
- Scanned receipts for the year (monthly folders / zips / PDFs).
- A 3-tab classification workbook (
Claims to submit (not via bank),Excluded - bank-paid & dup,Excluded - utilities & rental) with columns: Reference No., Date, Supplier/Payee, Description, Original Category, Acct Code, Account (PrimaHQ classification), Amount (RM), Original Ref, Status, Source File, Page(s). - Client branding: legal name, registration/SSM no., TIN, address, and a logo (PNG/JPG).
Build steps (do these in order)
- Parse the workbook → build the dataset JSON (one row per line item). Claims tab →
inc:"in"; both excluded tabs →inc:"out". Fields:id, client, clientName, date(YYYY-MM-DD true doc date), month, supplier, desc, category(=account name), ref, amount, note("Status: … | was: …"), file(relative path), pages[ints], type, inc. Type default: Utilities/Telephone/Rental → "Bill (Credit Purchase)", else "Cash Bill". - Collect distinct accounts → seed categories
{name, code, bukku:"", excluded:false}(codes from the Acct Code column). Merge with our standard COA list. - Embed the logo (trim white, base64 data URI). Auto-set the client's report accent (
spine) to the logo's dominant colour. Fillreg, tin, addr. - Inject dataset/seedcats/clientdefaults/logo into
app2_template.html→ write the final.html. Write big files via a bash heredoc on the Linux side (host writes can truncate), thennode --checkthe extracted<script>. - Generate the receipts pack with
gen_receipts_hq.py(point it at the client's receipt source; keys =file + "|" + page; ~80 DPI / JPEG q38 / max width 850; run in batches of ~100–130 pages). Use a fuzzy filename resolver (normalise apostrophes/spaces/case) + distinctive-token fallback. - Deliver: the app
.html, the receipts pack.json, and a Google-Sheets master.xlsx.
Classification rules (apply consistently)
True-date placement (client ledger date beats stale receipt date); partial claims = only the marked amount; utility arrears = current-month charge only; LTT supplier house-style Brand (Legal Sdn. Bhd.).Outlet, keep Chinese; exclude rental/utilities/payroll/bank-paid/duplicates from the claim.
LTT internal standard (must follow)
- Visual identity SOP001: charcoal #323232 text (never pure black), graphite #3D424A table headers, hairline rules, generous whitespace, tabular numerals, Poppins (Latin) + KaiTi (Chinese). App chrome accent = LTT crimson #C62F58; client reports accent = the client logo colour. Embed logos as data URIs (self-contained).
- File naming: app
LTHExpIQ_EntityName(<EntityCodes>)-v<N>-<yymmdd>.<hhmmss>.html; receipts packLTHExpIQ_Receipts(<EntityCode>)-v<N>-<yymmdd>.json. Whole version numbers, no leading zero; bump the version and thelocalStoragekey on every change. - Bukku export: Batch Cash Bills columns — Supplier, Reference No., Date(dd/mm/yyyy), Currency(MYR), Pay From, Account(=code - name), Item Description, Amount, Tax. Excluded rows omitted.
Start by confirming you have the starter kit and the three client inputs, then ask me for anything missing before building.