From 1be1a20e36bd8c014976bd75417245a153ea5bc7 Mon Sep 17 00:00:00 2001 From: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Date: Sun, 7 Jun 2026 16:23:23 +0800 Subject: [PATCH] feat(showcase): invoice header tax_rate for the live totals stack Add a `tax_rate` (percent) field to showcase_invoice and relabel the line subtotal summary "Subtotal". The line-item entry form reads tax_rate live to render a Subtotal / Tax / Total stack under the grid as lines are entered. Co-Authored-By: Claude Opus 4.8 --- examples/app-showcase/src/objects/invoice.object.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/app-showcase/src/objects/invoice.object.ts b/examples/app-showcase/src/objects/invoice.object.ts index 29dd17038..ede7dd448 100644 --- a/examples/app-showcase/src/objects/invoice.object.ts +++ b/examples/app-showcase/src/objects/invoice.object.ts @@ -55,10 +55,14 @@ export const Invoice = ObjectSchema.create({ ], }), issued_on: Field.date({ label: 'Issued On' }), + // Header tax rate (percent). The line-item entry form reads it live to show + // a Subtotal / Tax / Total stack under the grid as lines are entered. + tax_rate: Field.number({ label: 'Tax Rate (%)', min: 0, max: 100, defaultValue: 0 }), // Roll-up: recomputed server-side as line items are inserted/updated/deleted - // (child FK auto-detected: showcase_invoice_line.invoice). + // (child FK auto-detected: showcase_invoice_line.invoice). This is the line + // subtotal; the tax-inclusive grand total is shown live during entry. total: Field.summary({ - label: 'Total', + label: 'Subtotal', summaryOperations: { object: 'showcase_invoice_line', field: 'amount', function: 'sum' }, }), },