Commit b70ee121 authored by niminmin's avatar niminmin

[feat]租金功能优化

parent 3fe2226c
This diff is collapsed.
...@@ -15,27 +15,27 @@ ...@@ -15,27 +15,27 @@
t1.contract_status_desc, t1.contract_status_desc,
t1.billing_method, t1.billing_method,
t1.billing_method_desc, t1.billing_method_desc,
decode(t2.cf_item,'912',t1.inv_billing_object_id,t1.billing_object_id) billing_object_id, decode(t2.cf_item,'250',t1.inv_billing_object_id,t1.billing_object_id) billing_object_id,
decode(t2.cf_item,'912',t1.inv_billing_object_code,t1.billing_object_code) billing_object_code, decode(t2.cf_item,'250',t1.inv_billing_object_code,t1.billing_object_code) billing_object_code,
decode(t2.cf_item,'912',t1.inv_billing_object_name,t1.billing_object_name) billing_object_name, decode(t2.cf_item,'250',t1.inv_billing_object_name,t1.billing_object_name) billing_object_name,
decode(t2.cf_item,'912',t1.inv_object_taxpayer_type,t1.object_taxpayer_type) object_taxpayer_type, decode(t2.cf_item,'250',t1.inv_object_taxpayer_type,t1.object_taxpayer_type) object_taxpayer_type,
decode(t2.cf_item,'912',t1.inv_object_taxpayer_type_desc,t1.object_taxpayer_type_desc) object_taxpayer_type_desc, decode(t2.cf_item,'250',t1.inv_object_taxpayer_type_desc,t1.object_taxpayer_type_desc) object_taxpayer_type_desc,
decode(t2.cf_item,'912',t1.inv_object_tax_registry_num,t1.object_tax_registry_num) object_tax_registry_num, decode(t2.cf_item,'250',t1.inv_object_tax_registry_num,t1.object_tax_registry_num) object_tax_registry_num,
decode(t2.cf_item,'912',t1.inv_bill_object_bp_class,t1.bill_object_bp_class) bill_object_bp_class, decode(t2.cf_item,'250',t1.inv_bill_object_bp_class,t1.bill_object_bp_class) bill_object_bp_class,
decode(t2.cf_item,'912',t1.inv_bill_object_bp_class_desc,t1.bill_object_bp_class_desc) bill_object_bp_class_desc, decode(t2.cf_item,'250',t1.inv_bill_object_bp_class_desc,t1.bill_object_bp_class_desc) bill_object_bp_class_desc,
t1.tax_type_vat, t1.tax_type_vat,
t1.description, t1.description,
decode(t2.cf_item,'912',t1.inv_invoice_title,t1.invoice_title) invoice_title, decode(t2.cf_item,'250',t1.inv_invoice_title,t1.invoice_title) invoice_title,
decode(t2.cf_item,'912',t1.inv_bp_address_phone_num,t1.invoice_bp_address_phone_num) invoice_bp_address_phone_num, decode(t2.cf_item,'250',t1.inv_bp_address_phone_num,t1.invoice_bp_address_phone_num) invoice_bp_address_phone_num,
decode(t2.cf_item,'912',t1.inv_invoice_bp_bank_account,t1.invoice_bp_bank_account) invoice_bp_bank_account, decode(t2.cf_item,'250',t1.inv_invoice_bp_bank_account,t1.invoice_bp_bank_account) invoice_bp_bank_account,
decode(t2.cf_item,'912',t1.inv_tax_registry_num,t1.tax_registry_num) tax_registry_num, decode(t2.cf_item,'250',t1.inv_tax_registry_num,t1.tax_registry_num) tax_registry_num,
t1.prj_search_term_1, t1.prj_search_term_1,
t1.prj_search_term_2, t1.prj_search_term_2,
t1.con_search_term_1, t1.con_search_term_1,
t1.con_search_term_2, t1.con_search_term_2,
t1.document_type, t1.document_type,
t1.bp_name, t1.bp_name,
decode(t2.cf_item,'912',t1.inv_invoice_type_desc,t1.invoice_type_desc) invoice_type_desc, decode(t2.cf_item,'250',t1.inv_invoice_type_desc,t1.invoice_type_desc) invoice_type_desc,
t2.cashflow_id, t2.cashflow_id,
t2.cf_item, t2.cf_item,
t2.cf_item_desc, t2.cf_item_desc,
......
...@@ -53,7 +53,32 @@ ...@@ -53,7 +53,32 @@
from hls_division hd from hls_division hd
where hd.enabled_flag = 'Y' where hd.enabled_flag = 'Y'
and hd.division = cc.division) division_n, and hd.division = cc.division) division_n,
cc.division cc.division,
con_contract_pkg.get_cus_column(p_contract_id => cc.contract_id,
p_type => 'times') account_due_times, --会计逾期总期数
con_contract_pkg.get_cus_column(p_contract_id => cc.contract_id,
p_type => 'days') account_due_days, --会计逾期总天数
con_contract_pkg.get_cus_column(p_contract_id => cc.contract_id,
p_type => 'amounts') account_due_amount, --会计逾期总金额
(select count(1)
from con_contract_cashflow ccc
where ccc.contract_id = cc.contract_id
and ccc.overdue_status = 'Y'
and ccc.cf_item = 1
and ccc.write_off_flag <> 'FULL') business_due_times, --营业逾期总期数
(select sum(ccc.overdue_max_days)
from con_contract_cashflow ccc
where ccc.contract_id = cc.contract_id
and ccc.overdue_status = 'Y'
and ccc.cf_item = 1
and ccc.write_off_flag <> 'FULL') business_due_days, --营业逾期总天数
(select sum(ccc.due_amount - nvl(ccc.received_amount, 0))
from con_contract_cashflow ccc
where ccc.contract_id = cc.contract_id
and ccc.overdue_status = 'Y'
and ccc.cf_item = 1
and ccc.write_off_flag <> 'FULL') business_due_amount --营业逾期总金额
FROM con_contract cc FROM con_contract cc
where exists (select 1 where exists (select 1
from con_contract_cashflow ccw from con_contract_cashflow ccw
...@@ -71,10 +96,12 @@ ...@@ -71,10 +96,12 @@
<bm:query-field name="bp_id_tenant" queryExpression="t1.bp_id_tenant = ${@bp_id_tenant}"/> <bm:query-field name="bp_id_tenant" queryExpression="t1.bp_id_tenant = ${@bp_id_tenant}"/>
<bm:query-field name="contract_name" queryExpression="t1.contract_name = ${@contract_name}"/> <bm:query-field name="contract_name" queryExpression="t1.contract_name = ${@contract_name}"/>
<bm:query-field name="project_number" queryExpression="t1.project_number = ${@project_number}"/> <bm:query-field name="project_number" queryExpression="t1.project_number = ${@project_number}"/>
<bm:query-field name="bp_id_tenant_desc" queryExpression="t1.bp_id_tenant_desc = ${@bp_id_tenant_desc}"/> <!--<bm:query-field name="bp_id_tenant_desc" queryExpression="t1.bp_id_tenant_desc like ${@bp_id_tenant_desc}"/>-->
<bm:query-field name="bp_id_agent_desc" queryExpression="t1.bp_id_agent_desc like ${@bp_id_agent_desc}"/>
<!-- <bm:query-field name="lease_start_date_from" queryExpression="t1.inception_of_lease &gt;=to_date(${@lease_start_date_from},&apos;yyyy-mm-dd&apos;)"/> <!-- <bm:query-field name="lease_start_date_from" queryExpression="t1.inception_of_lease &gt;=to_date(${@lease_start_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="lease_start_date_to" queryExpression="t1.inception_of_lease &lt;=to_date(${@lease_start_date_to},&apos;yyyy-mm-dd&apos;)"/> <bm:query-field name="lease_start_date_to" queryExpression="t1.inception_of_lease &lt;=to_date(${@lease_start_date_to},&apos;yyyy-mm-dd&apos;)"/>
--> -->
<bm:query-field name="division" queryExpression="t1.division = ${@division}"/>
<bm:query-field name="lease_start_date_from" <bm:query-field name="lease_start_date_from"
queryExpression="t1.inception_of_lease &gt;=${@lease_start_date_from}"/> queryExpression="t1.inception_of_lease &gt;=${@lease_start_date_from}"/>
<bm:query-field name="lease_start_date_to" <bm:query-field name="lease_start_date_to"
...@@ -88,11 +115,18 @@ ...@@ -88,11 +115,18 @@
queryExpression="t1.promised_return_date &gt;= to_date(${@promised_return_date_from},&apos;yyyy-mm-dd&apos;)"/> queryExpression="t1.promised_return_date &gt;= to_date(${@promised_return_date_from},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="promised_return_date_to" <bm:query-field name="promised_return_date_to"
queryExpression="t1.promised_return_date &lt;= to_date(${@promised_return_date_to},&apos;yyyy-mm-dd&apos;)"/> queryExpression="t1.promised_return_date &lt;= to_date(${@promised_return_date_to},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="overdue_times" queryExpression="t1.overdue_times = ${@overdue_times}"/> <bm:query-field name="account_due_times_from" queryExpression="t1.account_due_times &gt;= ${@account_due_times_from}"/>
<bm:query-field name="overdue_days_from" queryExpression="overdue_days &gt;= ${@overdue_days_from}"/> <bm:query-field name="account_due_times_to" queryExpression="t1.account_due_times &lt;= ${@account_due_times_to}"/>
<bm:query-field name="overdue_days_to" queryExpression="overdue_days &lt;= ${@overdue_days_to}"/> <bm:query-field name="account_due_days_from" queryExpression="t1.account_due_days &gt;= ${@account_due_days_from}"/>
<bm:query-field name="due_amount_from" queryExpression="t1.pmt &gt;= ${@due_amount_from}"/> <bm:query-field name="account_due_days_to" queryExpression="t1.account_due_days &lt;= ${@account_due_days_to}"/>
<bm:query-field name="due_amount_to" queryExpression="t1.pmt &lt;= ${@due_amount_to}"/> <bm:query-field name="account_due_amount_from" queryExpression="t1.account_due_amount &gt;= ${@account_due_amount_from}"/>
<bm:query-field name="account_due_amount_to" queryExpression="t1.account_due_amount &lt;= ${@account_due_amount_to}"/>
<bm:query-field name="business_due_times_from" queryExpression="t1.business_due_times &gt;= ${@business_due_times_from}"/>
<bm:query-field name="business_due_times_to" queryExpression="t1.business_due_times &lt;= ${@business_due_times_to}"/>
<bm:query-field name="business_due_days_from" queryExpression="t1.business_due_days &gt;= ${@business_due_days_from}"/>
<bm:query-field name="business_due_days_to" queryExpression="t1.business_due_days &lt;= ${@business_due_days_to}"/>
<bm:query-field name="business_due_amount_from" queryExpression="t1.business_due_amount &gt;= ${@business_due_amount_from}"/>
<bm:query-field name="business_due_amount_to" queryExpression="t1.business_due_amount &lt;= ${@business_due_amount_to}"/>
<bm:query-field name="owner_user_id" queryExpression="t1.owner_user_id = ${@owner_user_id}"/> <bm:query-field name="owner_user_id" queryExpression="t1.owner_user_id = ${@owner_user_id}"/>
<bm:query-field name="lease_organization" queryExpression="t1.lease_organization = ${@lease_organization}"/> <bm:query-field name="lease_organization" queryExpression="t1.lease_organization = ${@lease_organization}"/>
</bm:query-fields> </bm:query-fields>
......
...@@ -175,17 +175,17 @@ ...@@ -175,17 +175,17 @@
} }
} }
function onIndexChange(ds, record, name, value, oldvalue) { // function onIndexChange(ds, record, name, value, oldvalue) {
$('bgt_contract_payment_detail_line_ds').setQueryParameter('contract_id', record.get('contract_id')); // $('bgt_contract_payment_detail_line_ds').setQueryParameter('contract_id', record.get('contract_id'));
$('bgt_contract_payment_detail_line_ds').query(); // $('bgt_contract_payment_detail_line_ds').query();
} // }
function ds_query(ds) { // function ds_query(ds) {
if (ds.getAll().length == 0) { // if (ds.getAll().length == 0) {
$('bgt_contract_payment_detail_line_ds').setQueryParameter('contract_id', null); // $('bgt_contract_payment_detail_line_ds').setQueryParameter('contract_id', null);
$('bgt_contract_payment_detail_line_ds').query(); // $('bgt_contract_payment_detail_line_ds').query();
} // }
} // }
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
...@@ -209,6 +209,8 @@ ...@@ -209,6 +209,8 @@
</a:mapping> </a:mapping>
</a:field> </a:field>
<a:field name="bp_id_tenant"/> <a:field name="bp_id_tenant"/>
<a:field name="bp_id_agent_desc"/>
<a:field name="division"/>
<a:field name="contract_number" typeCase="Upper"/> <a:field name="contract_number" typeCase="Upper"/>
<a:field name="overdue_times"/> <a:field name="overdue_times"/>
<a:field name="owner_user_id_desc" lovGridHeight="350" lovHeight="475" <a:field name="owner_user_id_desc" lovGridHeight="350" lovHeight="475"
...@@ -234,7 +236,7 @@ ...@@ -234,7 +236,7 @@
</a:fields> </a:fields>
<a:events> <a:events>
<!--<a:event name="indexChange" handler="onIndexChange"/>--> <!--<a:event name="indexChange" handler="onIndexChange"/>-->
<a:event name="load" handler="ds_query"/> <!--<a:event name="load" handler="ds_query"/>-->
</a:events> </a:events>
</a:dataSet> </a:dataSet>
<!--<a:dataSet id="bgt_contract_payment_detail_line_ds" fetchAll="true" model="cont.CON620.bgt_contract_payment_detail_line"/>--> <!--<a:dataSet id="bgt_contract_payment_detail_line_ds" fetchAll="true" model="cont.CON620.bgt_contract_payment_detail_line"/>-->
...@@ -278,15 +280,15 @@ ...@@ -278,15 +280,15 @@
<a:column name="bp_id_agent_desc" align="center" prompt="代理店" width="200"/> <a:column name="bp_id_agent_desc" align="center" prompt="代理店" width="200"/>
<a:column name="business_type_n" align="center" prompt="业务类型" width="60"/> <a:column name="business_type_n" align="center" prompt="业务类型" width="60"/>
<a:column name="division_n" align="center" prompt="租赁物" width="60"/> <a:column name="division_n" align="center" prompt="租赁物" width="60"/>
<a:column name="account_due_times" align="right" prompt="会计逾期总期数" renderer="Leaf.formatMoney" <a:column name="account_due_times" align="center" prompt="会计逾期总期数"
width="100"/> width="100"/>
<a:column name="account_due_days" align="right" prompt="会计逾期总天数" renderer="Leaf.formatMoney" <a:column name="account_due_days" align="center" prompt="会计逾期总天数"
width="100"/> width="100"/>
<a:column name="account_due_amount" align="right" prompt="会计逾期总金额" renderer="Leaf.formatMoney" <a:column name="account_due_amount" align="right" prompt="会计逾期总金额" renderer="Leaf.formatMoney"
width="100"/> width="100"/>
<a:column name="business_due_times" align="right" prompt="营业逾期总期数" renderer="Leaf.formatMoney" <a:column name="business_due_times" align="center" prompt="营业逾期总期数"
width="100"/> width="100"/>
<a:column name="business_due_days" align="right" prompt="营业逾期总天数" renderer="Leaf.formatMoney" <a:column name="business_due_days" align="center" prompt="营业逾期总天数"
width="100"/> width="100"/>
<a:column name="business_due_amount" align="right" prompt="营业逾期总金额" renderer="Leaf.formatMoney" <a:column name="business_due_amount" align="right" prompt="营业逾期总金额" renderer="Leaf.formatMoney"
width="100"/> width="100"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment