From 2f66315416bead1c211ee0b024576bba7eceafa8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 23 Oct 2022 14:53:13 +0200 Subject: [PATCH 1/2] Fix #6556 --- app/Http/Controllers/Chart/BillController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index 6ba30c5dec..ff1782f1b5 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -31,7 +31,6 @@ use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Support\CacheProperties; use Illuminate\Http\JsonResponse; -use JsonException; /** * Class BillController. @@ -134,7 +133,7 @@ class BillController extends Controller } ); - $chartData = [ + $chartData = [ ['type' => 'line', 'label' => (string) trans('firefly.min-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol, 'currency_code' => $bill->transactionCurrency->code, 'entries' => []], ['type' => 'line', 'label' => (string) trans('firefly.max-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol, @@ -142,7 +141,7 @@ class BillController extends Controller ['type' => 'bar', 'label' => (string) trans('firefly.journal-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol, 'currency_code' => $bill->transactionCurrency->code, 'entries' => []], ]; - + $currencyId = (int) $bill->transaction_currency_id; foreach ($journals as $journal) { $date = $journal['date']->isoFormat((string) trans('config.month_and_day_js', [], $locale)); $chartData[0]['entries'][$date] = $bill->amount_min; // minimum amount of bill @@ -152,7 +151,12 @@ class BillController extends Controller if (!array_key_exists($date, $chartData[2]['entries'])) { $chartData[2]['entries'][$date] = '0'; } - $amount = bcmul($journal['amount'], '-1'); + $amount = bcmul($journal['amount'], '-1'); + if ($currencyId === $journal['foreign_currency_id']) { + $amount = bcmul($journal['foreign_amount'], '-1'); + } + + $chartData[2]['entries'][$date] = bcadd($chartData[2]['entries'][$date], $amount); // amount of journal } From d4738b21abf9a573b7a7e5978c3fe4e7ce711f55 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 23 Oct 2022 17:36:26 +0200 Subject: [PATCH 2/2] Make sure form elements are not spell checked. --- resources/assets/js/components/passport/Clients.vue | 10 +++++----- .../js/components/passport/PersonalAccessTokens.vue | 2 +- .../js/components/transactions/AccountSelect.vue | 1 + resources/assets/js/components/transactions/Amount.vue | 2 +- .../assets/js/components/transactions/Category.vue | 1 + .../js/components/transactions/CustomAttachments.vue | 2 +- .../assets/js/components/transactions/CustomDate.vue | 2 +- .../assets/js/components/transactions/CustomString.vue | 2 +- .../assets/js/components/transactions/CustomUri.vue | 2 +- .../js/components/transactions/GroupDescription.vue | 1 + .../components/transactions/TransactionDescription.vue | 1 + resources/views/accounts/reconcile/index.twig | 8 ++++---- resources/views/auth/login.twig | 4 ++-- resources/views/auth/mfa.twig | 2 +- resources/views/auth/passwords/email.twig | 2 +- resources/views/auth/passwords/reset.twig | 6 +++--- resources/views/auth/register.twig | 6 +++--- resources/views/auth/two-factor.twig | 2 +- resources/views/layout/default.twig | 2 +- resources/views/profile/change-email.twig | 2 +- resources/views/profile/change-password.twig | 6 +++--- resources/views/profile/delete-account.twig | 2 +- resources/views/profile/logout-other-sessions.twig | 2 +- resources/views/search/index.twig | 2 +- resources/views/transactions/bulk/edit.twig | 8 ++++---- resources/views/transactions/mass/edit.twig | 6 +++--- 26 files changed, 45 insertions(+), 41 deletions(-) diff --git a/resources/assets/js/components/passport/Clients.vue b/resources/assets/js/components/passport/Clients.vue index edbfa9d982..68920664d5 100644 --- a/resources/assets/js/components/passport/Clients.vue +++ b/resources/assets/js/components/passport/Clients.vue @@ -127,7 +127,7 @@
- @@ -141,7 +141,7 @@
- @@ -214,7 +214,7 @@
- @@ -228,7 +228,7 @@
- @@ -268,7 +268,7 @@ {{ $t('firefly.profile_oauth_client_secret_expl') }}

