You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

644 lines
40 KiB

{% extends "./layout/default" %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-12">
&nbsp;
</div>
</div>
<div class="row">
<div class="col-lg-10 offset-lg-1">
<h1>{{ mainTitle }}</h1>
</div>
</div>
<div class="row">
<div class="col-lg-10 offset-lg-1">
<div class="card">
<div class="card-header">
{{ subTitle }}
</div>
<div class="card-body">
{% if 'csv' == flow %}
<p>
TODO files come in many shapes and forms. Some of the most important settings are below.
They
apply
to all lines in the file, and what to do with double lines or troubles during the
import.
If you would like some support, <a
href="https://docs.firefly-iii.org/csv/usage/configure/"
target="_blank">TODO check out the documentation for this
page.</a>
</p>
{% endif %}
{% if 'nordigen' == flow %}
<p>
TODO nordigen
</p>
{% endif %}
{% if 'spectre' == flow %}
<p>
TODO spectre
</p>
{% endif %}
</div>
</div>
</div>
</div>
{% if not errors.isEmpty %}
<div class="row mt-3">
<div class="col-lg-10 offset-lg-1">
<div class="card">
<div class="card-header">
Errors :(
</div>
<div class="card-body">
<p class="text-danger">Some error(s) occurred:</p>
<ul>
{% for error in errors.all %}
<li class="text-danger">{{ error }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endif %}
<form method="post" action="{{ route('004-configure.post') }}" accept-charset="UTF-8" id="store">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="flow" value="{{ flow }}"/>
<div class="row mt-3">
<div class="col-lg-10 offset-lg-1">
<div class="card">
<div class="card-header">
Form
</div>
<div class="card-body">
{% if 'nordigen' == flow or 'spectre' == flow %}
<h4>{{ flow|capitalize }} import options</h4>
<div class="form-group row">
<div class="col-sm-3">Accounts</div>
<div class="col-sm-9">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th>{{ flow|capitalize }}</th>
<th>&nbsp;</th>
<th>Firefly III</th>
</tr>
</thead>
<tbody>
{% for information in importerAccounts %}
<tr>
<td>
{% if 'nordigen' == flow %}
<input
id="do_import_{{ information.import_service.identifier }}"
type="checkbox"
{% if 'disabled' == information.import_service.status %}
disabled="disabled"
{% endif %}
name="do_import[{{ information.import_service.identifier }}]"
value="1"
aria-describedby="accountsHelp"
{% if(information.firefly|length==0) %}disabled="disabled"{% endif %}
/> <label class="form-check-label"
{% if '' != information.import_service.iban %}title="IBAN: {{ information.import_service.iban }}"{% endif %}
for="do_import_{{ information.import_service.identifier }}">
Account "{{ information.import_service.getFullName }}"
</label>
{% if 'disabled' != information.import_service.status and '' != information.import_service.iban %}
<br><small>
IBAN: {{ information.import_service.iban }}</small>{% endif %}
{% if 'disabled' == information.import_service.status %}<br>
<small class="text-danger">(this account is
disabled)</small>{% endif %}
{% endif %}
{% if 'spectre' == flow %}
<input
id="do_import_{{ information.import_service.id }}"
type="checkbox"
name="do_import[{{ information.import_service.id }}]"
value="1"
aria-describedby="accountsHelp"
{% if(information.firefly|length==0) %}disabled="disabled"{% endif %}
/> <label class="form-check-label"
{% if '' != information.import_service.iban %}title="IBAN: {{ information.import_service.iban }}"{% endif %}
for="do_import_{{ information.import_service.id }}">
Account "{{ information.import_service.name }}"
</label>
{% if '' != information.import_service.iban %}
<br><small>
IBAN: {{ information.import_service.iban }}</small>{% endif %}
{% endif %}
</td>
<td>
{% if 'disabled' != information.import_service.status %}
{% if(information.firefly|length!=0) %}&rarr;{% endif %}
{% endif %}
</td>
<td>
{% if(information.firefly|length==0) %}
<span class="text-danger">Cannot be imported</span>
{% endif %}
{% if(information.firefly|length>0) %}
{% if 'disabled' != information.import_service.status %}
<select style="width:100%;"
class="custom-select custom-select-sm form-control"
name="accounts[{{ information.import_service.identifier }}]">
{% for ff3Account in information.firefly %}
{# {% if configuration.getAccounts[spectreAccount.id] == ff3Account.id %}selected{% endif %} #}
<option value="{{ ff3Account.id }}"
label="{{ ff3Account.name }}{% if ff3Account.iban %} ({{ ff3Account.iban }}){% endif %}">
{{ ff3Account.name }}{% if ff3Account.iban %} ({{ ff3Account.iban }}){% endif %}
</option>
{% endfor %}
</select>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<small id="accountsHelp" class="form-text text-muted">
Select the accounts you want to import into your Firefly III installation.
</small>
</div>
</div>
{% endif %}
{% if 'csv' == flow %}
<h5>File options</h5>
<div class="form-group row mb-3">
<div class="col-sm-3">Headers</div>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input"
{% if configuration.isHeaders %}checked{% endif %} type="checkbox"
id="headers" name="headers" value="1" aria-describedby="headersHelp">
<label class="form-check-label" for="headers">
Yes
</label><br>
<small id="headersHelp" class="form-text text-muted">
Select this checkbox when your CSV file has headers on the first line of
the TODO
file.
</small>
</div>
</div>
</div>
<div class="form-group row mb-3">
<div class="col-sm-3">Convert to UTF-8</div>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input"
{% if configuration.isConversion %}checked{% endif %} type="checkbox"
id="conversion" name="conversion" value="1"
aria-describedby="conversionHelp">
<label class="form-check-label" for="conversion">
Yes
</label><br>
<small id="conversionHelp" class="form-text text-muted">
Try to convert your TODO file to UTF-8. May lead to weird characters.
</small>
</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="delimiter" class="col-sm-3 col-form-label">CSV delimiter</label>
<div class="col-sm-9">
<select id="delimiter" name="delimiter" class="form-control"
aria-describedby="delimiterHelp">
<option value="comma"
{% if configuration.getDelimiter == 'comma' %}selected{% endif %}
label="A comma (,)">A comma (,)
</option>
<option value="semicolon"
{% if configuration.getDelimiter == 'semicolon' %}selected{% endif %}
label="A semicolon (;)">A semicolon (;)
</option>
<option value="tab"
{% if configuration.getDelimiter == 'tab' %}selected{% endif %}
label="A tab (invisible)">A tab (invisible)
</option>
</select>
<small id="delimiterHelp" class="form-text text-muted">
Select the field separator of our CSV file. This is almost always a comma.
TODO
</small>
</div>
</div>
<div class="form-group row mb-3">
<label for="date" class="col-sm-3 col-form-label">Date format</label>
<div class="col-sm-9">
<input type="text" name="date" class="form-control" id="date"
placeholder="Date format"
value="{{ configuration.getDate|default('Y-m-d') }}"
aria-describedby="dateHelp">
<small id="dateHelp" class="form-text text-muted">
Use this box to set the date format as it can be found in your file. You can
use
the format as described
<a href="https://www.php.net/manual/en/function.date.php">on this page</a>.
Don't stop playing with this setting until <strong
id="date_example">1984-09-17</strong> matches what you see in your
CSV file.
</small>
</div>
</div>
{% endif %}
<h4>Import options</h4>
<div class="form-group row mb-3">
<label for="default_account" class="col-sm-3 col-form-label">Default import
account</label>
<div class="col-sm-9">
<select id="default_account" name="default_account" class="form-control"
aria-describedby="defaultAccountHelp">
{% for accountGroup, accountList in accounts %}
<optgroup label="{{ accountGroup }}">
{% for account in accountList %}
<option
{% if configuration.getDefaultAccount == account.id %}selected{% endif %}
value="{{ account.id }}"
label="{{ account.name }}">{{ account.name }}</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
<small id="defaultAccountHelp" class="form-text text-muted">
Select the asset account you want to link transactions to, if your import
doesn't have enough meta data to determine this.
</small>
</div>
</div>
<div class="form-group row mb-3">
<div class="col-sm-3">Rules</div>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input"
{% if configuration.isRules or null == configuration %}checked{% endif %}
type="checkbox" id="rules" name="rules" value="1"
aria-describedby="rulesHelp">
<label class="form-check-label" for="rules">
Yes
</label>
<small id="rulesHelp" class="form-text text-muted">
<br>Select if you want Firefly III to apply your rules to the import.
</small>
</div>
</div>
</div>
<div class="form-group row mb-3">
<div class="col-sm-3">Import tag</div>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input"
{% if configuration.isAddImportTag or null == configuration %}checked{% endif %}
type="checkbox" id="rules" name="add_import_tag" value="1"
aria-describedby="add_import_tagHelp">
<label class="form-check-label" for="rules">
Yes
</label>
<small id="add_import_tagHelp" class="form-text text-muted">
<br>When selected Firefly III will add a tag to each imported transaction
denoting the import; this groups your import under a tag.
</small>
</div>
</div>
</div>
{% if 'nordigen' == flow or 'spectre' == flow %}
<div class="form-group row mb-3">
<div class="col-sm-3">Map data</div>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input"
{% if configuration.isMapAllData %}checked{% endif %} type="checkbox"
id="map_all_data"
name="map_all_data" value="1" aria-describedby="mapAllDataHelp">
<label class="form-check-label" for="map_all_data">
Yes
</label>
<small id="mapAllDataHelp" class="form-text text-muted">
<br>You get the opportunity to link your TODO data to existing Firefly
III
data, for a cleaner import.
</small>
</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="default_account" class="col-sm-3 col-form-label">Date range</label>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input date-range-radio" id="date_range_all"
type="radio" name="date_range" value="all"
{% if configuration.getDateRange == 'all' %}checked{% endif %}
aria-describedby="rangeHelp"/>
<label class="form-check-label" for="date_range_all">Import
everything</label>
</div>
<div class="form-check">
<input class="form-check-input date-range-radio" id="date_range_partial"
type="radio" name="date_range"
value="partial"
{% if configuration.getDateRange == 'partial' %}checked{% endif %}
aria-describedby="rangeHelp"/>
<label class="form-check-label" for="date_range_partial">Go back some
time</label>
</div>
<div class="form-check">
<input class="form-check-input date-range-radio" id="date_range_range"
type="radio" name="date_range" value="range"
{% if configuration.getDateRange == 'range' %}checked{% endif %}
aria-describedby="rangeHelp"/>
<label class="form-check-label" for="date_range_range">Import a specific
range</label>
<small id="rangeHelp" class="form-text text-muted">
<br>What range to grab from your bank through Nordigen?
</small>
</div>
</div>
</div>
<div class="form-group row mb-3" id="date_range_partial_settings">
<div class="col-sm-3">
Date range settings
</div>
<div class="col-sm-3">
<input
name="date_range_number"
id="date_range_number"
class="form-control" value="{{ configuration.getDateRangeNumber }}"
type="number" step="1" min="1" max="365">
</div>
<div class="col-sm-6">
<select class="form-control"
name="date_range_unit"
id="date_range_unit">
<option {% if 'd' == configuration.getDateRangeUnit %}selected{% endif %}
value="d" label="days">days
</option>
<option {% if 'w' == configuration.getDateRangeUnit %}selected{% endif %}
value="w" label="weeks">weeks
</option>
<option {% if 'm' == configuration.getDateRangeUnit %}selected{% endif %}
value="m" label="months">months
</option>
<option {% if 'y' == configuration.getDateRangeUnit %}selected{% endif %}
value="y" label="years">years
</option>
</select>
</div>
</div>
<div class="form-group row mb-3" id="date_range_range_settings">
<div class="col-sm-3">
Date range settings
</div>
<div class="col-sm-4">
<input type="date" name="date_not_before" class="form-control"
value="{{ configuration.getDateNotBefore }}">
</div>
<div class="col-sm-4">
<input type="date" name="date_not_after" class="form-control"
value="{{ configuration.getDateNotAfter }}">
</div>
</div>
{% endif %}
<h4>Duplicate transaction detection</h4>
<div class="col-sm-9 offset-sm-3">
<p class="text-muted">
Firefly III can automatically detect duplicate transactions. This is pretty
foolproof. TODO
In some special cases however,
you want more control over this process. Read more about the options below in <a
href="https://docs.firefly-iii.org/csv/usage/configure/" target="_blank">the
documentation</a>.
</p>
</div>
<div class="form-group row mb-3">
<label for="X" class="col-sm-3 col-form-label">General detection options</label>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input"
{% if configuration.isIgnoreDuplicateLines or null == configuration %}checked{% endif %}
type="checkbox" value="1" id="ignore_duplicate_lines"
name="ignore_duplicate_lines" aria-describedby="duplicateHelp">
<label class="form-check-label" for="ignore_duplicate_lines">
Do not import duplicate lines in the import.
</label>
<br>
<small class="form-text text-muted" id="duplicateHelp">
Whatever method you choose ahead, it's smart to make the importer ignore any
duplicated lines in your CSV file. TODO
</small>
</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="duplicate_detection_method" class="col-sm-3 col-form-label">Detection
method</label>
<div class="col-sm-9">
<select id="duplicate_detection_method" name="duplicate_detection_method"
class="form-control" aria-describedby="duplicate_detection_method_help">
<option label="No duplicate detection"
{% if configuration.getDuplicateDetectionMethod == 'none' %}selected{% endif %}
value="none">No duplicate detection
</option>
<option label="Content-based"
{% if configuration.getDuplicateDetectionMethod == 'classic' %}selected{% endif %}
value="classic">Content-based detection
</option>
<option label="Identifier-based"
{% if configuration.getDuplicateDetectionMethod == 'cell' %}selected{% endif %}
value="cell">Identifier-based detection
</option>
</select>
<small id="duplicate_detection_method_help" class="form-text text-muted">
For more details on these detection method see <a
href="https://docs.firefly-iii.org/csv/usage/configure/#duplicate-transaction-detection"
target="_blank">the documentation</a>. If you're not sure, select
"content-based" detection.
</small>
</div>
</div>
{% if 'csv' == flow %}
<div class="form-group row mb-3" id="unique_column_index_holder">
<label for="unique_column_index" class="col-sm-3 col-form-label">Unique column
index</label>
<div class="col-sm-9">
<input type="number" step="1" name="unique_column_index" class="form-control"
id="unique_column_index" placeholder="Column index"
value="{{ configuration.getUniqueColumnIndex }}"
aria-describedby="unique_column_index_help">
<small id="unique_column_index_help" class="form-text text-muted">
This field is only relevant for the "identifier-based" detection option.
Indicate which column contains the unique identifier. Start counting from
zero!
</small>
</div>
</div>
<div class="form-group row" id="unique_column_type_holder">
<label for="unique_column_type" class="col-sm-3 col-form-label">Unique column
type</label>
<div class="col-sm-9">
<select id="unique_column_type" name="unique_column_type" class="form-control"
aria-describedby="unique_column_type_help">
{% for columnType, columnName in config('csv.unique_column_options') %}
<option label="{{ columnName }}"
{% if configuration.getUniqueColumnType == columnType %}selected{% endif %}
value="{{ columnType }}">{{ columnName }}</option>
{% endfor %}
</select>
<small id="unique_column_type_help" class="form-text text-muted">
This field is only relevant for the "identifier-based" detection option.
Select
the type of value you expect in
the unique identifier. What must Firefly III search for?
</small>
</div>
</div>
{% endif %}
<h4>Other options</h4>
<div class="form-group row mb-3">
<div class="col-sm-3">Skip form</div>
<div class="col-sm-9">
<div class="form-check">
<input class="form-check-input"
{% if configuration.isSkipForm %}checked{% endif %} type="checkbox"
id="skip_form" name="skip_form" value="1" aria-describedby="skipHelp">
<label class="form-check-label" for="skip_form">
Yes
</label>
<small id="skipHelp" class="form-text text-muted">
<br>Skip the options the next time you import and go straight to processing.
</small>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<button type="submit" class="float-end btn btn-primary">Submit &rarr;</button>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="row mt-3">
<div class="col-lg-10 offset-lg-1">
<div class="card">
<div class="card-body">
<div class="btn-group btn-group-sm">
<a href="{{ route('back.upload') }}" class="btn btn-secondary"><span
class="fas fa-arrow-left"></span> Go back to upload</a>
<a href="{{ route('flush') }}" class="btn btn-danger btn-sm"><span
class="fas fa-redo-alt"></span> Start over</a>
</div>
</div>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p><p>&nbsp;</p>
{% endblock %}
{% block scripts %}
<script type="text/javascript">
// some basic triggers for the duplicate options.
var phpFormatRoute = '{{ route('004-configure.php_date') }}';
$(document).ready(function () {
updateDateExample();
linkToTriggers();
triggerDetectionMethod();
// date range
$('#date_range_partial_settings').hide();
$('#date_range_range_settings').hide();
$('.date-range-radio').on('change', updateRange);
updateRange();
});
function linkToTriggers() {
$('#duplicate_detection_method').on('change', triggerDetectionMethod);
}
function triggerDetectionMethod() {
var value = $('#duplicate_detection_method').val();
console.log('trigger change, value is')
console.log(value);
if ('none' === value) {
$('#unique_column_index_holder').hide();
$('#unique_column_type_holder').hide();
}
if ('classic' === value) {
$('#unique_column_index_holder').hide();
$('#unique_column_type_holder').hide();
}
if ('cell' === value) {
$('#unique_column_index_holder').show();
$('#unique_column_type_holder').show();
}
}
function updateRange() {
var check = $('input[name="date_range"]:checked');
if ('partial' === check.val()) {
$('#date_range_partial_settings').show();
$('#date_range_range_settings').hide();
}
if ('range' === check.val()) {
$('#date_range_partial_settings').hide();
$('#date_range_range_settings').show();
}
if ('all' === check.val()) {
$('#date_range_partial_settings').hide();
$('#date_range_range_settings').hide();
}
}
``
function updateDateExample() {
$('#date_example').text('...');
var format = $('#date').val();
$.getJSON(phpFormatRoute, {format: format}).done(function (data) {
$('#date_example').text(data.result);
}).fail(function () {
$('#date_example').text(':(');
});
}
$('#date').on('change', updateDateExample);
</script>
{% endblock %}