添加功能
This commit is contained in:
@@ -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)
|
||||
])
|
||||
|
||||
@@ -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='物业信息')
|
||||
|
||||
@@ -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='承租方')
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
<!-- <header>-->
|
||||
<!-- <button name="update_date" type="object" string="更新合同" class="oe_highlight"/>-->
|
||||
<!-- </header>-->
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="number" column_invisible="1"/>
|
||||
<field name="epitope_values_id" domain="[('type', '=', 'ammeter')]"/>
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
<!-- <header>-->
|
||||
<!-- <button name="update_date" type="object" string="更新" class="oe_highlight"/>-->
|
||||
<!-- </header>-->
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="number" column_invisible="1"/>
|
||||
<field name="yuthon_property_ids" string="地址" readonly="1" widget="many2many_tags" />
|
||||
|
||||
@@ -449,7 +449,7 @@
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name" readonly="0"/>
|
||||
<field name="name_title" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group col="3" string="基本信息">
|
||||
@@ -469,6 +469,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="rent_company" string="出租方" readonly="0"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="lessee_id" readonly="0"/>
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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',
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="youthon_report.ReceivableReport">
|
||||
<div class="container-fluid d-flex flex-column h-100 mt-2 pb-3">
|
||||
<!-- 筛选卡片 -->
|
||||
<div class="card mb-2">
|
||||
<div class="card-body">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="row mb-2" t-ref="search_area">
|
||||
<!-- 所属公司 -->
|
||||
<div class="col-3">
|
||||
<label>所属公司</label>
|
||||
<Many2XAutocomplete
|
||||
value="state.partnerValue?.display_name"
|
||||
getDomain="getDomain"
|
||||
resModel="'res.company'"
|
||||
fieldString="'所属公司'"
|
||||
activeActions="{}"
|
||||
update.bind="onUpdatePartner"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<label>权属类型</label>
|
||||
<select id="formview_default_conditions" class="o_input" t-model="state.condition">
|
||||
<option t-foreach="state.conditions" t-as="cond"
|
||||
t-att-value="cond.value"
|
||||
t-key="cond.name">
|
||||
<t t-esc="cond.name"/>
|
||||
</option>
|
||||
</select>
|
||||
</div><!-- 片区管理员 -->
|
||||
<div class="col-3">
|
||||
<label>片区管理员</label>
|
||||
<Many2XAutocomplete
|
||||
value="state.partnerValue?.display_name"
|
||||
getDomain="getDomain"
|
||||
resModel="'res.users'"
|
||||
fieldString="'片区管理员'"
|
||||
activeActions="{}"
|
||||
update.bind="onUpdatePartner"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 应收日期范围 -->
|
||||
<div class="col-3">
|
||||
<label>应收日期范围</label>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<DateTimeInput
|
||||
value="state.startDate"
|
||||
type="'date'"
|
||||
placeholder="fromPlaceholder"
|
||||
onChange="(date) => this.onChangeStartDate(date)"
|
||||
/>
|
||||
<i class="oi oi-arrow-right"></i>
|
||||
<DateTimeInput
|
||||
value="state.endDate"
|
||||
type="'date'"
|
||||
placeholder="toPlaceholder"
|
||||
onChange="(date) => this.onChangeEndDate(date)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="col-12 mt-3 d-flex justify-content-end gap-2">
|
||||
<button class="btn btn-primary" t-on-click="onSearch">搜索</button>
|
||||
<button class="btn btn-success" t-on-click="onExportExcel">导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ag-grid 表格区域 -->
|
||||
<div class="row flex-grow-1">
|
||||
<div class="col-12 h-100">
|
||||
<div class="ag-theme-alpine w-100 h-100" t-ref="grid"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -3,40 +3,13 @@
|
||||
<data>
|
||||
<record id="action_property_accounts_receivable_report" model="ir.actions.client">
|
||||
<field name="name">应收账单报表</field>
|
||||
<field name="tag">youthon_report_client</field>
|
||||
<field name="tag">receivable_report_client</field>
|
||||
<field name="context">
|
||||
{
|
||||
"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},
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="action_youthon_report" model="ir.actions.client">
|
||||
<field name="name">Youthon 报表</field>
|
||||
<field name="tag">youthon_report_client</field>
|
||||
|
||||
Reference in New Issue
Block a user