sinfactura-types 1.8.0 → 1.8.1
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/dist/invoice.d.ts +36 -0
- package/package.json +1 -1
package/dist/invoice.d.ts
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
type FiscalStatus = 'pending_cae' | 'authorized_cae' | 'authorized_caea' | 'caea_reported' | 'rejected' | 'voided';
|
|
3
|
+
/**
|
|
4
|
+
* One discriminated IVA alicuota on an issued voucher (api#1961).
|
|
5
|
+
*
|
|
6
|
+
* `id` is AFIP's WSFE `Iva[].Id`, which is ALSO the Libro IVA Digital alicuota
|
|
7
|
+
* code once 4-padded — verified against ARCA's *Tablas del SISTEMA* section 1:
|
|
8
|
+
* 0003 = 0,00 % · 0004 = 10,50 % · 0005 = 21,00 % · 0006 = 27,00 % ·
|
|
9
|
+
* 0008 = 5,00 % · 0009 = 2,50 %. Those six are the whole valid domain; Ids 1
|
|
10
|
+
* and 2 (No Gravado / Exento) are Codigos de Operacion, not alicuotas, and
|
|
11
|
+
* WSFEv1 rejects them inside `Iva[]`.
|
|
12
|
+
*
|
|
13
|
+
* A bucket is meaningful when `baseImp !== 0`: a 0 %-rated line has
|
|
14
|
+
* `importe === 0` but is still a real, declarable alicuota.
|
|
15
|
+
*/
|
|
16
|
+
interface InvoiceAlicuota {
|
|
17
|
+
/** AFIP WSFE `Iva[].Id` — one of 3, 4, 5, 6, 8, 9. */
|
|
18
|
+
id: number;
|
|
19
|
+
/** Neto gravado at this rate. */
|
|
20
|
+
baseImp: number;
|
|
21
|
+
/** IVA liquidado at this rate; `0` for the 0 % rate. */
|
|
22
|
+
importe: number;
|
|
23
|
+
}
|
|
3
24
|
interface Invoice {
|
|
4
25
|
storeId: string;
|
|
5
26
|
invoiceId: string;
|
|
@@ -28,6 +49,21 @@ declare global {
|
|
|
28
49
|
neto21: number;
|
|
29
50
|
iva10: number;
|
|
30
51
|
iva21: number;
|
|
52
|
+
/**
|
|
53
|
+
* api#1961 — the FULL per-alicuota IVA breakdown, one entry per declared rate.
|
|
54
|
+
*
|
|
55
|
+
* The `neto10`/`neto21`/`iva10`/`iva21` quartet above only ever captured AFIP
|
|
56
|
+
* Iva Ids 4 (10,5 %) and 5 (21 %). The catalog has SIX rates, so the other
|
|
57
|
+
* four (0 %, 2,5 %, 5 %, 27 %) were declared to ARCA yet dropped from the row,
|
|
58
|
+
* while `total` included every bucket — silently under-reporting the Libro IVA
|
|
59
|
+
* Digital, the RG 3685 export, the F.2051 apertura and the invoice PDF.
|
|
60
|
+
*
|
|
61
|
+
* Forward-only, no backfill: absent on every row issued before api#1961, and
|
|
62
|
+
* never set on the WSFEX export path. Consumers MUST fall back to the legacy
|
|
63
|
+
* quartet when it is absent rather than treating an empty result as "no IVA".
|
|
64
|
+
* The quartet is retained, not deprecated — still written on every new row.
|
|
65
|
+
*/
|
|
66
|
+
alicuotas?: InvoiceAlicuota[];
|
|
31
67
|
discount?: number;
|
|
32
68
|
total: number;
|
|
33
69
|
cae: string;
|