diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-09-12 17:05:11 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-09-12 17:05:11 +0700 |
| commit | 43e1e37ec252e6f46e885cb5055f69a3b01ba9d1 (patch) | |
| tree | 771e13b482ba5d1b6de4f372681d56d059d43c9e | |
| parent | d62c1d36de434fc2c40984d1b860c424bc6ce241 (diff) | |
push po report
| -rw-r--r-- | indoteknik_custom/report/purchase_report.xml | 137 |
1 files changed, 96 insertions, 41 deletions
diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml index 275dd526..265db28b 100644 --- a/indoteknik_custom/report/purchase_report.xml +++ b/indoteknik_custom/report/purchase_report.xml @@ -27,16 +27,80 @@ <template id="report_purchaseorder_website_document"> <t t-call="web.html_container"> - <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" /> + <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/> - <!-- HEADER LOGO --> - <div style="margin-bottom:20px;"> - <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2498521" - style="width:100%; height:auto; display:block;"/> - </div> + <!-- IMPORTANT: style harus ada di top-level template --> + <style> + /* Sesuaikan angka ini menurut tinggi header/footer image lo */ + /* margin-top harus = (kira-kira) tinggi header + spacing */ + @page { + size: A4; + margin: 140px 20px 110px 20px; /* top right bottom left */ + } + + html, body { + margin: 0; + padding: 0; + font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; + color: #222; + } + + /* Tarik header ke atas luar area konten */ + .report-header { + position: fixed; + top: -140px; /* NEGATIVE of @page margin-top */ + left: 0; + right: 0; + height: 120px; /* atur sesuai tinggi gambar header */ + z-index: 9999; + } + .report-header img { + display:block; + width:100%; + height:auto; + } + + /* Tarik footer ke bawah luar area konten */ + .report-footer { + position: fixed; + bottom: -110px; /* NEGATIVE of @page margin-bottom */ + left: 0; + right: 0; + height: 90px; /* atur sesuai tinggi gambar footer */ + z-index: 9999; + } + .report-footer img { + display:block; + width:100%; + height:auto; + } + + /* Konten utama berada di antara margin */ + .po-content { + font-size: 13px; + /* jangan kasih margin-top besar di sini; @page sudah atur ruang */ + } + + /* Biar <thead> diulang tiap halaman */ + thead { display: table-header-group; } + tfoot { display: table-footer-group; } - <div class="page"> + /* Hindari tabel terpotong di tengah baris */ + table { border-collapse: collapse; width:100%; } + tr { page-break-inside: avoid; break-inside: avoid; } + /* Styling kecil biar rapi */ + th, td { border:1px solid #ccc; padding:6px; vertical-align:top; } + th { background:#f2f2f2; font-weight:600; } + </style> + + <!-- HEADER (pakai div, bukan <header>) --> + <div class="report-header"> + <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2498521" alt="header"/> + </div> + + <!-- PAGE CONTENT --> + <div class="po-content"> <!-- TITLE --> <h2 style="text-align:center; margin:0; color:#d32f2f; font-weight:bold;"> PURCHASE ORDER @@ -45,8 +109,8 @@ No. <span t-field="doc.name"/> </h4> - <!-- TOP INFO (Term, Date, Responsible) --> - <table style="width:100%; margin-bottom:16px; font-size:14px;"> + <!-- TOP INFO --> + <table style="margin-bottom:16px; font-size:14px;"> <tr> <td><strong>Term Of Payment:</strong> <span t-field="doc.payment_term_id.name"/></td> <td><strong>Order Date:</strong> <span t-field="doc.date_order" t-options='{"widget": "date"}'/></td> @@ -54,17 +118,17 @@ </tr> </table> - <!-- VENDOR & DELIVERY SIDE BY SIDE --> - <table style="width:100%; margin-bottom:24px; border-collapse:separate; border-spacing:16px 0;"> + <!-- VENDOR & DELIVERY --> + <table style="margin-bottom:24px; border-collapse:separate; border-spacing:16px 0;"> <tr> - <td style="width:50%; border:1px solid #ccc; padding:8px; vertical-align:top;"> + <td style="width:50%; padding:8px;"> <strong>Alamat Pengiriman:</strong><br/> PT Indoteknik (Bandengan 1 Depan)<br/> Jl. Bandengan Utara Komp A 8 B<br/> RT. Penjaringan, Kec. Penjaringan, Jakarta (BELAKANG INDOMARET)<br/> JK 14440 - Indonesia </td> - <td style="width:50%; border:1px solid #ccc; padding:8px; vertical-align:top;"> + <td style="width:50%; padding:8px;"> <strong>Nama Vendor:</strong><br/> <span t-field="doc.partner_id.name"/><br/> <span t-field="doc.partner_id.street"/><br/> @@ -73,39 +137,29 @@ </tr> </table> - <!-- ORDER LINES TABLE --> - <table style="border-collapse:collapse; width:100%; margin-top:16px;"> + <!-- ORDER LINES --> + <table style="margin-top:16px;"> <thead> - <tr style="background:#f2f2f2;"> - <th style="border:1px solid #ccc; padding:4px;">Description</th> - <th style="border:1px solid #ccc; padding:4px; text-align:right;">Quantity</th> - <th style="border:1px solid #ccc; padding:4px; text-align:right;">Unit Price</th> - <th style="border:1px solid #ccc; padding:4px; text-align:right;">Taxes</th> - <th style="border:1px solid #ccc; padding:4px; text-align:right;">Subtotal</th> + <tr> + <th>Description</th> + <th style="text-align:right;">Quantity</th> + <th style="text-align:right;">Unit Price</th> + <th style="text-align:right;">Taxes</th> + <th style="text-align:right;">Subtotal</th> </tr> </thead> <tbody> <t t-foreach="doc.order_line" t-as="line"> <tr> - <td style="border:1px solid #ccc; padding:4px;"> - <span t-field="line.name"/> - </td> - <td style="border:1px solid #ccc; padding:4px; text-align:right;"> - <span t-field="line.product_qty"/> <span t-field="line.product_uom"/> - </td> - <td style="border:1px solid #ccc; padding:4px; text-align:right;"> - <span t-field="line.price_unit"/> - </td> - <td style="border:1px solid #ccc; padding:4px; text-align:right;"> - <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.taxes_id))"/> - </td> - <td style="border:1px solid #ccc; padding:4px; text-align:right;"> - <span t-field="line.price_subtotal"/> - </td> + <td><span t-field="line.name"/></td> + <td style="text-align:right;"><span t-field="line.product_qty"/> <span t-field="line.product_uom"/></td> + <td style="text-align:right;"><span t-field="line.price_unit"/></td> + <td style="text-align:right;"><span t-esc="', '.join(map(lambda x: (x.description or x.name), line.taxes_id))"/></td> + <td style="text-align:right;"><span t-field="line.price_subtotal"/></td> </tr> <t t-if="line.product_id.website_description"> <tr> - <td colspan="5" style="padding:8px 12px; font-size:11px; background:#fafafa; border-left:1px solid #ccc; border-right:1px solid #ccc;"> + <td colspan="5" style="padding:8px 12px; font-size:11px; background:#fafafa;"> <div t-raw="line.product_id.website_description"/> </td> </tr> @@ -136,12 +190,13 @@ </div> </div> - <!-- FOOTER IMAGE --> - <div style="margin-top:30px;"> - <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2859765" - style="width:100%; display:block;"/> + <!-- FOOTER (pakai div, bukan <footer>) --> + <div class="report-footer"> + <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2859765" alt="footer"/> </div> </t> </template> + + </odoo> |
