Skip to content

Firefly III: a personal finances manager

Fix amounts in transaction.

James Cole134770644a11
diff --git a/resources/assets/v2/src/pages/transactions/show.js b/resources/assets/v2/src/pages/transactions/show.js
index ad5a3f55ab..84522924a5 100644
--- a/resources/assets/v2/src/pages/transactions/show.js
+++ b/resources/assets/v2/src/pages/transactions/show.js
@@ -87,11 +87,16 @@ let show = function () {
if (this.entries.hasOwnProperty(i)) {
const currencyCode = this.entries[i].currency_code;
const foreignCurrencyCode = this.entries[i].foreign_currency_code;
+ const primaryCurrencyCode = this.entries[i].primary_currency_code;
if (undefined === this.amounts[currencyCode]) {
this.amounts[currencyCode] = 0;
this.amounts[currencyCode] += parseFloat(this.entries[i].amount);
}
+ if (undefined === this.amounts[primaryCurrencyCode]) {
+ this.amounts[primaryCurrencyCode] = 0;
+ this.amounts[primaryCurrencyCode] += parseFloat(this.entries[i].pc_amount);
+ }
if (null !== foreignCurrencyCode && '' !== foreignCurrencyCode && undefined === this.amounts[foreignCurrencyCode]) {
this.amounts[foreignCurrencyCode] = 0;
this.amounts[foreignCurrencyCode] += parseFloat(this.entries[i].foreign_amount);
diff --git a/resources/views/v2/transactions/show.blade.php b/resources/views/v2/transactions/show.blade.php
index 80f948b353..ebaa9e87f4 100644
--- a/resources/views/v2/transactions/show.blade.php
+++ b/resources/views/v2/transactions/show.blade.php
@@ -17,23 +17,23 @@
<tbody>
<tr>
<th style="width:10%;">
- <template x-if="'Withdrawal' === groupProperties.transactionType">
+ <template x-if="'withdrawal' === groupProperties.transactionType">
<em class="fa fa-solid fa-arrow-left"
:title="groupProperties.transactionTypeTranslated"></em>
</template>
- <template x-if="'Deposit' === groupProperties.transactionType">
+ <template x-if="'deposit' === groupProperties.transactionType">
<em class="fa-solid fa-arrow-right"
:title="groupProperties.transactionTypeTranslated"></em>
</template>
- <template x-if="'Transfer' === groupProperties.transactionType">
+ <template x-if="'transfer' === groupProperties.transactionType">
<em class="fa-solid fa-rotate"
:title="groupProperties.transactionTypeTranslated"></em>
</template>
<template
- x-if="'Transfer' !== groupProperties.transactionType && 'Deposit' !== groupProperties.transactionType && 'Withdrawal' !== groupProperties.transactionType">
- <span>TODO missing ICON</span>
+ x-if="'transfer' !== groupProperties.transactionType && 'deposit' !== groupProperties.transactionType && 'withdrawal' !== groupProperties.transactionType">
+ <span x-text="groupProperties.transactionType"></span>
</template>
</th>
<td><span class="group_title" :data-group="groupProperties.id" x-text="groupProperties.title"></span></td>
@@ -53,6 +53,18 @@
<a class="btn btn-danger" :href="'./transactions/delete/' + groupProperties.id">
<em class="fa-solid fa-trash"></em> {{ __('firefly.delete') }}
</a>
+ <div class="btn-group btn-group-sm" role="group">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
+ {{ __('firefly.actions') }}
+ </button>
+ <ul class="dropdown-menu">
+ <li x-show="'withdrawal' !== groupProperties.transactionType"><a class="dropdown-item" href="{{ route('transactions.convert.index', ['withdrawal', $transactionGroup['id']]) }}">{{ __('firefly.convert_to_withdrawal') }}</a></li>
+ <li x-show="'deposit' !== groupProperties.transactionType"><a class="dropdown-item" href="{{ route('transactions.convert.index', ['deposit', $transactionGroup['id']]) }}">{{ __('firefly.convert_to_deposit') }}</a></li>
+ <li x-show="'transfer' !== groupProperties.transactionType"><a class="dropdown-item" href="{{ route('transactions.convert.index', ['transfer', $transactionGroup['id']]) }}">{{ __('firefly.convert_to_transfer') }}</a></li>
+ <li><a class="dropdown-item" href="#">{{ __('firefly.clone') }}</a></li>
+ <li><a class="dropdown-item" href="#">{{ __('firefly.clone_and_edit') }}</a></li>
+ </ul>
+ </div>
</div>
</div>
</div>
@@ -70,25 +82,25 @@
<em class="fa-solid fa-money-bill-wave" title="{{ __('firefly.amount') }}"></em>
</th>
<td>
- <template x-if="'Withdrawal' === groupProperties.transactionType">
+ <template x-if="'withdrawal' === groupProperties.transactionType">
<template x-for="(amount, code) in amounts">
<span class="text-danger" x-text="formatMoney(amount*-1, code)"></span>
</template>
</template>
- <template x-if="'Deposit' === groupProperties.transactionType">
+ <template x-if="'deposit' === groupProperties.transactionType">
<template x-for="(amount, code) in amounts">
<span class="text-success" x-text="formatMoney(amount, code)"></span>
</template>
</template>
- <template x-if="'Transfer' === groupProperties.transactionType">
+ <template x-if="'transfer' === groupProperties.transactionType">
<template x-for="(amount, code) in amounts">
<span class="text-info" x-text="formatMoney(amount, code)"></span>
</template>
</template>
<template
- x-if="'Transfer' !== groupProperties.transactionType && 'Deposit' !== groupProperties.transactionType && 'Withdrawal' !== groupProperties.transactionType">
+ x-if="'transfer' !== groupProperties.transactionType && 'deposit' !== groupProperties.transactionType && 'withdrawal' !== groupProperties.transactionType">
<span>TODO PARSE MISSING AMOUNT</span>
</template>
</td>
@@ -164,33 +176,33 @@
:title="entry.source_account.name"
x-text="entry.source_account.name"></a>
&rarr;
- <template x-if="'Withdrawal' === groupProperties.transactionType">
+ <template x-if="'withdrawal' === groupProperties.transactionType">
<span class="text-danger"
x-text="formatMoney(entry.amount*-1, entry.currency_code)"></span>
</template>
- <template x-if="'Deposit' === groupProperties.transactionType">
+ <template x-if="'deposit' === groupProperties.transactionType">
<span class="text-success"
x-text="formatMoney(entry.amount, entry.currency_code)"></span>
</template>
- <template x-if="'Transfer' === groupProperties.transactionType">
+ <template x-if="'transfer' === groupProperties.transactionType">
<span class="text-info"
x-text="formatMoney(entry.amount, entry.currency_code)"></span>
</template>
<template
- x-if="null !== entry.foreign_currency_code && 'Withdrawal' === groupProperties.transactionType">
+ x-if="null !== entry.foreign_currency_code && '' !== entry.foreign_currency_code && 'withdrawal' === groupProperties.transactionType">
<span class="text-muted"
- x-text="formatMoney(entry.foreign_amount*-1, entry.foreign_currency_code)"></span>
+ x-text="formatMoney(entry.foreign_amount*-1, entry.foreign_currency_code) + 'y'"></span>
</template>
<template
- x-if="null !== entry.foreign_currency_code && 'Withdrawal' !== groupProperties.transactionType">
+ x-if="null !== entry.foreign_currency_code && '' !== entry.foreign_currency_code && 'withdrawal' !== groupProperties.transactionType">
<span class="text-muted"
- x-text="formatMoney(entry.foreign_amount, entry.foreign_currency_code)"></span>
+ x-text="formatMoney(entry.foreign_amount, entry.foreign_currency_code) + 'x'"></span>
</template>
<template
- x-if="'Transfer' !== groupProperties.transactionType && 'Deposit' !== groupProperties.transactionType && 'Withdrawal' !== groupProperties.transactionType">
+ x-if="'transfer' !== groupProperties.transactionType && 'deposit' !== groupProperties.transactionType && 'withdrawal' !== groupProperties.transactionType">
<span>TODO PARSE MISSING AMOUNT</span>
</template>
&rarr;