updates
This commit is contained in:
@@ -45,6 +45,21 @@
|
||||
<field name="paperformat_id" ref="paperformat_a4_landscape"/>
|
||||
</record>
|
||||
|
||||
<!-- =============================================================== -->
|
||||
<!-- LTC Repair Order / Quotation Report (Landscape) -->
|
||||
<!-- =============================================================== -->
|
||||
<record id="action_report_saleorder_ltc_repair" model="ir.actions.report">
|
||||
<field name="name">LTC Repair Order / Quotation</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">fusion_claims.report_saleorder_ltc_repair</field>
|
||||
<field name="report_file">fusion_claims.report_saleorder_ltc_repair</field>
|
||||
<field name="print_report_name">'LTC Repair - %s - %s' % (object.name, object.partner_id.name)</field>
|
||||
<field name="binding_model_id" ref="sale.model_sale_order"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="paperformat_id" ref="paperformat_a4_landscape"/>
|
||||
</record>
|
||||
|
||||
<!-- Invoice Reports -->
|
||||
<record id="action_report_invoice_portrait" model="ir.actions.report">
|
||||
<field name="name">Invoice (Portrait)</field>
|
||||
|
||||
139
fusion_claims/report/report_ltc_nursing_station.xml
Normal file
139
fusion_claims/report/report_ltc_nursing_station.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_ltc_nursing_station_document">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="facility">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page" style="font-size: 11px;">
|
||||
<h3 class="text-center mb-3">
|
||||
Equipment Repair Log - <t t-esc="facility.name"/>
|
||||
</h3>
|
||||
<p class="text-center text-muted mb-4">
|
||||
Generated: <t t-esc="context_timestamp(datetime.datetime.now()).strftime('%B %d, %Y')"/>
|
||||
</p>
|
||||
|
||||
<table class="table table-bordered" style="border: 1px solid #000;">
|
||||
<thead>
|
||||
<tr style="background-color: #f0f0f0; height: 20px;">
|
||||
<th style="border: 1px solid #000; width: 5%; text-align: center;">S/N</th>
|
||||
<th style="border: 1px solid #000; width: 18%;">Client Name</th>
|
||||
<th style="border: 1px solid #000; width: 8%; text-align: center;">Room #</th>
|
||||
<th style="border: 1px solid #000; width: 27%;">Issue Description</th>
|
||||
<th style="border: 1px solid #000; width: 12%; text-align: center;">Reported Date</th>
|
||||
<th style="border: 1px solid #000; width: 20%;">Resolution</th>
|
||||
<th style="border: 1px solid #000; width: 10%; text-align: center;">Fixed Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-set="counter" t-value="0"/>
|
||||
<t t-foreach="facility.repair_ids.sorted(key=lambda r: r.issue_reported_date or '', reverse=True)"
|
||||
t-as="repair">
|
||||
<t t-set="counter" t-value="counter + 1"/>
|
||||
<tr style="height: 20px;">
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
<t t-esc="counter"/>
|
||||
</td>
|
||||
<td style="border: 1px solid #000;">
|
||||
<t t-esc="repair.display_client_name"/>
|
||||
</td>
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
<t t-esc="repair.room_number"/>
|
||||
</td>
|
||||
<td style="border: 1px solid #000; font-size: 10px;">
|
||||
<t t-esc="repair.issue_description"/>
|
||||
</td>
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
<t t-if="repair.issue_reported_date">
|
||||
<t t-esc="repair.issue_reported_date" t-options='{"widget": "date"}'/>
|
||||
</t>
|
||||
</td>
|
||||
<td style="border: 1px solid #000; font-size: 10px;">
|
||||
<t t-esc="repair.resolution_description or ''"/>
|
||||
</td>
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
<t t-if="repair.issue_fixed_date">
|
||||
<t t-esc="repair.issue_fixed_date" t-options='{"widget": "date"}'/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="report_ltc_repairs_summary_document">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="facility">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<h3 class="text-center mb-3">
|
||||
Repair Summary - <t t-esc="facility.name"/>
|
||||
</h3>
|
||||
<p class="text-center text-muted mb-4">
|
||||
Total Repairs: <t t-esc="len(facility.repair_ids)"/>
|
||||
</p>
|
||||
|
||||
<h5>Repairs by Stage</h5>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Stage</th>
|
||||
<th class="text-end">Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-set="stages" t-value="{}"/>
|
||||
<t t-foreach="facility.repair_ids" t-as="r">
|
||||
<t t-set="sname" t-value="r.stage_id.name or 'No Stage'"/>
|
||||
<t t-if="sname not in stages">
|
||||
<t t-set="_" t-value="stages.__setitem__(sname, 0)"/>
|
||||
</t>
|
||||
<t t-set="_" t-value="stages.__setitem__(sname, stages[sname] + 1)"/>
|
||||
</t>
|
||||
<t t-foreach="stages" t-as="stage_name">
|
||||
<tr>
|
||||
<td><t t-esc="stage_name"/></td>
|
||||
<td class="text-end"><t t-esc="stages[stage_name]"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h5 class="mt-4">Recent Repairs</h5>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Reference</th>
|
||||
<th>Client</th>
|
||||
<th>Room</th>
|
||||
<th>Reported</th>
|
||||
<th>Fixed</th>
|
||||
<th>Stage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="facility.repair_ids.sorted(key=lambda r: r.issue_reported_date or '', reverse=True)[:50]"
|
||||
t-as="repair">
|
||||
<tr>
|
||||
<td><t t-esc="repair.name"/></td>
|
||||
<td><t t-esc="repair.display_client_name"/></td>
|
||||
<td><t t-esc="repair.room_number"/></td>
|
||||
<td><t t-esc="repair.issue_reported_date" t-options='{"widget": "date"}'/></td>
|
||||
<td><t t-esc="repair.issue_fixed_date" t-options='{"widget": "date"}'/></td>
|
||||
<td><t t-esc="repair.stage_id.name"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
280
fusion_claims/report/sale_report_ltc_repair.xml
Normal file
280
fusion_claims/report/sale_report_ltc_repair.xml
Normal file
@@ -0,0 +1,280 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2024-2026 Nexa Systems Inc.
|
||||
License OPL-1 (Odoo Proprietary License v1.0)
|
||||
Part of the Fusion Claim Assistant product family.
|
||||
Landscape LTC Repair Order / Quotation Report Template
|
||||
-->
|
||||
<odoo>
|
||||
<template id="report_saleorder_ltc_repair">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
|
||||
<t t-set="repair" t-value="doc.x_fc_ltc_repair_id"/>
|
||||
|
||||
<style>
|
||||
.fc-ltc { font-family: Arial, sans-serif; font-size: 11pt; }
|
||||
.fc-ltc table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
|
||||
.fc-ltc table.bordered, .fc-ltc table.bordered th, .fc-ltc table.bordered td { border: 1px solid #000; }
|
||||
.fc-ltc th { background-color: #0066a1; color: white; padding: 8px 10px; font-weight: bold; font-size: 10pt; }
|
||||
.fc-ltc td { padding: 6px 8px; vertical-align: top; font-size: 10pt; }
|
||||
.fc-ltc .text-center { text-align: center; }
|
||||
.fc-ltc .text-end { text-align: right; }
|
||||
.fc-ltc .text-start { text-align: left; }
|
||||
.fc-ltc .repair-bg { background-color: #e8f5e9; }
|
||||
.fc-ltc .section-row { background-color: #f0f0f0; font-weight: bold; }
|
||||
.fc-ltc .note-row { font-style: italic; }
|
||||
.fc-ltc h2 { color: #0066a1; margin: 10px 0; font-size: 18pt; }
|
||||
.fc-ltc .info-table td { padding: 8px 12px; font-size: 11pt; }
|
||||
.fc-ltc .info-table th { background-color: #f5f5f5; color: #333; font-size: 10pt; padding: 6px 12px; }
|
||||
.fc-ltc .totals-table { border: 1px solid #000; }
|
||||
.fc-ltc .totals-table td { border: 1px solid #000; padding: 8px 12px; font-size: 11pt; }
|
||||
.fc-ltc .photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
|
||||
.fc-ltc .photo-grid img { max-width: 220px; max-height: 180px; border: 1px solid #ccc; }
|
||||
.fc-ltc .photo-section { margin-top: 20px; page-break-inside: avoid; }
|
||||
.fc-ltc .photo-section h3 { color: #0066a1; font-size: 14pt; border-bottom: 2px solid #0066a1; padding-bottom: 4px; }
|
||||
</style>
|
||||
|
||||
<div class="fc-ltc">
|
||||
<div class="page">
|
||||
|
||||
<!-- Document Title -->
|
||||
<h2 style="text-align: left;">
|
||||
<span t-if="doc.state in ['draft','sent']">LTC Repair Quotation </span>
|
||||
<span t-else="">LTC Repair Order </span>
|
||||
<span t-field="doc.name"/>
|
||||
</h2>
|
||||
|
||||
<!-- Address Table -->
|
||||
<table class="bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 50%;">BILLING ADDRESS</th>
|
||||
<th style="width: 50%;">DELIVERY ADDRESS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="height: 70px; font-size: 12pt;">
|
||||
<div t-field="doc.partner_invoice_id"
|
||||
t-options="{'widget': 'contact', 'fields': ['name', 'address'], 'no_marker': True}"/>
|
||||
</td>
|
||||
<td style="height: 70px; font-size: 12pt;">
|
||||
<div t-field="doc.partner_shipping_id"
|
||||
t-options="{'widget': 'contact', 'fields': ['name', 'address'], 'no_marker': True}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Order Info Table -->
|
||||
<table class="bordered info-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ORDER DATE</th>
|
||||
<th>SALES REP</th>
|
||||
<th>VALIDITY</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<span t-field="doc.date_order" t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-field="doc.user_id"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-field="doc.validity_date"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- LTC Repair Info Table -->
|
||||
<t t-if="repair">
|
||||
<table class="bordered info-table">
|
||||
<thead>
|
||||
<tr class="repair-bg">
|
||||
<th style="background-color: #e8f5e9; color: #333;">REPAIR REF</th>
|
||||
<th style="background-color: #e8f5e9; color: #333;">TECHNICIAN</th>
|
||||
<th style="background-color: #e8f5e9; color: #333;">REPORTED DATE</th>
|
||||
<th style="background-color: #e8f5e9; color: #333;">SERIAL #</th>
|
||||
<th style="background-color: #e8f5e9; color: #333;">LTC LOCATION</th>
|
||||
<th style="background-color: #e8f5e9; color: #333;">ROOM #</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="repair-bg">
|
||||
<td class="text-center">
|
||||
<span t-esc="repair.name or '-'"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-if="repair.assigned_technician_id"
|
||||
t-esc="repair.assigned_technician_id.name"/>
|
||||
<span t-else="">-</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<t t-if="repair.issue_reported_date">
|
||||
<span t-field="repair.issue_reported_date"/>
|
||||
</t>
|
||||
<t t-else="">-</t>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-esc="repair.product_serial or '-'"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-if="repair.facility_id"
|
||||
t-esc="repair.facility_id.name"/>
|
||||
<span t-else="">-</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-esc="repair.room_number or '-'"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</t>
|
||||
|
||||
<!-- Order Lines Table -->
|
||||
<table class="bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-start" style="width: 40%;">DESCRIPTION</th>
|
||||
<th class="text-center" style="width: 10%;">QTY</th>
|
||||
<th class="text-center" style="width: 15%;">UNIT PRICE</th>
|
||||
<th class="text-center" style="width: 15%;">TAX</th>
|
||||
<th class="text-center" style="width: 20%;">TOTAL</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="doc.order_line" t-as="line">
|
||||
<!-- Section Header -->
|
||||
<t t-if="line.display_type == 'line_section'">
|
||||
<tr class="section-row">
|
||||
<td colspan="5">
|
||||
<strong><span t-field="line.name"/></strong>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
<!-- Note Line -->
|
||||
<t t-elif="line.display_type == 'line_note'">
|
||||
<tr class="note-row">
|
||||
<td colspan="5">
|
||||
<span t-field="line.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
<!-- Product Line -->
|
||||
<t t-elif="not line.display_type">
|
||||
<tr>
|
||||
<td>
|
||||
<t t-if="line.name">
|
||||
<t t-set="clean_name" t-value="line.name"/>
|
||||
<t t-if="'] ' in line.name">
|
||||
<t t-set="clean_name" t-value="line.name.split('] ', 1)[1]"/>
|
||||
</t>
|
||||
<t t-esc="clean_name"/>
|
||||
</t>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-esc="int(line.product_uom_qty) if line.product_uom_qty == int(line.product_uom_qty) else line.product_uom_qty"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<t t-esc="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids]) or 'NO TAX SALE'"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-field="line.price_subtotal" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Payment Terms and Totals Row -->
|
||||
<div class="row" style="margin-top: 15px;">
|
||||
<div class="col-7">
|
||||
<t t-if="doc.payment_term_id.note">
|
||||
<strong>Payment Terms:</strong><br/>
|
||||
<span t-field="doc.payment_term_id.note"/>
|
||||
</t>
|
||||
</div>
|
||||
<div class="col-5" style="text-align: right;">
|
||||
<table class="totals-table" style="width: auto; margin-left: auto;">
|
||||
<tr>
|
||||
<td style="min-width: 200px;">Subtotal</td>
|
||||
<td class="text-end" style="min-width: 150px;">
|
||||
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Taxes</td>
|
||||
<td class="text-end">
|
||||
<span t-field="doc.amount_tax" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Grand Total</strong></td>
|
||||
<td class="text-end"><strong>
|
||||
<span t-field="doc.amount_total" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
||||
</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Terms and Conditions -->
|
||||
<t t-if="doc.note">
|
||||
<div style="margin-top: 15px;">
|
||||
<strong>Terms and Conditions:</strong>
|
||||
<div t-field="doc.note"/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<!-- Before Photos -->
|
||||
<t t-if="repair and repair.before_photo_ids">
|
||||
<div class="photo-section">
|
||||
<h3>Before Photos (Reported Condition)</h3>
|
||||
<div class="photo-grid">
|
||||
<t t-foreach="repair.before_photo_ids" t-as="photo">
|
||||
<img t-att-src="image_data_uri(photo.datas)"
|
||||
t-att-alt="photo.name"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<!-- After Photos -->
|
||||
<t t-if="repair and repair.after_photo_ids">
|
||||
<div class="photo-section">
|
||||
<h3>After Photos (Completed Repair)</h3>
|
||||
<div class="photo-grid">
|
||||
<t t-foreach="repair.after_photo_ids" t-as="photo">
|
||||
<img t-att-src="image_data_uri(photo.datas)"
|
||||
t-att-alt="photo.name"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<!-- Signature -->
|
||||
<t t-if="doc.signature">
|
||||
<div style="margin-top: 20px; text-align: right;">
|
||||
<strong>Signature</strong><br/>
|
||||
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/><br/>
|
||||
<span t-field="doc.signed_by"/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user