Compare commits

..

87 Commits

Author SHA1 Message Date
James Cole
6e48827d3f Merge branch 'release/3.4.0.10' 2015-05-24 15:56:04 +02:00
James Cole
f0c20cc706 New release. 2015-05-24 15:55:59 +02:00
James Cole
8916c0a3de Clean code [skip ci] 2015-05-24 15:18:19 +02:00
James Cole
7193a77840 Some translations and cleanup [skip ci] 2015-05-24 15:13:07 +02:00
James Cole
61930b5b51 Code cleanup [skip ci] 2015-05-24 15:03:45 +02:00
James Cole
11a494cacf Remove some middleware, fix cleanup [skip ci] 2015-05-24 12:53:47 +02:00
James Cole
17f9bf0339 Merge branch 'release/3.4.0.9' into develop 2015-05-24 11:53:44 +02:00
James Cole
3d9755ca8c Merge branch 'release/3.4.0.9' 2015-05-24 11:53:43 +02:00
James Cole
b5cf2d03e6 New version. 2015-05-24 11:53:34 +02:00
James Cole
e3b35b8f35 Add code climate file [skip ci] 2015-05-24 11:46:41 +02:00
James Cole
1c1fe672bd Some code cleanup [skip ci] 2015-05-24 11:41:52 +02:00
James Cole
6c71f68ed8 Should cover models. 2015-05-24 11:13:46 +02:00
James Cole
8f2f912cdf New (empty) tests for models. 2015-05-24 10:01:00 +02:00
James Cole
bf6ea16acb Fixed test. 2015-05-24 09:29:44 +02:00
James Cole
288546c2b9 Fixed some math. 2015-05-24 08:00:40 +02:00
James Cole
724db6c34c Built some new tests 2015-05-24 07:43:48 +02:00
James Cole
067c451c1d Fixed tests 2015-05-23 21:41:04 +02:00
James Cole
11e3696191 Cleanup tests. 2015-05-23 21:23:51 +02:00
James Cole
41e20664de Fixed coverage. 2015-05-23 21:18:20 +02:00
James Cole
d8de90d6f3 Ignore constructors. 2015-05-23 20:49:57 +02:00
James Cole
b01e8299d3 Fixed tests 2015-05-23 20:47:31 +02:00
James Cole
1ec11e3e2e Compartmentalised all tests. 2015-05-23 19:41:54 +02:00
James Cole
422f429725 Experimental count thing. 2015-05-23 17:38:16 +02:00
James Cole
5c55fa5fbb Remove encrypted amounts because it stinks. 2015-05-23 17:33:04 +02:00
James Cole
80d845fdf2 Save but don't use. 2015-05-23 17:18:23 +02:00
James Cole
601fe68346 Don't multiply transactions. 2015-05-23 17:14:36 +02:00
James Cole
9e050fb059 Updated some tests. 2015-05-23 17:11:16 +02:00
James Cole
99d4adf5e6 Translations [skip ci] 2015-05-23 15:57:38 +02:00
James Cole
85f8d1e8e9 Math is hard [skip ci] 2015-05-23 15:45:01 +02:00
James Cole
8334d3d99f Translation error [skip ci] 2015-05-23 15:43:48 +02:00
James Cole
cff08d19eb Slowly move away from using the raw 'transactions.amount' field. 2015-05-23 15:42:19 +02:00
James Cole
2d86390bc1 Experimental query.Code cleanup [skip ci] 2015-05-23 09:11:59 +02:00
James Cole
7a20835571 Code cleanup [skip ci] 2015-05-23 09:09:25 +02:00
James Cole
ff3c9676b5 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:05:08 +02:00
James Cole
055f97dab1 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:03:52 +02:00
James Cole
8a867e71a1 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:02:27 +02:00
James Cole
b8275b4734 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:01:38 +02:00
James Cole
36b951b146 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:01:07 +02:00
James Cole
c5a5f17643 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:00:11 +02:00
James Cole
16b909c4df Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 08:59:23 +02:00
James Cole
92b7648e03 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 08:58:21 +02:00
James Cole
ca46ebe3b2 Encrypt bill amounts [skip ci] 2015-05-23 08:57:02 +02:00
James Cole
676e48254a Whoops [skip ci] 2015-05-23 08:55:16 +02:00
James Cole
b15b55227d Add another cleanup routine. [skip ci] 2015-05-23 08:54:25 +02:00
James Cole
3c3b723913 Some code cleanup [skip ci] 2015-05-23 08:51:24 +02:00
James Cole
f05002c729 Updated models for encryption. 2015-05-23 08:46:46 +02:00
James Cole
1c2cbd5b40 New stuff for encrypted amounts. 2015-05-23 07:47:36 +02:00
James Cole
54c6ca9f45 Expanded some tests. 2015-05-22 20:25:12 +02:00
James Cole
c10efbb170 Also encrypt meta data for reminders. 2015-05-22 19:19:18 +02:00
James Cole
a496ad5814 Simple routine to encrypt entries which were not encrypted yet. 2015-05-22 19:18:00 +02:00
James Cole
50cf7f6a3b Merge branch 'release/3.4.0.8' 2015-05-22 18:55:13 +02:00
James Cole
f946f10afd Merge branch 'release/3.4.0.8' into develop 2015-05-22 18:55:13 +02:00
James Cole
eecb4db34c Built chart tests. 2015-05-22 18:31:57 +02:00
James Cole
1f865d3ea4 Improved coverage. 2015-05-22 15:05:32 +02:00
James Cole
623bb4b350 New tests. 2015-05-22 10:17:20 +02:00
James Cole
dc8ad673a6 New test to cover some reminder stuff. 2015-05-22 08:52:30 +02:00
James Cole
4914ad821e Fixed coverage for transaction controller. 2015-05-22 08:03:34 +02:00
James Cole
f099cbadc3 Version increment. 2015-05-22 07:16:36 +02:00
James Cole
42cda384c8 Fix help routes 2015-05-22 07:15:40 +02:00
James Cole
23c91b9990 Some translations, playing around with popups. [skip ci] 2015-05-21 23:05:31 +02:00
James Cole
ff0379182e Sort chart [skip ci] 2015-05-21 18:57:14 +02:00
James Cole
e08a23948f Fixed chart. [skip ci] 2015-05-21 18:50:23 +02:00
James Cole
bd56de6d36 Fix other translations [skip ci] 2015-05-21 17:47:10 +02:00
James Cole
42970aea80 Fix some translations. 2015-05-21 17:45:01 +02:00
James Cole
003a05ee8d Fixed the category chart. 2015-05-21 17:27:48 +02:00
James Cole
ffb11b01a6 Some new translations. 2015-05-21 07:44:44 +02:00
James Cole
e426f5d5da Some new translations. 2015-05-21 07:30:38 +02:00
James Cole
6989f61e1b Extra translations [skip ci] 2015-05-20 20:10:01 +02:00
James Cole
0e6677ccb3 Remove cash accounts from list [skip ci] 2015-05-20 20:04:27 +02:00
James Cole
8f104d555a Added newlines to files. 2015-05-20 19:56:14 +02:00
James Cole
b1d3158db1 Code cleanup. 2015-05-20 19:55:53 +02:00
James Cole
7645005d5a Return of account id. 2015-05-20 18:18:05 +02:00
James Cole
411f77fd29 Fixed some other displays of money 2015-05-20 18:09:44 +02:00
James Cole
568ab26db1 Spell check [skip ci] 2015-05-20 17:06:47 +02:00
James Cole
29652108f0 Fixed tests. 2015-05-20 17:04:53 +02:00
James Cole
f07e4dc711 Fix sort. [skip ci] 2015-05-20 07:21:40 +02:00
James Cole
8a2ac457c2 Name fix [skip ci] 2015-05-20 07:21:01 +02:00
James Cole
9e54eecfaa Fixed some views. 2015-05-20 07:20:02 +02:00
James Cole
95ef691077 Fixed some more reports and charts. [skip ci] 2015-05-20 07:07:46 +02:00
James Cole
7a0ad5a587 Fixed a chart [skip ci] 2015-05-20 06:50:24 +02:00
James Cole
42b49d0e4b Added some correcting methods. [skip ci] 2015-05-20 06:50:15 +02:00
James Cole
9217c2f003 Corrected some charts [skip ci] 2015-05-20 06:49:51 +02:00
James Cole
fbdf66998d Added a forgotten chart, corrected some others. [skip ci] 2015-05-20 06:49:22 +02:00
James Cole
deda9d3c54 Add corrected expense routes [skip ci] 2015-05-20 06:49:03 +02:00
James Cole
a5d78f20ae Add corrected income and expense methods [skip ci] 2015-05-20 06:48:52 +02:00
James Cole
5ed09e3f38 Call the corrected spent function [skip ci] 2015-05-20 06:47:53 +02:00
James Cole
54387c8fdf Merge branch 'release/3.4.0.7' into develop 2015-05-18 18:23:07 +02:00
154 changed files with 4424 additions and 1459 deletions

25
.codeclimate.yml Normal file
View File

@@ -0,0 +1,25 @@
# Save as .codeclimate.yml (note leading .) in project root directory
languages:
JavaScript: true
PHP: true
exclude_paths:
- "public/packages/maximebf/php-debugbar/debugbar.js"
- "public/packages/maximebf/php-debugbar/widgets.js"
- "public/packages/maximebf/php-debugbar/openhandler.js"
- "public/packages/maximebf/php-debugbar/widgets/sqlqueries/widget.js"
- "public/js/bootstrap3-typeahead.min.js"
- "public/js/bootstrap-sortable.js"
- "public/js/bootstrap-tagsinput.min.js"
- "public/js/bootstrap-tagsinput.min.js.map"
- "public/js/daterangepicker.js"
- "public/js/jquery-2.1.3.min.js"
- "public/js/jquery-2.1.3.min.js.map"
- "public/js/jquery-ui.min.js"
- "public/js/metisMenu.js"
- "public/js/moment.min.js"
- "public/js/sb-admin-2.js"
- "public/bootstrap/*"
- "resources/lang/*"
- "tests/*"
- "database/*"
- "storage/*"

View File

@@ -16,4 +16,5 @@ EMAIL_DRIVER=smtp
EMAIL_USERNAME= EMAIL_USERNAME=
EMAIL_PASSWORD= EMAIL_PASSWORD=
ANALYTICS_ID= ANALYTICS_ID=
EMAIL_PRETEND=false EMAIL_PRETEND=false
RUNCLEANUP=true

View File

@@ -1,5 +1,5 @@
# Firefly III # Firefly III
#### v3.4.0.7 #### v3.4.0.10
[![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=develop)](https://travis-ci.org/JC5/firefly-iii) [![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=develop)](https://travis-ci.org/JC5/firefly-iii)
[![Project Status](http://stillmaintained.com/JC5/firefly-iii.png?a=b)](http://stillmaintained.com/JC5/firefly-iii) [![Project Status](http://stillmaintained.com/JC5/firefly-iii.png?a=b)](http://stillmaintained.com/JC5/firefly-iii)

View File

@@ -18,6 +18,8 @@ class ConnectJournalToPiggyBank
/** /**
* Create the event handler. * Create the event handler.
* *
* @codeCoverageIgnore
*
*/ */
public function __construct() public function __construct()
{ {

View File

@@ -87,4 +87,4 @@ class Account
} }
} }

View File

@@ -1,6 +1,7 @@
<?php <?php
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
@@ -60,6 +61,4 @@ class Balance
} }
}
}

View File

@@ -17,14 +17,11 @@ class BalanceEntry
/** @var AccountModel */ /** @var AccountModel */
protected $account; protected $account;
/** @var float */
protected $left = 0.0;
/** @var float */ /** @var float */
protected $spent = 0.0; protected $spent = 0.0;
/** @var float */
protected $left = 0.0;
/** /**
* @return AccountModel * @return AccountModel
*/ */
@@ -41,22 +38,6 @@ class BalanceEntry
$this->account = $account; $this->account = $account;
} }
/**
* @return float
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param float $spent
*/
public function setSpent($spent)
{
$this->spent = $spent;
}
/** /**
* @return float * @return float
*/ */
@@ -73,7 +54,21 @@ class BalanceEntry
$this->left = $left; $this->left = $left;
} }
/**
* @return float
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param float $spent
*/
public function setSpent($spent)
{
$this->spent = $spent;
}
}
}

View File

@@ -43,5 +43,4 @@ class BalanceHeader
} }
}
}

View File

@@ -167,4 +167,4 @@ class BalanceLine
} }
} }

View File

@@ -3,10 +3,10 @@
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Bill as BillModel;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* @codeCoverageIgnore
* Class Bill * Class Bill
* *
* @package FireflyIII\Helpers\Collection * @package FireflyIII\Helpers\Collection
@@ -43,8 +43,9 @@ class Bill
$this->bills->sortBy( $this->bills->sortBy(
function (BillLine $bill) { function (BillLine $bill) {
$active = intval($bill->getBill()->active) == 0 ? 1 : 0; $active = intval($bill->getBill()->active) == 0 ? 1 : 0;
$name = $bill->getBill()->name; $name = $bill->getBill()->name;
return $active.$name;
return $active . $name;
} }
); );
@@ -52,4 +53,4 @@ class Bill
return $this->bills; return $this->bills;
} }
} }

View File

@@ -5,6 +5,8 @@ namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Bill as BillModel; use FireflyIII\Models\Bill as BillModel;
/** /**
* @codeCoverageIgnore
*
* Class BillLine * Class BillLine
* *
* @package FireflyIII\Helpers\Collection * @package FireflyIII\Helpers\Collection
@@ -122,4 +124,4 @@ class BillLine
} }
} }

View File

@@ -1,6 +1,7 @@
<?php <?php
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
@@ -14,14 +15,14 @@ class Budget
{ {
/** @var Collection */ /** @var Collection */
protected $budgetLines; protected $budgetLines;
/** @var float */ /** @var string */
protected $budgeted = 0; protected $budgeted = '0';
/** @var float */ /** @var string */
protected $left = 0; protected $left = '0';
/** @var float */ /** @var string */
protected $overspent = 0; protected $overspent = '0';
/** @var float */ /** @var string */
protected $spent = 0; protected $spent = '0';
/** /**
* *
@@ -44,7 +45,9 @@ class Budget
*/ */
public function addBudgeted($add) public function addBudgeted($add)
{ {
$this->budgeted += floatval($add); $add = strval(round($add, 2));
bcscale(2);
$this->budgeted = bcadd($this->budgeted, $add);
} }
/** /**
@@ -52,7 +55,9 @@ class Budget
*/ */
public function addLeft($add) public function addLeft($add)
{ {
$this->left += floatval($add); $add = strval(round($add, 2));
bcscale(2);
$this->left = bcadd($this->left, $add);
} }
/** /**
@@ -60,7 +65,9 @@ class Budget
*/ */
public function addOverspent($add) public function addOverspent($add)
{ {
$this->overspent += floatval($add); $add = strval(round($add, 2));
bcscale(2);
$this->overspent = bcadd($this->overspent, $add);
} }
/** /**
@@ -68,71 +75,9 @@ class Budget
*/ */
public function addSpent($add) public function addSpent($add)
{ {
$this->spent += floatval($add); $add = strval(round($add, 2));
} bcscale(2);
$this->spent = bcadd($this->spent, $add);
/**
* @return float
*/
public function getBudgeted()
{
return $this->budgeted;
}
/**
* @param float $budgeted
*/
public function setBudgeted($budgeted)
{
$this->budgeted = $budgeted;
}
/**
* @return float
*/
public function getLeft()
{
return $this->left;
}
/**
* @param float $left
*/
public function setLeft($left)
{
$this->left = $left;
}
/**
* @return float
*/
public function getOverspent()
{
return $this->overspent;
}
/**
* @param float $overspent
*/
public function setOverspent($overspent)
{
$this->overspent = $overspent;
}
/**
* @return float
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param float $spent
*/
public function setSpent($spent)
{
$this->spent = $spent;
} }
/** /**
@@ -143,7 +88,69 @@ class Budget
return $this->budgetLines; return $this->budgetLines;
} }
/**
* @return string
*/
public function getBudgeted()
{
return $this->budgeted;
}
/**
* @param string $budgeted
*/
public function setBudgeted($budgeted)
{
$this->budgeted = $budgeted;
}
/**
* @return string
*/
public function getLeft()
{
return $this->left;
}
/**
* @param string $left
*/
public function setLeft($left)
{
$this->left = $left;
}
/**
* @return string
*/
public function getOverspent()
{
return $this->overspent;
}
/**
* @param string $overspent
*/
public function setOverspent($overspent)
{
$this->overspent = strval(round($overspent, 2));
}
/**
* @return string
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param string $spent
*/
public function setSpent($spent)
{
$this->spent = strval(round($spent, 2));
}
}
}

View File

@@ -17,18 +17,16 @@ class BudgetLine
/** @var BudgetModel */ /** @var BudgetModel */
protected $budget; protected $budget;
/** @var LimitRepetition */
protected $repetition;
/** @var float */ /** @var float */
protected $budgeted = 0; protected $budgeted = 0;
/** @var float */ /** @var float */
protected $left = 0; protected $left = 0;
/** @var float */ /** @var float */
protected $overspent = 0; protected $overspent = 0;
/** @var LimitRepetition */
protected $repetition;
/** @var float */ /** @var float */
protected $spent = 0; protected $spent = 0;
/** /**
* @return BudgetModel * @return BudgetModel
@@ -94,22 +92,6 @@ class BudgetLine
$this->overspent = $overspent; $this->overspent = $overspent;
} }
/**
* @return float
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param float $spent
*/
public function setSpent($spent)
{
$this->spent = $spent;
}
/** /**
* @return LimitRepetition * @return LimitRepetition
*/ */
@@ -126,9 +108,21 @@ class BudgetLine
$this->repetition = $repetition; $this->repetition = $repetition;
} }
/**
* @return float
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param float $spent
*/
public function setSpent($spent)
{
$this->spent = $spent;
}
}
}

View File

@@ -1,10 +1,4 @@
<?php <?php
/**
* Created by PhpStorm.
* User: sander
* Date: 16/05/15
* Time: 13:09
*/
namespace FireflyIII\Helpers\Collection; namespace FireflyIII\Helpers\Collection;
@@ -24,8 +18,8 @@ class Category
/** @var Collection */ /** @var Collection */
protected $categories; protected $categories;
/** @var float */ /** @var string */
protected $total = 0; protected $total = '0';
/** /**
* *
@@ -50,7 +44,9 @@ class Category
*/ */
public function addTotal($add) public function addTotal($add)
{ {
$this->total += floatval($add); $add = strval(round($add, 2));
bcscale(2);
$this->total = bcadd($this->total, $add);
} }
/** /**
@@ -69,12 +65,12 @@ class Category
} }
/** /**
* @return float * @return string
*/ */
public function getTotal() public function getTotal()
{ {
return $this->total; return strval(round($this->total, 2));
} }
} }

View File

@@ -17,8 +17,8 @@ class Expense
{ {
/** @var Collection */ /** @var Collection */
protected $expenses; protected $expenses;
/** @var float */ /** @var string */
protected $total; protected $total = '0';
/** /**
* *
@@ -37,14 +37,15 @@ class Expense
$accountId = $entry->account_id; $accountId = $entry->account_id;
if (!$this->expenses->has($accountId)) { if (!$this->expenses->has($accountId)) {
$newObject = new stdClass; $newObject = new stdClass;
$newObject->amount = floatval($entry->queryAmount); $newObject->amount = strval(round($entry->amount, 2));
$newObject->name = $entry->name; $newObject->name = $entry->name;
$newObject->count = 1; $newObject->count = 1;
$newObject->id = $accountId; $newObject->id = $accountId;
$this->expenses->put($accountId, $newObject); $this->expenses->put($accountId, $newObject);
} else { } else {
$existing = $this->expenses->get($accountId); bcscale(2);
$existing->amount += floatval($entry->queryAmount); $existing = $this->expenses->get($accountId);
$existing->amount = bcadd($existing->amount, $entry->amount);
$existing->count++; $existing->count++;
$this->expenses->put($accountId, $existing); $this->expenses->put($accountId, $existing);
} }
@@ -55,7 +56,9 @@ class Expense
*/ */
public function addToTotal($add) public function addToTotal($add)
{ {
$this->total += floatval($add); $add = strval(round($add, 2));
bcscale(2);
$this->total = bcadd($this->total, $add);
} }
/** /**
@@ -63,7 +66,7 @@ class Expense
*/ */
public function getExpenses() public function getExpenses()
{ {
$this->expenses->sortBy( $this->expenses->sortByDesc(
function (stdClass $object) { function (stdClass $object) {
return $object->amount; return $object->amount;
} }
@@ -73,10 +76,10 @@ class Expense
} }
/** /**
* @return float * @return string
*/ */
public function getTotal() public function getTotal()
{ {
return $this->total; return strval(round($this->total, 2));
} }
} }

View File

@@ -38,14 +38,15 @@ class Income
$accountId = $entry->account_id; $accountId = $entry->account_id;
if (!$this->incomes->has($accountId)) { if (!$this->incomes->has($accountId)) {
$newObject = new stdClass; $newObject = new stdClass;
$newObject->amount = floatval($entry->queryAmount); $newObject->amount = strval(round($entry->amount, 2));
$newObject->name = $entry->name; $newObject->name = $entry->name;
$newObject->count = 1; $newObject->count = 1;
$newObject->id = $accountId; $newObject->id = $accountId;
$this->incomes->put($accountId, $newObject); $this->incomes->put($accountId, $newObject);
} else { } else {
$existing = $this->incomes->get($accountId); bcscale(2);
$existing->amount += floatval($entry->queryAmount); $existing = $this->incomes->get($accountId);
$existing->amount = bcadd($existing->amount, $entry->amount);
$existing->count++; $existing->count++;
$this->incomes->put($accountId, $existing); $this->incomes->put($accountId, $existing);
} }
@@ -56,7 +57,9 @@ class Income
*/ */
public function addToTotal($add) public function addToTotal($add)
{ {
$this->total += floatval($add); $add = strval(round($add, 2));
bcscale(2);
$this->total = bcadd($this->total, $add);
} }
/** /**
@@ -78,8 +81,8 @@ class Income
*/ */
public function getTotal() public function getTotal()
{ {
return $this->total; return strval(round($this->total, 2));
} }
} }

View File

