@zauru-sdk/utils 2.0.47 → 2.0.49
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/index.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export * from "./zauru/4pinos-receptions-form-history.utils.js";
|
|
2
|
-
export * from "./zauru/4pinos-reception-register.utils.js";
|
|
3
|
-
export * from "./zauru/4pinos-shipments-form-history.utils.js";
|
|
4
|
-
export * from "./zauru/4pinos-shipment-register.utils.js";
|
|
5
1
|
export * from "./zauru/automatic-number.utils.js";
|
|
6
2
|
export * from "./zauru/bitacora-edicion-masiva.utils.js";
|
|
7
3
|
export * from "./zauru/bundles.utils.js";
|
|
@@ -104,7 +104,7 @@ export const register4pinosReception = async ({ cookie, idWebAppTable, agency_id
|
|
|
104
104
|
const netWeight = Number(values.netWgt);
|
|
105
105
|
const total_baskets = Number(values.totalBaskets);
|
|
106
106
|
const netWeightByBasket = Number(netWeight) / total_baskets;
|
|
107
|
-
const
|
|
107
|
+
const pesoEnUnidades = values.stockInteger == "true";
|
|
108
108
|
const buildArray = (keyIncludes, processValue) => {
|
|
109
109
|
const regex = /\d/; // Expresión regular para buscar al menos un dígito.
|
|
110
110
|
return keys
|
|
@@ -154,8 +154,10 @@ export const register4pinosReception = async ({ cookie, idWebAppTable, agency_id
|
|
|
154
154
|
const weight = Number(values[key]);
|
|
155
155
|
const detail_basket = Number(detail_baskets[index]);
|
|
156
156
|
const detail_discount = Number(detail_discounts[index]) ?? 0;
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
const descuentoPesoCanasta = pesoEnUnidades
|
|
158
|
+
? 0
|
|
159
|
+
: detail_basket * singleBasketWeight;
|
|
160
|
+
return ((weight - descuentoPesoCanasta) * ((100 - detail_discount) / 100));
|
|
159
161
|
});
|
|
160
162
|
const newPurchaseOrderDetails = detail_baskets.map((x, index) => {
|
|
161
163
|
return {
|
|
@@ -305,7 +307,10 @@ export const register4pinosReception = async ({ cookie, idWebAppTable, agency_id
|
|
|
305
307
|
qcMovementDetails.push({
|
|
306
308
|
item_id: apiResponses.authorizedPO.purchase_order_details[0].item_id,
|
|
307
309
|
lot_id: Number(lotResponse.data?.id),
|
|
308
|
-
|
|
310
|
+
//Si es por unidad, se redondea al entero más cercano, por ejemplo 12.3 quedaría como
|
|
311
|
+
booked_quantity: pesoEnUnidades
|
|
312
|
+
? Math.round(total_qc_baskets * netWeightByBasket)
|
|
313
|
+
: total_qc_baskets * netWeightByBasket,
|
|
309
314
|
reference: "Verduras a control de calidad.",
|
|
310
315
|
});
|
|
311
316
|
const qcBasketShipment = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export * from "./zauru/4pinos-receptions-form-history.utils.js";
|
|
2
|
-
export * from "./zauru/4pinos-reception-register.utils.js";
|
|
3
|
-
export * from "./zauru/4pinos-shipments-form-history.utils.js";
|
|
4
|
-
export * from "./zauru/4pinos-shipment-register.utils.js";
|
|
5
1
|
export * from "./zauru/automatic-number.utils.js";
|
|
6
2
|
export * from "./zauru/bitacora-edicion-masiva.utils.js";
|
|
7
3
|
export * from "./zauru/bundles.utils.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.49",
|
|
4
4
|
"description": "Utilidades, parseo de request y demás para desarrollo de webapps de Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@zauru-sdk/services": "^2.0.47",
|
|
31
31
|
"@zauru-sdk/types": "^2.0.44"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "da90612dd5438fef4b7015632b6c8f0e2d9873ee"
|
|
34
34
|
}
|