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-11-10 10:08:44 +00:00
|
|
|
<form name="form" vn-http-submit="$ctrl.onSubmit()" class="vn-w-md">
|
|
|
|
<vn-card class="vn-pa-lg">
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-two
|
|
|
|
label="Comercial Name"
|
|
|
|
ng-model="$ctrl.client.name"
|
|
|
|
rule
|
|
|
|
vn-focus>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-autocomplete vn-one
|
|
|
|
ng-model="$ctrl.client.salesPersonFk"
|
|
|
|
url="Clients/activeWorkersWithRole"
|
|
|
|
search-function="{firstName: $search}"
|
|
|
|
show-field="firstName"
|
|
|
|
value-field="id"
|
|
|
|
where="{role: 'employee'}"
|
|
|
|
label="Salesperson">
|
|
|
|
<tpl-item>{{firstName}} {{lastName}}</tpl-item>
|
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<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>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-two
|
|
|
|
label="Street"
|
|
|
|
ng-model="$ctrl.client.street"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2020-02-21 11:39:41 +00:00
|
|
|
<vn-autocomplete vn-id="country" vn-one
|
2019-11-10 10:08:44 +00:00
|
|
|
ng-model="$ctrl.client.countryFk"
|
|
|
|
url="Countries"
|
|
|
|
show-field="country"
|
|
|
|
value-field="id"
|
|
|
|
label="Country">
|
|
|
|
</vn-autocomplete>
|
2020-02-21 11:39:41 +00:00
|
|
|
<vn-autocomplete vn-id="province" vn-one
|
|
|
|
label="Province"
|
2019-11-10 10:08:44 +00:00
|
|
|
ng-model="$ctrl.client.provinceFk"
|
2020-02-21 11:39:41 +00:00
|
|
|
selection="$ctrl.province"
|
|
|
|
url="Provinces/location"
|
|
|
|
fields="['id', 'name', 'countryFk']"
|
2019-11-10 10:08:44 +00:00
|
|
|
where="{countryFk: country.selection.id}"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
2020-02-21 11:39:41 +00:00
|
|
|
rule>
|
|
|
|
<tpl-item>{{name}} ({{country.country}})</tpl-item>
|
2019-11-10 10:08:44 +00:00
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2020-02-21 11:39:41 +00:00
|
|
|
<vn-datalist vn-id="town" vn-one
|
2019-11-10 10:08:44 +00:00
|
|
|
label="City"
|
|
|
|
ng-model="$ctrl.client.city"
|
2020-02-21 11:39:41 +00:00
|
|
|
selection="$ctrl.town"
|
|
|
|
url="Towns/location"
|
|
|
|
fields="['id', 'name', 'provinceFk']"
|
2019-11-10 10:08:44 +00:00
|
|
|
where="{provinceFk: province.selection.id}"
|
|
|
|
show-field="name"
|
2020-02-21 11:39:41 +00:00
|
|
|
value-field="name">
|
|
|
|
<tpl-item>
|
|
|
|
{{name}}, {{province.name}}
|
|
|
|
({{province.country.country}})
|
|
|
|
</tpl-item>
|
|
|
|
</vn-datalist>
|
|
|
|
<vn-datalist vn-one
|
2019-11-10 10:08:44 +00:00
|
|
|
label="Postcode"
|
|
|
|
ng-model="$ctrl.client.postcode"
|
2020-02-21 11:39:41 +00:00
|
|
|
selection="$ctrl.postcode"
|
2019-11-10 10:08:44 +00:00
|
|
|
url="Postcodes/location"
|
2020-02-21 11:39:41 +00:00
|
|
|
fields="['code','townFk']"
|
2019-11-10 10:08:44 +00:00
|
|
|
where="{townFk: town.selection.id}"
|
|
|
|
order="code, townFk"
|
|
|
|
value-field="code"
|
2020-02-21 11:39:41 +00:00
|
|
|
show-field="code"
|
|
|
|
rule>
|
2019-11-10 10:08:44 +00:00
|
|
|
<tpl-item>
|
2020-02-24 10:27:36 +00:00
|
|
|
{{code}} - {{town.name}} ({{town.province.name}},
|
|
|
|
{{town.province.country.country}})
|
2019-11-10 10:08:44 +00:00
|
|
|
</tpl-item>
|
2020-02-24 10:27:36 +00:00
|
|
|
<append>
|
|
|
|
<vn-icon-button
|
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="New postcode"
|
|
|
|
ng-click="postcode.open()">
|
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
2020-02-21 11:39:41 +00:00
|
|
|
</vn-datalist>
|
2019-11-10 10:08:44 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Web user"
|
|
|
|
ng-model="$ctrl.client.userName"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Email"
|
|
|
|
ng-model="$ctrl.client.email"
|
|
|
|
rule
|
|
|
|
info="You can save multiple emails">
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-check
|
|
|
|
vn-one
|
|
|
|
label="Is equalizated"
|
|
|
|
ng-model="$ctrl.client.isEqualizated">
|
|
|
|
</vn-check>
|
|
|
|
</vn-horizontal>
|
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
|
|
|
<vn-submit label="Create"></vn-submit>
|
|
|
|
<vn-button ui-sref="client.index" label="Cancel"></vn-button>
|
|
|
|
</vn-button-bar>
|
|
|
|
</form>
|
|
|
|
<!-- New postcode dialog -->
|
|
|
|
<vn-client-postcode
|
|
|
|
vn-id="postcode"
|
|
|
|
on-response="$ctrl.onResponse($response)">
|
|
|
|
</vn-client-postcode>
|