mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Correctly order account names.
This commit is contained in:
parent
43ac541cb8
commit
0b028a8923
@ -137,7 +137,7 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
$sharedAccounts[] = $account->id;
|
$sharedAccounts[] = $account->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$accounts = \Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])->filter(
|
$accounts = \Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name','ASC')->get(['accounts.*'])->filter(
|
||||||
function (Account $account) use ($sharedAccounts) {
|
function (Account $account) use ($sharedAccounts) {
|
||||||
if (!in_array($account->id, $sharedAccounts)) {
|
if (!in_array($account->id, $sharedAccounts)) {
|
||||||
return $account;
|
return $account;
|
||||||
|
@ -129,6 +129,7 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
|
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
->orderBy('accounts.name','ASC')
|
||||||
->where(
|
->where(
|
||||||
function (Builder $query) {
|
function (Builder $query) {
|
||||||
$query->where('account_meta.data', '!=', '"sharedAsset"');
|
$query->where('account_meta.data', '!=', '"sharedAsset"');
|
||||||
|
@ -134,7 +134,7 @@ class AccountController extends Controller
|
|||||||
$start = clone Session::get('start');
|
$start = clone Session::get('start');
|
||||||
$start->subDay();
|
$start->subDay();
|
||||||
$set->each(
|
$set->each(
|
||||||
function (Account $account) use($start) {
|
function (Account $account) use ($start) {
|
||||||
$lastTransaction = $account->transactions()->leftJoin(
|
$lastTransaction = $account->transactions()->leftJoin(
|
||||||
'transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id'
|
'transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id'
|
||||||
)->orderBy('transaction_journals.date', 'DESC')->first(['transactions.*', 'transaction_journals.date']);
|
)->orderBy('transaction_journals.date', 'DESC')->first(['transactions.*', 'transaction_journals.date']);
|
||||||
|
@ -76,7 +76,7 @@ class AuthController extends Controller
|
|||||||
);
|
);
|
||||||
|
|
||||||
// set flash message
|
// set flash message
|
||||||
Session::flash('success','You have registered successfully!');
|
Session::flash('success', 'You have registered successfully!');
|
||||||
|
|
||||||
|
|
||||||
return redirect($this->redirectPath());
|
return redirect($this->redirectPath());
|
||||||
|
@ -8,11 +8,11 @@ use FireflyIII\Models\Bill;
|
|||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||||
|
use Input;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use Session;
|
use Session;
|
||||||
use URL;
|
use URL;
|
||||||
use View;
|
use View;
|
||||||
use Input;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BillController
|
* Class BillController
|
||||||
@ -81,7 +81,7 @@ class BillController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(BillRepositoryInterface $repository)
|
public function index(BillRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
$bills = Auth::user()->bills()->orderBy('name','ASC')->get();
|
$bills = Auth::user()->bills()->orderBy('name', 'ASC')->get();
|
||||||
$bills->each(
|
$bills->each(
|
||||||
function (Bill $bill) use ($repository) {
|
function (Bill $bill) use ($repository) {
|
||||||
$bill->nextExpectedMatch = $repository->nextExpectedMatch($bill);
|
$bill->nextExpectedMatch = $repository->nextExpectedMatch($bill);
|
||||||
@ -109,7 +109,9 @@ class BillController extends Controller
|
|||||||
return Redirect::intended('/');
|
return Redirect::intended('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
$set = \DB::table('transactions')->where('amount', '>', 0)->where('amount', '>=', $bill->amount_min)->where('amount', '<=', $bill->amount_max)->get(['transaction_journal_id']);
|
$set = \DB::table('transactions')->where('amount', '>', 0)->where('amount', '>=', $bill->amount_min)->where('amount', '<=', $bill->amount_max)->get(
|
||||||
|
['transaction_journal_id']
|
||||||
|
);
|
||||||
$ids = [];
|
$ids = [];
|
||||||
|
|
||||||
/** @var Transaction $entry */
|
/** @var Transaction $entry */
|
||||||
@ -117,7 +119,7 @@ class BillController extends Controller
|
|||||||
$ids[] = intval($entry->transaction_journal_id);
|
$ids[] = intval($entry->transaction_journal_id);
|
||||||
}
|
}
|
||||||
if (count($ids) > 0) {
|
if (count($ids) > 0) {
|
||||||
$journals = Auth::user()->transactionjournals()->whereIn('id',$ids)->get();
|
$journals = Auth::user()->transactionjournals()->whereIn('id', $ids)->get();
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$repository->scan($bill, $journal);
|
$repository->scan($bill, $journal);
|
||||||
|
@ -103,18 +103,18 @@ class CategoryController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function noCategory()
|
public function noCategory()
|
||||||
{
|
{
|
||||||
$start = Session::get('start', Carbon::now()->startOfMonth());
|
$start = Session::get('start', Carbon::now()->startOfMonth());
|
||||||
$end = Session::get('end', Carbon::now()->startOfMonth());
|
$end = Session::get('end', Carbon::now()->startOfMonth());
|
||||||
$list = Auth::user()
|
$list = Auth::user()
|
||||||
->transactionjournals()
|
->transactionjournals()
|
||||||
->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->whereNull('category_transaction_journal.id')
|
->whereNull('category_transaction_journal.id')
|
||||||
->before($end)
|
->before($end)
|
||||||
->after($start)
|
->after($start)
|
||||||
->orderBy('transaction_journals.date')
|
->orderBy('transaction_journals.date')
|
||||||
->get(['transaction_journals.*']);
|
->get(['transaction_journals.*']);
|
||||||
|
|
||||||
$subTitle = 'Transactions without a category between ' . $start->format('jS F Y').' and '.$end->format('jS F Y');
|
$subTitle = 'Transactions without a category between ' . $start->format('jS F Y') . ' and ' . $end->format('jS F Y');
|
||||||
|
|
||||||
return view('categories.noCategory', compact('list', 'subTitle'));
|
return view('categories.noCategory', compact('list', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
|
use Cache;
|
||||||
use FireflyIII\Http\Requests;
|
use FireflyIII\Http\Requests;
|
||||||
use FireflyIII\Http\Requests\CurrencyFormRequest;
|
use FireflyIII\Http\Requests\CurrencyFormRequest;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
|
use Input;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use Session;
|
use Session;
|
||||||
use View;
|
use View;
|
||||||
use Cache;
|
|
||||||
use Input;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,9 +78,9 @@ class GoogleChartController extends Controller
|
|||||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||||
|
|
||||||
if ($frontPage->data == []) {
|
if ($frontPage->data == []) {
|
||||||
$accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']);
|
$accounts = Auth::user()->accounts()->orderBy('accounts.name', 'ASC')->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']);
|
||||||
} else {
|
} else {
|
||||||
$accounts = Auth::user()->accounts()->whereIn('id', $frontPage->data)->get(['accounts.*']);
|
$accounts = Auth::user()->accounts()->whereIn('id', $frontPage->data)->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
|
||||||
}
|
}
|
||||||
$index = 1;
|
$index = 1;
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
@ -508,7 +508,7 @@ class GoogleChartController extends Controller
|
|||||||
|
|
||||||
$end = Session::get('end');
|
$end = Session::get('end');
|
||||||
while ($start <= $end) {
|
while ($start <= $end) {
|
||||||
$spent = floatval($category->transactionjournals()->onDate($start)->lessThan(0)->sum('amount')) * -1;
|
$spent = floatval($category->transactionjournals()->onDate($start)->lessThan(0)->sum('amount')) * -1;
|
||||||
$chart->addRow(clone $start, $spent);
|
$chart->addRow(clone $start, $spent);
|
||||||
$start->addDay();
|
$start->addDay();
|
||||||
}
|
}
|
||||||
@ -521,7 +521,6 @@ class GoogleChartController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param PiggyBank $piggyBank
|
* @param PiggyBank $piggyBank
|
||||||
*
|
*
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
|
use Cache;
|
||||||
use ErrorException;
|
use ErrorException;
|
||||||
use FireflyIII\Http\Requests;
|
use FireflyIII\Http\Requests;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use League\CommonMark\CommonMarkConverter;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
use Route;
|
|
||||||
use Response;
|
use Response;
|
||||||
use Cache;
|
use Route;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class HelpController
|
* Class HelpController
|
||||||
*
|
*
|
||||||
* @package FireflyIII\Http\Controllers
|
* @package FireflyIII\Http\Controllers
|
||||||
*/
|
*/
|
||||||
class HelpController extends Controller {
|
class HelpController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $route
|
* @param $route
|
||||||
@ -83,7 +81,7 @@ class HelpController extends Controller {
|
|||||||
if (strlen(trim($content['text'])) == 0) {
|
if (strlen(trim($content['text'])) == 0) {
|
||||||
$content['text'] = '<p>There is no help for this route.</p>';
|
$content['text'] = '<p>There is no help for this route.</p>';
|
||||||
}
|
}
|
||||||
$converter = new CommonMarkConverter();
|
$converter = new CommonMarkConverter();
|
||||||
$content['text'] = $converter->convertToHtml($content['text']);
|
$content['text'] = $converter->convertToHtml($content['text']);
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
@ -7,7 +7,7 @@ use Input;
|
|||||||
use Preferences;
|
use Preferences;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use Session;
|
use Session;
|
||||||
use DB;
|
|
||||||
/**
|
/**
|
||||||
* Class HomeController
|
* Class HomeController
|
||||||
*
|
*
|
||||||
@ -64,7 +64,7 @@ class HomeController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
if ($frontPage->data == []) {
|
if ($frontPage->data == []) {
|
||||||
$accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']);
|
$accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
|
||||||
} else {
|
} else {
|
||||||
$accounts = Auth::user()->accounts()->whereIn('id', $frontPage->data)->get(['accounts.*']);
|
$accounts = Auth::user()->accounts()->whereIn('id', $frontPage->data)->get(['accounts.*']);
|
||||||
}
|
}
|
||||||
@ -75,8 +75,8 @@ class HomeController extends Controller
|
|||||||
->with(['transactions', 'transactioncurrency', 'transactiontype'])
|
->with(['transactions', 'transactioncurrency', 'transactiontype'])
|
||||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')->where('accounts.id', $account->id)
|
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')->where('accounts.id', $account->id)
|
||||||
->before($end)
|
->before($end)
|
||||||
->after($start)
|
->after($start)
|
||||||
->orderBy('transaction_journals.date', 'DESC')
|
->orderBy('transaction_journals.date', 'DESC')
|
||||||
->orderBy('transaction_journals.id', 'DESC')
|
->orderBy('transaction_journals.id', 'DESC')
|
||||||
->take(10)
|
->take(10)
|
||||||
|
@ -7,6 +7,7 @@ use FireflyIII\Http\Requests;
|
|||||||
use FireflyIII\Models\Bill;
|
use FireflyIII\Models\Bill;
|
||||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||||
use Input;
|
use Input;
|
||||||
|
use Preferences;
|
||||||
use Response;
|
use Response;
|
||||||
use Session;
|
use Session;
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ class JsonController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'bills-paid':
|
case 'bills-paid':
|
||||||
$box = 'bills-paid';
|
$box = 'bills-paid';
|
||||||
// these two functions are the same as the chart TODO
|
// these two functions are the same as the chart TODO
|
||||||
@ -104,7 +105,7 @@ class JsonController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json(['box' => $box, 'amount' => Amount::format($amount, false),'amount_raw' => $amount]);
|
return Response::json(['box' => $box, 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,8 +122,6 @@ class JsonController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Response::json($return);
|
return Response::json($return);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,7 +131,7 @@ class JsonController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function expenseAccounts()
|
public function expenseAccounts()
|
||||||
{
|
{
|
||||||
$list = Auth::user()->accounts()->accountTypeIn(['Expense account', 'Beneficiary account'])->get();
|
$list = Auth::user()->accounts()->orderBy('accounts.name', 'ASC')->accountTypeIn(['Expense account', 'Beneficiary account'])->get();
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($list as $entry) {
|
foreach ($list as $entry) {
|
||||||
$return[] = $entry->name;
|
$return[] = $entry->name;
|
||||||
@ -147,7 +146,7 @@ class JsonController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function revenueAccounts()
|
public function revenueAccounts()
|
||||||
{
|
{
|
||||||
$list = Auth::user()->accounts()->accountTypeIn(['Revenue account'])->get();
|
$list = Auth::user()->accounts()->accountTypeIn(['Revenue account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($list as $entry) {
|
foreach ($list as $entry) {
|
||||||
$return[] = $entry->name;
|
$return[] = $entry->name;
|
||||||
@ -157,4 +156,27 @@ class JsonController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function showSharedReports()
|
||||||
|
{
|
||||||
|
$pref = Preferences::get('showSharedReports', false);
|
||||||
|
|
||||||
|
return Response::json(['value' => $pref->data]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
|
public function setSharedReports()
|
||||||
|
{
|
||||||
|
$pref = Preferences::get('showSharedReports', false);
|
||||||
|
$new = !$pref->data;
|
||||||
|
Preferences::set('showSharedReports', $new);
|
||||||
|
|
||||||
|
|
||||||
|
return Response::json(['value' => $new]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,9 @@ class PiggyBankController extends Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
$periods = Config::get('firefly.piggy_bank_periods');
|
$periods = Config::get('firefly.piggy_bank_periods');
|
||||||
$accounts = ExpandedForm::makeSelectList(Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']));
|
$accounts = ExpandedForm::makeSelectList(
|
||||||
|
Auth::user()->accounts()->orderBy('accounts.name', 'ASC')->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])
|
||||||
|
);
|
||||||
$subTitle = 'Create new piggy bank';
|
$subTitle = 'Create new piggy bank';
|
||||||
$subTitleIcon = 'fa-plus';
|
$subTitleIcon = 'fa-plus';
|
||||||
|
|
||||||
@ -107,7 +109,9 @@ class PiggyBankController extends Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
$periods = Config::get('firefly.piggy_bank_periods');
|
$periods = Config::get('firefly.piggy_bank_periods');
|
||||||
$accounts = ExpandedForm::makeSelectList(Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']));
|
$accounts = ExpandedForm::makeSelectList(
|
||||||
|
Auth::user()->accounts()->orderBy('accounts.name', 'ASC')->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])
|
||||||
|
);
|
||||||
$subTitle = 'Edit piggy bank "' . e($piggyBank->name) . '"';
|
$subTitle = 'Edit piggy bank "' . e($piggyBank->name) . '"';
|
||||||
$subTitleIcon = 'fa-pencil';
|
$subTitleIcon = 'fa-pencil';
|
||||||
|
|
||||||
@ -335,5 +339,4 @@ class PiggyBankController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use FireflyIII\Http\Requests;
|
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use View;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Preferences;
|
use FireflyIII\Http\Requests;
|
||||||
use Input;
|
use Input;
|
||||||
use Session;
|
use Preferences;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
|
use Session;
|
||||||
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PreferencesController
|
* Class PreferencesController
|
||||||
*
|
*
|
||||||
* @package FireflyIII\Http\Controllers
|
* @package FireflyIII\Http\Controllers
|
||||||
*/
|
*/
|
||||||
class PreferencesController extends Controller {
|
class PreferencesController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -32,7 +31,7 @@ class PreferencesController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']);
|
$accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
|
||||||
$viewRange = Preferences::get('viewRange', '1M');
|
$viewRange = Preferences::get('viewRange', '1M');
|
||||||
$viewRangeValue = $viewRange->data;
|
$viewRangeValue = $viewRange->data;
|
||||||
$frontPage = Preferences::get('frontPageAccounts', []);
|
$frontPage = Preferences::get('frontPageAccounts', []);
|
||||||
|
@ -6,8 +6,8 @@ use FireflyIII\Helpers\Reminders\ReminderHelperInterface;
|
|||||||
use FireflyIII\Http\Requests;
|
use FireflyIII\Http\Requests;
|
||||||
use FireflyIII\Models\Reminder;
|
use FireflyIII\Models\Reminder;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use URL;
|
|
||||||
use Session;
|
use Session;
|
||||||
|
use URL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ReminderController
|
* Class ReminderController
|
||||||
@ -27,12 +27,12 @@ class ReminderController extends Controller
|
|||||||
'description' => 'Money for piggy bank "' . $reminder->remindersable->name . '"',
|
'description' => 'Money for piggy bank "' . $reminder->remindersable->name . '"',
|
||||||
'amount' => round($reminder->metadata->perReminder, 2),
|
'amount' => round($reminder->metadata->perReminder, 2),
|
||||||
'account_to_id' => $reminder->remindersable->account_id,
|
'account_to_id' => $reminder->remindersable->account_id,
|
||||||
'piggy_bank_id' => $reminder->remindersable_id,
|
'piggy_bank_id' => $reminder->remindersable_id,
|
||||||
'reminder_id' => $reminder->id,
|
'reminder_id' => $reminder->id,
|
||||||
];
|
];
|
||||||
Session::flash('_old_input',$data);
|
Session::flash('_old_input', $data);
|
||||||
|
|
||||||
return Redirect::route('transactions.create','transfer');
|
return Redirect::route('transactions.create', 'transfer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +36,9 @@ class RepeatedExpenseController extends Controller
|
|||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$periods = Config::get('firefly.piggy_bank_periods');
|
$periods = Config::get('firefly.piggy_bank_periods');
|
||||||
$accounts = ExpandedForm::makeSelectList(Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']));
|
$accounts = ExpandedForm::makeSelectList(
|
||||||
|
Auth::user()->accounts()->orderBy('accounts.name', 'ASC')->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])
|
||||||
|
);
|
||||||
|
|
||||||
return view('repeatedExpense.create', compact('accounts', 'periods'))->with('subTitle', 'Create new repeated expense')->with(
|
return view('repeatedExpense.create', compact('accounts', 'periods'))->with('subTitle', 'Create new repeated expense')->with(
|
||||||
'subTitleIcon', 'fa-plus'
|
'subTitleIcon', 'fa-plus'
|
||||||
@ -79,7 +81,9 @@ class RepeatedExpenseController extends Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
$periods = Config::get('firefly.piggy_bank_periods');
|
$periods = Config::get('firefly.piggy_bank_periods');
|
||||||
$accounts = ExpandedForm::makeSelectList(Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']));
|
$accounts = ExpandedForm::makeSelectList(
|
||||||
|
Auth::user()->accounts()->orderBy('accounts.name', 'ASC')->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])
|
||||||
|
);
|
||||||
$subTitle = 'Edit repeated expense "' . e($repeatedExpense->name) . '"';
|
$subTitle = 'Edit repeated expense "' . e($repeatedExpense->name) . '"';
|
||||||
$subTitleIcon = 'fa-pencil';
|
$subTitleIcon = 'fa-pencil';
|
||||||
|
|
||||||
@ -183,7 +187,7 @@ class RepeatedExpenseController extends Controller
|
|||||||
'rep_length' => $request->get('rep_length'),
|
'rep_length' => $request->get('rep_length'),
|
||||||
'rep_every' => intval($request->get('rep_every')),
|
'rep_every' => intval($request->get('rep_every')),
|
||||||
'rep_times' => intval($request->get('rep_times')),
|
'rep_times' => intval($request->get('rep_times')),
|
||||||
'remind_me' => intval($request->get('remind_me')) == 1 ? true : false ,
|
'remind_me' => intval($request->get('remind_me')) == 1 ? true : false,
|
||||||
'reminder' => $request->get('reminder'),
|
'reminder' => $request->get('reminder'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use FireflyIII\Http\Requests;
|
use FireflyIII\Http\Requests;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
use FireflyIII\Support\Search\SearchInterface;
|
use FireflyIII\Support\Search\SearchInterface;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Input;
|
use Input;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -12,7 +9,8 @@ use Input;
|
|||||||
*
|
*
|
||||||
* @package FireflyIII\Http\Controllers
|
* @package FireflyIII\Http\Controllers
|
||||||
*/
|
*/
|
||||||
class SearchController extends Controller {
|
class SearchController extends Controller
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* Results always come in the form of an array [results, count, fullCount]
|
* Results always come in the form of an array [results, count, fullCount]
|
||||||
*/
|
*/
|
||||||
|
@ -11,7 +11,6 @@ use FireflyIII\Models\Transaction;
|
|||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
use Illuminate\Support\Collection;
|
|
||||||
use Input;
|
use Input;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use Session;
|
use Session;
|
||||||
@ -43,7 +42,9 @@ class TransactionController extends Controller
|
|||||||
public function create($what = 'deposit')
|
public function create($what = 'deposit')
|
||||||
{
|
{
|
||||||
$accounts = ExpandedForm::makeSelectList(
|
$accounts = ExpandedForm::makeSelectList(
|
||||||
Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->where('active', 1)->orderBy('name', 'DESC')->get(['accounts.*'])
|
Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->orderBy('name', 'ASC')->where(
|
||||||
|
'active', 1
|
||||||
|
)->orderBy('name', 'DESC')->get(['accounts.*'])
|
||||||
);
|
);
|
||||||
$budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get());
|
$budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get());
|
||||||
$budgets[0] = '(no budget)';
|
$budgets[0] = '(no budget)';
|
||||||
@ -120,7 +121,9 @@ class TransactionController extends Controller
|
|||||||
{
|
{
|
||||||
$what = strtolower($journal->transactiontype->type);
|
$what = strtolower($journal->transactiontype->type);
|
||||||
$accounts = ExpandedForm::makeSelectList(
|
$accounts = ExpandedForm::makeSelectList(
|
||||||
Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->where('active', 1)->orderBy('name', 'DESC')->get(['accounts.*'])
|
Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->where('active', 1)->orderBy(
|
||||||
|
'name', 'DESC'
|
||||||
|
)->get(['accounts.*'])
|
||||||
);
|
);
|
||||||
$budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get());
|
$budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get());
|
||||||
$budgets[0] = '(no budget)';
|
$budgets[0] = '(no budget)';
|
||||||
@ -259,8 +262,8 @@ class TransactionController extends Controller
|
|||||||
event(new JournalSaved($journal));
|
event(new JournalSaved($journal));
|
||||||
event(new JournalCreated($journal, intval($request->get('piggy_bank_id'))));
|
event(new JournalCreated($journal, intval($request->get('piggy_bank_id'))));
|
||||||
|
|
||||||
if(intval($request->get('reminder_id')) > 0) {
|
if (intval($request->get('reminder_id')) > 0) {
|
||||||
$reminder = Auth::user()->reminders()->find($request->get('reminder_id'));
|
$reminder = Auth::user()->reminders()->find($request->get('reminder_id'));
|
||||||
$reminder->active = 0;
|
$reminder->active = 0;
|
||||||
$reminder->save();
|
$reminder->save();
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\Bill;
|
use FireflyIII\Models\Bill;
|
||||||
use FireflyIII\Models\Reminder;
|
|
||||||
use FireflyIII\Models\Budget;
|
use FireflyIII\Models\Budget;
|
||||||
use FireflyIII\Models\Category;
|
use FireflyIII\Models\Category;
|
||||||
use FireflyIII\Models\LimitRepetition;
|
use FireflyIII\Models\LimitRepetition;
|
||||||
|
use FireflyIII\Models\PiggyBank;
|
||||||
|
use FireflyIII\Models\Reminder;
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\PiggyBank;
|
|
||||||
|
|
||||||
|
|
||||||
// models
|
// models
|
||||||
@ -146,7 +146,7 @@ Route::get('/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'r
|
|||||||
|
|
||||||
Route::controllers(
|
Route::controllers(
|
||||||
[
|
[
|
||||||
'auth' => 'Auth\AuthController',
|
'auth' => 'Auth\AuthController',
|
||||||
'password' => 'Auth\PasswordController',
|
'password' => 'Auth\PasswordController',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@ -156,10 +156,10 @@ Route::controllers(
|
|||||||
* Home Controller
|
* Home Controller
|
||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => ['auth', 'range','reminders']], function () {
|
['middleware' => ['auth', 'range', 'reminders']], function () {
|
||||||
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
|
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
|
||||||
Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);
|
Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);
|
||||||
Route::post('/daterange',['uses' => 'HomeController@dateRange','as' => 'daterange']);
|
Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']);
|
||||||
Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']);
|
Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']);
|
||||||
/**
|
/**
|
||||||
* Account Controller
|
* Account Controller
|
||||||
@ -260,14 +260,16 @@ Route::group(
|
|||||||
Route::get('/json/revenue-accounts', ['uses' => 'JsonController@revenueAccounts', 'as' => 'json.revenue-accounts']);
|
Route::get('/json/revenue-accounts', ['uses' => 'JsonController@revenueAccounts', 'as' => 'json.revenue-accounts']);
|
||||||
Route::get('/json/categories', ['uses' => 'JsonController@categories', 'as' => 'json.categories']);
|
Route::get('/json/categories', ['uses' => 'JsonController@categories', 'as' => 'json.categories']);
|
||||||
Route::get('/json/box', ['uses' => 'JsonController@box', 'as' => 'json.box']);
|
Route::get('/json/box', ['uses' => 'JsonController@box', 'as' => 'json.box']);
|
||||||
|
Route::get('/json/show-shared-reports', 'JsonController@showSharedReports');
|
||||||
|
Route::get('/json/show-shared-reports/set', 'JsonController@setSharedReports');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Piggy Bank Controller
|
* Piggy Bank Controller
|
||||||
*/
|
*/
|
||||||
Route::get('/piggy-banks', ['uses' => 'PiggyBankController@index', 'as' => 'piggy-banks.index']);
|
Route::get('/piggy-banks', ['uses' => 'PiggyBankController@index', 'as' => 'piggy-banks.index']);
|
||||||
Route::get('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@add','as' => 'piggy-banks.addMoney']); # add money
|
Route::get('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@add', 'as' => 'piggy-banks.addMoney']); # add money
|
||||||
Route::get('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@remove','as' => 'piggy-banks.removeMoney']); #remove money
|
Route::get('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@remove', 'as' => 'piggy-banks.removeMoney']); #remove money
|
||||||
Route::get('/piggy-banks/create', ['uses' => 'PiggyBankController@create', 'as' => 'piggy-banks.create']);
|
Route::get('/piggy-banks/create', ['uses' => 'PiggyBankController@create', 'as' => 'piggy-banks.create']);
|
||||||
Route::get('/piggy-banks/edit/{piggyBank}', ['uses' => 'PiggyBankController@edit', 'as' => 'piggy-banks.edit']);
|
Route::get('/piggy-banks/edit/{piggyBank}', ['uses' => 'PiggyBankController@edit', 'as' => 'piggy-banks.edit']);
|
||||||
Route::get('/piggy-banks/delete/{piggyBank}', ['uses' => 'PiggyBankController@delete', 'as' => 'piggy-banks.delete']);
|
Route::get('/piggy-banks/delete/{piggyBank}', ['uses' => 'PiggyBankController@delete', 'as' => 'piggy-banks.delete']);
|
||||||
@ -289,7 +291,7 @@ Route::group(
|
|||||||
*/
|
*/
|
||||||
Route::get('/profile', ['uses' => 'ProfileController@index', 'as' => 'profile']);
|
Route::get('/profile', ['uses' => 'ProfileController@index', 'as' => 'profile']);
|
||||||
Route::get('/profile/change-password', ['uses' => 'ProfileController@changePassword', 'as' => 'change-password']);
|
Route::get('/profile/change-password', ['uses' => 'ProfileController@changePassword', 'as' => 'change-password']);
|
||||||
Route::post('/profile/change-password', ['uses' => 'ProfileController@postChangePassword','as' => 'change-password-post']);
|
Route::post('/profile/change-password', ['uses' => 'ProfileController@postChangePassword', 'as' => 'change-password-post']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Related transactions controller
|
* Related transactions controller
|
||||||
@ -331,9 +333,14 @@ Route::group(
|
|||||||
Route::get('/reports/budget/{year}/{month}', ['uses' => 'ReportController@budget', 'as' => 'reports.budget']);
|
Route::get('/reports/budget/{year}/{month}', ['uses' => 'ReportController@budget', 'as' => 'reports.budget']);
|
||||||
|
|
||||||
// pop ups for budget report:
|
// pop ups for budget report:
|
||||||
Route::get('/reports/modal/{account}/{year}/{month}/no-budget', ['uses' => 'ReportController@modalNoBudget','as' => 'reports.no-budget']);
|
Route::get('/reports/modal/{account}/{year}/{month}/no-budget', ['uses' => 'ReportController@modalNoBudget', 'as' => 'reports.no-budget']);
|
||||||
Route::get('/reports/modal/{account}/{year}/{month}/balanced-transfers', ['uses' => 'ReportController@modalBalancedTransfers','as' => 'reports.balanced-transfers']);
|
Route::get(
|
||||||
Route::get('/reports/modal/{account}/{year}/{month}/left-unbalanced', ['uses' => 'ReportController@modalLeftUnbalanced','as' => 'reports.left-unbalanced']);
|
'/reports/modal/{account}/{year}/{month}/balanced-transfers',
|
||||||
|
['uses' => 'ReportController@modalBalancedTransfers', 'as' => 'reports.balanced-transfers']
|
||||||
|
);
|
||||||
|
Route::get(
|
||||||
|
'/reports/modal/{account}/{year}/{month}/left-unbalanced', ['uses' => 'ReportController@modalLeftUnbalanced', 'as' => 'reports.left-unbalanced']
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search Controller
|
* Search Controller
|
||||||
|
@ -11,6 +11,8 @@ if (typeof(google) != 'undefined') {
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$('.openModal').on('click', openModal);
|
$('.openModal').on('click', openModal);
|
||||||
|
includeSharedToggle();
|
||||||
|
$('#includeShared').click(includeSharedSet);
|
||||||
});
|
});
|
||||||
|
|
||||||
function openModal(e) {
|
function openModal(e) {
|
||||||
@ -25,5 +27,34 @@ function openModal(e) {
|
|||||||
alert('Could not load data.');
|
alert('Could not load data.');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function includeSharedToggle() {
|
||||||
|
// get setting from JSON.
|
||||||
|
$.getJSON('json/show-shared-reports').success(function (data) {
|
||||||
|
console.log('GO');
|
||||||
|
if (data.value == true) {
|
||||||
|
// show shared data, update button:
|
||||||
|
//<i class="state-icon glyphicon glyphicon-check"></i>
|
||||||
|
$('#includeShared').empty().addClass('btn-info').append($('<i>').addClass('state-icon glyphicon glyphicon-check')).append(' Include shared asset accounts').show();
|
||||||
|
console.log('true');
|
||||||
|
} else {
|
||||||
|
$('#includeShared').empty().removeClass('btn-info').append($('<i>').addClass('state-icon glyphicon glyphicon-unchecked')).append(' Include shared asset accounts').show();
|
||||||
|
console.log('false');
|
||||||
|
}
|
||||||
|
}).fail(function () {
|
||||||
|
console.log('fail');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function includeSharedSet() {
|
||||||
|
// get setting from JSON.
|
||||||
|
$.getJSON('json/show-shared-reports/set').success(function (data) {
|
||||||
|
console.log('Value is now: ' + data.value);
|
||||||
|
includeSharedToggle();
|
||||||
|
}).fail(function () {
|
||||||
|
console.log('fail');
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
@ -1,128 +1,146 @@
|
|||||||
@extends('layouts.default')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $date) !!}
|
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $date) !!}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
|
<p>
|
||||||
|
<a href="#" class="btn btn-default" id="includeShared" style="display:none;">
|
||||||
|
<i class="state-icon glyphicon glyphicon-unchecked"></i>
|
||||||
|
Include shared asset accounts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<table class="table table-bordered table-striped">
|
<div class="panel panel-default">
|
||||||
<tr>
|
<div class="panel-heading">
|
||||||
<th>Account</th>
|
Accounts
|
||||||
<th>Start of month</th>
|
</div>
|
||||||
<th>Current balance</th>
|
<table class="table table-bordered table-striped">
|
||||||
<th>Spent</th>
|
|
||||||
<th>Earned</th>
|
|
||||||
</tr>
|
|
||||||
@foreach($accounts as $account)
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a></td>
|
<th>Account</th>
|
||||||
<td>{!! Amount::format($account->startBalance) !!}</td>
|
<th>Start of month</th>
|
||||||
<td>{!! Amount::format($account->endBalance) !!}</td>
|
<th>Current balance</th>
|
||||||
<td>
|
<th>Spent</th>
|
||||||
@if($account->startBalance - $account->endBalance >= 0)
|
<th>Earned</th>
|
||||||
{!! Amount::format($account->startBalance - $account->endBalance) !!}
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if($account->startBalance - $account->endBalance < 0)
|
|
||||||
{!! Amount::format(($account->startBalance - $account->endBalance)*-1) !!}
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@foreach($accounts as $account)
|
||||||
</table>
|
<tr>
|
||||||
|
<td><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a></td>
|
||||||
|
<td>{!! Amount::format($account->startBalance) !!}</td>
|
||||||
|
<td>{!! Amount::format($account->endBalance) !!}</td>
|
||||||
|
<td>
|
||||||
|
@if($account->startBalance - $account->endBalance >= 0)
|
||||||
|
{!! Amount::format($account->startBalance - $account->endBalance) !!}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($account->startBalance - $account->endBalance < 0)
|
||||||
|
{!! Amount::format(($account->startBalance - $account->endBalance)*-1) !!}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||||
|
<div class="panel panel-default">
|
||||||
<table class="table table-bordered table-striped">
|
<div class="panel-heading">
|
||||||
<tr>
|
Budgets
|
||||||
<th colspan="2">Budgets</th>
|
</div>
|
||||||
<?php
|
<table class="table table-bordered table-striped">
|
||||||
$accountSums = [];
|
<tr>
|
||||||
?>
|
<th colspan="2">Budgets</th>
|
||||||
@foreach($accounts as $account)
|
|
||||||
<th><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a></th>
|
|
||||||
<?php
|
<?php
|
||||||
$accountSums[$account->id] = 0;
|
$accountSums = [];
|
||||||
?>
|
?>
|
||||||
@endforeach
|
@foreach($accounts as $account)
|
||||||
<th colspan="2">
|
<th><a href="{{route('accounts.show',$account->id)}}">{{{$account->name}}}</a></th>
|
||||||
Left in budget
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
@foreach($budgets as $id => $budget)
|
|
||||||
<tr>
|
|
||||||
<td>{{{$budget['name']}}}</td>
|
|
||||||
<td>{!! Amount::format($budget['amount']) !!}</td>
|
|
||||||
<?php $spent = 0;?>
|
|
||||||
@foreach($accounts as $account)
|
|
||||||
@if(isset($account->budgetInformation[$id]))
|
|
||||||
<td>
|
|
||||||
@if($id == 0)
|
|
||||||
<a href="{{route('reports.no-budget',[$account, $year, $month])}}" class="openModal">
|
|
||||||
{!! Amount::format($account->budgetInformation[$id]['amount']) !!}
|
|
||||||
</a>
|
|
||||||
@else
|
|
||||||
{!! Amount::format($account->budgetInformation[$id]['amount']) !!}
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<?php
|
<?php
|
||||||
$spent += floatval($account->budgetInformation[$id]['amount']);
|
$accountSums[$account->id] = 0;
|
||||||
$accountSums[$account->id] += floatval($account->budgetInformation[$id]['amount']);
|
|
||||||
?>
|
?>
|
||||||
@else
|
@endforeach
|
||||||
<td>{!! Amount::format(0) !!}</td>
|
<th colspan="2">
|
||||||
@endif
|
Left in budget
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
@foreach($budgets as $id => $budget)
|
||||||
|
<tr>
|
||||||
|
<td>{{{$budget['name']}}}</td>
|
||||||
|
<td>{!! Amount::format($budget['amount']) !!}</td>
|
||||||
|
<?php $spent = 0;?>
|
||||||
|
@foreach($accounts as $account)
|
||||||
|
@if(isset($account->budgetInformation[$id]))
|
||||||
|
<td>
|
||||||
|
@if($id == 0)
|
||||||
|
<a href="{{route('reports.no-budget',[$account, $year, $month])}}" class="openModal">
|
||||||
|
{!! Amount::format($account->budgetInformation[$id]['amount']) !!}
|
||||||
|
</a>
|
||||||
|
@else
|
||||||
|
{!! Amount::format($account->budgetInformation[$id]['amount']) !!}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<?php
|
||||||
|
$spent += floatval($account->budgetInformation[$id]['amount']);
|
||||||
|
$accountSums[$account->id] += floatval($account->budgetInformation[$id]['amount']);
|
||||||
|
?>
|
||||||
|
@else
|
||||||
|
<td>{!! Amount::format(0) !!}</td>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
<td>{!! Amount::format($budget['amount'] + $budget['spent']) !!}</td>
|
||||||
|
<td>{!! Amount::format($budget['amount'] + $spent) !!}</td>
|
||||||
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
<td>{!! Amount::format($budget['amount'] + $budget['spent']) !!}</td>
|
<tr>
|
||||||
<td>{!! Amount::format($budget['amount'] + $spent) !!}</td>
|
<td colspan="2">Balanced by transfers</td>
|
||||||
</tr>
|
@foreach($accounts as $account)
|
||||||
@endforeach
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">Balanced by transfers</td>
|
|
||||||
@foreach($accounts as $account)
|
|
||||||
<td>
|
|
||||||
<a href="{{route('reports.balanced-transfers',[$account, $year, $month])}}" class="openModal">{!! Amount::format($account->balancedAmount) !!}</a>
|
|
||||||
</td>
|
|
||||||
@endforeach
|
|
||||||
<td colspan="2"> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">Left unbalanced</td>
|
|
||||||
@foreach($accounts as $account)
|
|
||||||
<?php
|
|
||||||
$accountSums[$account->id] += $account->balancedAmount;
|
|
||||||
?>
|
|
||||||
@if(isset($account->budgetInformation[0]))
|
|
||||||
<td>
|
<td>
|
||||||
@if($account->budgetInformation[0]['amount'] + $account->balancedAmount != 0.0)
|
<a href="{{route('reports.balanced-transfers',[$account, $year, $month])}}" class="openModal">{!! Amount::format($account->balancedAmount) !!}</a>
|
||||||
<a href="{{route('reports.left-unbalanced',[$account, $year, $month])}}" class="openModal">{!! Amount::format($account->budgetInformation[0]['amount'] + $account->balancedAmount) !!}</a>
|
|
||||||
@else
|
|
||||||
{!! Amount::format($account->budgetInformation[0]['amount'] + $account->balancedAmount) !!}
|
|
||||||
@endif
|
|
||||||
</td>
|
</td>
|
||||||
@else
|
@endforeach
|
||||||
<td>{!! Amount::format(0) !!}</td>
|
<td colspan="2"> </td>
|
||||||
@endif
|
</tr>
|
||||||
@endforeach
|
<tr>
|
||||||
<td colspan="2"> </td>
|
<td colspan="2">Left unbalanced</td>
|
||||||
</tr>
|
@foreach($accounts as $account)
|
||||||
<tr>
|
<?php
|
||||||
<td colspan="2"><em>Sum</em></td>
|
$accountSums[$account->id] += $account->balancedAmount;
|
||||||
@foreach($accounts as $account)
|
?>
|
||||||
<td>{!! Amount::format($accountSums[$account->id]) !!}</td>
|
@if(isset($account->budgetInformation[0]))
|
||||||
@endforeach
|
<td>
|
||||||
<td colspan="2"> </td>
|
@if($account->budgetInformation[0]['amount'] + $account->balancedAmount != 0.0)
|
||||||
</tr>
|
<a href="{{route('reports.left-unbalanced',[$account, $year, $month])}}" class="openModal">{!! Amount::format($account->budgetInformation[0]['amount'] + $account->balancedAmount) !!}</a>
|
||||||
<tr>
|
@else
|
||||||
<td colspan="2">Expected balance</td>
|
{!! Amount::format($account->budgetInformation[0]['amount'] + $account->balancedAmount) !!}
|
||||||
@foreach($accounts as $account)
|
@endif
|
||||||
<td>{!! Amount::format($account->startBalance + $accountSums[$account->id]) !!}</td>
|
</td>
|
||||||
@endforeach
|
@else
|
||||||
<td colspan="2"> </td>
|
<td>{!! Amount::format(0) !!}</td>
|
||||||
</tr>
|
@endif
|
||||||
|
@endforeach
|
||||||
|
<td colspan="2"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><em>Sum</em></td>
|
||||||
|
@foreach($accounts as $account)
|
||||||
|
<td>{!! Amount::format($accountSums[$account->id]) !!}</td>
|
||||||
|
@endforeach
|
||||||
|
<td colspan="2"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">Expected balance</td>
|
||||||
|
@foreach($accounts as $account)
|
||||||
|
<td>{!! Amount::format($account->startBalance + $accountSums[$account->id]) !!}</td>
|
||||||
|
@endforeach
|
||||||
|
<td colspan="2"> </td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -133,6 +151,5 @@
|
|||||||
|
|
||||||
@stop
|
@stop
|
||||||
@section('scripts')
|
@section('scripts')
|
||||||
|
|
||||||
<script type="text/javascript" src="js/reports.js"></script>
|
<script type="text/javascript" src="js/reports.js"></script>
|
||||||
@stop
|
@stop
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
@extends('layouts.default')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName()) !!}
|
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName()) !!}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
|
<p>
|
||||||
|
<a href="#" class="btn btn-default" id="includeShared" style="display:none;">
|
||||||
|
<i class="state-icon glyphicon glyphicon-unchecked"></i>
|
||||||
|
Include shared asset accounts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
@ -51,9 +60,11 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@stop
|
@stop
|
||||||
|
@section('scripts')
|
||||||
|
<script type="text/javascript" src="js/reports.js"></script>
|
||||||
|
@stop
|
@ -1,6 +1,15 @@
|
|||||||
@extends('layouts.default')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $date) !!}
|
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $date) !!}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
|
<p>
|
||||||
|
<a href="#" class="btn btn-default" id="includeShared" style="display:none;">
|
||||||
|
<i class="state-icon glyphicon glyphicon-unchecked"></i>
|
||||||
|
Include shared asset accounts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5 col-md-5 col-sm-12">
|
<div class="col-lg-5 col-md-5 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
@extends('layouts.default')
|
@extends('layouts.default')
|
||||||
@section('content')
|
@section('content')
|
||||||
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $date) !!}
|
{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $date) !!}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
|
<p>
|
||||||
|
<a href="#" class="btn btn-default" id="includeShared" style="display:none;">
|
||||||
|
<i class="state-icon glyphicon glyphicon-unchecked"></i>
|
||||||
|
Include shared asset accounts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-10 col-md-8 col-sm-12">
|
<div class="col-lg-10 col-md-8 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
@ -13,7 +13,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
*/
|
*/
|
||||||
public function createApplication()
|
public function createApplication()
|
||||||
{
|
{
|
||||||
$app = require __DIR__ . '/../bootstrap/app.php';
|
$app = require __DIR__ . '/../../bootstrap/app.php';
|
||||||
|
|
||||||
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user