fix(statements): set envelope geometry for #9 double-window

Reset the statement window positions to the app's proven #9 (9x4)
double-window geometry, mirroring sales_invoice_ns.html — recipient
window at top:1.5in/left:1.125in. It previously copied the dunning
format's 1.9in, which sits too low for a #9. Tighten the body
padding-top to keep clearance below the higher window, and correct the
stale #10 references in the template comment and docs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-09 07:52:07 -04:00
parent 326adf865a
commit 0aefdeb5ff
3 changed files with 10 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
> Branch: `feature/customer-statements`
Generates printable, **one-page-per-customer** account statements — formatted to
fit a standard #10 **double-window envelope** — for customers with overdue
fit a standard #9 (9x4) **double-window envelope** — for customers with overdue
invoices, and (optionally) bills a **late-payment fee** that posts to the ledger
and is collectible through the app's existing payment flow.

View File

@@ -202,6 +202,9 @@ def _wrap_document(pages):
overflow: hidden;
}}
.statement-page:last-of-type {{ page-break-after: auto; }}
/* Window positions match the app's proven #9 (9x4) double-window envelope
geometry — recipient window at top:1.5in/left:1.125in, mirroring
sales_invoice_ns.html ("9x4 envelope position"). */
.return-window {{
position: absolute; top: 0.55in; left: 0.6in;
width: 3.5in; font-size: 11px; line-height: 1.3;
@@ -212,11 +215,11 @@ def _wrap_document(pages):
}}
.doc-header .doc-title {{ font-size: 20px; font-weight: bold; letter-spacing: 1px; }}
.recipient-window {{
position: absolute; top: 1.9in; left: 1.125in;
position: absolute; top: 1.5in; left: 1.125in;
width: 4.5in; height: 1.25in; font-size: 15px; line-height: 1.15em;
overflow: hidden;
}}
.statement-body {{ padding: 3.35in 0.6in 0.6in 0.6in; }}
.statement-body {{ padding: 2.95in 0.6in 0.6in 0.6in; }}
.intro {{ font-size: 12px; margin-bottom: 12px; }}
table.items, table.aging {{ width: 100%; border-collapse: collapse; }}
table.items th, table.items td,

View File

@@ -1,7 +1,8 @@
{# One customer account statement = one printed page.
Envelope geometry (recipient window at top:1.9in / left:1.125in) mirrors the
existing double-window print formats so the same #10 double-window envelopes
work. Rendered via frappe.render_template with context key `s`
Envelope geometry (recipient window at top:1.5in / left:1.125in) mirrors the
app's proven #9 (9x4) double-window print format (sales_invoice_ns.html) so
the same #9 double-window envelopes work. Rendered via
frappe.render_template with context key `s`
(see ns_app.api.statements.get_statement_data). #}
{% set fmt = frappe.utils.fmt_money %}
<div class="statement-page">