diff --git a/README.md b/README.md index a601b48810..a3de7d2e42 100644 --- a/README.md +++ b/README.md @@ -61,19 +61,19 @@ Everything is organised: _Please note that everything in these screenshots is fictional and may not be realistic._ -![Index](https://i.nder.be/gdryw73q) +![Index](https://i.nder.be/c6hz06d3) -![Accounts](https://i.nder.be/hmpkq8q0) +![Accounts](https://i.nder.be/gzxxyz6n) -![Budgets](https://i.nder.be/cbq2n5g9) +![Budgets](https://i.nder.be/hhu3krqk) -![Reports 1](https://i.nder.be/cmwvqrds) +![Reports 1](https://i.nder.be/cc3yspf6) -![Reports 2](https://i.nder.be/cv4dqbp4) +![Reports 2](https://i.nder.be/h6fp7xkb) -![Bills](https://i.nder.be/gmkxqdw7) +![Bills](https://i.nder.be/c30zkcpv) -![Piggy banks](https://i.nder.be/cc5u6h3b) +![Piggy banks](https://i.nder.be/g20k0mdq) ## Running and installing diff --git a/config/firefly.php b/config/firefly.php index 49251d3e79..aa34693bf9 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -1,8 +1,8 @@ 'chartjs', // or 'chartjs' - 'version' => '3.4.6', + 'chart' => 'chartjs', + 'version' => '3.4.7', 'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'], 'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'csv_import_enabled' => true, diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php index b187830979..cca8a151fd 100644 --- a/database/seeds/TestDataSeeder.php +++ b/database/seeds/TestDataSeeder.php @@ -7,6 +7,7 @@ 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; @@ -45,6 +46,7 @@ class TestDataSeeder extends Seeder $this->createExpenseAccounts(); $this->createRevenueAccounts(); $this->createBills(); + $this->createPiggybanks(); // dates: $start = Carbon::now()->subyear()->startOfMonth(); @@ -213,6 +215,144 @@ class TestDataSeeder extends Seeder ); } + protected function createPiggybanks() + { + $account = $this->findAccount('Savings'); + + $camera = PiggyBank::create( + [ + 'account_id' => $account->id, + 'name' => 'New camera', + 'targetamount' => 1000, + 'startdate' => '2015-04-01', + 'reminder_skip' => 0, + 'remind_me' => 0, + 'order' => 1, + ] + ); + $repetition = $camera->piggyBankRepetitions()->first(); + $repetition->currentamount = 735; + $repetition->save(); + + // events: + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $camera->id, + 'date' => '2015-05-01', + 'amount' => '245' + ] + ); + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $camera->id, + 'date' => '2015-06-01', + 'amount' => '245' + ] + ); + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $camera->id, + 'date' => '2015-07-01', + 'amount' => '245' + ] + ); + + + $phone = PiggyBank::create( + [ + 'account_id' => $account->id, + 'name' => 'New phone', + 'targetamount' => 600, + 'startdate' => '2015-04-01', + 'reminder_skip' => 0, + 'remind_me' => 0, + 'order' => 1, + ] + ); + $repetition = $phone->piggyBankRepetitions()->first(); + $repetition->currentamount = 333; + $repetition->save(); + + // events: + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $phone->id, + 'date' => '2015-05-01', + 'amount' => '111' + ] + ); + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $phone->id, + 'date' => '2015-06-01', + 'amount' => '111' + ] + ); + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $phone->id, + 'date' => '2015-07-01', + 'amount' => '111' + ] + ); + + $couch = PiggyBank::create( + [ + 'account_id' => $account->id, + 'name' => 'New couch', + 'targetamount' => 500, + 'startdate' => '2015-04-01', + 'reminder_skip' => 0, + 'remind_me' => 0, + 'order' => 1, + ] + ); + $repetition = $couch->piggyBankRepetitions()->first(); + $repetition->currentamount = 120; + $repetition->save(); + + // events: + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $couch->id, + 'date' => '2015-05-01', + 'amount' => '40' + ] + ); + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $couch->id, + 'date' => '2015-06-01', + 'amount' => '40' + ] + ); + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $couch->id, + 'date' => '2015-07-01', + 'amount' => '40' + ] + ); + } + + /** + * @param $name + * + * @return Account|null + */ + protected function findAccount($name) + { + /** @var Account $account */ + foreach (Account::get() as $account) { + if ($account->name == $name && $this->user->id == $account->user_id) { + return $account; + break; + } + } + + return null; + } + /** * @param $description * @param Carbon $date @@ -260,24 +400,6 @@ class TestDataSeeder extends Seeder } - /** - * @param $name - * - * @return Account|null - */ - protected function findAccount($name) - { - /** @var Account $account */ - foreach (Account::get() as $account) { - if ($account->name == $name && $this->user->id == $account->user_id) { - return $account; - break; - } - } - - return null; - } - /** * @param $description * @param Carbon $date @@ -593,7 +715,7 @@ class TestDataSeeder extends Seeder $journal = TransactionJournal::create( [ 'user_id' => $this->user->id, - 'transaction_type_id' => 2, + 'transaction_type_id' => 3, 'transaction_currency_id' => 1, 'description' => 'Save money', 'completed' => 1,