mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 17:48:41 +02: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_prefix = self.initial.get("prefix", "")
|
||||||
self.currency_decimal_places = self.initial.get("decimal_places", 2)
|
self.currency_decimal_places = self.initial.get("decimal_places", 2)
|
||||||
self.account_name = self.initial.get("account_name", "")
|
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.current_balance = self.initial.get("current_balance", 0)
|
||||||
|
|
||||||
self.helper = FormHelper()
|
self.helper = FormHelper()
|
||||||
|
|||||||
@@ -31,13 +31,14 @@ def account_reconciliation(request):
|
|||||||
initial_data = [
|
initial_data = [
|
||||||
{
|
{
|
||||||
"account_id": account.id,
|
"account_id": account.id,
|
||||||
|
"account_group": account.group,
|
||||||
"account_name": account.name,
|
"account_name": account.name,
|
||||||
"decimal_places": account.currency.decimal_places,
|
"decimal_places": account.currency.decimal_places,
|
||||||
"suffix": account.currency.suffix,
|
"suffix": account.currency.suffix,
|
||||||
"prefix": account.currency.prefix,
|
"prefix": account.currency.prefix,
|
||||||
"current_balance": get_account_balance(account),
|
"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":
|
if request.method == "POST":
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#flush-collapse-{{ forloop.counter0 }}" aria-expanded="false"
|
data-bs-target="#flush-collapse-{{ forloop.counter0 }}" aria-expanded="false"
|
||||||
aria-controls="flush-collapseOne">
|
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>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
<div id="flush-collapse-{{ forloop.counter0 }}" class="accordion-collapse collapse">
|
<div id="flush-collapse-{{ forloop.counter0 }}" class="accordion-collapse collapse">
|
||||||
|
|||||||
Reference in New Issue
Block a user