添加功能

This commit is contained in:
李鹏宇
2026-03-31 10:52:32 +08:00
parent 3b4aedbc9d
commit 157bcfc770
@@ -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: