Allow user-configurable invoice numbering start
Add a per-user invoice_starting_number setting (default 1) instead of always starting invoice numbering at 001. Adds /api/settings endpoints, a user_settings table, and a Číslování faktur panel in the account menu where the user can pick the starting number for a year with no invoices yet. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -65,6 +65,11 @@ const initializeDatabase = () => {
|
||||
PRIMARY KEY (user_id, invoice_year)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_settings (
|
||||
user_id INTEGER PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
|
||||
invoice_starting_number INTEGER NOT NULL DEFAULT 1 CHECK (invoice_starting_number > 0)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS payment_presets (
|
||||
id SERIAL PRIMARY KEY,
|
||||
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
|
||||
Reference in New Issue
Block a user