diff --git a/README.md b/README.md index 976c4f4772..d9d66ad662 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Firefly III -#### v3.4.0.7 +#### v3.4.0.8 [![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=develop)](https://travis-ci.org/JC5/firefly-iii) [![Project Status](http://stillmaintained.com/JC5/firefly-iii.png?a=b)](http://stillmaintained.com/JC5/firefly-iii) diff --git a/app/Helpers/Collection/Account.php b/app/Helpers/Collection/Account.php index ad227fdea2..1906c651db 100644 --- a/app/Helpers/Collection/Account.php +++ b/app/Helpers/Collection/Account.php @@ -87,4 +87,4 @@ class Account } -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/Balance.php b/app/Helpers/Collection/Balance.php index cbafe987ce..48d8433c2f 100644 --- a/app/Helpers/Collection/Balance.php +++ b/app/Helpers/Collection/Balance.php @@ -1,6 +1,7 @@ account = $account; } - /** - * @return float - */ - public function getSpent() - { - return $this->spent; - } - - /** - * @param float $spent - */ - public function setSpent($spent) - { - $this->spent = $spent; - } - /** * @return float */ @@ -73,7 +54,21 @@ class BalanceEntry $this->left = $left; } + /** + * @return float + */ + public function getSpent() + { + return $this->spent; + } + + /** + * @param float $spent + */ + public function setSpent($spent) + { + $this->spent = $spent; + } - -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/BalanceHeader.php b/app/Helpers/Collection/BalanceHeader.php index 3563420408..5dbe86f5f6 100644 --- a/app/Helpers/Collection/BalanceHeader.php +++ b/app/Helpers/Collection/BalanceHeader.php @@ -43,5 +43,4 @@ class BalanceHeader } - -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index 4e045eca8a..a3d64ff7e3 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -167,4 +167,4 @@ class BalanceLine } -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php index 973b886482..dd1d19d767 100644 --- a/app/Helpers/Collection/Bill.php +++ b/app/Helpers/Collection/Bill.php @@ -7,6 +7,7 @@ use FireflyIII\Models\Bill as BillModel; use Illuminate\Support\Collection; /** + * @codeCoverageIgnore * Class Bill * * @package FireflyIII\Helpers\Collection @@ -43,8 +44,9 @@ class Bill $this->bills->sortBy( function (BillLine $bill) { $active = intval($bill->getBill()->active) == 0 ? 1 : 0; - $name = $bill->getBill()->name; - return $active.$name; + $name = $bill->getBill()->name; + + return $active . $name; } ); @@ -52,4 +54,4 @@ class Bill return $this->bills; } -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php index 613121073b..9c225a28e5 100644 --- a/app/Helpers/Collection/BillLine.php +++ b/app/Helpers/Collection/BillLine.php @@ -5,6 +5,8 @@ namespace FireflyIII\Helpers\Collection; use FireflyIII\Models\Bill as BillModel; /** + * @codeCoverageIgnore + * * Class BillLine * * @package FireflyIII\Helpers\Collection @@ -122,4 +124,4 @@ class BillLine } -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/Budget.php b/app/Helpers/Collection/Budget.php index 7cd5e1f3fa..dd609f39f6 100644 --- a/app/Helpers/Collection/Budget.php +++ b/app/Helpers/Collection/Budget.php @@ -1,6 +1,7 @@ spent += floatval($add); } + /** + * @return \Illuminate\Support\Collection + */ + public function getBudgetLines() + { + return $this->budgetLines; + } + /** * @return float */ @@ -135,15 +144,5 @@ class Budget $this->spent = $spent; } - /** - * @return \Illuminate\Support\Collection - */ - public function getBudgetLines() - { - return $this->budgetLines; - } - - - -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/BudgetLine.php b/app/Helpers/Collection/BudgetLine.php index a950ed088f..b8f76488a1 100644 --- a/app/Helpers/Collection/BudgetLine.php +++ b/app/Helpers/Collection/BudgetLine.php @@ -22,13 +22,13 @@ class BudgetLine protected $repetition; /** @var float */ - protected $budgeted = 0; + protected $budgeted = 0; /** @var float */ - protected $left = 0; + protected $left = 0; /** @var float */ protected $overspent = 0; /** @var float */ - protected $spent = 0; + protected $spent = 0; /** * @return BudgetModel @@ -127,8 +127,4 @@ class BudgetLine } - - - - -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/Category.php b/app/Helpers/Collection/Category.php index 96f1c63363..07a4ce7296 100644 --- a/app/Helpers/Collection/Category.php +++ b/app/Helpers/Collection/Category.php @@ -77,4 +77,4 @@ class Category } -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/Expense.php b/app/Helpers/Collection/Expense.php index 3c0d908ab6..4a0098679a 100644 --- a/app/Helpers/Collection/Expense.php +++ b/app/Helpers/Collection/Expense.php @@ -37,14 +37,14 @@ class Expense $accountId = $entry->account_id; if (!$this->expenses->has($accountId)) { $newObject = new stdClass; - $newObject->amount = floatval($entry->queryAmount); + $newObject->amount = floatval($entry->amount); $newObject->name = $entry->name; $newObject->count = 1; $newObject->id = $accountId; $this->expenses->put($accountId, $newObject); } else { $existing = $this->expenses->get($accountId); - $existing->amount += floatval($entry->queryAmount); + $existing->amount += floatval($entry->amount); $existing->count++; $this->expenses->put($accountId, $existing); } @@ -63,7 +63,7 @@ class Expense */ public function getExpenses() { - $this->expenses->sortBy( + $this->expenses->sortByDesc( function (stdClass $object) { return $object->amount; } @@ -79,4 +79,4 @@ class Expense { return $this->total; } -} \ No newline at end of file +} diff --git a/app/Helpers/Collection/Income.php b/app/Helpers/Collection/Income.php index c3e60e0cf7..eaf0568bc4 100644 --- a/app/Helpers/Collection/Income.php +++ b/app/Helpers/Collection/Income.php @@ -38,14 +38,14 @@ class Income $accountId = $entry->account_id; if (!$this->incomes->has($accountId)) { $newObject = new stdClass; - $newObject->amount = floatval($entry->queryAmount); + $newObject->amount = floatval($entry->amount); $newObject->name = $entry->name; $newObject->count = 1; $newObject->id = $accountId; $this->incomes->put($accountId, $newObject); } else { $existing = $this->incomes->get($accountId); - $existing->amount += floatval($entry->queryAmount); + $existing->amount += floatval($entry->amount); $existing->count++; $this->incomes->put($accountId, $existing); } @@ -82,4 +82,4 @@ class Income } -} \ No newline at end of file +} diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index 39628ea108..b8516a8704 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -37,7 +37,7 @@ class Help implements HelpInterface */ public function getFromGithub($route) { - $uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/' . e($route) . '.md'; + $uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/en/' . e($route) . '.md'; $content = [ 'text' => '

There is no help for this route!

