sinfactura-types 1.10.283 → 1.10.284

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.
Files changed (2) hide show
  1. package/dist/report.d.ts +49 -0
  2. package/package.json +1 -1
package/dist/report.d.ts CHANGED
@@ -32,6 +32,27 @@ declare global {
32
32
  /** `cost - returnCost`. Forward-only — see `returns`. */
33
33
  netCost?: number;
34
34
  }
35
+ /**
36
+ * One IVA rate's slice of a `ReportInvoicesAmounts` bucket.
37
+ *
38
+ * ⚠️ The SIGN follows the bucket it sits in, exactly like the scalar
39
+ * `neto`/`iva` beside it: positive magnitudes inside `gross` and `credit`,
40
+ * and `gross - credit` inside `net` — so a rate whose credit notes outweigh
41
+ * its facturas (or that a day credited without invoicing) carries NEGATIVE
42
+ * figures in `net.rates` and only there.
43
+ */
44
+ interface ReportInvoicesRateAmount {
45
+ /**
46
+ * AFIP Iva Id — `3` (0,00 %), `4` (10,50 %), `5` (21,00 %), `6` (27,00 %),
47
+ * `8` (5,00 %), `9` (2,50 %). ARCA *Tablas del SISTEMA* §1 one-for-one; the
48
+ * same numbering `InvoiceAlicuota.id` uses, NOT a percentage.
49
+ */
50
+ id: number;
51
+ /** Neto gravado on this rate. */
52
+ neto: number;
53
+ /** Débito fiscal (IVA) on this rate. */
54
+ iva: number;
55
+ }
35
56
  /**
36
57
  * One FAC/NC/net bucket of the ventas IVA summary. Every amount is a POSITIVE
37
58
  * magnitude, including `credit` — netting is expressed by the `net` bucket only.
@@ -45,6 +66,29 @@ declare global {
45
66
  iva: number;
46
67
  /** `ImpTotal` sum. */
47
68
  total: number;
69
+ /**
70
+ * The per-rate decomposition of `neto`/`iva`, ascending by AFIP Iva Id.
71
+ * SPARSE — a rate absent from the bucket emits no entry, so an empty array
72
+ * means no declared alícuota at all (an export-only or Factura C-only day).
73
+ *
74
+ * ⚠️ **`net.rates` is the netted per-rate base**, and the only one in this
75
+ * payload. The legacy `neto10`/`neto21`/`iva10`/`iva21` columns on
76
+ * `ReportInvoicesResume` sum credit notes with a POSITIVE sign and cover
77
+ * only Iva Ids 4 and 5 — they are neither netted nor complete, and must not
78
+ * be presented as a «base imponible».
79
+ *
80
+ * ⚠️ `neto`/`iva` stay authoritative for the bucket total. Each entry is
81
+ * rounded to 2 decimals independently of the scalar beside it, so the two
82
+ * can disagree by a cent for sub-centavo alícuota bases — which the stored
83
+ * 2-decimal amounts do not produce today. Read the scalar for the total,
84
+ * `rates` for the split; do not re-derive one from the other.
85
+ *
86
+ * ⚠️ Rows whose voucher class declares no débito fiscal — exports
87
+ * (CbteTipo 19/20/21) and the Factura C family — contribute to `quantity`
88
+ * and `total` but to NO rate entry, matching `neto`/`iva`. Their internal
89
+ * `Invoice.alicuotas` breakdown is not declared IVA.
90
+ */
91
+ rates: ReportInvoicesRateAmount[];
48
92
  }
49
93
  /**
50
94
  * One day of the `GET /reports?mode=invoices&date=YYYYMM` ventas summary.
@@ -62,6 +106,11 @@ declare global {
62
106
  * Legacy roll-up columns summing EVERY deliverable voucher with a POSITIVE
63
107
  * sign (credit notes included), so `total` mixes debits and credits.
64
108
  * Retained for wire compatibility; prefer `gross`/`credit`/`net` below.
109
+ *
110
+ * ⚠️ `neto10`/`neto21`/`iva10`/`iva21` are NOT a taxable base. They add a
111
+ * Nota de Crédito to the figure it should reduce, and they cover only Iva
112
+ * Ids 4 and 5 — a voucher on any of the other four declarable rates is
113
+ * missing from them entirely. The netted per-rate base is `net.rates`.
65
114
  */
66
115
  neto10: number;
67
116
  neto21: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.283",
3
+ "version": "1.10.284",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",