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

160 lines
5.2 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>
<vn-crud-model
auto-load="true"
url="PayMethods"
data="paymethods">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-autocomplete
vn-one
label="Billing data"
vn-acl="salesAssistant"
ng-model="$ctrl.client.payMethodFk"
data="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"
ng-click="$ctrl.onAddEntityClick($event)"
vn-tooltip="New bank entity"
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
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>
<!-- Create bank entity dialog -->
<vn-dialog class="edit"
vn-id="bankEntityDialog"
on-accept="$ctrl.onBankEntityAccept()"
message="New bank entity">
<tpl-body>
<vn-horizontal>
<vn-textfield
vn-one
label="Name"
ng-model="$ctrl.newBankEntity.name"
required="true"
vn-focus>
</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>