fix(erpsetup): top room for the Vertragsbedingungen block on page 2
ci / shared (pull_request) Successful in 12s
ci / test (pull_request) Successful in 24m38s
ci / image (pull_request) Skipped

With page-break-inside: avoid (#96) the block moves whole to page 2, which
has no letter head, so it sat flush against the top edge. Give the wrapper
28px top padding. Padding rather than margin: wkhtmltopdf drops a margin at
a page break. When the block fits on page 1 it only widens the gap after
the totals a little.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KYcAAeTw22GE9QPzDM8yc4
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-28 09:22:09 +01:00
1 parent 950e81c43e
commit 212b1b30d0
1 file changed
+3 -1
+3 -1
View File
@@ -288,7 +288,9 @@ var documentHTML = brand.Replace(`{%- set is_inv = doc.doctype == "Sales Invoice
document discount. -#}
{%- set line_discount = 0 - (doc.items | selectattr("rate", "lt", 0) | sum(attribute="amount")) if doc.items else 0 -%}
{%- set total_discount = net_discount + line_discount -%}
<div style="page-break-inside:avoid;">
{#- padding, not margin: wkhtmltopdf drops a margin at a page break, and the
block usually moves whole to page 2, which has no letter head. -#}
<div style="page-break-inside:avoid;padding-top:28px;">
<p class="sepa-head"><b>Vertragsbedingungen</b></p>
<table class="meta" style="margin-top:2px;page-break-inside:avoid;">
<tr><td class="k">Vertragsart</td><td>Monatlich wiederkehrende SaaS- und Hosting-Leistungen (Abonnement).</td></tr>