invoiceOut descriptor popover in ticket summary

This commit is contained in:
Bernat Exposito Domenech 2020-05-18 10:28:33 +02:00
parent 1f2dee9c12
commit c205c173f8
4 changed files with 22 additions and 3 deletions

View File

@ -101,6 +101,12 @@ module.exports = Self => {
fields: ['name']
}
}
},
{
relation: 'invoiceOut',
scope: {
fields: ['id']
}
}
],
where: {id: ticketFk}

View File

@ -3,7 +3,7 @@
"name": "Tickets",
"icon": "icon-ticket",
"validations": true,
"dependencies": ["worker", "item", "client", "route"],
"dependencies": ["worker", "item", "client", "route", "invoiceOut"],
"menus": {
"main": [
{"state": "ticket.index", "icon": "icon-ticket"},

View File

@ -37,8 +37,12 @@
{{$ctrl.summary.routeFk}}
</span>
</vn-label-value>
<vn-label-value label="Invoice"
value="{{$ctrl.summary.refFk}}">
<vn-label-value label="Invoice">
<span
ng-click="$ctrl.showInvoiceOutDescriptor($event)"
class="link">
{{$ctrl.summary.refFk | dashIfEmpty}}
</span>
</vn-label-value>
</vn-one>
<vn-one>
@ -235,3 +239,6 @@
vn-id="descriptor"
quicklinks="$ctrl.quicklinks">
</vn-item-descriptor-popover>
<vn-invoice-out-descriptor-popover
vn-id="invoice-out-descriptor">
</vn-invoice-out-descriptor-popover>

View File

@ -44,6 +44,12 @@ class Controller extends Section {
this.$.routeDescriptor.show();
}
showInvoiceOutDescriptor(event) {
this.$.invoiceOutDescriptor.invoiceOutId = this.summary.invoiceOut.id;
this.$.invoiceOutDescriptor.parent = event.target;
this.$.invoiceOutDescriptor.show();
}
showDescriptor(event, sale) {
this.quicklinks = {
btnThree: {