', 'title' => $route, diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index c1f3863e0e..ce160a0d88 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -33,6 +33,7 @@ class ReportHelper implements ReportHelperInterface protected $query; /** + * @codeCoverageIgnore * @param ReportQueryInterface $query * */ @@ -62,6 +63,13 @@ class ReportHelper implements ReportHelperInterface $end = 0; $diff = 0; + // remove cash account, if any: + $accounts =$accounts->filter(function(Account $account) { + if($account->accountType->type != 'Cash account') { + return $account; + } + }); + // summarize: foreach ($accounts as $account) { $start += $account->startBalance; @@ -129,7 +137,7 @@ class ReportHelper implements ReportHelperInterface $balanceEntry->setAccount($account); // get spent: - $spent = $this->query->spentInBudget($account, $budget, $start, $end); // I think shared is irrelevant. + $spent = $this->query->spentInBudgetCorrected($account, $budget, $start, $end); // I think shared is irrelevant. $balanceEntry->setSpent($spent); $line->addBalanceEntry($balanceEntry); @@ -247,7 +255,7 @@ class ReportHelper implements ReportHelperInterface // no repetition(s) for this budget: if ($repetitions->count() == 0) { - $spent = $repository->spentInPeriod($budget, $start, $end, $shared); + $spent = $repository->spentInPeriodCorrected($budget, $start, $end, $shared); $budgetLine = new BudgetLine; $budgetLine->setBudget($budget); $budgetLine->setOverspent($spent); @@ -262,7 +270,7 @@ class ReportHelper implements ReportHelperInterface $budgetLine = new BudgetLine; $budgetLine->setBudget($budget); $budgetLine->setRepetition($repetition); - $expenses = $repository->spentInPeriod($budget, $repetition->startdate, $repetition->enddate, $shared); + $expenses = $repository->spentInPeriodCorrected($budget, $repetition->startdate, $repetition->enddate, $shared); $left = $expenses < floatval($repetition->amount) ? floatval($repetition->amount) - $expenses : 0; $spent = $expenses > floatval($repetition->amount) ? 0 : $expenses; $overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0; @@ -311,7 +319,7 @@ class ReportHelper implements ReportHelperInterface $repository = App::make('FireflyIII\Repositories\Category\CategoryRepositoryInterface'); $set = $repository->getCategories(); foreach ($set as $category) { - $spent = $repository->spentInPeriod($category, $start, $end, $shared); + $spent = $repository->spentInPeriodCorrected($category, $start, $end, $shared); $category->spent = $spent; $object->addCategory($category); $object->addTotal($spent); @@ -332,9 +340,9 @@ class ReportHelper implements ReportHelperInterface public function getExpenseReport($start, $end, $shared) { $object = new Expense; - $set = $this->query->expenseInPeriod($start, $end, $shared); + $set = $this->query->expenseInPeriodCorrected($start, $end, $shared); foreach ($set as $entry) { - $object->addToTotal($entry->queryAmount); + $object->addToTotal($entry->amount); $object->addOrCreateExpense($entry); } @@ -353,9 +361,9 @@ class ReportHelper implements ReportHelperInterface public function getIncomeReport($start, $end, $shared) { $object = new Income; - $set = $this->query->incomeInPeriod($start, $end, $shared); + $set = $this->query->incomeInPeriodCorrected($start, $end, $shared); foreach ($set as $entry) { - $object->addToTotal($entry->queryAmount); + $object->addToTotal($entry->amount); $object->addOrCreateIncome($entry); } diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 38fce48ebb..78f4295ea2 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -22,12 +22,8 @@ use Steam; */ class ReportQuery implements ReportQueryInterface { - - /** - * This method returns all "expense" journals in a certain period, which are both transfers to a shared account - * and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does - * not group and returns different fields. + * See ReportQueryInterface::incomeInPeriodCorrected * * @param Carbon $start * @param Carbon $end @@ -36,7 +32,7 @@ class ReportQuery implements ReportQueryInterface * @return Collection * */ - public function expenseInPeriod(Carbon $start, Carbon $end, $includeShared = false) + public function expenseInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false) { $query = $this->queryJournalsWithTransactions($start, $end); if ($includeShared === false) { @@ -59,19 +55,27 @@ class ReportQuery implements ReportQueryInterface } else { $query->where('transaction_types.type', 'Withdrawal'); // any withdrawal is fine. } - $query->groupBy('transaction_journals.id')->orderBy('transaction_journals.date'); + $query->orderBy('transaction_journals.date'); - // get everything, decrypt and return - $data = $query->get(['transaction_journals.id', 'transaction_journals.description', 'transaction_journals.encrypted', 'transaction_types.type', - DB::Raw('SUM(`t_from`.`amount`) as `queryAmount`'), - 'transaction_journals.date', 't_to.account_id as account_id', 'ac_to.name as name', 'ac_to.encrypted as account_encrypted']); + // get everything + $data = $query->get( + ['transaction_journals.*', 'transaction_types.type', 'ac_to.name as name', 'ac_to.id as account_id', 'ac_to.encrypted as account_encrypted'] + ); $data->each( - function (Model $object) { - $object->name = intval($object->account_encrypted) == 1 ? Crypt::decrypt($object->name) : $object->name; + function (TransactionJournal $journal) { + if (intval($journal->account_encrypted) == 1) { + $journal->name = Crypt::decrypt($journal->name); + } + } + ); + $data = $data->filter( + function (TransactionJournal $journal) { + if ($journal->amount != 0) { + return $journal; + } } ); - $data->sortByDesc('queryAmount'); return $data; } @@ -127,9 +131,14 @@ class ReportQuery implements ReportQueryInterface /** + * This method works the same way as ReportQueryInterface::incomeInPeriod does, but instead of returning results + * will simply list the transaction journals only. This should allow any follow up counting to be accurate with + * regards to tags. + * * This method returns all "income" journals in a certain period, which are both transfers from a shared account * and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does * not group and returns different fields. + * * @param Carbon $start * @param Carbon $end @@ -137,7 +146,7 @@ class ReportQuery implements ReportQueryInterface * * @return Collection */ - public function incomeInPeriod(Carbon $start, Carbon $end, $includeShared = false) + public function incomeInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false) { $query = $this->queryJournalsWithTransactions($start, $end); if ($includeShared === false) { @@ -163,35 +172,34 @@ class ReportQuery implements ReportQueryInterface // any deposit is fine. $query->where('transaction_types.type', 'Deposit'); } - $query->groupBy('transaction_journals.id')->orderBy('transaction_journals.date'); + $query->orderBy('transaction_journals.date'); - // get everything, decrypt and return + // get everything $data = $query->get( - ['transaction_journals.id', - 'transaction_journals.description', - 'transaction_journals.encrypted', - 'transaction_types.type', - DB::Raw('SUM(`t_to`.`amount`) as `queryAmount`'), - 'transaction_journals.date', - 't_from.account_id as account_id', - 'ac_from.name as name', - 'ac_from.encrypted as account_encrypted' - ] + ['transaction_journals.*', 'transaction_types.type', 'ac_from.name as name', 'ac_from.id as account_id', 'ac_from.encrypted as account_encrypted'] ); $data->each( - function (Model $object) { - $object->name = intval($object->account_encrypted) == 1 ? Crypt::decrypt($object->name) : $object->name; + function (TransactionJournal $journal) { + if (intval($journal->account_encrypted) == 1) { + $journal->name = Crypt::decrypt($journal->name); + } + } + ); + $data = $data->filter( + function (TransactionJournal $journal) { + if ($journal->amount != 0) { + return $journal; + } } ); - $data->sortByDesc('queryAmount'); return $data; } - - /** + * Covers tags + * * @param Account $account * @param Budget $budget * @param Carbon $start @@ -199,21 +207,20 @@ class ReportQuery implements ReportQueryInterface * * @return float */ - public function spentInBudget(Account $account, Budget $budget, Carbon $start, Carbon $end) + public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end) { return floatval( - Auth::user()->transactionjournals() - ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') - ->transactionTypes(['Withdrawal']) - ->where('transactions.amount', '<', 0) - ->where('transactions.account_id', $account->id) - ->before($end) - ->after($start) - ->where('budget_transaction_journal.budget_id', $budget->id) - ->sum('transactions.amount') - ); + Auth::user()->transactionjournals() + ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') + ->transactionTypes(['Withdrawal']) + ->where('transactions.account_id', $account->id) + ->before($end) + ->after($start) + ->where('budget_transaction_journal.budget_id', $budget->id) + ->get(['transaction_journals.*'])->sum('amount') + ) * -1; } /** diff --git a/app/Helpers/Report/ReportQueryInterface.php b/app/Helpers/Report/ReportQueryInterface.php index bcf36e45da..fc46ab8255 100644 --- a/app/Helpers/Report/ReportQueryInterface.php +++ b/app/Helpers/Report/ReportQueryInterface.php @@ -16,32 +16,8 @@ interface ReportQueryInterface { /** - * Get a users accounts combined with various meta-data related to the start and end date. + * See ReportQueryInterface::incomeInPeriodCorrected * - * @param Carbon $start - * @param Carbon $end - * @param bool $includeShared - * - * @return Collection - */ - public function getAllAccounts(Carbon $start, Carbon $end, $includeShared = false); - - - /** - * This method returns all "income" journals in a certain period, which are both transfers from a shared account - * and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does - * not group and returns different fields. - * - * @param Carbon $start - * @param Carbon $end - * @param bool $includeShared - * - * @return Collection - * - */ - public function incomeInPeriod(Carbon $start, Carbon $end, $includeShared = false); - - /** * This method returns all "expense" journals in a certain period, which are both transfers to a shared account * and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does * not group and returns different fields. @@ -53,10 +29,35 @@ interface ReportQueryInterface * @return Collection * */ - public function expenseInPeriod(Carbon $start, Carbon $end, $includeShared = false); - + public function expenseInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false); /** + * Get a users accounts combined with various meta-data related to the start and end date. + * + * @param Carbon $start + * @param Carbon $end + * @param bool $includeShared + * + * @return Collection + */ + public function getAllAccounts(Carbon $start, Carbon $end, $includeShared = false); + + /** + * This method works the same way as ReportQueryInterface::incomeInPeriod does, but instead of returning results + * will simply list the transaction journals only. This should allow any follow up counting to be accurate with + * regards to tags. + * + * @param Carbon $start + * @param Carbon $end + * @param bool $includeShared + * + * @return Collection + */ + public function incomeInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false); + + /** + * Covers tags as well. + * * @param Account $account * @param Budget $budget * @param Carbon $start @@ -64,7 +65,7 @@ interface ReportQueryInterface * * @return float */ - public function spentInBudget(Account $account, Budget $budget, Carbon $start, Carbon $end); + public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end); /** * @param Account $account diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 1e55f4b445..f8ac8373aa 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -96,7 +96,7 @@ class AccountController extends Controller { $what = Config::get('firefly.shortNamesByFullName')[$account->accountType->type]; - $subTitle = 'Edit ' . strtolower(e($account->accountType->type)) . ' "' . e($account->name) . '"'; + $subTitle = trans('firefly.edit_' . $what . '_account', ['name' => $account->name]); $subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what); $openingBalance = $repository->openingBalanceTransaction($account); @@ -170,7 +170,7 @@ class AccountController extends Controller $subTitleIcon = Config::get('firefly.subTitlesByIdentifier.' . $account->accountType->type); $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); $journals = $repository->getJournals($account, $page); - $subTitle = 'Details for ' . strtolower(e($account->accountType->type)) . ' "' . e($account->name) . '"'; + $subTitle = trans('firefly.details_for_' . $what, ['name' => $account->name]); $journals->setPath('accounts/show/' . $account->id); diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index a2877aa940..a5ea27d221 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -7,7 +7,6 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Bill; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; -use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface; use Input; use Redirect; diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index c62d06a799..6cab6dbf2c 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -60,7 +60,7 @@ class BudgetController extends Controller Session::put('budgets.create.url', URL::previous()); } Session::forget('budgets.create.fromStore'); - $subTitle = 'Create a new budget'; + $subTitle = trans('firefly.create_new_budget'); return view('budgets.create', compact('subTitle')); } @@ -138,7 +138,7 @@ class BudgetController extends Controller function (Budget $budget) use ($repository) { $date = Session::get('start', Carbon::now()->startOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth()); - $budget->spent = $repository->spentInPeriod($budget, $date, $end); + $budget->spent = $repository->spentInPeriodCorrected($budget, $date, $end); $budget->currentRep = $repository->getCurrentRepetition($budget, $date); } ); diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 530e032851..5460b9212b 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -147,4 +147,4 @@ class AccountController extends Controller return Response::json($chart->getData()); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index f32611d055..567caf1abc 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -138,4 +138,4 @@ class BillController extends Controller return Response::json($chart->getData()); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 11031f865a..a6e61d7ab0 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -9,6 +9,8 @@ use FireflyIII\Models\LimitRepetition; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Grumpydictator\Gchart\GChart; use Illuminate\Support\Collection; +use Navigation; +use Preferences; use Response; use Session; @@ -19,6 +21,39 @@ use Session; */ class BudgetController extends Controller { + /** + * @param GChart $chart + * @param BudgetRepositoryInterface $repository + * @param Budget $budget + */ + public function budget(GChart $chart, BudgetRepositoryInterface $repository, Budget $budget) + { + $chart->addColumn(trans('firefly.period'), 'date'); + $chart->addColumn(trans('firefly.spent'), 'number'); + + + $first = $repository->getFirstBudgetLimitDate($budget); + $range = $viewRange = Preferences::get('viewRange', '1M')->data; + $last = Session::get('end', new Carbon); + $final = clone $last; + $final->addYears(2); + $last = Navigation::endOfX($last, $range, $final); + + while ($first < $last) { + $end = Navigation::addPeriod($first, $range, 0); + + $spent = $repository->spentInPeriodCorrected($budget, $first, $end); + $chart->addRow($end, $spent); + + + $first = Navigation::addPeriod($first, $range, 0); + } + + $chart->generate(); + + return Response::json($chart->getData()); + } + /** * Shows the amount left in a specific budget limit. * @@ -44,7 +79,7 @@ class BudgetController extends Controller /* * Sum of expenses on this day: */ - $sum = $repository->expensesOnDay($budget, $start); + $sum = $repository->expensesOnDayCorrected($budget, $start); $amount += $sum; $chart->addRow(clone $start, $amount); $start->addDay(); @@ -78,15 +113,15 @@ class BudgetController extends Controller foreach ($budgets as $budget) { $repetitions = $repository->getBudgetLimitRepetitions($budget, $start, $end); if ($repetitions->count() == 0) { - $expenses = $repository->spentInPeriod($budget, $start, $end, true); + $expenses = $repository->spentInPeriodCorrected($budget, $start, $end, true); $allEntries->push([$budget->name, 0, 0, $expenses]); continue; } /** @var LimitRepetition $repetition */ foreach ($repetitions as $repetition) { - $expenses = $repository->spentInPeriod($budget, $repetition->startdate, $repetition->enddate, true); + $expenses = $repository->spentInPeriodCorrected($budget, $repetition->startdate, $repetition->enddate, true); $left = $expenses < floatval($repetition->amount) ? floatval($repetition->amount) - $expenses : 0; - $spent = $expenses > floatval($repetition->amount) ? 0 : $expenses; + $spent = $expenses > floatval($repetition->amount) ? floatval($repetition->amount) : $expenses; $overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0; $allEntries->push( [$budget->name . ' (' . $repetition->startdate->formatLocalized($this->monthAndDayFormat) . ')', @@ -145,7 +180,7 @@ class BudgetController extends Controller // each budget, fill the row: foreach ($budgets as $budget) { - $spent = $repository->spentInPeriod($budget, $start, $month, $shared); + $spent = $repository->spentInPeriodCorrected($budget, $start, $month, $shared); $row[] = $spent; } $chart->addRowArray($row); @@ -157,4 +192,4 @@ class BudgetController extends Controller return Response::json($chart->getData()); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index b51120ebc1..b067803f0b 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -4,7 +4,6 @@ namespace FireflyIII\Http\Controllers\Chart; use Carbon\Carbon; -use Crypt; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Category; use FireflyIII\Models\LimitRepetition; @@ -50,7 +49,7 @@ class CategoryController extends Controller while ($start <= $end) { $currentEnd = Navigation::endOfPeriod($start, $range); - $spent = $repository->spentInPeriod($category, $start, $currentEnd); + $spent = $repository->spentInPeriodCorrected($category, $start, $currentEnd); $chart->addRow(clone $start, $spent); $start = Navigation::addPeriod($start, $range, 0); @@ -78,13 +77,26 @@ class CategoryController extends Controller $start = Session::get('start', Carbon::now()->startOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth()); - $set = $repository->getCategoriesAndExpenses($start, $end); + $set = $repository->getCategoriesAndExpensesCorrected($start, $end); + + // sort by callback: + uasort( + $set, + function ($left, $right) { + if ($left['sum'] == $right['sum']) { + return 0; + } + + return ($left['sum'] < $right['sum']) ? 1 : -1; + } + ); + foreach ($set as $entry) { - $isEncrypted = intval($entry->encrypted) == 1 ? true : false; - $name = strlen($entry->name) == 0 ? trans('firefly.noCategory') : $entry->name; - $name = $isEncrypted ? Crypt::decrypt($name) : $name; - $chart->addRow($name, floatval($entry->sum)); + $sum = floatval($entry['sum']); + if ($sum != 0) { + $chart->addRow($entry['name'], $sum); + } } $chart->generate(); @@ -109,7 +121,7 @@ class CategoryController extends Controller $chart->addColumn(trans('firefly.spent'), 'number'); while ($start <= $end) { - $spent = $repository->spentOnDaySum($category, $start); + $spent = $repository->spentOnDaySumCorrected($category, $start); $chart->addRow(clone $start, $spent); $start->addDay(); } @@ -153,7 +165,7 @@ class CategoryController extends Controller // each budget, fill the row: foreach ($categories as $category) { - $spent = $repository->spentInPeriod($category, $start, $month, $shared); + $spent = $repository->spentInPeriodCorrected($category, $start, $month, $shared); $row[] = $spent; } $chart->addRowArray($row); @@ -165,4 +177,4 @@ class CategoryController extends Controller return Response::json($chart->getData()); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index d240afa583..e3b05f55f7 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -55,4 +55,4 @@ class PiggyBankController extends Controller return Response::json($chart->getData()); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 0980cf9525..a474f1ac51 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -43,8 +43,8 @@ class ReportController extends Controller $month = clone $start; $month->endOfMonth(); // total income and total expenses: - $incomeSum = floatval($query->incomeInPeriod($start, $month, $shared)->sum('queryAmount')); - $expenseSum = floatval($query->expenseInPeriod($start, $month, $shared)->sum('queryAmount')) * -1; + $incomeSum = floatval($query->incomeInPeriodCorrected($start, $month, $shared)->sum('amount')); + $expenseSum = floatval($query->expenseInPeriodCorrected($start, $month, $shared)->sum('amount')); $chart->addRow(clone $start, $incomeSum, $expenseSum); $start->addMonth(); @@ -82,8 +82,8 @@ class ReportController extends Controller $month = clone $start; $month->endOfMonth(); // total income and total expenses: - $income += floatval($query->incomeInPeriod($start, $month, $shared)->sum('queryAmount')); - $expense += floatval($query->expenseInPeriod($start, $month, $shared)->sum('queryAmount')) * -1; + $income += floatval($query->incomeInPeriodCorrected($start, $month, $shared)->sum('amount')); + $expense += floatval($query->expenseInPeriodCorrected($start, $month, $shared)->sum('amount')); $count++; $start->addMonth(); } @@ -98,4 +98,4 @@ class ReportController extends Controller return Response::json($chart->getData()); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index 8c4f64e97a..3f47dbdc67 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -122,7 +122,12 @@ class JsonController extends Controller { $start = Session::get('start', Carbon::now()->startOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth()); - $amount = $reportQuery->incomeInPeriod($start, $end, true)->sum('queryAmount'); + $amount = $reportQuery->incomeInPeriodCorrected($start, $end, true)->sum('amount'); + // $amount = 0; + // foreach($set as $entry) { + // //echo $entry->description.' ('.$entry->tags->count().'): ' . $entry->amount."\n"; + // $amount += $entry->amount; + // } return Response::json(['box' => 'in', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]); } @@ -136,7 +141,7 @@ class JsonController extends Controller { $start = Session::get('start', Carbon::now()->startOfMonth()); $end = Session::get('end', Carbon::now()->endOfMonth()); - $amount = $reportQuery->expenseInPeriod($start, $end, true)->sum('queryAmount') * -1; + $amount = $reportQuery->expenseInPeriodCorrected($start, $end, true)->sum('amount'); return Response::json(['box' => 'out', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]); } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 90cd841829..09a65833d7 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -133,7 +133,7 @@ class TagController extends Controller * changes to an advancePayment. */ - if ($tag->tagMode == 'balancingAct') { + if ($tag->tagMode == 'balancingAct' || $tag->tagMode == 'nothing') { foreach ($tag->transactionjournals as $journal) { if ($journal->transactionType->type == 'Transfer') { $allowToAdvancePayment = false; diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index e8a0c23a81..8188ceb1f1 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -149,7 +149,7 @@ class TransactionController extends Controller $preFilled['piggy_bank_id'] = $journal->piggyBankEvents()->orderBy('date', 'DESC')->first()->piggy_bank_id; } - $preFilled['amount'] = $journal->amount; + $preFilled['amount'] = $journal->actualAmount; $preFilled['account_id'] = $journal->assetAccount->id; $preFilled['expense_account'] = $transactions[0]->account->name; $preFilled['revenue_account'] = $transactions[1]->account->name; diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 9faf2b4e00..64ceaff4c4 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -55,10 +55,10 @@ class Range if (!Session::has('start') && !Session::has('end')) { /** @var \FireflyIII\Models\Preference $viewRange */ - $viewRange = Preferences::get('viewRange', '1M'); + $viewRange = Preferences::get('viewRange', '1M')->data; $start = new Carbon; - $start = Navigation::updateStartDate($viewRange->data, $start); - $end = Navigation::updateEndDate($viewRange->data, $start); + $start = Navigation::updateStartDate($viewRange, $start); + $end = Navigation::updateEndDate($viewRange, $start); Session::put('start', $start); Session::put('end', $end); @@ -73,9 +73,9 @@ class Range Session::put('first', Carbon::now()->startOfYear()); } } - $current = Carbon::now()->format('F Y'); - $next = Carbon::now()->endOfMonth()->addDay()->format('F Y'); - $prev = Carbon::now()->startOfMonth()->subDay()->format('F Y'); + $current = Carbon::now()->formatLocalized('%B %Y'); + $next = Carbon::now()->endOfMonth()->addDay()->formatLocalized('%B %Y'); + $prev = Carbon::now()->startOfMonth()->subDay()->formatLocalized('%B %Y'); View::share('currentMonthName', $current); View::share('previousMonthName', $prev); View::share('nextMonthName', $next); diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index 5f3c45adfb..289eec2ca5 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -50,25 +50,10 @@ Breadcrumbs::register( Breadcrumbs::register( 'accounts.show', function (Generator $breadcrumbs, Account $account) { - switch ($account->accountType->type) { - default: - throw new FireflyException('Cannot handle account type "' . e($account->accountType->type) . '"'); - break; - case 'Default account': - case 'Asset account': - $what = 'asset'; - break; - case 'Cash account': - $what = 'cash'; - break; - case 'Expense account': - case 'Beneficiary account': - $what = 'expense'; - break; - case 'Revenue account': - $what = 'revenue'; - break; - } + + $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); + + $breadcrumbs->parent('accounts.index', $what); $breadcrumbs->push(e($account->name), route('accounts.show', $account->id)); } @@ -84,7 +69,9 @@ Breadcrumbs::register( Breadcrumbs::register( 'accounts.edit', function (Generator $breadcrumbs, Account $account) { $breadcrumbs->parent('accounts.show', $account); - $breadcrumbs->push(trans('breadcrumbs.edit_account', ['name' => e($account->name)]), route('accounts.edit', $account->id)); + $what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type); + + $breadcrumbs->push(trans('breadcrumbs.edit_'.$what.'_account', ['name' => e($account->name)]), route('accounts.edit', $account->id)); } ); diff --git a/app/Http/routes.php b/app/Http/routes.php index c5b4ed80af..1987fbd585 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -188,7 +188,7 @@ Route::get('/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'r Route::controllers( [ - 'auth' => 'Auth\AuthController', + 'auth' => 'Auth\AuthController', 'password' => 'Auth\PasswordController', ] ); @@ -276,7 +276,9 @@ Route::group( */ // accounts: Route::get('/chart/account/frontpage', ['uses' => 'Chart\AccountController@frontpage']); - Route::get('/chart/account/month/{year}/{month}/{shared?}', ['uses' => 'Chart\AccountController@all'])->where(['year' => '[0-9]{4}', 'month' => '[0-9]{1,2}', 'shared' => 'shared']); + Route::get('/chart/account/month/{year}/{month}/{shared?}', ['uses' => 'Chart\AccountController@all'])->where( + ['year' => '[0-9]{4}', 'month' => '[0-9]{1,2}', 'shared' => 'shared'] + ); Route::get('/chart/account/{account}', ['uses' => 'Chart\AccountController@single']); @@ -288,6 +290,7 @@ Route::group( Route::get('/chart/budget/frontpage', ['uses' => 'Chart\BudgetController@frontpage']); Route::get('/chart/budget/year/{year}/{shared?}', ['uses' => 'Chart\BudgetController@year'])->where(['year' => '[0-9]{4}', 'shared' => 'shared']); Route::get('/chart/budget/{budget}/{limitrepetition}', ['uses' => 'Chart\BudgetController@budgetLimit']); + Route::get('/chart/budget/{budget}', ['uses' => 'Chart\BudgetController@budget']); // categories: Route::get('/chart/category/frontpage', ['uses' => 'Chart\CategoryController@frontpage']); diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 9bbe977e46..b65b400f64 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -96,18 +96,42 @@ class TransactionJournal extends Model } // if journal is part of advancePayment AND journal is a withdrawal, // then journal is being repaid by other journals, so the actual amount will lower: - /** @var Tag $tag */ - $tag = $this->tags()->where('tagMode', 'advancePayment')->first(); - if ($tag && $this->transactionType->type == 'Withdrawal') { + /** @var Tag $advancePayment */ + $advancePayment = $this->tags()->where('tagMode', 'advancePayment')->first(); + if ($advancePayment && $this->transactionType->type == 'Withdrawal') { + // loop other deposits, remove from our amount. - $others = $tag->transactionJournals()->transactionTypes(['Deposit'])->get(); + $others = $advancePayment->transactionJournals()->transactionTypes(['Deposit'])->get(); foreach ($others as $other) { - $amount -= $other->amount; + $amount -= $other->actualAmount; } return $amount; } + // if this journal is part of an advancePayment AND the journal is a deposit, + // then the journal amount is correcting a withdrawal, and the amount is zero: + if ($advancePayment && $this->transactionType->type == 'Deposit') { + return 0; + } + + + // is balancing act? + $balancingAct = $this->tags()->where('tagMode', 'balancingAct')->first(); + if ($balancingAct) { + // this is the transfer + + // this is the expense: + if ($this->transactionType->type == 'Withdrawal') { + $transfer = $balancingAct->transactionJournals()->transactionTypes(['Transfer'])->first(); + if ($transfer) { + $amount -= $transfer->actualAmount; + + return $amount; + } + } + } + return $amount; } diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index b5e7cfcd31..c8ff2053eb 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -306,7 +306,7 @@ class AccountRepository implements AccountRepositoryInterface /** * @param Account $account - * @param Carbon $date + * @param Carbon $date * * @return float */ diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 1a25f120d5..605f8c15c2 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -115,7 +115,7 @@ interface AccountRepositoryInterface /** * @param Account $account - * @param Carbon $date + * @param Carbon $date * * @return float */ diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 96a5899e13..1a0b4f0823 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -49,9 +49,11 @@ class BudgetRepository implements BudgetRepositoryInterface * * @return float */ - public function expensesOnDay(Budget $budget, Carbon $date) + public function expensesOnDayCorrected(Budget $budget, Carbon $date) { - return floatval($budget->transactionjournals()->lessThan(0)->transactionTypes(['Withdrawal'])->onDate($date)->sum('amount')); + $sum = floatval($budget->transactionjournals()->transactionTypes(['Withdrawal'])->onDate($date)->get(['transaction_journals.*'])->sum('amount')); + + return $sum * -1; } /** @@ -99,6 +101,7 @@ class BudgetRepository implements BudgetRepositoryInterface public function getBudgets() { $budgets = Auth::user()->budgets()->get(); + return $budgets; } @@ -262,11 +265,11 @@ class BudgetRepository implements BudgetRepositoryInterface * * @return float */ - public function spentInPeriod(Budget $budget, Carbon $start, Carbon $end, $shared = true) + public function spentInPeriodCorrected(Budget $budget, Carbon $start, Carbon $end, $shared = true) { if ($shared === true) { // get everything: - $sum = floatval($budget->transactionjournals()->before($end)->after($start)->lessThan(0)->sum('amount')) * -1; + $sum = floatval($budget->transactionjournals()->before($end)->after($start)->lessThan(0)->get(['transaction_journals.*'])->sum('amount')); } else { // get all journals in this month where the asset account is NOT shared. $sum = $budget->transactionjournals() @@ -280,8 +283,9 @@ class BudgetRepository implements BudgetRepositoryInterface } ) ->where('account_meta.data', '!=', '"sharedAsset"') + ->get(['transaction_journals.*']) ->sum('amount'); - $sum = floatval($sum) * -1; + $sum = floatval($sum); } return $sum; @@ -305,17 +309,7 @@ class BudgetRepository implements BudgetRepositoryInterface return $newBudget; } - /** - * @param Budget $budget - * @param Carbon $start - * @param Carbon $end - * - * @return float - */ - public function sumBudgetExpensesInPeriod(Budget $budget, $start, $end) - { - return floatval($budget->transactionjournals()->before($end)->after($start)->lessThan(0)->sum('amount')) * -1; - } + /** * @param Budget $budget diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index fc65660310..b928ed35df 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -27,12 +27,14 @@ interface BudgetRepositoryInterface public function destroy(Budget $budget); /** + * Takes tags into account. + * * @param Budget $budget * @param Carbon $date * * @return float */ - public function expensesOnDay(Budget $budget, Carbon $date); + public function expensesOnDayCorrected(Budget $budget, Carbon $date); /** * @return Collection @@ -123,14 +125,17 @@ interface BudgetRepositoryInterface public function getWithoutBudgetSum(Carbon $start, Carbon $end); /** - * @param Budget $budget - * @param Carbon $start - * @param Carbon $end + * + * Same as ::spentInPeriod but corrects journals for their amount (tags). + * + * @param Budget $budget + * @param Carbon $start + * @param Carbon $end * @param boolean $shared * * @return float */ - public function spentInPeriod(Budget $budget, Carbon $start, Carbon $end, $shared = true); + public function spentInPeriodCorrected(Budget $budget, Carbon $start, Carbon $end, $shared = true); /** * @param array $data @@ -139,15 +144,6 @@ interface BudgetRepositoryInterface */ public function store(array $data); - /** - * @param Budget $budget - * @param Carbon $start - * @param Carbon $end - * - * @return float - */ - public function sumBudgetExpensesInPeriod(Budget $budget, $start, $end); - /** * @param Budget $budget * @param array $data diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index e67a9db2a8..a6c7de1d3c 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -4,6 +4,7 @@ namespace FireflyIII\Repositories\Category; use Auth; use Carbon\Carbon; +use Crypt; use DB; use FireflyIII\Models\Category; use FireflyIII\Models\TransactionJournal; @@ -58,33 +59,44 @@ class CategoryRepository implements CategoryRepositoryInterface } /** + * * @param Carbon $start * @param Carbon $end * * @return Collection */ - public function getCategoriesAndExpenses($start, $end) + public function getCategoriesAndExpensesCorrected($start, $end) { - return TransactionJournal:: - where('transaction_journals.user_id', Auth::user()->id) - ->leftJoin( - 'transactions', - function (JoinClause $join) { - $join->on('transaction_journals.id', '=', 'transactions.transaction_journal_id')->where('amount', '>', 0); - } - ) - ->leftJoin( - 'category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id' - ) - ->leftJoin('categories', 'categories.id', '=', 'category_transaction_journal.category_id') - ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') - ->before($end) - ->where('categories.user_id', Auth::user()->id) - ->after($start) - ->where('transaction_types.type', 'Withdrawal') - ->groupBy('categories.id') - ->orderBy('sum', 'DESC') - ->get(['categories.id', 'categories.encrypted', 'categories.name', DB::Raw('SUM(`transactions`.`amount`) AS `sum`')]); + $set = Auth::user()->transactionjournals() + ->leftJoin( + 'category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id' + ) + ->leftJoin('categories', 'categories.id', '=', 'category_transaction_journal.category_id') + ->before($end) + ->where('categories.user_id', Auth::user()->id) + ->after($start) + ->transactionTypes(['Withdrawal']) + ->groupBy('categories.id') + ->get(['categories.id as category_id', 'categories.encrypted as category_encrypted', 'categories.name', 'transaction_journals.*']); + + $result = []; + foreach ($set as $entry) { + $categoryId = intval($entry->category_id); + if (isset($result[$categoryId])) { + $result[$categoryId]['sum'] += floatval($entry->amount); + } else { + $isEncrypted = intval($entry->category_encrypted) == 1 ? true : false; + $name = strlen($entry->name) == 0 ? trans('firefly.noCategory') : $entry->name; + $name = $isEncrypted ? Crypt::decrypt($name) : $name; + $result[$categoryId] = [ + 'name' => $name, + 'sum' => floatval($entry->amount), + ]; + + } + } + + return $result; } /** @@ -172,16 +184,16 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return float */ - public function spentInPeriod(Category $category, Carbon $start, Carbon $end, $shared = false) + public function spentInPeriodCorrected(Category $category, Carbon $start, Carbon $end, $shared = false) { if ($shared === true) { // shared is true. // always ignore transfers between accounts! $sum = floatval( - $category->transactionjournals() - ->transactionTypes(['Withdrawal']) - ->before($end)->after($start)->lessThan(0)->sum('amount') - ) * -1; + $category->transactionjournals() + ->transactionTypes(['Withdrawal']) + ->before($end)->after($start)->get(['transaction_journals.*'])->sum('amount') + ); } else { // do something else, SEE budgets. @@ -198,22 +210,24 @@ class CategoryRepository implements CategoryRepositoryInterface } ) ->where('account_meta.data', '!=', '"sharedAsset"') - ->sum('amount'); - $sum = floatval($sum) * -1; + ->get(['transaction_journals.*'])->sum('amount'); + $sum = floatval($sum); } return $sum; } /** + * Corrected for tags + * * @param Category $category * @param Carbon $date * * @return float */ - public function spentOnDaySum(Category $category, Carbon $date) + public function spentOnDaySumCorrected(Category $category, Carbon $date) { - return floatval($category->transactionjournals()->onDate($date)->lessThan(0)->sum('amount')) * -1; + return floatval($category->transactionjournals()->onDate($date)->get(['transaction_journals.*'])->sum('amount')); } /** diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index 2c1355c057..524b2ce443 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -33,12 +33,14 @@ interface CategoryRepositoryInterface public function getCategories(); /** + * Corrected for tags. + * * @param Carbon $start * @param Carbon $end * * @return Collection */ - public function getCategoriesAndExpenses($start, $end); + public function getCategoriesAndExpensesCorrected($start, $end); /** * @param Category $category @@ -71,6 +73,8 @@ interface CategoryRepositoryInterface public function getWithoutCategory(Carbon $start, Carbon $end); /** + * Corrected for tags. + * * @param Category $category * @param \Carbon\Carbon $start * @param \Carbon\Carbon $end @@ -79,15 +83,18 @@ interface CategoryRepositoryInterface * * @return float */ - public function spentInPeriod(Category $category, Carbon $start, Carbon $end, $shared = false); + public function spentInPeriodCorrected(Category $category, Carbon $start, Carbon $end, $shared = false); /** + * + * Corrected for tags. + * * @param Category $category * @param Carbon $date * * @return float */ - public function spentOnDaySum(Category $category, Carbon $date); + public function spentOnDaySumCorrected(Category $category, Carbon $date); /** * @param array $data diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index ab4ad796b3..cc847817b7 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -9,7 +9,6 @@ use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\PiggyBankRepetition; use Illuminate\Support\Collection; -use Navigation; /** * Class PiggyBankRepository diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 750a0edd84..e117e7ba1b 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -51,7 +51,8 @@ class ExpandedForm if (isset($options['label'])) { return $options['label']; } - return trans('form.'.$name); + + return trans('form.' . $name); } diff --git a/app/Support/Twig/Budget.php b/app/Support/Twig/Budget.php index 046e741446..787f14bd39 100644 --- a/app/Support/Twig/Budget.php +++ b/app/Support/Twig/Budget.php @@ -39,6 +39,22 @@ class Budget extends Twig_Extension } ); + $functions[] = new Twig_SimpleFunction( + 'spentInRepetitionCorrected', function (LimitRepetition $repetition) { + $sum + = Auth::user()->transactionjournals() + ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') + ->leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budget_transaction_journal.budget_id') + ->leftJoin('limit_repetitions', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id') + ->before($repetition->enddate) + ->after($repetition->startdate) + ->where('limit_repetitions.id', '=', $repetition->id) + ->get(['transaction_journals.*'])->sum('amount'); + + return floatval($sum); + } + ); + return $functions; } diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index 299cdaf6d6..a77e29692b 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -85,6 +85,7 @@ class Journal extends Twig_Extension // return tag formatted for a "balancing act", even if other // tags are present. $amount = App::make('amount')->formatJournal($journal, false); + return ' ' . $tag->tag . ''; } @@ -94,6 +95,7 @@ class Journal extends Twig_Extension */ if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Deposit') { $amount = App::make('amount')->formatJournal($journal, false); + return ' ' . $tag->tag . ''; } @@ -103,6 +105,7 @@ class Journal extends Twig_Extension */ if ($tag->tagMode == 'advancePayment' && $journal->transactionType->type == 'Withdrawal') { $amount = App::make('amount')->formatJournal($journal); + return '' . $amount . ''; } diff --git a/config/firefly.php b/config/firefly.php index aa8bb76867..95182d0d21 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -56,6 +56,7 @@ return [ 'asset' => 'Asset accounts', 'expense' => 'Expense accounts', 'revenue' => 'Revenue accounts', + 'cash' => 'Cash accounts', ], 'subIconsByIdentifier' => [ diff --git a/public/js/budgets.js b/public/js/budgets.js index b4820c206d..1ab91d8b23 100644 --- a/public/js/budgets.js +++ b/public/js/budgets.js @@ -8,7 +8,7 @@ $(function () { if (typeof budgetID !== 'undefined' && typeof repetitionID === 'undefined') { - googleColumnChart('chart/budget/' + budgetID + '/spending', 'budgetOverview'); + googleColumnChart('chart/budget/' + budgetID, 'budgetOverview'); } if (typeof budgetID !== 'undefined' && typeof repetitionID !== 'undefined') { googleLineChart('chart/budget/' + budgetID + '/' + repetitionID, 'budgetOverview'); @@ -20,7 +20,7 @@ $(function () { function updateSingleRange(e) { // get some values: var input = $(e.target); - var id = input.data('id'); + var id = input.data('id'); var value = parseInt(input.val()); var spent = parseFloat($('#spent-' + id).data('value')); @@ -95,7 +95,9 @@ function updateTotal() { } function updateIncome(e) { - $('#monthlyBudgetModal').empty().load('budgets/income').modal('show'); + $('#monthlyBudgetModal').empty().load('budgets/income', function () { + $('#monthlyBudgetModal').modal('show'); + }); return false; } @@ -112,7 +114,7 @@ function updateRanges() { var value = parseInt(input.val()); // calculate sum: - sum += value + sum += value; // update small display: $('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2)); diff --git a/public/js/firefly.js b/public/js/firefly.js index e0a35830ea..a8c075a761 100644 --- a/public/js/firefly.js +++ b/public/js/firefly.js @@ -6,7 +6,7 @@ $(function () { ranges[currentMonthName] = [moment().startOf('month'), moment().endOf('month')]; ranges[previousMonthName] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]; ranges[nextMonthName] = [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')]; - ranges['Everything'] = [firstDate, moment()]; + ranges[everything] = [firstDate, moment()]; $('#daterange').daterangepicker( { @@ -15,10 +15,19 @@ $(function () { //View::share('nextMonthName', $next); - ranges: ranges - , + ranges: ranges, opens: 'left', - + locale: { + applyLabel: applyLabel, + cancelLabel: cancelLabel, + fromLabel: fromLabel, + toLabel: toLabel, + weekLabel: 'W', + customRangeLabel: customRangeLabel, + daysOfWeek: moment.weekdaysMin(), + monthNames: moment.monthsShort(), + firstDay: moment.localeData()._week.dow + }, format: 'DD-MM-YYYY', startDate: start, endDate: end diff --git a/resources/lang/en/breadcrumbs.php b/resources/lang/en/breadcrumbs.php index 49962c8cf8..4f5ddeadd2 100644 --- a/resources/lang/en/breadcrumbs.php +++ b/resources/lang/en/breadcrumbs.php @@ -2,73 +2,88 @@ return [ 'home' => 'Home', + // accounts 'asset_accounts' => 'Asset accounts', 'expense_accounts' => 'Expense accounts', 'revenue_accounts' => 'Revenue accounts', - + 'cash_accounts' => 'Cash accounts', 'new_asset_account' => 'New asset accounts', 'new_expense_account' => 'New expense account', 'new_revenue_account' => 'New revenue account', - 'delete_account' => 'Delete account ":name"', 'edit_account' => 'Edit account ":name"', + 'edit_asset_account' => 'Edit asset account ":name"', + 'edit_expense_account' => 'Edit expense account ":name"', + 'edit_revenue_account' => 'Edit revenue account ":name"', + // budgets 'budgets' => 'Budgets', 'newBudget' => 'Create a new budget', 'delete_budget' => 'Delete budget ":name"', 'edit_budget' => 'Edit budget ":name"', + // categories 'categories' => 'Categories', 'newCategory' => 'Create a new categori', 'delete_category' => 'Delete category ":name"', 'edit_category' => 'Edit category ":name"', + // currencies 'currencies' => 'Currencies', 'edit_currency' => 'Edit currencies ":name"', 'delete_currency' => 'Delete currencies ":name"', + // piggy banks 'piggyBanks' => 'Piggy banks', 'newPiggyBank' => 'Create a new piggy bank', 'edit_piggyBank' => 'Edit piggy bank ":name"', 'delete_piggyBank' => 'Delete piggy bank ":name"', + // top menu 'preferences' => 'Preferences', 'profile' => 'Profile', 'changePassword' => 'Change your password', + // bills 'bills' => 'Bills', 'newBill' => 'New bill', 'edit_bill' => 'Edit bill ":name"', 'delete_bill' => 'Delete bill ":name"', + // reminders 'reminders' => 'Reminders', 'reminder' => 'Reminder #:id', + // reports 'reports' => 'Reports', 'monthly_report' => 'Montly report for :date', 'monthly_report_shared' => 'Montly report for :date (including shared accounts)', 'yearly_report' => 'Yearly report for :date', 'yearly_report_shared' => 'Yearly report for :date (including shared accounts)', - 'budget_report' => 'Budget report for :date', + // search 'searchResult' => 'Search for ":query"', + // transaction lists. 'withdrawal_list' => 'Expenses', 'deposit_list' => 'Revenue, income and deposits', 'transfer_list' => 'Transfers', 'transfers_list' => 'Transfers', + // create transactions 'create_withdrawal' => 'Create new withdrawal', 'create_deposit' => 'Create new deposit', 'create_transfer' => 'Create new transfer', + // edit transactions 'edit_journal' => 'Edit transaction ":description"', 'delete_journal' => 'Delete transaction ":description"', + // tags 'tags' => 'Tags', 'createTag' => 'Create new tag', 'edit_tag' => 'Edit tag ":tag"', 'delete_tag' => 'Delete tag ":tag"', -]; \ No newline at end of file +]; diff --git a/resources/lang/en/firefly.php b/resources/lang/en/firefly.php index f4150d4695..bffcf4d117 100644 --- a/resources/lang/en/firefly.php +++ b/resources/lang/en/firefly.php @@ -1,161 +1,201 @@ 'You have selected English.', - 'close' => 'Close', - 'pleaseHold' => 'Please hold...', - 'mandatoryFields' => 'Mandatory fields', - 'optionalFields' => 'Optional fields', - 'options' => 'Options', - 'something' => 'Something!', - 'actions' => 'Actions', - 'edit' => 'Edit', - 'delete' => 'Delete', - 'welcomeBack' => 'What\'s playing?', + 'test' => 'You have selected English.', + 'close' => 'Close', + 'pleaseHold' => 'Please hold...', + 'mandatoryFields' => 'Mandatory fields', + 'optionalFields' => 'Optional fields', + 'options' => 'Options', + 'something' => 'Something!', + 'actions' => 'Actions', + 'edit' => 'Edit', + 'delete' => 'Delete', + 'welcomeBack' => 'What\'s playing?', + + 'everything' => 'Everything', + 'customRange' => 'Custom range', + 'apply' => 'Apply', + 'cancel' => 'Cancel', + 'from' => 'From', + 'to' => 'To', + + 'showEverything' => 'Show everything', + 'create_new_budget' => 'Create a new budget', + 'store_new_budget' => ' Store new budget', + + 'availableIn' => 'Available in :date', + 'transactionsWithoutBudget' => 'Expenses without budget', + 'transactionsWithoutBudgetDate' => 'Expenses without budget in :date', + 'createBudget' => 'New budget', + 'inactiveBudgets' => 'Inactive budgets', + 'newCategory' => 'New category', + 'withoutCategory' => 'Without a category', + + '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"', + + 'update_asset_account' => 'Update asset account', + 'update_expense_account' => 'Update expense account', + 'update_revenue_account' => 'Update revenue account', + + 'make_new_asset_account' => 'New asset account', + 'make_new_expense_account' => 'New expense account', + 'make_new_revenue_account' => 'New revenue account', // 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', + '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', + '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', - 'seeAllReminders' => 'See all reminders', - 'reminders' => 'Reminders', - 'currency' => 'Currency', - 'preferences' => 'Preferences', - 'logout' => 'Logout', - 'searchPlaceholder' => 'Search...', - 'dashboard' => 'Dashboard', - 'currencies' => 'Currencies', - 'accounts' => 'Accounts', - 'assetAccounts' => 'Asset accounts', - 'expenseAccounts' => 'Expense accounts', - 'revenueAccounts' => 'Revenue accounts', - 'Asset account' => 'Asset account', - 'Default account' => 'Asset account', - 'Expense account' => 'Expense account', - 'Revenue account' => 'Revenue account', - 'budgets' => 'Budgets', - 'categories' => 'Categories', - 'tags' => 'Tags', - 'reports' => 'Reports', - 'transactions' => 'Transactions', - 'expenses' => 'Expenses', - 'income' => 'Revenue / income', - 'transfers' => 'Transfer', - 'moneyManagement' => 'Money management', - 'piggyBanks' => 'Piggy banks', - 'bills' => 'Bills', - 'createNew' => 'Create new', - 'withdrawal' => 'Withdrawal', - 'deposit' => 'Deposit', - 'transfer' => 'Transfer', - 'Withdrawal' => 'Withdrawal', - 'Deposit' => 'Deposit', - 'Transfer' => 'Transfer', - 'bill' => 'Rekening', - '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', + 'toggleNavigation' => 'Toggle navigation', + 'seeAllReminders' => 'See all reminders', + 'reminders' => 'Reminders', + 'currency' => 'Currency', + 'preferences' => 'Preferences', + 'logout' => 'Logout', + 'searchPlaceholder' => 'Search...', + 'dashboard' => 'Dashboard', + 'currencies' => 'Currencies', + 'accounts' => 'Accounts', + 'assetAccounts' => 'Asset accounts', + 'expenseAccounts' => 'Expense accounts', + 'revenueAccounts' => 'Revenue accounts', + 'Asset account' => 'Asset account', + 'Default account' => 'Asset account', + 'Expense account' => 'Expense account', + 'Revenue account' => 'Revenue account', + 'budgets' => 'Budgets', + 'categories' => 'Categories', + 'tags' => 'Tags', + 'reports' => 'Reports', + 'transactions' => 'Transactions', + 'expenses' => 'Expenses', + 'income' => 'Revenue / income', + 'transfers' => 'Transfer', + 'moneyManagement' => 'Money management', + 'piggyBanks' => 'Piggy banks', + 'bills' => 'Bills', + 'createNew' => 'Create new', + 'withdrawal' => 'Withdrawal', + 'deposit' => 'Deposit', + 'transfer' => 'Transfer', + 'Withdrawal' => 'Withdrawal', + 'Deposit' => 'Deposit', + 'Transfer' => 'Transfer', + 'bill' => 'Rekening', + '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', - 'reportForYear' => 'Yearly report for :year', - 'reportForYearShared' => 'Yearly report for :year (including shared accounts)', - 'reportForMonth' => 'Montly report for :year', - 'reportForMonthShared' => 'Montly report for :year (including shared accounts)', - 'incomeVsExpenses' => 'Income vs. expenses', - 'accountBalances' => 'Account balances', - 'balanceStartOfYear' => 'Balance at start of year', - 'balanceEndOfYear' => 'Balance at end of year', - 'balanceStartOfMonth' => 'Balance at end of month', - 'balanceEndOfMonth' => 'Balance at end of month', + 'reportForYear' => 'Yearly report for :year', + 'reportForYearShared' => 'Yearly report for :year (including shared accounts)', + 'reportForMonth' => 'Montly report for :year', + 'reportForMonthShared' => 'Montly report for :year (including shared accounts)', + 'incomeVsExpenses' => 'Income vs. expenses', + 'accountBalances' => 'Account balances', + 'balanceStartOfYear' => 'Balance at start of year', + 'balanceEndOfYear' => 'Balance at end of year', + 'balanceStartOfMonth' => 'Balance at end of month', + 'balanceEndOfMonth' => 'Balance at end of month', - 'balanceStart' => 'Balance at end of period', - 'balanceEnd' => 'Balance at end of period', + 'balanceStart' => 'Balance at end of period', + 'balanceEnd' => 'Balance at end of period', - 'reportsOwnAccounts' => 'Reports for your own accounts', - 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts', + 'reportsOwnAccounts' => 'Reports for your own accounts', + 'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts', - 'account' => 'Account', + 'account' => 'Account', - 'splitByAccount' => 'Split by account', - 'balancedByTransfersAndTags' => 'Balanced by transfers and tags', - 'leftUnbalanced' => 'Left unbalanced', - 'expectedBalance' => 'Expected balance', - 'outsideOfBudgets' => 'Outside of budgets', - 'leftInBudget' => 'Left in budget', + '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', - 'notCharged' => 'Not charged (yet)', - 'inactive' => 'Inactive', + 'sumOfSums' => 'Sum of sums', + 'notCharged' => 'Not charged (yet)', + 'inactive' => 'Inactive', - 'difference' => 'Difference', - 'in' => 'In', - 'out' => 'Out', - 'topX' => 'top :number', - 'showTheRest' => 'Show everything', - 'hideTheRest' => 'Show only the top :number', + 'difference' => 'Difference', + 'in' => 'In', + 'out' => 'Out', + 'topX' => 'top :number', + 'showTheRest' => 'Show everything', + 'hideTheRest' => 'Show only the top :number', // charts: - 'dayOfMonth' => 'Day of the month', - 'month' => 'Month', - 'budget' => 'Budget', - 'spent' => 'Spent', - 'overspent' => 'Overspent', - 'left' => 'Left', - 'noCategory' => '(no category)', - 'noBudget' => '(no budget)', - 'category' => 'Category', - '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', + 'dayOfMonth' => 'Day of the month', + 'month' => 'Month', + 'budget' => 'Budget', + 'spent' => 'Spent', + 'overspent' => 'Overspent', + 'left' => 'Left', + 'noCategory' => '(no category)', + 'noBudget' => '(no budget)', + 'category' => 'Category', + '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', - 'asset_accounts' => 'Asset accounts', - 'expense_accounts' => 'Expense accounts', - 'revenue_accounts' => 'Revenue accounts', + 'asset_accounts' => 'Asset accounts', + 'expense_accounts' => 'Expense accounts', + 'revenue_accounts' => 'Revenue accounts', // some extra help: - 'accountExtraHelp_asset' => '', - 'accountExtraHelp_expense' => '', - 'accountExtraHelp_revenue' => '', + 'accountExtraHelp_asset' => '', + 'accountExtraHelp_expense' => '', + 'accountExtraHelp_revenue' => '', ]; diff --git a/resources/lang/en/form.php b/resources/lang/en/form.php index 9d4e273217..7cc7b2e5bd 100644 --- a/resources/lang/en/form.php +++ b/resources/lang/en/form.php @@ -13,7 +13,7 @@ return [ 'openingBalance' => 'Opening balance', 'tagMode' => 'Tag mode', 'tagPosition' => 'Tag location', - 'virtualBalance' => 'Vitual balance', + 'virtualBalance' => 'Virtual balance', 'longitude_latitude' => 'Location', 'targetamount' => 'Target amount', 'accountRole' => 'Account role', @@ -75,4 +75,4 @@ return [ '|All :count transactions connected to this budget will spared deletion.', 'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.' . '|All :count transactions connected to this category will spared deletion.', -]; \ No newline at end of file +]; diff --git a/resources/lang/en/list.php b/resources/lang/en/list.php index 22a32b39cb..4ad2805ede 100644 --- a/resources/lang/en/list.php +++ b/resources/lang/en/list.php @@ -29,4 +29,4 @@ return [ 'transfer' => 'Transfer', 'type' => 'Type', 'completed' => 'Completed', -]; \ No newline at end of file +]; diff --git a/resources/lang/nl/breadcrumbs.php b/resources/lang/nl/breadcrumbs.php index 3994dceb70..18e12fe0c5 100644 --- a/resources/lang/nl/breadcrumbs.php +++ b/resources/lang/nl/breadcrumbs.php @@ -2,48 +2,59 @@ return [ 'home' => 'Home', + // accounts 'asset_accounts' => 'Betaalrekeningen', 'expense_accounts' => 'Crediteuren', 'revenue_accounts' => 'Debiteuren', - + 'cash_accounts' => 'Contant geldrekeningen', 'new_asset_account' => 'Nieuwe betaalrekening', 'new_expense_account' => 'Nieuwe crediteur', 'new_revenue_account' => 'Nieuwe debiteur', - 'delete_account' => 'Verwijder rekening ":name"', 'edit_account' => 'Wijzig rekening ":name"', + 'edit_asset_account' => 'Wijzig betaalrekening ":name"', + 'edit_expense_account' => 'Wijzig crediteur ":name"', + 'edit_revenue_account' => 'Wijzig debiteur ":name"', + // budgets 'budgets' => 'Budgetten', 'newBudget' => 'Maak een nieuw budget', 'delete_budget' => 'Verwijder budget ":name"', 'edit_budget' => 'Wijzig budget ":name"', + // categories 'categories' => 'Categorieën', 'newCategory' => 'Maak een nieuw categorie', 'delete_category' => 'Verwijder categorie ":name"', 'edit_category' => 'Wijzig categorie ":name"', + // currencies 'currencies' => 'Munteenheden', 'edit_currency' => 'Wijzig munteenheid ":name"', 'delete_currency' => 'Verwijder munteenheid ":name"', + // piggy banks 'piggyBanks' => 'Spaarpotjes', 'newPiggyBank' => 'Nieuw spaarpotje', 'edit_piggyBank' => 'Wijzig spaarpotje ":name"', 'delete_piggyBank' => 'Verwijder spaarportje ":name"', + // top menu 'preferences' => 'Voorkeuren', 'profile' => 'Profiel', 'changePassword' => 'Verander je wachtwoord', + // bills 'bills' => 'Rekeningen', 'newBill' => 'Nieuwe rekening', 'edit_bill' => 'Wijzig rekening ":name"', 'delete_bill' => 'Verwijder rekening ":name"', + // reminders 'reminders' => 'Herinneringen', 'reminder' => 'Herinnering #:id', + // reports 'reports' => 'Overzichten', 'monthly_report' => 'Maandoverzicht :date', 'monthly_report_shared' => 'Maandoverzicht :date (inclusief gedeelde rekeningen)', @@ -51,23 +62,28 @@ return [ 'yearly_report_shared' => 'Jaaroverzicht :date (inclusief gedeelde rekeningen)', 'budget_report' => 'Budgetoverzicht :date', + // search 'searchResult' => 'Zoeken naar ":query"', + // transaction lists. 'withdrawal_list' => 'Uitgaven', 'deposit_list' => 'Inkomsten', 'transfer_list' => 'Overschrijvingen', 'transfers_list' => 'Overschrijvingen', + // create transactions 'create_withdrawal' => 'Sla nieuwe uitgave op', 'create_deposit' => 'Sla nieuwe inkomsten op', 'create_transfer' => 'Sla nieuwe overschrijving op', + // edit transactions 'edit_journal' => 'Wijzig transactie ":description"', 'delete_journal' => 'Verwijder transactie ":description"', + // tags 'tags' => 'Tags', 'createTag' => 'Maak nieuwe tag', 'edit_tag' => 'Wijzig tag ":tag"', 'delete_tag' => 'Verwijder tag ":tag"', -]; \ No newline at end of file +]; diff --git a/resources/lang/nl/firefly.php b/resources/lang/nl/firefly.php index 74dfbe3699..aca206de42 100644 --- a/resources/lang/nl/firefly.php +++ b/resources/lang/nl/firefly.php @@ -1,169 +1,209 @@ 'Nederlands geselecteerd!', - 'close' => 'Sluiten', - 'pleaseHold' => 'Momentje...', - 'mandatoryFields' => 'Verplichte velden', - 'optionalFields' => 'Optionele velden', - 'options' => 'Opties', - 'something' => 'Iets!', - 'actions' => 'Acties', - 'edit' => 'Wijzig', - 'delete' => 'Verwijder', - 'welcomeBack' => 'Hoe staat het er voor?', + 'test' => 'Nederlands geselecteerd!', + 'close' => 'Sluiten', + 'pleaseHold' => 'Momentje...', + 'mandatoryFields' => 'Verplichte velden', + 'optionalFields' => 'Optionele velden', + 'options' => 'Opties', + 'something' => 'Iets!', + 'actions' => 'Acties', + 'edit' => 'Wijzig', + 'delete' => 'Verwijder', + 'welcomeBack' => 'Hoe staat het er voor?', + + 'everything' => 'Alles', + 'customRange' => 'Zelf bereik kiezen', + 'apply' => 'Go', + 'cancel' => 'Annuleren', + 'from' => 'Van', + 'to' => 'Tot', + + 'showEverything' => 'Laat alles zien', + 'create_new_budget' => 'Maak een nieuw budget', + 'store_new_budget' => 'Sla nieuw budget op', + + 'availableIn' => 'Beschikbaar in :date', + 'transactionsWithoutBudget' => 'Uitgaven zonder budget', + 'transactionsWithoutBudgetDate' => 'Uitgaven zonder budget in :date', + 'createBudget' => 'Maak nieuw budget', + 'inactiveBudgets' => 'Inactieve budgetten', + 'newCategory' => 'Nieuwe categorie', + 'withoutCategory' => 'Zonder categorie', + + 'details_for_asset' => 'Overzicht voor betaalrekening ":name"', + 'details_for_expense' => 'Overzicht voor crediteur ":name"', + 'details_for_revenue' => 'Overzicht voor debiteur ":name"', + 'details_for_cash' => 'Overzicht voor contant geldrekening ":name"', + + 'store_new_asset_account' => 'Sla nieuwe betaalrekening op', + 'store_new_expense_account' => 'Sla nieuwe crediteur op', + 'store_new_revenue_account' => 'Sla nieuwe debiteur op', + + 'edit_asset_account' => 'Wijzig betaalrekening ":name"', + 'edit_expense_account' => 'Wijzig crediteur ":name"', + 'edit_revenue_account' => 'Wijzig debiteur ":name"', + + 'update_asset_account' => 'Wijzig betaalrekening', + 'update_expense_account' => 'Wijzig crediteur', + 'update_revenue_account' => 'Wijzig debiteur', + + 'make_new_asset_account' => 'Nieuwe betaalrekening', + 'make_new_expense_account' => 'Nieuwe crediteur', + 'make_new_revenue_account' => 'Nieuwe debiteur', // new user: - 'welcome' => 'Welkom bij Firefly!', - 'createNewAsset' => 'Maak om te beginnen een nieuwe betaalrekening. Dit is je start van je financiële beheer.', - 'createNewAssetButton' => 'Maak een nieuwe betaalrekening', + 'welcome' => 'Welkom bij Firefly!', + 'createNewAsset' => 'Maak om te beginnen een nieuwe betaalrekening. Dit is je start van je financiële beheer.', + 'createNewAssetButton' => 'Maak een nieuwe betaalrekening', // home page: - 'yourAccounts' => 'Je betaalrekeningen', - 'budgetsAndSpending' => 'Budgetten en uitgaven', - 'savings' => 'Sparen', - 'markAsSavingsToContinue' => 'Om hier wat te zien stel je je betaalrekeningen in als "spaarrekening".', - 'createPiggyToContinue' => 'Maak spaarpotjes om hier iets te zien.', - 'newWithdrawal' => 'Nieuwe uitgave', - 'newDeposit' => 'Nieuwe inkomsten', - 'newTransfer' => 'Nieuwe overschrijving', - 'moneyIn' => 'Inkomsten', - 'moneyOut' => 'Uitgaven', - 'billsToPay' => 'Openstaande rekeningen', - 'billsPaid' => 'Betaalde rekeningen', - 'viewDetails' => 'Meer info', - 'divided' => 'verdeeld', - 'toDivide' => 'te verdelen', + 'yourAccounts' => 'Je betaalrekeningen', + 'budgetsAndSpending' => 'Budgetten en uitgaven', + 'savings' => 'Sparen', + 'markAsSavingsToContinue' => 'Om hier wat te zien stel je je betaalrekeningen in als "spaarrekening".', + 'createPiggyToContinue' => 'Maak spaarpotjes om hier iets te zien.', + 'newWithdrawal' => 'Nieuwe uitgave', + 'newDeposit' => 'Nieuwe inkomsten', + 'newTransfer' => 'Nieuwe overschrijving', + 'moneyIn' => 'Inkomsten', + 'moneyOut' => 'Uitgaven', + 'billsToPay' => 'Openstaande rekeningen', + 'billsPaid' => 'Betaalde rekeningen', + 'viewDetails' => 'Meer info', + 'divided' => 'verdeeld', + 'toDivide' => 'te verdelen', // menu and titles, should be recycled as often as possible: - 'toggleNavigation' => 'Navigatie aan of uit', - 'seeAllReminders' => 'Bekijk alle herinneringen', - 'reminders' => 'Herinneringen', - 'currency' => 'Munteenheden', - 'preferences' => 'Voorkeuren', - 'logout' => 'Uitloggen', - 'searchPlaceholder' => 'Zoeken...', - 'dashboard' => 'Dashboard', - 'currencies' => 'Munteenheden', - 'accounts' => 'Rekeningen', - 'assetAccounts' => 'Betaalrekeningen', - 'expenseAccounts' => 'Crediteuren', - 'revenueAccounts' => 'Debiteuren', - 'Asset account' => 'Betaalrekening', - 'Default account' => 'Betaalrekening', - 'Expense account' => 'Crediteur', - 'Revenue account' => 'Debiteur', - 'budgets' => 'Budgetten', - 'categories' => 'Categorieën', - 'tags' => 'Tags', - 'reports' => 'Overzichten', - 'transactions' => 'Transacties', - 'expenses' => 'Uitgaven', - 'income' => 'Inkomsten', - 'transfers' => 'Overschrijvingen', - 'moneyManagement' => 'Geldbeheer', - 'piggyBanks' => 'Spaarpotjes', - 'bills' => 'Rekeningen', - 'createNew' => 'Nieuw', - 'withdrawal' => 'Uitgave', - 'deposit' => 'Inkomsten', - 'transfer' => 'Overschrijving', - 'Withdrawal' => 'Uitgave', - 'Deposit' => 'Inkomsten', - 'Transfer' => 'Overschrijving', - 'bill' => 'Rekening', - 'yes' => 'Ja', - 'no' => 'Nee', - 'amount' => 'Bedrag', - 'newBalance' => 'Nieuw saldo', - 'overview' => 'Overzicht', - 'saveOnAccount' => 'Sparen op rekening', - 'unknown' => 'Onbekend', - 'daily' => 'Dagelijks', - 'weekly' => 'Wekelijks', - 'monthly' => 'Maandelijks', - 'quarterly' => 'Elk kwartaal', - 'half-year' => 'Elk half jaar', - 'yearly' => 'Jaarlijks', + 'toggleNavigation' => 'Navigatie aan of uit', + 'seeAllReminders' => 'Bekijk alle herinneringen', + 'reminders' => 'Herinneringen', + 'currency' => 'Munteenheden', + 'preferences' => 'Voorkeuren', + 'logout' => 'Uitloggen', + 'searchPlaceholder' => 'Zoeken...', + 'dashboard' => 'Dashboard', + 'currencies' => 'Munteenheden', + 'accounts' => 'Rekeningen', + 'assetAccounts' => 'Betaalrekeningen', + 'expenseAccounts' => 'Crediteuren', + 'revenueAccounts' => 'Debiteuren', + 'Asset account' => 'Betaalrekening', + 'Default account' => 'Betaalrekening', + 'Expense account' => 'Crediteur', + 'Revenue account' => 'Debiteur', + 'budgets' => 'Budgetten', + 'categories' => 'Categorieën', + 'tags' => 'Tags', + 'reports' => 'Overzichten', + 'transactions' => 'Transacties', + 'expenses' => 'Uitgaven', + 'income' => 'Inkomsten', + 'transfers' => 'Overschrijvingen', + 'moneyManagement' => 'Geldbeheer', + 'piggyBanks' => 'Spaarpotjes', + 'bills' => 'Rekeningen', + 'createNew' => 'Nieuw', + 'withdrawal' => 'Uitgave', + 'deposit' => 'Inkomsten', + 'transfer' => 'Overschrijving', + 'Withdrawal' => 'Uitgave', + 'Deposit' => 'Inkomsten', + 'Transfer' => 'Overschrijving', + 'bill' => 'Rekening', + 'yes' => 'Ja', + 'no' => 'Nee', + 'amount' => 'Bedrag', + 'newBalance' => 'Nieuw saldo', + 'overview' => 'Overzicht', + 'saveOnAccount' => 'Sparen op rekening', + 'unknown' => 'Onbekend', + 'daily' => 'Dagelijks', + 'weekly' => 'Wekelijks', + 'monthly' => 'Maandelijks', + 'quarterly' => 'Elk kwartaal', + 'half-year' => 'Elk half jaar', + 'yearly' => 'Jaarlijks', - 'reportForYear' => 'Jaaroverzicht :year', - 'reportForYearShared' => 'Jaaroverzicht :year (inclusief gedeelde rekeningen)', - 'reportForMonth' => 'Maandoverzicht van :date', - 'reportForMonthShared' => 'Maandoverzicht van :date (inclusief gedeelde rekeningen)', - 'incomeVsExpenses' => 'Inkomsten tegenover uitgaven', - 'accountBalances' => 'Rekeningsaldi', - 'balanceStartOfYear' => 'Saldo aan het begin van het jaar', - 'balanceEndOfYear' => 'Saldo aan het einde van het jaar', - 'balanceStartOfMonth' => 'Saldo aan het einde van de maand', - 'balanceEndOfMonth' => 'Saldo aan het einde van de maand', + 'reportForYear' => 'Jaaroverzicht :year', + 'reportForYearShared' => 'Jaaroverzicht :year (inclusief gedeelde rekeningen)', + 'reportForMonth' => 'Maandoverzicht van :date', + 'reportForMonthShared' => 'Maandoverzicht van :date (inclusief gedeelde rekeningen)', + 'incomeVsExpenses' => 'Inkomsten tegenover uitgaven', + 'accountBalances' => 'Rekeningsaldi', + 'balanceStartOfYear' => 'Saldo aan het begin van het jaar', + 'balanceEndOfYear' => 'Saldo aan het einde van het jaar', + 'balanceStartOfMonth' => 'Saldo aan het einde van de maand', + 'balanceEndOfMonth' => 'Saldo aan het einde van de maand', - 'balanceStart' => 'Saldo aan het einde van de periode', - 'balanceEnd' => 'Saldo aan het einde van de periode', + 'balanceStart' => 'Saldo aan het einde van de periode', + 'balanceEnd' => 'Saldo aan het einde van de periode', - 'reportsOwnAccounts' => 'Overzichten voor je eigen betaalrekeningen', - 'reportsOwnAccountsAndShared' => 'Overzichten voor je eigen betaalrekeningen en gedeelde rekeningen', + 'reportsOwnAccounts' => 'Overzichten voor je eigen betaalrekeningen', + 'reportsOwnAccountsAndShared' => 'Overzichten voor je eigen betaalrekeningen en gedeelde rekeningen', - 'account' => 'Rekening', + 'account' => 'Rekening', - 'splitByAccount' => 'Per betaalrekening', - 'balancedByTransfersAndTags' => 'Gecorrigeerd met overschrijvingen en tags', - 'coveredWithTags' => 'Gecorrigeerd met tags', - 'leftUnbalanced' => 'Ongecorrigeerd', - 'expectedBalance' => 'Verwacht saldo', - 'outsideOfBudgets' => 'Buiten budgetten', - 'leftInBudget' => 'Over van budget', + 'splitByAccount' => 'Per betaalrekening', + 'balancedByTransfersAndTags' => 'Gecorrigeerd met overschrijvingen en tags', + 'coveredWithTags' => 'Gecorrigeerd met tags', + 'leftUnbalanced' => 'Ongecorrigeerd', + 'expectedBalance' => 'Verwacht saldo', + 'outsideOfBudgets' => 'Buiten budgetten', + 'leftInBudget' => 'Over van budget', - 'sumOfSums' => 'Alles bij elkaar', - 'notCharged' => '(Nog) niet betaald', - 'inactive' => 'Niet actief', + 'sumOfSums' => 'Alles bij elkaar', + 'notCharged' => '(Nog) niet betaald', + 'inactive' => 'Niet actief', - 'difference' => 'Verschil', - 'in' => 'In', - 'out' => 'Uit', - 'topX' => 'top :number', - 'showTheRest' => 'Laat alles zien', - 'hideTheRest' => 'Laat alleen de top :number zien', + 'difference' => 'Verschil', + 'in' => 'In', + 'out' => 'Uit', + 'topX' => 'top :number', + 'showTheRest' => 'Laat alles zien', + 'hideTheRest' => 'Laat alleen de top :number zien', // charts: - 'dayOfMonth' => 'Dag vd maand', - 'month' => 'Maand', - 'budget' => 'Budget', - 'spent' => 'Uitgegeven', - 'overspent' => 'Teveel uitgegeven', - 'left' => 'Over', - 'noCategory' => '(geen categorie)', - 'noBudget' => '(geen budget)', - 'category' => 'Categorie', - 'maxAmount' => 'Maximaal bedrag', - 'minAmount' => 'Minimaal bedrag', - 'billEntry' => 'Bedrag voor deze rekening', - 'name' => 'Naam', - 'date' => 'Datum', - 'paid' => 'Betaald', - 'unpaid' => 'Niet betaald', - 'day' => 'Dag', - 'budgeted' => 'Gebudgetteerd', - 'period' => 'Periode', - 'balance' => 'Saldo', - 'summary' => 'Samenvatting', - 'sum' => 'Som', - 'average' => 'Gemiddeld', - 'balanceFor' => 'Saldo op :name', + 'dayOfMonth' => 'Dag vd maand', + 'month' => 'Maand', + 'budget' => 'Budget', + 'spent' => 'Uitgegeven', + 'overspent' => 'Teveel uitgegeven', + 'left' => 'Over', + 'noCategory' => '(geen categorie)', + 'noBudget' => '(geen budget)', + 'category' => 'Categorie', + 'maxAmount' => 'Maximaal bedrag', + 'minAmount' => 'Minimaal bedrag', + 'billEntry' => 'Bedrag voor deze rekening', + 'name' => 'Naam', + 'date' => 'Datum', + 'paid' => 'Betaald', + 'unpaid' => 'Niet betaald', + 'day' => 'Dag', + 'budgeted' => 'Gebudgetteerd', + 'period' => 'Periode', + 'balance' => 'Saldo', + 'summary' => 'Samenvatting', + 'sum' => 'Som', + 'average' => 'Gemiddeld', + 'balanceFor' => 'Saldo op :name', - 'asset_accounts' => 'Betaalrekeningen', - 'expense_accounts' => 'Crediteuren', - 'revenue_accounts' => 'Debiteuren', + 'asset_accounts' => 'Betaalrekeningen', + 'expense_accounts' => 'Crediteuren', + 'revenue_accounts' => 'Debiteuren', // some extra help: - 'accountExtraHelp_asset' => '', - 'accountExtraHelp_expense' => 'Een crediteur is een persoon of een bedrijf waar je geld aan moet betalen. Je staat bij ze in het krijt. Een verwarrende' . - ' term misschien, maar zo werkt het nou eenmaal. De supermarkt, je huurbaas of de bank zijn crediteuren. Jouw ' . - 'geld (krediet) gaat naar hen toe. De term komt uit de wereld van de boekhouding. De uitgaves die je hier ziet zijn ' . - 'positief, want je kijkt uit hun perspectief. Zodra jij afrekent in een winkel, komt het geld er bij hen bij (positief).', - 'accountExtraHelp_revenue' => 'Als je geld krijgt van een bedrijf of een persoon is dat een debiteur. ' . - 'Dat kan salaris zijn, of een andere betaling. ' . - ' Ze hebben een schuld (debet) aan jou. De term komt uit de wereld van de boekhouding.' . - ' De inkomsten die je hier ziet zijn negatief, want je kijkt uit hun perspectief. Zodra een debiteur geld naar jou ' . - 'overmaakt gaat het er bij hen af (negatief).', + 'accountExtraHelp_asset' => '', + 'accountExtraHelp_expense' => + 'Een crediteur is een persoon of een bedrijf waar je geld aan moet betalen. Je staat bij ze in het krijt. Een verwarrende' . + ' term misschien, maar zo werkt het nou eenmaal. De supermarkt, je huurbaas of de bank zijn crediteuren. Jouw ' . + 'geld (krediet) gaat naar hen toe. De term komt uit de wereld van de boekhouding. De uitgaves die je hier ziet zijn ' . + 'positief, want je kijkt uit hun perspectief. Zodra jij afrekent in een winkel, komt het geld er bij hen bij (positief).', + 'accountExtraHelp_revenue' => 'Als je geld krijgt van een bedrijf of een persoon is dat een debiteur. ' . + 'Dat kan salaris zijn, of een andere betaling. ' . + ' Ze hebben een schuld (debet) aan jou. De term komt uit de wereld van de boekhouding.' . + ' De inkomsten die je hier ziet zijn negatief, want je kijkt uit hun perspectief. Zodra een debiteur geld naar jou ' . + 'overmaakt gaat het er bij hen af (negatief).', ]; diff --git a/resources/lang/nl/form.php b/resources/lang/nl/form.php index 062b7a8db1..7f7d22578c 100644 --- a/resources/lang/nl/form.php +++ b/resources/lang/nl/form.php @@ -75,4 +75,4 @@ return [ '|De :count transacties verbonden aan dit budget blijven bewaard.', 'category_keep_transactions' => 'De transactie verbonden aan deze categorie blijft bewaard.' . '|De :count transacties verbonden aan deze categorie blijven bewaard.', -]; \ No newline at end of file +]; diff --git a/resources/lang/nl/list.php b/resources/lang/nl/list.php index 42d4b8c538..7ade859e8c 100644 --- a/resources/lang/nl/list.php +++ b/resources/lang/nl/list.php @@ -10,7 +10,7 @@ return [ 'lastActivity' => 'Laatste activiteit', 'balanceDiff' => 'Saldoverschil tussen :start en :end', 'matchedOn' => 'Wordt herkend', - 'matchesOn' => 'Wordt herkend', + 'matchesOn' => 'Wordt herkend', 'matchingAmount' => 'Bedrag', 'lastMatch' => 'Laatste keer gezien', 'expectedMatch' => 'Wordt verwacht', @@ -30,4 +30,4 @@ return [ 'type' => 'Type', 'completed' => 'Opgeslagen' -]; \ No newline at end of file +]; diff --git a/resources/twig/accounts/create.twig b/resources/twig/accounts/create.twig index 1a11d72452..dbe886c6c9 100644 --- a/resources/twig/accounts/create.twig +++ b/resources/twig/accounts/create.twig @@ -50,7 +50,7 @@

diff --git a/resources/twig/accounts/edit.twig b/resources/twig/accounts/edit.twig index f32d375941..f83bfe474c 100644 --- a/resources/twig/accounts/edit.twig +++ b/resources/twig/accounts/edit.twig @@ -62,7 +62,7 @@

diff --git a/resources/twig/accounts/index.twig b/resources/twig/accounts/index.twig index f331622602..b7248b6a2e 100644 --- a/resources/twig/accounts/index.twig +++ b/resources/twig/accounts/index.twig @@ -22,7 +22,7 @@ diff --git a/resources/twig/budgets/create.twig b/resources/twig/budgets/create.twig index 526bc9d00e..7bd44a5bfc 100644 --- a/resources/twig/budgets/create.twig +++ b/resources/twig/budgets/create.twig @@ -31,7 +31,7 @@

diff --git a/resources/twig/budgets/edit.twig b/resources/twig/budgets/edit.twig index 9818ea25a0..6242dad9ac 100644 --- a/resources/twig/budgets/edit.twig +++ b/resources/twig/budgets/edit.twig @@ -1,12 +1,6 @@ {% extends "./layout/default.twig" %} {% block content %} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, budget) }} -
-
-

