Add tax relevant flag to transaction and recc. transaction
This commit is contained in:
@@ -22,6 +22,7 @@ public class RecurringTransaction {
|
||||
private HolidayWeekendType holidayWeekendType;
|
||||
private boolean deleted;
|
||||
private boolean remind;
|
||||
private boolean taxRelevant;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -106,4 +107,12 @@ public class RecurringTransaction {
|
||||
public void setRemind(boolean remind) {
|
||||
this.remind = remind;
|
||||
}
|
||||
|
||||
public boolean isTaxRelevant() {
|
||||
return taxRelevant;
|
||||
}
|
||||
|
||||
public void setTaxRelevant(boolean taxRelevant) {
|
||||
this.taxRelevant = taxRelevant;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class Transaction {
|
||||
inverseJoinColumns = @JoinColumn(name = "period_id"))
|
||||
//@formatter:on
|
||||
private Set<Period> periods;
|
||||
private boolean taxRelevant;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
@@ -87,4 +88,12 @@ public class Transaction {
|
||||
public void setPeriods(Set<Period> periods) {
|
||||
this.periods = periods;
|
||||
}
|
||||
|
||||
public boolean isTaxRelevant() {
|
||||
return taxRelevant;
|
||||
}
|
||||
|
||||
public void setTaxRelevant(boolean taxRelevant) {
|
||||
this.taxRelevant = taxRelevant;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<properties>
|
||||
<packaging.type>jar</packaging.type>
|
||||
<activeProfiles>hsqldb,dev</activeProfiles>
|
||||
<activeProfiles>postgres,dev</activeProfiles>
|
||||
<deploymentProfile>mk</deploymentProfile>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class RecurringTransactionController {
|
||||
public ResponseEntity createRecurringTransaction(String fromAccountKey, String toAccountKey, Long amount,
|
||||
String description, String holidayWeekendType,
|
||||
String intervalType, String firstOccurrence,
|
||||
String lastOccurrence, Boolean remind
|
||||
String lastOccurrence, Boolean remind, Boolean taxRelevant
|
||||
) {
|
||||
final String decodedFrom = ControllerUtil.urlDecode(fromAccountKey);
|
||||
final String decodedTo = ControllerUtil.urlDecode(toAccountKey);
|
||||
@@ -62,13 +62,13 @@ public class RecurringTransactionController {
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String
|
||||
.format("/recurringTransactions/createRecurringTransaction got parameters: %s, %s, %s, %s, %s, " +
|
||||
"%s, %s, %s, %s", decodedFrom, decodedTo, amount, decodedDesc, holidayWeekendType,
|
||||
intervalType, firstOccurrence, lastOccurrence, remind));
|
||||
"%s, %s, %s, %s, %s", decodedFrom, decodedTo, amount, decodedDesc, holidayWeekendType,
|
||||
intervalType, firstOccurrence, lastOccurrence, remind, taxRelevant));
|
||||
}
|
||||
|
||||
final ResponseReason responseReason = this.recurringTransactionService
|
||||
.createRecurringTransaction(decodedFrom, decodedTo, amount, decodedDesc, holidayWeekendType,
|
||||
intervalType, firstOccurrence, lastOccurrence, remind);
|
||||
intervalType, firstOccurrence, lastOccurrence, remind, taxRelevant);
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TransactionController {
|
||||
|
||||
@RequestMapping(value = "createTransaction")
|
||||
public ResponseEntity createTransaction(String fromAccountKey, String toAccountKey, Long amount, String date,
|
||||
String description
|
||||
String description, Boolean taxRelevant
|
||||
) {
|
||||
final String decodedFrom = ControllerUtil.urlDecode(fromAccountKey);
|
||||
final String decodedTo = ControllerUtil.urlDecode(toAccountKey);
|
||||
@@ -47,12 +47,12 @@ public class TransactionController {
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String
|
||||
.format("/transactions/createTransaction got parameters: %s, %s, %s, %s, %s",
|
||||
decodedFrom, decodedTo, amount, date, decodedDesc));
|
||||
.format("/transactions/createTransaction got parameters: %s, %s, %s, %s, %s, %s",
|
||||
decodedFrom, decodedTo, amount, date, decodedDesc, taxRelevant));
|
||||
}
|
||||
|
||||
final ResponseReason responseReason = this.transactionService
|
||||
.createTransaction(decodedFrom, decodedTo, amount, date, decodedDesc);
|
||||
.createTransaction(decodedFrom, decodedTo, amount, date, decodedDesc, taxRelevant);
|
||||
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug(String.format("/transactions/createTransaction returns with %s", responseReason.name()));
|
||||
|
||||
@@ -318,7 +318,7 @@ public class RecurringTransactionService {
|
||||
public ResponseReason createRecurringTransaction(String fromAccountKey, String toAccountKey, Long amount,
|
||||
String description, String holidayWeekendType,
|
||||
String intervalType, String firstOccurrence,
|
||||
String lastOccurrence, Boolean remind
|
||||
String lastOccurrence, Boolean remind, Boolean taxRelevant
|
||||
) {
|
||||
final Account fromAccount = this.accountService.getAccountByKey(fromAccountKey);
|
||||
final Account toAccount = this.accountService.getAccountByKey(toAccountKey);
|
||||
@@ -332,7 +332,7 @@ public class RecurringTransactionService {
|
||||
|
||||
try {
|
||||
final RecurringTransaction transaction = buildRecurringTransaction(fromAccount, toAccount, amount,
|
||||
description, holidayWeekendType, intervalType, firstOccurrence, lastOccurrence, remind);
|
||||
description, holidayWeekendType, intervalType, firstOccurrence, lastOccurrence, remind, taxRelevant);
|
||||
|
||||
this.recurringTransactionRepository.save(transaction);
|
||||
|
||||
@@ -357,13 +357,15 @@ public class RecurringTransactionService {
|
||||
* @param firstOccurrence the first occurrence
|
||||
* @param lastOccurrence the last occurrence, may be <code>null</code>
|
||||
* @param remind the remind flag
|
||||
* @param taxRelevant whether the recurring transaction, respectively its transaction instances, are relevant for
|
||||
* tax declaration
|
||||
*
|
||||
* @return the build {@link RecurringTransaction} instance
|
||||
*/
|
||||
private RecurringTransaction buildRecurringTransaction(Account fromAccount, Account toAccount, Long amount,
|
||||
String description, String holidayWeekendType,
|
||||
String intervalType, String firstOccurrence,
|
||||
String lastOccurrence, Boolean remind
|
||||
String lastOccurrence, Boolean remind, Boolean taxRelevant
|
||||
) {
|
||||
final RecurringTransaction recurringTransaction = new RecurringTransaction();
|
||||
|
||||
@@ -378,6 +380,7 @@ public class RecurringTransactionService {
|
||||
// See 'resources/database/postgres/readme_V1_0_0__init.txt'
|
||||
recurringTransaction.setDeleted(false);
|
||||
recurringTransaction.setRemind(BooleanUtils.toBooleanDefaultIfNull(remind, true));
|
||||
recurringTransaction.setTaxRelevant(taxRelevant);
|
||||
|
||||
// lastOccurrence is optional
|
||||
if (StringUtils.isNotEmpty(lastOccurrence)) {
|
||||
@@ -472,7 +475,8 @@ public class RecurringTransactionService {
|
||||
amount.orElseGet(recurringTransaction::getAmount),
|
||||
LocalDate.now().format(DateTimeFormatter.ofPattern(this.financerConfig.getDateFormat())),
|
||||
recurringTransaction.getDescription(),
|
||||
recurringTransaction);
|
||||
recurringTransaction,
|
||||
recurringTransaction.isTaxRelevant());
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
|
||||
@@ -69,14 +69,15 @@ public class TransactionService {
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
public ResponseReason createTransaction(String fromAccountKey, String toAccountKey, Long amount, String date,
|
||||
String description
|
||||
String description, Boolean taxRelevant
|
||||
) {
|
||||
return this.createTransaction(fromAccountKey, toAccountKey, amount, date, description, null);
|
||||
return this.createTransaction(fromAccountKey, toAccountKey, amount, date, description, null, taxRelevant);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
public ResponseReason createTransaction(String fromAccountKey, String toAccountKey, Long amount, String date,
|
||||
String description, RecurringTransaction recurringTransaction
|
||||
String description, RecurringTransaction recurringTransaction,
|
||||
Boolean taxRelevant
|
||||
) {
|
||||
final Account fromAccount = this.accountService.getAccountByKey(fromAccountKey);
|
||||
final Account toAccount = this.accountService.getAccountByKey(toAccountKey);
|
||||
@@ -88,7 +89,8 @@ public class TransactionService {
|
||||
}
|
||||
|
||||
try {
|
||||
final Transaction transaction = buildTransaction(fromAccount, toAccount, amount, description, date, recurringTransaction);
|
||||
final Transaction transaction =
|
||||
buildTransaction(fromAccount, toAccount, amount, description, date, recurringTransaction, taxRelevant);
|
||||
|
||||
transaction.setPeriods(getRelevantPeriods(transaction));
|
||||
|
||||
@@ -143,11 +145,12 @@ public class TransactionService {
|
||||
* @param date the date of the transaction
|
||||
* @param recurringTransaction the recurring transaction that caused the creation of this transaction, may be
|
||||
* <code>null</code>
|
||||
* @param taxRelevant whether the transaction is relevant for tax declaration
|
||||
*
|
||||
* @return the build {@link Transaction} instance
|
||||
*/
|
||||
private Transaction buildTransaction(Account fromAccount, Account toAccount, Long amount, String description,
|
||||
String date, RecurringTransaction recurringTransaction
|
||||
String date, RecurringTransaction recurringTransaction, Boolean taxRelevant
|
||||
) {
|
||||
final Transaction transaction = new Transaction();
|
||||
|
||||
@@ -157,6 +160,7 @@ public class TransactionService {
|
||||
transaction.setDescription(description);
|
||||
transaction.setDate(LocalDate.parse(date, DateTimeFormatter.ofPattern(this.financerConfig.getDateFormat())));
|
||||
transaction.setRecurringTransaction(recurringTransaction);
|
||||
transaction.setTaxRelevant(taxRelevant);
|
||||
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
-- Add a new column to the transaction table that denotes whether this transaction is
|
||||
-- relevant for tax declaration
|
||||
ALTER TABLE "transaction"
|
||||
ADD COLUMN tax_relevant BOOLEAN DEFAULT FALSE NOT NULL;
|
||||
|
||||
ALTER TABLE recurring_transaction
|
||||
ADD COLUMN tax_relevant BOOLEAN DEFAULT FALSE NOT NULL;
|
||||
@@ -0,0 +1,7 @@
|
||||
-- Add a new column to the transaction table that denotes whether this transaction is
|
||||
-- relevant for tax declaration
|
||||
ALTER TABLE "transaction"
|
||||
ADD COLUMN tax_relevant BOOLEAN DEFAULT 'FALSE' NOT NULL;
|
||||
|
||||
ALTER TABLE recurring_transaction
|
||||
ADD COLUMN tax_relevant BOOLEAN DEFAULT 'FALSE' NOT NULL;
|
||||
@@ -52,7 +52,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.FROM_AND_TO_ACCOUNT_NOT_FOUND, response);
|
||||
@@ -72,7 +73,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.TO_ACCOUNT_NOT_FOUND, response);
|
||||
@@ -92,7 +94,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.FROM_ACCOUNT_NOT_FOUND, response);
|
||||
@@ -113,7 +116,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.INVALID_BOOKING_ACCOUNTS, response);
|
||||
@@ -134,7 +138,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.MISSING_AMOUNT, response);
|
||||
@@ -155,7 +160,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.AMOUNT_ZERO, response);
|
||||
@@ -176,7 +182,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.MISSING_HOLIDAY_WEEKEND_TYPE, response);
|
||||
@@ -197,7 +204,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.INVALID_HOLIDAY_WEEKEND_TYPE, response);
|
||||
@@ -218,7 +226,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
null,
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.MISSING_INTERVAL_TYPE, response);
|
||||
@@ -239,7 +248,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
"INTERVAL_TYPE",
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.INVALID_INTERVAL_TYPE, response);
|
||||
@@ -260,7 +270,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
IntervalType.DAILY.name(),
|
||||
null,
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.MISSING_FIRST_OCCURRENCE, response);
|
||||
@@ -281,7 +292,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
IntervalType.DAILY.name(),
|
||||
"FIRST_OCCURRENCE",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.INVALID_FIRST_OCCURRENCE_FORMAT, response);
|
||||
@@ -302,7 +314,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
IntervalType.DAILY.name(),
|
||||
"07.03.2019",
|
||||
"LAST_OCCURRENCE",
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.INVALID_LAST_OCCURRENCE_FORMAT, response);
|
||||
@@ -324,7 +337,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
IntervalType.DAILY.name(),
|
||||
"07.03.2019",
|
||||
null,
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.UNKNOWN_ERROR, response);
|
||||
@@ -345,7 +359,8 @@ public class RecurringTransactionService_createRecurringTransactionTest {
|
||||
IntervalType.DAILY.name(),
|
||||
"07.03.2019",
|
||||
null,
|
||||
Boolean.TRUE);
|
||||
Boolean.TRUE,
|
||||
Boolean.FALSE);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.OK, response);
|
||||
|
||||
@@ -48,7 +48,7 @@ public class TransactionService_createTransactionTest {
|
||||
// will not be found.
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.invalid", "account.invalid", Long.valueOf(150l), "24.02.2019", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.invalid", "account.invalid", Long.valueOf(150l), "24.02.2019", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.FROM_AND_TO_ACCOUNT_NOT_FOUND, response);
|
||||
@@ -60,7 +60,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(this.accountService.getAccountByKey(Mockito.anyString())).thenReturn(createAccount(), null);
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.invalid", Long.valueOf(150l), "24.02.2019", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.invalid", Long.valueOf(150l), "24.02.2019", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.TO_ACCOUNT_NOT_FOUND, response);
|
||||
@@ -72,7 +72,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(this.accountService.getAccountByKey(Mockito.anyString())).thenReturn(null, createAccount());
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.invalid", "account.to", Long.valueOf(150l), "24.02.2019", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.invalid", "account.to", Long.valueOf(150l), "24.02.2019", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.FROM_ACCOUNT_NOT_FOUND, response);
|
||||
@@ -85,7 +85,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(this.ruleService.isValidBooking(Mockito.any(Account.class), Mockito.any(Account.class))).thenReturn(Boolean.FALSE);
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(150l), "24.02.2019", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(150l), "24.02.2019", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.INVALID_BOOKING_ACCOUNTS, response);
|
||||
@@ -98,7 +98,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(this.ruleService.isValidBooking(Mockito.any(Account.class), Mockito.any(Account.class))).thenReturn(Boolean.TRUE);
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", null, "24.02.2019", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", null, "24.02.2019", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.MISSING_AMOUNT, response);
|
||||
@@ -111,7 +111,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(this.ruleService.isValidBooking(Mockito.any(Account.class), Mockito.any(Account.class))).thenReturn(Boolean.TRUE);
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(0l), "24.02.2019", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(0l), "24.02.2019", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.AMOUNT_ZERO, response);
|
||||
@@ -124,7 +124,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(this.ruleService.isValidBooking(Mockito.any(Account.class), Mockito.any(Account.class))).thenReturn(Boolean.TRUE);
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(125l), null, "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(125l), null, "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.MISSING_DATE, response);
|
||||
@@ -137,7 +137,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(this.ruleService.isValidBooking(Mockito.any(Account.class), Mockito.any(Account.class))).thenReturn(Boolean.TRUE);
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(125l), "2019-01-01", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(125l), "2019-01-01", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.INVALID_DATE_FORMAT, response);
|
||||
@@ -156,7 +156,7 @@ public class TransactionService_createTransactionTest {
|
||||
Mockito.when(toAccount.getCurrentBalance()).thenReturn(Long.valueOf(0l));
|
||||
|
||||
// Act
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(125l), "24.02.2019", "XXX");
|
||||
final ResponseReason response = this.classUnderTest.createTransaction("account.from", "account.to", Long.valueOf(125l), "24.02.2019", "XXX", false);
|
||||
|
||||
// Assert
|
||||
Assert.assertEquals(ResponseReason.OK, response);
|
||||
|
||||
@@ -62,7 +62,8 @@ public class RecurringTransactionController {
|
||||
.queryParam("holidayWeekendType", form.getHolidayWeekendType())
|
||||
.queryParam("intervalType", form.getIntervalType())
|
||||
.queryParam("description", form.getDescription())
|
||||
.queryParam("remind", form.getRemind());
|
||||
.queryParam("remind", form.getRemind())
|
||||
.queryParam("taxRelevant", form.getTaxRelevant());
|
||||
|
||||
final ResponseEntity<String> response = new StringTemplate().exchange(builder);
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@ public class TransactionController {
|
||||
.queryParam("toAccountKey", form.getToAccountKey())
|
||||
.queryParam("amount", form.getAmount())
|
||||
.queryParam("date", ControllerUtils.formatDate(this.financerConfig, form.getDate()))
|
||||
.queryParam("description", form.getDescription());
|
||||
.queryParam("description", form.getDescription())
|
||||
.queryParam("taxRelevant", form.getTaxRelevant());
|
||||
|
||||
final ResponseEntity<String> response = new StringTemplate().exchange(builder);
|
||||
final ResponseReason responseReason = ResponseReason.fromResponseEntity(response);
|
||||
|
||||
@@ -10,6 +10,7 @@ public class NewRecurringTransactionForm {
|
||||
private String intervalType;
|
||||
private String holidayWeekendType;
|
||||
private Boolean remind;
|
||||
private Boolean taxRelevant;
|
||||
|
||||
public String getFromAccountKey() {
|
||||
return fromAccountKey;
|
||||
@@ -82,4 +83,12 @@ public class NewRecurringTransactionForm {
|
||||
public void setRemind(Boolean remind) {
|
||||
this.remind = remind;
|
||||
}
|
||||
|
||||
public Boolean getTaxRelevant() {
|
||||
return taxRelevant;
|
||||
}
|
||||
|
||||
public void setTaxRelevant(Boolean taxRelevant) {
|
||||
this.taxRelevant = taxRelevant;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ public class NewTransactionForm {
|
||||
private String amount;
|
||||
private String date;
|
||||
private String description;
|
||||
private Boolean taxRelevant;
|
||||
|
||||
public String getFromAccountKey() {
|
||||
return fromAccountKey;
|
||||
@@ -46,4 +47,12 @@ public class NewTransactionForm {
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Boolean getTaxRelevant() {
|
||||
return taxRelevant;
|
||||
}
|
||||
|
||||
public void setTaxRelevant(Boolean taxRelevant) {
|
||||
this.taxRelevant = taxRelevant;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ financer.transaction-new.label.to-account=To account\:
|
||||
financer.transaction-new.label.amount=Amount\:
|
||||
financer.transaction-new.label.date=Date\:
|
||||
financer.transaction-new.label.description=Description\:
|
||||
financer.transaction-new.label.taxRelevant=Tax relevant\:
|
||||
financer.transaction-new.submit=Create transaction
|
||||
financer.transaction-new.account-type.BANK={0}|Bank|{1}{2}
|
||||
financer.transaction-new.account-type.CASH={0}|Cash|{1}{2}
|
||||
@@ -60,6 +61,7 @@ financer.recurring-transaction-new.label.interval-type=Interval\:
|
||||
financer.recurring-transaction-new.label.holiday-weekend-type=Holiday/weekend rule\:
|
||||
financer.recurring-transaction-new.label.description=Description\:
|
||||
financer.recurring-transaction-new.label.remind=Remind if due\:
|
||||
financer.recurring-transaction-new.label.taxRelevant=Tax relevant\:
|
||||
financer.recurring-transaction-new.submit=Create recurring transaction
|
||||
financer.recurring-transaction-new.account-type.BANK={0}|Bank|{1}{2}
|
||||
financer.recurring-transaction-new.account-type.CASH={0}|Cash|{1}{2}
|
||||
@@ -80,11 +82,14 @@ financer.recurring-transaction-list.table-header.amount=Amount
|
||||
financer.recurring-transaction-list.table-header.description=Description
|
||||
financer.recurring-transaction-list.table-header.intervalType=Interval
|
||||
financer.recurring-transaction-list.table-header.holidayWeekendType=Holiday/weekend rule
|
||||
financer.recurring-transaction-list.table-header.taxRelevant=Tax relevant
|
||||
financer.recurring-transaction-list.table-header.actions=Actions
|
||||
financer.recurring-transaction-list.table.actions.createTransaction=Create transaction
|
||||
financer.recurring-transaction-list.table.actions.createTransactionWithAmount=Create transaction with amount
|
||||
financer.recurring-transaction-list.table.actions.editRecurringTransaction=Edit
|
||||
financer.recurring-transaction-list.table.actions.deleteRecurringTransaction=Delete
|
||||
financer.recurring-transaction-list.table.taxRelevant.true=Yes
|
||||
financer.recurring-transaction-list.table.taxRelevant.false=No
|
||||
financer.recurring-transaction-list.back-to-overview=Back to overview
|
||||
|
||||
financer.account-details.title=financer\: account details
|
||||
@@ -99,7 +104,8 @@ financer.account-details.table-header.toAccount=To account
|
||||
financer.account-details.table-header.date=Date
|
||||
financer.account-details.table-header.amount=Amount
|
||||
financer.account-details.table-header.description=Description
|
||||
financer.account-details.table-header.byRecurring=Recurring?
|
||||
financer.account-details.table-header.byRecurring=Recurring
|
||||
financer.account-details.table-header.taxRelevant=Tax relevant
|
||||
financer.account-details.details.type=Type\:
|
||||
financer.account-details.details.balance=Current balance\:
|
||||
financer.account-details.details.group=Group\:
|
||||
@@ -107,6 +113,8 @@ financer.account-details.table-header.actions=Actions
|
||||
financer.account-details.table.actions.deleteTransaction=Delete
|
||||
financer.account-details.table.recurring.yes=Yes
|
||||
financer.account-details.table.recurring.no=No
|
||||
financer.account-details.table.taxRelevant.true=Yes
|
||||
financer.account-details.table.taxRelevant.false=No
|
||||
|
||||
financer.recurring-to-transaction-with-amount.title=financer\: create transaction from recurring with amount
|
||||
financer.recurring-to-transaction-with-amount.label.amount=Amount\:
|
||||
@@ -116,12 +124,12 @@ financer.chart-select.title=Select a chart to generate
|
||||
financer.chart-select.submit=Select
|
||||
|
||||
financer.chart-config-account-group-expenses-for-period.title=Configure account group expenses for period chart
|
||||
financer.chart-config-account-group-expenses-for-period.label.from-date=From date\:
|
||||
financer.chart-config-account-group-expenses-for-period.label.from-date=From date\:
|
||||
financer.chart-config-account-group-expenses-for-period.label.to-date=To date\:
|
||||
financer.chart-config-account-group-expenses-for-period.submit=Generate
|
||||
|
||||
financer.chart-config-account-expenses-for-period.title=Configure account expenses for period chart
|
||||
financer.chart-config-account-expenses-for-period.label.from-date=From date\:
|
||||
financer.chart-config-account-expenses-for-period.label.from-date=From date\:
|
||||
financer.chart-config-account-expenses-for-period.label.to-date=To date\:
|
||||
financer.chart-config-account-expenses-for-period.submit=Generate
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ financer.transaction-new.label.to-account=An Konto\:
|
||||
financer.transaction-new.label.amount=Betrag\:
|
||||
financer.transaction-new.label.date=Datum\:
|
||||
financer.transaction-new.label.description=Beschreibung\:
|
||||
financer.transaction-new.label.taxRelevant=Relevant f\u00FCr Steuererkl\u00E4rung\:
|
||||
financer.transaction-new.submit=Buchung erstellen
|
||||
financer.transaction-new.account-type.BANK={0}|Bank|{1}{2}
|
||||
financer.transaction-new.account-type.CASH={0}|Bar|{1}{2}
|
||||
@@ -58,6 +59,7 @@ financer.recurring-transaction-new.label.interval-type=Intervall\:
|
||||
financer.recurring-transaction-new.label.holiday-weekend-type=Feiertag-/Wochenendregel\:
|
||||
financer.recurring-transaction-new.label.description=Beschreibung\:
|
||||
financer.recurring-transaction-new.label.remind=Erinnern wenn f\u00E4llig\:
|
||||
financer.recurring-transaction-new.label.taxRelevant=Relevant f\u00FCr Steuererkl\u00E4rung\:
|
||||
financer.recurring-transaction-new.submit=Wiederkehrende Buchung erstellen
|
||||
financer.recurring-transaction-new.account-type.BANK={0}|Bank|{1}{2}
|
||||
financer.recurring-transaction-new.account-type.CASH={0}|Bar|{1}{2}
|
||||
@@ -78,11 +80,14 @@ financer.recurring-transaction-list.table-header.amount=Betrag
|
||||
financer.recurring-transaction-list.table-header.description=Beschreibung
|
||||
financer.recurring-transaction-list.table-header.intervalType=Intervall
|
||||
financer.recurring-transaction-list.table-header.holidayWeekendType=Feiertag-/Wochenendregel
|
||||
financer.recurring-transaction-list.table-header.taxRelevant=Relevant f\u00FCr Steuererkl\u00E4rung
|
||||
financer.recurring-transaction-list.table-header.actions=Aktionen
|
||||
financer.recurring-transaction-list.table.actions.createTransaction=Erstelle Buchung
|
||||
financer.recurring-transaction-list.table.actions.createTransactionWithAmount=Erstelle Buchung mit Betrag
|
||||
financer.recurring-transaction-list.table.actions.editRecurringTransaction=Bearbeiten
|
||||
financer.recurring-transaction-list.table.actions.deleteRecurringTransaction=L\u00F6schen
|
||||
financer.recurring-transaction-list.table.taxRelevant.true=Ja
|
||||
financer.recurring-transaction-list.table.taxRelevant.false=Nein
|
||||
financer.recurring-transaction-list.back-to-overview=Zur\u00FCck zur \u00DCbersicht
|
||||
|
||||
financer.account-details.title=financer\: Kontodetails
|
||||
@@ -97,7 +102,8 @@ financer.account-details.table-header.toAccount=An Konto
|
||||
financer.account-details.table-header.date=Datum
|
||||
financer.account-details.table-header.amount=Betrag
|
||||
financer.account-details.table-header.description=Beschreibung
|
||||
financer.account-details.table-header.byRecurring=Wiederkehrend?
|
||||
financer.account-details.table-header.byRecurring=Wiederkehrend
|
||||
financer.account-details.table-header.taxRelevant=Relevant f\u00FCr Steuererkl\u00E4rung
|
||||
financer.account-details.details.type=Typ\:
|
||||
financer.account-details.details.balance=Kontostand\:
|
||||
financer.account-details.details.group=Gruppe\:
|
||||
@@ -105,6 +111,8 @@ financer.account-details.table-header.actions=Aktionen
|
||||
financer.account-details.table.actions.deleteTransaction=L\u00F6schen
|
||||
financer.account-details.table.recurring.yes=Ja
|
||||
financer.account-details.table.recurring.no=Nein
|
||||
financer.account-details.table.taxRelevant.true=Ja
|
||||
financer.account-details.table.taxRelevant.false=Nein
|
||||
|
||||
financer.recurring-to-transaction-with-amount.title=financer\: Buchung mit Betrag aus wiederkehrender Buchung erstellen
|
||||
financer.recurring-to-transaction-with-amount.label.amount=Betrag\:
|
||||
@@ -114,12 +122,12 @@ financer.chart-select.title=Ein Diagramm zum Erzeugen ausw\u00E4hlen
|
||||
financer.chart-select.submit=Ausw\u00E4hlen
|
||||
|
||||
financer.chart-config-account-group-expenses-for-period.title=Konfigurieren von Ausgaben f\u00FCr Periode gruppiert nach Konto-Gruppe Diagramm
|
||||
financer.chart-config-account-group-expenses-for-period.label.from-date=Von Datum\:
|
||||
financer.chart-config-account-group-expenses-for-period.label.from-date=Von Datum\:
|
||||
financer.chart-config-account-group-expenses-for-period.label.to-date=Bis Datum\:
|
||||
financer.chart-config-account-group-expenses-for-period.submit=Erzeugen
|
||||
|
||||
financer.chart-config-account-expenses-for-period.title=Konfigurieren von Ausgaben f\u00FCr Periode gruppiert nach Konto Diagramm
|
||||
financer.chart-config-account-expenses-for-period.label.from-date=Von Datum\:
|
||||
financer.chart-config-account-expenses-for-period.label.from-date=Von Datum\:
|
||||
financer.chart-config-account-expenses-for-period.label.to-date=Bis Datum\:
|
||||
financer.chart-config-account-expenses-for-period.submit=Erzeugen
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
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
|
||||
- Add tax relevance flag to transaction and recurring transaction creation. This flag denotes whether a transaction or
|
||||
the instances of a recurring transaction are relevant for a tax declaration. This is preparation for extended reports.
|
||||
|
||||
v25 -> v26:
|
||||
- Close of the current expense period now creates null statistic entries for accounts that have not been used in
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<th th:text="#{financer.account-details.table-header.amount}"/>
|
||||
<th th:text="#{financer.account-details.table-header.description}"/>
|
||||
<th th:text="#{financer.account-details.table-header.byRecurring}"/>
|
||||
<th th:text="#{financer.account-details.table-header.taxRelevant}"/>
|
||||
<th th:text="#{financer.account-details.table-header.actions}"/>
|
||||
</tr>
|
||||
<tr th:each="transaction : ${transactions}">
|
||||
@@ -55,6 +56,7 @@
|
||||
<td th:text="${transaction.description}" />
|
||||
<td th:if="${transaction.recurringTransaction != null}" th:text="#{financer.account-details.table.recurring.yes}" />
|
||||
<td th:if="${transaction.recurringTransaction == null}" th:text="#{financer.account-details.table.recurring.no}" />
|
||||
<td th:text="#{'financer.account-details.table.taxRelevant.' + ${transaction.taxRelevant}}" />
|
||||
<td>
|
||||
<div id="account-transaction-table-actions-container">
|
||||
<a th:href="@{/deleteTransaction(transactionId=${transaction.id}, accountKey=${account.key})}"
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
</select>
|
||||
<label for="inputDescription" th:text="#{financer.recurring-transaction-new.label.description}"/>
|
||||
<input type="text" id="inputDescription" th:field="*{description}"/>
|
||||
<label for="inputTaxRelevant" th:text="#{financer.recurring-transaction-new.label.taxRelevant}" />
|
||||
<input type="checkbox" id="inputTaxRelevant" th:field="*{taxRelevant}" />
|
||||
<label for="inputRemind" th:text="#{financer.recurring-transaction-new.label.remind}" />
|
||||
<input type="checkbox" id="inputRemind" th:field="*{remind}" />
|
||||
<input type="submit" th:value="#{financer.recurring-transaction-new.submit}"/>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<th th:text="#{financer.recurring-transaction-list.table-header.description}"/>
|
||||
<th th:text="#{financer.recurring-transaction-list.table-header.intervalType}"/>
|
||||
<th th:text="#{financer.recurring-transaction-list.table-header.holidayWeekendType}"/>
|
||||
<th th:text="#{financer.recurring-transaction-list.table-header.taxRelevant}"/>
|
||||
<th th:text="#{financer.recurring-transaction-list.table-header.actions}"/>
|
||||
</tr>
|
||||
<tr th:each="rt : ${recurringTransactions}">
|
||||
@@ -38,6 +39,7 @@
|
||||
<td th:text="${rt.description}"/>
|
||||
<td th:text="#{'financer.interval-type.' + ${rt.intervalType}}"/>
|
||||
<td th:text="#{'financer.holiday-weekend-type.' + ${rt.holidayWeekendType}}"/>
|
||||
<td th:text="#{'financer.recurring-transaction-list.table.taxRelevant.' + ${rt.taxRelevant}}" />
|
||||
<td>
|
||||
<div id="recurring-transaction-list-table-actions-container">
|
||||
<a th:href="@{/recurringToTransaction(recurringTransactionId=${rt.id}, sub=${subTitle})}"
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
<input type="date" id="inputDate" th:field="*{date}"/>
|
||||
<label for="inputDescription" th:text="#{financer.transaction-new.label.description}"/>
|
||||
<input type="text" id="inputDescription" th:field="*{description}"/>
|
||||
<label for="inputTaxRelevant" th:text="#{financer.transaction-new.label.taxRelevant}" />
|
||||
<input type="checkbox" id="inputTaxRelevant" th:field="*{taxRelevant}" />
|
||||
<input type="submit" th:value="#{financer.transaction-new.submit}"/>
|
||||
</form>
|
||||
<div th:replace="includes/footer :: footer"/>
|
||||
|
||||
Reference in New Issue
Block a user