evil default category hack
This commit is contained in:
@@ -10,7 +10,6 @@ import javax.persistence.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
@Entity
|
||||
public class Account {
|
||||
@@ -31,9 +30,6 @@ public class Account {
|
||||
@JoinTable(name = "account_user", joinColumns = @JoinColumn(name = "account_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id"))
|
||||
private List<User> users;
|
||||
|
||||
@OneToOne
|
||||
private Category preselectedCategory;
|
||||
|
||||
|
||||
|
||||
public Long getId() {
|
||||
|
||||
@@ -77,6 +77,11 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$routePara
|
||||
|
||||
if (typeof $scope.categories !== 'undefined') {
|
||||
$scope.transaction.category = $scope.categories[0];
|
||||
|
||||
// XXX dirty hack - one day we will have to move that into the database...
|
||||
if ($scope.account.name == 'Gemeinschaftskonto') {
|
||||
$scope.transaction.category = $scope.categories[3];
|
||||
}
|
||||
}
|
||||
|
||||
// get recent transactions
|
||||
|
||||
Reference in New Issue
Block a user