Use budgets to organize and limit your expenses.

-
-
- {{ Form.model(budget, {'class' : 'form-horizontal','id' : 'update','url' : route('budgets.update',budget.id) } ) }}
diff --git a/resources/twig/budgets/income.twig b/resources/twig/budgets/income.twig index d642a54c54..fa89e27828 100644 --- a/resources/twig/budgets/income.twig +++ b/resources/twig/budgets/income.twig @@ -1,13 +1,12 @@ -
- -
\ No newline at end of file diff --git a/resources/twig/budgets/index.twig b/resources/twig/budgets/index.twig index 66ee95c6da..6de86a80d3 100644 --- a/resources/twig/budgets/index.twig +++ b/resources/twig/budgets/index.twig @@ -14,7 +14,7 @@ {{ 'budgeted'|_ }}:
- Available in {{ Session.get('start').formatLocalized(monthFormat) }}: + {{ trans('firefly.availableIn',{date : Session.get('start').formatLocalized(monthFormat) }) }}: {{ amount|formatAmount }}
@@ -60,12 +60,13 @@
- Transactions without a budget + {{ 'transactionsWithoutBudget'|_ }}
@@ -144,7 +145,7 @@

- Spent: {{ budget.spent|formatAmount }} + {{ 'spent'|_ }}: {{ budget.spent|formatAmount }}

