添加功能
This commit is contained in:
@@ -9,6 +9,7 @@ class ClickReconciliationWizard(models.Model):
|
||||
message = fields.Text(string='确认信息', readonly=True)
|
||||
|
||||
def action_confirm(self):
|
||||
target_lessee = '广州志为健康管理咨询有限公司'
|
||||
unreconciled_states = ['not_reconciled', 'registered']
|
||||
|
||||
bank_statements = self.env["property.bank.statements"].search([
|
||||
@@ -54,6 +55,7 @@ class ClickReconciliationWizard(models.Model):
|
||||
('contract_id', 'in', contract_ids),
|
||||
('due_date', '>=', month_start),
|
||||
('due_date', '<', month_end),
|
||||
('lessee_id.name', '=', target_lessee),
|
||||
])
|
||||
if not receivables:
|
||||
continue # 无匹配应收单,跳过
|
||||
@@ -89,11 +91,20 @@ class ClickReconciliationWizard(models.Model):
|
||||
})
|
||||
|
||||
for statement in statements:
|
||||
self.env['receivable.modify.line'].create({
|
||||
'is_write': True,
|
||||
'is_penalty': False,
|
||||
'bank_id': statement.id,
|
||||
'reconciliation_date': (fields.Datetime.from_string(statement.start_time) - timedelta(hours=8)).date(),
|
||||
'receivable_id': rec.id,
|
||||
'amount': rec.original_amount,
|
||||
})
|
||||
modify = self.env['receivable.modify.line'].search([
|
||||
('receivable_id', '=', rec.id),
|
||||
('bank_id', '=', statement.id),
|
||||
('is_write', '=', True),
|
||||
('is_penalty', '=', False),
|
||||
('reconciliation_date', '=', (fields.Datetime.from_string(statement.start_time) - timedelta(hours=8)).date()),
|
||||
('amount', '=', rec.original_amount)
|
||||
])
|
||||
if not modify:
|
||||
self.env['receivable.modify.line'].create({
|
||||
'is_write': True,
|
||||
'is_penalty': False,
|
||||
'bank_id': statement.id,
|
||||
'reconciliation_date': (fields.Datetime.from_string(statement.start_time) - timedelta(hours=8)).date(),
|
||||
'receivable_id': rec.id,
|
||||
'amount': rec.original_amount,
|
||||
})
|
||||
@@ -30,7 +30,7 @@ class PropertyReconciliationWizard(models.Model):
|
||||
for rec in self:
|
||||
rec.amount_reconciled = rec.actual_total - rec.amount_been_reconciled - sum(line.amount for line in rec.reconciliation_line_ids)
|
||||
for line in rec.reconciliation_line_ids:
|
||||
if line.rent_month == line.rent:
|
||||
if line.rent_month == line.amount:
|
||||
line.remake = str(rec.actual_date) + '补' + str(line.due_date)
|
||||
|
||||
@api.depends('reconciliation_line_ids')
|
||||
|
||||
Reference in New Issue
Block a user