2020-06-12 07:18:19 +00:00
|
|
|
<vn-crud-model vn-id="model"
|
|
|
|
url="Clients/consumption"
|
|
|
|
link="{clientFk: $ctrl.$params.id}"
|
|
|
|
filter="::$ctrl.filter"
|
|
|
|
user-params="::$ctrl.filterParams"
|
2020-06-10 11:35:41 +00:00
|
|
|
data="sales"
|
2020-06-12 07:18:19 +00:00
|
|
|
order="itemTypeFk, itemName, itemSize">
|
2020-06-10 11:35:41 +00:00
|
|
|
</vn-crud-model>
|
2020-06-12 07:18:19 +00:00
|
|
|
<vn-portal slot="topbar">
|
|
|
|
<vn-searchbar
|
|
|
|
panel="vn-consumption-search-panel"
|
|
|
|
suggested-filter="$ctrl.filterParams"
|
|
|
|
info="Search by item id or name"
|
|
|
|
model="model"
|
|
|
|
auto-state="false">
|
|
|
|
</vn-searchbar>
|
|
|
|
</vn-portal>
|
|
|
|
<vn-data-viewer model="model">
|
2020-06-10 11:35:41 +00:00
|
|
|
<vn-card class="vn-pa-lg vn-w-lg">
|
2020-06-12 07:18:19 +00:00
|
|
|
<section class="header">
|
|
|
|
<vn-tool-bar class="vn-mb-md">
|
|
|
|
<vn-button disabled="!model.userParams.from || !model.userParams.to"
|
|
|
|
icon="picture_as_pdf"
|
|
|
|
ng-click="$ctrl.showReport()"
|
|
|
|
vn-tooltip="Open as PDF">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button disabled="!model.userParams.from || !model.userParams.to"
|
|
|
|
icon="email"
|
|
|
|
ng-click="confirm.show()"
|
|
|
|
vn-tooltip="Send to email">
|
|
|
|
</vn-button>
|
|
|
|
<vn-check
|
|
|
|
label="Group by item"
|
|
|
|
on-change="$ctrl.changeGrouped(value)">
|
|
|
|
</vn-check>
|
|
|
|
</vn-tool-bar>
|
|
|
|
</section>
|
2020-06-10 11:35:41 +00:00
|
|
|
<vn-table model="model">
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
2020-06-12 07:18:19 +00:00
|
|
|
<vn-th field="itemFk" number>Item</vn-th>
|
|
|
|
<vn-th field="ticketFk" number>Ticket</vn-th>
|
|
|
|
<vn-th field="shipped">Fecha</vn-th>
|
|
|
|
<vn-th expand>Description</vn-th>
|
|
|
|
<vn-th field="quantity" number>Quantity</vn-th>
|
2020-06-10 11:35:41 +00:00
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
|
|
|
<vn-tr
|
2020-06-12 07:18:19 +00:00
|
|
|
ng-repeat="sale in sales">
|
2020-06-10 11:35:41 +00:00
|
|
|
<vn-td number>
|
2020-06-12 07:18:19 +00:00
|
|
|
<span
|
|
|
|
ng-click="itemDescriptor.show($event, sale.itemFk)"
|
|
|
|
class="link">
|
|
|
|
{{::sale.itemFk}}
|
2020-06-10 11:35:41 +00:00
|
|
|
</span>
|
|
|
|
</vn-td>
|
2020-06-12 07:18:19 +00:00
|
|
|
<vn-td number>
|
|
|
|
<span
|
|
|
|
ng-click="ticketDescriptor.show($event, sale.ticketFk)"
|
2020-06-10 11:35:41 +00:00
|
|
|
class="link">
|
2020-06-12 07:18:19 +00:00
|
|
|
{{::sale.ticketFk}}
|
2020-06-10 11:35:41 +00:00
|
|
|
</span>
|
|
|
|
</vn-td>
|
2020-06-12 07:18:19 +00:00
|
|
|
<vn-td>{{::sale.shipped | date: 'dd/MM/yyyy'}}</vn-td>
|
|
|
|
<vn-td expand>
|
|
|
|
<vn-fetched-tags
|
|
|
|
max-length="6"
|
|
|
|
item="::sale"
|
|
|
|
name="::sale.concept"
|
|
|
|
sub-name="::sale.subName">
|
|
|
|
</vn-fetched-tags>
|
2020-06-10 11:35:41 +00:00
|
|
|
</vn-td>
|
2020-06-12 07:18:19 +00:00
|
|
|
<vn-td number>{{::sale.quantity | dashIfEmpty}}</vn-td>
|
2020-06-10 11:35:41 +00:00
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
</vn-table>
|
|
|
|
</vn-card>
|
2020-06-12 07:18:19 +00:00
|
|
|
</vn-data-viewer>
|
|
|
|
<vn-item-descriptor-popover
|
|
|
|
vn-id="item-descriptor">
|
|
|
|
</vn-item-descriptor-popover>
|
2020-06-10 11:35:41 +00:00
|
|
|
<vn-ticket-descriptor-popover
|
|
|
|
vn-id="ticket-descriptor">
|
|
|
|
</vn-ticket-descriptor-popover>
|
2020-06-12 07:18:19 +00:00
|
|
|
<vn-confirm
|
|
|
|
vn-id="confirm"
|
|
|
|
question="Please, confirm"
|
|
|
|
message="The consumption report will be sent"
|
|
|
|
on-accept="$ctrl.sendEmail()">
|
|
|
|
</vn-confirm>
|