refs #6276 updateFromSale refactored
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2023-12-01 12:48:21 +01:00
parent 7e57640758
commit 660e77be55
1 changed files with 3 additions and 6 deletions

View File

@ -28,14 +28,11 @@ module.exports = Self => {
try {
const itemShelvingSale = await models.ItemShelvingSale.findOne({
where: {saleFk}
where: {saleFk},
include: {relation: 'itemShelving'}
}, myOptions);
const itemShelving = await models.ItemShelving.findOne({
where: {
id: itemShelvingSale.ItemShelvingFk
}
});
const itemShelving = itemShelvingSale.itemShelving();
const quantity = itemShelving.visible + itemShelvingSale.quantity;
await itemShelving.updateAttributes(