@@ -154,10 +155,10 @@
- Create budget + {{ 'createBudget'|_ }}
@@ -166,7 +167,7 @@
- Inactive budgets + {{ 'inactiveBudgets'|_ }}
{% for index,budget in inactive %} @@ -184,6 +185,8 @@ {% endblock %} diff --git a/resources/twig/budgets/show.twig b/resources/twig/budgets/show.twig index 82b0b8b9a0..d83c8c1d28 100644 --- a/resources/twig/budgets/show.twig +++ b/resources/twig/budgets/show.twig @@ -29,36 +29,36 @@
- Transactions + {{ 'transactions'|_ }}
{% include 'list/journals.twig' %}
{% if limits|length == 1 %} -

Show everything

+

{{ 'showEverything'|_ }}

{% endif %} {% for limit in limits %} {% for rep in limit.limitRepetitions %}
- Amount: {{ rep.amount|formatAmount }} + {{ 'amount'|_ }}: {{ rep.amount|formatAmount }}
- Spent: {{ spentInRepetition(rep)|formatAmount }} + {{ 'spent'|_ }}: {{ spentInRepetitionCorrected(rep)|formatAmount }}
- {% set overspent = spentInRepetition(rep) > rep.amount %} + {% set overspent = spentInRepetitionCorrected(rep) > rep.amount %} {% if overspent %} - {% set spent = spentInRepetition(rep) %} + {% set spent = spentInRepetitionCorrected(rep) %} {% set pct = (spent != 0 ? (rep.amount / spent)*100 : 0) %}
@@ -66,7 +66,7 @@
{% else %} {% set amount = rep.amount %} - {% set pct = (amount != 0 ? (spentInRepetition(rep) / amount)*100 : 0) %} + {% set pct = (amount != 0 ? (spentInRepetitionCorrected(rep) / amount)*100 : 0) %}
@@ -79,7 +79,7 @@ {% endfor %} {% if limits|length == 1 %} -

Show everything

+

{{ 'showEverything'|_ }}

{% endif %}
diff --git a/resources/twig/categories/index.twig b/resources/twig/categories/index.twig index f79e9ad08d..8faf88ee28 100644 --- a/resources/twig/categories/index.twig +++ b/resources/twig/categories/index.twig @@ -5,7 +5,7 @@
- Categories + {{ 'categories'|_ }}
diff --git a/resources/twig/layout/default.twig b/resources/twig/layout/default.twig index 60038da2f8..c79316bc88 100644 --- a/resources/twig/layout/default.twig +++ b/resources/twig/layout/default.twig @@ -128,13 +128,22 @@