Mainly layout improvements.

This commit is contained in:
James Cole 2015-07-06 08:14:19 +02:00
parent 1658c666ab
commit 13bda0a264
13 changed files with 46 additions and 21 deletions

View File

@ -126,14 +126,13 @@ class Importer
} }
// post processing and validating. // post processing and validating.
$data = $this->postProcess($data, $row); $data = $this->postProcess($data, $row);
$result = $this->validateData($data); $result = $this->validateData($data);
$journal = null;
if ($result === true) { if ($result === true) {
$result = $this->createTransactionJournal($data); $journal = $this->createTransactionJournal($data);
} else {
Log::error('Validator: ' . $result);
} }
if ($result instanceof TransactionJournal) { if ($journal instanceof TransactionJournal) {
return true; return true;
} }

View File

@ -20,13 +20,15 @@ class AnyAccount implements MapperInterface
{ {
$result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']); $result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
$list = []; $list = [];
/** @var Account $account */ /** @var Account $account */
foreach ($result as $account) { foreach ($result as $account) {
$list[$account->id] = $account->name . ' (' . $account->accountType->type . ')'; $list[$account->id] = $account->name . ' (' . $account->accountType->type . ')';
} }
asort($list); asort($list);
array_unshift($list, trans('firefly.csv_do_not_map'));
return $list; return $list;
} }
} }

View File

@ -26,13 +26,20 @@ class AssetAccount implements MapperInterface
)->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']); )->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
$list = []; $list = [];
/** @var Account $account */ /** @var Account $account */
foreach ($result as $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); asort($list);
array_unshift($list, trans('firefly.csv_do_not_map'));
return $list; return $list;
} }
} }

View File

@ -27,6 +27,8 @@ class Bill implements MapperInterface
} }
asort($list); asort($list);
array_unshift($list, trans('firefly.csv_do_not_map'));
return $list; return $list;
} }
} }

View File

@ -27,6 +27,8 @@ class Budget implements MapperInterface
} }
asort($list); asort($list);
array_unshift($list, trans('firefly.csv_do_not_map'));
return $list; return $list;
} }
} }

View File

@ -27,6 +27,8 @@ class Category implements MapperInterface
} }
asort($list); asort($list);
array_unshift($list, trans('firefly.csv_do_not_map'));
return $list; return $list;
} }
} }

View File

@ -27,6 +27,8 @@ class Tag implements MapperInterface
} }
asort($list); asort($list);
array_unshift($list, trans('firefly.csv_do_not_map'));
return $list; return $list;
} }
} }

View File

@ -23,6 +23,10 @@ class TransactionCurrency implements MapperInterface
$list[$currency->id] = $currency->name . ' (' . $currency->code . ')'; $list[$currency->id] = $currency->name . ' (' . $currency->code . ')';
} }
asort($list);
array_unshift($list, trans('firefly.csv_do_not_map'));
return $list; return $list;
} }
} }

View File

@ -25,7 +25,8 @@ return [
'csv_index_title' => 'Upload and import a CSV file', 'csv_index_title' => 'Upload and import a CSV file',
'csv_index_text' => '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' . '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_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_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.' . '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_error_see_logs' => 'Check the log files to see details.',
'csv_start_over' => 'Import again', 'csv_start_over' => 'Import again',
'csv_to_index' => 'Back home', 'csv_to_index' => 'Back home',
'csv_do_not_map' => 'Do not map this value',
// 'csv_index_text' => 'Here be explanation.', // 'csv_index_text' => 'Here be explanation.',
// 'csv_upload_form' => 'Upload form', // 'csv_upload_form' => 'Upload form',
// 'upload_csv_file' => 'Upload CSV file', // 'upload_csv_file' => 'Upload CSV file',

View File

@ -28,6 +28,7 @@ return [
'categories-delete' => 'categories.delete', 'categories-delete' => 'categories.delete',
'categories-show' => 'categories.show', 'categories-show' => 'categories.show',
'categories-noCategory' => 'categories.noCategory', 'categories-noCategory' => 'categories.noCategory',
'csv-index' => 'Upload and import a CSV file',
'currency-index' => 'currency.index', 'currency-index' => 'currency.index',
'currency-create' => 'currency.create', 'currency-create' => 'currency.create',
'currency-edit' => 'currency.edit', 'currency-edit' => 'currency.edit',

View File

@ -45,17 +45,17 @@
<table class="table"> <table class="table">
<thead> <thead>
<th>{{ 'cvs_column_name'|_ }}</th> <th style="width:20%;">{{ 'cvs_column_name'|_ }}</th>
<th>{{ 'cvs_column_example'|_ }}</th> <th style="width:40%;">{{ 'cvs_column_example'|_ }}</th>
<th>{{ 'cvs_column_role'|_ }}</th> <th style="width:30%;">{{ 'cvs_column_role'|_ }}</th>
<th>{{ 'csv_do_map_value'|_ }}</th> <th style="width:10%;">{{ 'csv_do_map_value'|_ }}</th>
</thead> </thead>
{% for index,header in headers %} {% for index,header in headers %}
<tr> <tr>
<td>{{ header }}</td> <td>{{ header }}</td>
<td>{{ example[index] }}</td> <td><code>{{ example[index] }}</code></td>
<td> <td>
{{ Form.select(('role['~index~']'), availableRoles,roles[index]) }} {{ Form.select(('role['~index~']'), availableRoles,roles[index],{class: 'form-control'}) }}
</td> </td>
<td> <td>
{{ Form.checkbox(('map['~index~']'),1,map[index]) }} {{ Form.checkbox(('map['~index~']'),1,map[index]) }}

View File

@ -61,6 +61,8 @@
{{ ExpandedForm.file('csv_config',{helpText: 'csv_csv_config_file_help'|_}) }} {{ ExpandedForm.file('csv_config',{helpText: 'csv_csv_config_file_help'|_}) }}
<!-- ExpandedForm.multiCheckbox('specifix',Config.get('csv.specifix')) -->
{% if not uploadPossible %} {% if not uploadPossible %}
<div class="form-group" id="csv_holder"> <div class="form-group" id="csv_holder">
<div class="col-sm-4"> <div class="col-sm-4">

View File

@ -21,7 +21,7 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<p> <p>
{{ 'csv_map_text'|_ }} {{ 'csv_map_text'|_ }}
</p> </p>
</div> </div>
</div> </div>
@ -45,18 +45,18 @@
</div> </div>
</div> </div>
<div class="box-body"> <div class="box-body no-padding">
<table class="table"> <table class="table table-hover">
<thead> <thead>
<th>{{ 'cvs_field_value'|_ }}</th> <th style="width:50%;">{{ 'cvs_field_value'|_ }}</th>
<th>{{ 'csv_field_mapped_to'|_ }}</th> <th>{{ 'csv_field_mapped_to'|_ }}</th>
</thead> </thead>
<tbody> <tbody>
{% for value in values[index] %} {% for value in values[index] %}
<tr> <tr>
<td>{{ value }}</td> <td><code>{{ value }}</code></td>
<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> </td>
</tr> </tr>
{% endfor %} {% endfor %}