@@ -65,20 +65,41 @@ class PropertyBankStatements(models.Model):
|
||||
|
||||
def _get_reconciliation_vals(self, record):
|
||||
if record.name:
|
||||
dt = datetime.strptime(str(self.start_time), '%Y-%m-%d %H:%M:%S').date()
|
||||
bank_id = self.env['property.bank.line'].search([('bank', '=', record.name)])
|
||||
first_day = dt.replace(day=1)
|
||||
last_day = first_day + relativedelta(months=1) - relativedelta(days=1)
|
||||
total_rent_month = 0
|
||||
if bank_id:
|
||||
tenant_id = bank_id.tenant_id
|
||||
# 应收租金
|
||||
rent_ids = self.env['property.rent.list'].search([('lessee_id', '=', tenant_id.id)])
|
||||
rent_ids = self.env['property.rent.list'].search([
|
||||
('lessee_id', '=', tenant_id.id),
|
||||
('due_date', '>=', fields.Date.to_string(first_day)),
|
||||
('due_date', '<=', fields.Date.to_string(last_day)),
|
||||
])
|
||||
# 应收押金
|
||||
deposit_ids = self.env['property.deposit.list'].search([('lessee_id', '=', tenant_id.id)])
|
||||
deposit_ids = self.env['property.deposit.list'].search([
|
||||
('lessee_id', '=', tenant_id.id),
|
||||
])
|
||||
# 应收管理费
|
||||
management_ids = self.env['property.management.list'].search([('lessee_id', '=', tenant_id.id)])
|
||||
management_ids = self.env['property.management.list'].search([
|
||||
('lessee_id', '=', tenant_id.id),
|
||||
('due_date', '>=', fields.Date.to_string(first_day)),
|
||||
('due_date', '<=', fields.Date.to_string(last_day)),
|
||||
])
|
||||
# 应收水费
|
||||
water_ids = self.env['property.water.list'].search([('lessee_id', '=', tenant_id.id)])
|
||||
water_ids = self.env['property.water.list'].search([
|
||||
('lessee_id', '=', tenant_id.id),
|
||||
('due_date', '>=', fields.Date.to_string(first_day)),
|
||||
('due_date', '<=', fields.Date.to_string(last_day)),
|
||||
])
|
||||
# 应收电费
|
||||
electricity_ids = self.env['property.tariff.list'].search([('lessee_id', '=', tenant_id.id)])
|
||||
electricity_ids = self.env['property.tariff.list'].search([
|
||||
('lessee_id', '=', tenant_id.id),
|
||||
('due_date', '>=', fields.Date.to_string(first_day)),
|
||||
('due_date', '<=', fields.Date.to_string(last_day)),
|
||||
])
|
||||
|
||||
def create_reconciliation_vals(ids, collection_type_val, sequence_val):
|
||||
"""
|
||||
@@ -95,7 +116,6 @@ class PropertyBankStatements(models.Model):
|
||||
'repair_fee': '维修费',
|
||||
'other': '其他'
|
||||
}
|
||||
|
||||
nonlocal total_rent_month
|
||||
vals_list = []
|
||||
current_sequence = sequence_val
|
||||
@@ -259,6 +279,7 @@ class PropertyAccountsReceivable(models.Model):
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
tenure_type = fields.Selection(related='property_id.tenure_type', string="权属类型", store=True)
|
||||
precinct_id = fields.Many2one(related='property_id.precinct_id', string="所属片区", store=True)
|
||||
penalty = fields.Float(string="违约金")
|
||||
penalty_date = fields.Date(string="违约金日期")
|
||||
# 报表新增字段
|
||||
|
||||
Reference in New Issue
Block a user