Skip to content

Firefly III: a personal finances manager

Add debug messages.

James Coledc4665e82ad1
diff --git a/app/Events/TransactionJournalStored.php b/app/Events/TransactionJournalStored.php
index d28e1bc5e1..82653056a9 100644
--- a/app/Events/TransactionJournalStored.php
+++ b/app/Events/TransactionJournalStored.php
@@ -12,6 +12,7 @@ namespace FireflyIII\Events;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels;
+use Log;
/**
* Class TransactionJournalStored
@@ -34,6 +35,7 @@ class TransactionJournalStored extends Event
*/
public function __construct(TransactionJournal $journal, int $piggyBankId)
{
+ Log::debug('Created new TransactionJournalStored.');
//
$this->journal = $journal;
$this->piggyBankId = $piggyBankId;
diff --git a/app/Events/TransactionJournalUpdated.php b/app/Events/TransactionJournalUpdated.php
index ad75a4f410..e6c11d44c1 100644
--- a/app/Events/TransactionJournalUpdated.php
+++ b/app/Events/TransactionJournalUpdated.php
@@ -5,6 +5,7 @@ namespace FireflyIII\Events;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels;
+use Log;
/**
* Class TransactionJournalUpdated
@@ -25,6 +26,7 @@ class TransactionJournalUpdated extends Event
*/
public function __construct(TransactionJournal $journal)
{
+ Log::debug('Created new TransactionJournalUpdated');
//
$this->journal = $journal;
}
diff --git a/app/Handlers/Events/FireRulesForStore.php b/app/Handlers/Events/FireRulesForStore.php
index 1d33736afc..05ab7006d8 100644
--- a/app/Handlers/Events/FireRulesForStore.php
+++ b/app/Handlers/Events/FireRulesForStore.php
@@ -36,6 +36,7 @@ class FireRulesForStore
*/
public function handle(TransactionJournalStored $event): bool
{
+ Log::debug('Now running FireRulesForStore because TransactionJournalStored fired.');
// get all the user's rule groups, with the rules, order by 'order'.
/** @var User $user */
$user = Auth::user();
diff --git a/app/Handlers/Events/FireRulesForUpdate.php b/app/Handlers/Events/FireRulesForUpdate.php
index 27aa80c39f..ae1e187d67 100644
--- a/app/Handlers/Events/FireRulesForUpdate.php
+++ b/app/Handlers/Events/FireRulesForUpdate.php
@@ -34,6 +34,7 @@ class FireRulesForUpdate
*/
public function handle(TransactionJournalUpdated $event): bool
{
+ Log::debug('Now running FireRulesForUpdate because TransactionJournalUpdated fired.');
// get all the user's rule groups, with the rules, order by 'order'.
/** @var User $user */
$user = Auth::user();
diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php
index a0971dd904..b70fd3ac54 100644
--- a/app/Http/Controllers/TransactionController.php
+++ b/app/Http/Controllers/TransactionController.php
@@ -20,6 +20,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use Illuminate\Support\Collection;
use Input;
+use Log;
use Preferences;
use Response;
use Session;
@@ -307,6 +308,7 @@ class TransactionController extends Controller
Session::flash('info', $att->getMessages()->get('attachments'));
}
+ Log::debug('Triggered TransactionJournalStored with transaction journal #' . $journal->id.' and piggy #' . intval($request->get('piggy_bank_id')));
event(new TransactionJournalStored($journal, intval($request->get('piggy_bank_id'))));
Session::flash('success', strval(trans('firefly.stored_journal', ['description' => e($journal->description)])));
diff --git a/app/Rules/Processor.php b/app/Rules/Processor.php
index 1bbcc988f5..58e5d406e2 100644
--- a/app/Rules/Processor.php
+++ b/app/Rules/Processor.php
@@ -138,11 +138,13 @@ final class Processor
$triggered = $this->triggered();
if ($triggered) {
if ($this->actions->count() > 0) {
+ Log::debug('Journal #' . $journal->id . ' triggered, actions executed.');
$this->actions();
}
return true;
}
+ Log::debug('Journal #' . $journal->id . ' not triggered, did nothing.');
return false;
diff --git a/resources/views/reports/audit/report.twig b/resources/views/reports/audit/report.twig
new file mode 100644
index 0000000000..adc37cf7ba
--- /dev/null
+++ b/resources/views/reports/audit/report.twig
@@ -0,0 +1,50 @@
+{% extends "./layout/default.twig" %}
+
+{% block breadcrumbs %}
+ {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }}
+{% endblock %}
+
+{% block content %}
+
+ {% for account in accounts %}
+ <div class="row">
+ <div class="col-lg-12 col-md-12 col-sm-12">
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title">{{ account.name }}</h3>
+ </div>
+ <div class="box-body">
+ {% if not auditData[account.id].exists %}
+ <em>
+ No activity was recorded
+ on account <a href="{{ route('accounts.show',account.id) }}"
+ title="{{ account.name }}">{{ account.name }}</a>
+ between
+ {{ start }} and
+ {{ end }}.
+ </em>
+ {% else %}
+ <p>
+ Account balance of <a href="{{ route('accounts.show',account.id) }}"
+ title="{{ account.name }}">{{ account.name }}</a>
+ at the end of {{ auditData[account.id].end }} was:
+ {{ auditData[account.id].endBalance|formatAmount }}
+ </p>
+ {% include 'list/journals-extended.twig' with {'journals': auditData[account.id].journals,'account':account} %}
+ <p>
+ Account balance of <a href="{{ route('accounts.show',account.id) }}" title="{{ account.name }}">{{ account.name }}</a>
+ at the end of {{ auditData[account.id].dayBefore }} was:
+ {{ auditData[account.id].dayBeforeBalance|formatAmount }}
+ </p>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+
+{% endblock %}
+{% block styles %}
+{% endblock %}
+{% block scripts %}
+{% endblock %}
diff --git a/resources/views/reports/index.twig b/resources/views/reports/index.twig
index 0f1aa7e179..7d878d8fa7 100644
--- a/resources/views/reports/index.twig
+++ b/resources/views/reports/index.twig
@@ -20,8 +20,8 @@
<div class="col-sm-9">
<select name="report_type" class="form-control" id="inputReportType">
- <option label="{{ 'report_type_default'|_ }}" value="default">{{ 'report_type_default'|_ }}</option>
- <!--<option label="{{ 'report_type_audit'|_ }}" value="audit">{{ 'report_type_audit'|_ }}</option>-->
+ <option selected label="{{ 'report_type_default'|_ }}" value="default">{{ 'report_type_default'|_ }}</option>
+ <option label="{{ 'report_type_audit'|_ }}" value="audit">{{ 'report_type_audit'|_ }}</option>
</select>
</div>
</div>