diff --git a/modules/item/back/methods/item/getCard.js b/modules/item/back/methods/item/getCard.js
index eb479607b..9780c5601 100644
--- a/modules/item/back/methods/item/getCard.js
+++ b/modules/item/back/methods/item/getCard.js
@@ -60,16 +60,6 @@ module.exports = Self => {
};
[item] = await Self.app.models.Item.find(filter);
- // Visible Available
- let query = `
- CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
-
- let options = [item.id, item.itemType().warehouseFk, false];
- let [res] = await Self.rawSql(query, options);
-
- item.available = res[0].available;
- item.visible = res[0].visible;
-
return item;
};
};
diff --git a/modules/item/back/methods/item/getVisibleAvailable.js b/modules/item/back/methods/item/getVisibleAvailable.js
index 6e9f2b531..fecdb736b 100644
--- a/modules/item/back/methods/item/getVisibleAvailable.js
+++ b/modules/item/back/methods/item/getVisibleAvailable.js
@@ -4,7 +4,7 @@ module.exports = Self => {
accessType: '',
accepts: [
{
- arg: 'itemFk',
+ arg: 'id',
type: 'Number',
required: true,
},
@@ -18,21 +18,20 @@ module.exports = Self => {
root: true
},
http: {
- path: `/getVisibleAvailable`,
+ path: `/:id/getVisibleAvailable`,
verb: 'GET'
}
});
Self.getVisibleAvailable = async(itemFk, warehouseFk) => {
- let item = {};
let query = `
CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
let options = [itemFk, warehouseFk, false];
[res] = await Self.rawSql(query, options);
- item.available = res[0].available;
- item.visible = res[0].visible;
- return item;
+ return {
+ available: res[0].available,
+ visible: res[0].visible};
};
};
diff --git a/modules/item/front/descriptor/index.html b/modules/item/front/descriptor/index.html
index 22769d5a7..a0d6404f5 100644
--- a/modules/item/front/descriptor/index.html
+++ b/modules/item/front/descriptor/index.html
@@ -1,10 +1,3 @@
-