Line
in package
FinalYes
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).
Table of Contents
Methods
- fromArray() : LineBuilder
- A line from an array whose keys are methods of the LineBuilder (LineBuilder::ARRAY_KEYS): ['name' => 'Consulting', 'quantity' => 4, 'netPrice' => '120.00'].
- make() : LineBuilder
- 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.
Methods
fromArray()
A line from an array whose keys are methods of the LineBuilder (LineBuilder::ARRAY_KEYS): ['name' => 'Consulting', 'quantity' => 4, 'netPrice' => '120.00'].
public
static fromArray(array<string|int, mixed> $line) : LineBuilder
Parameters
- $line : array<string|int, mixed>
Return values
LineBuildermake()
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.
public
static 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|null $description = null ][, BigDecimal|int|float|string|null $priceInclVat = null ]) : LineBuilder
Parameters
- $name : string
- $netPrice : BigDecimal|int|float|string|null = null
- $quantity : BigDecimal|int|float|string|null = null
- $unit : UnitCode|RawCode|string|null = null
- $vat : TaxPreset|VatCategory|null = null
- $description : string|null = null
- $priceInclVat : BigDecimal|int|float|string|null = null