Merge pull request '2920-item_descriptor_user_warehouse' (#630) from 2920-item_descriptor_user_warehouse into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #630
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Joan Sanchez 2021-05-24 09:23:33 +00:00
commit ec7cc169f5
32 changed files with 161 additions and 94 deletions

View File

@ -892,7 +892,7 @@ export default {
penultimateMondayOfJanuary: 'vn-worker-calendar vn-calendar:nth-child(2) section:nth-child(22) > div', 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', 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', 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', 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', 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', secondThursdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(18) > div',

View File

@ -71,7 +71,7 @@
vn-repeat-last on-last="$ctrl.focusLastInput()"> vn-repeat-last on-last="$ctrl.focusLastInput()">
<vn-td number> <vn-td number>
<span <span
ng-click="descriptor.show($event, saleClaimed.sale.itemFk)" ng-click="itemDescriptor.show($event, saleClaimed.sale.itemFk)"
class="link"> class="link">
{{::saleClaimed.sale.itemFk | zeroFill:6}} {{::saleClaimed.sale.itemFk | zeroFill:6}}
</span> </span>
@ -154,10 +154,11 @@
</div> </div>
</vn-popover> </vn-popover>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-ticket-descriptor-popover <vn-ticket-descriptor-popover
vn-id="ticketDescriptor"> vn-id="ticket-descriptor">
</vn-ticket-descriptor-popover> </vn-ticket-descriptor-popover>
<vn-confirm <vn-confirm
vn-id="update-greuge" vn-id="update-greuge"

View File

@ -129,7 +129,8 @@
</tpl-body> </tpl-body>
</vn-dialog> </vn-dialog>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-popover <vn-popover
class="edit" class="edit"

View File

@ -220,11 +220,12 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<vn-ticket-descriptor-popover <vn-ticket-descriptor-popover
vn-id="ticketDescriptor"> vn-id="ticket-descriptor">
</vn-ticket-descriptor-popover> </vn-ticket-descriptor-popover>

View File

@ -82,7 +82,8 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="item-descriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-ticket-descriptor-popover <vn-ticket-descriptor-popover
vn-id="ticket-descriptor"> vn-id="ticket-descriptor">

View File

@ -202,7 +202,8 @@
</vn-vertical> </vn-vertical>
</div> </div>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-confirm <vn-confirm

View File

@ -195,8 +195,9 @@
</tpl-buttons> </tpl-buttons>
</vn-dialog> </vn-dialog>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-entry-descriptor-popover <vn-entry-descriptor-popover
vn-id="entryDescriptor"> vn-id="entry-descriptor">
</vn-entry-descriptor-popover> </vn-entry-descriptor-popover>

View File

@ -160,9 +160,10 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-travel-descriptor-popover <vn-travel-descriptor-popover
vn-id="travelDescriptor"> vn-id="travel-descriptor">
</vn-travel-descriptor-popover> </vn-travel-descriptor-popover>

View File

@ -1,5 +1,5 @@
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('getSummary', { Self.remoteMethodCtx('getSummary', {
description: 'return the item information', description: 'return the item information',
accessType: 'READ', accessType: 'READ',
accepts: [{ accepts: [{
@ -19,7 +19,7 @@ module.exports = Self => {
} }
}); });
Self.getSummary = async id => { Self.getSummary = async(ctx, id) => {
let promises = []; let promises = [];
let summary = {}; let summary = {};
const models = Self.app.models; const models = Self.app.models;
@ -102,7 +102,9 @@ module.exports = Self => {
[summary.botanical] = res[2]; [summary.botanical] = res[2];
summary.niches = res[3]; 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.available = res.available;
summary.visible = res.visible; summary.visible = res.visible;

View File

@ -1,5 +1,8 @@
<vn-portal slot="menu"> <vn-portal slot="menu">
<vn-item-descriptor item="$ctrl.item" card-reload="$ctrl.reload()"></vn-item-descriptor> <vn-item-descriptor
warehouse-fk="$ctrl.vnConfig.warehouseFk"
item="$ctrl.item"
card-reload="$ctrl.reload()"></vn-item-descriptor>
<vn-left-menu source="card"></vn-left-menu> <vn-left-menu source="card"></vn-left-menu>
</vn-portal> </vn-portal>
<ui-view></ui-view> <ui-view></ui-view>

View File

@ -21,7 +21,16 @@ class Controller extends Descriptor {
set entity(value) { set entity(value) {
super.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() { loadData() {
@ -35,7 +44,7 @@ class Controller extends Descriptor {
if (!this.item) return; if (!this.item) return;
const params = { const params = {
warehouseFk: this.item.itemType.warehouseFk, warehouseFk: this.warehouseFk,
dated: this.dated dated: this.dated
}; };
@ -90,6 +99,7 @@ ngModule.vnComponent('vnItemDescriptor', {
bindings: { bindings: {
item: '<', item: '<',
dated: '<', dated: '<',
cardReload: '&' cardReload: '&',
warehouseFk: '<?'
} }
}); });

View File

@ -155,5 +155,6 @@
</vn-card> </vn-card>
</div> </div>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -112,10 +112,11 @@
<vn-float-button icon="add"></vn-float-button> <vn-float-button icon="add"></vn-float-button>
</a> </a>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<vn-confirm <vn-confirm
vn-id="clone" vn-id="clone"

View File

@ -107,13 +107,14 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<vn-ticket-descriptor-popover <vn-ticket-descriptor-popover
vn-id="ticketDescriptor"> vn-id="ticket-descriptor">
</vn-ticket-descriptor-popover> </vn-ticket-descriptor-popover>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-dialog <vn-dialog
vn-id="denyDialog" vn-id="denyDialog"

View File

@ -23,7 +23,7 @@
<vn-tr ng-repeat="waste in detail.lines"> <vn-tr ng-repeat="waste in detail.lines">
<vn-td shrink> <vn-td shrink>
<span <span
ng-click="descriptor.show($event, waste.itemFk)" ng-click="itemDescriptor.show($event, waste.itemFk)"
class="link"> class="link">
{{::waste.itemFk}} {{::waste.itemFk}}
</span> </span>
@ -38,5 +38,6 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -63,9 +63,10 @@
</vn-horizontal> </vn-horizontal>
</vn-data-viewer> </vn-data-viewer>
<vn-order-prices-popover <vn-order-prices-popover
vn-id="pricesPopover" vn-id="prices-popover"
order="$ctrl.order"> order="$ctrl.order">
</vn-order-prices-popover> </vn-order-prices-popover>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -37,7 +37,7 @@
on-error-src/> on-error-src/>
</vn-td> </vn-td>
<vn-td number> <vn-td number>
<span ng-click="descriptor.show($event, row.itemFk)" <span ng-click="itemDescriptor.show($event, row.itemFk)"
class="link"> class="link">
{{::row.itemFk | zeroFill:6}} {{::row.itemFk | zeroFill:6}}
</span> </span>
@ -83,7 +83,8 @@
fixed-bottom-right> fixed-bottom-right>
</vn-float-button> </vn-float-button>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-confirm <vn-confirm
vn-id="delete-row" vn-id="delete-row"

View File

@ -93,7 +93,7 @@
</vn-td> </vn-td>
<vn-td shrink> <vn-td shrink>
<span <span
ng-click="descriptor.show($event, row.itemFk)" ng-click="itemDescriptor.show($event, row.itemFk)"
class="link"> class="link">
{{::row.itemFk | zeroFill:6}} {{::row.itemFk | zeroFill:6}}
</span> </span>
@ -119,8 +119,9 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-client-descriptor-popover <vn-client-descriptor-popover
vn-id="clientDescriptor"> vn-id="client-descriptor">
</vn-client-descriptor-popover> </vn-client-descriptor-popover>

View File

@ -34,7 +34,7 @@
<vn-tr ng-repeat="row in rows"> <vn-tr ng-repeat="row in rows">
<vn-td shrink number> <vn-td shrink number>
<span <span
ng-click="descriptor.show($event, row.itemFk)" ng-click="itemDescriptor.show($event, row.itemFk)"
class="link"> class="link">
{{::row.itemFk}} {{::row.itemFk}}
</span> </span>
@ -58,6 +58,7 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -24,7 +24,7 @@
<tr class="initial"> <tr class="initial">
<td rowspan="{{::sale.components.length + 1}}" number> <td rowspan="{{::sale.components.length + 1}}" number>
<span <span
ng-click="descriptor.show($event, sale.itemFk, sale.id)" ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)"
class="link"> class="link">
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
@ -103,11 +103,11 @@
</div> </div>
</vn-side-menu> </vn-side-menu>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk"> warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-zone-descriptor-popover <vn-zone-descriptor-popover
vn-id="zoneDescriptor"> vn-id="zone-descriptor">
</vn-zone-descriptor-popover> </vn-zone-descriptor-popover>

View File

@ -57,15 +57,15 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor" vn-id="item-descriptor"
warehouse-fk="this.ticket.warehouseFk", warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<vn-confirm <vn-confirm
vn-id="deleteExpedition" vn-id="delete-expedition"
on-accept="$ctrl.onDialogAccept($data)" on-accept="$ctrl.onDialogAccept($data)"
question="Delete expedition" question="Delete expedition"
message="Are you sure you want to delete this expedition?"> message="Are you sure you want to delete this expedition?">

View File

@ -25,7 +25,7 @@
</div> </div>
<div class="description"> <div class="description">
<h3> <h3>
<span class="link" ng-click="descriptor.show($event, sale.item.id)"> <span class="link" ng-click="itemDescriptor.show($event, sale.item.id)">
{{::sale.item.name}} {{::sale.item.name}}
</span> </span>
</h3> </h3>
@ -63,5 +63,6 @@
<vn-pagination model="model"></vn-pagination> <vn-pagination model="model"></vn-pagination>
</vn-vertical> </vn-vertical>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -17,5 +17,8 @@ class Controller extends Section {
ngModule.vnComponent('vnTicketPicture', { ngModule.vnComponent('vnTicketPicture', {
template: require('./index.html'), template: require('./index.html'),
controller: Controller controller: Controller,
bindings: {
ticket: '<'
}
}); });

View File

@ -24,7 +24,7 @@
<vn-th>Atender</vn-th> <vn-th>Atender</vn-th>
<vn-th number>Quantity</vn-th> <vn-th number>Quantity</vn-th>
<vn-th number>Price</vn-th> <vn-th number>Price</vn-th>
<vn-th number>Sale id</vn-th> <vn-th number>Item id</vn-th>
<vn-th number>Ok</vn-th> <vn-th number>Ok</vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
@ -101,10 +101,11 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor"> vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<a ui-sref="ticket.card.request.create" <a ui-sref="ticket.card.request.create"
vn-tooltip="New request" vn-tooltip="New request"

View File

@ -70,5 +70,8 @@ class Controller extends Section {
ngModule.vnComponent('vnTicketRequestIndex', { ngModule.vnComponent('vnTicketRequestIndex', {
template: require('./index.html'), template: require('./index.html'),
controller: Controller controller: Controller,
bindings: {
ticket: '<'
}
}); });

View File

@ -37,17 +37,20 @@
"abstract": true, "abstract": true,
"component": "vn-ticket", "component": "vn-ticket",
"description": "Tickets" "description": "Tickets"
}, { },
{
"url": "/index?q", "url": "/index?q",
"state": "ticket.index", "state": "ticket.index",
"component": "vn-ticket-index", "component": "vn-ticket-index",
"description": "Tickets" "description": "Tickets"
}, { },
{
"url": "/:id?sendSMS&phone&message", "url": "/:id?sendSMS&phone&message",
"state": "ticket.card", "state": "ticket.card",
"abstract": true, "abstract": true,
"component": "vn-ticket-card" "component": "vn-ticket-card"
}, { },
{
"url": "/summary", "url": "/summary",
"state": "ticket.card.summary", "state": "ticket.card.summary",
"component": "vn-ticket-summary", "component": "vn-ticket-summary",
@ -55,7 +58,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url" : "/basic-data", "url" : "/basic-data",
"state": "ticket.card.basicData", "state": "ticket.card.basicData",
"component": "vn-ticket-basic-data", "component": "vn-ticket-basic-data",
@ -63,7 +67,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url" : "/step-one", "url" : "/step-one",
"state": "ticket.card.basicData.stepOne", "state": "ticket.card.basicData.stepOne",
"component": "vn-ticket-basic-data-step-one", "component": "vn-ticket-basic-data-step-one",
@ -71,7 +76,8 @@
"params": { "params": {
"ticket": "$ctrl.data" "ticket": "$ctrl.data"
} }
}, { },
{
"url" : "/step-two", "url" : "/step-two",
"state": "ticket.card.basicData.stepTwo", "state": "ticket.card.basicData.stepTwo",
"component": "vn-ticket-basic-data-step-two", "component": "vn-ticket-basic-data-step-two",
@ -79,7 +85,8 @@
"params": { "params": {
"ticket": "$ctrl.data" "ticket": "$ctrl.data"
} }
}, { },
{
"url" : "/sale", "url" : "/sale",
"state": "ticket.card.sale", "state": "ticket.card.sale",
"component": "vn-ticket-sale", "component": "vn-ticket-sale",
@ -87,7 +94,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url": "/observation", "url": "/observation",
"state": "ticket.card.observation", "state": "ticket.card.observation",
"component": "vn-ticket-observation", "component": "vn-ticket-observation",
@ -95,7 +103,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url": "/volume", "url": "/volume",
"state": "ticket.card.volume", "state": "ticket.card.volume",
"component": "vn-ticket-volume", "component": "vn-ticket-volume",
@ -103,7 +112,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url": "/expedition", "url": "/expedition",
"state": "ticket.card.expedition", "state": "ticket.card.expedition",
"component": "vn-ticket-expedition", "component": "vn-ticket-expedition",
@ -111,7 +121,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url" : "/package", "url" : "/package",
"state": "ticket.card.package", "state": "ticket.card.package",
"component": "vn-ticket-package", "component": "vn-ticket-package",
@ -119,12 +130,14 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url": "/tracking", "url": "/tracking",
"state": "ticket.card.tracking", "state": "ticket.card.tracking",
"abstract": true, "abstract": true,
"component": "ui-view" "component": "ui-view"
}, { },
{
"url" : "/index", "url" : "/index",
"state": "ticket.card.tracking.index", "state": "ticket.card.tracking.index",
"component": "vn-ticket-tracking-index", "component": "vn-ticket-tracking-index",
@ -132,7 +145,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url": "/edit", "url": "/edit",
"state": "ticket.card.tracking.edit", "state": "ticket.card.tracking.edit",
"component": "vn-ticket-tracking-edit", "component": "vn-ticket-tracking-edit",
@ -141,7 +155,8 @@
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
}, },
"acl": ["production", "administrative", "salesPerson"] "acl": ["production", "administrative", "salesPerson"]
}, { },
{
"url" : "/sale-checked", "url" : "/sale-checked",
"state": "ticket.card.saleChecked", "state": "ticket.card.saleChecked",
"component": "vn-ticket-sale-checked", "component": "vn-ticket-sale-checked",
@ -149,7 +164,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url" : "/components", "url" : "/components",
"state": "ticket.card.components", "state": "ticket.card.components",
"component": "vn-ticket-components", "component": "vn-ticket-components",
@ -157,7 +173,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url" : "/sale-tracking", "url" : "/sale-tracking",
"state": "ticket.card.saleTracking", "state": "ticket.card.saleTracking",
"component": "vn-ticket-sale-tracking", "component": "vn-ticket-sale-tracking",
@ -165,7 +182,8 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url" : "/picture", "url" : "/picture",
"state": "ticket.card.picture", "state": "ticket.card.picture",
"component": "vn-ticket-picture", "component": "vn-ticket-picture",
@ -173,43 +191,54 @@
"params": { "params": {
"ticket": "$ctrl.ticket" "ticket": "$ctrl.ticket"
} }
}, { },
{
"url" : "/log", "url" : "/log",
"state": "ticket.card.log", "state": "ticket.card.log",
"component": "vn-ticket-log", "component": "vn-ticket-log",
"description": "Log" "description": "Log"
}, { },
{
"url": "/weekly", "url": "/weekly",
"state": "ticket.weekly", "state": "ticket.weekly",
"abstract": true, "abstract": true,
"component": "ui-view", "component": "ui-view",
"description": "Weekly" "description": "Weekly"
}, { },
{
"url": "/index?q", "url": "/index?q",
"state": "ticket.weekly.index", "state": "ticket.weekly.index",
"component": "vn-ticket-weekly-index", "component": "vn-ticket-weekly-index",
"description": "Weekly tickets" "description": "Weekly tickets"
}, { },
{
"url": "/service", "url": "/service",
"state": "ticket.card.service", "state": "ticket.card.service",
"component": "vn-ticket-service", "component": "vn-ticket-service",
"description": "Service" "description": "Service"
}, { },
{
"url": "/request", "url": "/request",
"state": "ticket.card.request", "state": "ticket.card.request",
"abstract": true, "abstract": true,
"component": "ui-view" "component": "ui-view"
}, { },
{
"url" : "/index", "url" : "/index",
"state": "ticket.card.request.index", "state": "ticket.card.request.index",
"component": "vn-ticket-request-index", "component": "vn-ticket-request-index",
"description": "Purchase request" "description": "Purchase request",
}, { "params": {
"ticket": "$ctrl.ticket"
}
},
{
"url" : "/create", "url" : "/create",
"state": "ticket.card.request.create", "state": "ticket.card.request.create",
"component": "vn-ticket-request-create", "component": "vn-ticket-request-create",
"description": "New purchase request" "description": "New purchase request"
}, { },
{
"url": "/create?clientFk", "url": "/create?clientFk",
"state": "ticket.create", "state": "ticket.create",
"component": "vn-ticket-create", "component": "vn-ticket-create",

View File

@ -29,7 +29,7 @@
</vn-td> </vn-td>
<vn-td number> <vn-td number>
<span <span
ng-click="$ctrl.showDescriptor($event, sale)" ng-click="$ctrl.showItemDescriptor($event, sale)"
class="link"> class="link">
{{::sale.itemFk | zeroFill:6}} {{::sale.itemFk | zeroFill:6}}
</span> </span>
@ -52,7 +52,7 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk" warehouse-fk="$ctrl.ticket.warehouseFk"
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -17,7 +17,7 @@ class Controller extends Section {
] ]
}; };
} }
showDescriptor(event, sale) { showItemDescriptor(event, sale) {
this.quicklinks = { this.quicklinks = {
btnThree: { btnThree: {
icon: 'icon-transaction', icon: 'icon-transaction',
@ -29,7 +29,7 @@ class Controller extends Section {
tooltip: 'Item diary' tooltip: 'Item diary'
} }
}; };
this.$.descriptor.show(event.target, sale.itemFk); this.$.itemDescriptor.show(event.target, sale.itemFk);
} }
} }

View File

@ -67,9 +67,9 @@
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="itemDescriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk"> warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="worker-descriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>

View File

@ -100,7 +100,7 @@
</vn-td> </vn-td>
<vn-td shrink> <vn-td shrink>
<span class="link" ng-if="sale.id" <span class="link" ng-if="sale.id"
ng-click="descriptor.show($event, sale.itemFk, sale.id)"> ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)">
{{sale.itemFk}} {{sale.itemFk}}
</span> </span>
<vn-autocomplete ng-if="!sale.id" class="dense" <vn-autocomplete ng-if="!sale.id" class="dense"
@ -190,7 +190,7 @@
fixed-bottom-right> fixed-bottom-right>
</vn-float-button> </vn-float-button>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk", warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -142,7 +142,7 @@
</vn-td> </vn-td>
<vn-td number shrink> <vn-td number shrink>
<span <span
ng-click="descriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)" ng-click="itemDescriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)"
class="link"> class="link">
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
@ -258,7 +258,7 @@
<vn-td number> <vn-td number>
<span <span
ng-show="::request.saleFk" ng-show="::request.saleFk"
ng-click="descriptor.show($event, request.sale.itemFk, request.sale.id)" ng-click="itemDescriptor.show($event, request.sale.itemFk, request.sale.id)"
class="link"> class="link">
{{request.sale.itemFk | zeroFill:6}} {{request.sale.itemFk | zeroFill:6}}
</span> </span>
@ -278,10 +278,10 @@
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-route-descriptor-popover <vn-route-descriptor-popover
vn-id="routeDescriptor"> vn-id="route-descriptor">
</vn-route-descriptor-popover> </vn-route-descriptor-popover>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk", warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id"> ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>

View File

@ -37,7 +37,7 @@
<vn-tr ng-repeat="sale in $ctrl.sales"> <vn-tr ng-repeat="sale in $ctrl.sales">
<vn-td number> <vn-td number>
<span <span
ng-click="descriptor.show($event, sale.itemFk, sale.id)" ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)"
class="link"> class="link">
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
@ -63,7 +63,7 @@
</vn-card> </vn-card>
</vn-vertical> </vn-vertical>
<vn-item-descriptor-popover <vn-item-descriptor-popover
vn-id="descriptor" vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk"> warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover> </vn-item-descriptor-popover>