cardus 0.0.101 → 0.0.103
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 +5 -3
- package/index.ts +7 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -161,11 +161,12 @@ class IntegrationManager {
|
|
|
161
161
|
id_envio: idEnvioTemporal,
|
|
162
162
|
id_usuario: idUsuario
|
|
163
163
|
});
|
|
164
|
+
this.dataToInsert.lines.delete(idEnvioTemporal);
|
|
164
165
|
return;
|
|
165
166
|
}
|
|
166
167
|
if (isTempShipmentModified) {
|
|
167
168
|
delete partialTempShipmentModified.abort_creation; // por si acaso
|
|
168
|
-
yield integrationsService.updateTempShimpment(Object.assign({ id_envio: idEnvioTemporal },
|
|
169
|
+
yield integrationsService.updateTempShimpment(Object.assign({ id_envio: idEnvioTemporal }, partialTempShipmentModified));
|
|
169
170
|
}
|
|
170
171
|
if (arePackagesModified) {
|
|
171
172
|
this.dataToInsert.lines.set(idEnvioTemporal, packagesModified);
|
|
@@ -184,7 +185,7 @@ class IntegrationManager {
|
|
|
184
185
|
user,
|
|
185
186
|
countryName: country.nombre_pais_en
|
|
186
187
|
});
|
|
187
|
-
const arrayPackages =
|
|
188
|
+
const arrayPackages = [...this.dataToInsert.lines.values()].flat().flat();
|
|
188
189
|
yield Promise.allSettled([
|
|
189
190
|
integrationsService.insertTempShipmentMultipleLines(arrayPackages),
|
|
190
191
|
integrationsService.insertTempShipmentMultipleDetails(this.dataToInsert.details),
|
|
@@ -377,7 +378,7 @@ class IntegrationManager {
|
|
|
377
378
|
}
|
|
378
379
|
else {
|
|
379
380
|
// lo de "forzarAgrupamientoDeLinea" se hizo solo para un usuario (Pegaso) que ya ni siquiera esta. Lo que hace es que siempre mete una linea, sin tener en cuenta la cantidad, pero con las dimensiones que les hemos preparado para ese bulto (que es una suma de todos los bultos reales... un chanchullo)
|
|
380
|
-
const tempShipmentLines =
|
|
381
|
+
const tempShipmentLines = [];
|
|
381
382
|
if (forzarAgrupamientoDeLinea) {
|
|
382
383
|
tempShipmentLines.push({
|
|
383
384
|
id_envio: idEnvioTemporal,
|
|
@@ -394,6 +395,7 @@ class IntegrationManager {
|
|
|
394
395
|
}));
|
|
395
396
|
tempShipmentLines.push(...linesToAdd);
|
|
396
397
|
}
|
|
398
|
+
this.dataToInsert.lines.set(idEnvioTemporal, tempShipmentLines);
|
|
397
399
|
}
|
|
398
400
|
// para cuando el usuario quiere mapear su sku con la referencia que tenga en almacen
|
|
399
401
|
if (shouldFindWarehouseSkus) {
|
package/index.ts
CHANGED
|
@@ -242,6 +242,8 @@ export class IntegrationManager {
|
|
|
242
242
|
id_usuario: idUsuario
|
|
243
243
|
});
|
|
244
244
|
|
|
245
|
+
this.dataToInsert.lines.delete(idEnvioTemporal);
|
|
246
|
+
|
|
245
247
|
return;
|
|
246
248
|
}
|
|
247
249
|
|
|
@@ -250,7 +252,7 @@ export class IntegrationManager {
|
|
|
250
252
|
|
|
251
253
|
await integrationsService.updateTempShimpment({
|
|
252
254
|
id_envio: idEnvioTemporal,
|
|
253
|
-
...
|
|
255
|
+
...partialTempShipmentModified
|
|
254
256
|
});
|
|
255
257
|
}
|
|
256
258
|
|
|
@@ -275,9 +277,7 @@ export class IntegrationManager {
|
|
|
275
277
|
countryName: country.nombre_pais_en
|
|
276
278
|
});
|
|
277
279
|
|
|
278
|
-
const arrayPackages
|
|
279
|
-
Object.values(this.dataToInsert.lines)
|
|
280
|
-
).flat();
|
|
280
|
+
const arrayPackages = [...this.dataToInsert.lines.values()].flat().flat();
|
|
281
281
|
|
|
282
282
|
await Promise.allSettled([
|
|
283
283
|
integrationsService.insertTempShipmentMultipleLines(arrayPackages),
|
|
@@ -615,8 +615,7 @@ export class IntegrationManager {
|
|
|
615
615
|
// si no agrupamos, cogemos el peso y dimensiones del peso mismo
|
|
616
616
|
} else {
|
|
617
617
|
// lo de "forzarAgrupamientoDeLinea" se hizo solo para un usuario (Pegaso) que ya ni siquiera esta. Lo que hace es que siempre mete una linea, sin tener en cuenta la cantidad, pero con las dimensiones que les hemos preparado para ese bulto (que es una suma de todos los bultos reales... un chanchullo)
|
|
618
|
-
const tempShipmentLines =
|
|
619
|
-
this.dataToInsert.lines.get(idEnvioTemporal) || [];
|
|
618
|
+
const tempShipmentLines = [];
|
|
620
619
|
|
|
621
620
|
if (forzarAgrupamientoDeLinea) {
|
|
622
621
|
tempShipmentLines.push({
|
|
@@ -635,6 +634,8 @@ export class IntegrationManager {
|
|
|
635
634
|
|
|
636
635
|
tempShipmentLines.push(...linesToAdd);
|
|
637
636
|
}
|
|
637
|
+
|
|
638
|
+
this.dataToInsert.lines.set(idEnvioTemporal, tempShipmentLines);
|
|
638
639
|
}
|
|
639
640
|
|
|
640
641
|
// para cuando el usuario quiere mapear su sku con la referencia que tenga en almacen
|