From 16fd808f25194284d069fcd9ca228fb74b5a4dce Mon Sep 17 00:00:00 2001 From: Filippo Ferrari Date: Tue, 4 Jun 2024 09:41:22 +0100 Subject: [PATCH] feat: added debtors management --- .../com/application/munera/views/expenses/ExpensesView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/application/munera/views/expenses/ExpensesView.java b/src/main/java/com/application/munera/views/expenses/ExpensesView.java index f6adc71..251acb9 100644 --- a/src/main/java/com/application/munera/views/expenses/ExpensesView.java +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -68,6 +68,7 @@ public class ExpensesView extends Div implements BeforeEnterObserver { private TextField periodInterval; private DatePicker date; private MultiSelectComboBox creditors; + private MultiSelectComboBox debtors; public ExpensesView(ExpenseService expenseService, CategoryService categoryService, PersonService personService) { this.expenseService = expenseService; @@ -216,6 +217,9 @@ public class ExpensesView extends Div implements BeforeEnterObserver { creditors = new MultiSelectComboBox<>("Creditors"); creditors.setItems(personService.findAll()); creditors.setItemLabelGenerator(Person::getFirstName); + debtors = new MultiSelectComboBox<>("Debtors"); + debtors.setItems(personService.findAll()); + debtors.setItemLabelGenerator(Person::getFirstName); date = new DatePicker("Date"); LitRenderer isPeriodicRenderer = LitRenderer.of( "") @@ -224,7 +228,7 @@ public class ExpensesView extends Div implements BeforeEnterObserver { ? "var(--lumo-primary-text-color)" : "var(--lumo-disabled-text-color)"); - formLayout.add(name, cost, category, description, isPeriodic, periodUnit, periodInterval, date, creditors); + formLayout.add(name, cost, category, description, isPeriodic, periodUnit, periodInterval, date, creditors, debtors); grid.addColumn(isPeriodicRenderer).setHeader("Periodic").setAutoWidth(true); editorDiv.add(formLayout); createButtonLayout(editorLayoutDiv);