This commit is contained in:
李鹏宇
2026-05-09 10:44:49 +08:00
parent 729c976d9c
commit 24bd919219
2 changed files with 12 additions and 15 deletions
+3 -1
View File
@@ -35,13 +35,15 @@ class BusController(Controller):
if employee and attendance_iot_id not in employee.attendance_iot_ids.mapped('attendance_iot_id'):
employee.write({
'image_1920': data.get('photo'),
'avatar_image': data.get('photo'),
'attendance_iot_ids': [(0, 0, {
'employee_id': employee.id,
'attendance_address': '',
'attendance_iot_id': attendance_iot_id.id
})]
})
_logger.info("-------------------------%s创建成功-------------------------------" % (employee.name))
_logger.info(f"-------------{employee.name}人脸更新触发------人脸数据{data.get('photo')}-------------")
_logger.info("-------------%s创建成功-------------------" % (employee.name))
return {"Result": 0, "Msg": "添加成功"}
@route('/api/v1/record/face', methods=['POST'], type='json', auth='none', csrf=False)
+9 -14
View File
@@ -9,11 +9,11 @@ class PreArrearsReport(models.Model):
@api.model
def get_pre_arrears_report(self, params):
"""
前期欠收报表(数据源:receivable.modify.line):
- 查询条件的日期对应应收账单的 due_date(应收日期在查询月内)
- 收款日期(reconciliation_date)晚于应收日期(due_date)的记录就是欠收
- 金额取收款记录的 not_collected(未收金额/欠收金额)
- 按应收账单聚合,每张账单只出一行(汇总该账单下所有欠收收款金额)
前期欠收报表(数据源:receivable.modify.line):
- 查询条件的日期对应应收账单的 due_date(应收日期在查询月内)
- 欠收条件:not_collected > 0(有未收金额)
- 金额取收款记录的 not_collected(未收金额/欠收金额)
- 按应收账单聚合,每张账单只出一行(汇总该账单下所有欠收收款金额)
"""
today = datetime.date.today()
this_month_first = today.replace(day=1)
@@ -23,7 +23,7 @@ class PreArrearsReport(models.Model):
# 应收日期在查询日期之前(不含查询月)
cutoff_date = datetime.datetime.fromisoformat(date_start).date() if date_start else this_month_first
# 核心逻辑:due_date < cutoff_date,且收款日期 > 应收日期
# 核心逻辑:due_date < cutoff_date,且有未收金额
domain = [
('reconciliation_date', '!=', False),
('receivable_id.due_date', '<', cutoff_date),
@@ -65,15 +65,10 @@ class PreArrearsReport(models.Model):
domain.append(('receivable_id.management_type_id.name', 'not in', ['押金', '违约金']))
lines = self.sudo().search(domain, order="receivable_id asc, reconciliation_date asc")
# 欠收条件:reconciliation_date > due_date 且不在同一个月(跨月才算欠收)
# 欠收条件:not_collected > 0(有未收金额就算欠收)
lines = lines.filtered(
lambda l: l.reconciliation_date and l.receivable_id.due_date
and l.reconciliation_date > l.receivable_id.due_date
and not (
l.reconciliation_date.year == l.receivable_id.due_date.year
and l.reconciliation_date.month == l.receivable_id.due_date.month
)
lambda l: l.not_collected and l.not_collected > 0
)
# 按应收账单聚合