diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index cd0eecfb9..fbc442a8d 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -567,17 +567,27 @@ class PropertyReconciliationLine(models.Model): due_date_str = due_date.strftime('%Y-%m') actual_date_str = actual_date.strftime('%Y-%m-%d') rent = round(line.rent or 0, 2) - debt_amount = round(rent - line.amount, 2) - # 不显示备注条件:年月相同 + rent == rent_month + rent_month = round(line.rent_month or 0, 2) + amount = round(line.amount or 0, 2) + debt_amount = round(rent - amount, 2) + + # ===================== 不显示备注条件 ===================== 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)) + no_remark = same_month and (rent == rent_month) if no_remark: line.remake = "" continue + debt_str = f',欠{debt_amount}' if debt_amount != 0 else '' + if same_month: + # 条件1:rent_month≠rent 且 rent_month≠amount 且 amount≠0 → 补交 + if rent_month != rent and rent_month != amount and amount != 0: + line.remake = f'补交{due_date_str}' + # 条件2:rent == amount → 补齐 + elif rent == amount and amount != 0: + line.remake = f'补齐{due_date_str}' + continue 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: - line.remake = f'交{due_date_str}{debt_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}{debt_str}' \ No newline at end of file + line.remake = f'{actual_date_str}补{due_date.strftime("%Y-%m-%d")}{debt_str}' \ No newline at end of file