Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions examples/app-showcase/src/objects/invoice.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
}),
},
Expand Down