mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 22:35:03 +00:00
Made deleted piggy banks for piggy bank events visible.
This commit is contained in:
@@ -10,11 +10,13 @@ use FireflyIII\Events\JournalSaved;
|
|||||||
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||||
use FireflyIII\Http\Requests\JournalFormRequest;
|
use FireflyIII\Http\Requests\JournalFormRequest;
|
||||||
use FireflyIII\Models\PiggyBank;
|
use FireflyIII\Models\PiggyBank;
|
||||||
|
use FireflyIII\Models\PiggyBankEvent;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
use Input;
|
use Input;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
use Response;
|
||||||
@@ -264,6 +266,15 @@ class TransactionController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function show(JournalRepositoryInterface $repository, TransactionJournal $journal)
|
public function show(JournalRepositoryInterface $repository, TransactionJournal $journal)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/** @var Collection $set */
|
||||||
|
$events = $journal->piggyBankEvents()->get();
|
||||||
|
$events->each(
|
||||||
|
function (PiggyBankEvent $event) {
|
||||||
|
$event->piggyBank = $event->piggyBank()->withTrashed()->first();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
bcscale(2);
|
bcscale(2);
|
||||||
$journal->transactions->each(
|
$journal->transactions->each(
|
||||||
function (Transaction $t) use ($journal, $repository) {
|
function (Transaction $t) use ($journal, $repository) {
|
||||||
@@ -274,7 +285,7 @@ class TransactionController extends Controller
|
|||||||
$what = strtolower($journal->getTransactionType());
|
$what = strtolower($journal->getTransactionType());
|
||||||
$subTitle = trans('firefly.' . $journal->getTransactionType()) . ' "' . e($journal->description) . '"';
|
$subTitle = trans('firefly.' . $journal->getTransactionType()) . ' "' . e($journal->description) . '"';
|
||||||
|
|
||||||
return view('transactions.show', compact('journal', 'subTitle', 'what'));
|
return view('transactions.show', compact('journal','events', 'subTitle', 'what'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property integer $transaction_journal_id
|
* @property integer $transaction_journal_id
|
||||||
* @property \Carbon\Carbon $date
|
* @property \Carbon\Carbon $date
|
||||||
* @property float $amount
|
* @property float $amount
|
||||||
* @property-read \FireflyIII\Models\PiggyBank $piggyBank
|
* @property \FireflyIII\Models\PiggyBank $piggyBank
|
||||||
* @property-read \FireflyIII\Models\TransactionJournal $transactionJournal
|
* @property-read \FireflyIII\Models\TransactionJournal $transactionJournal
|
||||||
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankEvent whereId($value)
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankEvent whereId($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankEvent whereCreatedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankEvent whereCreatedAt($value)
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
{% if showPiggyBank %}
|
{% if showPiggyBank %}
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ route('piggy-banks.show',event.piggyBank_id) }}">{{ event.piggyBank.name }}</a>
|
<a href="{{ route('piggy-banks.show',event.piggyBank.id) }}">{{ event.piggyBank.name }}</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>
|
<td>
|
||||||
|
@@ -126,10 +126,10 @@
|
|||||||
{% if journal.piggyBankEvents|length > 0 %}
|
{% if journal.piggyBankEvents|length > 0 %}
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
{{ 'piggyBanks'|_ }}
|
<h3 class="box-title">{{ 'piggyBanks'|_ }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
{% include 'list/piggy-bank-events' with {'events': journal.piggyBankEvents, 'showPiggyBank':true} %}
|
{% include 'list/piggy-bank-events' with {'events': events, 'showPiggyBank':true} %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user