mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-17 23:13:57 +01:00
feat: show account group on account reconciliation form
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||
data-bs-target="#flush-collapse-{{ forloop.counter0 }}" aria-expanded="false"
|
||||
aria-controls="flush-collapseOne">
|
||||
{{ form.account_name }}
|
||||
{% if form.account_group %}<span class="badge !tw-bg-blue-300 !tw-text-blue-800 me-2">{{ form.account_group.name }}</span>{% endif %}{{ form.account_name }}
|
||||
</button>
|
||||
</h2>
|
||||
<div id="flush-collapse-{{ forloop.counter0 }}" class="accordion-collapse collapse">
|
||||
|
||||
Reference in New Issue
Block a user