PartyBuilder
in package
Fluent builder for the seller (BG-4), the buyer (BG-7) and the payee (BG-10).
Table of Contents
Methods
- additionalLegalInfo() : self
- The seller's additional legal information (BT-33), e.g. legal form and share capital; ignored for the buyer.
- address() : self
- Postal address (seller BG-5, buyer BG-8); the country code (ISO 3166-1 alpha-2) is uppercased. Required for seller and buyer.
- buildBuyer() : BuyerParty
- The buyer party (BG-7).
- buildPayee() : PayeeParty
- Payee (BG-10): name, the first identifier (BT-60) and the legal registration (BT-61); the other values of the builder do not belong to the payee.
- buildSeller() : SellerParty
- The seller party (BG-4).
- consumer() : self
- Marks the buyer as a consumer (B2C): gross prices, no e-invoice obligation.
- contact() : self
- Contact (seller BG-6, buyer BG-9): name, phone and e-mail. XRechnung requires all three for the seller.
- countryCode() : string|null
- Country code of the postal address set so far (BT-40, BT-55), e.g. for defaults that depend on the seller's country.
- electronicAddress() : self
- Electronic address (seller BT-34, buyer BT-49) with its EAS scheme; default e-mail (EM).
- fromBuyer() : self
- A builder with the values of an existing buyer.
- fromModel() : self
- Lets an application model fill this builder (ProvidesParty).
- fromPayee() : self
- A builder with the values of an existing payee.
- fromSeller() : self
- A builder with the values of an existing seller, e.g. to change one of them.
- identifier() : self
- Adds an identifier (BT-29 seller, BT-46 buyer, BT-60 payee), e.g. a GLN or the customer number. Buyer and payee take the first one.
- legalRegistration() : self
- Legal registration identifier, e.g. the commercial register number (seller BT-30, buyer BT-47, payee BT-61), with its scheme.
- name() : self
- Legal name: seller BT-27, buyer BT-44, payee BT-59. Required.
- postalAddress() : self
- Postal address as object, see address().
- taxNumber() : self
- The seller's tax registration number (BT-32), e.g. the German Steuernummer; ignored for the buyer.
- tradingName() : self
- Trading name: seller BT-28, buyer BT-45; null removes it.
- vatId() : self
- VAT identifier with country prefix, e.g. "DE123456789" (seller BT-31, buyer BT-48); uppercased, spaces removed; null removes it.
Methods
additionalLegalInfo()
The seller's additional legal information (BT-33), e.g. legal form and share capital; ignored for the buyer.
public
additionalLegalInfo(string|null $info) : self
Parameters
- $info : string|null
Return values
selfaddress()
Postal address (seller BG-5, buyer BG-8); the country code (ISO 3166-1 alpha-2) is uppercased. Required for seller and buyer.
public
address(string|null $line1, string|null $postcode, string|null $city, string $countryCode[, string|null $line2 = null ][, string|null $line3 = null ][, string|null $subdivision = null ]) : self
Parameters
- $line1 : string|null
- $postcode : string|null
- $city : string|null
- $countryCode : string
- $line2 : string|null = null
- $line3 : string|null = null
- $subdivision : string|null = null
Return values
selfbuildBuyer()
The buyer party (BG-7).
public
buildBuyer() : BuyerParty
Tags
Return values
BuyerPartybuildPayee()
Payee (BG-10): name, the first identifier (BT-60) and the legal registration (BT-61); the other values of the builder do not belong to the payee.
public
buildPayee() : PayeeParty
Return values
PayeePartybuildSeller()
The seller party (BG-4).
public
buildSeller() : SellerParty
Tags
Return values
SellerPartyconsumer()
Marks the buyer as a consumer (B2C): gross prices, no e-invoice obligation.
public
consumer([bool $consumer = true ]) : self
Parameters
- $consumer : bool = true
Return values
selfcontact()
Contact (seller BG-6, buyer BG-9): name, phone and e-mail. XRechnung requires all three for the seller.
public
contact([string|null $name = null ][, string|null $phone = null ][, string|null $email = null ]) : self
Parameters
- $name : string|null = null
- $phone : string|null = null
- $email : string|null = null
Return values
selfcountryCode()
Country code of the postal address set so far (BT-40, BT-55), e.g. for defaults that depend on the seller's country.
public
countryCode() : string|null
Return values
string|nullelectronicAddress()
Electronic address (seller BT-34, buyer BT-49) with its EAS scheme; default e-mail (EM).
public
electronicAddress(string $value[, ElectronicAddressScheme|RawCode|string $scheme = ElectronicAddressScheme::Email ]) : self
Required by XRechnung and Peppol.
Parameters
- $value : string
- $scheme : ElectronicAddressScheme|RawCode|string = ElectronicAddressScheme::Email
Return values
selffromBuyer()
A builder with the values of an existing buyer.
public
static fromBuyer(BuyerParty $buyer) : self
Parameters
- $buyer : BuyerParty
Return values
selffromModel()
Lets an application model fill this builder (ProvidesParty).
public
fromModel(ProvidesParty $model) : self
Parameters
- $model : ProvidesParty
Return values
selffromPayee()
A builder with the values of an existing payee.
public
static fromPayee(PayeeParty $payee) : self
Parameters
- $payee : PayeeParty
Return values
selffromSeller()
A builder with the values of an existing seller, e.g. to change one of them.
public
static fromSeller(SellerParty $seller) : self
Parameters
- $seller : SellerParty
Return values
selfidentifier()
Adds an identifier (BT-29 seller, BT-46 buyer, BT-60 payee), e.g. a GLN or the customer number. Buyer and payee take the first one.
public
identifier(string $value[, IdentifierScheme|RawCode|string|null $scheme = null ]) : self
Parameters
- $value : string
- $scheme : IdentifierScheme|RawCode|string|null = null
Return values
selflegalRegistration()
Legal registration identifier, e.g. the commercial register number (seller BT-30, buyer BT-47, payee BT-61), with its scheme.
public
legalRegistration(string|null $value[, IdentifierScheme|RawCode|string|null $scheme = null ]) : self
Parameters
- $value : string|null
- $scheme : IdentifierScheme|RawCode|string|null = null
Return values
selfname()
Legal name: seller BT-27, buyer BT-44, payee BT-59. Required.
public
name(string $name) : self
Parameters
- $name : string
Return values
selfpostalAddress()
Postal address as object, see address().
public
postalAddress(Address $address) : self
Parameters
- $address : Address
Return values
selftaxNumber()
The seller's tax registration number (BT-32), e.g. the German Steuernummer; ignored for the buyer.
public
taxNumber(string|null $taxNumber) : self
Parameters
- $taxNumber : string|null
Return values
selftradingName()
Trading name: seller BT-28, buyer BT-45; null removes it.
public
tradingName(string|null $tradingName) : self
Parameters
- $tradingName : string|null
Return values
selfvatId()
VAT identifier with country prefix, e.g. "DE123456789" (seller BT-31, buyer BT-48); uppercased, spaces removed; null removes it.
public
vatId(string|null $vatId) : self
Parameters
- $vatId : string|null