Commit graph

8 commits

Author SHA1 Message Date
Claude
8be37f29fe
Add configurable date-format; replace browser date pickers with text inputs
- New config key date-format (default DD/MM/YYYY) controls date display
  throughout the form and PDF output
- formatDate(iso) converts stored YYYY-MM-DD to the configured display format
- parseDate(str) converts user input back to YYYY-MM-DD for state storage
- All three date inputs (line date, period from/to) switched from type=date
  to type=text with format placeholder, removing browser locale dependency
- PDF line dates, period header, and continuation header all use formatDate()
- Filename stays in YYYY-MM-DD for safe file naming

https://claude.ai/code/session_014uUwDBtG5y5FuWcy5zqVD1
2026-05-13 09:38:27 +00:00
Claude
156c76baae
Fix crash: state initialized before CFG is loaded
state.baseCurrency was set to CFG['currency-base'] at declaration time,
but CFG is only populated after await loadConfig(). Reading a property of
undefined throws synchronously, crashing the script before init() runs.
Move the assignment to after loadConfig() resolves in init().

https://claude.ai/code/session_014uUwDBtG5y5FuWcy5zqVD1
2026-05-13 09:30:22 +00:00
Claude
e1292822f8
FX rate memory per currency and fix item header layout
- Remember the last valid FX rate entered per currency in state.fxRateMemory;
  pre-fill it when staff picks the same currency on a new line.
- Move Remove button to top-right of item header (alongside label);
  Subtotal moves below the name input, right-aligned in its own row.

https://claude.ai/code/session_014uUwDBtG5y5FuWcy5zqVD1
2026-05-13 09:26:14 +00:00
Claude
9eccc0af8b
Fix period default dates shifting by one day in UTC+ timezones
toISOString() converts local midnight to UTC, producing the previous day
in any timezone east of UTC. Format dates using local getFullYear/Month/Date
instead.

https://claude.ai/code/session_014uUwDBtG5y5FuWcy5zqVD1
2026-05-13 09:20:35 +00:00
Claude
9d4533b7a1
Swap Vendor and Description fields in form and PDF output
Vendor moves to row 1 (alongside Date/Currency/FX rate) and Description
moves to row 2 (alongside Receipt/Amount), in both the UI and the PDF layout.

https://claude.ai/code/session_014uUwDBtG5y5FuWcy5zqVD1
2026-05-13 09:17:31 +00:00
Claude
09ceaaf360
Add selectable base currency to form header
Replace static base currency badge with a currency dropdown (makeCDD).
Changing the selection updates state.baseCurrency, re-renders all item/line
blocks so closures capture the new base, and recalculates totals. All
dynamic references to CFG['currency-base'] replaced with state.baseCurrency.

https://claude.ai/code/session_014uUwDBtG5y5FuWcy5zqVD1
2026-05-13 09:15:54 +00:00
Claude
d35429314d
Fix item name and FX rate fields not filling form width
- item-name: change flex:1 to width:100% since it's not in a flex container
- FX rate: add grow class to fgrp and set input width to 100% so it extends to the right edge

https://claude.ai/code/session_014uUwDBtG5y5FuWcy5zqVD1
2026-05-13 09:13:07 +00:00
8b823bba1f First iteration 2026-05-13 01:02:05 +07:00