en16931-parser 0.0.0-stage → 1.0.0
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/LICENSE +21 -0
- package/README.md +64 -2
- package/bin/cli.js +75 -0
- package/dist/einvoice-viewer.d.ts +129 -0
- package/dist/einvoice-viewer.js +651 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/collections.d.ts +62 -0
- package/dist/internal/collections.js +146 -0
- package/dist/internal/csv.d.ts +63 -0
- package/dist/internal/csv.js +209 -0
- package/dist/internal/pii-patterns.d.ts +42 -0
- package/dist/internal/pii-patterns.js +162 -0
- package/dist/internal/xml-entities.d.ts +14 -0
- package/dist/internal/xml-entities.js +50 -0
- package/dist/internal/xml-formatter-options.d.ts +190 -0
- package/dist/internal/xml-formatter-options.js +848 -0
- package/dist/internal/xml-inspect.d.ts +38 -0
- package/dist/internal/xml-inspect.js +103 -0
- package/package.json +48 -4
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* einvoice-viewer.ts — Pure TypeScript parser and validator for Factur-X / ZUGFeRD
|
|
3
|
+
* (UN/CEFACT CrossIndustryInvoice) and XRechnung / Peppol (UBL 2.1 Invoice/CreditNote).
|
|
4
|
+
*
|
|
5
|
+
* Pure Node-testable module with zero DOM, network, or `pdfjs-dist` dependencies.
|
|
6
|
+
*/
|
|
7
|
+
import { toCsv } from './internal/csv.js';
|
|
8
|
+
import { isValidIbanMod97 } from './internal/pii-patterns.js';
|
|
9
|
+
import { findAllByLocalName, findFirstByLocalName, formatXml, getNodeAttr, getNodeText, inspectXmlDocument, localTagName, } from './internal/xml-inspect.js';
|
|
10
|
+
const ARITHMETIC_TOLERANCE = 0.02;
|
|
11
|
+
const PREFERRED_ATTACHMENT_NAMES = [
|
|
12
|
+
'factur-x.xml',
|
|
13
|
+
'zugferd-invoice.xml',
|
|
14
|
+
'xrechnung.xml',
|
|
15
|
+
];
|
|
16
|
+
const EMPTY_NODE = {
|
|
17
|
+
id: '',
|
|
18
|
+
tag: '',
|
|
19
|
+
xpath: '',
|
|
20
|
+
depth: 0,
|
|
21
|
+
attributes: [],
|
|
22
|
+
text: '',
|
|
23
|
+
cdata: [],
|
|
24
|
+
children: [],
|
|
25
|
+
};
|
|
26
|
+
function findChildOrFallback(node, localName) {
|
|
27
|
+
return node ? (findFirstByLocalName(node, localName, false) ?? EMPTY_NODE) : EMPTY_NODE;
|
|
28
|
+
}
|
|
29
|
+
function extractCiiDateTime(parent, containerTag) {
|
|
30
|
+
const container = findFirstByLocalName(parent, containerTag, false);
|
|
31
|
+
if (!container)
|
|
32
|
+
return '';
|
|
33
|
+
return normalizeEinvoiceDate(firstText(container, 'DateTimeString') || getNodeText(container));
|
|
34
|
+
}
|
|
35
|
+
function round2(value) {
|
|
36
|
+
return Math.round((value + Number.EPSILON) * 100) / 100;
|
|
37
|
+
}
|
|
38
|
+
function parseNumericText(raw, fallback = 0) {
|
|
39
|
+
const normalized = raw.trim().replace(/\s+/g, '').replace(',', '.');
|
|
40
|
+
if (!normalized)
|
|
41
|
+
return fallback;
|
|
42
|
+
const num = Number(normalized);
|
|
43
|
+
return Number.isFinite(num) ? num : fallback;
|
|
44
|
+
}
|
|
45
|
+
function parseOptionalNumericText(raw) {
|
|
46
|
+
const normalized = raw.trim().replace(/\s+/g, '').replace(',', '.');
|
|
47
|
+
if (!normalized)
|
|
48
|
+
return null;
|
|
49
|
+
const num = Number(normalized);
|
|
50
|
+
return Number.isFinite(num) ? num : null;
|
|
51
|
+
}
|
|
52
|
+
function findDirectChild(node, targetLocal) {
|
|
53
|
+
const needle = targetLocal.toLowerCase();
|
|
54
|
+
for (const child of node.children) {
|
|
55
|
+
if (localTagName(child.tag).toLowerCase() === needle)
|
|
56
|
+
return child;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
function firstText(node, localName) {
|
|
61
|
+
return getNodeText(findFirstByLocalName(node, localName, false));
|
|
62
|
+
}
|
|
63
|
+
function directChildText(node, localName) {
|
|
64
|
+
return node ? getNodeText(findDirectChild(node, localName)) : '';
|
|
65
|
+
}
|
|
66
|
+
/** Normalizes CII `YYYYMMDD` or ISO `YYYY-MM-DD` date strings to `YYYY-MM-DD`. */
|
|
67
|
+
export function normalizeEinvoiceDate(raw) {
|
|
68
|
+
const clean = raw.trim();
|
|
69
|
+
if (/^\d{8}$/.test(clean)) {
|
|
70
|
+
return `${clean.slice(0, 4)}-${clean.slice(4, 6)}-${clean.slice(6, 8)}`;
|
|
71
|
+
}
|
|
72
|
+
const isoMatch = clean.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
73
|
+
return isoMatch ? isoMatch[1] : clean;
|
|
74
|
+
}
|
|
75
|
+
/** Formats an IBAN into 4-character groups for display. */
|
|
76
|
+
export function formatIbanDisplay(rawIban) {
|
|
77
|
+
const compact = rawIban.replace(/[\s-]+/g, '').toUpperCase();
|
|
78
|
+
if (!compact)
|
|
79
|
+
return '';
|
|
80
|
+
return compact.replace(/(.{4})(?=.)/g, '$1 ');
|
|
81
|
+
}
|
|
82
|
+
function buildPaymentInfo(rawIban, bic, paymentReference) {
|
|
83
|
+
const iban = rawIban.replace(/[\s-]+/g, '').toUpperCase();
|
|
84
|
+
return {
|
|
85
|
+
iban,
|
|
86
|
+
ibanFormatted: formatIbanDisplay(iban),
|
|
87
|
+
ibanValid: iban ? isValidIbanMod97(iban) : null,
|
|
88
|
+
bic: bic.trim().toUpperCase(),
|
|
89
|
+
paymentReference: paymentReference.trim(),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const formatEn16931Label = (std) => std === 'CII' ? 'Factur-X / EN 16931' : 'EN 16931 (UBL 2.1)';
|
|
93
|
+
const PROFILE_RULES = [
|
|
94
|
+
{ tokens: ['xrechnung'], label: 'XRechnung' },
|
|
95
|
+
{ tokens: ['peppol'], label: 'Peppol BIS Billing 3.0' },
|
|
96
|
+
{ tokens: ['extended'], label: 'Factur-X / ZUGFeRD Extended' },
|
|
97
|
+
{ tokens: ['comfort', 'en16931'], label: formatEn16931Label },
|
|
98
|
+
{ tokens: ['basicwl'], label: 'Factur-X Basic WL' },
|
|
99
|
+
{ tokens: ['basic'], label: 'Factur-X Basic' },
|
|
100
|
+
{ tokens: ['minimum'], label: 'Factur-X Minimum' },
|
|
101
|
+
];
|
|
102
|
+
function classifyProfileLabel(guid, standard) {
|
|
103
|
+
const lower = guid.toLowerCase();
|
|
104
|
+
for (const rule of PROFILE_RULES) {
|
|
105
|
+
if (rule.tokens.some((tok) => lower.includes(tok))) {
|
|
106
|
+
return typeof rule.label === 'function' ? rule.label(standard) : rule.label;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return guid || (standard === 'CII' ? 'UN/CEFACT CII' : 'UBL 2.1');
|
|
110
|
+
}
|
|
111
|
+
function computeArithmeticCheck(lines, totals) {
|
|
112
|
+
const hasLines = lines.length > 0;
|
|
113
|
+
const linesSum = round2(lines.reduce((acc, item) => acc + item.lineTotal, 0));
|
|
114
|
+
const expectedTaxBasis = round2(linesSum - totals.allowanceTotal + totals.chargeTotal);
|
|
115
|
+
const taxBasisDelta = round2(expectedTaxBasis - totals.taxBasis);
|
|
116
|
+
const linesMatchTaxBasis = !hasLines || Math.abs(taxBasisDelta) <= ARITHMETIC_TOLERANCE;
|
|
117
|
+
const expectedGrandTotal = round2(totals.taxBasis + totals.taxTotal);
|
|
118
|
+
const grandTotalDelta = round2(expectedGrandTotal - totals.grandTotal);
|
|
119
|
+
const taxPlusBasisMatchGrandTotal = Math.abs(grandTotalDelta) <= ARITHMETIC_TOLERANCE;
|
|
120
|
+
return {
|
|
121
|
+
hasLines,
|
|
122
|
+
linesSum,
|
|
123
|
+
expectedTaxBasis,
|
|
124
|
+
taxBasisDelta,
|
|
125
|
+
linesMatchTaxBasis,
|
|
126
|
+
expectedGrandTotal,
|
|
127
|
+
grandTotalDelta,
|
|
128
|
+
taxPlusBasisMatchGrandTotal,
|
|
129
|
+
passed: linesMatchTaxBasis && taxPlusBasisMatchGrandTotal,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function extractCiiVatId(partyNode) {
|
|
133
|
+
const taxRegs = findAllByLocalName(partyNode, 'SpecifiedTaxRegistration', false);
|
|
134
|
+
for (const reg of taxRegs) {
|
|
135
|
+
const idNode = findFirstByLocalName(reg, 'ID', false);
|
|
136
|
+
if (getNodeAttr(idNode, 'schemeID').toUpperCase() === 'VA') {
|
|
137
|
+
return getNodeText(idNode);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return taxRegs.length > 0 ? firstText(taxRegs[0], 'ID') : '';
|
|
141
|
+
}
|
|
142
|
+
function extractCiiParty(partyNode) {
|
|
143
|
+
const safeParty = partyNode ?? EMPTY_NODE;
|
|
144
|
+
const addr = findChildOrFallback(safeParty, 'PostalTradeAddress');
|
|
145
|
+
return {
|
|
146
|
+
name: firstText(safeParty, 'Name'),
|
|
147
|
+
vatId: extractCiiVatId(safeParty),
|
|
148
|
+
address: {
|
|
149
|
+
street: firstText(addr, 'LineOne'),
|
|
150
|
+
additionalStreet: firstText(addr, 'LineTwo'),
|
|
151
|
+
postalCode: firstText(addr, 'PostcodeCode'),
|
|
152
|
+
city: firstText(addr, 'CityName'),
|
|
153
|
+
country: firstText(addr, 'CountryID'),
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function extractCiiLine(lineNode, index) {
|
|
158
|
+
const id = firstText(lineNode, 'LineID') || String(index + 1);
|
|
159
|
+
const product = findChildOrFallback(lineNode, 'SpecifiedTradeProduct');
|
|
160
|
+
const delivery = findChildOrFallback(lineNode, 'SpecifiedLineTradeDelivery');
|
|
161
|
+
const qtyNode = findFirstByLocalName(delivery, 'BilledQuantity', false);
|
|
162
|
+
const agreement = findChildOrFallback(lineNode, 'SpecifiedLineTradeAgreement');
|
|
163
|
+
const netPriceNode = findChildOrFallback(agreement, 'NetPriceProductTradePrice');
|
|
164
|
+
const grossPriceNode = findChildOrFallback(agreement, 'GrossPriceProductTradePrice');
|
|
165
|
+
const unitPriceRaw = firstText(netPriceNode, 'ChargeAmount') || firstText(grossPriceNode, 'ChargeAmount');
|
|
166
|
+
const settlement = findChildOrFallback(lineNode, 'SpecifiedLineTradeSettlement');
|
|
167
|
+
return {
|
|
168
|
+
id,
|
|
169
|
+
name: firstText(product, 'Name'),
|
|
170
|
+
qty: parseNumericText(getNodeText(qtyNode), 0),
|
|
171
|
+
unitCode: getNodeAttr(qtyNode, 'unitCode'),
|
|
172
|
+
unitPrice: parseNumericText(unitPriceRaw, 0),
|
|
173
|
+
lineTotal: parseNumericText(firstText(settlement, 'LineTotalAmount'), 0),
|
|
174
|
+
vatRate: parseOptionalNumericText(firstText(settlement, 'RateApplicablePercent')),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function extractCiiTotals(settlement) {
|
|
178
|
+
const sum = findChildOrFallback(settlement, 'SpecifiedTradeSettlementHeaderMonetarySummation');
|
|
179
|
+
const lineTotalAmount = parseNumericText(firstText(sum, 'LineTotalAmount'), 0);
|
|
180
|
+
const taxBasisRaw = firstText(sum, 'TaxBasisTotalAmount');
|
|
181
|
+
const taxBasis = taxBasisRaw ? parseNumericText(taxBasisRaw, lineTotalAmount) : lineTotalAmount;
|
|
182
|
+
const taxTotal = parseNumericText(firstText(sum, 'TaxTotalAmount'), 0);
|
|
183
|
+
const grandTotal = parseNumericText(firstText(sum, 'GrandTotalAmount'), 0);
|
|
184
|
+
const duePayableRaw = firstText(sum, 'DuePayableAmount');
|
|
185
|
+
return {
|
|
186
|
+
lineTotalAmount,
|
|
187
|
+
allowanceTotal: parseNumericText(firstText(sum, 'AllowanceTotalAmount'), 0),
|
|
188
|
+
chargeTotal: parseNumericText(firstText(sum, 'ChargeTotalAmount'), 0),
|
|
189
|
+
taxBasis,
|
|
190
|
+
taxTotal,
|
|
191
|
+
grandTotal,
|
|
192
|
+
duePayable: duePayableRaw ? parseNumericText(duePayableRaw, grandTotal) : grandTotal,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function parseCiiDocument(root) {
|
|
196
|
+
const docContext = findChildOrFallback(root, 'ExchangedDocumentContext');
|
|
197
|
+
const profileGuid = firstText(docContext, 'ID');
|
|
198
|
+
const exchangedDoc = findChildOrFallback(root, 'ExchangedDocument');
|
|
199
|
+
const typeCode = firstText(exchangedDoc, 'TypeCode') || '380';
|
|
200
|
+
const transaction = findChildOrFallback(root, 'SupplyChainTradeTransaction');
|
|
201
|
+
const agreement = findChildOrFallback(transaction, 'ApplicableHeaderTradeAgreement');
|
|
202
|
+
const settlement = findChildOrFallback(transaction, 'ApplicableHeaderTradeSettlement');
|
|
203
|
+
const paymentMeans = findChildOrFallback(settlement, 'SpecifiedTradeSettlementPaymentMeans');
|
|
204
|
+
const account = findChildOrFallback(paymentMeans, 'PayeePartyCreditorFinancialAccount');
|
|
205
|
+
const bicNode = findChildOrFallback(paymentMeans, 'PayeeSpecifiedCreditorFinancialInstitution');
|
|
206
|
+
const terms = findChildOrFallback(settlement, 'SpecifiedTradePaymentTerms');
|
|
207
|
+
const lines = findAllByLocalName(transaction, 'IncludedSupplyChainTradeLineItem', false).map(extractCiiLine);
|
|
208
|
+
const totals = extractCiiTotals(settlement);
|
|
209
|
+
return {
|
|
210
|
+
standard: 'CII',
|
|
211
|
+
documentKind: typeCode === '381' ? 'CreditNote' : 'Invoice',
|
|
212
|
+
typeCode,
|
|
213
|
+
profileGuid,
|
|
214
|
+
profileLabel: classifyProfileLabel(profileGuid, 'CII'),
|
|
215
|
+
invoiceNumber: directChildText(exchangedDoc, 'ID') || firstText(exchangedDoc, 'ID'),
|
|
216
|
+
issueDate: extractCiiDateTime(exchangedDoc, 'IssueDateTime'),
|
|
217
|
+
dueDate: extractCiiDateTime(terms, 'DueDateDateTime'),
|
|
218
|
+
currency: firstText(settlement, 'InvoiceCurrencyCode'),
|
|
219
|
+
seller: extractCiiParty(findFirstByLocalName(agreement, 'SellerTradeParty', false)),
|
|
220
|
+
buyer: extractCiiParty(findFirstByLocalName(agreement, 'BuyerTradeParty', false)),
|
|
221
|
+
payment: buildPaymentInfo(firstText(account, 'IBANID') || firstText(account, 'ProprietaryID'), firstText(bicNode, 'BICID'), firstText(settlement, 'PaymentReference')),
|
|
222
|
+
lines,
|
|
223
|
+
totals,
|
|
224
|
+
arithmeticCheck: computeArithmeticCheck(lines, totals),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function extractUblParty(container) {
|
|
228
|
+
const party = findChildOrFallback(container, 'Party');
|
|
229
|
+
const legalEntity = findChildOrFallback(party, 'PartyLegalEntity');
|
|
230
|
+
const partyName = findChildOrFallback(party, 'PartyName');
|
|
231
|
+
const taxScheme = findChildOrFallback(party, 'PartyTaxScheme');
|
|
232
|
+
const addr = findChildOrFallback(party, 'PostalAddress');
|
|
233
|
+
const countryNode = findChildOrFallback(addr, 'Country');
|
|
234
|
+
return {
|
|
235
|
+
name: firstText(legalEntity, 'RegistrationName') || firstText(partyName, 'Name'),
|
|
236
|
+
vatId: firstText(taxScheme, 'CompanyID'),
|
|
237
|
+
address: {
|
|
238
|
+
street: firstText(addr, 'StreetName'),
|
|
239
|
+
additionalStreet: firstText(addr, 'AdditionalStreetName'),
|
|
240
|
+
postalCode: firstText(addr, 'PostalZone'),
|
|
241
|
+
city: firstText(addr, 'CityName'),
|
|
242
|
+
country: firstText(countryNode, 'IdentificationCode'),
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function extractUblLine(lineNode, index, isCreditNote) {
|
|
247
|
+
const qtyTag = isCreditNote ? 'CreditedQuantity' : 'InvoicedQuantity';
|
|
248
|
+
const qtyNode = findDirectChild(lineNode, qtyTag);
|
|
249
|
+
const itemNode = findChildOrFallback(lineNode, 'Item');
|
|
250
|
+
const priceNode = findDirectChild(lineNode, 'Price');
|
|
251
|
+
const taxCat = findChildOrFallback(itemNode, 'ClassifiedTaxCategory');
|
|
252
|
+
return {
|
|
253
|
+
id: directChildText(lineNode, 'ID') || String(index + 1),
|
|
254
|
+
name: directChildText(itemNode, 'Name') || firstText(itemNode, 'Description'),
|
|
255
|
+
qty: parseNumericText(getNodeText(qtyNode), 0),
|
|
256
|
+
unitCode: getNodeAttr(qtyNode, 'unitCode'),
|
|
257
|
+
unitPrice: parseNumericText(directChildText(priceNode, 'PriceAmount'), 0),
|
|
258
|
+
lineTotal: parseNumericText(directChildText(lineNode, 'LineExtensionAmount'), 0),
|
|
259
|
+
vatRate: parseOptionalNumericText(firstText(taxCat, 'Percent')),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function extractUblTotals(root) {
|
|
263
|
+
const monetary = findChildOrFallback(root, 'LegalMonetaryTotal');
|
|
264
|
+
const taxTotalNode = findChildOrFallback(root, 'TaxTotal');
|
|
265
|
+
const lineTotalAmount = parseNumericText(directChildText(monetary, 'LineExtensionAmount'), 0);
|
|
266
|
+
const taxBasisRaw = directChildText(monetary, 'TaxExclusiveAmount');
|
|
267
|
+
const taxBasis = taxBasisRaw ? parseNumericText(taxBasisRaw, lineTotalAmount) : lineTotalAmount;
|
|
268
|
+
const taxTotal = parseNumericText(directChildText(taxTotalNode, 'TaxAmount'), 0);
|
|
269
|
+
const grandTotal = parseNumericText(directChildText(monetary, 'TaxInclusiveAmount'), 0);
|
|
270
|
+
const duePayableRaw = directChildText(monetary, 'PayableAmount');
|
|
271
|
+
return {
|
|
272
|
+
lineTotalAmount,
|
|
273
|
+
allowanceTotal: parseNumericText(directChildText(monetary, 'AllowanceTotalAmount'), 0),
|
|
274
|
+
chargeTotal: parseNumericText(directChildText(monetary, 'ChargeTotalAmount'), 0),
|
|
275
|
+
taxBasis,
|
|
276
|
+
taxTotal,
|
|
277
|
+
grandTotal,
|
|
278
|
+
duePayable: duePayableRaw ? parseNumericText(duePayableRaw, grandTotal) : grandTotal,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function parseUblDocument(root, isCreditNote) {
|
|
282
|
+
const profileGuid = directChildText(root, 'CustomizationID') || directChildText(root, 'ProfileID');
|
|
283
|
+
const typeCode = directChildText(root, isCreditNote ? 'CreditNoteTypeCode' : 'InvoiceTypeCode') ||
|
|
284
|
+
(isCreditNote ? '381' : '380');
|
|
285
|
+
const paymentMeans = findChildOrFallback(root, 'PaymentMeans');
|
|
286
|
+
const account = findChildOrFallback(paymentMeans, 'PayeeFinancialAccount');
|
|
287
|
+
const branch = findChildOrFallback(account, 'FinancialInstitutionBranch');
|
|
288
|
+
const lineTag = isCreditNote ? 'CreditNoteLine' : 'InvoiceLine';
|
|
289
|
+
const lines = findAllByLocalName(root, lineTag, false).map((n, i) => extractUblLine(n, i, isCreditNote));
|
|
290
|
+
const totals = extractUblTotals(root);
|
|
291
|
+
return {
|
|
292
|
+
standard: 'UBL',
|
|
293
|
+
documentKind: isCreditNote ? 'CreditNote' : 'Invoice',
|
|
294
|
+
typeCode,
|
|
295
|
+
profileGuid,
|
|
296
|
+
profileLabel: classifyProfileLabel(profileGuid, 'UBL'),
|
|
297
|
+
invoiceNumber: directChildText(root, 'ID'),
|
|
298
|
+
issueDate: normalizeEinvoiceDate(directChildText(root, 'IssueDate')),
|
|
299
|
+
dueDate: normalizeEinvoiceDate(directChildText(root, 'DueDate') || firstText(paymentMeans, 'PaymentDueDate')),
|
|
300
|
+
currency: directChildText(root, 'DocumentCurrencyCode'),
|
|
301
|
+
seller: extractUblParty(findDirectChild(root, 'AccountingSupplierParty')),
|
|
302
|
+
buyer: extractUblParty(findDirectChild(root, 'AccountingCustomerParty')),
|
|
303
|
+
payment: buildPaymentInfo(directChildText(account, 'ID'), directChildText(branch, 'ID'), directChildText(paymentMeans, 'PaymentID')),
|
|
304
|
+
lines,
|
|
305
|
+
totals,
|
|
306
|
+
arithmeticCheck: computeArithmeticCheck(lines, totals),
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Parses a UN/CEFACT CrossIndustryInvoice (Factur-X / ZUGFeRD) or UBL 2.1
|
|
311
|
+
* Invoice/CreditNote (XRechnung / Peppol) XML document into a structured summary.
|
|
312
|
+
*/
|
|
313
|
+
export function parseEinvoiceXml(rawXml) {
|
|
314
|
+
if (!rawXml.trim()) {
|
|
315
|
+
return {
|
|
316
|
+
ok: false,
|
|
317
|
+
errorCode: 'EMPTY_INPUT',
|
|
318
|
+
reason: 'Paste or upload an e-invoice XML document or Factur-X PDF.',
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
const inspected = inspectXmlDocument(rawXml);
|
|
322
|
+
if (!inspected.ok) {
|
|
323
|
+
return {
|
|
324
|
+
ok: false,
|
|
325
|
+
errorCode: inspected.hasDoctypeOrEntity ? 'XXE_BLOCKED' : 'INVALID_XML',
|
|
326
|
+
reason: inspected.reason,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
const rootName = localTagName(inspected.root.tag).toLowerCase();
|
|
330
|
+
let invoice = null;
|
|
331
|
+
if (rootName === 'crossindustryinvoice') {
|
|
332
|
+
invoice = parseCiiDocument(inspected.root);
|
|
333
|
+
}
|
|
334
|
+
else if (rootName === 'invoice' || rootName === 'creditnote') {
|
|
335
|
+
invoice = parseUblDocument(inspected.root, rootName === 'creditnote');
|
|
336
|
+
}
|
|
337
|
+
if (!invoice) {
|
|
338
|
+
return {
|
|
339
|
+
ok: false,
|
|
340
|
+
errorCode: 'UNSUPPORTED_SCHEMA',
|
|
341
|
+
reason: `Unsupported XML root "${inspected.root.tag}". Expected CrossIndustryInvoice (Factur-X/ZUGFeRD) or UBL Invoice/CreditNote.`,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
const formatted = formatXml(inspected.cleanedXml, { indent: '2', preserveDeclaration: true });
|
|
345
|
+
/* v8 ignore next -- @preserve formatXml validates the same XML just accepted by inspectXmlDocument */
|
|
346
|
+
const formattedXml = formatted.ok ? formatted.output : inspected.cleanedXml;
|
|
347
|
+
return {
|
|
348
|
+
ok: true,
|
|
349
|
+
invoice,
|
|
350
|
+
formattedXml,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
/** Decodes raw UTF-8 XML bytes (stripping a leading BOM if present). */
|
|
354
|
+
export function decodeEmbeddedXmlBytes(bytes) {
|
|
355
|
+
return new TextDecoder('utf-8').decode(bytes).replace(/^\uFEFF/, '');
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Selects the preferred `.xml` attachment descriptor from either a `Map`
|
|
359
|
+
* (`pdfjs-dist` v5+) or a plain object map without decoding content yet.
|
|
360
|
+
*/
|
|
361
|
+
export function selectEmbeddedXmlAttachmentCandidate(attachments) {
|
|
362
|
+
if (!attachments)
|
|
363
|
+
return null;
|
|
364
|
+
const pairs = attachments instanceof Map ? Array.from(attachments.entries()) : Object.entries(attachments);
|
|
365
|
+
const xmlEntries = pairs
|
|
366
|
+
.map(([key, item]) => ({
|
|
367
|
+
key,
|
|
368
|
+
filename: (item.filename || key).trim(),
|
|
369
|
+
content: item.content ?? null,
|
|
370
|
+
}))
|
|
371
|
+
.filter((entry) => entry.filename.toLowerCase().endsWith('.xml'));
|
|
372
|
+
if (xmlEntries.length === 0)
|
|
373
|
+
return null;
|
|
374
|
+
return (xmlEntries.find((entry) => PREFERRED_ATTACHMENT_NAMES.includes(entry.filename.toLowerCase())) ??
|
|
375
|
+
xmlEntries[0]);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Selects and decodes the embedded e-invoice XML attachment from a PDF's
|
|
379
|
+
* attachment map when bytes are inline, preferring Factur-X / ZUGFeRD / XRechnung names.
|
|
380
|
+
*/
|
|
381
|
+
export function pickEmbeddedEinvoiceXmlAttachment(attachments) {
|
|
382
|
+
const picked = selectEmbeddedXmlAttachmentCandidate(attachments);
|
|
383
|
+
if (!picked || !picked.content)
|
|
384
|
+
return null;
|
|
385
|
+
return { filename: picked.filename, xml: decodeEmbeddedXmlBytes(picked.content) };
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Collects a readable text snippet from PDF page text-content items when a PDF
|
|
389
|
+
* carries no embedded Factur-X / ZUGFeRD XML attachment.
|
|
390
|
+
*/
|
|
391
|
+
export function extractPdfTextSnippet(items, maxLength = 420) {
|
|
392
|
+
const parts = [];
|
|
393
|
+
for (const item of items) {
|
|
394
|
+
if (item && typeof item === 'object' && 'str' in item) {
|
|
395
|
+
const str = String(item.str ?? '').trim();
|
|
396
|
+
if (str)
|
|
397
|
+
parts.push(str);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
const joined = parts.join(' ').replace(/\s+/g, ' ').trim();
|
|
401
|
+
if (joined.length <= maxLength)
|
|
402
|
+
return joined;
|
|
403
|
+
return `${joined.slice(0, Math.max(0, maxLength - 3)).trim()}...`;
|
|
404
|
+
}
|
|
405
|
+
/** Exports extracted e-invoice line items and metadata as RFC 4180 CSV. */
|
|
406
|
+
export function einvoiceLinesToCsv(invoice, includeBom = false) {
|
|
407
|
+
const header = [
|
|
408
|
+
'invoice_number',
|
|
409
|
+
'issue_date',
|
|
410
|
+
'currency',
|
|
411
|
+
'line_id',
|
|
412
|
+
'item_name',
|
|
413
|
+
'quantity',
|
|
414
|
+
'unit_code',
|
|
415
|
+
'unit_price',
|
|
416
|
+
'vat_rate_percent',
|
|
417
|
+
'line_total',
|
|
418
|
+
];
|
|
419
|
+
const rows = invoice.lines.map((line) => [
|
|
420
|
+
invoice.invoiceNumber,
|
|
421
|
+
invoice.issueDate,
|
|
422
|
+
invoice.currency,
|
|
423
|
+
line.id,
|
|
424
|
+
line.name,
|
|
425
|
+
line.qty,
|
|
426
|
+
line.unitCode,
|
|
427
|
+
line.unitPrice.toFixed(2),
|
|
428
|
+
line.vatRate === null ? '' : String(line.vatRate),
|
|
429
|
+
line.lineTotal.toFixed(2),
|
|
430
|
+
]);
|
|
431
|
+
const csv = toCsv([header, ...rows]);
|
|
432
|
+
return includeBom ? `\uFEFF${csv}` : csv;
|
|
433
|
+
}
|
|
434
|
+
/** Serializes a parsed e-invoice into formatted JSON. */
|
|
435
|
+
export function einvoiceToJson(invoice) {
|
|
436
|
+
return JSON.stringify(invoice, null, 2);
|
|
437
|
+
}
|
|
438
|
+
/** Built-in Factur-X EN 16931 (UN/CEFACT CII) sample payload (urn: URIs only). */
|
|
439
|
+
export const SAMPLE_FACTURX_CII_XML = `<?xml version="1.0" encoding="UTF-8"?>
|
|
440
|
+
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
|
|
441
|
+
<rsm:ExchangedDocumentContext>
|
|
442
|
+
<ram:GuidelineSpecifiedDocumentContextParameter>
|
|
443
|
+
<ram:ID>urn:cen.eu:en16931:2017</ram:ID>
|
|
444
|
+
</ram:GuidelineSpecifiedDocumentContextParameter>
|
|
445
|
+
</rsm:ExchangedDocumentContext>
|
|
446
|
+
<rsm:ExchangedDocument>
|
|
447
|
+
<ram:ID>FX-2026-0142</ram:ID>
|
|
448
|
+
<ram:TypeCode>380</ram:TypeCode>
|
|
449
|
+
<ram:IssueDateTime>
|
|
450
|
+
<udt:DateTimeString format="102">20260315</udt:DateTimeString>
|
|
451
|
+
</ram:IssueDateTime>
|
|
452
|
+
</rsm:ExchangedDocument>
|
|
453
|
+
<rsm:SupplyChainTradeTransaction>
|
|
454
|
+
<ram:IncludedSupplyChainTradeLineItem>
|
|
455
|
+
<ram:AssociatedDocumentLineDocument>
|
|
456
|
+
<ram:LineID>1</ram:LineID>
|
|
457
|
+
</ram:AssociatedDocumentLineDocument>
|
|
458
|
+
<ram:SpecifiedTradeProduct>
|
|
459
|
+
<ram:Name>Accounting Audit Advisory (Hours)</ram:Name>
|
|
460
|
+
</ram:SpecifiedTradeProduct>
|
|
461
|
+
<ram:SpecifiedLineTradeAgreement>
|
|
462
|
+
<ram:NetPriceProductTradePrice>
|
|
463
|
+
<ram:ChargeAmount>180.00</ram:ChargeAmount>
|
|
464
|
+
</ram:NetPriceProductTradePrice>
|
|
465
|
+
</ram:SpecifiedLineTradeAgreement>
|
|
466
|
+
<ram:SpecifiedLineTradeDelivery>
|
|
467
|
+
<ram:BilledQuantity unitCode="HUR">8</ram:BilledQuantity>
|
|
468
|
+
</ram:SpecifiedLineTradeDelivery>
|
|
469
|
+
<ram:SpecifiedLineTradeSettlement>
|
|
470
|
+
<ram:ApplicableTradeTax>
|
|
471
|
+
<ram:TypeCode>VAT</ram:TypeCode>
|
|
472
|
+
<ram:CategoryCode>S</ram:CategoryCode>
|
|
473
|
+
<ram:RateApplicablePercent>20.00</ram:RateApplicablePercent>
|
|
474
|
+
</ram:ApplicableTradeTax>
|
|
475
|
+
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
|
476
|
+
<ram:LineTotalAmount>1440.00</ram:LineTotalAmount>
|
|
477
|
+
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
|
478
|
+
</ram:SpecifiedLineTradeSettlement>
|
|
479
|
+
</ram:IncludedSupplyChainTradeLineItem>
|
|
480
|
+
<ram:IncludedSupplyChainTradeLineItem>
|
|
481
|
+
<ram:AssociatedDocumentLineDocument>
|
|
482
|
+
<ram:LineID>2</ram:LineID>
|
|
483
|
+
</ram:AssociatedDocumentLineDocument>
|
|
484
|
+
<ram:SpecifiedTradeProduct>
|
|
485
|
+
<ram:Name>Annual Compliance Archive License</ram:Name>
|
|
486
|
+
</ram:SpecifiedTradeProduct>
|
|
487
|
+
<ram:SpecifiedLineTradeAgreement>
|
|
488
|
+
<ram:NetPriceProductTradePrice>
|
|
489
|
+
<ram:ChargeAmount>360.00</ram:ChargeAmount>
|
|
490
|
+
</ram:NetPriceProductTradePrice>
|
|
491
|
+
</ram:SpecifiedLineTradeAgreement>
|
|
492
|
+
<ram:SpecifiedLineTradeDelivery>
|
|
493
|
+
<ram:BilledQuantity unitCode="C62">1</ram:BilledQuantity>
|
|
494
|
+
</ram:SpecifiedLineTradeDelivery>
|
|
495
|
+
<ram:SpecifiedLineTradeSettlement>
|
|
496
|
+
<ram:ApplicableTradeTax>
|
|
497
|
+
<ram:TypeCode>VAT</ram:TypeCode>
|
|
498
|
+
<ram:CategoryCode>S</ram:CategoryCode>
|
|
499
|
+
<ram:RateApplicablePercent>20.00</ram:RateApplicablePercent>
|
|
500
|
+
</ram:ApplicableTradeTax>
|
|
501
|
+
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
|
502
|
+
<ram:LineTotalAmount>360.00</ram:LineTotalAmount>
|
|
503
|
+
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
|
504
|
+
</ram:SpecifiedLineTradeSettlement>
|
|
505
|
+
</ram:IncludedSupplyChainTradeLineItem>
|
|
506
|
+
<ram:ApplicableHeaderTradeAgreement>
|
|
507
|
+
<ram:SellerTradeParty>
|
|
508
|
+
<ram:Name>Atelier Fiscal Lyon SAS</ram:Name>
|
|
509
|
+
<ram:PostalTradeAddress>
|
|
510
|
+
<ram:PostcodeCode>69002</ram:PostcodeCode>
|
|
511
|
+
<ram:LineOne>18 Rue de la Republique</ram:LineOne>
|
|
512
|
+
<ram:CityName>Lyon</ram:CityName>
|
|
513
|
+
<ram:CountryID>FR</ram:CountryID>
|
|
514
|
+
</ram:PostalTradeAddress>
|
|
515
|
+
<ram:SpecifiedTaxRegistration>
|
|
516
|
+
<ram:ID schemeID="VA">FR40303265045</ram:ID>
|
|
517
|
+
</ram:SpecifiedTaxRegistration>
|
|
518
|
+
</ram:SellerTradeParty>
|
|
519
|
+
<ram:BuyerTradeParty>
|
|
520
|
+
<ram:Name>Nordic Logistics GmbH</ram:Name>
|
|
521
|
+
<ram:PostalTradeAddress>
|
|
522
|
+
<ram:PostcodeCode>20457</ram:PostcodeCode>
|
|
523
|
+
<ram:LineOne>Am Sandtorkai 72</ram:LineOne>
|
|
524
|
+
<ram:CityName>Hamburg</ram:CityName>
|
|
525
|
+
<ram:CountryID>DE</ram:CountryID>
|
|
526
|
+
</ram:PostalTradeAddress>
|
|
527
|
+
<ram:SpecifiedTaxRegistration>
|
|
528
|
+
<ram:ID schemeID="VA">DE123456789</ram:ID>
|
|
529
|
+
</ram:SpecifiedTaxRegistration>
|
|
530
|
+
</ram:BuyerTradeParty>
|
|
531
|
+
</ram:ApplicableHeaderTradeAgreement>
|
|
532
|
+
<ram:ApplicableHeaderTradeSettlement>
|
|
533
|
+
<ram:PaymentReference>FX-2026-0142</ram:PaymentReference>
|
|
534
|
+
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
|
|
535
|
+
<ram:SpecifiedTradeSettlementPaymentMeans>
|
|
536
|
+
<ram:TypeCode>58</ram:TypeCode>
|
|
537
|
+
<ram:PayeePartyCreditorFinancialAccount>
|
|
538
|
+
<ram:IBANID>FR7630006000011234567890189</ram:IBANID>
|
|
539
|
+
</ram:PayeePartyCreditorFinancialAccount>
|
|
540
|
+
<ram:PayeeSpecifiedCreditorFinancialInstitution>
|
|
541
|
+
<ram:BICID>AGRIFRPP</ram:BICID>
|
|
542
|
+
</ram:PayeeSpecifiedCreditorFinancialInstitution>
|
|
543
|
+
</ram:SpecifiedTradeSettlementPaymentMeans>
|
|
544
|
+
<ram:SpecifiedTradePaymentTerms>
|
|
545
|
+
<ram:DueDateDateTime>
|
|
546
|
+
<udt:DateTimeString format="102">20260414</udt:DateTimeString>
|
|
547
|
+
</ram:DueDateDateTime>
|
|
548
|
+
</ram:SpecifiedTradePaymentTerms>
|
|
549
|
+
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
|
550
|
+
<ram:LineTotalAmount>1800.00</ram:LineTotalAmount>
|
|
551
|
+
<ram:TaxBasisTotalAmount>1800.00</ram:TaxBasisTotalAmount>
|
|
552
|
+
<ram:TaxTotalAmount currencyID="EUR">360.00</ram:TaxTotalAmount>
|
|
553
|
+
<ram:GrandTotalAmount>2160.00</ram:GrandTotalAmount>
|
|
554
|
+
<ram:DuePayableAmount>2160.00</ram:DuePayableAmount>
|
|
555
|
+
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
|
556
|
+
</ram:ApplicableHeaderTradeSettlement>
|
|
557
|
+
</rsm:SupplyChainTradeTransaction>
|
|
558
|
+
</rsm:CrossIndustryInvoice>`;
|
|
559
|
+
/** Built-in UBL 2.1 XRechnung sample payload (urn: URIs only). */
|
|
560
|
+
export const SAMPLE_UBL_XRECHNUNG_XML = `<?xml version="1.0" encoding="UTF-8"?>
|
|
561
|
+
<ubl:Invoice xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
|
|
562
|
+
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID>
|
|
563
|
+
<cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
|
|
564
|
+
<cbc:ID>XR-2026-8804</cbc:ID>
|
|
565
|
+
<cbc:IssueDate>2026-03-20</cbc:IssueDate>
|
|
566
|
+
<cbc:DueDate>2026-04-19</cbc:DueDate>
|
|
567
|
+
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
|
|
568
|
+
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
|
|
569
|
+
<cac:AccountingSupplierParty>
|
|
570
|
+
<cac:Party>
|
|
571
|
+
<cac:PostalAddress>
|
|
572
|
+
<cbc:StreetName>Friedrichstrasse 114</cbc:StreetName>
|
|
573
|
+
<cbc:CityName>Berlin</cbc:CityName>
|
|
574
|
+
<cbc:PostalZone>10117</cbc:PostalZone>
|
|
575
|
+
<cac:Country>
|
|
576
|
+
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
|
577
|
+
</cac:Country>
|
|
578
|
+
</cac:PostalAddress>
|
|
579
|
+
<cac:PartyTaxScheme>
|
|
580
|
+
<cbc:CompanyID>DE298765432</cbc:CompanyID>
|
|
581
|
+
</cac:PartyTaxScheme>
|
|
582
|
+
<cac:PartyLegalEntity>
|
|
583
|
+
<cbc:RegistrationName>RheinWerk Software GmbH</cbc:RegistrationName>
|
|
584
|
+
</cac:PartyLegalEntity>
|
|
585
|
+
</cac:Party>
|
|
586
|
+
</cac:AccountingSupplierParty>
|
|
587
|
+
<cac:AccountingCustomerParty>
|
|
588
|
+
<cac:Party>
|
|
589
|
+
<cac:PostalAddress>
|
|
590
|
+
<cbc:StreetName>Bahnhofplatz 4</cbc:StreetName>
|
|
591
|
+
<cbc:CityName>Munich</cbc:CityName>
|
|
592
|
+
<cbc:PostalZone>80335</cbc:PostalZone>
|
|
593
|
+
<cac:Country>
|
|
594
|
+
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
|
595
|
+
</cac:Country>
|
|
596
|
+
</cac:PostalAddress>
|
|
597
|
+
<cac:PartyTaxScheme>
|
|
598
|
+
<cbc:CompanyID>DE198765431</cbc:CompanyID>
|
|
599
|
+
</cac:PartyTaxScheme>
|
|
600
|
+
<cac:PartyLegalEntity>
|
|
601
|
+
<cbc:RegistrationName>Bavaria Cloud AG</cbc:RegistrationName>
|
|
602
|
+
</cac:PartyLegalEntity>
|
|
603
|
+
</cac:Party>
|
|
604
|
+
</cac:AccountingCustomerParty>
|
|
605
|
+
<cac:PaymentMeans>
|
|
606
|
+
<cbc:PaymentID>XR-2026-8804</cbc:PaymentID>
|
|
607
|
+
<cac:PayeeFinancialAccount>
|
|
608
|
+
<cbc:ID>DE89370400440532013000</cbc:ID>
|
|
609
|
+
<cac:FinancialInstitutionBranch>
|
|
610
|
+
<cbc:ID>COBADEFFXXX</cbc:ID>
|
|
611
|
+
</cac:FinancialInstitutionBranch>
|
|
612
|
+
</cac:PayeeFinancialAccount>
|
|
613
|
+
</cac:PaymentMeans>
|
|
614
|
+
<cac:TaxTotal>
|
|
615
|
+
<cbc:TaxAmount currencyID="EUR">228.00</cbc:TaxAmount>
|
|
616
|
+
</cac:TaxTotal>
|
|
617
|
+
<cac:LegalMonetaryTotal>
|
|
618
|
+
<cbc:LineExtensionAmount currencyID="EUR">1200.00</cbc:LineExtensionAmount>
|
|
619
|
+
<cbc:TaxExclusiveAmount currencyID="EUR">1200.00</cbc:TaxExclusiveAmount>
|
|
620
|
+
<cbc:TaxInclusiveAmount currencyID="EUR">1428.00</cbc:TaxInclusiveAmount>
|
|
621
|
+
<cbc:PayableAmount currencyID="EUR">1428.00</cbc:PayableAmount>
|
|
622
|
+
</cac:LegalMonetaryTotal>
|
|
623
|
+
<cac:InvoiceLine>
|
|
624
|
+
<cbc:ID>10</cbc:ID>
|
|
625
|
+
<cbc:InvoicedQuantity unitCode="MON">3</cbc:InvoicedQuantity>
|
|
626
|
+
<cbc:LineExtensionAmount currencyID="EUR">900.00</cbc:LineExtensionAmount>
|
|
627
|
+
<cac:Item>
|
|
628
|
+
<cbc:Name>Managed Hosting Cluster</cbc:Name>
|
|
629
|
+
<cac:ClassifiedTaxCategory>
|
|
630
|
+
<cbc:Percent>19</cbc:Percent>
|
|
631
|
+
</cac:ClassifiedTaxCategory>
|
|
632
|
+
</cac:Item>
|
|
633
|
+
<cac:Price>
|
|
634
|
+
<cbc:PriceAmount currencyID="EUR">300.00</cbc:PriceAmount>
|
|
635
|
+
</cac:Price>
|
|
636
|
+
</cac:InvoiceLine>
|
|
637
|
+
<cac:InvoiceLine>
|
|
638
|
+
<cbc:ID>20</cbc:ID>
|
|
639
|
+
<cbc:InvoicedQuantity unitCode="HUR">2</cbc:InvoicedQuantity>
|
|
640
|
+
<cbc:LineExtensionAmount currencyID="EUR">300.00</cbc:LineExtensionAmount>
|
|
641
|
+
<cac:Item>
|
|
642
|
+
<cbc:Name>Security Onboarding Workshop</cbc:Name>
|
|
643
|
+
<cac:ClassifiedTaxCategory>
|
|
644
|
+
<cbc:Percent>19</cbc:Percent>
|
|
645
|
+
</cac:ClassifiedTaxCategory>
|
|
646
|
+
</cac:Item>
|
|
647
|
+
<cac:Price>
|
|
648
|
+
<cbc:PriceAmount currencyID="EUR">150.00</cbc:PriceAmount>
|
|
649
|
+
</cac:Price>
|
|
650
|
+
</cac:InvoiceLine>
|
|
651
|
+
</ubl:Invoice>`;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './einvoice-viewer.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './einvoice-viewer.js';
|