diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 143196d18..b5bf46dd5 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -892,7 +892,7 @@ export default { penultimateMondayOfJanuary: 'vn-worker-calendar vn-calendar:nth-child(2) section:nth-child(22) > div', lastMondayOfMarch: 'vn-worker-calendar vn-calendar:nth-child(4) section:nth-child(29) > div', fistMondayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(8) > div', - secondFridayOfJun: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(12) > div', + secondFridayOfJun: 'vn-worker-calendar vn-calendar:nth-child(7) section:nth-child(12) > div', secondTuesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(16) > div', secondWednesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(17) > div', secondThursdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(18) > div', diff --git a/modules/claim/front/action/index.html b/modules/claim/front/action/index.html index 5f187c05b..eeac01d78 100644 --- a/modules/claim/front/action/index.html +++ b/modules/claim/front/action/index.html @@ -71,7 +71,7 @@ vn-repeat-last on-last="$ctrl.focusLastInput()"> {{::saleClaimed.sale.itemFk | zeroFill:6}} @@ -154,10 +154,11 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="ticket-descriptor"> + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="worker-descriptor"> + vn-id="ticket-descriptor"> \ No newline at end of file diff --git a/modules/client/front/consumption/index.html b/modules/client/front/consumption/index.html index b2128ee11..146565954 100644 --- a/modules/client/front/consumption/index.html +++ b/modules/client/front/consumption/index.html @@ -82,7 +82,8 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> diff --git a/modules/entry/front/buy/index/index.html b/modules/entry/front/buy/index/index.html index 22ae27540..9b9cd4634 100644 --- a/modules/entry/front/buy/index/index.html +++ b/modules/entry/front/buy/index/index.html @@ -202,7 +202,8 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="entry-descriptor"> diff --git a/modules/entry/front/summary/index.html b/modules/entry/front/summary/index.html index 24cedcdb2..e4ad6ba31 100644 --- a/modules/entry/front/summary/index.html +++ b/modules/entry/front/summary/index.html @@ -160,9 +160,10 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="travel-descriptor"> diff --git a/modules/item/back/methods/item/getSummary.js b/modules/item/back/methods/item/getSummary.js index 698984572..4ef9652ca 100644 --- a/modules/item/back/methods/item/getSummary.js +++ b/modules/item/back/methods/item/getSummary.js @@ -1,5 +1,5 @@ module.exports = Self => { - Self.remoteMethod('getSummary', { + Self.remoteMethodCtx('getSummary', { description: 'return the item information', accessType: 'READ', accepts: [{ @@ -19,7 +19,7 @@ module.exports = Self => { } }); - Self.getSummary = async id => { + Self.getSummary = async(ctx, id) => { let promises = []; let summary = {}; const models = Self.app.models; @@ -102,7 +102,9 @@ module.exports = Self => { [summary.botanical] = res[2]; summary.niches = res[3]; - res = await models.Item.getVisibleAvailable(summary.item.id, summary.item.itemType().warehouseFk); + const userConfig = await models.UserConfig.getUserConfig(ctx); + + res = await models.Item.getVisibleAvailable(summary.item.id, userConfig.warehouseFk); 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 b7513a42a..e92e1696d 100644 --- a/modules/item/front/card/index.html +++ b/modules/item/front/card/index.html @@ -1,5 +1,8 @@ - + diff --git a/modules/item/front/descriptor/index.js b/modules/item/front/descriptor/index.js index bdf95fb61..133b11b48 100644 --- a/modules/item/front/descriptor/index.js +++ b/modules/item/front/descriptor/index.js @@ -21,7 +21,16 @@ class Controller extends Descriptor { set entity(value) { super.entity = value; - this.updateStock(); + if (this.warehouseFk) this.updateStock(); + } + + get warehouseFk() { + return this._warehouseFk; + } + + set warehouseFk(value) { + this._warehouseFk = value; + if (value) this.updateStock(); } loadData() { @@ -35,7 +44,7 @@ class Controller extends Descriptor { if (!this.item) return; const params = { - warehouseFk: this.item.itemType.warehouseFk, + warehouseFk: this.warehouseFk, dated: this.dated }; @@ -90,6 +99,7 @@ ngModule.vnComponent('vnItemDescriptor', { bindings: { item: '<', dated: '<', - cardReload: '&' + cardReload: '&', + warehouseFk: ' + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> \ No newline at end of file diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 590a6fdf3..bcebaee48 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -112,10 +112,11 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="worker-descriptor"> + vn-id="worker-descriptor"> + vn-id="ticket-descriptor"> + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> {{::waste.itemFk}} @@ -38,5 +38,6 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> \ No newline at end of file diff --git a/modules/order/front/catalog-view/index.html b/modules/order/front/catalog-view/index.html index f247c9b6b..fca728855 100644 --- a/modules/order/front/catalog-view/index.html +++ b/modules/order/front/catalog-view/index.html @@ -63,9 +63,10 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> \ No newline at end of file diff --git a/modules/order/front/line/index.html b/modules/order/front/line/index.html index 957b59cfe..df81102d5 100644 --- a/modules/order/front/line/index.html +++ b/modules/order/front/line/index.html @@ -37,7 +37,7 @@ on-error-src/> - {{::row.itemFk | zeroFill:6}} @@ -83,7 +83,8 @@ fixed-bottom-right> + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> {{::row.itemFk | zeroFill:6}} @@ -119,8 +119,9 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> + vn-id="client-descriptor"> diff --git a/modules/order/front/volume/index.html b/modules/order/front/volume/index.html index 078ac9280..f7e03e871 100644 --- a/modules/order/front/volume/index.html +++ b/modules/order/front/volume/index.html @@ -34,7 +34,7 @@ {{::row.itemFk}} @@ -58,6 +58,7 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.vnConfig.warehouseFk"> diff --git a/modules/ticket/front/component/index.html b/modules/ticket/front/component/index.html index ac109c334..3843529c3 100644 --- a/modules/ticket/front/component/index.html +++ b/modules/ticket/front/component/index.html @@ -24,7 +24,7 @@ {{sale.itemFk | zeroFill:6}} @@ -103,11 +103,11 @@ + vn-id="zone-descriptor"> diff --git a/modules/ticket/front/expedition/index.html b/modules/ticket/front/expedition/index.html index 26d9ef640..e4d42d62e 100644 --- a/modules/ticket/front/expedition/index.html +++ b/modules/ticket/front/expedition/index.html @@ -57,15 +57,15 @@ + vn-id="worker-descriptor"> diff --git a/modules/ticket/front/picture/index.html b/modules/ticket/front/picture/index.html index c95e604dd..7522fa028 100644 --- a/modules/ticket/front/picture/index.html +++ b/modules/ticket/front/picture/index.html @@ -25,7 +25,7 @@

- + {{::sale.item.name}}

@@ -63,5 +63,6 @@ - + vn-id="item-descriptor" + warehouse-fk="$ctrl.ticket.warehouseFk"> + \ No newline at end of file diff --git a/modules/ticket/front/picture/index.js b/modules/ticket/front/picture/index.js index 89cf9e078..0c0017e66 100644 --- a/modules/ticket/front/picture/index.js +++ b/modules/ticket/front/picture/index.js @@ -17,5 +17,8 @@ class Controller extends Section { ngModule.vnComponent('vnTicketPicture', { template: require('./index.html'), - controller: Controller + controller: Controller, + bindings: { + ticket: '<' + } }); diff --git a/modules/ticket/front/request/index/index.html b/modules/ticket/front/request/index/index.html index dadc96325..39a290d8c 100644 --- a/modules/ticket/front/request/index/index.html +++ b/modules/ticket/front/request/index/index.html @@ -24,7 +24,7 @@ Atender Quantity Price - Sale id + Item id Ok @@ -101,10 +101,11 @@ + vn-id="item-descriptor" + warehouse-fk="$ctrl.ticket.warehouseFk"> + vn-id="worker-descriptor"> {{::sale.itemFk | zeroFill:6}} @@ -52,7 +52,7 @@ diff --git a/modules/ticket/front/sale-checked/index.js b/modules/ticket/front/sale-checked/index.js index cfc3985ba..857ac49e3 100644 --- a/modules/ticket/front/sale-checked/index.js +++ b/modules/ticket/front/sale-checked/index.js @@ -17,7 +17,7 @@ class Controller extends Section { ] }; } - showDescriptor(event, sale) { + showItemDescriptor(event, sale) { this.quicklinks = { btnThree: { icon: 'icon-transaction', @@ -29,7 +29,7 @@ class Controller extends Section { tooltip: 'Item diary' } }; - this.$.descriptor.show(event.target, sale.itemFk); + this.$.itemDescriptor.show(event.target, sale.itemFk); } } diff --git a/modules/ticket/front/sale-tracking/index.html b/modules/ticket/front/sale-tracking/index.html index 4e80b3565..54a0eca66 100644 --- a/modules/ticket/front/sale-tracking/index.html +++ b/modules/ticket/front/sale-tracking/index.html @@ -67,9 +67,9 @@ + vn-id="worker-descriptor"> \ No newline at end of file diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 5bba457ca..5156206bb 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -100,7 +100,7 @@ + ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)"> {{sale.itemFk}} diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 1441024ba..b2c322633 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -142,7 +142,7 @@ {{sale.itemFk | zeroFill:6}} @@ -258,7 +258,7 @@ {{request.sale.itemFk | zeroFill:6}} @@ -278,10 +278,10 @@ + vn-id="route-descriptor"> diff --git a/modules/ticket/front/volume/index.html b/modules/ticket/front/volume/index.html index eb2a07d26..8e2bc4bb6 100644 --- a/modules/ticket/front/volume/index.html +++ b/modules/ticket/front/volume/index.html @@ -37,7 +37,7 @@ {{sale.itemFk | zeroFill:6}} @@ -63,7 +63,7 @@