添加功能

This commit is contained in:
李鹏宇
2026-06-15 10:06:31 +08:00
parent b22736da9e
commit f48286b6e7
5 changed files with 7 additions and 4 deletions
@@ -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(
@@ -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='应收日期')
@@ -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}",
@@ -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, {
@@ -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,