TPDFlibSBInvoice

Editions

Description

TPDFlibSBInvoice (unit PDFlibSBInvoice) descends from TPDFlibSBCompare and implements the Small Business methods for business-rule validation of electronic invoices that are embedded in the selected document: EN 16931, XRechnung and Peppol rules, checked with the built-in rule set, with external XML tools or with an invoice rule package, together with the creation and inspection of such packages.

It belongs to the Small Business edition; the Enterprise edition includes every Small Business class, so it is part of both editions. TPDFlibSBBates descends from it and adds the next feature group.

Syntax

Delphi

TPDFlibSBInvoice = Class(TPDFlibSBCompare);

Key members

ValidateInvoiceBusinessRulesLocates the embedded invoice XML named by EmbeddedFileName in the selected document, decodes it and hands it with Request to Provider; Report receives the result
ValidateInvoiceBusinessRulesWithToolsValidates the embedded invoice against the named schema and Schematron stylesheet with the xmllint, Java and Saxon executables the caller names, and returns the report as JSON
ValidateInvoiceBusinessRulesBuiltInValidates the embedded invoice with the built-in provider against the built-in EN16931 rules of version BuiltIn-1.0, and returns the report as JSON
GetBuiltInInvoiceRuleCatalogReturns the JSON catalog of the rules the built-in validation checks
ValidateInvoiceBusinessRulesWithPackageValidates the embedded invoice against the rule package PackageFile, checked against PackageSHA256, with the external tools when their executable names are given, and returns the report as JSON
GetInvoiceRulePackageInfoLoads the rule package and returns the information of its manifest as JSON
CreateInvoiceRulePackageWrites the rule package manifest for Directory from the named standard, version, profile, syntax, schema and Schematron stylesheet, and returns the package information as JSON

Remarks

The validated XML always comes from an attachment of the selected document; XML bytes supplied in Request.XMLBytes are ignored. An empty EmbeddedFileName selects the embedded Factur-X invoice, whose conformance level also becomes the rule profile when the profile is empty or Auto, or else the single attachment with the extension .xml.

A missing, ambiguous or undecodable attachment sets LastErrorCode to 401, records the error as an issue in Report and makes ValidateInvoiceBusinessRules return False.

Applications normally create TPDFlibSmallBusiness or TPDFlibEnterprise and get the methods of this class through them. The same methods on a plain TPDFlib return 0, an empty string or False and set LastErrorCode to PDFLIB_ERROR_SMALLBUSINESS_REQUIRED.

See also

TPDFlibSBCompare, TPDFlibSBBates, TPDFlibSmallBusiness, TPDFlibEnterprise