diff --git a/financer-common/pom.xml b/financer-common/pom.xml new file mode 100644 index 0000000..d57150e --- /dev/null +++ b/financer-common/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + + financer-parent + de.77zzcx7.financer + 11-SNAPSHOT + + + financer-common + jar + Common functionality of the financer app + financer-common + + + + javax.persistence + javax.persistence-api + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + \ No newline at end of file diff --git a/financer-server/src/main/java/de/financer/model/Account.java b/financer-common/src/main/java/de/financer/model/Account.java similarity index 100% rename from financer-server/src/main/java/de/financer/model/Account.java rename to financer-common/src/main/java/de/financer/model/Account.java diff --git a/financer-server/src/main/java/de/financer/model/AccountGroup.java b/financer-common/src/main/java/de/financer/model/AccountGroup.java similarity index 100% rename from financer-server/src/main/java/de/financer/model/AccountGroup.java rename to financer-common/src/main/java/de/financer/model/AccountGroup.java diff --git a/financer-server/src/main/java/de/financer/model/AccountStatus.java b/financer-common/src/main/java/de/financer/model/AccountStatus.java similarity index 100% rename from financer-server/src/main/java/de/financer/model/AccountStatus.java rename to financer-common/src/main/java/de/financer/model/AccountStatus.java diff --git a/financer-web-client/src/main/java/de/financer/model/AccountType.java b/financer-common/src/main/java/de/financer/model/AccountType.java similarity index 100% rename from financer-web-client/src/main/java/de/financer/model/AccountType.java rename to financer-common/src/main/java/de/financer/model/AccountType.java diff --git a/financer-web-client/src/main/java/de/financer/model/HolidayWeekendType.java b/financer-common/src/main/java/de/financer/model/HolidayWeekendType.java similarity index 100% rename from financer-web-client/src/main/java/de/financer/model/HolidayWeekendType.java rename to financer-common/src/main/java/de/financer/model/HolidayWeekendType.java diff --git a/financer-web-client/src/main/java/de/financer/model/IntervalType.java b/financer-common/src/main/java/de/financer/model/IntervalType.java similarity index 100% rename from financer-web-client/src/main/java/de/financer/model/IntervalType.java rename to financer-common/src/main/java/de/financer/model/IntervalType.java diff --git a/financer-server/src/main/java/de/financer/model/RecurringTransaction.java b/financer-common/src/main/java/de/financer/model/RecurringTransaction.java similarity index 100% rename from financer-server/src/main/java/de/financer/model/RecurringTransaction.java rename to financer-common/src/main/java/de/financer/model/RecurringTransaction.java diff --git a/financer-server/src/main/java/de/financer/model/Transaction.java b/financer-common/src/main/java/de/financer/model/Transaction.java similarity index 100% rename from financer-server/src/main/java/de/financer/model/Transaction.java rename to financer-common/src/main/java/de/financer/model/Transaction.java diff --git a/financer-server/src/main/java/de/financer/model/package-info.java b/financer-common/src/main/java/de/financer/model/package-info.java similarity index 100% rename from financer-server/src/main/java/de/financer/model/package-info.java rename to financer-common/src/main/java/de/financer/model/package-info.java diff --git a/financer-common/src/main/java/de/financer/util/ExpensePeriod.java b/financer-common/src/main/java/de/financer/util/ExpensePeriod.java new file mode 100644 index 0000000..db0fd13 --- /dev/null +++ b/financer-common/src/main/java/de/financer/util/ExpensePeriod.java @@ -0,0 +1,55 @@ +package de.financer.util; + +import java.time.LocalDate; + +public class ExpensePeriod { + private LocalDate start; + private LocalDate end; + + private ExpensePeriod(LocalDate start, LocalDate end) { + this.start = start; + this.end = end; + } + + public static final ExpensePeriod getCurrentExpensePeriod(int periodStartDay) { + LocalDate periodStart; + LocalDate periodEnd; + + if (LocalDate.now().getDayOfMonth() < periodStartDay) { + // If the current day of month is less than the configured period start day + // we need to go back one month in time and then set the day to the configured + // start day. For example: + // configured start day of month for period = 15 + // now = 2019-06-10 + // => 10 < 15 + // now - one month = 2019-05-10 + // set the day = 2019-05-15 = start + // end = start + one month = 2019-06-15 + // Period from 2019-05-15 to 2019-06-15 + periodStart = LocalDate.now().minusMonths(1).withDayOfMonth(periodStartDay); + periodEnd = periodStart.plusMonths(1); + } + else { + // Else, the current day of month is greater or equals the configured period + // start day, just reset the day of month to the configured day, for example: + // configured start day of month for period = 15 + // now = 2019-06-26 + // => 26 > 15 + // set the day = 2019-06-15 = start + // end = start + one month = 2019-07-15 + // Period from 2019-06-15 to 2019-07-15 + periodStart = LocalDate.now().withDayOfMonth(periodStartDay); + periodEnd = periodStart.plusMonths(1); + } + + return new ExpensePeriod(periodStart, periodEnd); + } + + public LocalDate getStart() { + return start; + } + + public LocalDate getEnd() { + return end; + } +} diff --git a/financer-server/pom.xml b/financer-server/pom.xml index ac3ca2e..60889db 100644 --- a/financer-server/pom.xml +++ b/financer-server/pom.xml @@ -10,7 +10,6 @@ 11-SNAPSHOT - de.77zzcx7.financer financer-server ${packaging.type} The server part of the financer application - a simple app to manage your personal finances @@ -58,6 +57,11 @@ org.glassfish.jaxb jaxb-runtime + + + de.77zzcx7.financer + financer-common + diff --git a/financer-server/src/main/java/de/financer/config/FinancerConfig.java b/financer-server/src/main/java/de/financer/config/FinancerConfig.java index 55fd74b..3e8a5f6 100644 --- a/financer-server/src/main/java/de/financer/config/FinancerConfig.java +++ b/financer-server/src/main/java/de/financer/config/FinancerConfig.java @@ -21,7 +21,6 @@ public class FinancerConfig { private String dateFormat; private Collection mailRecipients; private String fromAddress; - private Integer monthPeriodStartDay; /** * @return the raw country code, mostly an uppercase ISO 3166 2-letter code @@ -110,32 +109,4 @@ public class FinancerConfig { public void setFromAddress(String fromAddress) { this.fromAddress = fromAddress; } - - /** - * The day of month that indicates a start of an expense period. Valid values range from 1-28. There is no special - * handling for months with more days. - * If the value is 15 for example an expense period is always from the 15th of the current month to the 15th of the - * next month: - * - * - * @return the day of month indicating the start of an expense period - */ - public Integer getMonthPeriodStartDay() { - return monthPeriodStartDay; - } - - public void setMonthPeriodStartDay(Integer monthPeriodStartDay) { - if (monthPeriodStartDay == null) { - throw new IllegalArgumentException("Parameter 'financer.monthPeriodStartDay' is not set!"); - } - else if (monthPeriodStartDay < 1 || monthPeriodStartDay > 28) { - throw new IllegalArgumentException("Parameter 'financer.monthPeriodStartDay' is out of range! Valid range from 1-28"); - } - - this.monthPeriodStartDay = monthPeriodStartDay; - } } diff --git a/financer-server/src/main/java/de/financer/controller/TransactionController.java b/financer-server/src/main/java/de/financer/controller/TransactionController.java index 7e4503e..e8180c9 100644 --- a/financer-server/src/main/java/de/financer/controller/TransactionController.java +++ b/financer-server/src/main/java/de/financer/controller/TransactionController.java @@ -81,12 +81,12 @@ public class TransactionController { } @RequestMapping("getExpensesCurrentPeriod") - public Long getExpensesCurrentPeriod() { + public Long getExpensesCurrentPeriod(Integer monthPeriodStartDay) { if (LOGGER.isDebugEnabled()) { - LOGGER.debug("/transactions/getExpensesCurrentPeriod called"); + LOGGER.debug(String.format("/transactions/getExpensesCurrentPeriod got parameters: %s", monthPeriodStartDay)); } - final Long response = this.transactionService.getExpensesCurrentPeriod(); + final Long response = this.transactionService.getExpensesCurrentPeriod(monthPeriodStartDay); if (LOGGER.isDebugEnabled()) { LOGGER.debug(String.format("/transactions/getExpensesCurrentPeriod returns with %s", response)); diff --git a/financer-server/src/main/java/de/financer/model/AccountType.java b/financer-server/src/main/java/de/financer/model/AccountType.java deleted file mode 100644 index 007146b..0000000 --- a/financer-server/src/main/java/de/financer/model/AccountType.java +++ /dev/null @@ -1,33 +0,0 @@ -package de.financer.model; - -import java.util.*; - -public enum AccountType { - /** Used to mark an account that acts as a source of money, e.g. monthly wage */ - INCOME, - - /** Indicates a real account at a bank, e.g. a check payment account */ - BANK, - - /** Marks an account as physical cash, e.g. the money currently in the purse */ - CASH, - - /** Used to mark an account that acts as a destination of money, e.g. through buying goods */ - EXPENSE, - - /** Marks an account as a liability from a third party, e.g. credit card or loan */ - LIABILITY, - - /** Marks the start account that is to be used to book all the opening balances for the different accounts */ - START; - - /** - * This method validates whether the given string represents a valid account type. - * - * @param type to check - * @return whether the given type represents a valid account type - */ - public static boolean isValidType(String type) { - return Arrays.stream(AccountType.values()).anyMatch((accountType) -> accountType.name().equals(type)); - } -} diff --git a/financer-server/src/main/java/de/financer/model/HolidayWeekendType.java b/financer-server/src/main/java/de/financer/model/HolidayWeekendType.java deleted file mode 100644 index b25cbdb..0000000 --- a/financer-server/src/main/java/de/financer/model/HolidayWeekendType.java +++ /dev/null @@ -1,65 +0,0 @@ -package de.financer.model; - -import java.util.Arrays; - -/** - * This enum specifies constants that control how actions should be handled that would fall on a holiday - * or weekday (where usually are no bookings done by e.g. banks) - */ -public enum HolidayWeekendType { - /** Indicates that the action should be done on the specified day regardless whether it's a holiday or a weekend */ - SAME_DAY, - - /** - *

- * Indicates that the action should be deferred to the next workday. - *

- *
-     *     Example 1:
-     *     MO   TU   WE   TH   FR   SA   SO
-     *               H              WE   WE   -> Holiday/WeekEnd
-     *               X                        -> Due date of action
-     *                    X'                  -> Deferred, effective due date of action
-     * 
- *
-     *     Example 2:
-     *     TU   WE   TH   FR   SA   SO   MO
-     *          H              WE   WE        -> Holiday/WeekEnd
-     *                         X              -> Due date of action
-     *                                   X'   -> Deferred, effective due date of action
-     * 
- * - */ - NEXT_WORKDAY, - - /** - *

- * Indicates that the action should preponed to the previous day - *

- *
-     *     Example 1:
-     *     MO   TU   WE   TH   FR   SA   SO
-     *               H              WE   WE   -> Holiday/WeekEnd
-     *               X                        -> Due date of action
-     *          X'                            -> Earlier, effective due date of action
-     * 
- *
-     *     Example 2:
-     *     MO   TU   WE   TH   FR   SA   SO
-     *                         H    WE   WE   -> Holiday/WeekEnd
-     *                                   X    -> Due date of action
-     *                    X'                  -> Earlier, effective due date of action
-     * 
- */ - PREVIOUS_WORKDAY; - - /** - * This method validates whether the given string represents a valid holiday weekend type. - * - * @param type to check - * @return whether the given type represents a valid holiday weekend type - */ - public static boolean isValidType(String type) { - return Arrays.stream(HolidayWeekendType.values()).anyMatch((holidayWeekendType) -> holidayWeekendType.name().equals(type)); - } -} diff --git a/financer-server/src/main/java/de/financer/model/IntervalType.java b/financer-server/src/main/java/de/financer/model/IntervalType.java deleted file mode 100644 index 952f9b8..0000000 --- a/financer-server/src/main/java/de/financer/model/IntervalType.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.financer.model; - -import java.util.Arrays; - -public enum IntervalType { - /** Indicates that an action should be executed every day */ - DAILY, - - /** Indicates that an action should be executed once a week */ - WEEKLY, - - /** Indicates that an action should be executed once a month */ - MONTHLY, - - /** Indicates that an action should be executed once a quarter */ - QUARTERLY, - - /** Indicates that an action should be executed once a year */ - YEARLY; - - /** - * This method validates whether the given string represents a valid interval type. - * - * @param type to check - * @return whether the given type represents a valid interval type - */ - public static boolean isValidType(String type) { - return Arrays.stream(IntervalType.values()).anyMatch((intervalType) -> intervalType.name().equals(type)); - } -} diff --git a/financer-server/src/main/java/de/financer/service/TransactionService.java b/financer-server/src/main/java/de/financer/service/TransactionService.java index 3f875bb..d9efca3 100644 --- a/financer-server/src/main/java/de/financer/service/TransactionService.java +++ b/financer-server/src/main/java/de/financer/service/TransactionService.java @@ -7,6 +7,7 @@ import de.financer.model.Account; import de.financer.model.AccountType; import de.financer.model.RecurringTransaction; import de.financer.model.Transaction; +import de.financer.util.ExpensePeriod; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.slf4j.Logger; @@ -224,12 +225,17 @@ public class TransactionService { return response; } - public Long getExpensesCurrentPeriod() { - final LocalDate periodStart = LocalDate.now().withDayOfMonth(this.financerConfig.getMonthPeriodStartDay()); - final LocalDate periodEnd = periodStart.plusMonths(1); + public Long getExpensesCurrentPeriod(Integer monthPeriodStartDay) { + if (monthPeriodStartDay == null) { + return Long.valueOf(-1l); + } + + final ExpensePeriod expensePeriod = ExpensePeriod + .getCurrentExpensePeriod(monthPeriodStartDay); final Long expensesCurrentPeriod = this.transactionRepository - .getExpensesCurrentPeriod(periodStart, periodEnd, AccountType.EXPENSE, AccountType.LIABILITY); + .getExpensesCurrentPeriod(expensePeriod.getStart(), expensePeriod + .getEnd(), AccountType.EXPENSE, AccountType.LIABILITY); return Optional.ofNullable(expensesCurrentPeriod).orElse(Long.valueOf(0l)); } diff --git a/financer-server/src/main/resources/config/application.properties b/financer-server/src/main/resources/config/application.properties index 740c91d..51e132e 100644 --- a/financer-server/src/main/resources/config/application.properties +++ b/financer-server/src/main/resources/config/application.properties @@ -1,7 +1,7 @@ ### ### This is the main configuration file of the application. ### Filtering of the @...@ values happens via the maven-resource-plugin. The execution of the plugin is configured in -### the Spring Boot parent POM. +### the Spring Boot parent POM.// The same property exists on the server, look there for documentation spring.profiles.active=@activeProfiles@ @@ -46,7 +46,4 @@ spring.mail.host=localhost # Disable JMX as we don't need it and it blocks parallel deployment on Tomcat # because the connection pool cannot shutdown properly -spring.jmx.enabled=false - -# The day of month indicating the start of an expense period. Valid values range from 1-28 -financer.monthPeriodStartDay=15 \ No newline at end of file +spring.jmx.enabled=false \ No newline at end of file diff --git a/financer-web-client/pom.xml b/financer-web-client/pom.xml index 09c50fa..abbf5bf 100644 --- a/financer-web-client/pom.xml +++ b/financer-web-client/pom.xml @@ -10,7 +10,6 @@ 11-SNAPSHOT - de.77zzcx7.financer financer-web-client ${packaging.type} The web client part of the financer application - a simple app to manage your personal finances @@ -49,6 +48,12 @@
+ + + de.77zzcx7.financer + financer-common + + diff --git a/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java b/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java index 0648ef1..07ebb0d 100644 --- a/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java +++ b/financer-web-client/src/main/java/de/financer/config/FinancerConfig.java @@ -39,7 +39,19 @@ public class FinancerConfig { this.version = version; } - // The same property exists on the server, look there for documentation + /** + * The day of month that indicates a start of an expense period. Valid values range from 1-28. There is no special + * handling for months with more days. + * If the value is 15 for example an expense period is always from the 15th of the current month to the 15th of the + * next month: + * + * + * @return the day of month indicating the start of an expense period + */ public Integer getMonthPeriodStartDay() { return monthPeriodStartDay; } diff --git a/financer-web-client/src/main/java/de/financer/controller/AccountController.java b/financer-web-client/src/main/java/de/financer/controller/AccountController.java index f039b85..e70e29d 100644 --- a/financer-web-client/src/main/java/de/financer/controller/AccountController.java +++ b/financer-web-client/src/main/java/de/financer/controller/AccountController.java @@ -6,6 +6,7 @@ import de.financer.controller.template.*; import de.financer.form.NewAccountForm; import de.financer.model.*; import de.financer.util.ControllerUtils; +import de.financer.util.ExpensePeriod; import de.financer.util.TransactionUtils; import de.financer.util.comparator.TransactionByDateByIdDescComparator; import org.apache.commons.collections4.IterableUtils; @@ -36,16 +37,16 @@ public class AccountController { final ResponseEntity currentAssets = new GetCurrentAssetsTemplate().exchange(this.financerConfig); final ResponseEntity currentExpenses = new GetExpensesCurrentPeriodTemplate().exchange(this.financerConfig); final boolean showClosedBoolean = BooleanUtils.toBoolean(showClosed); - final LocalDate periodStart = LocalDate.now().withDayOfMonth(this.financerConfig.getMonthPeriodStartDay()); - final LocalDate periodEnd = periodStart.plusMonths(1); + final ExpensePeriod expensePeriod = ExpensePeriod + .getCurrentExpensePeriod(this.financerConfig.getMonthPeriodStartDay()); 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("currentExpenses", currentExpenses.getBody()); - model.addAttribute("periodStart", ControllerUtils.formatDate(this.financerConfig, periodStart)); - model.addAttribute("periodEnd", ControllerUtils.formatDate(this.financerConfig, periodEnd)); + model.addAttribute("periodStart", expensePeriod.getStart()); + model.addAttribute("periodEnd", expensePeriod.getEnd()); model.addAttribute("showClosed", showClosedBoolean); ControllerUtils.addVersionAttribute(model, this.financerConfig); diff --git a/financer-web-client/src/main/java/de/financer/controller/template/GetExpensesCurrentPeriodTemplate.java b/financer-web-client/src/main/java/de/financer/controller/template/GetExpensesCurrentPeriodTemplate.java index 3eed6ab..fb2c8b4 100644 --- a/financer-web-client/src/main/java/de/financer/controller/template/GetExpensesCurrentPeriodTemplate.java +++ b/financer-web-client/src/main/java/de/financer/controller/template/GetExpensesCurrentPeriodTemplate.java @@ -2,14 +2,20 @@ package de.financer.controller.template; import de.financer.config.FinancerConfig; import de.financer.controller.Function; +import de.financer.model.Transaction; import de.financer.util.ControllerUtils; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.ResponseEntity; +import org.springframework.web.util.UriComponentsBuilder; public class GetExpensesCurrentPeriodTemplate { public ResponseEntity exchange(FinancerConfig financerConfig) { - return new FinancerRestTemplate().exchange(ControllerUtils - .buildUrl(financerConfig, Function.TR_EXPENSES_CURRENT_PERIOD), new ParameterizedTypeReference() { - }); + final UriComponentsBuilder transactionBuilder = UriComponentsBuilder + .fromHttpUrl(ControllerUtils.buildUrl(financerConfig, Function.TR_EXPENSES_CURRENT_PERIOD)) + .queryParam("monthPeriodStartDay", financerConfig.getMonthPeriodStartDay()); + + return new FinancerRestTemplate() + .exchange(transactionBuilder.toUriString(), new ParameterizedTypeReference() { + }); } } diff --git a/financer-web-client/src/main/java/de/financer/model/Account.java b/financer-web-client/src/main/java/de/financer/model/Account.java deleted file mode 100644 index 50d0ff3..0000000 --- a/financer-web-client/src/main/java/de/financer/model/Account.java +++ /dev/null @@ -1,54 +0,0 @@ -package de.financer.model; - -public class Account { - private Long id; - private String key; - private AccountType type; - private AccountStatus status; - private Long currentBalance; - private AccountGroup accountGroup; - - public Long getId() { - return id; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public AccountType getType() { - return type; - } - - public void setType(AccountType type) { - this.type = type; - } - - public AccountStatus getStatus() { - return status; - } - - public void setStatus(AccountStatus status) { - this.status = status; - } - - public Long getCurrentBalance() { - return currentBalance; - } - - public void setCurrentBalance(Long currentBalance) { - this.currentBalance = currentBalance; - } - - public AccountGroup getAccountGroup() { - return accountGroup; - } - - public void setAccountGroup(AccountGroup accountGroup) { - this.accountGroup = accountGroup; - } -} diff --git a/financer-web-client/src/main/java/de/financer/model/AccountGroup.java b/financer-web-client/src/main/java/de/financer/model/AccountGroup.java deleted file mode 100644 index 8e0a90f..0000000 --- a/financer-web-client/src/main/java/de/financer/model/AccountGroup.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.financer.model; - -public class AccountGroup { - private Long id; - private String name; - - public Long getId() { - return id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/financer-web-client/src/main/java/de/financer/model/AccountStatus.java b/financer-web-client/src/main/java/de/financer/model/AccountStatus.java deleted file mode 100644 index 9298e31..0000000 --- a/financer-web-client/src/main/java/de/financer/model/AccountStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.financer.model; - -import java.util.Arrays; - -public enum AccountStatus { - /** Indicates that the account is open for bookings */ - OPEN, - /** Indicates that the account is closed and bookings to it are forbidden */ - CLOSED; - - /** - * This method validates whether the given string represents a valid account status. - * - * @param status to check - * @return whether the given status represents a valid account status - */ - public static boolean isValidType(String status) { - return Arrays.stream(AccountStatus.values()).anyMatch((accountStatus) -> accountStatus.name().equals(status)); - } -} diff --git a/financer-web-client/src/main/java/de/financer/model/RecurringTransaction.java b/financer-web-client/src/main/java/de/financer/model/RecurringTransaction.java deleted file mode 100644 index a2d486a..0000000 --- a/financer-web-client/src/main/java/de/financer/model/RecurringTransaction.java +++ /dev/null @@ -1,92 +0,0 @@ -package de.financer.model; - -import java.time.LocalDate; - -public class RecurringTransaction { - private Long id; - private Account fromAccount; - private Account toAccount; - private String description; - private Long amount; - private IntervalType intervalType; - private LocalDate firstOccurrence; - private LocalDate lastOccurrence; - private HolidayWeekendType holidayWeekendType; - private boolean remind; - - public Long getId() { - return id; - } - - public Account getFromAccount() { - return fromAccount; - } - - public void setFromAccount(Account fromAccount) { - this.fromAccount = fromAccount; - } - - public Account getToAccount() { - return toAccount; - } - - public void setToAccount(Account toAccount) { - this.toAccount = toAccount; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Long getAmount() { - return amount; - } - - public void setAmount(Long amount) { - this.amount = amount; - } - - public HolidayWeekendType getHolidayWeekendType() { - return holidayWeekendType; - } - - public void setHolidayWeekendType(HolidayWeekendType holidayWeekendType) { - this.holidayWeekendType = holidayWeekendType; - } - - public LocalDate getLastOccurrence() { - return lastOccurrence; - } - - public void setLastOccurrence(LocalDate lastOccurrence) { - this.lastOccurrence = lastOccurrence; - } - - public LocalDate getFirstOccurrence() { - return firstOccurrence; - } - - public void setFirstOccurrence(LocalDate firstOccurrence) { - this.firstOccurrence = firstOccurrence; - } - - public IntervalType getIntervalType() { - return intervalType; - } - - public void setIntervalType(IntervalType intervalType) { - this.intervalType = intervalType; - } - - public boolean isRemind() { - return remind; - } - - public void setRemind(boolean remind) { - this.remind = remind; - } -} diff --git a/financer-web-client/src/main/java/de/financer/model/Transaction.java b/financer-web-client/src/main/java/de/financer/model/Transaction.java deleted file mode 100644 index 16c848d..0000000 --- a/financer-web-client/src/main/java/de/financer/model/Transaction.java +++ /dev/null @@ -1,65 +0,0 @@ -package de.financer.model; - -import java.time.LocalDate; - -public class Transaction { - private Long id; - private Account fromAccount; - private Account toAccount; - private LocalDate date; - private String description; - private Long amount; - private RecurringTransaction recurringTransaction; - - public Long getId() { - return id; - } - - public Account getFromAccount() { - return fromAccount; - } - - public void setFromAccount(Account fromAccount) { - this.fromAccount = fromAccount; - } - - public Account getToAccount() { - return toAccount; - } - - public void setToAccount(Account toAccount) { - this.toAccount = toAccount; - } - - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Long getAmount() { - return amount; - } - - public void setAmount(Long amount) { - this.amount = amount; - } - - public RecurringTransaction getRecurringTransaction() { - return recurringTransaction; - } - - public void setRecurringTransaction(RecurringTransaction recurringTransaction) { - this.recurringTransaction = recurringTransaction; - } -} diff --git a/financer-web-client/src/main/resources/i18n/message.properties b/financer-web-client/src/main/resources/i18n/message.properties index 9e3b18c..ef3b9ca 100644 --- a/financer-web-client/src/main/resources/i18n/message.properties +++ b/financer-web-client/src/main/resources/i18n/message.properties @@ -19,6 +19,7 @@ financer.account-overview.table-header.balance=Current Balance financer.account-overview.table-header.type=Type financer.account-overview.table-header.status=Status financer.account-overview.tooltip.status.current-expenses=Period from {0} to {1} +financer.account-overview.tooltip.status.current-assets=Assets available at short-notice financer.account-new.title=financer\: create new account financer.account-new.label.key=Key\: @@ -133,6 +134,8 @@ financer.heading.recurring-transaction-list.active=financer\: active recurring t financer.heading.recurring-transaction-list.all=financer\: all recurring transaction financer.heading.recurring-to-transaction-with-amount=financer\: create transaction from recurring with amount +financer.cancel-back-to-overview=Cancel and back to overview + financer.error-message.UNKNOWN_ERROR=An unknown error occurred! financer.error-message.INVALID_ACCOUNT_TYPE=The selected account type is not valid! financer.error-message.FROM_ACCOUNT_NOT_FOUND=The specified from account has not been found! diff --git a/financer-web-client/src/main/resources/i18n/message_de_DE.properties b/financer-web-client/src/main/resources/i18n/message_de_DE.properties index 425644e..4555889 100644 --- a/financer-web-client/src/main/resources/i18n/message_de_DE.properties +++ b/financer-web-client/src/main/resources/i18n/message_de_DE.properties @@ -19,6 +19,7 @@ financer.account-overview.table-header.balance=Kontostand financer.account-overview.table-header.type=Typ financer.account-overview.table-header.status=Status financer.account-overview.tooltip.status.current-expenses=Periode ab {0} bis {1} +financer.account-overview.tooltip.status.current-assets=Kurzfristig verf\u00FCgbares Verm\u00F6gen financer.account-new.title=financer\: Neues Konto erstellen financer.account-new.label.key=Schl\u00FCssel\: @@ -131,4 +132,6 @@ financer.heading.account-details=financer\: Kontodetails f\u00FCr {0} financer.heading.recurring-transaction-list.dueToday=financer\: wiederkehrende Buchungen heute f\u00E4llig financer.heading.recurring-transaction-list.active=financer\: aktive wiederkehrende Buchungen financer.heading.recurring-transaction-list.all=financer\: alle wiederkehrende Buchungen -financer.heading.recurring-to-transaction-with-amount=financer\: Buchung mit Betrag aus wiederkehrender Buchung erstellen \ No newline at end of file +financer.heading.recurring-to-transaction-with-amount=financer\: Buchung mit Betrag aus wiederkehrender Buchung erstellen + +financer.cancel-back-to-overview=Abbrechen und zur \u00DCbersicht \ No newline at end of file diff --git a/financer-web-client/src/main/resources/static/css/main.css b/financer-web-client/src/main/resources/static/css/main.css index 8f3eef5..6644a3f 100644 --- a/financer-web-client/src/main/resources/static/css/main.css +++ b/financer-web-client/src/main/resources/static/css/main.css @@ -74,6 +74,14 @@ tr:hover { box-sizing: border-box; } +input[type=submit] { + margin-bottom: 1em; +} + +#footer-container { + margin-top: 1em; +} + #footer-container * { display: block; } diff --git a/financer-web-client/src/main/resources/templates/account/accountDetails.html b/financer-web-client/src/main/resources/templates/account/accountDetails.html index e393186..b8b42d4 100644 --- a/financer-web-client/src/main/resources/templates/account/accountDetails.html +++ b/financer-web-client/src/main/resources/templates/account/accountDetails.html @@ -47,7 +47,7 @@ - + diff --git a/financer-web-client/src/main/resources/templates/account/accountOverview.html b/financer-web-client/src/main/resources/templates/account/accountOverview.html index 2878d50..20baabd 100644 --- a/financer-web-client/src/main/resources/templates/account/accountOverview.html +++ b/financer-web-client/src/main/resources/templates/account/accountOverview.html @@ -10,11 +10,11 @@

-
+
-
+
diff --git a/financer-web-client/src/main/resources/templates/account/newAccount.html b/financer-web-client/src/main/resources/templates/account/newAccount.html index 7a10e30..d053612 100644 --- a/financer-web-client/src/main/resources/templates/account/newAccount.html +++ b/financer-web-client/src/main/resources/templates/account/newAccount.html @@ -9,6 +9,7 @@

+

+

+

+ - - + + diff --git a/financer-web-client/src/main/resources/templates/transaction/newTransaction.html b/financer-web-client/src/main/resources/templates/transaction/newTransaction.html index 791f08f..0727f4f 100644 --- a/financer-web-client/src/main/resources/templates/transaction/newTransaction.html +++ b/financer-web-client/src/main/resources/templates/transaction/newTransaction.html @@ -9,6 +9,7 @@

+