Zum Inhalt springen

API reference / Quittio \ Core \ Testing

InvoiceFactory

final class in quittio/core

Quittio\Core\Testing\InvoiceFactory · Source

Test data factory: InvoiceData::factory()->reverseCharge()->withLines(5)->make().

Deterministic (no random values), so that snapshots stay stable.

Methods#

MethodDescription
->b2c()
->builder()
->calculated()Invoice data with totals and VAT breakdown, calculated with $calculator (default: En16931Calculator).
->creditNote()
->currency()
->export()
->intraCommunity()
->make()Uncalculated invoice data.
::new()
->number()
->reverseCharge()
->state()Free modification of the builder.
->withLines()

b2c()#

public function b2c(): self
Returns
self

builder()#

public function builder(): InvoiceBuilder
Returns
InvoiceBuilder

calculated()#

public function calculated(?TotalsCalculator $calculator = null): InvoiceData

Invoice data with totals and VAT breakdown, calculated with $calculator (default: En16931Calculator).

ParameterTypeDescription
$calculator?TotalsCalculator = null
Returns
InvoiceData

creditNote()#

public function creditNote(): self
Returns
self

currency()#

public function currency(string $currency): self
ParameterTypeDescription
$currencystring
Returns
self

export()#

public function export(): self
Returns
self

intraCommunity()#

public function intraCommunity(): self
Returns
self

make()#

public function make(): InvoiceData

Uncalculated invoice data.

Returns
InvoiceData

new()#

public static function new(): self

static

Returns
self

number()#

public function number(string $number): self
ParameterTypeDescription
$numberstring
Returns
self

reverseCharge()#

public function reverseCharge(): self
Returns
self

state()#

public function state(callable $state): self

Free modification of the builder.

ParameterTypeDescription
$statecallable
Returns
self

withLines()#

public function withLines(int $count): self
ParameterTypeDescription
$countint
Returns
self

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.