diff options
| -rw-r--r-- | indoteknik_custom/report/purchase_report.xml | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/indoteknik_custom/report/purchase_report.xml b/indoteknik_custom/report/purchase_report.xml index f3d203fc..80112947 100644 --- a/indoteknik_custom/report/purchase_report.xml +++ b/indoteknik_custom/report/purchase_report.xml @@ -77,6 +77,7 @@ <!-- ORDER LINES --> <table style="border-collapse:collapse; width:100%; margin-top:16px; font-size:14px;"> <tbody> + <!-- HEADER --> <tr style="background:#e53935; color:white;"> <th style="border:1px solid #ccc; padding:8px; text-align:left;">No. & Description</th> <th style="border:1px solid #ccc; padding:8px; text-align:center;">Quantity</th> @@ -84,28 +85,57 @@ <th style="border:1px solid #ccc; padding:8px; text-align:center;">Taxes</th> <th style="border:1px solid #ccc; padding:8px; text-align:center;">Subtotal</th> </tr> + + <!-- ISI ORDER LINE --> <t t-foreach="doc.order_line" t-as="line" t-index="line_index"> <tr t-attf-style="background-color: #{ '#fafafa' if line_index % 2 == 0 else 'white' };"> - <td style="border:1px solid #ccc; padding: 6px;"> - <span style="font-weight:bold; margin-right:6px;"><t t-esc="line_index + 1"/>.</span> - <span t-field="line.name"/> + + <!-- NO & DESCRIPTION + IMAGE --> + <td style="border:1px solid #ccc; padding: 6px; display:flex; align-items:center; gap:10px;"> + <!-- GAMBAR PRODUK --> + <t t-if="line.image_small"> + <img t-att-src="'data:image/png;base64,%s' % line.image_small" + style="width:40px; height:40px; object-fit:contain; border:1px solid #ddd; border-radius:6px; background:#fff;"/> + </t> + <t t-if="not line.image_small"> + <div style="width:40px; height:40px; background:#f5f5f5; border:1px solid #ddd; border-radius:6px; display:flex; align-items:center; justify-content:center; color:#999; font-size:10px;"> + N/A + </div> + </t> + + <!-- TEKS --> + <div style="display:flex; flex-direction:column; flex:1;"> + <span style="font-weight:bold; margin-bottom:2px;"> + <t t-esc="line_index + 1"/>. <t t-esc="line.name"/> + </span> + </div> </td> + + <!-- QTY --> <td style="border:1px solid #ccc; padding:6px; text-align:center;"> <span t-field="line.product_qty"/> <span t-field="line.product_uom"/> </td> + + <!-- UNIT PRICE --> <td style="border:1px solid #ccc; padding:6px; text-align:center;"> <span t-field="line.price_unit"/> </td> + + <!-- TAXES --> <td style="border:1px solid #ccc; padding:6px; text-align:center;"> <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.taxes_id))"/> </td> + + <!-- SUBTOTAL --> <td style="border:1px solid #ccc; padding:6px; text-align:right; font-weight:bold;"> <span t-field="line.price_subtotal"/> </td> </tr> + + <!-- WEBSITE DESCRIPTION --> <t t-if="line.product_id.website_description"> - <tr t-attf-style="background-color: #{ '#fef5f5' if line_index % 2 == 0 else '#fffafa' };"> - <td colspan="5" style="padding: 8px 12px; font-size:9px; font-style:italic; color:#555; border-left:1px solid #ccc; border-right:1px solid #ccc; border-bottom:1px solid #ccc;"> + <tr t-attf-style="background-color: #{ '#fef5f5' if line_index % 2 == 0 else '#fffafa' }; "> + <td colspan="5" style="padding: 6px 12px; font-size:12px; line-height:1.3; font-style:italic; color:#555; border-left:1px solid #ccc; border-right:1px solid #ccc; border-bottom:1px solid #ccc;"> <div t-raw="line.product_id.website_description"/> </td> </tr> @@ -114,6 +144,7 @@ </tbody> </table> + <!-- TOTALS --> <table style="margin-top:24px; margin-left:auto; width:40%; font-size:14px; border:1px solid #ddd; border-radius:6px; box-shadow:0 1px 3px rgba(0,0,0,0.08);"> <tr style="background:#fafafa;"> |
