Skip to content

0.4.0

Choose a tag to compare

@nforst nforst released this 17 Oct 22:03
· 22 commits to master since this release
0d822c6

Added

  • Typed view model: every node that templates receive has a class in Quittio\Core\View\Model (PartyView, AddressView, LineView, VatRowView, TotalsView, PaymentView, DesignView, DocumentInfoView …; lists are ViewList<T>, e.g. ViewList<LineView>) with its keys as typed properties, so IDEs and PHPStan know that $invoice->totals->amountDue is a ?FormattedValue. The nodes are ViewNode objects over the same data: published Blade and PHP templates, array syntax, toArray() and the mandatory field guard work unchanged (Typed nodes). The compatibility promise now names the keys and types of the view model.
  • The PHP rules check the XRechnung extension like the official validator: BR-DEX-02 (warning), BR-DEX-04 to BR-DEX-10 and BR-DEX-12 to BR-DEX-14 for identifier schemes with XR01 to XR03, the amount due with third party payments and the third party payments themselves. In the profile xrechnung-extension they replace BR-CL-10, -11, -21, -25, -26 and, in UBL, BR-CO-16 and QUITTIO-SUBLINES, so a violation is reported once. Profiles declare such replacements with the capability ReplacesRules.
  • The Peppol profile checks all Peppol BIS Billing 3.0 rules that the data of an invoice can break, with readable messages instead of only the official validation: the format of the business process (PEPPOL-EN16931-R007), values of only whitespace (-R008), net price against gross price and discount (-R046), the sign of BT-111 (-R055), line periods within the invoicing period (-R110, -R111), currencies and dates (-CL007, -F001), the type codes of business process 01 (-P0100, -P0101), the type codes 326 and 384 outside Germany (-P0112), VATEX codes with the wrong VAT category (-P0104 to -P0111) and the format and check digits of GLN, Norwegian, Danish, Belgian, Italian, Swedish and Australian identifiers (PEPPOL-COMMON-R040 to -R053). The code lists CodeList::PEPPOL_CURRENCIES, PEPPOL_INVOICE_TYPES and PEPPOL_CREDIT_NOTE_TYPES are generated from the Peppol rules with CodeListGenerator::generatePeppol() (CodeListGenerator::PEPPOL_LISTS). The rules the UBL writer always satisfies are listed in the validation docs (Peppol rules).
  • The PHP validation checks the VAT categories L (IGIC, Canary Islands: BR-AF-01, -02, -05, -08, -09, -10), M (IPSI, Ceuta and Melilla: BR-AG-01, -02, -05, -08, -09, -10) and B (split payment, Italy: BR-B-01, BR-B-02). Like S, L and M allow one VAT breakdown per rate with VAT; their rate may also be 0. The warning QUITTIO-IGIC-ZERO-RATE-CII reports IGIC with the rate 0 in CII, which the official CII Schematron rejects.
  • XRechnung CVD (Clean Vehicles Directive) in the German pack: the profile xrechnung-cvd (XRechnung30Cvd, specification identifier …#compliant#urn:xeinkauf.de:kosit:xrechnung:cvd_0.9) for xrechnung-cii, xrechnung-ubl and zugferd, with the rules BR-DE-CVD-01 to BR-DE-CVD-06-b: contract (BT-12) and tender or lot reference (BT-17) are required, and vehicle lines carry the category as item classification with scheme CVD (BT-158) and the item attribute cva (BT-160, BT-161). The profile accepts the scheme CVD in the code list check BR-CL-13.

Changed

  • The Laravel settings of the German pack live under quittio.countries.de (config('quittio.countries.de.base_rates'), ….base_rate_file) instead of the configuration quittio-de. php artisan vendor:publish --tag=quittio-de-config publishes them to config/quittio/countries/de.php, which Laravel loads as quittio.countries.de; they can also be set in config/quittio.php under 'countries' => ['de' => […]]. quittio:install publishes the tag quittio-{code}-config of every installed country pack with config/quittio.php. GermanyServiceProvider no longer fills quittio-de with defaults: code that reads config('quittio-de.…') reads quittio.countries.de. Lower-case codes under quittio.countries hold the settings of a pack, the convention for further packs (quittio.countries.{code}); a pack class listed under 'de' is moved to a numeric key.
  • The calculator, the builder, the reader and the cancellations read and write the declared amounts flags together as one typed state (the internal Calculation\DeclaredAmountsState) instead of single flags. The flags stay the stored format with the same strings, so stored data of earlier versions is read unchanged; they are now always written after the other flags in a fixed order (declared_amounts, declared_amounts_recalculated, cancellation_vat_aligned, declared_vat_in_tax_currency:, amounts_fingerprint: last), and duplicates or an unreadable declared_vat_in_tax_currency: value are dropped when data is calculated again.
  • ViewModelFactory builds the view model with one internal factory per section (header, parties, references, lines, allowances and charges, VAT breakdown, totals, payment, notes, design, documents; View\Internal\Sections). The view model is the same as before.

Deprecated

  • The configuration quittio-de (config/quittio-de.php): move its keys to quittio.countries.de and delete the file. Until 1.0 it is still read: its keys fill those that quittio.countries.de leaves out or keeps at the default, and the provider reports an E_USER_DEPRECATED on every start while it is set (The old file).

Fixed

  • The KoSIT validator (L5) reports a rule with the level the validator scenario gives it (customLevel), as the validator itself does when it decides on acceptance. Before, the level of the Schematron was used, so e.g. BR-CO-16 in an XRechnung extension invoice with third party payments was reported as error although the validator accepted the document.
  • The official validation in CI now checks PDF/A-3b with veraPDF: the job pulls the verapdf/cli image (pinned by digest), and the veraPDF tests fail instead of being skipped when the image is missing in CI. tools/validate-fixtures.sh also renders every EN 16931 scenario as ZUGFeRD PDF and checks the PDFs with veraPDF; before, it generated no PDFs, and its veraPDF call would have received no files.