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>() {
});
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -10,6 +10,7 @@ financer.account-overview.available-actions.create-account-group=Create new acco
financer.account-overview.status=Status\:
financer.account-overview.status.recurring-transaction-due-today=Recurring transactions due today\:
financer.account-overview.status.recurring-transaction-active=Active recurring transactions\:
financer.account-overview.status.current-assets=Current assets\:
financer.account-overview.table-header.id=ID
financer.account-overview.table-header.key=Account
financer.account-overview.table-header.group=Group

View File

@@ -10,6 +10,7 @@ financer.account-overview.available-actions.create-account-group=Neue Konto-Grup
financer.account-overview.status=Status\:
financer.account-overview.status.recurring-transaction-due-today=Wiederkehrende Buchungen heute f\u00E4llig\:
financer.account-overview.status.recurring-transaction-active=Aktive wiederkehrende Buchungen\:
financer.account-overview.status.current-assets=Umlaufverm\u00F6gen\:
financer.account-overview.table-header.id=ID
financer.account-overview.table-header.key=Konto
financer.account-overview.table-header.group=Gruppe

View File

@@ -10,6 +10,10 @@
<h1 th:text="#{financer.heading.account-overview}" />
<div id="status-container">
<span th:text="#{financer.account-overview.status}"/>
<div>
<span th:text="#{financer.account-overview.status.current-assets}"/>
<span th:text="${#numbers.formatDecimal(currentAssets/100D, 1, 'DEFAULT', 2, 'DEFAULT')}"/>
</div>
<div>
<span th:text="#{financer.account-overview.status.recurring-transaction-due-today}"/>
<a th:href="@{/recurringTransactionDueToday}" th:text="${rtDueTodayCount}"/>