principio 1146

This commit is contained in:
Javi Gallego 2019-02-15 16:04:24 +01:00
parent 00c7f28baf
commit 2b4f5984cc
4 changed files with 21 additions and 7 deletions

View File

@ -60,15 +60,15 @@ module.exports = Self => {
};
[item] = await Self.app.models.Item.find(filter);
// Visible Avaible
// 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 ? res[0].available : '-';
item.visible = res[0].visible ? res[0].visible : '-';
item.available = res[0].available;
item.visible = res[0].visible;
return item;
};

View File

@ -28,7 +28,7 @@ module.exports = Self => {
}
});
Self.regularize = async (ctx, itemFk, quantity, warehouseFk) => {
Self.regularize = async(ctx, itemFk, quantity, warehouseFk) => {
const userId = ctx.req.accessToken.userId;
const models = Self.app.models;

View File

@ -25,7 +25,6 @@ class Controller {
if (value)
this._warehouseFk = value;
}
get warehouseFk() {
if (!this._warehouseFk)
this._warehouseFk = parseInt(window.localStorage.defaultWarehouseFk);
@ -33,6 +32,20 @@ class Controller {
return this._warehouseFk;
}
set item(value) {
this._item = value
this.avai = null
visible null
if (!this.item)
this._warehouseFk = parseInt(window.localStorage.defaultWarehouseFk);
llamar availabe
return this._warehouseFk;
}
get item(){
return this._item;
}
onMoreChange(callback) {
callback.call(this);
}
@ -57,6 +70,7 @@ class Controller {
warehouseFk: this.warehouseFk
}).then(res => {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
this.card.reload();
});
}
}

View File

@ -35,14 +35,14 @@
<vn-tbody>
<vn-tr
ng-class="::{
'isToday': $ctrl.isToday(sale.date),
'isIn': sale.in,
'balanceNegative': sale.balance < 0}"
ng-repeat="sale in sales"
vn-repeat-last
on-last="$ctrl.scrollToLine()">
<vn-td>
<span class="chip date">
<span class="chip"
ng-class="::{warning: $ctrl.isToday(sale.date)}">
{{::sale.date | date:'dd/MM/yyyy' }}
</span>
</vn-td>