@@ -37,7 +37,7 @@ class Help implements HelpInterface
*/ */
public function getFromGithub($route) public function getFromGithub($route)
{ {
$uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/' . e($route) . '.md'; $uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/en/' . e($route) . '.md';
$content = [ $content = [
'text' => '<p>There is no help for this route!</p>', 'text' => '<p>There is no help for this route!</p>',
'title' => $route, 'title' => $route,

View File

@@ -4,7 +4,6 @@ namespace FireflyIII\Helpers\Reminders;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankRepetition;
use FireflyIII\Models\Reminder; use FireflyIII\Models\Reminder;
/** /**

View File

@@ -33,6 +33,8 @@ class ReportHelper implements ReportHelperInterface
protected $query; protected $query;
/** /**
* @codeCoverageIgnore
*
* @param ReportQueryInterface $query * @param ReportQueryInterface $query
* *
*/ */
@@ -62,6 +64,15 @@ class ReportHelper implements ReportHelperInterface
$end = 0; $end = 0;
$diff = 0; $diff = 0;
// remove cash account, if any:
$accounts = $accounts->filter(
function (Account $account) {
if ($account->accountType->type != 'Cash account') {
return $account;
}
} // @codeCoverageIgnore
);
// summarize: // summarize:
foreach ($accounts as $account) { foreach ($accounts as $account) {
$start += $account->startBalance; $start += $account->startBalance;
@@ -129,7 +140,7 @@ class ReportHelper implements ReportHelperInterface
$balanceEntry->setAccount($account); $balanceEntry->setAccount($account);
// get spent: // get spent:
$spent = $this->query->spentInBudget($account, $budget, $start, $end); // I think shared is irrelevant. $spent = $this->query->spentInBudgetCorrected($account, $budget, $start, $end); // I think shared is irrelevant.
$balanceEntry->setSpent($spent); $balanceEntry->setSpent($spent);
$line->addBalanceEntry($balanceEntry); $line->addBalanceEntry($balanceEntry);
@@ -247,7 +258,7 @@ class ReportHelper implements ReportHelperInterface
// no repetition(s) for this budget: // no repetition(s) for this budget:
if ($repetitions->count() == 0) { if ($repetitions->count() == 0) {
$spent = $repository->spentInPeriod($budget, $start, $end, $shared); $spent = $repository->spentInPeriodCorrected($budget, $start, $end, $shared);
$budgetLine = new BudgetLine; $budgetLine = new BudgetLine;
$budgetLine->setBudget($budget); $budgetLine->setBudget($budget);
$budgetLine->setOverspent($spent); $budgetLine->setOverspent($spent);
@@ -262,7 +273,7 @@ class ReportHelper implements ReportHelperInterface
$budgetLine = new BudgetLine; $budgetLine = new BudgetLine;
$budgetLine->setBudget($budget); $budgetLine->setBudget($budget);
$budgetLine->setRepetition($repetition); $budgetLine->setRepetition($repetition);
$expenses = $repository->spentInPeriod($budget, $repetition->startdate, $repetition->enddate, $shared); $expenses = $repository->spentInPeriodCorrected($budget, $repetition->startdate, $repetition->enddate, $shared);
$left = $expenses < floatval($repetition->amount) ? floatval($repetition->amount) - $expenses : 0; $left = $expenses < floatval($repetition->amount) ? floatval($repetition->amount) - $expenses : 0;
$spent = $expenses > floatval($repetition->amount) ? 0 : $expenses; $spent = $expenses > floatval($repetition->amount) ? 0 : $expenses;
$overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0; $overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0;
@@ -311,7 +322,7 @@ class ReportHelper implements ReportHelperInterface
$repository = App::make('FireflyIII\Repositories\Category\CategoryRepositoryInterface'); $repository = App::make('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
$set = $repository->getCategories(); $set = $repository->getCategories();
foreach ($set as $category) { foreach ($set as $category) {
$spent = $repository->spentInPeriod($category, $start, $end, $shared); $spent = $repository->spentInPeriodCorrected($category, $start, $end, $shared);
$category->spent = $spent; $category->spent = $spent;
$object->addCategory($category); $object->addCategory($category);
$object->addTotal($spent); $object->addTotal($spent);
@@ -332,9 +343,9 @@ class ReportHelper implements ReportHelperInterface
public function getExpenseReport($start, $end, $shared) public function getExpenseReport($start, $end, $shared)
{ {
$object = new Expense; $object = new Expense;
$set = $this->query->expenseInPeriod($start, $end, $shared); $set = $this->query->expenseInPeriodCorrected($start, $end, $shared);
foreach ($set as $entry) { foreach ($set as $entry) {
$object->addToTotal($entry->queryAmount); $object->addToTotal($entry->amount);
$object->addOrCreateExpense($entry); $object->addOrCreateExpense($entry);
} }
@@ -353,9 +364,9 @@ class ReportHelper implements ReportHelperInterface
public function getIncomeReport($start, $end, $shared) public function getIncomeReport($start, $end, $shared)
{ {
$object = new Income; $object = new Income;
$set = $this->query->incomeInPeriod($start, $end, $shared); $set = $this->query->incomeInPeriodCorrected($start, $end, $shared);
foreach ($set as $entry) { foreach ($set as $entry) {
$object->addToTotal($entry->queryAmount); $object->addToTotal($entry->amount);
$object->addOrCreateIncome($entry); $object->addOrCreateIncome($entry);
} }

View File

@@ -5,12 +5,10 @@ namespace FireflyIII\Helpers\Report;
use Auth; use Auth;
use Carbon\Carbon; use Carbon\Carbon;
use Crypt; use Crypt;
use DB;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\JoinClause; use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Steam; use Steam;
@@ -22,12 +20,8 @@ use Steam;
*/ */
class ReportQuery implements ReportQueryInterface class ReportQuery implements ReportQueryInterface
{ {
/** /**
* This method returns all "expense" journals in a certain period, which are both transfers to a shared account * See ReportQueryInterface::incomeInPeriodCorrected
* and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
* not group and returns different fields.
* *
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
@@ -36,7 +30,7 @@ class ReportQuery implements ReportQueryInterface
* @return Collection * @return Collection
* *
*/ */
public function expenseInPeriod(Carbon $start, Carbon $end, $includeShared = false) public function expenseInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false)
{ {
$query = $this->queryJournalsWithTransactions($start, $end); $query = $this->queryJournalsWithTransactions($start, $end);
if ($includeShared === false) { if ($includeShared === false) {
@@ -59,19 +53,27 @@ class ReportQuery implements ReportQueryInterface
} else { } else {
$query->where('transaction_types.type', 'Withdrawal'); // any withdrawal is fine. $query->where('transaction_types.type', 'Withdrawal'); // any withdrawal is fine.
} }
$query->groupBy('transaction_journals.id')->orderBy('transaction_journals.date'); $query->orderBy('transaction_journals.date');
// get everything, decrypt and return // get everything
$data = $query->get(['transaction_journals.id', 'transaction_journals.description', 'transaction_journals.encrypted', 'transaction_types.type', $data = $query->get(
DB::Raw('SUM(`t_from`.`amount`) as `queryAmount`'), ['transaction_journals.*', 'transaction_types.type', 'ac_to.name as name', 'ac_to.id as account_id', 'ac_to.encrypted as account_encrypted']
'transaction_journals.date', 't_to.account_id as account_id', 'ac_to.name as name', 'ac_to.encrypted as account_encrypted']); );
$data->each( $data->each(
function (Model $object) { function (TransactionJournal $journal) {
$object->name = intval($object->account_encrypted) == 1 ? Crypt::decrypt($object->name) : $object->name; if (intval($journal->account_encrypted) == 1) {
$journal->name = Crypt::decrypt($journal->name);
}
} }
); );
$data->sortByDesc('queryAmount'); $data = $data->filter(
function (TransactionJournal $journal) {
if ($journal->amount != 0) {
return $journal;
}
} // @codeCoverageIgnore
);
return $data; return $data;
} }
@@ -127,6 +129,10 @@ class ReportQuery implements ReportQueryInterface
/** /**
* This method works the same way as ReportQueryInterface::incomeInPeriod does, but instead of returning results
* will simply list the transaction journals only. This should allow any follow up counting to be accurate with
* regards to tags.
*
* This method returns all "income" journals in a certain period, which are both transfers from a shared account * This method returns all "income" journals in a certain period, which are both transfers from a shared account
* and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does * and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
* not group and returns different fields. * not group and returns different fields.
@@ -137,7 +143,7 @@ class ReportQuery implements ReportQueryInterface
* *
* @return Collection * @return Collection
*/ */
public function incomeInPeriod(Carbon $start, Carbon $end, $includeShared = false) public function incomeInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false)
{ {
$query = $this->queryJournalsWithTransactions($start, $end); $query = $this->queryJournalsWithTransactions($start, $end);
if ($includeShared === false) { if ($includeShared === false) {
@@ -163,35 +169,34 @@ class ReportQuery implements ReportQueryInterface
// any deposit is fine. // any deposit is fine.
$query->where('transaction_types.type', 'Deposit'); $query->where('transaction_types.type', 'Deposit');
} }
$query->groupBy('transaction_journals.id')->orderBy('transaction_journals.date'); $query->orderBy('transaction_journals.date');
// get everything, decrypt and return // get everything
$data = $query->get( $data = $query->get(
['transaction_journals.id', ['transaction_journals.*', 'transaction_types.type', 'ac_from.name as name', 'ac_from.id as account_id', 'ac_from.encrypted as account_encrypted']
'transaction_journals.description',
'transaction_journals.encrypted',
'transaction_types.type',
DB::Raw('SUM(`t_to`.`amount`) as `queryAmount`'),
'transaction_journals.date',
't_from.account_id as account_id',
'ac_from.name as name',
'ac_from.encrypted as account_encrypted'
]
); );
$data->each( $data->each(
function (Model $object) { function (TransactionJournal $journal) {
$object->name = intval($object->account_encrypted) == 1 ? Crypt::decrypt($object->name) : $object->name; if (intval($journal->account_encrypted) == 1) {
$journal->name = Crypt::decrypt($journal->name);
}
} }
); );
$data->sortByDesc('queryAmount'); $data = $data->filter(
function (TransactionJournal $journal) {
if ($journal->amount != 0) {
return $journal;
}
} // @codeCoverageIgnore
);
return $data; return $data;
} }
/** /**
* Covers tags
*
* @param Account $account * @param Account $account
* @param Budget $budget * @param Budget $budget
* @param Carbon $start * @param Carbon $start
@@ -199,21 +204,20 @@ class ReportQuery implements ReportQueryInterface
* *
* @return float * @return float
*/ */
public function spentInBudget(Account $account, Budget $budget, Carbon $start, Carbon $end) public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end)
{ {
return floatval( return floatval(
Auth::user()->transactionjournals() Auth::user()->transactionjournals()
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
->transactionTypes(['Withdrawal']) ->transactionTypes(['Withdrawal'])
->where('transactions.amount', '<', 0) ->where('transactions.account_id', $account->id)
->where('transactions.account_id', $account->id) ->before($end)
->before($end) ->after($start)
->after($start) ->where('budget_transaction_journal.budget_id', $budget->id)
->where('budget_transaction_journal.budget_id', $budget->id) ->get(['transaction_journals.*'])->sum('amount')
->sum('transactions.amount') ) * -1;
);
} }
/** /**
@@ -230,13 +234,11 @@ class ReportQuery implements ReportQueryInterface
Auth::user()->transactionjournals() Auth::user()->transactionjournals()
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
->where('transactions.amount', '<', 0)
->transactionTypes(['Withdrawal']) ->transactionTypes(['Withdrawal'])
->where('transactions.account_id', $account->id) ->where('transactions.account_id', $account->id)
->before($end) ->before($end)
->after($start) ->after($start)
->whereNull('budget_transaction_journal.budget_id') ->whereNull('budget_transaction_journal.budget_id')->get(['transaction_journals.*'])->sum('amount')
->sum('transactions.amount')
); );
} }

View File

@@ -16,32 +16,8 @@ interface ReportQueryInterface
{ {
/** /**
* Get a users accounts combined with various meta-data related to the start and end date. * See ReportQueryInterface::incomeInPeriodCorrected
* *
* @param Carbon $start
* @param Carbon $end
* @param bool $includeShared
*
* @return Collection
*/
public function getAllAccounts(Carbon $start, Carbon $end, $includeShared = false);
/**
* This method returns all "income" journals in a certain period, which are both transfers from a shared account
* and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
* not group and returns different fields.
*
* @param Carbon $start
* @param Carbon $end
* @param bool $includeShared
*
* @return Collection
*
*/
public function incomeInPeriod(Carbon $start, Carbon $end, $includeShared = false);
/**
* This method returns all "expense" journals in a certain period, which are both transfers to a shared account * This method returns all "expense" journals in a certain period, which are both transfers to a shared account
* and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does * and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
* not group and returns different fields. * not group and returns different fields.
@@ -53,10 +29,35 @@ interface ReportQueryInterface
* @return Collection * @return Collection
* *
*/ */
public function expenseInPeriod(Carbon $start, Carbon $end, $includeShared = false); public function expenseInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false);
/** /**
* Get a users accounts combined with various meta-data related to the start and end date.
*
* @param Carbon $start
* @param Carbon $end
* @param bool $includeShared
*
* @return Collection
*/
public function getAllAccounts(Carbon $start, Carbon $end, $includeShared = false);
/**
* This method works the same way as ReportQueryInterface::incomeInPeriod does, but instead of returning results
* will simply list the transaction journals only. This should allow any follow up counting to be accurate with
* regards to tags.
*
* @param Carbon $start
* @param Carbon $end
* @param bool $includeShared
*
* @return Collection
*/
public function incomeInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false);
/**
* Covers tags as well.
*
* @param Account $account * @param Account $account
* @param Budget $budget * @param Budget $budget
* @param Carbon $start * @param Carbon $start
@@ -64,7 +65,7 @@ interface ReportQueryInterface
* *
* @return float * @return float
*/ */
public function spentInBudget(Account $account, Budget $budget, Carbon $start, Carbon $end); public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end);
/** /**
* @param Account $account * @param Account $account

View File

@@ -22,7 +22,7 @@ use View;
class AccountController extends Controller class AccountController extends Controller
{ {
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {
@@ -39,7 +39,7 @@ class AccountController extends Controller
public function create($what = 'asset') public function create($what = 'asset')
{ {
$subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what); $subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what);
$subTitle = 'Create a new ' . e($what) . ' account'; $subTitle = trans('firefly.make_new_' . $what . '_account');
// put previous url in session if not redirect from store (not "create another"). // put previous url in session if not redirect from store (not "create another").
if (Session::get('accounts.create.fromStore') !== true) { if (Session::get('accounts.create.fromStore') !== true) {
@@ -58,7 +58,8 @@ class AccountController extends Controller
*/ */
public function delete(Account $account) public function delete(Account $account)
{ {
$subTitle = 'Delete ' . strtolower(e($account->accountType->type)) . ' "' . e($account->name) . '"'; $typeName = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type);
$subTitle = trans('firefly.delete_' . $typeName . '_account', ['name' => $account->name]);
// put previous url in session // put previous url in session
Session::put('accounts.delete.url', URL::previous()); Session::put('accounts.delete.url', URL::previous());
@@ -81,7 +82,7 @@ class AccountController extends Controller
$repository->destroy($account); $repository->destroy($account);
Session::flash('success', 'The ' . e($typeName) . ' account "' . e($name) . '" was deleted.'); Session::flash('success', trans('firefly.' . $typeName . '_deleted', ['name' => $name]));
return Redirect::to(Session::get('accounts.delete.url')); return Redirect::to(Session::get('accounts.delete.url'));
} }
@@ -96,7 +97,7 @@ class AccountController extends Controller
{ {
$what = Config::get('firefly.shortNamesByFullName')[$account->accountType->type]; $what = Config::get('firefly.shortNamesByFullName')[$account->accountType->type];
$subTitle = 'Edit ' . strtolower(e($account->accountType->type)) . ' "' . e($account->name) . '"'; $subTitle = trans('firefly.edit_' . $what . '_account', ['name' => $account->name]);
$subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what); $subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what);
$openingBalance = $repository->openingBalanceTransaction($account); $openingBalance = $repository->openingBalanceTransaction($account);
@@ -170,7 +171,7 @@ class AccountController extends Controller
$subTitleIcon = Config::get('firefly.subTitlesByIdentifier.' . $account->accountType->type); $subTitleIcon = Config::get('firefly.subTitlesByIdentifier.' . $account->accountType->type);
$what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type);
$journals = $repository->getJournals($account, $page); $journals = $repository->getJournals($account, $page);
$subTitle = 'Details for ' . strtolower(e($account->accountType->type)) . ' "' . e($account->name) . '"'; $subTitle = trans('firefly.details_for_' . $what, ['name' => $account->name]);
$journals->setPath('accounts/show/' . $account->id); $journals->setPath('accounts/show/' . $account->id);

View File

@@ -36,6 +36,8 @@ class PasswordController extends Controller
* @param \Illuminate\Contracts\Auth\Guard $auth * @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords * @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
* *
* @codeCoverageIgnore
*
*/ */
public function __construct(Guard $auth, PasswordBroker $passwords) public function __construct(Guard $auth, PasswordBroker $passwords)
{ {

View File

@@ -3,11 +3,9 @@
use Config; use Config;
use FireflyIII\Http\Requests; use FireflyIII\Http\Requests;
use FireflyIII\Http\Requests\BillFormRequest; use FireflyIII\Http\Requests\BillFormRequest;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\Transaction; use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use Input; use Input;
use Redirect; use Redirect;
@@ -24,7 +22,7 @@ class BillController extends Controller
{ {
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {

View File

@@ -24,7 +24,7 @@ class BudgetController extends Controller
{ {
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {
@@ -60,7 +60,7 @@ class BudgetController extends Controller
Session::put('budgets.create.url', URL::previous()); Session::put('budgets.create.url', URL::previous());
} }
Session::forget('budgets.create.fromStore'); Session::forget('budgets.create.fromStore');
$subTitle = 'Create a new budget'; $subTitle = trans('firefly.create_new_budget');
return view('budgets.create', compact('subTitle')); return view('budgets.create', compact('subTitle'));
} }
@@ -138,7 +138,7 @@ class BudgetController extends Controller
function (Budget $budget) use ($repository) { function (Budget $budget) use ($repository) {
$date = Session::get('start', Carbon::now()->startOfMonth()); $date = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth());
$budget->spent = $repository->spentInPeriod($budget, $date, $end); $budget->spent = $repository->spentInPeriodCorrected($budget, $date, $end);
$budget->currentRep = $repository->getCurrentRepetition($budget, $date); $budget->currentRep = $repository->getCurrentRepetition($budget, $date);
} }
); );

View File

@@ -21,7 +21,7 @@ class CategoryController extends Controller
{ {
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {

View File

@@ -147,4 +147,4 @@ class AccountController extends Controller
return Response::json($chart->getData()); return Response::json($chart->getData());
} }
} }

View File

@@ -4,7 +4,6 @@ namespace FireflyIII\Http\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@@ -138,4 +137,4 @@ class BillController extends Controller
return Response::json($chart->getData()); return Response::json($chart->getData());
} }
} }

View File

@@ -9,6 +9,8 @@ use FireflyIII\Models\LimitRepetition;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Grumpydictator\Gchart\GChart; use Grumpydictator\Gchart\GChart;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Navigation;
use Preferences;
use Response; use Response;
use Session; use Session;
@@ -19,6 +21,39 @@ use Session;
*/ */
class BudgetController extends Controller class BudgetController extends Controller
{ {
/**
* @param GChart $chart
* @param BudgetRepositoryInterface $repository
* @param Budget $budget
*/
public function budget(GChart $chart, BudgetRepositoryInterface $repository, Budget $budget)
{
$chart->addColumn(trans('firefly.period'), 'date');
$chart->addColumn(trans('firefly.spent'), 'number');
$first = $repository->getFirstBudgetLimitDate($budget);
$range = Preferences::get('viewRange', '1M')->data;
$last = Session::get('end', new Carbon);
$final = clone $last;
$final->addYears(2);
$last = Navigation::endOfX($last, $range, $final);
while ($first < $last) {
$end = Navigation::addPeriod($first, $range, 0);
$spent = $repository->spentInPeriodCorrected($budget, $first, $end);
$chart->addRow($end, $spent);
$first = Navigation::addPeriod($first, $range, 0);
}
$chart->generate();
return Response::json($chart->getData());
}
/** /**
* Shows the amount left in a specific budget limit. * Shows the amount left in a specific budget limit.
* *
@@ -44,7 +79,7 @@ class BudgetController extends Controller
/* /*
* Sum of expenses on this day: * Sum of expenses on this day:
*/ */
$sum = $repository->expensesOnDay($budget, $start); $sum = $repository->expensesOnDayCorrected($budget, $start);
$amount += $sum; $amount += $sum;
$chart->addRow(clone $start, $amount); $chart->addRow(clone $start, $amount);
$start->addDay(); $start->addDay();
@@ -78,15 +113,15 @@ class BudgetController extends Controller
foreach ($budgets as $budget) { foreach ($budgets as $budget) {
$repetitions = $repository->getBudgetLimitRepetitions($budget, $start, $end); $repetitions = $repository->getBudgetLimitRepetitions($budget, $start, $end);
if ($repetitions->count() == 0) { if ($repetitions->count() == 0) {
$expenses = $repository->spentInPeriod($budget, $start, $end, true); $expenses = $repository->spentInPeriodCorrected($budget, $start, $end, true);
$allEntries->push([$budget->name, 0, 0, $expenses]); $allEntries->push([$budget->name, 0, 0, $expenses]);
continue; continue;
} }
/** @var LimitRepetition $repetition */ /** @var LimitRepetition $repetition */
foreach ($repetitions as $repetition) { foreach ($repetitions as $repetition) {
$expenses = $repository->spentInPeriod($budget, $repetition->startdate, $repetition->enddate, true); $expenses = $repository->spentInPeriodCorrected($budget, $repetition->startdate, $repetition->enddate, true);
$left = $expenses < floatval($repetition->amount) ? floatval($repetition->amount) - $expenses : 0; $left = $expenses < floatval($repetition->amount) ? floatval($repetition->amount) - $expenses : 0;
$spent = $expenses > floatval($repetition->amount) ? 0 : $expenses; $spent = $expenses > floatval($repetition->amount) ? floatval($repetition->amount) : $expenses;
$overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0; $overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0;
$allEntries->push( $allEntries->push(
[$budget->name . ' (' . $repetition->startdate->formatLocalized($this->monthAndDayFormat) . ')', [$budget->name . ' (' . $repetition->startdate->formatLocalized($this->monthAndDayFormat) . ')',
@@ -145,7 +180,7 @@ class BudgetController extends Controller
// each budget, fill the row: // each budget, fill the row:
foreach ($budgets as $budget) { foreach ($budgets as $budget) {
$spent = $repository->spentInPeriod($budget, $start, $month, $shared); $spent = $repository->spentInPeriodCorrected($budget, $start, $month, $shared);
$row[] = $spent; $row[] = $spent;
} }
$chart->addRowArray($row); $chart->addRowArray($row);
@@ -157,4 +192,4 @@ class BudgetController extends Controller
return Response::json($chart->getData()); return Response::json($chart->getData());
} }
} }

View File

@@ -4,11 +4,8 @@ namespace FireflyIII\Http\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;
use Crypt;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\Preference;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use Grumpydictator\Gchart\GChart; use Grumpydictator\Gchart\GChart;
use Navigation; use Navigation;
@@ -50,7 +47,7 @@ class CategoryController extends Controller
while ($start <= $end) { while ($start <= $end) {
$currentEnd = Navigation::endOfPeriod($start, $range); $currentEnd = Navigation::endOfPeriod($start, $range);
$spent = $repository->spentInPeriod($category, $start, $currentEnd); $spent = $repository->spentInPeriodCorrected($category, $start, $currentEnd);
$chart->addRow(clone $start, $spent); $chart->addRow(clone $start, $spent);
$start = Navigation::addPeriod($start, $range, 0); $start = Navigation::addPeriod($start, $range, 0);
@@ -78,13 +75,26 @@ class CategoryController extends Controller
$start = Session::get('start', Carbon::now()->startOfMonth()); $start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth());
$set = $repository->getCategoriesAndExpenses($start, $end); $set = $repository->getCategoriesAndExpensesCorrected($start, $end);
// sort by callback:
uasort(
$set,
function ($left, $right) {
if ($left['sum'] == $right['sum']) {
return 0;
}
return ($left['sum'] < $right['sum']) ? 1 : -1;
}
);
foreach ($set as $entry) { foreach ($set as $entry) {
$isEncrypted = intval($entry->encrypted) == 1 ? true : false; $sum = floatval($entry['sum']);
$name = strlen($entry->name) == 0 ? trans('firefly.noCategory') : $entry->name; if ($sum != 0) {
$name = $isEncrypted ? Crypt::decrypt($name) : $name; $chart->addRow($entry['name'], $sum);
$chart->addRow($name, floatval($entry->sum)); }
} }
$chart->generate(); $chart->generate();
@@ -109,7 +119,7 @@ class CategoryController extends Controller
$chart->addColumn(trans('firefly.spent'), 'number'); $chart->addColumn(trans('firefly.spent'), 'number');
while ($start <= $end) { while ($start <= $end) {
$spent = $repository->spentOnDaySum($category, $start); $spent = $repository->spentOnDaySumCorrected($category, $start);
$chart->addRow(clone $start, $spent); $chart->addRow(clone $start, $spent);
$start->addDay(); $start->addDay();
} }
@@ -153,7 +163,7 @@ class CategoryController extends Controller
// each budget, fill the row: // each budget, fill the row:
foreach ($categories as $category) { foreach ($categories as $category) {
$spent = $repository->spentInPeriod($category, $start, $month, $shared); $spent = $repository->spentInPeriodCorrected($category, $start, $month, $shared);
$row[] = $spent; $row[] = $spent;
} }
$chart->addRowArray($row); $chart->addRowArray($row);
@@ -165,4 +175,4 @@ class CategoryController extends Controller
return Response::json($chart->getData()); return Response::json($chart->getData());
} }
} }

View File

@@ -1,19 +1,10 @@
<?php <?php
/**
* Created by PhpStorm.
* User: sander
* Date: 16/05/15
* Time: 09:36
*/
namespace FireflyIII\Http\Controllers\Chart; namespace FireflyIII\Http\Controllers\Chart;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill;
use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use Grumpydictator\Gchart\GChart; use Grumpydictator\Gchart\GChart;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
@@ -55,4 +46,4 @@ class PiggyBankController extends Controller
return Response::json($chart->getData()); return Response::json($chart->getData());
} }
} }

View File

@@ -43,8 +43,8 @@ class ReportController extends Controller
$month = clone $start; $month = clone $start;
$month->endOfMonth(); $month->endOfMonth();
// total income and total expenses: // total income and total expenses:
$incomeSum = floatval($query->incomeInPeriod($start, $month, $shared)->sum('queryAmount')); $incomeSum = floatval($query->incomeInPeriodCorrected($start, $month, $shared)->sum('amount'));
$expenseSum = floatval($query->expenseInPeriod($start, $month, $shared)->sum('queryAmount')) * -1; $expenseSum = floatval($query->expenseInPeriodCorrected($start, $month, $shared)->sum('amount'));
$chart->addRow(clone $start, $incomeSum, $expenseSum); $chart->addRow(clone $start, $incomeSum, $expenseSum);
$start->addMonth(); $start->addMonth();
@@ -82,8 +82,8 @@ class ReportController extends Controller
$month = clone $start; $month = clone $start;
$month->endOfMonth(); $month->endOfMonth();
// total income and total expenses: // total income and total expenses:
$income += floatval($query->incomeInPeriod($start, $month, $shared)->sum('queryAmount')); $income += floatval($query->incomeInPeriodCorrected($start, $month, $shared)->sum('amount'));
$expense += floatval($query->expenseInPeriod($start, $month, $shared)->sum('queryAmount')) * -1; $expense += floatval($query->expenseInPeriodCorrected($start, $month, $shared)->sum('amount'));
$count++; $count++;
$start->addMonth(); $start->addMonth();
} }
@@ -98,4 +98,4 @@ class ReportController extends Controller
return Response::json($chart->getData()); return Response::json($chart->getData());
} }
} }

