Show outstanding sum only for accounts with several users
This commit is contained in:
@@ -103,7 +103,6 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
|||||||
// if this is selected to be a withdrawal, preselect the current user and lock the radio buttons
|
// if this is selected to be a withdrawal, preselect the current user and lock the radio buttons
|
||||||
if ($scope.transaction.category.name === 'Private Entnahme') {
|
if ($scope.transaction.category.name === 'Private Entnahme') {
|
||||||
for (i = 0; i < userLabels.length; i++) {
|
for (i = 0; i < userLabels.length; i++) {
|
||||||
console.log(userLabels[i].innerHTML.substr(-$scope.userinfo.name.length-6));
|
|
||||||
if (userLabels[i].innerHTML.indexOf($scope.userinfo.name) >= 0) {
|
if (userLabels[i].innerHTML.indexOf($scope.userinfo.name) >= 0) {
|
||||||
userLabels[i].getElementsByTagName('INPUT')[0].checked = true;
|
userLabels[i].getElementsByTagName('INPUT')[0].checked = true;
|
||||||
}
|
}
|
||||||
@@ -135,9 +134,10 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
|||||||
var accountInfo = $resource('/accounts/search/findByUserName', { username: $scope.userid }).get();
|
var accountInfo = $resource('/accounts/search/findByUserName', { username: $scope.userid }).get();
|
||||||
accountInfo.$promise.then(function(data) {
|
accountInfo.$promise.then(function(data) {
|
||||||
$scope.accounts = accountInfo._embedded.accounts;
|
$scope.accounts = accountInfo._embedded.accounts;
|
||||||
|
if ($scope.account == undefined)
|
||||||
$scope.account = $scope.accounts[0];
|
$scope.account = $scope.accounts[0];
|
||||||
|
|
||||||
var categories = $resource('/categories/search/listForAccount', { accountId: $scope.accounts[0].id }).get();
|
var categories = $resource('/categories/search/listForAccount', { accountId: $scope.account.id }).get();
|
||||||
categories.$promise.then(function(data) {
|
categories.$promise.then(function(data) {
|
||||||
$scope.categories = categories._embedded.categories;
|
$scope.categories = categories._embedded.categories;
|
||||||
$scope.refreshList();
|
$scope.refreshList();
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div ng-show="accounts.length > 1">
|
<div ng-show="accounts.length > 1">
|
||||||
<select
|
<select
|
||||||
ng-model='account'
|
ng-model='account'
|
||||||
ng-change='refreshList()'
|
ng-change='initList()'
|
||||||
ng-options="account.name for account in accounts track by account.id"></select>
|
ng-options="account.name for account in accounts track by account.id"></select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
<a href="" ng-click="moreTransactions()">more</a>
|
<a href="" ng-click="moreTransactions()">more</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 2em; text-align: center;">
|
<div ng-show="accountUsers.length > 1" style="margin-top: 2em; text-align: center;">
|
||||||
<span ng-repeat="user in accountUsers" ng-click="openOutstandings(user)" class="clickable">{{user.name}} {{user.outstandingAmount}} €<br/></span>
|
<span ng-repeat="user in accountUsers" ng-click="openOutstandings(user)" class="clickable">{{user.name}} {{user.outstandingAmount}} €<br/></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user