@ekwo-ai/factur-x 0.9.0 → 0.10.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/README.md CHANGED
@@ -60,8 +60,8 @@ const back = await extractFacturX(pdf); // { filename: 'factu
60
60
  ### VAT categories
61
61
 
62
62
  Each line carries a `vatRate`. The category (BT-151) is derived when you do not state it:
63
- positive rate → `S`; zero rate at home → `Z`; zero rate to an EU business with a VAT id → `K`
64
- (intra-community); to an EU buyer without one → `E`; outside the EU → `G`. Set `vatCategory`
63
+ positive rate → `S`; zero rate at home → `Z`; zero rate to a business in another Member State of the European Union with a VAT id → `K`
64
+ (supply between Member States); to a buyer there without one → `E`; outside the European Union → `G`. Set `vatCategory`
65
65
  on the line to override (`AE` reverse charge, `O` not subject to VAT…). Exempt groups get a
66
66
  reason text (BT-120, override with `invoice.exemptionReasons`) and the VATEX code where one
67
67
  exists.
package/dist/types.d.ts CHANGED
@@ -13,8 +13,8 @@ export type CurrencyCode = string;
13
13
  * - `Z` zero rated
14
14
  * - `E` exempt
15
15
  * - `AE` reverse charge
16
- * - `K` intra-community supply
17
- * - `G` export outside the EU
16
+ * - `K` supply between Member States of the European Union
17
+ * - `G` export outside the European Union
18
18
  * - `O` not subject to VAT
19
19
  */
20
20
  export type VatCategory = 'S' | 'Z' | 'E' | 'AE' | 'K' | 'G' | 'O';
package/dist/vat.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import type { VatCategory } from './types.js';
2
- /** EU member states, ISO 3166-1 alpha-2. */
2
+ /** Member States of the European Union, ISO 3166-1 alpha-2. */
3
3
  export declare const EU_COUNTRIES: ReadonlySet<string>;
4
4
  export declare function isEuCountry(code: string): boolean;
5
5
  /**
6
6
  * Picks the VAT category of a line when the caller does not state it.
7
- * Positive rate → standard. Zero rate: domestic → zero-rated; EU buyer with a
8
- * VAT identifier → intra-community supply; EU buyer without → exempt;
9
- * non-EU buyer → export.
7
+ * Positive rate → standard. Zero rate: domestic → zero-rated; buyer in the European Union with a
8
+ * VAT identifier → supply between Member States; such a buyer without → exempt;
9
+ * buyer outside the European Union → export.
10
10
  */
11
11
  export declare function defaultVatCategory(input: {
12
12
  rate: number;
package/dist/vat.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../src/vat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,4CAA4C;AAC5C,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAG3C,CAAC;AAEH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;CACxB,GAAG,WAAW,CAOd;AAED,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,WAAW,CAAuC,CAAC;AAE/F,8DAA8D;AAC9D,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAKjF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,EAAE,MAAM,CAAC,CAM/F,CAAC"}
1
+ {"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../src/vat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,+DAA+D;AAC/D,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAG3C,CAAC;AAEH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;CACxB,GAAG,WAAW,CAOd;AAED,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,WAAW,CAAuC,CAAC;AAE/F,8DAA8D;AAC9D,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAKjF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,EAAE,MAAM,CAAC,CAM/F,CAAC"}
package/dist/vat.js CHANGED
@@ -1,4 +1,4 @@
1
- /** EU member states, ISO 3166-1 alpha-2. */
1
+ /** Member States of the European Union, ISO 3166-1 alpha-2. */
2
2
  export const EU_COUNTRIES = new Set([
3
3
  'AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GR', 'HR', 'HU',
4
4
  'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK',
@@ -8,9 +8,9 @@ export function isEuCountry(code) {
8
8
  }
9
9
  /**
10
10
  * Picks the VAT category of a line when the caller does not state it.
11
- * Positive rate → standard. Zero rate: domestic → zero-rated; EU buyer with a
12
- * VAT identifier → intra-community supply; EU buyer without → exempt;
13
- * non-EU buyer → export.
11
+ * Positive rate → standard. Zero rate: domestic → zero-rated; buyer in the European Union with a
12
+ * VAT identifier → supply between Member States; such a buyer without → exempt;
13
+ * buyer outside the European Union → export.
14
14
  */
15
15
  export function defaultVatCategory(input) {
16
16
  if (input.rate > 0)
@@ -36,7 +36,7 @@ export const EXEMPTION_REASON_CODES = {
36
36
  export const DEFAULT_EXEMPTION_REASONS = {
37
37
  E: 'Exempt from VAT',
38
38
  AE: 'Reverse charge: VAT to be accounted for by the recipient',
39
- K: 'Intra-community supply, exempt from VAT',
39
+ K: 'Supply between Member States of the European Union, exempt from VAT',
40
40
  G: 'Export outside the European Union, exempt from VAT',
41
41
  O: 'Not subject to VAT',
42
42
  };
package/dist/vat.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vat.js","sourceRoot":"","sources":["../src/vat.ts"],"names":[],"mappings":"AAEA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IACvD,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAClF,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC7E,CAAC,CAAC;AAEH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAKlC;IACC,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAC/C,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,GAAG,CAAC;IACjC,IA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W,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAKlC;IACC,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAC/C,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,GAAG,CAAC;IACjC,IAAI,WAAW,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC/D,OAAO,GAAG,CAAC;AACb,CAAC;AAED,mGAAmG;AACnG,MAAM,CAAC,MAAM,iBAAiB,GAA6B,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE/F,8DAA8D;AAC9D,MAAM,CAAC,MAAM,sBAAsB,GAAmD;IACpF,CAAC,EAAE,aAAa;IAChB,EAAE,EAAE,aAAa;IACjB,CAAC,EAAE,YAAY;IACf,CAAC,EAAE,YAAY;CAChB,CAAC;AAEF,2FAA2F;AAC3F,MAAM,CAAC,MAAM,yBAAyB,GAA8D;IAClG,CAAC,EAAE,iBAAiB;IACpB,EAAE,EAAE,0DAA0D;IAC9D,CAAC,EAAE,qEAAqE;IACxE,CAAC,EAAE,oDAAoD;IACvD,CAAC,EAAE,oBAAoB;CACxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekwo-ai/factur-x",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Factur-X / ZUGFeRD e-invoices in TypeScript: EN 16931 CII XML from a plain invoice object, PDF/A-3 embedding and extraction.",
5
5
  "keywords": [
6
6
  "factur-x",