salix/modules/entry/front/buy/index/index.html

213 lines
8.7 KiB
HTML
Raw Normal View History

2021-04-28 08:32:24 +00:00
<vn-crud-model
auto-load="true"
vn-id="model"
url="Entries/{{$ctrl.$params.id}}/getBuys"
data="$ctrl.buys">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="$ctrl.buys">
</vn-watcher>
<div class="vn-w-xl">
<vn-card class="vn-pa-lg">
<vn-horizontal class="header">
<vn-tool-bar class="vn-mb-md">
<vn-button
disabled="$ctrl.selectedBuys() == 0"
ng-click="deleteBuys.show()"
vn-tooltip="Delete buy(s)"
icon="delete">
</vn-button>
</vn-tool-bar>
<vn-one class="taxes" ng-if="$ctrl.sales.length > 0">
<p><vn-label translate>Subtotal</vn-label> {{$ctrl.ticket.totalWithoutVat | currency: 'EUR':2}}</p>
<p><vn-label translate>VAT</vn-label> {{$ctrl.ticket.totalWithVat - $ctrl.ticket.totalWithoutVat | currency: 'EUR':2}}</p>
<p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.ticket.totalWithVat | currency: 'EUR':2}}</strong></p>
</vn-one>
</vn-horizontal>
<table class="vn-table">
<thead>
<tr>
<th shrink>
<vn-multi-check model="model" on-change="$ctrl.resetChanges()">
</vn-multi-check>
</th>
<th translate center>Item</th>
<th translate center>Quantity</th>
<th translate center>Package</th>
<th translate>Stickers</th>
<th translate>Weight</th>
<th translate>Packing</th>
<th translate>Grouping</th>
<th translate>Buying value</th>
<th translate expand>Grouping price</th>
<th translate expand>Packing price</th>
<th translate>Import</th>
</tr>
</thead>
<tbody ng-repeat="buy in $ctrl.buys">
<tr>
<td shrink>
<vn-check tabindex="-1" ng-model="buy.checked">
</vn-check>
</td>
<td shrink>
<span
ng-if="buy.id"
ng-click="itemDescriptor.show($event, buy.item.id)"
class="link">
{{::buy.item.id | zeroFill:6}}
</span>
<vn-autocomplete ng-if="!buy.id" class="dense"
vn-focus
url="Items"
ng-model="buy.itemFk"
show-field="name"
value-field="id"
search-function="$ctrl.itemSearchFunc($search)"
on-change="$ctrl.saveBuy(buy)"
order="id DESC"
tabindex="1">
<tpl-item>
{{::id}} - {{::name}}
</tpl-item>
</vn-autocomplete>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.quantity | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.quantity"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
2021-04-28 10:11:49 +00:00
<td center>
2021-04-28 08:32:24 +00:00
<vn-autocomplete
vn-one
2021-04-28 10:11:49 +00:00
title="{{::buy.packageFk | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
url="Packagings"
show-field="id"
value-field="id"
where="{isBox: true}"
ng-model="buy.packageFk"
on-change="$ctrl.saveBuy(buy)">
</vn-autocomplete>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.stickers | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.stickers"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.weight | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.weight"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.packing | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.packing"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.grouping | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.grouping"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.buyingValue | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.buyingValue"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.price2 | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.price2"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
<td>
<vn-input-number class="dense"
2021-04-28 10:11:49 +00:00
title="{{::buy.price3 | dashIfEmpty}}"
2021-04-28 08:32:24 +00:00
ng-model="buy.price3"
on-change="$ctrl.saveBuy(buy)">
</vn-input-number>
</td>
<td>
<span
ng-if="buy.quantity != null && buy.buyingValue != null"
title="{{buy.quantity * buy.buyingValue | currency: 'EUR':2}}">
{{buy.quantity * buy.buyingValue | currency: 'EUR':2}}
</span>
</td>
</tr>
<tr class="dark-row">
<td shrink>
</td>
<td shrink>
<span translate-attr="{title: 'Item type'}">
{{::buy.item.itemType.code}}
</span>
</td>
<td number shrink>
<span translate-attr="{title: 'Item size'}">
{{::buy.item.size}}
</span>
</td>
<td center>
<span translate-attr="{title: 'Minimum price'}">
{{::buy.item.minPrice | currency: 'EUR':2}}
</span>
</td>
<td vn-fetched-tags colspan="9">
<vn-one title="{{::buy.item.name}}">{{::buy.item.name}}</vn-one>
<vn-fetched-tags
max-length="6"
item="::buy.item"
tabindex="-1">
</vn-fetched-tags>
</td>
</tr>
</tbody>
</table>
<div>
<vn-icon-button
vn-one
vn-tooltip="Add buy"
vn-bind="+"
icon="add_circle"
ng-click="model.insert({})">
</vn-icon-button>
</div>
</vn-card>
</div>
2021-01-26 06:21:05 +00:00
<div fixed-bottom-right>
<vn-vertical style="align-items: center;">
2021-03-10 10:04:56 +00:00
<a ui-sref="entry.card.buy.import"
2021-04-28 08:32:24 +00:00
vn-bind="+">
2021-01-26 06:21:05 +00:00
<vn-button class="round md vn-mb-sm"
icon="publish"
vn-tooltip="Import buys"
tooltip-position="left">
</vn-button>
</a>
</vn-vertical>
2021-04-28 08:32:24 +00:00
</div>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
</vn-item-descriptor-popover>
<vn-confirm
vn-id="delete-buys"
question="You are going to delete buy(s) from this entry"
message="Continue anyway?"
on-accept="$ctrl.deleteBuys()">
</vn-confirm>