147 lines
5.0 KiB
HTML
147 lines
5.0 KiB
HTML
<mg-ajax path="Clients/{{patch.params.id}}" options="vnPatch"></mg-ajax>
|
|
<vn-watcher
|
|
vn-id="watcher"
|
|
data="$ctrl.client"
|
|
form="form"
|
|
save="patch">
|
|
</vn-watcher>
|
|
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
|
|
<vn-card class="vn-pa-lg">
|
|
<vn-horizontal>
|
|
<vn-autocomplete
|
|
vn-one
|
|
label="Billing data"
|
|
vn-acl="salesAssistant"
|
|
ng-model="$ctrl.client.payMethodFk"
|
|
url="PayMethods"
|
|
fields="['ibanRequired']"
|
|
initial-data="$ctrl.client.payMethod">
|
|
</vn-autocomplete>
|
|
<vn-input-number
|
|
vn-one
|
|
min="0"
|
|
step="1"
|
|
label="Due day"
|
|
ng-model="$ctrl.client.dueDay"
|
|
vn-acl="salesAssistant"
|
|
rule>
|
|
</vn-input-number>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-textfield
|
|
vn-one
|
|
label="IBAN"
|
|
ng-model="$ctrl.client.iban"
|
|
rule
|
|
on-change="$ctrl.autofillBic()"
|
|
vn-acl="salesAssistant">
|
|
</vn-textfield>
|
|
<vn-autocomplete
|
|
vn-one
|
|
label="Swift / BIC"
|
|
url="BankEntities"
|
|
ng-model="$ctrl.client.bankEntityFk"
|
|
fields="['name']"
|
|
initial-data="$ctrl.client.bankEntityFk"
|
|
on-change="$ctrl.autofillBic()"
|
|
search-function="{or: [{bic: {like: $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}"
|
|
value-field="id"
|
|
show-field="bic"
|
|
vn-acl="salesAssistant"
|
|
disabled="$ctrl.ibanCountry == 'ES'">
|
|
<tpl-item>
|
|
<vn-horizontal>
|
|
<vn-one>{{bic}}</vn-one>
|
|
<vn-one>
|
|
<div class="ellipsize" style="max-width: 10em">{{name}}</div>
|
|
</vn-one>
|
|
</vn-horizontal>
|
|
</tpl-item>
|
|
<append>
|
|
<vn-icon-button
|
|
vn-auto
|
|
icon="add_circle"
|
|
vn-tooltip="New bank entity"
|
|
vn-dialog="bankEntityDialog"
|
|
vn-acl="salesAssistant">
|
|
</vn-icon-button>
|
|
</append>
|
|
</vn-autocomplete>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-check
|
|
vn-one
|
|
label="Received LCR"
|
|
ng-model="$ctrl.client.hasLcr"
|
|
vn-acl="salesAssistant">
|
|
</vn-check>
|
|
<vn-check
|
|
vn-one
|
|
label="Received core VNL"
|
|
ng-model="$ctrl.client.hasCoreVnl"
|
|
vn-acl="salesAssistant">
|
|
</vn-check>
|
|
<vn-check
|
|
vn-one
|
|
label="Received B2B VNL"
|
|
ng-model="$ctrl.client.hasSepaVnl"
|
|
vn-acl="salesAssistant">
|
|
</vn-check>
|
|
</vn-horizontal>
|
|
</vn-card>
|
|
<vn-button-bar>
|
|
<vn-submit label="Save" vn-acl="salesAssistant"></vn-submit>
|
|
<vn-button label="Undo changes" ng-if="watcher.dataChanged()" ng-click="watcher.loadOriginalData()"></vn-button>
|
|
</vn-button-bar>
|
|
</form>
|
|
|
|
<!-- Create bank entity dialog -->
|
|
<vn-dialog class="edit"
|
|
vn-id="bankEntityDialog"
|
|
on-open="$ctrl.onBankEntityOpen()"
|
|
on-response="$ctrl.onBankEntityResponse(response)">
|
|
<tpl-body>
|
|
<h5 class="vn-py-sm" translate>New bank entity</h5>
|
|
<vn-horizontal>
|
|
<vn-textfield
|
|
vn-one
|
|
label="Name"
|
|
ng-model="$ctrl.newBankEntity.name"
|
|
required="true">
|
|
</vn-textfield>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-autocomplete
|
|
vn-one
|
|
vn-id="country"
|
|
label="Country"
|
|
ng-model="$ctrl.newBankEntity.countryFk"
|
|
fields="['id', 'country', 'code']"
|
|
url="Countries"
|
|
value-field="id"
|
|
show-field="country"
|
|
required="true">
|
|
</vn-autocomplete>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-textfield
|
|
vn-one
|
|
label="Entity Code"
|
|
ng-model="$ctrl.newBankEntity.id"
|
|
ng-show="country.selection.code === 'ES'">
|
|
</vn-textfield>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-textfield
|
|
vn-one
|
|
label="Swift / BIC"
|
|
ng-model="$ctrl.newBankEntity.bic"
|
|
required="true">
|
|
</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>
|
|
</vn-dialog> |