Commit graph

113 commits

Author SHA1 Message Date
22d2507d52 fix: CSV reports now include claim currency column, claim totals, and total claim header 2026-07-14 14:33:45 +00:00
f1b029949e feat: PDF — total claim in header, wider merchant column (52mm) 2026-07-14 13:48:31 +00:00
e9460a6a7d fix: UpdateEvent now saves the event name, not just currency/rate 2026-07-14 12:21:40 +00:00
47fb82d109 fix: PDF reports show local+claim columns, totals in claim currency, remove grand total 2026-07-14 12:17:42 +00:00
a7f7dca41d fix: auto-calculate claim conversion when converted_amount is empty using event exchange rate 2026-07-14 11:47:26 +00:00
2fcce08cff fix: remove nested #receipt-form wrapper causing duplicate IDs on edit 2026-07-14 11:33:24 +00:00
dfefd0208c fix: allow editing expenses in pre-migration events (empty month_id) 2026-07-14 11:24:24 +00:00
2f2fbf7630 fix: bump upload limit to 11MB, add .gitignore for build artifacts 2026-07-14 10:40:49 +00:00
949d4f277c fix: expense edit form — restore description value, use event's exchange rate 2026-07-14 10:26:28 +00:00
10e6b78940 feat: prepend user name to email report subjects (Claus Lohmar | Monthly Expense Report: ...) 2026-07-14 10:18:18 +00:00
6d641cf8c9 fix: correct curl pipe syntax in README 2026-07-14 10:11:28 +00:00
3bc3eddd5b chore: install.sh with --install/--update/--remove flags, help, update README 2026-07-14 10:09:50 +00:00
64844baa83 fix: landscape PDF reports, full text, wider columns, include CSV+PDF in monthly ZIP 2026-07-14 10:06:31 +00:00
d65c0cd5fa feat: add month hierarchy, AI categories, and UI polish
- Restructure hierarchy: Month → Event → Expense (new months table, FK)
- Add MonthHandler with CRUD, monthly reports, dropdown create form
- Events now scoped under months with extended ownership chain
- AI extraction: 16 specific expense categories (Airfare, Meals, etc.)
- UI: category dropdown, button-consistent cards, centered mobile shell on desktop
- Dashboard/month views show claim totals per card
- Description field now mandatory, forms simplified
- Months sorted by name chronologically (latest first)
2026-07-14 09:29:26 +00:00
1c9ab4554a chore: always include both CSV and PDF in report ZIP instead of picking one format 2026-07-13 09:10:12 +00:00
517e95adc2 chore: rebrand ReceiptNext to NextExpense
- Rename Go module from github.com/cclohmar/ReceiptNext to NextExpense
- Update all import paths across 7 Go source files
- Update templates (titles, headings, branding)
- Update static files (manifest.json, sw.js, CSS)
- Update config (Makefile, install.sh, .env.example)
- Update README with new name and URLs
- Rename service file receiptnext.service -> nextexpense.service
- Update install paths, service names, log paths in install.sh
2026-06-21 18:39:48 +00:00
ce08681d81 chore: add profile editor — edit name/department via dashboard 2026-06-17 15:15:23 +00:00
24451b4f4f chore: put currency labels in proper CSV/PDF columns, not jammed into number cells 2026-06-17 13:05:18 +00:00
95762cd1ae chore: add base currency to CSV totals row too 2026-06-17 12:58:33 +00:00
b50699fc0e chore: add base currency label to PDF totals row 2026-06-17 12:57:41 +00:00
7c84c0858f chore: add totals row to PDF reports (local + converted currency) 2026-06-17 12:54:16 +00:00
a943c258bb chore: use request Host header for download links, not BASE_URL 2026-06-17 12:41:38 +00:00
5e66e849fc chore: add Close Event button + cleanup download tokens on reopen 2026-06-17 12:38:21 +00:00
5aa5523e8b chore: remove eager token cleanup on regenerate to prevent breaking emailed links 2026-06-17 12:34:22 +00:00
64d7494e33 chore: flat ZIP structure + event-name download filenames (/dl/{token}/{name}.zip) 2026-06-17 12:28:20 +00:00
4bc9fe52ae chore: add onboarding flow — capture user name/department, inject into CSV/PDF reports 2026-06-17 12:23:21 +00:00
8759b31e47 chore: log addToZip errors instead of silently dropping 2026-06-17 12:14:37 +00:00
be3aa7a036 chore: add postbox — generate report package, download or email link 2026-06-17 12:13:34 +00:00
cc56d1ac9f chore: resize receipt images on upload (max 2048px, JPEG 85%) to prevent SMTP attachment size rejections 2026-06-17 11:50:46 +00:00
44309dc189 chore: surface SMTP error message to user on filing failure 2026-06-17 11:45:45 +00:00
290f803996 chore: fix upload error visibility + install.sh update mode ownership bug 2026-06-17 11:27:33 +00:00
422aaa08ab chore: fix invisible filing errors — add HTMX error feedback and loading indicator 2026-06-17 11:08:01 +00:00
90c9df6cce fix: receipt images missing from filed event ZIP + feat: delete individual expenses
- Fix createReceiptZip path traversal guard blocking new ImagePath entries
  (UploadReceipt stores bare filenames, guard required 'storage/' prefix)
