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 ($scope.transaction.category.name === 'Private Entnahme') {
|
||||
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) {
|
||||
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();
|
||||
accountInfo.$promise.then(function(data) {
|
||||
$scope.accounts = accountInfo._embedded.accounts;
|
||||
$scope.account = $scope.accounts[0];
|
||||
if ($scope.account == undefined)
|
||||
$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) {
|
||||
$scope.categories = categories._embedded.categories;
|
||||
$scope.refreshList();
|
||||
|
||||
Reference in New Issue
Block a user