Item | Qty | Price | Amount |
|---|---|---|---|
| Discovery workshop | 1 | $900.00 | $900.00 |
| Design system setup | 3 | $640.00 | $1,920.00 |
- Subtotal
- $2,820.00
- VAT (12%)
- $338.40
- Total
- $3,158.40
Components
A business document such as an invoice, quote or receipt, with parties, lines, totals and a note.
Item | Qty | Price | Amount |
|---|---|---|---|
| Discovery workshop | 1 | $900.00 | $900.00 |
| Design system setup | 3 | $640.00 | $1,920.00 |
BaseDocument only takes props: it knows nothing about invoices. A module maps its record onto it in a small component of its own, so the same layout serves invoices, quotes, receipts or order confirmations. InvoiceDocument is the reference: it passes the issuer, the client, the dates as meta, the lines and the totals it computes, and the invoice editor shows it as a live preview next to the form.
<BaseDocument
:title="$t('invoices.preview.invoice')"
:number="invoice.id"
:issuer="{ name: issuer.name, code: issuer.taxId, lines: [issuer.address] }"
:recipient="{ name: invoice.client, lines: [invoice.address, invoice.email] }"
:recipient-label="$t('invoices.preview.billTo')"
:meta="[issuedLabel, dueLabel]"
:lines="invoice.lines"
:totals="totals"
:note="invoice.note"
/>
Amounts use the default currency; each line's amount is quantity × price unless you pass amount. The column headers come from document.* in locales/<code>/common.json.
print(), exposed through a template ref, opens the browser's print dialog with only the document: it is copied into a light-theme root while the dialog is open, the rest of the page is hidden, and the tab is renamed to the title and number so "Save as PDF" suggests Invoice INV-0042.pdf. Rows never split across pages. The "Download PDF" actions of the invoice quick view use it.
<BaseDocument ref="invoiceDocument" v-bind="documentProps" />
<BaseButton prepend-icon="download" @click="invoiceDocument?.print()">Download PDF</BaseButton>
To print any other element the same way, call usePrintElement().print(element, { title }).
Props
Name | Type | Default | Description |
|---|---|---|---|
titlerequired | string | — | The document type shown large at the top end, such as "Invoice", "Quote" or "Receipt". |
number | string | — | The document number under the title, in the monospace font. |
issuer | DocumentParty | — | Who issues it: { name, code?, lines? }. code (a tax id) follows the name in the monospace font and each line is a smaller row, such as the address. |
recipient | DocumentParty | — | Whom it is for, with the same shape as issuer. |
recipient-label | string | — | The small uppercase label over the recipient, such as "Bill to". |
meta | (string | null)[] | [] | Short facts aligned to the end next to the recipient, such as the issue and due dates. Empty values are skipped. |
lines | DocumentLine[] | — | The rows { description, quantity, price, amount? }; amount defaults to quantity × price and amounts use the default currency. |
totals | SummaryListItem[] | — | The totals block under the lines, rendered by BaseSummaryList. |
note | string | — | A note in the muted box at the bottom. |
footnote | string | — | A second, quieter line in that box, such as the payment details. |
logo | boolean | true | Shows the app logo above the issuer. |
empty-text | string | — | The message of the lines table while it has no rows. |
Slots
Name | Slot props | Description |
|---|---|---|
#brand | any | Replaces the logo above the issuer, for example with a client logo. |
#footer | any | Replaces the note and footnote inside the muted box. |