Skip to content

\Einvoicing\Invoice

__construct()

Invoice constructor

public __construct($preset: string|null = null)

Parameters

  • $preset: string|null — Preset classname or NULL for blank invoice

Throws


getDecimals()

Get number of decimal places for a given field

public getDecimals($field: string): int

Parameters

  • $field: string — Field name

Returns

  • int — Number of decimal places

round()

Round value

public round($value: float, $field: string): float

Parameters

  • $value: float — Value to round
  • $field: string — Field name

Returns

  • float — Rounded value

setRoundingMatrix()

Set rounding matrix

public setRoundingMatrix($matrix: mixed[]): \Einvoicing\Invoice

Parameters

  • $matrix: mixed[] — Rounding matrix

Returns


getSpecification()

Get specification identifier

public getSpecification(): string|null

Returns

  • string|null — Specification identifier

setSpecification()

Set specification identifier

public setSpecification($specification: string): \Einvoicing\Invoice

Parameters

  • $specification: string — Specification identifier

Returns


getBusinessProcess()

Get business process type

public getBusinessProcess(): string|null

Returns

  • string|null — Business process type

setBusinessProcess()

Set business process type

public setBusinessProcess($businessProcess: string|null): \Einvoicing\Invoice

Parameters

  • $businessProcess: string|null — Business process type

Returns


getNumber()

Get invoice number

public getNumber(): string|null

Returns

  • string|null — Invoice number

setNumber()

Set invoice number

public setNumber($number: string): \Einvoicing\Invoice

Parameters

  • $number: string — Invoice number

Returns


getType()

Get invoice type code

public getType(): int

Returns

  • int — Invoice type code

setType()

Set invoice type code

public setType($typeCode: int): \Einvoicing\Invoice

Parameters

  • $typeCode: int — Invoice type code

Returns


getCurrency()

Get document currency code

public getCurrency(): string

Returns

  • string — Document currency code

setCurrency()

Set document currency code

public setCurrency($currencyCode: string): \Einvoicing\Invoice

Parameters

  • $currencyCode: string — Document currency code

Returns


getVatCurrency()

Get VAT accounting currency code

public getVatCurrency(): string|null

Returns

  • string|null — VAT accounting currency code or NULL if same as document's

setVatCurrency()

Set VAT accounting currency code

public setVatCurrency($currencyCode: string|null): \Einvoicing\Invoice

Parameters

  • $currencyCode: string|null — VAT accounting currency code or NULL if same as document's

Returns


getIssueDate()

Get invoice issue date

public getIssueDate(): \DateTime|null

Returns


setIssueDate()

Set invoice issue date

public setIssueDate($issueDate: \DateTime): \Einvoicing\Invoice

Parameters

  • $issueDate: \DateTime — Invoice issue date

Returns


getDueDate()

Get payment due date

public getDueDate(): \DateTime|null

Returns


setDueDate()

Set payment due date

public setDueDate($dueDate: \DateTime|null): \Einvoicing\Invoice

Parameters

  • $dueDate: \DateTime|null — Payment due date

Returns


getTaxPointDate()

Get tax point date

public getTaxPointDate(): \DateTime|null

Returns


setTaxPointDate()

Set tax point date

public setTaxPointDate($taxPointDate: \DateTime|null): \Einvoicing\Invoice

Parameters

  • $taxPointDate: \DateTime|null — Tax point date

Returns


getNotes()

Get invoice notes

public getNotes(): string[]

Returns

  • string[] — Invoice notes

addNote()

Add invoice note

public addNote($note: string): \Einvoicing\Invoice

Parameters

  • $note: string — Invoice note

Returns


removeNote()

Remove invoice note

public removeNote($index: int): \Einvoicing\Invoice

Parameters

  • $index: int — Invoice note index

Returns

Throws


clearNotes()

Clear all invoice notes

public clearNotes(): \Einvoicing\Invoice

Returns


getNote()

Get invoice note

Deprecated since v0.2.1

Use \Einvoicing\Invoice::getNotes() instead.

public getNote(): string|null

Returns

  • string|null — Invoice note

setNote()

Set invoice note

Deprecated since v0.2.1

