Skip to content
Back to News
Changelog

CLI 0.15.1 converts a pack to XPK, not the retired PK

cli

0.15.1 is a patch. It bundles @getpeppr/sdk 6.5.2 in place of 6.5.0, and changes no command, option or flag. The CLI builds XML and validates invoices on your machine with the SDK it embeds, so the SDK 6.5.2 fix only reaches CLI users with this release.

getpeppr convert writes XPK for a pack

With a line written as "unit": "pack", 0.15.0 wrote:

<cbc:InvoicedQuantity unitCode="PK">1</cbc:InvoicedQuantity>

PK is no longer a UN/ECE Recommendation 20 code, and the Peppol rule BR-CL-23, which is fatal, refuses it. 0.15.1 writes unitCode="XPK" (UN/ECE Recommendation 21, « Package ») for "pack" and "packs". The same applies to baseQuantityUnit.

A code you pass as-is is still written unchanged: "unit": "PK" gives unitCode="PK" in both versions. Replace it with "XPK" (package) or "C62" (one).

getpeppr validate now flags "PK"

In 0.15.0, validate printed no warning for "unit": "PK", and a false one for "unit": "XPK". In 0.15.1 it is the other way round. On a file with "unit": "PK" on its second line, 0.15.1 prints:

  ⚠ lines[1].unit — Line 1: unit "PK" (resolved: "PK") is not in the SDK's common unit list. It may still be a valid UN/ECE Rec20/21 code; network validation decides. Common codes: EA, HUR, DAY, KGM. (GETPEPPR-UNIT-CODE-RECOGNISED)

The message is the same for every unit outside the SDK's list. For PK, the network's answer is known: it is refused. The warning does not change the exit code, which stays 0. "unit": "pack" passes without a warning, as it did in 0.15.0, and convert turns it into XPK.

getpeppr convert accepts "unit": "constructor"

A unit named after a property of a plain JavaScript object made 0.15.0 fail:

Error: XML generation failed — str.replace is not a function

with exit code 2. 0.15.1 writes unitCode="constructor" and exits 0, as it does for any unit it does not know. validate warns on it in both versions.

getpeppr send does not depend on this release

send posts your JSON with the unit as you wrote it, and the API resolves units itself. What the hosted API does with "pack" and "PK" is described in the SDK 6.5.2 note.

Upgrade if you run convert or validate:

npm install -g @getpeppr/cli@0.15.1