Rename solds to balances.

This commit is contained in:
Alexis Lahouze 2017-06-16 23:28:34 +02:00
parent 396210d924
commit 13320602bf
2 changed files with 9 additions and 8 deletions

View File

@ -39,20 +39,21 @@
<tr id="{{ account.id }}"
class="form-inline" ng-class="rowClass(account)"
ng-repeat="account in accountsCtrl.accounts | orderBy:'name'" ng-init="account.getSolds()">
ng-repeat="account in accountsCtrl.accounts | orderBy:'name'"
ng-init="account.getBalances()">
<td>
<a href="#!/account/{{ account.id }}/operations">{{ account.name }}</a>
</td>
<td>
<span ng-class="accountsCtrl.valueClass(account, account.solds.current)">
{{ account.solds.current | currency : "€" }}
<span ng-class="accountsCtrl.valueClass(account, account.balances.current)">
{{ account.balances.current | currency : "€" }}
</span>
</td>
<td>
<span ng-class="accountsCtrl.valueClass(account, account.solds.pointed)">
{{ account.solds.pointed | currency : "€" }}
<span ng-class="accountsCtrl.valueClass(account, account.balancess.pointed)">
{{ account.balances.pointed | currency : "€" }}
</span>
</td>

View File

@ -47,10 +47,10 @@ var accountModule = angular.module('accountant.accounts', [
}
);
Account.prototype.getSolds = function() {
var Solds = $resource('/api/account/:id/balances', {id: this.id});
Account.prototype.getBalances = function() {
var Balances = $resource('/api/account/:id/balances', {id: this.id});
this.solds = Solds.get();
this.balances = Balances.get();
};
Account.prototype.getBalance = function(begin, end) {