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: