2019-10-24 22:53:53 +00:00
|
|
|
<mg-ajax path="Clients/createWithUser" options="vnPost"></mg-ajax>
|
2017-02-07 11:58:25 +00:00
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
2017-02-21 10:36:43 +00:00
|
|
|
data="$ctrl.client"
|
2017-02-21 15:21:55 +00:00
|
|
|
form="form"
|
|
|
|
save="post">
|
2017-02-07 11:58:25 +00:00
|
|
|
</vn-watcher>
|
2019-01-30 22:47:06 +00:00
|
|
|
<div class="content-block">
|
2019-07-08 12:07:09 +00:00
|
|
|
<form name="form" vn-http-submit="$ctrl.onSubmit()" compact>
|
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
|
|
|
|
vn-two
|
|
|
|
label="Comercial Name"
|
|
|
|
ng-model="$ctrl.client.name"
|
|
|
|
rule
|
|
|
|
vn-focus>
|
|
|
|
</vn-textfield>
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-autocomplete vn-one
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.salesPersonFk"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="Clients/activeWorkersWithRole"
|
2018-11-27 08:10:30 +00:00
|
|
|
search-function="{firstName: $search}"
|
2018-04-03 17:29:01 +00:00
|
|
|
show-field="firstName"
|
2018-03-01 22:38:14 +00:00
|
|
|
value-field="id"
|
2018-12-17 12:14:23 +00:00
|
|
|
where="{role: 'employee'}"
|
2018-04-03 17:29:01 +00:00
|
|
|
label="Salesperson">
|
2019-07-29 11:12:36 +00:00
|
|
|
<tpl-item>{{firstName}} {{lastName}}</tpl-item>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
2018-03-22 17:02:48 +00:00
|
|
|
<vn-horizontal>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-textfield
|
|
|
|
vn-two
|
|
|
|
label="Business name"
|
|
|
|
ng-model="$ctrl.client.socialName"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Tax number"
|
|
|
|
ng-model="$ctrl.client.fi"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
2018-05-31 11:34:48 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2018-03-22 17:02:48 +00:00
|
|
|
<vn-textfield
|
|
|
|
vn-two
|
|
|
|
label="Street"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.street"
|
|
|
|
rule>
|
2018-03-22 17:02:48 +00:00
|
|
|
</vn-textfield>
|
2018-05-31 11:34:48 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-autocomplete
|
|
|
|
vn-id="country"
|
|
|
|
vn-one
|
|
|
|
ng-model="$ctrl.client.countryFk"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="Countries"
|
2019-07-26 11:05:22 +00:00
|
|
|
show-field="country"
|
|
|
|
value-field="id"
|
|
|
|
label="Country">
|
|
|
|
</vn-autocomplete>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-autocomplete
|
|
|
|
vn-id="province"
|
|
|
|
vn-one
|
2019-10-24 22:53:53 +00:00
|
|
|
url="Provinces"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.provinceFk"
|
2019-07-26 11:05:22 +00:00
|
|
|
where="{countryFk: country.selection.id}"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
|
|
|
label="Province">
|
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
2019-09-18 08:35:46 +00:00
|
|
|
label="City"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.city"
|
|
|
|
rule>
|
2019-09-18 08:35:46 +00:00
|
|
|
</vn-textfield>
|
2019-10-04 22:16:57 +00:00
|
|
|
<!--
|
|
|
|
<vn-autocomplete vn-id="town" vn-one
|
2019-07-26 11:05:22 +00:00
|
|
|
label="City"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="Towns"
|
2019-07-26 11:05:22 +00:00
|
|
|
fields="['id', 'name']"
|
|
|
|
where="{provinceFk: province.selection.id}"
|
|
|
|
show-field="name"
|
|
|
|
value-field="name"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.city">
|
2019-10-04 22:16:57 +00:00
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-icon-button
|
|
|
|
vn-auto
|
|
|
|
class="vn-my-md"
|
2019-07-26 11:05:22 +00:00
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="New postcode"
|
|
|
|
ng-click="postcode.open()">
|
2019-10-04 22:16:57 +00:00
|
|
|
</vn-icon-button>
|
|
|
|
-->
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
2019-09-18 08:35:46 +00:00
|
|
|
label="Postcode"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.postcode"
|
|
|
|
rule>
|
2019-09-18 08:35:46 +00:00
|
|
|
</vn-textfield>
|
|
|
|
<!-- <vn-autocomplete vn-one
|
2019-10-24 22:53:53 +00:00
|
|
|
url="Postcodes/location"
|
2019-07-26 11:05:22 +00:00
|
|
|
fields="['code', 'townFk']"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.postcode"
|
2019-07-08 12:07:09 +00:00
|
|
|
selection="$ctrl.postcodeSelection"
|
2019-06-13 11:08:11 +00:00
|
|
|
search-function="{code: $search}"
|
2019-07-26 11:05:22 +00:00
|
|
|
where="{townFk: town.selection.id}"
|
|
|
|
order="code, townFk"
|
2019-06-13 11:08:11 +00:00
|
|
|
show-field="code"
|
|
|
|
value-field="code"
|
|
|
|
label="Postcode">
|
|
|
|
<tpl-item>
|
|
|
|
{{code}}, {{town.name}} - {{town.province.name}}
|
|
|
|
({{town.province.country.country}})
|
|
|
|
</tpl-item>
|
2019-09-18 08:35:46 +00:00
|
|
|
</vn-autocomplete> -->
|
2018-03-22 17:02:48 +00:00
|
|
|
</vn-horizontal>
|
2018-05-31 11:34:48 +00:00
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Web user"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.userName"
|
|
|
|
rule>
|
2018-05-31 11:34:48 +00:00
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Email"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.email"
|
|
|
|
rule
|
2018-05-31 11:34:48 +00:00
|
|
|
info="You can save multiple emails">
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-horizontal>
|
2018-05-31 11:34:48 +00:00
|
|
|
<vn-check
|
|
|
|
vn-one
|
|
|
|
label="Is equalizated"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.client.isEqualizated">
|
2018-05-31 11:34:48 +00:00
|
|
|
</vn-check>
|
|
|
|
</vn-horizontal>
|
2017-02-21 15:21:55 +00:00
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
2017-11-21 13:53:09 +00:00
|
|
|
<vn-submit label="Create"></vn-submit>
|
2018-05-31 14:51:33 +00:00
|
|
|
<vn-button ui-sref="client.index" label="Cancel"></vn-button>
|
2017-02-21 15:21:55 +00:00
|
|
|
</vn-button-bar>
|
2019-01-30 22:47:06 +00:00
|
|
|
</form>
|
2019-07-08 12:07:09 +00:00
|
|
|
|
|
|
|
<!-- New postcode dialog -->
|
|
|
|
<vn-client-postcode vn-id="postcode"
|
|
|
|
on-response="$ctrl.onResponse(response)">
|
|
|
|
</vn-client-postcode>
|
|
|
|
</div>
|