2020-12-16 07:05:41 +00:00
|
|
|
<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>
|
2020-12-18 09:08:51 +00:00
|
|
|
<vn-th field="entryFk" expand>Entry </vn-th>
|
|
|
|
<vn-td expand>{{::entry.id}}</vn-td>
|
2020-12-16 07:05:41 +00:00
|
|
|
<vn-th field="data">Date</vn-th>
|
|
|
|
<vn-td>{{::entry.shipped | date: 'dd/MM/yyyy'}}</vn-td>
|
|
|
|
<vn-th field="ref">Reference</vn-th>
|
2020-12-18 09:08:51 +00:00
|
|
|
<vn-td vn-tooltip="{{::entry.ref}}">{{::entry.ref}}</vn-td>
|
2020-12-16 07:05:41 +00:00
|
|
|
</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>
|
2020-12-18 09:08:51 +00:00
|
|
|
</vn-tbody>
|
|
|
|
<vn-tfoot>
|
2020-12-16 07:05:41 +00:00
|
|
|
<vn-tr>
|
|
|
|
<vn-td>
|
|
|
|
<vn-label-value
|
|
|
|
label="Total entry"
|
|
|
|
value="{{$ctrl.getTotal(entry)}}">
|
|
|
|
</vn-label-value>
|
|
|
|
</vn-td>
|
2020-12-18 09:08:51 +00:00
|
|
|
</vn-tr>
|
|
|
|
</vn-tfoot>
|
2020-12-16 07:05:41 +00:00
|
|
|
</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>
|