2021-04-28 08:32:24 +00:00
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
vn-id="model"
|
|
|
|
url="Entries/{{$ctrl.$params.id}}/getBuys"
|
2021-07-02 11:10:46 +00:00
|
|
|
data="$ctrl.buys"
|
2021-07-02 11:22:37 +00:00
|
|
|
limit="20">
|
2021-04-28 08:32:24 +00:00
|
|
|
</vn-crud-model>
|
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
|
|
|
data="$ctrl.buys">
|
|
|
|
</vn-watcher>
|
2021-07-02 11:10:46 +00:00
|
|
|
<vn-data-viewer
|
|
|
|
model="model"
|
|
|
|
class="vn-w-xl">
|
2021-04-28 08:32:24 +00:00
|
|
|
<vn-card class="vn-pa-lg">
|
2021-06-14 13:52:46 +00:00
|
|
|
<div class="tableWrapper">
|
|
|
|
<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"
|
|
|
|
title="{{::buy.quantity | dashIfEmpty}}"
|
|
|
|
ng-model="buy.quantity"
|
|
|
|
on-change="$ctrl.saveBuy(buy)">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
|
|
|
<td center>
|
|
|
|
<vn-autocomplete
|
|
|
|
vn-one
|
|
|
|
title="{{::buy.packageFk | dashIfEmpty}}"
|
|
|
|
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"
|
|
|
|
title="{{::buy.stickers | dashIfEmpty}}"
|
|
|
|
ng-model="buy.stickers"
|
|
|
|
on-change="$ctrl.saveBuy(buy)">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<vn-input-number class="dense"
|
|
|
|
title="{{::buy.weight | dashIfEmpty}}"
|
|
|
|
ng-model="buy.weight"
|
|
|
|
on-change="$ctrl.saveBuy(buy)">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<vn-input-number class="dense"
|
|
|
|
title="{{::buy.packing | dashIfEmpty}}"
|
|
|
|
ng-model="buy.packing"
|
|
|
|
on-change="$ctrl.saveBuy(buy)">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<vn-input-number class="dense"
|
|
|
|
title="{{::buy.grouping | dashIfEmpty}}"
|
|
|
|
ng-model="buy.grouping"
|
|
|
|
on-change="$ctrl.saveBuy(buy)">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<vn-input-number class="dense"
|
|
|
|
title="{{::buy.buyingValue | dashIfEmpty}}"
|
|
|
|
ng-model="buy.buyingValue"
|
|
|
|
on-change="$ctrl.saveBuy(buy)">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<vn-input-number class="dense"
|
|
|
|
title="{{::buy.price2 | dashIfEmpty}}"
|
|
|
|
ng-model="buy.price2"
|
|
|
|
on-change="$ctrl.saveBuy(buy)">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<vn-input-number class="dense"
|
|
|
|
title="{{::buy.price3 | dashIfEmpty}}"
|
|
|
|
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="8">
|
|
|
|
<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>
|
2021-06-14 14:09:28 +00:00
|
|
|
<tr><td></td></tr>
|
2021-06-14 13:52:46 +00:00
|
|
|
</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>
|
2021-04-28 08:32:24 +00:00
|
|
|
</div>
|
|
|
|
</vn-card>
|
2021-07-02 11:10:46 +00:00
|
|
|
</vn-data-viewer>
|
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
|
2021-05-21 13:31:05 +00:00
|
|
|
vn-id="item-descriptor"
|
|
|
|
warehouse-fk="$ctrl.vnConfig.warehouseFk">
|
2021-04-28 08:32:24 +00:00
|
|
|
</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>
|