Use \Einvoicing\Invoice::addNote() instead.

public setNote($note: string|null): \Einvoicing\Invoice

Parameters

  • $note: string|null — Invoice note

Returns


getBuyerReference()

Get buyer reference

public getBuyerReference(): string|null

Returns

  • string|null — Buyer reference

setBuyerReference()

Set buyer reference

public setBuyerReference($buyerReference: string|null): \Einvoicing\Invoice

Parameters

  • $buyerReference: string|null — Buyer reference

Returns


getPurchaseOrderReference()

Get purchase order reference

public getPurchaseOrderReference(): string|null

Returns

  • string|null — Purchase order reference

setPurchaseOrderReference()

Set purchase order reference

public setPurchaseOrderReference($purchaseOrderReference: string|null): \Einvoicing\Invoice

Parameters

  • $purchaseOrderReference: string|null — Purchase order reference

Returns


getSalesOrderReference()

Get sales order reference

public getSalesOrderReference(): string|null

Returns

  • string|null — Sales order reference

setSalesOrderReference()

Set sales order reference

public setSalesOrderReference($salesOrderReference: string|null): \Einvoicing\Invoice

Parameters

  • $salesOrderReference: string|null — Sales order reference

Returns


getTenderOrLotReference()

Get tender or lot reference

public getTenderOrLotReference(): string|null

Returns

  • string|null — Tender or lot reference

setTenderOrLotReference()

Set tender or lot reference

public setTenderOrLotReference($tenderOrLotReference: string|null): \Einvoicing\Invoice

Parameters

  • $tenderOrLotReference: string|null — Tender or lot reference

Returns


getContractReference()

Get contract reference

public getContractReference(): string|null

Returns

  • string|null — Contract reference

setContractReference()

Set contract reference

public setContractReference($contractReference: string|null): \Einvoicing\Invoice

Parameters

  • $contractReference: string|null — Contract reference

Returns


getPaidAmount()

Get invoice prepaid amount

public getPaidAmount(): float

Returns

  • float — Invoice prepaid amount

setPaidAmount()

Set invoice prepaid amount

public setPaidAmount($paidAmount: float): \Einvoicing\Invoice

Parameters

  • $paidAmount: float — Invoice prepaid amount

Returns


getRoundingAmount()

Get invoice rounding amount

public getRoundingAmount(): float

Returns

  • float — Invoice rounding amount

setRoundingAmount()

Set invoice rounding amount

public setRoundingAmount($roundingAmount: float): \Einvoicing\Invoice

Parameters

  • $roundingAmount: float — Invoice rounding amount

Returns


getCustomVatAmount()

Get total VAT amount in VAT accounting currency

public getCustomVatAmount(): float|null

Returns

  • float|null — Total amount in accounting currency

setCustomVatAmount()

Set total VAT amount in VAT accounting currency

public setCustomVatAmount($customVatAmount: float|null): \Einvoicing\Invoice

Parameters

  • $customVatAmount: float|null — Total amount in accounting currency

Returns


getSeller()

Get seller

public getSeller(): \Einvoicing\Party|null

Returns


setSeller()

Set seller

public setSeller($seller: \Einvoicing\Party): \Einvoicing\Invoice

Parameters

Returns


getBuyer()

Get buyer

public getBuyer(): \Einvoicing\Party|null

Returns


setBuyer()

Set buyer

public setBuyer($buyer: \Einvoicing\Party): \Einvoicing\Invoice

Parameters

Returns


getPayee()

Get payee

public getPayee(): \Einvoicing\Party|null

Returns


setPayee()

Set payee

public setPayee($payee: \Einvoicing\Party|null): \Einvoicing\Invoice

Parameters

Returns


getDelivery()

Get delivery information

public getDelivery(): \Einvoicing\Delivery|null

Returns


setDelivery()

Set delivery information

public setDelivery($delivery: \Einvoicing\Delivery|null): \Einvoicing\Invoice

Parameters

Returns


getPayment()

Get payment information

public getPayment(): \Einvoicing\Payments\Payment|null

Returns


setPayment()

Set payment information

public setPayment($payment: \Einvoicing\Payments\Payment|null): \Einvoicing\Invoice

