---
title: "DocumentBuilder – API-Referenz · Quittio"
description: "Fluent builder for documents. Parties, lines, notes, discounts and payment data work exactly like in the {@see InvoiceBuilder}."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentBuilder"
locale: de
meta:
  "og:description": "Fluent builder for documents. Parties, lines, notes, discounts and payment data work exactly like in the {@see InvoiceBuilder}."
  "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": "DocumentBuilder – 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) \\ [Documents](https://quittio.dev/docs/api/Quittio/Core/Documents)

# DocumentBuilder

class in quittio/core · uses [`Macroable`](https://quittio.dev/docs/api/Quittio/Core/Support/Macroable)

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

Fluent builder for documents. Parties, lines, notes, discounts and payment data work exactly like in the {@see InvoiceBuilder}.

## Properties \#

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

## Methods \#

| Method | Description |
| --- | --- |
| `->__construct()` | |
| `->__call()` | |
| `::accountStatement()` | An account statement (Kontoauszug): open items of a statementPeriod() with an opening balance. |
| `->alternativeLine()` | Alternative to another line, shown but not included in the totals. |
| `->bonus()` | The reduction of the net amount of one VAT rate of a bonus statement, as a line; the VAT of the reduction follows from the rate. For exempt supplies pass their category and exemption reason. |
| `->bonusAgreement()` | The agreement a bonus statement is based on, e.g. "der Bonusvereinbarung vom 15.01.2026"; the statement names it. |
| `->bonusInvoices()` | Numbers of the invoices a bonus statement concerns (optional, listed on the statement). |
| `->bonusOnRevenue()` | The reduction of one VAT rate as a percentage of the revenue of that rate in the period, e.g. 3 % of 100,000.00: a line of 3,000.00 with the revenue and the percentage as description. |
| `->bonusPeriod()` | Period of the supplies a bonus statement reduces, e.g. a calendar year. |
| `::bonusStatement()` | A bonus statement (Bonusabrechnung): the reduction of the consideration of the supplies of a bonusPeriod() under a bonusAgreement(), per VAT rate with bonus() or bonusOnRevenue() (in Germany section 17 (4) UStG). |
| `->build()` | The immutable document, not calculated yet (DocumentCalculator, or the render run). |
| `->buyer()` | |
| `->buyerReference()` | The buyer's reference; null removes it. |
| `->cashDiscount()` | Cash discount ("Skonto"), see InvoiceBuilder::cashDiscount(). |
| `->creditTransfer()` | Bank account for the payment, see InvoiceBuilder::creditTransfer(). |
| `->currency()` | Currency, ISO 4217; default EUR. |
| `->custom()` | Free data for templates (view model key meta.custom). |
| `->deadline()` | Payment deadline of a payment reminder. |
| `->defaultVat()` | VAT treatment of the lines that set none, see InvoiceBuilder::defaultVat(). |
| `->deliverTo()` | Deliver-to party: recipient name and address, see InvoiceBuilder::deliverTo(). |
| `->deliveryDate()` | Delivery date. |
| `::deliveryNote()` | A delivery note (Lieferschein), e.g. with packages and serialised lines. |
| `->discountAmount()` | Absolute discount on the lines that count towards the totals, see InvoiceBuilder::discountAmount(). |
| `->discountPercent()` | Percentage discount on the lines that count towards the totals, see InvoiceBuilder::discountPercent(). |
| `->dueInDays()` | Payment target in days, see InvoiceBuilder::dueInDays(). |
| `->fee()` | Adds a fee of a payment reminder, e.g. a reminder fee. |
| `->flatRate()` | Adds the flat rate for recovery costs of a late payment (Article 6 Directive 2011/7/EU; section 288 (5) BGB: 40 EUR) for one claim, e.g. an invoice or an instalment. It is owed once per late payment, only by businesses, and counts towards other recovery costs such as reminder fees, which may then be claimed only in so far as they exceed it. |
| `::flushMacros()` | |
| `::hasMacro()` | |
| `->interest()` | Default interest from $from (first day with interest) until $until (exclusive: the last day with interest is the day before). $dayCount null counts actual/actual (365 or 366 days per calendar year); 365 or 360 use a fixed basis, e.g. from the dayCount of the country pack's DunningLaw. |
| `->interestCharge()` | Adds calculated interest charges, e.g. of Dunning\\DefaultInterest::calculate(), with their own day count basis and texts. The base is taken over as amount in the document currency. |
| `->issueDate()` | Document date; default today. |
| `->line()` | A line in the forms of InvoiceBuilder::line(), e.g. ->line('Consulting', netPrice: '120.00'). |
| `->lines()` | |
| `->locale()` | Language of the document, see InvoiceBuilder::locale(). |
| `::macro()` | |
| `::make()` | A new builder for a document of $type. |
| `->note()` | Adds a note with an optional subject code, see InvoiceBuilder::note(). |
| `->number()` | Document number. |
| `->openingBalance()` | Opening balance of an account statement. |
| `->openItem()` | Adds an open invoice of a payment reminder or account statement: number, date, amount (string), due date, the amount paid so far and a description. |
| `->optionalLine()` | Optional quote line, shown with its price but not included in the totals. |
| `::orderConfirmation()` | An order confirmation (Auftragsbestätigung), e.g. with reference() to the quote. |
| `->package()` | Adds a package of a delivery note. |
| `::paymentReminder()` | |
| `->paymentTerms()` | |
| `->presentation()` | Design of this document, see InvoiceBuilder::presentation(). |
| `::proforma()` | A proforma invoice: looks like an invoice, but is not one for tax purposes. |
| `->purchaseOrderReference()` | The buyer's purchase order reference; null removes it. |
| `::quote()` | A quote (Angebot): lines, optional and alternative lines, validUntil(). |
| `->reference()` | Preceding document, e.g. the quote of an order confirmation or the order of a delivery note. |
| `->seller()` | |
| `->serialisedLine()` | Delivery note line with serial numbers. |
| `->statementPeriod()` | Period of an account statement. |
| `->tap()` | Direct access to the underlying invoice builder for everything not wrapped here. |
| `->validUntil()` | Date until which a quote is valid. |

### `__construct()`#

```
final public function __construct(DocumentType $type)
```

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

### `__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>

### `accountStatement()`#

```
public static function accountStatement(): static
```

static

An account statement (Kontoauszug): open items of a statementPeriod() with an opening balance.

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

### `alternativeLine()`#

```
public function alternativeLine(
    string $alternativeTo,
    InvoiceLine|LineBuilder|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
```

Alternative to another line, shown but not included in the totals.

| Parameter | Type | Description |
| --- | --- | --- |
| `$alternativeTo` | `string` | |
| `$line` | `[InvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine)\| [LineBuilder](https://quittio.dev/docs/api/Quittio/Core/Builder/LineBuilder)\|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>

### `bonus()`#

```
public function bonus(
    BigDecimal|int|string $net,
    TaxPreset|VatCategory $vat,
    BigDecimal|int|string|null $rate = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null,
    ?string $description = null,
): static
```

The reduction of the net amount of one VAT rate of a bonus statement, as a line; the VAT of the reduction follows from the rate. For exempt supplies pass their category and exemption reason.

| Parameter | Type | Description |
| --- | --- | --- |
| `$net` | `Brick\Math\BigDecimal\|int\|string` | |
| `$vat` | `[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\|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` | |
| `$description` | `?string` = `null` | |

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

### `bonusAgreement()`#

```
public function bonusAgreement(string $agreement): static
```

The agreement a bonus statement is based on, e.g. "der Bonusvereinbarung vom 15.01.2026"; the statement names it.

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

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

### `bonusInvoices()`#

```
public function bonusInvoices(string ...$numbers): static
```

Numbers of the invoices a bonus statement concerns (optional, listed on the statement).

| Parameter | Type | Description |
| --- | --- | --- |
| `...$numbers` | `string` | |

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

### `bonusOnRevenue()`#

```
public function bonusOnRevenue(
    BigDecimal|int|string $revenue,
    BigDecimal|int|string $percent,
    TaxPreset|VatCategory $vat,
    BigDecimal|int|string|null $rate = null,
    ?string $exemptionReason = null,
    VatExemptionReasonCode|RawCode|string|null $exemptionReasonCode = null,
): static
```

The reduction of one VAT rate as a percentage of the revenue of that rate in the period, e.g. 3 % of 100,000.00: a line of 3,000.00 with the revenue and the percentage as description.

| Parameter | Type | Description |
| --- | --- | --- |
| `$revenue` | `Brick\Math\BigDecimal\|int\|string` | |
| `$percent` | `Brick\Math\BigDecimal\|int\|string` | |
| `$vat` | `[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\|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>

### `bonusPeriod()`#

```
public function bonusPeriod(
    Date|DateTimeInterface|string $start,
    Date|DateTimeInterface|string $end,
): static
```

Period of the supplies a bonus statement reduces, e.g. a calendar year.

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

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

### `bonusStatement()`#

```
public static function bonusStatement(): static
```

static

A bonus statement (Bonusabrechnung): the reduction of the consideration of the supplies of a bonusPeriod() under a bonusAgreement(), per VAT rate with bonus() or bonusOnRevenue() (in Germany section 17 (4) UStG).

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

### `build()`#

```
public function build(): DocumentData
```

The immutable document, not calculated yet (DocumentCalculator, or the render run).

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentData">DocumentData</a></code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidInvoiceData">InvalidInvoiceData</a></code> – when the seller or the buyer is missing, or an item name or the VAT of a line without default VAT</dd></dl>

### `buyer()`#

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

| 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>

### `buyerReference()`#

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

The buyer's reference; null removes it.

| 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"), see InvoiceBuilder::cashDiscount().

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

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

### `creditTransfer()`#

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

Bank account for the payment, see InvoiceBuilder::creditTransfer().

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

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

### `currency()`#

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

Currency, ISO 4217; 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).

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

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

### `deadline()`#

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

Payment deadline of a payment reminder.

| 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>

### `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, see InvoiceBuilder::defaultVat().

| 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): static
```

Deliver-to party: recipient name and address, see InvoiceBuilder::deliverTo().

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

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

### `deliveryDate()`#

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

Delivery date.

| 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>

### `deliveryNote()`#

```
public static function deliveryNote(): static
```

static

A delivery note (Lieferschein), e.g. with packages and serialised lines.

<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 on the lines that count towards the totals, see InvoiceBuilder::discountAmount().

| 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 the lines that count towards the totals, see InvoiceBuilder::discountPercent().

| 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>

### `dueInDays()`#

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

Payment target in days, see InvoiceBuilder::dueInDays().

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

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

### `fee()`#

```
public function fee(string $description, BigDecimal|int|float|string $amount): static
```

Adds a fee of a payment reminder, e.g. a reminder fee.

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

<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 amount</dd></dl>

### `flatRate()`#

```
public function flatRate(
    string $claim,
    BigDecimal|int|string $amount = '40.00',
    ?string $description = null,
): static
```

Adds the flat rate for recovery costs of a late payment (Article 6 Directive 2011/7/EU; section 288 (5) BGB: 40 EUR) for one claim, e.g. an invoice or an instalment. It is owed once per late payment, only by businesses, and counts towards other recovery costs such as reminder fees, which may then be claimed only in so far as they exceed it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$claim` | `string` | |
| `$amount` | `Brick\Math\BigDecimal\|int\|string` = `'40.00'` | |
| `$description` | `?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 a float amount; when building, for a second flat rate of the same claim or a consumer as buyer</dd></dl>

### `flushMacros()`#

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

static

### `hasMacro()`#

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

static

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

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

### `interest()`#

```
public function interest(
    string $base,
    BigDecimal|string $ratePercent,
    Date|DateTimeInterface|string $from,
    Date|DateTimeInterface|string $until,
    ?string $description = null,
    ?int $dayCount = \Quittio\Core\Documents\InterestCharge::ACTUAL_ACTUAL,
): static
```

Default interest from $from (first day with interest) until $until (exclusive: the last day with interest is the day before). $dayCount null counts actual/actual (365 or 366 days per calendar year); 365 or 360 use a fixed basis, e.g. from the dayCount of the country pack's DunningLaw.

| Parameter | Type | Description |
| --- | --- | --- |
| `$base` | `string` | |
| `$ratePercent` | `Brick\Math\BigDecimal\|string` | |
| `$from` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string` | |
| `$until` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string` | |
| `$description` | `?string` = `null` | |
| `$dayCount` | `?int` = `\Quittio\Core\Documents\InterestCharge::ACTUAL_ACTUAL` | |

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

### `interestCharge()`#

```
public function interestCharge(InterestCharge ...$charges): static
```

Adds calculated interest charges, e.g. of Dunning\\DefaultInterest::calculate(), with their own day count basis and texts. The base is taken over as amount in the document currency.

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

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

### `issueDate()`#

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

Document date; default today.

| 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>

### `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,
    ?DocumentLineOptions $options = null,
): static
```

A line in the forms of InvoiceBuilder::line(), e.g. ->line('Consulting', netPrice: '120.00').

| 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` | |
| `$options` | `? [DocumentLineOptions](https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentLineOptions)` = `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 document, see InvoiceBuilder::locale().

| 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(DocumentType $type): static
```

