2022-12-27 06:48:09 +00:00
|
|
|
<mg-ajax
|
|
|
|
path="Items/{{patch.params.id}}"
|
|
|
|
options="vnPatch"
|
2019-12-13 10:59:25 +00:00
|
|
|
override="{filter: {include: [{relation: 'itemType'}, {relation: 'origin'}, {relation: 'ink'}, {relation: 'producer'}, {relation: 'expense'}]}}">
|
2017-12-21 13:09:55 +00:00
|
|
|
</mg-ajax>
|
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
|
|
|
data="$ctrl.item"
|
|
|
|
form="form"
|
|
|
|
save="patch">
|
|
|
|
</vn-watcher>
|
2020-09-17 18:12:52 +00:00
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
url="Origins"
|
|
|
|
data="originsData"
|
|
|
|
order="name"
|
|
|
|
vn-id="origin-model">
|
|
|
|
</vn-crud-model>
|
2019-11-10 10:08:44 +00:00
|
|
|
<form name="form" ng-submit="watcher.submit()" ng-cloak class="vn-w-md">
|
2019-10-04 22:16:57 +00:00
|
|
|
<vn-card class="vn-pa-lg">
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-horizontal>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-textfield
|
|
|
|
label="Name"
|
|
|
|
ng-model="$ctrl.item.name"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="name"
|
2019-10-09 22:47:29 +00:00
|
|
|
rule
|
|
|
|
vn-focus>
|
|
|
|
</vn-textfield>
|
2022-12-27 06:48:09 +00:00
|
|
|
<vn-textfield
|
2023-05-05 06:12:38 +00:00
|
|
|
label="Full name"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.item.longName"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="longName"
|
2019-10-09 22:47:29 +00:00
|
|
|
rule
|
2018-10-15 11:20:55 +00:00
|
|
|
info="Full name calculates based on tags 1-3. Is not recommended to change it manually">
|
|
|
|
</vn-textfield>
|
2023-10-11 06:28:52 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2023-05-05 06:12:38 +00:00
|
|
|
<vn-autocomplete
|
2019-10-24 22:53:53 +00:00
|
|
|
url="ItemTypes"
|
2018-03-01 22:38:14 +00:00
|
|
|
label="Type"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.item.typeFk"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="type"
|
2019-12-26 10:27:44 +00:00
|
|
|
initial-data="$ctrl.item.itemType"
|
|
|
|
fields="['categoryFk']"
|
|
|
|
include="'category'">
|
|
|
|
<tpl-item>
|
2023-05-05 06:12:38 +00:00
|
|
|
<div>{{::name}}</div>
|
2019-12-26 10:27:44 +00:00
|
|
|
<div class="text-caption text-secondary">
|
2023-05-05 06:12:38 +00:00
|
|
|
{{::category.name}}
|
2019-12-26 10:27:44 +00:00
|
|
|
</div>
|
|
|
|
</tpl-item>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-autocomplete>
|
2023-10-11 06:28:52 +00:00
|
|
|
<vn-autocomplete
|
|
|
|
label="Generic"
|
|
|
|
url="Items/withName"
|
|
|
|
ng-model="$ctrl.item.genericFk"
|
|
|
|
vn-name="generic"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
|
|
|
search-function="$ctrl.itemSearchFunc($search)"
|
|
|
|
order="id DESC"
|
|
|
|
tabindex="1">
|
|
|
|
<tpl-item>
|
|
|
|
<div>{{::name}}</div>
|
|
|
|
<div class="text-caption text-secondary">
|
|
|
|
#{{::id}}
|
|
|
|
</div>
|
|
|
|
</tpl-item>
|
|
|
|
<append>
|
|
|
|
<vn-icon-button
|
|
|
|
icon="filter_alt"
|
|
|
|
vn-click-stop="$ctrl.showFilterDialog($ctrl.item)"
|
|
|
|
vn-tooltip="Filter...">
|
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
|
|
|
</vn-autocomplete>
|
2018-12-17 13:15:39 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2023-05-05 06:12:38 +00:00
|
|
|
<vn-autocomplete
|
2019-10-24 22:53:53 +00:00
|
|
|
url="Intrastats"
|
2018-03-01 22:38:14 +00:00
|
|
|
label="Intrastat"
|
|
|
|
show-field="description"
|
|
|
|
value-field="id"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.item.intrastatFk"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="intrastat"
|
2019-01-28 09:04:08 +00:00
|
|
|
search-function="{or: [{id: {like: $search +'%'}}, {description: {like: '%'+ $search +'%'}}]}"
|
2018-03-01 22:38:14 +00:00
|
|
|
initial-data="$ctrl.item.intrastat">
|
2023-05-05 06:12:38 +00:00
|
|
|
<tpl-item>
|
2018-05-31 12:40:42 +00:00
|
|
|
<div>{{::description}}</div>
|
2023-05-05 06:12:38 +00:00
|
|
|
<div class="text-caption text-secondary">
|
|
|
|
#{{::id}}
|
|
|
|
</div>
|
2018-05-31 12:40:42 +00:00
|
|
|
</tpl-item>
|
2020-02-17 06:22:55 +00:00
|
|
|
<append>
|
|
|
|
<vn-icon-button
|
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="New intrastat"
|
|
|
|
ng-click="$ctrl.showIntrastat($event)">
|
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-autocomplete>
|
2023-05-05 06:12:38 +00:00
|
|
|
<vn-autocomplete
|
2019-12-13 10:59:25 +00:00
|
|
|
url="Expenses"
|
|
|
|
label="Expense"
|
|
|
|
ng-model="$ctrl.item.expenseFk"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="expence"
|
2019-12-13 10:59:25 +00:00
|
|
|
initial-data="$ctrl.item.expense">
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-autocomplete>
|
2023-07-11 05:37:51 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2023-05-05 06:12:38 +00:00
|
|
|
<vn-autocomplete
|
2020-09-17 18:12:52 +00:00
|
|
|
data="originsData"
|
2018-10-15 11:20:55 +00:00
|
|
|
label="Origin"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.item.originFk"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="origin"
|
2018-10-15 11:20:55 +00:00
|
|
|
initial-data="$ctrl.item.origin">
|
2020-02-17 06:22:55 +00:00
|
|
|
</vn-autocomplete>
|
2023-07-11 05:37:51 +00:00
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
|
|
|
label="Size"
|
|
|
|
ng-model="$ctrl.item.size"
|
|
|
|
vn-name="size"
|
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
2018-12-17 13:15:39 +00:00
|
|
|
<vn-textfield
|
|
|
|
label="Reference"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.item.comment"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="comment"
|
2019-10-09 22:47:29 +00:00
|
|
|
rule>
|
2018-12-17 13:15:39 +00:00
|
|
|
</vn-textfield>
|
2020-09-17 07:58:00 +00:00
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
2022-12-27 06:48:09 +00:00
|
|
|
label="Relevancy"
|
2020-09-17 07:58:00 +00:00
|
|
|
ng-model="$ctrl.item.relevancy"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="relevancy"
|
2020-09-17 07:58:00 +00:00
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
2023-07-11 05:37:51 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2019-10-08 21:57:02 +00:00
|
|
|
<vn-input-number
|
2022-12-27 06:48:09 +00:00
|
|
|
min="0"
|
|
|
|
label="stems"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.item.stems"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="stems"
|
2019-10-08 21:57:02 +00:00
|
|
|
rule>
|
2019-03-26 06:29:45 +00:00
|
|
|
</vn-input-number>
|
2021-02-17 14:38:57 +00:00
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
2022-12-27 06:48:09 +00:00
|
|
|
label="Multiplier"
|
2023-05-05 06:12:38 +00:00
|
|
|
ng-model="$ctrl.item.stemMultiplier"
|
|
|
|
vn-name="stemMultiplier">
|
2021-02-17 14:38:57 +00:00
|
|
|
</vn-input-number>
|
2023-10-11 06:28:52 +00:00
|
|
|
<vn-input-number
|
|
|
|
min="1"
|
|
|
|
label="Minimum sales quantity"
|
|
|
|
ng-model="$ctrl.item.minQuantity"
|
|
|
|
vn-name="minQuantity"
|
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
2021-11-26 07:34:32 +00:00
|
|
|
</vn-horizontal>
|
2023-07-11 05:37:51 +00:00
|
|
|
<vn-horizontal>
|
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
|
|
|
label="Weight/Piece"
|
|
|
|
ng-model="$ctrl.item.weightByPiece"
|
|
|
|
vn-name="weightByPiece"
|
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
|
|
|
label="Units/Box"
|
|
|
|
ng-model="$ctrl.item.packingOut"
|
|
|
|
vn-name="packingOut"
|
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
2023-07-11 06:41:43 +00:00
|
|
|
label="Recycled Plastic"
|
2023-07-11 05:37:51 +00:00
|
|
|
ng-model="$ctrl.item.recycledPlastic"
|
2023-07-11 05:58:18 +00:00
|
|
|
vn-name="recycledPlastic"
|
2023-07-11 05:37:51 +00:00
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
2023-07-11 06:41:43 +00:00
|
|
|
label="Non recycled plastic"
|
2023-07-11 05:37:51 +00:00
|
|
|
ng-model="$ctrl.item.nonRecycledPlastic"
|
|
|
|
vn-name="nonRecycledPlastic"
|
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
|
|
|
</vn-horizontal>
|
2021-11-26 07:34:32 +00:00
|
|
|
<vn-horizontal>
|
2020-09-17 07:58:00 +00:00
|
|
|
<vn-textarea
|
|
|
|
label="Description"
|
|
|
|
ng-model="$ctrl.item.description"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="description"
|
2019-10-08 21:57:02 +00:00
|
|
|
rule>
|
2020-09-17 07:58:00 +00:00
|
|
|
</vn-textarea>
|
2018-12-17 13:15:39 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2018-10-15 11:20:55 +00:00
|
|
|
<vn-check
|
2018-10-23 09:25:51 +00:00
|
|
|
label="Active"
|
2023-05-05 06:12:38 +00:00
|
|
|
ng-model="$ctrl.item.isActive"
|
|
|
|
vn-name="isActive">
|
2018-10-15 11:20:55 +00:00
|
|
|
</vn-check>
|
2019-09-18 09:11:47 +00:00
|
|
|
<vn-check
|
2020-09-17 07:58:00 +00:00
|
|
|
label="Price in kg"
|
2023-05-05 06:12:38 +00:00
|
|
|
ng-model="$ctrl.item.hasKgPrice"
|
|
|
|
vn-name="priceInKg">
|
2020-09-17 07:58:00 +00:00
|
|
|
</vn-check>
|
|
|
|
<vn-check
|
|
|
|
label="Fragile"
|
|
|
|
ng-model="$ctrl.item.isFragile"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="isFragile"
|
2020-09-17 07:58:00 +00:00
|
|
|
info="Is shown at website, app that this item cannot travel (wreath, palms, ...)">
|
|
|
|
</vn-check>
|
2023-01-17 09:11:41 +00:00
|
|
|
<vn-check
|
|
|
|
label="Do photo"
|
|
|
|
ng-model="$ctrl.item.isPhotoRequested"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="isPhotoRequested"
|
2023-01-17 09:11:41 +00:00
|
|
|
info="This item does need a photo">
|
|
|
|
</vn-check>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-horizontal>
|
2017-12-21 13:09:55 +00:00
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
2020-12-13 12:54:17 +00:00
|
|
|
<vn-submit
|
2020-12-15 15:07:34 +00:00
|
|
|
disabled="!watcher.dataChanged()"
|
2020-12-13 12:54:17 +00:00
|
|
|
label="Save">
|
|
|
|
</vn-submit>
|
2020-12-15 15:07:34 +00:00
|
|
|
<vn-button
|
|
|
|
class="cancel"
|
|
|
|
label="Undo changes"
|
|
|
|
disabled="!watcher.dataChanged()"
|
|
|
|
ng-click="watcher.loadOriginalData()">
|
|
|
|
</vn-button>
|
2017-12-21 13:09:55 +00:00
|
|
|
</vn-button-bar>
|
|
|
|
</form>
|
2020-02-17 06:22:55 +00:00
|
|
|
|
|
|
|
<!-- Create custom agent dialog -->
|
2022-12-27 06:48:09 +00:00
|
|
|
<vn-dialog class="edit"
|
2020-02-17 06:22:55 +00:00
|
|
|
vn-id="intrastat"
|
2020-05-06 12:38:09 +00:00
|
|
|
on-accept="$ctrl.onIntrastatAccept()"
|
|
|
|
message="New intrastat">
|
2020-02-17 06:22:55 +00:00
|
|
|
<tpl-body>
|
|
|
|
<vn-horizontal>
|
2023-05-05 06:12:38 +00:00
|
|
|
<vn-input-number
|
|
|
|
vn-focus
|
2020-02-17 06:22:55 +00:00
|
|
|
label="Identifier"
|
2020-02-17 11:47:03 +00:00
|
|
|
ng-model="$ctrl.newIntrastat.intrastatId"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="id"
|
2020-02-17 06:22:55 +00:00
|
|
|
required="true">
|
2020-02-17 11:47:03 +00:00
|
|
|
</vn-input-number>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2023-05-05 06:12:38 +00:00
|
|
|
<vn-textfield
|
2020-02-17 06:22:55 +00:00
|
|
|
label="Description"
|
|
|
|
ng-model="$ctrl.newIntrastat.description"
|
2023-05-05 06:12:38 +00:00
|
|
|
vn-name="description"
|
2020-02-17 06:22:55 +00:00
|
|
|
required="true">
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
</tpl-body>
|
|
|
|
<tpl-buttons>
|
|
|
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="accept" translate>Create</button>
|
|
|
|
</tpl-buttons>
|
2021-11-24 07:51:07 +00:00
|
|
|
</vn-dialog>
|
|
|
|
|
|
|
|
<!-- Filter item dialog -->
|
|
|
|
<vn-dialog
|
|
|
|
vn-id="filterDialog"
|
|
|
|
message="Filter item">
|
|
|
|
<tpl-body class="itemFilter">
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
2022-12-27 06:48:09 +00:00
|
|
|
label="Name"
|
2021-11-24 07:51:07 +00:00
|
|
|
ng-model="$ctrl.itemFilterParams.name"
|
|
|
|
vn-focus>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
2022-12-27 06:48:09 +00:00
|
|
|
label="Size"
|
2021-11-24 07:51:07 +00:00
|
|
|
ng-model="$ctrl.itemFilterParams.size">
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-autocomplete
|
|
|
|
label="Producer"
|
|
|
|
ng-model="$ctrl.itemFilterParams.producerFk"
|
|
|
|
url="Producers"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id">
|
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-autocomplete
|
|
|
|
label="Type"
|
|
|
|
ng-model="$ctrl.itemFilterParams.typeFk"
|
|
|
|
url="ItemTypes"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id">
|
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-autocomplete
|
|
|
|
label="Color"
|
|
|
|
ng-model="$ctrl.itemFilterParams.inkFk"
|
|
|
|
url="Inks"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id">
|
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal class="vn-mb-md">
|
|
|
|
<vn-button vn-none
|
|
|
|
label="Search"
|
|
|
|
ng-click="$ctrl.filter()">
|
|
|
|
</vn-button>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-crud-model
|
2022-12-27 06:48:09 +00:00
|
|
|
vn-id="itemsModel"
|
2021-11-24 07:51:07 +00:00
|
|
|
url="Items/withName"
|
|
|
|
filter="$ctrl.itemFilter"
|
|
|
|
data="items"
|
|
|
|
limit="10">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-data-viewer
|
|
|
|
model="itemsModel"
|
|
|
|
class="vn-w-lg">
|
|
|
|
<vn-table class="scrollable">
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-th shrink>ID</vn-th>
|
|
|
|
<vn-th expand>Item</vn-th>
|
|
|
|
<vn-th number>Size</vn-th>
|
|
|
|
<vn-th expand>Producer</vn-th>
|
|
|
|
<vn-th>Color</vn-th>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
|
|
|
<a ng-repeat="item in items"
|
|
|
|
class="clickable vn-tr search-result"
|
|
|
|
ng-click="$ctrl.selectItem(item.id)">
|
|
|
|
<vn-td shrink>
|
|
|
|
<span
|
2022-01-14 07:06:38 +00:00
|
|
|
vn-click-stop="itemDescriptor.show($event, item.id)"
|
2021-11-24 07:51:07 +00:00
|
|
|
class="link">
|
|
|
|
{{::item.id}}
|
|
|
|
</span>
|
|
|
|
</vn-td>
|
|
|
|
<vn-td expand>{{::item.name}}</vn-td>
|
|
|
|
<vn-td number>{{::item.size}}</vn-td>
|
|
|
|
<vn-td expand>{{::item.producer.name}}</vn-td>
|
|
|
|
<vn-td>{{::item.ink.name}}</vn-td>
|
|
|
|
</a>
|
|
|
|
</vn-tbody>
|
|
|
|
</vn-table>
|
|
|
|
</vn-data-viewer>
|
|
|
|
<vn-item-descriptor-popover
|
|
|
|
vn-id="item-descriptor"
|
|
|
|
warehouse-fk="$ctrl.vnConfig.warehouseFk">
|
|
|
|
</vn-item-descriptor-popover>
|
|
|
|
</tpl-body>
|
2022-12-27 06:48:09 +00:00
|
|
|
</vn-dialog>
|