Method AbstractEinvoice():toModel() Professional
Builds the calculated invoice model.
:toModel() --> oModel
A DataObject with the invoice model. Among others, it contains the members :Scenario, :Profile, :Number, :IssueDate, :TypeCode, :Currency, :Notes, :Seller, :Buyer, :Payee, :ShipTo, :Lines, :AllowanceCharges, :TaxBreakdownand :Totals.
Creates a normalized and fully calculated representation of the invoice. The method resolves the VAT category and rate of every invoice line via :resolveVatCategory() and groups the lines, allowances and charges into the VAT breakdown. It calculates the line total, the allowance and charge totals, the tax basis, the tax total, the grand total and the amount due for payment. In addition, it adds the legal notes which are required for the resolved VAT exemption reasons.
All amounts in the model, for example Totals:GrandTotal or the members :Basis and :Tax of a VAT breakdown entry, are EinvoiceDecimal() objects instead of numeric values. Use the methods :toFixed() or :toPlain() to format an amount for display.
This method is called internally by :validate() and the serializers. It only needs to be called directly to inspect the calculated model, for example for logging or for a custom report.
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.