diff --git a/.gitignore b/.gitignore
index 24797db2e7..b59bed9bb4 100755
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,12 @@ Homestead.json
_ide_helper.php
_ide_helper_models.php
.phpstorm.meta.php
+
+storage/
+
+# Eclipse project files
+.buildpath
+.project
+.settings/
+
+.env.local
diff --git a/.travis.yml b/.travis.yml
index 861a66a8b4..fcabf8f7bf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,9 +10,9 @@ install:
- composer install
- php artisan env
- mv -v .env.testing .env
- - touch storage/database.sqlite
- - php artisan migrate --env=testing
- - php artisan migrate --seed --env=testing
+ - php artisan env
+ - touch storage/database/testing.db
+ - php artisan migrate --seed
script:
- phpunit
diff --git a/app/Console/Commands/UpgradeFireflyInstructions.php b/app/Console/Commands/UpgradeFireflyInstructions.php
new file mode 100644
index 0000000000..4fe2ddea56
--- /dev/null
+++ b/app/Console/Commands/UpgradeFireflyInstructions.php
@@ -0,0 +1,69 @@
+line('+------------------------------------------------------------------------------+');
+ $this->line('');
+
+ if (is_null($text)) {
+ $this->line('Thank you for installing Firefly III, v' . $version);
+ $this->line('If you are upgrading from a previous version,');
+ $this->info('there are no extra upgrade instructions.');
+ $this->line('Firefly III should be ready for use.');
+ } else {
+ $this->line('Thank you for installing Firefly III, v' . $version);
+ $this->line('If you are upgrading from a previous version,');
+ $this->line('please follow these upgrade instructions carefully:');
+ $this->info(wordwrap($text));
+ }
+
+ $this->line('');
+ $this->line('+------------------------------------------------------------------------------+');
+ }
+}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 9579812620..386fd469c7 100755
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -9,6 +9,7 @@
namespace FireflyIII\Console;
+use FireflyIII\Console\Commands\UpgradeFireflyInstructions;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -24,14 +25,19 @@ class Kernel extends ConsoleKernel
*
* @var array
*/
- protected $commands = [
- ];
+ protected $commands
+ = [
+ UpgradeFireflyInstructions::class
+ ];
/**
* Define the application's command schedule.
*
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
+ * @param \Illuminate\Console\Scheduling\Schedule $schedule
+ *
* @return void
+ *
+ * @SuppressWarnings(PHPMD.UnusedFormalParameters)
*/
protected function schedule(Schedule $schedule)
{
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 1e54fff73b..9b449ff362 100755
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -34,25 +34,25 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
- * @param \Exception $e
+ * @param Exception $exception
*
* @return void
*/
- public function report(Exception $e)
+ public function report(Exception $exception)
{
- return parent::report($e);
+ parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
- * @param \Exception $e
+ * @param \Exception $exception
*
* @return \Illuminate\Http\Response
*/
- public function render($request, Exception $e)
+ public function render($request, Exception $exception)
{
- return parent::render($request, $e);
+ return parent::render($request, $exception);
}
}
diff --git a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php
index 4e446f617b..ef53c4b7bd 100644
--- a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php
+++ b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php
@@ -89,18 +89,13 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator
{
// language:
$format = trans('config.month_and_day');
- $data = [
- 'count' => 0,
- 'labels' => [],
- 'datasets' => [],
- ];
+ $data = ['count' => 0, 'labels' => [], 'datasets' => [],];
$current = clone $start;
while ($current <= $end) {
$data['labels'][] = $current->formatLocalized($format);
$current->addDay();
}
-
foreach ($accounts as $account) {
$set = [
'label' => $account->name,
@@ -148,8 +143,8 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator
'datasets' => [
[
'label' => $account->name,
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
$range = Steam::balanceInRange($account, $start, $end);
diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php
index 879a1f8d84..ff1c9b6150 100644
--- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php
+++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php
@@ -35,7 +35,7 @@ class ChartJsBillChartGenerator implements BillChartGenerator
'color' => 'rgba(0, 141, 76, 0.7)',
'highlight' => 'rgba(0, 141, 76, 0.9)',
'label' => trans('firefly.paid'),
- ]
+ ],
];
return $data;
diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php
index 77678b93e9..fa25cd857b 100644
--- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php
+++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php
@@ -156,7 +156,8 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
];
// get labels from one of the budgets (assuming there's at least one):
$first = $entries->first();
- foreach ($first['budgeted'] as $year => $noInterest) {
+ $keys = array_keys($first['budgeted']);
+ foreach ($keys as $year) {
$data['labels'][] = strval($year);
}
diff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php
index 8bb0402d25..3c744cb9de 100644
--- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php
+++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php
@@ -28,12 +28,12 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
'datasets' => [
[
'label' => trans('firefly.spent'),
- 'data' => []
+ 'data' => [],
],
[
'label' => trans('firefly.earned'),
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
@@ -95,8 +95,8 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
'datasets' => [
[
'label' => trans('firefly.spent'),
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
foreach ($entries as $entry) {
@@ -124,7 +124,8 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
];
// get labels from one of the categories (assuming there's at least one):
$first = $entries->first();
- foreach ($first['spent'] as $year => $noInterest) {
+ $keys = array_keys($first['spent']);
+ foreach ($keys as $year) {
$data['labels'][] = strval($year);
}
diff --git a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php
index bea4b9605a..a33b867911 100644
--- a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php
+++ b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php
@@ -31,8 +31,8 @@ class ChartJsPiggyBankChartGenerator implements PiggyBankChartGenerator
'datasets' => [
[
'label' => 'Diff',
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
$sum = '0';
diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php
index 1089ba7305..3b64f1a8b1 100644
--- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php
+++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php
@@ -27,12 +27,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
'datasets' => [
[
'label' => trans('firefly.income'),
- 'data' => []
+ 'data' => [],
],
[
'label' => trans('firefly.expenses'),
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
@@ -60,12 +60,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
'datasets' => [
[
'label' => trans('firefly.income'),
- 'data' => []
+ 'data' => [],
],
[
'label' => trans('firefly.expenses'),
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
$data['datasets'][0]['data'][] = round($income, 2);
@@ -92,12 +92,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
'datasets' => [
[
'label' => trans('firefly.income'),
- 'data' => []
+ 'data' => [],
],
[
'label' => trans('firefly.expenses'),
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
@@ -126,12 +126,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
'datasets' => [
[
'label' => trans('firefly.income'),
- 'data' => []
+ 'data' => [],
],
[
'label' => trans('firefly.expenses'),
- 'data' => []
- ]
+ 'data' => [],
+ ],
],
];
$data['datasets'][0]['data'][] = round($income, 2);
diff --git a/app/Handlers/Events/FireRulesForStore.php b/app/Handlers/Events/FireRulesForStore.php
index 1fa8554217..2adb382390 100644
--- a/app/Handlers/Events/FireRulesForStore.php
+++ b/app/Handlers/Events/FireRulesForStore.php
@@ -45,7 +45,6 @@ class FireRulesForStore
*/
public function handle(TransactionJournalStored $event)
{
- Log::debug('Before event (in handle). From account name is: ' . $event->journal->source_account->name);
// get all the user's rule groups, with the rules, order by 'order'.
/** @var User $user */
$user = Auth::user();
@@ -74,7 +73,7 @@ class FireRulesForStore
}
}
-// echo 'Done processing rules. See log.';
-// exit;
+ // echo 'Done processing rules. See log.';
+ // exit;
}
}
\ No newline at end of file
diff --git a/app/Handlers/Events/FireRulesForUpdate.php b/app/Handlers/Events/FireRulesForUpdate.php
index d0b36c45dd..6e891626fc 100644
--- a/app/Handlers/Events/FireRulesForUpdate.php
+++ b/app/Handlers/Events/FireRulesForUpdate.php
@@ -8,7 +8,13 @@
*/
namespace FireflyIII\Handlers\Events;
+
+use Auth;
use FireflyIII\Events\TransactionJournalUpdated;
+use FireflyIII\Models\Rule;
+use FireflyIII\Models\RuleGroup;
+use FireflyIII\Rules\Processor;
+use FireflyIII\User;
use Log;
/**
@@ -36,7 +42,33 @@ class FireRulesForUpdate
*/
public function handle(TransactionJournalUpdated $event)
{
- Log::debug('Fire rules for update!');
+ // get all the user's rule groups, with the rules, order by 'order'.
+ /** @var User $user */
+ $user = Auth::user();
+ $groups = $user->ruleGroups()->where('rule_groups.active', 1)->orderBy('order', 'ASC')->get();
+ //
+ /** @var RuleGroup $group */
+ foreach ($groups as $group) {
+ Log::debug('Now processing group "' . $group->title . '".');
+ $rules = $group->rules()
+ ->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id')
+ ->where('rule_triggers.trigger_type', 'user_action')
+ ->where('rule_triggers.trigger_value', 'update-journal')
+ ->where('rules.active', 1)
+ ->get(['rules.*']);
+ /** @var Rule $rule */
+ foreach ($rules as $rule) {
+ Log::debug('Now handling rule #' . $rule->id . ' (' . $rule->title . ')');
+ $processor = new Processor($rule, $event->journal);
+ // get some return out of this?
+ $processor->handle();
+
+ if ($rule->stop_processing) {
+ break;
+ }
+
+ }
+ }
}
}
\ No newline at end of file
diff --git a/app/Helpers/Csv/Converter/CategoryName.php b/app/Helpers/Csv/Converter/CategoryName.php
index 52e371ad58..54fa5b72f7 100644
--- a/app/Helpers/Csv/Converter/CategoryName.php
+++ b/app/Helpers/Csv/Converter/CategoryName.php
@@ -24,7 +24,7 @@ class CategoryName extends BasicConverter implements ConverterInterface
$category = Category::firstOrCreateEncrypted(
[
'name' => $this->value,
- 'user_id' => Auth::user()->id
+ 'user_id' => Auth::user()->id,
]
);
}
diff --git a/app/Helpers/Csv/Data.php b/app/Helpers/Csv/Data.php
index f77391cb37..2d6388792b 100644
--- a/app/Helpers/Csv/Data.php
+++ b/app/Helpers/Csv/Data.php
@@ -1,5 +1,4 @@
sessionMapped();
$this->sessionSpecifix();
$this->sessionImportAccount();
+ $this->sessionDelimiter();
}
protected function sessionHasHeaders()
@@ -110,7 +117,15 @@ class Data
}
}
+ protected function sessionDelimiter()
+ {
+ if (Session::has('csv-delimiter')) {
+ $this->delimiter = Session::get('csv-delimiter');
+ }
+ }
+
/**
+ *
* @return string
*/
public function getDateFormat()
@@ -119,6 +134,7 @@ class Data
}
/**
+ *
* @param mixed $dateFormat
*/
public function setDateFormat($dateFormat)
@@ -128,6 +144,7 @@ class Data
}
/**
+ *
* @param int $importAccount
*/
public function setImportAccount($importAccount)
@@ -137,6 +154,7 @@ class Data
}
/**
+ *
* @return bool
*/
public function hasHeaders()
@@ -145,6 +163,7 @@ class Data
}
/**
+ *
* @param bool $hasHeaders
*/
public function setHasHeaders($hasHeaders)
@@ -154,6 +173,7 @@ class Data
}
/**
+ *
* @return array
*/
public function getMap()
@@ -162,6 +182,7 @@ class Data
}
/**
+ *
* @param array $map
*/
public function setMap(array $map)
@@ -171,6 +192,7 @@ class Data
}
/**
+ *
* @return array
*/
public function getMapped()
@@ -179,6 +201,7 @@ class Data
}
/**
+ *
* @param array $mapped
*/
public function setMapped(array $mapped)
@@ -188,17 +211,18 @@ class Data
}
/**
+ *
* @return Reader
*/
public function getReader()
{
-
if (strlen($this->csvFileContent) === 0) {
$this->loadCsvFile();
}
if (is_null($this->reader)) {
$this->reader = Reader::createFromString($this->getCsvFileContent());
+ $this->reader->setDelimiter($this->delimiter);
}
return $this->reader;
@@ -213,6 +237,7 @@ class Data
}
/**
+ *
* @return string
*/
public function getCsvFileLocation()
@@ -221,6 +246,7 @@ class Data
}
/**
+ *
* @param string $csvFileLocation
*/
public function setCsvFileLocation($csvFileLocation)
@@ -230,6 +256,7 @@ class Data
}
/**
+ *
* @return string
*/
public function getCsvFileContent()
@@ -238,6 +265,7 @@ class Data
}
/**
+ *
* @param string $csvFileContent
*/
public function setCsvFileContent($csvFileContent)
@@ -246,6 +274,7 @@ class Data
}
/**
+ *
* @return array
*/
public function getRoles()
@@ -254,6 +283,7 @@ class Data
}
/**
+ *
* @param array $roles
*/
public function setRoles(array $roles)
@@ -263,6 +293,7 @@ class Data
}
/**
+ *
* @return array
*/
public function getSpecifix()
@@ -271,6 +302,7 @@ class Data
}
/**
+ *
* @param array $specifix
*/
public function setSpecifix($specifix)
@@ -279,5 +311,22 @@ class Data
$this->specifix = $specifix;
}
+ /**
+ *
+ * @return string
+ */
+ public function getDelimiter()
+ {
+ return $this->delimiter;
+ }
+ /**
+ *
+ * @param string $delimiter
+ */
+ public function setDelimiter($delimiter)
+ {
+ Session::put('csv-delimiter', $delimiter);
+ $this->delimiter = $delimiter;
+ }
}
diff --git a/app/Helpers/Csv/Wizard.php b/app/Helpers/Csv/Wizard.php
index 148934ee60..03ed929ce0 100644
--- a/app/Helpers/Csv/Wizard.php
+++ b/app/Helpers/Csv/Wizard.php
@@ -63,7 +63,8 @@ class Wizard implements WizardInterface
if (is_array($map)) {
- foreach ($map as $index => $field) {
+ $keys = array_keys($map);
+ foreach ($keys as $index) {
if (isset($roles[$index])) {
$name = $roles[$index];
if ($configRoles[$name]['mappable']) {
diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php
index 709a306b0d..2b13fbe9ae 100644
--- a/app/Helpers/Report/ReportHelper.php
+++ b/app/Helpers/Report/ReportHelper.php
@@ -19,9 +19,12 @@ use FireflyIII\Helpers\Collection\Income;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget as BudgetModel;
+use FireflyIII\Models\Budget;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionJournal;
+use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
+use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Support\Collection;
/**
@@ -35,16 +38,26 @@ class ReportHelper implements ReportHelperInterface
/** @var ReportQueryInterface */
protected $query;
+ /** @var BudgetRepositoryInterface */
+ protected $budgetRepository;
+
+ /** @var TagRepositoryInterface */
+ protected $tagRepository;
+
/**
+ * ReportHelper constructor.
+ *
* @codeCoverageIgnore
*
- * @param ReportQueryInterface $query
- *
+ * @param ReportQueryInterface $query
+ * @param BudgetRepositoryInterface $budgetRepository
+ * @param TagRepositoryInterface $tagRepository
*/
- public function __construct(ReportQueryInterface $query)
+ public function __construct(ReportQueryInterface $query, BudgetRepositoryInterface $budgetRepository, TagRepositoryInterface $tagRepository)
{
- $this->query = $query;
-
+ $this->query = $query;
+ $this->budgetRepository = $budgetRepository;
+ $this->tagRepository = $tagRepository;
}
/**
@@ -329,105 +342,24 @@ class ReportHelper implements ReportHelperInterface
*/
public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts)
{
- /** @var \FireflyIII\Repositories\Budget\BudgetRepositoryInterface $repository */
- $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
-
- /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
- $tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
-
$balance = new Balance;
// build a balance header:
$header = new BalanceHeader;
- $budgets = $repository->getBudgetsAndLimitsInRange($start, $end);
- $spentData = $repository->spentPerBudgetPerAccount($budgets, $accounts, $start, $end);
+ $budgets = $this->budgetRepository->getBudgetsAndLimitsInRange($start, $end);
+ $spentData = $this->budgetRepository->spentPerBudgetPerAccount($budgets, $accounts, $start, $end);
foreach ($accounts as $account) {
$header->addAccount($account);
}
/** @var BudgetModel $budget */
foreach ($budgets as $budget) {
- $line = new BalanceLine;
- $line->setBudget($budget);
-
- // loop accounts:
- foreach ($accounts as $account) {
- $balanceEntry = new BalanceEntry;
- $balanceEntry->setAccount($account);
-
- // get spent:
- $entry = $spentData->filter(
- function (TransactionJournal $model) use ($budget, $account) {
- return $model->account_id == $account->id && $model->budget_id == $budget->id;
- }
- );
- $spent = 0;
- if (!is_null($entry->first())) {
- $spent = $entry->first()->spent;
- }
- $balanceEntry->setSpent($spent);
- $line->addBalanceEntry($balanceEntry);
- }
- // add line to balance:
- $balance->addBalanceLine($line);
+ $balance->addBalanceLine($this->createBalanceLine($budget, $accounts, $spentData));
}
- // then a new line for without budget.
- // and one for the tags:
- // and one for "left unbalanced".
- $empty = new BalanceLine;
- $tags = new BalanceLine;
- $diffLine = new BalanceLine;
- $tagsLeft = $tagRepository->allCoveredByBalancingActs($accounts, $start, $end);
-
- $tags->setRole(BalanceLine::ROLE_TAGROLE);
- $diffLine->setRole(BalanceLine::ROLE_DIFFROLE);
-
- foreach ($accounts as $account) {
- $entry = $spentData->filter(
- function (TransactionJournal $model) use ($account) {
- return $model->account_id == $account->id && is_null($model->budget_id);
- }
- );
- $spent = 0;
- if (!is_null($entry->first())) {
- $spent = $entry->first()->spent;
- }
- $leftEntry = $tagsLeft->filter(
- function (Tag $tag) use ($account) {
- return $tag->account_id == $account->id;
- }
- );
- $left = 0;
- if (!is_null($leftEntry->first())) {
- $left = $leftEntry->first()->sum;
- }
- bcscale(2);
- $diff = bcadd($spent, $left);
-
- // budget
- $budgetEntry = new BalanceEntry;
- $budgetEntry->setAccount($account);
- $budgetEntry->setSpent($spent);
- $empty->addBalanceEntry($budgetEntry);
-
- // balanced by tags
- $tagEntry = new BalanceEntry;
- $tagEntry->setAccount($account);
- $tagEntry->setLeft($left);
- $tags->addBalanceEntry($tagEntry);
-
- // difference:
- $diffEntry = new BalanceEntry;
- $diffEntry->setAccount($account);
- $diffEntry->setSpent($diff);
- $diffLine->addBalanceEntry($diffEntry);
-
- }
-
- $balance->addBalanceLine($empty);
- $balance->addBalanceLine($tags);
- $balance->addBalanceLine($diffLine);
+ $balance->addBalanceLine($this->createEmptyBalanceLine($accounts, $spentData));
+ $balance->addBalanceLine($this->createTagsBalanceLine($accounts, $start, $end));
+ $balance->addBalanceLine($this->createDifferenceBalanceLine($accounts, $spentData, $start, $end));
$balance->setBalanceHeader($header);
@@ -511,4 +443,157 @@ class ReportHelper implements ReportHelperInterface
return $sum;
}
+
+ /**
+ * @param Budget $budget
+ * @param Collection $accounts
+ * @param Collection $spentData
+ *
+ * @return BalanceLine
+ */
+ private function createBalanceLine(BudgetModel $budget, Collection $accounts, Collection $spentData)
+ {
+ $line = new BalanceLine;
+ $line->setBudget($budget);
+
+ // loop accounts:
+ foreach ($accounts as $account) {
+ $balanceEntry = new BalanceEntry;
+ $balanceEntry->setAccount($account);
+
+ // get spent:
+ $entry = $spentData->filter(
+ function (TransactionJournal $model) use ($budget, $account) {
+ return $model->account_id == $account->id && $model->budget_id == $budget->id;
+ }
+ );
+ $spent = 0;
+ if (!is_null($entry->first())) {
+ $spent = $entry->first()->spent;
+ }
+ $balanceEntry->setSpent($spent);
+ $line->addBalanceEntry($balanceEntry);
+ }
+
+ return $line;
+ }
+
+ /**
+ * @param Collection $accounts
+ * @param Collection $spentData
+ *
+ * @return BalanceLine
+ */
+ private function createEmptyBalanceLine(Collection $accounts, Collection $spentData)
+ {
+ $empty = new BalanceLine;
+
+ foreach ($accounts as $account) {
+ $entry = $spentData->filter(
+ function (TransactionJournal $model) use ($account) {
+ return $model->account_id == $account->id && is_null($model->budget_id);
+ }
+ );
+ $spent = 0;
+ if (!is_null($entry->first())) {
+ $spent = $entry->first()->spent;
+ }
+
+ // budget
+ $budgetEntry = new BalanceEntry;
+ $budgetEntry->setAccount($account);
+ $budgetEntry->setSpent($spent);
+ $empty->addBalanceEntry($budgetEntry);
+
+ }
+
+ return $empty;
+ }
+
+ /**
+ * @param Collection $accounts
+ * @param Carbon $start
+ * @param Carbon $end
+ *
+ * @return BalanceLine
+ */
+ private function createTagsBalanceLine(Collection $accounts, Carbon $start, Carbon $end)
+ {
+ $tags = new BalanceLine;
+ $tagsLeft = $this->tagRepository->allCoveredByBalancingActs($accounts, $start, $end);
+
+ $tags->setRole(BalanceLine::ROLE_TAGROLE);
+
+ foreach ($accounts as $account) {
+ $leftEntry = $tagsLeft->filter(
+ function (Tag $tag) use ($account) {
+ return $tag->account_id == $account->id;
+ }
+ );
+ $left = 0;
+ if (!is_null($leftEntry->first())) {
+ $left = $leftEntry->first()->sum;
+ }
+ bcscale(2);
+
+ // balanced by tags
+ $tagEntry = new BalanceEntry;
+ $tagEntry->setAccount($account);
+ $tagEntry->setLeft($left);
+ $tags->addBalanceEntry($tagEntry);
+
+ }
+
+ return $tags;
+ }
+
+ /**
+ * @param Collection $accounts
+ * @param Collection $spentData
+ * @param Carbon $start
+ * @param Carbon $end
+ *
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
+ * @return BalanceLine
+ */
+ private function createDifferenceBalanceLine(Collection $accounts, Collection $spentData, Carbon $start, Carbon $end)
+ {
+ $diff = new BalanceLine;
+ $tagsLeft = $this->tagRepository->allCoveredByBalancingActs($accounts, $start, $end);
+
+ $diff->setRole(BalanceLine::ROLE_DIFFROLE);
+
+ foreach ($accounts as $account) {
+ $entry = $spentData->filter(
+ function (TransactionJournal $model) use ($account) {
+ return $model->account_id == $account->id && is_null($model->budget_id);
+ }
+ );
+ $spent = 0;
+ if (!is_null($entry->first())) {
+ $spent = $entry->first()->spent;
+ }
+ $leftEntry = $tagsLeft->filter(
+ function (Tag $tag) use ($account) {
+ return $tag->account_id == $account->id;
+ }
+ );
+ $left = 0;
+ if (!is_null($leftEntry->first())) {
+ $left = $leftEntry->first()->sum;
+ }
+ bcscale(2);
+ $diffValue = bcadd($spent, $left);
+
+ // difference:
+ $diffEntry = new BalanceEntry;
+ $diffEntry->setAccount($account);
+ $diffEntry->setSpent($diffValue);
+ $diff->addBalanceEntry($diffEntry);
+
+ }
+
+ return $diff;
+ }
}
diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php
index 24fa89dc7d..0180571484 100644
--- a/app/Helpers/Report/ReportQuery.php
+++ b/app/Helpers/Report/ReportQuery.php
@@ -50,7 +50,7 @@ class ReportQuery implements ReportQueryInterface
->get(
[
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y-%m") AS `dateFormatted`'),
- DB::Raw('SUM(`t_from`.`amount`) AS `sum`')
+ DB::Raw('SUM(`t_from`.`amount`) AS `sum`'),
]
);
$array = [];
@@ -95,7 +95,7 @@ class ReportQuery implements ReportQueryInterface
->get(
[
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y-%m") AS `dateFormatted`'),
- DB::Raw('SUM(`t_to`.`amount`) AS `sum`')
+ DB::Raw('SUM(`t_to`.`amount`) AS `sum`'),
]
);
$array = [];
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index e018002bfc..44d210ca40 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -133,7 +133,7 @@ class AccountController extends Controller
'ccMonthlyPaymentDate' => $account->getMeta('ccMonthlyPaymentDate'),
'openingBalanceDate' => $openingBalance ? $openingBalance->date->format('Y-m-d') : null,
'openingBalance' => $openingBalanceAmount,
- 'virtualBalance' => round($account->virtual_balance, 2)
+ 'virtualBalance' => round($account->virtual_balance, 2),
];
Session::flash('preFilled', $preFilled);
Session::flash('gaEventCategory', 'accounts');
@@ -251,12 +251,10 @@ class AccountController extends Controller
'virtualBalance' => round($request->input('virtualBalance'), 2),
'openingBalance' => round($request->input('openingBalance'), 2),
'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')),
- 'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
+ 'openingBalanceCurrency' => intval($request->input('amount_currency_id_openingBalance')),
'ccType' => $request->input('ccType'),
'ccMonthlyPaymentDate' => $request->input('ccMonthlyPaymentDate'),
];
-
-
$repository->update($account, $accountData);
Session::flash('success', 'Account "' . $account->name . '" updated.');
diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php
index 6a634369b8..c7ec06cfcd 100755
--- a/app/Http/Controllers/Auth/AuthController.php
+++ b/app/Http/Controllers/Auth/AuthController.php
@@ -66,15 +66,7 @@ class AuthController extends Controller
*/
public function login(Request $request)
{
- $this->validate(
- $request, [
- $this->loginUsername() => 'required', 'password' => 'required',
- ]
- );
-
- // If the class is using the ThrottlesLogins trait, we can automatically throttle
- // the login attempts for this application. We'll key this by the username and
- // the IP address of the client making these requests into this application.
+ $this->validate($request, [$this->loginUsername() => 'required', 'password' => 'required',]);
$throttles = $this->isUsingThrottlesLoginsTrait();
if ($throttles && $this->hasTooManyLoginAttempts($request)) {
@@ -102,10 +94,6 @@ class AuthController extends Controller
$message = trans('firefly.' . $code . '_error', ['email' => $credentials['email']]);
}
-
- // If the login attempt was unsuccessful we will increment the number of attempts
- // to login and redirect the user back to the login form. Of course, when this
- // user surpasses their maximum number of attempts they will get locked out.
if ($throttles) {
$this->incrementLoginAttempts($request);
}
diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php
index 39d3c4dffa..3fc267d732 100644
--- a/app/Http/Controllers/Chart/BudgetController.php
+++ b/app/Http/Controllers/Chart/BudgetController.php
@@ -46,6 +46,8 @@ class BudgetController extends Controller
* @param Collection $accounts
* @param Collection $budgets
*
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList) // need all parameters
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function multiYear(BudgetRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts, Collection $budgets)
diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php
index 028174d80e..27c97ab7c6 100644
--- a/app/Http/Controllers/Chart/CategoryController.php
+++ b/app/Http/Controllers/Chart/CategoryController.php
@@ -43,6 +43,8 @@ class CategoryController extends Controller
* @param SCRI $repository
* @param Category $category
*
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
* @return \Symfony\Component\HttpFoundation\Response
*/
public function all(SCRI $repository, Category $category)
@@ -53,8 +55,6 @@ class CategoryController extends Controller
$start = Navigation::startOfPeriod($start, $range);
$end = new Carbon;
$entries = new Collection;
-
-
// chart properties for cache:
$cache = new CacheProperties();
$cache->addProperty($start);
@@ -67,29 +67,21 @@ class CategoryController extends Controller
$spentArray = $repository->spentPerDay($category, $start, $end);
$earnedArray = $repository->earnedPerDay($category, $start, $end);
-
while ($start <= $end) {
$currentEnd = Navigation::endOfPeriod($start, $range);
-
- // get the sum from $spentArray and $earnedArray:
- $spent = $this->getSumOfRange($start, $currentEnd, $spentArray);
- $earned = $this->getSumOfRange($start, $currentEnd, $earnedArray);
-
- $date = Navigation::periodShow($start, $range);
+ $spent = $this->getSumOfRange($start, $currentEnd, $spentArray);
+ $earned = $this->getSumOfRange($start, $currentEnd, $earnedArray);
+ $date = Navigation::periodShow($start, $range);
$entries->push([clone $start, $date, $spent, $earned]);
$start = Navigation::addPeriod($start, $range, 0);
}
- // limit the set to the last 40:
$entries = $entries->reverse();
$entries = $entries->slice(0, 48);
$entries = $entries->reverse();
-
- $data = $this->generator->all($entries);
+ $data = $this->generator->all($entries);
$cache->store($data);
return Response::json($data);
-
-
}
@@ -161,23 +153,8 @@ class CategoryController extends Controller
return Response::json($cache->get()); // @codeCoverageIgnore
}
- /**
- * category
- * year:
- * spent: x
- * earned: x
- * year
- * spent: x
- * earned: x
- */
$entries = new Collection;
- // go by category, not by year.
-
- // given a set of categories and accounts, it should not be difficult to get
- // the exact array of data we need.
-
- // then get the data for "no category".
- $set = $repository->listMultiYear($categories, $accounts, $start, $end);
+ $set = $repository->listMultiYear($categories, $accounts, $start, $end);
/** @var Category $category */
foreach ($categories as $category) {
@@ -336,6 +313,10 @@ class CategoryController extends Controller
* @param Carbon $end
* @param Collection $accounts
*
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList) // cant avoid it.
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // it's long but ok.
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function earnedInPeriod(CRI $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
@@ -360,18 +341,15 @@ class CategoryController extends Controller
$entries = new Collection;
while ($start < $end) { // filter the set:
- $row = [clone $start];
- // get possibly relevant entries from the big $set
- $currentSet = $set->filter(
+ $row = [clone $start];
+ $currentSet = $set->filter( // get possibly relevant entries from the big $set
function (Category $category) use ($start) {
return $category->dateFormatted == $start->format("Y-m");
}
);
- // check for each category if its in the current set.
/** @var Category $category */
- foreach ($categories as $category) {
- // if its in there, use the value.
- $entry = $currentSet->filter(
+ foreach ($categories as $category) { // check for each category if its in the current set.
+ $entry = $currentSet->filter( // if its in there, use the value.
function (Category $cat) use ($category) {
return ($cat->id == $category->id);
}
@@ -382,7 +360,6 @@ class CategoryController extends Controller
$row[] = 0;
}
}
-
$entries->push($row);
$start->addMonth();
}
@@ -403,6 +380,9 @@ class CategoryController extends Controller
* @param Carbon $end
* @param Collection $accounts
*
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList) // need all parameters
+ * @SuppressWarnings(PHPMD.ExcessuveMethodLength) // need the length
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function spentInPeriod(CRI $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
@@ -427,18 +407,15 @@ class CategoryController extends Controller
$entries = new Collection;
while ($start < $end) { // filter the set:
- $row = [clone $start];
- // get possibly relevant entries from the big $set
- $currentSet = $set->filter(
+ $row = [clone $start];
+ $currentSet = $set->filter(// get possibly relevant entries from the big $set
function (Category $category) use ($start) {
return $category->dateFormatted == $start->format("Y-m");
}
);
- // check for each category if its in the current set.
/** @var Category $category */
- foreach ($categories as $category) {
- // if its in there, use the value.
- $entry = $currentSet->filter(
+ foreach ($categories as $category) {// check for each category if its in the current set.
+ $entry = $currentSet->filter(// if its in there, use the value.
function (Category $cat) use ($category) {
return ($cat->id == $category->id);
}
diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php
index 545fe46d7a..3ffb128691 100644
--- a/app/Http/Controllers/Chart/ReportController.php
+++ b/app/Http/Controllers/Chart/ReportController.php
@@ -41,6 +41,8 @@ class ReportController extends Controller
* @param Carbon $end
* @param Collection $accounts
*
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList) // cant avoid it.
+ *
* @return \Illuminate\Http\JsonResponse
*/
public function yearInOut(ReportQueryInterface $query, $reportType, Carbon $start, Carbon $end, Collection $accounts)
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 2d33717042..6241057961 100755
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -57,7 +57,7 @@ class Controller extends BaseController
$localeconv = [
'mon_decimal_point' => $numberFormatter->getSymbol($numberFormatter->getAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL)),
'mon_thousands_sep' => $numberFormatter->getSymbol($numberFormatter->getAttribute(NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL)),
- 'frac_digits' => $numberFormatter->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)
+ 'frac_digits' => $numberFormatter->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS),
];
View::share('monthFormat', $this->monthFormat);
View::share('monthAndDayFormat', $this->monthAndDayFormat);
diff --git a/app/Http/Controllers/CsvController.php b/app/Http/Controllers/CsvController.php
index bde7d5b7e0..6bc6a9b2e3 100644
--- a/app/Http/Controllers/CsvController.php
+++ b/app/Http/Controllers/CsvController.php
@@ -79,8 +79,8 @@ class CsvController extends Controller
if ($this->data->hasHeaders()) {
$headers = $firstRow;
}
-
- foreach (Config::get('csv.roles') as $name => $role) {
+ $keys = array_keys(Config::get('csv.roles'));
+ foreach ($keys as $name) {
$availableRoles[$name] = trans('firefly.csv_column_' . $name);//$role['name'];
}
ksort($availableRoles);
@@ -105,7 +105,7 @@ class CsvController extends Controller
}
$data = [
'date-format' => Session::get('csv-date-format'),
- 'has-headers' => Session::get('csv-has-headers')
+ 'has-headers' => Session::get('csv-has-headers'),
];
if (Session::has('csv-map')) {
$data['map'] = Session::get('csv-map');
@@ -162,6 +162,7 @@ class CsvController extends Controller
Session::forget('csv-roles');
Session::forget('csv-mapped');
Session::forget('csv-specifix');
+ SessioN::forget('csv-delimiter');
// get list of supported specifix
$specifix = [];
@@ -169,6 +170,13 @@ class CsvController extends Controller
$specifix[$entry] = trans('firefly.csv_specifix_' . $entry);
}
+ // get a list of delimiters:
+ $delimiters = [
+ ',' => trans('form.csv_comma'),
+ ';' => trans('form.csv_semicolon'),
+ 'tab' => trans('form.csv_tab'),
+ ];
+
// get a list of asset accounts:
$accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Asset account', 'Default account']));
@@ -176,7 +184,7 @@ class CsvController extends Controller
$uploadPossible = is_writable(storage_path('upload'));
$path = storage_path('upload');
- return view('csv.index', compact('subTitle', 'uploadPossible', 'path', 'specifix', 'accounts'));
+ return view('csv.index', compact('subTitle', 'uploadPossible', 'path', 'specifix', 'accounts', 'delimiters'));
}
/**
@@ -323,6 +331,8 @@ class CsvController extends Controller
*
* STEP SIX
*
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) it's 6, but it's allright.
+ *
* @return \Illuminate\Http\RedirectResponse
*/
public function saveMapping()
@@ -367,6 +377,9 @@ class CsvController extends Controller
*
* STEP TWO
*
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // need the length.
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) // its exactly 5, its ok
+ *
* @param Request $request
*
* @return \Illuminate\Http\RedirectResponse
@@ -385,9 +398,17 @@ class CsvController extends Controller
$settings['has-headers'] = intval(Input::get('has_headers')) === 1;
$settings['specifix'] = Input::get('specifix');
$settings['import-account'] = intval(Input::get('csv_import_account'));
- $settings['map'] = [];
- $settings['mapped'] = [];
- $settings['roles'] = [];
+ $settings['delimiter'] = Input::get('csv_delimiter', ',');
+
+ // A tab character cannot be used itself as option value in HTML
+ // See http://stackoverflow.com/questions/6064135/valid-characters-in-option-value
+ if ($settings['delimiter'] == 'tab') {
+ $settings['delimiter'] = "\t";
+ }
+
+ $settings['map'] = [];
+ $settings['mapped'] = [];
+ $settings['roles'] = [];
if ($request->hasFile('csv_config')) { // Process config file if present.
$data = file_get_contents($request->file('csv_config')->getRealPath());
@@ -405,6 +426,7 @@ class CsvController extends Controller
$this->data->setRoles($settings['roles']);
$this->data->setSpecifix($settings['specifix']);
$this->data->setImportAccount($settings['import-account']);
+ $this->data->setDelimiter($settings['delimiter']);
return redirect(route('csv.column-roles'));
diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php
index 83ed844119..a3b93b97ac 100644
--- a/app/Http/Controllers/PiggyBankController.php
+++ b/app/Http/Controllers/PiggyBankController.php
@@ -186,7 +186,7 @@ class PiggyBankController extends Controller
'leftForPiggyBanks' => $repository->leftOnAccount($account, $end),
'sumOfSaved' => $piggyBank->savedSoFar,
'sumOfTargets' => round($piggyBank->targetamount, 2),
- 'leftToSave' => $piggyBank->leftToSave
+ 'leftToSave' => $piggyBank->leftToSave,
];
} else {
$accounts[$account->id]['sumOfSaved'] = bcadd($accounts[$account->id]['sumOfSaved'], $piggyBank->savedSoFar);
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php
index 684d9e2d98..f8253d7408 100644
--- a/app/Http/Controllers/ProfileController.php
+++ b/app/Http/Controllers/ProfileController.php
@@ -1,7 +1,6 @@
$email,
'password' => 'deleted',
'blocked' => 1,
- 'blocked_code' => 'deleted'
+ 'blocked_code' => 'deleted',
]
);
diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php
index 647c55e86d..e323aefdbb 100644
--- a/app/Http/Controllers/RuleController.php
+++ b/app/Http/Controllers/RuleController.php
@@ -10,7 +10,6 @@
namespace FireflyIII\Http\Controllers;
use Auth;
-use FireflyIII\Http\Requests;
use FireflyIII\Http\Requests\RuleFormRequest;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleAction;
@@ -54,7 +53,7 @@ class RuleController extends Controller
// process the rule itself:
$data = [
- 'rule_group_id' => intval($request->get('rule_group_id')),
+ 'rule_group_id' => $ruleGroup->id,
'title' => $request->get('title'),
'trigger' => $request->get('trigger'),
'description' => $request->get('description'),
@@ -101,44 +100,12 @@ class RuleController extends Controller
// has old input?
if (Input::old()) {
// process old triggers.
- $newIndex = 0;
- foreach (Input::old('rule-trigger') as $index => $entry) {
- $count = ($newIndex + 1);
- $triggerCount++;
- $oldTrigger = $entry;
- $oldValue = Input::old('rule-trigger-value')[$index];
- $oldChecked = isset(Input::old('rule-trigger-stop')[$index]) ? true : false;
- $oldTriggers[] = view(
- 'rules.partials.trigger',
- [
- 'oldTrigger' => $oldTrigger,
- 'oldValue' => $oldValue,
- 'oldChecked' => $oldChecked,
- 'count' => $count,
- ]
- )->render();
- $newIndex++;
- }
+ $oldTriggers = $this->getPreviousTriggers();
+ $triggerCount = count($oldTriggers);
// process old actions
- $newIndex = 0;
- foreach (Input::old('rule-action') as $index => $entry) {
- $count = ($newIndex + 1);
- $actionCount++;
- $oldAction = $entry;
- $oldValue = Input::old('rule-action-value')[$index];
- $oldChecked = isset(Input::old('rule-action-stop')[$index]) ? true : false;
- $oldActions[] = view(
- 'rules.partials.action',
- [
- 'oldTrigger' => $oldAction,
- 'oldValue' => $oldValue,
- 'oldChecked' => $oldChecked,
- 'count' => $count,
- ]
- )->render();
- $newIndex++;
- }
+ $oldActions = $this->getPreviousActions();
+ $actionCount = count($oldActions);
}
$subTitleIcon = 'fa-clone';
@@ -164,114 +131,22 @@ class RuleController extends Controller
*/
public function edit(Rule $rule)
{
-
- // count for current rule's triggers/actions.
- $triggerCount = 0;
- $actionCount = 0;
-
- // collection of those triggers/actions.
- $oldTriggers = [];
- $oldActions = [];
-
// has old input?
if (Input::old()) {
- // process old triggers.
- $newIndex = 0;
- foreach (Input::old('rule-trigger') as $index => $entry) {
- $count = ($newIndex + 1);
- $triggerCount++;
- $oldTrigger = $entry;
- $oldValue = Input::old('rule-trigger-value')[$index];
- $oldChecked = isset(Input::old('rule-trigger-stop')[$index]) ? true : false;
- $oldTriggers[] = view(
- 'rules.partials.trigger',
- [
- 'oldTrigger' => $oldTrigger,
- 'oldValue' => $oldValue,
- 'oldChecked' => $oldChecked,
- 'count' => $count,
- ]
- )->render();
- $newIndex++;
- }
-
- // process old actions
- $newIndex = 0;
- foreach (Input::old('rule-action') as $index => $entry) {
- $count = ($newIndex + 1);
- $actionCount++;
- $oldAction = $entry;
- $oldValue = Input::old('rule-action-value')[$index];
- $oldChecked = isset(Input::old('rule-action-stop')[$index]) ? true : false;
- $oldActions[] = view(
- 'rules.partials.action',
- [
- 'oldTrigger' => $oldAction,
- 'oldValue' => $oldValue,
- 'oldChecked' => $oldChecked,
- 'count' => $count,
- ]
- )->render();
- $newIndex++;
- }
+ $oldTriggers = $this->getPreviousTriggers();
+ $triggerCount = count($oldTriggers);
+ $oldActions = $this->getPreviousActions();
+ $actionCount = count($oldActions);
} else {
- // get current triggers
- $newIndex = 0;
- /**
- * @var int $index
- * @var RuleTrigger $entry
- */
- foreach ($rule->ruleTriggers as $index => $entry) {
- if ($entry->trigger_type != 'user_action') {
- $count = ($newIndex + 1);
- $triggerCount++;
- $oldTrigger = $entry->trigger_type;
- $oldValue = $entry->trigger_value;
- $oldChecked = $entry->stop_processing;
- $oldTriggers[] = view(
- 'rules.partials.trigger',
- [
- 'oldTrigger' => $oldTrigger,
- 'oldValue' => $oldValue,
- 'oldChecked' => $oldChecked,
- 'count' => $count,
- ]
- )->render();
- $newIndex++;
- }
-
- }
-
- // get current actions
- $newIndex = 0;
- /**
- * @var int $index
- * @var RuleAction $entry
- */
- foreach ($rule->ruleActions as $index => $entry) {
- $count = ($newIndex + 1);
- $actionCount++;
- $oldAction = $entry->action_type;
- $oldValue = $entry->action_value;
- $oldChecked = $entry->stop_processing;
- $oldActions[] = view(
- 'rules.partials.action',
- [
- 'oldTrigger' => $oldAction,
- 'oldValue' => $oldValue,
- 'oldChecked' => $oldChecked,
- 'count' => $count,
- ]
- )->render();
- $newIndex++;
- }
+ $oldTriggers = $this->getCurrentTriggers($rule);
+ $triggerCount = count($oldTriggers);
+ $oldActions = $this->getCurrentActions($rule);
+ $actionCount = count($oldActions);
}
// get rule trigger for update / store-journal:
$primaryTrigger = $rule->ruleTriggers()->where('trigger_type', 'user_action')->first()->trigger_value;
-
-
- $subTitle = trans('firefly.edit_rule', ['title' => $rule->title]);
+ $subTitle = trans('firefly.edit_rule', ['title' => $rule->title]);
// put previous url in session if not redirect from store (not "return_to_edit").
if (Session::get('rules.rule.edit.fromUpdate') !== true) {
@@ -283,9 +158,9 @@ class RuleController extends Controller
return view(
'rules.rule.edit', compact(
- 'rule', 'subTitle', 'primaryTrigger',
- 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount'
- )
+ 'rule', 'subTitle', 'primaryTrigger',
+ 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount'
+ )
);
}
@@ -459,5 +334,113 @@ class RuleController extends Controller
}
+ /**
+ * @param Rule $rule
+ *
+ * @return array
+ */
+ private function getCurrentActions(Rule $rule)
+ {
+ $index = 0;
+ $actions = [];
+
+ /** @var RuleAction $entry */
+ foreach ($rule->ruleActions as $entry) {
+ $count = ($index + 1);
+ $actions[] = view(
+ 'rules.partials.action',
+ [
+ 'oldTrigger' => $entry->action_type,
+ 'oldValue' => $entry->action_value,
+ 'oldChecked' => $entry->stop_processing,
+ 'count' => $count,
+ ]
+ )->render();
+ $index++;
+ }
+
+ return $actions;
+ }
+
+ /**
+ * @param Rule $rule
+ *
+ * @return array
+ */
+ private function getCurrentTriggers(Rule $rule)
+ {
+ $index = 0;
+ $triggers = [];
+
+ /** @var RuleTrigger $entry */
+ foreach ($rule->ruleTriggers as $entry) {
+ if ($entry->trigger_type != 'user_action') {
+ $count = ($index + 1);
+ $triggers[] = view(
+ 'rules.partials.trigger',
+ [
+ 'oldTrigger' => $entry->trigger_type,
+ 'oldValue' => $entry->trigger_value,
+ 'oldChecked' => $entry->stop_processing,
+ 'count' => $count,
+ ]
+ )->render();
+ $index++;
+ }
+ }
+
+ return $triggers;
+ }
+
+ /**
+ * @return array
+ */
+ private function getPreviousActions()
+ {
+ $newIndex = 0;
+ $actions = [];
+ foreach (Input::old('rule-action') as $index => $entry) {
+ $count = ($newIndex + 1);
+ $checked = isset(Input::old('rule-action-stop')[$index]) ? true : false;
+ $actions[] = view(
+ 'rules.partials.action',
+ [
+ 'oldTrigger' => $entry,
+ 'oldValue' => Input::old('rule-action-value')[$index],
+ 'oldChecked' => $checked,
+ 'count' => $count,
+ ]
+ )->render();
+ $newIndex++;
+ }
+
+ return $actions;
+ }
+
+ /**
+ * @return array
+ */
+ private function getPreviousTriggers()
+ {
+ $newIndex = 0;
+ $triggers = [];
+ foreach (Input::old('rule-trigger') as $index => $entry) {
+ $count = ($newIndex + 1);
+ $oldChecked = isset(Input::old('rule-trigger-stop')[$index]) ? true : false;
+ $triggers[] = view(
+ 'rules.partials.trigger',
+ [
+ 'oldTrigger' => $entry,
+ 'oldValue' => Input::old('rule-trigger-value')[$index],
+ 'oldChecked' => $oldChecked,
+ 'count' => $count,
+ ]
+ )->render();
+ $newIndex++;
+ }
+
+ return $triggers;
+ }
+
}
diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php
index 7c375cd027..e0dda063ea 100644
--- a/app/Http/Controllers/RuleGroupController.php
+++ b/app/Http/Controllers/RuleGroupController.php
@@ -46,7 +46,7 @@ class RuleGroupController extends Controller
Session::flash('gaEventCategory', 'rules');
Session::flash('gaEventAction', 'create-rule-group');
- return view('rules.rule-group.create', compact('subTitleIcon', 'what', 'subTitle'));
+ return view('rules.rule-group.create', compact('subTitleIcon', 'subTitle'));
}
diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php
index bf0baa0805..bdd0c6bab5 100644
--- a/app/Http/Controllers/TagController.php
+++ b/app/Http/Controllers/TagController.php
@@ -60,7 +60,7 @@ class TagController extends Controller
$subTitleIcon = 'fa-tag';
$preFilled = [
- 'tagMode' => 'nothing'
+ 'tagMode' => 'nothing',
];
if (!Input::old('tagMode')) {
Session::flash('preFilled', $preFilled);
diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php
index a5009e0cca..41b0a4975f 100644
--- a/app/Http/Controllers/TransactionController.php
+++ b/app/Http/Controllers/TransactionController.php
@@ -58,9 +58,7 @@ class TransactionController extends Controller
$accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account']));
$budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get());
$budgets[0] = trans('form.noBudget');
-
- // piggy bank list:
- $piggyBanks = Auth::user()->piggyBanks()->orderBy('order', 'ASC')->get();
+ $piggyBanks = Auth::user()->piggyBanks()->orderBy('order', 'ASC')->get();
/** @var PiggyBank $piggy */
foreach ($piggyBanks as $piggy) {
$piggy->name = $piggy->name . ' (' . Amount::format($piggy->currentRelevantRep()->currentamount, false) . ')';
@@ -161,7 +159,7 @@ class TransactionController extends Controller
'date' => $journal->date->format('Y-m-d'),
'category' => '',
'budget_id' => 0,
- 'piggy_bank_id' => 0
+ 'piggy_bank_id' => 0,
];
// get tags:
$preFilled['tags'] = join(',', $journal->tags->pluck('tag')->toArray());
@@ -295,7 +293,6 @@ class TransactionController extends Controller
*/
public function store(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att)
{
-
$journalData = $request->getJournalData();
// if not withdrawal, unset budgetid.
@@ -305,7 +302,6 @@ class TransactionController extends Controller
$journal = $repository->store($journalData);
- // save attachments:
$att->saveAttachmentsForModel($journal);
// flash errors
@@ -347,10 +343,6 @@ class TransactionController extends Controller
public function update(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att, TransactionJournal $journal)
{
- if ($journal->isOpeningBalance()) {
- return view('error')->with('message', 'Cannot edit this transaction. Edit the account instead!');
- }
-
$journalData = $request->getJournalData();
$repository->update($journal, $journalData);
diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php
index 088f1e9a8d..3a3ccb3c85 100644
--- a/app/Http/Middleware/Binder.php
+++ b/app/Http/Middleware/Binder.php
@@ -54,6 +54,7 @@ class Binder
private function performBinding($key, $value, $route)
{
$class = $this->binders[$key];
+
return $class::routeBinder($value, $route);
}
}
diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php
index 2686edac4f..8784890ec9 100755
--- a/app/Http/Middleware/EncryptCookies.php
+++ b/app/Http/Middleware/EncryptCookies.php
@@ -16,7 +16,8 @@ class EncryptCookies extends BaseEncrypter
*
* @var array
*/
- protected $except = [
- //
- ];
+ protected $except
+ = [
+ //
+ ];
}
diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php
index a4b6ead33d..36155e56d3 100644
--- a/app/Http/Middleware/Range.php
+++ b/app/Http/Middleware/Range.php
@@ -73,6 +73,10 @@ class Range
Session::put('first', Carbon::now()->startOfYear());
}
}
+
+ // check "sum of everything".
+
+
$current = Carbon::now()->formatLocalized('%B %Y');
$next = Carbon::now()->endOfMonth()->addDay()->formatLocalized('%B %Y');
$prev = Carbon::now()->startOfMonth()->subDay()->formatLocalized('%B %Y');
diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php
index 578c034176..004336e184 100644
--- a/app/Http/Requests/AccountFormRequest.php
+++ b/app/Http/Requests/AccountFormRequest.php
@@ -53,7 +53,7 @@ class AccountFormRequest extends Request
'ccMonthlyPaymentDate' => 'date',
'amount_currency_id_openingBalance' => 'exists:transaction_currencies,id',
'amount_currency_id_virtualBalance' => 'exists:transaction_currencies,id',
- 'what' => 'in:' . $types
+ 'what' => 'in:' . $types,
];
}
}
diff --git a/app/Http/Requests/BudgetFormRequest.php b/app/Http/Requests/BudgetFormRequest.php
index 11207e8037..8d99f5f52a 100644
--- a/app/Http/Requests/BudgetFormRequest.php
+++ b/app/Http/Requests/BudgetFormRequest.php
@@ -36,7 +36,7 @@ class BudgetFormRequest extends Request
return [
'name' => $nameRule,
- 'active' => 'numeric|between:0,1'
+ 'active' => 'numeric|between:0,1',
];
}
}
diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php
index d5e7423b36..be60f0e06a 100644
--- a/app/Http/Requests/RuleFormRequest.php
+++ b/app/Http/Requests/RuleFormRequest.php
@@ -62,6 +62,7 @@ class RuleFormRequest extends Request
for ($i = 0; $i < 10; $i++) {
$rules['rule-action-value.' . $i] = 'required_if:rule-action.' . $i . ',' . $contextActions . '|ruleActionValue';
}
+
return $rules;
}
}
diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php
index 638c50341b..112a1dcca6 100644
--- a/app/Http/Requests/RuleGroupFormRequest.php
+++ b/app/Http/Requests/RuleGroupFormRequest.php
@@ -42,7 +42,7 @@ class RuleGroupFormRequest extends Request
}
return [
- 'title' => $titleRule,
+ 'title' => $titleRule,
'description' => 'between:1,5000',
];
}
diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php
index 28773c874c..a4f5da9021 100644
--- a/app/Http/Requests/TagFormRequest.php
+++ b/app/Http/Requests/TagFormRequest.php
@@ -42,7 +42,7 @@ class TagFormRequest extends Request
'latitude' => 'numeric|min:-90|max:90',
'longitude' => 'numeric|min:-90|max:90',
'zoomLevel' => 'numeric|min:0|max:80',
- 'tagMode' => 'required|in:nothing,balancingAct,advancePayment'
+ 'tagMode' => 'required|in:nothing,balancingAct,advancePayment',
];
}
}
diff --git a/app/Models/Account.php b/app/Models/Account.php
index d381f6b4c1..ecfc6825ea 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -5,11 +5,11 @@ use Crypt;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
+use Illuminate\Database\Query\Builder;
use Illuminate\Database\Query\JoinClause;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Watson\Validating\ValidatingTrait;
-
/**
* FireflyIII\Models\Account
*
@@ -30,8 +30,8 @@ use Watson\Validating\ValidatingTrait;
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions
* @property-read \FireflyIII\User $user
- * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account accountTypeIn($types)
- * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account hasMetaValue($name, $value)
+ * @method static Builder|\FireflyIII\Models\Account accountTypeIn($types)
+ * @method static Builder|\FireflyIII\Models\Account hasMetaValue($name, $value)
* @property string $startBalance
* @property string $endBalance
*/
@@ -41,12 +41,13 @@ class Account extends Model
protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban'];
protected $hidden = ['virtual_balance_encrypted', 'encrypted'];
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $rules
= [
'user_id' => 'required|exists:users,id',
'account_type_id' => 'required|exists:account_types,id',
'name' => 'required',
- 'active' => 'required|boolean'
+ 'active' => 'required|boolean',
];
/**
@@ -126,15 +127,6 @@ class Account extends Model
return $this->belongsTo('FireflyIII\Models\AccountType');
}
- /**
- * @codeCoverageIgnore
- * @return string[]
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at'];
- }
-
/**
* @codeCoverageIgnore
*
@@ -293,6 +285,11 @@ class Account extends Model
return $this->belongsTo('FireflyIII\User');
}
+ /**
+ * @param Account $value
+ *
+ * @return Account
+ */
public static function routeBinder(Account $value)
{
diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php
index aab45415f6..846ff8954b 100644
--- a/app/Models/AccountMeta.php
+++ b/app/Models/AccountMeta.php
@@ -2,7 +2,6 @@
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
-use Watson\Validating\ValidatingTrait;
/**
* FireflyIII\Models\AccountMeta
@@ -18,14 +17,8 @@ use Watson\Validating\ValidatingTrait;
class AccountMeta extends Model
{
- use ValidatingTrait;
+ protected $dates = ['created_at', 'updated_at'];
protected $fillable = ['account_id', 'name', 'data'];
- protected $rules
- = [
- 'account_id' => 'required|exists:accounts,id',
- 'name' => 'required|between:1,100',
- 'data' => 'required'
- ];
protected $table = 'account_meta';
/**
@@ -48,14 +41,6 @@ class AccountMeta extends Model
return json_decode($value);
}
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at'];
- }
-
/**
* @param $value
*/
diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php
index 55f1e1f720..817d488b14 100644
--- a/app/Models/AccountType.php
+++ b/app/Models/AccountType.php
@@ -17,6 +17,8 @@ use Illuminate\Database\Eloquent\Model;
class AccountType extends Model
{
+ protected $dates = ['created_at', 'updated_at'];
+
//
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
@@ -25,13 +27,4 @@ class AccountType extends Model
{
return $this->hasMany('FireflyIII\Models\Account');
}
-
- /**
- * @return array
- */
- /** @noinspection PhpMissingParentCallCommonInspection */
- public function getDates()
- {
- return ['created_at', 'updated_at'];
- }
}
diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php
index 4d90fc06a1..f57d1d31b5 100644
--- a/app/Models/Attachment.php
+++ b/app/Models/Attachment.php
@@ -175,6 +175,11 @@ class Attachment extends Model
$this->attributes['notes'] = Crypt::encrypt($value);
}
+ /**
+ * @param Attachment $value
+ *
+ * @return Attachment
+ */
public static function routeBinder(Attachment $value)
{
if (Auth::check()) {
diff --git a/app/Models/Bill.php b/app/Models/Bill.php
index 79cf30bbfe..d8ca9ef6dd 100644
--- a/app/Models/Bill.php
+++ b/app/Models/Bill.php
@@ -28,6 +28,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property boolean $match_encrypted
* @property-read Collection|TransactionJournal[] $transactionjournals
* @property-read User $user
+ * @property Carbon $nextExpectedMatch
+ * @property Carbon $lastFoundMatch
*/
class Bill extends Model
{
@@ -36,15 +38,7 @@ class Bill extends Model
= ['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
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'date'];
- }
+ protected $dates = ['created_at', 'updated_at', 'date'];
/**
* @param $value
@@ -127,6 +121,11 @@ class Bill extends Model
}
+ /**
+ * @param Bill $value
+ *
+ * @return Bill
+ */
public static function routeBinder(Bill $value)
{
if (Auth::check()) {
diff --git a/app/Models/Budget.php b/app/Models/Budget.php
index 4000306a2c..ed72b0b1e8 100644
--- a/app/Models/Budget.php
+++ b/app/Models/Budget.php
@@ -23,6 +23,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read Collection|BudgetLimit[] $budgetlimits
* @property-read Collection|TransactionJournal[] $transactionjournals
* @property-read User $user
+ * @property string $dateFormatted
+ * @property string $budgeted
*/
class Budget extends Model
{
@@ -31,6 +33,7 @@ class Budget extends Model
protected $fillable = ['user_id', 'name', 'active'];
protected $hidden = ['encrypted'];
+ protected $dates = ['created_at', 'updated_at', 'deleted_at', 'startdate', 'enddate'];
/**
* @param array $fields
@@ -69,14 +72,6 @@ class Budget extends Model
return $this->hasMany('FireflyIII\Models\BudgetLimit');
}
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'enddate'];
- }
-
/**
* @param $value
*
@@ -125,6 +120,11 @@ class Budget extends Model
return $this->belongsTo('FireflyIII\User');
}
+ /**
+ * @param Budget $value
+ *
+ * @return Budget
+ */
public static function routeBinder(Budget $value)
{
if (Auth::check()) {
diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php
index ba44ed72b0..0a05e24836 100644
--- a/app/Models/BudgetLimit.php
+++ b/app/Models/BudgetLimit.php
@@ -22,6 +22,7 @@ class BudgetLimit extends Model
{
protected $hidden = ['amount_encrypted'];
+ protected $dates = ['created_at', 'updated_at', 'startdate'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
@@ -31,14 +32,6 @@ class BudgetLimit extends Model
return $this->belongsTo('FireflyIII\Models\Budget');
}
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'startdate'];
- }
-
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
diff --git a/app/Models/Category.php b/app/Models/Category.php
index b331b5960a..84e79ae404 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -21,6 +21,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property boolean $encrypted
* @property-read Collection|TransactionJournal[] $transactionjournals
* @property-read User $user
+ * @property string $dateFormatted
*/
class Category extends Model
{
@@ -28,6 +29,7 @@ class Category extends Model
protected $fillable = ['user_id', 'name'];
protected $hidden = ['encrypted'];
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/**
* @param array $fields
@@ -57,15 +59,6 @@ class Category extends Model
}
- /**
- * @codeCoverageIgnore
- * @return string[]
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at'];
- }
-
/**
* @codeCoverageIgnore
*
@@ -112,6 +105,11 @@ class Category extends Model
return $this->belongsTo('FireflyIII\User');
}
+ /**
+ * @param Category $value
+ *
+ * @return Category
+ */
public static function routeBinder(Category $value)
{
if (Auth::check()) {
diff --git a/app/Models/Component.php b/app/Models/Component.php
index 82ffc02f1c..3cdf904b4f 100644
--- a/app/Models/Component.php
+++ b/app/Models/Component.php
@@ -1,24 +1,14 @@
belongsTo('FireflyIII\Models\BudgetLimit');
}
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'startdate', 'enddate'];
- }
-
/**
* @param $value
*/
@@ -47,6 +40,11 @@ class LimitRepetition extends Model
}
+ /**
+ * @param $value
+ *
+ * @return mixed
+ */
public static function routeBinder($value)
{
if (Auth::check()) {
diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php
index c1c7513934..73c1ab74db 100644
--- a/app/Models/PiggyBank.php
+++ b/app/Models/PiggyBank.php
@@ -27,7 +27,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read Account $account
* @property-read Collection|PiggyBankRepetition[] $piggyBankRepetitions
* @property-read Collection|PiggyBankEvent[] $piggyBankEvents
- * @property string $reminder
+ * @property string $reminder
*/
class PiggyBank extends Model
{
@@ -36,6 +36,7 @@ class PiggyBank extends Model
protected $fillable
= ['name', 'account_id', 'order', 'targetamount', 'startdate', 'targetdate', 'remind_me', 'reminder_skip'];
protected $hidden = ['targetamount_encrypted', 'encrypted'];
+ protected $dates = ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
@@ -72,14 +73,6 @@ class PiggyBank extends Model
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
}
- /**
- * @return string[]
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
- }
-
/**
*
* @param $value
@@ -122,6 +115,11 @@ class PiggyBank extends Model
$this->attributes['targetamount'] = strval(round($value, 2));
}
+ /**
+ * @param PiggyBank $value
+ *
+ * @return PiggyBank
+ */
public static function routeBinder(PiggyBank $value)
{
if (Auth::check()) {
diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php
index e373ab93a1..1710da1617 100644
--- a/app/Models/PiggyBankEvent.php
+++ b/app/Models/PiggyBankEvent.php
@@ -19,18 +19,10 @@ use Illuminate\Database\Eloquent\Model;
class PiggyBankEvent extends Model
{
+ protected $dates = ['created_at', 'updated_at', 'date'];
protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];
protected $hidden = ['amount_encrypted'];
- /**
- * @return array
- */
- /** @noinspection PhpMissingParentCallCommonInspection */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'date'];
- }
-
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php
index 25ada5c27b..b8fb7eec61 100644
--- a/app/Models/PiggyBankRepetition.php
+++ b/app/Models/PiggyBankRepetition.php
@@ -24,14 +24,7 @@ class PiggyBankRepetition extends Model
protected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];
protected $hidden = ['currentamount_encrypted'];
-
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'startdate', 'targetdate'];
- }
+ protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
diff --git a/app/Models/Preference.php b/app/Models/Preference.php
index d66b36476e..641054e3f4 100644
--- a/app/Models/Preference.php
+++ b/app/Models/Preference.php
@@ -23,6 +23,7 @@ class Preference extends Model
protected $fillable = ['user_id', 'data', 'name'];
protected $hidden = ['data_encrypted', 'name_encrypted'];
+ protected $dates = ['created_at', 'updated_at'];
/**
* @param $value
@@ -39,14 +40,6 @@ class Preference extends Model
return json_decode($data);
}
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at'];
- }
-
/**
* @param $value
*/
diff --git a/app/Models/Rule.php b/app/Models/Rule.php
index b99d6334b0..faf2110825 100644
--- a/app/Models/Rule.php
+++ b/app/Models/Rule.php
@@ -37,6 +37,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Rule extends Model
{
use SoftDeletes;
+
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.php
index 257ae41f7d..fd65f781d5 100644
--- a/app/Models/RuleAction.php
+++ b/app/Models/RuleAction.php
@@ -15,15 +15,15 @@ use Illuminate\Database\Eloquent\Model;
/**
* FireflyIII\Models\RuleAction
*
- * @property integer $id
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- * @property integer $rule_id
- * @property integer $order
- * @property boolean $active
- * @property boolean $stop_processing
- * @property string $action_type
- * @property string $action_value
+ * @property integer $id
+ * @property \Carbon\Carbon $created_at
+ * @property \Carbon\Carbon $updated_at
+ * @property integer $rule_id
+ * @property integer $order
+ * @property boolean $active
+ * @property boolean $stop_processing
+ * @property string $action_type
+ * @property string $action_value
* @property-read \FireflyIII\Models\Rule $rule
*/
class RuleAction extends Model
diff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.php
index daaeea0e98..fb504433a8 100644
--- a/app/Models/RuleTrigger.php
+++ b/app/Models/RuleTrigger.php
@@ -14,16 +14,16 @@ use Illuminate\Database\Eloquent\Model;
/**
* FireflyIII\Models\RuleTrigger
*
- * @property integer $id
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- * @property integer $rule_id
- * @property integer $order
- * @property string $title
- * @property string $trigger_type
- * @property string $trigger_value
- * @property boolean $active
- * @property boolean $stop_processing
+ * @property integer $id
+ * @property \Carbon\Carbon $created_at
+ * @property \Carbon\Carbon $updated_at
+ * @property integer $rule_id
+ * @property integer $order
+ * @property string $title
+ * @property string $trigger_type
+ * @property string $trigger_value
+ * @property boolean $active
+ * @property boolean $stop_processing
* @property-read \FireflyIII\Models\Rule $rule
*/
class RuleTrigger extends Model
diff --git a/app/Models/Tag.php b/app/Models/Tag.php
index f9aa51a1a0..f9894ef980 100644
--- a/app/Models/Tag.php
+++ b/app/Models/Tag.php
@@ -9,7 +9,6 @@ use FireflyIII\User;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Watson\Validating\ValidatingTrait;
/**
* FireflyIII\Models\Tag
@@ -31,18 +30,8 @@ use Watson\Validating\ValidatingTrait;
*/
class Tag extends Model
{
- use ValidatingTrait;
-
protected $fillable = ['user_id', 'tag', 'date', 'description', 'longitude', 'latitude', 'zoomLevel', 'tagMode'];
- protected $rules
- = [
- 'tag' => 'required|min:1',
- 'description' => 'min:1',
- 'date' => 'date',
- 'latitude' => 'numeric|min:-90|max:90',
- 'longitude' => 'numeric|min:-90|max:90',
- 'tagMode' => 'required|in:nothing,balancingAct,advancePayment'
- ];
+ protected $dates = ['created_at', 'updated_at', 'date'];
/**
* @param array $fields
@@ -76,15 +65,6 @@ class Tag extends Model
}
- /**
- * @codeCoverageIgnore
- * @return string[]
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'date'];
- }
-
/**
* Save the model to the database.
*
@@ -170,6 +150,11 @@ class Tag extends Model
}
+ /**
+ * @param Tag $value
+ *
+ * @return Tag
+ */
public static function routeBinder(Tag $value)
{
if (Auth::check()) {
diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php
index 1bdd1148a1..2357277d52 100644
--- a/app/Models/Transaction.php
+++ b/app/Models/Transaction.php
@@ -33,8 +33,10 @@ class Transaction extends Model
'account_id' => 'required|exists:accounts,id',
'transaction_journal_id' => 'required|exists:transaction_journals,id',
'description' => 'between:1,255',
- 'amount' => 'required|numeric'
+ 'amount' => 'required|numeric',
];
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
+
use SoftDeletes, ValidatingTrait;
/**
@@ -55,14 +57,6 @@ class Transaction extends Model
return $value;
}
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at'];
- }
-
/**
* @param EloquentBuilder $query
* @param Carbon $date
diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php
index 168bfb9bf5..1ed3691164 100644
--- a/app/Models/TransactionCurrency.php
+++ b/app/Models/TransactionCurrency.php
@@ -25,14 +25,7 @@ class TransactionCurrency extends Model
protected $fillable = ['name', 'code', 'symbol'];
-
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at'];
- }
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
@@ -44,6 +37,8 @@ class TransactionCurrency extends Model
/**
* @param TransactionCurrency $currency
+ *
+ * @return TransactionCurrency
*/
public static function routeBinder(TransactionCurrency $currency)
{
diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php
index 5d2830778d..51275cf773 100644
--- a/app/Models/TransactionGroup.php
+++ b/app/Models/TransactionGroup.php
@@ -22,13 +22,7 @@ class TransactionGroup extends Model
{
use SoftDeletes;
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at'];
- }
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php
index d060021302..4299f900b1 100644
--- a/app/Models/TransactionJournal.php
+++ b/app/Models/TransactionJournal.php
@@ -12,7 +12,6 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Query\Builder;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Watson\Validating\ValidatingTrait;
/**
* FireflyIII\Models\TransactionJournal
@@ -55,23 +54,13 @@ use Watson\Validating\ValidatingTrait;
*/
class TransactionJournal extends Model
{
- use SoftDeletes, ValidatingTrait;
+ use SoftDeletes;
protected $fillable
= ['user_id', 'transaction_type_id', 'bill_id', 'transaction_currency_id', 'description', 'completed', 'date', 'encrypted', 'tag_count'];
protected $hidden = ['encrypted'];
- protected $rules
- = [
- 'user_id' => 'required|exists:users,id',
- 'transaction_type_id' => 'required|exists:transaction_types,id',
- 'bill_id' => 'exists:bills,id',
- 'transaction_currency_id' => 'required|exists:transaction_currencies,id',
- 'description' => 'required|between:1,1024',
- 'completed' => 'required|boolean',
- 'date' => 'required|date',
- 'encrypted' => 'required|boolean'
- ];
+ protected $dates = ['created_at', 'updated_at', 'date', 'deleted_at'];
/**
* @codeCoverageIgnore
@@ -140,72 +129,6 @@ class TransactionJournal extends Model
}
- /**
- * @param Tag $tag
- * @param $amount
- *
- * @return string
- */
- protected function amountByTagAdvancePayment(Tag $tag, $amount)
- {
- if ($this->isWithdrawal()) {
- $others = $tag->transactionJournals()->transactionTypes([TransactionType::DEPOSIT])->get();
- foreach ($others as $other) {
- $amount = bcsub($amount, $other->amount_positive);
- }
-
- return $amount;
- }
- if ($this->isDeposit()) {
- return '0';
- }
-
- return $amount;
- }
-
- /**
- * @param $tag
- * @param $amount
- *
- * @return string
- */
- protected function amountByTagBalancingAct($tag, $amount)
- {
- if ($this->isWithdrawal()) {
- $transfer = $tag->transactionJournals()->transactionTypes([TransactionType::TRANSFER])->first();
- if ($transfer) {
- $amount = bcsub($amount, $transfer->amount_positive);
-
- return $amount;
- }
- }
-
- return $amount;
- }
-
- /**
- * Assuming the journal has only one tag. Parameter amount is used as fallback.
- *
- * @param Tag $tag
- * @param string $amount
- *
- * @return string
- */
- protected function amountByTag(Tag $tag, $amount)
- {
- if ($tag->tagMode == 'advancePayment') {
- return $this->amountByTagAdvancePayment($tag, $amount);
- }
-
- if ($tag->tagMode == 'balancingAct') {
- return $this->amountByTagBalancingAct($tag, $amount);
-
- }
-
- return $amount;
-
- }
-
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
@@ -215,27 +138,6 @@ class TransactionJournal extends Model
return $this->belongsToMany('FireflyIII\Models\Tag');
}
- /**
- * @param string $amount
- *
- * @return string
- */
- public function amountByTags($amount)
- {
- $firstBalancingAct = $this->tags()->where('tagMode', 'balancingAct')->first();
- if ($firstBalancingAct) {
- return $this->amountByTag($firstBalancingAct, $amount);
- }
-
- $firstAdvancePayment = $this->tags()->where('tagMode', 'advancePayment')->first();
- if ($firstAdvancePayment) {
- return $this->amountByTag($firstAdvancePayment, $amount);
- }
-
- return $amount;
- }
-
-
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\HasMany
@@ -245,15 +147,6 @@ class TransactionJournal extends Model
return $this->hasMany('FireflyIII\Models\Transaction');
}
- /**
- * @codeCoverageIgnore
- * @return string[]
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'date', 'deleted_at'];
- }
-
/**
* Save the model to the database.
*
@@ -314,21 +207,6 @@ class TransactionJournal extends Model
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
}
- /**
- * @codeCoverageIgnore
- *
- * @param EloquentBuilder $query
- * @param Account $account
- */
- public function scopeAccountIs(EloquentBuilder $query, Account $account)
- {
- if (!isset($this->joinedTransactions)) {
- $query->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id');
- $this->joinedTransactions = true;
- }
- $query->where('transactions.account_id', $account->id);
- }
-
/**
* @codeCoverageIgnore
*
@@ -355,19 +233,6 @@ class TransactionJournal extends Model
return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d 00:00:00'));
}
- /**
- * @codeCoverageIgnore
- *
- * @param EloquentBuilder $query
- * @param Carbon $date
- *
- * @return EloquentBuilder
- */
- public function scopeOnDate(EloquentBuilder $query, Carbon $date)
- {
- return $query->where('date', '=', $date->format('Y-m-d'));
- }
-
/**
* @codeCoverageIgnore
*
@@ -514,15 +379,18 @@ class TransactionJournal extends Model
/**
* @param $value
- * @param $route
*
* @return mixed
* @throws NotFoundHttpException
*/
- public static function routeBinder($value, $route)
+ public static function routeBinder($value)
{
if (Auth::check()) {
- $object = TransactionJournal::where('id', $value)->where('user_id', Auth::user()->id)->first();
+ $validTypes = [TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::TRANSFER];
+ $object = TransactionJournal::where('transaction_journals.id', $value)
+ ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
+ ->whereIn('transaction_types.type', $validTypes)
+ ->where('user_id', Auth::user()->id)->first(['transaction_journals.*']);
if ($object) {
return $object;
}
diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php
index 6df752b214..f3201469c1 100644
--- a/app/Models/TransactionType.php
+++ b/app/Models/TransactionType.php
@@ -24,13 +24,7 @@ class TransactionType extends Model
const TRANSFER = 'Transfer';
const OPENING_BALANCE = 'Opening balance';
- /**
- * @return array
- */
- public function getDates()
- {
- return ['created_at', 'updated_at', 'deleted_at'];
- }
+ protected $dates = ['created_at', 'updated_at', 'deleted_at'];
/**
* @return bool
@@ -65,6 +59,8 @@ class TransactionType extends Model
}
/**
+ * @codeCoverageIgnore
+ *
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function transactionJournals()
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index 0666667ec6..7d3f4d2b73 100755
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -17,14 +17,16 @@ class AuthServiceProvider extends ServiceProvider
*
* @var array
*/
- protected $policies = [
- 'FireflyIII\Model' => 'FireflyIII\Policies\ModelPolicy',
- ];
+ protected $policies
+ = [
+ 'FireflyIII\Model' => 'FireflyIII\Policies\ModelPolicy',
+ ];
/**
* Register any application authentication / authorization services.
*
- * @param \Illuminate\Contracts\Auth\Access\Gate $gate
+ * @param \Illuminate\Contracts\Auth\Access\Gate $gate
+ *
* @return void
*/
public function boot(GateContract $gate)
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 7b86a54d04..7d0b742adf 100755
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -29,19 +29,19 @@ class EventServiceProvider extends ServiceProvider
*/
protected $listen
= [
- 'FireflyIII\Events\TransactionJournalUpdated' => [
+ 'FireflyIII\Events\TransactionJournalUpdated' => [
'FireflyIII\Handlers\Events\ScanForBillsAfterUpdate',
'FireflyIII\Handlers\Events\UpdateJournalConnection',
'FireflyIII\Handlers\Events\FireRulesForUpdate',
],
- 'FireflyIII\Events\TransactionJournalStored' => [
+ 'FireflyIII\Events\TransactionJournalStored' => [
'FireflyIII\Handlers\Events\ScanForBillsAfterStore',
'FireflyIII\Handlers\Events\ConnectJournalToPiggyBank',
'FireflyIII\Handlers\Events\FireRulesForStore',
- ]
+ ],
];
diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php
index 1a57d10806..ba3b700a19 100644
--- a/app/Providers/FireflyServiceProvider.php
+++ b/app/Providers/FireflyServiceProvider.php
@@ -11,8 +11,8 @@ use FireflyIII\Support\Twig\Budget;
use FireflyIII\Support\Twig\General;
use FireflyIII\Support\Twig\Journal;
use FireflyIII\Support\Twig\PiggyBank;
-use FireflyIII\Support\Twig\Translation;
use FireflyIII\Support\Twig\Rule;
+use FireflyIII\Support\Twig\Translation;
use FireflyIII\Validation\FireflyValidator;
use Illuminate\Support\ServiceProvider;
use Twig;
@@ -54,7 +54,6 @@ class FireflyServiceProvider extends ServiceProvider
public function register()
{
-
$this->app->bind(
'preferences', function () {
return new Preferences;
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 34cdcf76c6..6e583159bf 100755
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -2,8 +2,8 @@
namespace FireflyIII\Providers;
-use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
+use Illuminate\Routing\Router;
/**
* Class RouteServiceProvider
@@ -24,7 +24,8 @@ class RouteServiceProvider extends ServiceProvider
/**
* Define your route model bindings, pattern filters, etc.
*
- * @param \Illuminate\Routing\Router $router
+ * @param \Illuminate\Routing\Router $router
+ *
* @return void
*/
public function boot(Router $router)
@@ -37,13 +38,16 @@ class RouteServiceProvider extends ServiceProvider
/**
* Define the routes for the application.
*
- * @param \Illuminate\Routing\Router $router
+ * @param \Illuminate\Routing\Router $router
+ *
* @return void
*/
public function map(Router $router)
{
- $router->group(['namespace' => $this->namespace], function ($router) {
+ $router->group(
+ ['namespace' => $this->namespace], function ($router) {
require app_path('Http/routes.php');
- });
+ }
+ );
}
}
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index 0dd0573754..6a9ebf260b 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -111,7 +111,7 @@ class AccountRepository implements AccountRepositoryInterface
'accounts.*',
'ccType.data as ccType',
'accountRole.data as accountRole',
- DB::Raw('SUM(`transactions`.`amount`) AS `balance`')
+ DB::Raw('SUM(`transactions`.`amount`) AS `balance`'),
]
);
@@ -323,7 +323,8 @@ class AccountRepository implements AccountRepositoryInterface
{
$journal = TransactionJournal
::orderBy('transaction_journals.date', 'ASC')
- ->accountIs($account)
+ ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
+ ->where('transactions.account_id', $account->id)
->transactionTypes([TransactionType::OPENING_BALANCE])
->orderBy('created_at', 'ASC')
->first(['transaction_journals.*']);
@@ -377,6 +378,8 @@ class AccountRepository implements AccountRepositoryInterface
* @param Account $account
* @param array $data
*
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) // need the complexity.
+ *
* @return Account
*/
public function update(Account $account, array $data)
@@ -390,15 +393,10 @@ class AccountRepository implements AccountRepositoryInterface
$this->updateMetadata($account, $data);
$openingBalance = $this->openingBalanceTransaction($account);
-
- // if has openingbalance?
if ($data['openingBalance'] != 0) {
- // if opening balance, do an update:
if ($openingBalance) {
- // update existing opening balance.
$this->updateInitialBalance($account, $openingBalance, $data);
} else {
- // create new opening balance.
$type = $data['openingBalance'] < 0 ? 'expense' : 'revenue';
$opposingData = [
'user' => $data['user'],
@@ -480,7 +478,7 @@ class AccountRepository implements AccountRepositoryInterface
[
'account_id' => $account->id,
'name' => $field,
- 'data' => $data[$field]
+ 'data' => $data[$field],
]
);
$metaData->save();
@@ -509,7 +507,7 @@ class AccountRepository implements AccountRepositoryInterface
'description' => 'Initial balance for "' . $account->name . '"',
'completed' => true,
'date' => $data['openingBalanceDate'],
- 'encrypted' => true
+ 'encrypted' => true,
]
);
@@ -547,21 +545,21 @@ class AccountRepository implements AccountRepositoryInterface
foreach ($validFields as $field) {
$entry = $account->accountMeta()->where('name', $field)->first();
- // update if new data is present:
- if ($entry && isset($data[$field])) {
- $entry->data = $data[$field];
- $entry->save();
- }
- // no entry but data present?
- if (!$entry && isset($data[$field])) {
- $metaData = new AccountMeta(
- [
- 'account_id' => $account->id,
- 'name' => $field,
- 'data' => $data[$field]
- ]
- );
- $metaData->save();
+ if (isset($data[$field])) {
+ // update if new data is present:
+ if (!is_null($entry)) {
+ $entry->data = $data[$field];
+ $entry->save();
+ } else {
+ $metaData = new AccountMeta(
+ [
+ 'account_id' => $account->id,
+ 'name' => $field,
+ 'data' => $data[$field],
+ ]
+ );
+ $metaData->save();
+ }
}
}
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index 17386d9797..daa5a2a698 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -61,7 +61,7 @@ class BillRepository implements BillRepositoryInterface
->get(
[
'transaction_journals.bill_id',
- DB::Raw('SUM(`transactions`.`amount`) as `journalAmount`')
+ DB::Raw('SUM(`transactions`.`amount`) as `journalAmount`'),
]
);
@@ -476,7 +476,7 @@ class BillRepository implements BillRepositoryInterface
->get(
[
'bills.*',
- DB::Raw('(`bills`.`amount_min` + `bills`.`amount_max` / 2) as `expectedAmount`')
+ DB::Raw('(`bills`.`amount_min` + `bills`.`amount_max` / 2) as `expectedAmount`'),
]
)->sortBy('name');
@@ -540,8 +540,7 @@ class BillRepository implements BillRepositoryInterface
/** @var Account $creditCard */
foreach ($creditCards as $creditCard) {
if ($creditCard->balance == 0) {
- // find a transfer TO the credit card which should account for
- // anything paid. If not, the CC is not yet used.
+ // find a transfer TO the credit card which should account for anything paid. If not, the CC is not yet used.
$set = TransactionJournal::whereIn(
'transaction_journals.id', function (Builder $q) use ($creditCard, $start, $end) {
$q->select('transaction_journals.id')
diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php
index 75c9ca247f..715665e372 100644
--- a/app/Repositories/Budget/BudgetRepository.php
+++ b/app/Repositories/Budget/BudgetRepository.php
@@ -89,7 +89,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
->get(
[
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`, "%Y-%m") AS `dateFormatted`'),
- DB::Raw('SUM(`transactions`.`amount`) as `monthlyAmount`')
+ DB::Raw('SUM(`transactions`.`amount`) as `monthlyAmount`'),
]
);
@@ -316,7 +316,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
[
'budgets.*',
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`, "%Y-%m") AS `dateFormatted`'),
- DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`')
+ DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`'),
]
);
@@ -559,7 +559,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
[
'budgets.*',
DB::Raw('DATE_FORMAT(`limit_repetitions`.`startdate`,"%Y") as `dateFormatted`'),
- DB::Raw('SUM(`limit_repetitions`.`amount`) as `budgeted`')
+ DB::Raw('SUM(`limit_repetitions`.`amount`) as `budgeted`'),
]
);
@@ -575,6 +575,8 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
* @param Carbon $start
* @param Carbon $end
*
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength) // it's a query.
+ *
* @return array
*/
public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end)
@@ -601,7 +603,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
[
'budgets.*',
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`, "%Y") AS `dateFormatted`'),
- DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`')
+ DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`'),
]
);
@@ -718,7 +720,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
->get(
[
't_from.account_id', 'budget_transaction_journal.budget_id',
- DB::Raw('SUM(`t_from`.`amount`) AS `spent`')
+ DB::Raw('SUM(`t_from`.`amount`) AS `spent`'),
]
);
diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php
index 534188bace..6d0cc981d2 100644
--- a/app/Repositories/Category/CategoryRepository.php
+++ b/app/Repositories/Category/CategoryRepository.php
@@ -76,22 +76,7 @@ class CategoryRepository implements CategoryRepositoryInterface
*/
public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end)
{
- /*
- * select categories.id, DATE_FORMAT(transaction_journals.date,"%Y") as dateFormatted, transaction_types.type, SUM(amount) as sum from categories
-left join category_transaction_journal ON category_transaction_journal.category_id = categories.id
-left join transaction_journals ON transaction_journals.id = category_transaction_journal.transaction_journal_id
-left join transaction_types ON transaction_types.id = transaction_journals.transaction_type_id
-left join transactions ON transactions.transaction_journal_id = transaction_journals.id
-
-
-where
-categories.user_id =1
-and transaction_types.type in ("Withdrawal","Deposit")
-and transactions.account_id IN (2,4,6,10,11,610,725,879,1248)
-
-group by categories.id, transaction_types.type, dateFormatted
- */
$set = Auth::user()->categories()
->leftJoin('category_transaction_journal', 'category_transaction_journal.category_id', '=', 'categories.id')
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'category_transaction_journal.transaction_journal_id')
@@ -100,6 +85,8 @@ group by categories.id, transaction_types.type, dateFormatted
->whereIn('transaction_types.type', [TransactionType::DEPOSIT, TransactionType::WITHDRAWAL])
->whereIn('transactions.account_id', $accounts->pluck('id')->toArray())
->whereIn('categories.id', $categories->pluck('id')->toArray())
+ ->where('transaction_journals.date', '>=', $start->format('Y-m-d'))
+ ->where('transaction_journals.date', '<=', $end->format('Y-m-d'))
->groupBy('categories.id')
->groupBy('transaction_types.type')
->groupBy('dateFormatted')
@@ -108,7 +95,7 @@ group by categories.id, transaction_types.type, dateFormatted
'categories.*',
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y") as `dateFormatted`'),
'transaction_types.type',
- DB::Raw('SUM(`amount`) as `sum`')
+ DB::Raw('SUM(`amount`) as `sum`'),
]
);
@@ -158,7 +145,7 @@ group by categories.id, transaction_types.type, dateFormatted
[
'categories.*',
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y-%m") as `dateFormatted`'),
- DB::Raw('SUM(`t_dest`.`amount`) AS `earned`')
+ DB::Raw('SUM(`t_dest`.`amount`) AS `earned`'),
]
);
@@ -212,7 +199,7 @@ group by categories.id, transaction_types.type, dateFormatted
[
'categories.*',
DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y-%m") as `dateFormatted`'),
- DB::Raw('SUM(`t_src`.`amount`) AS `spent`')
+ DB::Raw('SUM(`t_src`.`amount`) AS `spent`'),
]
);
@@ -286,7 +273,7 @@ group by categories.id, transaction_types.type, dateFormatted
$single = $query->first(
[
- DB::Raw('SUM(`transactions`.`amount`) as `sum`')
+ DB::Raw('SUM(`transactions`.`amount`) as `sum`'),
]
);
if (!is_null($single)) {
diff --git a/app/Repositories/Category/SingleCategoryRepository.php b/app/Repositories/Category/SingleCategoryRepository.php
index 3b52f6c04b..95c41a26fa 100644
--- a/app/Repositories/Category/SingleCategoryRepository.php
+++ b/app/Repositories/Category/SingleCategoryRepository.php
@@ -25,7 +25,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate
*/
public function countJournals(Category $category)
{
- return $category->transactionJournals()->count();
+ return $category->transactionjournals()->count();
}
@@ -39,7 +39,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate
*/
public function countJournalsInRange(Category $category, Carbon $start, Carbon $end)
{
- return $category->transactionJournals()->before($end)->after($start)->count();
+ return $category->transactionjournals()->before($end)->after($start)->count();
}
/**
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php
index c3d4d08c5e..e0b3dc3dc8 100644
--- a/app/Repositories/Journal/JournalRepository.php
+++ b/app/Repositories/Journal/JournalRepository.php
@@ -196,14 +196,14 @@ class JournalRepository implements JournalRepositoryInterface
[
'account_id' => $fromAccount->id,
'transaction_journal_id' => $journal->id,
- 'amount' => $data['amount'] * -1
+ 'amount' => $data['amount'] * -1,
]
);
Transaction::create( // second transaction.
[
'account_id' => $toAccount->id,
'transaction_journal_id' => $journal->id,
- 'amount' => $data['amount']
+ 'amount' => $data['amount'],
]
);
$journal->completed = 1;
@@ -323,6 +323,8 @@ class JournalRepository implements JournalRepositoryInterface
* @param array $data
*
* @return array
+ *
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
protected function storeAccounts(TransactionType $type, array $data)
{
diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php
index 171468a6ac..4593d1d1fe 100644
--- a/app/Repositories/RuleGroup/RuleGroupRepository.php
+++ b/app/Repositories/RuleGroup/RuleGroupRepository.php
@@ -8,6 +8,11 @@ use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup;
use Illuminate\Support\Collection;
+/**
+ * Class RuleGroupRepository
+ *
+ * @package FireflyIII\Repositories\RuleGroup
+ */
class RuleGroupRepository implements RuleGroupRepositoryInterface
{
/**
diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php
index 060f5c5b17..f1dd3f317b 100644
--- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php
+++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php
@@ -52,6 +52,8 @@ interface RuleGroupRepositoryInterface
public function resetRuleGroupOrder();
/**
+ * @param RuleGroup $ruleGroup
+ *
* @return bool
*/
public function resetRulesInGroupOrder(RuleGroup $ruleGroup);
diff --git a/app/Repositories/Shared/ComponentRepository.php b/app/Repositories/Shared/ComponentRepository.php
index aa604b2859..391e78f21d 100644
--- a/app/Repositories/Shared/ComponentRepository.php
+++ b/app/Repositories/Shared/ComponentRepository.php
@@ -35,7 +35,7 @@ class ComponentRepository
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
->whereIn('accounts.id', $ids)
->after($start)
- ->first([DB::Raw('SUM(`transactions`.`amount`) as `journalAmount`')]);
+ ->first([DB::raw('SUM(`transactions`.`amount`) as `journalAmount`')]);
$amount = $entry->journalAmount;
return $amount;
diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php
index ccdb2d9dae..d0368d05f1 100644
--- a/app/Repositories/Tag/TagRepository.php
+++ b/app/Repositories/Tag/TagRepository.php
@@ -27,6 +27,8 @@ class TagRepository implements TagRepositoryInterface
* @param TransactionJournal $journal
* @param Tag $tag
*
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
+ *
* @return boolean
*/
public function connect(TransactionJournal $journal, Tag $tag)
@@ -129,7 +131,7 @@ class TagRepository implements TagRepositoryInterface
->get(
[
't_to.account_id',
- DB::Raw('SUM(`t_to`.`amount`) as `sum`')
+ DB::Raw('SUM(`t_to`.`amount`) as `sum`'),
]
);
@@ -316,6 +318,8 @@ class TagRepository implements TagRepositoryInterface
* @param TransactionJournal $journal
* @param Tag $tag
*
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ *
* @return boolean
*/
protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag)
@@ -330,13 +334,11 @@ class TagRepository implements TagRepositoryInterface
$withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
$deposits = $tag->transactionjournals()->where('transaction_type_id', $deposit->id)->count();
- // advance payments cannot accept transfers:
- if ($journal->transaction_type_id == $transfer->id) {
+ if ($journal->transaction_type_id == $transfer->id) { // advance payments cannot accept transfers:
return false;
}
- // the first transaction to be attached to this
- // tag is attached just like that:
+ // the first transaction to be attached to this tag is attached just like that:
if ($withdrawals < 1 && $deposits < 1) {
$journal->tags()->save($tag);
$journal->save();
@@ -363,6 +365,8 @@ class TagRepository implements TagRepositoryInterface
* @param TransactionJournal $journal
* @param Tag $tag
*
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's complex but nothing can be done.
+ *
* @return bool
*/
protected function matchAll(TransactionJournal $journal, Tag $tag)
diff --git a/app/Rules/Actions/ActionInterface.php b/app/Rules/Actions/ActionInterface.php
index 16a597b7e1..91cbec46c7 100644
--- a/app/Rules/Actions/ActionInterface.php
+++ b/app/Rules/Actions/ActionInterface.php
@@ -8,6 +8,7 @@
*/
namespace FireflyIII\Rules\Actions;
+
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
@@ -21,7 +22,7 @@ interface ActionInterface
/**
* TriggerInterface constructor.
*
- * @param RuleAction $action
+ * @param RuleAction $action
* @param TransactionJournal $journal
*/
public function __construct(RuleAction $action, TransactionJournal $journal);
diff --git a/app/Rules/Actions/ClearBudget.php b/app/Rules/Actions/ClearBudget.php
index f74b633537..e1558afdcd 100644
--- a/app/Rules/Actions/ClearBudget.php
+++ b/app/Rules/Actions/ClearBudget.php
@@ -10,11 +10,8 @@
namespace FireflyIII\Rules\Actions;
-use Auth;
-use FireflyIII\Models\Category;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
-use Log;
/**
* Class ClearBudget
diff --git a/app/Rules/Actions/ClearCategory.php b/app/Rules/Actions/ClearCategory.php
index 107f2241e0..76569523b8 100644
--- a/app/Rules/Actions/ClearCategory.php
+++ b/app/Rules/Actions/ClearCategory.php
@@ -10,11 +10,8 @@
namespace FireflyIII\Rules\Actions;
-use Auth;
-use FireflyIII\Models\Category;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
-use Log;
/**
* Class ClearCategory
diff --git a/app/Rules/Actions/SetBudget.php b/app/Rules/Actions/SetBudget.php
index 5f77b75595..5373fdd6d4 100644
--- a/app/Rules/Actions/SetBudget.php
+++ b/app/Rules/Actions/SetBudget.php
@@ -15,6 +15,7 @@ use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Log;
+
/**
* Class SetBudget
*
@@ -56,7 +57,7 @@ class SetBudget implements ActionInterface
Log::debug('Will set budget "' . $search . '" (#' . $budget->id . ') on journal #' . $this->journal->id . '.');
$this->journal->budgets()->save($budget);
} else {
- Log::debug('Could not find budget "'.$search.'". Failed.');
+ Log::debug('Could not find budget "' . $search . '". Failed.');
}
return true;
diff --git a/app/Rules/Processor.php b/app/Rules/Processor.php
index 45692c8603..eb932ca2ec 100644
--- a/app/Rules/Processor.php
+++ b/app/Rules/Processor.php
@@ -39,6 +39,9 @@ class Processor
/**
* Processor constructor.
+ *
+ * @param Rule $rule
+ * @param TransactionJournal $journal
*/
public function __construct(Rule $rule, TransactionJournal $journal)
{
@@ -69,7 +72,7 @@ class Processor
$foundTriggers = 0;
$hitTriggers = 0;
/** @var RuleTrigger $trigger */
- foreach ($this->rule->ruleTriggers()->orderBy('order', 'ASC')->get() as $index => $trigger) {
+ foreach ($this->rule->ruleTriggers()->orderBy('order', 'ASC')->get() as $trigger) {
$foundTriggers++;
$type = $trigger->trigger_type;
@@ -107,7 +110,7 @@ class Processor
* @var int $index
* @var RuleAction $action
*/
- foreach ($this->rule->ruleActions()->orderBy('order', 'ASC')->get() as $index => $action) {
+ foreach ($this->rule->ruleActions()->orderBy('order', 'ASC')->get() as $action) {
$type = $action->action_type;
$class = $this->actionTypes[$type];
Log::debug('Action #' . $action->id . ' for rule #' . $action->rule_id . ' (' . $type . ')');
diff --git a/app/Rules/Triggers/FromAccountEnds.php b/app/Rules/Triggers/FromAccountEnds.php
index b207ef6ddd..57f686a063 100644
--- a/app/Rules/Triggers/FromAccountEnds.php
+++ b/app/Rules/Triggers/FromAccountEnds.php
@@ -44,29 +44,29 @@ class FromAccountEnds implements TriggerInterface
*/
public function triggered()
{
- $fromAccountName = strtolower($this->journal->source_account->name);
- $fromAccountNameLength = strlen($fromAccountName);
- $search = strtolower($this->trigger->trigger_value);
- $searchLength = strlen($search);
+ $name = strtolower($this->journal->source_account->name);
+ $nameLength = strlen($name);
+ $search = strtolower($this->trigger->trigger_value);
+ $searchLength = strlen($search);
// if the string to search for is longer than the account name,
// shorten the search string.
- if ($searchLength > $fromAccountNameLength) {
- Log::debug('Search string "' . $search . '" (' . $searchLength . ') is longer than "' . $fromAccountName . '" (' . $fromAccountNameLength . '). ');
- $search = substr($search, ($fromAccountNameLength * -1));
+ if ($searchLength > $nameLength) {
+ Log::debug('Search string "' . $search . '" (' . $searchLength . ') is longer than "' . $name . '" (' . $nameLength . '). ');
+ $search = substr($search, ($nameLength * -1));
$searchLength = strlen($search);
Log::debug('Search string is now "' . $search . '" (' . $searchLength . ') instead.');
}
- $part = substr($fromAccountName, $searchLength * -1);
+ $part = substr($name, $searchLength * -1);
if ($part == $search) {
- Log::debug('"' . $fromAccountName . '" ends with "' . $search . '". Return true.');
+ Log::debug('"' . $name . '" ends with "' . $search . '". Return true.');
return true;
}
- Log::debug('"' . $fromAccountName . '" does not end with "' . $search . '". Return false.');
+ Log::debug('"' . $name . '" does not end with "' . $search . '". Return false.');
return false;
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index 6298bc61f6..72bb329ad7 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -29,9 +29,9 @@ class Amount
*/
public function formatAnything(TransactionCurrency $format, $amount, $coloured = true)
{
- $locale = setlocale(LC_MONETARY, 0);
- $a = new NumberFormatter($locale, NumberFormatter::CURRENCY);
- $result = $a->formatCurrency($amount, $format->code);
+ $locale = setlocale(LC_MONETARY, 0);
+ $formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
+ $result = $formatter->formatCurrency($amount, $format->code);
if ($coloured === true) {
if ($amount == 0) {
@@ -136,7 +136,7 @@ class Amount
{
$currency = $transaction->transactionJournal->transactionCurrency;
- return $this->formatAnything($currency, $transaction->amount);
+ return $this->formatAnything($currency, $transaction->amount, $coloured);
}
/**
diff --git a/app/Support/Binder/CategoryList.php b/app/Support/Binder/CategoryList.php
index ff787b85b5..4f39ca6e2f 100644
--- a/app/Support/Binder/CategoryList.php
+++ b/app/Support/Binder/CategoryList.php
@@ -19,7 +19,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @package FireflyIII\Support\Binder
*/
class CategoryList implements BinderInterface
-
{
/**
diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.php
index 2aa4fe26de..db75e43d18 100644
--- a/app/Support/Binder/Date.php
+++ b/app/Support/Binder/Date.php
@@ -9,6 +9,7 @@
namespace FireflyIII\Support\Binder;
+use Auth;
use Carbon\Carbon;
use Exception;
use Log;
diff --git a/app/Support/Domain.php b/app/Support/Domain.php
index d1f8be1fed..8506fcc998 100644
--- a/app/Support/Domain.php
+++ b/app/Support/Domain.php
@@ -30,16 +30,16 @@ class Domain
/**
* @return array
*/
- public static function getRuleTriggers()
+ public static function getRuleActions()
{
- return Config::get('firefly.rule-triggers');
+ return Config::get('firefly.rule-actions');
}
/**
* @return array
*/
- public static function getRuleActions()
+ public static function getRuleTriggers()
{
- return Config::get('firefly.rule-actions');
+ return Config::get('firefly.rule-triggers');
}
}
\ No newline at end of file
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index 216d5528e4..647b75f138 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -28,7 +28,7 @@ class Steam
$set = Auth::user()->transactions()
->whereIn('account_id', $accounts)
->groupBy('account_id')
- ->get(['transactions.account_id', DB::Raw('MAX(`transaction_journals`.`date`) as `max_date`')]);
+ ->get(['transactions.account_id', DB::raw('MAX(`transaction_journals`.`date`) as `max_date`')]);
foreach ($set as $entry) {
$list[intval($entry->account_id)] = new Carbon($entry->max_date);
diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php
index 628745d1f8..29b9c2d31f 100644
--- a/app/Support/Twig/Journal.php
+++ b/app/Support/Twig/Journal.php
@@ -37,7 +37,7 @@ class Journal extends Twig_Extension
{
$functions = [
$this->invalidJournal(),
- $this->relevantTags()
+ $this->relevantTags(),
];
return $functions;
diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php
index 8cd9ef6779..6b0a9e181d 100644
--- a/app/Support/Twig/Rule.php
+++ b/app/Support/Twig/Rule.php
@@ -8,18 +8,18 @@ use Twig_SimpleFunction;
/**
* Class Rule
+ *
* @package FireflyIII\Support\Twig
*/
class Rule extends Twig_Extension
{
- /**
- *
- */
- public function getFunctions()
- {
- $functions = [];
- $functions[] = new Twig_SimpleFunction(
+ /**
+ * @return Twig_SimpleFunction
+ */
+ public function allJournalTriggers()
+ {
+ return new Twig_SimpleFunction(
'allJournalTriggers', function () {
return [
'store-journal' => trans('firefly.rule_trigger_store_journal'),
@@ -27,8 +27,14 @@ class Rule extends Twig_Extension
];
}
);
+ }
- $functions[] = new Twig_SimpleFunction(
+ /**
+ * @return Twig_SimpleFunction
+ */
+ public function allRuleTriggers()
+ {
+ return new Twig_SimpleFunction(
'allRuleTriggers', function () {
$ruleTriggers = array_keys(Config::get('firefly.rule-triggers'));
$possibleTriggers = [];
@@ -44,7 +50,15 @@ class Rule extends Twig_Extension
);
- $functions[] = new Twig_SimpleFunction('allRuleActions', function () {
+ }
+
+ /**
+ * @return Twig_SimpleFunction
+ */
+ public function allActionTriggers()
+ {
+ return new Twig_SimpleFunction(
+ 'allRuleActions', function () {
// array of valid values for actions
$ruleActions = array_keys(Config::get('firefly.rule-actions'));
$possibleActions = [];
@@ -54,9 +68,21 @@ class Rule extends Twig_Extension
unset($key, $ruleActions);
return $possibleActions;
- });
+ }
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function getFunctions()
+ {
+ return [
+ $this->allJournalTriggers(),
+ $this->allRuleTriggers(),
+ $this->allActionTriggers(),
+ ];
- return $functions;
}
/**
diff --git a/app/User.php b/app/User.php
index 1fb85eb23f..b274e6d9dc 100755
--- a/app/User.php
+++ b/app/User.php
@@ -9,24 +9,24 @@ use Zizaco\Entrust\Traits\EntrustUserTrait;
* Class User
*
* @package FireflyIII
- * @property integer $id
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- * @property string $email
- * @property string $password
- * @property string $remember_token
- * @property string $reset
- * @property boolean $blocked
- * @property string $blocked_code
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences
+ * @property integer $id
+ * @property \Carbon\Carbon $created_at
+ * @property \Carbon\Carbon $updated_at
+ * @property string $email
+ * @property string $password
+ * @property string $remember_token
+ * @property string $reset
+ * @property boolean $blocked
+ * @property string $blocked_code
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals
- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Role[] $roles
+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Role[] $roles
*/
class User extends Authenticatable
{
@@ -71,30 +71,6 @@ class User extends Authenticatable
return $this->hasMany('FireflyIII\Models\Attachment');
}
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasMany
- */
- public function tags()
- {
- return $this->hasMany('FireflyIII\Models\Tag');
- }
-
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasMany
- */
- public function rules()
- {
- return $this->hasMany('FireflyIII\Models\Rule');
- }
-
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasMany
- */
- public function ruleGroups()
- {
- return $this->hasMany('FireflyIII\Models\RuleGroup');
- }
-
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
@@ -127,14 +103,6 @@ class User extends Authenticatable
return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'FireflyIII\Models\Account');
}
- /**
- * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
- */
- public function transactions()
- {
- return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal');
- }
-
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
@@ -143,6 +111,30 @@ class User extends Authenticatable
return $this->hasMany('FireflyIII\Models\Preference');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
+ public function ruleGroups()
+ {
+ return $this->hasMany('FireflyIII\Models\RuleGroup');
+ }
+
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
+ public function rules()
+ {
+ return $this->hasMany('FireflyIII\Models\Rule');
+ }
+
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
+ public function tags()
+ {
+ return $this->hasMany('FireflyIII\Models\Tag');
+ }
+
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
@@ -151,4 +143,12 @@ class User extends Authenticatable
return $this->hasMany('FireflyIII\Models\TransactionJournal');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
+ */
+ public function transactions()
+ {
+ return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal');
+ }
+
}
diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php
index 6ca1067c65..d386645292 100644
--- a/app/Validation/FireflyValidator.php
+++ b/app/Validation/FireflyValidator.php
@@ -32,6 +32,8 @@ class FireflyValidator extends Validator
* @param array $rules
* @param array $messages
* @param array $customAttributes
+ *
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList) // inherited from Laravel.
*/
public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [])
{
@@ -40,12 +42,10 @@ class FireflyValidator extends Validator
/**
* @param $attribute
- * @param $value
- * @param $parameters
*
* @return bool
*/
- public function validateRuleTriggerValue($attribute, $value, $parameters)
+ public function validateRuleTriggerValue($attribute)
{
// get the index from a string like "rule-trigger-value.2".
$parts = explode('.', $attribute);
@@ -54,8 +54,8 @@ class FireflyValidator extends Validator
// loop all rule-triggers.
// check if rule-value matches the thing.
if (is_array($this->data['rule-trigger'])) {
- $name = isset($this->data['rule-trigger'][$index]) ? $this->data['rule-trigger'][$index] : 'invalid';
- $value = isset($this->data['rule-trigger-value'][$index]) ? $this->data['rule-trigger-value'][$index] : false;
+ $name = $this->getRuleTriggerName($index);
+ $value = $this->getRuleTriggerValue($index);
switch ($name) {
default:
return true;
@@ -76,12 +76,10 @@ class FireflyValidator extends Validator
/**
* @param $attribute
- * @param $value
- * @param $parameters
*
* @return bool
*/
- public function validateRuleActionValue($attribute, $value, $parameters)
+ public function validateRuleActionValue($attribute)
{
// get the index from a string like "rule-action-value.2".
$parts = explode('.', $attribute);
@@ -383,17 +381,16 @@ class FireflyValidator extends Validator
* @param $value
* @param $parameters
*
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter) // cant remove it
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity) // its as simple as I can get it.
*
* @return bool
*/
public function validateUniquePiggyBankForUser($attribute, $value, $parameters)
{
$exclude = isset($parameters[0]) ? $parameters[0] : null;
- $query = DB::table('piggy_banks');
- $query->whereNull('piggy_banks.deleted_at');
- $query->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id');
- $query->where('accounts.user_id', Auth::user()->id);
+ $query = DB::table('piggy_banks')->whereNull('piggy_banks.deleted_at')
+ ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->where('accounts.user_id', Auth::user()->id);
if (!is_null($exclude)) {
$query->where('piggy_banks.id', '!=', $exclude);
}
@@ -408,7 +405,27 @@ class FireflyValidator extends Validator
}
return true;
+ }
+ /**
+ * @param int $index
+ *
+ * @return string
+ */
+ private function getRuleTriggerName($index)
+ {
+ return isset($this->data['rule-trigger'][$index]) ? $this->data['rule-trigger'][$index] : 'invalid';
+
+ }
+
+ /**
+ * @param int $index
+ *
+ * @return string
+ */
+ private function getRuleTriggerValue($index)
+ {
+ return isset($this->data['rule-trigger-value'][$index]) ? $this->data['rule-trigger-value'][$index] : '';
}
}
diff --git a/composer.json b/composer.json
index 44c5ab0766..7dbfee8eb0 100755
--- a/composer.json
+++ b/composer.json
@@ -55,13 +55,15 @@
],
"post-install-cmd": [
"php artisan clear-compiled",
- "php artisan optimize"
+ "php artisan optimize",
+ "php artisan firefly:upgrade-instructions"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
- "php artisan optimize"
+ "php artisan optimize",
+ "php artisan firefly:upgrade-instructions"
]
},
"config": {
diff --git a/composer.lock b/composer.lock
index ac61669c9c..91b23f2f19 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "847987de4271f2467a4a5fc50bc04cc9",
+ "hash": "df00127da416acad2a36b6128b82fdd9",
"content-hash": "28b178f07a713b4db441e7e1f380916e",
"packages": [
{
@@ -759,16 +759,16 @@
},
{
"name": "laravel/framework",
- "version": "v5.2.8",
+ "version": "v5.2.10",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "867914788c2ec942967c3608ed54626228a5f916"
+ "reference": "93dc5b0089eef468157fd7200e575c3861ec59a5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/867914788c2ec942967c3608ed54626228a5f916",
- "reference": "867914788c2ec942967c3608ed54626228a5f916",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/93dc5b0089eef468157fd7200e575c3861ec59a5",
+ "reference": "93dc5b0089eef468157fd7200e575c3861ec59a5",
"shasum": ""
},
"require": {
@@ -883,20 +883,20 @@
"framework",
"laravel"
],
- "time": "2016-01-12 22:45:00"
+ "time": "2016-01-13 20:29:10"
},
{
"name": "laravelcollective/html",
- "version": "v5.2",
+ "version": "v5.2.2",
"source": {
"type": "git",
"url": "https://github.com/LaravelCollective/html.git",
- "reference": "5a8f1380a0d5ef21cdef37e775d86566307f8358"
+ "reference": "c88b2d59a56ed2290fc5082a1a6099e357c9fdbc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/LaravelCollective/html/zipball/5a8f1380a0d5ef21cdef37e775d86566307f8358",
- "reference": "5a8f1380a0d5ef21cdef37e775d86566307f8358",
+ "url": "https://api.github.com/repos/LaravelCollective/html/zipball/c88b2d59a56ed2290fc5082a1a6099e357c9fdbc",
+ "reference": "c88b2d59a56ed2290fc5082a1a6099e357c9fdbc",
"shasum": ""
},
"require": {
@@ -937,20 +937,20 @@
],
"description": "HTML and Form Builders for the Laravel Framework",
"homepage": "http://laravelcollective.com",
- "time": "2015-12-23 07:46:46"
+ "time": "2016-01-16 16:54:49"
},
{
"name": "league/commonmark",
- "version": "0.12.0",
+ "version": "0.13.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
- "reference": "3eb64850ee688623db494398a5284a7a4cdf7b47"
+ "reference": "a4e93bc4fd1a8ff8f534040c4a07371ea5f4b484"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/3eb64850ee688623db494398a5284a7a4cdf7b47",
- "reference": "3eb64850ee688623db494398a5284a7a4cdf7b47",
+ "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/a4e93bc4fd1a8ff8f534040c4a07371ea5f4b484",
+ "reference": "a4e93bc4fd1a8ff8f534040c4a07371ea5f4b484",
"shasum": ""
},
"require": {
@@ -962,21 +962,23 @@
},
"require-dev": {
"erusev/parsedown": "~1.0",
- "jgm/commonmark": "0.22",
- "jgm/smartpunct": "0.22",
+ "jgm/commonmark": "0.24",
"michelf/php-markdown": "~1.4",
"mikehaertl/php-shellcommand": "~1.1.0",
"phpunit/phpunit": "~4.3|~5.0",
"scrutinizer/ocular": "^1.1",
"symfony/finder": "~2.3"
},
+ "suggest": {
+ "league/commonmark-extras": "Library of useful extensions including smart punctuation"
+ },
"bin": [
"bin/commonmark"
],
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "0.13-dev"
+ "dev-master": "0.14-dev"
}
},
"autoload": {
@@ -1003,7 +1005,7 @@
"markdown",
"parser"
],
- "time": "2015-11-04 14:24:41"
+ "time": "2016-01-14 04:29:54"
},
{
"name": "league/csv",
@@ -3897,16 +3899,16 @@
},
{
"name": "symfony/class-loader",
- "version": "v2.8.1",
+ "version": "v2.8.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/class-loader.git",
- "reference": "ec74b0a279cf3a9bd36172b3e3061591d380ce6c"
+ "reference": "98e9089a428ed0e39423b67352c57ef5910a3269"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/class-loader/zipball/ec74b0a279cf3a9bd36172b3e3061591d380ce6c",
- "reference": "ec74b0a279cf3a9bd36172b3e3061591d380ce6c",
+ "url": "https://api.github.com/repos/symfony/class-loader/zipball/98e9089a428ed0e39423b67352c57ef5910a3269",
+ "reference": "98e9089a428ed0e39423b67352c57ef5910a3269",
"shasum": ""
},
"require": {
@@ -3945,7 +3947,7 @@
],
"description": "Symfony ClassLoader Component",
"homepage": "https://symfony.com",
- "time": "2015-12-05 17:37:59"
+ "time": "2016-01-03 15:33:41"
},
{
"name": "symfony/css-selector",
diff --git a/config/database.php b/config/database.php
index 5865a2f758..9467c969e6 100755
--- a/config/database.php
+++ b/config/database.php
@@ -48,7 +48,7 @@ return [
'sqlite' => [
'driver' => 'sqlite',
- 'database' => storage_path('database.sqlite'),
+ 'database' => storage_path('database') . '/testing.db',
'prefix' => '',
],
diff --git a/config/firefly.php b/config/firefly.php
index 952f9463e6..f37b62ce98 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -2,7 +2,7 @@
return [
'chart' => 'chartjs',
- 'version' => '3.6.1',
+ 'version' => '3.7.0',
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
'csv_import_enabled' => true,
diff --git a/config/upgrade.php b/config/upgrade.php
new file mode 100644
index 0000000000..be8b331d37
--- /dev/null
+++ b/config/upgrade.php
@@ -0,0 +1,15 @@
+ [
+ '3.7.0' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' .
+ 'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0'],
+];
\ No newline at end of file
diff --git a/cover.sh b/cover.sh
new file mode 100755
index 0000000000..4311932be6
--- /dev/null
+++ b/cover.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# set testing environment
+cp .env.testing .env
+
+# set cover:
+cp phpunit.cover.xml phpunit.xml
+
+# test!
+if [ -z "$1" ]
+then
+ phpdbg -qrr /usr/local/bin/phpunit
+fi
+
+# directories to look in:
+#dirs=("controllers" "database" "factories" "generators" "helpers" "models" "middleware" "repositories" "support")
+#
+#if [ ! -z "$1" ]
+#then
+# for i in "${dirs[@]}"
+# do
+# firstFile="./tests/$i/$1.php"
+# secondFile="./tests/$i/$1Test.php"
+# if [ -f "$firstFile" ]
+# then
+# # run it!
+# phpunit --verbose $firstFile
+# exit $?
+# fi
+# if [ -f "$secondFile" ]
+# then
+# # run it!
+# phpunit --verbose $secondFile
+# exit $?
+# fi
+#
+#
+# done
+#
+#fi
+
+# restore .env file
+cp .env.local .env
+
+# restore cover
+cp phpunit.default.xml phpunit.xml
\ No newline at end of file
diff --git a/database/migrations/2014_12_13_190730_changes_for_v321.php b/database/migrations/2014_12_13_190730_changes_for_v321.php
index a893f8c0a7..a10d7785ae 100644
--- a/database/migrations/2014_12_13_190730_changes_for_v321.php
+++ b/database/migrations/2014_12_13_190730_changes_for_v321.php
@@ -10,7 +10,8 @@ use Illuminate\Support\Facades\Schema;
/**
* @SuppressWarnings(PHPMD.ShortMethodName) // method names are mandated by laravel.
- * @SuppressWarnings("TooManyMethods") // I'm fine with this
+ * @SuppressWarnings(PHPMD.TooManyMethods)
+ *
*
* Down:
* 1. Create new Components based on Budgets.
diff --git a/database/migrations/2015_04_26_054507_changes_for_v3310.php b/database/migrations/2015_04_26_054507_changes_for_v3310.php
index 3598736a21..7073e1b6b1 100644
--- a/database/migrations/2015_04_26_054507_changes_for_v3310.php
+++ b/database/migrations/2015_04_26_054507_changes_for_v3310.php
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
- * @SuppressWarnings("PHPMD.ExcessiveMethodLength")
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* Class ChangesForV3310
*/
diff --git a/database/migrations/2015_05_28_041652_entrust_setup_tables.php b/database/migrations/2015_05_28_041652_entrust_setup_tables.php
index 270f46a768..f18279e3a5 100644
--- a/database/migrations/2015_05_28_041652_entrust_setup_tables.php
+++ b/database/migrations/2015_05_28_041652_entrust_setup_tables.php
@@ -4,6 +4,9 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class EntrustSetupTables
+ *
+ * @SuppressWarnings(PHPMD.ShortMethodName)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
class EntrustSetupTables extends Migration
{
diff --git a/database/migrations/2015_06_14_093841_changes_for_v345.php b/database/migrations/2015_06_14_093841_changes_for_v345.php
index 43a1df7223..752a0a54f9 100644
--- a/database/migrations/2015_06_14_093841_changes_for_v345.php
+++ b/database/migrations/2015_06_14_093841_changes_for_v345.php
@@ -5,6 +5,9 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV345
+ *
+ * @SuppressWarnings(PHPMD.ShortMethodName)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
class ChangesForV345 extends Migration
{
diff --git a/database/migrations/2015_07_03_102450_changes_for_v3462.php b/database/migrations/2015_07_03_102450_changes_for_v3462.php
index 930c8b0bab..d18d7c232c 100644
--- a/database/migrations/2015_07_03_102450_changes_for_v3462.php
+++ b/database/migrations/2015_07_03_102450_changes_for_v3462.php
@@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV3462
+ *
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
class ChangesForV3462 extends Migration
{
diff --git a/database/migrations/2015_07_14_204645_changes_for_v349.php b/database/migrations/2015_07_14_204645_changes_for_v349.php
index 3f2538c339..48147e6448 100644
--- a/database/migrations/2015_07_14_204645_changes_for_v349.php
+++ b/database/migrations/2015_07_14_204645_changes_for_v349.php
@@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV349
+ *
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
class ChangesForV349 extends Migration
{
diff --git a/database/migrations/2015_07_17_190438_changes_for_v3410.php b/database/migrations/2015_07_17_190438_changes_for_v3410.php
index c8e64213d9..feebb8396b 100644
--- a/database/migrations/2015_07_17_190438_changes_for_v3410.php
+++ b/database/migrations/2015_07_17_190438_changes_for_v3410.php
@@ -5,6 +5,8 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV3410
+ *
+ * @SuppressWarnings(PHPMD.ShortMethodName)
*/
class ChangesForV3410 extends Migration
{
diff --git a/database/migrations/2016_01_11_193428_changes_for_v370.php b/database/migrations/2016_01_11_193428_changes_for_v370.php
index 6eed8b823b..87134f0581 100644
--- a/database/migrations/2016_01_11_193428_changes_for_v370.php
+++ b/database/migrations/2016_01_11_193428_changes_for_v370.php
@@ -12,6 +12,9 @@ use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV370
+ *
+ * @SuppressWarnings(PHPMD.ShortMethodName)
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
class ChangesForV370 extends Migration
{
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php
index 9adb4e5c34..69a846e857 100644
--- a/database/seeds/DatabaseSeeder.php
+++ b/database/seeds/DatabaseSeeder.php
@@ -22,9 +22,15 @@ class DatabaseSeeder extends Seeder
$this->call('TransactionTypeSeeder');
$this->call('PermissionSeeder');
- if (App::environment() == 'testing' || App::environment() == 'homestead' || gethostname() == 'lightning') {
+ // set up basic test data (as little as possible):
+ if (App::environment() == 'testing') {
$this->call('TestDataSeeder');
}
+
+ // this one is reserved for more extensive testing.
+ if (App::environment() == 'local') {
+ $this->call('VisualTestDataSeeder');
+ }
}
}
diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php
index 49550f1b0a..67e4ad7d2d 100644
--- a/database/seeds/TestDataSeeder.php
+++ b/database/seeds/TestDataSeeder.php
@@ -1,583 +1,50 @@
user()->associate($this->user);
- $ruleGroup->order = 1;
- $ruleGroup->active = 1;
- $ruleGroup->title = 'Default rules';
- $ruleGroup->description = 'All your rules not in a particular group.';
- $ruleGroup->save();
- unset($ruleGroup);
-
- $ruleGroup = new RuleGroup;
- $ruleGroup->user()->associate($this->user);
- $ruleGroup->order = 2;
- $ruleGroup->active = 1;
- $ruleGroup->title = 'Empty rule group';
- $ruleGroup->description = 'Intentionally has no rules.';
- $ruleGroup->save();
- unset($ruleGroup);
-
-
- $ruleGroup = new RuleGroup;
- $ruleGroup->user()->associate($this->user);
- $ruleGroup->order = 3;
- $ruleGroup->active = 1;
- $ruleGroup->title = 'Rules for bills';
- $ruleGroup->description = 'All rules for bills and recurring costs.';
- $ruleGroup->save();
- unset($ruleGroup);
-
- // move groceries to correct budget/category
- $rule = new Rule;
- $rule->user()->associate($this->user);
- $rule->ruleGroup()->associate(RuleGroup::find(1));
- $rule->order = 1;
- $rule->active = 1;
- $rule->stop_processing = 0;
- $rule->title = 'Move groceries';
- $rule->description = 'Move groceries to correct category and budget.';
-
- $rule->save();
-
- // initial trigger for this rule:
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 1;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'user_action';
- $ruleTrigger->trigger_value = 'store-journal';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // content trigger for this rule.
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 2;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'description_contains';
- $ruleTrigger->trigger_value = 'groceries';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // another
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 3;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'from_account_is';
- $ruleTrigger->trigger_value = 'MyBank Checking Account';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // actions for this rule. one, set category
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 1;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_category';
- $ruleAction->action_value = 'Groceries';
- $ruleAction->save();
- unset($ruleAction);
-
- // actions for this rule. one, set budget
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 2;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_budget';
- $ruleAction->action_value = 'Groceries';
- $ruleAction->save();
- unset($ruleAction);
-
-
- // move "gas" to "Car" and "Car"
- $rule = new Rule;
- $rule->user()->associate($this->user);
- $rule->ruleGroup()->associate(RuleGroup::find(1));
- $rule->order = 2;
- $rule->active = 1;
- $rule->stop_processing = 0;
- $rule->title = 'Move gas';
- $rule->description = null;
-
- $rule->save();
-
- // initial trigger for this rule:
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 1;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'user_action';
- $ruleTrigger->trigger_value = 'store-journal';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // content trigger for this rule.
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 2;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'description_contains';
- $ruleTrigger->trigger_value = 'gas';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // another
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 3;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'from_account_is';
- $ruleTrigger->trigger_value = 'MyBank Checking Account';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // actions for this rule. one, set category
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 1;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_category';
- $ruleAction->action_value = 'Car';
- $ruleAction->save();
- unset($ruleAction);
-
- // actions for this rule. one, set budget
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 2;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_budget';
- $ruleAction->action_value = 'Car';
- $ruleAction->save();
- unset($ruleAction);
-
- // move savings to money management
- $rule = new Rule;
- $rule->user()->associate($this->user);
- $rule->ruleGroup()->associate(RuleGroup::find(1));
- $rule->order = 3;
- $rule->active = 1;
- $rule->stop_processing = 0;
- $rule->title = 'Move savings';
- $rule->description = null;
-
- $rule->save();
-
- // initial trigger for this rule:
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 1;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'user_action';
- $ruleTrigger->trigger_value = 'store-journal';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // is transfer
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 2;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'transaction_type';
- $ruleTrigger->trigger_value = 'Transfer';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // content trigger for this rule.
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 3;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'description_is';
- $ruleTrigger->trigger_value = 'Save money';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // another
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 4;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'from_account_is';
- $ruleTrigger->trigger_value = 'MyBank Checking Account';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // another
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 5;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'to_account_is';
- $ruleTrigger->trigger_value = 'Savings';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // actions for this rule. one, set category
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 1;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_category';
- $ruleAction->action_value = 'Money Management';
- $ruleAction->save();
- unset($ruleAction);
-
- // move TV bill to "Bills" and "House"
- $rule = new Rule;
- $rule->user()->associate($this->user);
- $rule->ruleGroup()->associate(RuleGroup::find(3));
- $rule->order = 1;
- $rule->active = 1;
- $rule->stop_processing = 0;
- $rule->title = 'TV Bill';
- $rule->description = null;
-
- $rule->save();
-
- // initial trigger for this rule:
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 1;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'user_action';
- $ruleTrigger->trigger_value = 'store-journal';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // content trigger for this rule.
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 2;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'description_contains';
- $ruleTrigger->trigger_value = 'tv bill';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // another
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 3;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'from_account_is';
- $ruleTrigger->trigger_value = 'MyBank Checking Account';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // actions for this rule. one, set category
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 1;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_category';
- $ruleAction->action_value = 'House';
- $ruleAction->save();
- unset($ruleAction);
-
- // actions for this rule. one, set budget
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 2;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_budget';
- $ruleAction->action_value = 'Bills';
- $ruleAction->save();
- unset($ruleAction);
-
- // move rent to bills, rent.
- $rule = new Rule;
- $rule->user()->associate($this->user);
- $rule->ruleGroup()->associate(RuleGroup::find(3));
- $rule->order = 2;
- $rule->active = 1;
- $rule->stop_processing = 1;
- $rule->title = 'Rent';
- $rule->description = 'Do something with rent.';
-
- $rule->save();
-
- // initial trigger for this rule:
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 1;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'user_action';
- $ruleTrigger->trigger_value = 'update-journal';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // content trigger for this rule.
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 2;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 0;
- $ruleTrigger->trigger_type = 'description_contains';
- $ruleTrigger->trigger_value = 'rent';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // another
- $ruleTrigger = new RuleTrigger;
- $ruleTrigger->rule()->associate($rule);
- $ruleTrigger->order = 3;
- $ruleTrigger->active = 1;
- $ruleTrigger->stop_processing = 1;
- $ruleTrigger->trigger_type = 'from_account_is';
- $ruleTrigger->trigger_value = 'MyBank Checking Account';
-
- $ruleTrigger->save();
- unset($ruleTrigger);
-
- // actions for this rule. one, set category
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 1;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 0;
- $ruleAction->action_type = 'set_category';
- $ruleAction->action_value = 'House';
- $ruleAction->save();
- unset($ruleAction);
-
- // actions for this rule. one, set budget
- $ruleAction = new RuleAction;
- $ruleAction->rule()->associate($rule);
- $ruleAction->order = 2;
- $ruleAction->active = 1;
- $ruleAction->stop_processing = 1;
- $ruleAction->action_type = 'set_budget';
- $ruleAction->action_value = 'Bills';
- $ruleAction->save();
- unset($ruleAction);
-
-
- // a normal rule: saves transactions where description contains "groceries"
- // and from account is "MyBank Checking Account"
- // send it to Groceries/Groceries
-
-
- //$ruleAction
-
- // TODO a rule that triggers on something, just like the previous one, but it has "stop_processing" set to 1.
- // TODO a rule that triggers on that same thing, but it will not file, because the previous rule made FF skip it.
-
- // TODO rule with specific actions.
- // TODO rule with actions and one action has stop_processing and other actions are not processed. Somewhere in test?
-
-
- }
-
/**
+ * Run the database seeds.
*
+ * @return void
*/
public function run()
{
- $this->createUsers();
-
- // create accounts:
- $this->createAssetAccounts();
- $this->createExpenseAccounts();
- $this->createRevenueAccounts();
- $this->createBills();
- $this->createPiggybanks();
-
- $this->createRules();
-
- // preference to only see account #1 on frontpage.
- $this->createPreferences();
-
- // dates:
- $start = Carbon::now()->subYears(2)->startOfMonth();
- $end = Carbon::now()->endOfDay();
-
-
- $current = clone $start;
- while ($current < $end) {
- $month = $current->format('F Y');
- // create salaries:
- $this->createIncome('Salary ' . $month, $current, rand(2000, 2100));
-
- // pay bills:
- $this->createRent('Rent for ' . $month, $current, 800);
- $this->createWater('Water bill for ' . $month, $current, 15);
- $this->createTV('TV bill for ' . $month, $current, 60);
- $this->createPower('Power bill for ' . $month, $current, 120);
-
-
- // pay daily groceries:
- $this->createGroceries($current);
-
- // create tag (each type of tag, for date):
- $this->createTags($current);
-
- // go out for drinks:
- $this->createDrinksAndOthers($current);
-
- // save money every month:
- $this->createSavings($current);
-
- // buy gas for the car every month:
- $this->createCar($current);
-
- // budget limit for this month, on "Groceries".
- $this->createBudgetLimit($current, 'Groceries', 400);
- $this->createBudgetLimit($current, 'Bills', 1000);
- $this->createBudgetLimit($current, 'Car', 100);
-
- echo 'Created test data for ' . $month . "\n";
- $current->addMonth();
- }
+ $user = User::create(['email' => 'thegrumpydictator@gmail.com', 'password' => bcrypt('james'), 'reset' => null, 'remember_token' => null]);
+ $emptyUser = User::create(['email' => 'thegrumpydictator+empty@gmail.com', 'password' => bcrypt('james'), 'reset' => null, 'remember_token' => null]);
+ // create asset accounts for user #1.
+ $this->createAssetAccounts($user);
}
/**
- * @param Carbon $date
+ * @param User $user
*/
- protected function createTags(Carbon $date)
+ private function createAssetAccounts(User $user)
{
- Tag::create(
- [
- 'user_id' => $this->user->id,
- 'tag' => 'SomeTag' . $date->month . '.' . $date->year . '.nothing',
- 'tagMode' => 'nothing',
- 'date' => $date->format('Y-m-d'),
-
-
- ]
- );
- }
-
- /**
- *
- */
- protected function createUsers()
- {
- User::create(['email' => 'thegrumpydictator@gmail.com', 'password' => bcrypt('james'), 'reset' => null, 'remember_token' => null]);
- $this->user = User::whereEmail('thegrumpydictator@gmail.com')->first();
-
- // create rights:
- $role = Role::find(1);
- $this->user->roles()->save($role);
-
- }
-
- protected function createAssetAccounts()
- {
- $assets = ['MyBank Checking Account', 'Savings', 'Shared', 'Creditcard', 'Emergencies', 'STE'];
+ $assets = ['TestData Checking Account', 'TestData Savings', 'TestData Shared', 'TestData Creditcard', 'Emergencies', 'STE'];
$ibans = ['NL47JDYU6179706202', 'NL51WGBP5832453599', 'NL81RCQZ7160379858', 'NL19NRAP2367994221', 'NL40UKBK3619908726', 'NL38SRMN4325934708'];
$assetMeta = [
- [
- 'accountRole' => 'defaultAsset',
- ],
- [
- 'accountRole' => 'savingAsset',
- ],
- [
- 'accountRole' => 'sharedAsset',
- ],
- [
- 'accountRole' => 'ccAsset',
- 'ccMonthlyPaymentDate' => '2015-05-27',
- 'ccType' => 'monthlyFull',
- ],
- [
- 'accountRole' => 'savingAsset',
- ],
- [
- 'accountRole' => 'savingAsset',
- ],
-
+ ['accountRole' => 'defaultAsset'],
+ ['accountRole' => 'savingAsset',],
+ ['accountRole' => 'sharedAsset',],
+ ['accountRole' => 'ccAsset', 'ccMonthlyPaymentDate' => '2015-05-27', 'ccType' => 'monthlyFull',],
+ ['accountRole' => 'savingAsset',],
+ ['accountRole' => 'savingAsset',],
];
foreach ($assets as $index => $name) {
// create account:
$account = Account::create(
[
- 'user_id' => $this->user->id,
+ 'user_id' => $user->id,
'account_type_id' => 3,
'name' => $name,
'active' => 1,
@@ -589,831 +56,6 @@ class TestDataSeeder extends Seeder
AccountMeta::create(['account_id' => $account->id, 'name' => $name, 'data' => $value,]);
}
}
- }
-
- protected function createExpenseAccounts()
- {
- $expenses = ['Adobe', 'Google', 'Vitens', 'Albert Heijn', 'PLUS', 'Apple', 'Bakker', 'Belastingdienst', 'bol.com', 'Cafe Central', 'conrad.nl',
- 'coolblue', 'Shell',
- 'DUO', 'Etos', 'FEBO', 'Greenchoice', 'Halfords', 'XS4All', 'iCentre', 'Jumper', 'Land lord'];
- foreach ($expenses as $name) {
- // create account:
- Account::create(
- [
- 'user_id' => $this->user->id,
- 'account_type_id' => 4,
- 'name' => $name,
- 'active' => 1,
- 'encrypted' => 1,
- ]
- );
- }
}
-
- /**
- *
- */
- protected function createRevenueAccounts()
- {
- $revenues = ['Job', 'Belastingdienst', 'Bank', 'KPN', 'Google'];
- foreach ($revenues as $name) {
- // create account:
- Account::create(
- [
- 'user_id' => $this->user->id,
- 'account_type_id' => 5,
- 'name' => $name,
- 'active' => 1,
- 'encrypted' => 1,
- ]
- );
- }
- }
-
- public function createBills()
- {
- Bill::create(
- [
- 'name' => 'Rent',
- 'match' => 'rent,land,lord',
- 'amount_min' => 795,
- 'amount_max' => 805,
- 'user_id' => $this->user->id,
- 'date' => '2015-01-01',
- 'active' => 1,
- 'automatch' => 1,
- 'repeat_freq' => 'monthly',
- 'skip' => 0,
- ]
- );
- Bill::create(
- [
- 'name' => 'Health insurance',
- 'match' => 'zilveren,kruis,health',
- 'amount_min' => 120,
- 'amount_max' => 140,
- 'user_id' => $this->user->id,
- 'date' => '2015-01-01',
- 'active' => 1,
- 'automatch' => 1,
- 'repeat_freq' => 'monthly',
- 'skip' => 0,
- ]
- );
- }
-
- protected function createPiggybanks()
- {
- $account = $this->findAccount('Savings');
-
- $camera = PiggyBank::create(
- [
- 'account_id' => $account->id,
- 'name' => 'New camera',
- 'targetamount' => 1000,
- 'startdate' => '2015-04-01',
- 'reminder_skip' => 0,
- 'remind_me' => 0,
- 'order' => 1,
- ]
- );
- $repetition = $camera->piggyBankRepetitions()->first();
- $repetition->currentamount = 735;
- $repetition->save();
-
- // events:
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $camera->id,
- 'date' => '2015-05-01',
- 'amount' => '245',
- ]
- );
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $camera->id,
- 'date' => '2015-06-01',
- 'amount' => '245',
- ]
- );
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $camera->id,
- 'date' => '2015-07-01',
- 'amount' => '245',
- ]
- );
-
-
- $phone = PiggyBank::create(
- [
- 'account_id' => $account->id,
- 'name' => 'New phone',
- 'targetamount' => 600,
- 'startdate' => '2015-04-01',
- 'reminder_skip' => 0,
- 'remind_me' => 0,
- 'order' => 2,
- ]
- );
- $repetition = $phone->piggyBankRepetitions()->first();
- $repetition->currentamount = 333;
- $repetition->save();
-
- // events:
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $phone->id,
- 'date' => '2015-05-01',
- 'amount' => '111',
- ]
- );
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $phone->id,
- 'date' => '2015-06-01',
- 'amount' => '111',
- ]
- );
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $phone->id,
- 'date' => '2015-07-01',
- 'amount' => '111',
- ]
- );
-
- $couch = PiggyBank::create(
- [
- 'account_id' => $account->id,
- 'name' => 'New couch',
- 'targetamount' => 500,
- 'startdate' => '2015-04-01',
- 'reminder_skip' => 0,
- 'remind_me' => 0,
- 'order' => 3,
- ]
- );
- $repetition = $couch->piggyBankRepetitions()->first();
- $repetition->currentamount = 120;
- $repetition->save();
-
- // events:
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $couch->id,
- 'date' => '2015-05-01',
- 'amount' => '40',
- ]
- );
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $couch->id,
- 'date' => '2015-06-01',
- 'amount' => '40',
- ]
- );
- PiggyBankEvent::create(
- [
- 'piggy_bank_id' => $couch->id,
- 'date' => '2015-07-01',
- 'amount' => '40',
- ]
- );
-
- // empty one.
- PiggyBank::create(
- [
- 'account_id' => $account->id,
- 'name' => 'New head set',
- 'targetamount' => 500,
- 'startdate' => '2015-04-01',
- 'reminder_skip' => 0,
- 'remind_me' => 0,
- 'order' => 4,
- ]
- );
-
- }
-
- /**
- * @param $name
- *
- * @return Account|null
- */
- protected function findAccount($name)
- {
- /** @var Account $account */
- foreach (Account::get() as $account) {
- if ($account->name == $name && $this->user->id == $account->user_id) {
- return $account;
- break;
- }
- }
-
- return null;
- }
-
- /**
- * @param $description
- * @param Carbon $date
- * @param $amount
- *
- * @return TransactionJournal
- */
- protected function createIncome($description, Carbon $date, $amount)
- {
- $date = new Carbon($date->format('Y-m') . '-23'); // paid on 23rd.
- $today = new Carbon;
- if ($date >= $today) {
- return null;
- }
- $toAccount = $this->findAccount('MyBank Checking Account');
- $fromAccount = $this->findAccount('Job');
- $category = Category::firstOrCreateEncrypted(['name' => 'Salary', 'user_id' => $this->user->id]);
- // create journal:
-
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 2,
- 'transaction_currency_id' => 1,
- 'description' => $description,
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
-
- return $journal;
-
- }
-
- /**
- * @param $description
- * @param Carbon $date
- * @param $amount
- *
- * @return TransactionJournal
- */
- protected function createRent($description, Carbon $date, $amount)
- {
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $toAccount = $this->findAccount('Land lord');
- $category = Category::firstOrCreateEncrypted(['name' => 'Rent', 'user_id' => $this->user->id]);
- $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'bill_id' => 1,
- 'description' => $description,
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
- $journal->budgets()->save($budget);
-
- return $journal;
-
- }
-
- /**
- * @param $description
- * @param Carbon $date
- * @param $amount
- *
- * @return TransactionJournal
- */
- protected function createWater($description, Carbon $date, $amount)
- {
- $date = new Carbon($date->format('Y-m') . '-10'); // paid on 10th
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $toAccount = $this->findAccount('Vitens');
- $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]);
- $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'description' => $description,
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
- $journal->budgets()->save($budget);
-
- return $journal;
-
- }
-
- /**
- * @param $description
- * @param Carbon $date
- * @param $amount
- *
- * @return TransactionJournal
- */
- protected function createTV($description, Carbon $date, $amount)
- {
- $date = new Carbon($date->format('Y-m') . '-15'); // paid on 10th
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $toAccount = $this->findAccount('XS4All');
- $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]);
- $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'description' => $description,
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
- $journal->budgets()->save($budget);
-
- return $journal;
-
- }
-
- /**
- * @param $description
- * @param Carbon $date
- * @param $amount
- *
- * @return TransactionJournal
- */
- protected function createPower($description, Carbon $date, $amount)
- {
- $date = new Carbon($date->format('Y-m') . '-06'); // paid on 10th
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $toAccount = $this->findAccount('Greenchoice');
- $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]);
- $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'description' => $description,
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
- $journal->budgets()->save($budget);
-
- return $journal;
-
- }
-
- /**
- * @param Carbon $date
- */
- protected function createGroceries(Carbon $date)
- {
- $start = clone $date;
- $end = clone $date;
- $today = new Carbon;
- $start->startOfMonth();
- $end->endOfMonth();
-
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $stores = ['Albert Heijn', 'PLUS', 'Bakker'];
- $descriptions = ['Groceries', 'Bought some groceries', 'Got groceries'];
- $category = Category::firstOrCreateEncrypted(['name' => 'Daily groceries', 'user_id' => $this->user->id]);
- $budget = Budget::firstOrCreateEncrypted(['name' => 'Groceries', 'user_id' => $this->user->id]);
-
- $current = clone $start;
- while ($current < $end && $current < $today) {
- // daily groceries:
- $amount = rand(1500, 2500) / 100;
- $toAccount = $this->findAccount($stores[rand(0, count($stores) - 1)]);
-
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'description' => $descriptions[rand(0, count($descriptions) - 1)],
- 'completed' => 1,
- 'date' => $current,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
- $journal->budgets()->save($budget);
-
-
- $current->addDay();
- }
- }
-
- /**
- * @param Carbon $date
- */
- protected function createDrinksAndOthers(Carbon $date)
- {
- $start = clone $date;
- $end = clone $date;
- $today = new Carbon;
- $start->startOfMonth();
- $end->endOfMonth();
- $current = clone $start;
- while ($current < $end && $current < $today) {
-
- // weekly drink:
- $thisDate = clone $current;
- $thisDate->addDay();
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $toAccount = $this->findAccount('Cafe Central');
- $category = Category::firstOrCreateEncrypted(['name' => 'Drinks', 'user_id' => $this->user->id]);
- $budget = Budget::firstOrCreateEncrypted(['name' => 'Going out', 'user_id' => $this->user->id]);
- $amount = rand(1500, 3600) / 100;
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'description' => 'Going out for drinks',
- 'completed' => 1,
- 'date' => $thisDate,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
- $journal->budgets()->save($budget);
-
- // shopping at some (online) shop:
-
-
- $current->addWeek();
- }
- }
-
- /**
- * @param Carbon $date
- *
- * @return TransactionJournal
- */
- protected function createSavings(Carbon $date)
- {
- $date = new Carbon($date->format('Y-m') . '-24'); // paid on 24th.
- $toAccount = $this->findAccount('Savings');
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $category = Category::firstOrCreateEncrypted(['name' => 'Money management', 'user_id' => $this->user->id]);
- // create journal:
-
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 3,
- 'transaction_currency_id' => 1,
- 'description' => 'Save money',
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => -150,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => 150,
-
- ]
- );
- $journal->categories()->save($category);
-
- return $journal;
-
- }
-
- /**
- * @param Carbon $current
- * @param $name
- * @param $amount
- */
- protected function createBudgetLimit(Carbon $current, $name, $amount)
- {
- $start = clone $current;
- $end = clone $current;
- $budget = $this->findBudget($name);
- $start->startOfMonth();
- $end->endOfMonth();
-
- BudgetLimit::create(
- [
- 'budget_id' => $budget->id,
- 'startdate' => $start->format('Y-m-d'),
- 'amount' => $amount,
- 'repeats' => 0,
- 'repeat_freq' => 'monthly',
- ]
- );
- }
-
- /**
- * @param $name
- *
- * @return Budget|null
- */
- protected function findBudget($name)
- {
- /** @var Budget $budget */
- foreach (Budget::get() as $budget) {
- if ($budget->name == $name && $this->user->id == $budget->user_id) {
- return $budget;
- break;
- }
- }
-
- return null;
- }
-
- /**
- * @param $name
- *
- * @return Bill|null
- */
- protected function findBill($name)
- {
- /** @var Bill $bill */
- foreach (Bill::get() as $bill) {
- if ($bill->name == $name && $this->user->id == $bill->user_id) {
- return $bill;
- break;
- }
- }
-
- return null;
- }
-
- /**
- * @param $name
- *
- * @return Category|null
- */
- protected function findCategory($name)
- {
-
- /** @var Category $category */
- foreach (Category::get() as $category) {
- if ($category->name == $name && $this->user->id == $category->user_id) {
- return $category;
- break;
- }
- }
-
- return null;
- }
-
- /**
- * @param $name
- *
- * @return PiggyBank|null
- */
- protected function findPiggyBank($name)
- {
-
- /** @var Budget $budget */
- foreach (PiggyBank::get() as $piggyBank) {
- $account = $piggyBank->account()->first();
- if ($piggyBank->name == $name && $this->user->id == $account->user_id) {
- return $piggyBank;
- break;
- }
- }
-
- return null;
- }
-
- /**
- * @param $tagName
- *
- * @return Tag|null
- * @internal param $tag
- */
- protected function findTag($tagName)
- {
- /** @var Tag $tag */
- foreach (Tag::get() as $tag) {
- if ($tag->tag == $tagName && $this->user->id == $tag->user_id) {
- return $tag;
- break;
- }
- }
-
- return null;
- }
-
- protected function createCar($date)
- {
- // twice:
- $date = new Carbon($date->format('Y-m') . '-10'); // paid on 10th
- $fromAccount = $this->findAccount('MyBank Checking Account');
- $toAccount = $this->findAccount('Shell');
- $category = Category::firstOrCreateEncrypted(['name' => 'Car', 'user_id' => $this->user->id]);
- $budget = Budget::firstOrCreateEncrypted(['name' => 'Car', 'user_id' => $this->user->id]);
- $amount = rand(4000, 5000) / 100;
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'description' => 'Bought gas',
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
- $journal->categories()->save($category);
- $journal->budgets()->save($budget);
-
- // and again!
- $date = new Carbon($date->format('Y-m') . '-20'); // paid on 20th
- $amount = rand(4000, 5000) / 100;
-
-
- $journal = TransactionJournal::create(
- [
- 'user_id' => $this->user->id,
- 'transaction_type_id' => 1,
- 'transaction_currency_id' => 1,
- 'description' => 'Gas for car',
- 'completed' => 1,
- 'date' => $date,
- ]
- );
- Transaction::create(
- [
- 'account_id' => $fromAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount * -1,
-
- ]
- );
- Transaction::create(
- [
- 'account_id' => $toAccount->id,
- 'transaction_journal_id' => $journal->id,
- 'amount' => $amount,
-
- ]
- );
-
- // and again!
-
- return $journal;
- }
-
- protected function createPreferences()
- {
- $preference = new Preference;
- $preference->name = 'frontPageAccounts';
- $preference->data = [1];
- $preference->user()->associate($this->user);
- $preference->save();
- }
-
-
}
diff --git a/database/seeds/VisualTestDataSeeder.php b/database/seeds/VisualTestDataSeeder.php
new file mode 100644
index 0000000000..b099d2db30
--- /dev/null
+++ b/database/seeds/VisualTestDataSeeder.php
@@ -0,0 +1,1424 @@
+user()->associate($this->user);
+ $ruleGroup->order = 1;
+ $ruleGroup->active = 1;
+ $ruleGroup->title = 'Default rules';
+ $ruleGroup->description = 'All your rules not in a particular group.';
+ $ruleGroup->save();
+ unset($ruleGroup);
+
+ $ruleGroup = new RuleGroup;
+ $ruleGroup->user()->associate($this->user);
+ $ruleGroup->order = 2;
+ $ruleGroup->active = 1;
+ $ruleGroup->title = 'Empty rule group';
+ $ruleGroup->description = 'Intentionally has no rules.';
+ $ruleGroup->save();
+ unset($ruleGroup);
+
+
+ $ruleGroup = new RuleGroup;
+ $ruleGroup->user()->associate($this->user);
+ $ruleGroup->order = 3;
+ $ruleGroup->active = 1;
+ $ruleGroup->title = 'Rules for bills';
+ $ruleGroup->description = 'All rules for bills and recurring costs.';
+ $ruleGroup->save();
+ unset($ruleGroup);
+
+ // move groceries to correct budget/category
+ $rule = new Rule;
+ $rule->user()->associate($this->user);
+ $rule->ruleGroup()->associate(RuleGroup::find(1));
+ $rule->order = 1;
+ $rule->active = 1;
+ $rule->stop_processing = 0;
+ $rule->title = 'Move groceries';
+ $rule->description = 'Move groceries to correct category and budget.';
+
+ $rule->save();
+
+ // initial trigger for this rule:
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 1;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'user_action';
+ $ruleTrigger->trigger_value = 'store-journal';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // content trigger for this rule.
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 2;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'description_contains';
+ $ruleTrigger->trigger_value = 'groceries';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // another
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 3;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'from_account_is';
+ $ruleTrigger->trigger_value = 'MyBank Checking Account';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // actions for this rule. one, set category
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 1;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_category';
+ $ruleAction->action_value = 'Groceries';
+ $ruleAction->save();
+ unset($ruleAction);
+
+ // actions for this rule. one, set budget
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 2;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_budget';
+ $ruleAction->action_value = 'Groceries';
+ $ruleAction->save();
+ unset($ruleAction);
+
+
+ // move "gas" to "Car" and "Car"
+ $rule = new Rule;
+ $rule->user()->associate($this->user);
+ $rule->ruleGroup()->associate(RuleGroup::find(1));
+ $rule->order = 2;
+ $rule->active = 1;
+ $rule->stop_processing = 0;
+ $rule->title = 'Move gas';
+ $rule->description = null;
+
+ $rule->save();
+
+ // initial trigger for this rule:
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 1;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'user_action';
+ $ruleTrigger->trigger_value = 'store-journal';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // content trigger for this rule.
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 2;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'description_contains';
+ $ruleTrigger->trigger_value = 'gas';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // another
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 3;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'from_account_is';
+ $ruleTrigger->trigger_value = 'MyBank Checking Account';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // actions for this rule. one, set category
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 1;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_category';
+ $ruleAction->action_value = 'Car';
+ $ruleAction->save();
+ unset($ruleAction);
+
+ // actions for this rule. one, set budget
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 2;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_budget';
+ $ruleAction->action_value = 'Car';
+ $ruleAction->save();
+ unset($ruleAction);
+
+ // move savings to money management
+ $rule = new Rule;
+ $rule->user()->associate($this->user);
+ $rule->ruleGroup()->associate(RuleGroup::find(1));
+ $rule->order = 3;
+ $rule->active = 1;
+ $rule->stop_processing = 0;
+ $rule->title = 'Move savings';
+ $rule->description = null;
+
+ $rule->save();
+
+ // initial trigger for this rule:
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 1;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'user_action';
+ $ruleTrigger->trigger_value = 'store-journal';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // is transfer
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 2;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'transaction_type';
+ $ruleTrigger->trigger_value = 'Transfer';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // content trigger for this rule.
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 3;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'description_is';
+ $ruleTrigger->trigger_value = 'Save money';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // another
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 4;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'from_account_is';
+ $ruleTrigger->trigger_value = 'MyBank Checking Account';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // another
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 5;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'to_account_is';
+ $ruleTrigger->trigger_value = 'Savings';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // actions for this rule. one, set category
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 1;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_category';
+ $ruleAction->action_value = 'Money Management';
+ $ruleAction->save();
+ unset($ruleAction);
+
+ // move TV bill to "Bills" and "House"
+ $rule = new Rule;
+ $rule->user()->associate($this->user);
+ $rule->ruleGroup()->associate(RuleGroup::find(3));
+ $rule->order = 1;
+ $rule->active = 1;
+ $rule->stop_processing = 0;
+ $rule->title = 'TV Bill';
+ $rule->description = null;
+
+ $rule->save();
+
+ // initial trigger for this rule:
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 1;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'user_action';
+ $ruleTrigger->trigger_value = 'store-journal';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // content trigger for this rule.
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 2;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'description_contains';
+ $ruleTrigger->trigger_value = 'tv bill';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // another
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 3;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'from_account_is';
+ $ruleTrigger->trigger_value = 'MyBank Checking Account';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // actions for this rule. one, set category
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 1;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_category';
+ $ruleAction->action_value = 'House';
+ $ruleAction->save();
+ unset($ruleAction);
+
+ // actions for this rule. one, set budget
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 2;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_budget';
+ $ruleAction->action_value = 'Bills';
+ $ruleAction->save();
+ unset($ruleAction);
+
+ // move rent to bills, rent.
+ $rule = new Rule;
+ $rule->user()->associate($this->user);
+ $rule->ruleGroup()->associate(RuleGroup::find(3));
+ $rule->order = 2;
+ $rule->active = 1;
+ $rule->stop_processing = 1;
+ $rule->title = 'Rent';
+ $rule->description = 'Do something with rent.';
+
+ $rule->save();
+
+ // initial trigger for this rule:
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 1;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'user_action';
+ $ruleTrigger->trigger_value = 'update-journal';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // content trigger for this rule.
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 2;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 0;
+ $ruleTrigger->trigger_type = 'description_contains';
+ $ruleTrigger->trigger_value = 'rent';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // another
+ $ruleTrigger = new RuleTrigger;
+ $ruleTrigger->rule()->associate($rule);
+ $ruleTrigger->order = 3;
+ $ruleTrigger->active = 1;
+ $ruleTrigger->stop_processing = 1;
+ $ruleTrigger->trigger_type = 'from_account_is';
+ $ruleTrigger->trigger_value = 'MyBank Checking Account';
+
+ $ruleTrigger->save();
+ unset($ruleTrigger);
+
+ // actions for this rule. one, set category
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 1;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 0;
+ $ruleAction->action_type = 'set_category';
+ $ruleAction->action_value = 'House';
+ $ruleAction->save();
+ unset($ruleAction);
+
+ // actions for this rule. one, set budget
+ $ruleAction = new RuleAction;
+ $ruleAction->rule()->associate($rule);
+ $ruleAction->order = 2;
+ $ruleAction->active = 1;
+ $ruleAction->stop_processing = 1;
+ $ruleAction->action_type = 'set_budget';
+ $ruleAction->action_value = 'Bills';
+ $ruleAction->save();
+ unset($ruleAction);
+ }
+
+ /**
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
+ public function run()
+ {
+ $this->createUsers();
+
+ // create accounts:
+ $this->createAssetAccounts();
+ $this->createExpenseAccounts();
+ $this->createRevenueAccounts();
+ $this->createBills();
+ $this->createPiggybanks();
+
+ $this->createRules();
+
+ // preference to only see account #1 on frontpage.
+ $this->createPreferences();
+
+ // dates:
+ $start = Carbon::now()->subYears(2)->startOfMonth();
+ $end = Carbon::now()->endOfDay();
+
+
+ $current = clone $start;
+ while ($current < $end) {
+ $month = $current->format('F Y');
+ // create salaries:
+ $this->createIncome('Salary ' . $month, $current, rand(2000, 2100));
+
+ // pay bills:
+ $this->createRent('Rent for ' . $month, $current, 800);
+ $this->createWater('Water bill for ' . $month, $current, 15);
+ $this->createTV('TV bill for ' . $month, $current, 60);
+ $this->createPower('Power bill for ' . $month, $current, 120);
+
+
+ // pay daily groceries:
+ $this->createGroceries($current);
+
+ // create tag (each type of tag, for date):
+ $this->createTags($current);
+
+ // go out for drinks:
+ $this->createDrinksAndOthers($current);
+
+ // save money every month:
+ $this->createSavings($current);
+
+ // buy gas for the car every month:
+ $this->createCar($current);
+
+ // budget limit for this month, on "Groceries".
+ $this->createBudgetLimit($current, 'Groceries', 400);
+ $this->createBudgetLimit($current, 'Bills', 1000);
+ $this->createBudgetLimit($current, 'Car', 100);
+
+ echo 'Created test data for ' . $month . "\n";
+ $current->addMonth();
+ }
+
+ }
+
+ /**
+ * @param Carbon $date
+ */
+ protected function createTags(Carbon $date)
+ {
+ Tag::create(
+ [
+ 'user_id' => $this->user->id,
+ 'tag' => 'SomeTag' . $date->month . '.' . $date->year . '.nothing',
+ 'tagMode' => 'nothing',
+ 'date' => $date->format('Y-m-d'),
+
+
+ ]
+ );
+ }
+
+ /**
+ *
+ */
+ protected function createUsers()
+ {
+ User::create(['email' => 'thegrumpydictator@gmail.com', 'password' => bcrypt('james'), 'reset' => null, 'remember_token' => null]);
+ $this->user = User::whereEmail('thegrumpydictator@gmail.com')->first();
+
+ // create rights:
+ $role = Role::find(1);
+ $this->user->roles()->save($role);
+
+ }
+
+ /**
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
+ protected function createAssetAccounts()
+ {
+ $assets = ['MyBank Checking Account', 'Savings', 'Shared', 'Creditcard', 'Emergencies', 'STE'];
+ $ibans = ['NL47JDYU6179706202', 'NL51WGBP5832453599', 'NL81RCQZ7160379858', 'NL19NRAP2367994221', 'NL40UKBK3619908726', 'NL38SRMN4325934708'];
+ $assetMeta = [
+ [
+ 'accountRole' => 'defaultAsset',
+ ],
+ [
+ 'accountRole' => 'savingAsset',
+ ],
+ [
+ 'accountRole' => 'sharedAsset',
+ ],
+ [
+ 'accountRole' => 'ccAsset',
+ 'ccMonthlyPaymentDate' => '2015-05-27',
+ 'ccType' => 'monthlyFull',
+ ],
+ [
+ 'accountRole' => 'savingAsset',
+ ],
+ [
+ 'accountRole' => 'savingAsset',
+ ],
+
+ ];
+
+ foreach ($assets as $index => $name) {
+ // create account:
+ $account = Account::create(
+ [
+ 'user_id' => $this->user->id,
+ 'account_type_id' => 3,
+ 'name' => $name,
+ 'active' => 1,
+ 'encrypted' => 1,
+ 'iban' => $ibans[$index],
+ ]
+ );
+ foreach ($assetMeta[$index] as $name => $value) {
+ AccountMeta::create(['account_id' => $account->id, 'name' => $name, 'data' => $value,]);
+ }
+ }
+ }
+
+ protected function createExpenseAccounts()
+ {
+ $expenses = ['Adobe', 'Google', 'Vitens', 'Albert Heijn', 'PLUS', 'Apple', 'Bakker', 'Belastingdienst', 'bol.com', 'Cafe Central', 'conrad.nl',
+ 'coolblue', 'Shell',
+ 'DUO', 'Etos', 'FEBO', 'Greenchoice', 'Halfords', 'XS4All', 'iCentre', 'Jumper', 'Land lord'];
+ foreach ($expenses as $name) {
+ // create account:
+ Account::create(
+ [
+ 'user_id' => $this->user->id,
+ 'account_type_id' => 4,
+ 'name' => $name,
+ 'active' => 1,
+ 'encrypted' => 1,
+ ]
+ );
+ }
+
+ }
+
+ /**
+ *
+ */
+ protected function createRevenueAccounts()
+ {
+ $revenues = ['Job', 'Belastingdienst', 'Bank', 'KPN', 'Google'];
+ foreach ($revenues as $name) {
+ // create account:
+ Account::create(
+ [
+ 'user_id' => $this->user->id,
+ 'account_type_id' => 5,
+ 'name' => $name,
+ 'active' => 1,
+ 'encrypted' => 1,
+ ]
+ );
+ }
+ }
+
+ public function createBills()
+ {
+ Bill::create(
+ [
+ 'name' => 'Rent',
+ 'match' => 'rent,land,lord',
+ 'amount_min' => 795,
+ 'amount_max' => 805,
+ 'user_id' => $this->user->id,
+ 'date' => '2015-01-01',
+ 'active' => 1,
+ 'automatch' => 1,
+ 'repeat_freq' => 'monthly',
+ 'skip' => 0,
+ ]
+ );
+ Bill::create(
+ [
+ 'name' => 'Health insurance',
+ 'match' => 'zilveren,kruis,health',
+ 'amount_min' => 120,
+ 'amount_max' => 140,
+ 'user_id' => $this->user->id,
+ 'date' => '2015-01-01',
+ 'active' => 1,
+ 'automatch' => 1,
+ 'repeat_freq' => 'monthly',
+ 'skip' => 0,
+ ]
+ );
+ }
+
+ /**
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
+ protected function createPiggybanks()
+ {
+ $account = $this->findAccount('Savings');
+
+ $camera = PiggyBank::create(
+ [
+ 'account_id' => $account->id,
+ 'name' => 'New camera',
+ 'targetamount' => 1000,
+ 'startdate' => '2015-04-01',
+ 'reminder_skip' => 0,
+ 'remind_me' => 0,
+ 'order' => 1,
+ ]
+ );
+ $repetition = $camera->piggyBankRepetitions()->first();
+ $repetition->currentamount = 735;
+ $repetition->save();
+
+ // events:
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $camera->id,
+ 'date' => '2015-05-01',
+ 'amount' => '245',
+ ]
+ );
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $camera->id,
+ 'date' => '2015-06-01',
+ 'amount' => '245',
+ ]
+ );
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $camera->id,
+ 'date' => '2015-07-01',
+ 'amount' => '245',
+ ]
+ );
+
+
+ $phone = PiggyBank::create(
+ [
+ 'account_id' => $account->id,
+ 'name' => 'New phone',
+ 'targetamount' => 600,
+ 'startdate' => '2015-04-01',
+ 'reminder_skip' => 0,
+ 'remind_me' => 0,
+ 'order' => 2,
+ ]
+ );
+ $repetition = $phone->piggyBankRepetitions()->first();
+ $repetition->currentamount = 333;
+ $repetition->save();
+
+ // events:
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $phone->id,
+ 'date' => '2015-05-01',
+ 'amount' => '111',
+ ]
+ );
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $phone->id,
+ 'date' => '2015-06-01',
+ 'amount' => '111',
+ ]
+ );
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $phone->id,
+ 'date' => '2015-07-01',
+ 'amount' => '111',
+ ]
+ );
+
+ $couch = PiggyBank::create(
+ [
+ 'account_id' => $account->id,
+ 'name' => 'New couch',
+ 'targetamount' => 500,
+ 'startdate' => '2015-04-01',
+ 'reminder_skip' => 0,
+ 'remind_me' => 0,
+ 'order' => 3,
+ ]
+ );
+ $repetition = $couch->piggyBankRepetitions()->first();
+ $repetition->currentamount = 120;
+ $repetition->save();
+
+ // events:
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $couch->id,
+ 'date' => '2015-05-01',
+ 'amount' => '40',
+ ]
+ );
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $couch->id,
+ 'date' => '2015-06-01',
+ 'amount' => '40',
+ ]
+ );
+ PiggyBankEvent::create(
+ [
+ 'piggy_bank_id' => $couch->id,
+ 'date' => '2015-07-01',
+ 'amount' => '40',
+ ]
+ );
+
+ // empty one.
+ PiggyBank::create(
+ [
+ 'account_id' => $account->id,
+ 'name' => 'New head set',
+ 'targetamount' => 500,
+ 'startdate' => '2015-04-01',
+ 'reminder_skip' => 0,
+ 'remind_me' => 0,
+ 'order' => 4,
+ ]
+ );
+
+ }
+
+ /**
+ * @param $name
+ *
+ * @return Account|null
+ */
+ protected function findAccount($name)
+ {
+ /** @var Account $account */
+ foreach (Account::get() as $account) {
+ if ($account->name == $name && $this->user->id == $account->user_id) {
+ return $account;
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param $description
+ * @param Carbon $date
+ * @param $amount
+ *
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ *
+ * @return TransactionJournal
+ */
+ protected function createIncome($description, Carbon $date, $amount)
+ {
+ $date = new Carbon($date->format('Y-m') . '-23'); // paid on 23rd.
+ $today = new Carbon;
+ if ($date >= $today) {
+ return null;
+ }
+ $toAccount = $this->findAccount('MyBank Checking Account');
+ $fromAccount = $this->findAccount('Job');
+ $category = Category::firstOrCreateEncrypted(['name' => 'Salary', 'user_id' => $this->user->id]);
+ // create journal:
+
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 2,
+ 'transaction_currency_id' => 1,
+ 'description' => $description,
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+
+ return $journal;
+
+ }
+
+ /**
+ * @param $description
+ * @param Carbon $date
+ * @param $amount
+ *
+ * @return TransactionJournal
+ */
+ protected function createRent($description, Carbon $date, $amount)
+ {
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $toAccount = $this->findAccount('Land lord');
+ $category = Category::firstOrCreateEncrypted(['name' => 'Rent', 'user_id' => $this->user->id]);
+ $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'bill_id' => 1,
+ 'description' => $description,
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+ $journal->budgets()->save($budget);
+
+ return $journal;
+
+ }
+
+ /**
+ * @param $description
+ * @param Carbon $date
+ * @param $amount
+ *
+ * @return TransactionJournal
+ */
+ protected function createWater($description, Carbon $date, $amount)
+ {
+ $date = new Carbon($date->format('Y-m') . '-10'); // paid on 10th
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $toAccount = $this->findAccount('Vitens');
+ $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]);
+ $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'description' => $description,
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+ $journal->budgets()->save($budget);
+
+ return $journal;
+
+ }
+
+ /**
+ * @param $description
+ * @param Carbon $date
+ * @param $amount
+ *
+ * @return TransactionJournal
+ */
+ protected function createTV($description, Carbon $date, $amount)
+ {
+ $date = new Carbon($date->format('Y-m') . '-15'); // paid on 10th
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $toAccount = $this->findAccount('XS4All');
+ $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]);
+ $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'description' => $description,
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+ $journal->budgets()->save($budget);
+
+ return $journal;
+
+ }
+
+ /**
+ * @param $description
+ * @param Carbon $date
+ * @param $amount
+ *
+ * @return TransactionJournal
+ */
+ protected function createPower($description, Carbon $date, $amount)
+ {
+ $date = new Carbon($date->format('Y-m') . '-06'); // paid on 10th
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $toAccount = $this->findAccount('Greenchoice');
+ $category = Category::firstOrCreateEncrypted(['name' => 'House', 'user_id' => $this->user->id]);
+ $budget = Budget::firstOrCreateEncrypted(['name' => 'Bills', 'user_id' => $this->user->id]);
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'description' => $description,
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+ $journal->budgets()->save($budget);
+
+ return $journal;
+
+ }
+
+ /**
+ * @param Carbon $date
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
+ protected function createGroceries(Carbon $date)
+ {
+ $start = clone $date;
+ $end = clone $date;
+ $today = new Carbon;
+ $start->startOfMonth();
+ $end->endOfMonth();
+
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $stores = ['Albert Heijn', 'PLUS', 'Bakker'];
+ $descriptions = ['Groceries', 'Bought some groceries', 'Got groceries'];
+ $category = Category::firstOrCreateEncrypted(['name' => 'Daily groceries', 'user_id' => $this->user->id]);
+ $budget = Budget::firstOrCreateEncrypted(['name' => 'Groceries', 'user_id' => $this->user->id]);
+
+ $current = clone $start;
+ while ($current < $end && $current < $today) {
+ // daily groceries:
+ $amount = rand(1500, 2500) / 100;
+ $toAccount = $this->findAccount($stores[rand(0, count($stores) - 1)]);
+
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'description' => $descriptions[rand(0, count($descriptions) - 1)],
+ 'completed' => 1,
+ 'date' => $current,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+ $journal->budgets()->save($budget);
+
+
+ $current->addDay();
+ }
+ }
+
+ /**
+ * @param Carbon $date
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
+ protected function createDrinksAndOthers(Carbon $date)
+ {
+ $start = clone $date;
+ $end = clone $date;
+ $today = new Carbon;
+ $start->startOfMonth();
+ $end->endOfMonth();
+ $current = clone $start;
+ while ($current < $end && $current < $today) {
+
+ // weekly drink:
+ $thisDate = clone $current;
+ $thisDate->addDay();
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $toAccount = $this->findAccount('Cafe Central');
+ $category = Category::firstOrCreateEncrypted(['name' => 'Drinks', 'user_id' => $this->user->id]);
+ $budget = Budget::firstOrCreateEncrypted(['name' => 'Going out', 'user_id' => $this->user->id]);
+ $amount = rand(1500, 3600) / 100;
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'description' => 'Going out for drinks',
+ 'completed' => 1,
+ 'date' => $thisDate,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+ $journal->budgets()->save($budget);
+
+ // shopping at some (online) shop:
+
+
+ $current->addWeek();
+ }
+ }
+
+ /**
+ * @param Carbon $date
+ *
+ * @return TransactionJournal
+ */
+ protected function createSavings(Carbon $date)
+ {
+ $date = new Carbon($date->format('Y-m') . '-24'); // paid on 24th.
+ $toAccount = $this->findAccount('Savings');
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $category = Category::firstOrCreateEncrypted(['name' => 'Money management', 'user_id' => $this->user->id]);
+ // create journal:
+
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 3,
+ 'transaction_currency_id' => 1,
+ 'description' => 'Save money',
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => -150,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => 150,
+
+ ]
+ );
+ $journal->categories()->save($category);
+
+ return $journal;
+
+ }
+
+ /**
+ * @param Carbon $current
+ * @param $name
+ * @param $amount
+ */
+ protected function createBudgetLimit(Carbon $current, $name, $amount)
+ {
+ $start = clone $current;
+ $end = clone $current;
+ $budget = $this->findBudget($name);
+ $start->startOfMonth();
+ $end->endOfMonth();
+
+ BudgetLimit::create(
+ [
+ 'budget_id' => $budget->id,
+ 'startdate' => $start->format('Y-m-d'),
+ 'amount' => $amount,
+ 'repeats' => 0,
+ 'repeat_freq' => 'monthly',
+ ]
+ );
+ }
+
+ /**
+ * @param $name
+ *
+ * @return Budget|null
+ */
+ protected function findBudget($name)
+ {
+ /** @var Budget $budget */
+ foreach (Budget::get() as $budget) {
+ if ($budget->name == $name && $this->user->id == $budget->user_id) {
+ return $budget;
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param $name
+ *
+ * @return Bill|null
+ */
+ protected function findBill($name)
+ {
+ /** @var Bill $bill */
+ foreach (Bill::get() as $bill) {
+ if ($bill->name == $name && $this->user->id == $bill->user_id) {
+ return $bill;
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param $name
+ *
+ * @return Category|null
+ */
+ protected function findCategory($name)
+ {
+
+ /** @var Category $category */
+ foreach (Category::get() as $category) {
+ if ($category->name == $name && $this->user->id == $category->user_id) {
+ return $category;
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param $name
+ *
+ * @return PiggyBank|null
+ */
+ protected function findPiggyBank($name)
+ {
+
+ /** @var Budget $budget */
+ foreach (PiggyBank::get() as $piggyBank) {
+ $account = $piggyBank->account()->first();
+ if ($piggyBank->name == $name && $this->user->id == $account->user_id) {
+ return $piggyBank;
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param $tagName
+ *
+ * @return Tag|null
+ * @internal param $tag
+ */
+ protected function findTag($tagName)
+ {
+ /** @var Tag $tag */
+ foreach (Tag::get() as $tag) {
+ if ($tag->tag == $tagName && $this->user->id == $tag->user_id) {
+ return $tag;
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @param $date
+ *
+ * @return static
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
+ protected function createCar($date)
+ {
+ // twice:
+ $date = new Carbon($date->format('Y-m') . '-10'); // paid on 10th
+ $fromAccount = $this->findAccount('MyBank Checking Account');
+ $toAccount = $this->findAccount('Shell');
+ $category = Category::firstOrCreateEncrypted(['name' => 'Car', 'user_id' => $this->user->id]);
+ $budget = Budget::firstOrCreateEncrypted(['name' => 'Car', 'user_id' => $this->user->id]);
+ $amount = rand(4000, 5000) / 100;
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'description' => 'Bought gas',
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+ $journal->categories()->save($category);
+ $journal->budgets()->save($budget);
+
+ // and again!
+ $date = new Carbon($date->format('Y-m') . '-20'); // paid on 20th
+ $amount = rand(4000, 5000) / 100;
+
+
+ $journal = TransactionJournal::create(
+ [
+ 'user_id' => $this->user->id,
+ 'transaction_type_id' => 1,
+ 'transaction_currency_id' => 1,
+ 'description' => 'Gas for car',
+ 'completed' => 1,
+ 'date' => $date,
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $fromAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount * -1,
+
+ ]
+ );
+ Transaction::create(
+ [
+ 'account_id' => $toAccount->id,
+ 'transaction_journal_id' => $journal->id,
+ 'amount' => $amount,
+
+ ]
+ );
+
+ // and again!
+
+ return $journal;
+ }
+
+ protected function createPreferences()
+ {
+ $preference = new Preference;
+ $preference->name = 'frontPageAccounts';
+ $preference->data = [1];
+ $preference->user()->associate($this->user);
+ $preference->save();
+ }
+
+
+}
diff --git a/phpunit.cover.xml b/phpunit.cover.xml
new file mode 100755
index 0000000000..05acf49856
--- /dev/null
+++ b/phpunit.cover.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ ./tests/
+
+
+
+
+ app/
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phpunit.default.xml b/phpunit.default.xml
new file mode 100755
index 0000000000..04f27f97f4
--- /dev/null
+++ b/phpunit.default.xml
@@ -0,0 +1,35 @@
+
+
+
+
+ ./tests/
+
+
+
+
+ app/
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phpunit.xml b/phpunit.xml
index cc0841c1d3..04f27f97f4 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -18,6 +18,14 @@
app/
+
+
diff --git a/pu.sh b/pu.sh
new file mode 100755
index 0000000000..2f20bcb843
--- /dev/null
+++ b/pu.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# set testing environment
+cp .env.testing .env
+
+# test!
+if [ -z "$1" ]
+then
+ #phpunit --verbose
+ phpunit
+fi
+
+# directories to look in:
+#dirs=("controllers" "database" "factories" "generators" "helpers" "models" "middleware" "repositories" "support")
+#
+#if [ ! -z "$1" ]
+#then
+# for i in "${dirs[@]}"
+# do
+# firstFile="./tests/$i/$1.php"
+# secondFile="./tests/$i/$1Test.php"
+# if [ -f "$firstFile" ]
+# then
+# # run it!
+# phpunit --verbose $firstFile
+# exit $?
+# fi
+# if [ -f "$secondFile" ]
+# then
+# # run it!
+# phpunit --verbose $secondFile
+# exit $?
+# fi
+#
+#
+# done
+#
+#fi
+
+# restore .env file
+cp .env.local .env
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 9beff0f8e6..be816a7d26 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -282,6 +282,7 @@ return [
'csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.',
'csv_specifix_Dummy' => 'Checking this has no effect whatsoever.',
'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',
+ 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.',
'csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',
// create new stuff:
diff --git a/resources/lang/en_US/form.php b/resources/lang/en_US/form.php
index ec273e435e..d1d398ebc2 100644
--- a/resources/lang/en_US/form.php
+++ b/resources/lang/en_US/form.php
@@ -53,6 +53,7 @@ return [
'csv_config' => 'CSV import configuration',
'specifix' => 'Bank- or file specific fixes',
'csv_import_account' => 'Default import account',
+ 'csv_delimiter' => 'CSV field delimiter',
'attachments[]' => 'Attachments',
'store_new_withdrawal' => 'Store new withdrawal',
'store_new_deposit' => 'Store new deposit',
@@ -70,6 +71,10 @@ return [
'trigger' => 'Trigger',
'stop_processing' => 'Stop processing',
+ 'csv_comma' => 'A comma (,)',
+ 'csv_semicolon' => 'A semicolon (;)',
+ 'csv_tab' => 'A tab (invisible)',
+
'delete_account' => 'Delete account ":name"',
'delete_bill' => 'Delete bill ":name"',
diff --git a/resources/lang/en_US/passwords.php b/resources/lang/en_US/passwords.php
index f248128198..125f093fa8 100644
--- a/resources/lang/en_US/passwords.php
+++ b/resources/lang/en_US/passwords.php
@@ -17,6 +17,6 @@ return [
"token" => "This password reset token is invalid.",
"sent" => "We have e-mailed your password reset link!",
"reset" => "Your password has been reset!",
- 'blocked' => 'Nice try though.'
+ 'blocked' => 'Nice try though.',
];
diff --git a/resources/lang/fr_FR/breadcrumbs.php b/resources/lang/fr_FR/breadcrumbs.php
old mode 100644
new mode 100755
diff --git a/resources/lang/fr_FR/config.php b/resources/lang/fr_FR/config.php
old mode 100644
new mode 100755
diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php
old mode 100644
new mode 100755
index d9dfa8daff..b0a5e55779
--- a/resources/lang/fr_FR/firefly.php
+++ b/resources/lang/fr_FR/firefly.php
@@ -1,487 +1,582 @@
'Vous avez choisi Anglais',
- 'close' => 'Fermer',
- 'pleaseHold' => 'Veuillew patienter...',
- 'actions' => 'Actions',
- 'edit' => 'Editer',
- 'delete' => 'Supprimer',
- 'welcomeBack' => 'What\'s playing?',
- 'everything' => 'Everything',
- 'customRange' => 'Custom range',
- 'apply' => 'Apply',
- 'cancel' => 'Cancel',
- 'from' => 'From',
- 'to' => 'To',
- 'total_sum' => 'Total sum',
- 'period_sum' => 'Sum for period',
- 'showEverything' => 'Show everything',
- 'never' => 'Never',
- 'search_results_for' => 'Search results for ":query"',
- 'bounced_error' => 'The message sent to :email bounced, so no access for you.',
- 'deleted_error' => 'These credentials do not match our records.',
- 'general_blocked_error' => 'Your account has been disabled, so you cannot login.',
- 'removed_amount' => 'Removed :amount',
- 'added_amount' => 'Added :amount',
- 'asset_account_role_help' => 'Any extra options resulting from your choice can be set later.',
- 'Opening balance' => 'Opening balance',
- 'create_new_stuff' => 'Create new stuff',
- 'new_withdrawal' => 'New withdrawal',
- 'new_deposit' => 'New deposit',
- 'new_transfer' => 'New transfer',
- 'new_asset_account' => 'New asset account',
- 'new_expense_account' => 'New expense account',
- 'new_revenue_account' => 'New revenue account',
- 'new_budget' => 'New budget',
- 'new_bill' => 'New bill',
+ // general stuff:
+ 'language_incomplete' => 'Cette langue n\'est pas encore complètement traduite',
+ 'test' => 'Vous avez choisi Anglais',
+ 'close' => 'Fermer',
+ 'pleaseHold' => 'Veuillew patienter...',
+ 'actions' => 'Actions',
+ 'edit' => 'Editer',
+ 'delete' => 'Supprimer',
+ 'welcomeBack' => 'What\'s playing?',
+ 'everything' => 'Tout',
+ 'customRange' => 'Plage personnalisée',
+ 'apply' => 'Appliquer',
+ 'cancel' => 'Annuler',
+ 'from' => 'Depuis',
+ 'to' => 'To',
+ 'total_sum' => 'Montant total ',
+ 'period_sum' => 'Somme pour la période',
+ 'showEverything' => 'Tout Afficher',
+ 'never' => 'Jamais',
+ 'search_results_for' => 'Résultats de recherche pour ":query"',
+ 'bounced_error' => 'Le message envoyé à :email a été rejeté, donc pas d\'accès pour vous.',
+ 'deleted_error' => 'These credentials do not match our records.',
+ 'general_blocked_error' => 'Your account has been disabled, so you cannot login.',
+ 'removed_amount' => 'Supprimé :amount',
+ 'added_amount' => 'Ajouté :amount',
+ 'asset_account_role_help' => 'Any extra options resulting from your choice can be set later.',
+ 'Opening balance' => 'Solde initial',
+ 'create_new_stuff' => 'Create new stuff',
+ 'new_withdrawal' => 'Nouveau retrait',
+ 'new_deposit' => 'Nouveau dépôt',
+ 'new_transfer' => 'Nouveau transfert',
+ 'new_asset_account' => 'New asset account',
+ 'new_expense_account' => 'New expense account',
+ 'new_revenue_account' => 'Nouveau compte de recettes',
+ 'new_budget' => 'Nouveau budget',
+ 'new_bill' => 'Nouvelle facture',
+
+ // rules
+ 'rules' => 'Rules',
+ 'rules_explanation' => 'Here you can manage rules. Rules are triggered when a transaction is created or updated. Then, if the transaction has certain properties (called "triggers") Firefly will execute the "actions". Combined, you can make Firefly respond in a certain way to new transactions.',
+ 'rule_name' => 'Name of rule',
+ 'rule_triggers' => 'Rule triggers when',
+ 'rule_actions' => 'Rule will',
+ 'new_rule' => 'New rule',
+ 'new_rule_group' => 'New rule group',
+ 'rule_priority_up' => 'Give rule more priority',
+ 'rule_priority_down' => 'Give rule less priority',
+ 'make_new_rule_group' => 'Make new rule group',
+ 'store_new_rule_group' => 'Store new rule group',
+ 'created_new_rule_group' => 'New rule group ":title" stored!',
+ 'updated_rule_group' => 'Successfully updated rule group ":title".',
+ 'edit_rule_group' => 'Edit rule group ":title"',
+ 'delete_rule_group' => 'Delete rule group ":title"',
+ 'deleted_rule_group' => 'Deleted rule group ":title"',
+ 'update_rule_group' => 'Update rule group',
+ 'no_rules_in_group' => 'There are no rules in this group',
+ 'move_rule_group_up' => 'Move rule group up',
+ 'move_rule_group_down' => 'Move rule group down',
+ 'save_rules_by_moving' => 'Save these rule(s) by moving them to another rule group:',
+ 'make_new_rule' => 'Make new rule in rule group ":title"',
+ 'rule_help_stop_processing' => 'When you check this box, later rules in this group will not be executed.',
+ 'rule_help_active' => 'Inactive rules will never fire.',
+ 'stored_new_rule' => 'Stored new rule with title ":title"',
+ 'deleted_rule' => 'Deleted rule with title ":title"',
+ 'store_new_rule' => 'Store new rule',
+ 'updated_rule' => 'Updated rule with title ":title"',
+
+ 'trigger' => 'Trigger',
+ 'trigger_value' => 'Trigger on value',
+ 'stop_processing_other_triggers' => 'Stop processing other triggers',
+ 'add_rule_trigger' => 'Add new trigger',
+ 'action' => 'Action',
+ 'action_value' => 'Action value',
+ 'stop_executing_other_actions' => 'Stop executing other actions',
+ 'add_rule_action' => 'Add new action',
+ 'edit_rule' => 'Edit rule ":title"',
+ 'update_rule' => 'Update rule',
+
+ // actions and triggers
+ 'rule_trigger_user_action' => 'User action is ":trigger_value"',
+ 'rule_trigger_from_account_starts' => 'Source account starts with ":trigger_value"',
+ 'rule_trigger_from_account_ends' => 'Source account ends with ":trigger_value"',
+ 'rule_trigger_from_account_is' => 'Source account is ":trigger_value"',
+ 'rule_trigger_from_account_contains' => 'Source account contains ":trigger_value"',
+ 'rule_trigger_to_account_starts' => 'Destination account starts with ":trigger_value"',
+ 'rule_trigger_to_account_ends' => 'Destination account ends with ":trigger_value"',
+ 'rule_trigger_to_account_is' => 'Destination account is ":trigger_value"',
+ 'rule_trigger_to_account_contains' => 'Destination account contains ":trigger_value"',
+ 'rule_trigger_transaction_type' => 'Transaction is of type ":trigger_value"',
+ 'rule_trigger_amount_less' => 'Amount is less than :trigger_value',
+ 'rule_trigger_amount_exactly' => 'Amount is :trigger_value',
+ 'rule_trigger_amount_more' => 'Amount is more than :trigger_value',
+ 'rule_trigger_description_starts' => 'Description starts with ":trigger_value"',
+ 'rule_trigger_description_ends' => 'Description ends with ":trigger_value"',
+ 'rule_trigger_description_contains' => 'Description contains ":trigger_value"',
+ 'rule_trigger_description_is' => 'Description is ":trigger_value"',
+
+ 'rule_trigger_from_account_starts_choice' => 'Source account starts with..',
+ 'rule_trigger_from_account_ends_choice' => 'Source account ends with..',
+ 'rule_trigger_from_account_is_choice' => 'Source account is..',
+ 'rule_trigger_from_account_contains_choice' => 'Source account contains..',
+ 'rule_trigger_to_account_starts_choice' => 'Destination account starts with..',
+ 'rule_trigger_to_account_ends_choice' => 'Destination account ends with..',
+ 'rule_trigger_to_account_is_choice' => 'Destination account is..',
+ 'rule_trigger_to_account_contains_choice' => 'Destination account contains..',
+ 'rule_trigger_transaction_type_choice' => 'Transaction is of type..',
+ 'rule_trigger_amount_less_choice' => 'Amount is less than..',
+ 'rule_trigger_amount_exactly_choice' => 'Amount is..',
+ 'rule_trigger_amount_more_choice' => 'Amount is more than..',
+ 'rule_trigger_description_starts_choice' => 'Description starts with..',
+ 'rule_trigger_description_ends_choice' => 'Description ends with..',
+ 'rule_trigger_description_contains_choice' => 'Description contains..',
+ 'rule_trigger_description_is_choice' => 'Description is..',
+
+ 'rule_trigger_store_journal' => 'When a journal is created',
+ 'rule_trigger_update_journal' => 'When a journal is updated',
+
+ 'rule_action_set_category' => 'Set category to ":action_value"',
+ 'rule_action_clear_category' => 'Clear category',
+ 'rule_action_set_budget' => 'Set budget to ":action_value"',
+ 'rule_action_clear_budget' => 'Clear budget',
+ 'rule_action_add_tag' => 'Add tag ":action_value"',
+ 'rule_action_remove_tag' => 'Remove tag ":action_value"',
+ 'rule_action_remove_all_tags' => 'Remove all tags',
+ 'rule_action_set_description' => 'Set description to ":action_value"',
+ 'rule_action_append_description' => 'Append description with ":action_value"',
+ 'rule_action_prepend_description' => 'Prepend description with ":action_value"',
+
+ 'rule_action_set_category_choice' => 'Set category to..',
+ 'rule_action_clear_category_choice' => 'Clear any category',
+ 'rule_action_set_budget_choice' => 'Set budget to..',
+ 'rule_action_clear_budget_choice' => 'Clear any budget',
+ 'rule_action_add_tag_choice' => 'Add tag..',
+ 'rule_action_remove_tag_choice' => 'Remove tag..',
+ 'rule_action_remove_all_tags_choice' => 'Remove all tags',
+ 'rule_action_set_description_choice' => 'Set description to..',
+ 'rule_action_append_description_choice' => 'Append description with..',
+ 'rule_action_prepend_description_choice' => 'Prepend description with..',
// tags
- 'store_new_tag' => 'Store new tag',
- 'update_tag' => 'Update tag',
- 'no_location_set' => 'No location set.',
- 'meta_data' => 'Meta data',
- 'location' => 'Location',
+ 'store_new_tag' => 'Créer un nouveau tag',
+ 'update_tag' => 'Mettre à jour le tag',
+ 'no_location_set' => 'Aucun emplacement défini.',
+ 'meta_data' => 'Meta-données',
+ 'location' => 'Emplacement',
// preferences
- 'pref_home_screen_accounts' => 'Home screen accounts',
- 'pref_home_screen_accounts_help' => 'Which accounts should be displayed on the home page?',
- 'pref_budget_settings' => 'Budget settings',
- 'pref_budget_settings_help' => 'What\'s the maximum amount of money a budget envelope may contain?',
- 'pref_view_range' => 'View range',
- 'pref_view_range_help' => 'Some charts are automatically grouped in periods. What period would you prefer?',
- 'pref_1D' => 'One day',
- 'pref_1W' => 'One week',
- 'pref_1M' => 'One month',
- 'pref_3M' => 'Three months (quarter)',
- 'pref_6M' => 'Six months',
- 'pref_languages' => 'Languages',
- 'pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?',
- 'pref_save_settings' => 'Save settings',
+ 'pref_home_screen_accounts' => 'Home screen accounts',
+ 'pref_home_screen_accounts_help' => 'Which accounts should be displayed on the home page?',
+ 'pref_budget_settings' => 'Paramètres de budget',
+ 'pref_budget_settings_help' => 'What\'s the maximum amount of money a budget envelope may contain?',
+ 'pref_view_range' => 'View range',
+ 'pref_view_range_help' => 'Some charts are automatically grouped in periods. What period would you prefer?',
+ 'pref_1D' => 'One day',
+ 'pref_1W' => 'One week',
+ 'pref_1M' => 'One month',
+ 'pref_3M' => 'Three months (quarter)',
+ 'pref_6M' => 'Six months',
+ 'pref_languages' => 'Languages',
+ 'pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?',
+ 'pref_save_settings' => 'Save settings',
- // profile
- 'change_your_password' => 'Change your password',
- 'delete_account' => 'Delete account',
- 'current_password' => 'Current password',
- 'new_password' => 'New password',
- 'new_password_again' => 'New password (again)',
- 'delete_your_account' => 'Delete your account',
- 'delete_your_account_help' => 'Deleting your account will also delete any accounts, transactions, anything you might have saved into Firefly III. It\'ll be GONE.',
- 'delete_your_account_password' => 'Enter your password to continue.',
- 'password' => 'Password',
- 'are_you_sure' => 'Are you sure? You cannot undo this.',
- 'delete_account_button' => 'DELETE your account',
- 'invalid_current_password' => 'Invalid current password!',
- 'password_changed' => 'Password changed!',
- 'should_change' => 'The idea is to change your password.',
- 'invalid_password' => 'Invalid password!',
+ // profile:
+ 'change_your_password' => 'Change your password',
+ 'delete_account' => 'Delete account',
+ 'current_password' => 'Current password',
+ 'new_password' => 'New password',
+ 'new_password_again' => 'New password (again)',
+ 'delete_your_account' => 'Delete your account',
+ 'delete_your_account_help' => 'Deleting your account will also delete any accounts, transactions, anything you might have saved into Firefly III. It\'ll be GONE.',
+ 'delete_your_account_password' => 'Enter your password to continue.',
+ 'password' => 'Password',
+ 'are_you_sure' => 'Are you sure? You cannot undo this.',
+ 'delete_account_button' => 'DELETE your account',
+ 'invalid_current_password' => 'Invalid current password!',
+ 'password_changed' => 'Password changed!',
+ 'should_change' => 'The idea is to change your password.',
+ 'invalid_password' => 'Invalid password!',
// attachments
- 'nr_of_attachments' => 'One attachment|:count attachments',
- 'attachments' => 'Attachments',
- 'edit_attachment' => 'Edit attachment ":name"',
- 'update_attachment' => 'Update attachment',
- 'delete_attachment' => 'Delete attachment ":name"',
- 'attachment_deleted' => 'Deleted attachment ":name"',
- 'upload_max_file_size' => 'Maximum file size: :size',
+ 'nr_of_attachments' => 'One attachment|:count attachments',
+ 'attachments' => 'Attachments',
+ 'edit_attachment' => 'Edit attachment ":name"',
+ 'update_attachment' => 'Update attachment',
+ 'delete_attachment' => 'Delete attachment ":name"',
+ 'attachment_deleted' => 'Deleted attachment ":name"',
+ 'upload_max_file_size' => 'Maximum file size: :size',
- // tour
- 'prev' => 'Prev',
- 'next' => 'Next',
- 'end-tour' => 'End tour',
- 'pause' => 'Pause',
+ // tour:
+ 'prev' => 'Prev',
+ 'next' => 'Next',
+ 'end-tour' => 'End tour',
+ 'pause' => 'Pause',
// transaction index
- 'title_expenses' => 'Expenses',
- 'title_withdrawal' => 'Expenses',
- 'title_revenue' => 'Revenue / income',
- 'title_deposit' => 'Revenue / income',
- 'title_transfer' => 'Transferts',
- 'title_transfers' => 'Transferts',
+ 'title_expenses' => 'Expenses',
+ 'title_withdrawal' => 'Expenses',
+ 'title_revenue' => 'Revenue / income',
+ 'title_deposit' => 'Revenue / income',
+ 'title_transfer' => 'Transferts',
+ 'title_transfers' => 'Transferts',
- // csv import
- 'csv_import' => 'Import CSV file',
- 'csv' => 'CSV',
- 'csv_index_title' => 'Upload and import a CSV file',
- 'csv_define_column_roles' => 'Define column roles',
- 'csv_map_values' => 'Map found values to existing values',
- 'csv_download_config' => 'Download CSV configuration file.',
- 'csv_index_text' => 'This form allows you to import a CSV file with transactions into Firefly. It is based on the excellent CSV importer made by the folks at Atlassian. Simply upload your CSV file and follow the instructions. If you would like to learn more, please click on the button at the top of this page.',
- 'csv_index_beta_warning' => 'This tool is very much in beta. Please proceed with caution',
- 'csv_header_help' => 'Check this box when your CSV file\'s first row consists of column names, not actual data',
- 'csv_date_help' => 'Date time format in your CSV. Follow the format like this page indicates. The default value will parse dates that look like this: 20151201',
- 'csv_csv_file_help' => 'Select the CSV file here. You can only upload one file at a time',
- 'csv_csv_config_file_help' => 'Select your CSV import configuration here. If you do not know what this is, ignore it. It will be explained later.',
- 'csv_upload_button' => 'Start importing CSV',
- 'csv_column_roles_title' => 'Define column roles',
- 'csv_column_roles_text' => 'Firefly does not know what each column means. You need to indicate what every column is. Please check out the example data if you\'re not sure yourself. Click on the question mark (top right of the page) to learn what each column means. If you want to map imported data onto existing data in Firefly, use the checkbox. The next step will show you what this button does.',
- 'csv_column_roles_table' => 'Column roles',
- 'csv_column' => 'CSV column',
- 'csv_column_name' => 'CSV column name',
- 'csv_column_example' => 'Column example data',
- 'csv_column_role' => 'Column contains?',
- 'csv_do_map_value' => 'Map value?',
- 'csv_continue' => 'Continue to the next step',
- 'csv_go_back' => 'Go back to the previous step',
- 'csv_map_title' => 'Map found values to existing values',
- 'csv_map_text' => 'This page allows you to map the values from the CSV file to existing entries in your database. This ensures that accounts and other things won\'t be created twice.',
- 'csv_field_value' => 'Field value from CSV',
- 'csv_field_mapped_to' => 'Must be mapped to...',
- 'csv_do_not_map' => 'Do not map this value',
- 'csv_download_config_title' => 'Download CSV configuration',
- 'csv_download_config_text' => 'Everything you\'ve just set up can be downloaded as a configuration file. Click the button to do so.',
- 'csv_more_information_text' => 'If the import fails, you can use this configuration file so you don\'t have to start all over again. But, if the import succeeds, it will be easier to upload similar CSV files.',
- 'csv_do_download_config' => 'Download configuration file.',
- 'csv_empty_description' => '(empty description)',
- 'csv_upload_form' => 'CSV upload form',
- 'csv_index_unsupported_warning' => 'The CSV importer is yet incapable of doing the following:',
- 'csv_unsupported_map' => 'The importer cannot map the column ":columnRole" to existing values in the database.',
- 'csv_unsupported_value' => 'The importer does not know how to handle values in columns marked as ":columnRole".',
- 'csv_cannot_store_value' => 'The importer has not reserved space for columns marked ":columnRole" and will be incapable of processing them.',
- 'csv_process_title' => 'CSV import finished!',
- 'csv_process_text' => 'The CSV importer has finished and has processed :rows rows',
- 'csv_row' => 'Row',
- 'csv_import_with_errors' => 'There was one error.|There were :errors errors.',
- 'csv_error_see_logs' => 'Check the log files to see details.',
- 'csv_process_new_entries' => 'Firefly has created :imported new transaction(s).',
- 'csv_start_over' => 'Import again',
- 'csv_to_index' => 'Back home',
- 'csv_upload_not_writeable' => 'Cannot write to the path mentioned here. Cannot upload',
- 'csv_column__ignore' => '(ignore this column)',
- 'csv_column_account-iban' => 'Asset account (IBAN)',
- 'csv_column_account-id' => 'Asset account ID (matching Firefly)',
- 'csv_column_account-name' => 'Asset account (name)',
- 'csv_column_amount' => 'Amount',
- 'csv_column_bill-id' => 'Bill ID (matching Firefly)',
- 'csv_column_bill-name' => 'Bill name',
- 'csv_column_budget-id' => 'Budget ID (matching Firefly)',
- 'csv_column_budget-name' => 'Budget name',
- 'csv_column_category-id' => 'Category ID (matching Firefly)',
- 'csv_column_category-name' => 'Category name',
- 'csv_column_currency-code' => 'Currency code (ISO 4217)',
- 'csv_column_currency-id' => 'Currency ID (matching Firefly)',
- 'csv_column_currency-name' => 'Currency name (matching Firefly)',
- 'csv_column_currency-symbol' => 'Currency symbol (matching Firefly)',
- 'csv_column_date-rent' => 'Rent calculation date',
- 'csv_column_date-transaction' => 'Date',
- 'csv_column_description' => 'Description',
- 'csv_column_opposing-iban' => 'Opposing account (IBAN)',
- 'csv_column_opposing-id' => 'Opposing account ID (matching Firefly)',
- 'csv_column_opposing-name' => 'Opposing account (name)',
- 'csv_column_rabo-debet-credit' => 'Rabobank specific debet/credit indicator',
- 'csv_column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID',
- 'csv_column_sepa-ct-op' => 'SEPA Credit Transfer opposing account',
- 'csv_column_sepa-db' => 'SEPA Direct Debet',
- 'csv_column_tags-comma' => 'Tags (comma separated)',
- 'csv_column_tags-space' => 'Tags (space separated)',
- 'csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.',
- 'csv_specifix_Dummy' => 'Checking this has no effect whatsoever.',
- 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',
- 'csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',
+ // csv import:
+ 'csv_import' => 'Import CSV file',
+ 'csv' => 'CSV',
+ 'csv_index_title' => 'Upload and import a CSV file',
+ 'csv_define_column_roles' => 'Define column roles',
+ 'csv_map_values' => 'Map found values to existing values',
+ 'csv_download_config' => 'Download CSV configuration file.',
+ 'csv_index_text' => 'This form allows you to import a CSV file with transactions into Firefly. It is based on the excellent CSV importer made by the folks at Atlassian. Simply upload your CSV file and follow the instructions. If you would like to learn more, please click on the button at the top of this page.',
+ 'csv_index_beta_warning' => 'This tool is very much in beta. Please proceed with caution',
+ 'csv_header_help' => 'Check this box when your CSV file\'s first row consists of column names, not actual data',
+ 'csv_date_help' => 'Date time format in your CSV. Follow the format like this page indicates. The default value will parse dates that look like this: :dateExample.',
+ 'csv_csv_file_help' => 'Select the CSV file here. You can only upload one file at a time',
+ 'csv_csv_config_file_help' => 'Select your CSV import configuration here. If you do not know what this is, ignore it. It will be explained later.',
+ 'csv_upload_button' => 'Start importing CSV',
+ 'csv_column_roles_title' => 'Define column roles',
+ 'csv_column_roles_text' => 'Firefly does not know what each column means. You need to indicate what every column is. Please check out the example data if you\'re not sure yourself. Click on the question mark (top right of the page) to learn what each column means. If you want to map imported data onto existing data in Firefly, use the checkbox. The next step will show you what this button does.',
+ 'csv_column_roles_table' => 'Column roles',
+ 'csv_column' => 'CSV column',
+ 'csv_column_name' => 'CSV column name',
+ 'csv_column_example' => 'Column example data',
+ 'csv_column_role' => 'Column contains?',
+ 'csv_do_map_value' => 'Map value?',
+ 'csv_continue' => 'Continue to the next step',
+ 'csv_go_back' => 'Go back to the previous step',
+ 'csv_map_title' => 'Map found values to existing values',
+ 'csv_map_text' => 'This page allows you to map the values from the CSV file to existing entries in your database. This ensures that accounts and other things won\'t be created twice.',
+ 'csv_field_value' => 'Field value from CSV',
+ 'csv_field_mapped_to' => 'Must be mapped to...',
+ 'csv_do_not_map' => 'Do not map this value',
+ 'csv_download_config_title' => 'Download CSV configuration',
+ 'csv_download_config_text' => 'Everything you\'ve just set up can be downloaded as a configuration file. Click the button to do so.',
+ 'csv_more_information_text' => 'If the import fails, you can use this configuration file so you don\'t have to start all over again. But, if the import succeeds, it will be easier to upload similar CSV files.',
+ 'csv_do_download_config' => 'Download configuration file.',
+ 'csv_empty_description' => '(empty description)',
+ 'csv_upload_form' => 'CSV upload form',
+ 'csv_index_unsupported_warning' => 'The CSV importer is yet incapable of doing the following:',
+ 'csv_unsupported_map' => 'The importer cannot map the column ":columnRole" to existing values in the database.',
+ 'csv_unsupported_value' => 'The importer does not know how to handle values in columns marked as ":columnRole".',
+ 'csv_cannot_store_value' => 'The importer has not reserved space for columns marked ":columnRole" and will be incapable of processing them.',
+ 'csv_process_title' => 'CSV import finished!',
+ 'csv_process_text' => 'The CSV importer has finished and has processed :rows rows',
+ 'csv_row' => 'Row',
+ 'csv_import_with_errors' => 'There was one error.|There were :errors errors.',
+ 'csv_error_see_logs' => 'Check the log files to see details.',
+ 'csv_process_new_entries' => 'Firefly has created :imported new transaction(s).',
+ 'csv_start_over' => 'Import again',
+ 'csv_to_index' => 'Back home',
+ 'csv_upload_not_writeable' => 'Cannot write to the path mentioned here. Cannot upload',
+ 'csv_column__ignore' => '(ignore this column)',
+ 'csv_column_account-iban' => 'Asset account (IBAN)',
+ 'csv_column_account-id' => 'Asset account ID (matching Firefly)',
+ 'csv_column_account-name' => 'Asset account (name)',
+ 'csv_column_amount' => 'Amount',
+ 'csv_column_bill-id' => 'Bill ID (matching Firefly)',
+ 'csv_column_bill-name' => 'Bill name',
+ 'csv_column_budget-id' => 'Budget ID (matching Firefly)',
+ 'csv_column_budget-name' => 'Budget name',
+ 'csv_column_category-id' => 'Category ID (matching Firefly)',
+ 'csv_column_category-name' => 'Category name',
+ 'csv_column_currency-code' => 'Currency code (ISO 4217)',
+ 'csv_column_currency-id' => 'Currency ID (matching Firefly)',
+ 'csv_column_currency-name' => 'Currency name (matching Firefly)',
+ 'csv_column_currency-symbol' => 'Currency symbol (matching Firefly)',
+ 'csv_column_date-rent' => 'Rent calculation date',
+ 'csv_column_date-transaction' => 'Date',
+ 'csv_column_description' => 'Description',
+ 'csv_column_opposing-iban' => 'Opposing account (IBAN)',
+ 'csv_column_opposing-id' => 'Opposing account ID (matching Firefly)',
+ 'csv_column_opposing-name' => 'Opposing account (name)',
+ 'csv_column_rabo-debet-credit' => 'Rabobank specific debet/credit indicator',
+ 'csv_column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID',
+ 'csv_column_sepa-ct-op' => 'SEPA Credit Transfer opposing account',
+ 'csv_column_sepa-db' => 'SEPA Direct Debet',
+ 'csv_column_tags-comma' => 'Tags (comma separated)',
+ 'csv_column_tags-space' => 'Tags (space separated)',
+ 'csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.',
+ 'csv_specifix_Dummy' => 'Checking this has no effect whatsoever.',
+ 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',
+ 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.',
+ 'csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',
+ // create new stuff:
+ 'create_new_withdrawal' => 'Creer un nouveau retrait',
+ 'create_new_deposit' => 'Create new deposit',
+ 'create_new_transfer' => 'Creer un nouveau transfert',
+ 'create_new_asset' => 'Create new asset account',
+ 'create_new_expense' => 'Create new expense account',
+ 'create_new_revenue' => 'Create new revenue account',
+ 'create_new_piggy_bank' => 'Create new piggy bank',
+ 'create_new_bill' => 'Create new bill',
- // create new stuff
- 'create_new_withdrawal' => 'Creer un nouveau retrait',
- 'create_new_deposit' => 'Create new deposit',
- 'create_new_transfer' => 'Creer un nouveau transfert',
- 'create_new_asset' => 'Create new asset account',
- 'create_new_expense' => 'Create new expense account',
- 'create_new_revenue' => 'Create new revenue account',
- 'create_new_piggy_bank' => 'Create new piggy bank',
- 'create_new_bill' => 'Create new bill',
+ // currencies:
+ 'create_currency' => 'Create a new currency',
+ 'edit_currency' => 'Edit currency ":name"',
+ 'store_currency' => 'Store new currency',
+ 'update_currency' => 'Update currency',
+ // new user:
+ 'submit' => 'Submit',
+ 'getting_started' => 'Getting started',
+ 'to_get_started' => 'To get started with Firefly, please enter your current bank\'s name, and the balance of your checking account:',
+ 'savings_balance_text' => 'If you have a savings account, please enter the current balance of your savings account:',
+ 'cc_balance_text' => 'If you have a credit card, please enter your credit card\'s limit.',
- // currencies
- 'create_currency' => 'Create a new currency',
- 'edit_currency' => 'Edit currency ":name"',
- 'store_currency' => 'Store new currency',
- 'update_currency' => 'Update currency',
+ // forms:
+ 'mandatoryFields' => 'Mandatory fields',
+ 'optionalFields' => 'Optional fields',
+ 'options' => 'Options',
+ 'something' => 'Something!',
- // new user
- 'submit' => 'Submit',
- 'getting_started' => 'Getting started',
- 'to_get_started' => 'To get started with Firefly, please enter your current bank\'s name, and the balance of your checking account:',
- 'savings_balance_text' => 'If you have a savings account, please enter the current balance of your savings account:',
- 'cc_balance_text' => 'If you have a credit card, please enter your credit card\'s limit.',
+ // budgets:
+ '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',
+ 'without_budget_between' => 'Transactions without a budget between :start and :end',
+ 'budget_in_month' => ':name in :month',
+ 'delete_budget' => 'Delete budget ":name"',
+ 'edit_budget' => 'Edit budget ":name"',
+ 'update_amount' => 'Update amount',
+ 'update_budget' => 'Update budget',
- // forms
- 'mandatoryFields' => 'Mandatory fields',
- 'optionalFields' => 'Optional fields',
- 'options' => 'Options',
- 'something' => 'Something!',
+ // bills:
+ 'delete_bill' => 'Delete bill ":name"',
+ 'edit_bill' => 'Edit bill ":name"',
+ 'update_bill' => 'Update bill',
+ 'store_new_bill' => 'Store new bill',
- // budgets
- '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',
- 'without_budget_between' => 'Transactions without a budget between :start and :end',
- 'budget_in_month' => ':name in :month',
- 'delete_budget' => 'Delete budget ":name"',
- 'edit_budget' => 'Edit budget ":name"',
- 'update_amount' => 'Update amount',
- 'update_budget' => 'Update budget',
+ // 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' => 'Create a new asset account',
+ 'make_new_expense_account' => 'Create a new expense account',
+ 'make_new_revenue_account' => 'Create a new revenue account',
+ 'asset_accounts' => 'Asset accounts',
+ 'expense_accounts' => 'Expense accounts',
+ 'revenue_accounts' => 'Revenue accounts',
+ 'accountExtraHelp_asset' => '',
+ 'accountExtraHelp_expense' => '',
+ 'accountExtraHelp_revenue' => '',
+ 'account_type' => 'Account type',
+ 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:',
- // bills
- 'delete_bill' => 'Delete bill ":name"',
- 'edit_bill' => 'Edit bill ":name"',
- 'update_bill' => 'Update bill',
- 'store_new_bill' => 'Store new bill',
+ // categories:
+ 'new_category' => 'New category',
+ 'create_new_category' => 'Create a new category',
+ 'without_category' => 'Without a category',
+ 'update_category' => 'Wijzig categorie',
+ 'categories' => 'Categories',
+ 'edit_category' => 'Edit category ":name"',
+ 'no_category' => '(no category)',
+ 'category' => 'Category',
+ 'delete_category' => 'Delete category ":name"',
+ 'store_category' => 'Store new category',
+ 'without_category_between' => 'Without category between :start and :end',
- // 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"',
+ // transactions:
+ 'update_withdrawal' => 'Update withdrawal',
+ 'update_deposit' => 'Update deposit',
+ 'update_transfer' => 'Update transfer',
+ 'delete_withdrawal' => 'Delete withdrawal ":description"',
+ 'delete_deposit' => 'Delete deposit ":description"',
+ 'delete_transfer' => 'Delete transfer ":description"',
- 'store_new_asset_account' => 'Store new asset account',
- 'store_new_expense_account' => 'Store new expense account',
- 'store_new_revenue_account' => 'Store new revenue account',
+ // new user:
+ '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',
+ 'createNewAssetButton' => 'Create new asset account',
- 'edit_asset_account' => 'Edit asset account ":name"',
- 'edit_expense_account' => 'Edit expense account ":name"',
- 'edit_revenue_account' => 'Edit revenue account ":name"',
+ // home page:
+ 'yourAccounts' => 'Your accounts',
+ 'budgetsAndSpending' => 'Budgets and spending',
+ 'savings' => 'Savings',
+ 'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel',
+ 'createPiggyToContinue' => 'Create piggy banks to fill this panel.',
+ 'newWithdrawal' => 'New expense',
+ 'newDeposit' => 'New deposit',
+ 'newTransfer' => 'New transfer',
+ 'moneyIn' => 'Money in',
+ 'moneyOut' => 'Money out',
+ 'billsToPay' => 'Bills to pay',
+ 'billsPaid' => 'Bills paid',
+ 'viewDetails' => 'View details',
+ 'divided' => 'divided',
+ 'toDivide' => 'left to divide',
- 'delete_asset_account' => 'Delete asset account ":name"',
- 'delete_expense_account' => 'Delete expense account ":name"',
- 'delete_revenue_account' => 'Delete revenue account ":name"',
+ // menu and titles, should be recycled as often as possible:
+ 'toggleNavigation' => 'Toggle navigation',
+ 'currency' => 'Currency',
+ 'preferences' => 'Preferences',
+ 'logout' => 'Logout',
+ 'searchPlaceholder' => 'Search...',
+ 'dashboard' => 'Dashboard',
+ 'currencies' => 'Currencies',
+ 'accounts' => 'Accounts',
+ 'Asset account' => 'Asset account',
+ 'Default account' => 'Asset account',
+ 'Expense account' => 'Expense account',
+ 'Revenue account' => 'Revenue account',
+ 'Initial balance account' => 'Initial balance account',
+ 'budgets' => 'Budgets',
+ 'tags' => 'Tags',
+ 'reports' => 'Reports',
+ 'transactions' => 'Transactions',
+ 'expenses' => 'Expenses',
+ 'income' => 'Revenue / income',
+ 'transfers' => 'Transferts',
+ 'moneyManagement' => 'Money management',
+ 'piggyBanks' => 'Piggy banks',
+ 'bills' => 'Bills',
+ 'createNew' => 'Create new',
+ 'withdrawal' => 'Withdrawal',
+ 'deposit' => 'Deposit',
+ 'account' => 'Account',
+ 'transfer' => 'Transfer',
+ 'Withdrawal' => 'Withdrawal',
+ 'Deposit' => 'Deposit',
+ 'Transfer' => 'Transfer',
+ 'bill' => 'Bill',
+ 'yes' => 'Yes',
+ 'no' => 'No',
+ 'amount' => 'Amount',
+ 'newBalance' => 'New balance',
+ 'overview' => 'Overview',
+ 'saveOnAccount' => 'Save on account',
+ 'unknown' => 'Unknown',
+ 'daily' => 'Daily',
+ 'weekly' => 'Weekly',
+ 'monthly' => 'Monthly',
+ 'quarterly' => 'Quarterly',
+ 'half-year' => 'Every six months',
+ 'yearly' => 'Yearly',
+ 'profile' => 'Profile',
- 'asset_deleted' => 'Successfully deleted asset account ":name"',
- 'expense_deleted' => 'Successfully deleted expense account ":name"',
- 'revenue_deleted' => 'Successfully deleted revenue account ":name"',
+ // reports:
+ 'report_default' => 'Default financial report for :start until :end',
+ 'quick_link_reports' => 'Quick links',
+ 'quick_link_default_report' => 'Default financial report',
+ 'report_this_month_quick' => 'Current month, all accounts',
+ 'report_this_year_quick' => 'Current year, all accounts',
+ 'report_all_time_quick' => 'All-time, all accounts',
+ 'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
+ 'incomeVsExpenses' => 'Income vs. expenses',
+ 'accountBalances' => 'Account balances',
+ 'balanceStartOfYear' => 'Balance at start of year',
+ 'balanceEndOfYear' => 'Balance at end of year',
+ 'balanceStartOfMonth' => 'Balance at start of month',
+ 'balanceEndOfMonth' => 'Balance at end of month',
+ 'balanceStart' => 'Balance at start of period',
+ 'balanceEnd' => 'Balance at end of period',
+ 'reportsOwnAccounts' => 'Reports for your own accounts',
+ 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts',
+ 'splitByAccount' => 'Split by account',
+ 'balancedByTransfersAndTags' => 'Balanced by transfers and tags',
+ 'coveredWithTags' => 'Covered with tags',
+ 'leftUnbalanced' => 'Left unbalanced',
+ 'expectedBalance' => 'Expected balance',
+ 'outsideOfBudgets' => 'Outside of budgets',
+ 'leftInBudget' => 'Left in budget',
+ 'sumOfSums' => 'Sum of sums',
+ 'noCategory' => '(no category)',
+ 'notCharged' => 'Not charged (yet)',
+ 'inactive' => 'Inactive',
+ 'difference' => 'Difference',
+ 'in' => 'In',
+ 'out' => 'Out',
+ 'topX' => 'top :number',
+ 'showTheRest' => 'Show everything',
+ 'hideTheRest' => 'Show only the top :number',
+ 'sum_of_year' => 'Sum of year',
+ 'sum_of_years' => 'Sum of years',
+ 'average_of_year' => 'Average of year',
+ 'average_of_years' => 'Average of years',
+ 'categories_earned_in_year' => 'Categories (by earnings)',
+ 'categories_spent_in_year' => 'Categories (by spendings)',
+ 'report_type' => 'Report type',
+ 'report_type_default' => 'Default financial report',
+ 'report_included_accounts' => 'Included accounts',
+ 'report_date_range' => 'Date range',
+ 'report_include_help' => 'In all cases, transfers to shared accounts count as expenses, and transfers from shared accounts count as income.',
+ 'report_preset_ranges' => 'Pre-set ranges',
+ 'shared' => 'Shared',
- 'update_asset_account' => 'Update asset account',
- 'update_expense_account' => 'Update expense account',
- 'update_revenue_account' => 'Update revenue account',
+ // charts:
+ 'dayOfMonth' => 'Day of the month',
+ 'month' => 'Month',
+ 'budget' => 'Budget',
+ 'spent' => 'Spent',
+ 'earned' => 'Earned',
+ 'overspent' => 'Overspent',
+ 'left' => 'Left',
+ 'noBudget' => '(no budget)',
+ 'maxAmount' => 'Maximum amount',
+ 'minAmount' => 'Minumum amount',
+ 'billEntry' => 'Current bill entry',
+ 'name' => 'Name',
+ 'date' => 'Date',
+ 'paid' => 'Paid',
+ 'unpaid' => 'Unpaid',
+ 'day' => 'Day',
+ 'budgeted' => 'Budgeted',
+ 'period' => 'Period',
+ 'balance' => 'Balance',
+ 'summary' => 'Summary',
+ 'sum' => 'Sum',
+ 'average' => 'Average',
+ 'balanceFor' => 'Balance for :name',
- 'make_new_asset_account' => 'Create a new asset account',
- 'make_new_expense_account' => 'Create a new expense account',
- 'make_new_revenue_account' => 'Create a new revenue account',
-
- 'asset_accounts' => 'Asset accounts',
- 'expense_accounts' => 'Expense accounts',
- 'revenue_accounts' => 'Revenue accounts',
-
- 'accountExtraHelp_asset' => '',
- 'accountExtraHelp_expense' => '',
- 'accountExtraHelp_revenue' => '',
- 'account_type' => 'Account type',
- 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:',
-
- // categories
- 'new_category' => 'New category',
- 'create_new_category' => 'Create a new category',
- 'without_category' => 'Without a category',
- 'update_category' => 'Wijzig categorie',
- 'categories' => 'Categories',
- 'edit_category' => 'Edit category ":name"',
- 'no_category' => '(no category)',
- 'category' => 'Category',
- 'delete_category' => 'Delete category ":name"',
- 'store_category' => 'Store new category',
-
- // transactions
- 'update_withdrawal' => 'Update withdrawal',
- 'update_deposit' => 'Update deposit',
- 'update_transfer' => 'Update transfer',
- 'delete_withdrawal' => 'Delete withdrawal ":description"',
- 'delete_deposit' => 'Delete deposit ":description"',
- 'delete_transfer' => 'Delete transfer ":description"',
-
- // new user
- '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',
- 'createNewAssetButton' => 'Create new asset account',
-
- // home page
- 'yourAccounts' => 'Your accounts',
- 'budgetsAndSpending' => 'Budgets and spending',
- 'savings' => 'Savings',
- 'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel',
- 'createPiggyToContinue' => 'Create piggy banks to fill this panel.',
- 'newWithdrawal' => 'New expense',
- 'newDeposit' => 'New deposit',
- 'newTransfer' => 'New transfer',
- 'moneyIn' => 'Money in',
- 'moneyOut' => 'Money out',
- 'billsToPay' => 'Bills to pay',
- 'billsPaid' => 'Bills paid',
- 'viewDetails' => 'View details',
- 'divided' => 'divided',
- 'toDivide' => 'left to divide',
-
- // menu and titles, should be recycled as often as possible
- 'toggleNavigation' => 'Toggle navigation',
- 'currency' => 'Currency',
- 'preferences' => 'Preferences',
- 'logout' => 'Logout',
- 'searchPlaceholder' => 'Search...',
- 'dashboard' => 'Dashboard',
- 'currencies' => 'Currencies',
- 'accounts' => 'Accounts',
- 'Asset account' => 'Asset account',
- 'Default account' => 'Asset account',
- 'Expense account' => 'Expense account',
- 'Revenue account' => 'Revenue account',
- 'Initial balance account' => 'Initial balance account',
- 'budgets' => 'Budgets',
- 'tags' => 'Tags',
- 'reports' => 'Reports',
- 'transactions' => 'Transactions',
- 'expenses' => 'Expenses',
- 'income' => 'Revenue / income',
- 'transfers' => 'Transferts',
- 'moneyManagement' => 'Money management',
- 'piggyBanks' => 'Piggy banks',
- 'bills' => 'Bills',
- 'createNew' => 'Create new',
- 'withdrawal' => 'Withdrawal',
- 'deposit' => 'Deposit',
- 'account' => 'Account',
- 'transfer' => 'Transfer',
- 'Withdrawal' => 'Withdrawal',
- 'Deposit' => 'Deposit',
- 'Transfer' => 'Transfer',
- 'bill' => 'Bill',
- 'yes' => 'Yes',
- 'no' => 'No',
- 'amount' => 'Amount',
- 'newBalance' => 'New balance',
- 'overview' => 'Overview',
- 'saveOnAccount' => 'Save on account',
- 'unknown' => 'Unknown',
- 'daily' => 'Daily',
- 'weekly' => 'Weekly',
- 'monthly' => 'Monthly',
- 'quarterly' => 'Quarterly',
- 'half-year' => 'Every six months',
- 'yearly' => 'Yearly',
- 'profile' => 'Profile',
-
- // reports
- 'report_default' => 'Default financial report for :start until :end',
- 'quick_link_reports' => 'Quick links',
- 'quick_link_default_report' => 'Default financial report',
- 'report_this_month_quick' => 'Current month, all accounts',
- 'report_this_year_quick' => 'Current year, all accounts',
- 'report_all_time_quick' => 'All-time, all accounts',
- 'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
- 'incomeVsExpenses' => 'Income vs. expenses',
- 'accountBalances' => 'Account balances',
- 'balanceStartOfYear' => 'Balance at start of year',
- 'balanceEndOfYear' => 'Balance at end of year',
- 'balanceStartOfMonth' => 'Balance at start of month',
- 'balanceEndOfMonth' => 'Balance at end of month',
- 'balanceStart' => 'Balance at start of period',
- 'balanceEnd' => 'Balance at end of period',
- 'reportsOwnAccounts' => 'Reports for your own accounts',
- 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts',
- 'splitByAccount' => 'Split by account',
- 'balancedByTransfersAndTags' => 'Balanced by transfers and tags',
- 'coveredWithTags' => 'Covered with tags',
- 'leftUnbalanced' => 'Left unbalanced',
- 'expectedBalance' => 'Expected balance',
- 'outsideOfBudgets' => 'Outside of budgets',
- 'leftInBudget' => 'Left in budget',
- 'sumOfSums' => 'Sum of sums',
- 'noCategory' => '(no category)',
- 'notCharged' => 'Not charged (yet)',
- 'inactive' => 'Inactive',
- 'difference' => 'Difference',
- 'in' => 'In',
- 'out' => 'Out',
- 'topX' => 'top :number',
- 'showTheRest' => 'Show everything',
- 'hideTheRest' => 'Show only the top :number',
- 'sum_of_year' => 'Sum of year',
- 'sum_of_years' => 'Sum of years',
- 'average_of_year' => 'Average of year',
- 'average_of_years' => 'Average of years',
- 'categories_earned_in_year' => 'Categories (by earnings)',
- 'categories_spent_in_year' => 'Categories (by spendings)',
- 'report_type' => 'Report type',
- 'report_type_default' => 'Default financial report',
- 'report_included_accounts' => 'Included accounts',
- 'report_date_range' => 'Date range',
- 'report_include_help' => 'In all cases, transfers to shared accounts count as expenses, and transfers from shared accounts count as income.',
- 'report_preset_ranges' => 'Pre-set ranges',
- 'shared' => 'Shared',
-
- // charts
- 'dayOfMonth' => 'Day of the month',
- 'month' => 'Month',
- 'budget' => 'Budget',
- 'spent' => 'Spent',
- 'earned' => 'Earned',
- 'overspent' => 'Overspent',
- 'left' => 'Left',
- 'noBudget' => '(no budget)',
- 'maxAmount' => 'Maximum amount',
- 'minAmount' => 'Minumum amount',
- 'billEntry' => 'Current bill entry',
- 'name' => 'Name',
- 'date' => 'Date',
- 'paid' => 'Paid',
- 'unpaid' => 'Unpaid',
- 'day' => 'Day',
- 'budgeted' => 'Budgeted',
- 'period' => 'Period',
- 'balance' => 'Balance',
- 'summary' => 'Summary',
- 'sum' => 'Sum',
- 'average' => 'Average',
- 'balanceFor' => 'Balance for :name',
-
- // piggy banks
- 'piggy_bank' => 'Piggy bank',
- 'new_piggy_bank' => 'Create new piggy bank',
- 'store_piggy_bank' => 'Store new piggy bank',
- 'account_status' => 'Account status',
- 'left_for_piggy_banks' => 'Left for piggy banks',
- 'sum_of_piggy_banks' => 'Sum of piggy banks',
- 'saved_so_far' => 'Saved so far',
- 'left_to_save' => 'Left to save',
- 'add_money_to_piggy_title' => 'Add money to piggy bank ":name"',
- 'remove_money_from_piggy_title' => 'Remove money from piggy bank ":name"',
- 'add' => 'Add',
- 'remove' => 'Remove',
- 'max_amount_add' => 'The maximum amount you can add is',
- 'max_amount_remove' => 'The maximum amount you can remove is',
- 'update_piggy_button' => 'Update piggy bank',
- 'update_piggy_title' => 'Update piggy bank ":name"',
- 'details' => 'Details',
- 'events' => 'Events',
- 'target_amount' => 'Target amount',
- 'start_date' => 'Start date',
- 'target_date' => 'Target date',
- 'no_target_date' => 'No target date',
- 'todo' => 'to do',
- 'table' => 'Table',
- 'piggy_bank_not_exists' => 'Piggy bank no longer exists.',
- 'add_any_amount_to_piggy' => 'Add money to this piggy bank to reach your target of :amount.',
- 'add_set_amount_to_piggy' => 'Add :amount to fill this piggy bank on :date',
- 'delete_piggy_bank' => 'Delete piggy bank ":name"',
+ // piggy banks:
+ 'piggy_bank' => 'Piggy bank',
+ 'new_piggy_bank' => 'Create new piggy bank',
+ 'store_piggy_bank' => 'Store new piggy bank',
+ 'account_status' => 'Account status',
+ 'left_for_piggy_banks' => 'Left for piggy banks',
+ 'sum_of_piggy_banks' => 'Sum of piggy banks',
+ 'saved_so_far' => 'Saved so far',
+ 'left_to_save' => 'Left to save',
+ 'add_money_to_piggy_title' => 'Add money to piggy bank ":name"',
+ 'remove_money_from_piggy_title' => 'Remove money from piggy bank ":name"',
+ 'add' => 'Add',
+ 'remove' => 'Remove',
+ 'max_amount_add' => 'The maximum amount you can add is',
+ 'max_amount_remove' => 'The maximum amount you can remove is',
+ 'update_piggy_button' => 'Update piggy bank',
+ 'update_piggy_title' => 'Update piggy bank ":name"',
+ 'details' => 'Details',
+ 'events' => 'Events',
+ 'target_amount' => 'Target amount',
+ 'start_date' => 'Start date',
+ 'target_date' => 'Target date',
+ 'no_target_date' => 'No target date',
+ 'todo' => 'to do',
+ 'table' => 'Table',
+ 'piggy_bank_not_exists' => 'Piggy bank no longer exists.',
+ 'add_any_amount_to_piggy' => 'Add money to this piggy bank to reach your target of :amount.',
+ 'add_set_amount_to_piggy' => 'Add :amount to fill this piggy bank on :date',
+ 'delete_piggy_bank' => 'Delete piggy bank ":name"',
// tags
- 'regular_tag' => 'Just a regular tag.',
- 'balancing_act' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.',
- 'advance_payment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.',
-
- 'delete_tag' => 'Supprimer le tag ":tag"',
- 'new_tag' => 'Make new tag',
- 'edit_tag' => 'Editer le tag ":tag"',
- 'no_year' => 'No year set',
- 'no_month' => 'No month set',
- 'tag_title_nothing' => 'Default tags',
- 'tag_title_balancingAct' => 'Balancing act tags',
- 'tag_title_advancePayment' => 'Advance payment tags',
- 'tags_introduction' => 'Usually tags are singular words, designed to quickly band items together using things like expensive, bill or for-party. In Firefly III, tags can have more properties such as a date, description and location. This allows you to join transactions together in a more meaningful way. For example, you could make a tag called Christmas dinner with friends and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, perhaps with multiple transactions.',
- 'tags_group' => 'Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits are cancelling each other out (buying something with saved money). It\'s all up to you. Using tags the old-fashioned way is of course always possible. ',
- 'tags_start' => 'Create a tag to get started or enter tags when creating new transactions.',
+ 'regular_tag' => 'Just a regular tag.',
+ 'balancing_act' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.',
+ 'advance_payment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.',
+ 'delete_tag' => 'Supprimer le tag ":tag"',
+ 'new_tag' => 'Make new tag',
+ 'edit_tag' => 'Editer le tag ":tag"',
+ 'no_year' => 'No year set',
+ 'no_month' => 'No month set',
+ 'tag_title_nothing' => 'Default tags',
+ 'tag_title_balancingAct' => 'Balancing act tags',
+ 'tag_title_advancePayment' => 'Advance payment tags',
+ 'tags_introduction' => 'Usually tags are singular words, designed to quickly band items together using things like expensive, bill or for-party. In Firefly III, tags can have more properties such as a date, description and location. This allows you to join transactions together in a more meaningful way. For example, you could make a tag called Christmas dinner with friends and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, perhaps with multiple transactions.',
+ 'tags_group' => 'Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits are cancelling each other out (buying something with saved money). It\'s all up to you. Using tags the old-fashioned way is of course always possible.',
+ 'tags_start' => 'Create a tag to get started or enter tags when creating new transactions.',
];
diff --git a/resources/lang/fr_FR/form.php b/resources/lang/fr_FR/form.php
old mode 100644
new mode 100755
index 19b1512659..a572419aec
--- a/resources/lang/fr_FR/form.php
+++ b/resources/lang/fr_FR/form.php
@@ -2,33 +2,33 @@
return [
// new user:
- 'bank_name' => 'Bank name',
- 'bank_balance' => 'Balance',
- 'savings_balance' => 'Savings balance',
- 'credit_card_limit' => 'Credit card limit',
+ 'bank_name' => 'Nom de la banque',
+ 'bank_balance' => 'Solde',
+ 'savings_balance' => 'Solde de l\'épargne',
+ 'credit_card_limit' => 'Limite de carte de crédit',
'automatch' => 'Match automatically',
'skip' => 'Skip',
- 'name' => 'Name',
- 'active' => 'Active',
- 'amount_min' => 'Minimum amount',
- 'amount_max' => 'Maximum amount',
+ 'name' => 'Nom',
+ 'active' => 'Actif',
+ 'amount_min' => 'Montant minimum',
+ 'amount_max' => 'Montant maximum',
'match' => 'Matches on',
'repeat_freq' => 'Repeats',
- 'account_from_id' => 'From account',
- 'account_to_id' => 'To account',
+ 'account_from_id' => 'Compte d\'origine',
+ 'account_to_id' => 'Compte de destination',
'account_id' => 'Asset account',
'budget_id' => 'Budget',
- 'openingBalance' => 'Opening balance',
+ 'openingBalance' => 'Solde initial',
'tagMode' => 'Tag mode',
'tagPosition' => 'Tag location',
- 'virtualBalance' => 'Virtual balance',
+ 'virtualBalance' => 'Solde virtuel',
'longitude_latitude' => 'Location',
'targetamount' => 'Target amount',
'accountRole' => 'Account role',
'openingBalanceDate' => 'Opening balance date',
'ccType' => 'Credit card payment plan',
'ccMonthlyPaymentDate' => 'Credit card monthly payment date',
- 'piggy_bank_id' => 'Piggy bank',
+ 'piggy_bank_id' => 'Tirelire',
'returnHere' => 'Return here',
'returnHereExplanation' => 'After storing, return here to create another one.',
'returnHereUpdateExplanation' => 'After updating, return here.',
@@ -53,6 +53,7 @@ return [
'csv_config' => 'CSV import configuration',
'specifix' => 'Bank- or file specific fixes',
'csv_import_account' => 'Default import account',
+ 'csv_delimiter' => 'CSV field delimiter',
'attachments[]' => 'Attachments',
'store_new_withdrawal' => 'Store new withdrawal',
'store_new_deposit' => 'Store new deposit',
@@ -67,6 +68,13 @@ return [
'filename' => 'File name',
'mime' => 'Mime type',
'size' => 'Size',
+ 'trigger' => 'Trigger',
+ 'stop_processing' => 'Stop processing',
+
+ 'csv_comma' => 'A comma (,)',
+ 'csv_semicolon' => 'A semicolon (;)',
+ 'csv_tab' => 'A tab (invisible)',
+
'delete_account' => 'Delete account ":name"',
'delete_bill' => 'Supprimer la facture ":name"',
@@ -75,10 +83,14 @@ return [
'delete_currency' => 'Delete currency ":name"',
'delete_journal' => 'Delete transaction with description ":description"',
'delete_attachment' => 'Delete attachment ":name"',
+ 'delete_rule' => 'Delete rule ":title"',
+ 'delete_rule_group' => 'Delete rule group ":title"',
'attachment_areYouSure' => 'Are you sure you want to delete the attachment named ":name"?',
'account_areYouSure' => 'Are you sure you want to delete the account named ":name"?',
'bill_areYouSure' => 'Are you sure you want to delete the bill named ":name"?',
+ 'rule_areYouSure' => 'Are you sure you want to delete the rule titled ":title"?',
+ 'ruleGroup_areYouSure' => 'Are you sure you want to delete the rule group titled ":title"?',
'budget_areYouSure' => 'Are you sure you want to delete the budget named ":name"?',
'category_areYouSure' => 'Are you sure you want to delete the category named ":name"?',
'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?',
@@ -88,6 +100,7 @@ return [
'permDeleteWarning' => 'Deleting stuff from Firely is permanent and cannot be undone.',
'also_delete_transactions' => 'The only transaction connected to this account will be deleted as well.|All :count transactions connected to this account will be deleted as well.',
+ 'also_delete_rules' => 'The only rule connected to this rule group will be deleted as well.|All :count rules connected to this rule group will be deleted as well.',
'also_delete_piggyBanks' => 'The only piggy bank connected to this account will be deleted as well.|All :count piggy bank connected to this account will be deleted as well.',
'bill_keep_transactions' => 'The only transaction connected to this bill will not be deleted.|All :count transactions connected to this bill will spared deletion.',
'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will spared deletion.',
diff --git a/resources/lang/fr_FR/help.php b/resources/lang/fr_FR/help.php
old mode 100644
new mode 100755
index 75acf0fbdd..71f96fa6f2
--- a/resources/lang/fr_FR/help.php
+++ b/resources/lang/fr_FR/help.php
@@ -2,7 +2,7 @@
return [
// tour!
- 'main-content-title' => 'Welcome to Firefly III',
+ 'main-content-title' => 'Bienvenue sur Firefly III',
'main-content-text' => 'Do yourself a favor and follow this short guide to make sure you know your way around.',
'sidebar-toggle-title' => 'Sidebar to create stuff',
'sidebar-toggle-text' => 'Hidden under the plus icon are all the buttons to create new stuff. Accounts, transactions, everything!',
@@ -13,81 +13,72 @@ return [
'report-menu-title' => 'Rapport',
'report-menu-text' => 'Check this out when you want a solid overview of your fiances.',
'transaction-menu-title' => 'Transactions',
- 'transaction-menu-text' => 'All transactions you\'ve created can be found here.',
+ 'transaction-menu-text' => 'Toutes les transactions que vous avez créé peuvent être trouvées ici.',
'option-menu-title' => 'Options',
- 'option-menu-text' => 'This is pretty self-explanatory.',
- 'main-content-end-title' => 'The end!',
- 'main-content-end-text' => 'Remember that every page has a small question mark at the right top. Click it to get help about the page you\'re on.',
+ 'option-menu-text' => 'C\'est assez explicite.',
+ 'main-content-end-title' => 'Fin !',
+ 'main-content-end-text' => 'N\'oubliez pas que chaque page a un petit point d\'interrogation en haut à droite. Cliquez dessus pour obtenir de l\'aide concernant la page actuelle.',
- 'register' => 'register',
- 'index' => 'The main index',
- 'home' => 'home',
- 'flush' => 'flush',
- 'accounts-index' => 'accounts.index',
- 'accounts-create' => 'accounts.create',
- 'accounts-edit' => 'accounts.edit',
- 'accounts-delete' => 'accounts.delete',
- 'accounts-show' => 'accounts.show',
- 'bills-index' => 'bills.index',
- 'bills-rescan' => 'bills.rescan',
- 'bills-create' => 'bills.create',
- 'bills-edit' => 'bills.edit',
- 'bills-delete' => 'bills.delete',
- 'bills-show' => 'bills.show',
- 'budgets-index' => 'budgets.index',
- 'budgets-income' => 'budgets.income',
- 'budgets-create' => 'budgets.create',
- 'budgets-edit' => 'budgets.edit',
- 'budgets-delete' => 'budgets.delete',
- 'budgets-show' => 'budgets.show',
- 'budgets-noBudget' => 'budgets.noBudget',
- 'categories-index' => 'categories.index',
- 'categories-create' => 'categories.create',
- 'categories-edit' => 'categories.edit',
- 'categories-delete' => 'categories.delete',
- 'categories-show' => 'categories.show',
- 'categories-noCategory' => 'categories.noCategory',
- 'csv-index' => 'Upload and import a CSV file',
- 'currency-index' => 'currency.index',
- 'currency-create' => 'currency.create',
- 'currency-edit' => 'currency.edit',
- 'currency-delete' => 'currency.delete',
- 'currency-default' => 'currency.default',
- 'help-show' => 'help.show',
- 'json-expense-accounts' => 'json.expense-accounts',
- 'json-revenue-accounts' => 'json.revenue-accounts',
- 'json-categories' => 'json.categories',
- 'json-tags' => 'json.tags',
- 'json-box-in' => 'json.box.in',
- 'json-box-out' => 'json.box.out',
- 'json-box-paid' => 'json.box.paid',
- 'json-box-unpaid' => 'json.box.unpaid',
- 'new-user-index' => 'new-user.index',
- 'piggy-banks-index' => 'piggy-banks.index',
- 'piggy-banks-addMoney' => 'piggy-banks.addMoney',
- 'piggy-banks-removeMoney' => 'piggy-banks.removeMoney',
- 'piggy-banks-create' => 'piggy-banks.create',
- 'piggy-banks-edit' => 'piggy-banks.edit',
- 'piggy-banks-delete' => 'piggy-banks.delete',
- 'piggy-banks-show' => 'piggy-banks.show',
- 'preferences' => 'preferences',
- 'profile' => 'profile',
- 'profile-change-password' => 'profile.change-password',
- 'profile-delete-account' => 'profile.delete-account',
- 'reports-index' => 'reports.index',
- 'reports-year' => 'reports.year',
- 'reports-month' => 'reports.month',
- 'search' => 'search',
- 'tags-index' => 'tags.index',
- 'tags-create' => 'tags.create',
- 'tags-show' => 'tags.show',
- 'tags-edit' => 'tags.edit',
- 'tags-delete' => 'tags.delete',
- 'transactions-index' => 'transactions.index',
- 'transactions-create' => 'transactions.create',
- 'transactions-edit' => 'transactions.edit',
- 'transactions-delete' => 'transactions.delete',
- 'transactions-show' => 'transactions.show',
- 'logout' => 'logout',
+ 'index' => 'index',
+ 'home' => 'home',
+ 'accounts-index' => 'accounts.index',
+ 'accounts-create' => 'accounts.create',
+ 'accounts-edit' => 'accounts.edit',
+ 'accounts-delete' => 'accounts.delete',
+ 'accounts-show' => 'accounts.show',
+ 'attachments-edit' => 'attachments.edit',
+ 'attachments-delete' => 'attachments.delete',
+ 'attachments-show' => 'attachments.show',
+ 'attachments-preview' => 'attachments.preview',
+ 'bills-index' => 'bills.index',
+ 'bills-create' => 'bills.create',
+ 'bills-edit' => 'bills.edit',
+ 'bills-delete' => 'bills.delete',
+ 'bills-show' => 'bills.show',
+ 'budgets-index' => 'budgets.index',
+ 'budgets-create' => 'budgets.create',
+ 'budgets-edit' => 'budgets.edit',
+ 'budgets-delete' => 'budgets.delete',
+ 'budgets-show' => 'budgets.show',
+ 'budgets-noBudget' => 'budgets.noBudget',
+ 'categories-index' => 'categories.index',
+ 'categories-create' => 'categories.create',
+ 'categories-edit' => 'categories.edit',
+ 'categories-delete' => 'categories.delete',
+ 'categories-show' => 'categories.show',
+ 'categories-show-date' => 'categories.show.date',
+ 'categories-noCategory' => 'categories.noCategory',
+ 'csv-index' => 'csv.index',
+ 'csv-column-roles' => 'csv.column-roles',
+ 'csv-map' => 'csv.map',
+ 'csv-download-config-page' => 'csv.download-config-page',
+ 'csv-process' => 'csv.process',
+ 'currency-index' => 'currency.index',
+ 'currency-create' => 'currency.create',
+ 'currency-edit' => 'currency.edit',
+ 'currency-delete' => 'currency.delete',
+ 'new-user-index' => 'new-user.index',
+ 'piggy-banks-index' => 'piggy-banks.index',
+ 'piggy-banks-create' => 'piggy-banks.create',
+ 'piggy-banks-edit' => 'piggy-banks.edit',
+ 'piggy-banks-delete' => 'piggy-banks.delete',
+ 'piggy-banks-show' => 'piggy-banks.show',
+ 'preferences' => 'preferences',
+ 'profile' => 'profile',
+ 'profile-change-password' => 'profile.change-password',
+ 'profile-delete-account' => 'profile.delete-account',
+ 'reports-index' => 'reports.index',
+ 'reports-report' => 'reports.report',
+ 'search' => 'search',
+ 'tags-index' => 'tags.index',
+ 'tags-create' => 'tags.create',
+ 'tags-show' => 'tags.show',
+ 'tags-edit' => 'tags.edit',
+ 'tags-delete' => 'tags.delete',
+ 'transactions-index' => 'transactions.index',
+ 'transactions-create' => 'transactions.create',
+ 'transactions-edit' => 'transactions.edit',
+ 'transactions-delete' => 'transactions.delete',
+ 'transactions-show' => 'transactions.show',
];
diff --git a/resources/lang/fr_FR/list.php b/resources/lang/fr_FR/list.php
old mode 100644
new mode 100755
index 4bc0b61bc9..9d7fa6e86a
--- a/resources/lang/fr_FR/list.php
+++ b/resources/lang/fr_FR/list.php
@@ -3,15 +3,15 @@
// all table headers.
return [
- 'name' => 'Name',
- 'role' => 'Role',
- 'currentBalance' => 'Current balance',
- 'active' => 'Is active?',
- 'lastActivity' => 'Last activity',
- 'balanceDiff' => 'Balance difference between :start and :end',
+ 'name' => 'Nom',
+ 'role' => 'Rôle',
+ 'currentBalance' => 'Solde courant',
+ 'active' => 'Actif ?',
+ 'lastActivity' => 'Activité récente',
+ 'balanceDiff' => 'Difference solde entre :start et :end',
'matchedOn' => 'Matched on',
'matchesOn' => 'Matched on',
- 'matchingAmount' => 'Amount',
+ 'matchingAmount' => 'Montant',
'lastMatch' => 'Last match',
'expectedMatch' => 'Expected match',
'automatch' => 'Auto match?',
diff --git a/resources/lang/fr_FR/pagination.php b/resources/lang/fr_FR/pagination.php
old mode 100644
new mode 100755
index fcab34b253..e16f862ea6
--- a/resources/lang/fr_FR/pagination.php
+++ b/resources/lang/fr_FR/pagination.php
@@ -13,7 +13,7 @@ return [
|
*/
- 'previous' => '« Previous',
- 'next' => 'Next »',
+ 'previous' => '« Precedent',
+ 'next' => 'Suivant »',
];
diff --git a/resources/lang/fr_FR/passwords.php b/resources/lang/fr_FR/passwords.php
old mode 100644
new mode 100755
index 926c2b197d..5b2f00ff3a
--- a/resources/lang/fr_FR/passwords.php
+++ b/resources/lang/fr_FR/passwords.php
@@ -12,10 +12,11 @@ return [
|
*/
- "password" => "Passwords must be at least six characters and match the confirmation.",
- "user" => "We can't find a user with that e-mail address.",
- "token" => "This password reset token is invalid.",
- "sent" => "We have e-mailed your password reset link!",
- "reset" => "Your password has been reset!",
- 'blocked' => 'Nice try though.'
+ "password" => "Le mot de passe doit contenir au moins 6 caractères et correspondre à la confirmation.",
+ "user" => "Aucun utilisateur avec cette addresse email.",
+ "token" => "Le jeton de réinitialisation de mot de passe est invalide.",
+ "sent" => "Nous avons envoyé votre lien de réinitialisation de mot de passe!",
+ "reset" => "Le mot de passe a été réinitialisé!",
+ 'blocked' => 'Nice try though.',
+
];
diff --git a/resources/lang/fr_FR/validation.php b/resources/lang/fr_FR/validation.php
old mode 100644
new mode 100755
index fb45bf34d8..53c07b4811
--- a/resources/lang/fr_FR/validation.php
+++ b/resources/lang/fr_FR/validation.php
@@ -1,78 +1,69 @@
'This value is invalid for the selected trigger.',
+ 'rule_action_value' => 'This value is invalid for the selected action.',
'invalid_domain' => 'Due to security constraints, you cannot register from this domain.',
'file_already_attached' => 'Uploaded file ":name" is already attached to this object.',
'file_attached' => 'Succesfully uploaded file ":name".',
'file_invalid_mime' => 'File ":name" is of type ":mime" which is not accepted as a new upload.',
'file_too_large' => 'File ":name" is too large.',
- 'accepted' => 'Le champ :attribute doit être accepté.',
+ "accepted" => "Le champ :attribute doit être accepté.",
+ "active_url" => "Le champ :attribute n'est pas une URL valide.",
+ "after" => "Le champ :attribute doit être une date postérieure au :date.",
+ "alpha" => "Le champ :attribute doit seulement contenir des lettres.",
+ "alpha_dash" => "Le champ :attribute doit seulement contenir des lettres, des chiffres et des tirets.",
+ "alpha_num" => "Le champ :attribute doit seulement contenir des chiffres et des lettres.",
+ "array" => "Le champ :attribute doit être un tableau.",
"unique_for_user" => "There already is an entry with this :attribute.",
+ "before" => "Le champ :attribute doit être une date antérieure au :date.",
'unique_object_for_user' => 'This name is already in use',
'unique_account_for_user' => 'This account name is already in use',
- 'active_url' => "Le champ :attribute n'est pas une URL valide.",
- 'after' => 'Le champ :attribute doit être une date postérieure au :date.',
- 'alpha' => 'Le champ :attribute doit seulement contenir des lettres.',
- 'alpha_dash' => 'Le champ :attribute doit seulement contenir des lettres, des chiffres et des tirets.',
- 'alpha_num' => 'Le champ :attribute doit seulement contenir des chiffres et des lettres.',
- 'array' => 'Le champ :attribute doit être un tableau.',
- 'before' => 'Le champ :attribute doit être une date antérieure au :date.',
- 'between.numeric' => 'La valeur de :attribute doit être comprise entre :min et :max.',
- 'between.file' => 'Le fichier :attribute doit avoir une taille entre :min et :max kilo-octets.',
- 'between.string' => 'Le texte :attribute doit avoir entre :min et :max caractères.',
- 'between.array' => 'Le tableau :attribute doit avoir entre :min et :max éléments.',
- 'boolean' => 'Le champ :attribute doit être vrai ou faux.',
- 'confirmed' => 'Le champ de confirmation :attribute ne correspond pas.',
- 'date' => "Le champ :attribute n'est pas une date valide.",
- 'date_format' => 'Le champ :attribute ne correspond pas au format :format.',
- 'different' => 'Les champs :attribute et :other doivent être différents.',
- 'digits' => 'Le champ :attribute doit avoir :digits chiffres.',
- 'digits_between' => 'Le champ :attribute doit avoir entre :min et :max chiffres.',
- 'email' => 'Le champ :attribute doit être une adresse email valide.',
- 'exists' => 'Le champ :attribute sélectionné est invalide.',
- 'filled' => 'Le champ :attribute est obligatoire.',
- 'image' => 'Le champ :attribute doit être une image.',
- 'in' => 'Le champ :attribute est invalide.',
- 'integer' => 'Le champ :attribute doit être un entier.',
- 'ip' => 'Le champ :attribute doit être une adresse IP valide.',
+ "between.numeric" => "La valeur de :attribute doit être comprise entre :min et :max.",
+ "between.file" => "Le fichier :attribute doit avoir une taille entre :min et :max kilo-octets.",
+ "between.string" => "Le texte :attribute doit avoir entre :min et :max caractères.",
+ "between.array" => "Le tableau :attribute doit avoir entre :min et :max éléments.",
+ "boolean" => "Le champ :attribute doit être vrai ou faux.",
+ "confirmed" => "Le champ de confirmation :attribute ne correspond pas.",
+ "date" => "Le champ :attribute n'est pas une date valide.",
+ "date_format" => "Le champ :attribute ne correspond pas au format :format.",
+ "different" => "Les champs :attribute et :other doivent être différents.",
+ "digits" => "Le champ :attribute doit avoir :digits chiffres.",
+ "digits_between" => "Le champ :attribute doit avoir entre :min et :max chiffres.",
+ "email" => "Le champ :attribute doit être une adresse email valide.",
+ "filled" => "Le champ :attribute est obligatoire.",
+ "exists" => "Le champ :attribute sélectionné est invalide.",
+ "image" => "Le champ :attribute doit être une image.",
+ "in" => "Le champ :attribute est invalide.",
+ "integer" => "Le champ :attribute doit être un entier.",
+ "ip" => "Le champ :attribute doit être une adresse IP valide.",
'json' => 'Le champ :attribute doit être un document JSON valide.',
- 'max.numeric' => 'La valeur de :attribute ne peut être supérieure à :max.',
- 'max.file' => 'Le fichier :attribute ne peut être plus gros que :max kilo-octets.',
- 'max.string' => 'Le texte de :attribute ne peut contenir plus de :max caractères.',
- 'max.array' => 'Le tableau :attribute ne peut avoir plus de :max éléments.',
- 'mimes' => 'Le champ :attribute doit être un fichier de type : :values.',
- 'min.numeric' => 'La valeur de :attribute doit être supérieure à :min.',
- 'min.file' => 'Le fichier :attribute doit être plus gros que :min kilo-octets.',
- 'min.string' => 'Le texte :attribute doit contenir au moins :min caractères.',
- 'min.array' => 'Le tableau :attribute doit avoir au moins :min éléments.',
- 'not_in' => "Le champ :attribute sélectionné n'est pas valide.",
- 'numeric' => 'Le champ :attribute doit contenir un nombre.',
- 'regex' => 'Le format du champ :attribute est invalide.',
- 'required' => 'Le champ :attribute est obligatoire.',
- 'required_if' => 'Le champ :attribute est obligatoire quand la valeur de :other est :value.',
+ "max.numeric" => "La valeur de :attribute ne peut être supérieure à :max.",
+ "max.file" => "Le fichier :attribute ne peut être plus gros que :max kilo-octets.",
+ "max.string" => "Le texte de :attribute ne peut contenir plus de :max caractères.",
+ "max.array" => "Le tableau :attribute ne peut avoir plus de :max éléments.",
+ "mimes" => "Le champ :attribute doit être un fichier de type : :values.",
+ "min.numeric" => "La valeur de :attribute doit être supérieure à :min.",
+ "min.file" => "Le fichier :attribute doit être plus gros que :min kilo-octets.",
+ "min.string" => "Le texte :attribute doit contenir au moins :min caractères.",
+ "min.array" => "Le tableau :attribute doit avoir au moins :min éléments.",
+ "not_in" => "Le champ :attribute sélectionné n'est pas valide.",
+ "numeric" => "Le champ :attribute doit contenir un nombre.",
+ "regex" => "Le format du champ :attribute est invalide.",
+ "required" => "Le champ :attribute est obligatoire.",
+ "required_if" => "Le champ :attribute est obligatoire quand la valeur de :other est :value.",
'required_unless' => 'Le champ :attribute est obligatoire sauf si :other est :values.',
- 'required_with' => 'Le champ :attribute est obligatoire quand :values est présent.',
- 'required_with_all' => 'Le champ :attribute est obligatoire quand :values est présent.',
- 'required_without' => "Le champ :attribute est obligatoire quand :values n'est pas présent.",
- 'required_without_all' => "Le champ :attribute est requis quand aucun de :values n'est présent.",
- 'same' => 'Les champs :attribute et :other doivent être identiques.',
- 'size.numeric' => 'La valeur de :attribute doit être :size.',
- 'size.file' => 'La taille du fichier de :attribute doit être de :size kilo-octets.',
- 'size.string' => 'Le texte de :attribute doit contenir :size caractères.',
- 'size.array' => 'Le tableau :attribute doit contenir :size éléments.',
+ "required_with" => "Le champ :attribute est obligatoire quand :values est présent.",
+ "required_with_all" => "Le champ :attribute est obligatoire quand :values est présent.",
+ "required_without" => "Le champ :attribute est obligatoire quand :values n'est pas présent.",
+ "required_without_all" => "Le champ :attribute est requis quand aucun de :values n'est présent.",
+ "same" => "Les champs :attribute et :other doivent être identiques.",
+ "size.numeric" => "La valeur de :attribute doit être :size.",
+ "size.file" => "La taille du fichier de :attribute doit être de :size kilo-octets.",
+ "size.string" => "Le texte de :attribute doit contenir :size caractères.",
+ "size.array" => "Le tableau :attribute doit contenir :size éléments.",
+ "unique" => "La valeur du champ :attribute est déjà utilisée.",
'string' => 'Le champ :attribute doit être une chaîne de caractères.',
- 'timezone' => 'Le champ :attribute doit être un fuseau horaire valide.',
- 'unique' => 'La valeur du champ :attribute est déjà utilisée.',
- 'url' => "Le format de l'URL de :attribute n'est pas valide.",
+ "url" => "Le format de l'URL de :attribute n'est pas valide.",
+ "timezone" => "Le champ :attribute doit être un fuseau horaire valide.",
];
diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php
index 7644571945..3493ef0643 100755
--- a/resources/lang/nl_NL/firefly.php
+++ b/resources/lang/nl_NL/firefly.php
@@ -282,6 +282,7 @@ return [
'csv_specifix_RabobankDescription' => 'Vink dit aan als je Rabobank bestanden importeert.',
'csv_specifix_Dummy' => 'Dit vinkje doet niks (dummy).',
'csv_import_account_help' => 'Als jouw CSV bestand geen referenties bevat naar jouw rekening(en), geef dan hier aan om welke rekening het gaat.',
+ 'csv_delimiter_help' => 'Kies het veldscheidingsteken dat in het invoerbestand is gebruikt. Bij twijfel is de komma de veiligste optie.',
'csv_date_parse_error' => 'Firefly kan van ":value" geen datum maken, gegeven het formaat ":format". Weet je zeker dat je CSV goed is?',
// create new stuff:
diff --git a/resources/lang/nl_NL/form.php b/resources/lang/nl_NL/form.php
index d075a7693f..cce6489790 100755
--- a/resources/lang/nl_NL/form.php
+++ b/resources/lang/nl_NL/form.php
@@ -53,6 +53,7 @@ return [
'csv_config' => 'Configuratiebestand',
'specifix' => 'Bank- or of bestandsspecifieke opties',
'csv_import_account' => 'Standaard rekening voor importeren',
+ 'csv_delimiter' => 'CSV scheidingsteken',
'attachments[]' => 'Bijlagen',
'store_new_withdrawal' => 'Nieuwe uitgave opslaan',
'store_new_deposit' => 'Nieuwe inkomsten opslaan',
@@ -70,6 +71,10 @@ return [
'trigger' => 'Trigger',
'stop_processing' => 'Stop met verwerken',
+ 'csv_comma' => 'Een komma (,)',
+ 'csv_semicolon' => 'Een puntkomma (;)',
+ 'csv_tab' => 'Een tab (onzichtbaar)',
+
'delete_account' => 'Verwijder rekening ":name"',
'delete_bill' => 'Verwijder contract ":name"',
diff --git a/resources/lang/nl_NL/passwords.php b/resources/lang/nl_NL/passwords.php
index 6b189b754b..fc84b44aa5 100755
--- a/resources/lang/nl_NL/passwords.php
+++ b/resources/lang/nl_NL/passwords.php
@@ -17,6 +17,6 @@ return [
"token" => "Ongeldig token! Sorry",
"sent" => "Je krijgt een mailtje met een linkje om je wachtwoord te herstellen!",
"reset" => "Je wachtwoord is hersteld!",
- 'blocked' => 'Leuk geprobeerd wel.'
+ 'blocked' => 'Leuk geprobeerd wel.',
];
diff --git a/resources/lang/pt_BR/breadcrumbs.php b/resources/lang/pt_BR/breadcrumbs.php
old mode 100644
new mode 100755
diff --git a/resources/lang/pt_BR/config.php b/resources/lang/pt_BR/config.php
old mode 100644
new mode 100755
diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php
old mode 100644
new mode 100755
index 23584f877e..fedd465573
--- a/resources/lang/pt_BR/firefly.php
+++ b/resources/lang/pt_BR/firefly.php
@@ -2,476 +2,581 @@
return [
// general stuff:
- 'test' => 'Você selecionou Inglês',
- 'close' => 'Fechar',
- 'pleaseHold' => 'Por favor espere...',
- 'actions' => 'Ações',
- 'edit' => 'Editar',
- 'delete' => 'Apagar',
- 'welcomeBack' => 'What\'s playing?',
- 'everything' => 'Tudo',
- 'customRange' => 'Intervalo Personalizado',
- 'apply' => 'Aplicar',
- 'cancel' => 'Cancelar',
- 'from' => 'De',
- 'to' => 'Até',
- 'total_sum' => 'Soma Total',
- 'period_sum' => 'Soma por período',
- 'showEverything' => 'Mostrar tudo',
- 'never' => 'Never',
- 'search_results_for' => 'Pesquisar resultados por ":query"',
- 'bounced_error' => 'A mensagem enviado para :email ressaltado, não tem acesso para você.',
- 'deleted_error' => 'Estas credenciais não correspondem aos nossos registros.',
- 'general_blocked_error' => 'Sua conta foi desativada, você não pode entrar.',
- 'removed_amount' => ':amount removido',
- 'added_amount' => ':amount adicionada',
- 'asset_account_role_help' => 'Quaisquer opções extras resultantes da sua escolha pode ser definido mais tarde.',
- 'Opening balance' => 'Saldo inicial',
- 'create_new_stuff' => 'Criar novas coisas',
- 'new_withdrawal' => 'Nova retirada',
- 'new_deposit' => 'Novo depósito',
- 'new_transfer' => 'Nova transferência',
- 'new_asset_account' => 'Nova conta de ativo',
- 'new_expense_account' => 'Nova conta de despesa',
- 'new_revenue_account' => 'Nova conta de receita',
- 'new_budget' => 'Novo orçamento',
- 'new_bill' => 'Nova fatura',
+ 'language_incomplete' => 'This language is not yet fully translated',
+ 'test' => 'Você selecionou Inglês',
+ 'close' => 'Fechar',
+ 'pleaseHold' => 'Por favor espere...',
+ 'actions' => 'Ações',
+ 'edit' => 'Editar',
+ 'delete' => 'Apagar',
+ 'welcomeBack' => 'What\'s playing?',
+ 'everything' => 'Tudo',
+ 'customRange' => 'Intervalo Personalizado',
+ 'apply' => 'Aplicar',
+ 'cancel' => 'Cancelar',
+ 'from' => 'De',
+ 'to' => 'Até',
+ 'total_sum' => 'Soma Total',
+ 'period_sum' => 'Soma por período',
+ 'showEverything' => 'Mostrar tudo',
+ 'never' => 'Never',
+ 'search_results_for' => 'Pesquisar resultados por ":query"',
+ 'bounced_error' => 'A mensagem enviado para :email ressaltado, não tem acesso para você.',
+ 'deleted_error' => 'Estas credenciais não correspondem aos nossos registros.',
+ 'general_blocked_error' => 'Sua conta foi desativada, você não pode entrar.',
+ 'removed_amount' => ':amount removido',
+ 'added_amount' => ':amount adicionada',
+ 'asset_account_role_help' => 'Quaisquer opções extras resultantes da sua escolha pode ser definido mais tarde.',
+ 'Opening balance' => 'Saldo inicial',
+ 'create_new_stuff' => 'Criar novas coisas',
+ 'new_withdrawal' => 'Nova retirada',
+ 'new_deposit' => 'Novo depósito',
+ 'new_transfer' => 'Nova transferência',
+ 'new_asset_account' => 'Nova conta de ativo',
+ 'new_expense_account' => 'Nova conta de despesa',
+ 'new_revenue_account' => 'Nova conta de receita',
+ 'new_budget' => 'Novo orçamento',
+ 'new_bill' => 'Nova fatura',
+
+ // rules
+ 'rules' => 'Rules',
+ 'rules_explanation' => 'Here you can manage rules. Rules are triggered when a transaction is created or updated. Then, if the transaction has certain properties (called "triggers") Firefly will execute the "actions". Combined, you can make Firefly respond in a certain way to new transactions.',
+ 'rule_name' => 'Name of rule',
+ 'rule_triggers' => 'Rule triggers when',
+ 'rule_actions' => 'Rule will',
+ 'new_rule' => 'New rule',
+ 'new_rule_group' => 'New rule group',
+ 'rule_priority_up' => 'Give rule more priority',
+ 'rule_priority_down' => 'Give rule less priority',
+ 'make_new_rule_group' => 'Make new rule group',
+ 'store_new_rule_group' => 'Store new rule group',
+ 'created_new_rule_group' => 'New rule group ":title" stored!',
+ 'updated_rule_group' => 'Successfully updated rule group ":title".',
+ 'edit_rule_group' => 'Edit rule group ":title"',
+ 'delete_rule_group' => 'Delete rule group ":title"',
+ 'deleted_rule_group' => 'Deleted rule group ":title"',
+ 'update_rule_group' => 'Update rule group',
+ 'no_rules_in_group' => 'There are no rules in this group',
+ 'move_rule_group_up' => 'Move rule group up',
+ 'move_rule_group_down' => 'Move rule group down',
+ 'save_rules_by_moving' => 'Save these rule(s) by moving them to another rule group:',
+ 'make_new_rule' => 'Make new rule in rule group ":title"',
+ 'rule_help_stop_processing' => 'When you check this box, later rules in this group will not be executed.',
+ 'rule_help_active' => 'Inactive rules will never fire.',
+ 'stored_new_rule' => 'Stored new rule with title ":title"',
+ 'deleted_rule' => 'Deleted rule with title ":title"',
+ 'store_new_rule' => 'Store new rule',
+ 'updated_rule' => 'Updated rule with title ":title"',
+
+ 'trigger' => 'Trigger',
+ 'trigger_value' => 'Trigger on value',
+ 'stop_processing_other_triggers' => 'Stop processing other triggers',
+ 'add_rule_trigger' => 'Add new trigger',
+ 'action' => 'Action',
+ 'action_value' => 'Action value',
+ 'stop_executing_other_actions' => 'Stop executing other actions',
+ 'add_rule_action' => 'Add new action',
+ 'edit_rule' => 'Edit rule ":title"',
+ 'update_rule' => 'Update rule',
+
+ // actions and triggers
+ 'rule_trigger_user_action' => 'User action is ":trigger_value"',
+ 'rule_trigger_from_account_starts' => 'Source account starts with ":trigger_value"',
+ 'rule_trigger_from_account_ends' => 'Source account ends with ":trigger_value"',
+ 'rule_trigger_from_account_is' => 'Source account is ":trigger_value"',
+ 'rule_trigger_from_account_contains' => 'Source account contains ":trigger_value"',
+ 'rule_trigger_to_account_starts' => 'Destination account starts with ":trigger_value"',
+ 'rule_trigger_to_account_ends' => 'Destination account ends with ":trigger_value"',
+ 'rule_trigger_to_account_is' => 'Destination account is ":trigger_value"',
+ 'rule_trigger_to_account_contains' => 'Destination account contains ":trigger_value"',
+ 'rule_trigger_transaction_type' => 'Transaction is of type ":trigger_value"',
+ 'rule_trigger_amount_less' => 'Amount is less than :trigger_value',
+ 'rule_trigger_amount_exactly' => 'Amount is :trigger_value',
+ 'rule_trigger_amount_more' => 'Amount is more than :trigger_value',
+ 'rule_trigger_description_starts' => 'Description starts with ":trigger_value"',
+ 'rule_trigger_description_ends' => 'Description ends with ":trigger_value"',
+ 'rule_trigger_description_contains' => 'Description contains ":trigger_value"',
+ 'rule_trigger_description_is' => 'Description is ":trigger_value"',
+
+ 'rule_trigger_from_account_starts_choice' => 'Source account starts with..',
+ 'rule_trigger_from_account_ends_choice' => 'Source account ends with..',
+ 'rule_trigger_from_account_is_choice' => 'Source account is..',
+ 'rule_trigger_from_account_contains_choice' => 'Source account contains..',
+ 'rule_trigger_to_account_starts_choice' => 'Destination account starts with..',
+ 'rule_trigger_to_account_ends_choice' => 'Destination account ends with..',
+ 'rule_trigger_to_account_is_choice' => 'Destination account is..',
+ 'rule_trigger_to_account_contains_choice' => 'Destination account contains..',
+ 'rule_trigger_transaction_type_choice' => 'Transaction is of type..',
+ 'rule_trigger_amount_less_choice' => 'Amount is less than..',
+ 'rule_trigger_amount_exactly_choice' => 'Amount is..',
+ 'rule_trigger_amount_more_choice' => 'Amount is more than..',
+ 'rule_trigger_description_starts_choice' => 'Description starts with..',
+ 'rule_trigger_description_ends_choice' => 'Description ends with..',
+ 'rule_trigger_description_contains_choice' => 'Description contains..',
+ 'rule_trigger_description_is_choice' => 'Description is..',
+
+ 'rule_trigger_store_journal' => 'When a journal is created',
+ 'rule_trigger_update_journal' => 'When a journal is updated',
+
+ 'rule_action_set_category' => 'Set category to ":action_value"',
+ 'rule_action_clear_category' => 'Clear category',
+ 'rule_action_set_budget' => 'Set budget to ":action_value"',
+ 'rule_action_clear_budget' => 'Clear budget',
+ 'rule_action_add_tag' => 'Add tag ":action_value"',
+ 'rule_action_remove_tag' => 'Remove tag ":action_value"',
+ 'rule_action_remove_all_tags' => 'Remove all tags',
+ 'rule_action_set_description' => 'Set description to ":action_value"',
+ 'rule_action_append_description' => 'Append description with ":action_value"',
+ 'rule_action_prepend_description' => 'Prepend description with ":action_value"',
+
+ 'rule_action_set_category_choice' => 'Set category to..',
+ 'rule_action_clear_category_choice' => 'Clear any category',
+ 'rule_action_set_budget_choice' => 'Set budget to..',
+ 'rule_action_clear_budget_choice' => 'Clear any budget',
+ 'rule_action_add_tag_choice' => 'Add tag..',
+ 'rule_action_remove_tag_choice' => 'Remove tag..',
+ 'rule_action_remove_all_tags_choice' => 'Remove all tags',
+ 'rule_action_set_description_choice' => 'Set description to..',
+ 'rule_action_append_description_choice' => 'Append description with..',
+ 'rule_action_prepend_description_choice' => 'Prepend description with..',
// tags
- 'store_new_tag' => 'Armazenar nova tag',
- 'update_tag' => 'Atualizar tag',
- 'no_location_set' => 'Nenhuma localização.',
- 'meta_data' => 'Meta dados',
- 'location' => 'Localização',
+ 'store_new_tag' => 'Armazenar nova tag',
+ 'update_tag' => 'Atualizar tag',
+ 'no_location_set' => 'Nenhuma localização.',
+ 'meta_data' => 'Meta dados',
+ 'location' => 'Localização',
// preferences
- 'pref_home_screen_accounts' => 'Conta da tela inicial',
- 'pref_home_screen_accounts_help' => 'Que conta deve ser exibida na tela inicial?',
- 'pref_budget_settings' => 'Definições de Orçamento',
- 'pref_budget_settings_help' => 'Qual a quantidade máxima de dinheiro um envelope orçamental pode conter?',
- 'pref_view_range' => 'Ver intervalo',
- 'pref_view_range_help' => 'Alguns gráficos são agrupados automaticamente em períodos. Qual período você prefere?',
- 'pref_1D' => 'Um dia',
- 'pref_1W' => 'Uma semana',
- 'pref_1M' => 'Um mês',
- 'pref_3M' => 'Trimestral',
- 'pref_6M' => 'Semestral',
- 'pref_languages' => 'Idiomas',
- 'pref_languages_help' => 'Firefly III suporta muitos idiomas. Qual você prefere?',
- 'pref_save_settings' => 'Salvar definições',
+ 'pref_home_screen_accounts' => 'Conta da tela inicial',
+ 'pref_home_screen_accounts_help' => 'Que conta deve ser exibida na tela inicial?',
+ 'pref_budget_settings' => 'Definições de Orçamento',
+ 'pref_budget_settings_help' => 'Qual a quantidade máxima de dinheiro um envelope orçamental pode conter?',
+ 'pref_view_range' => 'Ver intervalo',
+ 'pref_view_range_help' => 'Alguns gráficos são agrupados automaticamente em períodos. Qual período você prefere?',
+ 'pref_1D' => 'Um dia',
+ 'pref_1W' => 'Uma semana',
+ 'pref_1M' => 'Um mês',
+ 'pref_3M' => 'Trimestral',
+ 'pref_6M' => 'Semestral',
+ 'pref_languages' => 'Idiomas',
+ 'pref_languages_help' => 'Firefly III suporta muitos idiomas. Qual você prefere?',
+ 'pref_save_settings' => 'Salvar definições',
// profile:
- 'change_your_password' => 'Alterar sua senha',
- 'delete_account' => 'Apagar conta',
- 'current_password' => 'Senha atual',
- 'new_password' => 'Nova senha',
- 'new_password_again' => 'Nova senha (novamente)',
- 'delete_your_account' => 'Apagar sua conta',
- 'delete_your_account_help' => 'Deleting your account will also delete any accounts, transactions, anything you might have saved into Firefly III. It\'ll be GONE.',
- 'delete_your_account_password' => 'Coloque sua senha para continuar.',
- 'password' => 'Senha',
- 'are_you_sure' => 'Você tem certeza? Você não poderá desfazer isso.',
- 'delete_account_button' => 'Apagar sua conta',
- 'invalid_current_password' => 'Senha atual inválida!',
- 'password_changed' => 'Senha alterada!',
- 'should_change' => 'A idéia é alterar sua senha.',
- 'invalid_password' => 'Senha inválida!',
+ 'change_your_password' => 'Alterar sua senha',
+ 'delete_account' => 'Apagar conta',
+ 'current_password' => 'Senha atual',
+ 'new_password' => 'Nova senha',
+ 'new_password_again' => 'Nova senha (novamente)',
+ 'delete_your_account' => 'Apagar sua conta',
+ 'delete_your_account_help' => 'Deleting your account will also delete any accounts, transactions, anything you might have saved into Firefly III. It\'ll be GONE.',
+ 'delete_your_account_password' => 'Coloque sua senha para continuar.',
+ 'password' => 'Senha',
+ 'are_you_sure' => 'Você tem certeza? Você não poderá desfazer isso.',
+ 'delete_account_button' => 'Apagar sua conta',
+ 'invalid_current_password' => 'Senha atual inválida!',
+ 'password_changed' => 'Senha alterada!',
+ 'should_change' => 'A idéia é alterar sua senha.',
+ 'invalid_password' => 'Senha inválida!',
// attachments
- 'nr_of_attachments' => 'Um anexo|:count anexos',
- 'attachments' => 'Anexos',
- 'edit_attachment' => 'Editar anexo ":name"',
- 'update_attachment' => 'Atualizar anexo',
- 'delete_attachment' => 'Apagar anexo ":name"',
- 'attachment_deleted' => 'Anexo apagado ":name"',
- 'upload_max_file_size' => 'Tamanho máximo do arquivo: :size',
+ 'nr_of_attachments' => 'Um anexo|:count anexos',
+ 'attachments' => 'Anexos',
+ 'edit_attachment' => 'Editar anexo ":name"',
+ 'update_attachment' => 'Atualizar anexo',
+ 'delete_attachment' => 'Apagar anexo ":name"',
+ 'attachment_deleted' => 'Anexo apagado ":name"',
+ 'upload_max_file_size' => 'Tamanho máximo do arquivo: :size',
// tour:
- 'prev' => 'Anterior',
- 'next' => 'Próximo',
- 'end-tour' => 'Fim do Tour',
- 'pause' => 'Parar',
+ 'prev' => 'Anterior',
+ 'next' => 'Próximo',
+ 'end-tour' => 'Fim do Tour',
+ 'pause' => 'Parar',
// transaction index
- 'title_expenses' => 'Despesas',
- 'title_withdrawal' => 'Despesas',
- 'title_revenue' => 'Receitas / Renda',
- 'title_deposit' => 'Receita / Renda',
- 'title_transfer' => 'Transferências',
- 'title_transfers' => 'Transferências',
+ 'title_expenses' => 'Despesas',
+ 'title_withdrawal' => 'Despesas',
+ 'title_revenue' => 'Receitas / Renda',
+ 'title_deposit' => 'Receita / Renda',
+ 'title_transfer' => 'Transferências',
+ 'title_transfers' => 'Transferências',
// csv import:
- 'csv_import' => 'Importar arquivo CSV',
- 'csv' => 'CSV',
- 'csv_index_title' => 'Carregar e importar um arquivo CSV',
- 'csv_define_column_roles' => 'Definir papeis da coluna',
- 'csv_map_values' => 'Valores mapeados encontrados para valores existentes',
- 'csv_download_config' => 'Download do arquivo CSV de configuração.',
- 'csv_index_text' => 'This form allows you to import a CSV file with transactions into Firefly. It is based on the excellent CSV importer made by the folks at Atlassian. Simply upload your CSV file and follow the instructions. If you would like to learn more, please click on the button at the top of this page.',
- 'csv_index_beta_warning' => 'Esta ferramenta está em beta. Por favor proceder com cautela',
- 'csv_header_help' => 'Check this box when your CSV file\'s first row consists of column names, not actual data',
- 'csv_date_help' => 'Date time format in your CSV. Follow the format like this page indicates. The default value will parse dates that look like this: :dateExample.',
- 'csv_csv_file_help' => 'Select the CSV file here. You can only upload one file at a time',
- 'csv_csv_config_file_help' => 'Select your CSV import configuration here. If you do not know what this is, ignore it. It will be explained later.',
- 'csv_upload_button' => 'Iniciando importação do CSV',
- 'csv_column_roles_title' => 'Definir papeis da coluna',
- 'csv_column_roles_text' => 'Firefly does not know what each column means. You need to indicate what every column is. Please check out the example data if you\'re not sure yourself. Click on the question mark (top right of the page) to learn what each column means. If you want to map imported data onto existing data in Firefly, use the checkbox. The next step will show you what this button does.',
- 'csv_column_roles_table' => 'Papéis da Coluna',
- 'csv_column' => 'Coluna CSV',
- 'csv_column_name' => 'Nome da coluna do CSV',
- 'csv_column_example' => 'Exemplo de dados da coluna',
- 'csv_column_role' => 'Coluna contém?',
- 'csv_do_map_value' => 'Valor mapeado?',
- 'csv_continue' => 'Continuar para o próximo passo',
- 'csv_go_back' => 'Voltar para o passo anterior',
- 'csv_map_title' => 'Valores mapeados encontrados para valores existentes',
- 'csv_map_text' => 'This page allows you to map the values from the CSV file to existing entries in your database. This ensures that accounts and other things won\'t be created twice.',
- 'csv_field_value' => 'Valor do campo do CSV',
- 'csv_field_mapped_to' => 'Deve ser mapeado para...',
- 'csv_do_not_map' => 'Não mapear este valor',
- 'csv_download_config_title' => 'Download do CSV de configuração ',
- 'csv_download_config_text' => 'Everything you\'ve just set up can be downloaded as a configuration file. Click the button to do so.',
- 'csv_more_information_text' => 'If the import fails, you can use this configuration file so you don\'t have to start all over again. But, if the import succeeds, it will be easier to upload similar CSV files.',
- 'csv_do_download_config' => 'Download do arquivo de configuração.',
- 'csv_empty_description' => '(descrição vazia)',
- 'csv_upload_form' => 'Formulário de Upload do CSV',
- 'csv_index_unsupported_warning' => 'O importador de CSV está incapaz de fazer o seguinte:',
- 'csv_unsupported_map' => 'The importer cannot map the column ":columnRole" to existing values in the database.',
- 'csv_unsupported_value' => 'The importer does not know how to handle values in columns marked as ":columnRole".',
- 'csv_cannot_store_value' => 'The importer has not reserved space for columns marked ":columnRole" and will be incapable of processing them.',
- 'csv_process_title' => 'Importação do CSV terminou!',
- 'csv_process_text' => 'O importador do CSV terminou e processou :rows linhas',
- 'csv_row' => 'Linha',
- 'csv_import_with_errors' => 'Houve um erro.|Houve :errors erros.',
- 'csv_error_see_logs' => 'Verifique o arquivo de log para ver detalhes.',
- 'csv_process_new_entries' => 'Firefly criou :imported nova(s) transação(ões)',
- 'csv_start_over' => 'Importar novamente',
- 'csv_to_index' => 'Voltar para tela inicial',
- 'csv_upload_not_writeable' => 'Cannot write to the path mentioned here. Cannot upload',
- 'csv_column__ignore' => '(ignorar esta coluna)',
- 'csv_column_account-iban' => 'Conta de Ativo (IBAN)',
- 'csv_column_account-id' => 'ID da Conta de Ativo (correspondente Firefly)',
- 'csv_column_account-name' => 'Conta de Ativo (nome)',
- 'csv_column_amount' => 'Valor',
- 'csv_column_bill-id' => 'ID Fatura (correspondente Firefly)',
- 'csv_column_bill-name' => 'Nom da Fatura',
- 'csv_column_budget-id' => 'ID do Orçamento (correspondente Firefly)',
- 'csv_column_budget-name' => 'Nome do Orçamento',
- 'csv_column_category-id' => 'ID da Categoria (correspondente Firefly)',
- 'csv_column_category-name' => 'Nome da Categoria',
- 'csv_column_currency-code' => 'Código da Moeda (ISO 4217)',
- 'csv_column_currency-id' => 'ID da Moeda (correspondente Firefly)',
- 'csv_column_currency-name' => 'Nome da Moeda (correspondente Firefly)',
- 'csv_column_currency-symbol' => 'Símbolo da Moeda (correspondente Firefly)',
- 'csv_column_date-rent' => 'Rent calculation date',
- 'csv_column_date-transaction' => 'Data',
- 'csv_column_description' => 'Descrição',
- 'csv_column_opposing-iban' => 'Opposing account (IBAN)',
- 'csv_column_opposing-id' => 'Opposing account ID (matching Firefly)',
- 'csv_column_opposing-name' => 'Opposing account (name)',
- 'csv_column_rabo-debet-credit' => 'Rabobank specific debet/credit indicator',
- 'csv_column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID',
- 'csv_column_sepa-ct-op' => 'SEPA Credit Transfer opposing account',
- 'csv_column_sepa-db' => 'SEPA Direct Debet',
- 'csv_column_tags-comma' => 'Tags (separadas por vírgula)',
- 'csv_column_tags-space' => 'Tags (separadas por espaço)',
- 'csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.',
- 'csv_specifix_Dummy' => 'Checking this has no effect whatsoever.',
- 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',
- 'csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',
+ 'csv_import' => 'Importar arquivo CSV',
+ 'csv' => 'CSV',
+ 'csv_index_title' => 'Carregar e importar um arquivo CSV',
+ 'csv_define_column_roles' => 'Definir papeis da coluna',
+ 'csv_map_values' => 'Valores mapeados encontrados para valores existentes',
+ 'csv_download_config' => 'Download do arquivo CSV de configuração.',
+ 'csv_index_text' => 'This form allows you to import a CSV file with transactions into Firefly. It is based on the excellent CSV importer made by the folks at Atlassian. Simply upload your CSV file and follow the instructions. If you would like to learn more, please click on the button at the top of this page.',
+ 'csv_index_beta_warning' => 'Esta ferramenta está em beta. Por favor proceder com cautela',
+ 'csv_header_help' => 'Check this box when your CSV file\'s first row consists of column names, not actual data',
+ 'csv_date_help' => 'Date time format in your CSV. Follow the format like this page indicates. The default value will parse dates that look like this: :dateExample.',
+ 'csv_csv_file_help' => 'Select the CSV file here. You can only upload one file at a time',
+ 'csv_csv_config_file_help' => 'Select your CSV import configuration here. If you do not know what this is, ignore it. It will be explained later.',
+ 'csv_upload_button' => 'Iniciando importação do CSV',
+ 'csv_column_roles_title' => 'Definir papeis da coluna',
+ 'csv_column_roles_text' => 'Firefly does not know what each column means. You need to indicate what every column is. Please check out the example data if you\'re not sure yourself. Click on the question mark (top right of the page) to learn what each column means. If you want to map imported data onto existing data in Firefly, use the checkbox. The next step will show you what this button does.',
+ 'csv_column_roles_table' => 'Papéis da Coluna',
+ 'csv_column' => 'Coluna CSV',
+ 'csv_column_name' => 'Nome da coluna do CSV',
+ 'csv_column_example' => 'Exemplo de dados da coluna',
+ 'csv_column_role' => 'Coluna contém?',
+ 'csv_do_map_value' => 'Valor mapeado?',
+ 'csv_continue' => 'Continuar para o próximo passo',
+ 'csv_go_back' => 'Voltar para o passo anterior',
+ 'csv_map_title' => 'Valores mapeados encontrados para valores existentes',
+ 'csv_map_text' => 'This page allows you to map the values from the CSV file to existing entries in your database. This ensures that accounts and other things won\'t be created twice.',
+ 'csv_field_value' => 'Valor do campo do CSV',
+ 'csv_field_mapped_to' => 'Deve ser mapeado para...',
+ 'csv_do_not_map' => 'Não mapear este valor',
+ 'csv_download_config_title' => 'Download do CSV de configuração ',
+ 'csv_download_config_text' => 'Everything you\'ve just set up can be downloaded as a configuration file. Click the button to do so.',
+ 'csv_more_information_text' => 'If the import fails, you can use this configuration file so you don\'t have to start all over again. But, if the import succeeds, it will be easier to upload similar CSV files.',
+ 'csv_do_download_config' => 'Download do arquivo de configuração.',
+ 'csv_empty_description' => '(descrição vazia)',
+ 'csv_upload_form' => 'Formulário de Upload do CSV',
+ 'csv_index_unsupported_warning' => 'O importador de CSV está incapaz de fazer o seguinte:',
+ 'csv_unsupported_map' => 'The importer cannot map the column ":columnRole" to existing values in the database.',
+ 'csv_unsupported_value' => 'The importer does not know how to handle values in columns marked as ":columnRole".',
+ 'csv_cannot_store_value' => 'The importer has not reserved space for columns marked ":columnRole" and will be incapable of processing them.',
+ 'csv_process_title' => 'Importação do CSV terminou!',
+ 'csv_process_text' => 'O importador do CSV terminou e processou :rows linhas',
+ 'csv_row' => 'Linha',
+ 'csv_import_with_errors' => 'Houve um erro.|Houve :errors erros.',
+ 'csv_error_see_logs' => 'Verifique o arquivo de log para ver detalhes.',
+ 'csv_process_new_entries' => 'Firefly criou :imported nova(s) transação(ões)',
+ 'csv_start_over' => 'Importar novamente',
+ 'csv_to_index' => 'Voltar para tela inicial',
+ 'csv_upload_not_writeable' => 'Cannot write to the path mentioned here. Cannot upload',
+ 'csv_column__ignore' => '(ignorar esta coluna)',
+ 'csv_column_account-iban' => 'Conta de Ativo (IBAN)',
+ 'csv_column_account-id' => 'ID da Conta de Ativo (correspondente Firefly)',
+ 'csv_column_account-name' => 'Conta de Ativo (nome)',
+ 'csv_column_amount' => 'Valor',
+ 'csv_column_bill-id' => 'ID Fatura (correspondente Firefly)',
+ 'csv_column_bill-name' => 'Nom da Fatura',
+ 'csv_column_budget-id' => 'ID do Orçamento (correspondente Firefly)',
+ 'csv_column_budget-name' => 'Nome do Orçamento',
+ 'csv_column_category-id' => 'ID da Categoria (correspondente Firefly)',
+ 'csv_column_category-name' => 'Nome da Categoria',
+ 'csv_column_currency-code' => 'Código da Moeda (ISO 4217)',
+ 'csv_column_currency-id' => 'ID da Moeda (correspondente Firefly)',
+ 'csv_column_currency-name' => 'Nome da Moeda (correspondente Firefly)',
+ 'csv_column_currency-symbol' => 'Símbolo da Moeda (correspondente Firefly)',
+ 'csv_column_date-rent' => 'Rent calculation date',
+ 'csv_column_date-transaction' => 'Data',
+ 'csv_column_description' => 'Descrição',
+ 'csv_column_opposing-iban' => 'Opposing account (IBAN)',
+ 'csv_column_opposing-id' => 'Opposing account ID (matching Firefly)',
+ 'csv_column_opposing-name' => 'Opposing account (name)',
+ 'csv_column_rabo-debet-credit' => 'Rabobank specific debet/credit indicator',
+ 'csv_column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID',
+ 'csv_column_sepa-ct-op' => 'SEPA Credit Transfer opposing account',
+ 'csv_column_sepa-db' => 'SEPA Direct Debet',
+ 'csv_column_tags-comma' => 'Tags (separadas por vírgula)',
+ 'csv_column_tags-space' => 'Tags (separadas por espaço)',
+ 'csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.',
+ 'csv_specifix_Dummy' => 'Checking this has no effect whatsoever.',
+ 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',
+ 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.',
+ 'csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',
// create new stuff:
- 'create_new_withdrawal' => 'Criar nova retirada',
- 'create_new_deposit' => 'Criar um novo depósito',
- 'create_new_transfer' => 'Criar nova transferência',
- 'create_new_asset' => 'Criar nova conta de ativo',
- 'create_new_expense' => 'Criar nova conta de despesa',
- 'create_new_revenue' => 'Criar nova conta de receita',
- 'create_new_piggy_bank' => 'Criar novo cofrinho',
- 'create_new_bill' => 'Criar nova fatura',
+ 'create_new_withdrawal' => 'Criar nova retirada',
+ 'create_new_deposit' => 'Criar um novo depósito',
+ 'create_new_transfer' => 'Criar nova transferência',
+ 'create_new_asset' => 'Criar nova conta de ativo',
+ 'create_new_expense' => 'Criar nova conta de despesa',
+ 'create_new_revenue' => 'Criar nova conta de receita',
+ 'create_new_piggy_bank' => 'Criar novo cofrinho',
+ 'create_new_bill' => 'Criar nova fatura',
// currencies:
- 'create_currency' => 'Criar uma nova moeda',
- 'edit_currency' => 'Editar moeda ":name"',
- 'store_currency' => 'Armazenar nova moeda',
- 'update_currency' => 'Atualizar moeda',
+ 'create_currency' => 'Criar uma nova moeda',
+ 'edit_currency' => 'Editar moeda ":name"',
+ 'store_currency' => 'Armazenar nova moeda',
+ 'update_currency' => 'Atualizar moeda',
// new user:
- 'submit' => 'Enviar',
- 'getting_started' => 'Iniciar',
- 'to_get_started' => 'To get started with Firefly, please enter your current bank\'s name, and the balance of your checking account:',
- 'savings_balance_text' => 'If you have a savings account, please enter the current balance of your savings account:',
- 'cc_balance_text' => 'If you have a credit card, please enter your credit card\'s limit.',
+ 'submit' => 'Enviar',
+ 'getting_started' => 'Iniciar',
+ 'to_get_started' => 'To get started with Firefly, please enter your current bank\'s name, and the balance of your checking account:',
+ 'savings_balance_text' => 'If you have a savings account, please enter the current balance of your savings account:',
+ 'cc_balance_text' => 'If you have a credit card, please enter your credit card\'s limit.',
// forms:
- 'mandatoryFields' => 'Campos obrigatórios',
- 'optionalFields' => 'Campos opcionais',
- 'options' => 'Opções',
- 'something' => 'Qualquer coisa!',
+ 'mandatoryFields' => 'Campos obrigatórios',
+ 'optionalFields' => 'Campos opcionais',
+ 'options' => 'Opções',
+ 'something' => 'Qualquer coisa!',
// budgets:
- 'create_new_budget' => 'Criar um novo orçamento',
- 'store_new_budget' => 'Armazenar novo orçamento',
- 'availableIn' => 'Disponível em :date',
- 'transactionsWithoutBudget' => 'Despesas sem orçamentos',
- 'transactionsWithoutBudgetDate' => 'Despesas sem orçamentos em :date',
- 'createBudget' => 'Novo orçamento',
- 'inactiveBudgets' => 'Orçamentos inativos',
- 'without_budget_between' => 'Transactions without a budget between :start and :end',
- 'budget_in_month' => ':name no :month',
- 'delete_budget' => 'Delete budget ":name"',
- 'edit_budget' => 'Edit budget ":name"',
- 'update_amount' => 'Update amount',
- 'update_budget' => 'Update budget',
+ 'create_new_budget' => 'Criar um novo orçamento',
+ 'store_new_budget' => 'Armazenar novo orçamento',
+ 'availableIn' => 'Disponível em :date',
+ 'transactionsWithoutBudget' => 'Despesas sem orçamentos',
+ 'transactionsWithoutBudgetDate' => 'Despesas sem orçamentos em :date',
+ 'createBudget' => 'Novo orçamento',
+ 'inactiveBudgets' => 'Orçamentos inativos',
+ 'without_budget_between' => 'Transactions without a budget between :start and :end',
+ 'budget_in_month' => ':name no :month',
+ 'delete_budget' => 'Delete budget ":name"',
+ 'edit_budget' => 'Edit budget ":name"',
+ 'update_amount' => 'Update amount',
+ 'update_budget' => 'Update budget',
// bills:
- 'delete_bill' => 'Delete bill ":name"',
- 'edit_bill' => 'Edit bill ":name"',
- 'update_bill' => 'Update bill',
- 'store_new_bill' => 'Store new bill',
+ 'delete_bill' => 'Delete bill ":name"',
+ 'edit_bill' => 'Edit bill ":name"',
+ 'update_bill' => 'Update bill',
+ 'store_new_bill' => 'Store new bill',
// 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' => 'Create a new asset account',
- 'make_new_expense_account' => 'Create a new expense account',
- 'make_new_revenue_account' => 'Create a new revenue account',
- 'asset_accounts' => 'Asset accounts',
- 'expense_accounts' => 'Expense accounts',
- 'revenue_accounts' => 'Revenue accounts',
- 'accountExtraHelp_asset' => '',
- 'accountExtraHelp_expense' => '',
- 'accountExtraHelp_revenue' => '',
- 'account_type' => 'Account type',
- 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:',
+ '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' => 'Create a new asset account',
+ 'make_new_expense_account' => 'Create a new expense account',
+ 'make_new_revenue_account' => 'Create a new revenue account',
+ 'asset_accounts' => 'Asset accounts',
+ 'expense_accounts' => 'Expense accounts',
+ 'revenue_accounts' => 'Revenue accounts',
+ 'accountExtraHelp_asset' => '',
+ 'accountExtraHelp_expense' => '',
+ 'accountExtraHelp_revenue' => '',
+ 'account_type' => 'Account type',
+ 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:',
// categories:
- 'new_category' => 'New category',
- 'create_new_category' => 'Create a new category',
- 'without_category' => 'Without a category',
- 'update_category' => 'Wijzig categorie',
- 'categories' => 'Categories',
- 'edit_category' => 'Edit category ":name"',
- 'no_category' => '(no category)',
- 'category' => 'Category',
- 'delete_category' => 'Delete category ":name"',
- 'store_category' => 'Store new category',
+ 'new_category' => 'New category',
+ 'create_new_category' => 'Create a new category',
+ 'without_category' => 'Without a category',
+ 'update_category' => 'Wijzig categorie',
+ 'categories' => 'Categories',
+ 'edit_category' => 'Edit category ":name"',
+ 'no_category' => '(no category)',
+ 'category' => 'Category',
+ 'delete_category' => 'Delete category ":name"',
+ 'store_category' => 'Store new category',
+ 'without_category_between' => 'Without category between :start and :end',
// transactions:
- 'update_withdrawal' => 'Update withdrawal',
- 'update_deposit' => 'Update deposit',
- 'update_transfer' => 'Update transfer',
- 'delete_withdrawal' => 'Delete withdrawal ":description"',
- 'delete_deposit' => 'Delete deposit ":description"',
- 'delete_transfer' => 'Delete transfer ":description"',
+ 'update_withdrawal' => 'Update withdrawal',
+ 'update_deposit' => 'Update deposit',
+ 'update_transfer' => 'Update transfer',
+ 'delete_withdrawal' => 'Delete withdrawal ":description"',
+ 'delete_deposit' => 'Delete deposit ":description"',
+ 'delete_transfer' => 'Delete transfer ":description"',
// new user:
- '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',
- 'createNewAssetButton' => 'Criar nova conta de ativo',
+ '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',
+ 'createNewAssetButton' => 'Criar nova conta de ativo',
// home page:
- 'yourAccounts' => 'Your accounts',
- 'budgetsAndSpending' => 'Budgets and spending',
- 'savings' => 'Savings',
- 'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel',
- 'createPiggyToContinue' => 'Create piggy banks to fill this panel.',
- 'newWithdrawal' => 'New expense',
- 'newDeposit' => 'Novo depósito',
- 'newTransfer' => 'Nova transferência',
- 'moneyIn' => 'Money in',
- 'moneyOut' => 'Money out',
- 'billsToPay' => 'Bills to pay',
- 'billsPaid' => 'Bills paid',
- 'viewDetails' => 'View details',
- 'divided' => 'divided',
- 'toDivide' => 'left to divide',
+ 'yourAccounts' => 'Your accounts',
+ 'budgetsAndSpending' => 'Budgets and spending',
+ 'savings' => 'Savings',
+ 'markAsSavingsToContinue' => 'Mark your asset accounts as "Savings account" to fill this panel',
+ 'createPiggyToContinue' => 'Create piggy banks to fill this panel.',
+ 'newWithdrawal' => 'New expense',
+ 'newDeposit' => 'Novo depósito',
+ 'newTransfer' => 'Nova transferência',
+ 'moneyIn' => 'Money in',
+ 'moneyOut' => 'Money out',
+ 'billsToPay' => 'Bills to pay',
+ 'billsPaid' => 'Bills paid',
+ 'viewDetails' => 'View details',
+ 'divided' => 'divided',
+ 'toDivide' => 'left to divide',
// menu and titles, should be recycled as often as possible:
- 'toggleNavigation' => 'Toggle navigation',
- 'currency' => 'Currency',
- 'preferences' => 'Preferences',
- 'logout' => 'Logout',
- 'searchPlaceholder' => 'Search...',
- 'dashboard' => 'Dashboard',
- 'currencies' => 'Currencies',
- 'accounts' => 'Accounts',
- 'Asset account' => 'Asset account',
- 'Default account' => 'Asset account',
- 'Expense account' => 'Conta de Despesa',
- 'Revenue account' => 'Conta de Receita',
- 'Initial balance account' => 'Initial balance account',
- 'budgets' => 'Budgets',
- 'tags' => 'Tags',
- 'reports' => 'Relatórios',
- 'transactions' => 'Transações',
- 'expenses' => 'Despesas',
- 'income' => 'Receita / Renda',
- 'transfers' => 'Transferências',
- 'moneyManagement' => 'Gerenciamento de Dinheiro',
- 'piggyBanks' => 'Cofrinhos',
- 'bills' => 'Faturas',
- 'createNew' => 'Criar nova(o)',
- 'withdrawal' => 'Retirada',
- 'deposit' => 'Depósito',
- 'account' => 'Conta',
- 'transfer' => 'Transferência',
- 'Withdrawal' => 'Retirada',
- 'Deposit' => 'Depósito',
- 'Transfer' => 'Transferência',
- 'bill' => 'Fatura',
- 'yes' => 'Sim',
- 'no' => 'Não',
- 'amount' => 'Valor',
- 'newBalance' => 'Novo saldo',
- 'overview' => 'Visão Geral',
- 'saveOnAccount' => 'Salvar na conta',
- 'unknown' => 'Desconhecido',
- 'daily' => 'Diário',
- 'weekly' => 'Semanal',
- 'monthly' => 'Mensal',
- 'quarterly' => 'Trimestral',
- 'half-year' => 'Semestral',
- 'yearly' => 'Anual',
- 'profile' => 'Perfil',
+ 'toggleNavigation' => 'Toggle navigation',
+ 'currency' => 'Currency',
+ 'preferences' => 'Preferences',
+ 'logout' => 'Logout',
+ 'searchPlaceholder' => 'Search...',
+ 'dashboard' => 'Dashboard',
+ 'currencies' => 'Currencies',
+ 'accounts' => 'Accounts',
+ 'Asset account' => 'Asset account',
+ 'Default account' => 'Asset account',
+ 'Expense account' => 'Conta de Despesa',
+ 'Revenue account' => 'Conta de Receita',
+ 'Initial balance account' => 'Initial balance account',
+ 'budgets' => 'Budgets',
+ 'tags' => 'Tags',
+ 'reports' => 'Relatórios',
+ 'transactions' => 'Transações',
+ 'expenses' => 'Despesas',
+ 'income' => 'Receita / Renda',
+ 'transfers' => 'Transferências',
+ 'moneyManagement' => 'Gerenciamento de Dinheiro',
+ 'piggyBanks' => 'Cofrinhos',
+ 'bills' => 'Faturas',
+ 'createNew' => 'Criar nova(o)',
+ 'withdrawal' => 'Retirada',
+ 'deposit' => 'Depósito',
+ 'account' => 'Conta',
+ 'transfer' => 'Transferência',
+ 'Withdrawal' => 'Retirada',
+ 'Deposit' => 'Depósito',
+ 'Transfer' => 'Transferência',
+ 'bill' => 'Fatura',
+ 'yes' => 'Sim',
+ 'no' => 'Não',
+ 'amount' => 'Valor',
+ 'newBalance' => 'Novo saldo',
+ 'overview' => 'Visão Geral',
+ 'saveOnAccount' => 'Salvar na conta',
+ 'unknown' => 'Desconhecido',
+ 'daily' => 'Diário',
+ 'weekly' => 'Semanal',
+ 'monthly' => 'Mensal',
+ 'quarterly' => 'Trimestral',
+ 'half-year' => 'Semestral',
+ 'yearly' => 'Anual',
+ 'profile' => 'Perfil',
// reports:
- 'report_default' => 'Default financial report for :start until :end',
- 'quick_link_reports' => 'Quick links',
- 'quick_link_default_report' => 'Default financial report',
- 'report_this_month_quick' => 'Current month, all accounts',
- 'report_this_year_quick' => 'Current year, all accounts',
- 'report_all_time_quick' => 'All-time, all accounts',
- 'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
- 'incomeVsExpenses' => 'Renda vs. Despesas',
- 'accountBalances' => 'Saldos de Contas',
- 'balanceStartOfYear' => 'Balance at start of year',
- 'balanceEndOfYear' => 'Balance at end of year',
- 'balanceStartOfMonth' => 'Balance at start of month',
- 'balanceEndOfMonth' => 'Balance at end of month',
- 'balanceStart' => 'Balance at start of period',
- 'balanceEnd' => 'Balance at end of period',
- 'reportsOwnAccounts' => 'Reports for your own accounts',
- 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts',
- 'splitByAccount' => 'Split by account',
- 'balancedByTransfersAndTags' => 'Balanced by transfers and tags',
- 'coveredWithTags' => 'Covered with tags',
- 'leftUnbalanced' => 'Left unbalanced',
- 'expectedBalance' => 'Saldo Experado',
- 'outsideOfBudgets' => 'Fora do orçamento',
- 'leftInBudget' => 'Deixou no orçamento',
- 'sumOfSums' => 'Soma dos montantes',
- 'noCategory' => '(no category)',
- 'notCharged' => 'Não cobrado (ainda)',
- 'inactive' => 'Inativo',
- 'difference' => 'Diferente',
- 'in' => 'Entrada',
- 'out' => 'Saída',
- 'topX' => 'top :number',
- 'showTheRest' => 'Mostrar tudo',
- 'hideTheRest' => 'Mostrar apenas os top :number',
- 'sum_of_year' => 'Soma do ano',
- 'sum_of_years' => 'Sum of years',
- 'average_of_year' => 'Média do ano',
- 'average_of_years' => 'Average of years',
- 'categories_earned_in_year' => 'Categories (by earnings)',
- 'categories_spent_in_year' => 'Categories (by spendings)',
- 'report_type' => 'Report type',
- 'report_type_default' => 'Default financial report',
- 'report_included_accounts' => 'Included accounts',
- 'report_date_range' => 'Date range',
- 'report_include_help' => 'In all cases, transfers to shared accounts count as expenses, and transfers from shared accounts count as income.',
- 'report_preset_ranges' => 'Pre-set ranges',
- 'shared' => 'Shared',
+ 'report_default' => 'Default financial report for :start until :end',
+ 'quick_link_reports' => 'Quick links',
+ 'quick_link_default_report' => 'Default financial report',
+ 'report_this_month_quick' => 'Current month, all accounts',
+ 'report_this_year_quick' => 'Current year, all accounts',
+ 'report_all_time_quick' => 'All-time, all accounts',
+ 'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
+ 'incomeVsExpenses' => 'Renda vs. Despesas',
+ 'accountBalances' => 'Saldos de Contas',
+ 'balanceStartOfYear' => 'Balance at start of year',
+ 'balanceEndOfYear' => 'Balance at end of year',
+ 'balanceStartOfMonth' => 'Balance at start of month',
+ 'balanceEndOfMonth' => 'Balance at end of month',
+ 'balanceStart' => 'Balance at start of period',
+ 'balanceEnd' => 'Balance at end of period',
+ 'reportsOwnAccounts' => 'Reports for your own accounts',
+ 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts',
+ 'splitByAccount' => 'Split by account',
+ 'balancedByTransfersAndTags' => 'Balanced by transfers and tags',
+ 'coveredWithTags' => 'Covered with tags',
+ 'leftUnbalanced' => 'Left unbalanced',
+ 'expectedBalance' => 'Saldo Experado',
+ 'outsideOfBudgets' => 'Fora do orçamento',
+ 'leftInBudget' => 'Deixou no orçamento',
+ 'sumOfSums' => 'Soma dos montantes',
+ 'noCategory' => '(no category)',
+ 'notCharged' => 'Não cobrado (ainda)',
+ 'inactive' => 'Inativo',
+ 'difference' => 'Diferente',
+ 'in' => 'Entrada',
+ 'out' => 'Saída',
+ 'topX' => 'top :number',
+ 'showTheRest' => 'Mostrar tudo',
+ 'hideTheRest' => 'Mostrar apenas os top :number',
+ 'sum_of_year' => 'Soma do ano',
+ 'sum_of_years' => 'Sum of years',
+ 'average_of_year' => 'Média do ano',
+ 'average_of_years' => 'Average of years',
+ 'categories_earned_in_year' => 'Categories (by earnings)',
+ 'categories_spent_in_year' => 'Categories (by spendings)',
+ 'report_type' => 'Report type',
+ 'report_type_default' => 'Default financial report',
+ 'report_included_accounts' => 'Included accounts',
+ 'report_date_range' => 'Date range',
+ 'report_include_help' => 'In all cases, transfers to shared accounts count as expenses, and transfers from shared accounts count as income.',
+ 'report_preset_ranges' => 'Pre-set ranges',
+ 'shared' => 'Shared',
// charts:
- 'dayOfMonth' => 'Dia do mês',
- 'month' => 'Mês',
- 'budget' => 'Orçamento',
- 'spent' => 'Gasto',
- 'earned' => 'Ganho',
- 'overspent' => 'Gasto excedido',
- 'left' => 'Left',
- 'noBudget' => '(sem orçamento)',
- 'maxAmount' => 'Valor Máximo',
- 'minAmount' => 'Valor Mínimo',
- 'billEntry' => 'Current bill entry',
- 'name' => 'Nome',
- 'date' => 'Data',
- 'paid' => 'Pago',
- 'unpaid' => 'Não pago',
- 'day' => 'Dia',
- 'budgeted' => 'Orçado',
- 'period' => 'Período',
- 'balance' => 'Saldo',
- 'summary' => 'Sumário',
- 'sum' => 'Soma',
- 'average' => 'Média',
- 'balanceFor' => 'Saldo para ":name"',
+ 'dayOfMonth' => 'Dia do mês',
+ 'month' => 'Mês',
+ 'budget' => 'Orçamento',
+ 'spent' => 'Gasto',
+ 'earned' => 'Ganho',
+ 'overspent' => 'Gasto excedido',
+ 'left' => 'Left',
+ 'noBudget' => '(sem orçamento)',
+ 'maxAmount' => 'Valor Máximo',
+ 'minAmount' => 'Valor Mínimo',
+ 'billEntry' => 'Current bill entry',
+ 'name' => 'Nome',
+ 'date' => 'Data',
+ 'paid' => 'Pago',
+ 'unpaid' => 'Não pago',
+ 'day' => 'Dia',
+ 'budgeted' => 'Orçado',
+ 'period' => 'Período',
+ 'balance' => 'Saldo',
+ 'summary' => 'Sumário',
+ 'sum' => 'Soma',
+ 'average' => 'Média',
+ 'balanceFor' => 'Saldo para ":name"',
// piggy banks:
- 'piggy_bank' => 'Cofrinho',
- 'new_piggy_bank' => 'Criar novo cofrinho',
- 'store_piggy_bank' => 'Store new piggy bank',
- 'account_status' => 'Account status',
- 'left_for_piggy_banks' => 'Left for piggy banks',
- 'sum_of_piggy_banks' => 'Sum of piggy banks',
- 'saved_so_far' => 'Saved so far',
- 'left_to_save' => 'Left to save',
- 'add_money_to_piggy_title' => 'Add money to piggy bank ":name"',
- 'remove_money_from_piggy_title' => 'Remove money from piggy bank ":name"',
- 'add' => 'Adicionar',
- 'remove' => 'Remover',
- 'max_amount_add' => 'The maximum amount you can add is',
- 'max_amount_remove' => 'The maximum amount you can remove is',
- 'update_piggy_button' => 'Update piggy bank',
- 'update_piggy_title' => 'Update piggy bank ":name"',
- 'details' => 'Detalhes',
- 'events' => 'Eventos',
- 'target_amount' => 'Valor alvo',
- 'start_date' => 'Data de Início',
- 'target_date' => 'Data Alvo',
- 'no_target_date' => 'Nenhum data',
- 'todo' => 'A fazer',
- 'table' => 'Tabela',
- 'piggy_bank_not_exists' => 'Piggy bank no longer exists.',
- 'add_any_amount_to_piggy' => 'Add money to this piggy bank to reach your target of :amount.',
- 'add_set_amount_to_piggy' => 'Add :amount to fill this piggy bank on :date',
- 'delete_piggy_bank' => 'Apagar cofrinho ":name"',
+ 'piggy_bank' => 'Cofrinho',
+ 'new_piggy_bank' => 'Criar novo cofrinho',
+ 'store_piggy_bank' => 'Store new piggy bank',
+ 'account_status' => 'Account status',
+ 'left_for_piggy_banks' => 'Left for piggy banks',
+ 'sum_of_piggy_banks' => 'Sum of piggy banks',
+ 'saved_so_far' => 'Saved so far',
+ 'left_to_save' => 'Left to save',
+ 'add_money_to_piggy_title' => 'Add money to piggy bank ":name"',
+ 'remove_money_from_piggy_title' => 'Remove money from piggy bank ":name"',
+ 'add' => 'Adicionar',
+ 'remove' => 'Remover',
+ 'max_amount_add' => 'The maximum amount you can add is',
+ 'max_amount_remove' => 'The maximum amount you can remove is',
+ 'update_piggy_button' => 'Update piggy bank',
+ 'update_piggy_title' => 'Update piggy bank ":name"',
+ 'details' => 'Detalhes',
+ 'events' => 'Eventos',
+ 'target_amount' => 'Valor alvo',
+ 'start_date' => 'Data de Início',
+ 'target_date' => 'Data Alvo',
+ 'no_target_date' => 'Nenhum data',
+ 'todo' => 'A fazer',
+ 'table' => 'Tabela',
+ 'piggy_bank_not_exists' => 'Piggy bank no longer exists.',
+ 'add_any_amount_to_piggy' => 'Add money to this piggy bank to reach your target of :amount.',
+ 'add_set_amount_to_piggy' => 'Add :amount to fill this piggy bank on :date',
+ 'delete_piggy_bank' => 'Apagar cofrinho ":name"',
// tags
- 'regular_tag' => 'Just a regular tag.',
- 'balancing_act' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.',
- 'advance_payment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.',
- 'delete_tag' => 'Apagar tag ":tag"',
- 'new_tag' => 'Fazer nova tag',
- 'edit_tag' => 'Editar tag ":tag"',
- 'no_year' => 'Nenhum ano definido',
- 'no_month' => 'Nenhum mês definido',
- 'tag_title_nothing' => 'Tags padrões',
- 'tag_title_balancingAct' => 'Balancing act tags',
- 'tag_title_advancePayment' => 'Advance payment tags',
- 'tags_introduction' => 'Usually tags are singular words, designed to quickly band items together using things like expensive, bill or for-party. In Firefly III, tags can have more properties such as a date, description and location. This allows you to join transactions together in a more meaningful way. For example, you could make a tag called Christmas dinner with friends and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, perhaps with multiple transactions.',
- 'tags_group' => 'Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits are cancelling each other out (buying something with saved money). It\'s all up to you. Using tags the old-fashioned way is of course always possible. ',
- 'tags_start' => 'Create a tag to get started or enter tags when creating new transactions.',
+ 'regular_tag' => 'Just a regular tag.',
+ 'balancing_act' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.',
+ 'advance_payment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.',
+ 'delete_tag' => 'Apagar tag ":tag"',
+ 'new_tag' => 'Fazer nova tag',
+ 'edit_tag' => 'Editar tag ":tag"',
+ 'no_year' => 'Nenhum ano definido',
+ 'no_month' => 'Nenhum mês definido',
+ 'tag_title_nothing' => 'Tags padrões',
+ 'tag_title_balancingAct' => 'Balancing act tags',
+ 'tag_title_advancePayment' => 'Advance payment tags',
+ 'tags_introduction' => 'Usually tags are singular words, designed to quickly band items together using things like expensive, bill or for-party. In Firefly III, tags can have more properties such as a date, description and location. This allows you to join transactions together in a more meaningful way. For example, you could make a tag called Christmas dinner with friends and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, perhaps with multiple transactions.',
+ 'tags_group' => 'Tags group transactions together, which makes it possible to store reimbursements (in case you front money for others) and other "balancing acts" where expenses are summed up (the payments on your new TV) or where expenses and deposits are cancelling each other out (buying something with saved money). It\'s all up to you. Using tags the old-fashioned way is of course always possible.',
+ 'tags_start' => 'Create a tag to get started or enter tags when creating new transactions.',
];
diff --git a/resources/lang/pt_BR/form.php b/resources/lang/pt_BR/form.php
old mode 100644
new mode 100755
index 03f40ccc90..fa7c85df17
--- a/resources/lang/pt_BR/form.php
+++ b/resources/lang/pt_BR/form.php
@@ -53,6 +53,7 @@ return [
'csv_config' => 'Importar CSV de configuração',
'specifix' => 'Bank- or file specific fixes',
'csv_import_account' => 'Default import account',
+ 'csv_delimiter' => 'CSV field delimiter',
'attachments[]' => 'Anexos',
'store_new_withdrawal' => 'Store new withdrawal',
'store_new_deposit' => 'Store new deposit',
@@ -67,6 +68,12 @@ return [
'filename' => 'Nome do arquivo',
'mime' => 'Mime type',
'size' => 'Tamanho',
+ 'trigger' => 'Trigger',
+ 'stop_processing' => 'Stop processing',
+
+ 'csv_comma' => 'A comma (,)',
+ 'csv_semicolon' => 'A semicolon (;)',
+ 'csv_tab' => 'A tab (invisible)',
'delete_account' => 'Apagar conta ":name"',
@@ -76,10 +83,14 @@ return [
'delete_currency' => 'Delete currency ":name"',
'delete_journal' => 'Delete transaction with description ":description"',
'delete_attachment' => 'Apagar anexo ":name"',
+ 'delete_rule' => 'Delete rule ":title"',
+ 'delete_rule_group' => 'Delete rule group ":title"',
'attachment_areYouSure' => 'Are you sure you want to delete the attachment named ":name"?',
'account_areYouSure' => 'Are you sure you want to delete the account named ":name"?',
'bill_areYouSure' => 'Você tem certeza que quer apagar a fatura ":name"?',
+ 'rule_areYouSure' => 'Are you sure you want to delete the rule titled ":title"?',
+ 'ruleGroup_areYouSure' => 'Are you sure you want to delete the rule group titled ":title"?',
'budget_areYouSure' => 'Are you sure you want to delete the budget named ":name"?',
'category_areYouSure' => 'Are you sure you want to delete the category named ":name"?',
'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?',
@@ -89,6 +100,7 @@ return [
'permDeleteWarning' => 'Deleting stuff from Firely is permanent and cannot be undone.',
'also_delete_transactions' => 'The only transaction connected to this account will be deleted as well.|All :count transactions connected to this account will be deleted as well.',
+ 'also_delete_rules' => 'The only rule connected to this rule group will be deleted as well.|All :count rules connected to this rule group will be deleted as well.',
'also_delete_piggyBanks' => 'The only piggy bank connected to this account will be deleted as well.|All :count piggy bank connected to this account will be deleted as well.',
'bill_keep_transactions' => 'The only transaction connected to this bill will not be deleted.|All :count transactions connected to this bill will spared deletion.',
'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will spared deletion.',
diff --git a/resources/lang/pt_BR/help.php b/resources/lang/pt_BR/help.php
old mode 100644
new mode 100755
index ca6f66c753..99e2295f4f
--- a/resources/lang/pt_BR/help.php
+++ b/resources/lang/pt_BR/help.php
@@ -20,74 +20,65 @@ return [
'main-content-end-text' => 'Remember that every page has a small question mark at the right top. Click it to get help about the page you\'re on.',
- 'register' => 'register',
- 'index' => 'The main index',
- 'home' => 'home',
- 'flush' => 'flush',
- 'accounts-index' => 'accounts.index',
- 'accounts-create' => 'accounts.create',
- 'accounts-edit' => 'accounts.edit',
- 'accounts-delete' => 'accounts.delete',
- 'accounts-show' => 'accounts.show',
- 'bills-index' => 'bills.index',
- 'bills-rescan' => 'bills.rescan',
- 'bills-create' => 'bills.create',
- 'bills-edit' => 'bills.edit',
- 'bills-delete' => 'bills.delete',
- 'bills-show' => 'bills.show',
- 'budgets-index' => 'budgets.index',
- 'budgets-income' => 'budgets.income',
- 'budgets-create' => 'budgets.create',
- 'budgets-edit' => 'budgets.edit',
- 'budgets-delete' => 'budgets.delete',
- 'budgets-show' => 'budgets.show',
- 'budgets-noBudget' => 'budgets.noBudget',
- 'categories-index' => 'categories.index',
- 'categories-create' => 'categories.create',
- 'categories-edit' => 'categories.edit',
- 'categories-delete' => 'categories.delete',
- 'categories-show' => 'categories.show',
- 'categories-noCategory' => 'categories.noCategory',
- 'csv-index' => 'Carregar e importar um arquivo CSV',
- 'currency-index' => 'currency.index',
- 'currency-create' => 'currency.create',
- 'currency-edit' => 'currency.edit',
- 'currency-delete' => 'currency.delete',
- 'currency-default' => 'currency.default',
- 'help-show' => 'help.show',
- 'json-expense-accounts' => 'json.expense-accounts',
- 'json-revenue-accounts' => 'json.revenue-accounts',
- 'json-categories' => 'json.categories',
- 'json-tags' => 'json.tags',
- 'json-box-in' => 'json.box.in',
- 'json-box-out' => 'json.box.out',
- 'json-box-paid' => 'json.box.paid',
- 'json-box-unpaid' => 'json.box.unpaid',
- 'new-user-index' => 'new-user.index',
- 'piggy-banks-index' => 'piggy-banks.index',
- 'piggy-banks-addMoney' => 'piggy-banks.addMoney',
- 'piggy-banks-removeMoney' => 'piggy-banks.removeMoney',
- 'piggy-banks-create' => 'piggy-banks.create',
- 'piggy-banks-edit' => 'piggy-banks.edit',
- 'piggy-banks-delete' => 'piggy-banks.delete',
- 'piggy-banks-show' => 'piggy-banks.show',
- 'preferences' => 'preferences',
- 'profile' => 'profile',
- 'profile-change-password' => 'profile.change-password',
- 'profile-delete-account' => 'profile.delete-account',
- 'reports-index' => 'reports.index',
- 'reports-year' => 'reports.year',
- 'reports-month' => 'reports.month',
- 'search' => 'search',
- 'tags-index' => 'tags.index',
- 'tags-create' => 'tags.create',
- 'tags-show' => 'tags.show',
- 'tags-edit' => 'tags.edit',
- 'tags-delete' => 'tags.delete',
- 'transactions-index' => 'transactions.index',
- 'transactions-create' => 'transactions.create',
- 'transactions-edit' => 'transactions.edit',
- 'transactions-delete' => 'transactions.delete',
- 'transactions-show' => 'transactions.show',
- 'logout' => 'logout',
+ 'index' => 'index',
+ 'home' => 'home',
+ 'accounts-index' => 'accounts.index',
+ 'accounts-create' => 'accounts.create',
+ 'accounts-edit' => 'accounts.edit',
+ 'accounts-delete' => 'accounts.delete',
+ 'accounts-show' => 'accounts.show',
+ 'attachments-edit' => 'attachments.edit',
+ 'attachments-delete' => 'attachments.delete',
+ 'attachments-show' => 'attachments.show',
+ 'attachments-preview' => 'attachments.preview',
+ 'bills-index' => 'bills.index',
+ 'bills-create' => 'bills.create',
+ 'bills-edit' => 'bills.edit',
+ 'bills-delete' => 'bills.delete',
+ 'bills-show' => 'bills.show',
+ 'budgets-index' => 'budgets.index',
+ 'budgets-create' => 'budgets.create',
+ 'budgets-edit' => 'budgets.edit',
+ 'budgets-delete' => 'budgets.delete',
+ 'budgets-show' => 'budgets.show',
+ 'budgets-noBudget' => 'budgets.noBudget',
+ 'categories-index' => 'categories.index',
+ 'categories-create' => 'categories.create',
+ 'categories-edit' => 'categories.edit',
+ 'categories-delete' => 'categories.delete',
+ 'categories-show' => 'categories.show',
+ 'categories-show-date' => 'categories.show.date',
+ 'categories-noCategory' => 'categories.noCategory',
+ 'csv-index' => 'Carregar e importar um arquivo CSV',
+ 'csv-column-roles' => 'csv.column-roles',
+ 'csv-map' => 'csv.map',
+ 'csv-download-config-page' => 'csv.download-config-page',
+ 'csv-process' => 'csv.process',
+ 'currency-index' => 'currency.index',
+ 'currency-create' => 'currency.create',
+ 'currency-edit' => 'currency.edit',
+ 'currency-delete' => 'currency.delete',
+ 'new-user-index' => 'new-user.index',
+ 'piggy-banks-index' => 'piggy-banks.index',
+ 'piggy-banks-create' => 'piggy-banks.create',
+ 'piggy-banks-edit' => 'piggy-banks.edit',
+ 'piggy-banks-delete' => 'piggy-banks.delete',
+ 'piggy-banks-show' => 'piggy-banks.show',
+ 'preferences' => 'preferences',
+ 'profile' => 'profile',
+ 'profile-change-password' => 'profile.change-password',
+ 'profile-delete-account' => 'profile.delete-account',
+ 'reports-index' => 'reports.index',
+ 'reports-report' => 'reports.report',
+ 'search' => 'search',
+ 'tags-index' => 'tags.index',
+ 'tags-create' => 'tags.create',
+ 'tags-show' => 'tags.show',
+ 'tags-edit' => 'tags.edit',
+ 'tags-delete' => 'tags.delete',
+ 'transactions-index' => 'transactions.index',
+ 'transactions-create' => 'transactions.create',
+ 'transactions-edit' => 'transactions.edit',
+ 'transactions-delete' => 'transactions.delete',
+ 'transactions-show' => 'transactions.show',
];
diff --git a/resources/lang/pt_BR/list.php b/resources/lang/pt_BR/list.php
old mode 100644
new mode 100755
diff --git a/resources/lang/pt_BR/pagination.php b/resources/lang/pt_BR/pagination.php
old mode 100644
new mode 100755
diff --git a/resources/lang/pt_BR/passwords.php b/resources/lang/pt_BR/passwords.php
old mode 100644
new mode 100755
index 7e45ef4749..914544dfb5
--- a/resources/lang/pt_BR/passwords.php
+++ b/resources/lang/pt_BR/passwords.php
@@ -17,6 +17,6 @@ return [
"token" => "Este token de redefinição de senha é inválido.",
"sent" => "Nós te enviamos um email com um link para trocar a senha!",
"reset" => "Sua senha foi redefinida!",
- 'blocked' => 'Nice try though.'
+ 'blocked' => 'Nice try though.',
];
diff --git a/resources/lang/pt_BR/validation.php b/resources/lang/pt_BR/validation.php
index 7819d30ce1..05c224dc29 100755
--- a/resources/lang/pt_BR/validation.php
+++ b/resources/lang/pt_BR/validation.php
@@ -1,6 +1,8 @@
'This value is invalid for the selected trigger.',
+ 'rule_action_value' => 'This value is invalid for the selected action.',
'invalid_domain' => 'Due to security constraints, you cannot register from this domain.',
'file_already_attached' => 'Uploaded file ":name" is already attached to this object.',
'file_attached' => 'Succesfully uploaded file ":name".',
diff --git a/resources/views/csv/index.twig b/resources/views/csv/index.twig
index 4bd88729ce..deff9ec3ae 100644
--- a/resources/views/csv/index.twig
+++ b/resources/views/csv/index.twig
@@ -59,10 +59,13 @@
{{ ExpandedForm.file('csv',{helpText: 'csv_csv_file_help'|_}) }}
+ {{ ExpandedForm.select('csv_delimiter', delimiters, 0, {helpText: 'csv_delimiter_help'|_} ) }}
+
{{ ExpandedForm.file('csv_config',{helpText: 'csv_csv_config_file_help'|_}) }}
{{ ExpandedForm.select('csv_import_account', accounts, 0, {helpText: 'csv_import_account_help'|_} ) }}
+
{{ ExpandedForm.multiCheckbox('specifix', specifix) }}
diff --git a/resources/views/emails/registered-html.twig b/resources/views/emails/registered-html.twig
index 532322e75a..5c89c1a81d 100644
--- a/resources/views/emails/registered-html.twig
+++ b/resources/views/emails/registered-html.twig
@@ -62,6 +62,7 @@
+