@stackforge-eu/factur-x 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/index.cjs +6 -6
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.6] — 2026-05-23
|
|
11
|
+
|
|
12
|
+
- **`SpecifiedTradeSettlementPaymentMeans` emitted its child elements in the
|
|
13
|
+
wrong order.** The EN16931 / CII XSD `TradeSettlementPaymentMeansType`
|
|
14
|
+
sequence requires `PayerPartyDebtorFinancialAccount` before
|
|
15
|
+
`PayeePartyCreditorFinancialAccount` and
|
|
16
|
+
`PayeeSpecifiedCreditorFinancialInstitution`, but the builder appended the
|
|
17
|
+
debtor account last. Any invoice combining a SEPA direct debit
|
|
18
|
+
(`payment.meansCode = "59"`) with `payment.debtorIban` plus a payee
|
|
19
|
+
IBAN/BIC failed XSD validation with `Element 'PayerPartyDebtorFinancialAccount':
|
|
20
|
+
This element is not expected`. Reordered the three blocks in
|
|
21
|
+
`src/core/xml-builder.ts`; regression test added in
|
|
22
|
+
`tests/xml-builder.test.ts`.
|
|
23
|
+
|
|
24
|
+
## [1.0.5] — 2026-05-12
|
|
25
|
+
|
|
26
|
+
- **`ChargeIndicator`'s inner `Indicator` element was emitted in the wrong XML
|
|
27
|
+
namespace.** The XSD requires `udt:Indicator` (UnqualifiedDataType:100) but
|
|
28
|
+
the builder emitted `ram:Indicator` (ReusableAggregateBusinessInformationEntity:100).
|
|
29
|
+
The XSD rejected every invoice carrying a `SpecifiedTradeAllowanceCharge`,
|
|
30
|
+
and the BASIC schematron's `udt:Indicator='true'/'false'` predicates silently
|
|
31
|
+
matched nothing — so every downstream sum over allowances/charges (BR-S-08,
|
|
32
|
+
BR-CO-11, BR-CO-14) computed zero on the allowance/charge side and tripped.
|
|
33
|
+
Affects every caller that uses `allowancesCharges`; previously masked because
|
|
34
|
+
the test suite only exercised allowance presence, never XSD round-trip with
|
|
35
|
+
one. Regression test added in `tests/xsd-validator.test.ts`.
|
|
36
|
+
|
|
10
37
|
## [1.0.4] — 2026-05-05
|
|
11
38
|
|
|
12
39
|
### Fixed
|
|
@@ -67,6 +94,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
67
94
|
- Deno compatibility test suite
|
|
68
95
|
|
|
69
96
|
[Unreleased]: https://github.com/StackForge-EU/factur-x/commits/main
|
|
97
|
+
[1.0.6]: https://github.com/StackForge-EU/factur-x/compare/v1.0.5...v1.0.6
|
|
98
|
+
[1.0.5]: https://github.com/StackForge-EU/factur-x/compare/v1.0.4...v1.0.5
|
|
70
99
|
[1.0.4]: https://github.com/StackForge-EU/factur-x/compare/v1.0.3...v1.0.4
|
|
71
100
|
[1.0.3]: https://github.com/StackForge-EU/factur-x/compare/v1.0.2...v1.0.3
|
|
72
101
|
[1.0.2]: https://github.com/StackForge-EU/factur-x/compare/v1.0.1...v1.0.2
|
package/dist/index.cjs
CHANGED
|
@@ -415,7 +415,7 @@ function buildLineItem(line, profile) {
|
|
|
415
415
|
);
|
|
416
416
|
}
|
|
417
417
|
function buildAllowanceCharge(ac) {
|
|
418
|
-
let x = tag("ram:ChargeIndicator", tag("
|
|
418
|
+
let x = tag("ram:ChargeIndicator", tag("udt:Indicator", ac.isCharge ? "true" : "false"));
|
|
419
419
|
if (ac.percent !== void 0) x += tag("ram:CalculationPercent", ac.percent.toString());
|
|
420
420
|
if (ac.baseAmount !== void 0) x += tag("ram:BasisAmount", fmtAmt(ac.baseAmount));
|
|
421
421
|
x += tag("ram:ActualAmount", fmtAmt(ac.amount));
|
|
@@ -591,6 +591,11 @@ function buildXml(input, profile, flavor) {
|
|
|
591
591
|
sett += tag("ram:PayeeTradeParty", buildParty(input.payee, profile));
|
|
592
592
|
if (payment?.meansCode && atLeast(profile, "BASIC_WL" /* BASIC_WL */)) {
|
|
593
593
|
let pm = tag("ram:TypeCode", escapeXml(payment.meansCode));
|
|
594
|
+
if (payment.debtorIban)
|
|
595
|
+
pm += tag(
|
|
596
|
+
"ram:PayerPartyDebtorFinancialAccount",
|
|
597
|
+
tag("ram:IBANID", escapeXml(payment.debtorIban))
|
|
598
|
+
);
|
|
594
599
|
if (payment.iban || payment.accountId || payment.accountName) {
|
|
595
600
|
let acct = "";
|
|
596
601
|
if (payment.iban) acct += tag("ram:IBANID", escapeXml(payment.iban));
|
|
@@ -604,11 +609,6 @@ function buildXml(input, profile, flavor) {
|
|
|
604
609
|
"ram:PayeeSpecifiedCreditorFinancialInstitution",
|
|
605
610
|
tag("ram:BICID", escapeXml(payment.bic))
|
|
606
611
|
);
|
|
607
|
-
if (payment.debtorIban)
|
|
608
|
-
pm += tag(
|
|
609
|
-
"ram:PayerPartyDebtorFinancialAccount",
|
|
610
|
-
tag("ram:IBANID", escapeXml(payment.debtorIban))
|
|
611
|
-
);
|
|
612
612
|
sett += tag("ram:SpecifiedTradeSettlementPaymentMeans", pm);
|
|
613
613
|
}
|
|
614
614
|
if (input.vatBreakdown && atLeast(profile, "BASIC_WL" /* BASIC_WL */))
|
package/dist/index.js
CHANGED
|
@@ -385,7 +385,7 @@ function buildLineItem(line, profile) {
|
|
|
385
385
|
);
|
|
386
386
|
}
|
|
387
387
|
function buildAllowanceCharge(ac) {
|
|
388
|
-
let x = tag("ram:ChargeIndicator", tag("
|
|
388
|
+
let x = tag("ram:ChargeIndicator", tag("udt:Indicator", ac.isCharge ? "true" : "false"));
|
|
389
389
|
if (ac.percent !== void 0) x += tag("ram:CalculationPercent", ac.percent.toString());
|
|
390
390
|
if (ac.baseAmount !== void 0) x += tag("ram:BasisAmount", fmtAmt(ac.baseAmount));
|
|
391
391
|
x += tag("ram:ActualAmount", fmtAmt(ac.amount));
|
|
@@ -561,6 +561,11 @@ function buildXml(input, profile, flavor) {
|
|
|
561
561
|
sett += tag("ram:PayeeTradeParty", buildParty(input.payee, profile));
|
|
562
562
|
if (payment?.meansCode && atLeast(profile, "BASIC_WL" /* BASIC_WL */)) {
|
|
563
563
|
let pm = tag("ram:TypeCode", escapeXml(payment.meansCode));
|
|
564
|
+
if (payment.debtorIban)
|
|
565
|
+
pm += tag(
|
|
566
|
+
"ram:PayerPartyDebtorFinancialAccount",
|
|
567
|
+
tag("ram:IBANID", escapeXml(payment.debtorIban))
|
|
568
|
+
);
|
|
564
569
|
if (payment.iban || payment.accountId || payment.accountName) {
|
|
565
570
|
let acct = "";
|
|
566
571
|
if (payment.iban) acct += tag("ram:IBANID", escapeXml(payment.iban));
|
|
@@ -574,11 +579,6 @@ function buildXml(input, profile, flavor) {
|
|
|
574
579
|
"ram:PayeeSpecifiedCreditorFinancialInstitution",
|
|
575
580
|
tag("ram:BICID", escapeXml(payment.bic))
|
|
576
581
|
);
|
|
577
|
-
if (payment.debtorIban)
|
|
578
|
-
pm += tag(
|
|
579
|
-
"ram:PayerPartyDebtorFinancialAccount",
|
|
580
|
-
tag("ram:IBANID", escapeXml(payment.debtorIban))
|
|
581
|
-
);
|
|
582
582
|
sett += tag("ram:SpecifiedTradeSettlementPaymentMeans", pm);
|
|
583
583
|
}
|
|
584
584
|
if (input.vatBreakdown && atLeast(profile, "BASIC_WL" /* BASIC_WL */))
|