#20 Add transaction type

This commit is contained in:
2021-08-08 23:38:41 +02:00
parent 7ffc597727
commit 0bb534c8b4
19 changed files with 373 additions and 104 deletions

View File

@@ -103,14 +103,15 @@ public class PeriodController {
@GetMapping("/showIncomeTransactions")
public String showIncomeTransactions(Model model, Long periodId) {
final String fql = String
.format("periodId = '%s' AND (fromAccountType = 'INCOME' OR (fromAccountType = 'LIABILITY' AND (toAccountType = 'BANK' OR toAccountType = 'CASH')) OR (fromAccountType = 'START' AND (toAccountType = 'BANK' OR toAccountType = 'CASH'))) ORDER BY date DESC", periodId);
final String fql = String.format("periodId = '%s' AND transactionType = 'INCOME' ORDER BY date DESC", periodId);
return showInternal(model, fql, true);
}
@GetMapping("/showExpenseTransactions")
public String showExpenseTransactions(Model model, Long periodId) {
// We cannot use transactionType = 'EXPENSE' because we do not want to show the Liability -> Expense bookings
// as these are counted via asset type account -> Liability
final String fql = String
.format("periodId = '%s' AND (fromAccountType = 'BANK' OR fromAccountType = 'CASH') AND toAccountType = 'EXPENSE' ORDER BY date DESC", periodId);
@@ -119,8 +120,7 @@ public class PeriodController {
@GetMapping("/showLiabilityTransactions")
public String showLiabilityTransactions(Model model, Long periodId) {
final String fql = String
.format("periodId = '%s' AND (fromAccountType = 'BANK' OR fromAccountType = 'CASH') AND toAccountType = 'LIABILITY' ORDER BY date DESC", periodId);
final String fql = String.format("periodId = '%s' AND transactionType = 'LIABILITY' ORDER BY date DESC", periodId);
return showInternal(model, fql, true);
}

View File

@@ -145,6 +145,7 @@ financer.search-transactions.show-query-options.recurring=recurring\: whether th
financer.search-transactions.show-query-options.taxRelevant=taxRelevant\: whether the transaction is relevant for tax declaration
financer.search-transactions.show-query-options.hasFile=hasFile\: whether the transaction has a file linked
financer.search-transactions.show-query-options.description=description\: the description of the transaction
financer.search-transactions.show-query-options.transactionType=transactionType\: the type of the transaction
financer.search-transactions.show-query-options.period=period\: the period the transaction is assigned to
financer.search-transactions.show-query-options.period.CURRENT=CURRENT\: denotes the current expense period
financer.search-transactions.show-query-options.period.LAST=LAST\: denotes the last expense period

View File

@@ -145,6 +145,7 @@ financer.search-transactions.show-query-options.recurring=recurring\: ob die Buc
financer.search-transactions.show-query-options.taxRelevant=taxRelevant\: ob die Buchung als steuerrelevant markiert wurde
financer.search-transactions.show-query-options.hasFile=hasFile\: ob eine Datei der Buchung zugeordnet ist
financer.search-transactions.show-query-options.description=description\: die Beschreibung der Buchung
financer.search-transactions.show-query-options.transactionType=transactionType\: der Typ der Buchung
financer.search-transactions.show-query-options.period=period\: die Periode der Buchung
financer.search-transactions.show-query-options.period.CURRENT=CURRENT\: bezeichnet die aktuelle Ausgabenperiode
financer.search-transactions.show-query-options.period.LAST=LAST\: bezeichnet die letzte Ausgabenperiode

View File

@@ -1,3 +1,10 @@
v47 -> v48:
- Added new property 'transaction type' to a transaction, denoting the type of the transaction, e.g. asset swap,
expense, liability or income. This can also be queried via FQL
v46 -> v47:
- Fix a bug that occurred while creating a transaction from a recurring transaction with amount overwrite
v45 -> v46:
- #17 Add actions to the period overview
- #18 Improve actions in the period overview

View File

@@ -16,7 +16,7 @@
9. Reporting
10. FQL
11. Setup
12. Planned features
12. Links
1. About
========
@@ -165,6 +165,21 @@
7. Transactions
===============
Transactions have a type that denotes the business case:
- Asset swap: Transferring money from one asset type account (Bank, Cash) to another account of an asset type
E.g. from Bank to Cash, e.g. making a withdrawal at an ATM, B- -> C+
- Expense: Booking money for an expense from a Bank, Cash or Liability account to an Expense account
E.g. from Cash to Expense, e.g. buying goods, C- -> E+
- Liability: Paying a credit installment from an asset type account (Bank, Cash) to a Liability account
E.g. from Bank to Liability, e.g. making an installment, B- -> L-
- Income: Increasing the assets from a Start, Income or Liability account to an asset type account (Bank, Cash).
Start -> asset type account bookings need to counted as the money that was there at the starting time of
a financer instance is used for expanses.
Liability -> asset type account bookings need to counted as the money is used for expenses.
E.g. from Liability to Bank, e.g. payout of a credit, L+ -> B+
- Start liability: Booking the current balance of a liability at the inception of a financer instance
E.g. from Start to Liability, e.g. initial setup of liability amount, S+ -> L+
8. Recurring transactions
=========================
@@ -195,8 +210,8 @@
\q
exit
12. Planned features
====================
This chapter lists planned features. The list is in no particular order:
- Transaction import from online banking (file based)
- Extended reports, e.g. forecasting based on recurring transactions and average spending
12. Links
=========
This chapter contains useful links:
- financer web page: https://financer.dev/
- financer git repository: https://77zzcx7.de/gitea/MK13/financer

View File

@@ -38,6 +38,7 @@
<li th:text="#{financer.search-transactions.show-query-options.taxRelevant}" />
<li th:text="#{financer.search-transactions.show-query-options.hasFile}" />
<li th:text="#{financer.search-transactions.show-query-options.description}" />
<li th:text="#{financer.search-transactions.show-query-options.transactionType}" />
<li><span th:text="#{financer.search-transactions.show-query-options.period}" />
<ul>
<li th:text="#{financer.search-transactions.show-query-options.period.CURRENT}" />