- +
diff --git a/resources/assets/js/components/passport/PersonalAccessTokens.vue b/resources/assets/js/components/passport/PersonalAccessTokens.vue index bb490f85de..ffa0dea671 100644 --- a/resources/assets/js/components/passport/PersonalAccessTokens.vue +++ b/resources/assets/js/components/passport/PersonalAccessTokens.vue @@ -108,7 +108,7 @@
- +
diff --git a/resources/assets/js/components/transactions/AccountSelect.vue b/resources/assets/js/components/transactions/AccountSelect.vue index 5a84ccb7d1..ca3705c628 100644 --- a/resources/assets/js/components/transactions/AccountSelect.vue +++ b/resources/assets/js/components/transactions/AccountSelect.vue @@ -25,6 +25,7 @@
-
-
-
-
-
- +
{{ currency.symbol }} - +
@@ -55,13 +55,13 @@
- +
{{ currency.symbol }} - +
diff --git a/resources/views/auth/login.twig b/resources/views/auth/login.twig index 9a96d56365..936f695e08 100644 --- a/resources/views/auth/login.twig +++ b/resources/views/auth/login.twig @@ -57,11 +57,11 @@ {% if config('firefly.authentication_guard') == 'web' %} {% else %} - + {% endif %}
- +
diff --git a/resources/views/auth/mfa.twig b/resources/views/auth/mfa.twig index 9297a6d4f3..ddac6e5482 100644 --- a/resources/views/auth/mfa.twig +++ b/resources/views/auth/mfa.twig @@ -18,7 +18,7 @@
- +
diff --git a/resources/views/auth/passwords/email.twig b/resources/views/auth/passwords/email.twig index cbfdb62597..1f6e0d13f9 100644 --- a/resources/views/auth/passwords/email.twig +++ b/resources/views/auth/passwords/email.twig @@ -31,7 +31,7 @@
- +
diff --git a/resources/views/auth/passwords/reset.twig b/resources/views/auth/passwords/reset.twig index 50f3ee56fc..d323ae3308 100644 --- a/resources/views/auth/passwords/reset.twig +++ b/resources/views/auth/passwords/reset.twig @@ -20,15 +20,15 @@
- +
- +
- +
diff --git a/resources/views/auth/register.twig b/resources/views/auth/register.twig index 6c2aa714b3..75f715b661 100644 --- a/resources/views/auth/register.twig +++ b/resources/views/auth/register.twig @@ -19,13 +19,13 @@
- +
- +
- +
diff --git a/resources/views/auth/two-factor.twig b/resources/views/auth/two-factor.twig index 73fd2998ae..cfe9657ee0 100644 --- a/resources/views/auth/two-factor.twig +++ b/resources/views/auth/two-factor.twig @@ -22,7 +22,7 @@
- +
diff --git a/resources/views/layout/default.twig b/resources/views/layout/default.twig index aedf826479..d1039ef92f 100644 --- a/resources/views/layout/default.twig +++ b/resources/views/layout/default.twig @@ -101,7 +101,7 @@
diff --git a/resources/views/profile/delete-account.twig b/resources/views/profile/delete-account.twig index 5783b1d910..839380e039 100644 --- a/resources/views/profile/delete-account.twig +++ b/resources/views/profile/delete-account.twig @@ -38,7 +38,7 @@
- +
diff --git a/resources/views/profile/logout-other-sessions.twig b/resources/views/profile/logout-other-sessions.twig index 01a40dfd9d..4399b044c0 100644 --- a/resources/views/profile/logout-other-sessions.twig +++ b/resources/views/profile/logout-other-sessions.twig @@ -19,7 +19,7 @@
-
diff --git a/resources/views/search/index.twig b/resources/views/search/index.twig index a053d03b20..56dd35ab2e 100644 --- a/resources/views/search/index.twig +++ b/resources/views/search/index.twig @@ -20,7 +20,7 @@
-
diff --git a/resources/views/transactions/bulk/edit.twig b/resources/views/transactions/bulk/edit.twig index 509a35838f..223b50788b 100644 --- a/resources/views/transactions/bulk/edit.twig +++ b/resources/views/transactions/bulk/edit.twig @@ -60,8 +60,8 @@ ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }}) {% endif %} {% endif %} - - + + {{ journal.date.isoFormat(monthAndDayFormat) }} @@ -104,7 +104,7 @@ {{ trans('list.category') }} - +
@@ -136,7 +136,7 @@ {{ trans('list.tags') }} - +
diff --git a/resources/views/transactions/mass/edit.twig b/resources/views/transactions/mass/edit.twig index 6dca509a69..0402ecc3c7 100644 --- a/resources/views/transactions/mass/edit.twig +++ b/resources/views/transactions/mass/edit.twig @@ -111,7 +111,7 @@ {# SOURCE ACCOUNT NAME FOR DEPOSIT #} {% if journal.transaction_type_type == 'Deposit' %} - @@ -141,7 +141,7 @@ {# category #} - {# budget #}