<script lang="ts">
  
  import { A13BerechnungRechnerischeLaufzeitHeizung } from "#lib/Berechnungen/BedarfsausweisWohnen/A13BerechnungRechnerischeLaufzeitHeizung.js";
  
  $: result = A13BerechnungRechnerischeLaufzeitHeizung();
</script>


<div class="overflow-x-auto mt-16">
    <table class="table-auto border-collapse border border-gray-300 w-full text-left">
      <thead>
        <tr class="bg-gray-200 text-left">
          <th colspan="6" class="border border-gray-300 p-2">
            <h2>Tabelle A.13 — Heizung – Berechnung der rechnerischen Laufzeit</h2>
          </th>
        <tr class="text-center">
          <tr class="bg-gray-200 text-left">
            <th colspan="6" class="border border-gray-300 p-2 text-xl">
              Rechnerische Laufzeit Heizung
            </th>
          </tr> 
          <tr class="text-center">
            <th class="border border-gray-300 px-4 py-2">Monat</th>
            <th class="border border-gray-300 px-4 py-2">t<sub>h</sub> [h] (aus Tabelle A.12)<br>(1)</th>
            <th class="border border-gray-300 px-4 py-2">f<sub>WE</sub> [-]<br>(2)</th>
            <th class="border border-gray-300 px-4 py-2">t<sub>rL</sub> [h] (EFH)<br>(3)</th>
            <th class="border border-gray-300 px-4 py-2">t<sub>rL</sub> [h] (MFH)<br>(3)</th>
            <th class="border border-gray-300 px-4 py-2">t<sub>h,rL</sub> [h]<br>(4) = (1) · (2) · (3)</th>
          </tr>
      </thead>
      <tbody>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Januar</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Januar)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">19,86</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[0])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Februar</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Februar)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">18,58</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[1])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">März</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Maerz)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">18,69</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[2])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">April</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.April)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,25</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[3])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Mai</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Mai)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[4])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Juni</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Juni)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[5])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Juli</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Juli)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[6])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">August</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.August)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[7])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">September</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.September)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[8])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Oktober</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Oktober)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,16</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[9])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">November</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.November)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">18,88</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[10])}</td>
        </tr>
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Dezember</td>
          <td class="border border-gray-300 px-4 py-2 bg-yellow-100">{Math.round(result.heizstunden.Dezember)}</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">0,042</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">17,00</td>
          <td class="border border-gray-300 px-4 py-2 bg-gray-100">19,90</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeiten[11])}</td>
        </tr> 
        <tr class="text-center">
          <td class="border border-gray-300 px-4 py-2">Jahressumme</td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.heizstundenGesamt)}</td>
          <td class="border border-gray-300 px-4 py-2"></td>
          <td class="border border-gray-300 px-4 py-2"></td>
          <td class="border border-gray-300 px-4 py-2"></td>
          <td class="border-2 border-gray-600 px-4 py-2">{Math.round(result.rechnerischeLaufzeitGesamt)}</td>
        </tr>
      </tbody>
    </table>
  </div>