View File

@@ -24,7 +24,7 @@ abstract class Controller extends BaseController
protected $monthFormat; protected $monthFormat;
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {

View File

@@ -23,7 +23,7 @@ class CurrencyController extends Controller
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {

View File

@@ -6,6 +6,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Input; use Input;
use Preferences; use Preferences;
use Redirect; use Redirect;
use Route;
use Session; use Session;
use Steam; use Steam;
@@ -87,5 +88,78 @@ class HomeController extends Controller
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts')); return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts'));
} }
/**
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function routes()
{
$directory = '/vagrant_data/Sites/firefly-iii-help';
$languages = array_keys(Config::get('firefly.lang'));
$routes = [];
$ignored = [
'debugbar.openhandler', 'debugbar.assets.css', 'debugbar.assets.js', 'register', 'routes', 'daterange',
'flush', 'delete-account-post', 'change-password-post', 'logout', 'login', 'tags.hideTagHelp',
'budgets.postIncome', 'flush'
];
$ignoreMatch = ['.store', '.update', '.destroy', 'json.'];
$routeCollection = Route::getRoutes();
/** @var \Illuminate\Routing\Route $object */
foreach ($routeCollection as $object) {
// get name:
$name = $object->getName();
// has name and not in ignore list?
if (strlen($name) > 0 && !in_array($name, $ignored)) {
// not in ignoreMatch?
$continue = true;
foreach ($ignoreMatch as $ignore) {
$match = strpos($name, $ignore);
if (!($match === false)) {
$continue = false;
}
}
unset($ignore, $match);
if ($continue) {
$routes[] = $name;
// check all languages:
foreach ($languages as $lang) {
$file = $directory . '/' . $lang . '/' . $name . '.md';
if (!file_exists($file)) {
touch($file);
echo $name . '<br />';
}
}
}
}
}
// loop directories with language file.
// tag the ones not in the list of approved routes.
foreach ($languages as $lang) {
$dir = $directory . '/' . $lang;
$set = scandir($dir);
foreach ($set as $entry) {
if ($entry != '.' && $entry != '..') {
$name = str_replace('.md', '', $entry);
if (!in_array($name, $routes)) {
$file = $dir . '/' . $entry;
unlink($file);
}
}
}
}
echo 'Done!';
}
} }

View File

@@ -5,7 +5,6 @@ use Carbon\Carbon;
use FireflyIII\Helpers\Report\ReportQueryInterface; use FireflyIII\Helpers\Report\ReportQueryInterface;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\Preference;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
@@ -122,7 +121,7 @@ class JsonController extends Controller
{ {
$start = Session::get('start', Carbon::now()->startOfMonth()); $start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth());
$amount = $reportQuery->incomeInPeriod($start, $end, true)->sum('queryAmount'); $amount = $reportQuery->incomeInPeriodCorrected($start, $end, true)->sum('amount');
return Response::json(['box' => 'in', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]); return Response::json(['box' => 'in', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]);
} }
@@ -136,7 +135,7 @@ class JsonController extends Controller
{ {
$start = Session::get('start', Carbon::now()->startOfMonth()); $start = Session::get('start', Carbon::now()->startOfMonth());
$end = Session::get('end', Carbon::now()->endOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth());
$amount = $reportQuery->expenseInPeriod($start, $end, true)->sum('queryAmount') * -1; $amount = $reportQuery->expenseInPeriodCorrected($start, $end, true)->sum('amount');
return Response::json(['box' => 'out', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]); return Response::json(['box' => 'out', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]);
} }

View File

@@ -26,7 +26,7 @@ class PiggyBankController extends Controller
{ {
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {

View File

@@ -17,7 +17,7 @@ class PreferencesController extends Controller
{ {
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {

View File

@@ -3,10 +3,6 @@
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Helpers\Report\ReportHelperInterface;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\Budget;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\Preference;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Session; use Session;
use View; use View;
@@ -23,6 +19,8 @@ class ReportController extends Controller
protected $helper; protected $helper;
/** /**
* @codeCoverageIgnore
*
* @param ReportHelperInterface $helper * @param ReportHelperInterface $helper
*/ */
public function __construct(ReportHelperInterface $helper) public function __construct(ReportHelperInterface $helper)

View File

@@ -32,7 +32,7 @@ use View;
class TagController extends Controller class TagController extends Controller
{ {
/** /**
* * @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {
@@ -133,7 +133,7 @@ class TagController extends Controller
* changes to an advancePayment. * changes to an advancePayment.
*/ */
if ($tag->tagMode == 'balancingAct') { if ($tag->tagMode == 'balancingAct' || $tag->tagMode == 'nothing') {
foreach ($tag->transactionjournals as $journal) { foreach ($tag->transactionjournals as $journal) {
if ($journal->transactionType->type == 'Transfer') { if ($journal->transactionType->type == 'Transfer') {
$allowToAdvancePayment = false; $allowToAdvancePayment = false;

View File

@@ -26,6 +26,7 @@ use View;
class TransactionController extends Controller class TransactionController extends Controller
{ {
/** /**
* @codeCoverageIgnore
*/ */
public function __construct() public function __construct()
{ {
@@ -149,7 +150,7 @@ class TransactionController extends Controller
$preFilled['piggy_bank_id'] = $journal->piggyBankEvents()->orderBy('date', 'DESC')->first()->piggy_bank_id; $preFilled['piggy_bank_id'] = $journal->piggyBankEvents()->orderBy('date', 'DESC')->first()->piggy_bank_id;
} }
$preFilled['amount'] = $journal->amount; $preFilled['amount'] = $journal->actualAmount;
$preFilled['account_id'] = $journal->assetAccount->id; $preFilled['account_id'] = $journal->assetAccount->id;
$preFilled['expense_account'] = $transactions[0]->account->name; $preFilled['expense_account'] = $transactions[0]->account->name;
$preFilled['revenue_account'] = $transactions[1]->account->name; $preFilled['revenue_account'] = $transactions[1]->account->name;

View File

@@ -37,8 +37,8 @@ class Kernel extends HttpKernel
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'FireflyIII\Http\Middleware\RedirectIfAuthenticated', 'guest' => 'FireflyIII\Http\Middleware\RedirectIfAuthenticated',
'range' => 'FireflyIII\Http\Middleware\Range', 'range' => 'FireflyIII\Http\Middleware\Range',
'cleanup' => 'FireflyIII\Http\Middleware\Cleanup',
'reminders' => 'FireflyIII\Http\Middleware\Reminders', 'reminders' => 'FireflyIII\Http\Middleware\Reminders',
'piggybanks' => 'FireflyIII\Http\Middleware\PiggyBanks',
]; ];

View File

@@ -3,7 +3,6 @@
use App; use App;
use Closure; use Closure;
use Config; use Config;
use FireflyIII\Models\Preference;
use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Preferences; use Preferences;

View File

@@ -0,0 +1,186 @@
<?php namespace FireflyIII\Http\Middleware;
use Closure;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\Category;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Models\PiggyBankRepetition;
use FireflyIII\Models\Preference;
use FireflyIII\Models\Reminder;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
use Session;
/**
* Class Cleanup
*
* @codeCoverageIgnore
* @package FireflyIII\Http\Middleware
*/
class Cleanup
{
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
*
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
if ($this->auth->guest()) {
if ($request->ajax()) {
return response('Unauthorized.', 401);
} else {
return redirect()->guest('auth/login');
}
}
$run = env('RUNCLEANUP') == 'true' ? true : false;
$count = 0;
if ($run) {
// encrypt account name
$set = Account::where('encrypted', 0)->take(5)->get();
/** @var Account $entry */
foreach ($set as $entry) {
$count++;
$name = $entry->name;
$entry->name = $name;
$entry->save();
}
unset($set, $entry, $name);
// encrypt bill name
$set = Bill::where('name_encrypted', 0)->take(5)->get();
/** @var Bill $entry */
foreach ($set as $entry) {
$count++;
$name = $entry->name;
$entry->name = $name;
$entry->save();
}
unset($set, $entry, $name);
// encrypt bill match
$set = Bill::where('match_encrypted', 0)->take(5)->get();
/** @var Bill $entry */
foreach ($set as $entry) {
$match = $entry->match;
$entry->match = $match;
$entry->save();
}
unset($set, $entry, $match);
// encrypt budget name
$set = Budget::where('encrypted', 0)->take(5)->get();
/** @var Budget $entry */
foreach ($set as $entry) {
$count++;
$name = $entry->name;
$entry->name = $name;
$entry->save();
}
unset($set, $entry, $name);
// encrypt category name
$set = Category::where('encrypted', 0)->take(5)->get();
/** @var Category $entry */
foreach ($set as $entry) {
$count++;
$name = $entry->name;
$entry->name = $name;
$entry->save();
}
unset($set, $entry, $name);
// encrypt piggy bank name
$set = PiggyBank::where('encrypted', 0)->take(5)->get();
/** @var PiggyBank $entry */
foreach ($set as $entry) {
$count++;
$name = $entry->name;
$entry->name = $name;
$entry->save();
}
unset($set, $entry, $name);
// encrypt transaction journal description
$set = TransactionJournal::where('encrypted', 0)->take(5)->get();
/** @var TransactionJournal $entry */
foreach ($set as $entry) {
$count++;
$description = $entry->description;
$entry->description = $description;
$entry->save();
}
unset($set, $entry, $description);
// encrypt reminder metadata
$set = Reminder::where('encrypted', 0)->take(5)->get();
/** @var Reminder $entry */
foreach ($set as $entry) {
$count++;
$metadata = $entry->metadata;
$entry->metadata = $metadata;
$entry->save();
}
unset($set, $entry, $metadata);
//encrypt preference name
$set = Preference::whereNull('name_encrypted')->take(5)->get();
/** @var Preference $entry */
foreach ($set as $entry) {
$count++;
$name = $entry->name;
$entry->name = $name;
$entry->save();
}
unset($set, $entry, $name);
//encrypt preference data
$set = Preference::whereNull('data_encrypted')->take(5)->get();
/** @var Preference $entry */
foreach ($set as $entry) {
$count++;
$data = $entry->data;
$entry->data = $data;
$entry->save();
}
unset($set, $entry, $data);
}
if ($count == 0 && $run) {
Session::flash('warning', 'Please open the .env file and change RUNCLEANUP=true to RUNCLEANUP=false');
}
return $next($request);
}
}

View File

@@ -1,70 +0,0 @@
<?php
namespace FireflyIII\Http\Middleware;
use Closure;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankRepetition;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
/**
* Class PiggyBanks
*
* @package FireflyIII\Http\Middleware
*/
class PiggyBanks
{
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
*
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
if ($this->auth->check() && !$request->isXmlHttpRequest()) {
// get piggy banks without a repetition:
/** @var Collection $set */
$set = $this->auth->user()->piggybanks()
->leftJoin('piggy_bank_repetitions', 'piggy_banks.id', '=', 'piggy_bank_repetitions.piggy_bank_id')
->whereNull('piggy_bank_repetitions.id')
->get(['piggy_banks.id', 'piggy_banks.startdate', 'piggy_banks.targetdate']);
/** @var PiggyBank $partialPiggy */
foreach ($set as $partialPiggy) {
$repetition = new PiggyBankRepetition;
$repetition->piggyBank()->associate($partialPiggy);
$repetition->startdate = $partialPiggy->startdate;
$repetition->targetdate = $partialPiggy->targetdate;
$repetition->currentamount = 0;
$repetition->save();
}
unset($partialPiggy, $set, $repetition);
}
return $next($request);
}
}

View File

@@ -55,10 +55,10 @@ class Range
if (!Session::has('start') && !Session::has('end')) { if (!Session::has('start') && !Session::has('end')) {
/** @var \FireflyIII\Models\Preference $viewRange */ /** @var \FireflyIII\Models\Preference $viewRange */
$viewRange = Preferences::get('viewRange', '1M'); $viewRange = Preferences::get('viewRange', '1M')->data;
$start = new Carbon; $start = new Carbon;
$start = Navigation::updateStartDate($viewRange->data, $start); $start = Navigation::updateStartDate($viewRange, $start);
$end = Navigation::updateEndDate($viewRange->data, $start); $end = Navigation::updateEndDate($viewRange, $start);
Session::put('start', $start); Session::put('start', $start);
Session::put('end', $end); Session::put('end', $end);
@@ -73,9 +73,9 @@ class Range
Session::put('first', Carbon::now()->startOfYear()); Session::put('first', Carbon::now()->startOfYear());
} }
} }
$current = Carbon::now()->format('F Y'); $current = Carbon::now()->formatLocalized('%B %Y');
$next = Carbon::now()->endOfMonth()->addDay()->format('F Y'); $next = Carbon::now()->endOfMonth()->addDay()->formatLocalized('%B %Y');
$prev = Carbon::now()->startOfMonth()->subDay()->format('F Y'); $prev = Carbon::now()->startOfMonth()->subDay()->formatLocalized('%B %Y');
View::share('currentMonthName', $current); View::share('currentMonthName', $current);
View::share('previousMonthName', $prev); View::share('previousMonthName', $prev);
View::share('nextMonthName', $next); View::share('nextMonthName', $next);

View File

@@ -1,11 +1,4 @@
<?php <?php
/**
* Created by PhpStorm.
* User: sander
* Date: 27/04/15
* Time: 12:50
*/
namespace FireflyIII\Http\Requests; namespace FireflyIII\Http\Requests;
use Auth; use Auth;

View File

@@ -1,7 +1,6 @@
<?php <?php
use Carbon\Carbon; use Carbon\Carbon;
use DaveJamesMiller\Breadcrumbs\Generator; use DaveJamesMiller\Breadcrumbs\Generator;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
@@ -50,25 +49,10 @@ Breadcrumbs::register(
Breadcrumbs::register( Breadcrumbs::register(
'accounts.show', function (Generator $breadcrumbs, Account $account) { 'accounts.show', function (Generator $breadcrumbs, Account $account) {
switch ($account->accountType->type) {
default: $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type);
throw new FireflyException('Cannot handle account type "' . e($account->accountType->type) . '"');
break;
case 'Default account':
case 'Asset account':
$what = 'asset';
break;
case 'Cash account':
$what = 'cash';
break;
case 'Expense account':
case 'Beneficiary account':
$what = 'expense';
break;
case 'Revenue account':
$what = 'revenue';
break;
}
$breadcrumbs->parent('accounts.index', $what); $breadcrumbs->parent('accounts.index', $what);
$breadcrumbs->push(e($account->name), route('accounts.show', $account->id)); $breadcrumbs->push(e($account->name), route('accounts.show', $account->id));
} }
@@ -84,7 +68,9 @@ Breadcrumbs::register(
Breadcrumbs::register( Breadcrumbs::register(
'accounts.edit', function (Generator $breadcrumbs, Account $account) { 'accounts.edit', function (Generator $breadcrumbs, Account $account) {
$breadcrumbs->parent('accounts.show', $account); $breadcrumbs->parent('accounts.show', $account);
$breadcrumbs->push(trans('breadcrumbs.edit_account', ['name' => e($account->name)]), route('accounts.edit', $account->id)); $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type);
$breadcrumbs->push(trans('breadcrumbs.edit_' . $what . '_account', ['name' => e($account->name)]), route('accounts.edit', $account->id));
} }
); );

View File

@@ -188,18 +188,19 @@ 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',
] ]
); );
Route::get('/routes', ['uses' => 'HomeController@routes', 'as' => 'routes']);
/** /**
* Home Controller * Home Controller
*/ */
Route::group( Route::group(
['middleware' => ['auth', 'range', 'reminders', 'piggybanks']], function () { ['middleware' => ['auth', 'range', 'reminders']], function () {
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']); Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index', 'middleware' => 'cleanup']);
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']);
@@ -276,7 +277,9 @@ Route::group(
*/ */
// accounts: // accounts:
Route::get('/chart/account/frontpage', ['uses' => 'Chart\AccountController@frontpage']); Route::get('/chart/account/frontpage', ['uses' => 'Chart\AccountController@frontpage']);
Route::get('/chart/account/month/{year}/{month}/{shared?}', ['uses' => 'Chart\AccountController@all'])->where(['year' => '[0-9]{4}', 'month' => '[0-9]{1,2}', 'shared' => 'shared']); Route::get('/chart/account/month/{year}/{month}/{shared?}', ['uses' => 'Chart\AccountController@all'])->where(
['year' => '[0-9]{4}', 'month' => '[0-9]{1,2}', 'shared' => 'shared']
);
Route::get('/chart/account/{account}', ['uses' => 'Chart\AccountController@single']); Route::get('/chart/account/{account}', ['uses' => 'Chart\AccountController@single']);
@@ -288,6 +291,7 @@ Route::group(
Route::get('/chart/budget/frontpage', ['uses' => 'Chart\BudgetController@frontpage']); Route::get('/chart/budget/frontpage', ['uses' => 'Chart\BudgetController@frontpage']);
Route::get('/chart/budget/year/{year}/{shared?}', ['uses' => 'Chart\BudgetController@year'])->where(['year' => '[0-9]{4}', 'shared' => 'shared']); Route::get('/chart/budget/year/{year}/{shared?}', ['uses' => 'Chart\BudgetController@year'])->where(['year' => '[0-9]{4}', 'shared' => 'shared']);
Route::get('/chart/budget/{budget}/{limitrepetition}', ['uses' => 'Chart\BudgetController@budgetLimit']); Route::get('/chart/budget/{budget}/{limitrepetition}', ['uses' => 'Chart\BudgetController@budgetLimit']);
Route::get('/chart/budget/{budget}', ['uses' => 'Chart\BudgetController@budget']);
// categories: // categories:
Route::get('/chart/category/frontpage', ['uses' => 'Chart\CategoryController@frontpage']); Route::get('/chart/category/frontpage', ['uses' => 'Chart\CategoryController@frontpage']);
@@ -367,7 +371,6 @@ Route::group(
* Report Controller * Report Controller
*/ */
Route::get('/reports', ['uses' => 'ReportController@index', 'as' => 'reports.index']); Route::get('/reports', ['uses' => 'ReportController@index', 'as' => 'reports.index']);
//Route::get('/reports/{year}', ['uses' => 'ReportController@year', 'as' => 'reports.year'])->where(['year' => '[0-9]{4}']);
Route::get('/reports/{year}/{shared?}', ['uses' => 'ReportController@year', 'as' => 'reports.year'])->where(['year' => '[0-9]{4}', 'shared' => 'shared']); Route::get('/reports/{year}/{shared?}', ['uses' => 'ReportController@year', 'as' => 'reports.year'])->where(['year' => '[0-9]{4}', 'shared' => 'shared']);
Route::get('/reports/{year}/{month}/{shared?}', ['uses' => 'ReportController@month', 'as' => 'reports.month'])->where( Route::get('/reports/{year}/{month}/{shared?}', ['uses' => 'ReportController@month', 'as' => 'reports.month'])->where(
['year' => '[0-9]{4}', 'month' => '[0-9]{1,2}', 'shared' => 'shared'] ['year' => '[0-9]{4}', 'month' => '[0-9]{1,2}', 'shared' => 'shared']

View File

@@ -1,6 +1,5 @@
<?php namespace FireflyIII\Models; <?php namespace FireflyIII\Models;
use App;
use Crypt; use Crypt;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
@@ -18,6 +17,7 @@ class Account extends Model
use SoftDeletes, ValidatingTrait; use SoftDeletes, ValidatingTrait;
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance']; protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance'];
protected $hidden = ['virtual_balance_encrypted', 'encrypted'];
protected $rules protected $rules
= [ = [
'user_id' => 'required|exists:users,id', 'user_id' => 'required|exists:users,id',
@@ -50,12 +50,6 @@ class Account extends Model
} }
// create it! // create it!
$account = Account::create($fields); $account = Account::create($fields);
if (is_null($account->id)) {
// could not create account:
App::abort(500, 'Could not create new account with data: ' . json_encode($fields) . ' because ' . json_encode($account->getErrors()));
}
return $account; return $account;
@@ -117,6 +111,8 @@ class Account extends Model
* *
* @param $fieldName * @param $fieldName
* *
* @codeCoverageIgnore
*
* @return string|null * @return string|null
*/ */
public function getMeta($fieldName) public function getMeta($fieldName)
@@ -145,9 +141,7 @@ class Account extends Model
return Crypt::decrypt($value); return Crypt::decrypt($value);
} }
// @codeCoverageIgnoreStart
return $value; return $value;
// @codeCoverageIgnoreEnd
} }
/** /**
@@ -203,6 +197,16 @@ class Account extends Model
$this->attributes['encrypted'] = true; $this->attributes['encrypted'] = true;
} }
/**
* @param $value
*
* @codeCoverageIgnore
*/
public function setVirtualBalanceAttribute($value)
{
$this->attributes['virtual_balance'] = strval(round($value, 2));
}
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\HasMany * @return \Illuminate\Database\Eloquent\Relations\HasMany

View File

@@ -4,6 +4,7 @@ use Crypt;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
/** /**
* @codeCoverageIgnore
* Class Bill * Class Bill
* *
* @package FireflyIII\Models * @package FireflyIII\Models
@@ -14,6 +15,8 @@ class Bill extends Model
protected $fillable protected $fillable
= ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',]; = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',];
protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted'];
/** /**
* @return array * @return array
*/ */
@@ -34,9 +37,7 @@ class Bill extends Model
return Crypt::decrypt($value); return Crypt::decrypt($value);
} }
// @codeCoverageIgnoreStart
return $value; return $value;
// @codeCoverageIgnoreEnd
} }
/** /**
@@ -51,9 +52,23 @@ class Bill extends Model
return Crypt::decrypt($value); return Crypt::decrypt($value);
} }
// @codeCoverageIgnoreStart
return $value; return $value;
// @codeCoverageIgnoreEnd }
/**
* @param $value
*/
public function setAmountMaxAttribute($value)
{
$this->attributes['amount_max'] = strval(round($value, 2));
}
/**
* @param $value
*/
public function setAmountMinAttribute($value)
{
$this->attributes['amount_min'] = strval(round($value, 2));
} }
/** /**

View File

@@ -15,7 +15,8 @@ class Budget extends Model
use SoftDeletes; use SoftDeletes;
protected $fillable = ['user_id', 'name']; protected $fillable = ['user_id', 'name', 'active'];
protected $hidden = ['encrypted'];
/** /**
* *
@@ -46,9 +47,7 @@ class Budget extends Model
return Crypt::decrypt($value); return Crypt::decrypt($value);
} }
// @codeCoverageIgnoreStart
return $value; return $value;
// @codeCoverageIgnoreEnd
} }
/** /**

View File

@@ -11,6 +11,8 @@ use Illuminate\Database\Eloquent\Model;
class BudgetLimit extends Model class BudgetLimit extends Model
{ {
protected $hidden = ['amount_encrypted'];
/** /**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
@@ -35,4 +37,12 @@ class BudgetLimit extends Model
return $this->hasMany('FireflyIII\Models\LimitRepetition'); return $this->hasMany('FireflyIII\Models\LimitRepetition');
} }
/**
* @param $value
*/
public function setAmountAttribute($value)
{
$this->attributes['amount'] = strval(round($value, 2));
}
} }

View File

@@ -1,6 +1,5 @@
<?php namespace FireflyIII\Models; <?php namespace FireflyIII\Models;
use App;
use Crypt; use Crypt;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
@@ -16,24 +15,7 @@ class Category extends Model
use SoftDeletes; use SoftDeletes;
protected $fillable = ['user_id', 'name']; protected $fillable = ['user_id', 'name'];
protected $hidden = ['encrypted'];
/**
* @codeCoverageIgnore
* @return array
*/
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function transactionjournals()
{
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
}
/** /**
* @param array $fields * @param array $fields
@@ -59,11 +41,6 @@ class Category extends Model
} }
// create it! // create it!
$category = Category::create($fields); $category = Category::create($fields);
if (is_null($category->id)) {
// could not create account:
App::abort(500, 'Could not create new category with data: ' . json_encode($fields));
}
return $category; return $category;
@@ -71,22 +48,11 @@ class Category extends Model
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo * @return array
*/ */
public function user() public function getDates()
{ {
return $this->belongsTo('FireflyIII\User'); return ['created_at', 'updated_at', 'deleted_at'];
}
/**
* @codeCoverageIgnore
*
* @param $value
*/
public function setNameAttribute($value)
{
$this->attributes['name'] = Crypt::encrypt($value);
$this->attributes['encrypted'] = true;
} }
/** /**
@@ -106,4 +72,33 @@ class Category extends Model
return $value; return $value;
} }
/**
* @codeCoverageIgnore
*
* @param $value
*/
public function setNameAttribute($value)
{
$this->attributes['name'] = Crypt::encrypt($value);
$this->attributes['encrypted'] = true;
}
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function transactionjournals()
{
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
}
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo('FireflyIII\User');
}
} }

