@@ -31,7 +31,7 @@ class DepositPreReceivedReport(models.Model):
|
||||
domain = [
|
||||
('management_type_id.name', '=', '押金'),
|
||||
('is_invalid', '!=', True),
|
||||
('deposit_state', 'in', ['paid', 'yes']),
|
||||
('deposit_state', 'in', ['paid', 'yes', 'no']),
|
||||
]
|
||||
|
||||
keyword = params.get("keyword")
|
||||
@@ -65,10 +65,13 @@ class DepositPreReceivedReport(models.Model):
|
||||
|
||||
# 内存过滤:按状态分别处理
|
||||
# - 已收(paid):收款日期必须存在且 < 查询月初(前期实收 = 查询月之前收到)
|
||||
# - 待退(no):收款日期存在且 < 查询月初(已收但未退,属于前期实收)
|
||||
# - 已退(yes):退款日期 > 查询月末 且 收款日期 < 查询月初(查询时还没退,且是前期收的)
|
||||
lines = lines.filtered(
|
||||
lambda l: (
|
||||
l.deposit_state == 'paid' and l.payout_date and l.payout_date < month_first
|
||||
) or (
|
||||
l.deposit_state == 'no' and l.payout_date and l.payout_date < month_first
|
||||
) or (
|
||||
l.deposit_state == 'yes' and l.has_date and l.has_date > month_last
|
||||
and l.payout_date and l.payout_date < month_first
|
||||
@@ -94,8 +97,17 @@ class DepositPreReceivedReport(models.Model):
|
||||
elif rec:
|
||||
property_val = rec.property_name or ''
|
||||
|
||||
# 状态映射:deposit_state 值 → 中文显示名
|
||||
state_display = {
|
||||
'unpaid': '未收',
|
||||
'no_paid': '收部分',
|
||||
'paid': '已收',
|
||||
'no': '待退',
|
||||
'yes': '已退',
|
||||
}
|
||||
rows.append({
|
||||
"序号": idx,
|
||||
"状态": state_display.get(rec.deposit_state, rec.deposit_state or ""),
|
||||
"合同编号": {
|
||||
'model': 'property.lease.contract',
|
||||
'id': contract.id,
|
||||
|
||||
@@ -46,7 +46,7 @@ class DepositTotalReport(models.Model):
|
||||
domain = [
|
||||
('management_type_id.name', '=', '押金'),
|
||||
('is_invalid', '!=', True),
|
||||
('deposit_state', 'in', ['paid', 'yes']),
|
||||
('deposit_state', 'in', ['paid', 'yes', 'no']),
|
||||
]
|
||||
|
||||
keyword = params.get("keyword")
|
||||
@@ -83,10 +83,13 @@ class DepositTotalReport(models.Model):
|
||||
|
||||
# 内存过滤:按状态分别处理
|
||||
# - 已收(paid):收款日期必须存在且 <= 查询月末(累计逻辑,含提前预收)
|
||||
# - 待退(no):收款日期存在且 <= 查询月末(已收未退,应包含在累计押金中)
|
||||
# - 已退(yes):退款日期 > 查询月末(查询时还没退,不受 payout_date 约束)
|
||||
lines = lines.filtered(
|
||||
lambda l: (
|
||||
l.deposit_state == 'paid' and l.payout_date and l.payout_date <= month_last
|
||||
) or (
|
||||
l.deposit_state == 'no' and l.payout_date and l.payout_date <= month_last
|
||||
) or (
|
||||
l.deposit_state == 'yes' and (
|
||||
(l.has_date and l.has_date > month_last) or
|
||||
@@ -116,8 +119,17 @@ class DepositTotalReport(models.Model):
|
||||
elif rec:
|
||||
property_val = rec.property_name or ''
|
||||
|
||||
# 状态映射:deposit_state 值 → 中文显示名
|
||||
state_display = {
|
||||
'unpaid': '未收',
|
||||
'no_paid': '收部分',
|
||||
'paid': '已收',
|
||||
'no': '待退',
|
||||
'yes': '已退',
|
||||
}
|
||||
rows.append({
|
||||
"序号": idx,
|
||||
"状态": state_display.get(rec.deposit_state, rec.deposit_state or ""),
|
||||
"合同编号": {
|
||||
'model': 'property.lease.contract',
|
||||
'id': contract.id,
|
||||
|
||||
@@ -291,6 +291,18 @@ class LeasedAreaReport(models.Model):
|
||||
property_name_value = display_property_name
|
||||
|
||||
# --- 6.9 构建行数据(物业名称、合同编号、承租方支持穿透) ---
|
||||
# 实际起止时间格式化
|
||||
actual_start = contract.actual_start_time
|
||||
if actual_start:
|
||||
actual_start_str = actual_start.strftime("%Y-%m-%d") if hasattr(actual_start, 'strftime') else str(actual_start)
|
||||
else:
|
||||
actual_start_str = ""
|
||||
actual_end = contract.actual_end_time
|
||||
if actual_end:
|
||||
actual_end_str = actual_end.strftime("%Y-%m-%d") if hasattr(actual_end, 'strftime') else str(actual_end)
|
||||
else:
|
||||
actual_end_str = ""
|
||||
|
||||
rows.append({
|
||||
"序号": idx,
|
||||
"物业id": display_property_ids,
|
||||
@@ -305,8 +317,8 @@ class LeasedAreaReport(models.Model):
|
||||
'id': lessee_record_id,
|
||||
'display_name': lessee_name,
|
||||
} if lessee_record_id else lessee_name or "",
|
||||
"产权证号": title_certificate,
|
||||
"产权地址": property_address,
|
||||
"实际开始时间": actual_start_str,
|
||||
"实际结束日期": actual_end_str,
|
||||
"物业已租面积": round(property_area, 4),
|
||||
"合同已租面积": round(contract_area, 4),
|
||||
"片区管理员": admin_display,
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"dateMode": "single",
|
||||
"columns": [
|
||||
{"headerName": "序号", "field": "序号", "width": 45, "flex": 0, "pinned": "left"},
|
||||
{"headerName": "状态", "field": "状态", "flex": 0.8},
|
||||
{"headerName": "合同编号", "field": "合同编号", "flex": 1.2},
|
||||
{"headerName": "物业名称", "field": "物业名称", "flex": 2.5},
|
||||
{"headerName": "承租方名称", "field": "承租方名称", "flex": 1.4},
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"method": "get_deposit_total_report",
|
||||
"columns": [
|
||||
{"headerName": "序号", "field": "序号", "width": 45, "flex": 0, "pinned": "left"},
|
||||
{"headerName": "状态", "field": "状态", "flex": 0.8},
|
||||
{"headerName": "合同编号", "field": "合同编号", "flex": 1.2},
|
||||
{"headerName": "物业名称", "field": "物业名称", "flex": 2},
|
||||
{"headerName": "承租方名称", "field": "承租方名称", "flex": 1.5},
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
{"headerName": "物业名称", "field": "物业名称", "flex": 1.8},
|
||||
{"headerName": "合同编号", "field": "合同编号", "flex": 1.5},
|
||||
{"headerName": "承租方", "field": "承租方", "flex": 1.2},
|
||||
{"headerName": "产权证号", "field": "产权证号", "flex": 1.2},
|
||||
{"headerName": "产权地址", "field": "产权地址", "flex": 1.8},
|
||||
{"headerName": "实际开始时间", "field": "实际开始时间", "flex": 1.2},
|
||||
{"headerName": "实际结束日期", "field": "实际结束日期", "flex": 1.2},
|
||||
{"headerName": "物业已租面积", "field": "物业已租面积", "flex": 1.2, "type": "number"},
|
||||
{"headerName": "合同已租面积", "field": "合同已租面积", "flex": 1.2, "type": "number"},
|
||||
{"headerName": "片区管理员", "field": "片区管理员", "flex": 1.2}
|
||||
|
||||
Reference in New Issue
Block a user