From e7ea0dc8422df3786d106e10b6b7e79cfc4a3983 Mon Sep 17 00:00:00 2001 From: Edwin Date: Sat, 19 Mar 2016 18:45:12 +0100 Subject: [PATCH 01/51] Fixed small typo. --- resources/lang/en_US/help.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/en_US/help.php b/resources/lang/en_US/help.php index 4f5b30adc1..698ed0ba8d 100644 --- a/resources/lang/en_US/help.php +++ b/resources/lang/en_US/help.php @@ -19,7 +19,7 @@ return [ 'budget-menu-title' => 'Budgets', 'budget-menu-text' => 'Use this page to organise your finances and limit spending.', 'report-menu-title' => 'Reports', - 'report-menu-text' => 'Check this out when you want a solid overview of your fiances.', + 'report-menu-text' => 'Check this out when you want a solid overview of your finances.', 'transaction-menu-title' => 'Transactions', 'transaction-menu-text' => 'All transactions you\'ve created can be found here.', 'option-menu-title' => 'Options', From 935d72d672ee5e3d382d68e18f4f49519f9f0c14 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 11:36:50 +0100 Subject: [PATCH 02/51] New English text for issue #218 --- resources/lang/en_US/firefly.php | 45 ++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 7f81a49fee..483621962c 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -62,6 +62,8 @@ return [ 'two_factor_lost_intro' => 'Unfortunately, this is not something you can reset from the web interface. You have two choices.', 'two_factor_lost_fix_self' => 'If you run your own instance of Firefly III, check the logs in storage/logs for instructions.', 'two_factor_lost_fix_owner' => 'Otherwise, email the site owner, :site_owner and ask them to reset your two factor authentication.', + 'warning_much_data' => ':days days of data may take a while to load.', + 'registered' => 'You have registered successfully!', // export data: 'import_and_export' => 'Import and export', @@ -247,6 +249,7 @@ return [ 'pref_two_factor_auth_remove_code' => 'Remove verification code', 'pref_two_factor_auth_remove_will_disable' => '(this will also disable two-factor authentication)', 'pref_save_settings' => 'Save settings', + 'saved_preferences' => 'Preferences saved!', // profile: 'change_your_password' => 'Change your password', @@ -273,6 +276,7 @@ return [ 'update_attachment' => 'Update attachment', 'delete_attachment' => 'Delete attachment ":name"', 'attachment_deleted' => 'Deleted attachment ":name"', + 'attachment_updated' => 'Updated attachment ":name"', 'upload_max_file_size' => 'Maximum file size: :size', // tour: @@ -374,6 +378,11 @@ return [ 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.', 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.', 'csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?', + 'could_not_recover' => 'Could not continue from the previous step. Your progress has been lost :(. The log files will tell you what happened.', + 'must_select_roles' => 'You must select some roles for your file content, or the process cannot continue.', + 'invalid_mapping' => 'You have submitted an invalid mapping. The process cannot continue.', + 'no_file_uploaded' => 'It seems you did not upload a file.', + // create new stuff: 'create_new_withdrawal' => 'Create new withdrawal', @@ -406,6 +415,8 @@ return [ 'to_get_started' => 'To get started with Firefly, please enter your current bank\'s name, and the balance of your checking account:', 'savings_balance_text' => 'If you have a savings account, please enter the current balance of your savings account:', 'cc_balance_text' => 'If you have a credit card, please enter your credit card\'s limit.', + 'stored_new_account' => 'Yay! Your new account has been stored.', + 'stored_new_accounts' => 'Yay! Your new accounts have been stored.', // forms: 'mandatoryFields' => 'Mandatory fields', @@ -415,7 +426,8 @@ return [ // budgets: 'create_new_budget' => 'Create a new budget', - 'store_new_budget' => ' Store new budget', + 'store_new_budget' => 'Store new budget', + 'stored_new_budget' => 'Stored new budget ":name"', 'availableIn' => 'Available in :date', 'transactionsWithoutBudget' => 'Expenses without budget', 'transactionsWithoutBudgetDate' => 'Expenses without budget in :date', @@ -424,15 +436,22 @@ return [ 'without_budget_between' => 'Transactions without a budget between :start and :end', 'budget_in_month' => ':name in :month', 'delete_budget' => 'Delete budget ":name"', + 'deleted_budget' => 'Deleted budget ":name"', 'edit_budget' => 'Edit budget ":name"', + 'updated_budget' => 'Updated budget ":name"', 'update_amount' => 'Update amount', 'update_budget' => 'Update budget', // bills: 'delete_bill' => 'Delete bill ":name"', + 'deleted_bill' => 'Deleted bill ":name"', 'edit_bill' => 'Edit bill ":name"', 'update_bill' => 'Update bill', + 'updated_bill' => 'Updated bill ":name"', 'store_new_bill' => 'Store new bill', + 'stored_new_bill' => 'Stored new bill ":name"', + 'cannot_scan_inactive_bill' => 'Inactive bills cannot be scanned.', + 'rescanned_bill' => 'Rescanned everything.', // accounts: 'details_for_asset' => 'Details for asset account ":name"', @@ -465,27 +484,39 @@ return [ 'accountExtraHelp_revenue' => '', 'account_type' => 'Account type', 'save_transactions_by_moving' => 'Save these transaction(s) by moving them to another account:', + 'stored_new_account' => 'New account ":name" stored!', + 'updated_account' => 'Updated account ":name"', // categories: 'new_category' => 'New category', 'create_new_category' => 'Create a new category', 'without_category' => 'Without a category', - 'update_category' => 'Wijzig categorie', + 'update_category' => 'Update category', + 'updated_category' => 'Updated category ":name"', 'categories' => 'Categories', 'edit_category' => 'Edit category ":name"', 'no_category' => '(no category)', 'category' => 'Category', 'delete_category' => 'Delete category ":name"', + 'deleted_category' => 'Deleted category ":name"', 'store_category' => 'Store new category', + 'stored_category' => 'Stored new category ":name"', 'without_category_between' => 'Without category between :start and :end', // transactions: 'update_withdrawal' => 'Update withdrawal', 'update_deposit' => 'Update deposit', 'update_transfer' => 'Update transfer', + 'updated_withdrawal' => 'Updated withdrawal ":description"', + 'updated_deposit' => 'Updated deposit ":description"', + 'updated_transfer' => 'Updated transfer ":description"', 'delete_withdrawal' => 'Delete withdrawal ":description"', 'delete_deposit' => 'Delete deposit ":description"', 'delete_transfer' => 'Delete transfer ":description"', + 'deleted_withdrawal' => 'Successfully deleted withdrawal ":description"', + 'deleted_deposit' => 'Successfully deleted deposit ":description"', + 'deleted_transfer' => 'Successfully deleted transfer ":description"', + 'stored_journal' => 'Successfully created new transaction ":description"', // new user: 'welcome' => 'Welcome to Firefly!', @@ -640,6 +671,7 @@ return [ 'piggy_bank' => 'Piggy bank', 'new_piggy_bank' => 'Create new piggy bank', 'store_piggy_bank' => 'Store new piggy bank', + 'stored_piggy_bank' => 'Store new piggy bank ":name"', 'account_status' => 'Account status', 'left_for_piggy_banks' => 'Left for piggy banks', 'sum_of_piggy_banks' => 'Sum of piggy banks', @@ -653,6 +685,7 @@ return [ 'max_amount_remove' => 'The maximum amount you can remove is', 'update_piggy_button' => 'Update piggy bank', 'update_piggy_title' => 'Update piggy bank ":name"', + 'updated_piggy_bank' => 'Updated piggy bank ":name"', 'details' => 'Details', 'events' => 'Events', 'target_amount' => 'Target amount', @@ -665,14 +698,22 @@ return [ 'add_any_amount_to_piggy' => 'Add money to this piggy bank to reach your target of :amount.', 'add_set_amount_to_piggy' => 'Add :amount to fill this piggy bank on :date', 'delete_piggy_bank' => 'Delete piggy bank ":name"', + 'cannot_add_amount_piggy' => 'Could not add :amount to ":name".', + 'deleted_piggy_bank' => 'Deleted piggy bank ":name"', + 'added_amount_to_piggy' => 'Added :amount to ":name"', + 'removed_amount_from_piggy' => 'Removed :amount from ":name"', + 'cannot_remove_amount_piggy' => 'Could not remove :amount from ":name".', // tags 'regular_tag' => 'Just a regular tag.', 'balancing_act' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.', 'advance_payment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.', 'delete_tag' => 'Delete tag ":tag"', + 'deleted_tag' => 'Deleted tag ":tag"', 'new_tag' => 'Make new tag', 'edit_tag' => 'Edit tag ":tag"', + 'updated_tag' => 'Updated tag ":tag"', + 'created_tag' => 'Tag ":tag" has been created!', 'no_year' => 'No year set', 'no_month' => 'No month set', 'tag_title_nothing' => 'Default tags', From 7e67eb17e065014e54bfb66f4180a3d8acdf6535 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 11:38:01 +0100 Subject: [PATCH 03/51] All new translations for #218 --- app/Http/Controllers/AccountController.php | 6 ++--- app/Http/Controllers/AttachmentController.php | 4 ++-- app/Http/Controllers/Auth/AuthController.php | 2 +- app/Http/Controllers/BillController.php | 11 +++++----- app/Http/Controllers/BudgetController.php | 6 ++--- app/Http/Controllers/CategoryController.php | 6 ++--- app/Http/Controllers/CsvController.php | 20 ++++++++--------- app/Http/Controllers/HomeController.php | 2 +- app/Http/Controllers/NewUserController.php | 11 ++++++++-- app/Http/Controllers/PiggyBankController.php | 22 +++++++++++++------ .../Controllers/PreferencesController.php | 4 ++-- app/Http/Controllers/ProfileController.php | 6 ++--- app/Http/Controllers/RuleGroupController.php | 8 +++---- app/Http/Controllers/TagController.php | 6 ++--- .../Controllers/TransactionController.php | 8 ++++--- 15 files changed, 70 insertions(+), 52 deletions(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 4ebb97f2a4..d0992f9627 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -91,7 +91,7 @@ class AccountController extends Controller $repository->destroy($account, $moveTo); - Session::flash('success', trans('firefly.' . $typeName . '_deleted', ['name' => $name])); + Session::flash('success', strval(trans('firefly.' . $typeName . '_deleted', ['name' => $name]))); Preferences::mark(); return redirect(session('accounts.delete.url')); @@ -224,7 +224,7 @@ class AccountController extends Controller $account = $repository->store($accountData); - Session::flash('success', 'New account "' . $account->name . '" stored!'); + Session::flash('success', strval(trans('firefly.stored_new_account', ['name' => $account->name]))); Preferences::mark(); // update preferences if necessary: @@ -271,7 +271,7 @@ class AccountController extends Controller ]; $repository->update($account, $accountData); - Session::flash('success', 'Account "' . $account->name . '" updated.'); + Session::flash('success', strval(trans('firefly.updated_account', ['name' => $account->name]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index c380af181f..a8f7b9eba5 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -64,7 +64,7 @@ class AttachmentController extends Controller $repository->destroy($attachment); - Session::flash('success', trans('firefly.attachment_deleted', ['name' => $name])); + Session::flash('success', strval(trans('firefly.attachment_deleted', ['name' => $name]))); Preferences::mark(); return redirect(session('attachments.delete.url')); @@ -159,7 +159,7 @@ class AttachmentController extends Controller $repository->update($attachment, $attachmentData); - Session::flash('success', 'Attachment "' . $attachment->filename . '" updated.'); + Session::flash('success', strval(trans('firefly.attachment_updated', ['name' => $attachment->filename]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 0d82af7b2c..a7146428d8 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -142,7 +142,7 @@ class AuthController extends Controller } // set flash message - Session::flash('success', 'You have registered successfully!'); + Session::flash('success', strval(trans('firefly.registered'))); Session::flash('gaEventCategory', 'user'); Session::flash('gaEventAction', 'new-registration'); diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index e74da3c093..a634c6aa46 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -73,9 +73,10 @@ class BillController extends Controller */ public function destroy(BillRepositoryInterface $repository, Bill $bill) { + $name = $bill->name; $repository->destroy($bill); - Session::flash('success', 'The bill was deleted.'); + Session::flash('success', strval(trans('firefly.deleted_bill', ['name' => $name]))); Preferences::mark(); return redirect(session('bills.delete.url')); @@ -129,7 +130,7 @@ class BillController extends Controller public function rescan(BillRepositoryInterface $repository, Bill $bill) { if (intval($bill->active) == 0) { - Session::flash('warning', 'Inactive bills cannot be scanned.'); + Session::flash('warning', strval(trans('firefly.cannot_scan_inactive_bill'))); return redirect(URL::previous()); } @@ -141,7 +142,7 @@ class BillController extends Controller } - Session::flash('success', 'Rescanned everything.'); + Session::flash('success', strval(trans('firefly.rescanned_bill'))); Preferences::mark(); return redirect(URL::previous()); @@ -173,7 +174,7 @@ class BillController extends Controller { $billData = $request->getBillData(); $bill = $repository->store($billData); - Session::flash('success', 'Bill "' . e($bill->name) . '" stored.'); + Session::flash('success', strval(trans('firefly.stored_new_bill', ['name' => e($bill->name)]))); Preferences::mark(); if (intval(Input::get('create_another')) === 1) { @@ -200,7 +201,7 @@ class BillController extends Controller $billData = $request->getBillData(); $bill = $repository->update($bill, $billData); - Session::flash('success', 'Bill "' . e($bill->name) . '" updated.'); + Session::flash('success', strval(trans('firefly.updated_bill', ['name' => e($bill->name)]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 6424acf265..4305b02a8b 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -105,7 +105,7 @@ class BudgetController extends Controller $repository->destroy($budget); - Session::flash('success', 'The budget "' . e($name) . '" was deleted.'); + Session::flash('success', strval(trans('firefly.deleted_budget', ['name' => e($name)]))); Preferences::mark(); @@ -277,7 +277,7 @@ class BudgetController extends Controller ]; $budget = $repository->store($budgetData); - Session::flash('success', 'New budget "' . $budget->name . '" stored!'); + Session::flash('success', strval(trans('firefly.stored_new_budget', ['name' => e($budget->name)]))); Preferences::mark(); if (intval(Input::get('create_another')) === 1) { @@ -308,7 +308,7 @@ class BudgetController extends Controller $repository->update($budget, $budgetData); - Session::flash('success', 'Budget "' . $budget->name . '" updated.'); + Session::flash('success', strval(trans('firefly.updated_budget', ['name' => e($budget->name)]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index f7239b898b..ebc39a5f15 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -80,7 +80,7 @@ class CategoryController extends Controller $name = $category->name; $repository->destroy($category); - Session::flash('success', 'The category "' . e($name) . '" was deleted.'); + Session::flash('success', strval(trans('firefly.deleted_category', ['name' => e($name)]))); Preferences::mark(); return redirect(session('categories.delete.url')); @@ -248,7 +248,7 @@ class CategoryController extends Controller ]; $category = $repository->store($categoryData); - Session::flash('success', 'New category "' . $category->name . '" stored!'); + Session::flash('success', strval(trans('firefly.stored_category', ['name' => e($category->name)]))); Preferences::mark(); if (intval(Input::get('create_another')) === 1) { @@ -276,7 +276,7 @@ class CategoryController extends Controller $repository->update($category, $categoryData); - Session::flash('success', 'Category "' . $category->name . '" updated.'); + Session::flash('success', strval(trans('firefly.updated_category', ['name' => e($category->name)]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/CsvController.php b/app/Http/Controllers/CsvController.php index b5a7966f32..3c86b55471 100644 --- a/app/Http/Controllers/CsvController.php +++ b/app/Http/Controllers/CsvController.php @@ -61,7 +61,7 @@ class CsvController extends Controller $fields = ['csv-file', 'csv-date-format', 'csv-has-headers', 'csv-import-account', 'csv-specifix', 'csv-delimiter']; if (!$this->wizard->sessionHasValues($fields)) { Log::error('Could not recover upload.'); - Session::flash('warning', 'Could not recover upload.'); + Session::flash('warning', strval(trans('firefly.could_not_recover'))); return redirect(route('csv.index')); } @@ -101,7 +101,7 @@ class CsvController extends Controller { $fields = ['csv-date-format', 'csv-has-headers', 'csv-delimiter']; if (!$this->wizard->sessionHasValues($fields)) { - Session::flash('warning', 'Could not recover upload.'); + Session::flash('warning', strval(trans('firefly.could_not_recover'))); return redirect(route('csv.index')); } @@ -144,7 +144,7 @@ class CsvController extends Controller { $fields = ['csv-date-format', 'csv-has-headers', 'csv-delimiter']; if (!$this->wizard->sessionHasValues($fields)) { - Session::flash('warning', 'Could not recover upload.'); + Session::flash('warning', strval(trans('firefly.could_not_recover'))); return redirect(route('csv.index')); } @@ -211,7 +211,7 @@ class CsvController extends Controller { $fields = ['csv-file', 'csv-date-format', 'csv-has-headers', 'csv-delimiter']; if (!$this->wizard->sessionHasValues($fields)) { - Session::flash('warning', 'Could not recover upload.'); + Session::flash('warning', strval(trans('firefly.could_not_recover'))); return redirect(route('csv.index')); } @@ -227,7 +227,7 @@ class CsvController extends Controller // Go back when no roles defined: if (count($roles) === 0) { - Session::flash('warning', 'Please select some roles.'); + Session::flash('warning', strval(trans('firefly.must_select_roles'))); return redirect(route('csv.column-roles')); } @@ -263,7 +263,7 @@ class CsvController extends Controller // Make sure all fields we need are accounted for. $fields = ['csv-file', 'csv-date-format', 'csv-has-headers', 'csv-map', 'csv-roles', 'csv-delimiter']; if (!$this->wizard->sessionHasValues($fields)) { - Session::flash('warning', 'Could not recover upload.'); + Session::flash('warning', strval(trans('firefly.could_not_recover'))); return redirect(route('csv.index')); } @@ -307,7 +307,7 @@ class CsvController extends Controller */ $fields = ['csv-file', 'csv-date-format', 'csv-has-headers', 'csv-map', 'csv-roles', 'csv-mapped', 'csv-delimiter']; if (!$this->wizard->sessionHasValues($fields)) { - Session::flash('warning', 'Could not recover upload.'); + Session::flash('warning', strval(trans('firefly.could_not_recover'))); return redirect(route('csv.index')); } @@ -348,7 +348,7 @@ class CsvController extends Controller */ $fields = ['csv-file', 'csv-date-format', 'csv-has-headers', 'csv-map', 'csv-roles', 'csv-delimiter']; if (!$this->wizard->sessionHasValues($fields)) { - Session::flash('warning', 'Could not recover upload.'); + Session::flash('warning', strval(trans('firefly.could_not_recover'))); return redirect(route('csv.index')); } @@ -356,7 +356,7 @@ class CsvController extends Controller // save mapping to session. $mapped = []; if (!is_array(Input::get('mapping'))) { - Session::flash('warning', 'Invalid mapping.'); + Session::flash('warning', strval(trans('firefly.invalid_mapping'))); return redirect(route('csv.map')); } @@ -393,7 +393,7 @@ class CsvController extends Controller public function upload(Request $request) { if (!$request->hasFile('csv')) { - Session::flash('warning', 'No file uploaded.'); + Session::flash('warning', strval(trans('firefly.no_file_uploaded'))); return redirect(route('csv.index')); } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 47b2f482d6..5b76367ded 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -38,7 +38,7 @@ class HomeController extends Controller $diff = $start->diffInDays($end); if ($diff > 50) { - Session::flash('warning', $diff . ' days of data may take a while to load.'); + Session::flash('warning', strval(trans('firefly.warning_much_data', ['days' => $diff]))); } Session::put('start', $start); diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 5560401813..517feaf1f6 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -55,6 +55,7 @@ class NewUserController extends Controller */ public function submit(NewUserFormRequest $request, ARI $repository) { + $count = 1; // create normal asset account: $assetAccount = [ 'name' => $request->get('bank_name'), @@ -86,6 +87,7 @@ class NewUserController extends Controller 'openingBalanceCurrency' => intval($request->input('amount_currency_id_savings_balance')), ]; $repository->store($savingsAccount); + $count++; } @@ -108,9 +110,14 @@ class NewUserController extends Controller // store meta for CC: $repository->storeMeta($creditCard, 'ccType', 'monthlyFull'); $repository->storeMeta($creditCard, 'ccMonthlyPaymentDate', Carbon::now()->year . '-01-01'); - + $count++; } - Session::flash('success', 'New account(s) created!'); + if ($count == 1) { + Session::flash('success', strval(trans('firefly.stored_new_account'))); + } else { + Session::flash('success', strval(trans('firefly.stored_new_accounts'))); + } + Preferences::mark(); return redirect(route('index')); diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 0a9c50e40a..7b1a105ae4 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -108,7 +108,7 @@ class PiggyBankController extends Controller { - Session::flash('success', 'Piggy bank "' . e($piggyBank->name) . '" deleted.'); + Session::flash('success', strval(trans('firefly.deleted_piggy_bank', ['name' => e($piggyBank->name)]))); Preferences::mark(); $repository->destroy($piggyBank); @@ -242,11 +242,15 @@ class PiggyBankController extends Controller // create event $repository->createEvent($piggyBank, $amount); - Session::flash('success', 'Added ' . Amount::format($amount, false) . ' to "' . e($piggyBank->name) . '".'); + Session::flash( + 'success', strval(trans('firefly.added_amount_to_piggy', ['amount' => Amount::format($amount, false), 'name' => e($piggyBank->name)])) + ); Preferences::mark(); } else { Log::error('Cannot add ' . $amount . ' because max amount is ' . $maxAmount . ' (left on account is ' . $leftOnAccount . ')'); - Session::flash('error', 'Could not add ' . Amount::format($amount, false) . ' to "' . e($piggyBank->name) . '".'); + Session::flash( + 'error', strval(trans('firefly.cannot_add_amount_piggy', ['amount' => Amount::format($amount, false), 'name' => e($piggyBank->name)])) + ); } return redirect(route('piggy-banks.index')); @@ -272,10 +276,14 @@ class PiggyBankController extends Controller // create event $repository->createEvent($piggyBank, bcmul($amount, '-1')); - Session::flash('success', 'Removed ' . Amount::format($amount, false) . ' from "' . e($piggyBank->name) . '".'); + Session::flash( + 'success', strval(trans('firefly.removed_amount_from_piggy', ['amount' => Amount::format($amount, false), 'name' => e($piggyBank->name)])) + ); Preferences::mark(); } else { - Session::flash('error', 'Could not remove ' . Amount::format($amount, false) . ' from "' . e($piggyBank->name) . '".'); + Session::flash( + 'error', strval(trans('firefly.cannot_remove_from_piggy', ['amount' => Amount::format($amount, false), 'name' => e($piggyBank->name)])) + ); } return redirect(route('piggy-banks.index')); @@ -329,7 +337,7 @@ class PiggyBankController extends Controller $piggyBank = $repository->store($piggyBankData); - Session::flash('success', 'Stored piggy bank "' . e($piggyBank->name) . '".'); + Session::flash('success', strval(trans('firefly.stored_piggy_bank', ['name' => e($piggyBank->name)]))); Preferences::mark(); if (intval(Input::get('create_another')) === 1) { @@ -364,7 +372,7 @@ class PiggyBankController extends Controller $piggyBank = $repository->update($piggyBank, $piggyBankData); - Session::flash('success', 'Updated piggy bank "' . e($piggyBank->name) . '".'); + Session::flash('success', strval(trans('firefly.updated_piggy_bank', ['name' => e($piggyBank->name)]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 482af8f2fb..bbfdc7941c 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -98,7 +98,7 @@ class PreferencesController extends Controller Preferences::set('twoFactorAuthEnabled', 1); Preferences::set('twoFactorAuthSecret', Session::get('two-factor-secret')); - Session::flash('success', 'Preferences saved!'); + Session::flash('success', strval(trans('firefly.saved_preferences'))); Preferences::mark(); return redirect(route('preferences')); @@ -151,7 +151,7 @@ class PreferencesController extends Controller } - Session::flash('success', 'Preferences saved!'); + Session::flash('success', strval(trans('firefly.saved_preferences'))); Preferences::mark(); // if we don't have a valid secret yet, redirect to the code page. diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index a6509cd9f2..f26023f3ec 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -60,7 +60,7 @@ class ProfileController extends Controller { // old, new1, new2 if (!Hash::check($request->get('current_password'), Auth::user()->password)) { - Session::flash('error', trans('firefly.invalid_current_password')); + Session::flash('error', strval(trans('firefly.invalid_current_password'))); return redirect(route('profile.change-password')); } @@ -75,7 +75,7 @@ class ProfileController extends Controller Auth::user()->password = bcrypt($request->get('new_password')); Auth::user()->save(); - Session::flash('success', trans('firefly.password_changed')); + Session::flash('success', strval(trans('firefly.password_changed'))); return redirect(route('profile')); } @@ -90,7 +90,7 @@ class ProfileController extends Controller { // old, new1, new2 if (!Hash::check($request->get('password'), Auth::user()->password)) { - Session::flash('error', trans('firefly.invalid_password')); + Session::flash('error', strval(trans('firefly.invalid_password'))); return redirect(route('profile.delete-account')); } diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index d34885acc2..9b4afec0f3 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -91,7 +91,7 @@ class RuleGroupController extends Controller $repository->destroy($ruleGroup, $moveTo); - Session::flash('success', trans('firefly.deleted_rule_group', ['title' => $title])); + Session::flash('success', strval(trans('firefly.deleted_rule_group', ['title' => $title]))); Preferences::mark(); @@ -162,7 +162,7 @@ class RuleGroupController extends Controller $this->dispatch($job); // Tell the user that the job is queued - Session::flash('success', trans('firefly.executed_group_on_existing_transactions', ['title' => $ruleGroup->title])); + Session::flash('success', strval(trans('firefly.executed_group_on_existing_transactions', ['title' => $ruleGroup->title]))); return redirect()->route('rules.index'); } @@ -204,7 +204,7 @@ class RuleGroupController extends Controller $ruleGroup = $repository->store($data); - Session::flash('success', trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title])); + Session::flash('success', strval(trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title]))); Preferences::mark(); if (intval(Input::get('create_another')) === 1) { @@ -249,7 +249,7 @@ class RuleGroupController extends Controller $repository->update($ruleGroup, $data); - Session::flash('success', trans('firefly.updated_rule_group', ['title' => $ruleGroup->title])); + Session::flash('success', strval(trans('firefly.updated_rule_group', ['title' => $ruleGroup->title]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 3002f05d9d..b2ef298649 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -106,7 +106,7 @@ class TagController extends Controller $tagName = $tag->tag; $repository->destroy($tag); - Session::flash('success', 'Tag "' . e($tagName) . '" was deleted.'); + Session::flash('success', strval(trans('firefly.deleted_tag', ['tag' => e($tagName)]))); Preferences::mark(); return redirect(route('tags.index')); @@ -244,7 +244,7 @@ class TagController extends Controller $data = $request->collectTagData(); $repository->store($data); - Session::flash('success', 'The tag has been created!'); + Session::flash('success', strval(trans('firefly.created_tag', ['tag' => e($data['tag'])]))); Preferences::mark(); if (intval(Input::get('create_another')) === 1) { @@ -271,7 +271,7 @@ class TagController extends Controller $data = $request->collectTagData(); $repository->update($tag, $data); - Session::flash('success', 'Tag "' . e($data['tag']) . '" updated.'); + Session::flash('success', strval(trans('firefly.updated_tag', ['tag' => e($data['tag'])]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 8b328be162..a4848f07de 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -119,7 +119,8 @@ class TransactionController extends Controller */ public function destroy(JournalRepositoryInterface $repository, TransactionJournal $transactionJournal) { - Session::flash('success', 'Transaction "' . e($transactionJournal->description) . '" destroyed.'); + $type = strtolower($transactionJournal->transaction_type_type ?? TransactionJournal::transactionTypeStr($transactionJournal)); + Session::flash('success', strval(trans('firefly.deleted_' . $type, ['description' => e($transactionJournal->description)]))); $repository->delete($transactionJournal); @@ -315,7 +316,7 @@ class TransactionController extends Controller event(new TransactionJournalStored($journal, intval($request->get('piggy_bank_id')))); - Session::flash('success', 'New transaction "' . $journal->description . '" stored!'); + Session::flash('success', strval(trans('firefly.stored_journal', ['description' => e($journal->description)]))); Preferences::mark(); if (intval(Input::get('create_another')) === 1) { @@ -360,7 +361,8 @@ class TransactionController extends Controller event(new TransactionJournalUpdated($journal)); // update, get events by date and sort DESC - Session::flash('success', 'Transaction "' . e($journalData['description']) . '" updated.'); + $type = strtolower($journal->transaction_type_type ?? TransactionJournal::transactionTypeStr($journal)); + Session::flash('success', strval(trans('firefly.updated_' . $type, ['description' => e($journalData['description'])]))); Preferences::mark(); if (intval(Input::get('return_to_edit')) === 1) { From 56a635212a0a112b9ab27ade8426753af0977b6b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 11:46:27 +0100 Subject: [PATCH 04/51] Code for #155 --- app/Http/routes.php | 36 ++++++++++++++++------------------ public/js/rules/create-edit.js | 2 +- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/app/Http/routes.php b/app/Http/routes.php index fc0929b5b7..3778c8b332 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -282,35 +282,33 @@ Route::group( // rules GET: Route::get('/rules/create/{ruleGroup}', ['uses' => 'RuleController@create', 'as' => 'rules.rule.create']); - Route::get('/rules/rules/up/{rule}', ['uses' => 'RuleController@up', 'as' => 'rules.rule.up']); - Route::get('/rules/rules/down/{rule}', ['uses' => 'RuleController@down', 'as' => 'rules.rule.down']); - Route::get('/rules/rules/edit/{rule}', ['uses' => 'RuleController@edit', 'as' => 'rules.rule.edit']); - Route::get('/rules/rules/delete/{rule}', ['uses' => 'RuleController@delete', 'as' => 'rules.rule.delete']); - Route::get('/rules/rules/test_triggers', ['uses' => 'RuleController@testTriggers', 'as' => 'rules.rule.test_triggers']); + Route::get('/rules/up/{rule}', ['uses' => 'RuleController@up', 'as' => 'rules.rule.up']); + Route::get('/rules/down/{rule}', ['uses' => 'RuleController@down', 'as' => 'rules.rule.down']); + Route::get('/rules/edit/{rule}', ['uses' => 'RuleController@edit', 'as' => 'rules.rule.edit']); + Route::get('/rules/delete/{rule}', ['uses' => 'RuleController@delete', 'as' => 'rules.rule.delete']); + Route::get('/rules/test', ['uses' => 'RuleController@testTriggers', 'as' => 'rules.rule.test_triggers']); // rules POST: - Route::post('/rules/rules/trigger/reorder/{rule}', ['uses' => 'RuleController@reorderRuleTriggers']); - Route::post('/rules/rules/action/reorder/{rule}', ['uses' => 'RuleController@reorderRuleActions']); + Route::post('/rules/trigger/order/{rule}', ['uses' => 'RuleController@reorderRuleTriggers']); + Route::post('/rules/action/order/{rule}', ['uses' => 'RuleController@reorderRuleActions']); Route::post('/rules/store/{ruleGroup}', ['uses' => 'RuleController@store', 'as' => 'rules.rule.store']); Route::post('/rules/update/{rule}', ['uses' => 'RuleController@update', 'as' => 'rules.rule.update']); Route::post('/rules/destroy/{rule}', ['uses' => 'RuleController@destroy', 'as' => 'rules.rule.destroy']); // rule groups GET - Route::get('/rules/groups/create', ['uses' => 'RuleGroupController@create', 'as' => 'rules.rule-group.create']); - Route::get('/rules/groups/edit/{ruleGroup}', ['uses' => 'RuleGroupController@edit', 'as' => 'rules.rule-group.edit']); - Route::get('/rules/groups/delete/{ruleGroup}', ['uses' => 'RuleGroupController@delete', 'as' => 'rules.rule-group.delete']); - Route::get('/rules/groups/up/{ruleGroup}', ['uses' => 'RuleGroupController@up', 'as' => 'rules.rule-group.up']); - Route::get('/rules/groups/down/{ruleGroup}', ['uses' => 'RuleGroupController@down', 'as' => 'rules.rule-group.down']); - Route::get( - '/rules/groups/select_transactions/{ruleGroup}', ['uses' => 'RuleGroupController@selectTransactions', 'as' => 'rules.rule-group.select_transactions'] - ); + Route::get('/rule-groups/create', ['uses' => 'RuleGroupController@create', 'as' => 'rules.rule-group.create']); + Route::get('/rule-groups/edit/{ruleGroup}', ['uses' => 'RuleGroupController@edit', 'as' => 'rules.rule-group.edit']); + Route::get('/rule-groups/delete/{ruleGroup}', ['uses' => 'RuleGroupController@delete', 'as' => 'rules.rule-group.delete']); + Route::get('/rule-groups/up/{ruleGroup}', ['uses' => 'RuleGroupController@up', 'as' => 'rules.rule-group.up']); + Route::get('/rule-groups/down/{ruleGroup}', ['uses' => 'RuleGroupController@down', 'as' => 'rules.rule-group.down']); + Route::get('/rule-groups/select/{ruleGroup}', ['uses' => 'RuleGroupController@selectTransactions', 'as' => 'rules.rule-group.select_transactions']); // rule groups POST - Route::post('/rules/groups/store', ['uses' => 'RuleGroupController@store', 'as' => 'rules.rule-group.store']); - Route::post('/rules/groups/update/{ruleGroup}', ['uses' => 'RuleGroupController@update', 'as' => 'rules.rule-group.update']); - Route::post('/rules/groups/destroy/{ruleGroup}', ['uses' => 'RuleGroupController@destroy', 'as' => 'rules.rule-group.destroy']); - Route::post('/rules/groups/execute/{ruleGroup}', ['uses' => 'RuleGroupController@execute', 'as' => 'rules.rule-group.execute']); + Route::post('/rule-groups/store', ['uses' => 'RuleGroupController@store', 'as' => 'rules.rule-group.store']); + Route::post('/rule-groups/update/{ruleGroup}', ['uses' => 'RuleGroupController@update', 'as' => 'rules.rule-group.update']); + Route::post('/rule-groups/destroy/{ruleGroup}', ['uses' => 'RuleGroupController@destroy', 'as' => 'rules.rule-group.destroy']); + Route::post('/rule-groups/execute/{ruleGroup}', ['uses' => 'RuleGroupController@execute', 'as' => 'rules.rule-group.execute']); /** * Search Controller diff --git a/public/js/rules/create-edit.js b/public/js/rules/create-edit.js index 9a4c0c812c..819fa8e2bd 100644 --- a/public/js/rules/create-edit.js +++ b/public/js/rules/create-edit.js @@ -91,7 +91,7 @@ function testRuleTriggers() { var triggerData = $( ".rule-trigger-tbody" ).find( "input[type=text], input[type=checkbox], select" ).serializeArray(); // Find a list of existing transactions that match these triggers - $.get('rules/rules/test_triggers', triggerData).done(function (data) { + $.get('rules/test', triggerData).done(function (data) { var modal = $( "#testTriggerModal" ); var numTriggers = $( ".rule-trigger-body > tr" ).length; From 628268d47c14e8cad770c7ee2deccdd87fb7abed Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 11:47:10 +0100 Subject: [PATCH 05/51] Code to fix #223 --- app/Repositories/Account/AccountRepository.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 38abfd74c9..8096a7f166 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -14,6 +14,7 @@ use FireflyIII\Models\Preference; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; +use FireflyIII\User; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -31,6 +32,19 @@ use Steam; class AccountRepository implements AccountRepositoryInterface { + /** @var User */ + private $user; + + /** + * AttachmentRepository constructor. + * + * @param User $user + */ + public function __construct(User $user) + { + $this->user = $user; + } + /** * @param array $types * From 6698b57f5209e5acd2f8a58a3b12960f8664c4a7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 16:41:48 +0100 Subject: [PATCH 06/51] Fixed a bug that would leave all amounts at zero. #224 --- app/Support/Amount.php | 7 ++----- resources/views/list/journals-tiny.twig | 17 +++++------------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/app/Support/Amount.php b/app/Support/Amount.php index c5ac2b7f28..2b2807f8d6 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -70,11 +70,8 @@ class Amount */ public function formatJournal(TransactionJournal $journal, bool $coloured = true): string { - $locale = setlocale(LC_MONETARY, 0); - $float = round($journal->destination_amount, 2); - if ($journal->isWithdrawal()) { - $float = round($journal->source_amount, 2); - } + $locale = setlocale(LC_MONETARY, 0); + $float = round(TransactionJournal::amount($journal), 2); $formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY); $currencyCode = $journal->transaction_currency_code ?? $journal->transactionCurrency->code; $result = $formatter->formatCurrency($float, $currencyCode); diff --git a/resources/views/list/journals-tiny.twig b/resources/views/list/journals-tiny.twig index 5dd61db3e8..b788fac644 100644 --- a/resources/views/list/journals-tiny.twig +++ b/resources/views/list/journals-tiny.twig @@ -1,24 +1,17 @@ From 6602b1587a9d7b0cc9b8abd428f82d56305bcf3e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 16:46:26 +0100 Subject: [PATCH 07/51] Some scrutiniser related code cleanup. --- app/Handlers/Events/UserEventListener.php | 2 +- .../Controllers/PreferencesController.php | 30 +++++++++---------- app/Http/Middleware/AuthenticateTwoFactor.php | 8 ++--- .../RedirectIfTwoFactorAuthenticated.php | 8 ++--- resources/views/preferences/index.twig | 4 +-- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/Handlers/Events/UserEventListener.php b/app/Handlers/Events/UserEventListener.php index 6bfdbb75bd..1b3888ec0c 100644 --- a/app/Handlers/Events/UserEventListener.php +++ b/app/Handlers/Events/UserEventListener.php @@ -21,7 +21,7 @@ class UserEventListener /** * Handle user logout events. */ - public function onUserLogout($event) + public function onUserLogout() { // dump stuff from the session: Session::forget('twofactor-authenticated'); diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index bbfdc7941c..e84245a4d6 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -64,26 +64,26 @@ class PreferencesController extends Controller */ public function index(ARI $repository) { - $accounts = $repository->getAccounts(['Default account', 'Asset account']); - $viewRangePref = Preferences::get('viewRange', '1M'); - $viewRange = $viewRangePref->data; - $frontPageAccounts = Preferences::get('frontPageAccounts', []); - $budgetMax = Preferences::get('budgetMaximum', 1000); - $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; - $budgetMaximum = $budgetMax->data; - $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; - $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data; - $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr; - $twoFactorAuthEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; - $hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret')); - $showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', false) === true; + $accounts = $repository->getAccounts(['Default account', 'Asset account']); + $viewRangePref = Preferences::get('viewRange', '1M'); + $viewRange = $viewRangePref->data; + $frontPageAccounts = Preferences::get('frontPageAccounts', []); + $budgetMax = Preferences::get('budgetMaximum', 1000); + $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; + $budgetMaximum = $budgetMax->data; + $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; + $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data; + $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr; + $is2faEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; // twoFactorAuthEnabled + $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); // hasTwoFactorAuthSecret + $showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', false) === true; return view( 'preferences.index', compact( 'budgetMaximum', 'language', 'accounts', 'frontPageAccounts', - 'viewRange', 'customFiscalYear', 'fiscalYearStart', 'twoFactorAuthEnabled', - 'hasTwoFactorAuthSecret', 'showIncomplete' + 'viewRange', 'customFiscalYear', 'fiscalYearStart', 'is2faEnabled', + 'has2faSecret', 'showIncomplete' ) ); } diff --git a/app/Http/Middleware/AuthenticateTwoFactor.php b/app/Http/Middleware/AuthenticateTwoFactor.php index a27ba70151..13e62673f1 100644 --- a/app/Http/Middleware/AuthenticateTwoFactor.php +++ b/app/Http/Middleware/AuthenticateTwoFactor.php @@ -52,10 +52,10 @@ class AuthenticateTwoFactor return redirect()->guest('login'); } } - $twoFactorAuthEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; - $hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret')); - $isTwoFactorAuthenticated = Session::get('twofactor-authenticated'); - if ($twoFactorAuthEnabled && $hasTwoFactorAuthSecret && !$isTwoFactorAuthenticated) { + $is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; + $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); + $is2faAuthed = Session::get('twofactor-authenticated'); + if ($is2faEnabled && $has2faSecret && !$is2faAuthed) { return redirect(route('two-factor')); } diff --git a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php index a918d515b4..682e2f09d6 100644 --- a/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php +++ b/app/Http/Middleware/RedirectIfTwoFactorAuthenticated.php @@ -36,10 +36,10 @@ class RedirectIfTwoFactorAuthenticated { if (Auth::guard($guard)->check()) { - $twoFactorAuthEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; - $hasTwoFactorAuthSecret = !is_null(Preferences::get('twoFactorAuthSecret')); - $isTwoFactorAuthenticated = Session::get('twofactor-authenticated'); - if ($twoFactorAuthEnabled && $hasTwoFactorAuthSecret && $isTwoFactorAuthenticated) { + $is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data; + $has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret')); + $is2faAuthed = Session::get('twofactor-authenticated'); + if ($is2faEnabled && $has2faSecret && $is2faAuthed) { return redirect('/'); } } diff --git a/resources/views/preferences/index.twig b/resources/views/preferences/index.twig index 5dd4882713..a78117cacf 100644 --- a/resources/views/preferences/index.twig +++ b/resources/views/preferences/index.twig @@ -150,12 +150,12 @@
- {% if twoFactorAuthEnabled == 1 and hasTwoFactorAuthSecret == true %} + {% if is2faEnabled == 1 and has2faSecret == true %}
From 745e0aa52560c1b6786f93e2d41c48f62328028a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 16:47:53 +0100 Subject: [PATCH 08/51] Move to object held user object. --- .../Account/AccountRepository.php | 101 +++++++++--------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 8096a7f166..0e2b58d244 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -2,7 +2,6 @@ namespace FireflyIII\Repositories\Account; -use Auth; use Carbon\Carbon; use Config; use DB; @@ -52,7 +51,7 @@ class AccountRepository implements AccountRepositoryInterface */ public function countAccounts(array $types): int { - $count = Auth::user()->accounts()->accountTypeIn($types)->count(); + $count = $this->user->accounts()->accountTypeIn($types)->count(); return $count; } @@ -84,7 +83,7 @@ class AccountRepository implements AccountRepositoryInterface */ public function find(int $accountId): Account { - return Auth::user()->accounts()->findOrNew($accountId); + return $this->user->accounts()->findOrNew($accountId); } /** @@ -107,7 +106,7 @@ class AccountRepository implements AccountRepositoryInterface public function getAccounts(array $types): Collection { /** @var Collection $result */ - $result = Auth::user()->accounts()->with( + $result = $this->user->accounts()->with( ['accountmeta' => function (HasMany $query) { $query->where('name', 'accountRole'); }] @@ -135,22 +134,22 @@ class AccountRepository implements AccountRepositoryInterface */ public function getCreditCards(Carbon $date): Collection { - $set = Auth::user()->accounts() - ->hasMetaValue('accountRole', 'ccAsset') - ->hasMetaValue('ccType', 'monthlyFull') - ->leftJoin('transactions', 'transactions.account_id', '=', 'accounts.id') - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->whereNull('transactions.deleted_at') - ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) - ->groupBy('accounts.id') - ->get( - [ - 'accounts.*', - 'ccType.data as ccType', - 'accountRole.data as accountRole', - DB::Raw('SUM(`transactions`.`amount`) AS `balance`'), - ] - ); + $set = $this->user->accounts() + ->hasMetaValue('accountRole', 'ccAsset') + ->hasMetaValue('ccType', 'monthlyFull') + ->leftJoin('transactions', 'transactions.account_id', '=', 'accounts.id') + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->whereNull('transactions.deleted_at') + ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) + ->groupBy('accounts.id') + ->get( + [ + 'accounts.*', + 'ccType.data as ccType', + 'accountRole.data as accountRole', + DB::Raw('SUM(`transactions`.`amount`) AS `balance`'), + ] + ); return $set; } @@ -178,7 +177,7 @@ class AccountRepository implements AccountRepositoryInterface */ public function getFrontpageAccounts(Preference $preference): Collection { - $query = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account']); + $query = $this->user->accounts()->accountTypeIn(['Default account', 'Asset account']); if (count($preference->data) > 0) { $query->whereIn('accounts.id', $preference->data); @@ -202,20 +201,20 @@ class AccountRepository implements AccountRepositoryInterface */ public function getFrontpageTransactions(Account $account, Carbon $start, Carbon $end): Collection { - $set = Auth::user() - ->transactionjournals() - ->with(['transactions']) - ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')->where('accounts.id', $account->id) - ->leftJoin('transaction_currencies', 'transaction_currencies.id', '=', 'transaction_journals.transaction_currency_id') - ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') - ->before($end) - ->after($start) - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC') - ->take(10) - ->get(['transaction_journals.*', 'transaction_currencies.symbol', 'transaction_types.type']); + $set = $this->user + ->transactionjournals() + ->with(['transactions']) + ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')->where('accounts.id', $account->id) + ->leftJoin('transaction_currencies', 'transaction_currencies.id', '=', 'transaction_journals.transaction_currency_id') + ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') + ->before($end) + ->after($start) + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC') + ->take(10) + ->get(['transaction_journals.*', 'transaction_currencies.symbol', 'transaction_types.type']); return $set; } @@ -229,14 +228,14 @@ class AccountRepository implements AccountRepositoryInterface public function getJournals(Account $account, $page): LengthAwarePaginator { $offset = ($page - 1) * 50; - $query = Auth::user() - ->transactionJournals() - ->withRelevantData() - ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->where('transactions.account_id', $account->id) - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC'); + $query = $this->user + ->transactionJournals() + ->withRelevantData() + ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('transactions.account_id', $account->id) + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC'); $count = $query->count(); $set = $query->take(50)->offset($offset)->get(['transaction_journals.*']); @@ -262,7 +261,7 @@ class AccountRepository implements AccountRepositoryInterface $ids = array_unique($ids); if (count($ids) > 0) { - $accounts = Auth::user()->accounts()->whereIn('id', $ids)->where('accounts.active', 1)->get(); + $accounts = $this->user->accounts()->whereIn('id', $ids)->where('accounts.active', 1)->get(); } bcscale(2); @@ -296,12 +295,12 @@ class AccountRepository implements AccountRepositoryInterface */ public function getSavingsAccounts(): Collection { - $accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC') - ->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id') - ->where('account_meta.name', 'accountRole') - ->where('accounts.active', 1) - ->where('account_meta.data', '"savingAsset"') - ->get(['accounts.*']); + $accounts = $this->user->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC') + ->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id') + ->where('account_meta.name', 'accountRole') + ->where('accounts.active', 1) + ->where('account_meta.data', '"savingAsset"') + ->get(['accounts.*']); $start = clone Session::get('start', new Carbon); $end = clone Session::get('end', new Carbon); @@ -426,7 +425,7 @@ class AccountRepository implements AccountRepositoryInterface */ public function sumOfEverything(): string { - return strval(Auth::user()->transactions()->sum('amount')); + return strval($this->user->transactions()->sum('amount')); } /** From cc26ce4143ff870e6df102be94d019545c41f04a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 16:49:49 +0100 Subject: [PATCH 09/51] Some scrutiniser related code cleanup. --- app/Validation/FireflyValidator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 1a14187fa3..fffb7dc2e5 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -16,6 +16,7 @@ use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Rules\Triggers\TriggerInterface; use FireflyIII\User; +use Google2FA; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Validation\Validator; use Log; @@ -60,6 +61,7 @@ class FireflyValidator extends Validator } $secret = Session::get('two-factor-secret'); + /** @var Google2FA $google2fa */ $google2fa = app('PragmaRX\Google2FA\Google2FA'); return $google2fa->verifyKey($secret, $value); From 201790ff8dd5f175b1f902a9867268636cb3c2f2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 20 Mar 2016 17:12:34 +0100 Subject: [PATCH 10/51] Cleanup transaction journal edit. #215 --- app/Helpers/Collection/BalanceLine.php | 2 +- .../Controllers/Chart/BudgetController.php | 4 +- .../Controllers/TransactionController.php | 85 +++++++++---------- .../Models/TransactionJournalSupport.php | 65 ++++++++++++++ resources/lang/en_US/firefly.php | 2 +- resources/lang/en_US/form.php | 1 - .../views/reports/default/multi-year.twig | 2 +- resources/views/reports/partials/budgets.twig | 2 +- resources/views/transactions/edit.twig | 12 +-- 9 files changed, 116 insertions(+), 59 deletions(-) diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index e6157f6c06..a57a7b403b 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -102,7 +102,7 @@ class BalanceLine return $this->getBudget()->name; } if ($this->getRole() == self::ROLE_DEFAULTROLE) { - return trans('firefly.noBudget'); + return trans('firefly.no_budget'); } if ($this->getRole() == self::ROLE_TAGROLE) { return trans('firefly.coveredWithTags'); diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 18a61759d2..54dd637839 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -198,7 +198,7 @@ class BudgetController extends Controller } $noBudgetExpenses = $repository->getWithoutBudgetSum($accounts, $start, $end); - $allEntries->push([trans('firefly.noBudget'), '0', '0', $noBudgetExpenses, '0', '0']); + $allEntries->push([trans('firefly.no_budget'), '0', '0', $noBudgetExpenses, '0', '0']); $data = $this->generator->frontpage($allEntries); $cache->store($data); @@ -258,7 +258,7 @@ class BudgetController extends Controller // basic information: $year = $currentStart->year; - $entry['name'] = $budget->name ?? (string)trans('firefly.noBudget'); + $entry['name'] = $budget->name ?? (string)trans('firefly.no_budget'); $spent = 0; // this might be a good moment to collect no budget stuff. if (is_null($budget->id)) { diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index a4848f07de..a0971dd904 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -7,7 +7,6 @@ use Config; use ExpandedForm; use FireflyIII\Events\TransactionJournalStored; use FireflyIII\Events\TransactionJournalUpdated; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Http\Requests\JournalFormRequest; use FireflyIII\Models\PiggyBank; @@ -16,7 +15,9 @@ use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; +use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Support\Collection; use Input; use Preferences; @@ -57,7 +58,7 @@ class TransactionController extends Controller $uploadSize = min($maxFileSize, $maxPostSize); $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); $budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get()); - $budgets[0] = trans('form.noBudget'); + $budgets[0] = trans('firefly.no_budget'); $piggyBanks = Auth::user()->piggyBanks()->orderBy('order', 'ASC')->get(); /** @var PiggyBank $piggy */ foreach ($piggyBanks as $piggy) { @@ -131,53 +132,45 @@ class TransactionController extends Controller } /** - * Shows the view to edit a transaction. - * - * @param ARI $repository * @param TransactionJournal $journal * - * @return $this - * @throws FireflyException + * @return mixed */ - public function edit(ARI $repository, TransactionJournal $journal) + public function edit(TransactionJournal $journal) { - $maxFileSize = Steam::phpBytes(ini_get('upload_max_filesize')); - $maxPostSize = Steam::phpBytes(ini_get('post_max_size')); - $uploadSize = min($maxFileSize, $maxPostSize); - $what = strtolower(TransactionJournal::transactionTypeStr($journal)); - $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); - $budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get()); - $budgets[0] = trans('form.noBudget'); - $piggies = ExpandedForm::makeSelectList(Auth::user()->piggyBanks()->get()); - $piggies[0] = trans('form.noPiggybank'); - $subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]); - $preFilled = [ - 'date' => $journal->date->format('Y-m-d'), - 'interest_date' => $journal->interest_date ? $journal->interest_date->format('Y-m-d') : '', - 'book_date' => $journal->book_date ? $journal->book_date->format('Y-m-d') : '', - 'process_date' => $journal->process_date ? $journal->process_date->format('Y-m-d') : '', - 'category' => '', - 'budget_id' => 0, - 'piggy_bank_id' => 0, - 'tags' => join(',', $journal->tags->pluck('tag')->toArray()), + /** @var ARI $accountRepository */ + $accountRepository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); + /** @var BudgetRepositoryInterface $budgetRepository */ + $budgetRepository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); + /** @var PiggyBankRepositoryInterface $piggyRepository */ + $piggyRepository = app('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface'); + + $accountList = ExpandedForm::makeSelectList($accountRepository->getAccounts(['Default account', 'Asset account'])); + $budgetList = ExpandedForm::makeSelectList($budgetRepository->getActiveBudgets()); + $piggyBankList = ExpandedForm::makeSelectList($piggyRepository->getPiggyBanks()); + $budgetList[0] = trans('firefly.no_budget'); + $piggyBankList[0] = trans('form.noPiggybank'); + $maxFileSize = Steam::phpBytes(ini_get('upload_max_filesize')); + $maxPostSize = Steam::phpBytes(ini_get('post_max_size')); + $uploadSize = min($maxFileSize, $maxPostSize); + $what = strtolower(TransactionJournal::transactionTypeStr($journal)); + $subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]); + + + $preFilled = [ + 'date' => TransactionJournal::dateAsString($journal), + 'interest_date' => TransactionJournal::dateAsString($journal, 'interest_date'), + 'book_date' => TransactionJournal::dateAsString($journal, 'book_date'), + 'process_date' => TransactionJournal::dateAsString($journal, 'process_date'), + 'category' => TransactionJournal::categoryAsString($journal), + 'budget_id' => TransactionJournal::budgetId($journal), + 'piggy_bank_id' => TransactionJournal::piggyBankId($journal), + 'tags' => join(',', $journal->tags->pluck('tag')->toArray()), + 'account_from_id' => TransactionJournal::sourceAccount($journal)->id, + 'account_to_id' => TransactionJournal::destinationAccount($journal)->id, + 'amount' => TransactionJournal::amountPositive($journal), ]; - $category = $journal->categories()->first(); - if (!is_null($category)) { - $preFilled['category'] = $category->name; - } - - $budget = $journal->budgets()->first(); - if (!is_null($budget)) { - $preFilled['budget_id'] = $budget->id; - } - - if ($journal->piggyBankEvents()->count() > 0) { - $preFilled['piggy_bank_id'] = $journal->piggyBankEvents()->orderBy('date', 'DESC')->first()->piggy_bank_id; - } - - $preFilled['amount'] = TransactionJournal::amountPositive($journal); - if ($journal->isWithdrawal()) { $preFilled['account_id'] = TransactionJournal::sourceAccount($journal)->id; if (TransactionJournal::destinationAccountTypeStr($journal) != 'Cash account') { @@ -190,8 +183,6 @@ class TransactionController extends Controller } } - $preFilled['account_from_id'] = TransactionJournal::sourceAccount($journal)->id; - $preFilled['account_to_id'] = TransactionJournal::destinationAccount($journal)->id; Session::flash('preFilled', $preFilled); Session::flash('gaEventCategory', 'transactions'); @@ -204,7 +195,9 @@ class TransactionController extends Controller Session::forget('transactions.edit.fromUpdate'); - return view('transactions.edit', compact('journal', 'uploadSize', 'accounts', 'what', 'budgets', 'piggies', 'subTitle'))->with('data', $preFilled); + return view('transactions.edit', compact('journal', 'uploadSize', 'accountList', 'what', 'budgetList', 'piggyBankList', 'subTitle'))->with( + 'data', $preFilled + ); } /** diff --git a/app/Support/Models/TransactionJournalSupport.php b/app/Support/Models/TransactionJournalSupport.php index 53688699a0..75fe75ac4f 100644 --- a/app/Support/Models/TransactionJournalSupport.php +++ b/app/Support/Models/TransactionJournalSupport.php @@ -10,6 +10,7 @@ namespace FireflyIII\Support\Models; +use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; @@ -79,6 +80,56 @@ class TransactionJournalSupport extends Model return $amount; } + /** + * @param TransactionJournal $journal + * + * @return int + */ + public static function budgetId(TransactionJournal $journal): int + { + $budget = $journal->budgets()->first(); + if (!is_null($budget)) { + return $budget->id; + } + + return 0; + } + + /** + * @param TransactionJournal $journal + * + * @return string + */ + public static function categoryAsString(TransactionJournal $journal): string + { + $category = $journal->categories()->first(); + if (!is_null($category)) { + return $category->name; + } + + return ''; + } + + /** + * @param TransactionJournal $journal + * @param string $dateField + * + * @return string + */ + public static function dateAsString(TransactionJournal $journal, string $dateField = ''): string + { + if ($dateField === '') { + return $journal->date->format('Y-m-d'); + } + if (!is_null($journal->$dateField) && $journal->$dateField instanceof Carbon) { + return $journal->$dateField->format('Y-m-d'); + } + + return ''; + + + } + /** * @param TransactionJournal $journal * @@ -147,6 +198,20 @@ class TransactionJournalSupport extends Model return false; } + /** + * @param TransactionJournal $journal + * + * @return int + */ + public static function piggyBankId(TransactionJournal $journal): int + { + if ($journal->piggyBankEvents()->count() > 0) { + return $journal->piggyBankEvents()->orderBy('date', 'DESC')->first()->piggy_bank_id; + } + + return 0; + } + /** * @param TransactionJournal $journal * diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 483621962c..bc4064ba9e 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -650,7 +650,7 @@ return [ 'earned' => 'Earned', 'overspent' => 'Overspent', 'left' => 'Left', - 'noBudget' => '(no budget)', + 'no_budget' => '(no budget)', 'maxAmount' => 'Maximum amount', 'minAmount' => 'Minumum amount', 'billEntry' => 'Current bill entry', diff --git a/resources/lang/en_US/form.php b/resources/lang/en_US/form.php index 5361c8daac..85263d00ed 100644 --- a/resources/lang/en_US/form.php +++ b/resources/lang/en_US/form.php @@ -74,7 +74,6 @@ return [ 'add_new_deposit' => 'Add a new deposit', 'add_new_transfer' => 'Add a new transfer', 'noPiggybank' => '(no piggy bank)', - 'noBudget' => '(no budget)', 'title' => 'Title', 'notes' => 'Notes', 'filename' => 'File name', diff --git a/resources/views/reports/default/multi-year.twig b/resources/views/reports/default/multi-year.twig index 1019861620..f08c3a7cc4 100644 --- a/resources/views/reports/default/multi-year.twig +++ b/resources/views/reports/default/multi-year.twig @@ -100,7 +100,7 @@
{% for budget in budgets %}
diff --git a/resources/views/bills/edit.twig b/resources/views/bills/edit.twig index 94c4add246..408f97ff27 100644 --- a/resources/views/bills/edit.twig +++ b/resources/views/bills/edit.twig @@ -21,7 +21,7 @@ {{ ExpandedForm.tags('match') }} {{ ExpandedForm.amount('amount_min') }} {{ ExpandedForm.amount('amount_max') }} - {{ ExpandedForm.date('date',bill.date.format('Y-m-d')) }} + {{ ExpandedForm.date('date',bill.date.format('Y-m-d'), {helpText: trans('firefly.bill_date_little_relevance')}) }} {{ ExpandedForm.select('repeat_freq',periods) }}
From f200086d012a62b7c03b38e972aa537499d8286b Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 15:55:14 +0200 Subject: [PATCH 41/51] Code for #207 --- app/Http/Controllers/BillController.php | 20 +++++++- app/Models/Bill.php | 36 +++++++-------- resources/lang/en_US/list.php | 61 +++++++++++++------------ resources/views/list/bills.twig | 17 +++++-- 4 files changed, 82 insertions(+), 52 deletions(-) diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index a634c6aa46..87be25b6e6 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -110,11 +110,29 @@ class BillController extends Controller */ public function index(BillRepositoryInterface $repository) { + $start = session('start'); + $end = session('end'); + $bills = $repository->getBills(); $bills->each( - function (Bill $bill) use ($repository) { + function (Bill $bill) use ($repository, $start, $end) { $bill->nextExpectedMatch = $repository->nextExpectedMatch($bill); $bill->lastFoundMatch = $repository->lastFoundMatch($bill); + $journals = $repository->getJournalsInRange($bill, $start, $end); + // loop journals, find average: + $average = '0'; + $count = $journals->count(); + if ($count > 0) { + $sum = '0'; + foreach ($journals as $journal) { + $sum = bcadd($sum, TransactionJournal::amountPositive($journal)); + } + $average = bcdiv($sum, strval($count)); + } + + $bill->lastPaidAmount = $average; + $bill->paidInPeriod = ($start <= $bill->lastFoundMatch) && ($end >= $bill->lastFoundMatch); + } ); diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 167ea38842..37cfdc5a6f 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -27,6 +27,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property-read \FireflyIII\User $user * @property \Carbon\Carbon $nextExpectedMatch * @property \Carbon\Carbon $lastFoundMatch + * @property bool $paidInPeriod + * @property string $lastPaidAmount * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereUpdatedAt($value) @@ -47,11 +49,25 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class Bill extends Model { + protected $dates = ['created_at', 'updated_at', 'date']; protected $fillable = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',]; - protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted']; - protected $dates = ['created_at', 'updated_at', 'date']; + + /** + * @param Bill $value + * + * @return Bill + */ + public static function routeBinder(Bill $value) + { + if (Auth::check()) { + if ($value->user_id == Auth::user()->id) { + return $value; + } + } + throw new NotFoundHttpException; + } /** * @param $value @@ -134,20 +150,4 @@ class Bill extends Model } - /** - * @param Bill $value - * - * @return Bill - */ - public static function routeBinder(Bill $value) - { - if (Auth::check()) { - if ($value->user_id == Auth::user()->id) { - return $value; - } - } - throw new NotFoundHttpException; - } - - } diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.php index 29ebb0b6ca..8cab261e04 100644 --- a/resources/lang/en_US/list.php +++ b/resources/lang/en_US/list.php @@ -8,34 +8,35 @@ */ return [ - 'name' => 'Name', - 'role' => 'Role', - 'currentBalance' => 'Current balance', - 'active' => 'Is active?', - 'lastActivity' => 'Last activity', - 'balanceDiff' => 'Balance difference between :start and :end', - 'matchedOn' => 'Matched on', - 'matchesOn' => 'Matched on', - 'matchingAmount' => 'Amount', - 'lastMatch' => 'Last match', - 'expectedMatch' => 'Expected match', - 'automatch' => 'Auto match?', - 'repeat_freq' => 'Repeats', - 'description' => 'Description', - 'amount' => 'Amount', - 'date' => 'Date', - 'interest_date' => 'Interest date', - 'book_date' => 'Book date', - 'process_date' => 'Processing date', - 'from' => 'From', - 'to' => 'To', - 'budget' => 'Budget', - 'category' => 'Category', - 'bill' => 'Bill', - 'withdrawal' => 'Withdrawal', - 'deposit' => 'Deposit', - 'transfer' => 'Transfer', - 'type' => 'Type', - 'completed' => 'Completed', - 'iban' => 'IBAN', + 'name' => 'Name', + 'role' => 'Role', + 'currentBalance' => 'Current balance', + 'active' => 'Is active?', + 'lastActivity' => 'Last activity', + 'balanceDiff' => 'Balance difference between :start and :end', + 'matchedOn' => 'Matched on', + 'matchesOn' => 'Matched on', + 'matchingAmount' => 'Amount', + 'lastMatch' => 'Last match', + 'expectedMatch' => 'Expected match', + 'automatch' => 'Auto match?', + 'repeat_freq' => 'Repeats', + 'description' => 'Description', + 'amount' => 'Amount', + 'date' => 'Date', + 'interest_date' => 'Interest date', + 'book_date' => 'Book date', + 'process_date' => 'Processing date', + 'from' => 'From', + 'to' => 'To', + 'budget' => 'Budget', + 'category' => 'Category', + 'bill' => 'Bill', + 'withdrawal' => 'Withdrawal', + 'deposit' => 'Deposit', + 'transfer' => 'Transfer', + 'type' => 'Type', + 'completed' => 'Completed', + 'iban' => 'IBAN', + 'paid_current_period' => 'Paid this period', ]; diff --git a/resources/views/list/bills.twig b/resources/views/list/bills.twig index c5c0b7fa57..380878a14e 100644 --- a/resources/views/list/bills.twig +++ b/resources/views/list/bills.twig @@ -5,7 +5,7 @@ {{ trans('list.name') }} {{ trans('list.matchesOn') }} {{ trans('list.matchingAmount') }} - {{ trans('list.lastMatch') }} + {{ trans('list.paid_current_period') }} {{ trans('list.expectedMatch') }} {{ trans('list.active') }} {{ trans('list.automatch') }} @@ -36,8 +36,19 @@ {{ entry.amount_max|formatAmount }} {% if not entry.lastFoundMatch.isFuture %} - + {{ entry.lastFoundMatch.formatLocalized(monthAndDayFormat) }} + {% if entry.active and entry.paidInPeriod %} + ({{ entry.lastPaidAmount|formatAmountPlain }}) + {% endif %} {% else %} @@ -51,7 +62,7 @@ {% else %} - {{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }} + ~ {{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }} {% endif %} From bdbead256c5a7d55410c1bad3f411b52a5806697 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 16:02:09 +0200 Subject: [PATCH 42/51] Make field a number. --- resources/views/auth/two-factor.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/auth/two-factor.twig b/resources/views/auth/two-factor.twig index 39a6046ed2..e7148d811e 100644 --- a/resources/views/auth/two-factor.twig +++ b/resources/views/auth/two-factor.twig @@ -22,7 +22,7 @@
- +
From cb34ff4c837b2ed1874386d739de3af0e307c79d Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 16:02:54 +0200 Subject: [PATCH 43/51] Clean up some code. --- app/Http/Kernel.php | 62 --------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 61887f68b6..930687c575 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -122,68 +122,6 @@ class Kernel extends HttpKernel Binder::class, ], -// -// // must be authenticated -// // must be 2fa (if enabled) -// // must be activated account -// 'web-auth' => [ -// EncryptCookies::class, -// AddQueuedCookiesToResponse::class, -// StartSession::class, -// ShareErrorsFromSession::class, -// VerifyCsrfToken::class, -// Authenticate::class, -// AuthenticateTwoFactor::class, -// IsConfirmed::class, -// ], -// // must be authenticated -// // must be 2fa (if enabled) -// // must NOT be activated account -// 'web-auth-no-confirm' => [ -// EncryptCookies::class, -// AddQueuedCookiesToResponse::class, -// StartSession::class, -// ShareErrorsFromSession::class, -// VerifyCsrfToken::class, -// Authenticate::class, -// AuthenticateTwoFactor::class, -// IsNotConfirmed::class, -// ], -// // must be authenticated -// // does not care about 2fa -// // must be confirmed. -// 'web-auth-no-two-factor' => [ -// EncryptCookies::class, -// AddQueuedCookiesToResponse::class, -// StartSession::class, -// ShareErrorsFromSession::class, -// VerifyCsrfToken::class, -// Authenticate::class, -// RedirectIfTwoFactorAuthenticated::class, -// IsConfirmed::class, -// ], -// 'web-auth-no-two-factor-any-confirm' => [ -// EncryptCookies::class, -// AddQueuedCookiesToResponse::class, -// StartSession::class, -// ShareErrorsFromSession::class, -// VerifyCsrfToken::class, -// Authenticate::class, -// RedirectIfTwoFactorAuthenticated::class, -// ], -// 'web-auth-range' => [ -// EncryptCookies::class, -// AddQueuedCookiesToResponse::class, -// StartSession::class, -// ShareErrorsFromSession::class, -// VerifyCsrfToken::class, -// Authenticate::class, -// AuthenticateTwoFactor::class, -// IsConfirmed::class, -// Range::class, -// Binder::class, -// ], - 'api' => [ 'throttle:60,1', ], From ab4616a3ad1ce2dda1c062b508be015f0c5cec30 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 16:10:51 +0200 Subject: [PATCH 44/51] Make some vars longer. --- app/Events/ResendConfirmation.php | 11 +++++------ app/Events/UserRegistration.php | 9 ++++----- app/Handlers/Events/SendRegistrationMail.php | 2 +- app/Handlers/Events/UserConfirmation.php | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/Events/ResendConfirmation.php b/app/Events/ResendConfirmation.php index 813334f5aa..6b7091ee24 100644 --- a/app/Events/ResendConfirmation.php +++ b/app/Events/ResendConfirmation.php @@ -21,19 +21,18 @@ class ResendConfirmation extends Event { use SerializesModels; - public $ip; + public $ipAddress; public $user; /** * Create a new event instance. * * @param User $user - * - * @param string $ip + * @param string $ipAddress */ - public function __construct(User $user, string $ip) + public function __construct(User $user, string $ipAddress) { - $this->user = $user; - $this->ip = $ip; + $this->user = $user; + $this->ipAddress = $ipAddress; } } \ No newline at end of file diff --git a/app/Events/UserRegistration.php b/app/Events/UserRegistration.php index 9ede0bfc2e..5f19b3f776 100644 --- a/app/Events/UserRegistration.php +++ b/app/Events/UserRegistration.php @@ -21,19 +21,18 @@ class UserRegistration extends Event { use SerializesModels; - public $ip; + public $ipAddress; public $user; /** * Create a new event instance. * * @param User $user - * - * @param string $ip + * @param string $ipAddress */ - public function __construct(User $user, string $ip) + public function __construct(User $user, string $ipAddress) { $this->user = $user; - $this->ip = $ip; + $this->ip = $ipAddress; } } \ No newline at end of file diff --git a/app/Handlers/Events/SendRegistrationMail.php b/app/Handlers/Events/SendRegistrationMail.php index 03e74a2e3e..71d623641b 100644 --- a/app/Handlers/Events/SendRegistrationMail.php +++ b/app/Handlers/Events/SendRegistrationMail.php @@ -48,7 +48,7 @@ class SendRegistrationMail // get the email address $email = $event->user->email; $address = route('index'); - $ipAddress = $event->ip; + $ipAddress = $event->ipAddress; // send email. try { Mail::send( diff --git a/app/Handlers/Events/UserConfirmation.php b/app/Handlers/Events/UserConfirmation.php index 536e9ed671..fe7eaa56bc 100644 --- a/app/Handlers/Events/UserConfirmation.php +++ b/app/Handlers/Events/UserConfirmation.php @@ -42,7 +42,7 @@ class UserConfirmation public function resendConfirmation(ResendConfirmation $event) { $user = $event->user; - $ipAddress = $event->ip; + $ipAddress = $event->ipAddress; $this->doConfirm($user, $ipAddress); } @@ -54,7 +54,7 @@ class UserConfirmation public function sendConfirmation(UserRegistration $event) { $user = $event->user; - $ipAddress = $event->ip; + $ipAddress = $event->ipAddress; $this->doConfirm($user, $ipAddress); } From 6fdfec39674a7ba49b6dc068cf032f1fac7d40c8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 16:13:36 +0200 Subject: [PATCH 45/51] Clean up some code. --- app/Http/Controllers/Chart/BudgetController.php | 5 +---- app/Validation/FireflyValidator.php | 2 +- tests/TestCase.php | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index a02a94a1da..7452997d4c 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -310,7 +310,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); $cache->addProperty('year'); if ($cache->has()) { - //return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); // @codeCoverageIgnore } $budgetInformation = $repository->getBudgetsAndExpensesPerMonth($accounts, $start, $end); @@ -328,9 +328,6 @@ class BudgetController extends Controller $row = [clone $start]; $dateFormatted = $start->format('Y-m'); - //echo $start,' '.$month.'
'; - - // each budget, check if there is an entry for this month: /** @var array $row */ foreach ($budgetInformation as $budgetRow) { diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index fffb7dc2e5..5cc51d0436 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -54,7 +54,7 @@ class FireflyValidator extends Validator * * @return bool */ - public function validate2faCode($attribute, $value, $parameters): bool + public function validate2faCode($attribute, $value): bool { if (!is_string($value) || is_null($value) || strlen($value) <> 6) { return false; diff --git a/tests/TestCase.php b/tests/TestCase.php index a0245e08d8..95dfdb28bb 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -36,8 +36,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase // set period to match? } - // custom is a weird range - // (20 days): if ($range === 'custom') { $this->session( [ From 08b5e66628e0d5fe976ef524ce7b1a81386b0863 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 16:16:14 +0200 Subject: [PATCH 46/51] Some code cleanup. --- .../Chart/Budget/ChartJsBudgetChartGenerator.php | 2 +- app/Http/Controllers/Auth/AuthController.php | 1 - app/Http/Controllers/Controller.php | 4 ++-- app/Http/Kernel.php | 12 ++++++------ app/Http/routes.php | 1 - app/Models/Bill.php | 5 +++-- app/Repositories/Bill/BillRepository.php | 2 +- app/Validation/FireflyValidator.php | 2 +- tests/TestCase.php | 6 ++---- 9 files changed, 16 insertions(+), 19 deletions(-) diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php index 7129260109..f0f3cce9a5 100644 --- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php +++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php @@ -161,7 +161,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGeneratorInterface } // also add "no budget" $data['labels'][] = strval(trans('firefly.no_budget')); - + /** @var array $entry */ foreach ($entries as $entry) { $array = [ diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index bfd184d0e3..fe39b4aedf 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -7,7 +7,6 @@ use Auth; use FireflyIII\Events\UserRegistration; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Http\Controllers\Controller; -use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\User; use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; use Illuminate\Foundation\Auth\ThrottlesLogins; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 56f0900feb..669caf9485 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -41,8 +41,8 @@ class Controller extends BaseController View::share('hideTags', false); if (Auth::check()) { - $pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US')); - $lang = $pref->data; + $pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US')); + $lang = $pref->data; App::setLocale($lang); Carbon::setLocale(substr($lang, 0, 2)); diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 930687c575..b59b2b02de 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -50,7 +50,7 @@ class Kernel extends HttpKernel // does not check login // does not check 2fa // does not check activation - 'web' => [ + 'web' => [ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, @@ -58,7 +58,7 @@ class Kernel extends HttpKernel VerifyCsrfToken::class, ], // MUST NOT be logged in. Does not care about 2FA or confirmation. - 'user-not-logged-in' => [ + 'user-not-logged-in' => [ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, @@ -70,7 +70,7 @@ class Kernel extends HttpKernel // MUST be logged in. // MUST NOT have 2FA // don't care about confirmation: - 'user-logged-in-no-2fa' => [ + 'user-logged-in-no-2fa' => [ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, @@ -82,7 +82,7 @@ class Kernel extends HttpKernel // MUST be logged in // MUST have 2FA // MUST NOT have confirmation. - 'user-logged-in-2fa-no-activation' => [ + 'user-logged-in-2fa-no-activation' => [ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, @@ -96,7 +96,7 @@ class Kernel extends HttpKernel // MUST be logged in // don't care about 2fa // don't care about confirmation. - 'user-simple-auth' => [ + 'user-simple-auth' => [ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, @@ -109,7 +109,7 @@ class Kernel extends HttpKernel // MUST have 2fa // MUST be confirmed. // (this group includes the other Firefly middleware) - 'user-full-auth' => [ + 'user-full-auth' => [ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, diff --git a/app/Http/routes.php b/app/Http/routes.php index 707e9d1664..caee07510f 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -2,7 +2,6 @@ declare(strict_types = 1); - /** * These routes only work when the user is NOT logged in. */ diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 37cfdc5a6f..0742cc8e26 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -28,7 +28,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; * @property \Carbon\Carbon $nextExpectedMatch * @property \Carbon\Carbon $lastFoundMatch * @property bool $paidInPeriod - * @property string $lastPaidAmount + * @property string $lastPaidAmount * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereUpdatedAt($value) @@ -51,7 +51,8 @@ class Bill extends Model protected $dates = ['created_at', 'updated_at', 'date']; protected $fillable - = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', 'automatch', 'active',]; + = ['name', 'match', 'amount_min', 'match_encrypted', 'name_encrypted', 'user_id', 'amount_max', 'date', 'repeat_freq', 'skip', + 'automatch', 'active',]; protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted']; /** diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 089bc3e88f..7c5bc3da07 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -466,7 +466,7 @@ class BillRepository implements BillRepositoryInterface $description = strtolower($journal->description) . ' ' . strtolower(TransactionJournal::destinationAccount($journal)->name); // new: add source to word match: - $description .= ' '.strtolower(TransactionJournal::sourceAccount($journal)->name); + $description .= ' ' . strtolower(TransactionJournal::sourceAccount($journal)->name); $wordMatch = $this->doWordMatch($matches, $description); $amountMatch = $this->doAmountMatch(TransactionJournal::amountPositive($journal), $bill->amount_min, $bill->amount_max); diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 5cc51d0436..db638513f3 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -60,7 +60,7 @@ class FireflyValidator extends Validator return false; } - $secret = Session::get('two-factor-secret'); + $secret = Session::get('two-factor-secret'); /** @var Google2FA $google2fa */ $google2fa = app('PragmaRX\Google2FA\Google2FA'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 95dfdb28bb..6c0953cfab 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,8 +6,6 @@ use FireflyIII\User; /** * Class TestCase */ - - class TestCase extends Illuminate\Foundation\Testing\TestCase { /** @@ -39,8 +37,8 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase if ($range === 'custom') { $this->session( [ - 'start' => Carbon::now()->subDays(20), - 'end' => Carbon::now(), + 'start' => Carbon::now()->subDays(20), + 'end' => Carbon::now(), ] ); } From d774f8e8707cf22666b25b14e1f67eab57c4ffe9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 16:17:06 +0200 Subject: [PATCH 47/51] Code cleanup. --- app/Events/ResendConfirmation.php | 2 +- app/Events/UserRegistration.php | 2 +- app/Handlers/Events/AttachUserRole.php | 2 +- app/Handlers/Events/SendRegistrationMail.php | 2 +- app/Handlers/Events/UserConfirmation.php | 2 +- app/Handlers/Events/UserEventListener.php | 2 +- app/Http/Controllers/Auth/ConfirmationController.php | 2 +- app/Http/Controllers/Auth/TwoFactorController.php | 2 +- resources/lang/fr_FR/breadcrumbs.php | 0 resources/lang/fr_FR/config.php | 0 resources/lang/fr_FR/firefly.php | 0 resources/lang/fr_FR/form.php | 0 resources/lang/fr_FR/help.php | 0 resources/lang/fr_FR/list.php | 0 resources/lang/fr_FR/pagination.php | 0 resources/lang/fr_FR/passwords.php | 0 resources/lang/fr_FR/validation.php | 0 resources/lang/nl_NL/breadcrumbs.php | 0 resources/lang/nl_NL/config.php | 0 resources/lang/nl_NL/firefly.php | 0 resources/lang/nl_NL/form.php | 0 resources/lang/nl_NL/help.php | 0 resources/lang/nl_NL/list.php | 0 resources/lang/nl_NL/pagination.php | 0 resources/lang/nl_NL/passwords.php | 0 resources/lang/nl_NL/validation.php | 0 resources/lang/pt_BR/breadcrumbs.php | 0 resources/lang/pt_BR/config.php | 0 resources/lang/pt_BR/firefly.php | 0 resources/lang/pt_BR/form.php | 0 resources/lang/pt_BR/help.php | 0 resources/lang/pt_BR/list.php | 0 resources/lang/pt_BR/pagination.php | 0 resources/lang/pt_BR/passwords.php | 0 resources/lang/pt_BR/validation.php | 0 35 files changed, 8 insertions(+), 8 deletions(-) mode change 100755 => 100644 resources/lang/fr_FR/breadcrumbs.php mode change 100755 => 100644 resources/lang/fr_FR/config.php mode change 100755 => 100644 resources/lang/fr_FR/firefly.php mode change 100755 => 100644 resources/lang/fr_FR/form.php mode change 100755 => 100644 resources/lang/fr_FR/help.php mode change 100755 => 100644 resources/lang/fr_FR/list.php mode change 100755 => 100644 resources/lang/fr_FR/pagination.php mode change 100755 => 100644 resources/lang/fr_FR/passwords.php mode change 100755 => 100644 resources/lang/fr_FR/validation.php mode change 100755 => 100644 resources/lang/nl_NL/breadcrumbs.php mode change 100755 => 100644 resources/lang/nl_NL/config.php mode change 100755 => 100644 resources/lang/nl_NL/firefly.php mode change 100755 => 100644 resources/lang/nl_NL/form.php mode change 100755 => 100644 resources/lang/nl_NL/help.php mode change 100755 => 100644 resources/lang/nl_NL/list.php mode change 100755 => 100644 resources/lang/nl_NL/pagination.php mode change 100755 => 100644 resources/lang/nl_NL/passwords.php mode change 100755 => 100644 resources/lang/nl_NL/validation.php mode change 100755 => 100644 resources/lang/pt_BR/breadcrumbs.php mode change 100755 => 100644 resources/lang/pt_BR/config.php mode change 100755 => 100644 resources/lang/pt_BR/firefly.php mode change 100755 => 100644 resources/lang/pt_BR/form.php mode change 100755 => 100644 resources/lang/pt_BR/help.php mode change 100755 => 100644 resources/lang/pt_BR/list.php mode change 100755 => 100644 resources/lang/pt_BR/pagination.php mode change 100755 => 100644 resources/lang/pt_BR/passwords.php mode change 100755 => 100644 resources/lang/pt_BR/validation.php diff --git a/app/Events/ResendConfirmation.php b/app/Events/ResendConfirmation.php index 6b7091ee24..f221d76141 100644 --- a/app/Events/ResendConfirmation.php +++ b/app/Events/ResendConfirmation.php @@ -35,4 +35,4 @@ class ResendConfirmation extends Event $this->user = $user; $this->ipAddress = $ipAddress; } -} \ No newline at end of file +} diff --git a/app/Events/UserRegistration.php b/app/Events/UserRegistration.php index 5f19b3f776..94c605e8a5 100644 --- a/app/Events/UserRegistration.php +++ b/app/Events/UserRegistration.php @@ -35,4 +35,4 @@ class UserRegistration extends Event $this->user = $user; $this->ip = $ipAddress; } -} \ No newline at end of file +} diff --git a/app/Handlers/Events/AttachUserRole.php b/app/Handlers/Events/AttachUserRole.php index 8b151b431d..bc79f0af69 100644 --- a/app/Handlers/Events/AttachUserRole.php +++ b/app/Handlers/Events/AttachUserRole.php @@ -48,4 +48,4 @@ class AttachUserRole } } -} \ No newline at end of file +} diff --git a/app/Handlers/Events/SendRegistrationMail.php b/app/Handlers/Events/SendRegistrationMail.php index 71d623641b..32768c7813 100644 --- a/app/Handlers/Events/SendRegistrationMail.php +++ b/app/Handlers/Events/SendRegistrationMail.php @@ -60,4 +60,4 @@ class SendRegistrationMail Log::error($e->getMessage()); } } -} \ No newline at end of file +} diff --git a/app/Handlers/Events/UserConfirmation.php b/app/Handlers/Events/UserConfirmation.php index fe7eaa56bc..1745466c42 100644 --- a/app/Handlers/Events/UserConfirmation.php +++ b/app/Handlers/Events/UserConfirmation.php @@ -111,4 +111,4 @@ class UserConfirmation return; } -} \ No newline at end of file +} diff --git a/app/Handlers/Events/UserEventListener.php b/app/Handlers/Events/UserEventListener.php index 1b3888ec0c..e18177618e 100644 --- a/app/Handlers/Events/UserEventListener.php +++ b/app/Handlers/Events/UserEventListener.php @@ -29,4 +29,4 @@ class UserEventListener return true; } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Auth/ConfirmationController.php b/app/Http/Controllers/Auth/ConfirmationController.php index 4e50529dd4..d085966af0 100644 --- a/app/Http/Controllers/Auth/ConfirmationController.php +++ b/app/Http/Controllers/Auth/ConfirmationController.php @@ -79,4 +79,4 @@ class ConfirmationController extends Controller } } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index 4402039d96..72c798c932 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -76,4 +76,4 @@ class TwoFactorController extends Controller return redirect(route('home')); } -} \ No newline at end of file +} diff --git a/resources/lang/fr_FR/breadcrumbs.php b/resources/lang/fr_FR/breadcrumbs.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/config.php b/resources/lang/fr_FR/config.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/form.php b/resources/lang/fr_FR/form.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/help.php b/resources/lang/fr_FR/help.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/list.php b/resources/lang/fr_FR/list.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/pagination.php b/resources/lang/fr_FR/pagination.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/passwords.php b/resources/lang/fr_FR/passwords.php old mode 100755 new mode 100644 diff --git a/resources/lang/fr_FR/validation.php b/resources/lang/fr_FR/validation.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/breadcrumbs.php b/resources/lang/nl_NL/breadcrumbs.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/config.php b/resources/lang/nl_NL/config.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/form.php b/resources/lang/nl_NL/form.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/help.php b/resources/lang/nl_NL/help.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/list.php b/resources/lang/nl_NL/list.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/pagination.php b/resources/lang/nl_NL/pagination.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/passwords.php b/resources/lang/nl_NL/passwords.php old mode 100755 new mode 100644 diff --git a/resources/lang/nl_NL/validation.php b/resources/lang/nl_NL/validation.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/breadcrumbs.php b/resources/lang/pt_BR/breadcrumbs.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/config.php b/resources/lang/pt_BR/config.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/form.php b/resources/lang/pt_BR/form.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/help.php b/resources/lang/pt_BR/help.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/list.php b/resources/lang/pt_BR/list.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/pagination.php b/resources/lang/pt_BR/pagination.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/passwords.php b/resources/lang/pt_BR/passwords.php old mode 100755 new mode 100644 diff --git a/resources/lang/pt_BR/validation.php b/resources/lang/pt_BR/validation.php old mode 100755 new mode 100644 From d21885ca988f2f7cd94c99945331afcf709cf11b Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 16:38:42 +0200 Subject: [PATCH 48/51] New translations. --- resources/lang/nl_NL/firefly.php | 61 ++++++++++++++++++++++++++++- resources/lang/nl_NL/form.php | 1 - resources/lang/nl_NL/help.php | 4 +- resources/lang/nl_NL/list.php | 61 +++++++++++++++-------------- resources/lang/nl_NL/validation.php | 7 ++++ 5 files changed, 100 insertions(+), 34 deletions(-) mode change 100644 => 100755 resources/lang/nl_NL/validation.php diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index d1df014f6b..f3f03c20df 100644 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -62,6 +62,21 @@ return [ 'two_factor_lost_intro' => 'Dit is helaas niet iets dat je kan resetten vanaf de site. Je hebt twee keuzes.', 'two_factor_lost_fix_self' => 'Als dit jouw installatie van Firefly III is, vind je in de logboeken (storage/logs) instructies.', 'two_factor_lost_fix_owner' => 'Zo niet, stuur dan een e-mail naar :site_owner en vraag of ze je authenticatie in twee stappen willen resetten.', + 'warning_much_data' => 'Het kan even duren voor :days dagen aan gegevens geladen zijn.', + 'registered' => 'Je bent geregistreerd!', + + // account confirmation: + 'confirm_account_header' => 'Bevestig je account', + 'confirm_account_intro' => 'TIjdens het registreren heb je een mailtje gehad. Kijk daar in voor instructies. Als je het mailtje niet hebt gehad, kan Firefly je een nieuwe sturen.', + 'confirm_account_resend_email' => 'Stuur me het bevestigingsmailtje dat ik nodig heb om mijn account te activeren.', + 'account_is_confirmed' => 'Je account is geactiveerd!', + 'invalid_activation_code' => 'Het lijkt er op dat de code die je gebruikt niet geldig is (of wellicht verlopen).', + 'confirm_account_is_resent_header' => 'De bevestiging is verstuurd', + 'confirm_account_is_resent_text' => 'De bevestiging is opnieuw verstuurd. Als je hem nu nog niet krijgt, stuur dan zelf een mailtje naar :owner of kijk in de logboeken om te zien wat er is fout gegaan.', + 'confirm_account_is_resent_go_home' => 'Ga naar de index van Firefly', + 'confirm_account_not_resent_header' => 'Er ging iets fout :(', + 'confirm_account_not_resent_intro' => 'Het bevestigingsmailtje is niet verstuurd. Als je het bevestigingsmailtje nog niet hebt gehad, neem dan even contact op met :owner.Het kan zijn dat je het bevestigingsmailtje te vaak laat versturen. Je kan dit slechts één keer per uur laten doen.', + 'confirm_account_not_resent_go_home' => 'Ga naar de index van Firefly', // export data: 'import_and_export' => 'Import en export', @@ -247,6 +262,7 @@ return [ 'pref_two_factor_auth_remove_code' => 'Verwijder de verificatiecode', 'pref_two_factor_auth_remove_will_disable' => '(hiermee zet je authenticatie in twee stappen ook uit)', 'pref_save_settings' => 'Instellingen opslaan', + 'saved_preferences' => 'Voorkeuren opgeslagen!', // profile: 'change_your_password' => 'Verander je wachtwoord', @@ -273,6 +289,7 @@ return [ 'update_attachment' => 'Update bijlage', 'delete_attachment' => 'Verwijder bijlage ":name"', 'attachment_deleted' => 'Bijlage ":name" verwijderd', + 'attachment_updated' => 'Attachment ":name" geüpdatet', 'upload_max_file_size' => 'Maximale grootte: :size', // tour: @@ -374,6 +391,11 @@ return [ 'csv_import_account_help' => 'Als jouw CSV bestand geen referenties bevat naar jouw rekening(en), geef dan hier aan om welke rekening het gaat.', 'csv_delimiter_help' => 'Kies het veldscheidingsteken dat in het invoerbestand is gebruikt. Bij twijfel is de komma de veiligste optie.', 'csv_date_parse_error' => 'Firefly kan van ":value" geen datum maken, gegeven het formaat ":format". Weet je zeker dat je CSV goed is?', + 'could_not_recover' => 'Helaas, kan niet doorgaan vanaf de vorige stap. Je voortgang is verloren gegaan :(. De logbestanden bevatten meer informatie.', + 'must_select_roles' => 'Je moet enkele rollen selecteren voor de kolommen in je bestand, anders kan je niet verder.', + 'invalid_mapping' => 'Je hebt verkeerde gegevens ingevoerd. Je kan helaas niet verder.', + 'no_file_uploaded' => 'Het lijkt er op dat je niets hebt geüpload.', + // create new stuff: 'create_new_withdrawal' => 'Nieuwe uitgave', @@ -406,6 +428,8 @@ return [ 'to_get_started' => 'Begin met de naam van de bank waar je je betaalrekening hebt, en het saldo van die rekening.', 'savings_balance_text' => 'Voer ook het saldo van je spaarrekening in, als je die hebt.', 'cc_balance_text' => 'Als je een credit card hebt, vul dan hier je credit cardlimiet in.', + 'stored_new_account_new_user' => 'Hoera! Je nieuwe account is opgeslagen.', + 'stored_new_accounts_new_user' => 'Hoera! Je nieuwe accounts zijn opgeslagen.', // forms: 'mandatoryFields' => 'Verplichte velden', @@ -416,6 +440,7 @@ return [ // budgets: 'create_new_budget' => 'Maak een nieuw budget', 'store_new_budget' => 'Sla nieuw budget op', + 'stored_new_budget' => 'Nieuw budget ":name" opgeslagen', 'availableIn' => 'Beschikbaar in :date', 'transactionsWithoutBudget' => 'Uitgaven zonder budget', 'transactionsWithoutBudgetDate' => 'Uitgaven zonder budget in :date', @@ -424,15 +449,23 @@ return [ 'without_budget_between' => 'Transacties zonder budget tussen :start en :end', 'budget_in_month' => ':name in :month', 'delete_budget' => 'Verwijder budget ":name"', + 'deleted_budget' => 'Budget ":name" verwijderd', 'edit_budget' => 'Wijzig budget ":name"', + 'updated_budget' => 'Budget ":name" geüpdatet', 'update_amount' => 'Bedrag bijwerken', 'update_budget' => 'Budget bijwerken', // bills: 'delete_bill' => 'Verwijder contract ":name"', + 'deleted_bill' => 'Contract ":name" verwijderd', 'edit_bill' => 'Wijzig contract ":name"', 'update_bill' => 'Wijzig contract', + 'updated_bill' => 'Contract ":name" geüpdatet', 'store_new_bill' => 'Sla nieuw contract op', + 'stored_new_bill' => 'Nieuw contract ":name" opgeslagen', + 'cannot_scan_inactive_bill' => 'Inactieve contracten kunnen niet worden gescand.', + 'rescanned_bill' => 'Alles is opnieuw gescand.', + 'bill_date_little_relevance' => 'Firefly gebruikt alleen de dag van dit datumveld. Dit veld heeft alleen zin als je rekening ook echt op die dag van de maand komt. Zo niet, vul dan gewoon de 1e van de maand in.', // accounts: 'details_for_asset' => 'Overzicht voor betaalrekening ":name"', @@ -460,32 +493,46 @@ return [ 'asset_accounts' => 'Betaalrekeningen', 'expense_accounts' => 'Crediteuren', 'revenue_accounts' => 'Debiteuren', + 'cash_accounts' => 'Contant geldrekeningen', + 'Cash account' => 'Contant geldrekening', 'accountExtraHelp_asset' => '', 'accountExtraHelp_expense' => '', 'accountExtraHelp_revenue' => '', 'account_type' => 'Rekeningtype', 'save_transactions_by_moving' => 'Bewaar deze transacties door ze aan een andere rekening te koppelen:', + 'stored_new_account' => 'Nieuwe rekening ":name" opgeslagen!', + 'updated_account' => 'Rekening ":name" geüpdatet', // categories: 'new_category' => 'Nieuwe categorie', 'create_new_category' => 'Nieuwe categorie', 'without_category' => 'Zonder categorie', - 'update_category' => 'Wijzig categorie', + 'update_category' => 'Update categorie', + 'updated_category' => 'Categorie ":name" geüpdatet', 'categories' => 'Categorieën', 'edit_category' => 'Wijzig categorie ":name"', 'no_category' => '(geen categorie)', 'category' => 'Categorie', 'delete_category' => 'Verwijder categorie ":name"', + 'deleted_category' => 'Categorie ":name" verwijderd', 'store_category' => 'Sla nieuwe categorie op', + 'stored_category' => 'Nieuwe categorie ":name" opgeslagen', 'without_category_between' => 'Zonder categorie tussen :start en :end', // transactions: 'update_withdrawal' => 'Wijzig uitgave', 'update_deposit' => 'Wijzig inkomsten', 'update_transfer' => 'Wijzig overschrijving', + 'updated_withdrawal' => 'Uitgave ":description" geüpdatet', + 'updated_deposit' => 'Inkomsten ":description" geüpdatet', + 'updated_transfer' => 'Overschrijving ":description" geüpdatet', 'delete_withdrawal' => 'Verwijder uitgave ":description"', 'delete_deposit' => 'Verwijder inkomsten ":description"', 'delete_transfer' => 'Verwijder overschrijving ":description"', + 'deleted_withdrawal' => 'Uitgave ":description" verwijderd', + 'deleted_deposit' => 'Inkomsten ":description" verwijderd', + 'deleted_transfer' => 'Overschrijving ":description" verwijderd', + 'stored_journal' => 'Nieuw transactie ":description" opgeslagen', // new user: 'welcome' => 'Welkom bij Firefly!', @@ -619,7 +666,7 @@ return [ 'earned' => 'Verdiend', 'overspent' => 'Teveel uitgegeven', 'left' => 'Over', - 'noBudget' => '(geen budget)', + 'no_budget' => '(geen budget)', 'maxAmount' => 'Maximaal bedrag', 'minAmount' => 'Minimaal bedrag', 'billEntry' => 'Bedrag voor dit contract', @@ -640,6 +687,7 @@ return [ 'piggy_bank' => 'Spaarpotje', 'new_piggy_bank' => 'Nieuw spaarpotje', 'store_piggy_bank' => 'Sla spaarpotje op', + 'stored_piggy_bank' => 'Nieuw spaarpotje ":name" opgeslagen', 'account_status' => 'Rekeningoverzicht', 'left_for_piggy_banks' => 'Over voor spaarpotjes', 'sum_of_piggy_banks' => 'Som van spaarpotjes', @@ -653,6 +701,7 @@ return [ 'max_amount_remove' => 'Hooguit te verwijderen', 'update_piggy_button' => 'Wijzig spaarpotje', 'update_piggy_title' => 'Wijzig spaarpotje ":name"', + 'updated_piggy_bank' => 'Spaarpotje ":name" geüpdatet', 'details' => 'Details', 'events' => 'Gebeurtenissen', 'target_amount' => 'Doelbedrag', @@ -665,14 +714,22 @@ return [ 'add_any_amount_to_piggy' => 'Stop geld in dit spaarpotje om het doel van :amount te halen.', 'add_set_amount_to_piggy' => 'Stop voor :date :amount in dit spaarpotje om hem op tijd te vullen.', 'delete_piggy_bank' => 'Verwijder spaarpotje ":name"', + 'cannot_add_amount_piggy' => 'Kon bedrag :amount niet aan ":name" toevoegen.', + 'deleted_piggy_bank' => 'Spaarpotje ":name" verwijderd', + 'added_amount_to_piggy' => ':amount aan ":name" toegevoegd', + 'removed_amount_from_piggy' => ':amount uit ":name" gehaald', + 'cannot_remove_amount_piggy' => 'Kon :amount niet uit ":name" halen.', // tags 'regular_tag' => 'Een gewone tag.', 'balancing_act' => 'Er kunnen maar twee transacties worden getagged; een uitgaven en inkomsten. Ze balanceren elkaar.', 'advance_payment' => 'Je kan een uitgave taggen en zoveel inkomsten om de uitgave (helemaal) te compenseren.', 'delete_tag' => 'Verwijder tag ":tag"', + 'deleted_tag' => 'Tag ":tag" verwijderd', 'new_tag' => 'Maak nieuwe tag', 'edit_tag' => 'Wijzig tag ":tag"', + 'updated_tag' => 'Tag ":tag" geüpdatet', + 'created_tag' => 'Tag ":tag" opgeslagen!', 'no_year' => 'Zonder jaar', 'no_month' => 'Zonder maand', 'tag_title_nothing' => 'Standaard tags', diff --git a/resources/lang/nl_NL/form.php b/resources/lang/nl_NL/form.php index 2bb5146290..9075401f2a 100644 --- a/resources/lang/nl_NL/form.php +++ b/resources/lang/nl_NL/form.php @@ -72,7 +72,6 @@ return [ 'add_new_deposit' => 'Maak nieuwe inkomsten', 'add_new_transfer' => 'Maak nieuwe overschrijving', 'noPiggybank' => '(geen spaarpotje)', - 'noBudget' => '(geen budget)', 'title' => 'Titel', 'notes' => 'Notities', 'filename' => 'Bestandsnaam', diff --git a/resources/lang/nl_NL/help.php b/resources/lang/nl_NL/help.php index 3cf854e3e6..c521afc405 100644 --- a/resources/lang/nl_NL/help.php +++ b/resources/lang/nl_NL/help.php @@ -8,6 +8,8 @@ */ return [ + + // tour! 'main-content-title' => 'Welkom bij Firefly III', 'main-content-text' => 'Doe jezelf een lol en volg deze korte tour. Je weet dan precies hoe alles werkt.', 'sidebar-toggle-title' => 'Sidebar om nieuwe dingen te maken', @@ -17,7 +19,7 @@ return [ 'budget-menu-title' => 'Budgetten', 'budget-menu-text' => 'Gebruik deze pagina voor budgetten.', 'report-menu-title' => 'Overzichten', - 'report-menu-text' => 'Hier vind je allerlei financiele rapportages.', + 'report-menu-text' => 'Bekijk dit als je een goed overzicht van je financiën wil.', 'transaction-menu-title' => 'Transacties', 'transaction-menu-text' => 'Hier vind je al je bijschrijvingen, afschrijvingen en overboekingen.', 'option-menu-title' => 'Opties', diff --git a/resources/lang/nl_NL/list.php b/resources/lang/nl_NL/list.php index 4d91559b82..13b4efa22a 100644 --- a/resources/lang/nl_NL/list.php +++ b/resources/lang/nl_NL/list.php @@ -8,34 +8,35 @@ */ return [ - 'name' => 'Naam', - 'role' => 'Rol', - 'currentBalance' => 'Huidig saldo', - 'active' => 'Actief?', - 'lastActivity' => 'Laatste activiteit', - 'balanceDiff' => 'Saldoverschil tussen :start en :end', - 'matchedOn' => 'Wordt herkend', - 'matchesOn' => 'Wordt herkend', - 'matchingAmount' => 'Bedrag', - 'lastMatch' => 'Laatste keer gezien', - 'expectedMatch' => 'Wordt verwacht', - 'automatch' => 'Automatisch herkennen?', - 'repeat_freq' => 'Herhaling', - 'description' => 'Omschrijving', - 'amount' => 'Bedrag', - 'date' => 'Datum', - 'interest_date' => 'Rentedatum', - 'book_date' => 'Boekdatum', - 'process_date' => 'Verwerkingsdatum', - 'from' => 'Van', - 'to' => 'Naar', - 'budget' => 'Budget', - 'category' => 'Categorie', - 'bill' => 'Contract', - 'withdrawal' => 'Uitgave', - 'deposit' => 'Inkomsten', - 'transfer' => 'Overschrijving', - 'type' => 'Type', - 'completed' => 'Opgeslagen', - 'iban' => 'IBAN', + 'name' => 'Naam', + 'role' => 'Rol', + 'currentBalance' => 'Huidig saldo', + 'active' => 'Actief?', + 'lastActivity' => 'Laatste activiteit', + 'balanceDiff' => 'Saldoverschil tussen :start en :end', + 'matchedOn' => 'Wordt herkend', + 'matchesOn' => 'Wordt herkend', + 'matchingAmount' => 'Bedrag', + 'lastMatch' => 'Laatste keer gezien', + 'expectedMatch' => 'Wordt verwacht', + 'automatch' => 'Automatisch herkennen?', + 'repeat_freq' => 'Herhaling', + 'description' => 'Omschrijving', + 'amount' => 'Bedrag', + 'date' => 'Datum', + 'interest_date' => 'Rentedatum', + 'book_date' => 'Boekdatum', + 'process_date' => 'Verwerkingsdatum', + 'from' => 'Van', + 'to' => 'Naar', + 'budget' => 'Budget', + 'category' => 'Categorie', + 'bill' => 'Contract', + 'withdrawal' => 'Uitgave', + 'deposit' => 'Inkomsten', + 'transfer' => 'Overschrijving', + 'type' => 'Type', + 'completed' => 'Opgeslagen', + 'iban' => 'IBAN', + 'paid_current_period' => 'Betaald deze periode', ]; diff --git a/resources/lang/nl_NL/validation.php b/resources/lang/nl_NL/validation.php old mode 100644 new mode 100755 index 37c25ed3d5..272898ccb9 --- a/resources/lang/nl_NL/validation.php +++ b/resources/lang/nl_NL/validation.php @@ -1,4 +1,11 @@ 'Dit is niet een geldige IBAN.', From 88a41c37f300bb2bff43dbbdd3547e89a51cb3b8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 17:18:42 +0200 Subject: [PATCH 49/51] Bug fix, thank you scrutiniser. --- app/Events/UserRegistration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Events/UserRegistration.php b/app/Events/UserRegistration.php index 94c605e8a5..779cf7edfa 100644 --- a/app/Events/UserRegistration.php +++ b/app/Events/UserRegistration.php @@ -32,7 +32,7 @@ class UserRegistration extends Event */ public function __construct(User $user, string $ipAddress) { - $this->user = $user; - $this->ip = $ipAddress; + $this->user = $user; + $this->ipAddress = $ipAddress; } } From a31f16bba7699334e43d9487702875e900afd2f3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 17:41:43 +0200 Subject: [PATCH 50/51] Change log for 3.8.1 [skip ci] --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f915a64c2..370226ffff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,31 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - No unreleased changes yet. +## [3.8.1] - 2016-03-29 +### Added +- More translations +- Extended cookie control. +- User accounts can now be activated (disabled by default). +- Bills can now take the source and destination account name into account. + +### Changed +- The pages related to rules have new URL's. + +### Deprecated +- Initial release. + +### Removed +- Initial release. + +### Fixed +- Spelling errors. +- Problems related to the "account repository". +- Some views showed empty (0.0) amounts. + +### Security +- Initial release. + + ## [3.8.0] - 2016-03-20 ### Added - Two factor authentication, thanks to the excellent work of [zjean](https://github.com/zjean). From bb075d15ff72c30787fe43227505766858742459 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 29 Mar 2016 17:42:32 +0200 Subject: [PATCH 51/51] Add warning about PHP 7.0 --- config/upgrade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/upgrade.php b/config/upgrade.php index d9962a69a6..ba08607148 100644 --- a/config/upgrade.php +++ b/config/upgrade.php @@ -23,5 +23,6 @@ return [ '3.7.2.3' => 'Because of the upgrade to Laravel 5.2, several manual changes must be made to your Firefly III installation. ' . 'Please follow the instructions on the following page: https://github.com/JC5/firefly-iii/wiki/Upgrade-to-3.7.0', '3.8.0' => 'This version of Firefly III requires PHP 7.0.', + '3.8.1' => 'This version of Firefly III requires PHP 7.0.', ], ];