From d7a1aa20d037fe2bea7362b70fa4df42cdfe27fd Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 15 Aug 2025 11:28:09 +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 --- .../views/property_management.xml | 6 +---- .../wizard/property_reconciliation_wizard.py | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/yuthon_property_approval/views/property_management.xml b/yuthon_property_approval/views/property_management.xml index 4288491ff..12f2d958d 100644 --- a/yuthon_property_approval/views/property_management.xml +++ b/yuthon_property_approval/views/property_management.xml @@ -91,11 +91,9 @@ - + - - @@ -103,8 +101,6 @@ - - diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index e1a9af611..3da1f531a 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -125,6 +125,26 @@ class PropertyReconciliationWizard(models.Model): 'sequence': int(line.sequence) + 1, } new_lines.append((0, 0, penalty_line_vals)) + # 上月违约金未对账延续 + receivable_penalties = self.env['property.accounts.receivable'].search([ + ('property_id', '=', line.property_id.id), + ('contract_id', '=', line.contract_id.id), + ('is_reconciliation', '=', False), + ('management_type_id.name', '=', '违约金') + ]) + for penalty in receivable_penalties: + receivable_line_vals = { + 'property_id': penalty.property_id.id, + 'contract_id': penalty.contract_id.id, + 'rent_month': 0, + 'due_date': penalty.due_date, + 'rent': penalty.submitted, + 'amount': 0, + 'collection_type': 'penalty', + 'remake': penalty.remark, + 'sequence': int(line.sequence) + 2, + } + new_lines.append((0, 0, receivable_line_vals)) if new_lines: keep_lines = [ @@ -162,6 +182,13 @@ class PropertyReconciliationWizard(models.Model): raise UserError(_( "错误:物业 '%s' 的对账明细行金额与租金不符,备注信息为必填项,请填写备注后再试。" ) % line.property_id.name) + line_date = fields.Date.from_string(line.due_date) + rec_date = fields.Date.from_string(rec.actual_date) + if (line_date.year, line_date.month) != (rec_date.year, rec_date.month): + if not line.remake: + raise UserError(_( + "错误:物业 '%s' 的对账明细行月份与对账月份不符,备注信息为必填项,请填写备注后再试。" + ) % line.property_id.name) first_day = line.due_date.replace(day=1) last_day = (first_day + relativedelta(months=1)) - relativedelta(days=1) domain = [