83 lines
3.0 KiB
HTML
83 lines
3.0 KiB
HTML
|
<vn-crud-model vn-id="model"
|
||
|
url="Suppliers/consumption"
|
||
|
link="{supplierFk: $ctrl.$params.id}"
|
||
|
limit="20"
|
||
|
user-params="::$ctrl.filterParams"
|
||
|
data="entries"
|
||
|
order="itemTypeFk, itemName, itemSize">
|
||
|
</vn-crud-model>
|
||
|
<vn-portal slot="topbar">
|
||
|
<vn-searchbar
|
||
|
panel="vn-supplier-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">
|
||
|
<vn-card class="vn-pa-lg vn-w-lg">
|
||
|
<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-tool-bar>
|
||
|
</section>
|
||
|
<vn-table model="model"
|
||
|
ng-repeat="entry in entries"
|
||
|
ng-if="entry.buys">
|
||
|
<vn-thead>
|
||
|
<vn-tr>
|
||
|
<vn-th field="entryFk">Entry </vn-th>
|
||
|
<vn-td >{{::entry.id}}</vn-td>
|
||
|
<vn-th field="data">Date</vn-th>
|
||
|
<vn-td>{{::entry.shipped | date: 'dd/MM/yyyy'}}</vn-td>
|
||
|
<vn-th field="ref">Reference</vn-th>
|
||
|
<vn-td >{{::entry.ref}}</vn-td>
|
||
|
</vn-tr>
|
||
|
</vn-thead>
|
||
|
<vn-tbody>
|
||
|
<vn-tr ng-repeat="buy in entry.buys">
|
||
|
<vn-td expand>
|
||
|
<span>
|
||
|
{{::buy.itemName}}
|
||
|
</span>
|
||
|
</vn-td>
|
||
|
<vn-td expand>
|
||
|
<vn-fetched-tags
|
||
|
max-length="6"
|
||
|
item="::buy">
|
||
|
</vn-fetched-tags>
|
||
|
</vn-td>
|
||
|
<vn-td number>{{::buy.quantity | dashIfEmpty}}</vn-td>
|
||
|
<vn-td number>{{::buy.price | dashIfEmpty}}</vn-td>
|
||
|
<vn-td number>{{::buy.total | dashIfEmpty}}</vn-td>
|
||
|
<vn-td></vn-td>
|
||
|
</vn-tr>
|
||
|
<vn-tr>
|
||
|
<vn-td>
|
||
|
<vn-label-value
|
||
|
label="Total entry"
|
||
|
value="{{$ctrl.getTotal(entry)}}">
|
||
|
</vn-label-value>
|
||
|
</vn-td>
|
||
|
</vn-tr>
|
||
|
</vn-tbody>
|
||
|
</vn-table>
|
||
|
</vn-card>
|
||
|
</vn-data-viewer>
|
||
|
<vn-confirm
|
||
|
vn-id="confirm"
|
||
|
question="Please, confirm"
|
||
|
message="The consumption report will be sent"
|
||
|
on-accept="$ctrl.sendEmail()">
|
||
|
</vn-confirm>
|