From 538cbda649724b605736f9a115c477a8abdda1ff 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: Thu, 30 Oct 2025 15:39:37 +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 | 30 ++----------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index 917605d84..667bf13e5 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -328,6 +328,7 @@ class PropertyReconciliationWizard(models.Model): assign_amount = min(rent, remaining_amount) line.amount = assign_amount remaining_amount -= assign_amount + line.onchange_remake() # 租金行分配完后,处理其他类型的行 if remaining_amount > 0: @@ -339,34 +340,7 @@ class PropertyReconciliationWizard(models.Model): assign_amount = min(rent, remaining_amount) line.amount = assign_amount remaining_amount -= assign_amount - - self._update_line_remarks() - - def _update_line_remarks(self): - """ - 分配金额后,更新明细行的备注(复用原onchange中的备注生成逻辑) - """ - for rec in self: - for line in rec.reconciliation_line_ids: - if line.amount == 0 and line.collection_type != 'penalty': - line.remake = "" - continue - if line.amount and line.collection_type != 'penalty' and line.due_date and rec.actual_date: - actual_date = rec.actual_date - due_date = line.due_date - actual_year, actual_month = actual_date.year, actual_date.month - due_year, due_month = due_date.year, due_date.month - due_date_str = due_date.strftime('%Y-%m') - actual_date_str = actual_date.strftime('%Y-%m-%d') - if (due_month > actual_month and due_year == actual_year) or (due_year > actual_year): - if line.rent >= line.amount: - line.remake = f'{actual_date_str}预{due_date_str},欠{round(line.rent - line.amount, 2)}' - elif due_month == actual_month and due_year == actual_year: - if line.rent >= line.amount: - line.remake = f'交{due_date_str},欠{round(line.rent - line.amount, 2)}' - elif (due_month < actual_month and due_year == actual_year) or (due_year < actual_year): - if line.rent >= line.amount: - line.remake = f'{actual_date_str}补{due_date_str},欠{round(line.rent - line.amount, 2)}' + line.onchange_remake() def confirm(self): collection_type_mapping = {