From 1c7f3695aa9d59fa41ae467235ce9a4e835ea535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 1 Apr 2026 10:29:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9C=AC=E6=9C=88=E5=AE=9E=E6=94=B6?= =?UTF-8?q?=E6=80=BB=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_report/models/total_received_report.py | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/yuthon_report/models/total_received_report.py b/yuthon_report/models/total_received_report.py index 588f58d3e..398f04276 100644 --- a/yuthon_report/models/total_received_report.py +++ b/yuthon_report/models/total_received_report.py @@ -9,10 +9,15 @@ class TotalReceivedReport(models.Model): @api.model def get_total_received_report(self, params): - """实收总额:查询月当月,应收类型不为押金和违约金的已对金额""" - domain = [('reconciliation_date', '!=', False)] + """本月实收总额 = 归属本月实收 + 本月预收 + 取数逻辑:收款日期(reconciliation_date)在查询月内的所有收款记录,金额取 amount + """ + domain = [ + ('reconciliation_date', '!=', False), + ('receivable_id.is_invalid', '=', False), + ] - # 单月日期过滤 + # 收款日期在查询月内 if params.get('date_start'): query_date = datetime.datetime.fromisoformat(params['date_start']).date() month_start = query_date.replace(day=1) @@ -23,11 +28,6 @@ class TotalReceivedReport(models.Model): ('reconciliation_date', '<=', month_end), ] - # 排除押金和违约金 - domain += [ - ('receivable_id.management_type_id.name', 'not in', ['押金', '违约金']), - ] - if params.get('keyword'): keyword = params['keyword'] domain += ['|', '|', @@ -40,6 +40,9 @@ class TotalReceivedReport(models.Model): partner_id = params.get('partner_id') company_id = params.get('company_id') management_type_id = params.get('management_type_id') + property_id = params.get('property_id') + lessee_id = params.get('lessee_id') + contract_id = params.get('contract_id') if condition: domain.append(('receivable_id.tenure_type', '=', condition)) @@ -49,6 +52,12 @@ class TotalReceivedReport(models.Model): domain.append(('receivable_id.company_id', '=', company_id)) if management_type_id: domain.append(('receivable_id.management_type_id', '=', management_type_id)) + if property_id: + domain.append(('receivable_id.property_ids', 'in', [property_id])) + if lessee_id: + domain.append(('receivable_id.lessee_id', '=', lessee_id)) + if contract_id: + domain.append(('receivable_id.contract_id', '=', contract_id)) lines = self.search(domain, order='reconciliation_date asc') @@ -57,7 +66,7 @@ class TotalReceivedReport(models.Model): for idx, line in enumerate(lines, start=1): rec = line.receivable_id contract = rec.contract_id if rec else None - amount = round(line.original_amount or 0.0, 2) + amount = round(line.amount or 0.0, 2) total_amount += amount # 物业穿透 @@ -98,11 +107,11 @@ class TotalReceivedReport(models.Model): '收款类型': rec.management_type_id.name if rec and rec.management_type_id else '', '金额': amount, '所属公司': contract.lessor_id.name if contract and contract.lessor_id else '', - "管理员": { + '管理员': { 'model': 'res.users', 'id': rec.admin_id.id, 'display_name': rec.admin_id.name, - } if rec.admin_id else "", + } if rec.admin_id else '', }) stats = [{'name': '合计', 'amount': round(total_amount, 2)}] From 854228c82d87b1dea9344ea0858ee258f6776864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 1 Apr 2026 10:43:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/property_lease_renewal_template.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yuthon_property_approval/report/property_lease_renewal_template.xml b/yuthon_property_approval/report/property_lease_renewal_template.xml index 3e8737eaf..c66f89ff1 100644 --- a/yuthon_property_approval/report/property_lease_renewal_template.xml +++ b/yuthon_property_approval/report/property_lease_renewal_template.xml @@ -66,13 +66,18 @@ 原承租方 - + 租赁合同 租金支付周期 - + + 月度 + 季度 + 半年 + 年度 + 租金