Skip to content

Commit

Permalink
Erweiterung der Footer-Tabelle abgeschlossen
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoerschke committed Jan 31, 2024
1 parent 839756f commit e7e3350
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package timkodiert.budgetBook.table.monthlyOverview;

import java.time.LocalDate;

import timkodiert.budgetBook.util.HasType;
import timkodiert.budgetBook.view.MonthlyOverview.RowType;

public record TableData(String position, double value, LocalDate date, String categories, RowType type) implements HasType<RowType> {

@Override
public RowType getType() {
return type;
}
}
5 changes: 5 additions & 0 deletions src/main/java/timkodiert/budgetBook/util/HasType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package timkodiert.budgetBook.util;

public interface HasType <T> {
T getType();
}
12 changes: 9 additions & 3 deletions src/main/java/timkodiert/budgetBook/view/MonthlyOverview.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ public void initialize(URL location, ResourceBundle resources) {
.filter(d -> !RowType.getGroupTypes().contains(d.type()))
.mapToDouble(TableData::value).sum();
sumTable.getItems().clear();
sumTable.getItems().add(new TableData(LanguageManager.getInstance().getLocString("monthlyOverview.label.sum"), totalSum, null, null, RowType.SUM));
sumTable.getItems()
.add(new TableData(LanguageManager.getInstance().getLocString("monthlyOverview.label.sumExpenses"),
totalSum,
null,
null,
RowType.SUM));

// Summe der Einnahmen für den Monat
double incomeSum = fixedExpenseRepository.findAll()
Expand All @@ -110,8 +115,9 @@ public void initialize(URL location, ResourceBundle resources) {
.filter(t -> t.getTotalValue() > 0)
.mapToDouble(UniqueTurnover::getTotalValue)
.sum();
sumTable.getItems().add(new TableData("Einnahmen (Summe)", incomeSum, null, null, RowType.SUM));
sumTable.getItems().add(new TableData("Summe", incomeSum + totalSum, null, null, RowType.TOTAL_SUM));

sumTable.getItems().addAll(new TableData(LanguageManager.get("monthlyOverview.label.sumEarnings"), incomeSum, null, null, RowType.SUM),
new TableData(LanguageManager.get("monthlyOverview.label.sum"), incomeSum + totalSum, null, null, RowType.TOTAL_SUM));
});

initDataGroups(MonthYear.now());
Expand Down
Binary file added src/main/resources/css/RobotoMono-Bold.ttf
Binary file not shown.
Binary file added src/main/resources/css/RobotoMono-Regular.ttf
Binary file not shown.
4 changes: 3 additions & 1 deletion src/main/resources/i18n/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ monthlyOverview.sumTable.column.columnX=Spalte X
monthlyOverview.sumTable.column.c1=C1
monthlyOverview.sumTable.column.c2=C2
monthlyOverview.label.monthlyView=Monatsansicht
monthlyOverview.label.sum=Summe (Ausgaben)
monthlyOverview.label.sum=Summe
monthlyOverview.label.sumEarnings=Einnahmen (Summe)
monthlyOverview.label.sumExpenses=Ausgaben (Summe)
monthlyOverview.label.uniqueExpenses=Einzigartige Ausgaben
monthlyOverview.label.fixedExpenses=Wiederkehrende Ausgaben

Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/i18n/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ monthlyOverview.sumTable.column.columnX=Column X
monthlyOverview.sumTable.column.c1=C1
monthlyOverview.sumTable.column.c2=C2
monthlyOverview.label.monthlyView=Monthly view
monthlyOverview.label.sum=Sum (expenses)
monthlyOverview.label.sum=Sum
monthlyOverview.label.sumEarnings=Earnings (sum)
monthlyOverview.label.sumExpenses=Expenses (sum)
monthlyOverview.label.uniqueExpenses=Unique expenses
monthlyOverview.label.fixedExpenses=Fixed expenses

Expand Down

0 comments on commit e7e3350

Please sign in to comment.