232402_test_to_dev #1637
|
@ -81,17 +81,15 @@ module.exports = Self => {
|
||||||
throw new UserError('You must delete all the buy requests first');
|
throw new UserError('You must delete all the buy requests first');
|
||||||
|
|
||||||
// removes item shelvings
|
// removes item shelvings
|
||||||
if (hasItemShelvingSales && canDeleteTicketWithPartPrepared) {
|
const promises = [];
|
||||||
const promises = [];
|
for (let sale of sales) {
|
||||||
for (let sale of sales) {
|
if (sale.itemShelvingSale()) {
|
||||||
if (sale.itemShelvingSale()) {
|
const itemShelvingSale = sale.itemShelvingSale();
|
||||||
const itemShelvingSale = sale.itemShelvingSale();
|
const destroyedShelving = models.ItemShelvingSale.destroyById(itemShelvingSale.id, myOptions);
|
||||||
const destroyedShelving = models.ItemShelvingSale.destroyById(itemShelvingSale.id, myOptions);
|
promises.push(destroyedShelving);
|
||||||
promises.push(destroyedShelving);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
await Promise.all(promises);
|
|
||||||
}
|
}
|
||||||
|
await Promise.all(promises);
|
||||||
|
|
||||||
// Remove ticket greuges
|
// Remove ticket greuges
|
||||||
const ticketGreuges = await models.Greuge.find({where: {ticketFk: id}}, myOptions);
|
const ticketGreuges = await models.Greuge.find({where: {ticketFk: id}}, myOptions);
|
||||||
|
|
Loading…
Reference in New Issue