diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index b1d1f2f7b..62fdbf426 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -259,8 +259,8 @@ class HrAttendanceDetail(models.Model): # 获取所有层级部门ID和部门名称 all_dept_ids, all_dept_names = get_all_upper_depts(employee.department_id) - # 打印所有层级的部门名称 - print("当前员工所属所有层级部门名称:", all_dept_names) + # # 打印所有层级的部门名称 + # print("当前员工所属所有层级部门名称:", all_dept_names) if is_resource_user: attendance = self.env['hr.attendance'].search( diff --git a/yuthon_property/models/property_rent_list.py b/yuthon_property/models/property_rent_list.py index f2b28c092..b1e85c468 100644 --- a/yuthon_property/models/property_rent_list.py +++ b/yuthon_property/models/property_rent_list.py @@ -15,6 +15,7 @@ class PropertyRentList(models.Model): tax = fields.Float(string='税率') title_certificate = fields.Char(sting="产权证号") acc_type = fields.Selection([('new', '新租'), ('done', '到期')], string='类型') + percentage_damages = fields.Float(string='违约金比例') invoicing_type = fields.Selection([('spot', '专票'), ('cape', '普票')], related='lessee_id.invoicing_type', string="开票类型") due_date = fields.Date(string='应收日期') diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 1cbfc9576..5aba10c1c 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -1398,6 +1398,7 @@ class PropertyRentList(models.Model): 'lessee_id': contract.lessee_id.id if contract and contract.lessee_id else None, 'original_amount': rec.original_amount, 'is_liquidated_damages': rec.is_liquidated_damages, + 'penalty': rec.percentage_damages, 'due_date': due_date, 'acc_type': rec.acc_type, 'charging_range': f"{due_date} 到 {due_date_end}", diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index 58f43853b..43537e05d 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -184,7 +184,7 @@ class PropertyReconciliationWizard(models.Model): late_days = (fields.Date.from_string(self.actual_date) - next_month_first).days + 1 # 找到符合月份的租金 penalty_amount = late_days * round( - contract_receivables.submitted * float(contract_id.percentage_liquidated_damages.name), 2 + contract_receivables.submitted * float(contract_receivables.percentage_damages), 2 ) start_date_str = fields.Date.to_string(next_month_first) end_date_str = self.actual_date @@ -219,7 +219,7 @@ class PropertyReconciliationWizard(models.Model): last_month_rent = rent.submitted penalty_days = self.actual_date - first_day penalty_amount = (penalty_days.days + 1) * round( - last_month_rent * float(contract_id.percentage_liquidated_damages.name), 2 + last_month_rent * float(rent.percentage_damages), 2 ) if contract_id else 0.0 if penalty_amount > 0: new_lines.append((0, 0, { diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index 4880914f3..b1a6c4d68 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -68,6 +68,7 @@ class PropertyRentalWizard(models.Model): "contract_id": record.id, "due_date": start_date, 'multiplier': multiplier, + "percentage_damages": float(record.percentage_liquidated_damages.name) if record.percentage_liquidated_damages else 0, 'acc_type': acc_type, "lessee_id": record.lessee_id.id, "property_id": property_id,