From 19120ef102541b1929d4be3bb26947d5c72f1f4e Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 31 Jan 2023 09:28:28 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20el=20descriptor=20coge=20el=20warehouse?= =?UTF-8?q?Fk=20dependiendo=20de=20la=20secci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/item/back/methods/item/getSummary.js | 4 ++-- modules/item/front/card/index.html | 4 ++-- modules/item/front/card/index.js | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) 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);