91 lines
5.4 KiB
XML
Executable File
91 lines
5.4 KiB
XML
Executable File
<odoo>
|
|
<record id="action_material_budget_summary" model="ir.actions.report">
|
|
<field name="name">Material Budget Summary</field>
|
|
<field name="model">sos_budget_plan</field> <!-- Adjust model if needed -->
|
|
<field name="report_type">qweb-html</field>
|
|
<field name="report_name">sos_inventory.report_material_budget_summary</field>
|
|
<field name="print_report_name">Material_Budget_Summary</field>
|
|
</record>
|
|
<template id="report_material_budget_summary">
|
|
<t t-call="web.basic_layout">
|
|
<t t-call="web.html_container">
|
|
<style>
|
|
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: #1f2937; }
|
|
.page { max-width: 1200px; margin: 0 auto; padding: 20px; }
|
|
.header { border-bottom: 2px solid #e5e7eb; padding-bottom: 16px; margin-bottom: 24px; }
|
|
.header h3 { font-size: 24px; font-weight: 700; margin: 0; color: #1e40af; }
|
|
.header .info { font-size: 14px; color: #4b5563; margin-top: 8px; }
|
|
.header .info strong { font-weight: 600; }
|
|
.section-title { font-size: 18px; font-weight: 600; color: #1e40af; margin: 24px 0 12px; }
|
|
.count { font-size: 14px; color: #4b5563; margin-bottom: 8px; }
|
|
.table-custom { width: 100%; border-collapse: separate; border-spacing: 0; background-color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; }
|
|
.table-custom th { background-color: #e4e0f9; color: #1e40af; font-weight: 600; padding: 12px; text-align: left; border-bottom: 1px solid #d1d5db; }
|
|
.table-custom td { padding: 12px; border-bottom: 1px solid #e5e7eb; }
|
|
.table-custom tr:last-child td { border-bottom: none; }
|
|
.table-custom th.center, .table-custom td.center { text-align: center; }
|
|
.no-data { text-align: center; color: #6b7280; padding: 16px; font-style: italic; }
|
|
.total-cost{
|
|
display:flex; justify-content:flex-end; align-items:center; gap:8px;
|
|
padding:8px 10px; margin:10px 0 6px;
|
|
background:#fff; border:1px solid #e5e7eb; border-radius:8px;
|
|
font-size:14px;
|
|
}
|
|
.total-cost .label{ color:#4b5563; }
|
|
.total-cost .amount{ font-weight:700; font-size:16px; }
|
|
</style>
|
|
<div class="page">
|
|
<div class="header">
|
|
<h3>Budget Summary</h3>
|
|
<div class="info">
|
|
<strong>Name:</strong> <t t-esc="fg_name or '—'"/>
|
|
| <strong>Planned Quantity:</strong> <t t-esc="total_quantity or '—'"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Material Quantities Table -->
|
|
<h4 class="section-title">Materials to Purchase</h4>
|
|
<div class="count">Total Materials: <t t-esc="len(materials)"/></div>
|
|
<div class="total-cost">
|
|
<span class="label">Estimated Purchase Cost:</span>
|
|
<span class="amount">
|
|
<t t-esc="currency_symbol"/> <t t-esc="'{:,.2f}'.format(total_cost)"/>
|
|
</span>
|
|
</div>
|
|
|
|
<table class="table-custom">
|
|
<thead>
|
|
<tr>
|
|
<th>Material Name</th>
|
|
<th class="center">Needed Qty</th>
|
|
<th class="center">In-Hand Qty</th>
|
|
<th class="center">Actual Needed Qty</th>
|
|
<th class="center">Standard Packing Qty</th>
|
|
<th class="center">To Purchase</th>
|
|
<th class="center">cost</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<t t-if="materials">
|
|
<t t-foreach="materials" t-as="material">
|
|
<tr>
|
|
<td><t t-esc="material['material_name']"/></td>
|
|
<td class="center"><t t-esc="material['needed_quantity']"/></td>
|
|
<td class="center"><t t-esc="material['inhand_quantity']"/></td>
|
|
<td class="center"><t t-esc="material['actual_needed']"/></td>
|
|
<td class="center"><t t-esc="material['std_packing_qty']"/></td>
|
|
<td class="center"><t t-esc="material['to_purchase']"/></td>
|
|
<td class="center"><t t-esc="material['cost']"/></td>
|
|
|
|
</tr>
|
|
</t>
|
|
</t>
|
|
<t t-if="not materials or len(materials) == 0">
|
|
<tr><td colspan="4" class="no-data">No materials need to be purchased.</td></tr>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
</odoo> |