API reference / Quittio \ Core \ Data \ Lines
InvoiceLine
final readonly class in quittio/core · uses Immutable
Quittio\Core\Data\Lines\InvoiceLine · Source
Invoice line (BG-25).
Properties#
| Property | Type | Description |
|---|---|---|
$allowances readonly | list<LineAllowance> | |
$buyerAccountingReference readonly | ?string | |
$charges readonly | list<LineCharge> | |
$extended readonly | ?LineExtendedData | |
$id readonly | string | |
$item readonly | Item | |
$lineReferences readonly | list<DocumentReference> | |
$netAmount readonly | ?Brick\Money\Money | |
$note readonly | ?string | |
$objectId readonly | ?Identifier | |
$orderLineReference readonly | ?string | |
$period readonly | ?Period | |
$presentation readonly | ?LinePresentation | |
$price readonly | Price | |
$quantity readonly | Brick\Math\BigDecimal | |
$subLines readonly | list<InvoiceLine> | |
$unit readonly | UnitCode|RawCode | |
$vat readonly | LineVat |
Methods#
| Method | Description |
|---|---|
->__construct() | |
->hasSubLines() | |
->with() | Returns a copy with the given properties replaced. |
->withNetPrice() | Copy with a new net price (BT-146); gross price and discount are dropped. |
->withPriceInclVat() | Copy with a new price including VAT (gross price mode). The calculator derives the net price again. |
__construct()#
public function __construct(
string $id,
BigDecimal $quantity,
UnitCode|RawCode $unit,
Price $price,
LineVat $vat,
Item $item,
?string $note = null,
?Identifier $objectId = null,
?Money $netAmount = null,
?string $orderLineReference = null,
?string $buyerAccountingReference = null,
?Period $period = null,
list<LineAllowance> $allowances = [],
list<LineCharge> $charges = [],
list<InvoiceLine> $subLines = [],
list<DocumentReference> $lineReferences = [],
?LineExtendedData $extended = null,
?LinePresentation $presentation = null,
)| Parameter | Type | Description |
|---|---|---|
$id | string | |
$quantity | Brick\Math\BigDecimal | |
$unit | UnitCode|RawCode | |
$price | Price | |
$vat | LineVat | |
$item | Item | |
$note | ?string = null | |
$objectId | ?Identifier = null | |
$netAmount | ?Brick\Money\Money = null | |
$orderLineReference | ?string = null | |
$buyerAccountingReference | ?string = null | |
$period | ?Period = null | |
$allowances | list<LineAllowance> = [] | |
$charges | list<LineCharge> = [] | |
$subLines | list<InvoiceLine> = [] | |
$lineReferences | list<DocumentReference> = [] | |
$extended | ?LineExtendedData = null | |
$presentation | ?LinePresentation = null |
hasSubLines()#
public function hasSubLines(): bool- Returns
bool
with()#
public function with(array<string, mixed> $changes): staticReturns a copy with the given properties replaced.
| Parameter | Type | Description |
|---|---|---|
$changes | array<string, mixed> |
- Returns
static
withNetPrice()#
public function withNetPrice(BigDecimal|int|float|string $price): selfCopy with a new net price (BT-146); gross price and discount are dropped.
| Parameter | Type | Description |
|---|---|---|
$price | Brick\Math\BigDecimal|int|float|string |
- Returns
self- Throws
InvalidArgumentException– for a line with a price including VAT: the gross price mode applies to all lines of an invoice, use withPriceInclVat()
withPriceInclVat()#
public function withPriceInclVat(BigDecimal|int|float|string $price): selfCopy with a new price including VAT (gross price mode). The calculator derives the net price again.
| Parameter | Type | Description |
|---|---|---|
$price | Brick\Math\BigDecimal|int|float|string |
- Returns
self- Throws
InvalidArgumentException– for a line with a net price, use withNetPrice()