@zauru-sdk/utils 1.0.68 → 1.0.69

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNewLabItemRequest = exports.deleteTask = exports.commitEndTask = exports.commitTask = exports.deletePurchaseOrderProcess = exports.getOrderIDS = exports.updatePurchaseOrderReception = exports.updateOchAndDis = exports.updatePurchaseItemPrice = exports.getPurchaseOrderDataTables = exports.getPurchasesDataTableListFormated = void 0;
3
+ exports.createNewLabItemRequest = exports.deleteTask = exports.commitEndTask = exports.commitTask = exports.deletePurchaseOrderProcess = exports.getOrderIDS = exports.updateOchAndDis = exports.updatePurchaseItemPrice = exports.getPurchaseOrderDataTables = exports.getPurchasesDataTableListFormated = void 0;
4
4
  const common_1 = require("@zauru-sdk/common");
5
5
  const services_1 = require("@zauru-sdk/services");
6
6
  /**
@@ -198,26 +198,6 @@ const updateOchAndDis = async (headers, data, purchase_id) => {
198
198
  });
199
199
  };
200
200
  exports.updateOchAndDis = updateOchAndDis;
201
- /**
202
- * updatePurchaseOrderReception
203
- * @param headers
204
- * @param data
205
- * @param purchase_id
206
- * @returns
207
- */
208
- const updatePurchaseOrderReception = async (headers, data, purchase_id) => {
209
- return (0, common_1.handlePossibleAxiosErrors)(async () => {
210
- const body = {
211
- purchase_order: {
212
- payee_id: data.payee_id,
213
- purchase_order_details_attributes: data.purchase_order_details_attributes,
214
- },
215
- };
216
- await (0, services_1.updateReceivedPurchaseOrder)(headers, body, purchase_id);
217
- return true;
218
- });
219
- };
220
- exports.updatePurchaseOrderReception = updatePurchaseOrderReception;
221
201
  /**
222
202
  * Obtengo los id's de las órdenes de compra en un arreglo numérico
223
203
  * @param headers
@@ -360,6 +340,7 @@ const createNewLabItemRequest = (headers, session, body) => {
360
340
  "laboratory_proyect_id",
361
341
  ]);
362
342
  const id_number = (0, services_1.generateDistinctCode)("POLAB");
343
+ const insumos = JSON.parse(body.insumos);
363
344
  const sendBody = {
364
345
  ...body,
365
346
  shipping_date: body.issue_date,
@@ -372,14 +353,14 @@ const createNewLabItemRequest = (headers, session, body) => {
372
353
  id_number,
373
354
  reference: "LABORATORIO - Solicitud de insumos desde WebApp",
374
355
  origin: "LABORATORIO",
375
- purchase_order_details: [
376
- {
377
- booked_quantity: body.booked_quantity,
378
- item_id: body.item_id,
356
+ purchase_order_details: insumos.map((x) => {
357
+ return {
358
+ booked_quantity: x.booked_quantity,
359
+ item_id: x.item_id,
379
360
  unit_cost: 1,
380
361
  tag_id: Number(laboratory_proyect_id),
381
- },
382
- ],
362
+ };
363
+ }),
383
364
  taggings: [{ tag_id: Number(laboratory_proyect_id) }],
384
365
  };
385
366
  const response = await (0, services_1.createNewPurchaseOrder)(headers, sendBody);
@@ -191,25 +191,6 @@ export const updateOchAndDis = async (headers, data, purchase_id) => {
191
191
  return true;
192
192
  });
193
193
  };
194
- /**
195
- * updatePurchaseOrderReception
196
- * @param headers
197
- * @param data
198
- * @param purchase_id
199
- * @returns
200
- */
201
- export const updatePurchaseOrderReception = async (headers, data, purchase_id) => {
202
- return handlePossibleAxiosErrors(async () => {
203
- const body = {
204
- purchase_order: {
205
- payee_id: data.payee_id,
206
- purchase_order_details_attributes: data.purchase_order_details_attributes,
207
- },
208
- };
209
- await updateReceivedPurchaseOrder(headers, body, purchase_id);
210
- return true;
211
- });
212
- };
213
194
  /**
214
195
  * Obtengo los id's de las órdenes de compra en un arreglo numérico
215
196
  * @param headers
@@ -347,6 +328,7 @@ export const createNewLabItemRequest = (headers, session, body) => {
347
328
  "laboratory_proyect_id",
348
329
  ]);
349
330
  const id_number = generateDistinctCode("POLAB");
331
+ const insumos = JSON.parse(body.insumos);
350
332
  const sendBody = {
351
333
  ...body,
352
334
  shipping_date: body.issue_date,
@@ -359,14 +341,14 @@ export const createNewLabItemRequest = (headers, session, body) => {
359
341
  id_number,
360
342
  reference: "LABORATORIO - Solicitud de insumos desde WebApp",
361
343
  origin: "LABORATORIO",
362
- purchase_order_details: [
363
- {
364
- booked_quantity: body.booked_quantity,
365
- item_id: body.item_id,
344
+ purchase_order_details: insumos.map((x) => {
345
+ return {
346
+ booked_quantity: x.booked_quantity,
347
+ item_id: x.item_id,
366
348
  unit_cost: 1,
367
349
  tag_id: Number(laboratory_proyect_id),
368
- },
369
- ],
350
+ };
351
+ }),
370
352
  taggings: [{ tag_id: Number(laboratory_proyect_id) }],
371
353
  };
372
354
  const response = await createNewPurchaseOrder(headers, sendBody);
@@ -44,20 +44,6 @@ export declare const updateOchAndDis: (headers: any, data: {
44
44
  discount?: number | string;
45
45
  other_charges?: number | string;
46
46
  }, purchase_id: number) => Promise<AxiosUtilsResponse<boolean>>;
47
- /**
48
- * updatePurchaseOrderReception
49
- * @param headers
50
- * @param data
51
- * @param purchase_id
52
- * @returns
53
- */
54
- export declare const updatePurchaseOrderReception: (headers: any, data: {
55
- payee_id?: string;
56
- purchase_order_details_attributes: Record<string, {
57
- item_id: number;
58
- id: number;
59
- }>;
60
- }, purchase_id: number) => Promise<AxiosUtilsResponse<boolean>>;
61
47
  /**
62
48
  * Obtengo los id's de las órdenes de compra en un arreglo numérico
63
49
  * @param headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/utils",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "Utilidades, parseo de request y demás para desarrollo de webapps de Zauru",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -25,11 +25,11 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@remix-run/node": "^2.8.1",
28
- "@zauru-sdk/common": "^1.0.60",
28
+ "@zauru-sdk/common": "^1.0.69",
29
29
  "@zauru-sdk/config": "^1.0.60",
30
- "@zauru-sdk/graphql": "^1.0.68",
31
- "@zauru-sdk/services": "^1.0.68",
32
- "@zauru-sdk/types": "^1.0.60"
30
+ "@zauru-sdk/graphql": "^1.0.69",
31
+ "@zauru-sdk/services": "^1.0.69",
32
+ "@zauru-sdk/types": "^1.0.69"
33
33
  },
34
- "gitHead": "907be35569dc738a582858bb47d96910ab5dcec3"
34
+ "gitHead": "46dd382e956e8b34c2a65ef078d8fddb2cdd434c"
35
35
  }