Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Mainly layout improvements.
James Cole13bda0a264f3
diff --git a/app/Helpers/Csv/Importer.php b/app/Helpers/Csv/Importer.phpindex edadb10d8e..14a3e8705e 100644--- a/app/Helpers/Csv/Importer.php+++ b/app/Helpers/Csv/Importer.php@@ -126,14 +126,13 @@ class Importer}// post processing and validating.- $data = $this->postProcess($data, $row);- $result = $this->validateData($data);+ $data = $this->postProcess($data, $row);+ $result = $this->validateData($data);+ $journal = null;if ($result === true) {- $result = $this->createTransactionJournal($data);- } else {- Log::error('Validator: ' . $result);+ $journal = $this->createTransactionJournal($data);}- if ($result instanceof TransactionJournal) {+ if ($journal instanceof TransactionJournal) {return true;}diff --git a/app/Helpers/Csv/Mapper/AnyAccount.php b/app/Helpers/Csv/Mapper/AnyAccount.phpindex 37488c1523..f42e64d071 100644--- a/app/Helpers/Csv/Mapper/AnyAccount.php+++ b/app/Helpers/Csv/Mapper/AnyAccount.php@@ -20,13 +20,15 @@ class AnyAccount implements MapperInterface{$result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']);- $list = [];+ $list = [];/** @var Account $account */foreach ($result as $account) {$list[$account->id] = $account->name . ' (' . $account->accountType->type . ')';}asort($list);+ array_unshift($list, trans('firefly.csv_do_not_map'));+return $list;}}\ No newline at end of filediff --git a/app/Helpers/Csv/Mapper/AssetAccount.php b/app/Helpers/Csv/Mapper/AssetAccount.phpindex cb49177976..6915533ea7 100644--- a/app/Helpers/Csv/Mapper/AssetAccount.php+++ b/app/Helpers/Csv/Mapper/AssetAccount.php@@ -26,13 +26,20 @@ class AssetAccount implements MapperInterface)->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']);$list = [];+/** @var Account $account */foreach ($result as $account) {- $list[$account->id] = $account->name;+ $name = $account->name;+ if (strlen($account->iban) > 0) {+ $name .= ' (' . $account->iban . ')';+ }+ $list[$account->id] = $name;}asort($list);+ array_unshift($list, trans('firefly.csv_do_not_map'));+return $list;}}\ No newline at end of filediff --git a/app/Helpers/Csv/Mapper/Bill.php b/app/Helpers/Csv/Mapper/Bill.phpindex 17a9f5b22e..45f2de5897 100644--- a/app/Helpers/Csv/Mapper/Bill.php+++ b/app/Helpers/Csv/Mapper/Bill.php@@ -27,6 +27,8 @@ class Bill implements MapperInterface}asort($list);+ array_unshift($list, trans('firefly.csv_do_not_map'));+return $list;}}\ No newline at end of filediff --git a/app/Helpers/Csv/Mapper/Budget.php b/app/Helpers/Csv/Mapper/Budget.phpindex c4bf2064eb..dbe8ebb03c 100644--- a/app/Helpers/Csv/Mapper/Budget.php+++ b/app/Helpers/Csv/Mapper/Budget.php@@ -27,6 +27,8 @@ class Budget implements MapperInterface}asort($list);+ array_unshift($list, trans('firefly.csv_do_not_map'));+return $list;}}\ No newline at end of filediff --git a/app/Helpers/Csv/Mapper/Category.php b/app/Helpers/Csv/Mapper/Category.phpindex 81634764f0..7244a65a1a 100644--- a/app/Helpers/Csv/Mapper/Category.php+++ b/app/Helpers/Csv/Mapper/Category.php@@ -27,6 +27,8 @@ class Category implements MapperInterface}asort($list);+ array_unshift($list, trans('firefly.csv_do_not_map'));+return $list;}}\ No newline at end of filediff --git a/app/Helpers/Csv/Mapper/Tag.php b/app/Helpers/Csv/Mapper/Tag.phpindex 9ef0d6a2db..559c73089c 100644--- a/app/Helpers/Csv/Mapper/Tag.php+++ b/app/Helpers/Csv/Mapper/Tag.php@@ -27,6 +27,8 @@ class Tag implements MapperInterface}asort($list);+ array_unshift($list, trans('firefly.csv_do_not_map'));+return $list;}}\ No newline at end of filediff --git a/app/Helpers/Csv/Mapper/TransactionCurrency.php b/app/Helpers/Csv/Mapper/TransactionCurrency.phpindex 0945bea416..4d6281acdc 100644--- a/app/Helpers/Csv/Mapper/TransactionCurrency.php+++ b/app/Helpers/Csv/Mapper/TransactionCurrency.php@@ -23,6 +23,10 @@ class TransactionCurrency implements MapperInterface$list[$currency->id] = $currency->name . ' (' . $currency->code . ')';}+ asort($list);++ array_unshift($list, trans('firefly.csv_do_not_map'));+return $list;}}\ No newline at end of filediff --git a/resources/lang/en/firefly.php b/resources/lang/en/firefly.phpindex 85a663d095..c45f5d6ae4 100644--- a/resources/lang/en/firefly.php+++ b/resources/lang/en/firefly.php@@ -25,7 +25,8 @@ return ['csv_index_title' => 'Upload and import a CSV file','csv_index_text' =>'This form allows you to import a CSV file with transactions into Firefly. It is based on the excellent CSV importer made by' .- ' the folks at <a href="https://www.atlassian.com/">Atlassian</a>. Simply upload your CSV file and follow the instructions.',+ ' the folks at <a href="https://www.atlassian.com/">Atlassian</a>. Simply upload your CSV file and follow the instructions.' .+ ' If you would like to learn more, please click on the <i class="fa fa-question-circle"></i> button at the top of this page.','csv_index_beta_warning' => 'This tool is very much in beta. Please proceed with caution','csv_header_help' => 'Check this box when your CSV file\'s first row consists of column names, not actual data','csv_date_help' => 'Date time format in your CSV. Follow the format like <a href="https://secure.' .@@ -70,6 +71,7 @@ return ['csv_error_see_logs' => 'Check the log files to see details.','csv_start_over' => 'Import again','csv_to_index' => 'Back home',+ 'csv_do_not_map' => 'Do not map this value',// 'csv_index_text' => 'Here be explanation.',// 'csv_upload_form' => 'Upload form',// 'upload_csv_file' => 'Upload CSV file',diff --git a/resources/lang/en/help.php b/resources/lang/en/help.phpindex e46f28061e..e8949bff78 100644--- a/resources/lang/en/help.php+++ b/resources/lang/en/help.php@@ -28,6 +28,7 @@ return ['categories-delete' => 'categories.delete','categories-show' => 'categories.show','categories-noCategory' => 'categories.noCategory',+ 'csv-index' => 'Upload and import a CSV file','currency-index' => 'currency.index','currency-create' => 'currency.create','currency-edit' => 'currency.edit',diff --git a/resources/twig/csv/column-roles.twig b/resources/twig/csv/column-roles.twigindex 3480bdbd0f..3f186e89ff 100644--- a/resources/twig/csv/column-roles.twig+++ b/resources/twig/csv/column-roles.twig@@ -45,17 +45,17 @@<table class="table"><thead>- <th>{{ 'cvs_column_name'|_ }}</th>- <th>{{ 'cvs_column_example'|_ }}</th>- <th>{{ 'cvs_column_role'|_ }}</th>- <th>{{ 'csv_do_map_value'|_ }}</th>+ <th style="width:20%;">{{ 'cvs_column_name'|_ }}</th>+ <th style="width:40%;">{{ 'cvs_column_example'|_ }}</th>+ <th style="width:30%;">{{ 'cvs_column_role'|_ }}</th>+ <th style="width:10%;">{{ 'csv_do_map_value'|_ }}</th></thead>{% for index,header in headers %}<tr><td>{{ header }}</td>- <td>{{ example[index] }}</td>+ <td><code>{{ example[index] }}</code></td><td>- {{ Form.select(('role['~index~']'), availableRoles,roles[index]) }}+ {{ Form.select(('role['~index~']'), availableRoles,roles[index],{class: 'form-control'}) }}</td><td>{{ Form.checkbox(('map['~index~']'),1,map[index]) }}diff --git a/resources/twig/csv/index.twig b/resources/twig/csv/index.twigindex 7e8e79c97f..e4a465bc9e 100644--- a/resources/twig/csv/index.twig+++ b/resources/twig/csv/index.twig@@ -61,6 +61,8 @@{{ ExpandedForm.file('csv_config',{helpText: 'csv_csv_config_file_help'|_}) }}+ <!-- ExpandedForm.multiCheckbox('specifix',Config.get('csv.specifix')) -->+{% if not uploadPossible %}<div class="form-group" id="csv_holder"><div class="col-sm-4">diff --git a/resources/twig/csv/map.twig b/resources/twig/csv/map.twigindex 97ce18b582..ccd26c0e50 100644--- a/resources/twig/csv/map.twig+++ b/resources/twig/csv/map.twig@@ -21,7 +21,7 @@</div><div class="box-body"><p>- {{ 'csv_map_text'|_ }}+ {{ 'csv_map_text'|_ }}</p></div></div>@@ -45,18 +45,18 @@</div></div>- <div class="box-body">- <table class="table">+ <div class="box-body no-padding">+ <table class="table table-hover"><thead>- <th>{{ 'cvs_field_value'|_ }}</th>+ <th style="width:50%;">{{ 'cvs_field_value'|_ }}</th><th>{{ 'csv_field_mapped_to'|_ }}</th></thead><tbody>{% for value in values[index] %}<tr>- <td>{{ value }}</td>+ <td><code>{{ value }}</code></td><td>- {{ Form.select('mapping['~index~']['~value~']',options[index], mapped[index][value]) }}+ {{ Form.select('mapping['~index~']['~value~']',options[index], mapped[index][value], {class: 'form-control'}) }}</td></tr>{% endfor %}