2018-05-31 09:52:39 +00:00
|
|
|
|
2018-02-28 11:07:56 +00:00
|
|
|
<mg-ajax
|
2019-10-24 22:53:53 +00:00
|
|
|
path="Addresses/{{edit.params.addressId}}"
|
2018-05-31 09:52:39 +00:00
|
|
|
actions="$ctrl.address = edit.model"
|
2018-02-28 11:07:56 +00:00
|
|
|
options="mgEdit">
|
|
|
|
</mg-ajax>
|
2017-02-21 15:21:55 +00:00
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
2020-01-28 08:03:20 +00:00
|
|
|
url="Clients/{{$ctrl.$params.id}}/updateAddress"
|
2017-02-21 15:21:55 +00:00
|
|
|
id-field="id"
|
2020-01-28 08:03:20 +00:00
|
|
|
data="$ctrl.address"
|
2018-05-31 09:52:39 +00:00
|
|
|
form="form">
|
2017-02-21 15:21:55 +00:00
|
|
|
</vn-watcher>
|
2018-05-31 09:52:39 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="AddressObservations"
|
2018-05-31 09:52:39 +00:00
|
|
|
fields="['id', 'addressFk', 'observationTypeFk', 'description']"
|
2020-01-28 10:56:26 +00:00
|
|
|
link="{addressFk: $ctrl.$params.addressId}"
|
2018-12-19 14:59:35 +00:00
|
|
|
data="observations"
|
|
|
|
auto-load="true">
|
2018-05-31 09:52:39 +00:00
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
2019-10-24 22:53:53 +00:00
|
|
|
url="ObservationTypes"
|
2018-05-31 09:52:39 +00:00
|
|
|
fields="['id', 'description']"
|
2018-12-19 14:59:35 +00:00
|
|
|
data="types"
|
|
|
|
auto-load="true">
|
2018-05-31 09:52:39 +00:00
|
|
|
</vn-crud-model>
|
2019-11-10 10:08:44 +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">
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-horizontal>
|
|
|
|
<vn-check
|
|
|
|
vn-one
|
|
|
|
label="Enabled"
|
|
|
|
ng-model="$ctrl.address.isActive">
|
|
|
|
</vn-check>
|
2018-03-12 10:10:05 +00:00
|
|
|
<vn-check
|
2019-10-09 22:47:29 +00:00
|
|
|
vn-one
|
|
|
|
label="Is equalizated"
|
|
|
|
ng-model="$ctrl.address.isEqualizated"
|
2018-03-12 10:10:05 +00:00
|
|
|
vn-acl="administrative, salesAssistant">
|
2022-04-06 12:48:22 +00:00
|
|
|
</vn-check>
|
|
|
|
<vn-check
|
|
|
|
vn-one
|
|
|
|
label="Is Logiflora allowed"
|
|
|
|
ng-model="$ctrl.address.isLogifloraAllowed"
|
|
|
|
vn-acl="salesAssistant">
|
|
|
|
</vn-check>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Consignee"
|
|
|
|
ng-model="$ctrl.address.nickname"
|
|
|
|
rule
|
|
|
|
vn-focus>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Street"
|
|
|
|
ng-model="$ctrl.address.street"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
2020-02-24 10:27:36 +00:00
|
|
|
<vn-datalist vn-one
|
|
|
|
label="Postcode"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="$ctrl.address.postalCode"
|
2020-02-24 10:27:36 +00:00
|
|
|
selection="$ctrl.postcode"
|
|
|
|
url="Postcodes/location"
|
|
|
|
fields="['code','townFk']"
|
2019-07-26 11:05:22 +00:00
|
|
|
order="code, townFk"
|
2019-06-13 11:08:11 +00:00
|
|
|
value-field="code"
|
2020-02-24 10:27:36 +00:00
|
|
|
show-field="code"
|
2019-10-09 22:47:29 +00:00
|
|
|
rule>
|
2020-02-24 10:27:36 +00:00
|
|
|
<tpl-item>
|
2023-06-12 12:58:28 +00:00
|
|
|
{{code}} - {{town.name}} ({{town.province.name}},
|
2020-02-24 10:27:36 +00:00
|
|
|
{{town.province.country.country}})
|
|
|
|
</tpl-item>
|
|
|
|
<append>
|
2023-06-12 12:58:28 +00:00
|
|
|
<vn-icon-button
|
2020-02-24 10:27:36 +00:00
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="New postcode"
|
2020-03-04 11:51:29 +00:00
|
|
|
ng-click="postcode.open()"
|
2023-06-21 11:34:27 +00:00
|
|
|
vn-acl="deliveryAssistant"
|
2020-03-04 11:51:29 +00:00
|
|
|
vn-acl-action="remove">
|
2020-02-24 10:27:36 +00:00
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
|
|
|
</vn-datalist>
|
2023-06-12 12:58:28 +00:00
|
|
|
<vn-datalist vn-id="town" vn-one
|
2020-03-02 08:30:54 +00:00
|
|
|
label="City"
|
|
|
|
ng-model="$ctrl.address.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-autocomplete vn-id="province" vn-one
|
|
|
|
label="Province"
|
|
|
|
ng-model="$ctrl.address.provinceFk"
|
|
|
|
url="Provinces/location"
|
|
|
|
fields="['id', 'name', 'countryFk']"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
|
|
|
rule>
|
|
|
|
<tpl-item>{{name}} ({{country.country}})</tpl-item>
|
|
|
|
</vn-autocomplete>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-autocomplete vn-one
|
2020-01-28 10:56:26 +00:00
|
|
|
ng-model="$ctrl.address.agencyModeFk"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="AgencyModes/isActive"
|
2018-03-01 22:38:14 +00:00
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
|
|
|
label="Agency">
|
|
|
|
</vn-autocomplete>
|
2019-10-09 22:47:29 +00:00
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Phone"
|
|
|
|
ng-model="$ctrl.address.phone"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Mobile"
|
|
|
|
ng-model="$ctrl.address.mobile"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-horizontal>
|
2020-01-24 08:47:24 +00:00
|
|
|
<vn-horizontal>
|
|
|
|
<vn-autocomplete vn-one
|
2020-01-28 10:56:26 +00:00
|
|
|
ng-model="$ctrl.address.incotermsFk"
|
2020-01-24 08:47:24 +00:00
|
|
|
url="Incoterms"
|
|
|
|
show-field="name"
|
|
|
|
value-field="code"
|
|
|
|
label="Incoterms">
|
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-autocomplete vn-one
|
2020-01-28 10:56:26 +00:00
|
|
|
ng-model="$ctrl.address.customsAgentFk"
|
2020-01-24 08:47:24 +00:00
|
|
|
url="CustomsAgents"
|
|
|
|
show-field="fiscalName"
|
|
|
|
value-field="id"
|
|
|
|
label="Customs agent">
|
2020-01-28 10:56:26 +00:00
|
|
|
<append>
|
|
|
|
<vn-icon-button
|
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="New customs agent"
|
|
|
|
ng-click="$ctrl.showCustomAgent($event)">
|
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
2020-01-24 08:47:24 +00:00
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
2018-05-31 09:52:39 +00:00
|
|
|
<vn-title>Notes</vn-title>
|
|
|
|
<div name="observations">
|
|
|
|
<vn-horizontal ng-repeat="observation in observations">
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-autocomplete
|
|
|
|
vn-one
|
2018-04-19 12:46:06 +00:00
|
|
|
vn-focus
|
2018-05-31 09:52:39 +00:00
|
|
|
data="types"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="observation.observationTypeFk"
|
2018-03-01 22:38:14 +00:00
|
|
|
show-field="description"
|
2019-11-12 07:51:50 +00:00
|
|
|
label="Observation type"
|
|
|
|
rule="AddressObservation">
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-autocomplete>
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-textfield
|
2018-03-07 12:34:34 +00:00
|
|
|
vn-two
|
2018-03-01 22:38:14 +00:00
|
|
|
label="Description"
|
2019-10-09 22:47:29 +00:00
|
|
|
ng-model="observation.description"
|
2019-10-11 15:38:04 +00:00
|
|
|
rule="AddressObservation">
|
2018-03-01 22:38:14 +00:00
|
|
|
</vn-textfield>
|
2018-06-07 21:47:19 +00:00
|
|
|
<vn-none>
|
|
|
|
<vn-icon-button
|
2018-03-07 12:34:34 +00:00
|
|
|
vn-tooltip="Remove note"
|
2018-12-11 07:50:54 +00:00
|
|
|
icon="delete"
|
2018-06-07 21:47:19 +00:00
|
|
|
ng-click="$ctrl.removeObservation($index)"
|
|
|
|
tabindex="-1">
|
2023-06-12 12:58:28 +00:00
|
|
|
</vn-icon-button>
|
2018-06-07 21:47:19 +00:00
|
|
|
</vn-none>
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-horizontal>
|
2019-07-08 12:07:09 +00:00
|
|
|
<vn-icon-button
|
|
|
|
vn-bind="+"
|
|
|
|
vn-tooltip="Add note"
|
|
|
|
icon="add_circle"
|
2023-06-12 12:58:28 +00:00
|
|
|
ng-if="types.length > observations.length"
|
2019-07-08 12:07:09 +00:00
|
|
|
ng-click="model.insert()">
|
|
|
|
</vn-icon-button>
|
2018-05-31 09:52:39 +00:00
|
|
|
</div>
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
2017-06-07 06:39:40 +00:00
|
|
|
<vn-submit label="Save"></vn-submit>
|
2018-10-17 07:28:38 +00:00
|
|
|
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button>
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-button-bar>
|
2017-02-07 11:58:25 +00:00
|
|
|
</form>
|
2019-07-08 12:07:09 +00:00
|
|
|
|
|
|
|
<!-- New postcode dialog -->
|
2023-06-12 12:58:28 +00:00
|
|
|
<vn-geo-postcode vn-id="postcode"
|
2019-10-30 15:57:14 +00:00
|
|
|
on-response="$ctrl.onResponse($response)">
|
2020-10-14 09:33:42 +00:00
|
|
|
</vn-geo-postcode>
|
2019-07-08 12:07:09 +00:00
|
|
|
|
2020-01-24 08:47:24 +00:00
|
|
|
<!-- Create custom agent dialog -->
|
2023-06-12 12:58:28 +00:00
|
|
|
<vn-dialog class="edit"
|
2020-01-24 08:47:24 +00:00
|
|
|
vn-id="customAgent"
|
2020-05-06 12:38:09 +00:00
|
|
|
on-accept="$ctrl.onCustomAgentAccept()"
|
|
|
|
message="New customs agent">
|
2020-01-24 08:47:24 +00:00
|
|
|
<tpl-body>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield vn-one vn-focus
|
|
|
|
label="NIF"
|
|
|
|
ng-model="$ctrl.newCustomsAgent.nif"
|
|
|
|
required="true">
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield vn-one
|
|
|
|
label="Fiscal name"
|
|
|
|
ng-model="$ctrl.newCustomsAgent.fiscalName"
|
|
|
|
required="true">
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield vn-one
|
|
|
|
label="Street"
|
|
|
|
ng-model="$ctrl.newCustomsAgent.street">
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield vn-one
|
|
|
|
label="Phone"
|
|
|
|
ng-model="$ctrl.newCustomsAgent.phone">
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
</tpl-body>
|
|
|
|
<tpl-buttons>
|
|
|
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
|
|
<button response="accept" translate>Create</button>
|
|
|
|
</tpl-buttons>
|
2023-06-12 12:58:28 +00:00
|
|
|
</vn-dialog>
|