Skip to content

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#

PropertyTypeDescription
$allowances readonlylist<LineAllowance>
$buyerAccountingReference readonly?string
$charges readonlylist<LineCharge>
$extended readonly?LineExtendedData
$id readonlystring
$item readonlyItem
$lineReferences readonlylist<DocumentReference>
$netAmount readonly?Brick\Money\Money
$note readonly?string
$objectId readonly?Identifier
$orderLineReference readonly?string
$period readonly?Period
$presentation readonly?LinePresentation
$price readonlyPrice
$quantity readonlyBrick\Math\BigDecimal
$subLines readonlylist<InvoiceLine>
$unit readonlyUnitCode|RawCode
$vat readonlyLineVat

Methods#

MethodDescription
->__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,
)
ParameterTypeDescription
$idstring
$quantityBrick\Math\BigDecimal
$unitUnitCode|RawCode
$pricePrice
$vatLineVat
$itemItem
$note?string = null
$objectId?Identifier = null
$netAmount?Brick\Money\Money = null
$orderLineReference?string = null
$buyerAccountingReference?string = null
$period?Period = null
$allowanceslist<LineAllowance> = []
$chargeslist<LineCharge> = []
$subLineslist<InvoiceLine> = []
$lineReferenceslist<DocumentReference> = []
$extended?LineExtendedData = null
$presentation?LinePresentation = null

hasSubLines()#

public function hasSubLines(): bool
Returns
bool

with()#

public function with(array<string, mixed> $changes): static

Returns a copy with the given properties replaced.

ParameterTypeDescription
$changesarray<string, mixed>
Returns
static

withNetPrice()#

public function withNetPrice(BigDecimal|int|float|string $price): self

Copy with a new net price (BT-146); gross price and discount are dropped.

ParameterTypeDescription
$priceBrick\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): self

Copy with a new price including VAT (gross price mode). The calculator derives the net price again.

ParameterTypeDescription
$priceBrick\Math\BigDecimal|int|float|string
Returns
self
Throws
InvalidArgumentException – for a line with a net price, use withNetPrice()

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.