Change account sort order in overview page
This commit is contained in:
@@ -2,6 +2,7 @@ package de.financer.util.comparator;
|
||||
|
||||
import de.financer.model.Account;
|
||||
import de.financer.model.AccountType;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
@@ -19,7 +20,13 @@ public class AccountByTypeByIdComparator implements Comparator<Account> {
|
||||
@Override
|
||||
public int compare(Account o1, Account o2) {
|
||||
int typeOrder = SORT_ORDER.get(o1.getType()).compareTo(SORT_ORDER.get(o2.getType()));
|
||||
int groupOrder = 0;
|
||||
int idOrder = o1.getId().compareTo(o2.getId());
|
||||
|
||||
return typeOrder != 0 ? typeOrder : o1.getId().compareTo(o2.getId());
|
||||
if (o1.getAccountGroup() != null && o2.getAccountGroup() != null) {
|
||||
groupOrder = o1.getAccountGroup().getName().compareTo(o2.getAccountGroup().getName());
|
||||
}
|
||||
|
||||
return typeOrder != 0 ? typeOrder : groupOrder != 0 ? groupOrder : idOrder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
v26 -> v27:
|
||||
- Changed sort order of accounts in overview page. The accounts are now sorted by the account type first (BCILES), then
|
||||
by the account group name and then by the account ID, leading to an overall more organic order of accounts
|
||||
|
||||
v25 -> v26:
|
||||
- Close of the current expense period now creates null statistic entries for accounts that have not been used in
|
||||
bookings in the period to close. This way the average spending better reflects the period average
|
||||
|
||||
Reference in New Issue
Block a user