feat: better PDF

This commit is contained in:
2025-08-24 00:24:40 +02:00
parent 0267e6e578
commit 5b664234e9
18 changed files with 540 additions and 228 deletions

View File

@@ -8,9 +8,13 @@
<style>
{{ .Style }}
</style>
<style>
{{.Invoice.CSS}}
</style>
</head>
<body>
<header>
<header class="first-page" style="margin-top: 2cm">
<div class="company">
<h2>{{ .Company.Name }}</h2>
<p>
@@ -23,12 +27,12 @@
</div>
<div class="invoice-info">
<p>
<strong>Rechnung:</strong> {{ .ID }} <br />
<strong>Rechnung:</strong> {{ .Invoice.Reference }} <br />
<strong>Datum:</strong> {{ .Date | date }} <br />
</p>
</div>
</header>
<section class="client">
<section class="client first-page">
<h2>Rechnung an:</h2>
<p>
{{ .Client.Name }} <br />
@@ -38,90 +42,52 @@
</p>
</section>
<section class="page p1">
<section class="page p1 first-page">
<article>
<table>
<thead>
<tr>
<th>FID</th>
<th style="min-width: 3.5em">FID</th>
<th>Name</th>
<th>Zeitaufwand</th>
<th>Stundensatz</th>
<th>Preis CHF</th>
<th>Fertiggestellt</th>
<th>Aufwand</th>
<th style="min-width: 5.5em">Preis</th>
</tr>
</thead>
<tbody>
{{ range .Issues }}
<tr>
<td>{{ .Index }}</td>
<td style="font-family: monospace">{{ .Shorthand }}</td>
<td>{{ .Title }}</td>
<td>{{ .Duration | duration }}</td>
<td>16 CHF/h</td>
<td>{{ .Duration | price }} CHF</td>
<td>{{ .Closed | time }}</td>
</tr>
{{ end }}
</tbody>
</table>
<div class="totals">
<table>
<tfoot>
<tr>
<td>Gesamtbetrag:</td>
<td>{{ .Total }} CHF</td>
</tr>
</table>
</div>
</article>
<article class="qr-section">
<div class="qr-code">
<!-- Replace with your QR code image or generated SVG -->
<div class="qr-section-img">
<image src="{{ .QRInvoice }}"></image>
{{ .ChCross }}
</div>
<th colspan="2" style="text-align: right">Summe:</th>
<div class="qr-section-info">
<h4>Währung</h4>
<h4>Betrag</h4>
<p>CHF</p>
<p>{{ .Total}}</p>
</div>
</div>
<div class="payment-details">
<div>
<h4 style="margin-top: 0">Konto / Zahlbar an</h4>
<p>
{{ .Company.IBAN }} <br />
{{ .Company.Contact }} <br />
{{ .Company.Address.Street}} {{.Company.Address.Number}} <br />
{{ .Company.Address.ZIPCode }} {{ .Company.Address.Place }}
</p>
</div>
<div>
<h4>Referenz</h4>
<p></p>
</div>
<div>
<h4>Zahlbar durch</h4>
<p>
{{ .Client.Contact }} <br />
{{ .Client.Address.Street}} {{.Client.Address.Number}} <br />
{{ .Client.Address.ZIPCode }} {{ .Client.Address.Place }}
</p>
</div>
</div>
<td>{{ .Total | duration }}</td>
<td>{{ .Total | price}}</td>
</tr>
</tfoot>
</table>
</article>
{{ .Invoice.HTML }}
</section>
<section>
<h2>Details zu den Features</h2>
<h2 style="margin-top: 0">Details zu den Features</h2>
{{ range .Issues }}
<article>
<h3>{{ .Index }}: {{ .Title }}</h3>
{{ .Body | md | oh 3 }}
<div class="issue-title">
<h3>
<span style="font-family: monospace">{{ .Shorthand }}</span>: {{
.Title }}
</h3>
<p>Fertiggestellt: {{ .Closed | time }}</p>
</div>
{{ .CleanBody | md | oh 3 }}
</article>
{{ end }}
</section>