{% extends "base.html" %} {% block content %}

{{ t('quality_title') }}

{{ t('quality_intro') }}

{{ t('quality_gaps') }}

{% macro gaptable(title, rows, cols) %} {# rows carrying _kind/_key (set in quality.py) get a per-row "Passt so" button: the finding is reviewed-as-correct and stays hidden — keyed by natural key, not by row id #} {% set dismissable = rows and rows[0]._kind is defined %}
{{ title }} {{ rows|length }} {% if rows %}
{% for c in cols %}{% endfor %}{% if dismissable %}{% endif %} {% for r in rows[:80] %} {% for c in cols %}{% endfor %} {% if dismissable %} {% endif %} {% endfor %} {% if rows|length > 80 %}{% endif %}
{{ c }}
{{ r[c] if r[c] is not none else '' }}
{{ t('quality_more', n=rows|length - 80) }}
{% endif %}
{% endmacro %} {{ gaptable(t('gap_depart_before_arrival'), q.gaps.depart_before_arrival, ['stay_id','source_sheet','name','arrival','departure']) }} {{ gaptable(t('gap_charges_without_money'), q.gaps.charges_without_money, ['charge_id','room','name','period_from','period_to']) }} {{ gaptable(t('gap_client_without_address'), q.gaps.client_without_address, ['name','as_payer','as_employer']) }} {{ gaptable(t('gap_address_has_name'), q.gaps.address_has_name, ['client_id','company','name','address','postcode','city']) }} {{ gaptable(t('gap_implausible_qty'), q.gaps.implausible_quantities, ['charge_id','room','name','period_from','period_to','quantity','amount']) }} {{ gaptable(t('gap_rnr_unlinked'), q.gaps.rnr_unlinked, ['charge_id','room','name','period_from','rnr']) }} {{ gaptable(t('gap_duplicate_numbers'), q.gaps.duplicate_invoice_numbers, ['unit','number','n','ids']) }} {{ gaptable(t('gap_number_year'), q.gaps.number_year_mismatch, ['unit','number','date']) }} {{ gaptable(t('gap_open_items'), q.gaps.open_items, ['room','name','period_from','amount']) }} {{ gaptable(t('gap_register_ledger'), q.gaps.register_ledger_mismatch, ['room','name','sheet_number','arrival','departure','ledger_from','ledger_to']) }} {{ gaptable(t('gap_gb_ref_unknown'), q.gaps.gb_ref_unknown, ['charge_id','room','name','period_from','gb_ref','missing']) }} {{ gaptable(t('gap_never_billed'), q.gaps.register_never_billed, ['sheet_number','room','name','arrival','departure']) }} {{ gaptable(t('gap_betrag_formula'), q.gaps.betrag_off_formula, ['room','name','period_from','quantity','gross_per_unit','persons','betrag','calc']) }} {{ gaptable(t('gap_tvb_stale_open'), q.gaps.tvb_stale_open, ['room','name','sheet_number','arrival']) }} {{ gaptable(t('gap_no_departure'), q.gaps.register_no_departure, ['name','arrival']) }}

{{ t('quality_suggestions') }}

{{ t('quality_suggestions_hint') }}

{% for s in q.suggestions.companies %}
{{ s.a }} ~ {{ s.b }} {{ t('btn_open') }}
{% else %}

{{ t('quality_no_company_suggestions') }}

{% endfor %} {% for s in q.suggestions.guests %}
{{ t('quality_guest') }}: {{ s.a }} ~ {{ s.b }}
{% endfor %} {% endblock %}