Files
gzth/yuthon_property_approval/report/property_lease_renewal_template.xml
T
2026-09-20 20:25:00 +08:00

266 lines
16 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="property_lease_renewal_template">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="web.external_layout">
<style type="text/css">
table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; table-layout: fixed; }
td { border: 1px solid #000; padding: 6px; text-align: center; vertical-align: middle; }
.title {
text-align: center;
font-weight: bold;
font-size: 18px;
padding: 8px 0;
}
.header-cell { font-weight: bold; background-color: #d4e6f1; }
.section-header { background-color: #d4e6f1; text-align: center; }
.text-left { text-align: left; }
.no-right-border { border-right: none !important; }
.no-left-border { border-left: none !important; }
</style>
<!-- 流水号 -->
<div style="margin-bottom:8px; text-align:left; color:#999999;">
流水号:<span t-esc="doc.code or ''"/>
</div>
<!-- 标题 -->
<div class="title">租赁变更审批</div>
<table>
<colgroup>
<col style="width:15%"/>
<col style="width:35%"/>
<col style="width:15%"/>
<col style="width:35%"/>
</colgroup>
<!-- 基本信息 -->
<tr>
<td class="header-cell"><strong>标题</strong></td>
<td colspan="3"><span t-esc="doc.name or ''"/></td>
</tr>
<tr>
<td class="header-cell"><strong>变更类型</strong></td>
<td>
<t t-if="doc.renewal_type == 'lease'">承租方变更</t>
<t t-elif="doc.renewal_type == 'extend'">延长租期</t>
</td>
<td class="header-cell"><strong>紧急程度</strong></td>
<td>
<t t-if="doc.urgency_level == 'normal'">普件</t>
<t t-elif="doc.urgency_level == 'urgent'">急件</t>
<t t-elif="doc.urgency_level == 'emergency'">特急件</t>
</td>
</tr>
<tr>
<td class="header-cell"><strong>经办意见</strong></td>
<td colspan="3" class="text-left"><span t-esc="doc.reason or ''"/></td>
</tr>
<!-- 原租赁合同信息 -->
<tr>
<td colspan="4" class="section-header"><strong>原租赁合同信息</strong></td>
</tr>
<tr>
<td class="header-cell"><strong>原承租方</strong></td>
<td><span t-esc="doc.lessee_id.name or ''"/></td>
<td class="header-cell"><strong>租赁合同</strong></td>
<td><span t-esc="doc.contract_id.name or ''"/></td>
</tr>
<tr>
<td class="header-cell"><strong>租金支付周期</strong></td>
<td>
<t t-if="doc.cycle_dict == 'monthly'">月度</t>
<t t-elif="doc.cycle_dict == 'quarter'">季度</t>
<t t-elif="doc.cycle_dict == 'half'">半年</t>
<t t-elif="doc.cycle_dict == 'year'">年度</t>
</td>
<td class="header-cell"><strong>租金</strong></td>
<td><span t-esc="'%.2f' % doc.monthly_rent if doc.monthly_rent else '0.00'"/></td>
</tr>
<tr>
<td class="header-cell"><strong>合约起止</strong></td>
<td>
<span t-esc="doc.original_start_date and doc.original_start_date.strftime('%Y-%m-%d') or ''"/>
至
<span t-esc="doc.original_end_date and doc.original_end_date.strftime('%Y-%m-%d') or ''"/>
</td>
<td class="header-cell"><strong>物业信息</strong></td>
<td><span t-esc="doc.property_name or ''"/></td>
</tr>
<!-- 变更信息 -->
<tr>
<td colspan="4" class="section-header"><strong>变更信息</strong></td>
</tr>
<!-- 合同终止专属字段 -->
<t t-if="doc.renewal_type == 'early_checkout'">
<tr>
<td class="header-cell"><strong>退租日期</strong></td>
<td><span t-esc="doc.early_quitting_date and doc.early_quitting_date.strftime('%Y-%m-%d') or ''"/></td>
<td class="header-cell"><strong>退租原因</strong></td>
<td>
<t t-if="doc.early_reason == 'normal'">正常退租</t>
<t t-elif="doc.early_reason == 'agree'">协商一致</t>
<t t-elif="doc.early_reason == 'settle'">违约结清</t>
<t t-elif="doc.early_reason == 'other'">其他</t>
</td>
</tr>
<tr>
<td class="header-cell"><strong>原押金</strong></td>
<td><span t-esc="'%.2f' % doc.deposit if doc.deposit else '0.00'"/></td>
<td class="header-cell"><strong>押金处理方式</strong></td>
<td>
<t t-if="doc.deposit_treatment == 'refund'">全额退押</t>
<t t-elif="doc.deposit_treatment == 'part_refund'">部分退租</t>
<t t-elif="doc.deposit_treatment == 'no_refund'">全额没收</t>
</td>
</tr>
<t t-if="doc.deposit_treatment == 'part_refund'">
<tr>
<td class="header-cell"><strong>退款金额</strong></td>
<td colspan="3">
<span t-esc="'%.2f' % doc.refund_amount if doc.refund_amount else '0.00'"/>
</td>
</tr>
<tr>
<td class="header-cell"><strong>应收金额</strong></td>
<td colspan="3">
<span t-esc="'%.2f' % doc.total_receivables if doc.total_receivables else '0.00'"/>
</td>
</tr>
</t>
<t t-if="doc.early_explain">
<tr>
<td class="header-cell"><strong>退租说明</strong></td>
<td colspan="3" class="text-left"><span t-esc="doc.early_explain or ''"/></td>
</tr>
</t>
</t>
<!-- 承租方变更专属字段 -->
<t t-if="doc.renewal_type == 'lease'">
<tr>
<td class="header-cell"><strong>新承租方</strong></td>
<td><span t-esc="doc.new_lessee_id.name or ''"/></td>
<td class="header-cell"><strong>承租方类型</strong></td>
<td>
<t t-if="doc.entity_type == 'person'">个人</t>
<t t-elif="doc.entity_type == 'company'">企业</t>
</td>
</tr>
<tr>
<td class="header-cell"><strong>联系人</strong></td>
<td><span t-esc="doc.contact or ''"/></td>
<td class="header-cell"><strong>联系电话</strong></td>
<td><span t-esc="doc.phone or ''"/></td>
</tr>
<tr>
<td class="header-cell"><strong>身份证号</strong></td>
<td><span t-esc="doc.card or ''"/></td>
<td class="header-cell"><strong>变更费用</strong></td>
<td><span t-esc="'%.2f' % doc.fee if doc.fee else '0.00'"/></td>
</tr>
<tr>
<td class="header-cell"><strong>生效日期</strong></td>
<td colspan="3"><span t-esc="doc.effective_date and doc.effective_date.strftime('%Y-%m-%d') or ''"/></td>
</tr>
</t>
<!-- 延长租期专属字段 -->
<t t-if="doc.renewal_type == 'extend'">
<tr>
<td class="header-cell"><strong>实际结束日期</strong></td>
<td colspan="3"><span t-esc="doc.actual_end_date and doc.actual_end_date.strftime('%Y-%m-%d') or ''"/></td>
</tr>
</t>
<!-- 附件 -->
<t t-if="doc.document_ids">
<tr>
<td class="header-cell"><strong>附件</strong></td>
<td colspan="3" class="text-left">
<t t-foreach="doc.document_ids" t-as="att">
<div style="padding-left:1em;"><span t-esc="att.name"/></div>
</t>
</td>
</tr>
</t>
<!-- 应收明细(合同终止时显示) -->
<t t-if="doc.renewal_type == 'early_checkout' and doc.receivables_ids">
<tr>
<td colspan="4" class="section-header"><strong>应收明细</strong></td>
</tr>
<tr>
<td class="header-cell"><strong>类型</strong></td>
<td class="header-cell"><strong>应收日期</strong></td>
<td class="header-cell"><strong>金额</strong></td>
<td class="header-cell"><strong>减免金额</strong></td>
</tr>
<t t-foreach="doc.receivables_ids" t-as="line">
<tr>
<td><span t-esc="line.management_type_id.name or ''"/></td>
<td><span t-esc="line.due_date and line.due_date.strftime('%Y-%m-%d') or ''"/></td>
<td><span t-esc="'%.2f' % line.original_amount if line.original_amount else '0.00'"/></td>
<td><span t-esc="'%.2f' % line.reduction_amount if line.reduction_amount else '0.00'"/></td>
</tr>
</t>
</t>
<!-- 租金明细(延长租期时显示) -->
<t t-if="doc.renewal_type == 'extend' and doc.breakdown_ids">
<tr>
<td colspan="4" class="section-header"><strong>租金明细</strong></td>
</tr>
<tr>
<td class="header-cell"><strong>单价</strong></td>
<td class="header-cell"><strong>月租金</strong></td>
<td class="header-cell"><strong>开始日期</strong></td>
<td class="header-cell"><strong>结束日期</strong></td>
</tr>
<t t-foreach="doc.breakdown_ids" t-as="line">
<tr>
<td><span t-esc="'%.4f' % line.unit_price if line.unit_price else '0.0000'"/></td>
<td><span t-esc="'%.2f' % line.monthly_amount if line.monthly_amount else '0.00'"/></td>
<td><span t-esc="line.start_data and line.start_data.strftime('%Y-%m-%d') or ''"/></td>
<td><span t-esc="line.end_data and line.end_data.strftime('%Y-%m-%d') or ''"/></td>
</tr>
<tr>
<td class="header-cell"><strong>期间月数</strong></td>
<td><span t-esc="line.month_number or 0"/></td>
<td class="header-cell"><strong>期间租金</strong></td>
<td><span t-esc="'%.2f' % line.period_rent if line.period_rent else '0.00'"/></td>
</tr>
</t>
</t>
<!-- 审批详情 -->
<tr>
<td colspan="4" class="section-header"><strong>审批详情</strong></td>
</tr>
<t t-if="doc.log_ids">
<t t-set="logs_ordered" t-value="doc.get_logs_for_print()"/>
<t t-foreach="logs_ordered" t-as="log">
<tr>
<td colspan="1"><span t-esc="log.name or '节点'"/></td>
<td class="no-right-border" colspan="2"><span t-esc="log.comment or ''"/></td>
<td class="no-left-border" colspan="1">
<t t-if="log.done_by">
<span t-esc="log.done_by.name"/>
<span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
</t>
</td>
</tr>
</t>
</t>
</table>
</t>
</t>
</t>
</template>
</odoo>