mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 22:35:03 +00:00
Various small fixes.
This commit is contained in:
@@ -150,11 +150,8 @@ class HomeController extends Controller
|
|||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$collector = app(JournalCollectorInterface::class);
|
$collector = app(JournalCollectorInterface::class);
|
||||||
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->setLimit(10)->setPage(1);
|
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->setLimit(10)->setPage(1);
|
||||||
$set = $collector->getJournals();
|
$set = $collector->getJournals();
|
||||||
|
$transactions[] = [$set, $account];
|
||||||
if (count($set) > 0) {
|
|
||||||
$transactions[] = [$set, $account];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view(
|
return view(
|
||||||
|
@@ -25,6 +25,7 @@ use Illuminate\Http\RedirectResponse;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
use Response;
|
||||||
|
use Session;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -145,6 +146,7 @@ class ReportController extends Controller
|
|||||||
if ($end < $start) {
|
if ($end < $start) {
|
||||||
return view('error')->with('message', trans('firefly.end_after_start_date'));
|
return view('error')->with('message', trans('firefly.end_after_start_date'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($start < session('first')) {
|
if ($start < session('first')) {
|
||||||
$start = session('first');
|
$start = session('first');
|
||||||
}
|
}
|
||||||
@@ -174,7 +176,6 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(AccountRepositoryInterface $repository)
|
public function index(AccountRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var Carbon $start */
|
/** @var Carbon $start */
|
||||||
$start = clone session('first');
|
$start = clone session('first');
|
||||||
$months = $this->helper->listOfMonths($start);
|
$months = $this->helper->listOfMonths($start);
|
||||||
@@ -220,6 +221,12 @@ class ReportController extends Controller
|
|||||||
$accounts = join(',', $request->getAccountList()->pluck('id')->toArray());
|
$accounts = join(',', $request->getAccountList()->pluck('id')->toArray());
|
||||||
$categories = join(',', $request->getCategoryList()->pluck('id')->toArray());
|
$categories = join(',', $request->getCategoryList()->pluck('id')->toArray());
|
||||||
|
|
||||||
|
if ($request->getAccountList()->count() === 0) {
|
||||||
|
Session::flash('error', trans('firefly.select_more_than_one_account'));
|
||||||
|
|
||||||
|
return redirect(route('reports.index'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($end < $start) {
|
if ($end < $start) {
|
||||||
return view('error')->with('message', trans('firefly.end_after_start_date'));
|
return view('error')->with('message', trans('firefly.end_after_start_date'));
|
||||||
}
|
}
|
||||||
|
@@ -155,7 +155,7 @@ class SingleController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$type = TransactionJournal::transactionTypeStr($transactionJournal);
|
$type = TransactionJournal::transactionTypeStr($transactionJournal);
|
||||||
Session::flash('success', strval(trans('firefly.deleted_' . $type, ['description' => e($transactionJournal->description)])));
|
Session::flash('success', strval(trans('firefly.deleted_' . strtolower($type), ['description' => e($transactionJournal->description)])));
|
||||||
|
|
||||||
$repository->delete($transactionJournal);
|
$repository->delete($transactionJournal);
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@ use FireflyIII\Models\PiggyBank;
|
|||||||
use FireflyIII\Models\PiggyBankRepetition;
|
use FireflyIII\Models\PiggyBankRepetition;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
|
use FireflyIII\Models\TransactionJournalMeta;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
use Log;
|
use Log;
|
||||||
|
|
||||||
@@ -137,13 +138,21 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
TransactionJournal::deleted(
|
TransactionJournal::deleted(
|
||||||
function (TransactionJournal $journal) {
|
function (TransactionJournal $journal) {
|
||||||
Log::debug('Now triggered journal delete response #' . $journal->id);
|
Log::debug(sprintf('Now triggered journal delete response #%d', $journal->id));
|
||||||
|
|
||||||
/** @var Transaction $transaction */
|
/** @var Transaction $transaction */
|
||||||
foreach ($journal->transactions()->get() as $transaction) {
|
foreach ($journal->transactions()->get() as $transaction) {
|
||||||
Log::debug('Will now delete transaction #' . $transaction->id);
|
Log::debug(sprintf('Will now delete transaction #%d', $transaction->id));
|
||||||
$transaction->delete();
|
$transaction->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// also delete journal_meta entries.
|
||||||
|
|
||||||
|
/** @var TransactionJournalMeta $meta */
|
||||||
|
foreach ($journal->transactionJournalMeta()->get() as $meta) {
|
||||||
|
Log::debug(sprintf('Will now delete meta-entry #%d', $meta->id));
|
||||||
|
$meta->delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@ namespace FireflyIII\Support;
|
|||||||
use Cache;
|
use Cache;
|
||||||
use FireflyIII\Models\Preference;
|
use FireflyIII\Models\Preference;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
|
use Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Preferences
|
* Class Preferences
|
||||||
@@ -128,6 +129,7 @@ class Preferences
|
|||||||
public function mark(): bool
|
public function mark(): bool
|
||||||
{
|
{
|
||||||
$this->set('lastActivity', microtime());
|
$this->set('lastActivity', microtime());
|
||||||
|
Session::forget('first');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -521,6 +521,9 @@ return [
|
|||||||
'stored_new_account' => 'New account ":name" stored!',
|
'stored_new_account' => 'New account ":name" stored!',
|
||||||
'updated_account' => 'Updated account ":name"',
|
'updated_account' => 'Updated account ":name"',
|
||||||
'credit_card_options' => 'Credit card options',
|
'credit_card_options' => 'Credit card options',
|
||||||
|
'no_transactions_account' => 'There are no transactions (in this period) for asset account ":name".',
|
||||||
|
'no_data_for_chart' => 'There is not enough information (yet) to generate this chart.',
|
||||||
|
'select_more_than_one_account' => 'Please select more than one account',
|
||||||
|
|
||||||
// categories:
|
// categories:
|
||||||
'new_category' => 'New category',
|
'new_category' => 'New category',
|
||||||
|
@@ -25,6 +25,8 @@ return [
|
|||||||
'match' => 'Matches on',
|
'match' => 'Matches on',
|
||||||
'repeat_freq' => 'Repeats',
|
'repeat_freq' => 'Repeats',
|
||||||
'journal_currency_id' => 'Currency',
|
'journal_currency_id' => 'Currency',
|
||||||
|
'currency_id' => 'Currency',
|
||||||
|
'attachments' => 'Attachments',
|
||||||
'journal_amount' => 'Amount',
|
'journal_amount' => 'Amount',
|
||||||
'journal_asset_source_account' => 'Asset account (source)',
|
'journal_asset_source_account' => 'Asset account (source)',
|
||||||
'journal_source_account_name' => 'Revenue account (source)',
|
'journal_source_account_name' => 'Revenue account (source)',
|
||||||
|
@@ -82,9 +82,21 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body no-padding">
|
|
||||||
{% include 'list.journals-tiny-tasker' with {'transactions': data[0],'account': data[1]} %}
|
{% if data[0].count > 0 %}
|
||||||
</div>
|
<div class="box-body no-padding">
|
||||||
|
{% include 'list.journals-tiny-tasker' with {'transactions': data[0],'account': data[1]} %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="box-body">
|
||||||
|
<p>
|
||||||
|
<em>
|
||||||
|
{{ trans('firefly.no_transactions_account', {name: data[1].name}) }}
|
||||||
|
</em>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="box-footer clearfix">
|
<div class="box-footer clearfix">
|
||||||
<a class="btn btn-sm btn-default btn-flat pull-right"
|
<a class="btn btn-sm btn-default btn-flat pull-right"
|
||||||
href="{{ route('accounts.show',data[1].id) }}">{{ (data[1]|balance)|formatAmountPlain }}</a>
|
href="{{ route('accounts.show',data[1].id) }}">{{ (data[1]|balance)|formatAmountPlain }}</a>
|
||||||
|
Reference in New Issue
Block a user