押金
This commit is contained in:
@@ -4,7 +4,7 @@ from odoo import api, models
|
||||
|
||||
|
||||
class DepositMonthReceivableReport(models.Model):
|
||||
_inherit = 'receivable.modify.line'
|
||||
_inherit = 'property.accounts.receivable'
|
||||
|
||||
@api.model
|
||||
def get_deposit_month_receivable_report(self, params):
|
||||
@@ -12,7 +12,7 @@ class DepositMonthReceivableReport(models.Model):
|
||||
押金本月应收报表:
|
||||
- 管理费用类型为"押金"
|
||||
- 应收开始时间在查询月中
|
||||
- 金额取交易金额
|
||||
- 金额取应收账单的原始金额
|
||||
"""
|
||||
deposit_type = self.env['yuthon.management.type'].search([('name', '=', '押金')], limit=1)
|
||||
|
||||
@@ -23,34 +23,33 @@ class DepositMonthReceivableReport(models.Model):
|
||||
date_start = params.get("date_start")
|
||||
date_end = params.get("date_end")
|
||||
if date_start:
|
||||
domain.append(('receivable_id.due_date', '>=', datetime.datetime.fromisoformat(date_start).date()))
|
||||
domain.append(('due_date', '>=', datetime.datetime.fromisoformat(date_start).date()))
|
||||
if date_end:
|
||||
domain.append(('receivable_id.due_date', '<=', datetime.datetime.fromisoformat(date_end).date()))
|
||||
domain.append(('due_date', '<=', datetime.datetime.fromisoformat(date_end).date()))
|
||||
|
||||
keyword = params.get("keyword")
|
||||
if keyword:
|
||||
domain += ['|', '|',
|
||||
('receivable_id.contract_id.contract_code', 'ilike', keyword),
|
||||
('receivable_id.property_name', 'ilike', keyword),
|
||||
('receivable_id.lessee_id.name', 'ilike', keyword),
|
||||
('contract_id.contract_code', 'ilike', keyword),
|
||||
('property_name', 'ilike', keyword),
|
||||
('lessee_id.name', 'ilike', keyword),
|
||||
]
|
||||
|
||||
condition = params.get('condition')
|
||||
partner_id = params.get('partner_id')
|
||||
company_id = params.get('company_id')
|
||||
if condition:
|
||||
domain.append(('receivable_id.tenure_type', '=', condition))
|
||||
domain.append(('tenure_type', '=', condition))
|
||||
if partner_id:
|
||||
domain.append(('receivable_id.precinct_id', '=', partner_id))
|
||||
domain.append(('precinct_id', '=', partner_id))
|
||||
if company_id:
|
||||
domain.append(('receivable_id.company_id', '=', company_id))
|
||||
domain.append(('company_id', '=', company_id))
|
||||
|
||||
lines = self.search(domain, order="receivable_id asc")
|
||||
receivables = self.search(domain, order="id asc")
|
||||
|
||||
rows = []
|
||||
total_amount = 0.0
|
||||
for idx, line in enumerate(lines, start=1):
|
||||
rec = line.receivable_id
|
||||
for idx, rec in enumerate(receivables, start=1):
|
||||
amount = round(rec.original_amount or 0.0, 2) # 取应收账单的原始金额
|
||||
total_amount += amount
|
||||
rows.append({
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{
|
||||
"sideBar": true,
|
||||
"report_config": {
|
||||
"model": "receivable.modify.line",
|
||||
"model": "property.accounts.receivable",
|
||||
"method": "get_deposit_month_receivable_report",
|
||||
"columns": [
|
||||
{"headerName": "序号", "field": "序号", "width": 45, "flex": 0, "pinned": "left"},
|
||||
|
||||
Reference in New Issue
Block a user