diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py
index e723fd146..c6056aabb 100644
--- a/yuthon_property/models/property_meter_archives.py
+++ b/yuthon_property/models/property_meter_archives.py
@@ -35,17 +35,26 @@ class PropertyMeterArchives(models.Model):
def update_epitope_values(self):
meter_ids = self.env["property.meter.archives"].browse(
- self._context.get('active_ids', self._context.get('active_id')))
+ self._context.get('active_ids', self._context.get('active_id'))
+ )
for meter in meter_ids:
- if meter.epitope_values:
- epitope_id = self.env['yuthon.epitope.values'].search([('name', '=', meter.epitope_values)])
- if not epitope_id:
- epitope_id = self.env['yuthon.epitope.values'].create({'name': meter.epitope_values,
- 'type': 'ammeter'
- })
- meter.epitope_values_id = epitope_id.id
- for line in meter.line_ids:
- line.epitope_values_id = epitope_id.id
+ for property in meter.yuthon_property_ids:
+ existing_energy = self.env['yuthon.property.energy'].search([
+ ('yuthon_property_id', '=', property.id),
+ ('property_meter_archives_id', '=', meter.id)
+ ], limit=1)
+
+ if not existing_energy:
+ self.env['yuthon.property.energy'].create({
+ 'property_meter_archives_id': meter.id,
+ 'yuthon_property_id': property.id,
+ })
+ invalid_energy = self.env['yuthon.property.energy'].search([
+ ('yuthon_property_id', '=', property.id),
+ ('property_meter_archives_id', '=', False)
+ ])
+ if invalid_energy:
+ invalid_energy.unlink()
@api.onchange('name')
def _onchange_line_ids(self):
diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py
index 8bad96b49..bc22adc74 100644
--- a/yuthon_property/models/property_meter_water.py
+++ b/yuthon_property/models/property_meter_water.py
@@ -170,10 +170,28 @@ class MeterWaterLine(models.Model):
1 + record.line_loss) * record.gauge_magnification
def update_meter(self):
- insurances_ids = self.env["meter.water.line"].browse(
- self._context.get('active_ids', self._context.get('active_id')))
- for line in insurances_ids:
- line.compute_meter_values()
+ meter_ids = self.env["property.meter.water"].browse(
+ self._context.get('active_ids', self._context.get('active_id'))
+ )
+ for meter in meter_ids:
+ for property in meter.yuthon_property_ids:
+ existing_water = self.env['yuthon.property.water'].search([
+ ('yuthon_property_id', '=', property.id),
+ ('property_meter_water_id', '=', meter.id)
+ ], limit=1)
+
+ if not existing_water:
+ self.env['yuthon.property.water'].create({
+ 'property_meter_water_id': meter.id,
+ 'yuthon_property_id': property.id,
+ })
+
+ invalid_water = self.env['yuthon.property.water'].search([
+ ('yuthon_property_id', '=', property.id),
+ ('property_meter_water_id', '=', False)
+ ])
+ if invalid_water:
+ invalid_water.unlink()
@api.depends('current_read', 'last_read', 'meter_date', 'maximum_count', 'water_id')
def compute_meter_values(self):
diff --git a/yuthon_property/views/property_bank_statements_views.xml b/yuthon_property/views/property_bank_statements_views.xml
index db5319215..e2eeb6df0 100644
--- a/yuthon_property/views/property_bank_statements_views.xml
+++ b/yuthon_property/views/property_bank_statements_views.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/yuthon_property_approval/__manifest__.py b/yuthon_property_approval/__manifest__.py
index 5c50535b7..e84ebb3c9 100644
--- a/yuthon_property_approval/__manifest__.py
+++ b/yuthon_property_approval/__manifest__.py
@@ -13,6 +13,8 @@
'security/ir.model.access.csv',
'report/lease_contract_report.xml',
'report/lease_contract_templates.xml',
+ 'report/property_accounting_templates.xml',
+ 'report/property_construction_templates.xml',
'views/property_billing_confirmation.xml',
'views/inherit_property_tenant_information_views.xml',
'views/property_approval_views.xml',
diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index bc73d233d..2a5ea2685 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -382,6 +382,8 @@ class PropertyAccountsReceivable(models.Model):
precinct_id = fields.Many2one(related='contract_id.precinct_id', string="所属片区", store=True)
penalty = fields.Float(string="违约金基数")
penalty_date = fields.Date(string="违约金日期")
+ invoice_type = fields.Selection(
+ [('ordinary_invoice', '普通发票'), ('vat_invoice', '增值税发票')], string='发票类型', default='ordinary_invoice')
# 报表新增字段
rent_owed = fields.Float(string="欠租金额")
per_day = fields.Float(string="每天违约金(元/天)")
diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py
index f089412b8..da4b06805 100644
--- a/yuthon_property_approval/models/property_lease_contract.py
+++ b/yuthon_property_approval/models/property_lease_contract.py
@@ -251,6 +251,10 @@ class PropertyLeaseContract(models.Model):
contract_count = fields.Integer(string="联系人数量", compute='_compute_contract_count')
reconciliation_count = fields.Integer(string="对账数量", compute='_compute_reconciliation_count')
process_count = fields.Integer(string="流程数量", compute='_compute_process_count')
+ def _get_default_name_title(self):
+ return self._description if self._description else self._name
+
+ name_title = fields.Char(default=_get_default_name_title)
@api.depends('lease_ids.address_id.title_deed')
def _compute_title_information(self):
diff --git a/yuthon_property_approval/report/lease_contract_report.xml b/yuthon_property_approval/report/lease_contract_report.xml
index 8ab969c5e..d0f3d4fe1 100644
--- a/yuthon_property_approval/report/lease_contract_report.xml
+++ b/yuthon_property_approval/report/lease_contract_report.xml
@@ -12,4 +12,26 @@
report
+
+
+ 建设工程委托监理合同报表
+ property.accounting.approval
+ qweb-pdf
+ yuthon_property_approval.report_property_accounting_approval
+ yuthon_property_approval.report_property_accounting_approval
+ 建设工程委托监理合同报表
+
+ report
+
+
+
+ 建设工程造价咨询合同报表
+ property.construction.approval
+ qweb-pdf
+ yuthon_property_approval.report_property_construction_approval
+ yuthon_property_approval.report_property_construction_approval
+ 建设工程造价咨询合同报表
+
+ report
+
\ No newline at end of file
diff --git a/yuthon_property_approval/report/property_accounting_templates.xml b/yuthon_property_approval/report/property_accounting_templates.xml
new file mode 100644
index 000000000..7011a9c51
--- /dev/null
+++ b/yuthon_property_approval/report/property_accounting_templates.xml
@@ -0,0 +1,212 @@
+
+
+
+
+
+
+
+ 建设工程委托监理合同审批
+
+
+
+
+
+
+
+
+ | 甲方: |
+
+
+ 无
+ |
+ 乙方: |
+
+
+ 无
+ |
+
+
+
+
+
+
+ | 物业地址: |
+ |
+ 业务类型: |
+ |
+
+
+
+
+
+ | 工程内容: |
+ |
+ 合同金额: |
+ |
+
+
+
+
+
+
+ | 开始日期: |
+ |
+ 结束日期: |
+ |
+
+
+
+
+
+
+ | 付款方式: |
+
+ 一次性
+ 分期
+ |
+ 合同附件: |
+
+ 查看合同
+ 无
+ |
+
+
+
+
+
+
+ | 预算清单: |
+
+ 查看预算清单
+ 无
+ |
+
+
+
+
+
+
+
+
+
+
+ | 维修前图片: |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ | 支付节点 |
+ 支付比例 |
+ 金额 |
+ 备注 |
+ 支付说明 |
+
+
+
+
+
+ |
+ 一期
+ 二期
+ 三期
+ 四期
+ |
+ % |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ | 节点 |
+ 意见 |
+ 审批人 |
+ 操作时间 |
+
+
+
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_property_approval/report/property_construction_templates.xml b/yuthon_property_approval/report/property_construction_templates.xml
new file mode 100644
index 000000000..40cefb7d8
--- /dev/null
+++ b/yuthon_property_approval/report/property_construction_templates.xml
@@ -0,0 +1,258 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ | 标题: |
+
+
+ 未设置标题
+ |
+ 编号: |
+
+
+ 未生成编号
+ |
+
+
+
+
+
+ | 申请人: |
+
+
+ 未设置申请人
+ |
+ 部门: |
+
+
+ 未关联部门
+ |
+
+
+
+
+
+ | 公司: |
+
+
+ 未关联公司
+ |
+ 业务类型: |
+
+
+ 未设置
+ |
+
+
+
+
+
+
+ | 甲方: |
+
+
+ 未设置
+ |
+ 乙方: |
+
+
+ 未设置
+ |
+
+
+
+
+
+
+ | 工程内容: |
+
+
+ 未填写
+ |
+ 物业地址: |
+
+
+ 未填写
+ |
+
+
+
+
+
+
+ | 代理开始日期: |
+
+
+ 未设置
+ |
+ 代理结束日期: |
+
+
+ 未设置
+ |
+
+
+
+
+
+
+ | 合同金额: |
+
+
+ 0.00
+ |
+ 付款方式: |
+
+ 一次性
+ 分期
+ 未设置
+ |
+
+
+
+
+
+
+ | 合同附件: |
+
+ 查看合同
+ 无
+ |
+ 预算清单: |
+
+ 查看预算清单
+ 无
+ |
+
+
+
+
+
+
+
+
+
+
+ | 开工前图片: |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ | 支付节点 |
+ 支付比例 |
+ 应付日期 |
+ 金额 |
+ 备注 |
+ 支付说明 |
+
+
+
+
+
+ |
+ 一期
+ 二期
+ 三期
+ 四期
+ |
+
+ %
+ 0%
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ | 节点 |
+ 意见 |
+ 审批人 |
+ 操作时间 |
+
+
+
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_property_approval/views/property_design_approval_views.xml b/yuthon_property_approval/views/property_design_approval_views.xml
index 3684f89d6..0f8ee0745 100644
--- a/yuthon_property_approval/views/property_design_approval_views.xml
+++ b/yuthon_property_approval/views/property_design_approval_views.xml
@@ -54,7 +54,8 @@
-
+
+
@@ -68,8 +69,7 @@
-
-
+
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index 1b9e16e77..ae058d25e 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -50,7 +50,7 @@
-
+
@@ -70,6 +70,7 @@
+
diff --git a/yuthon_property_approval/views/property_menu_all.xml b/yuthon_property_approval/views/property_menu_all.xml
index 9337aabe1..482464bd5 100644
--- a/yuthon_property_approval/views/property_menu_all.xml
+++ b/yuthon_property_approval/views/property_menu_all.xml
@@ -395,18 +395,7 @@
name="应收账单"
action="property_accounts_receivable_action"
sequence="1"/>
-
-
+