View File

@@ -1,19 +1,20 @@
<?php namespace FireflyIII\Models; <?php namespace FireflyIII\Models;
use Auth;
use DB;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
/** /**
* Class LimitRepetition * Class LimitRepetition
* *
* @codeCoverageIgnore
*
* @package FireflyIII\Models * @package FireflyIII\Models
*/ */
class LimitRepetition extends Model class LimitRepetition extends Model
{ {
protected $hidden = ['amount_encrypted'];
/** /**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function budgetLimit() public function budgetLimit()
@@ -22,7 +23,6 @@ class LimitRepetition extends Model
} }
/** /**
* @codeCoverageIgnore
* @return array * @return array
*/ */
public function getDates() public function getDates()
@@ -31,24 +31,11 @@ class LimitRepetition extends Model
} }
/** /**
* @return float * @param $value
*/ */
public function spentInRepetition() public function setAmountAttribute($value)
{ {
$sum = DB::table('transactions') $this->attributes['amount'] = strval(round($value, 2));
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
->leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budget_transaction_journal.budget_id')
->leftJoin('limit_repetitions', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id')
->where('transaction_journals.date', '>=', $this->startdate->format('Y-m-d'))
->where('transaction_journals.date', '<=', $this->enddate->format('Y-m-d'))
->where('transaction_journals.user_id', Auth::user()->id)
->whereNull('transactions.deleted_at')
->where('transactions.amount', '>', 0)
->where('limit_repetitions.id', '=', $this->id)
->sum('transactions.amount');
return floatval($sum);
} }
} }

View File

@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
/** /**
* Class PiggyBank * Class PiggyBank
* *
* @codeCoverageIgnore
*
* @package FireflyIII\Models * @package FireflyIII\Models
*/ */
class PiggyBank extends Model class PiggyBank extends Model
@@ -14,10 +16,10 @@ class PiggyBank extends Model
use SoftDeletes; use SoftDeletes;
protected $fillable protected $fillable
= ['name', 'account_id', 'order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me']; = ['name', 'account_id', 'order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me'];
protected $hidden = ['targetamount_encrypted', 'encrypted'];
/** /**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function account() public function account()
@@ -45,7 +47,6 @@ class PiggyBank extends Model
} }
/** /**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\HasMany * @return \Illuminate\Database\Eloquent\Relations\HasMany
*/ */
public function piggyBankRepetitions() public function piggyBankRepetitions()
@@ -54,7 +55,6 @@ class PiggyBank extends Model
} }
/** /**
* @codeCoverageIgnore
* @return array * @return array
*/ */
public function getDates() public function getDates()
@@ -63,48 +63,6 @@ class PiggyBank extends Model
} }
/** /**
* @codeCoverageIgnore
*
* @param $value
*
* @return int
*/
public function getRemindMeAttribute($value)
{
return intval($value) == 1;
}
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function piggyBankEvents()
{
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
}
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function reminders()
{
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
}
/**
* @codeCoverageIgnore
*
* @param $value
*/
public function setNameAttribute($value)
{
$this->attributes['name'] = Crypt::encrypt($value);
$this->attributes['encrypted'] = true;
}
/**
* @codeCoverageIgnore
* *
* @param $value * @param $value
* *
@@ -117,8 +75,51 @@ class PiggyBank extends Model
return Crypt::decrypt($value); return Crypt::decrypt($value);
} }
// @codeCoverageIgnoreStart
return $value; return $value;
// @codeCoverageIgnoreEnd }
/**
*
* @param $value
*
* @return int
*/
public function getRemindMeAttribute($value)
{
return intval($value) == 1;
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function piggyBankEvents()
{
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function reminders()
{
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
}
/**
*
* @param $value
*/
public function setNameAttribute($value)
{
$this->attributes['name'] = Crypt::encrypt($value);
$this->attributes['encrypted'] = true;
}
/**
* @param $value
*/
public function setTargetamountAttribute($value)
{
$this->attributes['targetamount'] = strval(round($value, 2));
} }
} }

View File

@@ -6,12 +6,14 @@ use Illuminate\Database\Eloquent\Model;
* Class PiggyBankEvent * Class PiggyBankEvent
* *
* @codeCoverageIgnore * @codeCoverageIgnore
*
* @package FireflyIII\Models * @package FireflyIII\Models
*/ */
class PiggyBankEvent extends Model class PiggyBankEvent extends Model
{ {
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount']; protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
protected $hidden = ['amount_encrypted'];
/** /**
* @return array * @return array
@@ -29,6 +31,14 @@ class PiggyBankEvent extends Model
return $this->belongsTo('FireflyIII\Models\PiggyBank'); return $this->belongsTo('FireflyIII\Models\PiggyBank');
} }
/**
* @param $value
*/
public function setAmountAttribute($value)
{
$this->attributes['amount'] = strval(round($value, 2));
}
/** /**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */

View File

@@ -14,6 +14,7 @@ class PiggyBankRepetition extends Model
{ {
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount']; protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
protected $hidden = ['currentamount_encrypted'];
/** /**
* @return array * @return array
@@ -66,4 +67,12 @@ class PiggyBankRepetition extends Model
); );
} }
/**
* @param $value
*/
public function setCurrentamountAttribute($value)
{
$this->attributes['currentamount'] = strval(round($value, 2));
}
} }

View File

@@ -1,5 +1,6 @@
<?php namespace FireflyIII\Models; <?php namespace FireflyIII\Models;
use Crypt;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
/** /**
@@ -12,6 +13,7 @@ class Preference extends Model
{ {
protected $fillable = ['user_id', 'data', 'name']; protected $fillable = ['user_id', 'data', 'name'];
protected $hidden = ['data_encrypted', 'name_encrypted'];
/** /**
* @param $value * @param $value
@@ -20,7 +22,12 @@ class Preference extends Model
*/ */
public function getDataAttribute($value) public function getDataAttribute($value)
{ {
return json_decode($value); if (is_null($this->data_encrypted)) {
return json_decode($value);
}
$data = Crypt::decrypt($this->data_encrypted);
return json_decode($data);
} }
/** /**
@@ -31,12 +38,37 @@ class Preference extends Model
return ['created_at', 'updated_at']; return ['created_at', 'updated_at'];
} }
/**
* @param $value
*
* @return float|int
*/
public function getNameAttribute($value)
{
if (is_null($this->name_encrypted)) {
return $value;
}
$value = Crypt::decrypt($this->name_encrypted);
return $value;
}
/** /**
* @param $value * @param $value
*/ */
public function setDataAttribute($value) public function setDataAttribute($value)
{ {
$this->attributes['data'] = json_encode($value); $this->attributes['data'] = '';
$this->attributes['data_encrypted'] = Crypt::encrypt(json_encode($value));
}
/**
* @param $value
*/
public function setNameAttribute($value)
{
$this->attributes['name_encrypted'] = Crypt::encrypt($value);
$this->attributes['name'] = $value;
} }
/** /**

View File

@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Model;
/** /**
* Class Reminder * Class Reminder
* *
* @codeCoverageIgnore
*
* @package FireflyIII\Models * @package FireflyIII\Models
*/ */
class Reminder extends Model class Reminder extends Model
@@ -15,9 +17,9 @@ class Reminder extends Model
protected $fillable = ['user_id', 'startdate', 'metadata', 'enddate', 'active', 'notnow', 'remindersable_id', 'remindersable_type',]; protected $fillable = ['user_id', 'startdate', 'metadata', 'enddate', 'active', 'notnow', 'remindersable_id', 'remindersable_type',];
protected $hidden = ['encrypted'];
/** /**
* @codeCoverageIgnore
* *
* @param $value * @param $value
* *
@@ -29,7 +31,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* @return array * @return array
*/ */
public function getDates() public function getDates()
@@ -38,7 +39,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* *
* @param $value * @param $value
* *
@@ -54,7 +54,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* *
* @param $value * @param $value
* *
@@ -66,7 +65,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\MorphTo * @return \Illuminate\Database\Eloquent\Relations\MorphTo
*/ */
public function remindersable() public function remindersable()
@@ -75,7 +73,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* *
* @param EloquentBuilder $query * @param EloquentBuilder $query
* @param Carbon $start * @param Carbon $start
@@ -89,7 +86,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* *
* @param EloquentBuilder $query * @param EloquentBuilder $query
* *
@@ -104,7 +100,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* *
* @param $value * @param $value
*/ */
@@ -115,7 +110,6 @@ class Reminder extends Model
} }
/** /**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/ */
public function user() public function user()

View File

@@ -2,7 +2,6 @@
namespace FireflyIII\Models; namespace FireflyIII\Models;
use App;
use Crypt; use Crypt;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait; use Watson\Validating\ValidatingTrait;
@@ -57,12 +56,6 @@ class Tag extends Model
$fields['tagMode'] = 'nothing'; $fields['tagMode'] = 'nothing';
$fields['description'] = isset($fields['description']) && !is_null($fields['description']) ? $fields['description'] : ''; $fields['description'] = isset($fields['description']) && !is_null($fields['description']) ? $fields['description'] : '';
$tag = Tag::create($fields); $tag = Tag::create($fields);
if (is_null($tag->id)) {
// could not create account:
App::abort(500, 'Could not create new tag with data: ' . json_encode($fields) . ' because ' . json_encode($tag->getErrors()));
}
return $tag; return $tag;

View File

@@ -16,6 +16,7 @@ class Transaction extends Model
{ {
protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount']; protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount'];
protected $hidden = ['encrypted'];
protected $rules protected $rules
= [ = [
'account_id' => 'required|exists:accounts,id', 'account_id' => 'required|exists:accounts,id',
@@ -33,6 +34,24 @@ class Transaction extends Model
return $this->belongsTo('FireflyIII\Models\Account'); return $this->belongsTo('FireflyIII\Models\Account');
} }
/**
* @param $value
*
* @return float|int
*/
public function getAmountAttribute($value)
{
return $value;
}
/**
* @return array
*/
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at'];
}
/** /**
* @param EloquentBuilder $query * @param EloquentBuilder $query
* @param Carbon $date * @param Carbon $date
@@ -56,11 +75,11 @@ class Transaction extends Model
} }
/** /**
* @return array * @param $value
*/ */
public function getDates() public function setAmountAttribute($value)
{ {
return ['created_at', 'updated_at', 'deleted_at']; $this->attributes['amount'] = strval(round($value, 2));
} }
/** /**

View File

@@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Query\JoinClause;
use Watson\Validating\ValidatingTrait; use Watson\Validating\ValidatingTrait;
/** /**
@@ -19,9 +18,9 @@ class TransactionJournal extends Model
use SoftDeletes, ValidatingTrait; use SoftDeletes, ValidatingTrait;
protected $fillable = ['user_id', 'transaction_type_id', 'bill_id', 'transaction_currency_id', 'description', 'completed', 'date', 'encrypted']; protected $fillable = ['user_id', 'transaction_type_id', 'bill_id', 'transaction_currency_id', 'description', 'completed', 'date', 'encrypted'];
protected $hidden = ['encrypted'];
protected $rules protected $rules
= [ = [
'user_id' => 'required|exists:users,id', 'user_id' => 'required|exists:users,id',
'transaction_type_id' => 'required|exists:transaction_types,id', 'transaction_type_id' => 'required|exists:transaction_types,id',
'bill_id' => 'exists:bills,id', 'bill_id' => 'exists:bills,id',
@@ -60,15 +59,15 @@ class TransactionJournal extends Model
} }
/** /**
* @return float * @return string
*/ */
public function getActualAmountAttribute() public function getActualAmountAttribute()
{ {
$amount = 0; $amount = '0';
/** @var Transaction $t */ /** @var Transaction $t */
foreach ($this->transactions as $t) { foreach ($this->transactions as $t) {
if ($t->amount > 0) { if ($t->amount > 0) {
$amount = floatval($t->amount); $amount = $t->amount;
} }
} }
@@ -80,11 +79,12 @@ class TransactionJournal extends Model
*/ */
public function getAmountAttribute() public function getAmountAttribute()
{ {
$amount = 0; $amount = '0';
bcscale(2);
/** @var Transaction $t */ /** @var Transaction $t */
foreach ($this->transactions as $t) { foreach ($this->transactions as $t) {
if ($t->amount > 0) { if ($t->amount > 0) {
$amount = floatval($t->amount); $amount = $t->amount;
} }
} }
@@ -94,20 +94,43 @@ class TransactionJournal extends Model
if ($this->tags->count() == 0) { if ($this->tags->count() == 0) {
return $amount; return $amount;
} }
// if journal is part of advancePayment AND journal is a withdrawal, // if journal is part of advancePayment AND journal is a withdrawal,
// then journal is being repaid by other journals, so the actual amount will lower: // then journal is being repaid by other journals, so the actual amount will lower:
/** @var Tag $tag */ /** @var Tag $advancePayment */
$tag = $this->tags()->where('tagMode', 'advancePayment')->first(); $advancePayment = $this->tags()->where('tagMode', 'advancePayment')->first();
if ($tag && $this->transactionType->type == 'Withdrawal') { if ($advancePayment && $this->transactionType->type == 'Withdrawal') {
// loop other deposits, remove from our amount. // loop other deposits, remove from our amount.
$others = $tag->transactionJournals()->transactionTypes(['Deposit'])->get(); $others = $advancePayment->transactionJournals()->transactionTypes(['Deposit'])->get();
foreach ($others as $other) { foreach ($others as $other) {
$amount -= $other->amount; $amount = bcsub($amount, $other->actualAmount);
} }
return $amount; return $amount;
} }
// if this journal is part of an advancePayment AND the journal is a deposit,
// then the journal amount is correcting a withdrawal, and the amount is zero:
if ($advancePayment && $this->transactionType->type == 'Deposit') {
return '0';
}
// is balancing act?
$balancingAct = $this->tags()->where('tagMode', 'balancingAct')->first();
if ($balancingAct) {
// this is the expense:
if ($this->transactionType->type == 'Withdrawal') {
$transfer = $balancingAct->transactionJournals()->transactionTypes(['Transfer'])->first();
if ($transfer) {
$amount = bcsub($amount, $transfer->actualAmount);
return $amount;
}
} // @codeCoverageIgnore
} // @codeCoverageIgnore
return $amount; return $amount;
} }
@@ -157,16 +180,16 @@ class TransactionJournal extends Model
*/ */
public function getCorrectedActualAmountAttribute() public function getCorrectedActualAmountAttribute()
{ {
$amount = 0; $amount = '0';
$type = $this->transactionType->type; $type = $this->transactionType->type;
/** @var Transaction $t */ /** @var Transaction $t */
foreach ($this->transactions as $t) { foreach ($this->transactions as $t) {
if ($t->amount > 0 && $type != 'Withdrawal') { if ($t->amount > 0 && $type != 'Withdrawal') {
$amount = floatval($t->amount); $amount = $t->amount;
break; break;
} }
if ($t->amount < 0 && $type == 'Withdrawal') { if ($t->amount < 0 && $type == 'Withdrawal') {
$amount = floatval($t->amount); $amount = $t->amount;
break; break;
} }
} }
@@ -199,6 +222,21 @@ class TransactionJournal extends Model
return $value; return $value;
} }
/**
* @return Account
*/
public function getDestinationAccountAttribute()
{
/** @var Transaction $transaction */
foreach ($this->transactions()->get() as $transaction) {
if (floatval($transaction->amount) > 0) {
return $transaction->account;
}
}
return $this->transactions()->first()->account;
}
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\HasMany * @return \Illuminate\Database\Eloquent\Relations\HasMany
@@ -249,24 +287,6 @@ class TransactionJournal extends Model
return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d 00:00:00')); return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d 00:00:00'));
} }
/**
* @codeCoverageIgnore
*
* @param EloquentBuilder $query
* @param $amount
*/
public function scopeLessThan(EloquentBuilder $query, $amount)
{
if (is_null($this->joinedTransactions)) {
$query->leftJoin(
'transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id'
);
$this->joinedTransactions = true;
}
$query->where('transactions.amount', '<=', $amount);
}
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
* *
@@ -280,24 +300,6 @@ class TransactionJournal extends Model
return $query->where('date', '=', $date->format('Y-m-d')); return $query->where('date', '=', $date->format('Y-m-d'));
} }
/**
* Returns the account to which the money was moved.
*
* @codeCoverageIgnore
*
* @param EloquentBuilder $query
* @param Account $account
*/
public function scopeToAccountIs(EloquentBuilder $query, Account $account)
{
$query->leftJoin(
'transactions', function (JoinClause $join) {
$join->on('transactions.transaction_journal_id', '=', 'transaction_journals.id')->where('transactions.amount', '>', 0);
}
);
$query->where('transactions.account_id', $account->id);
}
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
* *

View File

@@ -287,7 +287,7 @@ class AccountRepository implements AccountRepositoryInterface
*/ */
public function getTransfersInRange(Account $account, Carbon $start, Carbon $end) public function getTransfersInRange(Account $account, Carbon $start, Carbon $end)
{ {
return TransactionJournal::whereIn( $set = TransactionJournal::whereIn(
'id', function (Builder $q) use ($account, $start, $end) { 'id', function (Builder $q) use ($account, $start, $end) {
$q->select('transaction_journals.id') $q->select('transaction_journals.id')
->from('transactions') ->from('transactions')
@@ -297,16 +297,24 @@ class AccountRepository implements AccountRepositoryInterface
->where('transaction_journals.user_id', Auth::user()->id) ->where('transaction_journals.user_id', Auth::user()->id)
->where('transaction_journals.date', '>=', $start->format('Y-m-d')) ->where('transaction_journals.date', '>=', $start->format('Y-m-d'))
->where('transaction_journals.date', '<=', $end->format('Y-m-d')) ->where('transaction_journals.date', '<=', $end->format('Y-m-d'))
->where('transactions.amount', '>', 0)
->where('transaction_types.type', 'Transfer'); ->where('transaction_types.type', 'Transfer');
} }
)->get(); )->get();
$filtered = $set->filter(
function (TransactionJournal $journal) use ($account) {
if ($journal->destination_account->id == $account->id) {
return $journal;
}
} // @codeCoverageIgnore
);
return $filtered;
} }
/** /**
* @param Account $account * @param Account $account
* @param Carbon $date * @param Carbon $date
* *
* @return float * @return float
*/ */

View File

@@ -115,7 +115,7 @@ interface AccountRepositoryInterface
/** /**
* @param Account $account * @param Account $account
* @param Carbon $date * @param Carbon $date
* *
* @return float * @return float
*/ */

View File

