mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Various small fixes.
This commit is contained in:
parent
6c9990e0be
commit
c049d5cfa6
app
Http/Controllers
Providers
Support
resources
@ -150,11 +150,8 @@ class HomeController extends Controller
|
||||
foreach ($accounts as $account) {
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->setLimit(10)->setPage(1);
|
||||
$set = $collector->getJournals();
|
||||
|
||||
if (count($set) > 0) {
|
||||
$transactions[] = [$set, $account];
|
||||
}
|
||||
$set = $collector->getJournals();
|
||||
$transactions[] = [$set, $account];
|
||||
}
|
||||
|
||||
return view(
|
||||
|
@ -25,6 +25,7 @@ use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
use Preferences;
|
||||
use Response;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
/**
|
||||
@ -145,6 +146,7 @@ class ReportController extends Controller
|
||||
if ($end < $start) {
|
||||
return view('error')->with('message', trans('firefly.end_after_start_date'));
|
||||
}
|
||||
|
||||
if ($start < session('first')) {
|
||||
$start = session('first');
|
||||
}
|
||||
@ -174,7 +176,6 @@ class ReportController extends Controller
|
||||
*/
|
||||
public function index(AccountRepositoryInterface $repository)
|
||||
{
|
||||
|
||||
/** @var Carbon $start */
|
||||
$start = clone session('first');
|
||||
$months = $this->helper->listOfMonths($start);
|
||||
@ -220,6 +221,12 @@ class ReportController extends Controller
|
||||
$accounts = join(',', $request->getAccountList()->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) {
|
||||
return view('error')->with('message', trans('firefly.end_after_start_date'));
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ class SingleController extends Controller
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
|
@ -18,6 +18,7 @@ use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Models\PiggyBankRepetition;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionJournalMeta;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Log;
|
||||
|
||||
@ -137,13 +138,21 @@ class EventServiceProvider extends ServiceProvider
|
||||
|
||||
TransactionJournal::deleted(
|
||||
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 */
|
||||
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();
|
||||
}
|
||||
|
||||
// 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 FireflyIII\Models\Preference;
|
||||
use FireflyIII\User;
|
||||
use Session;
|
||||
|
||||
/**
|
||||
* Class Preferences
|
||||
@ -128,6 +129,7 @@ class Preferences
|
||||
public function mark(): bool
|
||||
{
|
||||
$this->set('lastActivity', microtime());
|
||||
Session::forget('first');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -521,6 +521,9 @@ return [
|
||||
'stored_new_account' => 'New account ":name" stored!',
|
||||
'updated_account' => 'Updated account ":name"',
|
||||
'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:
|
||||
'new_category' => 'New category',
|
||||
|
@ -25,6 +25,8 @@ return [
|
||||
'match' => 'Matches on',
|
||||
'repeat_freq' => 'Repeats',
|
||||
'journal_currency_id' => 'Currency',
|
||||
'currency_id' => 'Currency',
|
||||
'attachments' => 'Attachments',
|
||||
'journal_amount' => 'Amount',
|
||||
'journal_asset_source_account' => 'Asset account (source)',
|
||||
'journal_source_account_name' => 'Revenue account (source)',
|
||||
|
@ -82,9 +82,21 @@
|
||||
|
||||
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
{% include 'list.journals-tiny-tasker' with {'transactions': data[0],'account': data[1]} %}
|
||||
</div>
|
||||
|
||||
{% if data[0].count > 0 %}
|
||||
<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">
|
||||
<a class="btn btn-sm btn-default btn-flat pull-right"
|
||||
href="{{ route('accounts.show',data[1].id) }}">{{ (data[1]|balance)|formatAmountPlain }}</a>
|
||||
|
Loading…
Reference in New Issue
Block a user