@zauru-sdk/services 2.22.0 → 2.23.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.
@@ -145,7 +145,7 @@ export async function createInvoicePOS(headers, body) {
145
145
  delete sendBody.invoice_details;
146
146
  if (sendBody.tagging_invoices)
147
147
  delete sendBody.tagging_invoices;
148
- const response = await httpZauru.post(`/pos/sale_orders.json`, { invoice: sendBody }, { headers });
148
+ const response = await httpZauru.post(`/pos/invoices.json`, { invoice: sendBody }, { headers });
149
149
  return response.data;
150
150
  });
151
151
  }
@@ -155,22 +155,31 @@ export async function createInvoicePOS(headers, body) {
155
155
  * @param body
156
156
  * @returns
157
157
  */
158
- export async function updateInvoicePOS(headers, body) {
159
- return handlePossibleAxiosErrors(async () => {
160
- const sendBody = {
161
- ...body,
162
- invoice_details_attributes: arrayToObject(body.invoice_details),
163
- };
164
- if (sendBody.deleted_invoice_details)
165
- delete sendBody.deleted_invoice_details;
166
- if (sendBody.__rvfInternalFormId)
167
- delete sendBody.__rvfInternalFormId;
168
- if (sendBody.invoice_details)
169
- delete sendBody.invoice_details;
170
- const response = await httpZauru.patch(`/pos/sale_orders/${body.id}.json`, { invoice: sendBody }, { headers });
171
- return response.data;
172
- });
158
+ /*
159
+ export async function updateInvoicePOS(
160
+ headers: any,
161
+ body: Partial<InvoiceGraphQL>,
162
+ ): Promise<AxiosUtilsResponse<InvoiceGraphQL>> {
163
+ return handlePossibleAxiosErrors(async () => {
164
+ const sendBody = {
165
+ ...body,
166
+ invoice_details_attributes: arrayToObject(body.invoice_details),
167
+ } as any;
168
+ if (sendBody.deleted_invoice_details)
169
+ delete sendBody.deleted_invoice_details;
170
+ if (sendBody.__rvfInternalFormId) delete sendBody.__rvfInternalFormId;
171
+ if (sendBody.invoice_details) delete sendBody.invoice_details;
172
+
173
+ const response = await httpZauru.patch<InvoiceGraphQL>(
174
+ `/pos/invoices/${body.id}.json`,
175
+ { invoice: sendBody },
176
+ { headers },
177
+ );
178
+
179
+ return response.data;
180
+ });
173
181
  }
182
+ */
174
183
  /**
175
184
  * deleteInvoicePOS
176
185
  * @param headers
@@ -178,7 +187,7 @@ export async function updateInvoicePOS(headers, body) {
178
187
  */
179
188
  export async function deleteInvoicePOS(headers, id) {
180
189
  return handlePossibleAxiosErrors(async () => {
181
- await httpZauru.get(`/pos/sale_orders/${id}/void`, {
190
+ await httpZauru.delete(`/pos/invoices/${id}`, {
182
191
  headers,
183
192
  });
184
193
  return true;
@@ -50,7 +50,6 @@ export declare function createInvoicePOS(headers: any, body: Partial<InvoiceGrap
50
50
  * @param body
51
51
  * @returns
52
52
  */
53
- export declare function updateInvoicePOS(headers: any, body: Partial<InvoiceGraphQL>): Promise<AxiosUtilsResponse<InvoiceGraphQL>>;
54
53
  /**
55
54
  * deleteInvoicePOS
56
55
  * @param headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.22.0",
3
+ "version": "2.23.0",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -32,5 +32,5 @@
32
32
  "axios": "^1.6.7",
33
33
  "chalk": "5.3.0"
34
34
  },
35
- "gitHead": "1e2063d8965b458580aaaa1b17c5a88ff20243b1"
35
+ "gitHead": "dd7ff51f53cd22b8c8a343139d596f1c66e973ce"
36
36
  }