Repository navigation
Add quotes - #195
Merged
Merged
Add quotes#195
Conversation
Quotes (Angebote) can now be created, sent and turned into invoices.
They are stored as documents like invoices (document_type 'quote'), so
they reuse the editor, line items, taxes, PDF templates, public links and
email, but they are kept out of invoice lists, revenue and e-invoicing.
- Quotes page with filters, create/edit (the invoice editor in quote
mode), detail page with status history.
- Statuses: draft -> sent -> accepted / declined. A sent quote past its
"valid until" date (stored as the due date) shows as expired and can
still be accepted. Quotes can be revised until accepted or declined and
can always be deleted; they cannot be voided or credited.
- "Create invoice" turns a sent or accepted quote into a draft invoice
with the same customer, lines, discount and tax settings, links both
ways and marks the quote accepted. The invoice gets its number from the
invoice sequence when it is published.
- Numbering: quotes always use their own pattern (setting "Quote Number
Pattern", default QUO-{YYYY}-{SEQ}) and are numbered when created, so
they never use up or leave gaps in invoice numbers. New quotes are
valid for 30 days by default (setting "Quotes are valid for (days)").
- PDF/HTML: quote wording in all invoice languages (title, number, date,
"Valid until", recipient heading); no bank details. No e-invoice XML is
generated or embedded for quotes. Files are named quote-<number>.
- Permissions: new "quotes" resource (read, create, update, delete,
publish, export). Routes on a single document check the quotes or
invoices permissions depending on the document type.
- Database: status CHECK now allows 'accepted' and 'declined' (existing
databases are migrated by the existing table rebuild, which keeps all
rows), new column invoices.quote_id.
- Saving a document whose status is only derived ("overdue", "expired")
keeps the stored status instead of writing the derived one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Could you also fix these? |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@kittendevv done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds quotes (Angebote): create a quote, send it, and turn it into an invoice.
Quotes are stored as documents like invoices (
document_type = 'quote'), so they reuse the editor, line items, taxes, PDF templates, public links and email, but they are kept out of invoice lists, revenue figures and e-invoicing.Features
due_date) is shown as expired (derived, like "overdue") and can still be accepted. Quotes can be revised until accepted or declined and can always be deleted; they can't be voided or credited.QUO-{YYYY}-{SEQ}) and are numbered when created, so they never use up or leave gaps in invoice numbers. New quotes are valid for 30 days by default (Quotes are valid for (days)).quote-<number>.quotesresource (read, create, update, delete, publish, export) in the permission matrix. Routes on a single document (/invoices/:id/...) now check thequotesorinvoicespermissions depending on the document type (requireDocumentPermission); listing, creating and the quote-only actions are under/api/v1/quotes.Database
acceptedanddeclined. Existing databases are migrated by the existing table rebuild (migrateInvoicesForVoided), which now also triggers whenacceptedis missing and keeps all rows.invoices.quote_id(invoice created from a quote).Other change
Saving a document whose status is only derived (
overdue,expired) now keeps the stored status. Previously saving an overdue invoice from the editor wroteoverdueinto the database.Verification
backend/src/controllers/quotes_test.ts(8 tests): numbering, separate lists, status flow and expiry, revising, delete/void/credit rules, creating an invoice from a quote, duplicating, PDF labels.deno checkandsvelte-checkhave no errors./invoices/:idand/quotes/:id, and that quotes don't appear in the invoice list or dashboard data.Not included
🤖 Generated with Claude Code