---
title: "InvoiceBuilder – API-Referenz · Quittio"
description: "Fluent builder for InvoiceData."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Builder/InvoiceBuilder"
locale: de
meta:
  "og:description": "Fluent builder for InvoiceData."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "InvoiceBuilder – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core) \\ [Builder](https://quittio.dev/docs/api/Quittio/Core/Builder)

# InvoiceBuilder

class in quittio/core · uses [`BuildsAllowancesAndCharges`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsAllowancesAndCharges), [`BuildsDelivery`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsDelivery), [`BuildsExtensions`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsExtensions), [`BuildsHeader`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsHeader), [`BuildsLines`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsLines), [`BuildsNotesAndAttachments`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsNotesAndAttachments), [`BuildsParties`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsParties), [`BuildsPayment`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsPayment), [`BuildsPresentationAndMeta`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsPresentationAndMeta), [`BuildsReferences`](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsReferences), [`Macroable`](https://quittio.dev/docs/api/Quittio/Core/Support/Macroable)

`Quittio\Core\Builder\InvoiceBuilder` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/core/src/Builder/InvoiceBuilder.php#L81)

Fluent builder for InvoiceData.

Amounts, prices and quantities are passed as strings or integers, never as floats. The result is not yet calculated; totals and the VAT breakdown are set by the calculator.

## Properties \#

| Property | Type | Description |
| --- | --- | --- |
| `$macros` protected static | `array<string, callable>` | |

## Methods \#

| Method | Description |
| --- | --- |
| `->__construct()` | |
| `->__call()` | |
| `->addPrepaid()` | Adds to the amount already paid (BT-113), e.g. one of several advance payments. |
| `->allowance()` | Document level allowance (BG-20) for one VAT category and rate. |
| `->applyDefaults()` | Applies the defaults of a seller, e.g. the seller of config/quittio.php with its bank account and small business flag (Quittio::invoice()) or a Managed issuer. The builder remembers what they set: seller() with another seller removes it again. |
| `->attachment()` | Supporting document (BG-24), either embedded ($content) or as external link. |
| `->build()` | The invoice data, not calculated yet (the calculator or a render run adds the totals). |
| `->buildDraft()` | Builds without requiring lines, e.g. for payment reminders or account statements, or for drafts. Data without lines can be calculated (its line sum is zero; document allowances and charges still count), but it is not a valid invoice: EN 16931 requires at least one line (BR-16), so validation reports it. |
| `->businessProcess()` | Business process identifier (BT-23); Peppol and XRechnung write their process when it is not set. null removes it. |
| `->buyer()` | The buyer (BG-7): a BuyerParty, a PartyBuilder (Party::make()) or an application model (ProvidesParty), e.g. ->buyer($customer), replace the buyer set before; a callable receives the builder of the buyer set before and changes it. |
| `->buyerAccountingReference()` | The buyer's accounting reference (BT-19), e.g. a cost centre; null removes it. |
| `->buyerReference()` | Buyer reference (BT-10). For public sector buyers in Germany this is the Leitweg-ID. |
| `->cashDiscount()` | Cash discount ("Skonto") of $percent for payment within $days days after the issue date, optionally on a base amount; repeatable for several tiers. Continues the payment terms. |
| `->charge()` | Document level charge (BG-21) for one VAT category and rate. See allowance() for the exemption reason. |
| `->contractReference()` | Contract reference (BT-12); null removes it. |
| `->creditTransfer()` | Adds a further bank account (BG-17). |
| `->currency()` | Invoice currency (BT-5), ISO 4217; stored in upper case. Default EUR. |
| `->custom()` | Free data for templates (view model key meta.custom); the same key replaces the value. |
| `->defaultVat()` | VAT treatment of the lines that set none (also sub lines), with the arguments of LineBuilder::vat(). Without it, the application default of useDefaultVat() applies. |
| `->deliverTo()` | Deliver-to party and address (BT-70, BG-15). |
| `->delivery()` | Replaces the whole delivery information (BG-13), including the delivery date (BT-72). |
| `->deliveryDate()` | Actual delivery or service date (BT-72). |
| `->despatchAdviceReference()` | Despatch advice reference (BT-16); null removes it. |
| `->directDebit()` | SEPA direct debit (BG-19): mandate reference (BT-89), creditor identifier (BT-90) and the debited IBAN (BT-91, spaces removed). Without payment instructions it starts them with SepaDirectDebit (59). |
| `->discountAmount()` | Absolute discount distributed over all VAT groups in proportion to their line totals. |
| `->discountPercent()` | Percentage discount on all lines. Split into one allowance per VAT group. |
| `->dueDate()` | Due date (BT-9). Without it the calculator derives it from dueInDays(); otherwise the configured due\_days apply when rendering, never for credit notes. |
| `->dueInDays()` | Payment target: the due date (BT-9) is the issue date plus $days unless dueDate() is set, and the payment terms say "Payable within … days without deduction." Continues the payment terms set before. |
| `->exchangeRate()` | Exchange rate from the invoice currency to the VAT accounting currency (BT-6), used to calculate the VAT total in that currency (BT-111), with the date of the rate. Replaces a rate implied by declared amounts (see from()). |
| `->extended()` | Data of the profile EXTENDED of ZUGFeRD/Factur-X (further parties, delivery terms, instalments …); other profiles do not write it. |
| `->flag()` | Sets a flag that country packs evaluate (e.g. a small amount invoice in Germany). |
| `::flushMacros()` | |
| `::from()` | Starts a builder from existing data, e.g. to change a draft. |
| `::fromDocument()` | Starts an invoice from a quote, order confirmation, delivery note or proforma invoice: parties, billable lines, document allowances and charges and payment data are taken over; number and issue date must be set. |
| `::fromUsing()` | Like from(), with the calculator that decides whether the declared amounts of the data differ from a recalculation, e.g. the calculator of the Quittio instance. |
| `->group()` | Defines a line group for the PDF. Lines join it via LineBuilder::group(). |
| `::hasMacro()` | |
| `->invoicedObject()` | Identifier of the invoiced object (BT-18), e.g. a meter or subscription number, with its scheme (BT-18-1). |
| `->invoicingPeriod()` | Invoicing period (BG-14). |
| `->issueDate()` | Issue date (BT-2); default today. A DateTimeInterface is converted in the time zone of timezone(), so call timezone() first. |
| `->lateFee()` | Late payment terms: days, percentage and text. Continues the payment terms. |
| `->line()` | Adds a line (BG-25): a name with the common values (->line('Consulting', netPrice: '120.00', quantity: 4, unit: UnitCode::Hour)), a LineBuilder (Line::make()), an array with the keys of LineBuilder::ARRAY\_KEYS, an application model (ProvidesInvoiceLine), a callable that receives a new LineBuilder, or a finished InvoiceLine. |
| `->lines()` | |
| `->locale()` | Language of the invoice: labels, generated texts and the exemption texts of presets. The locale of a render call wins; without both, the configured locale or the country default. |
| `::macro()` | |
| `::make()` | A new, empty builder; type code 380 and the issue date today unless set. |
| `->note()` | Adds an invoice note (BG-1): the text (BT-22) and an optional subject code (BT-21, UNTDID 4451, e.g. "REG" for regulatory information). Unknown codes are kept as RawCode. |
| `->number()` | Invoice number (BT-1). Not checked here; the validation requires it. |
| `->payee()` | Payee (BG-10), if different from the seller (e.g. a factoring company): the name with the identifier (BT-60) and the legal registration identifier (BT-61) and their schemes, a PartyBuilder (Party::make('Factoring AG')->identifier(…)), a PayeeParty, or a callable that receives a PartyBuilder and, like seller() and buyer(), continues an earlier payee. |
| `->payment()` | Payment instructions (BG-16) with an optional credit transfer account (BG-17). |
| `->paymentCard()` | Payment card (BG-18): the last 4 to 6 digits of the card number (BT-87) and the holder (BT-88). Without payment instructions it starts them with BankCard (48). |
| `->paymentTerms()` | Payment terms (BT-20): a PaymentTerms object or a text replace earlier terms; a callable receives a PaymentTermsBuilder that continues the earlier terms, also those of a PaymentTerms object or of from(), like seller() and buyer(). |
| `->precedingInvoice()` | Adds a reference to a preceding invoice (BG-3): its number (BT-25) and issue date (BT-26), e.g. for a corrected invoice or a credit note. |
| `->prepaid()` | Amount already paid (BT-113), e.g. received advance payments. |
| `->presentation()` | Design of this invoice in PDF and HTML: a Presentation replaces it, an array changes single values (->presentation(\['introText' => 'Thank you for your order.', 'showGrossPrices' => true])), a callable receives the current Presentation and returns the new one. |
| `->projectReference()` | Project reference (BT-11) with the project name, which CII requires in addition to the identifier. |
| `->purchaseOrderReference()` | The buyer's purchase order reference (BT-13); null removes it. |
| `->receivingAdviceReference()` | Receiving advice reference (BT-15); null removes it. |
| `->removeLine()` | Removes an existing line by its identifier (BT-126). |
| `->rounding()` | Rounding amount (BT-114), e.g. cash rounding. Never use it to fix wrong totals. |
| `->salesOrderReference()` | The seller's sales order reference (BT-14); null removes it. |
| `->seller()` | The seller (BG-4). |
| `->source()` | Origin of the data, e.g. "shop" (view model key meta.source). |
| `->standard()` | Version of EN 16931 (BT-24 of the profile): 2017 (default) or 2026, which only the profile EN 16931 supports. |
| `->taxCurrency()` | VAT accounting currency (BT-6). With an exchange rate, BT-111 is calculated. |
| `->taxPointDate()` | Date when VAT becomes chargeable (BT-7), if it differs from the issue date. EN 16931 allows BT-7 or BT-8, not both (BR-CO-03). |
| `->taxPointDateCode()` | Code of the date when VAT becomes chargeable (BT-8): issue, delivery or payment date. EN 16931 allows BT-7 or BT-8, not both (BR-CO-03). |
| `->taxRepresentative()` | The seller's tax representative (BG-11): name (BT-62), VAT identifier (BT-63) and postal address (BG-12). |
| `->tenderReference()` | Tender or lot reference (BT-17); null removes it. |
| `->timezone()` | Time zone for DateTimeInterface values and for the default issue date; call it before the date setters. |
| `->type()` | Type code (BT-3) from UNTDID 1001, e.g. 381 for a credit note; default 380. Unknown codes are kept as RawCode and reported by the validation. |
| `->updateLine()` | Changes an existing line, e.g. of a correction draft started with {@see self::from()}: with the named values ->updateLine('2', netPrice: '80.00', quantity: 3), or with a callable that receives the InvoiceLine and returns the changed one, e.g. ->updateLine('2', fn (InvoiceLine $l) => $l->with(\['note' => 'Delivered in two parts'])). The calculated line net amount is reset, and percentage allowances and charges on the line amount are recalculated from the new amount. |
| `::useDefaultVat()` | Application default VAT of lines that set none, for invoices without defaultVat(): a preset, or a callable that receives the seller's country code and whether the invoice is flagged as small business invoice (Meta::FLAG\_SMALL\_BUSINESS) and returns a preset or null, e.g. Quittio\\Core\\Tax\\CountryDefaultVat. The Laravel integration sets it from quittio.defaults.vat; null removes it. Lines without VAT and without a default make build() fail (BG-30). |
| `->xrechnungExtension()` | Data of the XRechnung extension (e.g. third party payments), written only with the profile xrechnung-extension. |

### `__construct()`#

```
final public function __construct()
```

### `__call()`#

```
public function __call(string $method, array<mixed> $parameters): mixed
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$method` | `string` | |
| `$parameters` | `array<mixed>` | |

<dl><dt>Returns</dt>
<dd><code>mixed</code></dd>
</dl>

### `addPrepaid()`#

```
public function addPrepaid(BigDecimal|int|float|string $amount): static
```

Adds to the amount already paid (BT-113), e.g. one of several advance payments.

| Parameter | Type | Description |
| --- | --- | --- |
| `$amount` | `Brick\Math\BigDecimal\|int\|float\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `allowance()`#

```
public function allowance(
    VatCategory $category,
    BigDecimal|int|float|string|null $rate,
    ?string $amount = null,
    ?string $percent = null,
    ?string $reason = null,
    AllowanceReasonCode|RawCode|string|null $reasonCode = null,
    ?string $baseAmount = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null,
): static
```

Document level allowance (BG-20) for one VAT category and rate.

The exemption reason (BT-120/BT-121) is used for the VAT breakdown when no invoice line of the same VAT group provides one, e.g. an exempt charge on a standard rated invoice.

| Parameter | Type | Description |
| --- | --- | --- |
| `$category` | `[VatCategory](https://quittio.dev/docs/api/Quittio/Core/Enums/VatCategory)` | |
| `$rate` | `Brick\Math\BigDecimal\|int\|float\|string\|null` | |
| `$amount` | `?string` = `null` | |
| `$percent` | `?string` = `null` | |
| `$reason` | `?string` = `null` | |
| `$reasonCode` | `[AllowanceReasonCode](https://quittio.dev/docs/api/Quittio/Core/Enums/AllowanceReasonCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |
| `$baseAmount` | `?string` = `null` | |
| `$exemptionReason` | `?string` = `null` | |
| `$exemptionReasonCode` | `[VatExemptionReasonCode](https://quittio.dev/docs/api/Quittio/Core/Enums/VatExemptionReasonCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `applyDefaults()`#

```
public function applyDefaults(callable $apply): static
```

Applies the defaults of a seller, e.g. the seller of config/quittio.php with its bank account and small business flag (Quittio::invoice()) or a Managed issuer. The builder remembers what they set: seller() with another seller removes it again.

| Parameter | Type | Description |
| --- | --- | --- |
| `$apply` | `callable` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `attachment()`#

```
public function attachment(
    string $id,
    ?string $content = null,
    MimeType|string|null $mimeType = null,
    ?string $filename = null,
    ?string $description = null,
    ?string $externalUri = null,
): static
```

Supporting document (BG-24), either embedded ($content) or as external link.

| Parameter | Type | Description |
| --- | --- | --- |
| `$id` | `string` | |
| `$content` | `?string` = `null` | |
| `$mimeType` | `[MimeType](https://quittio.dev/docs/api/Quittio/Core/Enums/MimeType)\|string\|null` = `null` | |
| `$filename` | `?string` = `null` | |
| `$description` | `?string` = `null` | |
| `$externalUri` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `build()`#

```
public function build(): InvoiceData
```

The invoice data, not calculated yet (the calculator or a render run adds the totals).

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData">InvoiceData</a></code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidInvoiceData">InvalidInvoiceData</a></code> – when seller (BG-4), buyer (BG-7), the lines (BG-25), an item name (BT-153) or the VAT of a line without default VAT (BG-30) is missing, or a line identifier is used twice</dd></dl>

### `buildDraft()`#

```
public function buildDraft(): InvoiceData
```

Builds without requiring lines, e.g. for payment reminders or account statements, or for drafts. Data without lines can be calculated (its line sum is zero; document allowances and charges still count), but it is not a valid invoice: EN 16931 requires at least one line (BR-16), so validation reports it.

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData">InvoiceData</a></code></dd>
</dl>

### `businessProcess()`#

```
public function businessProcess(?string $process): static
```

Business process identifier (BT-23); Peppol and XRechnung write their process when it is not set. null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$process` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `buyer()`#

```
public function buyer(BuyerParty|PartyBuilder|ProvidesParty|callable $buyer): static
```

The buyer (BG-7): a BuyerParty, a PartyBuilder (Party::make()) or an application model (ProvidesParty), e.g. ->buyer($customer), replace the buyer set before; a callable receives the builder of the buyer set before and changes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$buyer` | `[BuyerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/BuyerParty)\| [PartyBuilder](https://quittio.dev/docs/api/Quittio/Core/Builder/PartyBuilder)\| [ProvidesParty](https://quittio.dev/docs/api/Quittio/Core/Contracts/ProvidesParty)\|callable` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `buyerAccountingReference()`#

```
public function buyerAccountingReference(?string $reference): static
```

The buyer's accounting reference (BT-19), e.g. a cost centre; null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `buyerReference()`#

```
public function buyerReference(?string $reference): static
```

Buyer reference (BT-10). For public sector buyers in Germany this is the Leitweg-ID.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `cashDiscount()`#

```
public function cashDiscount(
    int $days,
    string $percent,
    ?string $baseAmount = null,
): static
```

Cash discount ("Skonto") of $percent for payment within $days days after the issue date, optionally on a base amount; repeatable for several tiers. Continues the payment terms.

| Parameter | Type | Description |
| --- | --- | --- |
| `$days` | `int` | |
| `$percent` | `string` | |
| `$baseAmount` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `charge()`#

```
public function charge(
    VatCategory $category,
    BigDecimal|int|float|string|null $rate,
    ?string $amount = null,
    ?string $percent = null,
    ?string $reason = null,
    ChargeReasonCode|RawCode|string|null $reasonCode = null,
    ?string $baseAmount = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null,
): static
```

Document level charge (BG-21) for one VAT category and rate. See allowance() for the exemption reason.

| Parameter | Type | Description |
| --- | --- | --- |
| `$category` | `[VatCategory](https://quittio.dev/docs/api/Quittio/Core/Enums/VatCategory)` | |
| `$rate` | `Brick\Math\BigDecimal\|int\|float\|string\|null` | |
| `$amount` | `?string` = `null` | |
| `$percent` | `?string` = `null` | |
| `$reason` | `?string` = `null` | |
| `$reasonCode` | `[ChargeReasonCode](https://quittio.dev/docs/api/Quittio/Core/Enums/ChargeReasonCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |
| `$baseAmount` | `?string` = `null` | |
| `$exemptionReason` | `?string` = `null` | |
| `$exemptionReasonCode` | `[VatExemptionReasonCode](https://quittio.dev/docs/api/Quittio/Core/Enums/VatExemptionReasonCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `contractReference()`#

```
public function contractReference(?string $reference): static
```

Contract reference (BT-12); null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `creditTransfer()`#

```
public function creditTransfer(
    string $accountId,
    ?string $bic = null,
    ?string $accountName = null,
): static
```

Adds a further bank account (BG-17).

| Parameter | Type | Description |
| --- | --- | --- |
| `$accountId` | `string` | |
| `$bic` | `?string` = `null` | |
| `$accountName` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `currency()`#

```
public function currency(string $currency): static
```

Invoice currency (BT-5), ISO 4217; stored in upper case. Default EUR.

| Parameter | Type | Description |
| --- | --- | --- |
| `$currency` | `string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `custom()`#

```
public function custom(string $key, mixed $value): static
```

Free data for templates (view model key meta.custom); the same key replaces the value.

| Parameter | Type | Description |
| --- | --- | --- |
| `$key` | `string` | |
| `$value` | `mixed` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `defaultVat()`#

```
public function defaultVat(
    TaxPreset|VatCategory $presetOrCategory,
    BigDecimal|int|float|string|null $rate = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null,
): static
```

VAT treatment of the lines that set none (also sub lines), with the arguments of LineBuilder::vat(). Without it, the application default of useDefaultVat() applies.

| Parameter | Type | Description |
| --- | --- | --- |
| `$presetOrCategory` | `[TaxPreset](https://quittio.dev/docs/api/Quittio/Core/Tax/TaxPreset)\| [VatCategory](https://quittio.dev/docs/api/Quittio/Core/Enums/VatCategory)` | |
| `$rate` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |
| `$exemptionReason` | `?string` = `null` | |
| `$exemptionReasonCode` | `[VatExemptionReasonCode](https://quittio.dev/docs/api/Quittio/Core/Enums/VatExemptionReasonCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `deliverTo()`#

```
public function deliverTo(
    ?string $recipientName,
    ?Address $address = null,
    ?Identifier $locationId = null,
): static
```

Deliver-to party and address (BT-70, BG-15).

| Parameter | Type | Description |
| --- | --- | --- |
| `$recipientName` | `?string` | |
| `$address` | `? [Address](https://quittio.dev/docs/api/Quittio/Core/Data/Party/Address)` = `null` | |
| `$locationId` | `? [Identifier](https://quittio.dev/docs/api/Quittio/Core/Data/Identifier)` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `delivery()`#

```
public function delivery(Delivery $delivery): static
```

Replaces the whole delivery information (BG-13), including the delivery date (BT-72).

| Parameter | Type | Description |
| --- | --- | --- |
| `$delivery` | `[Delivery](https://quittio.dev/docs/api/Quittio/Core/Data/Delivery/Delivery)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `deliveryDate()`#

```
public function deliveryDate(Date|DateTimeInterface|string $date): static
```

Actual delivery or service date (BT-72).

| Parameter | Type | Description |
| --- | --- | --- |
| `$date` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `despatchAdviceReference()`#

```
public function despatchAdviceReference(?string $reference): static
```

Despatch advice reference (BT-16); null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `directDebit()`#

```
public function directDebit(
    ?string $mandateReference,
    ?string $creditorId = null,
    ?string $debitedIban = null,
): static
```

SEPA direct debit (BG-19): mandate reference (BT-89), creditor identifier (BT-90) and the debited IBAN (BT-91, spaces removed). Without payment instructions it starts them with SepaDirectDebit (59).

| Parameter | Type | Description |
| --- | --- | --- |
| `$mandateReference` | `?string` | |
| `$creditorId` | `?string` = `null` | |
| `$debitedIban` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `discountAmount()`#

```
public function discountAmount(
    BigDecimal|int|float|string $amount,
    ?string $reason = null,
    AllowanceReasonCode|RawCode|string|null $reasonCode = \Quittio\Core\Enums\AllowanceReasonCode::Discount,
): static
```

Absolute discount distributed over all VAT groups in proportion to their line totals.

| Parameter | Type | Description |
| --- | --- | --- |
| `$amount` | `Brick\Math\BigDecimal\|int\|float\|string` | |
| `$reason` | `?string` = `null` | |
| `$reasonCode` | `[AllowanceReasonCode](https://quittio.dev/docs/api/Quittio/Core/Enums/AllowanceReasonCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `\Quittio\Core\Enums\AllowanceReasonCode::Discount` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `discountPercent()`#

```
public function discountPercent(
    BigDecimal|int|float|string $percent,
    ?string $reason = null,
    AllowanceReasonCode|RawCode|string|null $reasonCode = \Quittio\Core\Enums\AllowanceReasonCode::Discount,
): static
```

Percentage discount on all lines. Split into one allowance per VAT group.

| Parameter | Type | Description |
| --- | --- | --- |
| `$percent` | `Brick\Math\BigDecimal\|int\|float\|string` | |
| `$reason` | `?string` = `null` | |
| `$reasonCode` | `[AllowanceReasonCode](https://quittio.dev/docs/api/Quittio/Core/Enums/AllowanceReasonCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `\Quittio\Core\Enums\AllowanceReasonCode::Discount` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `dueDate()`#

```
public function dueDate(Date|DateTimeInterface|string $date): static
```

Due date (BT-9). Without it the calculator derives it from dueInDays(); otherwise the configured due\_days apply when rendering, never for credit notes.

| Parameter | Type | Description |
| --- | --- | --- |
| `$date` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `dueInDays()`#

```
public function dueInDays(int $days): static
```

Payment target: the due date (BT-9) is the issue date plus $days unless dueDate() is set, and the payment terms say "Payable within … days without deduction." Continues the payment terms set before.

| Parameter | Type | Description |
| --- | --- | --- |
| `$days` | `int` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `exchangeRate()`#

```
public function exchangeRate(
    BigDecimal|int|float|string $rate,
    Date|DateTimeInterface|string|null $date = null,
): static
```

Exchange rate from the invoice currency to the VAT accounting currency (BT-6), used to calculate the VAT total in that currency (BT-111), with the date of the rate. Replaces a rate implied by declared amounts (see from()).

| Parameter | Type | Description |
| --- | --- | --- |
| `$rate` | `Brick\Math\BigDecimal\|int\|float\|string` | |
| `$date` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidArgumentException">InvalidArgumentException</a></code> – for a float</dd></dl>

### `extended()`#

```
public function extended(ExtendedData $extended): static
```

Data of the profile EXTENDED of ZUGFeRD/Factur-X (further parties, delivery terms, instalments …); other profiles do not write it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$extended` | `[ExtendedData](https://quittio.dev/docs/api/Quittio/Core/Data/Extensions/ExtendedData)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `flag()`#

```
public function flag(string $flag, bool $enabled = true): static
```

Sets a flag that country packs evaluate (e.g. a small amount invoice in Germany).

| Parameter | Type | Description |
| --- | --- | --- |
| `$flag` | `string` | |
| `$enabled` | `bool` = `true` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `flushMacros()`#

```
public static function flushMacros(): void
```

static

### `from()`#

```
public static function from(InvoiceData $data): static
```

static

Starts a builder from existing data, e.g. to change a draft.

For data with a declared VAT total in accounting currency (BT-111) but without exchange rate (e.g. read from XML) the implied rate is taken over, so that BT-111 is recalculated. Once lines, allowances, charges or the VAT accounting currency (BT-6) change, the implied rate is dropped: it is only as precise as the declared amounts and holds only for the declared currency, so set the rate with exchangeRate() (BR-53 otherwise). Percentage document allowances and charges on the line sum of their VAT group, and discounts split over the VAT groups (discountAmount(), discountPercent()), follow the lines when lines are added, changed or removed.

As long as nothing amount-relevant changes, declared line net amounts and the VAT breakdown that the recalculation does not reproduce (e.g. rounded per line by another system) are kept by the calculator (Meta::FLAG\_DECLARED\_AMOUNTS with a fingerprint of the amount inputs). Data flagged earlier whose amount inputs no longer match its fingerprint (e.g. changed with with() or in stored JSON) is treated as changed lines and recalculated.

The declared amounts are compared with the result of the default En16931Calculator; use fromUsing() or Quittio::edit() to compare with another calculator.

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `fromDocument()`#

```
public static function fromDocument(DocumentData $document): static
```

static

Starts an invoice from a quote, order confirmation, delivery note or proforma invoice: parties, billable lines, document allowances and charges and payment data are taken over; number and issue date must be set.

| Parameter | Type | Description |
| --- | --- | --- |
| `$document` | `[DocumentData](https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentData)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `fromUsing()`#

```
public static function fromUsing(InvoiceData $data, TotalsCalculator $calculator): static
```

static

Like from(), with the calculator that decides whether the declared amounts of the data differ from a recalculation, e.g. the calculator of the Quittio instance.

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |
| `$calculator` | `[TotalsCalculator](https://quittio.dev/docs/api/Quittio/Core/Calculation/TotalsCalculator)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `group()`#

```
public function group(string $id, string $title, bool $showSubtotal = true): static
```

Defines a line group for the PDF. Lines join it via LineBuilder::group().

| Parameter | Type | Description |
| --- | --- | --- |
| `$id` | `string` | |
| `$title` | `string` | |
| `$showSubtotal` | `bool` = `true` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `hasMacro()`#

```
public static function hasMacro(string $name): bool
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `invoicedObject()`#

```
public function invoicedObject(string $value, string|RawCode|null $scheme = null): static
```

Identifier of the invoiced object (BT-18), e.g. a meter or subscription number, with its scheme (BT-18-1).

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string` | |
| `$scheme` | `string\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `invoicingPeriod()`#

```
public function invoicingPeriod(
    Date|string|null $start,
    Date|string|null $end = null,
): static
```

Invoicing period (BG-14).

| Parameter | Type | Description |
| --- | --- | --- |
| `$start` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|string\|null` | |
| `$end` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `issueDate()`#

```
public function issueDate(Date|DateTimeInterface|string $date): static
```

Issue date (BT-2); default today. A DateTimeInterface is converted in the time zone of timezone(), so call timezone() first.

| Parameter | Type | Description |
| --- | --- | --- |
| `$date` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `lateFee()`#

```
public function lateFee(
    ?int $days = null,
    ?string $percent = null,
    ?string $text = null,
): static
```

Late payment terms: days, percentage and text. Continues the payment terms.

| Parameter | Type | Description |
| --- | --- | --- |
| `$days` | `?int` = `null` | |
| `$percent` | `?string` = `null` | |
| `$text` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `line()`#

```
public function line(
    InvoiceLine|LineBuilder|ProvidesInvoiceLine|array|callable|string $line,
    BigDecimal|int|float|string|null $netPrice = null,
    BigDecimal|int|float|string|null $quantity = null,
    UnitCode|RawCode|string|null $unit = null,
    TaxPreset|VatCategory|null $vat = null,
    ?string $description = null,
    BigDecimal|int|float|string|null $priceInclVat = null,
): static
```

Adds a line (BG-25): a name with the common values (->line('Consulting', netPrice: '120.00', quantity: 4, unit: UnitCode::Hour)), a LineBuilder (Line::make()), an array with the keys of LineBuilder::ARRAY\_KEYS, an application model (ProvidesInvoiceLine), a callable that receives a new LineBuilder, or a finished InvoiceLine.

| Parameter | Type | Description |
| --- | --- | --- |
| `$line` | `[InvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine)\| [LineBuilder](https://quittio.dev/docs/api/Quittio/Core/Builder/LineBuilder)\| [ProvidesInvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Contracts/ProvidesInvoiceLine)\|array\|callable\|string` | |
| `$netPrice` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |
| `$quantity` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |
| `$unit` | `[UnitCode](https://quittio.dev/docs/api/Quittio/Core/Enums/UnitCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |
| `$vat` | `[TaxPreset](https://quittio.dev/docs/api/Quittio/Core/Tax/TaxPreset)\| [VatCategory](https://quittio.dev/docs/api/Quittio/Core/Enums/VatCategory)\|null` = `null` | |
| `$description` | `?string` = `null` | |
| `$priceInclVat` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `lines()`#

```
public function lines(
    iterable<InvoiceLine|LineBuilder|ProvidesInvoiceLine|array<array-key, mixed>|callable(LineBuilder): mixed|string> $lines,
): static
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$lines` | `iterable< [InvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine)\| [LineBuilder](https://quittio.dev/docs/api/Quittio/Core/Builder/LineBuilder)\| [ProvidesInvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Contracts/ProvidesInvoiceLine)\|array<array-key, mixed>\|callable([LineBuilder](https://quittio.dev/docs/api/Quittio/Core/Builder/LineBuilder)): mixed\|string>` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `locale()`#

```
public function locale(string $locale): static
```

Language of the invoice: labels, generated texts and the exemption texts of presets. The locale of a render call wins; without both, the configured locale or the country default.

| Parameter | Type | Description |
| --- | --- | --- |
| `$locale` | `string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `macro()`#

```
public static function macro(string $name, callable $macro): void
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` | |
| `$macro` | `callable` | |

### `make()`#

```
public static function make(): static
```

static

A new, empty builder; type code 380 and the issue date today unless set.

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `note()`#

```
public function note(
    string $content,
    NoteSubjectCode|RawCode|string|null $subject = null,
): static
```

Adds an invoice note (BG-1): the text (BT-22) and an optional subject code (BT-21, UNTDID 4451, e.g. "REG" for regulatory information). Unknown codes are kept as RawCode.

| Parameter | Type | Description |
| --- | --- | --- |
| `$content` | `string` | |
| `$subject` | `[NoteSubjectCode](https://quittio.dev/docs/api/Quittio/Core/Enums/NoteSubjectCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `number()`#

```
public function number(string $number): static
```

Invoice number (BT-1). Not checked here; the validation requires it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$number` | `string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `payee()`#

```
public function payee(
    PayeeParty|PartyBuilder|string|callable $payee,
    ?string $identifier = null,
    ?string $legalRegistration = null,
    IdentifierScheme|RawCode|string|null $identifierScheme = null,
    IdentifierScheme|RawCode|string|null $legalRegistrationScheme = null,
): static
```

Payee (BG-10), if different from the seller (e.g. a factoring company): the name with the identifier (BT-60) and the legal registration identifier (BT-61) and their schemes, a PartyBuilder (Party::make('Factoring AG')->identifier(…)), a PayeeParty, or a callable that receives a PartyBuilder and, like seller() and buyer(), continues an earlier payee.

| Parameter | Type | Description |
| --- | --- | --- |
| `$payee` | `[PayeeParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/PayeeParty)\| [PartyBuilder](https://quittio.dev/docs/api/Quittio/Core/Builder/PartyBuilder)\|string\|callable` | |
| `$identifier` | `?string` = `null` | |
| `$legalRegistration` | `?string` = `null` | |
| `$identifierScheme` | `[IdentifierScheme](https://quittio.dev/docs/api/Quittio/Core/Enums/IdentifierScheme)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |
| `$legalRegistrationScheme` | `[IdentifierScheme](https://quittio.dev/docs/api/Quittio/Core/Enums/IdentifierScheme)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidArgumentException">InvalidArgumentException</a></code> – for identifiers or schemes next to a PayeeParty or a callable</dd></dl>

### `payment()`#

```
public function payment(
    PaymentMeansCode|RawCode|string $means,
    ?string $iban = null,
    ?string $bic = null,
    ?string $accountName = null,
    ?string $remittanceInformation = null,
    ?string $meansText = null,
): static
```

Payment instructions (BG-16) with an optional credit transfer account (BG-17).

A second call replaces the payment instructions: an account given here replaces the accounts, and data of other payment means is dropped (e.g. bank accounts when switching to direct debit). Without an account, existing accounts are kept for credit transfers (e.g. a seller default account); likewise card (BG-18) and direct debit (BG-19) data for card payments and direct debits. The remittance information (BT-83) is kept unless a new one is given. Further accounts are added with creditTransfer().

| Parameter | Type | Description |
| --- | --- | --- |
| `$means` | `[PaymentMeansCode](https://quittio.dev/docs/api/Quittio/Core/Enums/PaymentMeansCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string` | |
| `$iban` | `?string` = `null` | |
| `$bic` | `?string` = `null` | |
| `$accountName` | `?string` = `null` | |
| `$remittanceInformation` | `?string` = `null` | |
| `$meansText` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `paymentCard()`#

```
public function paymentCard(string $lastDigits, ?string $holderName = null): static
```

Payment card (BG-18): the last 4 to 6 digits of the card number (BT-87) and the holder (BT-88). Without payment instructions it starts them with BankCard (48).

| Parameter | Type | Description |
| --- | --- | --- |
| `$lastDigits` | `string` | |
| `$holderName` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidArgumentException">InvalidArgumentException</a></code> – for more or fewer digits</dd></dl>

### `paymentTerms()`#

```
public function paymentTerms(PaymentTerms|string|callable $terms): static
```

Payment terms (BT-20): a PaymentTerms object or a text replace earlier terms; a callable receives a PaymentTermsBuilder that continues the earlier terms, also those of a PaymentTerms object or of from(), like seller() and buyer().

| Parameter | Type | Description |
| --- | --- | --- |
| `$terms` | `[PaymentTerms](https://quittio.dev/docs/api/Quittio/Core/Data/Payment/PaymentTerms)\|string\|callable` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `precedingInvoice()`#

```
public function precedingInvoice(
    string $number,
    Date|DateTimeInterface|string|null $issueDate = null,
): static
```

Adds a reference to a preceding invoice (BG-3): its number (BT-25) and issue date (BT-26), e.g. for a corrected invoice or a credit note.

| Parameter | Type | Description |
| --- | --- | --- |
| `$number` | `string` | |
| `$issueDate` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `prepaid()`#

```
public function prepaid(BigDecimal|int|float|string $amount): static
```

Amount already paid (BT-113), e.g. received advance payments.

| Parameter | Type | Description |
| --- | --- | --- |
| `$amount` | `Brick\Math\BigDecimal\|int\|float\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `presentation()`#

```
public function presentation(Presentation|array|callable $presentation): static
```

Design of this invoice in PDF and HTML: a Presentation replaces it, an array changes single values (->presentation(\['introText' => 'Thank you for your order.', 'showGrossPrices' => true])), a callable receives the current Presentation and returns the new one.

| Parameter | Type | Description |
| --- | --- | --- |
| `$presentation` | `[Presentation](https://quittio.dev/docs/api/Quittio/Core/Data/Presentation/Presentation)\|array\|callable` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `projectReference()`#

```
public function projectReference(string $id, ?string $name = null): static
```

Project reference (BT-11) with the project name, which CII requires in addition to the identifier.

| Parameter | Type | Description |
| --- | --- | --- |
| `$id` | `string` | |
| `$name` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `purchaseOrderReference()`#

```
public function purchaseOrderReference(?string $reference): static
```

The buyer's purchase order reference (BT-13); null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `receivingAdviceReference()`#

```
public function receivingAdviceReference(?string $reference): static
```

Receiving advice reference (BT-15); null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `removeLine()`#

```
public function removeLine(string $id): static
```

Removes an existing line by its identifier (BT-126).

| Parameter | Type | Description |
| --- | --- | --- |
| `$id` | `string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `rounding()`#

```
public function rounding(BigDecimal|int|float|string $amount): static
```

Rounding amount (BT-114), e.g. cash rounding. Never use it to fix wrong totals.

| Parameter | Type | Description |
| --- | --- | --- |
| `$amount` | `Brick\Math\BigDecimal\|int\|float\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `salesOrderReference()`#

```
public function salesOrderReference(?string $reference): static
```

The seller's sales order reference (BT-14); null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `seller()`#

```
public function seller(SellerParty|PartyBuilder|ProvidesParty|callable $seller): static
```

The seller (BG-4).

A SellerParty, a PartyBuilder (Party::make()) or an application model (ProvidesParty) replaces the seller set before. If the builder was started with the defaults of a seller (applyDefaults(), e.g. Quittio::invoice() with the seller of config/quittio.php or the current Managed issuer), another seller gets nothing of them: everything they set is removed again, i.e. the bank account and the small business flag, for a Managed issuer also payment terms, presentation, locale, time zone and currency. Values the caller set on the builder stay, also when they were set before seller().

A callable receives the builder of the seller set before and changes it, e.g. ->seller(fn ($s) => $s->contact('Max Muster')); the seller stays the same, and so do its defaults.

| Parameter | Type | Description |
| --- | --- | --- |
| `$seller` | `[SellerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/SellerParty)\| [PartyBuilder](https://quittio.dev/docs/api/Quittio/Core/Builder/PartyBuilder)\| [ProvidesParty](https://quittio.dev/docs/api/Quittio/Core/Contracts/ProvidesParty)\|callable` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `source()`#

```
public function source(string $source): static
```

Origin of the data, e.g. "shop" (view model key meta.source).

| Parameter | Type | Description |
| --- | --- | --- |
| `$source` | `string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `standard()`#

```
public function standard(StandardVersion $version): static
```

Version of EN 16931 (BT-24 of the profile): 2017 (default) or 2026, which only the profile EN 16931 supports.

| Parameter | Type | Description |
| --- | --- | --- |
| `$version` | `[StandardVersion](https://quittio.dev/docs/api/Quittio/Core/Standards/StandardVersion)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `taxCurrency()`#

```
public function taxCurrency(
    string $currency,
    BigDecimal|int|float|string|null $exchangeRate = null,
    Date|DateTimeInterface|string|null $rateDate = null,
): static
```

VAT accounting currency (BT-6). With an exchange rate, BT-111 is calculated.

| Parameter | Type | Description |
| --- | --- | --- |
| `$currency` | `string` | |
| `$exchangeRate` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |
| `$rateDate` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `taxPointDate()`#

```
public function taxPointDate(Date|DateTimeInterface|string $date): static
```

Date when VAT becomes chargeable (BT-7), if it differs from the issue date. EN 16931 allows BT-7 or BT-8, not both (BR-CO-03).

| Parameter | Type | Description |
| --- | --- | --- |
| `$date` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `taxPointDateCode()`#

```
public function taxPointDateCode(TaxPointDateCode $code): static
```

Code of the date when VAT becomes chargeable (BT-8): issue, delivery or payment date. EN 16931 allows BT-7 or BT-8, not both (BR-CO-03).

| Parameter | Type | Description |
| --- | --- | --- |
| `$code` | `[TaxPointDateCode](https://quittio.dev/docs/api/Quittio/Core/Enums/TaxPointDateCode)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `taxRepresentative()`#

```
public function taxRepresentative(string $name, string $vatId, Address $address): static
```

The seller's tax representative (BG-11): name (BT-62), VAT identifier (BT-63) and postal address (BG-12).

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `string` | |
| `$vatId` | `string` | |
| `$address` | `[Address](https://quittio.dev/docs/api/Quittio/Core/Data/Party/Address)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `tenderReference()`#

```
public function tenderReference(?string $reference): static
```

Tender or lot reference (BT-17); null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$reference` | `?string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `timezone()`#

```
public function timezone(string $timezone): static
```

Time zone for DateTimeInterface values and for the default issue date; call it before the date setters.

| Parameter | Type | Description |
| --- | --- | --- |
| `$timezone` | `string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `type()`#

```
public function type(InvoiceTypeCode|RawCode|string $type): static
```

Type code (BT-3) from UNTDID 1001, e.g. 381 for a credit note; default 380. Unknown codes are kept as RawCode and reported by the validation.

| Parameter | Type | Description |
| --- | --- | --- |
| `$type` | `[InvoiceTypeCode](https://quittio.dev/docs/api/Quittio/Core/Enums/InvoiceTypeCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `updateLine()`#

```
public function updateLine(
    string $id,
    (callable(InvoiceLine): InvoiceLine)|null $change = null,
    BigDecimal|int|float|string|null $netPrice = null,
    BigDecimal|int|float|string|null $quantity = null,
    BigDecimal|int|float|string|null $priceInclVat = null,
    ?string $name = null,
    ?string $description = null,
): static
```

Changes an existing line, e.g. of a correction draft started with {@see self::from()}: with the named values ->updateLine('2', netPrice: '80.00', quantity: 3), or with a callable that receives the InvoiceLine and returns the changed one, e.g. ->updateLine('2', fn (InvoiceLine $l) => $l->with(\['note' => 'Delivered in two parts'])). The calculated line net amount is reset, and percentage allowances and charges on the line amount are recalculated from the new amount.

| Parameter | Type | Description |
| --- | --- | --- |
| `$id` | `string` | |
| `$change` | `(callable([InvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine)): [InvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine))\|null` = `null` | |
| `$netPrice` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |
| `$quantity` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |
| `$priceInclVat` | `Brick\Math\BigDecimal\|int\|float\|string\|null` = `null` | |
| `$name` | `?string` = `null` | |
| `$description` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `useDefaultVat()`#

```
public static function useDefaultVat(
    (callable(?string, bool): ?TaxPreset)|TaxPreset|null $default,
): void
```

static

Application default VAT of lines that set none, for invoices without defaultVat(): a preset, or a callable that receives the seller's country code and whether the invoice is flagged as small business invoice (Meta::FLAG\_SMALL\_BUSINESS) and returns a preset or null, e.g. Quittio\\Core\\Tax\\CountryDefaultVat. The Laravel integration sets it from quittio.defaults.vat; null removes it. Lines without VAT and without a default make build() fail (BG-30).

| Parameter | Type | Description |
| --- | --- | --- |
| `$default` | `(callable(?string, bool): ? [TaxPreset](https://quittio.dev/docs/api/Quittio/Core/Tax/TaxPreset))\| [TaxPreset](https://quittio.dev/docs/api/Quittio/Core/Tax/TaxPreset)\|null` | |

### `xrechnungExtension()`#

```
public function xrechnungExtension(XRechnungExtensionData $extension): static
```

Data of the XRechnung extension (e.g. third party payments), written only with the profile xrechnung-extension.

| Parameter | Type | Description |
| --- | --- | --- |
| `$extension` | `[XRechnungExtensionData](https://quittio.dev/docs/api/Quittio/Core/Data/Extensions/XRechnungExtensionData)` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/Builder/InvoiceBuilder#webpage","@type":"WebPage","description":"Fluent builder for InvoiceData.","name":"InvoiceBuilder – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Builder/InvoiceBuilder","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Builder/InvoiceBuilder"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```