summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-09-12 17:10:38 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-09-12 17:10:38 +0700
commit5d016b74e3de4d83cbe91fae56f8dc01e7e87879 (patch)
tree2c9e2cda50b24be0e1a41ba98fda0ad0f948ad22
parent43e1e37ec252e6f46e885cb5055f69a3b01ba9d1 (diff)
push report po
-rw-r--r--indoteknik_custom/report/purchase_report.xml131
1 files changed, 39 insertions, 92 deletions
diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml
index 265db28b..cd8af78a 100644
--- a/indoteknik_custom/report/purchase_report.xml
+++ b/indoteknik_custom/report/purchase_report.xml
@@ -27,80 +27,17 @@
<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)" />
- <!-- 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; }
-
- /* 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"/>
+ <!-- Header -->
+ <div class="header">
+ <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2498521"
+ style="width:100%; display: block;"/>
</div>
+
<!-- PAGE CONTENT -->
- <div class="po-content">
+ <div class="article" style="margin: 0 1.5cm 0 1.5cm; ">
<!-- TITLE -->
<h2 style="text-align:center; margin:0; color:#d32f2f; font-weight:bold;">
PURCHASE ORDER
@@ -110,7 +47,7 @@
</h4>
<!-- TOP INFO -->
- <table style="margin-bottom:16px; font-size:14px;">
+ <table style="width:100%; 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>
@@ -119,16 +56,16 @@
</table>
<!-- VENDOR & DELIVERY -->
- <table style="margin-bottom:24px; border-collapse:separate; border-spacing:16px 0;">
+ <table style="width:100%; margin-bottom:24px; border-collapse:separate; border-spacing:16px 0;">
<tr>
- <td style="width:50%; padding:8px;">
+ <td style="width:50%; border:1px solid #ccc; padding:8px; vertical-align:top;">
<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%; padding:8px;">
+ <td style="width:50%; border:1px solid #ccc; padding:8px; vertical-align:top;">
<strong>Nama Vendor:</strong><br/>
<span t-field="doc.partner_id.name"/><br/>
<span t-field="doc.partner_id.street"/><br/>
@@ -138,28 +75,38 @@
</table>
<!-- ORDER LINES -->
- <table style="margin-top:16px;">
+ <table style="border-collapse:collapse; width:100%; margin-top:16px;">
<thead>
- <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 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>
</thead>
<tbody>
<t t-foreach="doc.order_line" t-as="line">
<tr>
- <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>
+ <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>
</tr>
<t t-if="line.product_id.website_description">
<tr>
- <td colspan="5" style="padding:8px 12px; font-size:11px; background:#fafafa;">
+ <td colspan="5" style="padding:8px 12px; font-size:11px; background:#fafafa; border-left:1px solid #ccc; border-right:1px solid #ccc;">
<div t-raw="line.product_id.website_description"/>
</td>
</tr>
@@ -189,14 +136,14 @@
<p t-field="doc.notes"/>
</div>
</div>
-
- <!-- FOOTER (pakai div, bukan <footer>) -->
- <div class="report-footer">
- <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2859765" alt="footer"/>
+ <!-- STATIC FOOTER -->
+ <div class="footer">
+ <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2859765"
+ style="width:100%; display: block;"/>
</div>
+
</t>
</template>
-
</odoo>