From cc56a981cd80e69030886a18c4677779748165c7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 Aug 2019 17:26:00 +0200 Subject: [PATCH] Fix problem with type of transaction. --- .../Transaction/ShowController.php | 2 +- resources/views/v1/transactions/show.twig | 175 +----------------- 2 files changed, 2 insertions(+), 175 deletions(-) diff --git a/app/Http/Controllers/Transaction/ShowController.php b/app/Http/Controllers/Transaction/ShowController.php index a8ef038532..246ac0c8ba 100644 --- a/app/Http/Controllers/Transaction/ShowController.php +++ b/app/Http/Controllers/Transaction/ShowController.php @@ -70,7 +70,7 @@ class ShowController extends Controller /** @var TransactionJournal $first */ $first = $transactionGroup->transactionJournals->first(); $splits = $transactionGroup->transactionJournals->count(); - $type = (string)trans(sprintf('firefly.%s', strtolower($first->transactionType->type))); + $type = $first->transactionType->type; $title = 1 === $splits ? $first->description : $transactionGroup->title; $subTitle = sprintf('%s: "%s"', $type, $title); $message = $request->get('message'); diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig index bd3e40fff7..cd579124df 100644 --- a/resources/views/v1/transactions/show.twig +++ b/resources/views/v1/transactions/show.twig @@ -201,6 +201,7 @@
+ {{ journal.source_name }} → {% if type == 'Withdrawal' or type == 'Deposit' %} @@ -429,177 +430,3 @@ {% endblock %} -{# - - {% if links.count > 0 %} -
-
-

{{ 'journal_links'|_ }}

-
-
- - {% for link in links %} - - - - - {% endfor %} -
-
- - -
-
- {{ ('this_'~(what|lower))|_ }} - {% if link.source.id == journal.id %} - {{ journalLinkTranslation('outward', link.linkType.outward) }} - - #{{ link.destination.id }}: {{ link.destination.description }} - - ({{ link.destination|journalTotalAmount }}) - {% else %} - {{ journalLinkTranslation('inward', link.linkType.inward) }} - - #{{ link.source.id }}: {{ link.source.description }} - ({{ link.source|journalTotalAmount }}) - {% endif %} - {% if link.notes.count == 1 %} -
- {{ link.notes.first.text|markdown }} - {% endif %} -
-
-
-

- -

- {% endif %} - - -
-
-
-
-

{{ 'transactions'|_ }}

-
-
- - - - - - - - - - - - - - {% set maxIdentifier = ((transactions|length) / 2) -1 %} - {% for x in 0..maxIdentifier %} - - {% for transaction in transactions %} - {% if - ((transaction.type == 'Withdrawal') and transaction.identifier == x and transaction.amount < 0) - or - ((transaction.type == 'Deposit' or transaction.type == 'Transfer') and transaction.identifier == x and transaction.amount > 0) %} - - - - - - - {% endif %} - {% endfor %} - - - {% endfor %} - -
{{ trans('list.source_account') }}{{ trans('list.destination_account') }}{{ trans('list.amount') }}
- {% if transaction.source_type == 'Cash account' %} - ({{ 'cash'|_ }}) - {% else %} - {{ transaction.source_name }} - {% endif %} - - {% if transaction.destination_type == 'Cash account' %} - ({{ 'cash'|_ }}) - {% else %} - {{ transaction.destination_name }} - {% endif %} - - - {{ transaction|transactionXArrayAmount }} -
-
-
-
-
- - -#}