- Add DeleteExpense DB function, handler with ownership verification,
  DELETE /expenses/{id} route, and 🗑️ button in both expense templates
- Uses existing htmx.trigger confirm pattern for delete UX
2026-06-14 11:46:43 +00:00
09b2ddfc79 chore: final project handover — update README, AGENTS.md with project context
- AGENTS.md updated with full project architecture, structure, key decisions
- README.md: removed binary download section, build-from-source only
- README.md: updated build commands with -buildvcs=false
- README.md: updated install.sh description (installs Go if needed)
2026-06-05 15:01:11 +00:00
c83b2ccc83 refactor: install.sh always installs Go and builds from source — no binary downloads
- Removed all pre-built binary download logic from install.sh
- install.sh now installs Go (via apt/dnf/apk) if not present
- Always builds from source — ensures latest code, correct platform
- Removed dist/ binaries from local disk (not tracked in git)
2026-06-05 12:37:48 +00:00
ce2efd9be7 feat: persistent session + logout button + auto-redirect for authenticated users
- Logout button added to dashboard and event page headers
- Landing page checks for valid session cookie → auto-redirects to dashboard
- Session cookie persists 24h — closing and reopening browser keeps login
2026-06-05 11:24:05 +00:00
aa07ff3c50 feat: changing event exchange rate recalculates all expense converted amounts
- New RecalculateExpenses DB function updates all expenses for an event
- Expenses in different currency: converted = ROUND(amount * new_rate, 2)
- Expenses already in base currency: left unchanged
- Called from UpdateEvent handler after saving the new event rate
2026-06-03 08:24:46 +00:00
b0dfb5fad3 fix: reset ownership at start of update mode before any file operations
- Moves chown to the very beginning of the update
- Ensures app user can write to /opt/receiptnext/ before build
- Removes redundant chown later in update (already done upfront)
2026-06-03 08:20:23 +00:00
afd4b6a1cf fix: use sudo_if rm -f app — delete root-owned binary as app user 2026-06-03 08:18:17 +00:00
5abe8c49d9 fix: stop service before build so old binary can be removed
- Prevents 'text file busy' error when rebuilding running binary
- Service is started again after the build completes
2026-06-03 08:17:05 +00:00
f8d3cb6b33 fix: remove old binary before rebuild — prevents permission denied when overwriting root-owned file
- go build can't overwrite a root-owned binary as app user
- Added rm -f app before go build in both update and fresh install paths
- Also chown the app binary alongside .go cache
2026-06-03 08:15:58 +00:00
433b5a4ed8 fix: chown .go build cache before build to prevent permission errors
- Build cache may be root-owned from previous builds
- Added sudo_if chown before both update and fresh build steps
- Prevents 'permission denied' on go mod cache writes
2026-06-03 08:14:18 +00:00
67f1a6c845 fix: add -buildvcs=false to go build to prevent VCS errors
- .git directory may have ownership issues after sudo operations
- -buildvcs=false disables VCS stamping without affecting the binary
2026-06-03 08:11:53 +00:00
6e61740f0a fix: update mode chowns .go build cache to app user
- .go/ directory was root-owned from earlier builds
- Prevents 'permission denied' errors during go build
2026-06-03 08:10:57 +00:00
0d42a35cb8 refactor: remove duplicate edit from event page, add delete to edit form
- Event page now shows read-only metadata only (no edit/delete buttons)
- Edit works from dashboard (Edit button on event cards)
- Delete added to the edit form as a button alongside Save/Cancel
- htmx.trigger #delete div in the edit form fragment
2026-06-03 08:09:31 +00:00
b9721a9bab fix: event edit and delete now use htmx.trigger() instead of .submit() / hx.trigger()
- form.submit() triggered standard GET submission with query params
- hx.trigger() is not a valid function — htmx.trigger() is the correct API
- Both edit save and delete now properly fire HTMX requests
2026-06-03 08:03:47 +00:00
c815e022b5 fix: OTP email subject 'Your ExpenseFlow OTP' → 'Your ReceiptNext OTP' 2026-06-03 08:01:00 +00:00
e547eee57f fix: install.sh backup preserves database owner using stat
- Uses stat to get original owner:group before backup
- chown restores backup file to original owner
- Prevents database becoming readonly after update
2026-06-03 07:59:02 +00:00
91534ed8bd fix: renderOTPForm in auth.go now uses cached single-field template
- Was using its own inline template with 6 digit_0..digit_5 fields
- Now calls getTemplate('otp_form') which has the single 6-digit input
- templates.go already had the correct single-field version
2026-06-03 07:57:56 +00:00
cb42efa395 fix: database ownership preserved during backup — app user must be able to write
- Backup now uses chown --reference to preserve original owner
- Found: rsync changed database ownership to root, blocking writes
2026-06-03 07:52:23 +00:00