@@ -10,7 +10,6 @@ use FireflyIII\Models\AccountType;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\Transaction; use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Log; use Log;
use Navigation; use Navigation;
@@ -108,16 +107,10 @@ class BillRepository implements BillRepositoryInterface
public function getJournals(Bill $bill) public function getJournals(Bill $bill)
{ {
return $bill->transactionjournals()->withRelevantData() return $bill->transactionjournals()->withRelevantData()
->leftJoin(
'transactions', function (JoinClause $join) {
$join->on('transactions.transaction_journal_id', '=', 'transaction_journals.id')
->where('transactions.amount', '>', 0);
}
)
->orderBy('transaction_journals.date', 'DESC') ->orderBy('transaction_journals.date', 'DESC')
->orderBy('transaction_journals.order', 'ASC') ->orderBy('transaction_journals.order', 'ASC')
->orderBy('transaction_journals.id', 'DESC') ->orderBy('transaction_journals.id', 'DESC')
->get(['transaction_journals.*', 'transactions.amount']); ->get(['transaction_journals.*']);
} }
/** /**

View File

@@ -49,9 +49,11 @@ class BudgetRepository implements BudgetRepositoryInterface
* *
* @return float * @return float
*/ */
public function expensesOnDay(Budget $budget, Carbon $date) public function expensesOnDayCorrected(Budget $budget, Carbon $date)
{ {
return floatval($budget->transactionjournals()->lessThan(0)->transactionTypes(['Withdrawal'])->onDate($date)->sum('amount')); $sum = floatval($budget->transactionjournals()->transactionTypes(['Withdrawal'])->onDate($date)->get(['transaction_journals.*'])->sum('amount'));
return $sum * -1;
} }
/** /**
@@ -99,6 +101,7 @@ class BudgetRepository implements BudgetRepositoryInterface
public function getBudgets() public function getBudgets()
{ {
$budgets = Auth::user()->budgets()->get(); $budgets = Auth::user()->budgets()->get();
return $budgets; return $budgets;
} }
@@ -247,9 +250,8 @@ class BudgetRepository implements BudgetRepositoryInterface
) )
->after($start) ->after($start)
->before($end) ->before($end)
->lessThan(0)
->transactionTypes(['Withdrawal']) ->transactionTypes(['Withdrawal'])
->sum('transactions.amount'); ->get(['transaction_journals.*'])->sum('amount');
return floatval($noBudgetSet) * -1; return floatval($noBudgetSet) * -1;
} }
@@ -262,17 +264,17 @@ class BudgetRepository implements BudgetRepositoryInterface
* *
* @return float * @return float
*/ */
public function spentInPeriod(Budget $budget, Carbon $start, Carbon $end, $shared = true) public function spentInPeriodCorrected(Budget $budget, Carbon $start, Carbon $end, $shared = true)
{ {
if ($shared === true) { if ($shared === true) {
// get everything: // get everything:
$sum = floatval($budget->transactionjournals()->before($end)->after($start)->lessThan(0)->sum('amount')) * -1; $sum = floatval($budget->transactionjournals()->before($end)->after($start)->get(['transaction_journals.*'])->sum('amount'));
} else { } else {
// get all journals in this month where the asset account is NOT shared. // get all journals in this month where the asset account is NOT shared.
$sum = $budget->transactionjournals() $sum = $budget->transactionjournals()
->before($end) ->before($end)
->after($start) ->after($start)
->lessThan(0) ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
->leftJoin( ->leftJoin(
'account_meta', function (JoinClause $join) { 'account_meta', function (JoinClause $join) {
@@ -280,8 +282,9 @@ class BudgetRepository implements BudgetRepositoryInterface
} }
) )
->where('account_meta.data', '!=', '"sharedAsset"') ->where('account_meta.data', '!=', '"sharedAsset"')
->get(['transaction_journals.*'])
->sum('amount'); ->sum('amount');
$sum = floatval($sum) * -1; $sum = floatval($sum);
} }
return $sum; return $sum;
@@ -305,17 +308,6 @@ class BudgetRepository implements BudgetRepositoryInterface
return $newBudget; return $newBudget;
} }
/**
* @param Budget $budget
* @param Carbon $start
* @param Carbon $end
*
* @return float
*/
public function sumBudgetExpensesInPeriod(Budget $budget, $start, $end)
{
return floatval($budget->transactionjournals()->before($end)->after($start)->lessThan(0)->sum('amount')) * -1;
}
/** /**
* @param Budget $budget * @param Budget $budget

View File

@@ -27,12 +27,14 @@ interface BudgetRepositoryInterface
public function destroy(Budget $budget); public function destroy(Budget $budget);
/** /**
* Takes tags into account.
*
* @param Budget $budget * @param Budget $budget
* @param Carbon $date * @param Carbon $date
* *
* @return float * @return float
*/ */
public function expensesOnDay(Budget $budget, Carbon $date); public function expensesOnDayCorrected(Budget $budget, Carbon $date);
/** /**
* @return Collection * @return Collection
@@ -123,14 +125,17 @@ interface BudgetRepositoryInterface
public function getWithoutBudgetSum(Carbon $start, Carbon $end); public function getWithoutBudgetSum(Carbon $start, Carbon $end);
/** /**
* @param Budget $budget *
* @param Carbon $start * Same as ::spentInPeriod but corrects journals for their amount (tags).
* @param Carbon $end *
* @param Budget $budget
* @param Carbon $start
* @param Carbon $end
* @param boolean $shared * @param boolean $shared
* *
* @return float * @return float
*/ */
public function spentInPeriod(Budget $budget, Carbon $start, Carbon $end, $shared = true); public function spentInPeriodCorrected(Budget $budget, Carbon $start, Carbon $end, $shared = true);
/** /**
* @param array $data * @param array $data
@@ -139,15 +144,6 @@ interface BudgetRepositoryInterface
*/ */
public function store(array $data); public function store(array $data);
/**
* @param Budget $budget
* @param Carbon $start
* @param Carbon $end
*
* @return float
*/
public function sumBudgetExpensesInPeriod(Budget $budget, $start, $end);
/** /**
* @param Budget $budget * @param Budget $budget
* @param array $data * @param array $data

View File

@@ -4,7 +4,7 @@ namespace FireflyIII\Repositories\Category;
use Auth; use Auth;
use Carbon\Carbon; use Carbon\Carbon;
use DB; use Crypt;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Database\Query\JoinClause; use Illuminate\Database\Query\JoinClause;
@@ -58,33 +58,44 @@ class CategoryRepository implements CategoryRepositoryInterface
} }
/** /**
*
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* *
* @return Collection * @return Collection
*/ */
public function getCategoriesAndExpenses($start, $end) public function getCategoriesAndExpensesCorrected($start, $end)
{ {
return TransactionJournal:: $set = Auth::user()->transactionjournals()
where('transaction_journals.user_id', Auth::user()->id) ->leftJoin(
->leftJoin( 'category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id'
'transactions', )
function (JoinClause $join) { ->leftJoin('categories', 'categories.id', '=', 'category_transaction_journal.category_id')
$join->on('transaction_journals.id', '=', 'transactions.transaction_journal_id')->where('amount', '>', 0); ->before($end)
} ->where('categories.user_id', Auth::user()->id)
) ->after($start)
->leftJoin( ->transactionTypes(['Withdrawal'])
'category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id' ->groupBy('categories.id')
) ->get(['categories.id as category_id', 'categories.encrypted as category_encrypted', 'categories.name', 'transaction_journals.*']);
->leftJoin('categories', 'categories.id', '=', 'category_transaction_journal.category_id')
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') $result = [];
->before($end) foreach ($set as $entry) {
->where('categories.user_id', Auth::user()->id) $categoryId = intval($entry->category_id);
->after($start) if (isset($result[$categoryId])) {
->where('transaction_types.type', 'Withdrawal') $result[$categoryId]['sum'] += floatval($entry->amount);
->groupBy('categories.id') } else {
->orderBy('sum', 'DESC') $isEncrypted = intval($entry->category_encrypted) == 1 ? true : false;
->get(['categories.id', 'categories.encrypted', 'categories.name', DB::Raw('SUM(`transactions`.`amount`) AS `sum`')]); $name = strlen($entry->name) == 0 ? trans('firefly.no_category') : $entry->name;
$name = $isEncrypted ? Crypt::decrypt($name) : $name;
$result[$categoryId] = [
'name' => $name,
'sum' => floatval($entry->amount),
];
}
}
return $result;
} }
/** /**
@@ -172,16 +183,16 @@ class CategoryRepository implements CategoryRepositoryInterface
* *
* @return float * @return float
*/ */
public function spentInPeriod(Category $category, Carbon $start, Carbon $end, $shared = false) public function spentInPeriodCorrected(Category $category, Carbon $start, Carbon $end, $shared = false)
{ {
if ($shared === true) { if ($shared === true) {
// shared is true. // shared is true.
// always ignore transfers between accounts! // always ignore transfers between accounts!
$sum = floatval( $sum = floatval(
$category->transactionjournals() $category->transactionjournals()
->transactionTypes(['Withdrawal']) ->transactionTypes(['Withdrawal'])
->before($end)->after($start)->lessThan(0)->sum('amount') ->before($end)->after($start)->get(['transaction_journals.*'])->sum('amount')
) * -1; );
} else { } else {
// do something else, SEE budgets. // do something else, SEE budgets.
@@ -190,7 +201,7 @@ class CategoryRepository implements CategoryRepositoryInterface
->before($end) ->before($end)
->after($start) ->after($start)
->transactionTypes(['Withdrawal']) ->transactionTypes(['Withdrawal'])
->lessThan(0) ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
->leftJoin( ->leftJoin(
'account_meta', function (JoinClause $join) { 'account_meta', function (JoinClause $join) {
@@ -198,22 +209,24 @@ class CategoryRepository implements CategoryRepositoryInterface
} }
) )
->where('account_meta.data', '!=', '"sharedAsset"') ->where('account_meta.data', '!=', '"sharedAsset"')
->sum('amount'); ->get(['transaction_journals.*'])->sum('amount');
$sum = floatval($sum) * -1; $sum = floatval($sum);
} }
return $sum; return $sum;
} }
/** /**
* Corrected for tags
*
* @param Category $category * @param Category $category
* @param Carbon $date * @param Carbon $date
* *
* @return float * @return float
*/ */
public function spentOnDaySum(Category $category, Carbon $date) public function spentOnDaySumCorrected(Category $category, Carbon $date)
{ {
return floatval($category->transactionjournals()->onDate($date)->lessThan(0)->sum('amount')) * -1; return floatval($category->transactionjournals()->onDate($date)->get(['transaction_journals.*'])->sum('amount'));
} }
/** /**

View File

@@ -33,12 +33,14 @@ interface CategoryRepositoryInterface
public function getCategories(); public function getCategories();
/** /**
* Corrected for tags.
*
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* *
* @return Collection * @return Collection
*/ */
public function getCategoriesAndExpenses($start, $end); public function getCategoriesAndExpensesCorrected($start, $end);
/** /**
* @param Category $category * @param Category $category
@@ -71,6 +73,8 @@ interface CategoryRepositoryInterface
public function getWithoutCategory(Carbon $start, Carbon $end); public function getWithoutCategory(Carbon $start, Carbon $end);
/** /**
* Corrected for tags.
*
* @param Category $category * @param Category $category
* @param \Carbon\Carbon $start * @param \Carbon\Carbon $start
* @param \Carbon\Carbon $end * @param \Carbon\Carbon $end
@@ -79,15 +83,18 @@ interface CategoryRepositoryInterface
* *
* @return float * @return float
*/ */
public function spentInPeriod(Category $category, Carbon $start, Carbon $end, $shared = false); public function spentInPeriodCorrected(Category $category, Carbon $start, Carbon $end, $shared = false);
/** /**
*
* Corrected for tags.
*
* @param Category $category * @param Category $category
* @param Carbon $date * @param Carbon $date
* *
* @return float * @return float
*/ */
public function spentOnDaySum(Category $category, Carbon $date); public function spentOnDaySumCorrected(Category $category, Carbon $date);
/** /**
* @param array $data * @param array $data

View File

@@ -76,15 +76,20 @@ class JournalRepository implements JournalRepositoryInterface
*/ */
public function getAmountBefore(TransactionJournal $journal, Transaction $transaction) public function getAmountBefore(TransactionJournal $journal, Transaction $transaction)
{ {
return floatval( $set = $transaction->account->transactions()->leftJoin(
$transaction->account->transactions()->leftJoin( 'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id' )
) ->where('transaction_journals.date', '<=', $journal->date->format('Y-m-d'))
->where('transaction_journals.date', '<=', $journal->date->format('Y-m-d')) ->where('transaction_journals.order', '>=', $journal->order)
->where('transaction_journals.order', '>=', $journal->order) ->where('transaction_journals.id', '!=', $journal->id)
->where('transaction_journals.id', '!=', $journal->id) ->get(['transactions.*']);
->sum('transactions.amount') $sum = 0;
); foreach ($set as $entry) {
$sum += $entry->amount;
}
return $sum;
} }
/** /**

View File

@@ -7,9 +7,7 @@ use Carbon\Carbon;
use DB; use DB;
use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Models\PiggyBankRepetition;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Navigation;
/** /**
* Class PiggyBankRepository * Class PiggyBankRepository

View File

@@ -3,7 +3,6 @@
namespace FireflyIII\Repositories\PiggyBank; namespace FireflyIII\Repositories\PiggyBank;
use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankRepetition;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**

View File

@@ -78,9 +78,13 @@ class TagRepository implements TagRepositoryInterface
/** @var Tag $tag */ /** @var Tag $tag */
foreach ($tags as $tag) { foreach ($tags as $tag) {
$transfer = $tag->transactionjournals()->after($start)->before($end)->toAccountIs($account)->transactionTypes(['Transfer'])->first(); $journals = $tag->transactionjournals()->after($start)->before($end)->transactionTypes(['Transfer'])->get(['transaction_journals.*']);
if ($transfer) {
$amount += $transfer->amount; /** @var TransactionJournal $journal */
foreach ($journals as $journal) {
if ($journal->destination_account->id == $account->id) {
$amount += $journal->amount;
}
} }
} }

View File

@@ -51,7 +51,8 @@ class ExpandedForm
if (isset($options['label'])) { if (isset($options['label'])) {
return $options['label']; return $options['label'];
} }
return trans('form.'.$name);
return trans('form.' . $name);
} }

View File

@@ -34,16 +34,20 @@ class Steam
$firstDate = is_null($firstDateObject) ? clone $date : new Carbon($firstDateObject->date); $firstDate = is_null($firstDateObject) ? clone $date : new Carbon($firstDateObject->date);
$date = $date < $firstDate ? $firstDate : $date; $date = $date < $firstDate ? $firstDate : $date;
$balance = floatval( bcscale(2);
$account->transactions()->leftJoin( $set = $account->transactions()->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id' 'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
)->where('transaction_journals.date', '<=', $date->format('Y-m-d'))->sum('transactions.amount') )->where('transaction_journals.date', '<=', $date->format('Y-m-d'))->get(['transactions.*']);
); $balance = '0';
if (!$ignoreVirtualBalance) { foreach ($set as $entry) {
$balance += floatval($account->virtual_balance); $balance = bcadd($balance, $entry->amount);
} }
return $balance; if (!$ignoreVirtualBalance) {
$balance = bcadd($balance, $account->virtual_balance);
}
return round($balance, 2);
} }
/** /**

View File

@@ -3,7 +3,6 @@
namespace FireflyIII\Support\Twig; namespace FireflyIII\Support\Twig;
use Auth; use Auth;
use DB;
use FireflyIII\Models\LimitRepetition; use FireflyIII\Models\LimitRepetition;
use Twig_Extension; use Twig_Extension;
use Twig_SimpleFunction; use Twig_SimpleFunction;
@@ -21,19 +20,16 @@ class Budget extends Twig_Extension
public function getFunctions() public function getFunctions()
{ {
$functions[] = new Twig_SimpleFunction( $functions[] = new Twig_SimpleFunction(
'spentInRepetition', function (LimitRepetition $repetition) { 'spentInRepetitionCorrected', function (LimitRepetition $repetition) {
$sum = DB::table('transactions') $sum
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') = Auth::user()->transactionjournals()
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
->leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budget_transaction_journal.budget_id') ->leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budget_transaction_journal.budget_id')
->leftJoin('limit_repetitions', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id') ->leftJoin('limit_repetitions', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id')
->where('transaction_journals.date', '>=', $repetition->startdate->format('Y-m-d')) ->before($repetition->enddate)
->where('transaction_journals.date', '<=', $repetition->enddate->format('Y-m-d')) ->after($repetition->startdate)
->where('transaction_journals.user_id', Auth::user()->id) ->where('limit_repetitions.id', '=', $repetition->id)
->whereNull('transactions.deleted_at') ->get(['transaction_journals.*'])->sum('amount');
->where('transactions.amount', '>', 0)
->where('limit_repetitions.id', '=', $repetition->id)
->sum('transactions.amount');
return floatval($sum); return floatval($sum);
} }

View File

@@ -84,7 +84,8 @@ class Journal extends Twig_Extension
if ($tag->tagMode == 'balancingAct') { if ($tag->tagMode == 'balancingAct') {
// return tag formatted for a "balancing act", even if other // return tag formatted for a "balancing act", even if other
// tags are present. // tags are present.
$amount = App::make('amount')->formatJournal($journal, false); $amount = App::make('amount')->format($journal->actual_amount, false);
return '<a href="' . route('tags.show', $tag->id) . '" class="label label-success" title="' . $amount return '<a href="' . route('tags.show', $tag->id) . '" class="label label-success" title="' . $amount
. '"><i class="fa fa-fw fa-refresh"></i> ' . $tag->tag . '</a>'; . '"><i class="fa fa-fw fa-refresh"></i> ' . $tag->tag . '</a>';
} }
@@ -94,6 +95,7 @@ class Journal extends Twig_Extension
*/ */
if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Deposit') { if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Deposit') {
$amount = App::make('amount')->formatJournal($journal, false); $amount = App::make('amount')->formatJournal($journal, false);
return '<a href="' . route('tags.show', $tag->id) . '" class="label label-success" title="' . $amount return '<a href="' . route('tags.show', $tag->id) . '" class="label label-success" title="' . $amount
. '"><i class="fa fa-fw fa-sort-numeric-desc"></i> ' . $tag->tag . '</a>'; . '"><i class="fa fa-fw fa-sort-numeric-desc"></i> ' . $tag->tag . '</a>';
} }
@@ -103,6 +105,7 @@ class Journal extends Twig_Extension
*/ */
if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Withdrawal') { if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Withdrawal') {
$amount = App::make('amount')->formatJournal($journal); $amount = App::make('amount')->formatJournal($journal);
return '<a href="' . route('tags.show', $tag->id) . '">' . $amount . '</a>'; return '<a href="' . route('tags.show', $tag->id) . '">' . $amount . '</a>';
} }

View File

@@ -2,7 +2,6 @@
namespace FireflyIII\Support\Twig; namespace FireflyIII\Support\Twig;
use FireflyIII\Models\LimitRepetition;
use Twig_Extension; use Twig_Extension;
use Twig_SimpleFilter; use Twig_SimpleFilter;

372
composer.lock generated
View File

