@zauru-sdk/services 2.0.78 → 2.0.80

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.
@@ -24,7 +24,7 @@ export const markAsReceivePurchaseOrder = (headers, body) => {
24
24
  });
25
25
  };
26
26
  /**
27
- *
27
+ * createNewPurchaseOrder
28
28
  * @param headers
29
29
  * @param body
30
30
  * @returns
@@ -43,8 +43,10 @@ export const createNewPurchaseOrder = (headers, body) => {
43
43
  delete sendBody.__rvfInternalFormId;
44
44
  delete sendBody.taggings;
45
45
  delete sendBody.purchase_order_details;
46
- if (!(sendBody?.pdf instanceof File) || sendBody.pdf?.size <= 0) {
47
- delete sendBody.pdf;
46
+ if (sendBody.pdf) {
47
+ if (!(sendBody?.pdf instanceof File) || sendBody.pdf?.size <= 0) {
48
+ delete sendBody.pdf;
49
+ }
48
50
  }
49
51
  sendBody = convertToFormData({
50
52
  purchase_order: sendBody,
@@ -78,6 +80,18 @@ export const createNewAuthorizedPurchaseOrder = (headers, body, withReceive = tr
78
80
  return response.data;
79
81
  });
80
82
  };
83
+ /**
84
+ * authorizePurchaseOrder
85
+ * @param headers
86
+ * @param id
87
+ * @returns
88
+ */
89
+ export const authorizePurchaseOrder = (headers, id) => {
90
+ return handlePossibleAxiosErrors(async () => {
91
+ await httpZauru.get(`/purchases/purchase_orders/${id}/authorize.json`, { headers });
92
+ return true;
93
+ });
94
+ };
81
95
  /**
82
96
  * receiveLotPurchaseOrder
83
97
  * @param headers
@@ -12,7 +12,7 @@ export declare const markAsReceivePurchaseOrder: (headers: any, body: Partial<Pu
12
12
  fechaVencimiento?: string;
13
13
  }) => Promise<AxiosUtilsResponse<boolean>>;
14
14
  /**
15
- *
15
+ * createNewPurchaseOrder
16
16
  * @param headers
17
17
  * @param body
18
18
  * @returns
@@ -25,6 +25,13 @@ export declare const createNewPurchaseOrder: (headers: any, body: DeepPartial<Pu
25
25
  * @returns
26
26
  */
27
27
  export declare const createNewAuthorizedPurchaseOrder: (headers: any, body: CreateNewPurchaseOrderBody, withReceive?: boolean) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL>>;
28
+ /**
29
+ * authorizePurchaseOrder
30
+ * @param headers
31
+ * @param id
32
+ * @returns
33
+ */
34
+ export declare const authorizePurchaseOrder: (headers: any, id: number | string) => Promise<AxiosUtilsResponse<boolean>>;
28
35
  /**
29
36
  * receiveLotPurchaseOrder
30
37
  * @param headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/services",
3
- "version": "2.0.78",
3
+ "version": "2.0.80",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -31,5 +31,5 @@
31
31
  "axios": "^1.6.7",
32
32
  "chalk": "5.3.0"
33
33
  },
34
- "gitHead": "3fa94199738bbc2e4144bd618bc85eb12bae2925"
34
+ "gitHead": "0dfb29a7a60069462a9e258f4f879da79571050e"
35
35
  }