ValidateInvoiceBusinessRulesBuiltInA

E-invoicing

Requires the Small Business edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibSmallBusiness (unit PDFlibSmallBusiness) or TPDFlibEnterprise; the Small Business and Enterprise DLL and ActiveX builds provide it unchanged; the Single edition keeps the method, which returns 0, an empty string or False and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to ValidateInvoiceBusinessRulesBuiltIn and string arguments are interpreted using the current SetAnsiMode code page

Validates embedded Factur-X CII or OASIS UBL 2.1 invoice XML against a native subset of the EN 16931 business rules, without external tools, and reports which rules were not checked

Syntax

Delphi

Function DLValidateInvoiceBusinessRulesBuiltInA(InstanceID: Integer; EmbeddedFileName: PAnsiChar): PAnsiChar;

DLL

const char* DLValidateInvoiceBusinessRulesBuiltInA(int InstanceID, const char* EmbeddedFileName);

Parameters

EmbeddedFileNameName of the embedded invoice attachment inside the PDF, or an empty string to auto-detect the Factur-X or single XML invoice attachment

Return values

JSONThe validation report as JSON with per-stage status, coverage, executed rule count and the collected issues coverage is subset and fullConformance is always false for this provider

Remarks

The built-in provider runs on all supported platforms without xmllint, Java, Saxon or COM XML libraries. The Schema stage checks XML well-formedness, DTD prohibition and the root element (CrossIndustryInvoice, Invoice or CreditNote); it does not validate against the XSD

The Schematron stage reads the invoice into the EN 16931 business terms and checks, with the rule IDs of the EN 16931 validation artefacts 1.3.16:

Tolerances and rounding follow the CII or the UBL artefact of each rule. EN 16931 rules are not applied to Factur-X MINIMUM and BASIC WL documents, which are not EN 16931 invoices; an informational BuiltIn.Coverage.Profile issue says so

Each issue has a category: syntax, cardinality, calculation, vat, codelist, decimal, profile or coverage, so schema, arithmetic and profile findings can be told apart. Each stage lists the rule areas it left out in notCovered; GetBuiltInInvoiceRuleCatalog returns the complete list

A passed built-in report means the checked rules hold. For conformance to the complete standard or a CIUS, run ValidateInvoiceBusinessRulesWithTools with a versioned rule package, whose stages report coverage rulePackage

See also

ValidateInvoiceBusinessRules, ValidateInvoiceBusinessRulesWithTools, GetBuiltInInvoiceRuleCatalog, ExtractFacturXXMLToString