{% extends "base.html" %} {% block title %}Wartungs-Plan{% endblock %} {% block heading %}🔧 Maschinen-Wartungs-Plan{% endblock %} {% block breadcrumb %}

Werkstatt / Wartung

{% endblock %} {% block topbar_actions %} {% if due_count and due_count > 0 %} ⚠ {{ due_count }} fällig{% if due_count != 1 %}{% endif %} {% endif %} {% endblock %} {% block content %}
Filter zurücksetzen

{{ tasks|length }} Wartungs-Task{% if tasks|length != 1 %}s{% endif %}

Sortiert nach Fälligkeit · Stunden-basiert wird live aus den time_entries der Maschine gerechnet

{% for t in tasks %} {% set st = t.status_info %} {% set color = '#10b981' %} {% if st.status == 'warn' %}{% set color = '#f59e0b' %}{% endif %} {% if st.status == 'overdue' %}{% set color = '#ef4444' %}{% endif %} {% else %} {% endfor %}
Maschine Task Intervall Letzter Termin Fortschritt Status
{{ t.machine_name or '?' }} {{ t.name }} {% if t.external_provider %}
extern: {{ t.external_provider }}
{% endif %}
{% if t.interval_kind == 'hours' %}{{ t.interval_value|round(1) }} h{% endif %} {% if t.interval_kind == 'days' %}{{ t.interval_value|round|int }} Tage{% endif %} {% if t.interval_kind == 'months' %}{{ t.interval_value|round|int }} Monate{% endif %} {% if t.interval_kind == 'cycles' %}{{ t.interval_value|round|int }} Zyklen{% endif %} {% if t.last_done_at %} {{ t.last_done_at[:10] }} {% if t.last_done_value %}
bei {{ t.last_done_value|round(1) }}
{% endif %} {% else %} — noch nie — {% endif %}
{% if st.ratio_pct is not none %}
{{ st.ratio_pct|round|int }} % {% if st.hours_since_done is defined %} · {{ st.hours_since_done|round|int }} h{% endif %} {% if st.cycles_since_done is defined %} · {{ st.cycles_since_done }} Zyk{% endif %} {% if st.days_to_due is defined %} {% if st.days_to_due > 0 %} · in {{ st.days_to_due|round|int }} T{% else %} · {{ (st.days_to_due*-1)|round|int }} T überfällig{% endif %} {% endif %}
{% endif %}
{% if st.status == 'ok' %}OK{% endif %} {% if st.status == 'warn' %}Bald fällig{% endif %} {% if st.status == 'overdue' %}Überfällig{% endif %} {% if st.status == 'unknown' %}—{% endif %}
Erledigt ✓
Keine Wartungs-Tasks angelegt — oben „+ Wartungs-Task" anklicken um den ersten anzulegen.

Hinweis: Stunden-basierte Tasks zählen automatisch alle Arbeits- und Rüstzeiten (entry_type=work/setup) auf der Maschine seit der letzten Wartung. Zyklen-basierte Tasks summieren parts_good aus production_jobs. Tage/Monate-basierte Tasks vergleichen das letzte Wartungs-Datum mit heute.

{% endblock %}