From 157bcfc77046b5eb6f827a296f79a640bbbf9454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Tue, 31 Mar 2026 10:52:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wizard/property_reconciliation_wizard.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index 4f0229aa8..cd0eecfb9 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -568,18 +568,13 @@ class PropertyReconciliationLine(models.Model): actual_date_str = actual_date.strftime('%Y-%m-%d') rent = round(line.rent or 0, 2) debt_amount = round(rent - line.amount, 2) - # 欠款为0时不显示remake - if debt_amount == 0: - debt_str = "" - if (due_month > actual_month and due_year == actual_year) or (due_year > actual_year): - line.remake = f'{actual_date_str}预{due_date_str}' - elif (due_month < actual_month and due_year == actual_year) or (due_year < actual_year): - line.remake = f'{actual_date_str}补{due_date_str}' - else: - line.remake = "" + # 不显示备注条件:年月相同 + rent == rent_month + same_month = (due_month == actual_month) and (due_year == actual_year) + no_remark = same_month and (round(line.rent or 0, 2) == round(line.rent_month or 0, 2)) + if no_remark: + line.remake = "" continue - - debt_str = f',欠{debt_amount}' + debt_str = f',欠{debt_amount}' if debt_amount != 0 else '' if (due_month > actual_month and due_year == actual_year) or (due_year > actual_year): line.remake = f'{actual_date_str}预{due_date_str}{debt_str}' elif due_month == actual_month and due_year == actual_year: