salix/modules/supplier/front/consumption/index.html

90 lines
3.3 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" expand>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 vn-tooltip="{{::entry.ref}}">{{::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 vn-fetched-tags wide>
<vn-one></vn-one>
<vn-one ng-if="::buy.subName">
<h3 title="{{::buy.subName}}">{{::buy.subName}}</h3>
</vn-one>
<vn-fetched-tags
max-length="6"
item="::buy"
tabindex="-1">
</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-tbody>
<vn-tfoot>
<vn-tr>
<vn-td>
<vn-label-value
label="Total entry"
value="{{$ctrl.getTotal(entry)}}">
</vn-label-value>
</vn-td>
</vn-tr>
</vn-tfoot>
</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>