2021-01-18 13:16:39 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
|
|
|
url="FixedPrices/filter"
|
2023-03-30 12:29:19 +00:00
|
|
|
user-params="::$ctrl.filterParams"
|
2021-01-18 13:16:39 +00:00
|
|
|
limit="20"
|
2021-01-19 19:56:33 +00:00
|
|
|
data="prices"
|
2022-03-16 13:58:07 +00:00
|
|
|
order="itemFk"
|
|
|
|
auto-load="false">
|
2021-01-18 13:16:39 +00:00
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
url="Warehouses"
|
|
|
|
data="warehouses"
|
|
|
|
order="name">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-portal slot="topbar">
|
|
|
|
</vn-portal>
|
2023-03-27 07:11:29 +00:00
|
|
|
<vn-fixed-price-search-panel
|
|
|
|
model="model">
|
|
|
|
</vn-fixed-price-search-panel>
|
2022-03-15 14:18:27 +00:00
|
|
|
<div class="vn-w-xl">
|
2021-01-18 13:16:39 +00:00
|
|
|
<vn-card>
|
2022-11-02 08:40:09 +00:00
|
|
|
<smart-table
|
2021-11-16 06:45:15 +00:00
|
|
|
model="model"
|
2022-11-02 08:40:09 +00:00
|
|
|
options="$ctrl.smartTableOptions"
|
2022-03-16 13:58:07 +00:00
|
|
|
expr-builder="$ctrl.exprBuilder(param, value)">
|
|
|
|
<slot-table>
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-03-28 12:59:08 +00:00
|
|
|
<th shrink>
|
|
|
|
<vn-multi-check
|
|
|
|
model="model"
|
|
|
|
checked="$ctrl.checkAll"
|
|
|
|
check-field="checked"
|
|
|
|
check-dummy-enabled="true"
|
|
|
|
checked-dummy-count="$ctrl.checkedDummyCount">
|
|
|
|
</vn-multi-check>
|
|
|
|
</th>
|
2022-03-16 13:58:07 +00:00
|
|
|
<th field="itemFk">
|
|
|
|
<span translate>Item ID</span>
|
|
|
|
</th>
|
2022-11-02 08:40:09 +00:00
|
|
|
<th field="name">
|
2022-03-16 13:58:07 +00:00
|
|
|
<span translate>Description</span>
|
|
|
|
</th>
|
2022-11-02 08:40:09 +00:00
|
|
|
<th
|
2022-12-19 13:39:38 +00:00
|
|
|
field="rate2">
|
|
|
|
<span translate>Grouping price</span>
|
2022-03-16 13:58:07 +00:00
|
|
|
</th>
|
2022-11-02 08:40:09 +00:00
|
|
|
<th
|
2022-12-19 13:39:38 +00:00
|
|
|
field="rate3">
|
|
|
|
<span translate>Packing price</span>
|
2022-03-16 13:58:07 +00:00
|
|
|
</th>
|
|
|
|
<th field="minPrice">
|
|
|
|
<span translate>Min price</span>
|
|
|
|
</th>
|
|
|
|
<th field="started">
|
|
|
|
<span translate>Started</span>
|
|
|
|
</th>
|
|
|
|
<th field="ended">
|
|
|
|
<span translate>Ended</span>
|
|
|
|
</th>
|
2023-03-28 12:59:08 +00:00
|
|
|
<th field="warehouseFk">
|
|
|
|
<span translate>Warehouse</span>
|
|
|
|
</th>
|
2022-03-16 13:58:07 +00:00
|
|
|
<th shrink></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr ng-repeat="price in prices">
|
2023-03-28 12:59:08 +00:00
|
|
|
<td>
|
|
|
|
<vn-check
|
|
|
|
ng-model="price.checked"
|
|
|
|
on-change="$ctrl.saveChecked(price.id)"
|
|
|
|
vn-click-stop>
|
|
|
|
</vn-check>
|
|
|
|
</td>
|
2022-03-18 09:30:30 +00:00
|
|
|
<td shrink-field>
|
2022-03-16 13:58:07 +00:00
|
|
|
<vn-autocomplete
|
2023-03-28 08:30:02 +00:00
|
|
|
vn-id="itemFk"
|
2022-03-16 13:58:07 +00:00
|
|
|
class="dense"
|
|
|
|
url="Items/withName"
|
|
|
|
ng-model="price.itemFk"
|
2023-05-05 06:12:38 +00:00
|
|
|
fields="['name']"
|
2023-05-04 08:00:21 +00:00
|
|
|
show-field="id"
|
2022-03-16 13:58:07 +00:00
|
|
|
value-field="id"
|
|
|
|
search-function="$ctrl.itemSearchFunc($search)"
|
2023-07-18 13:01:58 +00:00
|
|
|
ng-change="$ctrl.upsertPrice(price, true)"
|
2022-03-16 13:58:07 +00:00
|
|
|
order="id DESC"
|
|
|
|
tabindex="1">
|
|
|
|
<tpl-item>
|
2022-03-18 09:30:30 +00:00
|
|
|
<div>{{id}}</div>
|
|
|
|
<div class="text-caption text-secondary">
|
|
|
|
{{name}}
|
|
|
|
</div>
|
2022-03-16 13:58:07 +00:00
|
|
|
</tpl-item>
|
|
|
|
</vn-autocomplete>
|
|
|
|
</td>
|
|
|
|
<td vn-fetched-tags>
|
|
|
|
<div>
|
|
|
|
<span
|
|
|
|
vn-one
|
|
|
|
ng-if="price.itemFk"
|
|
|
|
ng-click="itemDescriptor.show($event, price.itemFk)"
|
|
|
|
class="link">
|
2023-03-28 08:30:02 +00:00
|
|
|
{{itemFk.selection.name}}
|
2022-03-16 13:58:07 +00:00
|
|
|
</span>
|
|
|
|
<vn-one ng-if="price.subName">
|
|
|
|
<h3 title="{{price.subName}}">{{price.subName}}</h3>
|
|
|
|
</vn-one>
|
|
|
|
</div>
|
|
|
|
<vn-fetched-tags
|
|
|
|
max-length="6"
|
|
|
|
item="price"
|
|
|
|
tabindex="-1">
|
|
|
|
</vn-fetched-tags>
|
|
|
|
</td>
|
2022-03-18 09:30:30 +00:00
|
|
|
<td shrink-field>
|
2022-12-19 13:39:38 +00:00
|
|
|
<vn-td-editable number>
|
2023-03-28 12:59:08 +00:00
|
|
|
<text>
|
|
|
|
<strong>{{price.rate2 | currency: 'EUR':2}}</strong>
|
|
|
|
</text>
|
2022-12-19 13:39:38 +00:00
|
|
|
<field>
|
|
|
|
<vn-input-number
|
|
|
|
class="dense"
|
|
|
|
vn-focus
|
|
|
|
ng-model="price.rate2"
|
|
|
|
on-change="$ctrl.upsertPrice(price)"
|
|
|
|
step="0.01">
|
|
|
|
</vn-input-number>
|
|
|
|
</field>
|
|
|
|
</vn-td-editable>
|
2022-03-16 13:58:07 +00:00
|
|
|
</td>
|
2022-03-18 09:30:30 +00:00
|
|
|
<td shrink-field>
|
2022-12-19 13:39:38 +00:00
|
|
|
<vn-td-editable number>
|
2023-03-28 12:59:08 +00:00
|
|
|
<text>
|
|
|
|
<strong>{{price.rate3 | currency: 'EUR':2}}</strong>
|
|
|
|
</text>
|
2022-12-19 13:39:38 +00:00
|
|
|
<field>
|
|
|
|
<vn-input-number
|
|
|
|
class="dense"
|
|
|
|
vn-focus
|
|
|
|
ng-model="price.rate3"
|
2023-01-31 10:17:31 +00:00
|
|
|
on-change="$ctrl.upsertPrice(price);"
|
2022-12-19 13:39:38 +00:00
|
|
|
step="0.01"s>
|
|
|
|
</vn-input-number>
|
|
|
|
</field>
|
|
|
|
</vn-td-editable>
|
2022-03-16 13:58:07 +00:00
|
|
|
</td>
|
2022-03-18 09:30:30 +00:00
|
|
|
<td shrink-field-expand class="minPrice">
|
2022-03-16 13:58:07 +00:00
|
|
|
<vn-check
|
|
|
|
vn-one
|
2023-03-28 07:41:39 +00:00
|
|
|
ng-model="price.hasMinPrice"
|
|
|
|
on-change="$ctrl.upsertPrice(price)">
|
2022-03-16 13:58:07 +00:00
|
|
|
</vn-check>
|
|
|
|
<vn-input-number
|
2023-03-28 12:59:08 +00:00
|
|
|
ng-class="{inactive: !price.hasMinPrice}"
|
2022-03-16 13:58:07 +00:00
|
|
|
ng-model="price.minPrice"
|
|
|
|
on-change="$ctrl.upsertPrice(price)"
|
|
|
|
step="0.01">
|
|
|
|
</vn-input-number>
|
|
|
|
</td>
|
2022-03-18 09:30:30 +00:00
|
|
|
<td shrink-date>
|
2023-03-28 12:40:14 +00:00
|
|
|
<vn-chip class="chip {{$ctrl.isBigger(price.started)}} transparent">
|
|
|
|
<vn-date-picker
|
|
|
|
vn-one
|
|
|
|
ng-model="price.started"
|
|
|
|
on-change="$ctrl.upsertPrice(price)">
|
|
|
|
</vn-date-picker>
|
|
|
|
</vn-chip>
|
2022-03-16 13:58:07 +00:00
|
|
|
</td>
|
2022-03-18 09:30:30 +00:00
|
|
|
<td shrink-date>
|
2023-03-28 12:40:14 +00:00
|
|
|
<vn-chip class="chip {{$ctrl.isLower(price.ended)}} transparent">
|
|
|
|
<vn-date-picker
|
|
|
|
vn-one
|
|
|
|
ng-model="price.ended"
|
|
|
|
on-change="$ctrl.upsertPrice(price)">
|
|
|
|
</vn-date-picker>
|
|
|
|
</vn-chip>
|
2022-03-16 13:58:07 +00:00
|
|
|
</td>
|
2023-03-28 12:59:08 +00:00
|
|
|
<td expand>
|
|
|
|
<vn-autocomplete
|
2022-03-16 13:58:07 +00:00
|
|
|
vn-one
|
2023-03-28 12:59:08 +00:00
|
|
|
ng-model="price.warehouseFk"
|
|
|
|
data="warehouses"
|
|
|
|
on-change="$ctrl.upsertPrice(price)"
|
|
|
|
tabindex="2">
|
|
|
|
</vn-autocomplete>
|
2022-03-16 13:58:07 +00:00
|
|
|
</td>
|
|
|
|
<td shrink>
|
|
|
|
<vn-icon-button
|
|
|
|
icon="delete"
|
|
|
|
vn-tooltip="Delete"
|
|
|
|
ng-click="deleteFixedPrice.show({$index})">
|
|
|
|
</vn-icon-button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div class="vn-pa-md">
|
|
|
|
<vn-icon-button
|
|
|
|
vn-tooltip="Add fixed price"
|
|
|
|
icon="add_circle"
|
|
|
|
vn-bind="+"
|
|
|
|
ng-click="$ctrl.add()">
|
|
|
|
</vn-icon-button>
|
|
|
|
</div>
|
|
|
|
</slot-table>
|
2022-11-02 08:40:09 +00:00
|
|
|
</smart-table>
|
2021-01-18 13:16:39 +00:00
|
|
|
</vn-card>
|
|
|
|
</div>
|
2023-03-28 12:59:08 +00:00
|
|
|
|
|
|
|
<div fixed-bottom-right>
|
|
|
|
<vn-vertical style="align-items: center;">
|
|
|
|
<vn-button class="round sm vn-mb-sm"
|
|
|
|
icon="edit"
|
|
|
|
ng-show="$ctrl.totalChecked > 0"
|
|
|
|
ng-click="edit.show($event)"
|
|
|
|
vn-tooltip="Edit fixed price(s)"
|
|
|
|
tooltip-position="left">
|
|
|
|
</vn-button>
|
|
|
|
</vn-vertical>
|
|
|
|
</div>
|
|
|
|
<vn-dialog class="edit"
|
|
|
|
vn-id="edit"
|
|
|
|
on-accept="$ctrl.onEditAccept()"
|
|
|
|
on-close="$ctrl.editedColumn = null">
|
|
|
|
<tpl-body style="width: 400px;">
|
|
|
|
<span translate>Edit</span>
|
|
|
|
<span class="countLines">
|
|
|
|
{{::$ctrl.totalChecked}}
|
|
|
|
</span>
|
|
|
|
<span translate>buy(s)</span>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-autocomplete
|
|
|
|
vn-one
|
|
|
|
ng-model="$ctrl.editedColumn.field"
|
|
|
|
data="$ctrl.columns"
|
|
|
|
value-field="field"
|
|
|
|
show-field="displayName"
|
|
|
|
label="Field to edit">
|
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-input-number
|
|
|
|
vn-one
|
|
|
|
ng-if="$ctrl.editedColumn.field == 'rate2' || $ctrl.editedColumn.field == 'rate3' || $ctrl.editedColumn.field == 'minPrice'"
|
|
|
|
label="Value"
|
|
|
|
ng-model="$ctrl.editedColumn.newValue">
|
|
|
|
</vn-input-number>
|
|
|
|
<vn-check
|
|
|
|
vn-one
|
|
|
|
ng-if="$ctrl.editedColumn.field == 'hasMinPrice'"
|
|
|
|
ng-model="$ctrl.editedColumn.newValue">
|
|
|
|
</vn-check>
|
|
|
|
<vn-date-picker
|
|
|
|
vn-one
|
|
|
|
ng-if="$ctrl.editedColumn.field == 'started' || $ctrl.editedColumn.field == 'ended'"
|
|
|
|
label="Date"
|
|
|
|
ng-model="$ctrl.editedColumn.newValue">
|
|
|
|
</vn-date-picker>
|
|
|
|
<vn-autocomplete
|
|
|
|
vn-one
|
|
|
|
ng-if="$ctrl.editedColumn.field == 'warehouseFk'"
|
|
|
|
label="Warehouse"
|
|
|
|
ng-model="$ctrl.editedColumn.newValue"
|
|
|
|
data="warehouses">
|
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
</tpl-body>
|
|
|
|
<tpl-buttons>
|
|
|
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="accept" translate>Save</button>
|
|
|
|
</tpl-buttons>
|
|
|
|
</vn-dialog>
|
|
|
|
|
2021-01-18 13:16:39 +00:00
|
|
|
<vn-item-descriptor-popover
|
2021-05-21 13:31:05 +00:00
|
|
|
vn-id="item-descriptor"
|
|
|
|
warehouse-fk="$ctrl.vnConfig.warehouseFk">
|
2021-11-16 07:41:27 +00:00
|
|
|
</vn-item-descriptor-popover>
|
|
|
|
<vn-confirm
|
|
|
|
vn-id="deleteFixedPrice"
|
|
|
|
on-accept="$ctrl.removePrice($data.$index)"
|
|
|
|
question="Are you sure you want to continue?"
|
|
|
|
message="This row will be removed">
|
2022-11-02 08:40:09 +00:00
|
|
|
</vn-confirm>
|