summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-09-11 08:57:04 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-09-11 08:57:04 +0700
commit142f1a37b0d73ea847345428acc4224ff6e49419 (patch)
tree0c1d2f4ce8747f9b85e65cd59487134b255c4268
parent4db6034c07414dcd09292e3c41d6fd4598868148 (diff)
purchase report
-rwxr-xr-xindoteknik_custom/__manifest__.py2
-rw-r--r--indoteknik_custom/report/purchase_report.xml162
2 files changed, 164 insertions, 0 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py
index 31685005..09a3aa6f 100755
--- a/indoteknik_custom/__manifest__.py
+++ b/indoteknik_custom/__manifest__.py
@@ -166,6 +166,7 @@
'report/report_invoice.xml',
'report/report_picking.xml',
'report/report_sale_order.xml',
+ 'report/purchase_report.xml',
'views/vendor_sla.xml',
'views/coretax_faktur.xml',
'views/public_holiday.xml',
@@ -177,6 +178,7 @@
'views/tukar_guling_po.xml',
# 'views/refund_sale_order.xml',
'views/update_date_planned_po_wizard_view.xml',
+ # 'views/reimburse.xml',
],
'demo': [],
'css': [],
diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml
new file mode 100644
index 00000000..9d7f4028
--- /dev/null
+++ b/indoteknik_custom/report/purchase_report.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data>
+ <!-- Report Action -->
+ <record id="action_report_purchaseorder_website" model="ir.actions.report">
+ <field name="name">Purchase Order (Website)</field>
+ <field name="model">purchase.order</field>
+ <field name="report_type">qweb-pdf</field>
+ <field name="report_name">indoteknik_custom.report_purchaseorder_website</field>
+ <field name="report_file">indoteknik_custom.report_purchaseorder_website</field>
+ <field name="print_report_name">
+ ('PO - %s - %s' % (object.partner_id.name, object.name))
+ </field>
+ <field name="binding_model_id" ref="purchase.model_purchase_order"/>
+ <field name="binding_type">report</field>
+ </record>
+ </data>
+
+ <!-- Wrapper Template -->
+ <template id="report_purchaseorder_website">
+ <t t-call="web.html_container">
+ <t t-foreach="docs" t-as="doc">
+ <t t-call="indoteknik_custom.report_purchaseorder_website_document" t-lang="doc.partner_id.lang"/>
+ </t>
+ </t>
+ </template>
+
+ <!-- Document Template -->
+<template id="report_purchaseorder_website_document">
+ <t t-call="web.external_layout">
+ <t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" />
+
+ <div class="page">
+ <!-- Header Image -->
+ <div class="mb16">
+ <img src="https://erp.indoteknik.com/api/image/ir.attachment/datas/2498521"
+ style="width:100%; max-height:100px; object-fit:contain;"/>
+ </div>
+
+ <!-- Title -->
+ <h2 class="text-center mb4" style="color:#d32f2f; font-weight:bold;">
+ PURCHASE ORDER
+ </h2>
+ <h4 class="text-center mb32">
+ No. <span t-field="doc.name"/>
+ </h4>
+
+ <!-- Top Info sejajar -->
+ <div class="row mb16" style="font-size:12px;">
+ <div class="col-4">
+ <strong>Term Of Payment:</strong>
+ <span t-field="doc.payment_term_id.name"/>
+ </div>
+ <div class="col-4">
+ <strong>Order Date:</strong>
+ <span t-field="doc.date_order" t-options='{"widget": "date"}'/>
+ </div>
+ <div class="col-4">
+ <strong>Responsible:</strong>
+ <span t-field="doc.user_id"/>
+ </div>
+ </div>
+
+ <!-- Vendor & Shipping Info sejajar -->
+ <div class="row mb32" style="font-size:12px;">
+ <div class="col-6" style="border:1px solid #ccc; 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<br/>
+ Indonesia
+ </div>
+ <div class="col-6" style="border:1px solid #ccc; padding:8px;">
+ <strong>Nama Vendor:</strong><br/>
+ <div t-field="doc.partner_id"
+ t-options='{"widget": "contact", "fields": ["address", "name", "phone"],
+ "no_marker": True, "phone_icons": True}'/>
+ </div>
+ </div>
+
+ <!-- Order Lines -->
+ <table class="table table-sm o_main_table" style="font-size:11px; border:1px solid #000; border-collapse: collapse; width:100%;">
+ <thead style="display: table-row-group; background:#f5f5f5;">
+ <tr>
+ <th style="border:1px solid #000; padding:4px;">Description</th>
+ <th class="text-right" style="border:1px solid #000; padding:4px;">Quantity</th>
+ <th class="text-right" style="border:1px solid #000; padding:4px;">Unit Price</th>
+ <th class="text-right" style="border:1px solid #000; padding:4px;">Taxes</th>
+ <th class="text-right" style="border:1px solid #000; padding:4px;">Subtotal</th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="doc.order_line" t-as="line">
+ <!-- Main row -->
+ <tr>
+ <td style="border:1px solid #000; padding:4px;">
+ <span t-field="line.name"/>
+ </td>
+ <td class="text-right" style="border:1px solid #000; padding:4px;">
+ <span t-field="line.product_qty"/>
+ <span t-field="line.product_uom"/>
+ </td>
+ <td class="text-right" style="border:1px solid #000; padding:4px;">
+ <span t-field="line.price_unit"/>
+ </td>
+ <td class="text-right" style="border:1px solid #000; padding:4px;">
+ <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.taxes_id))"/>
+ </td>
+ <td class="text-right" style="border:1px solid #000; padding:4px;">
+ <span t-field="line.price_subtotal"/>
+ </td>
+ </tr>
+ <!-- Website Description row -->
+ <t t-if="line.product_id.website_description">
+ <tr>
+ <td colspan="5" style="border:1px solid #000; padding:6px; font-size:10px; color:#555;">
+ <div t-raw="line.product_id.website_description"/>
+ </td>
+ </tr>
+ </t>
+ </t>
+ </tbody>
+ </table>
+
+ <!-- Totals -->
+ <div class="clearfix">
+ <div class="row">
+ <div class="col-4 ml-auto">
+ <table class="table table-sm" style="border:1px solid #000; border-collapse: collapse; width:100%;">
+ <tr>
+ <td style="border:1px solid #000; padding:4px;"><strong>Subtotal</strong></td>
+ <td class="text-right" style="border:1px solid #000; padding:4px;">
+ <span t-field="doc.amount_untaxed"/>
+ </td>
+ </tr>
+ <tr>
+ <td style="border:1px solid #000; padding:4px;">Taxes</td>
+ <td class="text-right" style="border:1px solid #000; padding:4px;">
+ <span t-field="doc.amount_tax"/>
+ </td>
+ </tr>
+ <tr class="o_total">
+ <td style="border:1px solid #000; padding:4px;"><strong>Total</strong></td>
+ <td class="text-right" style="border:1px solid #000; padding:4px;">
+ <span t-field="doc.amount_total"/>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+
+ <!-- Notes -->
+ <div class="mt32" style="font-size:11px;">
+ <p t-field="doc.notes"/>
+ </div>
+ </div>
+ </t>
+ </template>
+
+</odoo>