feat(accounting): bill editor VAT dropdown + GET returns vat_code snapshot
Slice 2 + 1b: - Bill editor: VAT-rate field → VatRateSelect dropdown (mirrors the quote editor); snapshots vatCode on create + carries it from a source quote. - getQuoteById + the invoice serializer now return vat_code, so re-editing a saved document preserves the snapshot instead of falling back to the rate→code map. Payload types (quotes + bills) carry vatCode. 72 tests pass; build green.
This commit is contained in:
@@ -1780,6 +1780,8 @@ async function buildInvoiceRenderContext(invoice, lineItems) {
|
||||
totals: {
|
||||
netAmountMinor: invoice.net_amount_minor,
|
||||
vatRate: invoice.vat_rate,
|
||||
// Migration 130 — VAT-code snapshot (so re-editing preserves it).
|
||||
vatCode: invoice.vat_code ?? null,
|
||||
vatAmountMinor: invoice.vat_amount_minor,
|
||||
shippingAmountMinor: invoice.shipping_amount_minor,
|
||||
totalAmountMinor: invoice.total_amount_minor,
|
||||
|
||||
@@ -1562,6 +1562,8 @@ async function duplicateQuote(id, adminId) {
|
||||
expectedDurationHours: quote.expected_duration_hours,
|
||||
paymentTermTemplateId: quote.payment_term_template_id,
|
||||
vatRate: quote.vat_rate,
|
||||
// Migration 130 — VAT-code snapshot (so re-editing preserves it).
|
||||
vatCode: quote.vat_code ?? null,
|
||||
shippingAmountMinor: quote.shipping_amount_minor,
|
||||
introText: quote.intro_text,
|
||||
outroText: quote.outro_text,
|
||||
|
||||
Reference in New Issue
Block a user