Remove redundant shift speed section

This commit is contained in:
admin committed 2026-10-20 16:15:19 +02:00
1 parent f6ebd78a4a
commit 71eae0600d
6 files changed
+10 -19

No files matched your search

+3 -2
View File
@@ -277,8 +277,9 @@ Speed always uses the approximate FA windows.
The shift report's production table uses these same FA windows and KPI results
for each listed order. Its speed describes the FA's estimated period; material
uses the configured segment or order-aware source rule. The shift-wide speed and
material sections remain useful reconciliation totals. In HTML, the FA number
uses the configured segment or order-aware source rule. The shift-wide material
section remains available as a reconciliation total; the shift-wide speed
summary stays in the report model but is not rendered. In HTML, the FA number
links directly to `/order?production_order=...` for the order's full shift list.
The PDF prints the FA number as text.
@@ -201,17 +201,6 @@ def present_report(
story.append(
MaterialPieBlock(labels, tuple(quantity for _, _, quantity in positive_materials))
)
text("Liniengeschwindigkeit", "Heading2")
if report.speed is None:
text("Für diese Maschine nicht verfügbar.")
else:
speed = report.speed.average_line_speed_m_min
text(
"Durchschnittliche Liniengeschwindigkeit im Lauf: "
+ (f"{_number(speed)} m/min" if speed is not None
else "Nicht verfügbar (keine Laufdaten).")
)
return tuple(story)
+1 -1
View File
@@ -260,7 +260,7 @@ def test_partial_capabilities_skip_disabled_sources_and_render_unavailable(
blocks = present_report(report)
unavailable = [b for b in blocks if isinstance(b, TextBlock)
and b.text == "Für diese Maschine nicht verfügbar."]
assert len(unavailable) == (2 if downtime else 3)
assert len(unavailable) == (1 if downtime else 2)
def test_downtime_only_machine_does_not_query_production():
+2
View File
@@ -44,6 +44,8 @@ def test_production_rows_show_attributed_kpis_and_link_fa_to_detail():
assert '<td>10,24 m/min</td>' in html
assert '<td>3.317,58 kg</td>' in html
assert '<th scope="col">Details</th>' not in html
assert "Durchschnittliche Liniengeschwindigkeit im Lauf" not in html
assert "<h2>Liniengeschwindigkeit</h2>" not in html
def test_production_kpis_distinguish_unavailable_from_zero():
+3 -4
View File
@@ -48,15 +48,14 @@ def test_stable_model_required_labels_and_supplied_quantities():
"Zeit ohne erfassten Stillstand",
"Materialverbrauch",
"42,00 kg",
"Liniengeschwindigkeit im Lauf",
"order",
"article",
"description",
):
assert label in text
assert "Produktionszeit" not in text
value = replace(value, speed=replace(value.speed, average_line_speed_m_min=12.345))
assert "12,35 m/min" in content(value)
assert "Liniengeschwindigkeit im Lauf" not in text
assert "Durchschnittliche Liniengeschwindigkeit" not in text
def test_production_pdf_table_contains_attributed_kpis_as_plain_text():
@@ -72,6 +71,7 @@ def test_production_pdf_table_contains_attributed_kpis_as_plain_text():
assert table.rows[1][-2:] == ("—", "0,00 kg")
assert table.rows[0][0] == "12026001032"
assert "Materialverbrauch gesamt: 42,00 kg" in content(value)
assert "Liniengeschwindigkeit im Lauf" not in content(value)
assert render_pdf(value).startswith(b"%PDF-")
@@ -110,7 +110,6 @@ def test_empty_sections_and_zero_totals():
"Keine Stillstandsgründe vorhanden.",
"Keine Stillstandsereignisse vorhanden.",
"Keine Materialverbrauchsdaten vorhanden.",
"keine Laufdaten",
"Gesamtmenge: 0,00 m²",
"Rollen gesamt: 0",
):
+1 -1
View File
@@ -111,12 +111,12 @@ def test_default_and_render(application):
"42,00 kg",
"description",
"Ohne Stillstandsgrund",
"Nicht verfügbar",
"Datenstand: 14.10.2026 15:46:00 CEST",
"Europe/Berlin",
"Als PDF exportieren",
):
assert expected in text
assert "Durchschnittliche Liniengeschwindigkeit im Lauf" not in text
assert headers["Cache-Control"] == "no-store"