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

115 lines
3.8 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="['ibanRequiredForClients']"
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-click-stop="bankEntity.show({countryFk: $ctrl.client.countryFk})"
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>
<!-- New bankentity dialog -->
<vn-new-bank-entity
vn-id="bankEntity"
on-accept="$ctrl.onAccept($data)">
</vn-new-bank-entity>