diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py index 349576f97..f587ab7f3 100644 --- a/yuthon_hr_attendance/controllers/applet_attendance.py +++ b/yuthon_hr_attendance/controllers/applet_attendance.py @@ -758,7 +758,7 @@ class AppletAttendance(Controller): ]) water_records = request.env(user=SUPERUSER_ID)['meter.water.line'].search([ - ('water_state', '!=', 'stop'), + ('water_state', '! =', 'stop'), ('meter_date', '>=', first_day_str), ('meter_date', '<=', last_day_str) ]) diff --git a/yuthon_property/models/property_meter_archives.py b/yuthon_property/models/property_meter_archives.py index a80147c92..13be03750 100644 --- a/yuthon_property/models/property_meter_archives.py +++ b/yuthon_property/models/property_meter_archives.py @@ -157,11 +157,12 @@ class PropertyMeterArchives(models.Model): class MeterArchivesLine(models.Model): _name = 'meter.archives.line' _description = '电表库明细行' - _order = 'number asc' + _order = 'number asc, sequence asc' archives_id = fields.Many2one('property.meter.archives', string='电表库', required=True, ondelete='cascade') name = fields.Char(string='仪表编号') number = fields.Integer(related='epitope_values_id.sequence', string="序号", store=True) + sequence = fields.Integer(string="表序号") epitope_values_id = fields.Many2one('yuthon.epitope.values', string='表位置') lessee_id = fields.Many2one('property.tenant.information', string='承租方') yuthon_property_ids = fields.Many2many('yuthon.property', string='物业信息') diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py index 9642be5dc..6118d40e6 100644 --- a/yuthon_property/models/property_meter_water.py +++ b/yuthon_property/models/property_meter_water.py @@ -125,10 +125,11 @@ class PropertyMeterWater(models.Model): class MeterWaterLine(models.Model): _name = 'meter.water.line' _description = '水表库明细行' - _order = 'number asc' + _order = 'number asc, sequence asc' water_id = fields.Many2one('property.meter.water', string='水表库', required=True, ondelete='cascade') number = fields.Integer(related='epitope_values_id.sequence', string="序号", store=True) + sequence = fields.Integer(string="表序号") name = fields.Char(string='仪表编号') epitope_values_id = fields.Many2one('yuthon.epitope.values', string='表位置') lessee_id = fields.Many2one('property.tenant.information', string='承租方') diff --git a/yuthon_property/views/property_meter_archives_views.xml b/yuthon_property/views/property_meter_archives_views.xml index 538024ac8..4d66d777a 100644 --- a/yuthon_property/views/property_meter_archives_views.xml +++ b/yuthon_property/views/property_meter_archives_views.xml @@ -98,6 +98,7 @@ + diff --git a/yuthon_property/views/property_meter_water_views.xml b/yuthon_property/views/property_meter_water_views.xml index b1a39b4f7..5b7e8cfbc 100644 --- a/yuthon_property/views/property_meter_water_views.xml +++ b/yuthon_property/views/property_meter_water_views.xml @@ -101,6 +101,7 @@ + diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 020fe1fef..0bf123c83 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -449,7 +449,7 @@

- +

