Bug #97 - Show dash when no secured credit

This commit is contained in:
Juan 2018-02-27 13:28:07 +01:00
parent b864a8382c
commit 688881fac4
3 changed files with 12 additions and 10 deletions

View File

@ -5,16 +5,18 @@
<div pad-medium class="data">
<h6>{{$ctrl.client.name}}</h6>
<div>
<span translate>Id</span> {{$ctrl.client.id}}
<span class="label" translate>Id</span> {{$ctrl.client.id}}
</div>
<div>
<span translate>Phone</span> {{$ctrl.client.phone | phone}}
<span class="label" translate>Phone</span> {{$ctrl.client.phone | phone}}
</div>
<div>
<span translate>Credit</span> {{$ctrl.client.credit | number:2}}€
<span class="label" translate>Credit</span> {{$ctrl.client.credit | currency:'€':2}}
</div>
<div>
<span translate>Secured credit</span> {{$ctrl.client.creditInsurance || 0 | number:2}}€
<span class="label" translate>Secured credit</span>
<span ng-if="$ctrl.client.creditInsurance">{{$ctrl.client.creditInsurance | currency:'€':2}}</span>
<span ng-if="!$ctrl.client.creditInsurance">-</span>
</div>
</div>
</vn-card>

View File

@ -1,5 +1,5 @@
vn-client-descriptor {
.data span {
.data .label {
font-size: .9em;
color: #666;
}

View File

@ -13,7 +13,7 @@ module.exports = fiWithCountry => {
let validators = {
es: {
regExp: /^ES[A-Z0-9]\d{7}[A-Z0-9]$/,
regExp: /^[A-Z0-9]\d{7}[A-Z0-9]$/,
validate: () => {
let isCif = /[A-W]/.test(fi.charAt(0));
let lastDigit = fi.charAt(len - 1);
@ -55,13 +55,13 @@ module.exports = fiWithCountry => {
}
},
pt: {
regExp: /^PT\d{9}$/
regExp: /^\d{9}$/
},
fr: {
regExp: /^FR[A-Z0-9]{2}\d{9}$/
regExp: /^[A-Z0-9]{2}\d{9}$/
},
it: {
regExp: /^IT\d{11}$/
regExp: /^\d{11}$/
}
};
@ -70,6 +70,6 @@ module.exports = fiWithCountry => {
if (!validator)
return false;
return validator.regExp.test(fiWithCountry)
return validator.regExp.test(fi)
&& (!validator.validate || validator.validate());
};