evil default category hack

This commit is contained in:
2016-07-20 22:00:06 +02:00
parent d74acb65a7
commit def16ee8b0
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.tilman</groupId>
<artifactId>next-transactions</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<parent>
<groupId>org.springframework.boot</groupId>
@@ -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