@zauru-sdk/hooks 2.0.5 → 2.0.7
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 -19
- package/dist/receptions.d.ts +13 -5
- package/package.json +5 -5
package/dist/esm/receptions.js
CHANGED
|
@@ -122,37 +122,45 @@ const useGetPesadas = (purchaseOrder, stocks_only_integer = false) => {
|
|
|
122
122
|
const totales = [
|
|
123
123
|
//#
|
|
124
124
|
{
|
|
125
|
-
|
|
125
|
+
content: "",
|
|
126
|
+
name: "id",
|
|
126
127
|
},
|
|
127
128
|
//baskets
|
|
128
129
|
{
|
|
129
|
-
|
|
130
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => x.baskets).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
131
|
+
name: "baskets",
|
|
130
132
|
},
|
|
131
133
|
//totalWeight
|
|
132
134
|
{
|
|
133
|
-
|
|
135
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => x.totalWeight).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
136
|
+
name: "totalWeight",
|
|
134
137
|
},
|
|
135
138
|
//discount
|
|
136
139
|
{
|
|
137
|
-
|
|
140
|
+
content: "-",
|
|
141
|
+
name: "discount",
|
|
138
142
|
},
|
|
139
143
|
//netWeight
|
|
140
144
|
{
|
|
141
|
-
|
|
145
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => Number(x.netWeight)).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
146
|
+
name: "netWeight",
|
|
142
147
|
},
|
|
143
148
|
//weightByBasket
|
|
144
149
|
{
|
|
145
|
-
|
|
150
|
+
content: "-",
|
|
151
|
+
name: "weightByBasket",
|
|
146
152
|
},
|
|
147
153
|
//lbDiscounted
|
|
148
154
|
{
|
|
149
|
-
|
|
155
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => Number(x.lbDiscounted)).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
156
|
+
name: "lbDiscounted",
|
|
150
157
|
},
|
|
151
158
|
//probableUtilization
|
|
152
159
|
{
|
|
153
|
-
|
|
160
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas
|
|
154
161
|
?.map((x) => Number(x.probableUtilization))
|
|
155
162
|
.reduce(common_1.reduceAdd, 0)),
|
|
163
|
+
name: "probableUtilization",
|
|
156
164
|
},
|
|
157
165
|
];
|
|
158
166
|
const headers = [
|
|
@@ -236,23 +244,28 @@ const getPesadasByForm = (formInput, stocks_only_integer = false) => {
|
|
|
236
244
|
const totales = [
|
|
237
245
|
//#
|
|
238
246
|
{
|
|
239
|
-
|
|
247
|
+
content: "",
|
|
248
|
+
name: "id",
|
|
240
249
|
},
|
|
241
250
|
//baskets
|
|
242
251
|
{
|
|
243
|
-
|
|
252
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => x.baskets).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
253
|
+
name: "baskets",
|
|
244
254
|
},
|
|
245
255
|
//totalWeight
|
|
246
256
|
{
|
|
247
|
-
|
|
257
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => x.totalWeight).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
258
|
+
name: "totalWeight",
|
|
248
259
|
},
|
|
249
260
|
//netWeight
|
|
250
261
|
{
|
|
251
|
-
|
|
262
|
+
content: (0, common_1.toFixedIfNeeded)(tempPesadas?.map((x) => Number(x.netWeight)).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
263
|
+
name: "netWeight",
|
|
252
264
|
},
|
|
253
265
|
//weightByBasket
|
|
254
266
|
{
|
|
255
|
-
|
|
267
|
+
content: "-",
|
|
268
|
+
name: "weightByBasket",
|
|
256
269
|
},
|
|
257
270
|
];
|
|
258
271
|
const headers = [
|
|
@@ -323,15 +336,18 @@ const useGetBasketDetails = (purchaseOrder) => {
|
|
|
323
336
|
const totales = [
|
|
324
337
|
//color
|
|
325
338
|
{
|
|
326
|
-
|
|
339
|
+
content: "",
|
|
340
|
+
name: "color",
|
|
327
341
|
},
|
|
328
342
|
//total
|
|
329
343
|
{
|
|
330
|
-
|
|
344
|
+
content: (0, common_1.toFixedIfNeeded)(joinedBaskets?.map((x) => x.total).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
345
|
+
name: "total",
|
|
331
346
|
},
|
|
332
347
|
//cc
|
|
333
348
|
{
|
|
334
|
-
|
|
349
|
+
content: joinedBaskets?.map((x) => x.cc).reduce(common_1.reduceAdd, 0),
|
|
350
|
+
name: "cc",
|
|
335
351
|
},
|
|
336
352
|
];
|
|
337
353
|
const headers = [
|
|
@@ -399,15 +415,18 @@ const getBasketDetailsByForm = (formInput) => {
|
|
|
399
415
|
const totales = [
|
|
400
416
|
//color
|
|
401
417
|
{
|
|
402
|
-
|
|
418
|
+
content: "",
|
|
419
|
+
name: "color",
|
|
403
420
|
},
|
|
404
421
|
//total
|
|
405
422
|
{
|
|
406
|
-
|
|
423
|
+
content: (0, common_1.toFixedIfNeeded)(basketDetailsArray.map((x) => x.total).reduce(common_1.reduceAdd, 0))?.toString(),
|
|
424
|
+
name: "total",
|
|
407
425
|
},
|
|
408
426
|
//cc
|
|
409
427
|
{
|
|
410
|
-
|
|
428
|
+
content: basketDetailsArray.map((x) => x.cc).reduce(common_1.reduceAdd, 0),
|
|
429
|
+
name: "cc",
|
|
411
430
|
},
|
|
412
431
|
];
|
|
413
432
|
// Definir los encabezados de la tabla
|
package/dist/receptions.d.ts
CHANGED
|
@@ -47,7 +47,12 @@ type PesadaBody = {
|
|
|
47
47
|
probableUtilization: number;
|
|
48
48
|
lbDiscounted: number;
|
|
49
49
|
};
|
|
50
|
-
export
|
|
50
|
+
export type FooterColumnConfig = {
|
|
51
|
+
content: React.ReactNode;
|
|
52
|
+
className?: string;
|
|
53
|
+
name?: string;
|
|
54
|
+
};
|
|
55
|
+
export declare const useGetPesadas: (purchaseOrder?: PurchaseOrderGraphQL, stocks_only_integer?: boolean) => [PesadaBody[], FooterColumnConfig[], GenericDynamicTableColumn[]];
|
|
51
56
|
/**
|
|
52
57
|
* Sirve para imprimir offline
|
|
53
58
|
* @param formInput
|
|
@@ -56,7 +61,8 @@ export declare const useGetPesadas: (purchaseOrder?: PurchaseOrderGraphQL, stock
|
|
|
56
61
|
export declare const getPesadasByForm: (formInput: FormInput, stocks_only_integer?: boolean) => {
|
|
57
62
|
tempPesadas: PesadaBody[];
|
|
58
63
|
totales: {
|
|
59
|
-
|
|
64
|
+
content: string;
|
|
65
|
+
name: string;
|
|
60
66
|
}[];
|
|
61
67
|
headers: GenericDynamicTableColumn[];
|
|
62
68
|
};
|
|
@@ -66,7 +72,7 @@ type BasketDetailsBody = {
|
|
|
66
72
|
color: string;
|
|
67
73
|
cc: number;
|
|
68
74
|
};
|
|
69
|
-
export declare const useGetBasketDetails: (purchaseOrder?: PurchaseOrderGraphQL) => [BasketDetailsBody[],
|
|
75
|
+
export declare const useGetBasketDetails: (purchaseOrder?: PurchaseOrderGraphQL) => [BasketDetailsBody[], FooterColumnConfig[], GenericDynamicTableColumn[]];
|
|
70
76
|
/**
|
|
71
77
|
* Para imprimir en modo offline
|
|
72
78
|
* @param formInput
|
|
@@ -75,9 +81,11 @@ export declare const useGetBasketDetails: (purchaseOrder?: PurchaseOrderGraphQL)
|
|
|
75
81
|
export declare const getBasketDetailsByForm: (formInput: FormInput) => {
|
|
76
82
|
basketDetailsArray: BasketDetailsBody[];
|
|
77
83
|
totales: ({
|
|
78
|
-
|
|
84
|
+
content: string;
|
|
85
|
+
name: string;
|
|
79
86
|
} | {
|
|
80
|
-
|
|
87
|
+
content: number;
|
|
88
|
+
name: string;
|
|
81
89
|
})[];
|
|
82
90
|
headers: GenericDynamicTableColumn[];
|
|
83
91
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
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",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@remix-run/react": "^2.8.1",
|
|
29
|
-
"@zauru-sdk/common": "^2.0.
|
|
29
|
+
"@zauru-sdk/common": "^2.0.7",
|
|
30
30
|
"@zauru-sdk/icons": "^2.0.0",
|
|
31
|
-
"@zauru-sdk/redux": "^2.0.
|
|
32
|
-
"@zauru-sdk/types": "^2.0.
|
|
31
|
+
"@zauru-sdk/redux": "^2.0.7",
|
|
32
|
+
"@zauru-sdk/types": "^2.0.7",
|
|
33
33
|
"react": "^18.2.0",
|
|
34
34
|
"react-dom": "^18.2.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "56108530c1f948cb96e7d144d181b9afc433e52f"
|
|
37
37
|
}
|