From 9277ba60aa2ac1dd3538aefad21e90d81059ca07 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:10:07 +0200 Subject: [PATCH 01/54] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index 0f4989ffaf..fc5ec53ced 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -155,7 +155,7 @@ return [ 'export_data' => 'Exportar datos', 'export_and_backup_data' => 'Export and backup', 'export_data_intro' => 'For backup purposes, when migrating to another system or when migrating to another Firefly III installation.', - 'export_format' => 'Formato de exportación', + 'export_format' => 'Export format', 'export_format_csv' => 'Comma separated values (CSV file)', 'export_format_mt940' => 'MT940 compatible format', 'include_old_uploads_help' => 'Firefly III does not throw away the original CSV files you have imported in the past. You can include them in your export.', From c633c800a573463a797c96e941fc5c2562962779 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:10:09 +0200 Subject: [PATCH 02/54] New translations intro.php (French) --- resources/lang/fr_FR/intro.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/fr_FR/intro.php b/resources/lang/fr_FR/intro.php index be721ae9cc..e4dffb47e1 100644 --- a/resources/lang/fr_FR/intro.php +++ b/resources/lang/fr_FR/intro.php @@ -96,7 +96,7 @@ return [ 'bills_create_skip_holder' => 'Si une facture se répète toutes les 2 semaines par exemple, le champ "sauter" doit être réglé sur "1" pour sauter une semaine sur deux.', // rules index - 'rules_index_intro' => 'Firefly III vous permet de gérer les règles, qui seront automagiquement appliquées à toute transaction que vous créez ou modifiez.', + 'rules_index_intro' => 'Firefly III allows you to manage rules, that will automagically be applied to any transaction you create or edit.', 'rules_index_new_rule_group' => 'Vous pouvez rassembler les règles en groupes pour une gestion plus facile.', 'rules_index_new_rule' => 'Créez autant de règles que vous le souhaitez.', 'rules_index_prio_buttons' => 'Mettez-les dans l\'ordre que vous jugez convenable.', From 7dca784091f3824b98ecb404ae2c91ed9a350824 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:40:11 +0200 Subject: [PATCH 03/54] New translations breadcrumbs.php (Portuguese, Brazilian) --- resources/lang/pt_BR/breadcrumbs.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/lang/pt_BR/breadcrumbs.php b/resources/lang/pt_BR/breadcrumbs.php index 1a97cb2988..76ca4535f6 100644 --- a/resources/lang/pt_BR/breadcrumbs.php +++ b/resources/lang/pt_BR/breadcrumbs.php @@ -21,24 +21,24 @@ return [ 'preferences' => 'Preferências', 'profile' => 'Perfil', 'changePassword' => 'Alterar sua senha', - 'bills' => 'Faturas', + 'bills' => 'Bills', 'newBill' => 'Nova fatura', 'edit_bill' => 'Editar fatura ":name"', - 'delete_bill' => 'Apagar fatura ":name"', - 'reports' => 'Relatórios', + 'delete_bill' => 'Delete bill ":name"', + 'reports' => 'Reports', 'search_result' => 'Search results for ":query"', 'withdrawal_list' => 'Despesas', - 'deposit_list' => 'Receitas, renda e depósitos', - 'transfer_list' => 'Transferências', - 'transfers_list' => 'Transferências', - 'create_withdrawal' => 'Criar uma nova retirada', - 'create_deposit' => 'Criar um novo depósito', - 'create_transfer' => 'Criar nova transferência', + 'deposit_list' => 'Revenue, income and deposits', + 'transfer_list' => 'Transfers', + 'transfers_list' => 'Transfers', + 'create_withdrawal' => 'Create new withdrawal', + 'create_deposit' => 'Create new deposit', + 'create_transfer' => 'Create new transfer', 'edit_journal' => 'Editar transação ":description"', - 'delete_journal' => 'Apagar transação ":description"', - 'tags' => 'Etiquetas', - 'createTag' => 'Criar nova etiqueta', - 'edit_tag' => 'Editar etiqueta ":tag"', + 'delete_journal' => 'Delete transaction ":description"', + 'tags' => 'Tags', + 'createTag' => 'Create new tag', + 'edit_tag' => 'Edit tag ":tag"', 'delete_tag' => 'Apagar etiqueta ":tag"', 'delete_journal_link' => 'Delete link between transactions', ]; From 7f9f83bb3f29ed4b1c6416660d9028f601821418 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:40:12 +0200 Subject: [PATCH 04/54] New translations config.php (Portuguese, Brazilian) --- resources/lang/pt_BR/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/pt_BR/config.php b/resources/lang/pt_BR/config.php index 396ead4031..3c0ed45814 100644 --- a/resources/lang/pt_BR/config.php +++ b/resources/lang/pt_BR/config.php @@ -13,8 +13,8 @@ declare(strict_types=1); return [ 'locale' => 'pt-br, pt_BR, pt_BR.utf8, pt_BR.UTF-8', - 'month' => '%B %Y', - 'month_and_day' => '%e de %B de %Y', + 'month' => '%B %Yü', + 'month_and_day' => '%B %e, %Y', 'date_time' => '%B %e, %Y, @ %T', 'specific_day' => '%e %B %Y', 'week_in_year' => 'Semana %W, %Y', From e7a782359db89705409bb6fa98261dd30ae289e7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:40:14 +0200 Subject: [PATCH 05/54] New translations csv.php (Portuguese, Brazilian) --- resources/lang/pt_BR/csv.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/pt_BR/csv.php b/resources/lang/pt_BR/csv.php index 830d7cd73f..70ca0001e0 100644 --- a/resources/lang/pt_BR/csv.php +++ b/resources/lang/pt_BR/csv.php @@ -39,9 +39,9 @@ return [ // map data 'map_title' => 'Import setup (3/3) - Connect import data to Firefly III data', - 'map_text' => 'Nas tabelas a seguir, o valor à esquerda mostra informações encontradas no seu arquivo CSV carregado. É sua tarefa mapear esse valor, se possível, para um valor já presente em seu banco de dados. O Firefly vai se ater a esse mapeamento. Se não há nenhum valor para mapear, ou não quer mapear o valor específico, não selecione nada.', + 'map_text' => 'In the following tables, the left value shows you information found in your uploaded CSV file. It is your task to map this value, if possible, to a value already present in your database. Firefly will stick to this mapping. If there is no value to map to, or you do not wish to map the specific value, select nothing.', 'map_field_value' => 'Field value', - 'map_field_mapped_to' => 'Mapeado para', + 'map_field_mapped_to' => 'Mapped to', 'map_do_not_map' => '(não mapear)', 'map_submit' => 'Start the import', From f82880a519303dfee221805db34bc24943969605 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:40:16 +0200 Subject: [PATCH 06/54] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index ecffb17f59..54935eb26e 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -14,7 +14,7 @@ declare(strict_types=1); return [ // general stuff: 'close' => 'Fechar', - 'actions' => 'Ações', + 'actions' => 'Actions', 'edit' => 'Editar', 'delete' => 'Apagar', 'welcomeBack' => 'O que está passando?', @@ -28,10 +28,10 @@ return [ 'showEverything' => 'Mostrar tudo', 'never' => 'Nunca', 'no_results_for_empty_search' => 'Your search was empty, so nothing was found.', - 'removed_amount' => ':amount removido', - 'added_amount' => ':amount adicionada', - 'asset_account_role_help' => 'Quaisquer opções extras resultantes da sua escolha pode ser definido mais tarde.', - 'Opening balance' => 'Saldo inicial', + 'removed_amount' => 'Removed :amount', + 'added_amount' => 'Added :amount', + 'asset_account_role_help' => 'Any extra options resulting from your choice can be set later.', + 'Opening balance' => 'Opening balance', 'create_new_stuff' => 'Criar novas coisas', 'new_withdrawal' => 'Nova retirada', 'new_deposit' => 'Novo depósito', From 64b957fda66d9cf7f56427e187ce90de21ea0bbc Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:40:22 +0200 Subject: [PATCH 07/54] New translations bank.php (Slovenian) --- resources/lang/sl_SI/bank.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/sl_SI/bank.php b/resources/lang/sl_SI/bank.php index 964f43f024..b371fcf34c 100644 --- a/resources/lang/sl_SI/bank.php +++ b/resources/lang/sl_SI/bank.php @@ -1,6 +1,6 @@ 'Predpogoji za uvoz iz bunq', + 'bunq_prerequisites_title' => 'Prerequisites for an import from bunq', 'bunq_prerequisites_text' => 'Če želite uvoziti iz bunq-a, morate pridobiti ključ za API. To lahko storite s pomočjo aplikacije.', ]; \ No newline at end of file From 02203fb38a0b1445102e4ab70850e9a53d7bed94 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:50:12 +0200 Subject: [PATCH 08/54] New translations intro.php (French) --- resources/lang/fr_FR/intro.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/fr_FR/intro.php b/resources/lang/fr_FR/intro.php index e4dffb47e1..be721ae9cc 100644 --- a/resources/lang/fr_FR/intro.php +++ b/resources/lang/fr_FR/intro.php @@ -96,7 +96,7 @@ return [ 'bills_create_skip_holder' => 'Si une facture se répète toutes les 2 semaines par exemple, le champ "sauter" doit être réglé sur "1" pour sauter une semaine sur deux.', // rules index - 'rules_index_intro' => 'Firefly III allows you to manage rules, that will automagically be applied to any transaction you create or edit.', + 'rules_index_intro' => 'Firefly III vous permet de gérer les règles, qui seront automagiquement appliquées à toute transaction que vous créez ou modifiez.', 'rules_index_new_rule_group' => 'Vous pouvez rassembler les règles en groupes pour une gestion plus facile.', 'rules_index_new_rule' => 'Créez autant de règles que vous le souhaitez.', 'rules_index_prio_buttons' => 'Mettez-les dans l\'ordre que vous jugez convenable.', From aa6a0f6e8319d197d4837d1283ea46d2acd89436 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:50:13 +0200 Subject: [PATCH 09/54] New translations breadcrumbs.php (Portuguese, Brazilian) --- resources/lang/pt_BR/breadcrumbs.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/lang/pt_BR/breadcrumbs.php b/resources/lang/pt_BR/breadcrumbs.php index 76ca4535f6..1a97cb2988 100644 --- a/resources/lang/pt_BR/breadcrumbs.php +++ b/resources/lang/pt_BR/breadcrumbs.php @@ -21,24 +21,24 @@ return [ 'preferences' => 'Preferências', 'profile' => 'Perfil', 'changePassword' => 'Alterar sua senha', - 'bills' => 'Bills', + 'bills' => 'Faturas', 'newBill' => 'Nova fatura', 'edit_bill' => 'Editar fatura ":name"', - 'delete_bill' => 'Delete bill ":name"', - 'reports' => 'Reports', + 'delete_bill' => 'Apagar fatura ":name"', + 'reports' => 'Relatórios', 'search_result' => 'Search results for ":query"', 'withdrawal_list' => 'Despesas', - 'deposit_list' => 'Revenue, income and deposits', - 'transfer_list' => 'Transfers', - 'transfers_list' => 'Transfers', - 'create_withdrawal' => 'Create new withdrawal', - 'create_deposit' => 'Create new deposit', - 'create_transfer' => 'Create new transfer', + 'deposit_list' => 'Receitas, renda e depósitos', + 'transfer_list' => 'Transferências', + 'transfers_list' => 'Transferências', + 'create_withdrawal' => 'Criar uma nova retirada', + 'create_deposit' => 'Criar um novo depósito', + 'create_transfer' => 'Criar nova transferência', 'edit_journal' => 'Editar transação ":description"', - 'delete_journal' => 'Delete transaction ":description"', - 'tags' => 'Tags', - 'createTag' => 'Create new tag', - 'edit_tag' => 'Edit tag ":tag"', + 'delete_journal' => 'Apagar transação ":description"', + 'tags' => 'Etiquetas', + 'createTag' => 'Criar nova etiqueta', + 'edit_tag' => 'Editar etiqueta ":tag"', 'delete_tag' => 'Apagar etiqueta ":tag"', 'delete_journal_link' => 'Delete link between transactions', ]; From dfa7e94f878ad99a664e69f4b480f0f5fc9becbc Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:50:19 +0200 Subject: [PATCH 10/54] New translations bank.php (Slovenian) --- resources/lang/sl_SI/bank.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/sl_SI/bank.php b/resources/lang/sl_SI/bank.php index b371fcf34c..964f43f024 100644 --- a/resources/lang/sl_SI/bank.php +++ b/resources/lang/sl_SI/bank.php @@ -1,6 +1,6 @@ 'Prerequisites for an import from bunq', + 'bunq_prerequisites_title' => 'Predpogoji za uvoz iz bunq', 'bunq_prerequisites_text' => 'Če želite uvoziti iz bunq-a, morate pridobiti ključ za API. To lahko storite s pomočjo aplikacije.', ]; \ No newline at end of file From 2190fb972c45923c881209ba0d075f29bbd26e41 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:50:23 +0200 Subject: [PATCH 11/54] New translations csv.php (Portuguese, Brazilian) --- resources/lang/pt_BR/csv.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/pt_BR/csv.php b/resources/lang/pt_BR/csv.php index 70ca0001e0..830d7cd73f 100644 --- a/resources/lang/pt_BR/csv.php +++ b/resources/lang/pt_BR/csv.php @@ -39,9 +39,9 @@ return [ // map data 'map_title' => 'Import setup (3/3) - Connect import data to Firefly III data', - 'map_text' => 'In the following tables, the left value shows you information found in your uploaded CSV file. It is your task to map this value, if possible, to a value already present in your database. Firefly will stick to this mapping. If there is no value to map to, or you do not wish to map the specific value, select nothing.', + 'map_text' => 'Nas tabelas a seguir, o valor à esquerda mostra informações encontradas no seu arquivo CSV carregado. É sua tarefa mapear esse valor, se possível, para um valor já presente em seu banco de dados. O Firefly vai se ater a esse mapeamento. Se não há nenhum valor para mapear, ou não quer mapear o valor específico, não selecione nada.', 'map_field_value' => 'Field value', - 'map_field_mapped_to' => 'Mapped to', + 'map_field_mapped_to' => 'Mapeado para', 'map_do_not_map' => '(não mapear)', 'map_submit' => 'Start the import', From 4945356665dec5a4ca2a293dfc287ce811e1425f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 10:50:26 +0200 Subject: [PATCH 12/54] New translations config.php (Portuguese, Brazilian) --- resources/lang/pt_BR/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/pt_BR/config.php b/resources/lang/pt_BR/config.php index 3c0ed45814..396ead4031 100644 --- a/resources/lang/pt_BR/config.php +++ b/resources/lang/pt_BR/config.php @@ -13,8 +13,8 @@ declare(strict_types=1); return [ 'locale' => 'pt-br, pt_BR, pt_BR.utf8, pt_BR.UTF-8', - 'month' => '%B %Yü', - 'month_and_day' => '%B %e, %Y', + 'month' => '%B %Y', + 'month_and_day' => '%e de %B de %Y', 'date_time' => '%B %e, %Y, @ %T', 'specific_day' => '%e %B %Y', 'week_in_year' => 'Semana %W, %Y', From 99500a1ee2e39e31b77d7af6dba08ca78eb391a8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 11:20:24 +0200 Subject: [PATCH 13/54] New translations firefly.php (Portuguese, Brazilian) --- resources/lang/pt_BR/firefly.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.php index 54935eb26e..ecffb17f59 100644 --- a/resources/lang/pt_BR/firefly.php +++ b/resources/lang/pt_BR/firefly.php @@ -14,7 +14,7 @@ declare(strict_types=1); return [ // general stuff: 'close' => 'Fechar', - 'actions' => 'Actions', + 'actions' => 'Ações', 'edit' => 'Editar', 'delete' => 'Apagar', 'welcomeBack' => 'O que está passando?', @@ -28,10 +28,10 @@ return [ 'showEverything' => 'Mostrar tudo', 'never' => 'Nunca', 'no_results_for_empty_search' => 'Your search was empty, so nothing was found.', - 'removed_amount' => 'Removed :amount', - 'added_amount' => 'Added :amount', - 'asset_account_role_help' => 'Any extra options resulting from your choice can be set later.', - 'Opening balance' => 'Opening balance', + 'removed_amount' => ':amount removido', + 'added_amount' => ':amount adicionada', + 'asset_account_role_help' => 'Quaisquer opções extras resultantes da sua escolha pode ser definido mais tarde.', + 'Opening balance' => 'Saldo inicial', 'create_new_stuff' => 'Criar novas coisas', 'new_withdrawal' => 'Nova retirada', 'new_deposit' => 'Novo depósito', From 3e85e4180af56e7e3cdfc20d44e2954d630dfa06 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 11:20:28 +0200 Subject: [PATCH 14/54] New translations firefly.php (Spanish) --- resources/lang/es_ES/firefly.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/es_ES/firefly.php b/resources/lang/es_ES/firefly.php index fc5ec53ced..0f4989ffaf 100644 --- a/resources/lang/es_ES/firefly.php +++ b/resources/lang/es_ES/firefly.php @@ -155,7 +155,7 @@ return [ 'export_data' => 'Exportar datos', 'export_and_backup_data' => 'Export and backup', 'export_data_intro' => 'For backup purposes, when migrating to another system or when migrating to another Firefly III installation.', - 'export_format' => 'Export format', + 'export_format' => 'Formato de exportación', 'export_format_csv' => 'Comma separated values (CSV file)', 'export_format_mt940' => 'MT940 compatible format', 'include_old_uploads_help' => 'Firefly III does not throw away the original CSV files you have imported in the past. You can include them in your export.', From 5c0bb34d773886a44d63c758fd00a6a2190902e2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 14:05:31 +0200 Subject: [PATCH 15/54] Code for #916 --- .../Controllers/Chart/BudgetController.php | 24 +++++++++---------- app/Support/Navigation.php | 5 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 04fd3dbd2b..aac0c2b726 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -74,17 +74,17 @@ class BudgetController extends Controller */ public function budget(Budget $budget) { - $first = $this->repository->firstUseDate($budget); - $range = Preferences::get('viewRange', '1M')->data; - $last = session('end', new Carbon); - - $cache = new CacheProperties(); + $first = $this->repository->firstUseDate($budget); + $range = Preferences::get('viewRange', '1M')->data; + $currentStart = Navigation::startOfPeriod($first, $range); + $last = session('end', new Carbon); + $cache = new CacheProperties(); $cache->addProperty($first); $cache->addProperty($last); $cache->addProperty('chart.budget.budget'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); // @codeCoverageIgnore } $final = clone $last; @@ -92,17 +92,16 @@ class BudgetController extends Controller $budgetCollection = new Collection([$budget]); $last = Navigation::endOfX($last, $range, $final); // not to overshoot. $entries = []; - while ($first < $last) { - + while ($currentStart < $last) { // periodspecific dates: - $currentStart = Navigation::startOfPeriod($first, $range); - $currentEnd = Navigation::endOfPeriod($first, $range); + $currentEnd = Navigation::endOfPeriod($currentStart, $range); // sub another day because reasons. $currentEnd->subDay(); $spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $currentStart, $currentEnd); - $format = Navigation::periodShow($first, $range); + $format = Navigation::periodShow($currentStart, $range); $entries[$format] = bcmul($spent, '-1'); - $first = Navigation::addPeriod($first, $range, 0); + $currentStart = clone $currentEnd; + $currentStart->addDays(2); } $data = $this->generator->singleSet(strval(trans('firefly.spent')), $entries); @@ -244,6 +243,7 @@ class BudgetController extends Controller $data = $this->generator->pieChart($chartData); $cache->store($data); + return Response::json($data); } diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 15a3ade60d..af068c59f5 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -215,14 +215,15 @@ class Navigation } /** - * @param \Carbon\Carbon $date + * @param \Carbon\Carbon $theDate * @param $repeatFrequency * * @return string * @throws FireflyException */ - public function periodShow(Carbon $date, string $repeatFrequency): string + public function periodShow(Carbon $theDate, string $repeatFrequency): string { + $date = clone $theDate; $formatMap = [ '1D' => trans('config.specific_day'), 'daily' => trans('config.specific_day'), From dad1ee6edd80d8e2ca6bc43af6a8a09eaf60b3f7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 14:37:58 +0200 Subject: [PATCH 16/54] Fix bars #916 --- resources/views/budgets/show.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/views/budgets/show.twig b/resources/views/budgets/show.twig index 753c432375..3b57ef33d1 100644 --- a/resources/views/budgets/show.twig +++ b/resources/views/budgets/show.twig @@ -121,6 +121,7 @@ {{ 'spent'|_ }} {{ limit.spent|formatAmount }} + {% if limit.spent > 0 %} {% set overspent = limit.amount + limit.spent < 0 %} @@ -142,6 +143,7 @@ {% endif %} + {% endif %} From dc48335ed9cefde546973d4eae4e17f1f018ec57 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 14:38:12 +0200 Subject: [PATCH 17/54] Remove double budget limits. --- app/Repositories/Budget/BudgetRepository.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 4961d8987d..c83d7eba73 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -588,6 +588,11 @@ class BudgetRepository implements BudgetRepositoryInterface */ public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, int $amount): BudgetLimit { + // count the limits: + $limits = $budget->budgetlimits() + ->where('budget_limits.start_date', $start->format('Y-m-d')) + ->where('budget_limits.end_date', $end->format('Y-m-d')) + ->get(['budget_limits.*'])->count(); // there might be a budget limit for these dates: /** @var BudgetLimit $limit */ $limit = $budget->budgetlimits() @@ -595,6 +600,14 @@ class BudgetRepository implements BudgetRepositoryInterface ->where('budget_limits.end_date', $end->format('Y-m-d')) ->first(['budget_limits.*']); + // if more than 1 limit found, delete the others: + if ($limits > 1 && !is_null($limit)) { + $budget->budgetlimits() + ->where('budget_limits.start_date', $start->format('Y-m-d')) + ->where('budget_limits.end_date', $end->format('Y-m-d')) + ->where('budget_limits.id', '!=', $limit->id)->delete(); + } + // delete if amount is zero. if (!is_null($limit) && $amount <= 0.0) { $limit->delete(); From b36fc067c9f86c48533e863bcd2764273e136964 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Oct 2017 16:25:26 +0200 Subject: [PATCH 18/54] Set environment to local. --- .env.sandstorm | 2 +- docker-compose.prod.yml | 2 +- docker-compose.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.sandstorm b/.env.sandstorm index 77d1aec95c..ba2b67cc85 100755 --- a/.env.sandstorm +++ b/.env.sandstorm @@ -1,4 +1,4 @@ -APP_ENV=production +APP_ENV=local APP_DEBUG=true APP_NAME=FireflyIII APP_KEY=SomeRandomStringOf32CharsExactly diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 68fdff69a1..4ae95111a1 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -3,7 +3,7 @@ version: '2' services: firefly-app: environment: - - FF_APP_ENV=production + - FF_APP_ENV=local volumes: - firefly-app-storage:/var/www/firefly-iii/storage diff --git a/docker-compose.yml b/docker-compose.yml index 8bcdf06244..6c411857eb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,7 @@ services: - FF_DB_USER=firefly_db - FF_DB_PASSWORD=firefly_db_secret - FF_APP_KEY=SomeRandomStringOf32CharsExactly - - FF_APP_ENV=production + - FF_APP_ENV=local ports: - "80:80" links: From 95c3f52144ebe66fe44a6dc57de2e736750feaa9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 16 Oct 2017 15:53:55 +0200 Subject: [PATCH 19/54] Fix #932 --- app/Http/Controllers/HomeController.php | 8 +------- resources/views/partials/boxes.twig | 17 ++++------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 66fe45ce1e..eb48b4a263 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -19,7 +19,6 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Models\AccountType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; -use FireflyIII\Repositories\Bill\BillRepositoryInterface; use Illuminate\Http\Request; use Illuminate\Routing\Route; use Illuminate\Support\Collection; @@ -133,11 +132,6 @@ class HomeController extends Controller $accounts = $repository->getAccountsById($frontPage->data); $showDeps = Preferences::get('showDepositsFrontpage', false)->data; - // zero bills? Hide some elements from view. - /** @var BillRepositoryInterface $billRepository */ - $billRepository = app(BillRepositoryInterface::class); - $billCount = $billRepository->getBills()->count(); - foreach ($accounts as $account) { $collector = app(JournalCollectorInterface::class); $collector->setAccounts(new Collection([$account]))->setRange($start, $end)->setLimit(10)->setPage(1); @@ -146,7 +140,7 @@ class HomeController extends Controller } return view( - 'index', compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount') + 'index', compact('count', 'subTitle', 'transactions', 'showDeps') ); } diff --git a/resources/views/partials/boxes.twig b/resources/views/partials/boxes.twig index 2fc8f07e68..6964de40f3 100644 --- a/resources/views/partials/boxes.twig +++ b/resources/views/partials/boxes.twig @@ -1,16 +1,7 @@ -{# Set box sizes: #} -{% if billCount > 0 %} - {% set boxClasses = 'col-lg-3 col-md-3 col-sm-6 col-xs-12' %} -{% else %} - {# Zero bills? Remove the boxes. #} - {% set boxClasses = 'col-lg-4 col-md-4 col-sm-6 col-xs-12' %} -{% endif %} - -