diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index b8516a8704..87b7703ef8 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -37,10 +37,12 @@ class Help implements HelpInterface */ public function getFromGithub($route) { - $uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/en/' . e($route) . '.md'; - $content = [ + $uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/en/' . e($route) . '.md'; + $routeIndex = str_replace('.', '-', $route); + $title = trans('help.' . $routeIndex); + $content = [ 'text' => '

There is no help for this route!

', - 'title' => $route, + 'title' => $title, ]; try { $content['text'] = file_get_contents($uri); @@ -69,6 +71,18 @@ class Help implements HelpInterface return Route::has($route); } + /** + * @codeCoverageIgnore + * + * @param $route + * + * @return bool + */ + public function inCache($route) + { + return Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text'); + } + /** * @codeCoverageIgnore * @@ -82,16 +96,4 @@ class Help implements HelpInterface Cache::put('help.' . $route . '.text', $content['text'], 10080); // a week. Cache::put('help.' . $route . '.title', $content['title'], 10080); } - - /** - * @codeCoverageIgnore - * - * @param $route - * - * @return bool - */ - public function inCache($route) - { - return Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text'); - } } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index fc62db7d6a..987967585c 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,5 +1,6 @@ hasRole('owner')) { + Session::flash('warning', 'This page is broken.'); + + return Redirect::route('index'); + } + + // get all routes: + $routeCollection = Route::getRoutes(); + /** @var \Illuminate\Routing\Route $value */ + foreach ($routeCollection as $value) { + $name = $value->getName(); + $methods = $value->getMethods(); + $isPost = in_array('POST', $methods); + $index = str_replace('.', '-', $name); + + if (strlen($name) > 0 && !$isPost) { + echo "'" . $index . "' => '" . $name . "',
"; + } + } + + return ' '; + } } diff --git a/app/Http/routes.php b/app/Http/routes.php index f7c34ea677..3538bbf428 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -163,6 +163,7 @@ Route::group( Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']); Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']); Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']); + Route::get('/routes', ['uses' => 'HomeController@routes']); /** * Account Controller */ diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 02f1e46808..83ab460422 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -37,6 +37,36 @@ class Budget extends Model protected $fillable = ['user_id', 'name', 'active']; protected $hidden = ['encrypted']; + /** + * @param array $fields + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @codeCoverageIgnore + * + * @return Budget + */ + public static function firstOrCreateEncrypted(array $fields) + { + // everything but the name: + $query = Budget::orderBy('id'); + foreach ($fields as $name => $value) { + if ($name != 'name') { + $query->where($name, $value); + } + } + $set = $query->get(['budgets.*']); + /** @var Budget $budget */ + foreach ($set as $budget) { + if ($budget->name == $fields['name']) { + return $budget; + } + } + // create it! + $budget = Budget::create($fields); + + return $budget; + + } + /** * * @return \Illuminate\Database\Eloquent\Relations\HasMany diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php index 8ce3c8280e..770079ebe9 100644 --- a/database/seeds/TestDataSeeder.php +++ b/database/seeds/TestDataSeeder.php @@ -2,324 +2,222 @@ use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; -use FireflyIII\Models\AccountType; use FireflyIII\Models\Bill; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\Category; use FireflyIII\Models\PiggyBank; -use FireflyIII\Models\PiggyBankEvent; +use FireflyIII\Models\Role; use FireflyIII\Models\Tag; use FireflyIII\Models\Transaction; -use FireflyIII\Models\TransactionCurrency; -use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionJournal; -use FireflyIII\Models\TransactionType; use FireflyIII\User; use Illuminate\Database\Seeder; /** - * @SuppressWarnings("CamelCase") // I'm fine with this. - * @SuppressWarnings("TooManyMethods") // I'm fine with this - * @SuppressWarnings("CouplingBetweenObjects") // I'm fine with this - * @SuppressWarnings("MethodLength") // I'm fine with this * * Class TestDataSeeder */ class TestDataSeeder extends Seeder { - /** @var string */ - public $eom; - /** @var string */ - public $neom; - /** @var string */ - public $nsom; - /** @var string */ - public $som; - /** @var string */ - public $today; - /** @var string */ - public $yaeom; - /** @var string */ - public $yasom; - /** @var Carbon */ - protected $_endOfMonth; - /** @var Carbon */ - protected $_nextEndOfMonth; - /** @var Carbon */ - protected $_nextStartOfMonth; - /** @var Carbon */ - protected $_startOfMonth; - /** @var Carbon */ - protected $_today; - /** @var Carbon */ - protected $_yearAgoEndOfMonth; - /** @var Carbon */ - protected $_yearAgoStartOfMonth; + + /** @var User */ + protected $user; + /** - * A whole bunch of times and dates. + * */ public function __construct() { - $this->_startOfMonth = Carbon::now()->startOfMonth(); - $this->som = $this->_startOfMonth->format('Y-m-d'); - $this->_endOfMonth = Carbon::now()->endOfMonth(); - $this->eom = $this->_endOfMonth->format('Y-m-d'); - $this->_nextStartOfMonth = Carbon::now()->addMonth()->startOfMonth(); - $this->nsom = $this->_nextStartOfMonth->format('Y-m-d'); - $this->_nextEndOfMonth = Carbon::now()->addMonth()->endOfMonth(); - $this->neom = $this->_nextEndOfMonth->format('Y-m-d'); - $this->_yearAgoStartOfMonth = Carbon::now()->subYear()->startOfMonth(); - $this->yasom = $this->_yearAgoStartOfMonth->format('Y-m-d'); - $this->_yearAgoEndOfMonth = Carbon::now()->subYear()->startOfMonth(); - $this->yaeom = $this->_yearAgoEndOfMonth->format('Y-m-d'); - $this->_today = Carbon::now(); - $this->today = $this->_today->format('Y-m-d'); + } /** - * Dates are always this month, the start of this month or earlier. + * */ public function run() { $this->createUsers(); + + // create accounts: $this->createAssetAccounts(); - $this->createBudgets(); - $this->createCategories(); - $this->createPiggyBanks(); - $this->createBills(); $this->createExpenseAccounts(); $this->createRevenueAccounts(); - $this->createTags(); - $current = clone $this->_yearAgoStartOfMonth; - while ($current <= $this->_startOfMonth) { + // dates: + $start = Carbon::now()->subyear()->startOfMonth(); + $end = Carbon::now()->endOfDay(); - // create expenses for rent, utilities, TV, phone on the 1st of the month. - $this->createMonthlyExpenses(clone $current); - $this->createGroceries(clone $current); - $this->createBigExpense(clone $current); - echo 'Created test-content for ' . $current->format('F Y') . "\n"; + $current = clone $start; + while ($current < $end) { + $month = $current->format('F Y'); + // create salaries: + $this->createIncome('Salary ' . $month, $current, rand(1800, 2000)); + + // pay bills: + $this->createRent('Rent for ' . $month, $current, 800); + $this->createWater('Water bill for ' . $month, $current, 15); + $this->createTV('TV bill for ' . $month, $current, 60); + $this->createPower('Power bill for ' . $month, $current, 120); + + // pay daily groceries: + $this->createGroceries($current); + + // go out for drinks: + $this->createDrinksAndOthers($current); + + // save money every month: + $this->createSavings($current); + + // budget limit for this month, on "Groceries". + $this->createBudgetLimit($current, 'Groceries', 400); + $this->createBudgetLimit($current, 'Bills', 1000); + + echo 'Created test data for ' . $month . "\n"; $current->addMonth(); } - $this->createPiggyBankEvent(); - } /** * */ - public function createUsers() + protected function createUsers() { - User::create( - ['email' => 'reset@example.com', 'password' => bcrypt('functional'), 'reset' => 'okokokokokokokokokokokokokokokok', 'remember_token' => null] - ); - User::create(['email' => 'functional@example.com', 'password' => bcrypt('functional'), 'reset' => null, 'remember_token' => null]); User::create(['email' => 'thegrumpydictator@gmail.com', 'password' => bcrypt('james'), 'reset' => null, 'remember_token' => null]); + $this->user = User::whereEmail('thegrumpydictator@gmail.com')->first(); + + // create rights: + $role = Role::find(1); + $this->user->roles()->save($role); + + } + + protected function createAssetAccounts() + { + $assets = ['MyBank Checking Account', 'Savings', 'Shared', 'Creditcard']; + $assetMeta = [ + [ + 'accountRole' => 'defaultAsset', + ], + [ + 'accountRole' => 'savingAsset', + ], + [ + 'accountRole' => 'sharedAsset', + ], + [ + 'accountRole' => 'ccAsset', + 'ccMonthlyPaymentDate' => '2015-05-27', + 'ccType' => 'monthlyFull' + ], + + ]; + + foreach ($assets as $index => $name) { + // create account: + $account = Account::create( + [ + 'user_id' => $this->user->id, + 'account_type_id' => 3, + 'name' => $name, + 'active' => 1, + 'encrypted' => 1, + ] + ); + foreach ($assetMeta[$index] as $name => $value) { + AccountMeta::create(['account_id' => $account->id, 'name' => $name, 'data' => $value,]); + } + } + } + + protected function createExpenseAccounts() + { + $expenses = ['Adobe', 'Google', 'Vitens', 'Albert Heijn', 'PLUS', 'Apple', 'Bakker', 'Belastingdienst', 'bol.com', 'Cafe Central', 'conrad.nl', + 'coolblue', + 'DUO', 'Etos', 'FEBO', 'Greenchoice', 'Halfords', 'XS4All', 'iCentre', 'Jumper', 'Land lord']; + foreach ($expenses as $name) { + // create account: + Account::create( + [ + 'user_id' => $this->user->id, + 'account_type_id' => 4, + 'name' => $name, + 'active' => 1, + 'encrypted' => 1, + ] + ); + } + } /** * */ - public function createAssetAccounts() + protected function createRevenueAccounts() { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - $assetType = AccountType::whereType('Asset account')->first(); - $ibType = AccountType::whereType('Initial balance account')->first(); - $obType = TransactionType::whereType('Opening balance')->first(); - $euro = TransactionCurrency::whereCode('EUR')->first(); - - - $acc_a = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Checking account', 'active' => 1]); - $acc_b = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Savings account', 'active' => 1]); - $acc_c = Account::create( - ['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Delete me', 'active' => 1, 'virtual_balance' => 123.45] - ); - - // create account meta: - AccountMeta::create(['account_id' => $acc_a->id, 'name' => 'accountRole', 'data' => 'defaultAsset']); - AccountMeta::create(['account_id' => $acc_b->id, 'name' => 'accountRole', 'data' => 'savingAsset']); - AccountMeta::create(['account_id' => $acc_c->id, 'name' => 'accountRole', 'data' => 'defaultAsset']); - - $acc_d = Account::create(['user_id' => $user->id, 'account_type_id' => $ibType->id, 'name' => 'Checking account initial balance', 'active' => 0]); - $acc_e = Account::create(['user_id' => $user->id, 'account_type_id' => $ibType->id, 'name' => 'Savings account initial balance', 'active' => 0]); - $acc_f = Account::create(['user_id' => $user->id, 'account_type_id' => $ibType->id, 'name' => 'Delete me initial balance', 'active' => 0]); - - $this->createJournal( - ['from' => $acc_d, 'to' => $acc_a, 'amount' => 4000, 'transactionType' => $obType, 'description' => 'Initial Balance for Checking account', - 'date' => $this->yasom, 'transactionCurrency' => $euro] - ); - $this->createJournal( - ['from' => $acc_e, 'to' => $acc_b, 'amount' => 10000, 'transactionType' => $obType, 'description' => 'Initial Balance for Savings account', - 'date' => $this->yasom, 'transactionCurrency' => $euro] - ); - $this->createJournal( - ['from' => $acc_f, 'to' => $acc_c, 'amount' => 100, 'transactionType' => $obType, 'description' => 'Initial Balance for Delete me', - 'date' => $this->yasom, 'transactionCurrency' => $euro] - ); - - + $revenues = ['Job', 'Belastingdienst', 'Bank', 'KPN', 'Google']; + foreach ($revenues as $name) { + // create account: + Account::create( + [ + 'user_id' => $this->user->id, + 'account_type_id' => 5, + 'name' => $name, + 'active' => 1, + 'encrypted' => 1, + ] + ); + } } /** - * @param array $data + * @param $description + * @param Carbon $date + * @param $amount * * @return TransactionJournal */ - public function createJournal(array $data) + protected function createIncome($description, Carbon $date, $amount) { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - $billID = isset($data['bill']) ? $data['bill']->id : null; + $date = new Carbon($date->format('Y-m') . '-23'); // paid on 23rd. + $toAccount = $this->findAccount('MyBank Checking Account'); + $fromAccount = $this->findAccount('Job'); + $category = Category::firstOrCreateEncrypted(['name' => 'Salary', 'user_id' => $this->user->id]); + // create journal: - /** @var TransactionJournal $journal */ $journal = TransactionJournal::create( [ - 'user_id' => $user->id, - 'transaction_type_id' => $data['transactionType']->id, - 'transaction_currency_id' => $data['transactionCurrency']->id, - 'bill_id' => $billID, - 'description' => $data['description'], + 'user_id' => $this->user->id, + 'transaction_type_id' => 2, + 'transaction_currency_id' => 1, + 'description' => $description, 'completed' => 1, - 'date' => $data['date'] + 'date' => $date, ] ); + Transaction::create( + [ + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount * -1, - Transaction::create(['account_id' => $data['from']->id, 'transaction_journal_id' => $journal->id, 'amount' => $data['amount'] * -1]); - Transaction::create(['account_id' => $data['to']->id, 'transaction_journal_id' => $journal->id, 'amount' => $data['amount']]); + ] + ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount, - if (isset($data['budget'])) { - $journal->budgets()->save($data['budget']); - } - if (isset($data['category'])) { - $journal->categories()->save($data['category']); - } + ] + ); + $journal->categories()->save($category); return $journal; - } - /** - * - */ - public function createBudgets() - { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - - $groceries = Budget::create(['user_id' => $user->id, 'name' => 'Groceries']); - $bills = Budget::create(['user_id' => $user->id, 'name' => 'Bills']); - $deleteMe = Budget::create(['user_id' => $user->id, 'name' => 'Delete me']); - Budget::create(['user_id' => $user->id, 'name' => 'Budget without repetition']); - BudgetLimit::create( - ['startdate' => $this->som, 'amount' => 201, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $groceries->id] - ); - BudgetLimit::create( - ['startdate' => $this->som, 'amount' => 202, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $bills->id] - ); - BudgetLimit::create( - ['startdate' => $this->som, 'amount' => 203, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $deleteMe->id] - ); - - // and because we have no filters, some repetitions: - } - - /** - * - */ - public function createCategories() - { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - Category::create(['user_id' => $user->id, 'name' => 'DailyGroceries']); - Category::create(['user_id' => $user->id, 'name' => 'Lunch']); - Category::create(['user_id' => $user->id, 'name' => 'House']); - Category::create(['user_id' => $user->id, 'name' => 'Delete me']); - - } - - /** - * - */ - public function createPiggyBanks() - { - // account - $savings = $this->findAccount('Savings account'); - - - // some dates - $endDate = clone $this->_startOfMonth; - $nextYear = clone $this->_startOfMonth; - - $endDate->addMonths(4); - $nextYear->addYear()->subDay(); - - $end = $endDate->format('Y-m-d'); - - // piggy bank - $newCamera = PiggyBank::create( - [ - 'account_id' => $savings->id, - 'name' => 'New camera', - 'targetamount' => 2000, - 'startdate' => $this->som, - 'targetdate' => null, - 'reminder_skip' => 0, - 'remind_me' => 0, - 'order' => 0, - ] - ); - // and some events! - PiggyBankEvent::create(['piggy_bank_id' => $newCamera->id, 'date' => $this->som, 'amount' => 100]); - - - $newClothes = PiggyBank::create( - [ - 'account_id' => $savings->id, - 'name' => 'New clothes', - 'targetamount' => 2000, - 'startdate' => $this->som, - 'targetdate' => $end, - 'reminder_skip' => 0, - 'remind_me' => 0, - 'order' => 0, - ] - ); - - PiggyBankEvent::create(['piggy_bank_id' => $newClothes->id, 'date' => $this->som, 'amount' => 100]); - - /* - * New: create no less than eight piggy banks that - */ - $list = ['week', 'quarter', 'month', 'year']; - $nextYear = clone $this->_startOfMonth; - $nextYear->addYear(); - foreach ($list as $entry) { - - PiggyBank::create( - [ - 'account_id' => $savings->id, - 'name' => $entry . ' piggy bank with target date.', - 'targetamount' => 1000, - 'startdate' => $this->som, - 'targetdate' => $nextYear, - 'reminder_skip' => 0, - 'remind_me' => 0, - 'order' => 0, - ] - ); - PiggyBank::create( - [ - 'account_id' => $savings->id, - 'name' => $entry . ' piggy bank without target date.', - 'targetamount' => 1000, - 'startdate' => $this->som, - 'targetdate' => null, - 'reminder_skip' => 0, - 'remind_me' => 0, - 'order' => 0, - ] - ); - } } /** @@ -329,11 +227,9 @@ class TestDataSeeder extends Seeder */ protected function findAccount($name) { - // account - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); /** @var Account $account */ foreach (Account::get() as $account) { - if ($account->name == $name && $user->id == $account->user_id) { + if ($account->name == $name && $this->user->id == $account->user_id) { return $account; break; } @@ -343,168 +239,370 @@ class TestDataSeeder extends Seeder } /** + * @param $description + * @param Carbon $date + * @param $amount * + * @return TransactionJournal */ - public function createBills() + protected function createRent($description, Carbon $date, $amount) { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - // bill - Bill::create( - ['user_id' => $user->id, 'name' => 'Rent', 'match' => 'rent,land,lord', 'amount_min' => 700, 'amount_max' => 900, 'date' => $this->som, - 'active' => 1, 'automatch' => 1, 'repeat_freq' => 'monthly', 'skip' => 0,] - ); - - // bill - Bill::create( + $fromAccount = $this->findAccount('MyBank Checking Account'); + $toAccount = $this->findAccount('Land lord'); + $category = Category::firstOrCreateEncrypted(['name' => 'Rent', 'user_id' => $this->user->id]); + $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]); + $journal = TransactionJournal::create( [ - 'user_id' => $user->id, - 'name' => 'Gas licht', - 'match' => 'no,match', - 'amount_min' => 500, 'amount_max' => 700, - 'date' => $this->som, - 'active' => 1, 'automatch' => 1, - 'repeat_freq' => 'monthly', 'skip' => 0, + 'user_id' => $this->user->id, + 'transaction_type_id' => 1, + 'transaction_currency_id' => 1, + 'description' => $description, + 'completed' => 1, + 'date' => $date, ] ); - - // bill - Bill::create( + Transaction::create( [ - 'user_id' => $user->id, - 'name' => 'Something something', - 'match' => 'mumble,mumble', - 'amount_min' => 500, - 'amount_max' => 700, - 'date' => $this->som, - 'active' => 0, - 'automatch' => 1, - 'repeat_freq' => 'monthly', - 'skip' => 0, + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount * -1, + ] ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount, - } - - /** - * - */ - public function createExpenseAccounts() - { - //// create expenses for rent, utilities, water, TV, phone on the 1st of the month. - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - $expenseType = AccountType::whereType('Expense account')->first(); - - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Land lord', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Utilities company', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Water company', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'TV company', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Phone agency', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Super savers', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Groceries House', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Lunch House', 'active' => 1]); - - - Account::create(['user_id' => $user->id, 'account_type_id' => $expenseType->id, 'name' => 'Buy More', 'active' => 1]); - - } - - /** - * - */ - public function createRevenueAccounts() - { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - $revenueType = AccountType::whereType('Revenue account')->first(); - - Account::create(['user_id' => $user->id, 'account_type_id' => $revenueType->id, 'name' => 'Employer', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $revenueType->id, 'name' => 'IRS', 'active' => 1]); - Account::create(['user_id' => $user->id, 'account_type_id' => $revenueType->id, 'name' => 'Second job employer', 'active' => 1]); - - } - - /** - * - */ - public function createTags() - { - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - - Tag::create( - ['tag' => 'TagOne', 'tagMode' => 'nothing', 'user_id' => $user->id] + ] ); + $journal->categories()->save($category); + $journal->budgets()->save($budget); + + return $journal; + + } + + /** + * @param $description + * @param Carbon $date + * @param $amount + * + * @return TransactionJournal + */ + protected function createWater($description, Carbon $date, $amount) + { + $date = new Carbon($date->format('Y-m') . '-10'); // paid on 10th + $fromAccount = $this->findAccount('MyBank Checking Account'); + $toAccount = $this->findAccount('Vitens'); + $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]); + $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]); + $journal = TransactionJournal::create( + [ + 'user_id' => $this->user->id, + 'transaction_type_id' => 1, + 'transaction_currency_id' => 1, + 'description' => $description, + 'completed' => 1, + 'date' => $date, + ] + ); + Transaction::create( + [ + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount * -1, + + ] + ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount, + + ] + ); + $journal->categories()->save($category); + $journal->budgets()->save($budget); + + return $journal; + + } + + /** + * @param $description + * @param Carbon $date + * @param $amount + * + * @return TransactionJournal + */ + protected function createTV($description, Carbon $date, $amount) + { + $date = new Carbon($date->format('Y-m') . '-15'); // paid on 10th + $fromAccount = $this->findAccount('MyBank Checking Account'); + $toAccount = $this->findAccount('XS4All'); + $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]); + $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]); + $journal = TransactionJournal::create( + [ + 'user_id' => $this->user->id, + 'transaction_type_id' => 1, + 'transaction_currency_id' => 1, + 'description' => $description, + 'completed' => 1, + 'date' => $date, + ] + ); + Transaction::create( + [ + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount * -1, + + ] + ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount, + + ] + ); + $journal->categories()->save($category); + $journal->budgets()->save($budget); + + return $journal; + + } + + /** + * @param $description + * @param Carbon $date + * @param $amount + * + * @return TransactionJournal + */ + protected function createPower($description, Carbon $date, $amount) + { + $date = new Carbon($date->format('Y-m') . '-06'); // paid on 10th + $fromAccount = $this->findAccount('MyBank Checking Account'); + $toAccount = $this->findAccount('Greenchoice'); + $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]); + $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]); + $journal = TransactionJournal::create( + [ + 'user_id' => $this->user->id, + 'transaction_type_id' => 1, + 'transaction_currency_id' => 1, + 'description' => $description, + 'completed' => 1, + 'date' => $date, + ] + ); + Transaction::create( + [ + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount * -1, + + ] + ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount, + + ] + ); + $journal->categories()->save($category); + $journal->budgets()->save($budget); + + return $journal; - Tag::create(['tag' => 'TagTwo', 'tagMode' => 'nothing', 'user_id' => $user->id]); - Tag::create(['tag' => 'TagThree', 'tagMode' => 'nothing', 'user_id' => $user->id]); } /** * @param Carbon $date */ - public function createMonthlyExpenses(Carbon $date) + protected function createGroceries(Carbon $date) { - // get some objects from the database: - $checking = $this->findAccount('Checking account'); - $savings = $this->findAccount('Savings account'); - $landLord = $this->findAccount('Land lord'); - $utilities = $this->findAccount('Utilities company'); - $television = $this->findAccount('TV company'); - $phone = $this->findAccount('Phone agency'); - $employer = $this->findAccount('Employer'); - $bills = $this->findBudget('Bills'); - $tagOne = $this->findTag('TagOne'); - $tagTwo = $this->findTag('TagTwo'); - $house = $this->findCategory('House'); - $withdrawal = TransactionType::whereType('Withdrawal')->first(); - $deposit = TransactionType::whereType('Deposit')->first(); - $transfer = TransactionType::whereType('Transfer')->first(); - $euro = TransactionCurrency::whereCode('EUR')->first(); - $rentBill = $this->findBill('Rent'); - $cur = $date->format('Y-m-d'); - $formatted = $date->format('F Y'); + $start = clone $date; + $end = clone $date; + $start->startOfMonth(); + $end->endOfMonth(); - $this->createJournal( - ['from' => $checking, 'to' => $landLord, 'amount' => 800, 'transactionType' => $withdrawal, 'description' => 'Rent for ' . $formatted, - 'date' => $cur, 'transactionCurrency' => $euro, 'budget' => $bills, 'category' => $house, 'bill' => $rentBill] - ); - $this->createJournal( - ['from' => $checking, 'to' => $utilities, 'amount' => 150, 'transactionType' => $withdrawal, 'description' => 'Utilities for ' . $formatted, - 'date' => $cur, 'transactionCurrency' => $euro, 'budget' => $bills, 'category' => $house,] - ); - $this->createJournal( - ['from' => $checking, 'to' => $television, 'amount' => 50, 'transactionType' => $withdrawal, 'description' => 'TV for ' . $formatted, - 'date' => $cur, 'transactionCurrency' => $euro, 'budget' => $bills, 'category' => $house,] - ); - $jrnl = $this->createJournal( - ['from' => $checking, 'to' => $phone, 'amount' => 50, 'transactionType' => $withdrawal, 'description' => 'Phone bill for ' . $formatted, - 'date' => $cur, 'transactionCurrency' => $euro, 'budget' => $bills, 'category' => $house,] - ); + $fromAccount = $this->findAccount('MyBank Checking Account'); + $stores = ['Albert Heijn', 'PLUS', 'Bakker']; + $category = Category::firstOrCreateEncrypted(['name' => 'Daily groceries', 'user_id' => $this->user->id]); + $budget = Budget::firstOrCreateEncrypted(['name' => 'Groceries', 'user_id' => $this->user->id]); - $jrnl->tags()->save($tagOne); + $current = clone $start; + while ($current < $end) { + // daily groceries: + $amount = rand(1000, 2500) / 100; + $toAccount = $this->findAccount($stores[rand(0, count($stores) - 1)]); + + $journal = TransactionJournal::create( + [ + 'user_id' => $this->user->id, + 'transaction_type_id' => 1, + 'transaction_currency_id' => 1, + 'description' => 'Groceries', + 'completed' => 1, + 'date' => $current, + ] + ); + Transaction::create( + [ + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount * -1, + + ] + ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount, + + ] + ); + $journal->categories()->save($category); + $journal->budgets()->save($budget); - // two transactions. One without a budget, one without a category. - $jrnl = $this->createJournal( - ['from' => $checking, 'to' => $phone, 'amount' => 10, 'transactionType' => $withdrawal, - 'description' => 'Extra charges on phone bill for ' . $formatted, 'date' => $cur, 'transactionCurrency' => $euro, 'category' => $house] - ); + $current->addDay(); + } + } - $jrnl->tags()->save($tagTwo); + /** + * @param Carbon $date + */ + protected function createDrinksAndOthers(Carbon $date) + { + $start = clone $date; + $end = clone $date; + $start->startOfMonth(); + $end->endOfMonth(); + $current = clone $start; + while ($current < $end) { - $this->createJournal( - ['from' => $checking, 'to' => $television, 'amount' => 5, 'transactionType' => $withdrawal, - 'description' => 'Extra charges on TV bill for ' . $formatted, 'date' => $cur, 'transactionCurrency' => $euro, 'budget' => $bills] - ); + // weekly drink: + $thisDate = clone $current; + $thisDate->addDay(); + $fromAccount = $this->findAccount('MyBank Checking Account'); + $toAccount = $this->findAccount('Cafe Central'); + $category = Category::firstOrCreateEncrypted(['name' => 'Drinks', 'user_id' => $this->user->id]); + $budget = Budget::firstOrCreateEncrypted(['name' => 'Going out', 'user_id' => $this->user->id]); + $amount = rand(1500, 3600) / 100; + $journal = TransactionJournal::create( + [ + 'user_id' => $this->user->id, + 'transaction_type_id' => 1, + 'transaction_currency_id' => 1, + 'description' => 'Going out for drinks', + 'completed' => 1, + 'date' => $thisDate, + ] + ); + Transaction::create( + [ + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount * -1, - // income from job: - $this->createJournal( - ['from' => $employer, 'to' => $checking, 'amount' => rand(3500, 4000), 'transactionType' => $deposit, 'description' => 'Salary for ' . $formatted, - 'date' => $cur, 'transactionCurrency' => $euro] - ); - $this->createJournal( - ['from' => $checking, 'to' => $savings, 'amount' => 2000, 'transactionType' => $transfer, - 'description' => 'Salary to savings account in ' . $formatted, 'date' => $cur, 'transactionCurrency' => $euro] - ); + ] + ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => $amount, + ] + ); + $journal->categories()->save($category); + $journal->budgets()->save($budget); + + // shopping at some (online) shop: + + + $current->addWeek(); + } + } + + /** + * @param Carbon $date + * + * @return TransactionJournal + */ + protected function createSavings(Carbon $date) + { + $date = new Carbon($date->format('Y-m') . '-24'); // paid on 24th. + $toAccount = $this->findAccount('Savings'); + $fromAccount = $this->findAccount('MyBank Checking Account'); + $category = Category::firstOrCreateEncrypted(['name' => 'Money management', 'user_id' => $this->user->id]); + // create journal: + + $journal = TransactionJournal::create( + [ + 'user_id' => $this->user->id, + 'transaction_type_id' => 2, + 'transaction_currency_id' => 1, + 'description' => 'Save money', + 'completed' => 1, + 'date' => $date, + ] + ); + Transaction::create( + [ + 'account_id' => $fromAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => -150, + + ] + ); + Transaction::create( + [ + 'account_id' => $toAccount->id, + 'transaction_journal_id' => $journal->id, + 'amount' => 150, + + ] + ); + $journal->categories()->save($category); + + return $journal; + + } + + /** + * @param Carbon $current + * @param $name + * @param $amount + */ + protected function createBudgetLimit(Carbon $current, $name, $amount) + { + $start = clone $current; + $end = clone $current; + $budget = $this->findBudget($name); + $start->startOfMonth(); + $end->endOfMonth(); + + BudgetLimit::create( + [ + 'budget_id' => $budget->id, + 'startdate' => $start->format('Y-m-d'), + 'amount' => $amount, + 'repeats' => 0, + 'repeat_freq' => 'monthly' + ] + ); } /** @@ -514,11 +612,9 @@ class TestDataSeeder extends Seeder */ protected function findBudget($name) { - // account - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); /** @var Budget $budget */ foreach (Budget::get() as $budget) { - if ($budget->name == $name && $user->id == $budget->user_id) { + if ($budget->name == $name && $this->user->id == $budget->user_id) { return $budget; break; } @@ -527,6 +623,63 @@ class TestDataSeeder extends Seeder return null; } + /** + * @param $name + * + * @return Bill|null + */ + protected function findBill($name) + { + /** @var Bill $bill */ + foreach (Bill::get() as $bill) { + if ($bill->name == $name && $this->user->id == $bill->user_id) { + return $bill; + break; + } + } + + return null; + } + + /** + * @param $name + * + * @return Category|null + */ + protected function findCategory($name) + { + + /** @var Category $category */ + foreach (Category::get() as $category) { + if ($category->name == $name && $this->user->id == $category->user_id) { + return $category; + break; + } + } + + return null; + } + + /** + * @param $name + * + * @return PiggyBank|null + */ + protected function findPiggyBank($name) + { + + /** @var Budget $budget */ + foreach (PiggyBank::get() as $piggyBank) { + $account = $piggyBank->account()->first(); + if ($piggyBank->name == $name && $this->user->id == $account->user_id) { + return $piggyBank; + break; + } + } + + return null; + } + /** * @param $tagName * @@ -535,11 +688,9 @@ class TestDataSeeder extends Seeder */ protected function findTag($tagName) { - // account - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); /** @var Tag $tag */ foreach (Tag::get() as $tag) { - if ($tag->tag == $tagName && $user->id == $tag->user_id) { + if ($tag->tag == $tagName && $this->user->id == $tag->user_id) { return $tag; break; } @@ -549,171 +700,4 @@ class TestDataSeeder extends Seeder } - /** - * @param $name - * - * @return Category|null - */ - protected function findCategory($name) - { - // account - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - /** @var Category $category */ - foreach (Category::get() as $category) { - if ($category->name == $name && $user->id == $category->user_id) { - return $category; - break; - } - } - - return null; - } - - /** - * @param $name - * - * @return Bill|null - */ - protected function findBill($name) - { - // account - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - /** @var Bill $bill */ - foreach (Bill::get() as $bill) { - if ($bill->name == $name && $user->id == $bill->user_id) { - return $bill; - break; - } - } - - return null; - } - - /** - * @param Carbon $date - */ - public function createGroceries(Carbon $date) - { - // variables we need: - $checking = $this->findAccount('Checking account'); - $shopOne = $this->findAccount('Groceries House'); - $shopTwo = $this->findAccount('Super savers'); - $lunchHouse = $this->findAccount('Lunch House'); - $lunch = $this->findCategory('Lunch'); - $daily = $this->findCategory('DailyGroceries'); - $euro = TransactionCurrency::whereCode('EUR')->first(); - $withdrawal = TransactionType::whereType('Withdrawal')->first(); - $groceries = $this->findBudget('Groceries'); - - - $shops = [$shopOne, $shopTwo]; - - // create groceries and lunch (daily, between 5 and 10 euro). - $mStart = clone $date; - $mEnd = clone $date; - $mEnd->endOfMonth(); - while ($mStart <= $mEnd) { - $mFormat = $mStart->format('Y-m-d'); - $shop = $shops[rand(0, 1)]; - - $this->createJournal( - ['from' => $checking, 'to' => $shop, 'amount' => (rand(500, 1000) / 100), 'transactionType' => $withdrawal, 'description' => 'Groceries', - 'date' => $mFormat, 'transactionCurrency' => $euro, 'category' => $daily, 'budget' => $groceries] - ); - $this->createJournal( - ['from' => $checking, 'to' => $lunchHouse, 'amount' => (rand(200, 600) / 100), 'transactionType' => $withdrawal, 'description' => 'Lunch', - 'date' => $mFormat, 'transactionCurrency' => $euro, 'category' => $lunch, 'budget' => $groceries] - ); - - $mStart->addDay(); - } - } - - /** - * @param $date - */ - public function createBigExpense($date) - { - $date->addDays(12); - $dollar = TransactionCurrency::whereCode('USD')->first(); - $checking = $this->findAccount('Checking account'); - $savings = $this->findAccount('Savings account'); - $buyMore = $this->findAccount('Buy More'); - $withdrawal = TransactionType::whereType('Withdrawal')->first(); - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - - - // create some big expenses, move some money around. - $amount = rand(500, 2000); - - $one = $this->createJournal( - ['from' => $savings, 'to' => $checking, 'amount' => $amount, 'transactionType' => $withdrawal, - 'description' => 'Money for big expense in ' . $date->format('F Y'), 'date' => $date->format('Y-m-d'), 'transactionCurrency' => $dollar] - ); - $two = $this->createJournal( - ['from' => $checking, 'to' => $buyMore, 'amount' => $amount, 'transactionType' => $withdrawal, - 'description' => 'Big expense in ' . $date->format('F Y'), 'date' => $date->format('Y-m-d'), 'transactionCurrency' => $dollar] - ); - $group = TransactionGroup::create( - [ - 'user_id' => $user->id, - 'relation' => 'balance' - ] - ); - $group->transactionjournals()->save($one); - $group->transactionjournals()->save($two); - $group->save(); - } - - /** - * - */ - protected function createPiggyBankEvent() - { - // piggy bank event - // add money to this piggy bank - // create a piggy bank event to match: - $checking = $this->findAccount('Checking account'); - $savings = $this->findAccount('Savings account'); - $transfer = TransactionType::whereType('Transfer')->first(); - $euro = TransactionCurrency::whereCode('EUR')->first(); - $groceries = $this->findBudget('Groceries'); - $house = $this->findCategory('House'); - $piggyBank = $this->findPiggyBank('New camera'); - $intoPiggy = $this->createJournal( - ['from' => $checking, 'to' => $savings, 'amount' => 100, 'transactionType' => $transfer, 'description' => 'Money for piggy', - 'date' => $this->yaeom, 'transactionCurrency' => $euro, 'category' => $house, 'budget' => $groceries] - ); - PiggyBankEvent::create( - [ - 'piggy_bank_id' => $piggyBank->id, - 'transaction_journal_id' => $intoPiggy->id, - 'date' => $this->yaeom, - 'amount' => 100 - ] - ); - } - - /** - * @param $name - * - * @return PiggyBank|null - */ - protected function findPiggyBank($name) - { - // account - $user = User::whereEmail('thegrumpydictator@gmail.com')->first(); - /** @var Budget $budget */ - foreach (PiggyBank::get() as $piggyBank) { - $account = $piggyBank->account()->first(); - if ($piggyBank->name == $name && $user->id == $account->user_id) { - return $piggyBank; - break; - } - } - - return null; - } - - } diff --git a/database/seeds/TransactionCurrencySeeder.php b/database/seeds/TransactionCurrencySeeder.php index a53bb414b6..7b7486ce12 100644 --- a/database/seeds/TransactionCurrencySeeder.php +++ b/database/seeds/TransactionCurrencySeeder.php @@ -12,7 +12,7 @@ class TransactionCurrencySeeder extends Seeder { DB::table('transaction_currencies')->delete(); - TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€']); + TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€']); TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$']); TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft']); } diff --git a/public/js/help.js b/public/js/help.js index d4762b43e8..fab1272029 100644 --- a/public/js/help.js +++ b/public/js/help.js @@ -3,7 +3,7 @@ $(function () { $('#help').click(showHelp); $(function () { - $('[data-toggle="tooltip"]').tooltip(); + //$('[data-toggle="tooltip"]').tooltip(); }); }); diff --git a/resources/lang/en/help.php b/resources/lang/en/help.php new file mode 100644 index 0000000000..e46f28061e --- /dev/null +++ b/resources/lang/en/help.php @@ -0,0 +1,72 @@ + 'register', + 'index' => 'The main index', + 'home' => 'home', + 'flush' => 'flush', + 'accounts-index' => 'accounts.index', + 'accounts-create' => 'accounts.create', + 'accounts-edit' => 'accounts.edit', + 'accounts-delete' => 'accounts.delete', + 'accounts-show' => 'accounts.show', + 'bills-index' => 'bills.index', + 'bills-rescan' => 'bills.rescan', + 'bills-create' => 'bills.create', + 'bills-edit' => 'bills.edit', + 'bills-delete' => 'bills.delete', + 'bills-show' => 'bills.show', + 'budgets-index' => 'budgets.index', + 'budgets-income' => 'budgets.income', + 'budgets-create' => 'budgets.create', + 'budgets-edit' => 'budgets.edit', + 'budgets-delete' => 'budgets.delete', + 'budgets-show' => 'budgets.show', + 'budgets-noBudget' => 'budgets.noBudget', + 'categories-index' => 'categories.index', + 'categories-create' => 'categories.create', + 'categories-edit' => 'categories.edit', + 'categories-delete' => 'categories.delete', + 'categories-show' => 'categories.show', + 'categories-noCategory' => 'categories.noCategory', + 'currency-index' => 'currency.index', + 'currency-create' => 'currency.create', + 'currency-edit' => 'currency.edit', + 'currency-delete' => 'currency.delete', + 'currency-default' => 'currency.default', + 'help-show' => 'help.show', + 'json-expense-accounts' => 'json.expense-accounts', + 'json-revenue-accounts' => 'json.revenue-accounts', + 'json-categories' => 'json.categories', + 'json-tags' => 'json.tags', + 'json-box-in' => 'json.box.in', + 'json-box-out' => 'json.box.out', + 'json-box-paid' => 'json.box.paid', + 'json-box-unpaid' => 'json.box.unpaid', + 'new-user-index' => 'new-user.index', + 'piggy-banks-index' => 'piggy-banks.index', + 'piggy-banks-addMoney' => 'piggy-banks.addMoney', + 'piggy-banks-removeMoney' => 'piggy-banks.removeMoney', + 'piggy-banks-create' => 'piggy-banks.create', + 'piggy-banks-edit' => 'piggy-banks.edit', + 'piggy-banks-delete' => 'piggy-banks.delete', + 'piggy-banks-show' => 'piggy-banks.show', + 'preferences' => 'preferences', + 'profile' => 'profile', + 'profile-change-password' => 'profile.change-password', + 'profile-delete-account' => 'profile.delete-account', + 'reports-index' => 'reports.index', + 'reports-year' => 'reports.year', + 'reports-month' => 'reports.month', + 'search' => 'search', + 'tags-index' => 'tags.index', + 'tags-create' => 'tags.create', + 'tags-show' => 'tags.show', + 'tags-edit' => 'tags.edit', + 'tags-delete' => 'tags.delete', + 'transactions-index' => 'transactions.index', + 'transactions-create' => 'transactions.create', + 'transactions-edit' => 'transactions.edit', + 'transactions-delete' => 'transactions.delete', + 'transactions-show' => 'transactions.show', + 'logout' => 'logout', +]; \ No newline at end of file diff --git a/resources/lang/nl/help.php b/resources/lang/nl/help.php new file mode 100644 index 0000000000..46237d397b --- /dev/null +++ b/resources/lang/nl/help.php @@ -0,0 +1,72 @@ + 'register', + 'index' => 'index', + 'home' => 'home', + 'flush' => 'flush', + 'accounts-index' => 'accounts.index', + 'accounts-create' => 'accounts.create', + 'accounts-edit' => 'accounts.edit', + 'accounts-delete' => 'accounts.delete', + 'accounts-show' => 'accounts.show', + 'bills-index' => 'bills.index', + 'bills-rescan' => 'bills.rescan', + 'bills-create' => 'bills.create', + 'bills-edit' => 'bills.edit', + 'bills-delete' => 'bills.delete', + 'bills-show' => 'bills.show', + 'budgets-index' => 'budgets.index', + 'budgets-income' => 'budgets.income', + 'budgets-create' => 'budgets.create', + 'budgets-edit' => 'budgets.edit', + 'budgets-delete' => 'budgets.delete', + 'budgets-show' => 'budgets.show', + 'budgets-noBudget' => 'budgets.noBudget', + 'categories-index' => 'categories.index', + 'categories-create' => 'categories.create', + 'categories-edit' => 'categories.edit', + 'categories-delete' => 'categories.delete', + 'categories-show' => 'categories.show', + 'categories-noCategory' => 'categories.noCategory', + 'currency-index' => 'currency.index', + 'currency-create' => 'currency.create', + 'currency-edit' => 'currency.edit', + 'currency-delete' => 'currency.delete', + 'currency-default' => 'currency.default', + 'help-show' => 'help.show', + 'json-expense-accounts' => 'json.expense-accounts', + 'json-revenue-accounts' => 'json.revenue-accounts', + 'json-categories' => 'json.categories', + 'json-tags' => 'json.tags', + 'json-box-in' => 'json.box.in', + 'json-box-out' => 'json.box.out', + 'json-box-paid' => 'json.box.paid', + 'json-box-unpaid' => 'json.box.unpaid', + 'new-user-index' => 'new-user.index', + 'piggy-banks-index' => 'piggy-banks.index', + 'piggy-banks-addMoney' => 'piggy-banks.addMoney', + 'piggy-banks-removeMoney' => 'piggy-banks.removeMoney', + 'piggy-banks-create' => 'piggy-banks.create', + 'piggy-banks-edit' => 'piggy-banks.edit', + 'piggy-banks-delete' => 'piggy-banks.delete', + 'piggy-banks-show' => 'piggy-banks.show', + 'preferences' => 'preferences', + 'profile' => 'profile', + 'profile-change-password' => 'profile.change-password', + 'profile-delete-account' => 'profile.delete-account', + 'reports-index' => 'reports.index', + 'reports-year' => 'reports.year', + 'reports-month' => 'reports.month', + 'search' => 'search', + 'tags-index' => 'tags.index', + 'tags-create' => 'tags.create', + 'tags-show' => 'tags.show', + 'tags-edit' => 'tags.edit', + 'tags-delete' => 'tags.delete', + 'transactions-index' => 'transactions.index', + 'transactions-create' => 'transactions.create', + 'transactions-edit' => 'transactions.edit', + 'transactions-delete' => 'transactions.delete', + 'transactions-show' => 'transactions.show', + 'logout' => 'logout', +]; \ No newline at end of file diff --git a/resources/twig/layout/default.twig b/resources/twig/layout/default.twig index 24d1981508..a2f673e125 100644 --- a/resources/twig/layout/default.twig +++ b/resources/twig/layout/default.twig @@ -48,6 +48,13 @@