Method EinvFactory():createInvoice() Professional
Creates an invoice with automatic scenario selection.
:createInvoice( <oSeller>, <oBuyer>, <cNumber>, [<xIssueDate>] ) --> oInvoice
A new DomesticEinvoice(), IntraEuEinvoice(), ExportEinvoice() or ManualEinvoice() object with the seller and the buyer assigned.
Creates a new invoice object whose scenario is selected automatically from the countries of the seller and the buyer. The scenario is selected as follows:
ManualEinvoice() - The seller is located outside the EU. The automatic EU scenarios do not apply in this case.
DomesticEinvoice() - The buyer is located in the same country as the seller.
IntraEuEinvoice() - The buyer is located in another EU member state.
ExportEinvoice() - The buyer is located outside the EU.
Both parties are converted via EinvoiceParty():from() and assigned to the new invoice via :setSeller() and :addRecipient(). The type code and the currency keep the default values of AbstractEinvoice():init(). If other values are required, they can be assigned afterwards via :setTypeCode() and :setCurrency().
A runtime error is raised if the address of the seller or of the buyer has no country code. In this case, EinvFactory():createManualInvoice() can be used instead.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.