details.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {% extends "base/base.html" %}
  2. {% block content %}
  3. <div class="card mb-3">
  4. <div class="card-body">
  5. <h5 class="card-title">Rechnung {{ forderung.rechnungsnummer }}</h5>
  6. <p>Kunde: {{ forderung.kunde.name if forderung.kunde else '' }}</p>
  7. <p>Betrag: {{ forderung.betrag }}</p>
  8. <p>Fälligkeit: {{ forderung.faelligkeit }}</p>
  9. <div class="mt-3">
  10. <a class="btn btn-outline-secondary me-2" href="/detail/{{ forderung.id }}/export/docx">Export DOCX</a>
  11. <a class="btn btn-outline-primary" href="mailto:?subject=Rechnung%20{{ forderung.rechnungsnummer }}&body=Sie%20finden%20Details%20unter%20{{ request.url }}">E-Mail (mailto)</a>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="card">
  16. <div class="card-body">
  17. <h6>Neue Bemerkung</h6>
  18. <form method="post" action="/detail/{{ forderung.id }}/bemerkung">
  19. <div class="mb-2">
  20. <textarea name="bemerkung" class="form-control" rows="3"></textarea>
  21. </div>
  22. <div class="mb-2">
  23. <label>Wiedervorlage</label>
  24. <input type="date" name="wiedervorlage_datum" class="form-control" />
  25. </div>
  26. <button class="btn btn-primary" type="submit">Speichern</button>
  27. <a class="btn btn-secondary ms-2" href="/forderungen">Zurück</a>
  28. </form>
  29. </div>
  30. </div>
  31. {% if forderung.bemerkungen %}
  32. <div class="mt-3">
  33. <h5>Bemerkungen</h5>
  34. <ul class="list-group">
  35. {% for b in forderung.bemerkungen %}
  36. <li class="list-group-item">{{ b.zeitstempel }} - {{ b.benutzer }}: {{ b.bemerkung }} {% if b.wiedervorlage_datum %} (WV: {{ b.wiedervorlage_datum }}){% endif %}</li>
  37. {% endfor %}
  38. </ul>
  39. </div>
  40. {% endif %}
  41. <h2>Forderung Details</h2>
  42. <table class="table table-striped">
  43. <tbody>
  44. {% for row in forderung_kopf %}
  45. {% for value in row %}
  46. <tr>
  47. <th>{{ loop.index }}</th>
  48. <td>{{ value }}</td>
  49. </tr>
  50. {% endfor %}
  51. {% endfor %}
  52. </tbody>
  53. </table>
  54. <h2>Kommentare</h2>
  55. <table class="table table-striped">
  56. <thead>
  57. <tr>
  58. <th>Timestamp</th>
  59. <th>Name</th>
  60. <th>Rolle</th>
  61. <th>Begründung</th>
  62. <th>Wiedervorlage</th>
  63. <th>Kommentar</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. {% for row in forderung_kommentar %}
  68. <tr>
  69. <td>{{ row.Timestamp|date_format }}</td>
  70. <td>{{ row.Name }}</td>
  71. <td>{{ row.Rolle }}</td>
  72. <td>{{ row.Begründung }}</td>
  73. <td>{{ row.Wiedervorlage }}</td>
  74. <td>{{ row.Kommentar }}</td>
  75. </tr>
  76. {% endfor %}
  77. </tbody>
  78. </table>
  79. <h2>Mahnungen</h2>
  80. <table class="table table-striped">
  81. <thead>
  82. <tr>
  83. <th>Kunde_Nr</th>
  84. <th>Mahnung_Nr</th>
  85. <th>Mahndatum</th>
  86. <th>Mahnstufe</th>
  87. <th>Rechnung_Nr</th>
  88. <th>Rechnung_Datum</th>
  89. <th>Betrag</th>
  90. <th>Offen</th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. {% for row in forderung_mahnung %}
  95. <tr>
  96. <td>{{ row.Kunde_Nr }}</td>
  97. <td>{{ row.Mahnung_Nr }}</td>
  98. <td>{{ row.Mahndatum|date_format }}</td>
  99. <td>{{ row.Rechnung_Nr }}</td>
  100. <td>{{ row.Rechnung_Datum|date_format }}</td>
  101. <td>{{ row.Betrag|number_format }}</td>
  102. <td>{{ row.Offen|number_format }}</td>
  103. </tr>
  104. {% endfor %}
  105. </tbody>
  106. </table>
  107. <h2>Auftragspositionen</h2>
  108. <table class="table table-striped">
  109. <thead>
  110. <tr>
  111. <th>Auftrag_Nr</th>
  112. <th>Auftrag_Position</th>
  113. <th>Betrag</th>
  114. </tr>
  115. </thead>
  116. <tbody>
  117. {% for row in auftrag_positionen %}
  118. <tr>
  119. <td>{{ row.Auftrag_Nr }}</td>
  120. <td>{{ row.Auftrag_Position }}</td>
  121. <td>{{ row.Betrag|number_format }}</td>
  122. </tr>
  123. {% endfor %}
  124. </tbody>
  125. </table>
  126. {% endblock %}