Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Renamed lots of "piggybank" to "piggyBank".
James Cole335279e72888
diff --git a/app/breadcrumbs.php b/app/breadcrumbs.phpindex 3269c6e773..487b182ed3 100644--- a/app/breadcrumbs.php+++ b/app/breadcrumbs.php@@ -134,35 +134,35 @@ Breadcrumbs::register(// piggy banksBreadcrumbs::register(- 'piggybanks.index', function (Generator $breadcrumbs) {+ 'piggyBanks.index', function (Generator $breadcrumbs) {$breadcrumbs->parent('home');- $breadcrumbs->push('Piggy banks', route('piggybanks.index'));+ $breadcrumbs->push('Piggy banks', route('piggyBanks.index'));});Breadcrumbs::register(- 'piggybanks.create', function (Generator $breadcrumbs) {- $breadcrumbs->parent('piggybanks.index');- $breadcrumbs->push('Create new piggy bank', route('piggybanks.create'));+ 'piggyBanks.create', function (Generator $breadcrumbs) {+ $breadcrumbs->parent('piggyBanks.index');+ $breadcrumbs->push('Create new piggy bank', route('piggyBanks.create'));});Breadcrumbs::register(- 'piggybanks.edit', function (Generator $breadcrumbs, Piggybank $piggybank) {- $breadcrumbs->parent('piggybanks.show', $piggybank);- $breadcrumbs->push('Edit ' . $piggybank->name, route('piggybanks.edit', $piggybank->id));+ 'piggyBanks.edit', function (Generator $breadcrumbs, Piggybank $piggyBank) {+ $breadcrumbs->parent('piggyBanks.show', $piggyBank);+ $breadcrumbs->push('Edit ' . $piggyBank->name, route('piggyBanks.edit', $piggyBank->id));});Breadcrumbs::register(- 'piggybanks.delete', function (Generator $breadcrumbs, Piggybank $piggybank) {- $breadcrumbs->parent('piggybanks.show', $piggybank);- $breadcrumbs->push('Delete ' . $piggybank->name, route('piggybanks.delete', $piggybank->id));+ 'piggyBanks.delete', function (Generator $breadcrumbs, Piggybank $piggyBank) {+ $breadcrumbs->parent('piggyBanks.show', $piggyBank);+ $breadcrumbs->push('Delete ' . $piggyBank->name, route('piggyBanks.delete', $piggyBank->id));});Breadcrumbs::register(- 'piggybanks.show', function (Generator $breadcrumbs, Piggybank $piggybank) {- $breadcrumbs->parent('piggybanks.index');- $breadcrumbs->push($piggybank->name, route('piggybanks.show', $piggybank->id));+ 'piggyBanks.show', function (Generator $breadcrumbs, Piggybank $piggyBank) {+ $breadcrumbs->parent('piggyBanks.index');+ $breadcrumbs->push($piggyBank->name, route('piggyBanks.show', $piggyBank->id));});@@ -251,22 +251,22 @@ Breadcrumbs::register();Breadcrumbs::register(- 'repeated.edit', function (Generator $breadcrumbs, Piggybank $piggybank) {- $breadcrumbs->parent('repeated.show', $piggybank);- $breadcrumbs->push('Edit ' . $piggybank->name, route('repeated.edit', $piggybank->id));+ 'repeated.edit', function (Generator $breadcrumbs, Piggybank $piggyBank) {+ $breadcrumbs->parent('repeated.show', $piggyBank);+ $breadcrumbs->push('Edit ' . $piggyBank->name, route('repeated.edit', $piggyBank->id));});Breadcrumbs::register(- 'repeated.delete', function (Generator $breadcrumbs, Piggybank $piggybank) {- $breadcrumbs->parent('repeated.show', $piggybank);- $breadcrumbs->push('Delete ' . $piggybank->name, route('repeated.delete', $piggybank->id));+ 'repeated.delete', function (Generator $breadcrumbs, Piggybank $piggyBank) {+ $breadcrumbs->parent('repeated.show', $piggyBank);+ $breadcrumbs->push('Delete ' . $piggyBank->name, route('repeated.delete', $piggyBank->id));});Breadcrumbs::register(- 'repeated.show', function (Generator $breadcrumbs, Piggybank $piggybank) {+ 'repeated.show', function (Generator $breadcrumbs, Piggybank $piggyBank) {$breadcrumbs->parent('repeated.index');- $breadcrumbs->push($piggybank->name, route('repeated.show', $piggybank->id));+ $breadcrumbs->push($piggyBank->name, route('repeated.show', $piggyBank->id));});diff --git a/app/controllers/GoogleChartController.php b/app/controllers/GoogleChartController.phpindex 2a5786c5f6..2b5c50c22d 100644--- a/app/controllers/GoogleChartController.php+++ b/app/controllers/GoogleChartController.php@@ -312,16 +312,16 @@ class GoogleChartController extends BaseController}/**- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return \Illuminate\Http\JsonResponse*/- public function piggyBankHistory(\Piggybank $piggybank)+ public function piggyBankHistory(\Piggybank $piggyBank){$this->_chart->addColumn('Date', 'date');$this->_chart->addColumn('Balance', 'number');- $set = \DB::table('piggy_bank_events')->where('piggybank_id', $piggybank->id)->groupBy('date')->get(['date', DB::Raw('SUM(`amount`) AS `sum`')]);+ $set = \DB::table('piggy_bank_events')->where('piggybank_id', $piggyBank->id)->groupBy('date')->get(['date', DB::Raw('SUM(`amount`) AS `sum`')]);foreach ($set as $entry) {$this->_chart->addRow(new Carbon($entry->date), floatval($entry->sum));diff --git a/app/controllers/PiggybankController.php b/app/controllers/PiggybankController.phpindex 307197ac32..3f6b4d7626 100644--- a/app/controllers/PiggybankController.php+++ b/app/controllers/PiggybankController.php@@ -35,29 +35,21 @@ class PiggybankController extends BaseController/*** Add money to piggy bank*- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return $this*/- public function add(Piggybank $piggybank)+ public function add(Piggybank $piggyBank){- \Log::debug('Now in add() for piggy bank #' . $piggybank->id . ' (' . $piggybank->name . ')');- \Log::debug('Z');- \Log::debug('currentRelevantRep is null: ' . boolstr($piggybank->currentRelevantRep()));- $leftOnAccount = $this->_repository->leftOnAccount($piggybank->account);- \Log::debug('A');-- $savedSoFar = $piggybank->currentRelevantRep()->currentamount;- \Log::debug('B');- $leftToSave = $piggybank->targetamount - $savedSoFar;- \Log::debug('C');+ $leftOnAccount = $this->_repository->leftOnAccount($piggyBank->account);+ $savedSoFar = $piggyBank->currentRelevantRep()->currentamount;+ $leftToSave = $piggyBank->targetamount - $savedSoFar;$maxAmount = min($leftOnAccount, $leftToSave);- \Log::debug('D');- \Log::debug('Now going to view for piggy bank #' . $piggybank->id . ' (' . $piggybank->name . ')');+ \Log::debug('Now going to view for piggy bank #' . $piggyBank->id . ' (' . $piggyBank->name . ')');- return View::make('piggybanks.add', compact('piggybank', 'maxAmount'));+ return View::make('piggybanks.add', compact('piggyBank', 'maxAmount'));}/**@@ -78,15 +70,15 @@ class PiggybankController extends BaseController}/**- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return $this*/- public function delete(Piggybank $piggybank)+ public function delete(Piggybank $piggyBank){- $subTitle = 'Delete "' . e($piggybank->name) . '"';+ $subTitle = 'Delete "' . e($piggyBank->name) . '"';- return View::make('piggybanks.delete', compact('piggybank', 'subTitle'));+ return View::make('piggybanks.delete', compact('piggyBank', 'subTitle'));}/**@@ -104,11 +96,11 @@ class PiggybankController extends BaseController}/**- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return $this*/- public function edit(Piggybank $piggybank)+ public function edit(Piggybank $piggyBank){/** @var \FireflyIII\Database\Account\Account $acct */@@ -116,28 +108,28 @@ class PiggybankController extends BaseController$periods = Config::get('firefly.piggybank_periods');$accounts = FFForm::makeSelectList($acct->getAssetAccounts());- $subTitle = 'Edit piggy bank "' . e($piggybank->name) . '"';+ $subTitle = 'Edit piggy bank "' . e($piggyBank->name) . '"';$subTitleIcon = 'fa-pencil';/** Flash some data to fill the form.*/- if (is_null($piggybank->targetdate) || $piggybank->targetdate == '') {+ if (is_null($piggyBank->targetdate) || $piggyBank->targetdate == '') {$targetDate = null;} else {- $targetDate = new Carbon($piggybank->targetdate);+ $targetDate = new Carbon($piggyBank->targetdate);$targetDate = $targetDate->format('Y-m-d');}- $preFilled = ['name' => $piggybank->name,- 'account_id' => $piggybank->account_id,- 'targetamount' => $piggybank->targetamount,+ $preFilled = ['name' => $piggyBank->name,+ 'account_id' => $piggyBank->account_id,+ 'targetamount' => $piggyBank->targetamount,'targetdate' => $targetDate,- 'reminder' => $piggybank->reminder,- 'remind_me' => intval($piggybank->remind_me) == 1 || !is_null($piggybank->reminder) ? true : false+ 'reminder' => $piggyBank->reminder,+ 'remind_me' => intval($piggyBank->remind_me) == 1 || !is_null($piggyBank->reminder) ? true : false];Session::flash('preFilled', $preFilled);- return View::make('piggybanks.edit', compact('subTitle', 'subTitleIcon', 'piggybank', 'accounts', 'periods', 'preFilled'));+ return View::make('piggybanks.edit', compact('subTitle', 'subTitleIcon', 'piggyBank', 'accounts', 'periods', 'preFilled'));}/**@@ -145,134 +137,134 @@ class PiggybankController extends BaseController*/public function index(){- /** @var Collection $piggybanks */- $piggybanks = $this->_repository->get();+ /** @var Collection $piggyBanks */+ $piggyBanks = $this->_repository->get();$accounts = [];- /** @var Piggybank $piggybank */- foreach ($piggybanks as $piggybank) {- $piggybank->savedSoFar = floatval($piggybank->currentRelevantRep()->currentamount);- $piggybank->percentage = intval($piggybank->savedSoFar / $piggybank->targetamount * 100);- $piggybank->leftToSave = $piggybank->targetamount - $piggybank->savedSoFar;+ /** @var Piggybank $piggyBank */+ foreach ($piggyBanks as $piggyBank) {+ $piggyBank->savedSoFar = floatval($piggyBank->currentRelevantRep()->currentamount);+ $piggyBank->percentage = intval($piggyBank->savedSoFar / $piggyBank->targetamount * 100);+ $piggyBank->leftToSave = $piggyBank->targetamount - $piggyBank->savedSoFar;/** Fill account information:*/- $account = $piggybank->account;+ $account = $piggyBank->account;if (!isset($accounts[$account->id])) {$accounts[$account->id] = ['name' => $account->name,'balance' => Steam::balance($account),'leftForPiggybanks' => $this->_repository->leftOnAccount($account),- 'sumOfSaved' => $piggybank->savedSoFar,- 'sumOfTargets' => floatval($piggybank->targetamount),- 'leftToSave' => $piggybank->leftToSave+ 'sumOfSaved' => $piggyBank->savedSoFar,+ 'sumOfTargets' => floatval($piggyBank->targetamount),+ 'leftToSave' => $piggyBank->leftToSave];} else {- $accounts[$account->id]['sumOfSaved'] += $piggybank->savedSoFar;- $accounts[$account->id]['sumOfTargets'] += floatval($piggybank->targetamount);- $accounts[$account->id]['leftToSave'] += $piggybank->leftToSave;+ $accounts[$account->id]['sumOfSaved'] += $piggyBank->savedSoFar;+ $accounts[$account->id]['sumOfTargets'] += floatval($piggyBank->targetamount);+ $accounts[$account->id]['leftToSave'] += $piggyBank->leftToSave;}}- return View::make('piggybanks.index', compact('piggybanks', 'accounts'));+ return View::make('piggybanks.index', compact('piggyBanks', 'accounts'));}/*** POST add money to piggy bank*- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return \Illuminate\Http\RedirectResponse*/- public function postAdd(Piggybank $piggybank)+ public function postAdd(Piggybank $piggyBank){$amount = round(floatval(Input::get('amount')), 2);/** @var \FireflyIII\Database\PiggyBank\PiggyBank $acct */$repos = App::make('FireflyIII\Database\PiggyBank\PiggyBank');- $leftOnAccount = $repos->leftOnAccount($piggybank->account);- $savedSoFar = $piggybank->currentRelevantRep()->currentamount;- $leftToSave = $piggybank->targetamount - $savedSoFar;+ $leftOnAccount = $repos->leftOnAccount($piggyBank->account);+ $savedSoFar = $piggyBank->currentRelevantRep()->currentamount;+ $leftToSave = $piggyBank->targetamount - $savedSoFar;$maxAmount = round(min($leftOnAccount, $leftToSave), 2);if ($amount <= $maxAmount) {- $repetition = $piggybank->currentRelevantRep();+ $repetition = $piggyBank->currentRelevantRep();$repetition->currentamount += $amount;$repetition->save();/** Create event!*/- Event::fire('piggybank.addMoney', [$piggybank, $amount]); // new and used.+ Event::fire('piggybank.addMoney', [$piggyBank, $amount]); // new and used.- Session::flash('success', 'Added ' . mf($amount, false) . ' to "' . e($piggybank->name) . '".');+ Session::flash('success', 'Added ' . mf($amount, false) . ' to "' . e($piggyBank->name) . '".');} else {- Session::flash('error', 'Could not add ' . mf($amount, false) . ' to "' . e($piggybank->name) . '".');+ Session::flash('error', 'Could not add ' . mf($amount, false) . ' to "' . e($piggyBank->name) . '".');}return Redirect::route('piggybanks.index');}/**- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return \Illuminate\Http\RedirectResponse*/- public function postRemove(Piggybank $piggybank)+ public function postRemove(Piggybank $piggyBank){$amount = floatval(Input::get('amount'));- $savedSoFar = $piggybank->currentRelevantRep()->currentamount;+ $savedSoFar = $piggyBank->currentRelevantRep()->currentamount;if ($amount <= $savedSoFar) {- $repetition = $piggybank->currentRelevantRep();+ $repetition = $piggyBank->currentRelevantRep();$repetition->currentamount -= $amount;$repetition->save();/** Create event!*/- Event::fire('piggybank.removeMoney', [$piggybank, $amount]); // new and used.+ Event::fire('piggybank.removeMoney', [$piggyBank, $amount]); // new and used.- Session::flash('success', 'Removed ' . mf($amount, false) . ' from "' . e($piggybank->name) . '".');+ Session::flash('success', 'Removed ' . mf($amount, false) . ' from "' . e($piggyBank->name) . '".');} else {- Session::flash('error', 'Could not remove ' . mf($amount, false) . ' from "' . e($piggybank->name) . '".');+ Session::flash('error', 'Could not remove ' . mf($amount, false) . ' from "' . e($piggyBank->name) . '".');}return Redirect::route('piggybanks.index');}/**- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return \Illuminate\View\View*/- public function remove(Piggybank $piggybank)+ public function remove(Piggybank $piggyBank){- return View::make('piggybanks.remove')->with('piggybank', $piggybank);+ return View::make('piggybanks.remove',compact('piggyBank'));}/**- * @param Piggybank $piggybank+ * @param Piggybank $piggyBank** @return $this*/- public function show(Piggybank $piggybank)+ public function show(Piggybank $piggyBank){- $events = $piggybank->piggybankevents()->orderBy('date', 'DESC')->orderBy('id', 'DESC')->get();+ $events = $piggyBank->piggybankevents()->orderBy('date', 'DESC')->orderBy('id', 'DESC')->get();/** Number of reminders:*/- $amountPerReminder = $piggybank->amountPerReminder();- $remindersCount = $piggybank->countFutureReminders();- $subTitle = e($piggybank->name);+ $amountPerReminder = $piggyBank->amountPerReminder();+ $remindersCount = $piggyBank->countFutureReminders();+ $subTitle = e($piggyBank->name);- return View::make('piggybanks.show', compact('amountPerReminder', 'remindersCount', 'piggybank', 'events', 'subTitle'));+ return View::make('piggybanks.show', compact('amountPerReminder', 'remindersCount', 'piggyBank', 'events', 'subTitle'));}diff --git a/app/lib/FireflyIII/Database/PiggyBank/PiggyBank.php b/app/lib/FireflyIII/Database/PiggyBank/PiggyBank.phpindex 44d4a6adf9..9325da329b 100644--- a/app/lib/FireflyIII/Database/PiggyBank/PiggyBank.php+++ b/app/lib/FireflyIII/Database/PiggyBank/PiggyBank.php@@ -221,17 +221,17 @@ class PiggyBank implements CUD, CommonDatabaseCalls, PiggyBankInterface}/**- * @param \Piggybank $piggybank+ * @param \Piggybank $piggyBank* @param Carbon $date** @return mixed* @throws FireflyException* @throws NotImplementedException*/- public function findRepetitionByDate(\Piggybank $piggybank, Carbon $date)+ public function findRepetitionByDate(\Piggybank $piggyBank, Carbon $date){/** @var Collection $reps */- $reps = $piggybank->piggybankrepetitions()->get();+ $reps = $piggyBank->piggybankrepetitions()->get();if ($reps->count() == 1) {return $reps->first();}diff --git a/app/lib/FireflyIII/Event/Piggybank.php b/app/lib/FireflyIII/Event/Piggybank.phpindex bd9ee555f5..1b1c9cde1c 100644--- a/app/lib/FireflyIII/Event/Piggybank.php+++ b/app/lib/FireflyIII/Event/Piggybank.php@@ -15,14 +15,14 @@ class Piggybank{/**- * @param \Piggybank $piggybank+ * @param \Piggybank $piggyBank* @param float $amount*/- public function addMoney(\Piggybank $piggybank, $amount = 0.0)+ public function addMoney(\Piggybank $piggyBank, $amount = 0.0){if ($amount > 0) {$event = new \PiggyBankEvent;- $event->piggybank()->associate($piggybank);+ $event->piggybank()->associate($piggyBank);$event->amount = floatval($amount);$event->date = new Carbon;if (!$event->isValid()) {@@ -76,15 +76,15 @@ class Piggybank}/**- * @param \Piggybank $piggybank+ * @param \Piggybank $piggyBank* @param float $amount*/- public function removeMoney(\Piggybank $piggybank, $amount = 0.0)+ public function removeMoney(\Piggybank $piggyBank, $amount = 0.0){$amount = $amount * -1;if ($amount < 0) {$event = new \PiggyBankEvent;- $event->piggybank()->associate($piggybank);+ $event->piggybank()->associate($piggyBank);$event->amount = floatval($amount);$event->date = new Carbon;$event->save();@@ -92,15 +92,15 @@ class Piggybank}/**- * @param \Piggybank $piggybank+ * @param \Piggybank $piggyBank*/- public function storePiggybank(\Piggybank $piggybank)+ public function storePiggybank(\Piggybank $piggyBank){- if (intval($piggybank->repeats) == 0) {+ if (intval($piggyBank->repeats) == 0) {$repetition = new \PiggybankRepetition;- $repetition->piggybank()->associate($piggybank);- $repetition->startdate = $piggybank->startdate;- $repetition->targetdate = $piggybank->targetdate;+ $repetition->piggybank()->associate($piggyBank);+ $repetition->startdate = $piggyBank->startdate;+ $repetition->targetdate = $piggyBank->targetdate;$repetition->currentamount = 0;$repetition->save();}@@ -112,18 +112,18 @@ class Piggybank/*** @param \TransactionJournal $journal- * @param int $piggybankId+ * @param int $piggyBankId*/- public function storeTransfer(\TransactionJournal $journal, $piggybankId = 0)+ public function storeTransfer(\TransactionJournal $journal, $piggyBankId = 0){- if (intval($piggybankId) == 0) {+ if (intval($piggyBankId) == 0) {return;}/** @var \FireflyIII\Database\PiggyBank\PiggyBank $repository */$repository = \App::make('FireflyIII\Database\PiggyBank\PiggyBank');/** @var \Piggybank $piggyBank */- $piggyBank = $repository->find($piggybankId);+ $piggyBank = $repository->find($piggyBankId);if ($journal->transactions()->where('account_id', $piggyBank->account_id)->count() == 0) {return;diff --git a/app/lib/FireflyIII/Shared/Toolkit/Reminders.php b/app/lib/FireflyIII/Shared/Toolkit/Reminders.phpindex c70ea542e6..d3e582f916 100644--- a/app/lib/FireflyIII/Shared/Toolkit/Reminders.php+++ b/app/lib/FireflyIII/Shared/Toolkit/Reminders.php@@ -72,7 +72,7 @@ class Reminders$today = Carbon::now();- /** @var \Piggybank $piggybank */+ /** @var \Piggybank $piggyBank */foreach ($set as $piggyBank) {/** @var \PiggybankRepetition $repetition */$repetition = $piggyBank->currentRelevantRep();diff --git a/app/views/piggybanks/add.blade.php b/app/views/piggybanks/add.blade.phpindex a4c7f5dc6e..c4f0a9cc3d 100644--- a/app/views/piggybanks/add.blade.php+++ b/app/views/piggybanks/add.blade.php@@ -1,10 +1,10 @@-<form style="display: inline;" id="add" action="{{route('piggybanks.add',$piggybank->id)}}" method="POST">+<form style="display: inline;" id="add" action="{{route('piggybanks.add',$piggyBank->id)}}" method="POST">{{Form::token()}}<div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>- <h4 class="modal-title" id="myModalLabel">Add money to {{{$piggybank->name}}}</h4>+ <h4 class="modal-title" id="myModalLabel">Add money to {{{$piggyBank->name}}}</h4></div><div class="modal-body"><p>diff --git a/app/views/piggybanks/delete.blade.php b/app/views/piggybanks/delete.blade.phpindex 0e37e8d585..967e8b7bc8 100644--- a/app/views/piggybanks/delete.blade.php+++ b/app/views/piggybanks/delete.blade.php@@ -1,12 +1,12 @@@extends('layouts.default')@section('content')-{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggybank) }}-{{Form::open(['class' => 'form-horizontal','id' => 'destroy','url' => route('piggybanks.destroy',$piggybank->id)])}}+{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggyBank) }}+{{Form::open(['class' => 'form-horizontal','id' => 'destroy','url' => route('piggybanks.destroy',$piggyBank->id)])}}<div class="row"><div class="col-lg-6 col-md-12 col-sm-12"><div class="panel panel-red"><div class="panel-heading">- Delete piggy bank "{{{$piggybank->name}}}"+ Delete piggy bank "{{{$piggyBank->name}}}"</div><div class="panel-body"><p>diff --git a/app/views/piggybanks/edit.blade.php b/app/views/piggybanks/edit.blade.phpindex 945be6387e..9cc580c989 100644--- a/app/views/piggybanks/edit.blade.php+++ b/app/views/piggybanks/edit.blade.php@@ -1,7 +1,7 @@@extends('layouts.default')@section('content')-{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggybank) }}-{{Form::model($piggybank, ['class' => 'form-horizontal','id' => 'update','url' => route('piggybanks.update',$piggybank->id)])}}+{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggyBank) }}+{{Form::model($piggyBank, ['class' => 'form-horizontal','id' => 'update','url' => route('piggybanks.update',$piggyBank->id)])}}<div class="row"><div class="col-lg-6 col-md-12 col-sm-6">diff --git a/app/views/piggybanks/index.blade.php b/app/views/piggybanks/index.blade.phpindex 5d7a13d317..3bdc4ff6cc 100644--- a/app/views/piggybanks/index.blade.php+++ b/app/views/piggybanks/index.blade.php@@ -2,52 +2,52 @@@section('content'){{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName()) }}<div class="row">- @foreach($piggybanks as $piggybank)+ @foreach($piggyBanks as $piggyBank)<div class="col-lg-6 col-md-6 col-sm-12"><div class="panel panel-default"><div class="panel-heading">- <i class="fa fa-fw fa-rocket"></i> <a href="{{route('piggybanks.show',$piggybank->id)}}" title="{{{$piggybank->name}}}">{{{$piggybank->name}}}</a>+ <i class="fa fa-fw fa-rocket"></i> <a href="{{route('piggybanks.show',$piggyBank->id)}}" title="{{{$piggyBank->name}}}">{{{$piggyBank->name}}}</a></div><div class="panel-body"><div class="row"><div class="col-lg-2 col-md-3 col-sm-4">- {{mf($piggybank->savedSoFar,true)}}+ {{mf($piggyBank->savedSoFar,true)}}</div><div class="col-lg-8 col-md-6 col-sm-4"><div class="progress progress-striped"><div- @if($piggybank->percentage == 100)+ @if($piggyBank->percentage == 100)class="progress-bar progress-bar-success"@elseclass="progress-bar progress-bar-info"@endif- role="progressbar" aria-valuenow="{{$piggybank->percentage}}" aria-valuemin="0" aria-valuemax="100" style="min-width: 40px;width: {{$piggybank->percentage}}%;">- {{$piggybank->percentage}}%+ role="progressbar" aria-valuenow="{{$piggyBank->percentage}}" aria-valuemin="0" aria-valuemax="100" style="min-width: 40px;width: {{$piggyBank->percentage}}%;">+ {{$piggyBank->percentage}}%</div></div></div><div class="col-lg-2 col-md-3 col-sm-4">- {{mf($piggybank->targetamount,true)}}+ {{mf($piggyBank->targetamount,true)}}</div></div><div class="row"><div class="col-lg-2 col-md-3 col-sm-4"><div class="btn-group btn-group-xs">- @if($piggybank->leftToSave > 0)- <a href="#" class="btn btn-default addMoney" data-id="{{{$piggybank->id}}}"><span data-id="{{{$piggybank->id}}}" class="glyphicon glyphicon-plus"></span></a>+ @if($piggyBank->leftToSave > 0)+ <a href="#" class="btn btn-default addMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-plus"></span></a>@endif- <a href="#" class="btn btn-default removeMoney" data-id="{{{$piggybank->id}}}"><span data-id="{{{$piggybank->id}}}" class="glyphicon glyphicon-minus"></span></a>+ <a href="#" class="btn btn-default removeMoney" data-id="{{{$piggyBank->id}}}"><span data-id="{{{$piggyBank->id}}}" class="glyphicon glyphicon-minus"></span></a></div></div><div class="col-lg-8 col-md-6 col-sm-4"><div class="btn-group btn-group-xs">- <a href="{{route('piggybanks.edit',$piggybank->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>- <a href="{{route('piggybanks.delete',$piggybank->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a>+ <a href="{{route('piggybanks.edit',$piggyBank->id)}}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>+ <a href="{{route('piggybanks.delete',$piggyBank->id)}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span></a></div></div><div class="col-lg-2 col-md-3 col-sm-4">- @if($piggybank->leftToSave > 0)- {{mf($piggybank->leftToSave)}}+ @if($piggyBank->leftToSave > 0)+ {{mf($piggyBank->leftToSave)}}@endif</div></div>diff --git a/app/views/piggybanks/remove.blade.php b/app/views/piggybanks/remove.blade.phpindex d6d5a81f66..b0846bff2e 100644--- a/app/views/piggybanks/remove.blade.php+++ b/app/views/piggybanks/remove.blade.php@@ -1,18 +1,18 @@-<form style="display: inline;" id="remove" action="{{route('piggybanks.remove',$piggybank->id)}}" method="POST">+<form style="display: inline;" id="remove" action="{{route('piggybanks.remove',$piggyBank->id)}}" method="POST">{{Form::token()}}<div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>- <h4 class="modal-title" id="myModalLabel">Remove money from {{{$piggybank->name}}}</h4>+ <h4 class="modal-title" id="myModalLabel">Remove money from {{{$piggyBank->name}}}</h4></div><div class="modal-body"><p>- The maximum amount you can remove is {{mf($piggybank->currentRelevantRep()->currentamount)}}+ The maximum amount you can remove is {{mf($piggyBank->currentRelevantRep()->currentamount)}}</p><div class="input-group"><div class="input-group-addon">€</div>- <input step="any" class="form-control" id="amount" autocomplete="off" name="amount" max="{{round($piggybank->currentRelevantRep()->currentamount,2)}}" type="number">+ <input step="any" class="form-control" id="amount" autocomplete="off" name="amount" max="{{round($piggyBank->currentRelevantRep()->currentamount,2)}}" type="number"></div></div><div class="modal-footer">diff --git a/app/views/piggybanks/show.blade.php b/app/views/piggybanks/show.blade.phpindex 1dedd643d1..48f79b9f7d 100644--- a/app/views/piggybanks/show.blade.php+++ b/app/views/piggybanks/show.blade.php@@ -1,6 +1,6 @@@extends('layouts.default')@section('content')-{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggybank) }}+{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $piggyBank) }}<div class="row"><div class="col-lg-8 col-md-8 col-sm-6"><div class="panel panel-default">@@ -25,8 +25,8 @@<span class="caret"></span></button><ul class="dropdown-menu pull-right" role="menu">- <li><a href="{{route('piggybanks.edit',$piggybank->id)}}"><i class="fa fa-pencil fa-fw"></i> Edit</a></li>- <li><a href="{{route('piggybanks.delete',$piggybank->id)}}"><i class="fa fa-trash fa-fw"></i> Delete</a></li>+ <li><a href="{{route('piggybanks.edit',$piggyBank->id)}}"><i class="fa fa-pencil fa-fw"></i> Edit</a></li>+ <li><a href="{{route('piggybanks.delete',$piggyBank->id)}}"><i class="fa fa-trash fa-fw"></i> Delete</a></li></ul></div></div>@@ -36,54 +36,54 @@<table class="table table-bordered table-striped"><tr><td>Account</td>- <td><a href="{{route('accounts.show',$piggybank->account_id)}}">{{{$piggybank->account->name}}}</a></td>+ <td><a href="{{route('accounts.show',$piggyBank->account_id)}}">{{{$piggyBank->account->name}}}</a></td></tr><tr><td>Target amount</td>- <td>{{mf($piggybank->targetamount)}}</td>+ <td>{{mf($piggyBank->targetamount)}}</td></tr><tr><td>Saved so far</td>- <td>{{mf($piggybank->currentRelevantRep()->currentamount)}}</td>+ <td>{{mf($piggyBank->currentRelevantRep()->currentamount)}}</td></tr><tr><td>Left to save</td>- <td>{{mf($piggybank->targetamount-$piggybank->currentRelevantRep()->currentamount)}}</td>+ <td>{{mf($piggyBank->targetamount-$piggyBank->currentRelevantRep()->currentamount)}}</td></tr><tr><td>Start date</td><td>- @if(is_null($piggybank->startdate))+ @if(is_null($piggyBank->startdate))<em>No start date</em>@endif- @if(is_object($piggybank->startdate))- {{$piggybank->startdate->format('jS F Y')}}+ @if(is_object($piggyBank->startdate))+ {{$piggyBank->startdate->format('jS F Y')}}@endif</td></tr><tr><td>Target date</td><td>- @if(is_null($piggybank->targetdate))+ @if(is_null($piggyBank->targetdate))<em>No target date</em>@endif- @if(is_object($piggybank->targetdate))- {{$piggybank->targetdate->format('jS F Y')}}+ @if(is_object($piggyBank->targetdate))+ {{$piggyBank->targetdate->format('jS F Y')}}@endif</td></tr>- @if(!is_null($piggybank->reminder))+ @if(!is_null($piggyBank->reminder))<tr><td>Reminder</td><td>- @if(intval($piggybank->remind_me) == 0)+ @if(intval($piggyBank->remind_me) == 0)<em>(no reminder)</em>@elseEvery- @if($piggybank->reminder_skip != 0)- {{$piggybank->reminder_skip}}+ @if($piggyBank->reminder_skip != 0)+ {{$piggyBank->reminder_skip}}@endif- {{$piggybank->reminder}}(s)+ {{$piggyBank->reminder}}(s)@endif</td></tr>@@ -116,7 +116,7 @@@section('scripts')<script type="text/javascript">-var piggyBankID = {{{$piggybank->id}}};+var piggyBankID = {{{$piggyBank->id}}};</script><!-- load the libraries and scripts necessary for Google Charts: -->