ticket module descriptor now takes warehouseFk from the ticket

This commit is contained in:
Carlos Jimenez Ruiz 2021-05-21 15:31:28 +02:00
parent 1bfe537186
commit 5c18c5c94c
10 changed files with 41 additions and 27 deletions

View File

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

View File

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

View File

@ -7,6 +7,12 @@
data="sales"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="tickets"
link="{id: $ctrl.$params.id}"
data="tickets"
auto-load="true">
</vn-crud-model>
<vn-vertical>
<vn-card
ng-if="!model.data || model.data.length == 0"
@ -25,7 +31,7 @@
</div>
<div class="description">
<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}}
</span>
</h3>
@ -63,5 +69,6 @@
<vn-pagination model="model"></vn-pagination>
</vn-vertical>
<vn-item-descriptor-popover
vn-id="descriptor">
</vn-item-descriptor-popover>
vn-id="item-descriptor"
warehouse-fk="tickets[0].warehouseFk">
</vn-item-descriptor-popover>

View File

@ -8,6 +8,12 @@
data="purchaseRequests"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="tickets"
link="{id: $ctrl.$params.id}"
data="tickets"
auto-load="true">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="purchaseRequests">
@ -24,7 +30,7 @@
<vn-th>Atender</vn-th>
<vn-th number>Quantity</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-tr>
</vn-thead>
@ -101,10 +107,11 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="tickets[0].warehouseFk">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
<a ui-sref="ticket.card.request.create"
vn-tooltip="New request"

View File

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

View File

@ -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);
}
}

View File

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

View File

@ -100,7 +100,7 @@
</vn-td>
<vn-td shrink>
<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}}
</span>
<vn-autocomplete ng-if="!sale.id" class="dense"
@ -190,7 +190,7 @@
fixed-bottom-right>
</vn-float-button>
<vn-item-descriptor-popover
vn-id="descriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover>

View File

@ -147,7 +147,7 @@
</vn-td>
<vn-td number shrink>
<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">
{{sale.itemFk | zeroFill:6}}
</span>
@ -259,7 +259,7 @@
<vn-td number>
<span
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">
{{request.sale.itemFk | zeroFill:6}}
</span>
@ -279,10 +279,10 @@
</vn-horizontal>
</vn-card>
<vn-route-descriptor-popover
vn-id="routeDescriptor">
vn-id="route-descriptor">
</vn-route-descriptor-popover>
<vn-item-descriptor-popover
vn-id="descriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover>

View File

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