Method ExportEinvoice():validateScenario() Professional

Validates the rules of the export scenario.

Syntax
:validateScenario( <oCtx> ) --> self
Parameters
<oCtx>
The validation context. This is a DataObject with the members :Error and :Warn, which contain code blocks for reporting errors and warnings, and the member :Model, which contains the invoice model returned by :toModel().
Return

This method returns self.

Description

Checks the invoice against the rules of the export scenario. The method is called by :validate() as the last step of the rule catalog. The following rules are checked:

The seller must be located in the EU. This is checked via :requireEuSeller().

The buyer must be located outside the EU. This check is skipped if no buyer has been set.

Every invoice line must have a resolved VAT category. A line without a category is typically a service line for which no VAT category has been specified.

Every violation is reported as a "SCENARIO" error via the code block in the member :Error of <oCtx>. The method does not raise a runtime error, so :validate() can report all problems at once.

Feedback

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.