salix/modules/client/front/fiscal-data/index.html

220 lines
7.5 KiB
HTML
Raw Permalink Normal View History

<mg-ajax path="Clients/{{patch.params.id}}/updateFiscalData" options="vnPatch"></mg-ajax>
2023-05-04 08:00:21 +00:00
<vn-watcher
vn-id="watcher"
data="$ctrl.client"
id-field="id"
form="form"
save="patch">
2017-02-21 15:21:55 +00:00
</vn-watcher>
2023-05-04 08:00:21 +00:00
<vn-crud-model
auto-load="true"
url="Provinces/location"
data="provincesLocation"
order="name">
2020-09-17 18:12:52 +00:00
</vn-crud-model>
2023-05-04 08:00:21 +00:00
<vn-crud-model
auto-load="true"
url="Countries"
data="countries"
2024-04-25 10:35:21 +00:00
order="name">
2020-09-17 18:12:52 +00:00
</vn-crud-model>
2023-05-04 08:00:21 +00:00
<vn-crud-model
auto-load="true"
url="SageTaxTypes"
data="sageTaxTypes"
order="vat">
2020-10-15 09:53:01 +00:00
</vn-crud-model>
2020-11-04 12:38:09 +00:00
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
2018-03-01 22:38:14 +00:00
<vn-horizontal>
2023-05-04 08:00:21 +00:00
<vn-textfield
vn-focus
label="Social name"
ng-model="$ctrl.client.socialName"
info="Only letters, numbers and spaces can be used"
required="true"
2023-07-14 11:35:13 +00:00
ng-keyup="$ctrl.client.socialName = $ctrl.client.socialName.toUpperCase()"
2023-05-04 08:00:21 +00:00
rule>
2018-03-01 22:38:14 +00:00
</vn-textfield>
2023-05-04 08:00:21 +00:00
<vn-textfield
label="Tax number"
ng-model="$ctrl.client.fi"
rule>
2018-03-01 22:38:14 +00:00
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
2023-05-04 08:00:21 +00:00
<vn-textfield
vn-two
label="Street"
ng-model="$ctrl.client.street"
2023-07-14 11:35:13 +00:00
ng-keyup="$ctrl.client.street = $ctrl.client.street.toUpperCase()"
2023-05-04 08:00:21 +00:00
rule>
2018-03-01 22:38:14 +00:00
</vn-textfield>
</vn-horizontal>
2020-10-15 09:53:01 +00:00
<vn-horizontal>
2023-05-04 08:00:21 +00:00
<vn-autocomplete
ng-model="$ctrl.client.sageTaxTypeFk"
data="sageTaxTypes"
show-field="vat"
value-field="id"
label="Sage tax type"
vn-acl="salesAssistant"
rule>
2020-10-15 09:53:01 +00:00
</vn-autocomplete>
2023-05-04 08:00:21 +00:00
<vn-autocomplete
ng-model="$ctrl.client.sageTransactionTypeFk"
url="SageTransactionTypes"
show-field="transaction"
value-field="id"
label="Sage transaction type"
search-function="{or: [{id: $search}, {transaction: {like: '%'+ $search +'%'}}]}"
2023-05-04 08:00:21 +00:00
vn-acl="salesAssistant"
order="transaction"
rule>
<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>
2023-05-04 08:00:21 +00:00
<vn-datalist
label="Postcode"
ng-model="$ctrl.client.postcode"
selection="$ctrl.postcode"
url="Postcodes/location"
fields="['code','townFk']"
order="code, townFk"
value-field="code"
show-field="code"
rule>
2020-02-24 10:27:36 +00:00
<tpl-item>
2022-11-23 07:55:44 +00:00
{{code}} - {{town.name}} ({{town.province.name}},
2024-04-25 10:35:21 +00:00
{{town.province.country.name}})
2020-02-24 10:27:36 +00:00
</tpl-item>
<append>
2023-05-04 08:00:21 +00:00
<vn-icon-button
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
2023-06-21 11:34:27 +00:00
vn-acl="deliveryAssistant"
2023-05-04 08:00:21 +00:00
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>
2023-05-04 08:00:21 +00:00
<vn-datalist
vn-id="town"
label="City"
ng-model="$ctrl.client.city"
selection="$ctrl.town"
url="Towns/location"
fields="['id', 'name', 'provinceFk']"
show-field="name"
value-field="name">
2020-03-02 08:30:54 +00:00
<tpl-item>
{{name}}, {{province.name}}
2024-04-25 10:35:21 +00:00
({{province.country.name}})
2020-03-02 08:30:54 +00:00
</tpl-item>
</vn-datalist>
</vn-horizontal>
<vn-horizontal>
2023-05-04 08:00:21 +00:00
<vn-autocomplete
vn-one
vn-id="province"
label="Province"
ng-model="$ctrl.client.provinceFk"
selection="$ctrl.province"
data="provincesLocation"
fields="['id', 'name', 'countryFk']"
show-field="name"
value-field="id"
rule>
2024-04-25 10:35:21 +00:00
<tpl-item>{{name}} ({{country.name}})</tpl-item>
2020-03-02 08:30:54 +00:00
</vn-autocomplete>
2023-05-04 08:00:21 +00:00
<vn-autocomplete
vn-one
vn-id="country"
ng-model="$ctrl.client.countryFk"
data="countries"
2024-04-25 10:35:21 +00:00
show-field="name"
2023-05-04 08:00:21 +00:00
value-field="id"
label="Country"
rule>
2020-03-02 08:30:54 +00:00
</vn-autocomplete>
2018-03-01 22:38:14 +00:00
</vn-horizontal>
2019-10-09 22:47:29 +00:00
<vn-horizontal>
2023-05-04 08:00:21 +00:00
<vn-check
label="Active"
ng-model="$ctrl.client.isActive">
2018-03-01 22:38:14 +00:00
</vn-check>
2023-05-04 08:00:21 +00:00
<vn-check
label="Frozen"
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>
2023-05-04 08:00:21 +00:00
<vn-check
label="Has to invoice"
ng-model="$ctrl.client.hasToInvoice">
2018-03-01 22:38:14 +00:00
</vn-check>
2023-05-04 08:00:21 +00:00
<vn-check
label="Vies"
info="When activating it, do not enter the country code in the ID field."
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>
2023-05-04 08:00:21 +00:00
<vn-check
label="Notify by email"
ng-model="$ctrl.client.isToBeMailed">
2018-03-01 22:38:14 +00:00
</vn-check>
2023-05-04 08:00:21 +00:00
<vn-check
label="Invoice by address"
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>
2023-05-04 08:00:21 +00:00
<vn-check
label="Is equalizated"
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>
2023-05-04 08:00:21 +00:00
<vn-check
label="Verified data"
ng-model="$ctrl.client.isTaxDataChecked"
vn-acl="salesAssistant">
2018-05-31 11:34:48 +00:00
</vn-check>
2018-03-01 22:38:14 +00:00
</vn-horizontal>
2022-05-26 14:14:10 +00:00
<vn-horizontal>
2023-05-04 08:00:21 +00:00
<vn-check
label="Electronic invoice"
ng-model="$ctrl.client.hasElectronicInvoice"
vn-acl="administrative">
</vn-check>
2022-05-26 14:14:10 +00:00
</vn-horizontal>
</vn-card>
<vn-button-bar>
2022-11-23 07:55:44 +00:00
<vn-submit disabled="!watcher.dataChanged()" label="Save">
2020-12-13 13:57:42 +00:00
</vn-submit>
2023-05-04 08:00:21 +00:00
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
2020-12-13 13:57:42 +00:00
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>
2023-05-04 08:00:21 +00:00
<vn-confirm
vn-id="propagate-isEqualizated"
question="You changed the equalization tax"
message="Do you want to spread the change?"
on-accept="$ctrl.onAcceptEt()">
</vn-confirm>
2023-05-04 08:00:21 +00:00
<vn-confirm
vn-id="confirm-duplicatedClient"
message="Found a client with this data"
2020-02-04 10:25:15 +00:00
on-accept="$ctrl.onAcceptDuplication()">
</vn-confirm>
2023-05-04 08:00:21 +00:00
<vn-geo-postcode
vn-id="postcode"
on-response="$ctrl.onResponse($response)">
</vn-geo-postcode>