cardus 0.0.96 → 0.0.97
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/index.js +11 -2
- package/index.ts +16 -2
- package/package.json +1 -1
- package/types/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -307,7 +307,12 @@ class IntegrationManager {
|
|
|
307
307
|
2 - si "forzarAgrupamientoDeLinea" es true, se crea una linea por cada linea
|
|
308
308
|
3- si NO esta agrupado y "forzarAgrupamientoDeLinea" NO es true, se crea una linea por cada unidad de cada linea
|
|
309
309
|
*/
|
|
310
|
-
|
|
310
|
+
const { integrationsService } = this.services;
|
|
311
|
+
const userIntegrationConfiguration = yield integrationsService.getDefaultIntegrationsData({
|
|
312
|
+
id_usuario: idUsuario,
|
|
313
|
+
id_integracion: this.integrationType
|
|
314
|
+
});
|
|
315
|
+
const measuresFromConfig = !!(userIntegrationConfiguration === null || userIntegrationConfiguration === void 0 ? void 0 : userIntegrationConfiguration.dimensiones_medidas_configuradas);
|
|
311
316
|
const createBultoFromLine = (_b) => __awaiter(this, [_b], void 0, function* ({ line, idEnvioTemporal, shouldGroup }) {
|
|
312
317
|
const result = yield crearBulto({
|
|
313
318
|
lineItems: { idEnvioTemporal, line },
|
|
@@ -329,7 +334,11 @@ class IntegrationManager {
|
|
|
329
334
|
orders.forEach(({ idEnvioTemporal, lineas }) => {
|
|
330
335
|
if (!idEnvioTemporal)
|
|
331
336
|
return;
|
|
332
|
-
|
|
337
|
+
// Debe agrupar si:
|
|
338
|
+
// 1. grouped es 1 + hay más de una línea
|
|
339
|
+
// 2. grouped es 1 + hay una línea + configuración integraciones tiene el campo dimensiones_medidas_configuradas a 1
|
|
340
|
+
const shouldGroup = ((group === null || group === void 0 ? void 0 : group.grouped) === 1 && lineas.length > 1) ||
|
|
341
|
+
((group === null || group === void 0 ? void 0 : group.grouped) === 1 && lineas.length === 1 && measuresFromConfig);
|
|
333
342
|
if (shouldGroup) {
|
|
334
343
|
this.insertTempShipmentGroupLine({ idEnvioTemporal, group });
|
|
335
344
|
}
|
package/index.ts
CHANGED
|
@@ -523,7 +523,16 @@ export class IntegrationManager {
|
|
|
523
523
|
3- si NO esta agrupado y "forzarAgrupamientoDeLinea" NO es true, se crea una linea por cada unidad de cada linea
|
|
524
524
|
*/
|
|
525
525
|
|
|
526
|
-
|
|
526
|
+
const { integrationsService } = this.services;
|
|
527
|
+
|
|
528
|
+
const userIntegrationConfiguration =
|
|
529
|
+
await integrationsService.getDefaultIntegrationsData({
|
|
530
|
+
id_usuario: idUsuario,
|
|
531
|
+
id_integracion: this.integrationType
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
const measuresFromConfig =
|
|
535
|
+
!!userIntegrationConfiguration?.dimensiones_medidas_configuradas;
|
|
527
536
|
|
|
528
537
|
const createBultoFromLine = async ({
|
|
529
538
|
line,
|
|
@@ -557,7 +566,12 @@ export class IntegrationManager {
|
|
|
557
566
|
orders.forEach(({ idEnvioTemporal, lineas }) => {
|
|
558
567
|
if (!idEnvioTemporal) return;
|
|
559
568
|
|
|
560
|
-
|
|
569
|
+
// Debe agrupar si:
|
|
570
|
+
// 1. grouped es 1 + hay más de una línea
|
|
571
|
+
// 2. grouped es 1 + hay una línea + configuración integraciones tiene el campo dimensiones_medidas_configuradas a 1
|
|
572
|
+
const shouldGroup =
|
|
573
|
+
(group?.grouped === 1 && lineas.length > 1) ||
|
|
574
|
+
(group?.grouped === 1 && lineas.length === 1 && measuresFromConfig);
|
|
561
575
|
|
|
562
576
|
if (shouldGroup) {
|
|
563
577
|
this.insertTempShipmentGroupLine({ idEnvioTemporal, group });
|
package/package.json
CHANGED