2019-10-24 22:53:53 +00:00
< mg-ajax path = "Clients/{{patch.params.id}}/updateFiscalData" options = "vnPatch" > < / mg-ajax >
2017-02-21 15:21:55 +00:00
< vn-watcher
vn-id="watcher"
2017-06-03 11:01:47 +00:00
data="$ctrl.client"
2020-02-04 10:25:15 +00:00
id-field="id"
2017-02-21 15:21:55 +00:00
form="form"
2017-06-03 11:01:47 +00:00
save="patch">
2017-02-21 15:21:55 +00:00
< / vn-watcher >
2020-09-17 18:12:52 +00:00
< vn-crud-model
auto-load="true"
url="Provinces/location"
data="provincesLocation"
order="name">
< / vn-crud-model >
< vn-crud-model
auto-load="true"
url="Countries"
data="countries"
order="country">
< / vn-crud-model >
2020-10-15 09:53:01 +00:00
< vn-crud-model
auto-load="true"
url="SageTaxTypes"
data="sageTaxTypes"
order="vat">
< / vn-crud-model >
2020-11-04 12:38:09 +00:00
< form name = "form" ng-submit = "$ctrl.onSubmit()" 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 >
< vn-textfield
vn-two
vn-focus
label="Social name"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.socialName"
2019-10-11 15:38:04 +00:00
rule
2020-10-28 13:12:57 +00:00
info="You can use letters and spaces"
required="true">
2018-03-01 22:38:14 +00:00
< / vn-textfield >
< vn-textfield
vn-one
label="Tax number"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.fi"
rule>
2018-03-01 22:38:14 +00:00
< / vn-textfield >
< / vn-horizontal >
< vn-horizontal >
< vn-textfield
vn-two
label="Street"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.street"
rule>
2018-03-01 22:38:14 +00:00
< / vn-textfield >
< / vn-horizontal >
2020-10-15 09:53:01 +00:00
< vn-horizontal >
< vn-autocomplete vn-one
ng-model="$ctrl.client.sageTaxTypeFk"
data="sageTaxTypes"
show-field="vat"
value-field="id"
label="Sage tax type"
2020-10-28 13:12:57 +00:00
vn-acl="salesAssistant"
2020-10-15 09:53:01 +00:00
rule>
< / vn-autocomplete >
< vn-autocomplete vn-one
ng-model="$ctrl.client.sageTransactionTypeFk"
2020-12-30 09:49:02 +00:00
url="SageTransactionTypes"
2020-10-15 09:53:01 +00:00
show-field="transaction"
value-field="id"
label="Sage transaction type"
2020-12-30 09:49:02 +00:00
search-function="{or: [{id: $search}, {transaction: {like: '%'+ $search +'%'}}]}"
2020-10-28 13:12:57 +00:00
vn-acl="salesAssistant"
2020-12-30 14:39:27 +00:00
order="transaction"
2020-10-15 09:53:01 +00:00
rule>
2020-12-30 09:49:02 +00:00
< tpl-item > {{id}}: {{transaction}}< / tpl-item >
2020-10-15 09:53:01 +00:00
< / vn-autocomplete >
< / vn-horizontal >
2018-03-01 22:38:14 +00:00
< vn-horizontal >
2020-02-21 11:39:41 +00:00
< vn-datalist vn-one
label="Postcode"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.postcode"
2020-02-21 11:39:41 +00:00
selection="$ctrl.postcode"
url="Postcodes/location"
fields="['code','townFk']"
2019-09-02 07:11:40 +00:00
order="code, townFk"
2019-06-13 11:08:11 +00:00
value-field="code"
2020-02-21 11:39:41 +00:00
show-field="code"
rule>
2020-02-24 10:27:36 +00:00
< tpl-item >
{{code}} - {{town.name}} ({{town.province.name}},
{{town.province.country.country}})
< / tpl-item >
< append >
< vn-icon-button
icon="add_circle"
vn-tooltip="New postcode"
2020-03-04 11:51:29 +00:00
ng-click="postcode.open()"
vn-acl="deliveryBoss"
vn-acl-action="remove">
2020-02-24 10:27:36 +00:00
< / vn-icon-button >
< / append >
2020-02-21 11:39:41 +00:00
< / vn-datalist >
2020-03-02 08:30:54 +00:00
< vn-datalist vn-id = "town" vn-one
label="City"
ng-model="$ctrl.client.city"
selection="$ctrl.town"
url="Towns/location"
fields="['id', 'name', 'provinceFk']"
show-field="name"
value-field="name">
< tpl-item >
{{name}}, {{province.name}}
({{province.country.country}})
< / tpl-item >
< / vn-datalist >
< / vn-horizontal >
< vn-horizontal >
< vn-autocomplete vn-id = "province" vn-one
label="Province"
ng-model="$ctrl.client.provinceFk"
selection="$ctrl.province"
2020-09-17 18:12:52 +00:00
data="provincesLocation"
2020-03-02 08:30:54 +00:00
fields="['id', 'name', 'countryFk']"
show-field="name"
value-field="id"
rule>
< tpl-item > {{name}} ({{country.country}})< / tpl-item >
< / vn-autocomplete >
< vn-autocomplete vn-id = "country" vn-one
ng-model="$ctrl.client.countryFk"
2020-09-17 18:12:52 +00:00
data="countries"
2020-03-02 08:30:54 +00:00
show-field="country"
value-field="id"
label="Country"
rule>
< / vn-autocomplete >
2018-03-01 22:38:14 +00:00
< / vn-horizontal >
2019-10-09 22:47:29 +00:00
< vn-horizontal >
2018-03-01 22:38:14 +00:00
< vn-check
vn-one
label="Active"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.isActive">
2018-03-01 22:38:14 +00:00
< / vn-check >
< vn-check
vn-one
2018-03-19 16:46:28 +00:00
label="Frozen"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.isFreezed">
2018-03-19 16:46:28 +00:00
< / vn-check >
2018-05-31 11:34:48 +00:00
< / vn-horizontal >
2019-10-09 22:47:29 +00:00
< vn-horizontal >
2018-03-19 16:46:28 +00:00
< vn-check
2018-05-31 11:34:48 +00:00
vn-one
label="Has to invoice"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.hasToInvoice">
2018-03-01 22:38:14 +00:00
< / vn-check >
< vn-check
2018-05-31 11:34:48 +00:00
vn-one
label="Vies"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.isVies">
2018-03-01 22:38:14 +00:00
< / vn-check >
< / vn-horizontal >
2019-10-09 22:47:29 +00:00
< vn-horizontal >
2018-03-01 22:38:14 +00:00
< vn-check
vn-one
2020-06-03 11:42:36 +00:00
label="Notify by email"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.isToBeMailed">
2018-03-01 22:38:14 +00:00
< / vn-check >
< vn-check
vn-one
2018-05-31 11:34:48 +00:00
label="Invoice by address"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.hasToInvoiceByAddress">
2018-03-01 22:38:14 +00:00
< / vn-check >
2018-05-31 11:34:48 +00:00
< / vn-horizontal >
2019-10-09 22:47:29 +00:00
< vn-horizontal >
2018-03-01 22:38:14 +00:00
< vn-check
vn-one
2018-05-31 11:34:48 +00:00
label="Is equalizated"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.isEqualizated"
2020-02-04 10:25:15 +00:00
info="In order to invoice, this field is not consulted, but the consignee's ET. When modifying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not."
on-change="$ctrl.onChangeEqualizated(value)">
2018-03-01 22:38:14 +00:00
< / vn-check >
2018-05-31 11:34:48 +00:00
< vn-check
vn-one
label="Verified data"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.client.isTaxDataChecked"
2021-09-08 09:03:58 +00:00
vn-acl="salesAssistant">
2018-05-31 11:34:48 +00:00
< / vn-check >
2018-03-01 22:38:14 +00:00
< / vn-horizontal >
2017-01-31 13:13:06 +00:00
< / vn-card >
< vn-button-bar >
2020-12-13 13:57:42 +00:00
< vn-submit
2020-12-15 15:51:36 +00:00
disabled="!watcher.dataChanged()"
2020-12-13 13:57:42 +00:00
label="Save">
< / vn-submit >
< vn-button
2020-12-15 15:51:36 +00:00
class="cancel"
2020-12-13 13:57:42 +00:00
label="Undo changes"
2020-12-15 15:51:36 +00:00
disabled="!watcher.dataChanged()"
2020-12-13 13:57:42 +00:00
ng-click="watcher.loadOriginalData()">
< / vn-button >
2017-01-31 13:13:06 +00:00
< / vn-button-bar >
< / form >
2018-02-12 12:16:49 +00:00
< vn-confirm
2017-11-22 07:59:21 +00:00
vn-id="propagate-isEqualizated"
2018-02-12 12:16:49 +00:00
question="You changed the equalization tax"
message="Do you want to spread the change?"
2019-12-31 09:38:19 +00:00
on-accept="$ctrl.onAcceptEt()">
2018-02-12 12:16:49 +00:00
< / vn-confirm >
2020-02-04 10:25:15 +00:00
< vn-confirm
vn-id="confirm-duplicatedClient"
message="Found a client with this data"
on-accept="$ctrl.onAcceptDuplication()">
< / vn-confirm >
2020-02-24 10:27:36 +00:00
<!-- New postcode dialog -->
2020-10-14 09:33:42 +00:00
< vn-geo-postcode
2020-02-24 10:27:36 +00:00
vn-id="postcode"
on-response="$ctrl.onResponse($response)">
2020-10-14 09:33:42 +00:00
< / vn-geo-postcode >