Commit fba4a775 authored by 李贺贺's avatar 李贺贺

回收逾期明细表保证金抵扣后取值

parent 2fa91e00
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: lihh
$Date: 2021-06-10 上午10:30:21
$Revision: 1.0
$Purpose: 逾期租金表(保证金后)获取数据
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select
rct.agent_extra_name agent_extra_name_af,
rct.bp_tenant_name bp_tenant_name_af,
rct.branch_code branch_code_af,
rct.contract_id contract_id_af,
rct.contract_number contract_number_af,
rct.cshflow_id cshflow_id_af,
nvl(rct.deposit_amount,0) deposit_amount_af,
rct.due_amount due_amount_af,
to_char(rct.due_date,'yyyy-mm-dd') due_date_af,
(NVL(rct.int_rate_display, 0) * 100 ||'%') int_rate_display_af,
rct.is_buyout,
(Select v1.code_value_name
From sys_code_values_v v1
Where v1.code = 'YES_OR_NO'
And v1.code_enabled_flag = 'Y'
And v1.code_value_enabled_flag = 'Y'
and v1.CODE_VALUE = rct.is_buyout) is_buyout_af,
rct.large_balance large_balance_af,
rct.machine_number machine_number_af,
to_char(rct.lease_start_date,'yyyy-mm-dd') lease_start_date_af,
rct.modelcd modelcd_af,
nvl(rct.overdue_days,0) overdue_days_af,
nvl(rct.received_amount,0) received_amount_af,
rct.times times_af,
nvl(rct.unreceived_amount,0) unreceived_amount_af,
rct.rent_type
from
rpt5012_csh_result_after_temp rct
order by rct.contract_number,rct.times
]]></bm:query-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
csh_result_query_pkg.get_result_received_amount(
p_month =>${@month},
p_cur_begin =>${@cur_begin},
p_cur_end =>${@cur_end},
p_before_begin =>${@before_begin},
p_before_end =>${@before_end}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="cur_begin" dataType="date" input="true" output="true"
outputPath="/parameter/@cur_begin"/>
<bm:parameter name="cur_end" dataType="date" input="true" output="true"
outputPath="/parameter/@cur_end"/>
<bm:parameter name="before_begin" dataType="date" input="true" output="true"
outputPath="/parameter/@before_begin"/>
<bm:parameter name="before_end" dataType="date" input="true" output="true"
outputPath="/parameter/@before_end"/>
</bm:parameters>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="agent_extra_name_af"/>
<bm:field name="bp_tenant_name_af"/>
<bm:field name="contract_number_af"/>
<bm:field name="lease_start_date_af"/>
<bm:field name="modelcd_af"/>
<bm:field name="machine_number_af"/>
<bm:field name="int_rate_display_af"/>
<bm:field name="times_af"/>
<bm:field name="due_date_af"/>
<bm:field name="due_amount_af" datatype="java.lang.Double"/>
<bm:field name="received_amount_af" datatype="java.lang.Double"/>
<bm:field name="unreceived_amount_af" datatype="java.lang.Double"/>
<bm:field name="overdue_days_af" datatype="java.lang.Double"/>
<bm:field name="deposit_amount_af" datatype="java.lang.Double"/>
<bm:field name="is_buyout_af"/>
<bm:field name="rent_type"/>
</bm:fields>
</bm:model>
...@@ -26,7 +26,12 @@ ...@@ -26,7 +26,12 @@
'yyyy-mm-dd') lease_start_date, 'yyyy-mm-dd') lease_start_date,
ccli.machine_number, ccli.machine_number,
ccli.modelcd, ccli.modelcd,
ccc.times, (CASE
WHEN ccc.cf_item = 8 THEN
'留购价'
ELSE
to_char(ccc.times)
END) times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(NVL(t.int_rate_display, 0) * 100 || (NVL(t.int_rate_display, 0) * 100 ||
...@@ -95,7 +100,13 @@ ...@@ -95,7 +100,13 @@
Where v.code = 'BRANCH_CODE_SZMP' Where v.code = 'BRANCH_CODE_SZMP'
And v.code_enabled_flag = 'Y' And v.code_enabled_flag = 'Y'
And v.code_value_enabled_flag = 'Y' And v.code_value_enabled_flag = 'Y'
And v.code_value = t.branch_code) branch_code_n And v.code_value = t.branch_code) branch_code_n,
(CASE
WHEN to_char(ccc.due_date,'MM') = to_char(to_date(${@cur_begin}, 'yyyy-mm-dd'),'MM') THEN
'新增租金'
ELSE
'往期租金'
END) rent_type
from con_contract_cashflow ccc, con_contract t, con_contract_lease_item ccli from con_contract_cashflow ccc, con_contract t, con_contract_lease_item ccli
WHERE ccc.contract_id = t.contract_id WHERE ccc.contract_id = t.contract_id
AND ccli.contract_id (+) = t.contract_id AND ccli.contract_id (+) = t.contract_id
...@@ -144,12 +155,13 @@ ...@@ -144,12 +155,13 @@
<bm:field name="int_rate_display"/> <bm:field name="int_rate_display"/>
<bm:field name="times"/> <bm:field name="times"/>
<bm:field name="due_date"/> <bm:field name="due_date"/>
<bm:field name="due_amount"/> <bm:field name="due_amount" datatype="java.lang.Double"/>
<bm:field name="received_amount"/> <bm:field name="received_amount" datatype="java.lang.Double"/>
<bm:field name="unreceived_amount"/> <bm:field name="unreceived_amount" datatype="java.lang.Double"/>
<bm:field name="overdue_days"/> <bm:field name="overdue_days" datatype="java.lang.Double"/>
<bm:field name="deposit_amount"/> <bm:field name="deposit_amount" datatype="java.lang.Double"/>
<bm:field name="is_buyout_n"/> <bm:field name="is_buyout_n"/>
<bm:field name="rent_type"/>
</bm:fields> </bm:fields>
<!-- <bm:query-fields>--> <!-- <bm:query-fields>-->
<!-- <bm:query-field field="bp_id_tenant_n" queryExpression="t1.bp_id_tenant_n = ${@bp_id_tenant_n}"/>--> <!-- <bm:query-field field="bp_id_tenant_n" queryExpression="t1.bp_id_tenant_n = ${@bp_id_tenant_n}"/>-->
......
...@@ -483,19 +483,22 @@ ...@@ -483,19 +483,22 @@
p_calc_date => to_date(${@cur_end}, p_calc_date => to_date(${@cur_end},
'yyyy-mm-dd'), 'yyyy-mm-dd'),
p_contract_inception_date => ct.contract_inception_date) p_contract_inception_date => ct.contract_inception_date)
END) business_due_times, END) business_due_times_after,
--逾期期数 --逾期期数(保证金后)
(CASE (CASE
WHEN ct.contract_status IN ('TERMINATE', 'REPUR', 'ET') THEN WHEN ct.contract_status IN ('TERMINATE', 'REPUR', 'ET') THEN
0 0
ELSE ELSE
con_contract_pkg.get_business_times( (Select count(*)
p_contract_id => ct.contract_id, From con_contract_cashflow ccw
p_calc_date => to_date(${@cur_end}, 'yyyy-mm-dd'), Where trunc(ccw.due_date) <= trunc(to_date(${@cur_end},'yyyy-mm-dd'))
p_contract_inception_date => ct.contract_inception_date, And ccw.contract_id = ct.contract_id
p_amount_after => 'Y') And ccw.cf_item In (1, 200,250)
END) business_due_times_after, and ccw.cf_status = 'RELEASE'
--逾期期数(保证金后) And ccw.times > 0
and ccw.due_amount > ccw.received_amount)
END) business_due_times,
--逾期期数(保证金前)
(case when ((CASE (case when ((CASE
WHEN ct.contract_status IN ('TERMINATE', 'REPUR', 'ET') THEN WHEN ct.contract_status IN ('TERMINATE', 'REPUR', 'ET') THEN
0 0
...@@ -615,13 +618,18 @@ ...@@ -615,13 +618,18 @@
END) END)
end) business_due_amount_after, end) business_due_amount_after,
--当月末逾期金额(合计)保证金后 --当月末逾期金额(合计)保证金后
(SELECT SUM((nvl(tt.transaction_amount, 0) - nvl(tt.write_off_amount, 0) - ((SELECT SUM(nvl(tt.transaction_amount, 0))
nvl(tt.returned_amount, 0)))
FROM csh_transaction tt FROM csh_transaction tt
WHERE tt.transaction_type = 'DEPOSIT' WHERE tt.transaction_type = 'DEPOSIT'
AND tt.deposit_trans_type = 'rent_deposit' AND tt.deposit_trans_type = 'rent_deposit'
AND tt.ref_contract_id = ct.contract_id AND tt.ref_contract_id = ct.contract_id
AND tt.transaction_date <= trunc(to_date(${@cur_end}, 'yyyy-mm-dd'))) deposit_amount, AND tt.transaction_date <= trunc(to_date(${@cur_end}, 'yyyy-mm-dd')))
-
(SELECT sum(nvl(cwo.WRITE_OFF_DUE_AMOUNT,0))
FROM csh_write_off cwo
where cwo.write_off_type in ('CSH_RETURN','DEPOSIT_TRANSFER','DEPOSIT_CREDIT')
AND cwo.csh_transaction_id in (select cts.transaction_id from csh_transaction cts where cts.ref_contract_id = ct.contract_id)
AND cwo.write_off_date <= trunc(to_date(${@cur_end}, 'yyyy-mm-dd')))) deposit_amount,
--保证金金额 --保证金金额
(SELECT v.code_value_name (SELECT v.code_value_name
FROM sys_code_values_v v FROM sys_code_values_v v
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<a:link id="rpt5012_report_query_link" url="${/request/@context_path}/modules/rpt/RPT5012/rpt5012_repory_query.lview"/> <a:link id="rpt5012_report_query_link" url="${/request/@context_path}/modules/rpt/RPT5012/rpt5012_repory_query.lview"/>
<a:link id="rpt5012_print_link_id" model="rpt.RPT5012.rpt5012_result_query" modelaction="execute"/> <a:link id="rpt5012_print_link_id" model="rpt.RPT5012.rpt5012_result_query" modelaction="execute"/>
<a:link id="rpt5012_csh_result_after_link_id" model="rpt.RPT5012.rpt5012_csh_result_after_query" modelaction="execute"/>
<script><![CDATA[ <script><![CDATA[
function rpt5012_reset() { function rpt5012_reset() {
$('rpt5012_query_ds').reset(); $('rpt5012_query_ds').reset();
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
} }
Leaf.request({ Leaf.request({
url: $('rpt5012_print_link_id').getUrl(), url: $('rpt5012_csh_result_after_link_id').getUrl(),
para: { para: {
month: month month: month
}, },
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
<a:dataSets> <a:dataSets>
<a:dataSet id="con_contract_rental_result_ds" pageSize="13" autoQuery="true" model="rpt.RPT5012.rpt5012_result_query" queryUrl="${/request/@context_path}/autocrud/rpt.RPT5012.rpt5012_result_query/query?month=${/parameter/@month}&amp;cur_begin=${/parameter/@cur_begin}&amp;cur_end=${/parameter/@cur_end}&amp;before_begin=${/parameter/@before_begin}&amp;before_end=${/parameter/@before_end}" autoPageSize="true"/> <a:dataSet id="con_contract_rental_result_ds" pageSize="13" autoQuery="true" model="rpt.RPT5012.rpt5012_result_query" queryUrl="${/request/@context_path}/autocrud/rpt.RPT5012.rpt5012_result_query/query?month=${/parameter/@month}&amp;cur_begin=${/parameter/@cur_begin}&amp;cur_end=${/parameter/@cur_end}&amp;before_begin=${/parameter/@before_begin}&amp;before_end=${/parameter/@before_end}" autoPageSize="true"/>
<a:dataSet id="con_contract_cashflow_rental_result_ds" pageSize="13" autoQuery="true" model="rpt.RPT5012.rpt5012_csh_result_query" queryUrl="${/request/@context_path}/autocrud/rpt.RPT5012.rpt5012_csh_result_query/query?month=${/parameter/@month}&amp;cur_begin=${/parameter/@cur_begin}&amp;cur_end=${/parameter/@cur_end}&amp;before_begin=${/parameter/@before_begin}&amp;before_end=${/parameter/@before_end}" autoPageSize="true"/> <a:dataSet id="con_contract_cashflow_rental_result_ds" pageSize="13" autoQuery="true" model="rpt.RPT5012.rpt5012_csh_result_query" queryUrl="${/request/@context_path}/autocrud/rpt.RPT5012.rpt5012_csh_result_query/query?month=${/parameter/@month}&amp;cur_begin=${/parameter/@cur_begin}&amp;cur_end=${/parameter/@cur_end}&amp;before_begin=${/parameter/@before_begin}&amp;before_end=${/parameter/@before_end}" autoPageSize="true"/>
<a:dataSet id="con_contract_cashflow_rental_result_after_ds" pageSize="13" autoQuery="true" model="rpt.RPT5012.rpt5012_csh_result_after_query" queryUrl="${/request/@context_path}/autocrud/rpt.RPT5012.rpt5012_csh_result_after_query/query" autoPageSize="true"/>
</a:dataSets> </a:dataSets>
<a:screenBody> <a:screenBody>
<!-- <a:screenTopToolbar>--> <!-- <a:screenTopToolbar>-->
...@@ -155,7 +156,7 @@ ...@@ -155,7 +156,7 @@
<a:column name="is_buyout_n" align="center" prompt="是否买断机" width="100"/> <a:column name="is_buyout_n" align="center" prompt="是否买断机" width="100"/>
<a:column name="modelcd" align="center" prompt=" 机型" width="180"/> <a:column name="modelcd" align="center" prompt=" 机型" width="180"/>
<a:column name="machine_number" align="center" prompt="机器号码" width="80"/> <a:column name="machine_number" align="center" prompt="机器号码" width="80"/>
<a:column name="int_rate_display" align="center" prompt="利率" width="80"/> <!--<a:column name="int_rate_display" align="center" prompt="利率" width="80"/>-->
<a:column name="times" align="center" prompt="回数" width="80"/> <a:column name="times" align="center" prompt="回数" width="80"/>
<a:column name="due_date" align="center" prompt="支付预定日" width="80"/> <a:column name="due_date" align="center" prompt="支付预定日" width="80"/>
<a:column name="due_amount" align="center" prompt="应收款金额" renderer="Leaf.formatMoney" width="80"/> <a:column name="due_amount" align="center" prompt="应收款金额" renderer="Leaf.formatMoney" width="80"/>
...@@ -163,6 +164,30 @@ ...@@ -163,6 +164,30 @@
<a:column name="unreceived_amount" align="center" prompt="未收金额" renderer="Leaf.formatMoney" width="80"/> <a:column name="unreceived_amount" align="center" prompt="未收金额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="overdue_days" align="center" prompt="逾期天数" width="80"/> <a:column name="overdue_days" align="center" prompt="逾期天数" width="80"/>
<a:column name="deposit_amount" align="center" prompt="保证金" renderer="Leaf.formatMoney" width="80"/> <a:column name="deposit_amount" align="center" prompt="保证金" renderer="Leaf.formatMoney" width="80"/>
<a:column name="rent_type" align="center" prompt="租金类型" width="100"/>
</a:columns>
</a:grid>
</a:tab>
<a:tab prompt="回收逾期明细表(保证金后)" width="180">
<a:grid id="con_contract_cashflow_rental_result_after_grid" bindTarget="con_contract_cashflow_rental_result_after_ds" marginHeight="115" navBar="true" marginWidth="30">
<a:columns>
<a:column name="agent_extra_name_af" align="center" prompt="代理店" width="120"/>
<a:column name="bp_tenant_name_af" align="center" prompt="客户名称" width="120"/>
<a:column name="contract_number_af" align="center" prompt="合同编号" width="100"/>
<a:column name="lease_start_date_af" align="center" prompt="租赁期开始日" width="80"/>
<a:column name="branch_code_af" align="center" prompt="分公司" width="100"/>
<a:column name="large_balance_af" align="center" prompt="大额尾款" width="100"/>
<a:column name="is_buyout_af" align="center" prompt="是否买断机" width="100"/>
<a:column name="modelcd_af" align="center" prompt=" 机型" width="180"/>
<a:column name="machine_number_af" align="center" prompt="机器号码" width="80"/>
<a:column name="times_af" align="center" prompt="回数" width="80"/>
<a:column name="due_date_af" align="center" prompt="支付预定日" width="80"/>
<a:column name="due_amount_af" align="center" prompt="应收款金额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="received_amount_af" align="center" prompt="已收款金额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="unreceived_amount_af" align="center" prompt="未收金额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="overdue_days_af" align="center" prompt="逾期天数" width="80"/>
<a:column name="deposit_amount_af" align="center" prompt="保证金" renderer="Leaf.formatMoney" width="80"/>
<a:column name="rent_type" align="center" prompt="租金类型" width="100"/>
</a:columns> </a:columns>
</a:grid> </a:grid>
</a:tab> </a:tab>
......
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