From b77e48ef42d792a2a098a7851e672286c46b7a9c Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Sun, 20 Oct 2024 11:55:52 -0300 Subject: [PATCH] feat: show account group on account reconciliation form --- app/apps/accounts/forms.py | 1 + app/apps/accounts/views/balance.py | 3 ++- app/templates/accounts/fragments/account_reconciliation.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/apps/accounts/forms.py b/app/apps/accounts/forms.py index 8400fb8..662f5a7 100644 --- a/app/apps/accounts/forms.py +++ b/app/apps/accounts/forms.py @@ -122,6 +122,7 @@ class AccountBalanceForm(forms.Form): self.currency_prefix = self.initial.get("prefix", "") self.currency_decimal_places = self.initial.get("decimal_places", 2) self.account_name = self.initial.get("account_name", "") + self.account_group = self.initial.get("account_group", None) self.current_balance = self.initial.get("current_balance", 0) self.helper = FormHelper() diff --git a/app/apps/accounts/views/balance.py b/app/apps/accounts/views/balance.py index c6207e5..1817b2e 100644 --- a/app/apps/accounts/views/balance.py +++ b/app/apps/accounts/views/balance.py @@ -31,13 +31,14 @@ def account_reconciliation(request): initial_data = [ { "account_id": account.id, + "account_group": account.group, "account_name": account.name, "decimal_places": account.currency.decimal_places, "suffix": account.currency.suffix, "prefix": account.currency.prefix, "current_balance": get_account_balance(account), } - for account in Account.objects.all().select_related("currency") + for account in Account.objects.all().select_related("currency", "group") ] if request.method == "POST": diff --git a/app/templates/accounts/fragments/account_reconciliation.html b/app/templates/accounts/fragments/account_reconciliation.html index 34ead31..2361ec4 100644 --- a/app/templates/accounts/fragments/account_reconciliation.html +++ b/app/templates/accounts/fragments/account_reconciliation.html @@ -16,7 +16,7 @@