arca-sdk 1.1.2 → 1.2.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/CHANGELOG.md +8 -0
- package/dist/index.cjs +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -208,6 +208,23 @@ interface InvoiceItem {
|
|
|
208
208
|
/** Alícuota IVA % (0, 10.5, 21, 27) */
|
|
209
209
|
vatRate?: number;
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Condición frente al IVA del receptor (según catálogo ARCA/AFIP)
|
|
213
|
+
*/
|
|
214
|
+
declare enum VatCondition {
|
|
215
|
+
IVA_RESPONSABLE_INSCRIPTO = 1,
|
|
216
|
+
IVA_RESPONSABLE_NO_INSCRIPTO = 2,
|
|
217
|
+
IVA_NO_RESPONSABLE = 3,
|
|
218
|
+
IVA_SUJETO_EXENTO = 4,
|
|
219
|
+
CONSUMIDOR_FINAL = 5,
|
|
220
|
+
RESPONSABLE_MONOTRIBUTO = 6,
|
|
221
|
+
SUJETO_NO_CATEGORIZADO = 7,
|
|
222
|
+
PROVEEDOR_DEL_EXTERIOR = 8,
|
|
223
|
+
CLIENTE_DEL_EXTERIOR = 9,
|
|
224
|
+
IVA_LIBERADO_LEY_19640 = 10,
|
|
225
|
+
IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION = 11,
|
|
226
|
+
MONOTRIBUTISTA_SOCIAL = 13
|
|
227
|
+
}
|
|
211
228
|
/**
|
|
212
229
|
* Datos del comprador
|
|
213
230
|
*/
|
|
@@ -216,8 +233,8 @@ interface Buyer {
|
|
|
216
233
|
docType: TaxIdType;
|
|
217
234
|
/** Número de documento (sin guiones) */
|
|
218
235
|
docNumber: string;
|
|
219
|
-
/** Opcional: Condición frente al IVA del receptor (ej:
|
|
220
|
-
vatCondition?: number;
|
|
236
|
+
/** Opcional: Condición frente al IVA del receptor (ej: VatCondition.CONSUMIDOR_FINAL) */
|
|
237
|
+
vatCondition?: VatCondition | number;
|
|
221
238
|
}
|
|
222
239
|
/**
|
|
223
240
|
* Comprobante asociado (Requerido al emitir Notas de Crédito/Débito)
|
|
@@ -420,6 +437,7 @@ declare class WsfeService {
|
|
|
420
437
|
concept?: BillingConcept;
|
|
421
438
|
date?: Date;
|
|
422
439
|
optionals?: InvoiceOptional[];
|
|
440
|
+
serviceDates?: ServiceDates;
|
|
423
441
|
}): Promise<CAEResponse>;
|
|
424
442
|
/**
|
|
425
443
|
* Emite un Ticket C con detalle de items.
|
|
@@ -430,6 +448,7 @@ declare class WsfeService {
|
|
|
430
448
|
concept?: BillingConcept;
|
|
431
449
|
date?: Date;
|
|
432
450
|
optionals?: InvoiceOptional[];
|
|
451
|
+
serviceDates?: ServiceDates;
|
|
433
452
|
}): Promise<CAEResponse>;
|
|
434
453
|
/**
|
|
435
454
|
* Emite una Factura A (Responsable Inscripto a Responsable Inscripto, con IVA discriminado).
|
|
@@ -442,6 +461,7 @@ declare class WsfeService {
|
|
|
442
461
|
date?: Date;
|
|
443
462
|
includesVAT?: boolean;
|
|
444
463
|
optionals?: InvoiceOptional[];
|
|
464
|
+
serviceDates?: ServiceDates;
|
|
445
465
|
}): Promise<CAEResponse>;
|
|
446
466
|
/**
|
|
447
467
|
* Emite una Factura B (con IVA discriminado).
|
|
@@ -454,6 +474,7 @@ declare class WsfeService {
|
|
|
454
474
|
date?: Date;
|
|
455
475
|
includesVAT?: boolean;
|
|
456
476
|
optionals?: InvoiceOptional[];
|
|
477
|
+
serviceDates?: ServiceDates;
|
|
457
478
|
}): Promise<CAEResponse>;
|
|
458
479
|
/**
|
|
459
480
|
* Emite una Factura C (consumidor final, sin discriminación de IVA).
|
|
@@ -464,6 +485,7 @@ declare class WsfeService {
|
|
|
464
485
|
date?: Date;
|
|
465
486
|
buyer?: Buyer;
|
|
466
487
|
optionals?: InvoiceOptional[];
|
|
488
|
+
serviceDates?: ServiceDates;
|
|
467
489
|
}): Promise<CAEResponse>;
|
|
468
490
|
/**
|
|
469
491
|
* Emite un Recibo A (con IVA discriminado).
|
|
@@ -475,6 +497,7 @@ declare class WsfeService {
|
|
|
475
497
|
date?: Date;
|
|
476
498
|
includesVAT?: boolean;
|
|
477
499
|
optionals?: InvoiceOptional[];
|
|
500
|
+
serviceDates?: ServiceDates;
|
|
478
501
|
}): Promise<CAEResponse>;
|
|
479
502
|
/**
|
|
480
503
|
* Emite un Recibo B (con IVA discriminado).
|
|
@@ -486,6 +509,7 @@ declare class WsfeService {
|
|
|
486
509
|
date?: Date;
|
|
487
510
|
includesVAT?: boolean;
|
|
488
511
|
optionals?: InvoiceOptional[];
|
|
512
|
+
serviceDates?: ServiceDates;
|
|
489
513
|
}): Promise<CAEResponse>;
|
|
490
514
|
/**
|
|
491
515
|
* Emite un Recibo C (sin discriminación de IVA).
|
|
@@ -496,6 +520,7 @@ declare class WsfeService {
|
|
|
496
520
|
date?: Date;
|
|
497
521
|
buyer?: Buyer;
|
|
498
522
|
optionals?: InvoiceOptional[];
|
|
523
|
+
serviceDates?: ServiceDates;
|
|
499
524
|
}): Promise<CAEResponse>;
|
|
500
525
|
/**
|
|
501
526
|
* Emite una Nota de Crédito A.
|
|
@@ -534,6 +559,7 @@ declare class WsfeService {
|
|
|
534
559
|
date?: Date;
|
|
535
560
|
buyer?: Buyer;
|
|
536
561
|
optionals?: InvoiceOptional[];
|
|
562
|
+
serviceDates?: ServiceDates;
|
|
537
563
|
}): Promise<CAEResponse>;
|
|
538
564
|
/**
|
|
539
565
|
* Emite una Nota de Débito A.
|
|
@@ -572,6 +598,7 @@ declare class WsfeService {
|
|
|
572
598
|
date?: Date;
|
|
573
599
|
buyer?: Buyer;
|
|
574
600
|
optionals?: InvoiceOptional[];
|
|
601
|
+
serviceDates?: ServiceDates;
|
|
575
602
|
}): Promise<CAEResponse>;
|
|
576
603
|
/**
|
|
577
604
|
* Consulta un comprobante ya emitido (FECompConsultar).
|
|
@@ -752,4 +779,4 @@ declare class PadronService {
|
|
|
752
779
|
*/
|
|
753
780
|
declare function generateQRUrl(caeResponse: CAEResponse, issuerCUIT: string, total: number, buyer?: Buyer): string;
|
|
754
781
|
|
|
755
|
-
export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEResponse, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };
|
|
782
|
+
export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEResponse, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, VatCondition, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -208,6 +208,23 @@ interface InvoiceItem {
|
|
|
208
208
|
/** Alícuota IVA % (0, 10.5, 21, 27) */
|
|
209
209
|
vatRate?: number;
|
|
210
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Condición frente al IVA del receptor (según catálogo ARCA/AFIP)
|
|
213
|
+
*/
|
|
214
|
+
declare enum VatCondition {
|
|
215
|
+
IVA_RESPONSABLE_INSCRIPTO = 1,
|
|
216
|
+
IVA_RESPONSABLE_NO_INSCRIPTO = 2,
|
|
217
|
+
IVA_NO_RESPONSABLE = 3,
|
|
218
|
+
IVA_SUJETO_EXENTO = 4,
|
|
219
|
+
CONSUMIDOR_FINAL = 5,
|
|
220
|
+
RESPONSABLE_MONOTRIBUTO = 6,
|
|
221
|
+
SUJETO_NO_CATEGORIZADO = 7,
|
|
222
|
+
PROVEEDOR_DEL_EXTERIOR = 8,
|
|
223
|
+
CLIENTE_DEL_EXTERIOR = 9,
|
|
224
|
+
IVA_LIBERADO_LEY_19640 = 10,
|
|
225
|
+
IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION = 11,
|
|
226
|
+
MONOTRIBUTISTA_SOCIAL = 13
|
|
227
|
+
}
|
|
211
228
|
/**
|
|
212
229
|
* Datos del comprador
|
|
213
230
|
*/
|
|
@@ -216,8 +233,8 @@ interface Buyer {
|
|
|
216
233
|
docType: TaxIdType;
|
|
217
234
|
/** Número de documento (sin guiones) */
|
|
218
235
|
docNumber: string;
|
|
219
|
-
/** Opcional: Condición frente al IVA del receptor (ej:
|
|
220
|
-
vatCondition?: number;
|
|
236
|
+
/** Opcional: Condición frente al IVA del receptor (ej: VatCondition.CONSUMIDOR_FINAL) */
|
|
237
|
+
vatCondition?: VatCondition | number;
|
|
221
238
|
}
|
|
222
239
|
/**
|
|
223
240
|
* Comprobante asociado (Requerido al emitir Notas de Crédito/Débito)
|
|
@@ -420,6 +437,7 @@ declare class WsfeService {
|
|
|
420
437
|
concept?: BillingConcept;
|
|
421
438
|
date?: Date;
|
|
422
439
|
optionals?: InvoiceOptional[];
|
|
440
|
+
serviceDates?: ServiceDates;
|
|
423
441
|
}): Promise<CAEResponse>;
|
|
424
442
|
/**
|
|
425
443
|
* Emite un Ticket C con detalle de items.
|
|
@@ -430,6 +448,7 @@ declare class WsfeService {
|
|
|
430
448
|
concept?: BillingConcept;
|
|
431
449
|
date?: Date;
|
|
432
450
|
optionals?: InvoiceOptional[];
|
|
451
|
+
serviceDates?: ServiceDates;
|
|
433
452
|
}): Promise<CAEResponse>;
|
|
434
453
|
/**
|
|
435
454
|
* Emite una Factura A (Responsable Inscripto a Responsable Inscripto, con IVA discriminado).
|
|
@@ -442,6 +461,7 @@ declare class WsfeService {
|
|
|
442
461
|
date?: Date;
|
|
443
462
|
includesVAT?: boolean;
|
|
444
463
|
optionals?: InvoiceOptional[];
|
|
464
|
+
serviceDates?: ServiceDates;
|
|
445
465
|
}): Promise<CAEResponse>;
|
|
446
466
|
/**
|
|
447
467
|
* Emite una Factura B (con IVA discriminado).
|
|
@@ -454,6 +474,7 @@ declare class WsfeService {
|
|
|
454
474
|
date?: Date;
|
|
455
475
|
includesVAT?: boolean;
|
|
456
476
|
optionals?: InvoiceOptional[];
|
|
477
|
+
serviceDates?: ServiceDates;
|
|
457
478
|
}): Promise<CAEResponse>;
|
|
458
479
|
/**
|
|
459
480
|
* Emite una Factura C (consumidor final, sin discriminación de IVA).
|
|
@@ -464,6 +485,7 @@ declare class WsfeService {
|
|
|
464
485
|
date?: Date;
|
|
465
486
|
buyer?: Buyer;
|
|
466
487
|
optionals?: InvoiceOptional[];
|
|
488
|
+
serviceDates?: ServiceDates;
|
|
467
489
|
}): Promise<CAEResponse>;
|
|
468
490
|
/**
|
|
469
491
|
* Emite un Recibo A (con IVA discriminado).
|
|
@@ -475,6 +497,7 @@ declare class WsfeService {
|
|
|
475
497
|
date?: Date;
|
|
476
498
|
includesVAT?: boolean;
|
|
477
499
|
optionals?: InvoiceOptional[];
|
|
500
|
+
serviceDates?: ServiceDates;
|
|
478
501
|
}): Promise<CAEResponse>;
|
|
479
502
|
/**
|
|
480
503
|
* Emite un Recibo B (con IVA discriminado).
|
|
@@ -486,6 +509,7 @@ declare class WsfeService {
|
|
|
486
509
|
date?: Date;
|
|
487
510
|
includesVAT?: boolean;
|
|
488
511
|
optionals?: InvoiceOptional[];
|
|
512
|
+
serviceDates?: ServiceDates;
|
|
489
513
|
}): Promise<CAEResponse>;
|
|
490
514
|
/**
|
|
491
515
|
* Emite un Recibo C (sin discriminación de IVA).
|
|
@@ -496,6 +520,7 @@ declare class WsfeService {
|
|
|
496
520
|
date?: Date;
|
|
497
521
|
buyer?: Buyer;
|
|
498
522
|
optionals?: InvoiceOptional[];
|
|
523
|
+
serviceDates?: ServiceDates;
|
|
499
524
|
}): Promise<CAEResponse>;
|
|
500
525
|
/**
|
|
501
526
|
* Emite una Nota de Crédito A.
|
|
@@ -534,6 +559,7 @@ declare class WsfeService {
|
|
|
534
559
|
date?: Date;
|
|
535
560
|
buyer?: Buyer;
|
|
536
561
|
optionals?: InvoiceOptional[];
|
|
562
|
+
serviceDates?: ServiceDates;
|
|
537
563
|
}): Promise<CAEResponse>;
|
|
538
564
|
/**
|
|
539
565
|
* Emite una Nota de Débito A.
|
|
@@ -572,6 +598,7 @@ declare class WsfeService {
|
|
|
572
598
|
date?: Date;
|
|
573
599
|
buyer?: Buyer;
|
|
574
600
|
optionals?: InvoiceOptional[];
|
|
601
|
+
serviceDates?: ServiceDates;
|
|
575
602
|
}): Promise<CAEResponse>;
|
|
576
603
|
/**
|
|
577
604
|
* Consulta un comprobante ya emitido (FECompConsultar).
|
|
@@ -752,4 +779,4 @@ declare class PadronService {
|
|
|
752
779
|
*/
|
|
753
780
|
declare function generateQRUrl(caeResponse: CAEResponse, issuerCUIT: string, total: number, buyer?: Buyer): string;
|
|
754
781
|
|
|
755
|
-
export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEResponse, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };
|
|
782
|
+
export { type Activity, type Address, ArcaAuthError, type ArcaConfig, ArcaError, ArcaNetworkError, ArcaValidationError, BillingConcept, type Buyer, type CAEResponse, type Environment, type InvoiceDetails, type InvoiceItem, InvoiceType, type IssueInvoiceRequest, type LoginTicket, PadronService, type PointOfSale, type ServiceStatus, TaxIdType, type TaxRecord, type Taxpayer, type TaxpayerResponse, type TaxpayerServiceConfig, type TokenStorage, VatCondition, type WsaaConfig, WsaaService, type WsfeConfig, WsfeService, generateQRUrl };
|
package/dist/index.js
CHANGED
|
@@ -497,6 +497,21 @@ var TaxIdType = /* @__PURE__ */ ((TaxIdType2) => {
|
|
|
497
497
|
TaxIdType2[TaxIdType2["FINAL_CONSUMER"] = 99] = "FINAL_CONSUMER";
|
|
498
498
|
return TaxIdType2;
|
|
499
499
|
})(TaxIdType || {});
|
|
500
|
+
var VatCondition = /* @__PURE__ */ ((VatCondition2) => {
|
|
501
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_INSCRIPTO"] = 1] = "IVA_RESPONSABLE_INSCRIPTO";
|
|
502
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_NO_INSCRIPTO"] = 2] = "IVA_RESPONSABLE_NO_INSCRIPTO";
|
|
503
|
+
VatCondition2[VatCondition2["IVA_NO_RESPONSABLE"] = 3] = "IVA_NO_RESPONSABLE";
|
|
504
|
+
VatCondition2[VatCondition2["IVA_SUJETO_EXENTO"] = 4] = "IVA_SUJETO_EXENTO";
|
|
505
|
+
VatCondition2[VatCondition2["CONSUMIDOR_FINAL"] = 5] = "CONSUMIDOR_FINAL";
|
|
506
|
+
VatCondition2[VatCondition2["RESPONSABLE_MONOTRIBUTO"] = 6] = "RESPONSABLE_MONOTRIBUTO";
|
|
507
|
+
VatCondition2[VatCondition2["SUJETO_NO_CATEGORIZADO"] = 7] = "SUJETO_NO_CATEGORIZADO";
|
|
508
|
+
VatCondition2[VatCondition2["PROVEEDOR_DEL_EXTERIOR"] = 8] = "PROVEEDOR_DEL_EXTERIOR";
|
|
509
|
+
VatCondition2[VatCondition2["CLIENTE_DEL_EXTERIOR"] = 9] = "CLIENTE_DEL_EXTERIOR";
|
|
510
|
+
VatCondition2[VatCondition2["IVA_LIBERADO_LEY_19640"] = 10] = "IVA_LIBERADO_LEY_19640";
|
|
511
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION"] = 11] = "IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION";
|
|
512
|
+
VatCondition2[VatCondition2["MONOTRIBUTISTA_SOCIAL"] = 13] = "MONOTRIBUTISTA_SOCIAL";
|
|
513
|
+
return VatCondition2;
|
|
514
|
+
})(VatCondition || {});
|
|
500
515
|
|
|
501
516
|
// src/utils/calculations.ts
|
|
502
517
|
function calculateSubtotal(items, includesVAT = false) {
|
|
@@ -679,7 +694,8 @@ var WsfeService = class _WsfeService {
|
|
|
679
694
|
docType: 99 /* FINAL_CONSUMER */,
|
|
680
695
|
docNumber: "0"
|
|
681
696
|
},
|
|
682
|
-
optionals: params.optionals
|
|
697
|
+
optionals: params.optionals,
|
|
698
|
+
serviceDates: params.serviceDates
|
|
683
699
|
});
|
|
684
700
|
}
|
|
685
701
|
/**
|
|
@@ -697,7 +713,8 @@ var WsfeService = class _WsfeService {
|
|
|
697
713
|
docType: 99 /* FINAL_CONSUMER */,
|
|
698
714
|
docNumber: "0"
|
|
699
715
|
},
|
|
700
|
-
optionals: params.optionals
|
|
716
|
+
optionals: params.optionals,
|
|
717
|
+
serviceDates: params.serviceDates
|
|
701
718
|
});
|
|
702
719
|
return { ...cae, items: params.items };
|
|
703
720
|
}
|
|
@@ -1453,6 +1470,7 @@ export {
|
|
|
1453
1470
|
InvoiceType,
|
|
1454
1471
|
PadronService,
|
|
1455
1472
|
TaxIdType,
|
|
1473
|
+
VatCondition,
|
|
1456
1474
|
WsaaService,
|
|
1457
1475
|
WsfeService,
|
|
1458
1476
|
generateQRUrl
|