API reference / Quittio \ Core \ Builder
Line
final class in quittio/core
Quittio\Core\Builder\Line · Source
Starts an invoice line for InvoiceBuilder::line() and lines() without a callback: ->line(Line::make('Consulting', netPrice: '120.00')->sellerId('C-1')). Simple lines need no builder: ->line('Consulting', netPrice: '120.00', quantity: 4, unit: UnitCode::Hour).
Methods#
| Method | Description |
|---|---|
::fromArray() | A line from an array whose keys are methods of the LineBuilder (LineBuilder::ARRAY_KEYS): ['name' => 'Consulting', 'quantity' => 4, 'netPrice' => '120.00']. |
::make() | A line builder with the name and, optionally, the most common values: the net price (BT-146) or the price including VAT (gross price mode), the quantity (default 1) and unit, the VAT treatment (default: the default VAT of the invoice) and the description. |
fromArray()#
public static function fromArray(array<array-key, mixed> $line): LineBuilderA line from an array whose keys are methods of the LineBuilder (LineBuilder::ARRAY_KEYS): ['name' => 'Consulting', 'quantity' => 4, 'netPrice' => '120.00'].
| Parameter | Type | Description |
|---|---|---|
$line | array<array-key, mixed> |
- Returns
LineBuilder
make()#
public static function make(
string $name,
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,
): LineBuilderA line builder with the name and, optionally, the most common values: the net price (BT-146) or the price including VAT (gross price mode), the quantity (default 1) and unit, the VAT treatment (default: the default VAT of the invoice) and the description.
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$netPrice | Brick\Math\BigDecimal|int|float|string|null = null | |
$quantity | Brick\Math\BigDecimal|int|float|string|null = null | |
$unit | UnitCode|RawCode|string|null = null | |
$vat | TaxPreset|VatCategory|null = null | |
$description | ?string = null | |
$priceInclVat | Brick\Math\BigDecimal|int|float|string|null = null |
- Returns
LineBuilder