From 031bf93551f2dceb562d7daed2fa3bdffcde14d7 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Tue, 19 Aug 2025 09:42:22 +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 --- .../models/inherit_yuthon_property.py | 1 + .../wizard/property_reconciliation_wizard.py | 23 ++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 83937d5bb..36f785589 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -297,6 +297,7 @@ class PropertyBankStatements(models.Model): "default_account": record.name, "default_actual_total": record.original_amount, "default_reconciliation_line_ids": all_vals, + 'default_amount_reconciled': self.no_amount, "default_receivable_total": total_rent_month } diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index c1f8ab5eb..fd0d29663 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -126,17 +126,6 @@ class PropertyReconciliationWizard(models.Model): line.amount = 0 exact_match_line.amount = remaining_amount - # 计算已对账和未对账金额 - self.amount_been_reconciled = 0.0 - for line in self.reconciliation_line_ids: - self.amount_been_reconciled += line.amount - - if self.actual_total > self.amount_been_reconciled: - self.amount_reconciled = self.actual_total - self.amount_been_reconciled - else: - self.amount_reconciled = 0.0 - return - # 按合同和物业分组 groups = {} for line in self.reconciliation_line_ids: @@ -175,8 +164,6 @@ class PropertyReconciliationWizard(models.Model): rec.bank_id.registered = abs(rec.actual_total - rec.receivable_total) rec.bank_id.bank_state = 'registered' - rec.bank_id.yes_amount = rec.amount_been_reconciled - rec.bank_id.no_amount = rec.amount_reconciled first_line = bank_lines[0] for line in rec.reconciliation_line_ids: # 跳过金额为0的行 @@ -270,6 +257,16 @@ class PropertyReconciliationWizard(models.Model): 'reconciliation_time': fields.Datetime.now(), }) + # 计算已对账和未对账金额 + rec.amount_been_reconciled += line.amount + + if rec.actual_total > rec.amount_been_reconciled: + amount_reconciled = rec.actual_total - rec.amount_been_reconciled + else: + amount_reconciled = 0.0 + rec.bank_id.yes_amount = rec.amount_been_reconciled + rec.bank_id.no_amount = amount_reconciled + class PropertyReconciliationLine(models.Model):