diff --git a/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py b/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
index 28d42f7df..a3debf01a 100644
--- a/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
@@ -26,7 +26,7 @@ class YuthonOnboardApproval(models.Model):
employee_name = fields.Char(string='姓名')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
- yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
+ yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('ttcj','天投城建'),
('thlc', '天河粮储')], string="甲方")
account = fields.Char(string='账号')
reason = fields.Html(string="正文")
diff --git a/yuthon_property/models/property_bank_statements.py b/yuthon_property/models/property_bank_statements.py
index 243c07292..d789967da 100644
--- a/yuthon_property/models/property_bank_statements.py
+++ b/yuthon_property/models/property_bank_statements.py
@@ -21,10 +21,21 @@ class PropertyBankStatements(models.Model):
def button_reconciliation(self):
- pass
+ for rec in self:
+ receivable_id = self.env['property.accounts.receivable'].search([('property_id', '=', rec.property_id.id)])
+ if receivable_id:
+ difference_amount = receivable_id.original_amount - rec.original_amount
+ receivable_id.write({'is_reconciliation': True,
+ 'difference_amount': difference_amount})
def button_all_reconciliation(self):
- pass
+ statements_ids = self.env["property.bank.statements"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ for statements_id in statements_ids:
+ receivable_id = self.env['property.accounts.receivable'].search([('property_id', '=', statements_id.property_id.id)])
+ if receivable_id:
+ difference_amount = receivable_id.original_amount - statements_id.original_amount
+ receivable_id.write({'is_reconciliation': True,
+ 'difference_amount': difference_amount})
def unlink(self):
return super().unlink()
\ No newline at end of file
diff --git a/yuthon_property/wizard/property_statements_wizard.py b/yuthon_property/wizard/property_statements_wizard.py
index f990cdd9b..7bd6481d3 100644
--- a/yuthon_property/wizard/property_statements_wizard.py
+++ b/yuthon_property/wizard/property_statements_wizard.py
@@ -27,33 +27,38 @@ class PropertyStatementsWizard(models.Model):
self.property_bank_statements_data(row)
def property_bank_statements_data(self, row):
- if row[0].value:
- start_time = pd.to_datetime(row[0].value, unit='d', origin='1899-12-30')
+ if row[2].value:
+ start_time = pd.to_datetime(row[2].value, unit='d', origin='1899-12-30')
else:
start_time = None
+ name = row[0].value
company_id = self.env['yuthon.property.company'].search([('name', '=', row[1].value)])
- name = row[2].value
- name_account = row[3].value
- remake = row[4].value
- original_amount = row[5].value
- contract_id = self.env['property.lease.contract'].search([('name', '=', row[6].value)])
- property_id = self.env['yuthon.property'].search([('name', '=', row[7].value)])
- contract_account = row[8].value
- contract_penalty = row[9].value
- voucher_type = row[10].value
+ name_account = row[7].value
+ voucher_type = row[15].value
voucher_type_dict = {'电子转账凭证': 'electronic_transfer', '电汇凭证': 'telegraphic_transfer'}
voucher_type = voucher_type_dict.get(voucher_type)
+ if name:
+ bank_id = self.env['property.bank.line'].search([('bank', '=', name)])
+ if bank_id:
+ contract_id = self.env['property.lease.contract'].search([('lessee_id', '=', bank_id.tenant_id.id)])
+ if contract_id:
+ lease_id = contract_id.lease_ids[0].address_id
+ else:
+ lease_id = None
+
+ else:
+ contract_id = None
+ lease_id = None
+ else:
+ contract_id = None
+ lease_id = None
bank_data = {
- 'name':name,
- 'start_time':start_time,
+ 'name': name,
+ 'contract_id':contract_id.id if contract_id else None,
+ 'property_id':lease_id.id if lease_id else None,
'company_id': company_id.id,
+ 'start_time': start_time,
'name_account': name_account,
- 'remake': remake,
- 'original_amount': original_amount,
- 'contract_id': contract_id.id,
- 'property_id': property_id.id,
- 'contract_account': contract_account,
- 'contract_penalty': contract_penalty,
'voucher_type': voucher_type
}
self.env['property.bank.statements'].create(bank_data)
diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
index 01ccb8e84..9123e18d6 100644
--- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml
+++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
@@ -335,7 +335,7 @@
-
+