@@ -469,6 +469,7 @@ + diff --git a/yuthon_property_approval/wizard/binding_information_wizard.py b/yuthon_property_approval/wizard/binding_information_wizard.py index fdfd99445..5fefa11e7 100644 --- a/yuthon_property_approval/wizard/binding_information_wizard.py +++ b/yuthon_property_approval/wizard/binding_information_wizard.py @@ -93,13 +93,15 @@ class BindingInformationWizard(models.Model): # 根据银行账号查找承租方信息 bank_account = self.env['property.bank.line'].search([ - ('bank', '=', self.bank_id.name) + ('bank', '=', self.bank_id.name), + ('tenant_id.name', '!=', False), ]) if bank_account: # 获取已存在的合同明细行的合同ID existing_contract_ids = bank_account.tenant_id.property_contract_ids.mapped('lease_contract_id.id') + all_contracts = self.contract_ids | self.bank_id.contract_ids # 过滤出需要新增的合同(排除已存在的) - new_contracts = self.contract_ids.filtered(lambda c: c.id not in existing_contract_ids) + new_contracts = all_contracts.filtered(lambda c: c.id not in existing_contract_ids) for contract in new_contracts: self.env['property.tenant.line'].sudo().create({ 'tenant_id': bank_account.tenant_id.id, @@ -111,6 +113,7 @@ class BindingInformationWizard(models.Model): }) self.env['property.bank.line'].create({ 'bank': self.bank_id.name, + 'name': self.bank_id.bank_branch, 'user': self.bank_id.name_account, 'tenant_id': tenant.id, }) diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index 280d6ff88..2208d91c9 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -346,7 +346,7 @@ class PropertyReconciliationWizard(models.Model): 'tenant_id': information.id, 'bank': rec.bank_id.name, 'user': information.name, - 'name': rec.bank_id.name, + 'name': rec.bank_id.bank_branch, }) remaining_amount = 0 for line in rec.reconciliation_line_ids: diff --git a/yuthon_report/__manifest__.py b/yuthon_report/__manifest__.py index 0b5d051da..529aade3d 100644 --- a/yuthon_report/__manifest__.py +++ b/yuthon_report/__manifest__.py @@ -32,6 +32,8 @@ 'yuthon_report/static/src/components/yuthon_report/yuthon_report.js', 'yuthon_report/static/src/components/yuthon_report/yuthon_report.xml', 'yuthon_report/static/src/components/yuthon_report/yuthon_report.scss', + 'yuthon_report/static/src/components/yuthon_report/receivable_report.js', + 'yuthon_report/static/src/components/yuthon_report/receivable_report.xml', ], } diff --git a/yuthon_report/static/src/components/yuthon_report/receivable_report.js b/yuthon_report/static/src/components/yuthon_report/receivable_report.js new file mode 100644 index 000000000..7cd808512 --- /dev/null +++ b/yuthon_report/static/src/components/yuthon_report/receivable_report.js @@ -0,0 +1,111 @@ +/** @odoo-module1 **/ + + +import { registry } from "@web/core/registry"; +import { Component, onMounted, useRef, useState } from "@odoo/owl"; +import { useBus, useService } from "@web/core/utils/hooks"; +import { standardActionServiceProps } from "@web/webclient/actions/action_service"; +import { DateTimeInput } from "@web/core/datetime/datetime_input"; +import { CheckBox } from "@web/core/checkbox/checkbox"; +import { Many2XAutocomplete } from "@web/views/fields/relational_utils"; + +class ReceivableReport extends Component { + setup() { + this.gridRef = useRef("grid"); + console.log('131231') + console.log(this.props.action.context.report_config) + + this.serviceOrm = useService("orm") + + this.state = useState({ + startDate: null, + endDate: null, + keyword: "", + booleanValue:true, + partnerValue:false, + selectPartner:{}, + condition:false, + conditions:[{ + 'name':'自有', + 'value':'self' + },{ + 'name':'代管', + 'value':'agency' + }] + }); + + this.config = this.props.action.context.report_config || {}; + + onMounted(async () => { + // 加载 ag-grid + //await loadJS("https://cdn.jsdelivr.net/npm/ag-grid-community/dist/ag-grid-community.min.js"); + this.gridOptions = { + localeText: AG_GRID_LOCALE_CN, + theme:agGrid.themeMaterial, + columnDefs: this.config.columns || [], + rowData: [], + sideBar: true, + defaultColDef: { resizable: true, sortable: true, filter: true }, + + }; + this.grid = new agGrid.createGrid(this.gridRef.el, this.gridOptions); + + }); + } + + /** + * 改变布尔值 + * @param e + */ + async onChangeBoolean(v){ + this.state.booleanValue = v + } + + getDomain(){ + // 过滤条件 + return []; + } + async onUpdatePartner(v){ + console.log(v) + this.state.selectPartner = v + this.state.partnerValue = v.display_name + } + + async onSearch() { + const params = { + date_start: this.state.startDate, + date_end: this.state.endDate, + keyword: this.state.keyword, + }; + const result = await this.serviceOrm.call( + this.config.model, + this.config.method, + [params] + ); + console.log(result) + this.grid.setGridOption('rowData',result); + } + + onExportExcel() { + this.grid.exportDataAsExcel({ + fileName: 'my-data.xlsx', + sheetName: 'Sheet1' + }); +} + + async onChangeStartDate(date){ + this.state.startDate = date; + } + async onChangeEndDate(date){ + this.state.endDate = date; + } +} +ReceivableReport.props = {...standardActionServiceProps }; +ReceivableReport.template = "youthon_report.ReceivableReport"; +ReceivableReport.components = { + DateTimeInput, + CheckBox, + Many2XAutocomplete, +}; + +registry.category("actions").add("receivable_report_client", ReceivableReport); diff --git a/yuthon_report/static/src/components/yuthon_report/receivable_report.xml b/yuthon_report/static/src/components/yuthon_report/receivable_report.xml new file mode 100644 index 000000000..83341007b --- /dev/null +++ b/yuthon_report/static/src/components/yuthon_report/receivable_report.xml @@ -0,0 +1,82 @@ + + + + +
+ +
+
+ +
+ +
+ + +
+
+ + +
+
+ + +
+ + +
+ +
+ + + +
+
+ + +
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/yuthon_report/views/receivable_report_views.xml b/yuthon_report/views/receivable_report_views.xml index 2552214d5..aa25215e0 100644 --- a/yuthon_report/views/receivable_report_views.xml +++ b/yuthon_report/views/receivable_report_views.xml @@ -3,40 +3,13 @@ 应收账单报表 - youthon_report_client + receivable_report_client { "sideBar": true, "report_config": { "model": "property.accounts.receivable", "method": "get_complete_ledger_report", - "search_fields": [ - { - "name": "keyword", - "type": "char", - "label": "关键词搜索(承租方/物业/产权证号)" - }, - { - "name": "management_type_id", - "type": "many2one", - "label": "应收类型", - "model": "yuthon.management.type" - }, - { - "name": "invoice_type", - "type": "selection", - "label": "发票类型", - "selection": [ - ('ordinary_invoice', '普通发票'), - ('vat_invoice', '增值税发票') - ] - }, - { - "name": "date_range", - "type": "date_range", - "label": "应收日期范围" - } - ], "columns": [ {"headerName": "应收类型", "field": "应收类型", "flex": 1}, {"headerName": "应收开始", "field": "应收开始", "flex": 1}, diff --git a/yuthon_report/views/yuthon_report_res_partner.xml b/yuthon_report/views/yuthon_report_res_partner.xml index cf80283c6..5be396863 100644 --- a/yuthon_report/views/yuthon_report_res_partner.xml +++ b/yuthon_report/views/yuthon_report_res_partner.xml @@ -1,7 +1,6 @@ - Youthon 报表 youthon_report_client