From f39d7089dc7a2dcb9918f203daa4a0fb6cfc7941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Tue, 31 Mar 2026 16:29:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E6=9C=88=E5=BA=94=E6=94=B6=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_report/models/month_receivable_report.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yuthon_report/models/month_receivable_report.py b/yuthon_report/models/month_receivable_report.py index d0b8458e7..20ef24b5f 100644 --- a/yuthon_report/models/month_receivable_report.py +++ b/yuthon_report/models/month_receivable_report.py @@ -10,7 +10,8 @@ class MonthReceivableReport(models.Model): @api.model def get_month_receivable_report(self, params): """本月应收(数据源:receivable.modify.line): - - 收款日期(reconciliation_date)在查询月内 + - 应收日期(due_date)在查询月内(本月该收的账单) + - 有收款记录(reconciliation_date != False) - 排除跨月预收:reconciliation_date < due_date 且不在同年同月 - 金额取收款记录的 amount - 按应收账单聚合,每张账单只出一行 @@ -22,8 +23,9 @@ class MonthReceivableReport(models.Model): month_last = query_date.replace(day=last_day) domain = [ - ('reconciliation_date', '>=', month_first), - ('reconciliation_date', '<=', month_last), + ('reconciliation_date', '!=', False), + ('receivable_id.due_date', '>=', month_first), + ('receivable_id.due_date', '<=', month_last), ('receivable_id.is_invalid', '=', False), ]