Method IntraEuEinvoice():validateScenario() Professional
Validates the rules of the intra-community scenario.
:validateScenario( <oCtx> ) --> self
This method returns self.
Checks the invoice against the rules of the intra-community 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 in an EU member state other than the country of the seller. A violation is reported as a "SCENARIO" error. This check is skipped if no buyer has been set.
If at least one invoice line is resolved to the category K or AE, the VAT identifier of the seller (BT-31) is required (rule VAT-226-3) and the VAT identifier of the buyer (BT-48) is required (rule VAT-226-4). A buyer VAT identifier with an invalid syntax is reported as a "VATID" error. A buyer VAT identifier with the VAT prefix of the seller's country is reported as a "VAT-138" error. A buyer VAT identifier whose prefix differs from the country of the buyer is reported as a "VATID" warning.
If at least one invoice line is resolved to the category K and a deliver-to party with a country code has been set, the deliver-to country must be an EU member state other than the country of the seller (rule VAT-138).
In addition, the hints of the seller's country profile for intra-community supplies (category K) and for the EU reverse charge (category AE) are reported as "HINT" warnings if the invoice contains lines of the respective category.
Errors and warnings are reported via the code blocks in the members :Error and :Warn of <oCtx>. The method does not raise a runtime error, so :validate() can report all problems at once.
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.