summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-09-15 11:21:22 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-09-15 11:21:22 +0700
commitd44a0982075b8ddb134647a85531e8a68608af55 (patch)
tree07aeec36b85f2b7ca3f8561f00d2bbc8da308b7d
parent1fd86434b0cc2deeeb32451cb5ffebba6785009d (diff)
push
-rw-r--r--indoteknik_custom/report/purchase_report.xml242
1 files changed, 192 insertions, 50 deletions
diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml
index 69902b63..a6db2923 100644
--- a/indoteknik_custom/report/purchase_report.xml
+++ b/indoteknik_custom/report/purchase_report.xml
@@ -26,87 +26,236 @@
</template>
<template id="report_purchaseorder_website_document">
- <t t-call="web.html_container">
+ <t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" />
+
+ <style>
+ @page {
+ margin: 120px 25px 95px 25px;
+ size: A4 portrait;
+ }
+
+ body {
+ font-family: Arial, sans-serif;
+ font-size: 12px;
+ color: #000;
+ line-height: 1.4;
+ }
+
+ .header {
+ position: fixed;
+ top: -90px;
+ left: 0;
+ right: 0;
+ height: 100px;
+ text-align: center;
+ }
+
+ .footer {
+ position: fixed;
+ bottom: -70px;
+ left: 0;
+ right: 0;
+ height: 70px;
+ text-align: center;
+ font-size: 10px;
+ }
+
+ .article {
+ margin: 0;
+ padding: 0;
+ }
+
+ h2 {
+ text-align: center;
+ margin: 0;
+ color: #d32f2f;
+ font-weight: bold;
+ font-size: 18px;
+ padding: 5px 0;
+ }
+
+ h4 {
+ text-align: center;
+ margin: 0 0 15px 0;
+ font-size: 14px;
+ }
+
+ table.info-table {
+ width: 100%;
+ margin-bottom: 16px;
+ font-size: 12px;
+ border-collapse: collapse;
+ }
+
+ table.info-table td {
+ padding: 5px;
+ vertical-align: top;
+ }
+
+ table.address-table {
+ width: 100%;
+ margin-bottom: 20px;
+ border-collapse: collapse;
+ }
+
+ table.address-table td {
+ border: 1px solid #ccc;
+ padding: 8px;
+ vertical-align: top;
+ width: 50%;
+ }
+
+ table.items-table {
+ width: 100%;
+ border-collapse: collapse;
+ margin-top: 10px;
+ font-size: 11px;
+ }
+
+ table.items-table th {
+ background: #f2f2f2;
+ border: 1px solid #ccc;
+ padding: 6px;
+ text-align: center;
+ font-weight: bold;
+ }
+
+ table.items-table td {
+ border: 1px solid #ccc;
+ padding: 6px;
+ vertical-align: top;
+ }
+
+ .text-right {
+ text-align: right;
+ }
+
+ .text-center {
+ text-align: center;
+ }
+
+ .product-description {
+ background: #fafafa;
+ padding: 8px;
+ font-size: 10px;
+ border-left: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ }
+
+ .totals-table {
+ margin-top: 20px;
+ margin-left: auto;
+ width: 40%;
+ font-size: 12px;
+ border-collapse: collapse;
+ }
+
+ .totals-table td {
+ padding: 4px;
+ }
+
+ .page-break {
+ page-break-after: always;
+ }
+
+ .notes {
+ margin-top: 20px;
+ font-size: 11px;
+ }
+ </style>
<!-- Header -->
<div class="header">
- <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2498521"
- style="width:100%; display: block;"/>
+ <div style="text-align: center; margin-bottom: 10px;">
+ <strong>PT INDOTEKNIK DOTCOM GEMILANG</strong><br/>
+ www.indoteknik.com
+ </div>
+ <hr style="border-top: 1px solid #000; margin: 5px 0;"/>
</div>
+ <!-- Footer -->
+ <div class="footer">
+ <hr style="border-top: 1px solid #000; margin: 5px 0;"/>
+ <div style="text-align: center;">
+ Jalan Bandengan Utara Blok 85A No.8-9, Kec. Penjaringan, Jakarta Utara DKI Jakarta 14440<br/>
+ (021) 2933 8828 | 0817-1718-1922 | sales@indoteknik.com
+ </div>
+ </div>
<!-- PAGE CONTENT -->
- <div class="article" style="margin: 0 1.5cm 0 1.5cm; ">
+ <div class="article">
<!-- TITLE -->
- <h2 style="text-align:center; margin:0; color:#d32f2f; font-weight:bold;">
- PURCHASE ORDER
- </h2>
- <h4 style="text-align:center; margin:0 0 20px 0;">
- No. <span t-field="doc.name"/>
- </h4>
+ <h2>PURCHASE ORDER</h2>
+ <h4>No. <span t-field="doc.name"/></h4>
<!-- TOP INFO -->
- <table style="width:100%; margin-bottom:16px; font-size:14px;">
+ <table class="info-table">
<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>
- <td><strong>Responsible:</strong> <span t-field="doc.user_id"/></td>
+ <td style="width: 33%;"><strong>Term Of Payment:</strong> <span t-field="doc.payment_term_id.name"/></td>
+ <td style="width: 33%;"><strong>Order Date:</strong> <span t-field="doc.date_order" t-options='{"widget": "date"}'/></td>
+ <td style="width: 33%;"><strong>Responsible:</strong> <span t-field="doc.user_id.name"/></td>
</tr>
</table>
<!-- VENDOR & DELIVERY -->
- <table style="width:100%; margin-bottom:24px; border-collapse:separate; border-spacing:16px 0;">
+ <table class="address-table">
<tr>
- <td style="width:50%; border:1px solid #ccc; padding:8px; vertical-align:top;">
+ <td>
<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>
<strong>Nama Vendor:</strong><br/>
<span t-field="doc.partner_id.name"/><br/>
<span t-field="doc.partner_id.street"/><br/>
- <span t-field="doc.partner_id.city"/> - <span t-field="doc.partner_id.zip"/>
+ <span t-field="doc.partner_id.city"/> - <span t-field="doc.partner_id.state_id.name" t-if="doc.partner_id.state_id"/> - <span t-field="doc.partner_id.zip"/>
</td>
</tr>
</table>
<!-- ORDER LINES -->
- <table style="border-collapse:collapse; width:100%; margin-top:16px;">
+ <table class="items-table">
<thead>
- <tr style="background:#f2f2f2;">
- <th style="border:1px solid #ccc;">Description</th>
- <th style="border:1px solid #ccc; text-align:right;">Quantity</th>
- <th style="border:1px solid #ccc; text-align:right;">Unit Price</th>
- <th style="border:1px solid #ccc; text-align:right;">Taxes</th>
- <th style="border:1px solid #ccc; text-align:right;">Subtotal</th>
+ <tr>
+ <th style="width: 50%;">Description</th>
+ <th style="width: 10%; text-align: center;">Quantity</th>
+ <th style="width: 15%; text-align: right;">Unit Price</th>
+ <th style="width: 10%; text-align: center;">Taxes</th>
+ <th style="width: 15%; text-align: right;">Subtotal</th>
</tr>
</thead>
<tbody>
<t t-foreach="doc.order_line" t-as="line">
<tr>
- <td style="border:1px solid #ccc;">
- <span t-field="line.name"/>
+ <td>
+ <div><strong><span t-field="line.product_id.default_code" t-options='{"widget": "char"}'/></strong></div>
+ <div><span t-field="line.name"/></div>
</td>
- <td style="border:1px solid #ccc; text-align:right;">
- <span t-field="line.product_qty"/> <span t-field="line.product_uom"/>
+ <td class="text-center">
+ <span t-field="line.product_qty"/> <span t-field="line.product_uom.name"/>
</td>
- <td style="border:1px solid #ccc; text-align:right;">
- <span t-field="line.price_unit"/>
+ <td class="text-right">
+ <span t-esc="formatLang(line.price_unit, digits=2)"/>
</td>
- <td style="border:1px solid #ccc; text-align:right;">
- <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.taxes_id))"/>
+ <td class="text-center">
+ <t t-set="tax_descriptions" t-value="[]"/>
+ <t t-foreach="line.taxes_id" t-as="tax">
+ <t t-set="tax_descriptions" t-value="tax_descriptions + [tax.amount * 100]"/>
+ </t>
+ <span t-esc="', '.join(map(str, tax_descriptions)) + '%'" t-if="tax_descriptions"/>
</td>
- <td style="border:1px solid #ccc; text-align:right;">
- <span t-field="line.price_subtotal"/>
+ <td class="text-right">
+ <span t-esc="formatLang(line.price_subtotal, digits=2)"/>
</td>
</tr>
<t t-if="line.product_id.website_description">
<tr>
- <td colspan="5" style="margin-top: 1rem; padding: 1rem; background:#fafafa; border-left:1px solid #ccc; border-right:1px solid #ccc;">
+ <td colspan="5" class="product-description">
<div t-raw="line.product_id.website_description"/>
</td>
</tr>
@@ -116,34 +265,27 @@
</table>
<!-- TOTALS -->
- <table style="margin-top:20px; margin-left:auto; width:40%; font-size:14px;">
+ <table class="totals-table">
<tr>
<td><strong>Subtotal</strong></td>
- <td style="text-align:right;"><span t-field="doc.amount_untaxed"/></td>
+ <td class="text-right"><span t-esc="formatLang(doc.amount_untaxed, digits=2)"/></td>
</tr>
<tr>
<td>Taxes</td>
- <td style="text-align:right;"><span t-field="doc.amount_tax"/></td>
+ <td class="text-right"><span t-esc="formatLang(doc.amount_tax, digits=2)"/></td>
</tr>
<tr>
<td><strong>Total</strong></td>
- <td style="text-align:right;"><span t-field="doc.amount_total"/></td>
+ <td class="text-right"><span t-esc="formatLang(doc.amount_total, digits=2)"/></td>
</tr>
</table>
<!-- NOTES -->
- <div style="margin-top:24px;">
+ <div class="notes" t-if="doc.notes">
+ <strong>Catatan:</strong><br/>
<p t-field="doc.notes"/>
</div>
</div>
- <!-- 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>
+</odoo> \ No newline at end of file