@facturacr/atv-sdk 1.2.11 → 1.2.13
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/__tests__/stubs/commonExpectedXml.xml +1 -1
- package/__tests__/stubs/createDocument.data.ts +5 -3
- package/__tests__/tests/ATV/__snapshots__/create-document.test.ts.snap +1 -1
- package/__tests__/tests/ATV/create-document.test.ts +10 -1
- package/dist/src/ATV/core/CreateDocFactory.d.ts +2 -0
- package/dist/src/ATV/core/CreateDocFactory.js +2 -2
- package/dist/src/ATV/core/CreateDocFactory.js.map +1 -1
- package/dist/src/lib/genJSON/index.js +1 -1
- package/dist/src/lib/genJSON/index.js.map +1 -1
- package/doc/atv-structures/4.4/ANEXOS Y ESTRUCTURAS_V4.4.pdf +0 -0
- package/doc/atv-structures/4.4/FacturaElectronicaExportacion_V4.4.xsd.xml +2563 -0
- package/doc/atv-structures/4.4/FacturaElectronica_V4.4.xsd.xml +1 -0
- package/doc/atv-structures/4.4/MensajeHacienda_V4.4.xsd.xml +201 -0
- package/doc/atv-structures/4.4/MensajeReceptor_V4.4.xsd.xml +163 -0
- package/doc/atv-structures/4.4/NotaCreditoElectronica_V4.4.xsd.xml +2953 -0
- package/doc/atv-structures/4.4/NotaDebitoElectronica_V4.4.xsd.xml +2953 -0
- package/package.json +1 -1
- package/src/ATV/core/CreateDocFactory.ts +4 -2
- package/src/lib/genJSON/index.ts +1 -1
- /package/doc/{atv-structures/4.3/API Ministerio de Hacienda → API Ministerio de Hacienda }/342/200/223 Dropbox Paper.pdf" +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@facturacr/atv-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.13",
|
|
4
4
|
"description": "Librería (SDK) de Javascript/NodeJS para acceder al API de Administración Tributaria Virtual (ATV) del Ministerio de Hacienda.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -45,6 +45,8 @@ type DocumentInput = {
|
|
|
45
45
|
ceSituation: string; // situacionCE
|
|
46
46
|
orderLines: OrderInput[];
|
|
47
47
|
referenceInfo?: ReferenceInfoInput;
|
|
48
|
+
conditionSale:string
|
|
49
|
+
paymentMethod:string;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
type ReferenceInfoInput = ReferenceInformationProps;
|
|
@@ -73,8 +75,8 @@ export class CreateDocFactory {
|
|
|
73
75
|
issueDate: new Date(),
|
|
74
76
|
emitter: Person.create(document.emitter),
|
|
75
77
|
receiver: Person.create(document.receiver),
|
|
76
|
-
conditionSale:
|
|
77
|
-
paymentMethod:
|
|
78
|
+
conditionSale: document.conditionSale,
|
|
79
|
+
paymentMethod: document.paymentMethod,
|
|
78
80
|
referenceInformation: document.referenceInfo ? ReferenceInformation.create(document.referenceInfo) : undefined,
|
|
79
81
|
})
|
|
80
82
|
}
|
package/src/lib/genJSON/index.ts
CHANGED
|
@@ -61,7 +61,7 @@ function getSender(frontEndRequest: ClientPayload): Persona {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function setTaxObj(subtotal: number, taxObj: Impuesto): Impuesto {
|
|
64
|
-
const tax = taxObj.Tarifa
|
|
64
|
+
const tax = typeof taxObj.Tarifa === 'number' ? taxObj.Tarifa : 13
|
|
65
65
|
return {
|
|
66
66
|
Codigo: taxObj.Codigo,
|
|
67
67
|
CodigoTarifa: taxObj.CodigoTarifa,
|