InvoiceComposerRequest
in package
Complete input of {@see \App\UI\Api\Invoicer\Models\Generators\InvoiceComposer::compose()}.
Another module uses it to say "issue me an invoice for this" without knowing the inner fields
of the Invoice entity or the order they are filled in. What is not in this DTO the composer
does not fill, except values derived from the seller or directory and fallbacks from the
settings of module 7.
Deliberately absent:
orderId:Invoice.order_idalready mixes two id spaces (eshop and legacy payments) and must not be reused to link a foreign module. The caller keeps the link on its own side.totalPrice,totalPriceWithVat,rounding*: computed byInvoiceCalculatorinbeforeSave; a client-supplied number is not trusted.pdf,qrCode: filled byInvoiceManager::completedSave()after the commit.localizationId: the write goes through a Doctrine association and the composer must not inject the entity manager (only the manager tier may). The invoice therefore gets the currency-based formatting fallback; whoever needs a fixed localization sets it on the entity beforesave().
The private constructor keeps it out of DI search, see InvoiceComposerLine.
Table of Contents
Properties
- $billingLineId : int|null
- $creationDate : DateTime|null
- $currencyId : int
- $customer : InvoiceComposerCustomer|null
- $customerIsBusiness : bool|null
- $defaultUnit : string|null
- $dueDate : DateTime|null
- $duePeriod : int|null
- $emailTo : string|null
- $informations : string|null
- $invoiceTypeId : int
- $languageId : int|null
- $lines : array<string|int, mixed>
- $number : string|null
- $paymentRegionId : int|null
- $pdfTemplateVariantId : int|null
- $productTypeId : int|null
- $sellerBankAccountId : int|null
- $sellerContactId : int|null
- $sellerId : int
- $sendEmail : bool
- $status : string
- $supplyKindId : int|null
- $supplyPlaceCountryCode : string|null
- $taxableSupplyDate : DateTime|null
- $taxOverride : InvoiceTaxOverride|null
- $userTypeId : int|null
- $useVat : bool|null
- $variableSymbol : string|null
- $vatPercents : int|float|string|null
Methods
- create() : self
- The only way to create a request; call it with named arguments.
- __construct() : mixed
Properties
$billingLineId read-only
public
int|null
$billingLineId
= null
$creationDate read-only
public
DateTime|null
$creationDate
= null
$currencyId read-only
public
int
$currencyId
= 0
$customer read-only
public
InvoiceComposerCustomer|null
$customer
= null
$customerIsBusiness read-only
public
bool|null
$customerIsBusiness
= null
$defaultUnit read-only
public
string|null
$defaultUnit
= null
$dueDate read-only
public
DateTime|null
$dueDate
= null
$duePeriod read-only
public
int|null
$duePeriod
= null
$emailTo read-only
public
string|null
$emailTo
= null
$informations read-only
public
string|null
$informations
= null
$invoiceTypeId read-only
public
int
$invoiceTypeId
= 0
$languageId read-only
public
int|null
$languageId
= null
$lines read-only
public
array<string|int, mixed>
$lines
= []
$number read-only
public
string|null
$number
= null
$paymentRegionId read-only
public
int|null
$paymentRegionId
= null
$pdfTemplateVariantId read-only
public
int|null
$pdfTemplateVariantId
= null
$productTypeId read-only
public
int|null
$productTypeId
= null
$sellerBankAccountId read-only
public
int|null
$sellerBankAccountId
= null
$sellerContactId read-only
public
int|null
$sellerContactId
= null
$sellerId read-only
public
int
$sellerId
= 0
$sendEmail read-only
public
bool
$sendEmail
= false
$status read-only
public
string
$status
= 'unpaid'
$supplyKindId read-only
public
int|null
$supplyKindId
= null
$supplyPlaceCountryCode read-only
public
string|null
$supplyPlaceCountryCode
= null
$taxableSupplyDate read-only
public
DateTime|null
$taxableSupplyDate
= null
$taxOverride read-only
public
InvoiceTaxOverride|null
$taxOverride
= null
$userTypeId read-only
public
int|null
$userTypeId
= null
$useVat read-only
public
bool|null
$useVat
= null
$variableSymbol read-only
public
string|null
$variableSymbol
= null
$vatPercents read-only
public
int|float|string|null
$vatPercents
= null
Methods
create()
The only way to create a request; call it with named arguments.
public
static create(int $sellerId, int $currencyId, int $invoiceTypeId, array<int, InvoiceComposerLine> $lines[, InvoiceComposerCustomer|null $customer = null ][, int|null $billingLineId = null ][, string|null $number = null ][, bool|null $useVat = null ][, int|float|string|null $vatPercents = null ][, int|null $supplyKindId = null ][, InvoiceTaxOverride|null $taxOverride = null ][, string|null $supplyPlaceCountryCode = null ][, bool|null $customerIsBusiness = null ][, string|null $defaultUnit = null ][, int|null $sellerContactId = null ][, int|null $sellerBankAccountId = null ][, int|null $productTypeId = null ][, int|null $userTypeId = null ][, int|null $paymentRegionId = null ][, int|null $languageId = null ][, DateTime|null $creationDate = null ][, DateTime|null $taxableSupplyDate = null ][, DateTime|null $dueDate = null ][, int|null $duePeriod = null ][, string $status = 'unpaid' ][, string|null $variableSymbol = null ][, string|null $informations = null ][, bool $sendEmail = false ][, string|null $emailTo = null ][, int|null $pdfTemplateVariantId = null ]) : self
Parameters
- $sellerId : int
- $currencyId : int
- $invoiceTypeId : int
- $lines : array<int, InvoiceComposerLine>
- $customer : InvoiceComposerCustomer|null = null
- $billingLineId : int|null = null
- $number : string|null = null
- $useVat : bool|null = null
- $vatPercents : int|float|string|null = null
- $supplyKindId : int|null = null
- $taxOverride : InvoiceTaxOverride|null = null
- $supplyPlaceCountryCode : string|null = null
- $customerIsBusiness : bool|null = null
- $defaultUnit : string|null = null
- $sellerContactId : int|null = null
- $sellerBankAccountId : int|null = null
- $productTypeId : int|null = null
- $userTypeId : int|null = null
- $paymentRegionId : int|null = null
- $languageId : int|null = null
- $creationDate : DateTime|null = null
- $taxableSupplyDate : DateTime|null = null
- $dueDate : DateTime|null = null
- $duePeriod : int|null = null
- $status : string = 'unpaid'
- $variableSymbol : string|null = null
- $informations : string|null = null
- $sendEmail : bool = false
- $emailTo : string|null = null
- $pdfTemplateVariantId : int|null = null
Return values
self__construct()
private
__construct([int $sellerId = 0 ][, int $currencyId = 0 ][, int $invoiceTypeId = 0 ][, InvoiceComposerCustomer|null $customer = null ][, array<int, InvoiceComposerLine> $lines = [] ][, int|null $billingLineId = null ][, string|null $number = null ][, bool|null $useVat = null ][, int|float|string|null $vatPercents = null ][, int|null $supplyKindId = null ][, InvoiceTaxOverride|null $taxOverride = null ][, string|null $supplyPlaceCountryCode = null ][, bool|null $customerIsBusiness = null ][, string|null $defaultUnit = null ][, int|null $sellerContactId = null ][, int|null $sellerBankAccountId = null ][, int|null $productTypeId = null ][, int|null $userTypeId = null ][, int|null $paymentRegionId = null ][, int|null $languageId = null ][, DateTime|null $creationDate = null ][, DateTime|null $taxableSupplyDate = null ][, DateTime|null $dueDate = null ][, int|null $duePeriod = null ][, string $status = 'unpaid' ][, string|null $variableSymbol = null ][, string|null $informations = null ][, bool $sendEmail = false ][, string|null $emailTo = null ][, int|null $pdfTemplateVariantId = null ]) : mixed
Parameters
- $sellerId : int = 0
-
required; seller from the Invoicer directory. The composer builds the
seller_*snapshot from it and an unknown id is a hard error (an invoice without a seller header must not reach the customer). - $currencyId : int = 0
-
required; invoice currency. Without it no payment QR code is generated and the PDF cannot format amounts.
- $invoiceTypeId : int = 0
-
required; invoice type, the source of the PDF variant matrix and of a possible custom number line.
- $customer : InvoiceComposerCustomer|null = null
-
customer;
nullmeans an invoice without a customer (internal or proforma print), accepted as a deliberate choice of the caller - $lines : array<int, InvoiceComposerLine> = []
-
billed lines; an empty array is an error (an invoice for zero with a number from a live line is always a caller mistake)
- $billingLineId : int|null = null
-
billing line;
nulltakes the line of the invoice type, then7/invoice.default.billingLineId. It is mutually exclusive with$number, enforced byInvoiceManager::beforeSave(); the composer checks it earlier so that no PDF is wasted. - $number : string|null = null
-
manual number (import or migration);
nulllets the billing line generate it - $useVat : bool|null = null
-
IMPORTANT: fallback override of the VAT payer status without a justification; superseded by
$taxOverrideand kept only for existing callers.nulltakes the seller's tax status as of the tax point (SellerManager::resolveUseVatOn()). Ignored when$taxOverrideis set. - $vatPercents : int|float|string|null = null
-
IMPORTANT: default rate for lines without a supply kind;
nulltakes7/invoice.default.vatPercents. A line with a supply kind does not use it, the engine decides the rate. Superseded by$taxOverrideand the supply kind. - $supplyKindId : int|null = null
-
default supply kind of lines without their own;
nullleaves such lines without a kind and the engine is not called for them - $taxOverride : InvoiceTaxOverride|null = null
-
manual override of the tax treatment (code, rate and mandatory reason). It beats the engine result for the whole invoice, sets the
MANUAL_OVERRIDEflag and stores the reason intax_override_reason. The only way to getDOMESTIC_REVERSE_CHARGE. - $supplyPlaceCountryCode : string|null = null
-
ISO2 country of the place of supply (where the property is); read only for supply kinds with the
immovable_servicenature - $customerIsBusiness : bool|null = null
-
nullderives it from the customer's registration and VAT numbers;trueforces the business class (a non-EU company confirmed by the admin) - $defaultUnit : string|null = null
-
default unit of lines without their own;
nulltakes7/invoice.default.unit - $sellerContactId : int|null = null
-
specific seller contact;
nulltakes7/invoice.default.sellerContactId, then the seller's first contact - $sellerBankAccountId : int|null = null
-
specific seller bank account;
nulltakes7/invoice.default.sellerBankAccountId, then the seller's first account - $productTypeId : int|null = null
-
axis of the PDF variant matrix;
nulltakes7/invoice.default.productTypeId - $userTypeId : int|null = null
-
axis of the PDF variant matrix;
nulltakes7/invoice.default.userTypeId, then the customer contact - $paymentRegionId : int|null = null
-
axis of the PDF variant matrix;
nulltakes7/invoice.default.paymentRegionId, then the default region. Never null on the invoice: without a region the matrix finds no variant and the invoice would have no PDF. - $languageId : int|null = null
-
invoice language;
nulltakes the customer's language, then the default language of the payment region, then7/invoice.default.languageId, then 1 - $creationDate : DateTime|null = null
-
issue date (also drives
%Yand%min the number mask and the sequenceperiod_key);nullmeans today - $taxableSupplyDate : DateTime|null = null
-
tax point;
nullequals the issue date - $dueDate : DateTime|null = null
-
due date;
nullmeans the issue date plus$duePeriod - $duePeriod : int|null = null
-
days until due when
$dueDateis not set;nulltakes7/invoice.default.duePeriod, then 14 - $status : string = 'unpaid'
-
payment status (
unpaidorpaid); an invoice is issued as unpaid - $variableSymbol : string|null = null
-
nullderives it from the invoice number (digits) - $informations : string|null = null
-
note printed on the invoice
- $sendEmail : bool = false
-
"send by e-mail" flag; the composer sends nothing, it only records the intent
- $emailTo : string|null = null
-
recipient;
nullwith$sendEmailmeans the customer's e-mail - $pdfTemplateVariantId : int|null = null
-
hard-chosen PDF variant;
nulluses the matrix of the invoice type