Skip to content

Firefly III: a personal finances manager

Account show didn't show anything.

James Cole675530458c57
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index c3a79b49ca..eba8d2a3cd 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -74,6 +74,12 @@ class AccountController extends Controller
return Redirect::route('accounts.index', $typeName);
}
+ /**
+ * @param Account $account
+ * @param AccountRepositoryInterface $repository
+ *
+ * @return View
+ */
public function edit(Account $account, AccountRepositoryInterface $repository)
{
$what = Config::get('firefly.shortNamesByFullName')[$account->accountType->type];
diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php
index 26d24d611b..11ccb60bfd 100644
--- a/app/Http/Controllers/TransactionController.php
+++ b/app/Http/Controllers/TransactionController.php
@@ -268,6 +268,9 @@ class TransactionController extends Controller
event(new JournalSaved($journal));
Session::flash('success', 'New transaction "' . $journal->description . '" stored!');
+ if (intval(Input::get('create_another')) === 1) {
+ return Redirect::route('transactions.create', $request->input('what'));
+ }
return Redirect::route('transactions.index', $request->input('what'));
@@ -284,6 +287,7 @@ class TransactionController extends Controller
public function update(TransactionJournal $journal, JournalFormRequest $request, JournalRepositoryInterface $repository)
{
+
$journalData = [
'what' => $request->get('what'),
'description' => $request->get('description'),
@@ -306,6 +310,10 @@ class TransactionController extends Controller
Session::flash('success', 'Transaction "' . e($journalData['description']) . '" updated.');
+ if (intval(Input::get('return_to_edit')) === 1) {
+ return Redirect::route('transactions.edit', $journal->id);
+ }
+
return Redirect::route('transactions.index', $journalData['what']);
}
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index aff7831674..e6607bd2f0 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -46,7 +46,7 @@ class AccountRepository implements AccountRepositoryInterface
*/
public function getJournals(Account $account, $page, $range = 'session')
{
- $offset = $page * 50;
+ $offset = ($page-1) * 50;
$query = Auth::user()
->transactionJournals()
->withRelevantData()
@@ -55,7 +55,7 @@ class AccountRepository implements AccountRepositoryInterface
->orderBy('date', 'DESC');
if ($range == 'session') {
- $query->before(Session::get('end', Carbon::now()->startOfMonth()));
+ $query->before(Session::get('end', Carbon::now()->endOfMonth()));
$query->after(Session::get('start', Carbon::now()->startOfMonth()));
}
$count = $query->count();