static

A new builder for a document of $type.

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

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

### `note()`#

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

Adds a note with an optional subject code, see InvoiceBuilder::note().

| 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
```

Document number.

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

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

### `openingBalance()`#

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

Opening balance of an account statement.

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

<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 amount</dd></dl>

### `openItem()`#

```
public function openItem(
    string $invoiceNumber,
    Date|DateTimeInterface|string $invoiceDate,
    string $amount,
    Date|DateTimeInterface|string|null $dueDate = null,
    ?string $paid = null,
    ?string $description = null,
): static
```

Adds an open invoice of a payment reminder or account statement: number, date, amount (string), due date, the amount paid so far and a description.

| Parameter | Type | Description |
| --- | --- | --- |
| `$invoiceNumber` | `string` | |
| `$invoiceDate` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string` | |
| `$amount` | `string` | |
| `$dueDate` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)\|DateTimeInterface\|string\|null` = `null` | |
| `$paid` | `?string` = `null` | |
| `$description` | `?string` = `null` | |

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

### `optionalLine()`#

```
public function optionalLine(
    InvoiceLine|LineBuilder|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
```

Optional quote line, shown with its price but not included in the totals.

| 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)\|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>

### `orderConfirmation()`#

```
public static function orderConfirmation(): static
```

static

An order confirmation (Auftragsbestätigung), e.g. with reference() to the quote.

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

### `package()`#

```
public function package(Package $package): static
```

Adds a package of a delivery note.

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

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

### `paymentReminder()`#

```
public static function paymentReminder(int $level = 0): static
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$level` | `int` = `0` | 0 = payment reminder (Zahlungserinnerung), 1 = first formal reminder (1. Mahnung), 2 = second … |

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

### `paymentTerms()`#

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

| 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>

### `presentation()`#

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

Design of this document, see InvoiceBuilder::presentation().

| 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>

### `proforma()`#

```
public static function proforma(): static
```

static

A proforma invoice: looks like an invoice, but is not one for tax purposes.

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

### `purchaseOrderReference()`#

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

The buyer's purchase order reference; null removes it.

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

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

### `quote()`#

```
public static function quote(): static
```

static

A quote (Angebot): lines, optional and alternative lines, validUntil().

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

### `reference()`#

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

Preceding document, e.g. the quote of an order confirmation or the order of a delivery note.

| Parameter | Type | Description |
| --- | --- | --- |
| `$number` | `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>
</dl>

### `seller()`#

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

| 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>

### `serialisedLine()`#

```
public function serialisedLine(
    InvoiceLine|LineBuilder|array|callable|string $line,
    list<string> $serialNumbers,
    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
```

Delivery note line with serial numbers.

| 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)\|array\|callable\|string` | |
| `$serialNumbers` | `list<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>

### `statementPeriod()`#

```
public function statementPeriod(
    Date|DateTimeInterface|string $start,
    Date|DateTimeInterface|string $end,
): static
```

Period of an account statement.

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

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

### `tap()`#

```
public function tap(callable $callback): static
```

Direct access to the underlying invoice builder for everything not wrapped here.

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

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

### `validUntil()`#

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

Date until which a quote is valid.

| 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>

```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/Documents/DocumentBuilder#webpage","@type":"WebPage","description":"Fluent builder for documents. Parties, lines, notes, discounts and payment data work exactly like in the {@see InvoiceBuilder}.","name":"DocumentBuilder – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentBuilder","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentBuilder"]}],"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"}]}
```