mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 10:08:36 +02:00
feat: change how values are colored on yearly overviews and add exchange rates to accounts
This commit is contained in:
@@ -10,6 +10,8 @@ from django.db.models.expressions import Case, When
|
|||||||
from django.db.models.functions import Concat
|
from django.db.models.functions import Concat
|
||||||
|
|
||||||
from apps.transactions.models import Transaction
|
from apps.transactions.models import Transaction
|
||||||
|
from apps.currencies.utils.convert import convert
|
||||||
|
from apps.currencies.models import Currency
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@@ -196,14 +198,24 @@ def yearly_overview_by_account(request, year: int):
|
|||||||
|
|
||||||
monthly_data = (
|
monthly_data = (
|
||||||
transactions.annotate(month=TruncMonth("reference_date"))
|
transactions.annotate(month=TruncMonth("reference_date"))
|
||||||
|
.select_related(
|
||||||
|
"account__currency",
|
||||||
|
"account__exchange_currency",
|
||||||
|
)
|
||||||
.values(
|
.values(
|
||||||
"month",
|
"month",
|
||||||
"account__id",
|
"account__id",
|
||||||
"account__name",
|
"account__name",
|
||||||
|
"account__currency",
|
||||||
|
"account__exchange_currency",
|
||||||
"account__currency__code",
|
"account__currency__code",
|
||||||
"account__currency__prefix",
|
"account__currency__prefix",
|
||||||
"account__currency__suffix",
|
"account__currency__suffix",
|
||||||
"account__currency__decimal_places",
|
"account__currency__decimal_places",
|
||||||
|
"account__exchange_currency__code",
|
||||||
|
"account__exchange_currency__prefix",
|
||||||
|
"account__exchange_currency__suffix",
|
||||||
|
"account__exchange_currency__decimal_places",
|
||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
income_paid=Coalesce(
|
income_paid=Coalesce(
|
||||||
@@ -276,10 +288,9 @@ def yearly_overview_by_account(request, year: int):
|
|||||||
.order_by("month", "account__name")
|
.order_by("month", "account__name")
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create a list of all months in the year
|
|
||||||
all_months = [date(year, month, 1) for month in range(1, 13)]
|
all_months = [date(year, month, 1) for month in range(1, 13)]
|
||||||
|
|
||||||
# Get all accounts that had transactions in this year
|
# Get all accounts with their currencies
|
||||||
accounts = (
|
accounts = (
|
||||||
transactions.values(
|
transactions.values(
|
||||||
"account__id",
|
"account__id",
|
||||||
@@ -289,12 +300,18 @@ def yearly_overview_by_account(request, year: int):
|
|||||||
"account__currency__prefix",
|
"account__currency__prefix",
|
||||||
"account__currency__suffix",
|
"account__currency__suffix",
|
||||||
"account__currency__decimal_places",
|
"account__currency__decimal_places",
|
||||||
|
"account__exchange_currency__code",
|
||||||
|
"account__exchange_currency__prefix",
|
||||||
|
"account__exchange_currency__suffix",
|
||||||
|
"account__exchange_currency__decimal_places",
|
||||||
)
|
)
|
||||||
.distinct()
|
.distinct()
|
||||||
.order_by("account__name")
|
.order_by("account__name")
|
||||||
)
|
)
|
||||||
|
|
||||||
# Create a dictionary to store the final result
|
# Get Currency objects for conversion
|
||||||
|
currencies = {currency.id: currency for currency in Currency.objects.all()}
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
month: {
|
month: {
|
||||||
account["account__id"]: {
|
account["account__id"]: {
|
||||||
@@ -306,6 +323,18 @@ def yearly_overview_by_account(request, year: int):
|
|||||||
"suffix": account["account__currency__suffix"],
|
"suffix": account["account__currency__suffix"],
|
||||||
"decimal_places": account["account__currency__decimal_places"],
|
"decimal_places": account["account__currency__decimal_places"],
|
||||||
},
|
},
|
||||||
|
"exchange_currency": (
|
||||||
|
{
|
||||||
|
"code": account["account__exchange_currency__code"],
|
||||||
|
"prefix": account["account__exchange_currency__prefix"],
|
||||||
|
"suffix": account["account__exchange_currency__suffix"],
|
||||||
|
"decimal_places": account[
|
||||||
|
"account__exchange_currency__decimal_places"
|
||||||
|
],
|
||||||
|
}
|
||||||
|
if account["account__exchange_currency__code"]
|
||||||
|
else None
|
||||||
|
),
|
||||||
"income_paid": Decimal("0"),
|
"income_paid": Decimal("0"),
|
||||||
"expense_paid": Decimal("0"),
|
"expense_paid": Decimal("0"),
|
||||||
"income_unpaid": Decimal("0"),
|
"income_unpaid": Decimal("0"),
|
||||||
@@ -334,6 +363,24 @@ def yearly_overview_by_account(request, year: int):
|
|||||||
"balance_total",
|
"balance_total",
|
||||||
]:
|
]:
|
||||||
result[month][account_id][field] = entry[field]
|
result[month][account_id][field] = entry[field]
|
||||||
|
if result[month][account_id]["exchange_currency"]:
|
||||||
|
from_currency = currencies[entry["account__currency"]]
|
||||||
|
to_currency = currencies[entry["account__exchange_currency"]]
|
||||||
|
|
||||||
|
if entry[field] > 0 or entry[field] < 0:
|
||||||
|
converted_amount, prefix, suffix, decimal_places = convert(
|
||||||
|
amount=entry[field],
|
||||||
|
from_currency=from_currency,
|
||||||
|
to_currency=to_currency,
|
||||||
|
)
|
||||||
|
|
||||||
|
if isinstance(converted_amount, Decimal):
|
||||||
|
print(converted_amount)
|
||||||
|
result[month][account_id][
|
||||||
|
f"exchange_{field}"
|
||||||
|
] = converted_amount
|
||||||
|
else:
|
||||||
|
result[month][account_id][f"exchange_{field}"] = Decimal(0)
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
@@ -343,6 +390,5 @@ def yearly_overview_by_account(request, year: int):
|
|||||||
"next_year": next_year,
|
"next_year": next_year,
|
||||||
"previous_year": previous_year,
|
"previous_year": previous_year,
|
||||||
"totals": result,
|
"totals": result,
|
||||||
"accounts": accounts,
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header">
|
<h2 class="accordion-header">
|
||||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#{{ account.name|slugify }}-{{ forloop.parentloop.counter }}" aria-expanded="false" aria-controls="{{ account.name|slugify }}-{{ forloop.counter }}">
|
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#{{ account.name|slugify }}-{{ forloop.parentloop.counter }}" aria-expanded="false" aria-controls="{{ account.name|slugify }}-{{ forloop.counter }}">
|
||||||
<span class="badge text-bg-primary me-2">{{ account.group }}</span>{{ account.name }}
|
{% if account.group %}<span class="badge text-bg-primary me-2">{{ account.group }}</span>{% endif %}{{ account.name }}
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
<div id="{{ account.name|slugify }}-{{ forloop.parentloop.counter }}" class="accordion-collapse collapse">
|
<div id="{{ account.name|slugify }}-{{ forloop.parentloop.counter }}" class="accordion-collapse collapse">
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
<div class="tw-text-gray-400">{% translate 'projected income' %}</div>
|
<div class="tw-text-gray-400">{% translate 'projected income' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dotted-line flex-grow-1"></div>
|
<div class="dotted-line flex-grow-1"></div>
|
||||||
<div class="text-end font-monospace tw-text-green-300">
|
<div class="text-end font-monospace tw-text-green-400">
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="account.income_unpaid"
|
:amount="account.income_unpaid"
|
||||||
:prefix="account.currency.prefix"
|
:prefix="account.currency.prefix"
|
||||||
@@ -125,25 +125,45 @@
|
|||||||
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if account.exchange_currency and account.exchange_income_unpaid %}
|
||||||
|
<div class="text-end font-monospace tw-text-gray-500">
|
||||||
|
<c-amount.display
|
||||||
|
:amount="account.exchange_income_unpaid"
|
||||||
|
:prefix="account.exchange_currency.prefix"
|
||||||
|
:suffix="account.exchange_currency.suffix"
|
||||||
|
:decimal_places="account.exchange_currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'projected expenses' %}</div>
|
<div class="tw-text-gray-400">{% translate 'projected expenses' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dotted-line flex-grow-1"></div>
|
<div class="dotted-line flex-grow-1"></div>
|
||||||
<div class="text-end font-monospace tw-text-red-300">
|
<div>
|
||||||
<c-amount.display
|
<div class="text-end font-monospace tw-text-red-400">
|
||||||
:amount="account.expense_unpaid"
|
<c-amount.display
|
||||||
:prefix="account.currency.prefix"
|
:amount="account.expense_unpaid"
|
||||||
:suffix="account.currency.suffix"
|
:prefix="account.currency.prefix"
|
||||||
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
:suffix="account.currency.suffix"
|
||||||
|
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if account.exchange_currency and account.exchange_expense_unpaid %}
|
||||||
|
<div class="text-end font-monospace tw-text-gray-500">
|
||||||
|
<c-amount.display
|
||||||
|
:amount="account.exchange_expense_unpaid"
|
||||||
|
:prefix="account.exchange_currency.prefix"
|
||||||
|
:suffix="account.exchange_currency.suffix"
|
||||||
|
:decimal_places="account.exchange_currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'projected total' %}</div>
|
<div class="tw-text-gray-400">{% translate 'projected total' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dotted-line flex-grow-1"></div>
|
<div class="dotted-line flex-grow-1"></div>
|
||||||
<div class="text-end font-monospace tw-text-yellow-300">
|
<div class="text-end font-monospace {% if account.balance_unpaid > 0 %}tw-text-green-400{% elif account.balance_unpaid < 0 %}tw-text-red-400{% endif %}">
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="account.balance_unpaid"
|
:amount="account.balance_unpaid"
|
||||||
:prefix="account.currency.prefix"
|
:prefix="account.currency.prefix"
|
||||||
@@ -151,6 +171,15 @@
|
|||||||
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if account.exchange_currency and account.exchange_balance_unpaid %}
|
||||||
|
<div class="text-end font-monospace tw-text-gray-500">
|
||||||
|
<c-amount.display
|
||||||
|
:amount="account.exchange_balance_unpaid"
|
||||||
|
:prefix="account.exchange_currency.prefix"
|
||||||
|
:suffix="account.exchange_currency.suffix"
|
||||||
|
:decimal_places="account.exchange_currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<hr class="my-3 d-block d-lg-none">
|
<hr class="my-3 d-block d-lg-none">
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-6">
|
||||||
@@ -167,6 +196,15 @@
|
|||||||
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if account.exchange_currency and account.exchange_income_paid %}
|
||||||
|
<div class="text-end font-monospace tw-text-gray-500">
|
||||||
|
<c-amount.display
|
||||||
|
:amount="account.exchange_income_paid"
|
||||||
|
:prefix="account.exchange_currency.prefix"
|
||||||
|
:suffix="account.exchange_currency.suffix"
|
||||||
|
:decimal_places="account.exchange_currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'current expenses' %}</div>
|
<div class="tw-text-gray-400">{% translate 'current expenses' %}</div>
|
||||||
@@ -180,12 +218,21 @@
|
|||||||
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if account.exchange_currency and account.exchange_expense_paid %}
|
||||||
|
<div class="text-end font-monospace tw-text-gray-500">
|
||||||
|
<c-amount.display
|
||||||
|
:amount="account.exchange_expense_paid"
|
||||||
|
:prefix="account.exchange_currency.prefix"
|
||||||
|
:suffix="account.exchange_currency.suffix"
|
||||||
|
:decimal_places="account.exchange_currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
<div class="d-flex justify-content-between align-items-baseline mt-2">
|
||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'current total' %}</div>
|
<div class="tw-text-gray-400">{% translate 'current total' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dotted-line flex-grow-1"></div>
|
<div class="dotted-line flex-grow-1"></div>
|
||||||
<div class="text-end font-monospace tw-text-yellow-400">
|
<div class="text-end font-monospace {% if account.balance_paid > 0 %}tw-text-green-400{% elif account.balance_paid < 0 %}tw-text-red-400{% endif %}">
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="account.balance_paid"
|
:amount="account.balance_paid"
|
||||||
:prefix="account.currency.prefix"
|
:prefix="account.currency.prefix"
|
||||||
@@ -193,6 +240,15 @@
|
|||||||
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if account.exchange_currency and account.exchange_balance_paid %}
|
||||||
|
<div class="text-end font-monospace tw-text-gray-500">
|
||||||
|
<c-amount.display
|
||||||
|
:amount="account.exchange_balance_paid"
|
||||||
|
:prefix="account.exchange_currency.prefix"
|
||||||
|
:suffix="account.exchange_currency.suffix"
|
||||||
|
:decimal_places="account.exchange_currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<hr class="my-3">
|
<hr class="my-3">
|
||||||
<div>
|
<div>
|
||||||
@@ -201,7 +257,7 @@
|
|||||||
<div class="tw-text-gray-400">{% translate 'final total' %}</div>
|
<div class="tw-text-gray-400">{% translate 'final total' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dotted-line flex-grow-1"></div>
|
<div class="dotted-line flex-grow-1"></div>
|
||||||
<div class="text-end font-monospace tw-text-green-300">
|
<div class="text-end font-monospace {% if account.balance_total > 0 %}tw-text-green-400{% elif account.balance_total < 0 %}tw-text-red-400{% endif %}">
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="account.balance_total"
|
:amount="account.balance_total"
|
||||||
:prefix="account.currency.prefix"
|
:prefix="account.currency.prefix"
|
||||||
@@ -209,6 +265,15 @@
|
|||||||
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
:decimal_places="account.currency.decimal_places"></c-amount.display>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if account.exchange_currency and account.exchange_balance_total %}
|
||||||
|
<div class="text-end font-monospace tw-text-gray-500">
|
||||||
|
<c-amount.display
|
||||||
|
:amount="account.exchange_balance_total"
|
||||||
|
:prefix="account.exchange_currency.prefix"
|
||||||
|
:suffix="account.exchange_currency.suffix"
|
||||||
|
:decimal_places="account.exchange_currency.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'projected income' %}</div>
|
<div class="tw-text-gray-400">{% translate 'projected income' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-end font-monospace tw-text-green-300">
|
<div class="text-end font-monospace">
|
||||||
{% for entry in x.income_unpaid %}
|
{% for entry in x.income_unpaid %}
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount"
|
:amount="entry.amount"
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'projected expenses' %}</div>
|
<div class="tw-text-gray-400">{% translate 'projected expenses' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-end font-monospace tw-text-red-300">
|
<div class="text-end font-monospace">
|
||||||
{% for entry in x.expense_unpaid %}
|
{% for entry in x.expense_unpaid %}
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount"
|
:amount="entry.amount"
|
||||||
@@ -136,13 +136,15 @@
|
|||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'projected total' %}</div>
|
<div class="tw-text-gray-400">{% translate 'projected total' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-end font-monospace tw-text-yellow-300">
|
<div class="text-end font-monospace">
|
||||||
{% for entry in x.balance_unpaid %}
|
{% for entry in x.balance_unpaid %}
|
||||||
|
<div class="{% if entry.amount > 0 %}tw-text-green-400{% elif entry.amount < 0 %}tw-text-red-400{% endif %}">
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount"
|
:amount="entry.amount"
|
||||||
:prefix="entry.prefix"
|
:prefix="entry.prefix"
|
||||||
:suffix="entry.suffix"
|
:suffix="entry.suffix"
|
||||||
:decimal_places="entry.decimal_places"></c-amount.display>
|
:decimal_places="entry.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<div>-</div>
|
<div>-</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -153,7 +155,7 @@
|
|||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'current income' %}</div>
|
<div class="tw-text-gray-400">{% translate 'current income' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-end font-monospace tw-text-green-400">
|
<div class="text-end font-monospace">
|
||||||
{% for entry in x.income_paid %}
|
{% for entry in x.income_paid %}
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount"
|
:amount="entry.amount"
|
||||||
@@ -169,7 +171,7 @@
|
|||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
<div class="tw-text-gray-400">{% translate 'current expenses' %}</div>
|
<div class="tw-text-gray-400">{% translate 'current expenses' %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-end font-monospace tw-text-red-400">
|
<div class="text-end font-monospace">
|
||||||
{% for entry in x.expense_paid %}
|
{% for entry in x.expense_paid %}
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount"
|
:amount="entry.amount"
|
||||||
@@ -187,11 +189,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="text-end font-monospace tw-text-yellow-400">
|
<div class="text-end font-monospace tw-text-yellow-400">
|
||||||
{% for entry in x.balance_paid %}
|
{% for entry in x.balance_paid %}
|
||||||
|
<div class="{% if entry.amount > 0 %}tw-text-green-400{% elif entry.amount < 0 %}tw-text-red-400{% endif %}">
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount"
|
:amount="entry.amount"
|
||||||
:prefix="entry.prefix"
|
:prefix="entry.prefix"
|
||||||
:suffix="entry.suffix"
|
:suffix="entry.suffix"
|
||||||
:decimal_places="entry.decimal_places"></c-amount.display>
|
:decimal_places="entry.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<div>-</div>
|
<div>-</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -204,11 +208,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="text-end font-monospace">
|
<div class="text-end font-monospace">
|
||||||
{% for entry in x.balance_total %}
|
{% for entry in x.balance_total %}
|
||||||
|
<div class="{% if entry.amount > 0 %}tw-text-green-400{% elif entry.amount < 0 %}tw-text-red-400{% endif %}">
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount"
|
:amount="entry.amount"
|
||||||
:prefix="entry.prefix"
|
:prefix="entry.prefix"
|
||||||
:suffix="entry.suffix"
|
:suffix="entry.suffix"
|
||||||
:decimal_places="entry.decimal_places"></c-amount.display>
|
:decimal_places="entry.decimal_places"></c-amount.display>
|
||||||
|
</div>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<div>-</div>
|
<div>-</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user