Commit 197075b2 authored by stone's avatar stone

【fix】增加应收明细表打印

parent 151b33b2
<?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="execute">
<bm:update-sql><![CDATA[
DECLARE
v_print_contract_id NUMBER;
BEGIN
CON_CONTRACT_PKG.con_incept_print(p_contract_id=>${@contract_id},
p_print_contract_id=>${@v_print_contract_id},
p_user_id=>${/session/@user_id});
END;
]]>
</bm:update-sql>
<bm:parameters>
<bm:parameter name="v_print_contract_id" dataType="java.lang.Long" input="false" output="true" outputPath="@print_contract_id"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
<?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 * from (
SELECT cw.times,
cw.due_date,
cw.contract_id,
cw.due_amount,
nvl(cw.vat_due_amount, 0) vat_due_amount,
--上下端利息
nvl((SELECT cu.interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 2),
0) up_interest, --上端
nvl((SELECT cu.interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 1),
0) down_interest, --下端
(SELECT nvl(SUM(cu.interest), 0)
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id) total_interest,
--上下段税利息
nvl((SELECT cu.vat_interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 2),
0) up_vat_interest, --上端
nvl((SELECT cu.vat_interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 1),
0) down_vat_interest, --下端
(SELECT nvl(SUM(cu.vat_interest), 0)
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id) total_vat_interest,
--不含税利息
(nvl((SELECT cu.interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 2),
0) - nvl((SELECT cu.vat_interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 2),
0)) up_net_interest, --上端
(nvl((SELECT cu.interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 1),
0) - nvl((SELECT cu.vat_interest
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 2),
0)) down_net_interest, --上端
((SELECT nvl(SUM(cu.interest), 0)
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id) -
(SELECT nvl(SUM(cu.vat_interest), 0)
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id)) total_net_interest,
--本期天数
nvl((SELECT cu.weight_factor
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 2),
0) up_weight_factor,
nvl((SELECT cu.weight_factor
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 1),
0) down_weight_factor,
nvl((SELECT cu.total_weight
FROM con_unearned_finance_income cu
WHERE cu.cashflow_id = cw.cashflow_id
AND cu.seq_in_period = 1),
0) total_weight_factor
FROM con_contract ct, con_contract_cashflow cw
WHERE ct.contract_id = cw.contract_id
order by times ) t
#WHERE_CLAUSE#
#ORDER_BY_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<!-- <bm:query-field name="contract_id" queryExpression="t.contract_id=${@contract_id}"/>-->
</bm:query-fields>
</bm:model>
<?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 * from (
SELECT c.contract_number,
h.bp_name,
--机型
ccli.pattern,
--合同签订日
to_char(c.inception_of_lease,'yyyy-mm-dd') inception_of_lease,
--c.rate
ch.bp_code client_bp_code,
ch.bp_name client_bp_name,
--机号
ccli.machine_number,
c.contract_id,
to_char(c.lease_start_date,'yyyy-mm-dd')lease_start_date
--期间
from con_contract c,
hls_bp_master h,
hls_bp_master ch,
con_contract_lease_item ccli
WHERE c.bp_id_agent_level1=h.bp_id
AND ccli.contract_id=c.contract_id
AND ch.bp_id=c.bp_id_tenant
) t
#WHERE_CLAUSE#
#ORDER_BY_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<!-- <bm:query-field name="contract_id" queryExpression="t.contract_id=${@contract_id}"/>-->
</bm:query-fields>
</bm:model>
var add_datafilters = [
{
name : 'query',
expression : "(exists (select 1 from aut_trx_user_authorize a1, aut_owner_user_authorize a2 where a1.trx_category = 'CONTRACT' and a1.trx_id = t1.contract_id and trunc(sysdate) between a1.start_date and nvl(a1.end_date, trunc(sysdate)) and a1.user_id = a2.owner_user_id and a1.trx_category = a2.trx_category and a2.authorized_user_id = ${/session/@user_id} and trunc(sysdate) between a2.start_date and nvl(a2.end_date, trunc(sysdate))))"
}
];
var override_queryfields = [ var override_queryfields = [
{ {
name: 'bp_name', name: 'bp_name',
...@@ -19,4 +26,5 @@ var override_queryfields = [ ...@@ -19,4 +26,5 @@ var override_queryfields = [
queryexpression:"t1.contract_status=${@contract_status}" queryexpression:"t1.contract_status=${@contract_status}"
} }
]; ];
override(); override();
\ No newline at end of file add_datafilter();
\ No newline at end of file
...@@ -13,10 +13,13 @@ ...@@ -13,10 +13,13 @@
<a:link id="con311_create_entrusts_link" model="cont.CON311.create_entrusts" modelaction="execute"/> <a:link id="con311_create_entrusts_link" model="cont.CON311.create_entrusts" modelaction="execute"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}zj_wfl_approve_history_check" url="${/request/@context_path}/modules/zjwfl/zj_wfl_approve_history_check.lview"/> <a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}zj_wfl_approve_history_check" url="${/request/@context_path}/modules/zjwfl/zj_wfl_approve_history_check.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="con_contract_change_link_id" model="cont.CON1300.con_print_incept" modelaction="execute"/>
<a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/> <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link" <a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/> url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/> <a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
<a:link id="cont_con_sale_contract_info_print_link"
url="${/request/@context_path}/modules/cont/CON3200/contract_receipt_detail_print.lsc"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
Leaf.onReady(function() { Leaf.onReady(function() {
...@@ -96,10 +99,46 @@ ...@@ -96,10 +99,46 @@
} }
}; };
//应收明细打印
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var selectedDS=$(ds_id).getSelected();
if(selectedDS.length!=1){
$L.showErrorMessage("提示",'请选择一条数据进行打印!');
return;
}
if((selectedDS[0].get('contract_status')!='INCEPTING')&&(selectedDS[0].get('contract_status')!='INCEPT')){
$L.showErrorMessage("提示",'只有起租或者起租中的合同才能打印!');
return;
}
var contract_id=selectedDS[0].get('contract_id');
Leaf.Masker.mask(Ext.getBody());
Leaf.request({
url: $('con_contract_change_link_id').getUrl(),
para: {
contract_id:contract_id
},
success: function(res) {
var file_name = '应收明细表';
var template_name='aa.xls';
var print_contract_id=res.result.print_contract_id;
var url = $('cont_con_sale_contract_info_print_link').getUrl() + '?template_name=' + template_name + '&contract_id=' + print_contract_id + '&file_name=' + encodeURI(file_name);
window.location.href =url;
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
//单据跟踪 //单据跟踪
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() { window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
// var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); // var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
// var records = $('prj_project_ds_id').getSelected(); // var records = $('prj_project_ds_id').getSelected();
var ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds'); var ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds');
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" xmlns:dr="leaf.plugin.excelreport" trace="true">
<a:init-procedure>
<a:model-query defaultWhereClause="contract_id=${/parameter/@contract_id}" fetchAll="true" model="cont.CON1300.get_contract_print_info" rootPath="/model/head_info"/>
<a:model-query defaultWhereClause="contract_id=${/parameter/@contract_id}" fetchAll="true" model="cont.CON1300.get_contract_print_grid_info" rootPath="/model/grid_data"/>
<s:server-script><![CDATA[
function getdate() {
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
d = now.getDate()
m = m < 10 ? "0" + m : m
d = d < 10 ? "0" + d : d
return y + "" + m + "" + d
}
$ctx.parameter.file_name = $ctx.parameter.file_name+getdate()+'.xlsx';
]]></s:server-script>
<dr:excel-report enableTask="false" fileName="${/parameter/@file_name}">
<styles>
<dr:cell-style name="title" align="ALIGN_CENTER">
<dr:font fontName="宋体" height="14" italic="false"/>
</dr:cell-style>
<dr:cell-style name="left" align="ALIGN_LEFT">
<dr:font fontName="宋体" height="12" italic="false"/>
</dr:cell-style>
<dr:cell-style name="cell_right" align="ALIGN_RIGHT">
<dr:font fontName="宋体" height="12" italic="false"/>
</dr:cell-style>
<dr:cell-style name="cell_center" align="ALIGN_CENTER" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderTop="BORDER_THIN" borderRight="BORDER_THIN">
<dr:font fontName="宋体" height="12" italic="false"/>
</dr:cell-style>
<dr:cell-style name="header" align="ALIGN_CENTER">
<dr:font bold="false" fontName="宋体" height="12"/>
</dr:cell-style>
<dr:cell-style name="foot">
<dr:font bold="false" fontName="宋体" height="12"/>
</dr:cell-style>
<dr:cell-style name="footNumber" dataFormat="#,##0.000">
<dr:font bold="false" fontName="宋体" height="12"/>
</dr:cell-style>
<dr:cell-style name="dateFormat" dataFormat="YYYY-MM-DD">
<dr:font bold="false" fontName="宋体" height="12"/>
</dr:cell-style>
<dr:cell-style name="group">
<dr:font bold="false" fontName="宋体" height="12"/>
</dr:cell-style>
</styles>
<sheets>
<dr:sheet name="第一页" autoSizeColumns="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20" displayGridlines="true">
<dr:static-content>
<dr:cell-data cell="A" row="1" stylename="right" type="content" value="合同应收明细表"/>
<dr:cell-data cell="A" row="3" stylename="left" type="content" value="代理店:"/>
<dr:cell-data cell="B" row="3" stylename="left" type="content" value="${/model/head_info/record/@bp_name}"/>
<dr:cell-data cell="J" row="3" stylename="left" type="content" value="业务伙伴号:"/>
<dr:cell-data cell="L" row="3" stylename="left" type="content" value="${/model/head_info/record/@client_bp_code}"/>
<dr:cell-data cell="A" row="4" stylename="left" type="content" value="合同编号:"/>
<dr:cell-data cell="B" row="4" stylename="left" type="content" value="${/model/head_info/record/@contract_number}"/>
<dr:cell-data cell="J" row="4" stylename="left" type="content" value="客户名称:"/>
<dr:cell-data cell="L" row="4" stylename="left" type="content" value="${/model/head_info/record/@client_bp_name}"/>
<dr:cell-data cell="A" row="5" stylename="left" type="content" value="机型:"/>
<dr:cell-data cell="B" row="5" stylename="left" type="content" value="${/model/head_info/record/@pattern}"/>
<dr:cell-data cell="J" row="5" stylename="left" type="content" value="机号:"/>
<dr:cell-data cell="L" row="5" stylename="left" type="content" value="${/model/head_info/record/@machine_number}"/>
<dr:cell-data cell="A" row="6" stylename="left" type="content" value="合同签订日:"/>
<dr:cell-data cell="B" row="6" stylename="left" type="content" value="${/model/head_info/record/@inception_of_lease}"/>
<dr:cell-data cell="J" row="6" stylename="left" type="content" value="租赁开始日:"/>
<dr:cell-data cell="L" row="6" stylename="left" type="content" value="${/model/head_info/record/@lease_start_date}"/>
<dr:cell-data cell="A" row="7" stylename="left" type="content" value="利率:"/>
<dr:cell-data cell="B" row="7" stylename="left" type="content" value="${/model/head_info/record/@inception_of_lease}"/>
<dr:cell-data cell="J" row="7" stylename="left" type="content" value="租赁期间:"/>
<dr:cell-data cell="L" row="7" stylename="left" type="content" value="${/model/head_info/record/@lease_start_date}"/>
</dr:static-content>
<dr:dynamic-content cell="A" datamodel="/model/grid_data" row="8">
<dr:columns>
<dr:table-column cellStyle="cell_center" column_id="439" field="times" title="期数" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="440" field="due_date" title="预定收款日" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="441" field="due_amount" title="预定收款金额" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="448" field="total_interest" title="利息合计" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="442" field="up_interest" title="利息上端" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="443" field="down_interest" title="利息下端" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="444" field="total_net_interest" title="利息(不含税)合计" titlestyle="header" type="content" />
<dr:table-column cellStyle="cell_center" column_id="445" field="up_net_interest" title="利息(不含税)上端" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="446" field="down_net_interest" title="利息(不含税)下端" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="447" field="total_vat_interest" title="利息(增值税)合计" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="447" field="up_vat_interest" title="利息(增值税)上端" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="447" field="down_vat_interest" title="利息(增值税)下端" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="447" field="total_weight_factor" title="本期天数合计" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="447" field="up_weight_factor" title="本期天数下端" titlestyle="header" type="content"/>
<dr:table-column cellStyle="cell_center" column_id="447" field="down_weight_factor" title="本期天数下端" titlestyle="header" type="content"/>
</dr:columns>
</dr:dynamic-content>
</dr:sheet>
</sheets>
</dr:excel-report>
</a:init-procedure>
</a:service>
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