@@ -46,7 +46,14 @@ class YuthonEducationExperienceLine(models.Model):
|
||||
end_date = fields.Date(string="毕业时间")
|
||||
in_school_duties = fields.Char(string="在校职务")
|
||||
professional = fields.Char(string="专业")
|
||||
learning_style = fields.Selection([('full_time', '全日制'), ('part_time', '非全日制')], string="学习方式")
|
||||
learning_style = fields.Selection([
|
||||
('full_time', '全日制'),
|
||||
('upgrade', '专升本'),
|
||||
('adult_education', '成人教育'),
|
||||
('self_study', '自考'),
|
||||
('online_education', '网络教育'),
|
||||
('correspondence', '函授'),
|
||||
], string="学习方式")
|
||||
part_time_degree = fields.Char(string="学历")
|
||||
full_time_degree = fields.Char(string="学位")
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
|
||||
@@ -411,6 +411,7 @@
|
||||
<tree string="通讯录" crate="false" delete="false" editable="bottom">
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="mobile_phone" readonly="1"/>
|
||||
<field name="work_phone" readonly="1"/>
|
||||
<field name="department_id" readonly="1"/>
|
||||
<field name="job_id" readonly="1"/>
|
||||
<field name="company_id" column_invisible="1"/>
|
||||
|
||||
@@ -129,7 +129,7 @@ class YuthonPurposeEvidence(models.Model):
|
||||
|
||||
class YuthonManagementType(models.Model):
|
||||
_name = 'yuthon.management.type'
|
||||
_description = '管理类型'
|
||||
_description = '应收类型'
|
||||
|
||||
name = fields.Char(string="管理类型")
|
||||
|
||||
|
||||
@@ -72,11 +72,11 @@
|
||||
sequence="4"
|
||||
name="应收"
|
||||
parent="yuthon_property_estate_menu"/>
|
||||
<menuitem id="yuthon_property_penalty_list"
|
||||
sequence="25"
|
||||
name="违约金列表"
|
||||
parent="yuthon_property_fee_management"
|
||||
action="view_property_penalty_list_action"/>
|
||||
<!-- <menuitem id="yuthon_property_penalty_list"-->
|
||||
<!-- sequence="25"-->
|
||||
<!-- name="违约金列表"-->
|
||||
<!-- parent="yuthon_property_fee_management"-->
|
||||
<!-- action="view_property_penalty_list_action"/>-->
|
||||
<menuitem id="yuthon_property_estate_works_menu"
|
||||
sequence="10"
|
||||
name="建设工程"
|
||||
@@ -302,7 +302,7 @@
|
||||
action="view_yuthon_industry_setting_action" sequence="60"/>
|
||||
<menuitem id="yuthon_purpose_evidence_menu" parent="resource_mgmt_config_menu" name="证载用途"
|
||||
action="view_yuthon_purpose_evidence_action" sequence="65"/>
|
||||
<menuitem id="yuthon_management_type_menu" parent="resource_mgmt_config_menu" name="管理类型"
|
||||
<menuitem id="yuthon_management_type_menu" parent="resource_mgmt_config_menu" name="应收类型"
|
||||
action="view_yuthon_management_type_action" sequence="70"/>
|
||||
<menuitem id="yuthon_bank_setting_menu" parent="resource_mgmt_config_menu" name="银行"
|
||||
action="view_yuthon_bank_setting_action" sequence="75"/>
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_management_type_action" model="ir.actions.act_window">
|
||||
<field name="name">管理类型</field>
|
||||
<field name="name">应收类型</field>
|
||||
<field name="res_model">yuthon.management.type</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
@@ -69,21 +69,60 @@ class PropertyBankStatements(models.Model):
|
||||
electricity_ids = self.env['property.tariff.list'].search([('lessee_id', '=', tenant_id.id)])
|
||||
|
||||
def create_reconciliation_vals(ids, collection_type_val):
|
||||
"""
|
||||
:param ids:费用记录集
|
||||
:param collection_type_val: 费用类型(如 'rent', 'deposit')
|
||||
:return: 格式化后的费用行列表
|
||||
"""
|
||||
nonlocal total_rent_month
|
||||
vals_list = []
|
||||
for sub_record in ids:
|
||||
property_id = sub_record.property_id.id if sub_record.property_id else False
|
||||
contract_id = sub_record.contract_id.id if sub_record.contract_id else False
|
||||
original_amount = sub_record.original_amount if sub_record.original_amount else 0
|
||||
vals = {
|
||||
'property_id': property_id,
|
||||
'contract_id': contract_id,
|
||||
'rent_month': original_amount,
|
||||
'rent': original_amount,
|
||||
'collection_type': collection_type_val,
|
||||
}
|
||||
total_rent_month += original_amount
|
||||
vals_list.append((0, 0, vals))
|
||||
|
||||
# 特殊处理:押金类型需要去重相同合同的记录
|
||||
if collection_type_val == 'deposit':
|
||||
# 使用字典来跟踪已处理的合同ID
|
||||
processed_contracts = set()
|
||||
for sub_record in ids:
|
||||
property_id = sub_record.property_id.id if sub_record.property_id else False
|
||||
contract_id = sub_record.contract_id.id if sub_record.contract_id else False
|
||||
original_amount = sub_record.original_amount if sub_record.original_amount else 0
|
||||
# 跳过已处理的合同
|
||||
if contract_id and contract_id in processed_contracts:
|
||||
continue
|
||||
# 获取合同的实际开始日期作为到期日
|
||||
due_date = False
|
||||
if contract_id:
|
||||
due_date = sub_record.contract_id.actual_start_time
|
||||
# 构建对账行数据
|
||||
vals = {
|
||||
'property_id': property_id,
|
||||
'contract_id': contract_id,
|
||||
'rent_month': original_amount,
|
||||
'rent': original_amount,
|
||||
'collection_type': collection_type_val,
|
||||
'due_date': due_date, # 押金类型使用合同实际开始日期
|
||||
}
|
||||
total_rent_month += original_amount # 累加总金额
|
||||
vals_list.append((0, 0, vals))
|
||||
# 标记此合同已处理
|
||||
if contract_id:
|
||||
processed_contracts.add(contract_id)
|
||||
else:
|
||||
# 非押金类型:正常处理每条记录
|
||||
for sub_record in ids:
|
||||
property_id = sub_record.property_id.id if sub_record.property_id else False
|
||||
contract_id = sub_record.contract_id.id if sub_record.contract_id else False
|
||||
original_amount = sub_record.original_amount if sub_record.original_amount else 0
|
||||
due_date = sub_record.due_date if sub_record.due_date else False
|
||||
vals = {
|
||||
'property_id': property_id,
|
||||
'contract_id': contract_id,
|
||||
'rent_month': original_amount,
|
||||
'rent': original_amount,
|
||||
'collection_type': collection_type_val,
|
||||
'due_date': due_date,
|
||||
}
|
||||
total_rent_month += original_amount # 累加总金额
|
||||
vals_list.append((0, 0, vals))
|
||||
return vals_list
|
||||
|
||||
all_vals = []
|
||||
@@ -97,6 +136,12 @@ class PropertyBankStatements(models.Model):
|
||||
return [], 0
|
||||
|
||||
def _get_context_and_action(self, record, all_vals, total_rent_month):
|
||||
"""
|
||||
:param record: 银行收款记录
|
||||
:param all_vals: 应收费用列表
|
||||
:param total_rent_month: 应收总金额
|
||||
:return:
|
||||
"""
|
||||
context = {
|
||||
"default_account": record.name,
|
||||
"default_actual_total": record.original_amount,
|
||||
|
||||
@@ -22,6 +22,7 @@ class PropertyReconciliationLine(models.Model):
|
||||
property_id = fields.Many2one('yuthon.property', string='物业')
|
||||
contract_id = fields.Many2one('property.lease.contract', string='合同编号')
|
||||
rent_month = fields.Float(string='当月租金')
|
||||
due_date = fields.Date(string='应收日期')
|
||||
rent = fields.Float(string='应收租金')
|
||||
penalty = fields.Float(string='违约金')
|
||||
amount = fields.Float(string='金额')
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
<field name="reconciliation_id" column_invisible="1"/>
|
||||
<field name="property_id"/>
|
||||
<field name="contract_id"/>
|
||||
<field name="rent_month"/>
|
||||
<field name="rent"/>
|
||||
<field name="penalty"/>
|
||||
、 <field name="collection_type"/>
|
||||
<field name="amount"/>
|
||||
<field name="due_date"/>
|
||||
<field name="rent_month" sum = "Total"/>
|
||||
<field name="rent" sum = "Total"/>
|
||||
<field name="penalty" sum = "Total"/>
|
||||
<field name="collection_type"/>
|
||||
<field name="amount" sum = "Total"/>
|
||||
<field name="remake"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -16,7 +16,7 @@ class YuthonPurchaseOrder(models.Model):
|
||||
service_content = fields.Text(string="服务内容")
|
||||
service_start_date = fields.Date(string="服务开始时间")
|
||||
service_end_date = fields.Date(string="服务结束时间")
|
||||
type_of_procurement = fields.Selection([('service', '服务'), ('product', '低值易耗/固定资产')], string="采购类型")
|
||||
type_of_procurement = fields.Selection([('service', '服务'), ('product', '低值易耗'), ('fixed', '固定资产')], string="采购类型")
|
||||
purchase_order_models_ids = fields.One2many('purchase.order.pay.line', 'purchase_id', string="付款详情")
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<field name="service_content" invisible="type_of_procurement != 'service'"/>
|
||||
<field name="service_start_date" invisible="type_of_procurement != 'service'"/>
|
||||
<field name="service_end_date" invisible="type_of_procurement != 'service'"/>
|
||||
<field name="start_date" invisible="type_of_procurement != 'product'"/>
|
||||
<field name="start_date" invisible="type_of_procurement != 'product' or type_of_procurement != 'fixed'"/>
|
||||
<field name="code"/>
|
||||
<field name="reason_text"/>
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
|
||||
@@ -626,8 +626,6 @@
|
||||
parent="finance_root_board"
|
||||
action="yuthon_salary.action_yuthon_salary_asset"
|
||||
sequence="5"/>
|
||||
|
||||
|
||||
<menuitem id="yuthon_salary_project_menu"
|
||||
name="项目"
|
||||
parent="human_pay_slips_root_setting"
|
||||
@@ -648,6 +646,11 @@
|
||||
name="预算科目表"
|
||||
parent="yuthon_financial_management_menu"
|
||||
action="yuthon_property.view_property_subject_action"/>
|
||||
<menuitem id="yuthon_property_penalty_list"
|
||||
sequence="7"
|
||||
name="违约金列表"
|
||||
parent="finance_root_board"
|
||||
action="yuthon_property.view_property_penalty_list_action"/>
|
||||
<menuitem id="yuthon_bank_statement_menu"
|
||||
sequence="20"
|
||||
name="对账"
|
||||
|
||||
Reference in New Issue
Block a user