This commit is contained in:
Javi Gallego 2018-10-16 13:32:58 +02:00
parent 31fa66e052
commit 33b9efc5b7
9 changed files with 3645 additions and 3612 deletions

View File

@ -158,45 +158,49 @@
</vn-vertical> </vn-vertical>
</vn-one> </vn-one>
<vn-one margin-medium> <vn-one margin-medium>
<h5 translate>Recovery</h5> <h5 translate>Business data</h5>
<vn-vertical ng-if="$ctrl.summary.recovery"> <vn-label-value label="Total greuge"
<vn-label-value label="Since" value="{{$ctrl.summary.totalGreuge | currency:'€ ':2}}">
value="{{$ctrl.summary.recovery.started | date:'dd/MM/yyyy'}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="To" <vn-label-value label="Mana"
value="{{$ctrl.summary.recovery.finished | date:'dd/MM/yyyy'}}"> value="{{$ctrl.summary.mana.mana | currency:'€ ':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Amount" <vn-label-value label="Rate"
value="{{$ctrl.summary.recovery.amount | currency:'€ ':2}}"> value="{{$ctrl.summary.claimsRatio[0].priceIncreasing | percentage}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Period" <vn-label-value label="Average invoiced"
value="{{$ctrl.summary.recovery.period}}"> value="{{$ctrl.summary.averageInvoiced.invoiced | currency:'€ ':2}}">
</vn-label-value>
<vn-label-value label="Claims"
value="{{$ctrl.summary.claimsRatio[0].claimingRate | percentage}}">
</vn-label-value> </vn-label-value>
</vn-vertical>
</vn-one> </vn-one>
<vn-one margin-medium> <vn-one margin-medium>
<h5 translate>Financial data</h5> <h5 translate>Financial information</h5>
<vn-label-value label="Mana"
value="{{$ctrl.summary.mana.mana | currency:'€ ':2}}">
</vn-label-value>
<vn-label-value label="Risk" <vn-label-value label="Risk"
value="{{$ctrl.summary.debt.debt | currency:'€ ':2}}"> value="{{$ctrl.summary.debt.debt | currency:'€ ':2}}"
</vn-label-value> ng-class="{bold: $ctrl.summary.debt.debt > $ctrl.summary.credit}">
<vn-label-value label="Average invoiced"
value="{{$ctrl.summary.averageInvoiced.invoiced | currency:'€ ':2}}">
</vn-label-value>
<vn-label-value label="Total greuge"
value="{{$ctrl.summary.totalGreuge | currency:'€ ':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Credit" <vn-label-value label="Credit"
value="{{$ctrl.summary.credit | currency:'€ ':2}}"> value="{{$ctrl.summary.credit | currency:'€ ':2}}"
ng-class="{bold: $ctrl.summary.credit > $ctrl.summary.creditInsurance ||
($ctrl.summary.credit && $ctrl.summary.creditInsurance == null)}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Secured credit" <vn-label-value label="Secured credit"
value="{{$ctrl.summary.creditInsurance | currency:'€ ':2}}"> value="{{$ctrl.summary.creditInsurance | currency:'€ ':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Grade" <vn-label-value label="Balance"
value="{{$ctrl.grade}}"> value="{{$ctrl.summary.clientRisks[0].amount | currency:'€ ':2}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Balance due"
value="{{$ctrl.summary.defaulters[0].amount | currency:'€ ':2}}"
ng-class="{bold: $ctrl.summary.defaulters[0].amount}">
</vn-label-value>
<vn-vertical ng-if="$ctrl.summary.recovery.started">
<vn-label-value label="Recovery since"
value="{{$ctrl.summary.recovery.started | date:'dd/MM/yyyy'}}">
</vn-label-value>
</vn-vertical>
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>

View File

@ -1,9 +1,13 @@
Default address: Consignatario pred. Default address: Consignatario pred.
Total greuge: Greuge total Total greuge: Greuge total
Financial data: Datos financieros Financial information: Datos financieros
Mana: Maná Mana: Maná
Risk: Riesgo Risk: Riesgo
Secured credit: Crédito asegurado Secured credit: Crédito asegurado
Average invoiced: Consumo medio Average invoiced: Consumo medio
Sales person: Comercial Sales person: Comercial
Recovery: Recobro Recovery: Recobro
Balance due: Saldo vencido
Rate: Tarifa
Business data: Datos comerciales
Recovery since: Recobro desde

View File

@ -3,3 +3,7 @@ vn-dialog {
min-width: 10em; min-width: 10em;
} }
} }
vn-client-summary .bold {
font-family: vn-font-bold;
}

View File

@ -2,3 +2,5 @@ import './phone';
import './ucwords'; import './ucwords';
import './dash-if-empty'; import './dash-if-empty';
import './dateTime'; import './dateTime';
import './percentage';
import './currency';

7135
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,14 @@
} }
}, },
"properties": { "properties": {
"clientFk": {
"type": "Number",
"id": true
},
"companyFk": {
"type": "Number",
"id": true
},
"amount": { "amount": {
"type": "Number" "type": "Number"
} }

View File

@ -60,6 +60,29 @@ module.exports = Self => {
}, },
where: {finished: null} where: {finished: null}
} }
},
{
relation: 'defaulters',
scope: {
fields: ['amount'],
order: 'created DESC',
limit: 1
}
},
{
relation: 'clientsRisk',
scope: {
where: {companyFk: 442},
fields: ['amount'],
limit: 1
}
},
{
relation: 'claimsRatio',
scope: {
fields: ['claimingRate', 'priceIncreasing'],
limit: 1
}
} }
], ],
where: {id: clientId} where: {id: clientId}

View File

@ -9,6 +9,10 @@
}, },
"validateUpsert": true, "validateUpsert": true,
"properties": { "properties": {
"clientFk": {
"type": "Number",
"id": true
},
"yearSale": { "yearSale": {
"type": "Number" "type": "Number"
}, },

View File

@ -177,6 +177,21 @@
"type": "belongsTo", "type": "belongsTo",
"model": "BankEntity", "model": "BankEntity",
"foreignKey": "bankEntityFk" "foreignKey": "bankEntityFk"
} },
"defaulters": {
"type": "hasMany",
"model": "Defaulter",
"foreignKey": "clientFk"
},
"clientsRisk": {
"type": "hasMany",
"model": "ClientRisk",
"foreignKey": "clientFk"
},
"claimsRatio": {
"type": "hasMany",
"model": "ClaimRatio",
"foreignKey": "clientFk"
}
} }
} }