Commit 49ba2ff8 authored by stone's avatar stone

【fix】合同事項報表和销售收入报表

parent f35e2887
......@@ -51,15 +51,15 @@
t.lease_start_date,
(SELECT ccc.due_date
FROM con_contract_cashflow ccc
WHERE ccc.times = t.lease_times
AND cf_item = 1
AND ccc.contract_id = t.contract_id) lease_end_date,
WHERE ccc.cf_item=1 and ccc.contract_id=t.contract_id and ccc.times=(
select max(times) from con_contract_cashflow cc where cc.contract_id=t.contract_id
)) lease_end_date,
--当期利息
to_char(nvl((SELECT SUM(nvl(ccc.interest, 0))
FROM con_contract_cashflow ccc
WHERE ccc.contract_id = t.contract_id
AND cf_item = 1
AND to_char(ccc.due_date, 'yyyymmdd') BETWEEN
AND to_char(ccc.due_date, 'yyyy-mm-dd') BETWEEN
${@due_date_from} AND ${@due_date_to}),
0),
'FM999,999,999,999,990.00') this_interest,
......@@ -167,7 +167,8 @@
'FM999,999,999,999,990.00') future_due_amount
FROM con_contract t, hls_bp_master h
WHERE t.data_class = 'NORMAL'
AND h.bp_id = t.bp_id_tenant
and t.contract_status='INCEPT'
AND h.bp_id = t.bp_id_tenant
]]>
</bm:query-sql>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select
(SELECT h.extra_nam
FROM hls_bp_master h
WHERE h.bp_id=v.bp_id_agent_level1)agent_name,
(SELECT h.extra_nam
FROM hls_bp_master h
WHERE h.bp_id=v.vender_id) vender_name,
SUM(v.sale_amount) sale_amount,
SUM(v.sale_penalty)sale_penalty,
SUM(v.sale_other)sale_other,
(SUM(v.sale_amount)+SUM(v.sale_penalty)+SUM(v.sale_other)) sum_total
from (
select *
from CONTRACT_BENEFITS_SALE_V t
#WHERE_CLAUSE#
)v
GROUP BY v.bp_id_agent_level1,v.vender_id
]]>
</bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="journal_date_from" queryExpression="to_char(t.journal_date,&apos;yyyy-mm-dd&apos;) &gt;= ${@journal_date_from}"/>
<bm:query-field name="journal_date_to" queryExpression="to_char(t.journal_date,&apos;yyyy-mm-dd&apos;) &lt;= ${@journal_date_to}"/>
<bm:query-field name="bp_id_agent_level1" queryExpression="t.bp_id_agent_level1=${@bp_id_agent_level1}"/>
</bm:query-fields>
</bm:model>
var override_queryfields = [
{
name : 'journal_date_from',
queryexpression : "to_char(t1.journal_date,'yyyy-mm-dd') >=${@journal_date_from} "
},
{
name : 'journal_date_to',
queryexpression : "to_char(t1.journal_date,'yyyy-mm-dd') <=${@journal_date_to} "
}
];
var add_datafilters = [];
add_datafilter();
override();
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure/>
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<script type="text/javascript"><![CDATA[
// window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
// var lnds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CONTRACT_RESULT', 'hls_journal_detail');
// $(lnds).query();
// debugger
// var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CONTRACT_AGENT', 'hls_journal_detail');
// $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3400.contract_sales_report_query/query');
// $(ds_id).query();
//
// }
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
console.log(ds.id)
var lnds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CONTRACT_AGENT', 'hls_journal_detail');
if(lnds==ds.id){
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CONTRACT_AGENT', 'hls_journal_detail');
$(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3400.contract_sales_report_query/query');
$(ds_id).query();
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
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