From 21209602365dee12b624f67e1efae5bdebdc65ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Thu, 18 Jun 2026 19:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_report/models/pre_arrears_report.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yuthon_report/models/pre_arrears_report.py b/yuthon_report/models/pre_arrears_report.py index 163cd0ddc..753963cd7 100644 --- a/yuthon_report/models/pre_arrears_report.py +++ b/yuthon_report/models/pre_arrears_report.py @@ -19,7 +19,7 @@ class PreArrearsReport(models.Model): 1. receivable.modify.line: 有 reconciliation_date 且 reconciliation_date月 > due_date月 且 reconciliation_date月 >= 查询月 → 欠收金额取 amount 2. property.accounts.receivable: is_reconciliation=False 且 due_date月 < 查询月 - → 从未对过账,欠收金额取 submitted + 且 payout_date 为空 → 从未对过账且未收款,欠收金额取 submitted - 按应收账单聚合,每张账单只出一行 """ today = datetime.date.today() @@ -111,13 +111,14 @@ class PreArrearsReport(models.Model): # ============================================================ # 第二部分:从 property.accounts.receivable 取 is_reconciliation=False 的记录 - # 即:未对过账的应收账单,due_date月 < 查询月,欠收金额取 submitted + # 即:未对过账且未收款(payout_date为空)的应收账单,due_date月 < 查询月,欠收金额取 submitted # ============================================================ covered_ids = list(rec_map.keys()) receivable_domain = [ ('is_reconciliation', '=', False), ('due_date', '<', query_month_start), + ('payout_date', '=', False), ('is_invalid', '!=', True), ] if covered_ids: