Add current assets to status on overview page

This commit is contained in:
2019-06-24 21:11:36 +02:00
parent 30ebc2a154
commit 6ec073d08e
10 changed files with 71 additions and 17 deletions

View File

@@ -32,11 +32,13 @@ public class AccountController {
.exchange(this.financerConfig);
final ResponseEntity<Iterable<RecurringTransaction>> rtAllActRes = new GetAllActiveRecurringTransactionsTemplate()
.exchange(this.financerConfig);
final ResponseEntity<Long> currentAssets = new GetCurrentAssetsTemplate().exchange(this.financerConfig);
final boolean showClosedBoolean = BooleanUtils.toBoolean(showClosed);
model.addAttribute("accounts", ControllerUtils.filterAndSortAccounts(response.getBody(), showClosedBoolean));
model.addAttribute("rtDueTodayCount", IterableUtils.size(rtDtRes.getBody()));
model.addAttribute("rtAllActiveCount", IterableUtils.size(rtAllActRes.getBody()));
model.addAttribute("currentAssets", currentAssets.getBody());
model.addAttribute("showClosed", showClosedBoolean);
ControllerUtils.addVersionAttribute(model, this.financerConfig);

View File

@@ -6,6 +6,7 @@ public enum Function {
ACC_CREATE_ACCOUNT("accounts/createAccount"),
ACC_CLOSE_ACCOUNT("accounts/closeAccount"),
ACC_OPEN_ACCOUNT("accounts/openAccount"),
ACC_CURRENT_ASSETS("accounts/getCurrentAssets"),
ACC_GP_CREATE_ACCOUNT_GROUP("accountGroups/createAccountGroup"),
ACC_GP_GET_ALL("accountGroups/getAll"),

View File

@@ -0,0 +1,15 @@
package de.financer.controller.template;
import de.financer.config.FinancerConfig;
import de.financer.controller.Function;
import de.financer.util.ControllerUtils;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.ResponseEntity;
public class GetCurrentAssetsTemplate {
public ResponseEntity<Long> exchange(FinancerConfig financerConfig) {
return new FinancerRestTemplate<Long>().exchange(ControllerUtils
.buildUrl(financerConfig, Function.ACC_CURRENT_ASSETS), new ParameterizedTypeReference<Long>() {
});
}
}