item descriptor not sending the correct warehouse fixed
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
parent
20843a9068
commit
0f5d1e55c0
|
@ -23,11 +23,11 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.getVisibleAvailable = async(itemFk, warehouseFk) => {
|
Self.getVisibleAvailable = async(id, warehouseFk) => {
|
||||||
let query = `
|
let query = `
|
||||||
CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
|
CALL vn.getItemVisibleAvailable(?,curdate(),?,?)`;
|
||||||
|
|
||||||
let options = [itemFk, warehouseFk, false];
|
let options = [id, warehouseFk, false];
|
||||||
[res] = await Self.rawSql(query, options);
|
[res] = await Self.rawSql(query, options);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -34,20 +34,21 @@ class Controller {
|
||||||
|
|
||||||
set item(value) {
|
set item(value) {
|
||||||
this._item = value;
|
this._item = value;
|
||||||
this.updateStock();
|
if (value && value.itemType && value.itemType.warehouseFk)
|
||||||
|
this.updateStock(value.itemType.warehouseFk);
|
||||||
}
|
}
|
||||||
|
|
||||||
get item() {
|
get item() {
|
||||||
return this._item;
|
return this._item;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStock() {
|
updateStock(warehouseFk) {
|
||||||
this.available = null;
|
this.available = null;
|
||||||
this.visible = null;
|
this.visible = null;
|
||||||
if (this._item && this._item.id) {
|
if (this._item && this._item.id) {
|
||||||
let options = {
|
let options = {
|
||||||
params: {
|
params: {
|
||||||
warehouseFk: this._warehouseFk
|
warehouseFk: warehouseFk
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.$http.get(`/item/api/Items/${this._item.id}/getVisibleAvailable`, options).then(response => {
|
this.$http.get(`/item/api/Items/${this._item.id}/getVisibleAvailable`, options).then(response => {
|
||||||
|
@ -81,7 +82,7 @@ class Controller {
|
||||||
warehouseFk: this.warehouseFk
|
warehouseFk: this.warehouseFk
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
|
||||||
this.updateStock();
|
this.updateStock(this.item.itemType.warehouseFk);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue