{% extends "base.html" %} {% block title %}{{ t(m.title) }} — {{ t('Data Import') }}{% endblock %} {% block content %}
{{ t('Data Import') }} · {{ t(m.title) }}

{{ t('Match columns') }}

{{ meta.filename }} · {{ rows|length }} {{ t('rows') }} · {{ header|length }} {{ t('columns') }}
{% if result %} {% set ok = not result.errors %}
{% if ok %}

{{ t('Ready to import') }}

{{ result.created }} {{ t('to create') }}{% if result.updated %}, {{ result.updated }} {{ t('to update') }}{% endif %}{% if result.skipped %}, {{ result.skipped }} {{ t('skipped (already imported or empty)') }}{% endif %}.

{% else %}

{{ t('Problems to fix') }}: {{ result.errors|length }}{% if result.errors|length >= 300 %}+{% endif %}

{{ t('Nothing has been saved. Correct the file (or the column matching) and check again.') }}

{% for row_no, msg in result.errors[:300] %}{% endfor %}
{{ t('Row') }}{{ t('Problem') }}
{{ row_no }}{{ msg }}
{% endif %} {% if result.notes %}{% endif %}
{% if result.preview and ok %}
{% for c in preview_cols %}{% endfor %}{% for r in result.preview %}{% for v in r %}{% endfor %}{% endfor %}
{{ t(c) }}
{{ '{:,.2f}'.format(v) if v is float else (v if v is not none else '') }}
{% if result.created + result.updated > result.preview|length %}
{{ t('First') }} {{ result.preview|length }} {{ t('of') }} {{ result.created + result.updated }}
{% endif %}
{% endif %} {% endif %}

{{ t('Options') }}

{% if cutoff %}
{{ t('The last day in the old system. Balances are posted on this date.') }}
{% endif %} {% if branched %}
{{ t('Used for rows without a branch.') }}
{% endif %} {% if dated %}
{{ t('Real Excel dates and YYYY-MM-DD are always recognised.') }}
{% endif %} {% if kind in ('open_items', 'invoices') %}
{% endif %} {% if kind in ('partners', 'payments') %}
{% endif %} {% if kind == 'opening' %}
{% endif %} {% if sheets|length > 1 %}
{% endif %}
{% if master %}
{% endif %} {% if kind in ('opening', 'open_items', 'entries', 'invoices', 'payments') %}
{% endif %} {% if documents %}
{% endif %}
{% if kind == 'opening' %}
{{ t('Detail imported separately') }}
{{ t('The balances of these control accounts go to Opening Balance Clearing (3990); the detail imports post the other side.') }}
{% if has('inventory') %}
{% endif %} {% if has('assets') %}
{% endif %}
{% endif %}
{% for f in m.fields %}{% set col = mapping.get(f.key) %} {% endfor %}
{{ t('Lubwise field') }}{{ t('Column in your file') }}{{ t('First value') }}
{{ t(f.label) }}{% if f.required %} *{% endif %}{% if f.help %}
{{ t(f.help) }}
{% endif %}
{% if col is not none and rows %}{{ rows[0][col] }}{% endif %}
{{ t('Cancel') }} {{ t('Check runs the whole import and then discards it, so you see every problem first.') }}

{{ t('File preview') }}

{% for h in header %}{% endfor %}{% for r in rows[:8] %}{% for c in r %}{% endfor %}{% endfor %}
{{ t('Row') }}{{ h }}
{{ r.line }}{{ c }}
{% if rows|length > 8 %}
{{ t('First') }} 8 {{ t('of') }} {{ rows|length }}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}