@@ -118,7 +118,7 @@
|
||||
<field name="name">receivable.modify.line.tree</field>
|
||||
<field name="model">receivable.modify.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="应收流水中间表" editable="top">
|
||||
<tree string="应收流水中间表" editable="top" default_order="due_date desc">
|
||||
<field name="bank_id"/>
|
||||
<field name="no_amount"/>
|
||||
<field name="bank_state"/>
|
||||
|
||||
@@ -30,9 +30,9 @@ class PreArrearsReport(models.Model):
|
||||
query_month_start = datetime.datetime.fromisoformat(date_start).date() if date_start else this_month_first
|
||||
query_month_end = datetime.datetime.fromisoformat(date_end).date() if date_end else this_month_first
|
||||
|
||||
# 核心逻辑:due_date <= cutoff_date(查询月及之前的应收)
|
||||
# 核心逻辑:due_date < query_month_start(应收日期在查询月之前,不包含查询月)
|
||||
domain = [
|
||||
('receivable_id.due_date', '<=', cutoff_date),
|
||||
('receivable_id.due_date', '<', query_month_start),
|
||||
('receivable_id.is_invalid', '=', False),
|
||||
]
|
||||
|
||||
@@ -83,14 +83,6 @@ class PreArrearsReport(models.Model):
|
||||
(l.not_collected and l.not_collected > 0)
|
||||
)
|
||||
)
|
||||
|
||||
# 调试日志
|
||||
print(f"[前期欠收报表] 查询到的 lines 数量: {len(lines)}")
|
||||
for line in lines:
|
||||
print(f" - line.id={line.id}, receivable_id={line.receivable_id.id}, "
|
||||
f"due_date={line.receivable_id.due_date}, "
|
||||
f"reconciliation_date={line.reconciliation_date}, "
|
||||
f"not_collected={line.not_collected}, amount={line.amount}")
|
||||
|
||||
# 按应收账单聚合
|
||||
rec_map = {}
|
||||
@@ -103,11 +95,6 @@ class PreArrearsReport(models.Model):
|
||||
# 收集收款日期
|
||||
if line.reconciliation_date:
|
||||
rec_map[rid]['reconciliation_dates'].append(line.reconciliation_date)
|
||||
|
||||
# 调试日志
|
||||
print(f"[前期欠收报表] 聚合后的 rec_map 数量: {len(rec_map)}")
|
||||
for rid, data in rec_map.items():
|
||||
print(f" - receivable_id={rid}, amount={data['amount']}")
|
||||
|
||||
rows = []
|
||||
total_amount = 0.0
|
||||
|
||||
@@ -98,7 +98,7 @@ class YuthonProperty(models.Model):
|
||||
for rec in data['recs']:
|
||||
type_name = rec.management_type_id.name if rec.management_type_id else ''
|
||||
col = self._classify_fee_type(type_name)
|
||||
fee_row[col] += rec.original_amount or 0.0
|
||||
fee_row[col] += (rec.original_amount or 0.0) - (rec.discount_amount or 0.0)
|
||||
|
||||
subtotal = sum(fee_row.values())
|
||||
for col in self.FEE_COLUMNS:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="action_property_accounts_receivable_report" model="ir.actions.client">
|
||||
<field name="name">应收账单报表</field>
|
||||
<field name="name">当期应收</field>
|
||||
<field name="tag">receivable_report_client</field>
|
||||
<field name="context">
|
||||
{
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<menuitem
|
||||
id="menu_property_accounts_receivable_report2"
|
||||
name="应收账单报表"
|
||||
name="当期应收"
|
||||
parent="yuthon_property_income_menu"
|
||||
action="action_property_accounts_receivable_report"
|
||||
sequence="1"
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
<!--<field name="type_stamp_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}}"/>-->
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="is_finance_business" invisible="1"/>
|
||||
<field name="receivable_amount" invisible="not is_finance_business"/>
|
||||
<field name="payable_amount" invisible="not is_finance_business"/>
|
||||
<field name="receivable_amount" string="收款金额" invisible="not is_finance_business"/>
|
||||
<field name="payable_amount" string="付款金额" invisible="not is_finance_business"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
Reference in New Issue
Block a user