The invoice editor required picking a fixed due-date preset (14 or 30 days). We want issue and due dates to be optional fields that fall back to sensible defaults: today for the issue date, and 14 days after the issue date for the due date, only overridden when the user explicitly enters a custom value.
What changed
Replaced the dueDateOption select with two optional <input type="date"> fields: Datum vystaveni and Datum splatnosti.
script.js: added getIssueDate/getDueDate helpers that default to today / issue date + 14 days when the corresponding field is empty, and only use the entered value otherwise. These are wired into reading, saving, clearing, and loading invoice data.
app.js: added matching resolveIssueDate/resolveDueDate helpers on the server side so generated PDFs apply the same default logic, and print both dates in the invoice header next to the invoice number.
Merged latest main (invoice numbering settings, PDF payment footer/line-height tweaks, signature upload) into the branch; resolved one conflict in script.js from renamed DOM references, with no functional overlap.
Notes for review
No new dependencies or schema changes; dates are stored in the existing invoice_data JSON column.
Verified with npm test (3/3 passing) and node --check on both modified JS files.
## Why
The invoice editor required picking a fixed due-date preset (14 or 30 days). We want issue and due dates to be optional fields that fall back to sensible defaults: today for the issue date, and 14 days after the issue date for the due date, only overridden when the user explicitly enters a custom value.
## What changed
- Replaced the `dueDateOption` select with two optional `<input type="date">` fields: **Datum vystaveni** and **Datum splatnosti**.
- `script.js`: added `getIssueDate`/`getDueDate` helpers that default to today / issue date + 14 days when the corresponding field is empty, and only use the entered value otherwise. These are wired into reading, saving, clearing, and loading invoice data.
- `app.js`: added matching `resolveIssueDate`/`resolveDueDate` helpers on the server side so generated PDFs apply the same default logic, and print both dates in the invoice header next to the invoice number.
- Merged latest `main` (invoice numbering settings, PDF payment footer/line-height tweaks, signature upload) into the branch; resolved one conflict in `script.js` from renamed DOM references, with no functional overlap.
## Notes for review
- No new dependencies or schema changes; dates are stored in the existing `invoice_data` JSON column.
- Verified with `npm test` (3/3 passing) and `node --check` on both modified JS files.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
The invoice editor required picking a fixed due-date preset (14 or 30 days). We want issue and due dates to be optional fields that fall back to sensible defaults: today for the issue date, and 14 days after the issue date for the due date, only overridden when the user explicitly enters a custom value.
What changed
dueDateOptionselect with two optional<input type="date">fields: Datum vystaveni and Datum splatnosti.script.js: addedgetIssueDate/getDueDatehelpers that default to today / issue date + 14 days when the corresponding field is empty, and only use the entered value otherwise. These are wired into reading, saving, clearing, and loading invoice data.app.js: added matchingresolveIssueDate/resolveDueDatehelpers on the server side so generated PDFs apply the same default logic, and print both dates in the invoice header next to the invoice number.main(invoice numbering settings, PDF payment footer/line-height tweaks, signature upload) into the branch; resolved one conflict inscript.jsfrom renamed DOM references, with no functional overlap.Notes for review
invoice_dataJSON column.npm test(3/3 passing) andnode --checkon both modified JS files.