---
title: "BuildsLines – API-Referenz · Quittio"
description: "Invoice lines (BG-25) and their groups."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsLines"
locale: de
meta:
  "og:description": "Invoice lines (BG-25) and their groups."
  "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": "BuildsLines – 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) \\ [Concerns](https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns)

# BuildsLines

trait in quittio/core

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

Invoice lines (BG-25) and their groups.

Part of `InvoiceBuilder`, which holds the state; use the builder, not the trait.

## Methods \#

| Method | Description |
| --- | --- |
| `->group()` | Defines a line group for the PDF. Lines join it via LineBuilder::group(). |
| `->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()` | |
| `->removeLine()` | Removes an existing line by its identifier (BT-126). |
| `->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. |

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

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

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

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

```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/Concerns/BuildsLines#webpage","@type":"WebPage","description":"Invoice lines (BG-25) and their groups.","name":"BuildsLines – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsLines","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Builder/Concerns/BuildsLines"]}],"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"}]}
```