159 lines
6.2 KiB
HTML
159 lines
6.2 KiB
HTML
<vn-crud-model
|
|
vn-id="model"
|
|
url="FixedPrices/filter"
|
|
limit="20"
|
|
data="prices"
|
|
auto-load="true"
|
|
order="itemFk">
|
|
</vn-crud-model>
|
|
<vn-crud-model
|
|
auto-load="true"
|
|
url="Warehouses"
|
|
data="warehouses"
|
|
order="name">
|
|
</vn-crud-model>
|
|
<vn-portal slot="topbar">
|
|
<vn-searchbar
|
|
auto-state="false"
|
|
panel="vn-fixed-price-search-panel"
|
|
info="Search prices by item ID or code"
|
|
placeholder="Search fixed prices"
|
|
filter="{}"
|
|
model="model">
|
|
</vn-searchbar>
|
|
</vn-portal>
|
|
<div class="vn-w-xl">
|
|
<vn-card>
|
|
<vn-table model="model">
|
|
<vn-thead>
|
|
<vn-tr>
|
|
<vn-th field="itemFk">Item ID</vn-th>
|
|
<vn-th field="itemFk">Item</vn-th>
|
|
<vn-th field="warehouseFk">Warehouse</vn-th>
|
|
<vn-th field="rate2">P.P.U.</vn-th>
|
|
<vn-th field="rate3">P.P.P.</vn-th>
|
|
<vn-th field="minPrice">Min price</vn-th>
|
|
<vn-th field="started" style="width: 90px">Started</vn-th>
|
|
<vn-th field="ended" style="width: 90px">Ended</vn-th>
|
|
<vn-th shrink></vn-th>
|
|
</vn-tr>
|
|
</vn-thead>
|
|
<vn-tbody>
|
|
<vn-tr ng-repeat="price in prices">
|
|
<vn-td>
|
|
<span
|
|
ng-if="price.itemFk"
|
|
ng-click="itemDescriptor.show($event, price.itemFk)"
|
|
class="link">
|
|
{{price.itemFk}}
|
|
</span>
|
|
<vn-autocomplete
|
|
class="dense"
|
|
ng-if="!price.itemFk"
|
|
vn-focus
|
|
url="Items"
|
|
ng-model="price.itemFk"
|
|
show-field="name"
|
|
value-field="id"
|
|
search-function="$ctrl.itemSearchFunc($search)"
|
|
on-change="$ctrl.upsertPrice(price)"
|
|
order="id DESC"
|
|
tabindex="1">
|
|
<tpl-item>
|
|
{{::id}} - {{::name}}
|
|
</tpl-item>
|
|
</vn-autocomplete>
|
|
</vn-td>
|
|
<vn-td expand>
|
|
<text>
|
|
<vn-fetched-tags
|
|
max-length="6"
|
|
item="price"
|
|
name="price.name"
|
|
sub-name="price.subName"
|
|
tabindex="-1">
|
|
</vn-fetched-tags>
|
|
</text>
|
|
</vn-td>
|
|
<vn-td>
|
|
<vn-autocomplete
|
|
vn-one
|
|
label="Warehouse"
|
|
ng-model="price.warehouseFk"
|
|
url="Warehouses"
|
|
on-change="$ctrl.upsertPrice(price)"
|
|
tabindex="2">
|
|
</vn-autocomplete>
|
|
</vn-td>
|
|
<vn-td-editable number>
|
|
<text>{{price.rate2 | currency: 'EUR':2}}</text>
|
|
<field>
|
|
<vn-input-number
|
|
class="dense"
|
|
vn-focus
|
|
ng-model="price.rate2"
|
|
on-change="$ctrl.upsertPrice(price)">
|
|
</vn-input-number>
|
|
</field>
|
|
</vn-td-editable>
|
|
<vn-td-editable number>
|
|
<text>{{price.rate3 | currency: 'EUR':2}}</text>
|
|
<field>
|
|
<vn-input-number
|
|
class="dense"
|
|
vn-focus
|
|
ng-model="price.rate3"
|
|
on-change="$ctrl.upsertPrice(price)">
|
|
</vn-input-number>
|
|
</field>
|
|
</vn-td-editable>
|
|
<vn-td-editable number>
|
|
<text>{{(price.hasMinPrice ? (price.minPrice | currency: 'EUR':2) : "-")}}</text>
|
|
<field>
|
|
<vn-input-number
|
|
class="dense"
|
|
vn-focus
|
|
ng-model="price.minPrice"
|
|
on-change="$ctrl.upsertPrice(price)">
|
|
</vn-input-number>
|
|
</field>
|
|
</vn-td-editable>
|
|
<vn-td>
|
|
<vn-date-picker
|
|
vn-one
|
|
label="Started"
|
|
ng-model="price.started"
|
|
on-change="$ctrl.upsertPrice(price)">
|
|
</vn-date-picker>
|
|
</vn-td>
|
|
<vn-td>
|
|
<vn-date-picker
|
|
vn-one
|
|
label="Ended"
|
|
ng-model="price.ended"
|
|
on-change="$ctrl.upsertPrice(price)">
|
|
</vn-date-picker>
|
|
</vn-td>
|
|
<vn-td shrink>
|
|
<vn-icon-button
|
|
icon="delete"
|
|
vn-tooltip="Delete"
|
|
ng-click="$ctrl.removePrice($index)">
|
|
</vn-icon-button>
|
|
</vn-td>
|
|
</vn-tr>
|
|
</vn-tbody>
|
|
</vn-table>
|
|
<div class="vn-pa-md">
|
|
<vn-icon-button
|
|
vn-tooltip="Add fixed price"
|
|
icon="add_circle"
|
|
vn-bind="+"
|
|
ng-click="model.insert()">
|
|
</vn-icon-button>
|
|
</div>
|
|
</vn-card>
|
|
</div>
|
|
<vn-item-descriptor-popover
|
|
vn-id="itemDescriptor">
|
|
</vn-item-descriptor-popover> |