2020-10-30 14:11:45 +00:00
|
|
|
<mg-ajax path="Suppliers/{{patch.params.id}}/updateFiscalData" options="vnPatch"></mg-ajax>
|
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
|
|
|
data="$ctrl.supplier"
|
|
|
|
id-field="id"
|
|
|
|
form="form"
|
|
|
|
save="patch">
|
|
|
|
</vn-watcher>
|
|
|
|
<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>
|
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
url="SageTaxTypes"
|
|
|
|
data="sageTaxTypes"
|
|
|
|
order="vat">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
url="SageTransactionTypes"
|
|
|
|
data="sageTransactionTypes"
|
|
|
|
order="transaction">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
|
|
|
auto-load="true"
|
|
|
|
url="SageWithholdings"
|
|
|
|
data="sageWithholdings"
|
|
|
|
order="withholding">
|
|
|
|
</vn-crud-model>
|
|
|
|
<form name="form" vn-http-submit="watcher.submit()" class="vn-w-md">
|
|
|
|
<vn-card class="vn-pa-lg">
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-two
|
|
|
|
vn-focus
|
|
|
|
label="Social name"
|
|
|
|
ng-model="$ctrl.supplier.name"
|
2020-11-02 13:30:33 +00:00
|
|
|
info="You can use letters and spaces"
|
|
|
|
required="true"
|
|
|
|
rule>
|
2020-10-30 14:11:45 +00:00
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Tax number"
|
|
|
|
ng-model="$ctrl.supplier.nif"
|
2020-11-02 13:30:33 +00:00
|
|
|
required="true"
|
2020-10-30 14:11:45 +00:00
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
2020-11-04 10:37:54 +00:00
|
|
|
label="Account"
|
2020-10-30 14:11:45 +00:00
|
|
|
ng-model="$ctrl.supplier.account"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-autocomplete vn-one
|
|
|
|
ng-model="$ctrl.supplier.sageTaxTypeFk"
|
|
|
|
data="sageTaxTypes"
|
|
|
|
show-field="vat"
|
|
|
|
value-field="id"
|
|
|
|
label="Sage tax type"
|
|
|
|
rule>
|
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-autocomplete vn-one
|
|
|
|
ng-model="$ctrl.supplier.sageWithholdingFk"
|
|
|
|
data="sageWithholdings"
|
|
|
|
show-field="withholding"
|
|
|
|
value-field="id"
|
|
|
|
label="Sage withholding"
|
|
|
|
rule>
|
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-autocomplete vn-one
|
|
|
|
ng-model="$ctrl.supplier.sageTransactionTypeFk"
|
|
|
|
data="sageTransactionTypes"
|
|
|
|
show-field="transaction"
|
|
|
|
value-field="id"
|
|
|
|
label="Sage transaction type"
|
|
|
|
rule>
|
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-datalist vn-one
|
|
|
|
label="Postcode"
|
|
|
|
ng-model="$ctrl.supplier.postCode"
|
|
|
|
selection="$ctrl.postcode"
|
|
|
|
url="Postcodes/location"
|
|
|
|
fields="['code','townFk']"
|
|
|
|
order="code, townFk"
|
|
|
|
value-field="code"
|
|
|
|
show-field="code"
|
|
|
|
rule>
|
|
|
|
<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"
|
|
|
|
ng-click="postcode.open()"
|
|
|
|
vn-acl="deliveryBoss"
|
|
|
|
vn-acl-action="remove">
|
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
|
|
|
</vn-datalist>
|
|
|
|
<vn-datalist vn-id="town" vn-one
|
|
|
|
label="City"
|
|
|
|
ng-model="$ctrl.supplier.city"
|
|
|
|
selection="$ctrl.town"
|
|
|
|
url="Towns/location"
|
|
|
|
fields="['id', 'name', 'provinceFk']"
|
|
|
|
show-field="name"
|
2020-11-02 13:30:33 +00:00
|
|
|
value-field="name"
|
|
|
|
required="true"
|
|
|
|
rule>
|
2020-10-30 14:11:45 +00:00
|
|
|
<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.supplier.provinceFk"
|
|
|
|
selection="$ctrl.province"
|
|
|
|
data="provincesLocation"
|
|
|
|
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.supplier.countryFk"
|
|
|
|
data="countries"
|
|
|
|
show-field="country"
|
|
|
|
value-field="id"
|
|
|
|
label="Country"
|
|
|
|
rule>
|
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
|
|
|
<vn-submit label="Save"></vn-submit>
|
|
|
|
<vn-button label="Undo changes" ng-if="$ctrl.$.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button>
|
|
|
|
</vn-button-bar>
|
|
|
|
</form>
|
|
|
|
<!-- New postcode dialog -->
|
|
|
|
<vn-geo-postcode
|
|
|
|
vn-id="postcode"
|
|
|
|
on-response="$ctrl.onResponse($response)">
|
|
|
|
</vn-geo-postcode>
|