添加功能

This commit is contained in:
李鹏宇
2025-09-29 09:35:29 +08:00
parent 285c2ecb39
commit 635b18fcd6
5 changed files with 109 additions and 1 deletions
+1
View File
@@ -15,6 +15,7 @@
'report/lease_contract_templates.xml',
'report/property_accounting_templates.xml',
'report/property_construction_templates.xml',
'report/contract_accounts_receivable_templates.xml',
'views/property_billing_confirmation.xml',
'views/inherit_property_tenant_information_views.xml',
'views/property_approval_views.xml',
@@ -10,6 +10,7 @@ class ContractAccountsReceivable(models.Model):
lessee_id = fields.Many2one(related="contract_id.lessee_id", string='承租方')
property_name = fields.Char(related="contract_id.property_name", string='物业信息')
contract_accounts_ids = fields.One2many('property.accounts.receivable', 'contract_accounts_id', string='关联应收账单')
is_print = fields.Boolean(string="打印")
json_display = fields.Char(
string="收费项目详情",
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_contract_accounts_receivable">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<style type="text/css">
td {
border:1px solid #000000;
padding:8px;
/* 优化文字换行,避免内容溢出 */
word-break: break-all;
white-space: normal;
}
.title {
text-align:center;
font-weight:bold;
font-size:16px;
margin:15px 0;
}
.main-title {
font-weight:bold;
font-size:18px;
text-align:center;
margin:20px 0;
}
table {
border-collapse: collapse;
/* 保证表格列宽按设置生效 */
table-layout: fixed;
width: 100%;
}
.approval-table td {
border:1px solid #000000 !important;
}
/* 添加横向滚动容器,适配小屏幕 */
.table-container {
overflow-x: auto;
margin: 10px 0;
}
</style>
<div class="main-title">付款通知单</div>
<div class="table-container">
<table class="approval-table">
<thead>
<tr>
<th width="12%">收费项目</th>
<th width="8%">上月表数</th>
<th width="8%">本月表数</th>
<th width="8%">倍率</th>
<th width="10%">计费数量</th>
<th width="12%">应收开始</th>
<th width="12%">应收结束</th>
<th width="12%">应计金额</th>
<th width="10%">前期预收</th>
<th width="10%">实际应付</th>
<th width="10%">备注</th>
</tr>
</thead>
<tbody>
<t t-foreach="o.contract_accounts_ids" t-as="line">
<tr>
<td><t t-esc="line.management_type_id.name"/></td>
<td><t t-esc="line.last_month_table"/></td>
<td><t t-esc="line.this_month_table"/></td>
<td><t t-esc="line.ratio"/></td>
<td><t t-esc="line.billable_quantity"/></td>
<td><t t-esc="line.due_date"/></td>
<td><t t-esc="line.due_date_end"/></td>
<td><t t-esc="line.original_amount"/></td>
<td><t t-if="line.pre_collection"/></td>
<td><t t-if="line.actual_coping"/></td>
<td><t t-esc="line.remark"/></td>
</tr>
</t>
</tbody>
</table>
</div>
</t>
</t>
</t>
</template>
</odoo>
@@ -34,4 +34,24 @@
<field name="binding_model_id" ref="model_property_construction_approval"/>
<field name="binding_type">report</field>
</record>
<record id="action_property_construction_approval_report" model="ir.actions.report">
<field name="name">建设工程造价咨询合同报表</field>
<field name="model">property.construction.approval</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">yuthon_property_approval.report_property_construction_approval</field>
<field name="report_file">yuthon_property_approval.report_property_construction_approval</field>
<field name="print_report_name">建设工程造价咨询合同报表</field>
<field name="binding_model_id" ref="model_property_construction_approval"/>
<field name="binding_type">report</field>
</record>
<record id="action_contract_accounts_receivable_report" model="ir.actions.report">
<field name="name">付款通知单报表</field>
<field name="model">contract.accounts.receivable</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">yuthon_property_approval.report_contract_accounts_receivable</field>
<field name="report_file">yuthon_property_approval.report_contract_accounts_receivable</field>
<field name="print_report_name">付款通知单报表</field>
<field name="binding_model_id" ref="model_contract_accounts_receivable"/>
<field name="binding_type">report</field>
</record>
</odoo>
@@ -4,11 +4,12 @@
<field name="name">contract.accounts.receivable.tree</field>
<field name="model">contract.accounts.receivable</field>
<field name="arch" type="xml">
<tree string="应收账单(合同)">
<tree string="应收账单(合同)" decoration-success="is_print">
<field name="contract_id"/>
<field name="lessee_id"/>
<field name="property_name"/>
<field name="json_display" widget="json_template"/>
<field name="is_print"/>
</tree>
</field>
</record>