diff --git a/modules/item/back/methods/item/getSummary.js b/modules/item/back/methods/item/getSummary.js index 5f88ca939..216093bf1 100644 --- a/modules/item/back/methods/item/getSummary.js +++ b/modules/item/back/methods/item/getSummary.js @@ -101,8 +101,8 @@ module.exports = Self => { const userConfig = await models.UserConfig.getUserConfig(ctx, myOptions); console.log(userConfig.warehouseFk); const company = await models.Company.findOne({where: {code: 'VNL'}}, myOptions); - - res = await models.Item.getVisibleAvailable(summary.item.id, company.warehouseFk, undefined, myOptions); + console.log(company.warehouseFk); + res = await models.Item.getVisibleAvailable(summary.item.id, 1, undefined, myOptions); summary.available = res.available; summary.visible = res.visible; diff --git a/modules/item/front/card/index.html b/modules/item/front/card/index.html index e92e1696d..f141649eb 100644 --- a/modules/item/front/card/index.html +++ b/modules/item/front/card/index.html @@ -1,6 +1,6 @@ - diff --git a/modules/item/front/card/index.js b/modules/item/front/card/index.js index 8b32e030b..ca150e880 100644 --- a/modules/item/front/card/index.js +++ b/modules/item/front/card/index.js @@ -2,6 +2,12 @@ import ngModule from '../module'; import ModuleCard from 'salix/components/module-card'; class Controller extends ModuleCard { + getWarehouseFk() { + if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary') + return this.$params.warehouseFk; + return this.vnConfig.warehouseFk; + } + reload() { this.$http.get(`Items/${this.$params.id}/getCard`) .then(res => this.item = res.data);