{% extends "base.html" %} {% block content %}
{# Previous month link #} {% with pm=prev_month %} {% if pm.year and pm.month %} ← Previous {% else %} ← Previous {% endif %} {% endwith %}

{{ year }} - {{ month_name }} (Sheet {{ month }}/6)

{# Next month link #} {% with nm=next_month %} {% if nm.year and nm.month %} Next → {% else %} Next → {% endif %} {% endwith %} Go to Summary

Table 1: Top Left

{% for header in top_left_headers %} {% endfor %} {% for row in top_left_rows %} {% with rownum=forloop.counter %} {% for cell in row.cells %} {% if is_start_sheet or rownum == 1 or rownum == 5 or rownum == 6 %} {# Editable in start sheet OR always editable rows (B3, B7, B8) #} {% else %} {# Readonly for non-start sheets #} {% endif %} {% endfor %} {% endwith %} {% endfor %}
Row Label{{ header }}Sum
{% if rownum == 1 %} Stand der Gaszähler (Nm³) {% elif rownum == 2 %} Stand der Gaszähler (Vormonat) (Nm³) {% elif rownum == 3 %} Gasrückführung (Nm³) {% elif rownum == 4 %} Rückführung flüssig (Lit. L-He) {% elif rownum == 5 %} Sonderrückführungen (Lit. L-He) {% elif rownum == 6 %} Bestand in Kannen-1 (Lit. L-He) {% elif rownum == 7 %} Summe Bestand (Lit. L-He) {% elif rownum == 8 %} Best. in Kannen Vormonat (Lit. L-He) {% elif rownum == 9 %} Bezug (Liter L-He) {% elif rownum == 10 %} Rückführ. Soll (Lit. L-He) {% elif rownum == 11 %} Verluste (Soll-Rückf.) (Lit. L-He) {% elif rownum == 12 %} Füllungen warm (Lit. L-He) {% elif rownum == 13 %} Kaltgas Rückgabe (Lit. L-He) – Faktor {% elif rownum == 14 %} Faktor 0.06 {% elif rownum == 15 %} Verbraucherverluste (Liter L-He) {% elif rownum == 16 %} % {% elif rownum == 17 %} Gesamtrückführung (Nm³) {% elif rownum == 18 %} Aufgeteilte Verluste (Liter L-He) {% endif %} {{ cell.value|default:"" }} {{ cell.value|default:"" }} {{ row.sum|default_if_none:"" }}

Table 2: Top Right

{% for header in top_right_headers %} {% endfor %} {% for row in top_right_rows %} {% with rownum=forloop.counter %} {% for cell in row.cells %} {% with client_name=cell.client.name|default:"" %} {# Determine if this cell should be editable #} {% if is_start_sheet %} {% elif rownum == 4 or rownum == 6 or rownum == 1 and client_name in "M3 Thiele,M3 Buntkowsky,M3 Gutfleisch" %} {% else %} {% endif %} {% endwith %} {% endfor %} {% endwith %} {% endfor %}
Row Label{{ header }}Sum
{% if rownum == 1 %} Stand der Gaszähler (Vormonat) (Nm³) {% elif rownum == 2 %} Gasrückführung (Nm³) {% elif rownum == 3 %} Rückführung flüssig (Lit. L-He) {% elif rownum == 4 %} Sonderrückführungen (Lit. L-He) {% elif rownum == 5 %} Sammelrückführungen (Lit. L-He) {% elif rownum == 6 %} Bestand in Kannen-1 (Lit. L-He) {% elif rownum == 7 %} Summe Bestand (Lit. L-He) {% elif rownum == 8 %} Best. in Kannen Vormonat (Lit. L-He) {% elif rownum == 9 %} Bezug (Liter L-He) {% elif rownum == 10 %} Rückführ. Soll (Lit. L-He) {% elif rownum == 11 %} Verluste (Soll-Rückf.) (Lit. L-He) {% elif rownum == 12 %} Füllungen warm (Lit. L-He) {% elif rownum == 13 %} Kaltgas Rückgabe (Lit. L-He) – Faktor {% elif rownum == 14 %} Faktor 0.06 {% elif rownum == 15 %} Verbraucherverluste (Liter L-He) {% elif rownum == 16 %} % {% endif %} {{ cell.value|default:"" }} {{ cell.value|default:"" }} {% if rownum == 2 %} Aufteilung Nach Verbrauch {% else %} {{ cell.value|default:"" }} {% endif %} {{ row.sum|default_if_none:"" }}

Gesamtsumme (Top Left + Top Right)

{% for row in summary_rows %} {% endfor %}
Row Label Σ
{{ row.label }} {{ row.sum|default_if_none:"" }}

Bottom Table 1 – Gasspeicher

{% for row in cells_by_table.bottom_1 %} {% with rownum=forloop.counter %} {% for cell in row %} {% if forloop.counter0 < 5 %} {% if forloop.counter0 == 0 %} {# Volumen – fixed, not editable #} {% elif forloop.counter0 == 1 %} {# bar – editable only for rows 1–9 (not Gasbestand) #} {% if rownum < 10 %} {% else %} {% endif %} {% else %} {# korrigiert, Nm³, Lit. LHe – calculated, not editable #} {% endif %} {% endif %} {% endfor %} {% endwith %} {% endfor %}
Gasspeicher Volumen bar korrigiert Nm³ Lit. LHe
{% if rownum == 1 %}Batterie 1 {% elif rownum == 2 %}2 {% elif rownum == 3 %}3 {% elif rownum == 4 %}4 {% elif rownum == 5 %}5 {% elif rownum == 6 %}6 {% elif rownum == 7 %}2 Bündel {% elif rownum == 8 %}2 Ballone {% elif rownum == 9 %}Reingasspeicher {% elif rownum == 10 %}Gasbestand {% endif %} {% if cell.value %} {{ cell.value }} {% else %} {% if rownum == 1 %}2,4 {% elif rownum == 2 %}5,1 {% elif rownum == 3 %}4,0 {% elif rownum == 4 %}1,0 {% elif rownum == 5 %}4,0 {% elif rownum == 6 %}0,4 {% elif rownum == 7 %}1,2 {% elif rownum == 8 %}20,0 {% elif rownum == 9 %}5,0 {% endif %} {% endif %} {{ cell.value|default:"" }} {{ cell.value|default:"" }} {{ cell.value|default:"" }}

Bottom Table 2 – Verbraucherbestand L-He

{# Excel row 38: header line with J38/K38 #} {# Excel row 39: + Anlage – G39 / I39 are the ONLY editable inputs #} {% with cell=cells_by_table.bottom_2.0.0 %} {% endwith %} {% with cell=cells_by_table.bottom_2.0.1 %} {% endwith %} {# Excel row 40: + Kaltgas – all calculated #} {# Excel row 43: Bestand flüssig He – uses K38..K40 #} {# Excel row 44: Gesamtbestand neu – Gasbestand (bottom 1) + K43 #}
Verbraucherbestand L-He
+ Anlage Gefäss 2,5 {{ cell.value|default:"" }} Gefäss 1,0 {{ cell.value|default:"" }}
+ Kaltgas Gefäss 2,5 Gefäss 1,0
Bestand flüssig He
Gesamtbestand neu

Bottom Table 3 – Bilanz

{# Row 46: Gesamtbestand Vormonat #} {# J46 comes from bottom_3 row 0, col 3 #} {% with cell=cells_by_table.bottom_3.0.3 %} {% endwith %} {# K46 comes from bottom_3 row 0, col 4 (prev month K44) #} {% with cell=cells_by_table.bottom_3.0.4 %} {% endwith %} {# Row 47: + Verbrauch / Anlage #} {% with cell=cells_by_table.bottom_3.1.1 %} {% endwith %} {% with cell=cells_by_table.bottom_3.1.2 %} {% endwith %} {# Row 48: K48 = K46 + K47, J48 = K48 * 0.75 #} {# Row 49: K49 = current month K44, J49 = K49 * 0.75 (will fill via JS) #} {# Row 50: I50 editable, J50/K50 readonly #} {% with cell=cells_by_table.bottom_3.4.2 %} {% endwith %} {# Row 51: K51 = K48 - K49 - K50, J51 = K51 * 0.75 #} {# Row 52: K52 = Verbraucherverluste (aus Übersicht), J52 = K52 * 0.75 #} {# Row 53: J53 = J51 - J52, K53 = K51 - K52 #}
Bezeichnung F G I Nm³ (J) Lit. L-He (K)
Gesamtbestand Vormonat {{ cell.value|default:"" }} {% if prev_summary %} {{ prev_summary.gesamtbestand_neu_lhe|default_if_none:'' }} {% endif %}
+ Verbrauch / Anlage {{ cell.value|default:"" }} {{ cell.value|default:"" }}
Gesamtbestand inkl. Anlage
Gesamtbestand (akt. Monat)
Verbrauch Sonstiges {{ cell.value|default:"" }}
Differenz Bestand
Verbraucherverluste (aus Übersicht)
Differenz Bilanz
Saved cells Calculated cells
{% endblock %}