@@ -1,7 +1,7 @@
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "e3e90dd365b74f4878cf3b5b4a1c4007", "hash": "e3e90dd365b74f4878cf3b5b4a1c4007",
@@ -943,16 +943,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v5.0.29", "version": "v5.0.31",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "aa7046645e094b0134a4125cce6694f4b076ac62" "reference": "db0a7400465df159ba8c6eaa954f97f50bc19687"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/aa7046645e094b0134a4125cce6694f4b076ac62", "url": "https://api.github.com/repos/laravel/framework/zipball/db0a7400465df159ba8c6eaa954f97f50bc19687",
"reference": "aa7046645e094b0134a4125cce6694f4b076ac62", "reference": "db0a7400465df159ba8c6eaa954f97f50bc19687",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1065,7 +1065,7 @@
"framework", "framework",
"laravel" "laravel"
], ],
"time": "2015-05-08 12:57:10" "time": "2015-05-11 22:15:00"
}, },
{ {
"name": "league/commonmark", "name": "league/commonmark",
@@ -1328,21 +1328,21 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "1.18.0", "version": "1.19.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "99e2f69f7bdc2cc4334b2d00f1e0ba450623ea36" "reference": "68868e0b02d2d803d0052a59d4e5003cccf87320"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/99e2f69f7bdc2cc4334b2d00f1e0ba450623ea36", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/68868e0b02d2d803d0052a59d4e5003cccf87320",
"reference": "99e2f69f7bdc2cc4334b2d00f1e0ba450623ea36", "reference": "68868e0b02d2d803d0052a59d4e5003cccf87320",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.0", "php": ">=5.3.0",
"symfony/translation": "2.6.*" "symfony/translation": "~2.6"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.0" "phpunit/phpunit": "~4.0"
@@ -1371,7 +1371,7 @@
"datetime", "datetime",
"time" "time"
], ],
"time": "2015-03-26 03:05:57" "time": "2015-05-09 03:23:44"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
@@ -1529,21 +1529,21 @@
}, },
{ {
"name": "rcrowe/twigbridge", "name": "rcrowe/twigbridge",
"version": "0.7.x-dev", "version": "dev-master",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/rcrowe/TwigBridge.git", "url": "https://github.com/rcrowe/TwigBridge.git",
"reference": "ac0bfb5bcdb4fcd0cd01ab8425620ff07f6af026" "reference": "0e2693d99745eb8bbd01a80e841951c0738e1d15"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/ac0bfb5bcdb4fcd0cd01ab8425620ff07f6af026", "url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/0e2693d99745eb8bbd01a80e841951c0738e1d15",
"reference": "ac0bfb5bcdb4fcd0cd01ab8425620ff07f6af026", "reference": "0e2693d99745eb8bbd01a80e841951c0738e1d15",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/support": "5.0.*", "illuminate/support": "5.0.*|5.1.*",
"illuminate/view": "5.0.*", "illuminate/view": "5.0.*|5.1.*",
"php": ">=5.4.0", "php": ">=5.4.0",
"twig/twig": "~1.15" "twig/twig": "~1.15"
}, },
@@ -1589,7 +1589,7 @@
"laravel", "laravel",
"twig" "twig"
], ],
"time": "2015-04-22 09:19:03" "time": "2015-05-21 13:46:00"
}, },
{ {
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
@@ -1645,17 +1645,17 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Console", "target-dir": "Symfony/Component/Console",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Console.git", "url": "https://github.com/symfony/Console.git",
"reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667" "reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/5b91dc4ed5eb08553f57f6df04c4730a73992667", "url": "https://api.github.com/repos/symfony/Console/zipball/ebc5679854aa24ed7d65062e9e3ab0b18a917272",
"reference": "5b91dc4ed5eb08553f57f6df04c4730a73992667", "reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1688,32 +1688,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-30 15:54:10" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/debug", "name": "symfony/debug",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Debug", "target-dir": "Symfony/Component/Debug",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Debug.git", "url": "https://github.com/symfony/Debug.git",
"reference": "d49a46a20a8f0544aedac54466750ad787d3d3e3" "reference": "ad4511a8fddce7ec163b513ba39a30ea4f32c9e7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Debug/zipball/d49a46a20a8f0544aedac54466750ad787d3d3e3", "url": "https://api.github.com/repos/symfony/Debug/zipball/ad4511a8fddce7ec163b513ba39a30ea4f32c9e7",
"reference": "d49a46a20a8f0544aedac54466750ad787d3d3e3", "reference": "ad4511a8fddce7ec163b513ba39a30ea4f32c9e7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1749,32 +1749,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Debug Component", "description": "Symfony Debug Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-22 16:55:57" "time": "2015-05-08 13:17:44"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/EventDispatcher", "target-dir": "Symfony/Component/EventDispatcher",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/EventDispatcher.git", "url": "https://github.com/symfony/EventDispatcher.git",
"reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284" "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/70f7c8478739ad21e3deef0d977b38c77f1fb284", "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/672593bc4b0043a0acf91903bb75a1c82d8f2e02",
"reference": "70f7c8478739ad21e3deef0d977b38c77f1fb284", "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1808,32 +1808,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-13 17:37:22" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Filesystem", "target-dir": "Symfony/Component/Filesystem",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Filesystem.git", "url": "https://github.com/symfony/Filesystem.git",
"reference": "4983964b3693e4f13449cb3800c64a9112c301b4" "reference": "f73904bd2dae525c42ea1f0340c7c98480ecacde"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Filesystem/zipball/4983964b3693e4f13449cb3800c64a9112c301b4", "url": "https://api.github.com/repos/symfony/Filesystem/zipball/f73904bd2dae525c42ea1f0340c7c98480ecacde",
"reference": "4983964b3693e4f13449cb3800c64a9112c301b4", "reference": "f73904bd2dae525c42ea1f0340c7c98480ecacde",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1858,32 +1858,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Filesystem Component", "description": "Symfony Filesystem Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-22 16:55:57" "time": "2015-05-08 00:09:07"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Finder", "target-dir": "Symfony/Component/Finder",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Finder.git", "url": "https://github.com/symfony/Finder.git",
"reference": "5dbe2e73a580618f5b4880fda93406eed25de251" "reference": "704c64c8b12c8882640d5c0330a8414b1e06dc99"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Finder/zipball/5dbe2e73a580618f5b4880fda93406eed25de251", "url": "https://api.github.com/repos/symfony/Finder/zipball/704c64c8b12c8882640d5c0330a8414b1e06dc99",
"reference": "5dbe2e73a580618f5b4880fda93406eed25de251", "reference": "704c64c8b12c8882640d5c0330a8414b1e06dc99",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1908,32 +1908,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-30 15:54:10" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/HttpFoundation", "target-dir": "Symfony/Component/HttpFoundation",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/HttpFoundation.git", "url": "https://github.com/symfony/HttpFoundation.git",
"reference": "8a6337233f08f7520de97f4ffd6f00e947d892f9" "reference": "8a0d00980ef9f6b47ddbf24bdfbf70fead760816"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/8a6337233f08f7520de97f4ffd6f00e947d892f9", "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/8a0d00980ef9f6b47ddbf24bdfbf70fead760816",
"reference": "8a6337233f08f7520de97f4ffd6f00e947d892f9", "reference": "8a0d00980ef9f6b47ddbf24bdfbf70fead760816",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1962,32 +1962,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony HttpFoundation Component", "description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-04-01 16:50:12" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/HttpKernel", "target-dir": "Symfony/Component/HttpKernel",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/HttpKernel.git", "url": "https://github.com/symfony/HttpKernel.git",
"reference": "3829cacfe21eaf3f73604a62d79183d1f6e792c4" "reference": "2010194de0a57731af9404c7f97fd300db98b7a3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/HttpKernel/zipball/3829cacfe21eaf3f73604a62d79183d1f6e792c4", "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/2010194de0a57731af9404c7f97fd300db98b7a3",
"reference": "3829cacfe21eaf3f73604a62d79183d1f6e792c4", "reference": "2010194de0a57731af9404c7f97fd300db98b7a3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2040,32 +2040,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony HttpKernel Component", "description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-04-01 16:55:26" "time": "2015-05-11 01:58:49"
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Process", "target-dir": "Symfony/Component/Process",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Process.git", "url": "https://github.com/symfony/Process.git",
"reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552" "reference": "9f3c4baaf840ed849e1b1f7bfd5ae246e8509562"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Process/zipball/a8bebaec1a9dc6cde53e0250e32917579b0be552", "url": "https://api.github.com/repos/symfony/Process/zipball/9f3c4baaf840ed849e1b1f7bfd5ae246e8509562",
"reference": "a8bebaec1a9dc6cde53e0250e32917579b0be552", "reference": "9f3c4baaf840ed849e1b1f7bfd5ae246e8509562",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2090,32 +2090,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-30 15:54:10" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Routing", "target-dir": "Symfony/Component/Routing",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Routing.git", "url": "https://github.com/symfony/Routing.git",
"reference": "4e173a645b63ff60a124f3741b4f15feebd908fa" "reference": "1455ec537940f7428ea6aa9411f3c4bca69413a0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Routing/zipball/4e173a645b63ff60a124f3741b4f15feebd908fa", "url": "https://api.github.com/repos/symfony/Routing/zipball/1455ec537940f7428ea6aa9411f3c4bca69413a0",
"reference": "4e173a645b63ff60a124f3741b4f15feebd908fa", "reference": "1455ec537940f7428ea6aa9411f3c4bca69413a0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2153,28 +2153,28 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Routing Component", "description": "Symfony Routing Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"keywords": [ "keywords": [
"router", "router",
"routing", "routing",
"uri", "uri",
"url" "url"
], ],
"time": "2015-03-30 15:54:10" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/security-core", "name": "symfony/security-core",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Security/Core", "target-dir": "Symfony/Component/Security/Core",
"source": { "source": {
"type": "git", "type": "git",
@@ -2238,17 +2238,17 @@
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Translation", "target-dir": "Symfony/Component/Translation",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Translation.git", "url": "https://github.com/symfony/Translation.git",
"reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af" "reference": "398e0eedcb89243ad34a10d079a4b6ea4c0b61ff"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Translation/zipball/bd939f05cdaca128f4ddbae1b447d6f0203b60af", "url": "https://api.github.com/repos/symfony/Translation/zipball/398e0eedcb89243ad34a10d079a4b6ea4c0b61ff",
"reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af", "reference": "398e0eedcb89243ad34a10d079a4b6ea4c0b61ff",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2282,32 +2282,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Translation Component", "description": "Symfony Translation Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-30 15:54:10" "time": "2015-05-05 16:51:00"
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/VarDumper", "target-dir": "Symfony/Component/VarDumper",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
"reference": "aafae00236e147568832de3c65ccb94cfc836278" "reference": "89eec96645fb44af4a454a26c74c72ba6311f5bc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/aafae00236e147568832de3c65ccb94cfc836278", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89eec96645fb44af4a454a26c74c72ba6311f5bc",
"reference": "aafae00236e147568832de3c65ccb94cfc836278", "reference": "89eec96645fb44af4a454a26c74c72ba6311f5bc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2338,22 +2338,22 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Nicolas Grekas", "name": "Nicolas Grekas",
"email": "p@tchwork.com" "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony mechanism for exploring and dumping PHP variables", "description": "Symfony mechanism for exploring and dumping PHP variables",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"keywords": [ "keywords": [
"debug", "debug",
"dump" "dump"
], ],
"time": "2015-03-31 08:12:29" "time": "2015-05-01 14:14:24"
}, },
{ {
"name": "twig/extensions", "name": "twig/extensions",
@@ -2517,29 +2517,29 @@
}, },
{ {
"name": "watson/validating", "name": "watson/validating",
"version": "1.0.0", "version": "1.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/dwightwatson/validating.git", "url": "https://github.com/dwightwatson/validating.git",
"reference": "9066ffd9342d1bf8a571d157df047e200a24e64a" "reference": "47320813a45cc35384e72364484d54fe44dcd3fb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dwightwatson/validating/zipball/9066ffd9342d1bf8a571d157df047e200a24e64a", "url": "https://api.github.com/repos/dwightwatson/validating/zipball/47320813a45cc35384e72364484d54fe44dcd3fb",
"reference": "9066ffd9342d1bf8a571d157df047e200a24e64a", "reference": "47320813a45cc35384e72364484d54fe44dcd3fb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/contracts": "~5.0", "illuminate/contracts": "5.0.*|5.1.*",
"illuminate/database": "~5.0", "illuminate/database": "5.0.*|5.1.*",
"illuminate/events": "~5.0", "illuminate/events": "5.0.*|5.1.*",
"illuminate/support": "~5.0", "illuminate/support": "5.0.*|5.1.*",
"illuminate/validation": "~5.0", "illuminate/validation": "5.0.*|5.1.*",
"php": ">=5.4.0" "php": ">=5.4.0"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "0.9.*", "mockery/mockery": "0.9.*",
"phpunit/phpunit": "4.2.*" "phpunit/phpunit": "~4.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -2568,7 +2568,7 @@
"laravel", "laravel",
"validation" "validation"
], ],
"time": "2015-03-17 10:52:36" "time": "2015-05-23 00:03:54"
} }
], ],
"packages-dev": [ "packages-dev": [
@@ -2888,16 +2888,16 @@
}, },
{ {
"name": "hamcrest/hamcrest-php", "name": "hamcrest/hamcrest-php",
"version": "v1.2.1", "version": "v1.2.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/hamcrest/hamcrest-php.git", "url": "https://github.com/hamcrest/hamcrest-php.git",
"reference": "ac50c470531243944f977b8de75be0b684a9cb51" "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/ac50c470531243944f977b8de75be0b684a9cb51", "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c",
"reference": "ac50c470531243944f977b8de75be0b684a9cb51", "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2929,7 +2929,7 @@
"keywords": [ "keywords": [
"test" "test"
], ],
"time": "2015-01-20 19:34:09" "time": "2015-05-11 14:41:42"
}, },
{ {
"name": "league/factory-muffin", "name": "league/factory-muffin",
@@ -4148,17 +4148,17 @@
}, },
{ {
"name": "symfony/class-loader", "name": "symfony/class-loader",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/ClassLoader", "target-dir": "Symfony/Component/ClassLoader",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/ClassLoader.git", "url": "https://github.com/symfony/ClassLoader.git",
"reference": "861765b3e5f32979de5bd19ad2577cbb830a29d5" "reference": "695134c9b39559297fa5d1dcff6a9054bb56facb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/ClassLoader/zipball/861765b3e5f32979de5bd19ad2577cbb830a29d5", "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/695134c9b39559297fa5d1dcff6a9054bb56facb",
"reference": "861765b3e5f32979de5bd19ad2577cbb830a29d5", "reference": "695134c9b39559297fa5d1dcff6a9054bb56facb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4184,32 +4184,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony ClassLoader Component", "description": "Symfony ClassLoader Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-27 10:19:51" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/config", "name": "symfony/config",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Config", "target-dir": "Symfony/Component/Config",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Config.git", "url": "https://github.com/symfony/Config.git",
"reference": "d91be01336605db8da21b79bc771e46a7276d1bc" "reference": "b6fddb4aa2daaa2b06f0040071ac131b4a1ecf25"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Config/zipball/d91be01336605db8da21b79bc771e46a7276d1bc", "url": "https://api.github.com/repos/symfony/Config/zipball/b6fddb4aa2daaa2b06f0040071ac131b4a1ecf25",
"reference": "d91be01336605db8da21b79bc771e46a7276d1bc", "reference": "b6fddb4aa2daaa2b06f0040071ac131b4a1ecf25",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4235,32 +4235,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Config Component", "description": "Symfony Config Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-30 15:54:10" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/stopwatch", "name": "symfony/stopwatch",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Stopwatch", "target-dir": "Symfony/Component/Stopwatch",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Stopwatch.git", "url": "https://github.com/symfony/Stopwatch.git",
"reference": "5f196e84b5640424a166d2ce9cca161ce1e9d912" "reference": "b470f87c69837cb71115f1fa720388bb19b63635"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Stopwatch/zipball/5f196e84b5640424a166d2ce9cca161ce1e9d912", "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b470f87c69837cb71115f1fa720388bb19b63635",
"reference": "5f196e84b5640424a166d2ce9cca161ce1e9d912", "reference": "b470f87c69837cb71115f1fa720388bb19b63635",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4285,32 +4285,32 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Stopwatch Component", "description": "Symfony Stopwatch Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-22 16:55:57" "time": "2015-05-02 15:18:45"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v2.6.6", "version": "v2.6.7",
"target-dir": "Symfony/Component/Yaml", "target-dir": "Symfony/Component/Yaml",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Yaml.git", "url": "https://github.com/symfony/Yaml.git",
"reference": "174f009ed36379a801109955fc5a71a49fe62dd4" "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/174f009ed36379a801109955fc5a71a49fe62dd4", "url": "https://api.github.com/repos/symfony/Yaml/zipball/f157ab074e453ecd4c0fa775f721f6e67a99d9e2",
"reference": "174f009ed36379a801109955fc5a71a49fe62dd4", "reference": "f157ab074e453ecd4c0fa775f721f6e67a99d9e2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4335,18 +4335,18 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "http://symfony.com", "homepage": "https://symfony.com",
"time": "2015-03-30 15:54:10" "time": "2015-05-02 15:18:45"
} }
], ],
"aliases": [], "aliases": [],

View File

@@ -56,6 +56,7 @@ return [
'asset' => 'Asset accounts', 'asset' => 'Asset accounts',
'expense' => 'Expense accounts', 'expense' => 'Expense accounts',
'revenue' => 'Revenue accounts', 'revenue' => 'Revenue accounts',
'cash' => 'Cash accounts',
], ],
'subIconsByIdentifier' => 'subIconsByIdentifier' =>
[ [

View File

@@ -0,0 +1,148 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* Class ChangesForV3409
*/
class ChangesForV3409 extends Migration
{
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// remove decryption, but this will destroy amounts.
Schema::table(
'accounts', function (Blueprint $table) {
$table->dropColumn('virtual_balance_encrypted');
}
);
Schema::table(
'bills', function (Blueprint $table) {
$table->dropColumn('amount_min_encrypted');
$table->dropColumn('amount_max_encrypted');
}
);
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->dropColumn('amount_encrypted');
}
);
Schema::table(
'limit_repetitions', function (Blueprint $table) {
$table->dropColumn('amount_encrypted');
}
);
Schema::table(
'piggy_bank_events', function (Blueprint $table) {
$table->dropColumn('amount_encrypted');
}
);
Schema::table(
'piggy_bank_repetitions', function (Blueprint $table) {
$table->dropColumn('currentamount_encrypted');
}
);
Schema::table(
'piggy_banks', function (Blueprint $table) {
$table->dropColumn('targetamount_encrypted');
}
);
Schema::table(
'preferences', function (Blueprint $table) {
$table->dropColumn('name_encrypted');
$table->dropColumn('data_encrypted');
}
);
Schema::table(
'transactions', function (Blueprint $table) {
$table->dropColumn('amount_encrypted');
}
);
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// encrypt account virtual balance:
Schema::table(
'accounts', function (Blueprint $table) {
$table->string('virtual_balance_encrypted')->nullable()->after('virtual_balance');
}
);
// encrypt bill amount_min and amount_max:
Schema::table(
'bills', function (Blueprint $table) {
$table->string('amount_min_encrypted')->nullable()->after('amount_min');
$table->string('amount_max_encrypted')->nullable()->after('amount_max');
}
);
// encrypt budget limit amount
Schema::table(
'budget_limits', function (Blueprint $table) {
$table->string('amount_encrypted')->nullable()->after('amount');
}
);
// encrypt limit repetition amount
Schema::table(
'limit_repetitions', function (Blueprint $table) {
$table->string('amount_encrypted')->nullable()->after('amount');
}
);
// encrypt piggy bank event amount
Schema::table(
'piggy_bank_events', function (Blueprint $table) {
$table->string('amount_encrypted')->nullable()->after('amount');
}
);
// encrypt piggy bank repetition currentamount
Schema::table(
'piggy_bank_repetitions', function (Blueprint $table) {
$table->string('currentamount_encrypted')->nullable()->after('currentamount');
}
);
// encrypt piggy bank targetamount
Schema::table(
'piggy_banks', function (Blueprint $table) {
$table->string('targetamount_encrypted')->nullable()->after('targetamount');
}
);
// encrypt preference name (add field)
// encrypt preference data (add field)
Schema::table(
'preferences', function (Blueprint $table) {
$table->text('name_encrypted')->nullable()->after('name');
$table->text('data_encrypted')->nullable()->after('data');
}
);
// encrypt transaction amount
Schema::table(
'transactions', function (Blueprint $table) {
$table->string('amount_encrypted')->nullable()->after('amount');
}
);
}
}

View File

