cardus 0.0.96 → 0.0.98

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.
Files changed (3) hide show
  1. package/dist/index.js +11 -6
  2. package/index.ts +11 -7
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -385,13 +385,18 @@ class IntegrationManager {
385
385
  });
386
386
  }
387
387
  if (!shouldGroup && !forzarAgrupamientoDeLinea) {
388
- const arrayFake = Array.from({ length: Number(cantidad) });
389
- arrayFake.forEach(() => {
390
- this.dataToInsert.lines.push({
391
- id_envio: idEnvioTemporal,
392
- bulto
388
+ if ((group === null || group === void 0 ? void 0 : group.grouped) === 1 && Number(cantidad) > 1) {
389
+ this.insertTempShipmentGroupLine({ idEnvioTemporal, group });
390
+ }
391
+ else {
392
+ const arrayFake = Array.from({ length: Number(cantidad) });
393
+ arrayFake.forEach(() => {
394
+ this.dataToInsert.lines.push({
395
+ id_envio: idEnvioTemporal,
396
+ bulto
397
+ });
393
398
  });
394
- });
399
+ }
395
400
  }
396
401
  }
397
402
  catch (e) {
package/index.ts CHANGED
@@ -633,14 +633,18 @@ export class IntegrationManager {
633
633
  }
634
634
 
635
635
  if (!shouldGroup && !forzarAgrupamientoDeLinea) {
636
- const arrayFake = Array.from({ length: Number(cantidad) });
637
-
638
- arrayFake.forEach(() => {
639
- this.dataToInsert.lines.push({
640
- id_envio: idEnvioTemporal,
641
- bulto
636
+ if (group?.grouped === 1 && Number(cantidad) > 1) {
637
+ this.insertTempShipmentGroupLine({ idEnvioTemporal, group });
638
+ } else {
639
+ const arrayFake = Array.from({ length: Number(cantidad) });
640
+
641
+ arrayFake.forEach(() => {
642
+ this.dataToInsert.lines.push({
643
+ id_envio: idEnvioTemporal,
644
+ bulto
645
+ });
642
646
  });
643
- });
647
+ }
644
648
  }
645
649
  } catch (e) {
646
650
  console.log(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.96",
3
+ "version": "0.0.98",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",