@zauru-sdk/hooks 2.0.4 → 2.0.5
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/dist/esm/receptions.js +38 -14
- package/dist/receptions.d.ts +6 -7
- package/package.json +2 -2
package/dist/esm/receptions.js
CHANGED
|
@@ -120,6 +120,10 @@ const useGetPesadas = (purchaseOrder, stocks_only_integer = false) => {
|
|
|
120
120
|
}),
|
|
121
121
|
];
|
|
122
122
|
const totales = [
|
|
123
|
+
//#
|
|
124
|
+
{
|
|
125
|
+
contennt: "",
|
|
126
|
+
},
|
|
123
127
|
//baskets
|
|
124
128
|
{
|
|
125
129
|
contennt: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => x.baskets).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
@@ -230,6 +234,10 @@ const getPesadasByForm = (formInput, stocks_only_integer = false) => {
|
|
|
230
234
|
index++;
|
|
231
235
|
}
|
|
232
236
|
const totales = [
|
|
237
|
+
//#
|
|
238
|
+
{
|
|
239
|
+
contennt: "",
|
|
240
|
+
},
|
|
233
241
|
//baskets
|
|
234
242
|
{
|
|
235
243
|
contennt: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => x.baskets).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
@@ -272,7 +280,7 @@ exports.getPesadasByForm = getPesadasByForm;
|
|
|
272
280
|
const useGetBasketDetails = (purchaseOrder) => {
|
|
273
281
|
const [basketsJoined, footerBasketsJoined, headersBasketsJoined] = (0, react_2.useMemo)(() => {
|
|
274
282
|
if (!purchaseOrder)
|
|
275
|
-
return [[],
|
|
283
|
+
return [[], [], []];
|
|
276
284
|
const bsq = purchaseOrder?.lots.length > 0
|
|
277
285
|
? purchaseOrder?.lots
|
|
278
286
|
?.map((x) => {
|
|
@@ -312,12 +320,20 @@ const useGetBasketDetails = (purchaseOrder) => {
|
|
|
312
320
|
});
|
|
313
321
|
}
|
|
314
322
|
}
|
|
315
|
-
const totales =
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
const totales = [
|
|
324
|
+
//color
|
|
325
|
+
{
|
|
326
|
+
contennt: "",
|
|
327
|
+
},
|
|
328
|
+
//total
|
|
329
|
+
{
|
|
330
|
+
contennt: (0, common_1.toFixedIfNeeded)(joinedBaskets?.map((x) => x.total).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
331
|
+
},
|
|
332
|
+
//cc
|
|
333
|
+
{
|
|
334
|
+
contennt: joinedBaskets?.map((x) => x.cc).reduce(common_1.reduceAdd, 0),
|
|
335
|
+
},
|
|
336
|
+
];
|
|
321
337
|
const headers = [
|
|
322
338
|
{ label: "Color", name: "color", type: "label" },
|
|
323
339
|
{ label: "Canastas recibidas", name: "total", type: "label" },
|
|
@@ -339,7 +355,7 @@ const getBasketDetailsByForm = (formInput) => {
|
|
|
339
355
|
if (!formInput)
|
|
340
356
|
return {
|
|
341
357
|
basketDetailsArray,
|
|
342
|
-
totales:
|
|
358
|
+
totales: [],
|
|
343
359
|
headers: [],
|
|
344
360
|
};
|
|
345
361
|
// Regex para identificar los campos relevantes
|
|
@@ -380,12 +396,20 @@ const getBasketDetailsByForm = (formInput) => {
|
|
|
380
396
|
}
|
|
381
397
|
}
|
|
382
398
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
399
|
+
const totales = [
|
|
400
|
+
//color
|
|
401
|
+
{
|
|
402
|
+
contennt: "",
|
|
403
|
+
},
|
|
404
|
+
//total
|
|
405
|
+
{
|
|
406
|
+
contennt: (0, common_1.toFixedIfNeeded)(basketDetailsArray.map((x) => x.total).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
407
|
+
},
|
|
408
|
+
//cc
|
|
409
|
+
{
|
|
410
|
+
contennt: basketDetailsArray.map((x) => x.cc).reduce(common_1.reduceAdd, 0),
|
|
411
|
+
},
|
|
412
|
+
];
|
|
389
413
|
// Definir los encabezados de la tabla
|
|
390
414
|
const headers = [
|
|
391
415
|
{ label: "Color", name: "color", type: "label" },
|
package/dist/receptions.d.ts
CHANGED
|
@@ -66,12 +66,7 @@ type BasketDetailsBody = {
|
|
|
66
66
|
color: string;
|
|
67
67
|
cc: number;
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
id: string;
|
|
71
|
-
total: string;
|
|
72
|
-
cc: number;
|
|
73
|
-
};
|
|
74
|
-
export declare const useGetBasketDetails: (purchaseOrder?: PurchaseOrderGraphQL) => [BasketDetailsBody[], BasketDetailsFooter, GenericDynamicTableColumn[]];
|
|
69
|
+
export declare const useGetBasketDetails: (purchaseOrder?: PurchaseOrderGraphQL) => [BasketDetailsBody[], any[], GenericDynamicTableColumn[]];
|
|
75
70
|
/**
|
|
76
71
|
* Para imprimir en modo offline
|
|
77
72
|
* @param formInput
|
|
@@ -79,7 +74,11 @@ export declare const useGetBasketDetails: (purchaseOrder?: PurchaseOrderGraphQL)
|
|
|
79
74
|
*/
|
|
80
75
|
export declare const getBasketDetailsByForm: (formInput: FormInput) => {
|
|
81
76
|
basketDetailsArray: BasketDetailsBody[];
|
|
82
|
-
totales:
|
|
77
|
+
totales: ({
|
|
78
|
+
contennt: string;
|
|
79
|
+
} | {
|
|
80
|
+
contennt: number;
|
|
81
|
+
})[];
|
|
83
82
|
headers: GenericDynamicTableColumn[];
|
|
84
83
|
};
|
|
85
84
|
export declare const useGetProviderNameByPurchaseOrder: (payees: PayeeGraphQL[], purchaseOrder?: PurchaseOrderGraphQL) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Hooks reutilizables dentro de las webapps de Zauru.",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"react": "^18.2.0",
|
|
34
34
|
"react-dom": "^18.2.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "2f1bd6a004c343ec036dabe6d876b3a8ead23161"
|
|
37
37
|
}
|