Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Some more last-minute fixes.
James Colea24854464199
diff --git a/app/Factory/TransactionFactory.php b/app/Factory/TransactionFactory.phpindex 6331f2eed5..3cf47f1eed 100644--- a/app/Factory/TransactionFactory.php+++ b/app/Factory/TransactionFactory.php@@ -177,7 +177,12 @@ class TransactionFactory}// @codeCoverageIgnoreEndif (null !== $result) {- Log::debug(sprintf('Created transaction #%d (%s %s), part of journal #%d', $result->id, $this->currency->code, $amount, $this->journal->id));+ Log::debug(+ sprintf(+ 'Created transaction #%d (%s %s, account %s), part of journal #%d', $result->id, $this->currency->code, $amount, $this->account->name,+ $this->journal->id+ )+ );// do foreign currency thing: add foreign currency info to $one and $two if necessary.if (null !== $this->foreignCurrency && null !== $foreignAmount && $this->foreignCurrency->id !== $this->currency->id) {diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.phpindex 76c382c9cc..d185e4c975 100644--- a/app/Factory/TransactionJournalFactory.php+++ b/app/Factory/TransactionJournalFactory.php@@ -287,7 +287,7 @@ class TransactionJournalFactory$destForeignCurrency = $foreignCurrency;}- if ('Transfer' === $type->type) {+ if (TransactionType::TRANSFER === $type->type) {// get currencies$currency = $this->getCurrency($currency, $sourceAccount);$foreignCurrency = $this->getCurrency($foreignCurrency, $destinationAccount);@@ -298,6 +298,11 @@ class TransactionJournalFactory$destForeignCurrency = $currency;}+ // if transfer, switch accounts:+ if (TransactionType::TRANSFER === $type->type) {+ [$sourceAccount, $destinationAccount] = [$destinationAccount, $sourceAccount];+ }+/** Create a basic journal. */$journal = TransactionJournal::create([diff --git a/app/Http/Controllers/Transaction/ShowController.php b/app/Http/Controllers/Transaction/ShowController.phpindex 246ac0c8ba..80b9240914 100644--- a/app/Http/Controllers/Transaction/ShowController.php+++ b/app/Http/Controllers/Transaction/ShowController.php@@ -73,7 +73,6 @@ class ShowController extends Controller$type = $first->transactionType->type;$title = 1 === $splits ? $first->description : $transactionGroup->title;$subTitle = sprintf('%s: "%s"', $type, $title);- $message = $request->get('message');/** @var TransactionGroupTransformer $transformer */$transformer = app(TransactionGroupTransformer::class);@@ -91,7 +90,7 @@ class ShowController extends Controllerreturn view('transactions.show', compact('transactionGroup', 'amounts', 'first', 'type', 'subTitle', 'splits', 'groupArray',- 'events', 'attachments', 'links', 'message'+ 'events', 'attachments', 'links'));}diff --git a/app/Import/Storage/ImportArrayStorage.php b/app/Import/Storage/ImportArrayStorage.phpindex 4963d35039..b10c3a9f92 100644--- a/app/Import/Storage/ImportArrayStorage.php+++ b/app/Import/Storage/ImportArrayStorage.php@@ -459,8 +459,9 @@ class ImportArrayStorage// compare date:$transferDate = $transfer['date']->format('Y-m-d H:i:s');- Log::debug(sprintf('Comparing dates "%s" to "%s"', $transaction['date'], $transferDate));- if ($transaction['date'] !== $transferDate) {+ $transactionDate = $transaction['date']->format('Y-m-d H:i:s');+ Log::debug(sprintf('Comparing dates "%s" to "%s"', $transactionDate, $transferDate));+ if ($transactionDate !== $transferDate) {Log::debug('Date is not a match, continue with next transfer.');continue; // @codeCoverageIgnore}diff --git a/app/Support/Import/Routine/File/ImportableConverter.php b/app/Support/Import/Routine/File/ImportableConverter.phpindex c88822811f..69025d24f3 100644--- a/app/Support/Import/Routine/File/ImportableConverter.php+++ b/app/Support/Import/Routine/File/ImportableConverter.php@@ -120,7 +120,6 @@ class ImportableConverter// amount is positive? Then switch:if (1 === bccomp($amount, '0')) {-[$destination, $source] = [$source, $destination];Log::debug(sprintf(diff --git a/resources/views/v1/transactions/index.twig b/resources/views/v1/transactions/index.twigindex 878c4ef490..3646195456 100644--- a/resources/views/v1/transactions/index.twig+++ b/resources/views/v1/transactions/index.twig@@ -10,7 +10,7 @@{% if periods|length > 0 %}<div class="row"><div class="col-lg-offset-10 col-lg-2 col-md-offset-10 col-md-2 col-sm-12 col-xs-12">- <p class="small text-center"><a href="{{ route('transactions.index.all',[transactionType]) }}">{{ 'showEverything'|_ }}</a></p>+ <p class="small text-center"><a href="{{ route('transactions.index.all',[objectType]) }}">{{ 'showEverything'|_ }}</a></p></div></div>{% endif %}@@ -34,12 +34,12 @@{% if periods|length > 0 %}<p><i class="fa fa-calendar"></i>- <a href="{{ route('transactions.index.all', [transactionType]) }}">{{ 'show_all_no_filter'|_ }}</a>+ <a href="{{ route('transactions.index.all', [objectType]) }}">{{ 'show_all_no_filter'|_ }}</a></p>{% else %}<p><i class="fa fa-calendar"></i>- <a href="{{ route('transactions.index', [transactionType]) }}">{{ 'show_the_current_period_and_overview'|_ }}</a>+ <a href="{{ route('transactions.index', [objectType]) }}">{{ 'show_the_current_period_and_overview'|_ }}</a></p>{% endif %}</div>@@ -59,7 +59,7 @@{% if periods|length > 0 %}<div class="row"><div class="col-lg-offset-10 col-lg-2 col-md-offset-10 col-md-2 col-sm-12 col-xs-12">- <p class="small text-center"><a href="{{ route('transactions.index.all',[transactionType]) }}">{{ 'showEverything'|_ }}</a></p>+ <p class="small text-center"><a href="{{ route('transactions.index.all', [objectType]) }}">{{ 'showEverything'|_ }}</a></p></div></div>{% endif %}diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twigindex 972d715285..3b0e75c589 100644--- a/resources/views/v1/transactions/show.twig+++ b/resources/views/v1/transactions/show.twig@@ -5,36 +5,6 @@{% endblock %}{% block content %}- {% if message == 'created' %}- <div class="row">- <div class="col-lg-12">- <div class="alert alert-success alert-dismissible" role="alert">- <button type="button" class="close" data-dismiss="alert">- <span>×</span><span class="sr-only">{{ 'close'|_ }}</span>- </button>- <strong>{{ 'flash_success'|_ }}</strong>- {{ trans('firefly.stored_journal_no_descr') }}-- </div>- </div>- </div>- {% endif %}-- {% if message == 'updated' %}- <div class="row">- <div class="col-lg-12">- <div class="alert alert-success alert-dismissible" role="alert">- <button type="button" class="close" data-dismiss="alert">- <span>×</span><span class="sr-only">{{ 'close'|_ }}</span>- </button>- <strong>{{ 'flash_success'|_ }}</strong>- {{ trans('firefly.updated_journal_no_descr') }}-- </div>- </div>- </div>- {% endif %}-<div class="row"><div class="col-lg-6"><div class="box box-primary">