salix/modules/ticket/front/services/index.html

116 lines
3.6 KiB
HTML
Raw Normal View History

2018-11-30 06:57:41 +00:00
<vn-crud-model
vn-id="model"
url="TicketServices"
2020-03-18 07:35:59 +00:00
link="{ticketFk: $ctrl.$params.id}"
data="$ctrl.services"
auto-load="true">
2018-11-30 06:57:41 +00:00
</vn-crud-model>
2020-09-17 18:12:52 +00:00
<vn-crud-model
auto-load="true"
url="TicketServiceTypes"
data="ticketServiceTypes"
order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="TaxClasses"
data="taxClasses"
order="description">
</vn-crud-model>
2018-11-30 06:57:41 +00:00
<vn-watcher
vn-id="watcher"
data="$ctrl.services">
2018-11-30 06:57:41 +00:00
</vn-watcher>
2019-10-11 15:38:04 +00:00
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
2019-10-11 15:38:04 +00:00
<vn-horizontal ng-repeat="service in $ctrl.services track by $index">
<vn-autocomplete vn-two vn-focus
2020-09-17 18:12:52 +00:00
data="ticketServiceTypes"
2019-10-11 15:38:04 +00:00
label="Description"
show-field="name"
value-field="id"
ng-model="service.ticketServiceTypeFk">
2019-10-18 19:36:30 +00:00
<append>
<vn-icon-button
icon="add_circle"
vn-tooltip="New service type"
2020-03-30 15:30:03 +00:00
ng-click="$ctrl.onNewServiceTypeClick(service, $event)"
2019-10-18 19:36:30 +00:00
vn-acl="administrative"
style="padding: 0;">
</vn-icon-button>
</append>
2019-10-11 15:38:04 +00:00
</vn-autocomplete>
<vn-input-number
vn-one min="0"
step="1"
label="Quantity"
ng-model="service.quantity"
rule="TicketService">
</vn-input-number>
<vn-input-number
vn-one
label="Price"
ng-model="service.price"
step="0.01">
</vn-input-number>
<vn-autocomplete vn-one
2020-09-17 18:12:52 +00:00
data="taxClasses"
2019-10-11 15:38:04 +00:00
label="Tax class"
show-field="description"
value-field="id"
ng-model="service.taxClassFk">
</vn-autocomplete>
<vn-auto>
<vn-icon-button
pointer
vn-tooltip="Remove service"
icon="delete"
ng-click="model.remove($index)">
</vn-icon-button>
</vn-auto>
</vn-horizontal>
<vn-icon-button
2019-11-12 07:51:50 +00:00
ng-if=$ctrl.defaultTaxClass
2019-10-11 15:38:04 +00:00
vn-tooltip="Add service"
vn-bind="+"
icon="add_circle"
ng-click="$ctrl.add()">
</vn-icon-button>
2018-11-30 06:57:41 +00:00
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
</vn-button-bar>
</form>
<!-- Create service type dialog -->
<vn-dialog class="edit"
2020-03-30 15:30:03 +00:00
vn-id="newServiceTypeDialog"
on-accept="$ctrl.onNewServiceTypeAccept($data)"
2020-05-06 12:38:09 +00:00
on-close="newServiceType = null"
message="New service type">
<tpl-body>
<vn-horizontal>
2019-10-09 22:47:29 +00:00
<vn-textfield
vn-one
label="Description"
2020-03-30 15:30:03 +00:00
ng-model="newServiceType.name"
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
2020-03-30 15:30:03 +00:00
<vn-autocomplete
vn-one
vn-focus
url="Expenses"
label="Expense"
show-field="name"
value-field="id"
2020-03-30 15:30:03 +00:00
ng-model="newServiceType.expenseFk">
</vn-autocomplete>
</vn-horizontal>
</tpl-body>
<tpl-buttons>
2019-10-30 15:57:14 +00:00
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Create</button>
</tpl-buttons>
</vn-dialog>