@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@facturacr/atv-sdk",
3
- "version": "1.2.11",
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: '01',
77
- paymentMethod: '04',
78
+ conditionSale: document.conditionSale,
79
+ paymentMethod: document.paymentMethod,
78
80
  referenceInformation: document.referenceInfo ? ReferenceInformation.create(document.referenceInfo) : undefined,
79
81
  })
80
82
  }
@@ -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 || 13
64
+ const tax = typeof taxObj.Tarifa === 'number' ? taxObj.Tarifa : 13
65
65
  return {
66
66
  Codigo: taxObj.Codigo,
67
67
  CodigoTarifa: taxObj.CodigoTarifa,