@zauru-sdk/services 2.26.3 → 2.28.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.
@@ -41,7 +41,10 @@ export async function createInvoice(headers, body, sujetaAImpuestos = true) {
41
41
  const sendBody = {
42
42
  ...body,
43
43
  invoice_details_attributes: arrayToObject(body.invoice_details),
44
- tag_ids: ["", ...(body.tagging_invoices?.map((x) => x.tag_id) ?? [])],
44
+ tag_ids: [
45
+ "",
46
+ ...(body.tagging_invoices?.map((x) => `${x.tag_id}`) ?? []),
47
+ ],
45
48
  taxable: sujetaAImpuestos,
46
49
  };
47
50
  if (sendBody.deleted_invoice_details)
@@ -68,7 +71,10 @@ export async function createInvoiceOrder(headers, body, esFactura = false) {
68
71
  ...body,
69
72
  issued: esFactura, //(false) - Esto lo hace una órden y no una factura
70
73
  invoice_details_attributes: arrayToObject(body.invoice_details),
71
- tag_ids: ["", ...(body.tagging_invoices?.map((x) => x.tag_id) ?? [])],
74
+ tag_ids: [
75
+ "",
76
+ ...(body.tagging_invoices?.map((x) => `${x.tag_id}`) ?? []),
77
+ ],
72
78
  taxable: esFactura ? 1 : 0,
73
79
  };
74
80
  if (sendBody.deleted_invoice_details)
@@ -127,15 +133,15 @@ export async function deleteInvoiceOrder(headers, id) {
127
133
  * @param body
128
134
  * @returns
129
135
  */
130
- export async function createInvoicePOS(headers, body) {
136
+ export async function createInvoicePOS(headers, body, sujetaAImpuestos = true) {
131
137
  return handlePossibleAxiosErrors(async () => {
132
138
  const sendBody = {
133
139
  ...body,
134
- issued: true, //(true) - Esto lo hace una factura
140
+ taxable: sujetaAImpuestos, //(true) - Esto lo hace una factura
141
+ issued: true,
142
+ pos: true,
135
143
  invoice_details_attributes: arrayToObject(body.invoice_details),
136
144
  tag_ids: ["", ...(body.tagging_invoices?.map((x) => x.tag_id) ?? [])],
137
- taxable: 1,
138
- pos: true,
139
145
  };
140
146
  if (sendBody.deleted_invoice_details)
141
147
  delete sendBody.deleted_invoice_details;
@@ -43,7 +43,7 @@ export declare function deleteInvoiceOrder(headers: any, id: string | number): P
43
43
  * @param body
44
44
  * @returns
45
45
  */
46
- export declare function createInvoicePOS(headers: any, body: Partial<InvoiceGraphQL>): Promise<AxiosUtilsResponse<InvoiceGraphQL>>;
46
+ export declare function createInvoicePOS(headers: any, body: Partial<InvoiceGraphQL>, sujetaAImpuestos?: boolean): Promise<AxiosUtilsResponse<InvoiceGraphQL>>;
47
47
  /**
48
48
  * deleteInvoicePOS
49
49
  * @param headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.26.3",
3
+ "version": "2.28.0",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -25,12 +25,12 @@
25
25
  "dependencies": {
26
26
  "@remix-run/node": "^2.8.1",
27
27
  "@upstash/redis": "^1.34.5",
28
- "@zauru-sdk/common": "^2.16.1",
28
+ "@zauru-sdk/common": "^2.27.0",
29
29
  "@zauru-sdk/config": "^2.23.1",
30
30
  "@zauru-sdk/graphql": "^2.26.3",
31
- "@zauru-sdk/types": "^2.16.0",
31
+ "@zauru-sdk/types": "^2.27.0",
32
32
  "axios": "^1.6.7",
33
33
  "chalk": "5.3.0"
34
34
  },
35
- "gitHead": "b5c8ca28480c2cc45c7454d04ab72c26795ec97b"
35
+ "gitHead": "8a5b7cb2b72f7caaf63957161528903a694ee78a"
36
36
  }