Parameters

Returns


getLines()

Get invoice lines

public getLines(): \Einvoicing\InvoiceLine[]

Returns


addLine()

Add invoice line

public addLine($line: \Einvoicing\InvoiceLine): \Einvoicing\Invoice

Parameters

Returns


removeLine()

Remove invoice line

public removeLine($index: int): \Einvoicing\Invoice

Parameters

  • $index: int — Invoice line index

Returns

Throws


clearLines()

Clear all invoice lines

public clearLines(): \Einvoicing\Invoice

Returns


getTotals()

Get invoice total

public getTotals($round: bool = true): \Einvoicing\Models\InvoiceTotals

Parameters

  • $round: bool — Whether to round values or not

Returns


getAllowances()

Get allowances

public getAllowances(): \Einvoicing\AllowanceOrCharge[]

Returns


addAllowance()

Add allowance

public addAllowance($allowance: \Einvoicing\AllowanceOrCharge): \Einvoicing\Invoice

Parameters

Returns


removeAllowance()

Remove allowance

public removeAllowance($index: int): \Einvoicing\Invoice

Parameters

  • $index: int — Allowance index

Returns

Throws


clearAllowances()

Clear all allowances

public clearAllowances(): \Einvoicing\Invoice

Returns


getCharges()

Get charges

public getCharges(): \Einvoicing\AllowanceOrCharge[]

Returns


addCharge()

Add charge

public addCharge($charge: \Einvoicing\AllowanceOrCharge): \Einvoicing\Invoice

Parameters

Returns


removeCharge()

Remove charge

public removeCharge($index: int): \Einvoicing\Invoice

Parameters

  • $index: int — Charge index

Returns

Throws


clearCharges()

Clear all charges

public clearCharges(): \Einvoicing\Invoice

Returns


getAttachments()

Get attachments

public getAttachments(): \Einvoicing\Attachment[]

Returns


addAttachment()

Add attachment

public addAttachment($attachment: \Einvoicing\Attachment): \Einvoicing\Invoice

Parameters

Returns


removeAttachment()

Remove attachment

public removeAttachment($index: int): \Einvoicing\Invoice

Parameters

  • $index: int — Attachment index

Returns

Throws


clearAttachments()

Clear all attachments

public clearAttachments(): \Einvoicing\Invoice

Returns


getBuyerAccountingReference()

Get buyer accounting reference

public getBuyerAccountingReference(): string|null

Returns

  • string|null — Buyer accounting reference

setBuyerAccountingReference()

Set buyer accounting reference

public setBuyerAccountingReference($buyerAccountingReference: string|null): \Einvoicing\Invoice

Parameters

  • $buyerAccountingReference: string|null — Buyer accounting reference

Returns


getPeriodStartDate()

Get period start date

public getPeriodStartDate(): \DateTime|null

Returns


setPeriodStartDate()

Set period start date

public setPeriodStartDate($periodStartDate: \DateTime|null): \Einvoicing\Invoice

Parameters

  • $periodStartDate: \DateTime|null — Period start date

Returns


getPeriodEndDate()

Get period end date

public getPeriodEndDate(): \DateTime|null

Returns


setPeriodEndDate()

Set period end date

public setPeriodEndDate($periodEndDate: \DateTime|null): \Einvoicing\Invoice

Parameters

  • $periodEndDate: \DateTime|null — Period end date

Returns


validate()

Validate invoice

public validate()

Throws


getPrecedingInvoiceReferences()

Get preceding invoice references

public getPrecedingInvoiceReferences(): \Einvoicing\InvoiceReference[]

Returns


addPrecedingInvoiceReference()

Add preceding invoice reference

public addPrecedingInvoiceReference($reference: \Einvoicing\InvoiceReference): \Einvoicing\Invoice

Parameters

Returns


removePrecedingInvoiceReference()

Remove preceding invoice reference

public removePrecedingInvoiceReference($index: int): \Einvoicing\Invoice

Parameters

  • $index: int — Preceding invoice reference index

Returns

Throws


clearPrecedingInvoiceReferences()

Clear all preceding invoice references

public clearPrecedingInvoiceReferences(): \Einvoicing\Invoice

Returns