#6276 createNewWarehouse methods migrated from silex to salix #1850
|
@ -28,14 +28,11 @@ module.exports = Self => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const itemShelvingSale = await models.ItemShelvingSale.findOne({
|
const itemShelvingSale = await models.ItemShelvingSale.findOne({
|
||||||
where: {saleFk}
|
where: {saleFk},
|
||||||
|
include: {relation: 'itemShelving'}
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
const itemShelving = await models.ItemShelving.findOne({
|
const itemShelving = itemShelvingSale.itemShelving();
|
||||||
where: {
|
|
||||||
id: itemShelvingSale.ItemShelvingFk
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const quantity = itemShelving.visible + itemShelvingSale.quantity;
|
const quantity = itemShelving.visible + itemShelvingSale.quantity;
|
||||||
|
|
||||||
await itemShelving.updateAttributes(
|
await itemShelving.updateAttributes(
|
||||||
|
|
Loading…
Reference in New Issue