Skip to content

API reference / Quittio \ Core \ Builder \ Concerns

BuildsParties

trait in quittio/core

Quittio\Core\Builder\Concerns\BuildsParties · Source

Seller, buyer, payee and tax representative (BG-4, BG-7, BG-10, BG-11).

Part of InvoiceBuilder, which holds the state; use the builder, not the trait.

Methods#

MethodDescription
->buyer()The buyer (BG-7): a BuyerParty, a PartyBuilder (Party::make()) or an application model (ProvidesParty), e.g. ->buyer($customer), replace the buyer set before; a callable receives the builder of the buyer set before and changes it.
->payee()Payee (BG-10), if different from the seller (e.g. a factoring company): the name with the identifier (BT-60) and the legal registration identifier (BT-61) and their schemes, a PartyBuilder (Party::make('Factoring AG')->identifier(…)), a PayeeParty, or a callable that receives a PartyBuilder and, like seller() and buyer(), continues an earlier payee.
->seller()The seller (BG-4).
->taxRepresentative()The seller's tax representative (BG-11): name (BT-62), VAT identifier (BT-63) and postal address (BG-12).

buyer()#

public function buyer(BuyerParty|PartyBuilder|ProvidesParty|callable $buyer): static

The buyer (BG-7): a BuyerParty, a PartyBuilder (Party::make()) or an application model (ProvidesParty), e.g. ->buyer($customer), replace the buyer set before; a callable receives the builder of the buyer set before and changes it.

ParameterTypeDescription
$buyerBuyerParty|PartyBuilder|ProvidesParty|callable
Returns
static

payee()#

public function payee(
    PayeeParty|PartyBuilder|string|callable $payee,
    ?string $identifier = null,
    ?string $legalRegistration = null,
    IdentifierScheme|RawCode|string|null $identifierScheme = null,
    IdentifierScheme|RawCode|string|null $legalRegistrationScheme = null,
): static

Payee (BG-10), if different from the seller (e.g. a factoring company): the name with the identifier (BT-60) and the legal registration identifier (BT-61) and their schemes, a PartyBuilder (Party::make('Factoring AG')->identifier(…)), a PayeeParty, or a callable that receives a PartyBuilder and, like seller() and buyer(), continues an earlier payee.

ParameterTypeDescription
$payeePayeeParty|PartyBuilder|string|callable
$identifier?string = null
$legalRegistration?string = null
$identifierSchemeIdentifierScheme|RawCode|string|null = null
$legalRegistrationSchemeIdentifierScheme|RawCode|string|null = null
Returns
static
Throws
InvalidArgumentException – for identifiers or schemes next to a PayeeParty or a callable

seller()#

public function seller(SellerParty|PartyBuilder|ProvidesParty|callable $seller): static

The seller (BG-4).

A SellerParty, a PartyBuilder (Party::make()) or an application model (ProvidesParty) replaces the seller set before. If the builder was started with the defaults of a seller (applyDefaults(), e.g. Quittio::invoice() with the seller of config/quittio.php or the current Managed issuer), another seller gets nothing of them: everything they set is removed again, i.e. the bank account and the small business flag, for a Managed issuer also payment terms, presentation, locale, time zone and currency. Values the caller set on the builder stay, also when they were set before seller().

A callable receives the builder of the seller set before and changes it, e.g. ->seller(fn ($s) => $s->contact('Max Muster')); the seller stays the same, and so do its defaults.

ParameterTypeDescription
$sellerSellerParty|PartyBuilder|ProvidesParty|callable
Returns
static

taxRepresentative()#

public function taxRepresentative(string $name, string $vatId, Address $address): static

The seller's tax representative (BG-11): name (BT-62), VAT identifier (BT-63) and postal address (BG-12).

ParameterTypeDescription
$namestring
$vatIdstring
$addressAddress
Returns
static

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