mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-18 07:24:00 +01:00
fix: Summing exchanged transactions sums both amount and the exchanged amount
This commit is contained in:
@@ -66,21 +66,25 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-12 text-lg-end align-self-end">
|
||||
<c-amount.display
|
||||
:amount="transaction.amount"
|
||||
:prefix="transaction.account.currency.prefix"
|
||||
:suffix="transaction.account.currency.suffix"
|
||||
:decimal_places="transaction.account.currency.decimal_places"
|
||||
color="{% if transaction.type == "EX" %}red{% else %}green{% endif %}"></c-amount.display>
|
||||
<div class="main-amount">
|
||||
<c-amount.display
|
||||
:amount="transaction.amount"
|
||||
:prefix="transaction.account.currency.prefix"
|
||||
:suffix="transaction.account.currency.suffix"
|
||||
:decimal_places="transaction.account.currency.decimal_places"
|
||||
color="{% if transaction.type == "EX" %}red{% else %}green{% endif %}"></c-amount.display>
|
||||
</div>
|
||||
{# Exchange Rate#}
|
||||
{% with exchanged=transaction.exchanged_amount %}
|
||||
{% if exchanged %}
|
||||
<c-amount.display
|
||||
:amount="exchanged.amount"
|
||||
:prefix="exchanged.prefix"
|
||||
:suffix="exchanged.suffix"
|
||||
:decimal_places="exchanged.decimal_places"
|
||||
color="grey"></c-amount.display>
|
||||
<div class="exchanged-amount">
|
||||
<c-amount.display
|
||||
:amount="exchanged.amount"
|
||||
:prefix="exchanged.prefix"
|
||||
:suffix="exchanged.suffix"
|
||||
:decimal_places="exchanged.decimal_places"
|
||||
color="grey"></c-amount.display>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<div>{% if transaction.account.group %}{{ transaction.account.group.name }} • {% endif %}{{ transaction.account.name }}</div>
|
||||
|
||||
@@ -58,7 +58,7 @@ _="on change from #transactions-list or htmx:afterSettle
|
||||
<div class="vr mx-3 tw-align-middle"></div>
|
||||
<span _="on selected_transactions_updated from #actions-bar
|
||||
set total to 0.0
|
||||
for amt in <.transaction:has(input[name='transactions']:checked) .amount/>
|
||||
for amt in <.transaction:has(input[name='transactions']:checked) .main-amount .amount/>
|
||||
set amountValue to parseFloat(amt.getAttribute('data-amount'))
|
||||
if not isNaN(amountValue)
|
||||
set total to total + amountValue
|
||||
|
||||
Reference in New Issue
Block a user