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

244 lines
11 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"
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">
2023-05-05 06:12:38 +00:00
<vn-button
2021-06-14 13:52:46 +00:00
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>
2023-05-05 06:12:38 +00:00
<span
2021-06-14 13:52:46 +00:00
ng-if="buy.id"
ng-click="itemDescriptor.show($event, buy.item.id)"
class="link">
{{::buy.item.id}}
2021-06-14 13:52:46 +00:00
</span>
<vn-autocomplete ng-if="!buy.id" class="dense"
vn-focus
url="Items/withName"
2021-06-14 13:52:46 +00:00
ng-model="buy.itemFk"
2023-05-05 06:12:38 +00:00
show-field="id"
2021-06-14 13:52:46 +00:00
value-field="id"
search-function="$ctrl.itemSearchFunc($search)"
on-change="$ctrl.saveBuy(buy)"
order="id DESC"
tabindex="1">
<tpl-item>
2023-05-05 06:12:38 +00:00
<div>{{::name}}</div>
<div class="text-secondary text-caption">#{{::id}}</div>
2021-06-14 13:52:46 +00:00
</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
2023-09-22 08:59:48 +00:00
title="{{::buy.packagingFk | dashIfEmpty}}"
2021-06-14 13:52:46 +00:00
url="Packagings"
show-field="id"
value-field="id"
where="{freightItemFk: true}"
2023-09-22 08:59:48 +00:00
ng-model="buy.packagingFk"
2021-06-14 13:52:46 +00:00
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
2021-06-14 13:52:46 +00:00
title="{{::buy.packing | dashIfEmpty}}"
ng-model="buy.packing"
on-change="$ctrl.saveBuy(buy)">
<append>
<vn-icon
pointer
ng-show="buy.groupingMode == '2'"
ng-click="$ctrl.toggleGroupingMode(buy, 'packing')"
icon="lock">
</vn-icon>
<vn-icon
pointer
ng-show="buy.groupingMode != '2'"
ng-click="$ctrl.toggleGroupingMode(buy, 'packing')"
icon="lock_open">
</vn-icon>
</append>
2021-06-14 13:52:46 +00:00
</vn-input-number>
</td>
<td>
<vn-input-number
2021-06-14 13:52:46 +00:00
title="{{::buy.grouping | dashIfEmpty}}"
ng-model="buy.grouping"
on-change="$ctrl.saveBuy(buy)">
<append>
<vn-icon
pointer
ng-show="buy.groupingMode == '1'"
ng-click="$ctrl.toggleGroupingMode(buy, 'grouping')"
icon="lock">
</vn-icon>
<vn-icon
pointer
ng-show="buy.groupingMode != '1'"
ng-click="$ctrl.toggleGroupingMode(buy, 'grouping')"
icon="lock_open">
</vn-icon>
</append>
2021-06-14 13:52:46 +00:00
</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>
2023-05-05 06:12:38 +00:00
<span
2021-06-14 13:52:46 +00:00
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">
<div>
<vn-one title="{{::buy.item.concept}}">{{::buy.item.name}}</vn-one>
<vn-one ng-if="::buy.item.subName">
<h3 title="{{::buy.item.subName}}">{{::buy.item.subName}}</h3>
</vn-one>
</div>
2021-06-14 13:52:46 +00:00
<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>
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-11-15 17:24:01 +00:00
<a ui-sref="entry.card.buy.import" >
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="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()">
2023-05-05 06:12:38 +00:00
</vn-confirm>