@@ -134,7 +134,9 @@ class TestDataSeeder extends Seeder
$acc_a = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Checking account', 'active' => 1]); $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_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]); $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: // create account meta:
AccountMeta::create(['account_id' => $acc_a->id, 'name' => 'accountRole', 'data' => 'defaultAsset']); AccountMeta::create(['account_id' => $acc_a->id, 'name' => 'accountRole', 'data' => 'defaultAsset']);
@@ -514,27 +516,6 @@ class TestDataSeeder extends Seeder
return null; return null;
} }
/**
* @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;
}
/** /**
* @param $name * @param $name
* *
@@ -680,5 +661,26 @@ class TestDataSeeder extends Seeder
); );
} }
/**
* @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;
}
} }

View File

@@ -8,7 +8,7 @@ $(function () {
if (typeof budgetID !== 'undefined' && typeof repetitionID === 'undefined') { if (typeof budgetID !== 'undefined' && typeof repetitionID === 'undefined') {
googleColumnChart('chart/budget/' + budgetID + '/spending', 'budgetOverview'); googleColumnChart('chart/budget/' + budgetID, 'budgetOverview');
} }
if (typeof budgetID !== 'undefined' && typeof repetitionID !== 'undefined') { if (typeof budgetID !== 'undefined' && typeof repetitionID !== 'undefined') {
googleLineChart('chart/budget/' + budgetID + '/' + repetitionID, 'budgetOverview'); googleLineChart('chart/budget/' + budgetID + '/' + repetitionID, 'budgetOverview');
@@ -20,7 +20,7 @@ $(function () {
function updateSingleRange(e) { function updateSingleRange(e) {
// get some values: // get some values:
var input = $(e.target); var input = $(e.target);
var id = input.data('id'); var id = input.data('id');
var value = parseInt(input.val()); var value = parseInt(input.val());
var spent = parseFloat($('#spent-' + id).data('value')); var spent = parseFloat($('#spent-' + id).data('value'));
@@ -95,7 +95,9 @@ function updateTotal() {
} }
function updateIncome(e) { function updateIncome(e) {
$('#monthlyBudgetModal').empty().load('budgets/income').modal('show'); $('#monthlyBudgetModal').empty().load('budgets/income', function () {
$('#monthlyBudgetModal').modal('show');
});
return false; return false;
} }
@@ -112,7 +114,7 @@ function updateRanges() {
var value = parseInt(input.val()); var value = parseInt(input.val());
// calculate sum: // calculate sum:
sum += value sum += value;
// update small display: // update small display:
$('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2)); $('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2));

View File

@@ -6,7 +6,7 @@ $(function () {
ranges[currentMonthName] = [moment().startOf('month'), moment().endOf('month')]; ranges[currentMonthName] = [moment().startOf('month'), moment().endOf('month')];
ranges[previousMonthName] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]; ranges[previousMonthName] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')];
ranges[nextMonthName] = [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')]; ranges[nextMonthName] = [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')];
ranges['Everything'] = [firstDate, moment()]; ranges[everything] = [firstDate, moment()];
$('#daterange').daterangepicker( $('#daterange').daterangepicker(
{ {
@@ -15,10 +15,19 @@ $(function () {
//View::share('nextMonthName', $next); //View::share('nextMonthName', $next);
ranges: ranges ranges: ranges,
,
opens: 'left', opens: 'left',
locale: {
applyLabel: applyLabel,
cancelLabel: cancelLabel,
fromLabel: fromLabel,
toLabel: toLabel,
weekLabel: 'W',
customRangeLabel: customRangeLabel,
daysOfWeek: moment.weekdaysMin(),
monthNames: moment.monthsShort(),
firstDay: moment.localeData()._week.dow
},
format: 'DD-MM-YYYY', format: 'DD-MM-YYYY',
startDate: start, startDate: start,
endDate: end endDate: end

View File

@@ -2,73 +2,88 @@
return [ return [
'home' => 'Home', 'home' => 'Home',
// accounts
'asset_accounts' => 'Asset accounts', 'asset_accounts' => 'Asset accounts',
'expense_accounts' => 'Expense accounts', 'expense_accounts' => 'Expense accounts',
'revenue_accounts' => 'Revenue accounts', 'revenue_accounts' => 'Revenue accounts',
'cash_accounts' => 'Cash accounts',
'new_asset_account' => 'New asset accounts', 'new_asset_account' => 'New asset accounts',
'new_expense_account' => 'New expense account', 'new_expense_account' => 'New expense account',
'new_revenue_account' => 'New revenue account', 'new_revenue_account' => 'New revenue account',
'delete_account' => 'Delete account ":name"', 'delete_account' => 'Delete account ":name"',
'edit_account' => 'Edit account ":name"', 'edit_account' => 'Edit account ":name"',
'edit_asset_account' => 'Edit asset account ":name"',
'edit_expense_account' => 'Edit expense account ":name"',
'edit_revenue_account' => 'Edit revenue account ":name"',
// budgets
'budgets' => 'Budgets', 'budgets' => 'Budgets',
'newBudget' => 'Create a new budget', 'newBudget' => 'Create a new budget',
'delete_budget' => 'Delete budget ":name"', 'delete_budget' => 'Delete budget ":name"',
'edit_budget' => 'Edit budget ":name"', 'edit_budget' => 'Edit budget ":name"',
// categories
'categories' => 'Categories', 'categories' => 'Categories',
'newCategory' => 'Create a new categori', 'newCategory' => 'Create a new categori',
'delete_category' => 'Delete category ":name"', 'delete_category' => 'Delete category ":name"',
'edit_category' => 'Edit category ":name"', 'edit_category' => 'Edit category ":name"',
// currencies
'currencies' => 'Currencies', 'currencies' => 'Currencies',
'edit_currency' => 'Edit currencies ":name"', 'edit_currency' => 'Edit currencies ":name"',
'delete_currency' => 'Delete currencies ":name"', 'delete_currency' => 'Delete currencies ":name"',
// piggy banks
'piggyBanks' => 'Piggy banks', 'piggyBanks' => 'Piggy banks',
'newPiggyBank' => 'Create a new piggy bank', 'newPiggyBank' => 'Create a new piggy bank',
'edit_piggyBank' => 'Edit piggy bank ":name"', 'edit_piggyBank' => 'Edit piggy bank ":name"',
'delete_piggyBank' => 'Delete piggy bank ":name"', 'delete_piggyBank' => 'Delete piggy bank ":name"',
// top menu
'preferences' => 'Preferences', 'preferences' => 'Preferences',
'profile' => 'Profile', 'profile' => 'Profile',
'changePassword' => 'Change your password', 'changePassword' => 'Change your password',
// bills
'bills' => 'Bills', 'bills' => 'Bills',
'newBill' => 'New bill', 'newBill' => 'New bill',
'edit_bill' => 'Edit bill ":name"', 'edit_bill' => 'Edit bill ":name"',
'delete_bill' => 'Delete bill ":name"', 'delete_bill' => 'Delete bill ":name"',
// reminders
'reminders' => 'Reminders', 'reminders' => 'Reminders',
'reminder' => 'Reminder #:id', 'reminder' => 'Reminder #:id',
// reports
'reports' => 'Reports', 'reports' => 'Reports',
'monthly_report' => 'Montly report for :date', 'monthly_report' => 'Montly report for :date',
'monthly_report_shared' => 'Montly report for :date (including shared accounts)', 'monthly_report_shared' => 'Montly report for :date (including shared accounts)',
'yearly_report' => 'Yearly report for :date', 'yearly_report' => 'Yearly report for :date',
'yearly_report_shared' => 'Yearly report for :date (including shared accounts)', 'yearly_report_shared' => 'Yearly report for :date (including shared accounts)',
'budget_report' => 'Budget report for :date', 'budget_report' => 'Budget report for :date',
// search
'searchResult' => 'Search for ":query"', 'searchResult' => 'Search for ":query"',
// transaction lists.
'withdrawal_list' => 'Expenses', 'withdrawal_list' => 'Expenses',
'deposit_list' => 'Revenue, income and deposits', 'deposit_list' => 'Revenue, income and deposits',
'transfer_list' => 'Transfers', 'transfer_list' => 'Transfers',
'transfers_list' => 'Transfers', 'transfers_list' => 'Transfers',
// create transactions
'create_withdrawal' => 'Create new withdrawal', 'create_withdrawal' => 'Create new withdrawal',
'create_deposit' => 'Create new deposit', 'create_deposit' => 'Create new deposit',
'create_transfer' => 'Create new transfer', 'create_transfer' => 'Create new transfer',
// edit transactions
'edit_journal' => 'Edit transaction ":description"', 'edit_journal' => 'Edit transaction ":description"',
'delete_journal' => 'Delete transaction ":description"', 'delete_journal' => 'Delete transaction ":description"',
// tags
'tags' => 'Tags', 'tags' => 'Tags',
'createTag' => 'Create new tag', 'createTag' => 'Create new tag',
'edit_tag' => 'Edit tag ":tag"', 'edit_tag' => 'Edit tag ":tag"',
'delete_tag' => 'Delete tag ":tag"', 'delete_tag' => 'Delete tag ":tag"',
]; ];

View File

@@ -1,161 +1,214 @@
<?php <?php
// general fields and things.
return [ return [
'test' => 'You have selected English.', 'test' => 'You have selected English.',
'close' => 'Close', 'close' => 'Close',
'pleaseHold' => 'Please hold...', 'pleaseHold' => 'Please hold...',
'mandatoryFields' => 'Mandatory fields', 'mandatoryFields' => 'Mandatory fields',
'optionalFields' => 'Optional fields', 'optionalFields' => 'Optional fields',
'options' => 'Options', 'options' => 'Options',
'something' => 'Something!', 'something' => 'Something!',
'actions' => 'Actions', 'actions' => 'Actions',
'edit' => 'Edit', 'edit' => 'Edit',
'delete' => 'Delete', 'delete' => 'Delete',
'welcomeBack' => 'What\'s playing?', 'welcomeBack' => 'What\'s playing?',
'everything' => 'Everything',
'customRange' => 'Custom range',
'apply' => 'Apply',
'cancel' => 'Cancel',
'from' => 'From',
'to' => 'To',
'showEverything' => 'Show everything',
'create_new_budget' => 'Create a new budget',
'store_new_budget' => ' Store new budget',
'availableIn' => 'Available in :date',
'transactionsWithoutBudget' => 'Expenses without budget',
'transactionsWithoutBudgetDate' => 'Expenses without budget in :date',
'createBudget' => 'New budget',
'inactiveBudgets' => 'Inactive budgets',
// accounts:
'details_for_asset' => 'Details for asset account ":name"',
'details_for_expense' => 'Details for expense account ":name"',
'details_for_revenue' => 'Details for revenue account ":name"',
'details_for_cash' => 'Details for cash account ":name"',
'store_new_asset_account' => 'Store new asset account',
'store_new_expense_account' => 'Store new expense account',
'store_new_revenue_account' => 'Store new revenue account',
'edit_asset_account' => 'Edit asset account ":name"',
'edit_expense_account' => 'Edit expense account ":name"',
'edit_revenue_account' => 'Edit revenue account ":name"',
'delete_asset_account' => 'Delete asset account ":name"',
'delete_expense_account' => 'Delete expense account ":name"',
'delete_revenue_account' => 'Delete revenue account ":name"',
'asset_deleted' => 'Successfully deleted asset account ":name"',
'expense_deleted' => 'Successfully deleted expense account ":name"',
'revenue_deleted' => 'Successfully deleted revenue account ":name"',
'update_asset_account' => 'Update asset account',
'update_expense_account' => 'Update expense account',
'update_revenue_account' => 'Update revenue account',
'make_new_asset_account' => 'New asset account',
'make_new_expense_account' => 'New expense account',
'make_new_revenue_account' => 'New revenue account',
// categories:
'new_category' => 'New category',
'without_category' => 'Without a category',
'update_category' => 'Wijzig categorie',
'categories' => 'Categories',
'no_category' => '(no category)',
'category' => 'Category',
// new user: // new user:
'welcome' => 'Welcome to Firefly!', 'welcome' => 'Welcome to Firefly!',
'createNewAsset' => 'Create a new asset account to get started. This will allow you to create transactions and start your financial management', 'createNewAsset' => 'Create a new asset account to get started. This will allow you to create transactions and start your financial management',
'createNewAssetButton' => 'Create new asset account', 'createNewAssetButton' => 'Create new asset account',
// home page: // home page:
'yourAccounts' => 'Your accounts', 'yourAccounts' => 'Your accounts',
'budgetsAndSpending' => 'Budgets and spending', 'budgetsAndSpending' => 'Budgets and spending',
'savings' => 'Savings', 'savings' => 'Savings',
'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel', 'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel',
'createPiggyToContinue' => 'Create piggy banks to fill this panel.', 'createPiggyToContinue' => 'Create piggy banks to fill this panel.',
'newWithdrawal' => 'New expense', 'newWithdrawal' => 'New expense',
'newDeposit' => 'New deposit', 'newDeposit' => 'New deposit',
'newTransfer' => 'New transfer', 'newTransfer' => 'New transfer',
'moneyIn' => 'Money in', 'moneyIn' => 'Money in',
'moneyOut' => 'Money out', 'moneyOut' => 'Money out',
'billsToPay' => 'Bills to pay', 'billsToPay' => 'Bills to pay',
'billsPaid' => 'Bills paid', 'billsPaid' => 'Bills paid',
'viewDetails' => 'View details', 'viewDetails' => 'View details',
'divided' => 'divided', 'divided' => 'divided',
'toDivide' => 'left to divide', 'toDivide' => 'left to divide',
// menu and titles, should be recycled as often as possible: // menu and titles, should be recycled as often as possible:
'toggleNavigation' => 'Toggle navigation', 'toggleNavigation' => 'Toggle navigation',
'seeAllReminders' => 'See all reminders', 'seeAllReminders' => 'See all reminders',
'reminders' => 'Reminders', 'reminders' => 'Reminders',
'currency' => 'Currency', 'currency' => 'Currency',
'preferences' => 'Preferences', 'preferences' => 'Preferences',
'logout' => 'Logout', 'logout' => 'Logout',
'searchPlaceholder' => 'Search...', 'searchPlaceholder' => 'Search...',
'dashboard' => 'Dashboard', 'dashboard' => 'Dashboard',
'currencies' => 'Currencies', 'currencies' => 'Currencies',
'accounts' => 'Accounts', 'accounts' => 'Accounts',
'assetAccounts' => 'Asset accounts', 'assetAccounts' => 'Asset accounts',
'expenseAccounts' => 'Expense accounts', 'expenseAccounts' => 'Expense accounts',
'revenueAccounts' => 'Revenue accounts', 'revenueAccounts' => 'Revenue accounts',
'Asset account' => 'Asset account', 'Asset account' => 'Asset account',
'Default account' => 'Asset account', 'Default account' => 'Asset account',
'Expense account' => 'Expense account', 'Expense account' => 'Expense account',
'Revenue account' => 'Revenue account', 'Revenue account' => 'Revenue account',
'budgets' => 'Budgets', 'budgets' => 'Budgets',
'categories' => 'Categories', 'tags' => 'Tags',
'tags' => 'Tags', 'reports' => 'Reports',
'reports' => 'Reports', 'transactions' => 'Transactions',
'transactions' => 'Transactions', 'expenses' => 'Expenses',
'expenses' => 'Expenses', 'income' => 'Revenue / income',
'income' => 'Revenue / income', 'transfers' => 'Transfer',
'transfers' => 'Transfer', 'moneyManagement' => 'Money management',
'moneyManagement' => 'Money management', 'piggyBanks' => 'Piggy banks',
'piggyBanks' => 'Piggy banks', 'bills' => 'Bills',
'bills' => 'Bills', 'createNew' => 'Create new',
'createNew' => 'Create new', 'withdrawal' => 'Withdrawal',
'withdrawal' => 'Withdrawal', 'deposit' => 'Deposit',
'deposit' => 'Deposit', 'transfer' => 'Transfer',
'transfer' => 'Transfer', 'Withdrawal' => 'Withdrawal',
'Withdrawal' => 'Withdrawal', 'Deposit' => 'Deposit',
'Deposit' => 'Deposit', 'Transfer' => 'Transfer',
'Transfer' => 'Transfer', 'bill' => 'Rekening',
'bill' => 'Rekening', 'yes' => 'Yes',
'yes' => 'Yes', 'no' => 'No',
'no' => 'No', 'amount' => 'Amount',
'amount' => 'Amount', 'newBalance' => 'New balance',
'newBalance' => 'New balance', 'overview' => 'Overview',
'overview' => 'Overview', 'saveOnAccount' => 'Save on account',
'saveOnAccount' => 'Save on account', 'unknown' => 'Unknown',
'unknown' => 'Unknown', 'daily' => 'Daily',
'daily' => 'Daily', 'weekly' => 'Weekly',
'weekly' => 'Weekly', 'monthly' => 'Monthly',
'monthly' => 'Monthly', 'quarterly' => 'Quarterly',
'quarterly' => 'Quarterly', 'half-year' => 'Every six months',
'half-year' => 'Every six months', 'yearly' => 'Yearly',
'yearly' => 'Yearly',
'reportForYear' => 'Yearly report for :year', 'reportForYear' => 'Yearly report for :year',
'reportForYearShared' => 'Yearly report for :year (including shared accounts)', 'reportForYearShared' => 'Yearly report for :year (including shared accounts)',
'reportForMonth' => 'Montly report for :year', 'reportForMonth' => 'Montly report for :year',
'reportForMonthShared' => 'Montly report for :year (including shared accounts)', 'reportForMonthShared' => 'Montly report for :year (including shared accounts)',
'incomeVsExpenses' => 'Income vs. expenses', 'incomeVsExpenses' => 'Income vs. expenses',
'accountBalances' => 'Account balances', 'accountBalances' => 'Account balances',
'balanceStartOfYear' => 'Balance at start of year', 'balanceStartOfYear' => 'Balance at start of year',
'balanceEndOfYear' => 'Balance at end of year', 'balanceEndOfYear' => 'Balance at end of year',
'balanceStartOfMonth' => 'Balance at end of month', 'balanceStartOfMonth' => 'Balance at end of month',
'balanceEndOfMonth' => 'Balance at end of month', 'balanceEndOfMonth' => 'Balance at end of month',
'balanceStart' => 'Balance at end of period', 'balanceStart' => 'Balance at end of period',
'balanceEnd' => 'Balance at end of period', 'balanceEnd' => 'Balance at end of period',
'reportsOwnAccounts' => 'Reports for your own accounts', 'reportsOwnAccounts' => 'Reports for your own accounts',
'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts', 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts',
'account' => 'Account', 'account' => 'Account',
'splitByAccount' => 'Split by account', 'splitByAccount' => 'Split by account',
'balancedByTransfersAndTags' => 'Balanced by transfers and tags', 'balancedByTransfersAndTags' => 'Balanced by transfers and tags',
'leftUnbalanced' => 'Left unbalanced', 'coveredWithTags' => 'Covered with tags',
'expectedBalance' => 'Expected balance', 'leftUnbalanced' => 'Left unbalanced',
'outsideOfBudgets' => 'Outside of budgets', 'expectedBalance' => 'Expected balance',
'leftInBudget' => 'Left in budget', 'outsideOfBudgets' => 'Outside of budgets',
'leftInBudget' => 'Left in budget',
'sumOfSums' => 'Sum of sums', 'sumOfSums' => 'Sum of sums',
'notCharged' => 'Not charged (yet)', 'notCharged' => 'Not charged (yet)',
'inactive' => 'Inactive', 'inactive' => 'Inactive',
'difference' => 'Difference', 'difference' => 'Difference',
'in' => 'In', 'in' => 'In',
'out' => 'Out', 'out' => 'Out',
'topX' => 'top :number', 'topX' => 'top :number',
'showTheRest' => 'Show everything', 'showTheRest' => 'Show everything',
'hideTheRest' => 'Show only the top :number', 'hideTheRest' => 'Show only the top :number',
// charts: // charts:
'dayOfMonth' => 'Day of the month', 'dayOfMonth' => 'Day of the month',
'month' => 'Month', 'month' => 'Month',
'budget' => 'Budget', 'budget' => 'Budget',
'spent' => 'Spent', 'spent' => 'Spent',
'overspent' => 'Overspent', 'overspent' => 'Overspent',
'left' => 'Left', 'left' => 'Left',
'noCategory' => '(no category)', 'noBudget' => '(no budget)',
'noBudget' => '(no budget)', 'maxAmount' => 'Maximum amount',
'category' => 'Category', 'minAmount' => 'Minumum amount',
'maxAmount' => 'Maximum amount', 'billEntry' => 'Current bill entry',
'minAmount' => 'Minumum amount', 'name' => 'Name',
'billEntry' => 'Current bill entry', 'date' => 'Date',
'name' => 'Name', 'paid' => 'Paid',
'date' => 'Date', 'unpaid' => 'Unpaid',
'paid' => 'Paid', 'day' => 'Day',
'unpaid' => 'Unpaid', 'budgeted' => 'Budgeted',
'day' => 'Day', 'period' => 'Period',
'budgeted' => 'Budgeted', 'balance' => 'Balance',
'period' => 'Period', 'summary' => 'Summary',
'balance' => 'Balance', 'sum' => 'Sum',
'summary' => 'Summary', 'average' => 'Average',
'sum' => 'Sum', 'balanceFor' => 'Balance for :name',
'average' => 'Average',
'balanceFor' => 'Balance for :name',
'asset_accounts' => 'Asset accounts', 'asset_accounts' => 'Asset accounts',
'expense_accounts' => 'Expense accounts', 'expense_accounts' => 'Expense accounts',
'revenue_accounts' => 'Revenue accounts', 'revenue_accounts' => 'Revenue accounts',
// some extra help: // some extra help:
'accountExtraHelp_asset' => '', 'accountExtraHelp_asset' => '',
'accountExtraHelp_expense' => '', 'accountExtraHelp_expense' => '',
'accountExtraHelp_revenue' => '', 'accountExtraHelp_revenue' => '',
]; ];

View File

@@ -13,7 +13,7 @@ return [
'openingBalance' => 'Opening balance', 'openingBalance' => 'Opening balance',
'tagMode' => 'Tag mode', 'tagMode' => 'Tag mode',
'tagPosition' => 'Tag location', 'tagPosition' => 'Tag location',
'virtualBalance' => 'Vitual balance', 'virtualBalance' => 'Virtual balance',
'longitude_latitude' => 'Location', 'longitude_latitude' => 'Location',
'targetamount' => 'Target amount', 'targetamount' => 'Target amount',
'accountRole' => 'Account role', 'accountRole' => 'Account role',
@@ -75,4 +75,4 @@ return [
'|All :count transactions connected to this budget will spared deletion.', '|All :count transactions connected to this budget will spared deletion.',
'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.' . 'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.' .
'|All :count transactions connected to this category will spared deletion.', '|All :count transactions connected to this category will spared deletion.',
]; ];

View File

@@ -29,4 +29,4 @@ return [
'transfer' => 'Transfer', 'transfer' => 'Transfer',
'type' => 'Type', 'type' => 'Type',
'completed' => 'Completed', 'completed' => 'Completed',
]; ];

View File

@@ -2,48 +2,59 @@
return [ return [
'home' => 'Home', 'home' => 'Home',
// accounts
'asset_accounts' => 'Betaalrekeningen', 'asset_accounts' => 'Betaalrekeningen',
'expense_accounts' => 'Crediteuren', 'expense_accounts' => 'Crediteuren',
'revenue_accounts' => 'Debiteuren', 'revenue_accounts' => 'Debiteuren',
'cash_accounts' => 'Contant geldrekeningen',
'new_asset_account' => 'Nieuwe betaalrekening', 'new_asset_account' => 'Nieuwe betaalrekening',
'new_expense_account' => 'Nieuwe crediteur', 'new_expense_account' => 'Nieuwe crediteur',
'new_revenue_account' => 'Nieuwe debiteur', 'new_revenue_account' => 'Nieuwe debiteur',
'delete_account' => 'Verwijder rekening ":name"', 'delete_account' => 'Verwijder rekening ":name"',
'edit_account' => 'Wijzig rekening ":name"', 'edit_account' => 'Wijzig rekening ":name"',
'edit_asset_account' => 'Wijzig betaalrekening ":name"',
'edit_expense_account' => 'Wijzig crediteur ":name"',
'edit_revenue_account' => 'Wijzig debiteur ":name"',
// budgets
'budgets' => 'Budgetten', 'budgets' => 'Budgetten',
'newBudget' => 'Maak een nieuw budget', 'newBudget' => 'Maak een nieuw budget',
'delete_budget' => 'Verwijder budget ":name"', 'delete_budget' => 'Verwijder budget ":name"',
'edit_budget' => 'Wijzig budget ":name"', 'edit_budget' => 'Wijzig budget ":name"',
// categories
'categories' => 'Categorieën', 'categories' => 'Categorieën',
'newCategory' => 'Maak een nieuw categorie', 'newCategory' => 'Maak een nieuw categorie',
'delete_category' => 'Verwijder categorie ":name"', 'delete_category' => 'Verwijder categorie ":name"',
'edit_category' => 'Wijzig categorie ":name"', 'edit_category' => 'Wijzig categorie ":name"',
// currencies
'currencies' => 'Munteenheden', 'currencies' => 'Munteenheden',
'edit_currency' => 'Wijzig munteenheid ":name"', 'edit_currency' => 'Wijzig munteenheid ":name"',
'delete_currency' => 'Verwijder munteenheid ":name"', 'delete_currency' => 'Verwijder munteenheid ":name"',
// piggy banks
'piggyBanks' => 'Spaarpotjes', 'piggyBanks' => 'Spaarpotjes',
'newPiggyBank' => 'Nieuw spaarpotje', 'newPiggyBank' => 'Nieuw spaarpotje',
'edit_piggyBank' => 'Wijzig spaarpotje ":name"', 'edit_piggyBank' => 'Wijzig spaarpotje ":name"',
'delete_piggyBank' => 'Verwijder spaarportje ":name"', 'delete_piggyBank' => 'Verwijder spaarportje ":name"',
// top menu
'preferences' => 'Voorkeuren', 'preferences' => 'Voorkeuren',
'profile' => 'Profiel', 'profile' => 'Profiel',
'changePassword' => 'Verander je wachtwoord', 'changePassword' => 'Verander je wachtwoord',
// bills
'bills' => 'Rekeningen', 'bills' => 'Rekeningen',
'newBill' => 'Nieuwe rekening', 'newBill' => 'Nieuwe rekening',
'edit_bill' => 'Wijzig rekening ":name"', 'edit_bill' => 'Wijzig rekening ":name"',
'delete_bill' => 'Verwijder rekening ":name"', 'delete_bill' => 'Verwijder rekening ":name"',
// reminders
'reminders' => 'Herinneringen', 'reminders' => 'Herinneringen',
'reminder' => 'Herinnering #:id', 'reminder' => 'Herinnering #:id',
// reports
'reports' => 'Overzichten', 'reports' => 'Overzichten',
'monthly_report' => 'Maandoverzicht :date', 'monthly_report' => 'Maandoverzicht :date',
'monthly_report_shared' => 'Maandoverzicht :date (inclusief gedeelde rekeningen)', 'monthly_report_shared' => 'Maandoverzicht :date (inclusief gedeelde rekeningen)',
@@ -51,23 +62,28 @@ return [
'yearly_report_shared' => 'Jaaroverzicht :date (inclusief gedeelde rekeningen)', 'yearly_report_shared' => 'Jaaroverzicht :date (inclusief gedeelde rekeningen)',
'budget_report' => 'Budgetoverzicht :date', 'budget_report' => 'Budgetoverzicht :date',
// search
'searchResult' => 'Zoeken naar ":query"', 'searchResult' => 'Zoeken naar ":query"',
// transaction lists.
'withdrawal_list' => 'Uitgaven', 'withdrawal_list' => 'Uitgaven',
'deposit_list' => 'Inkomsten', 'deposit_list' => 'Inkomsten',
'transfer_list' => 'Overschrijvingen', 'transfer_list' => 'Overschrijvingen',
'transfers_list' => 'Overschrijvingen', 'transfers_list' => 'Overschrijvingen',
// create transactions
'create_withdrawal' => 'Sla nieuwe uitgave op', 'create_withdrawal' => 'Sla nieuwe uitgave op',
'create_deposit' => 'Sla nieuwe inkomsten op', 'create_deposit' => 'Sla nieuwe inkomsten op',
'create_transfer' => 'Sla nieuwe overschrijving op', 'create_transfer' => 'Sla nieuwe overschrijving op',
// edit transactions
'edit_journal' => 'Wijzig transactie ":description"', 'edit_journal' => 'Wijzig transactie ":description"',
'delete_journal' => 'Verwijder transactie ":description"', 'delete_journal' => 'Verwijder transactie ":description"',
// tags
'tags' => 'Tags', 'tags' => 'Tags',
'createTag' => 'Maak nieuwe tag', 'createTag' => 'Maak nieuwe tag',
'edit_tag' => 'Wijzig tag ":tag"', 'edit_tag' => 'Wijzig tag ":tag"',
'delete_tag' => 'Verwijder tag ":tag"', 'delete_tag' => 'Verwijder tag ":tag"',
]; ];

View File

@@ -1,169 +1,222 @@
<?php <?php
// general fields and things.
return [ return [
'test' => 'Nederlands geselecteerd!', 'test' => 'Nederlands geselecteerd!',
'close' => 'Sluiten', 'close' => 'Sluiten',
'pleaseHold' => 'Momentje...', 'pleaseHold' => 'Momentje...',
'mandatoryFields' => 'Verplichte velden', 'mandatoryFields' => 'Verplichte velden',
'optionalFields' => 'Optionele velden', 'optionalFields' => 'Optionele velden',
'options' => 'Opties', 'options' => 'Opties',
'something' => 'Iets!', 'something' => 'Iets!',
'actions' => 'Acties', 'actions' => 'Acties',
'edit' => 'Wijzig', 'edit' => 'Wijzig',
'delete' => 'Verwijder', 'delete' => 'Verwijder',
'welcomeBack' => 'Hoe staat het er voor?', 'welcomeBack' => 'Hoe staat het er voor?',
'everything' => 'Alles',
'customRange' => 'Zelf bereik kiezen',
'apply' => 'Go',
'cancel' => 'Annuleren',
'from' => 'Van',
'to' => 'Tot',
'showEverything' => 'Laat alles zien',
'create_new_budget' => 'Maak een nieuw budget',
'store_new_budget' => 'Sla nieuw budget op',
'availableIn' => 'Beschikbaar in :date',
'transactionsWithoutBudget' => 'Uitgaven zonder budget',
'transactionsWithoutBudgetDate' => 'Uitgaven zonder budget in :date',
'createBudget' => 'Maak nieuw budget',
'inactiveBudgets' => 'Inactieve budgetten',
// accounts:
'details_for_asset' => 'Overzicht voor betaalrekening ":name"',
'details_for_expense' => 'Overzicht voor crediteur ":name"',
'details_for_revenue' => 'Overzicht voor debiteur ":name"',
'details_for_cash' => 'Overzicht voor contant geldrekening ":name"',
'store_new_asset_account' => 'Sla nieuwe betaalrekening op',
'store_new_expense_account' => 'Sla nieuwe crediteur op',
'store_new_revenue_account' => 'Sla nieuwe debiteur op',
'edit_asset_account' => 'Wijzig betaalrekening ":name"',
'edit_expense_account' => 'Wijzig crediteur ":name"',
'edit_revenue_account' => 'Wijzig debiteur ":name"',
'delete_asset_account' => 'Verwijder betaalrekening ":name"',
'delete_expense_account' => 'Verwijder crediteur ":name"',
'delete_revenue_account' => 'Verwijder debiteur ":name"',
'asset_deleted' => 'Betaalrekening ":name" is verwijderd.',
'expense_deleted' => 'Crediteur ":name" is verwijderd.',
'revenue_deleted' => 'Debiteur ":name" is verwijderd.',
'update_asset_account' => 'Wijzig betaalrekening',
'update_expense_account' => 'Wijzig crediteur',
'update_revenue_account' => 'Wijzig debiteur',
'make_new_asset_account' => 'Nieuwe betaalrekening',
'make_new_expense_account' => 'Nieuwe crediteur',
'make_new_revenue_account' => 'Nieuwe debiteur',
// categories:
'new_category' => 'Nieuwe categorie',
'without_category' => 'Zonder categorie',
'update_category' => 'Wijzig categorie',
'categories' => 'Categorieën',
'no_category' => '(geen categorie)',
'category' => 'Categorie',
// new user: // new user:
'welcome' => 'Welkom bij Firefly!', 'welcome' => 'Welkom bij Firefly!',
'createNewAsset' => 'Maak om te beginnen een nieuwe betaalrekening. Dit is je start van je financiële beheer.', 'createNewAsset' => 'Maak om te beginnen een nieuwe betaalrekening. Dit is je start van je financiële beheer.',
'createNewAssetButton' => 'Maak een nieuwe betaalrekening', 'createNewAssetButton' => 'Maak een nieuwe betaalrekening',
// home page: // home page:
'yourAccounts' => 'Je betaalrekeningen', 'yourAccounts' => 'Je betaalrekeningen',
'budgetsAndSpending' => 'Budgetten en uitgaven', 'budgetsAndSpending' => 'Budgetten en uitgaven',
'savings' => 'Sparen', 'savings' => 'Sparen',
'markAsSavingsToContinue' => 'Om hier wat te zien stel je je betaalrekeningen in als "spaarrekening".', 'markAsSavingsToContinue' => 'Om hier wat te zien stel je je betaalrekeningen in als "spaarrekening".',
'createPiggyToContinue' => 'Maak spaarpotjes om hier iets te zien.', 'createPiggyToContinue' => 'Maak spaarpotjes om hier iets te zien.',
'newWithdrawal' => 'Nieuwe uitgave', 'newWithdrawal' => 'Nieuwe uitgave',
'newDeposit' => 'Nieuwe inkomsten', 'newDeposit' => 'Nieuwe inkomsten',
'newTransfer' => 'Nieuwe overschrijving', 'newTransfer' => 'Nieuwe overschrijving',
'moneyIn' => 'Inkomsten', 'moneyIn' => 'Inkomsten',
'moneyOut' => 'Uitgaven', 'moneyOut' => 'Uitgaven',
'billsToPay' => 'Openstaande rekeningen', 'billsToPay' => 'Openstaande rekeningen',
'billsPaid' => 'Betaalde rekeningen', 'billsPaid' => 'Betaalde rekeningen',
'viewDetails' => 'Meer info', 'viewDetails' => 'Meer info',
'divided' => 'verdeeld', 'divided' => 'verdeeld',
'toDivide' => 'te verdelen', 'toDivide' => 'te verdelen',
// menu and titles, should be recycled as often as possible: // menu and titles, should be recycled as often as possible:
'toggleNavigation' => 'Navigatie aan of uit', 'toggleNavigation' => 'Navigatie aan of uit',
'seeAllReminders' => 'Bekijk alle herinneringen', 'seeAllReminders' => 'Bekijk alle herinneringen',
'reminders' => 'Herinneringen', 'reminders' => 'Herinneringen',
'currency' => 'Munteenheden', 'currency' => 'Munteenheden',
'preferences' => 'Voorkeuren', 'preferences' => 'Voorkeuren',
'logout' => 'Uitloggen', 'logout' => 'Uitloggen',
'searchPlaceholder' => 'Zoeken...', 'searchPlaceholder' => 'Zoeken...',
'dashboard' => 'Dashboard', 'dashboard' => 'Dashboard',
'currencies' => 'Munteenheden', 'currencies' => 'Munteenheden',
'accounts' => 'Rekeningen', 'accounts' => 'Rekeningen',
'assetAccounts' => 'Betaalrekeningen', 'assetAccounts' => 'Betaalrekeningen',
'expenseAccounts' => 'Crediteuren', 'expenseAccounts' => 'Crediteuren',
'revenueAccounts' => 'Debiteuren', 'revenueAccounts' => 'Debiteuren',
'Asset account' => 'Betaalrekening', 'Asset account' => 'Betaalrekening',
'Default account' => 'Betaalrekening', 'Default account' => 'Betaalrekening',
'Expense account' => 'Crediteur', 'Expense account' => 'Crediteur',
'Revenue account' => 'Debiteur', 'Revenue account' => 'Debiteur',
'budgets' => 'Budgetten', 'budgets' => 'Budgetten',
'categories' => 'Categorieën', 'tags' => 'Tags',
'tags' => 'Tags', 'reports' => 'Overzichten',
'reports' => 'Overzichten', 'transactions' => 'Transacties',
'transactions' => 'Transacties', 'expenses' => 'Uitgaven',
'expenses' => 'Uitgaven', 'income' => 'Inkomsten',
'income' => 'Inkomsten', 'transfers' => 'Overschrijvingen',
'transfers' => 'Overschrijvingen', 'moneyManagement' => 'Geldbeheer',
'moneyManagement' => 'Geldbeheer', 'piggyBanks' => 'Spaarpotjes',
'piggyBanks' => 'Spaarpotjes', 'bills' => 'Rekeningen',
'bills' => 'Rekeningen', 'createNew' => 'Nieuw',
'createNew' => 'Nieuw', 'withdrawal' => 'Uitgave',
'withdrawal' => 'Uitgave', 'deposit' => 'Inkomsten',
'deposit' => 'Inkomsten', 'transfer' => 'Overschrijving',
'transfer' => 'Overschrijving', 'Withdrawal' => 'Uitgave',
'Withdrawal' => 'Uitgave', 'Deposit' => 'Inkomsten',
'Deposit' => 'Inkomsten', 'Transfer' => 'Overschrijving',
'Transfer' => 'Overschrijving', 'bill' => 'Rekening',
'bill' => 'Rekening', 'yes' => 'Ja',
'yes' => 'Ja', 'no' => 'Nee',
'no' => 'Nee', 'amount' => 'Bedrag',
'amount' => 'Bedrag', 'newBalance' => 'Nieuw saldo',
'newBalance' => 'Nieuw saldo', 'overview' => 'Overzicht',
'overview' => 'Overzicht', 'saveOnAccount' => 'Sparen op rekening',
'saveOnAccount' => 'Sparen op rekening', 'unknown' => 'Onbekend',
'unknown' => 'Onbekend', 'daily' => 'Dagelijks',
'daily' => 'Dagelijks', 'weekly' => 'Wekelijks',
'weekly' => 'Wekelijks', 'monthly' => 'Maandelijks',
'monthly' => 'Maandelijks', 'quarterly' => 'Elk kwartaal',
'quarterly' => 'Elk kwartaal', 'half-year' => 'Elk half jaar',
'half-year' => 'Elk half jaar', 'yearly' => 'Jaarlijks',
'yearly' => 'Jaarlijks',
'reportForYear' => 'Jaaroverzicht :year', 'reportForYear' => 'Jaaroverzicht :year',
'reportForYearShared' => 'Jaaroverzicht :year (inclusief gedeelde rekeningen)', 'reportForYearShared' => 'Jaaroverzicht :year (inclusief gedeelde rekeningen)',
'reportForMonth' => 'Maandoverzicht van :date', 'reportForMonth' => 'Maandoverzicht van :date',
'reportForMonthShared' => 'Maandoverzicht van :date (inclusief gedeelde rekeningen)', 'reportForMonthShared' => 'Maandoverzicht van :date (inclusief gedeelde rekeningen)',
'incomeVsExpenses' => 'Inkomsten tegenover uitgaven', 'incomeVsExpenses' => 'Inkomsten tegenover uitgaven',
'accountBalances' => 'Rekeningsaldi', 'accountBalances' => 'Rekeningsaldi',
'balanceStartOfYear' => 'Saldo aan het begin van het jaar', 'balanceStartOfYear' => 'Saldo aan het begin van het jaar',
'balanceEndOfYear' => 'Saldo aan het einde van het jaar', 'balanceEndOfYear' => 'Saldo aan het einde van het jaar',
'balanceStartOfMonth' => 'Saldo aan het einde van de maand', 'balanceStartOfMonth' => 'Saldo aan het begin van de maand',
'balanceEndOfMonth' => 'Saldo aan het einde van de maand', 'balanceEndOfMonth' => 'Saldo aan het einde van de maand',
'balanceStart' => 'Saldo aan het einde van de periode', 'balanceStart' => 'Saldo aan het begin van de periode',
'balanceEnd' => 'Saldo aan het einde van de periode', 'balanceEnd' => 'Saldo aan het einde van de periode',
'reportsOwnAccounts' => 'Overzichten voor je eigen betaalrekeningen', 'reportsOwnAccounts' => 'Overzichten voor je eigen betaalrekeningen',
'reportsOwnAccountsAndShared' => 'Overzichten voor je eigen betaalrekeningen en gedeelde rekeningen', 'reportsOwnAccountsAndShared' => 'Overzichten voor je eigen betaalrekeningen en gedeelde rekeningen',
'account' => 'Rekening', 'account' => 'Rekening',
'splitByAccount' => 'Per betaalrekening', 'splitByAccount' => 'Per betaalrekening',
'balancedByTransfersAndTags' => 'Gecorrigeerd met overschrijvingen en tags', 'balancedByTransfersAndTags' => 'Gecorrigeerd met overschrijvingen en tags',
'coveredWithTags' => 'Gecorrigeerd met tags', 'coveredWithTags' => 'Gecorrigeerd met tags',
'leftUnbalanced' => 'Ongecorrigeerd', 'leftUnbalanced' => 'Ongecorrigeerd',
'expectedBalance' => 'Verwacht saldo', 'expectedBalance' => 'Verwacht saldo',
'outsideOfBudgets' => 'Buiten budgetten', 'outsideOfBudgets' => 'Buiten budgetten',
'leftInBudget' => 'Over van budget', 'leftInBudget' => 'Over van budget',
'sumOfSums' => 'Alles bij elkaar', 'sumOfSums' => 'Alles bij elkaar',
'notCharged' => '(Nog) niet betaald', 'notCharged' => '(Nog) niet betaald',
'inactive' => 'Niet actief', 'inactive' => 'Niet actief',
'difference' => 'Verschil', 'difference' => 'Verschil',
'in' => 'In', 'in' => 'In',
'out' => 'Uit', 'out' => 'Uit',
'topX' => 'top :number', 'topX' => 'top :number',
'showTheRest' => 'Laat alles zien', 'showTheRest' => 'Laat alles zien',
'hideTheRest' => 'Laat alleen de top :number zien', 'hideTheRest' => 'Laat alleen de top :number zien',
// charts: // charts:
'dayOfMonth' => 'Dag vd maand', 'dayOfMonth' => 'Dag vd maand',
'month' => 'Maand', 'month' => 'Maand',
'budget' => 'Budget', 'budget' => 'Budget',
'spent' => 'Uitgegeven', 'spent' => 'Uitgegeven',
'overspent' => 'Teveel uitgegeven', 'overspent' => 'Teveel uitgegeven',
'left' => 'Over', 'left' => 'Over',
'noCategory' => '(geen categorie)', 'noBudget' => '(geen budget)',
'noBudget' => '(geen budget)', 'maxAmount' => 'Maximaal bedrag',
'category' => 'Categorie', 'minAmount' => 'Minimaal bedrag',
'maxAmount' => 'Maximaal bedrag', 'billEntry' => 'Bedrag voor deze rekening',
'minAmount' => 'Minimaal bedrag', 'name' => 'Naam',
'billEntry' => 'Bedrag voor deze rekening', 'date' => 'Datum',
'name' => 'Naam', 'paid' => 'Betaald',
'date' => 'Datum', 'unpaid' => 'Niet betaald',
'paid' => 'Betaald', 'day' => 'Dag',
'unpaid' => 'Niet betaald', 'budgeted' => 'Gebudgetteerd',
'day' => 'Dag', 'period' => 'Periode',
'budgeted' => 'Gebudgetteerd', 'balance' => 'Saldo',
'period' => 'Periode', 'summary' => 'Samenvatting',
'balance' => 'Saldo', 'sum' => 'Som',
'summary' => 'Samenvatting', 'average' => 'Gemiddeld',
'sum' => 'Som', 'balanceFor' => 'Saldo op :name',
'average' => 'Gemiddeld',
'balanceFor' => 'Saldo op :name',
'asset_accounts' => 'Betaalrekeningen', 'asset_accounts' => 'Betaalrekeningen',
'expense_accounts' => 'Crediteuren', 'expense_accounts' => 'Crediteuren',
'revenue_accounts' => 'Debiteuren', 'revenue_accounts' => 'Debiteuren',
// some extra help: // some extra help:
'accountExtraHelp_asset' => '', 'accountExtraHelp_asset' => '',
'accountExtraHelp_expense' => 'Een crediteur is een persoon of een bedrijf waar je geld aan moet betalen. Je staat bij ze in het krijt. Een verwarrende' . 'accountExtraHelp_expense' =>
' term misschien, maar zo werkt het nou eenmaal. De supermarkt, je huurbaas of de bank zijn crediteuren. Jouw ' . 'Een crediteur is een persoon of een bedrijf waar je geld aan moet betalen. Je staat bij ze in het krijt. Een verwarrende' .
'geld (krediet) gaat naar hen toe. De term komt uit de wereld van de boekhouding. De uitgaves die je hier ziet zijn ' . ' term misschien, maar zo werkt het nou eenmaal. De supermarkt, je huurbaas of de bank zijn crediteuren. Jouw ' .
'positief, want je kijkt uit hun perspectief. Zodra jij afrekent in een winkel, komt het geld er bij hen bij (positief).', 'geld (krediet) gaat naar hen toe. De term komt uit de wereld van de boekhouding. De uitgaves die je hier ziet zijn ' .
'accountExtraHelp_revenue' => 'Als je geld krijgt van een bedrijf of een persoon is dat een debiteur. ' . 'positief, want je kijkt uit hun perspectief. Zodra jij afrekent in een winkel, komt het geld er bij hen bij (positief).',
'Dat kan salaris zijn, of een andere betaling. ' . 'accountExtraHelp_revenue' => 'Als je geld krijgt van een bedrijf of een persoon is dat een debiteur. ' .
' Ze hebben een schuld (debet) aan jou. De term komt uit de wereld van de boekhouding.' . 'Dat kan salaris zijn, of een andere betaling. ' .
' De inkomsten die je hier ziet zijn negatief, want je kijkt uit hun perspectief. Zodra een debiteur geld naar jou ' . ' Ze hebben een schuld (debet) aan jou. De term komt uit de wereld van de boekhouding.' .
'overmaakt gaat het er bij hen af (negatief).', ' De inkomsten die je hier ziet zijn negatief, want je kijkt uit hun perspectief. Zodra een debiteur geld naar jou ' .
'overmaakt gaat het er bij hen af (negatief).',
]; ];

View File

@@ -75,4 +75,4 @@ return [
'|De :count transacties verbonden aan dit budget blijven bewaard.', '|De :count transacties verbonden aan dit budget blijven bewaard.',
'category_keep_transactions' => 'De transactie verbonden aan deze categorie blijft bewaard.' . 'category_keep_transactions' => 'De transactie verbonden aan deze categorie blijft bewaard.' .
'|De :count transacties verbonden aan deze categorie blijven bewaard.', '|De :count transacties verbonden aan deze categorie blijven bewaard.',
]; ];

View File

@@ -10,7 +10,7 @@ return [
'lastActivity' => 'Laatste activiteit', 'lastActivity' => 'Laatste activiteit',
'balanceDiff' => 'Saldoverschil tussen :start en :end', 'balanceDiff' => 'Saldoverschil tussen :start en :end',
'matchedOn' => 'Wordt herkend', 'matchedOn' => 'Wordt herkend',
'matchesOn' => 'Wordt herkend', 'matchesOn' => 'Wordt herkend',
'matchingAmount' => 'Bedrag', 'matchingAmount' => 'Bedrag',
'lastMatch' => 'Laatste keer gezien', 'lastMatch' => 'Laatste keer gezien',
'expectedMatch' => 'Wordt verwacht', 'expectedMatch' => 'Wordt verwacht',
@@ -30,4 +30,4 @@ return [
'type' => 'Type', 'type' => 'Type',
'completed' => 'Opgeslagen' 'completed' => 'Opgeslagen'
]; ];

View File

@@ -50,7 +50,7 @@
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<p> <p>
<button type="submit" class="btn btn-lg btn-success"> <button type="submit" class="btn btn-lg btn-success">
<i class="fa fa-plus-circle"></i> Store new {{ what }} account <i class="fa fa-plus-circle"></i> {{ ('store_new_' ~ what ~ '_account')|_ }}
</button> </button>
</p> </p>
</div> </div>

View File

@@ -62,7 +62,7 @@
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<p> <p>
<button type="submit" class="btn btn-lg btn-success"> <button type="submit" class="btn btn-lg btn-success">
Update account {{ ('update_' ~ what ~ '_account')|_ }}
</button> </button>
</p> </p>
</div> </div>

View File

@@ -22,7 +22,7 @@
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu pull-right" role="menu"> <ul class="dropdown-menu pull-right" role="menu">
<li><a href="{{route('accounts.create', what)}}"><i class="fa fa-plus fa-fw"></i> New {{ what }} account</a></li> <li><a href="{{route('accounts.create', what)}}"><i class="fa fa-plus fa-fw"></i> {{ ('make_new_' ~ what ~ '_account')|_ }}</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@@ -31,7 +31,7 @@
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<p> <p>
<button type="submit" class="btn btn-lg btn-success"> <button type="submit" class="btn btn-lg btn-success">
<i class="fa fa-plus-circle"></i> Store new budget <i class="fa fa-plus-circle"></i> {{ 'store_new_budget'|_ }}
</button> </button>
</p> </p>
</div> </div>

View File

@@ -1,12 +1,6 @@
{% extends "./layout/default.twig" %} {% extends "./layout/default.twig" %}
{% block content %} {% block content %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, budget) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, budget) }}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p class="lead">Use budgets to organize and limit your expenses.</p>
</div>
</div>
{{ Form.model(budget, {'class' : 'form-horizontal','id' : 'update','url' : route('budgets.update',budget.id) } ) }} {{ Form.model(budget, {'class' : 'form-horizontal','id' : 'update','url' : route('budgets.update',budget.id) } ) }}
<input type="hidden" name="id" value="{{budget.id}}" /> <input type="hidden" name="id" value="{{budget.id}}" />
<div class="row"> <div class="row">

View File

@@ -1,13 +1,12 @@
<form style="display: inline;" id="income" action="{{route('budgets.postIncome')}}" method="POST"> <div class="modal-dialog">
<input type="hidden" name="_token" value="{{ csrf_token() }}" <div class="modal-content">
<div class="modal-header">
<div class="modal-dialog"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{{ 'close'|_ }}</span></button>
<div class="modal-content"> <h4 class="modal-title" id="myModalLabel">Update (expected) available amount for {{Session.get('start').format('F Y')}}</h4>
<div class="modal-header"> </div>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{{ 'close'|_ }}</span></button> <form style="display: inline;" id="income" action="{{route('budgets.postIncome')}}" method="POST">
<h4 class="modal-title" id="myModalLabel">Update (expected) available amount for {{Session.get('start').format('F Y')}}</h4>
</div>
<div class="modal-body"> <div class="modal-body">
<input type="hidden" name="_token" value="{{ csrf_token() }}"
<div class="input-group"> <div class="input-group">
<div class="input-group-addon">{{ getCurrencySymbol() }}</div> <div class="input-group-addon">{{ getCurrencySymbol() }}</div>
<input step="any" class="form-control" id="amount" value="{{ amount.data }}" autocomplete="off" name="amount" type="number"> <input step="any" class="form-control" id="amount" value="{{ amount.data }}" autocomplete="off" name="amount" type="number">
@@ -17,6 +16,6 @@
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button> <button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
<button type="submit" class="btn btn-primary">Update</button> <button type="submit" class="btn btn-primary">Update</button>
</div> </div>
</div> </form>
</div> </div>
</form> </div>

View File

@@ -14,7 +14,7 @@
<small>{{ 'budgeted'|_ }}: <span id="budgetedAmount" data-value="300"></span></small> <small>{{ 'budgeted'|_ }}: <span id="budgetedAmount" data-value="300"></span></small>
</div> </div>
<div class="col-lg-6 col-md-4 col-sm-3" style="text-align:right;"> <div class="col-lg-6 col-md-4 col-sm-3" style="text-align:right;">
<small>Available in {{ Session.get('start').formatLocalized(monthFormat) }}: <small>{{ trans('firefly.availableIn',{date : Session.get('start').formatLocalized(monthFormat) }) }}:
<a href="#" class="updateIncome"><span id="totalAmount" data-value="{{ amount }}">{{ amount|formatAmount }}</span></a></small> <a href="#" class="updateIncome"><span id="totalAmount" data-value="{{ amount }}">{{ amount|formatAmount }}</span></a></small>
</div> </div>
</div> </div>
@@ -60,12 +60,13 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<i class="fa fa-fw fa-tags"></i> <i class="fa fa-fw fa-tags"></i>
Transactions without a budget {{ 'transactionsWithoutBudget'|_ }}
</div> </div>
<div class="panel-body"> <div class="panel-body">
<p> <p>
<a href="{{ route('budgets.noBudget') }}">Transactions without a budget in <a href="{{ route('budgets.noBudget') }}">
{{ Session.get('start').format('F Y') }}.</a> {{ trans('firefly.transactionsWithoutBudgetDate', {date: Session.get('start').formatLocalized(monthFormat)}) }}
</a>
</p> </p>
</div> </div>
</div> </div>
@@ -144,7 +145,7 @@
</p> </p>
<p> <p>
<span id="spent-{{ budget.id }}" data-value="{{ budget.spent }}">Spent: {{ budget.spent|formatAmount }}</span> <span id="spent-{{ budget.id }}" data-value="{{ budget.spent }}">{{ 'spent'|_ }}: {{ budget.spent|formatAmount }}</span>
</p> </p>
</div> </div>
</div> </div>
@@ -154,10 +155,10 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<i class="fa fa-fw fa-plus-circle"></i> <i class="fa fa-fw fa-plus-circle"></i>
Create budget {{ 'createBudget'|_ }}
</div> </div>
<div class="panel-body"> <div class="panel-body">
<a href="{{ route('budgets.create') }}" class="btn btn-success"><i class="fa fa-fw fa-plus"></i> Create new budget</a> <a href="{{ route('budgets.create') }}" class="btn btn-success"><i class="fa fa-fw fa-plus"></i> {{ 'createBudget'|_ }}</a>
</div> </div>
</div> </div>
</div> </div>
@@ -166,7 +167,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<i class="fa fa-fw fa-minus-circle"></i> <i class="fa fa-fw fa-minus-circle"></i>
Inactive budgets {{ 'inactiveBudgets'|_ }}
</div> </div>
<div class="panel-body"> <div class="panel-body">
{% for index,budget in inactive %} {% for index,budget in inactive %}
@@ -184,6 +185,8 @@
<!-- DIALOG --> <!-- DIALOG -->
<div class="modal fade" id="monthlyBudgetModal"> <div class="modal fade" id="monthlyBudgetModal">
</div><!-- /.modal --> </div><!-- /.modal -->
{% endblock %} {% endblock %}

Some files were not shown because too many files have changed in this diff Show More