Commit 6e793bb3 authored by liyuan.chen's avatar liyuan.chen

保证金退款,项目新增附件上传

parent 3a81b600
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
<bm:field name="authorized_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AUTHORIZED_USER_ID" prompt="AUT_OWNER_USER_AUTHORIZE.AUTHORIZED_USER_ID"/> <bm:field name="authorized_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AUTHORIZED_USER_ID" prompt="AUT_OWNER_USER_AUTHORIZE.AUTHORIZED_USER_ID"/>
<bm:field name="start_date" databaseType="DATE" datatype="java.util.Date" physicalName="START_DATE" prompt="AUT_OWNER_USER_AUTHORIZE.START_DATE"/> <bm:field name="start_date" databaseType="DATE" datatype="java.util.Date" physicalName="START_DATE" prompt="AUT_OWNER_USER_AUTHORIZE.START_DATE"/>
<bm:field name="end_date" databaseType="DATE" datatype="java.util.Date" physicalName="END_DATE" prompt="AUT_OWNER_USER_AUTHORIZE.END_DATE"/> <bm:field name="end_date" databaseType="DATE" datatype="java.util.Date" physicalName="END_DATE" prompt="AUT_OWNER_USER_AUTHORIZE.END_DATE"/>
<bm:field name="owner_user_desc" expression="(select description from sys_user_data_owner_v a where a.user_id=t1.owner_user_id)" forInsert="false" forUpdate="false"/> <!--<bm:field name="owner_user_desc" expression="(select description from sys_user_data_owner_v a where a.user_id=t1.owner_user_id)" forInsert="false" forUpdate="false"/>-->
<bm:field name="owner_user_desc" expression="(select user_name from sys_user_data_owner_v a where a.user_id=t1.owner_user_id)" forInsert="false" forUpdate="false"/>
<bm:field name="owner_employee_name" expression="(select employee_name from sys_user_data_owner_v a where a.user_id=t1.owner_user_id)" forInsert="false" forUpdate="false"/> <bm:field name="owner_employee_name" expression="(select employee_name from sys_user_data_owner_v a where a.user_id=t1.owner_user_id)" forInsert="false" forUpdate="false"/>
<bm:field name="authorized_user_desc" expression="(select description from sys_user_v a where a.user_id=t1.authorized_user_id)" forInsert="false" forUpdate="false"/> <!--<bm:field name="authorized_user_desc" expression="(select description from sys_user_v a where a.user_id=t1.authorized_user_id)" forInsert="false" forUpdate="false"/>-->
<bm:field name="authorized_user_desc" expression="(select user_name from sys_user_v a where a.user_id=t1.authorized_user_id)" forInsert="false" forUpdate="false"/>
<bm:field name="authorized_employee_name" expression="(select employee_name from sys_user_v a where a.user_id=t1.authorized_user_id)" forInsert="false" forUpdate="false"/> <bm:field name="authorized_employee_name" expression="(select employee_name from sys_user_v a where a.user_id=t1.authorized_user_id)" forInsert="false" forUpdate="false"/>
<bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V01"/> <bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V01"/>
<bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V02"/> <bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="AUT_OWNER_USER_AUTHORIZE.REF_V02"/>
......
...@@ -3,348 +3,386 @@ ...@@ -3,348 +3,386 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT h.extra_nam, SELECT
--合同编号 h.extra_nam,
t.contract_number, --合同编号
--应付未付租金总额 t.contract_number,
(CASE --应付未付租金总额
WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name} THEN (CASE
(SELECT SUM(nvl(ccc.due_amount, 0)) WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name}
FROM con_contract_cashflow ccc THEN
WHERE ccc.contract_id = t.contract_id (SELECT SUM(nvl(ccc.due_amount, 0))
AND ccc.cf_item IN (1, 200, 250) FROM con_contract_cashflow ccc
AND ccc.cf_status = 'RELEASE') - WHERE ccc.contract_id = t.contract_id
nvl((SELECT SUM(cwo.write_off_due_amount) AND ccc.cf_item IN (1, 200, 250)
FROM csh_write_off cwo, csh_transaction ct AND ccc.cf_status = 'RELEASE') -
WHERE cwo.contract_id = t.contract_id nvl((SELECT SUM(cwo.write_off_due_amount)
AND cwo.csh_transaction_id = ct.transaction_id FROM csh_write_off cwo, csh_transaction ct
AND cwo.cf_item IN (1, 200, 250) WHERE cwo.contract_id = t.contract_id
AND nvl(cwo.reversed_flag, 'N') = 'N' AND cwo.csh_transaction_id = ct.transaction_id
AND trunc(ct.transaction_date) <= AND cwo.cf_item IN (1, 200, 250)
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))), AND nvl(cwo.reversed_flag, 'N') = 'N'
0) AND trunc(ct.transaction_date) <=
ELSE trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))),
0 0)
END) unpayment_amount, ELSE
--应付未付首付款总额 --首付款关联不到就取核销日期而不是收款日期 0
contract_item_query_pkg.calc_down_payment_balance ( p_contract_id=>t.contract_id, END) unpayment_amount,
p_calc_date =>to_date(${@last_month_date}, 'yyyy-mm-dd'), --应付未付首付款总额 --首付款关联不到就取核销日期而不是收款日期
p_calc_flag =>'START', contract_item_query_pkg.calc_down_payment_balance(p_contract_id=>t.contract_id,
p_user_id =>-1) undown_payment, p_calc_date =>to_date(${@last_month_date},
--应付未付留购金总额 'yyyy-mm-dd'),
(CASE p_calc_flag =>'START',
WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name} THEN p_user_id =>-1) undown_payment,
(SELECT SUM(nvl(ccc.due_amount, 0)) --应付未付留购金总额
FROM con_contract_cashflow ccc (CASE
WHERE ccc.contract_id = t.contract_id WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name}
AND ccc.cf_item = 8 THEN
AND ccc.cf_status = 'RELEASE') - (SELECT SUM(nvl(ccc.due_amount, 0))
nvl((SELECT SUM(cwo.write_off_due_amount) FROM con_contract_cashflow ccc
FROM csh_write_off cwo, csh_transaction ct WHERE ccc.contract_id = t.contract_id
WHERE cwo.contract_id = t.contract_id AND ccc.cf_item = 8
AND cwo.cf_item = 8 AND ccc.cf_status = 'RELEASE') -
AND cwo.csh_transaction_id = ct.transaction_id nvl((SELECT SUM(cwo.write_off_due_amount)
AND nvl(cwo.reversed_flag, 'N') = 'N' FROM csh_write_off cwo, csh_transaction ct
AND trunc(ct.transaction_date) <= WHERE cwo.contract_id = t.contract_id
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))), AND cwo.cf_item = 8
0) AND cwo.csh_transaction_id = ct.transaction_id
ELSE AND nvl(cwo.reversed_flag, 'N') = 'N'
0 AND trunc(ct.transaction_date) <=
END) unpurchase_amount, trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))),
--逾期租金 0)
(CASE ELSE
WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name} AND 0
(nvl((SELECT SUM(nvl(ccc.due_amount, 0)) END) unpurchase_amount,
FROM con_contract_cashflow ccc --逾期租金
WHERE ccc.contract_id = t.contract_id (CASE
AND ccc.cf_item IN (1, 200, 250) WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name} AND
AND trunc(ccc.due_date) <= (nvl((SELECT SUM(nvl(ccc.due_amount, 0))
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd')) FROM con_contract_cashflow ccc
AND ccc.cf_status = 'RELEASE'), WHERE ccc.contract_id = t.contract_id
0) - AND ccc.cf_item IN (1, 200, 250)
nvl((SELECT SUM(cwo.write_off_due_amount) AND trunc(ccc.due_date) <=
FROM csh_write_off cwo, csh_transaction ct trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))
WHERE cwo.contract_id = t.contract_id AND ccc.cf_status = 'RELEASE'),
AND cwo.cf_item IN (1, 200, 250) 0) -
AND cwo.csh_transaction_id = ct.transaction_id nvl((SELECT SUM(cwo.write_off_due_amount)
AND nvl(cwo.reversed_flag, 'N') = 'N' FROM csh_write_off cwo, csh_transaction ct
AND trunc(ct.transaction_date) <= WHERE cwo.contract_id = t.contract_id
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))), AND cwo.cf_item IN (1, 200, 250)
0)) > 0 THEN AND cwo.csh_transaction_id = ct.transaction_id
(nvl((SELECT SUM(nvl(ccc.due_amount, 0)) AND nvl(cwo.reversed_flag, 'N') = 'N'
FROM con_contract_cashflow ccc AND trunc(ct.transaction_date) <=
WHERE ccc.contract_id = t.contract_id trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))),
AND ccc.cf_item IN (1, 200, 250) 0)) > 0
AND trunc(ccc.due_date) <= THEN
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd')) (nvl((SELECT SUM(nvl(ccc.due_amount, 0))
AND ccc.cf_status = 'RELEASE'), FROM con_contract_cashflow ccc
0) - nvl((SELECT SUM(cwo.write_off_due_amount) WHERE ccc.contract_id = t.contract_id
FROM csh_write_off cwo, csh_transaction ct AND ccc.cf_item IN (1, 200, 250)
WHERE cwo.contract_id = t.contract_id AND trunc(ccc.due_date) <=
AND cwo.cf_item IN (1, 200, 250) trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))
AND cwo.csh_transaction_id = ct.transaction_id AND ccc.cf_status = 'RELEASE'),
AND nvl(cwo.reversed_flag, 'N') = 'N' 0) - nvl((SELECT SUM(cwo.write_off_due_amount)
AND trunc(ct.transaction_date) <= FROM csh_write_off cwo, csh_transaction ct
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))), WHERE cwo.contract_id = t.contract_id
0)) AND cwo.cf_item IN (1, 200, 250)
ELSE AND cwo.csh_transaction_id = ct.transaction_id
0 AND nvl(cwo.reversed_flag, 'N') = 'N'
END) overdue_amount, AND trunc(ct.transaction_date) <=
--逾期违约金 trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))),
(CASE 0))
WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name} THEN ELSE
(contract_item_query_pkg.calc_penalty_by_contract(p_contract_id => t.contract_id, 0
p_calc_date => to_date(${@start_calc_date}, END) overdue_amount,
'yyyy-mm-dd'), --逾期违约金
p_user_id => 1) - (CASE
nvl((SELECT SUM(cwo.write_off_due_amount) WHEN to_char(t.lease_start_date, 'yyyy-mm') <> ${@period_name}
FROM csh_write_off cwo, csh_transaction ct THEN
WHERE cwo.contract_id = t.contract_id (contract_item_query_pkg.calc_penalty_by_contract(p_contract_id => t.contract_id,
AND nvl(cwo.reversed_flag, 'N') = 'N' p_calc_date => to_date(
AND cwo.cf_item = 9 ${@start_calc_date},
AND cwo.csh_transaction_id = ct.transaction_id 'yyyy-mm-dd'),
AND trunc(ct.transaction_date) <= p_user_id => 1) -
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))), nvl((SELECT SUM(cwo.write_off_due_amount)
0)) FROM csh_write_off cwo, csh_transaction ct
ELSE WHERE cwo.contract_id = t.contract_id
0 AND nvl(cwo.reversed_flag, 'N') = 'N'
END) overdue_penalty, AND cwo.cf_item = 9
--当月新增租金 AND cwo.csh_transaction_id = ct.transaction_id
(CASE AND trunc(ct.transaction_date) <=
WHEN trunc(t.lease_start_date) BETWEEN trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))
trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd')) AND And Exists(Select 1
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd'))) THEN From con_contract_cashflow cc
(SELECT SUM(ccc.due_amount) Where cc.cashflow_id = cwo.cashflow_id
FROM con_contract_cashflow ccc And cc.cf_status = 'RELEASE'
WHERE ccc.cf_item IN (1, 200, 250) And cc.cf_direction <> 'NONCASH')),
AND ccc.cf_status = 'RELEASE' 0))
AND ccc.contract_id = t.contract_id) ELSE
ELSE 0
0 END) overdue_penalty,
END) monthly_amount, --当月新增租金
--当月新增首付款 (CASE
(CASE WHEN trunc(t.lease_start_date) BETWEEN
WHEN trunc(t.lease_start_date) BETWEEN trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd')) AND
trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd')) AND TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd'))) THEN THEN
(SELECT SUM(ccc.due_amount) (SELECT SUM(ccc.due_amount)
FROM con_contract_cashflow ccc FROM con_contract_cashflow ccc
WHERE ccc.cf_item = 2 WHERE ccc.cf_item IN (1, 200, 250)
AND ccc.cf_status = 'RELEASE' AND ccc.cf_status = 'RELEASE'
AND ccc.contract_id = t.contract_id) AND ccc.contract_id = t.contract_id)
ELSE ELSE
0 0
END) monthly_downpayment, END) monthly_amount,
--当月新增留购款 --当月新增首付款
(CASE (CASE
WHEN trunc(t.lease_start_date) BETWEEN WHEN trunc(t.lease_start_date) BETWEEN
trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd')) AND trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd')) AND
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd'))) THEN TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
(SELECT SUM(ccc.due_amount) THEN
FROM con_contract_cashflow ccc (SELECT SUM(ccc.due_amount)
WHERE ccc.cf_item = 8 FROM con_contract_cashflow ccc
AND ccc.cf_status = 'RELEASE' WHERE ccc.cf_item = 2
AND ccc.contract_id = t.contract_id) AND ccc.cf_status = 'RELEASE'
ELSE AND ccc.contract_id = t.contract_id)
0 ELSE
END) monthly_purchase_amount, 0
--当月回租金 END) monthly_downpayment,
nvl((SELECT SUM(cwo.write_off_due_amount) --当月新增留购款
FROM csh_write_off cwo, csh_transaction ct (CASE
WHERE cwo.contract_id = t.contract_id WHEN trunc(t.lease_start_date) BETWEEN
AND nvl(cwo.reversed_flag, 'N') = 'N' trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd')) AND
AND cwo.cf_item IN (1, 200, 250) TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
AND cwo.csh_transaction_id = ct.transaction_id THEN
AND trunc(ct.transaction_date) <= (SELECT SUM(ccc.due_amount)
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd'))) FROM con_contract_cashflow ccc
AND trunc(ct.transaction_date) >= WHERE ccc.cf_item = 8
TRUNC(to_date(${@start_calc_date}, 'yyyy-mm-dd'))), AND ccc.cf_status = 'RELEASE'
0) write_off_amount, AND ccc.contract_id = t.contract_id)
--当月回收首付款 ELSE
0
END) monthly_purchase_amount,
--当月回租金
nvl((SELECT SUM(cwo.write_off_due_amount)
FROM csh_write_off cwo, csh_transaction ct
WHERE cwo.contract_id = t.contract_id
AND nvl(cwo.reversed_flag, 'N') = 'N'
AND cwo.cf_item IN (1, 200, 250)
AND cwo.csh_transaction_id = ct.transaction_id
AND trunc(ct.transaction_date) <=
TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
AND trunc(ct.transaction_date) >=
TRUNC(to_date(${@start_calc_date}, 'yyyy-mm-dd'))),
0) write_off_amount,
--当月回收首付款
contract_item_query_pkg.calc_down_payment_write(p_contract_id=> t.contract_id, contract_item_query_pkg.calc_down_payment_write(p_contract_id=> t.contract_id,
p_calc_date => to_date(${@start_calc_date}, p_calc_date => to_date(${@start_calc_date},
'yyyy-mm-dd'), 'yyyy-mm-dd'),
p_user_id => -1) write_off_downpayment, p_user_id => -1) write_off_downpayment,
--回收留购金 --回收留购金
nvl((SELECT SUM(cwo.write_off_due_amount) nvl((SELECT SUM(cwo.write_off_due_amount)
FROM csh_write_off cwo, csh_transaction ct FROM csh_write_off cwo, csh_transaction ct
WHERE cwo.contract_id = t.contract_id WHERE cwo.contract_id = t.contract_id
AND nvl(cwo.reversed_flag, 'N') = 'N' AND nvl(cwo.reversed_flag, 'N') = 'N'
AND cwo.cf_item = 8 AND cwo.cf_item = 8
AND cwo.csh_transaction_id = ct.transaction_id AND cwo.csh_transaction_id = ct.transaction_id
AND trunc(ct.transaction_date) <= AND trunc(ct.transaction_date) <=
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd'))) TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
AND trunc(ct.transaction_date) >= AND trunc(ct.transaction_date) >=
trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd'))), trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd'))),
0) write_off_purchase_amount, 0) write_off_purchase_amount,
--回收违约金 --回收违约金
nvl((SELECT SUM(cwo.write_off_due_amount) nvl((SELECT SUM(cwo.write_off_due_amount)
FROM csh_write_off cwo, csh_transaction ct FROM csh_write_off cwo, csh_transaction ct
WHERE cwo.contract_id = t.contract_id WHERE cwo.contract_id = t.contract_id
AND nvl(cwo.reversed_flag, 'N') = 'N' AND nvl(cwo.reversed_flag, 'N') = 'N'
AND cwo.cf_item = 9 AND cwo.cf_item = 9
AND cwo.csh_transaction_id = ct.transaction_id AND cwo.csh_transaction_id = ct.transaction_id
AND trunc(ct.transaction_date) <= AND trunc(ct.transaction_date) <=
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd'))) TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
AND trunc(ct.transaction_date) >= AND trunc(ct.transaction_date) >=
trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd'))), trunc(to_date(${@start_calc_date}, 'yyyy-mm-dd'))),
0) write_off_penalty, 0) write_off_penalty,
--期末数据 --期末数据
(SELECT SUM(nvl(ccc.due_amount, 0)) (SELECT SUM(nvl(ccc.due_amount, 0))
FROM con_contract_cashflow ccc FROM con_contract_cashflow ccc
WHERE ccc.contract_id = t.contract_id WHERE ccc.contract_id = t.contract_id
AND ccc.cf_item IN (1, 200, 250) AND ccc.cf_item IN (1, 200, 250)
AND ccc.cf_status = 'RELEASE') - AND ccc.cf_status = 'RELEASE') -
nvl((SELECT SUM(cwo.write_off_due_amount) nvl((SELECT SUM(cwo.write_off_due_amount)
FROM csh_write_off cwo, csh_transaction ct FROM csh_write_off cwo, csh_transaction ct
WHERE cwo.contract_id = t.contract_id WHERE cwo.contract_id = t.contract_id
AND cwo.cf_item IN (1, 200, 250) AND cwo.cf_item IN (1, 200, 250)
AND cwo.csh_transaction_id = ct.transaction_id AND cwo.csh_transaction_id = ct.transaction_id
AND nvl(cwo.reversed_flag, 'N') = 'N' AND nvl(cwo.reversed_flag, 'N') = 'N'
AND trunc(ct.transaction_date) <= AND trunc(ct.transaction_date) <=
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd')))), TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))),
0) rest_unpayment_amount, 0) rest_unpayment_amount,
--保证金后 --保证金后
contract_item_query_pkg.calc_rest_rent_by_dudt(p_contract_id => t.contract_id, contract_item_query_pkg.calc_rest_rent_by_dudt(p_contract_id => t.contract_id,
p_calc_date => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')), p_calc_date => last_day(
p_user_id => -1) rest_unpayment_amount_af, to_date(${@start_calc_date}, 'yyyy-mm-dd')),
p_user_id => -1) rest_unpayment_amount_af,
contract_item_query_pkg.calc_down_payment_balance ( p_contract_id=>t.contract_id, contract_item_query_pkg.calc_down_payment_balance(p_contract_id=>t.contract_id,
p_calc_date =>last_day(to_date(${@start_calc_date},'yyyy-mm-dd')), p_calc_date =>last_day(
p_calc_flag =>'END', to_date(${@start_calc_date},
p_user_id =>-1) rest_undown_payment, 'yyyy-mm-dd')),
--应付未付留购金总额 p_calc_flag =>'END',
(SELECT SUM(nvl(ccc.due_amount, 0)) p_user_id =>-1) rest_undown_payment,
FROM con_contract_cashflow ccc --应付未付留购金总额
WHERE ccc.contract_id = t.contract_id (SELECT SUM(nvl(ccc.due_amount, 0))
AND ccc.cf_item = 8
AND ccc.cf_status = 'RELEASE') -
nvl((SELECT SUM(cwo.write_off_due_amount)
FROM csh_write_off cwo, csh_transaction ct
WHERE cwo.contract_id = t.contract_id
AND cwo.cf_item = 8
AND cwo.csh_transaction_id = ct.transaction_id
AND nvl(cwo.reversed_flag, 'N') = 'N'
AND trunc(ct.transaction_date) <=
TRUNC(last_day(to_date(${@start_calc_date},'yyyy-mm-dd')))),
0) rest_unpurchase_amount,
--逾期租金
(CASE
WHEN (nvl((SELECT SUM(nvl(ccc.due_amount, 0))
FROM con_contract_cashflow ccc FROM con_contract_cashflow ccc
WHERE ccc.contract_id = t.contract_id WHERE ccc.contract_id = t.contract_id
AND ccc.cf_item IN (1, 200, 250) AND ccc.cf_item = 8
AND trunc(ccc.due_date) <= AND ccc.cf_status = 'RELEASE') -
trunc(comparedate(p_date1 => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')), nvl((SELECT SUM(cwo.write_off_due_amount)
p_date2 =>sysdate , FROM csh_write_off cwo, csh_transaction ct
p_type =>'SMALL')) WHERE cwo.contract_id = t.contract_id
AND ccc.cf_status = 'RELEASE'), AND cwo.cf_item = 8
0) - AND cwo.csh_transaction_id = ct.transaction_id
nvl((SELECT SUM(cwo.write_off_due_amount) AND nvl(cwo.reversed_flag, 'N') = 'N'
FROM csh_write_off cwo, csh_transaction ct AND trunc(ct.transaction_date) <=
WHERE cwo.contract_id = t.contract_id TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))),
AND cwo.cf_item IN (1, 200, 250) 0) rest_unpurchase_amount,
AND cwo.csh_transaction_id = ct.transaction_id --逾期租金
AND nvl(cwo.reversed_flag, 'N') = 'N' (CASE
AND trunc(ct.transaction_date) <= WHEN (nvl((SELECT SUM(nvl(ccc.due_amount, 0))
trunc(comparedate(p_date1 => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')), FROM con_contract_cashflow ccc
p_date2 =>sysdate , WHERE ccc.contract_id = t.contract_id
p_type =>'SMALL'))), AND ccc.cf_item IN (1, 200, 250)
0)) > 0 THEN AND trunc(ccc.due_date) <=
(nvl((SELECT SUM(nvl(ccc.due_amount, 0)) trunc(comparedate(
FROM con_contract_cashflow ccc p_date1 => last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')),
WHERE ccc.contract_id = t.contract_id p_date2 =>sysdate,
AND ccc.cf_item IN (1, 200, 250) p_type =>'SMALL'))
AND trunc(ccc.due_date) <= AND ccc.cf_status = 'RELEASE'),
trunc(comparedate(p_date1 => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')), 0) -
p_date2 =>sysdate , nvl((SELECT SUM(cwo.write_off_due_amount)
p_type =>'SMALL')) FROM csh_write_off cwo, csh_transaction ct
AND ccc.cf_status = 'RELEASE'), WHERE cwo.contract_id = t.contract_id
0) - nvl((SELECT SUM(cwo.write_off_due_amount) AND cwo.cf_item IN (1, 200, 250)
FROM csh_write_off cwo, csh_transaction ct AND cwo.csh_transaction_id = ct.transaction_id
AND nvl(cwo.reversed_flag, 'N') = 'N'
AND trunc(ct.transaction_date) <=
trunc(comparedate(
p_date1 => last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')),
p_date2 =>sysdate,
p_type =>'SMALL'))),
0)) > 0
THEN
(nvl((SELECT SUM(nvl(ccc.due_amount, 0))
FROM con_contract_cashflow ccc
WHERE ccc.contract_id = t.contract_id
AND ccc.cf_item IN (1, 200, 250)
AND trunc(ccc.due_date) <=
trunc(comparedate(p_date1 => last_day(
to_date(${@start_calc_date}, 'yyyy-mm-dd')),
p_date2 =>sysdate,
p_type =>'SMALL'))
AND ccc.cf_status = 'RELEASE'),
0) - nvl((SELECT SUM(cwo.write_off_due_amount)
FROM csh_write_off cwo, csh_transaction ct
WHERE cwo.contract_id = t.contract_id
AND cwo.cf_item IN (1, 200, 250)
AND cwo.csh_transaction_id = ct.transaction_id
AND nvl(cwo.reversed_flag, 'N') = 'N'
AND trunc(ct.transaction_date) <=
trunc(comparedate(p_date1 => last_day(
to_date(${@start_calc_date}, 'yyyy-mm-dd')),
p_date2 =>sysdate,
p_type =>'SMALL'))),
0))
ELSE
0
END) rest_overdue_amount,
contract_item_query_pkg.calc_overdue_amount_by_dudt(p_contract_id => t.contract_id,
p_calc_date =>comparedate(p_date1 => last_day(
to_date(${@start_calc_date},
'yyyy-mm-dd')),
p_date2 =>sysdate,
p_type =>'SMALL'),
p_user_id => -1) rest_overdue_amount_af,
--逾期违约金
(contract_item_query_pkg.calc_penalty_by_contract(p_contract_id => t.contract_id,
p_calc_date =>last_day(to_date(
${@start_calc_date},
'yyyy-mm-dd')) +
1,
p_user_id => 1) -
nvl((SELECT SUM(cwo.write_off_due_amount)
FROM csh_write_off cwo, csh_transaction ct
WHERE cwo.contract_id = t.contract_id WHERE cwo.contract_id = t.contract_id
AND cwo.cf_item IN (1, 200, 250) AND nvl(cwo.reversed_flag, 'N') = 'N'
AND cwo.csh_transaction_id = ct.transaction_id AND cwo.cf_item = 9
AND nvl(cwo.reversed_flag, 'N') = 'N' AND cwo.csh_transaction_id = ct.transaction_id
AND trunc(ct.transaction_date) <= AND trunc(ct.transaction_date) <=
trunc(comparedate(p_date1 => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')), trunc(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
p_date2 =>sysdate , And Exists(Select 1
p_type =>'SMALL'))), From con_contract_cashflow cc
0)) Where cc.cashflow_id = cwo.cashflow_id
ELSE And cc.cf_status = 'RELEASE'
0 And cc.cf_direction <> 'NONCASH')),
END) rest_overdue_amount, 0)) rest_overdue_penalty,
contract_item_query_pkg.calc_overdue_amount_by_dudt(p_contract_id => t.contract_id, --次月应收租金
p_calc_date =>comparedate(p_date1 => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')), nvl((SELECT SUM(nvl(due_amount, 0))
p_date2 =>sysdate , FROM con_contract_cashflow ccc
p_type =>'SMALL'), WHERE ccc.contract_id = t.contract_id
p_user_id => -1) rest_overdue_amount_af, AND to_char(ccc.due_date, 'yyyy-mm') =
--逾期违约金 to_char(add_months(to_date(${@start_calc_date}, 'yyyy-mm-dd'), 1), 'yyyy-mm')
(contract_item_query_pkg.calc_penalty_by_contract(p_contract_id => t.contract_id, AND ccc.cf_item IN (1, 200, 250)
p_calc_date => last_day(to_date(${@start_calc_date},'yyyy-mm-dd'))+1, AND ccc.cf_status = 'RELEASE'),
p_user_id => 1) - 0) next_due_amount,
nvl((SELECT SUM(cwo.write_off_due_amount) t.lease_start_date,
FROM csh_write_off cwo, csh_transaction ct (SELECT c.bp_name
WHERE cwo.contract_id = t.contract_id FROM hls_bp_master c
AND nvl(cwo.reversed_flag, 'N') = 'N' WHERE c.bp_id = t.bp_id_tenant) tenant_name,
AND cwo.cf_item = 9
AND cwo.csh_transaction_id = ct.transaction_id
AND trunc(ct.transaction_date) <=
trunc(last_day(to_date(${@start_calc_date},'yyyy-mm-dd')))),
0)) rest_overdue_penalty,
--次月应收租金
nvl((SELECT SUM(nvl(due_amount, 0))
FROM con_contract_cashflow ccc
WHERE ccc.contract_id = t.contract_id
AND to_char(ccc.due_date, 'yyyy-mm') = to_char(add_months(to_date(${@start_calc_date},'yyyy-mm-dd'),1),'yyyy-mm')
AND ccc.cf_item IN (1, 200, 250)
AND ccc.cf_status = 'RELEASE'),
0) next_due_amount,
t.lease_start_date,
(SELECT c.bp_name FROM hls_bp_master c WHERE c.bp_id = t.bp_id_tenant) tenant_name,
NVL((select sum((nvl(tt.transaction_amount, 0) - nvl(tt.write_off_amount, 0) -
nvl(tt.returned_amount, 0)))
from csh_transaction tt
where tt.transaction_type = 'DEPOSIT'
AND tt.deposit_trans_type = 'rent_deposit'
AND NVL(tt.reversed_flag,'N')='N'
and tt.ref_contract_id = T.contract_id),0) deposit_amount,
--逾期期数
contract_item_query_pkg.calc_business_overdue_times(p_contract_id =>t.contract_id ,
p_calc_date => comparedate(p_date1 => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')),
p_date2 =>sysdate ,
p_type =>'SMALL'),
p_user_id => -1)overdue_times_be,
--保证金后逾期期数
contract_item_query_pkg.calc_overdue_times_by_dudt(p_contract_id =>t.contract_id ,
p_calc_date =>comparedate(p_date1 => last_day(to_date(${@start_calc_date},'yyyy-mm-dd')),
p_date2 =>sysdate ,
p_type =>'SMALL'),
p_user_id => -1)overdue_times_af
FROM con_contract t, hls_bp_master h
WHERE t.data_class = 'NORMAL'
AND t.bp_id_agent_level1 = h.bp_id
AND (t.contract_status IN ('INCEPT',
'TERMINATING',
'ETING',
'REPURING',
'ET')or (to_char(t.et_date,'yyyy-mm')>=${@period_name} and t.contract_status='TERMINATE' ))
and trunc(t.lease_start_date) <= trunc(last_day(to_date(${@start_calc_date},'yyyy-mm-dd')))
NVL((select sum((nvl(tt.transaction_amount, 0) - nvl(tt.write_off_amount, 0) -
nvl(tt.returned_amount, 0)))
from csh_transaction tt
where tt.transaction_type = 'DEPOSIT'
AND tt.deposit_trans_type = 'rent_deposit'
AND NVL(tt.reversed_flag, 'N') = 'N'
and tt.ref_contract_id = T.contract_id), 0) deposit_amount,
--逾期期数
contract_item_query_pkg.calc_business_overdue_times(p_contract_id =>t.contract_id,
p_calc_date => comparedate(p_date1 => last_day(
to_date(${@start_calc_date},
'yyyy-mm-dd')),
p_date2 =>sysdate,
p_type =>'SMALL'),
p_user_id => -1) overdue_times_be,
--保证金后逾期期数
contract_item_query_pkg.calc_overdue_times_by_dudt(p_contract_id =>t.contract_id,
p_calc_date =>comparedate(p_date1 => last_day(
to_date(${@start_calc_date},
'yyyy-mm-dd')),
p_date2 =>sysdate,
p_type =>'SMALL'),
p_user_id => -1) overdue_times_af
FROM con_contract t, hls_bp_master h
WHERE t.data_class = 'NORMAL'
AND t.bp_id_agent_level1 = h.bp_id
AND (t.contract_status IN ('INCEPT',
'TERMINATING',
'ETING',
'REPURING',
'ET') or
(to_char(t.et_date, 'yyyy-mm') >= ${@period_name} and t.contract_status = 'TERMINATE'))
and trunc(t.lease_start_date) <= trunc(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
]]> ]]>
</bm:query-sql> </bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
<bm:query-fields> <bm:query-fields>
<!-- <bm:query-field name="period_name" queryExpression="t1.period_day=${@period_name}"/>--> <!-- <bm:query-field name="period_name" queryExpression="t1.period_day=${@period_name}"/>-->
<!-- <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="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-field name="bp_id_agent_level1" queryExpression="t.bp_id_agent_level1=${@bp_id_agent_level1}"/>-->
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -12,14 +12,17 @@ ...@@ -12,14 +12,17 @@
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="update"> <bm:operation name="update">
<bm:parameters>
<bm:parameter name="return_id" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@return_id"/>
</bm:parameters>
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
begin begin
hlcm_cux_deposit_pkg.check_transaction_status_new(
p_transaction_id=>${@transaction_id}, hlcm_cux_deposit_pkg.insert_transaction_return(p_transaction_id => ${@transaction_id},
p_user_id=>${/session/@user_id} p_user_id => ${/session/@user_id},
); p_return_id => ${@return_id});
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false" baseTable="CSH_DEPOSIT_CASHFLOW" alias="t">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
Select
t.deposit_cashflow_id,
t.return_id,
t.deposit_source_type,
t.transaction_id,
(Select c.transaction_num
From csh_transaction c
Where c.transaction_id = t.transaction_id) transaction_num,
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
t.transaction_amount,
t.transaction_deposit_amount,
t.contract_id,
(Select cc.contract_number
From con_contract cc
Where cc.contract_id = t.contract_id) contract_number,
t.creation_date,
t.created_by,
t.last_updated_by,
t.last_update_date,
(Select c.transaction_num
From csh_transaction c
Where c.transaction_id = t.source_csh_trx_id) source_transaction_num
From csh_deposit_cashflow t
#WHERE_CLAUSE#
order by t.transaction_date
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="query" expression="t.return_id = ${@return_id}"/>
</bm:data-filters>
<!--<bm:query-fields>
<bm:query-field name="return_id" queryExpression="t1.return_id = ${@return_id}"/>
</bm:query-fields>-->
</bm:model>
...@@ -103,10 +103,26 @@ ...@@ -103,10 +103,26 @@
<bm:field name="receipt_type_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'RECEIPT_TYPE' and v.code_value =t1.receipt_type)" forInsert="false" forUpdate="false"/> <bm:field name="receipt_type_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'RECEIPT_TYPE' and v.code_value =t1.receipt_type)" forInsert="false" forUpdate="false"/>
<bm:field name="deposit_trans_type"/> <bm:field name="deposit_trans_type"/>
<bm:field name="bp_id_telnet_code" expression="(select hb.bp_code from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant)" forInsert="false" forUpdate="false"/> <bm:field name="bp_id_telnet_code" expression="(select hb.bp_code from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant)" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id_telnet_n" expression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant)" forInsert="false" forUpdate="false"/> <bm:field name="bp_id_telnet_n" expression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_tenant)" forInsert="false" forUpdate="false"/>
<bm:field name="bp_name_n" expression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_agent_level1)" forInsert="false" forUpdate="false"/> <bm:field name="bp_name_n" expression="(select hb.bp_name from hls_bp_master hb,con_contract ct where ct.contract_id=t1.ref_contract_id and hb.bp_id=ct.bp_id_agent_level1)" forInsert="false" forUpdate="false"/>
<bm:field name="deposit_trans_type_desc" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'DEPOSIT_TRANS_TYPE' and v.code_value =t1.deposit_trans_type)" forInsert="false" forUpdate="false"/> <bm:field name="deposit_trans_type_desc" expression="(select v.code_value_name from sys_code_values_v v where v.code = 'DEPOSIT_TRANS_TYPE' and v.code_value =t1.deposit_trans_type)" forInsert="false" forUpdate="false"/>
<bm:field name="approve_status" expression=" nvl(( hlcm_cux_deposit_pkg.get_transaction_status_new(p_transaction_id=>t1.transaction_id,p_user_id=>1) ),'正常')" forInsert="false" forUpdate="false"/> <bm:field name="approve_status" expression=" nvl(( hlcm_cux_deposit_pkg.get_transaction_status_new(p_transaction_id=>t1.transaction_id,p_user_id=>1) ),'正常')" forInsert="false" forUpdate="false"/>
<bm:field name="left_amount" expression=" (Select (nvl(Sum(c.transaction_amount), 0) -
nvl(Sum(c.write_off_amount), 0) - nvl(Sum(c.returned_amount), 0) -
nvl(Sum((Select nvl(cr.return_amount, 0)
From csh_transaction_return cr
Where cr.transaction_id = c.transaction_id
And cr.status = 'APPROVING')),
0))
From csh_transaction c
Where c.company_id = ${/session/@company_id}
And c.ref_contract_id Is Not Null
And c.transaction_type = 'DEPOSIT'
And c.source_type Is Not Null
And c.ref_contract_id =
(Select c1.ref_contract_id
From csh_transaction c1
Where c1.transaction_id = t1.transaction_id) )" forInsert="false" forUpdate="false"/>
</bm:fields> </bm:fields>
<bm:features> <bm:features>
<f:standard-who/> <f:standard-who/>
......
...@@ -3,53 +3,63 @@ ...@@ -3,53 +3,63 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
select * from (select cr.return_id, select *
to_char(cr.return_date,'yyyy-mm-dd') return_date, from (select
cr.return_amount, cr.return_id,
ct.period_name, to_char(cr.return_date, 'yyyy-mm-dd') return_date,
cr.opposite_band_na, cr.return_amount,
cr.bp_bank_account_num, ct.period_name,
(select cp.description cr.opposite_band_na,
from csh_payment_method cp cr.bp_bank_account_num,
where cp.payment_method_id = ct.payment_method_id) payment_method_display, (select cp.description
ct.exchange_rate, from csh_payment_method cp
ct.bank_slip_num, where cp.payment_method_id =
(select gc.currency_name ct.payment_method_id) payment_method_display,
from gld_currency_vl gc ct.exchange_rate,
where gc.currency_code = ct.currency_code), ct.bank_slip_num,
(select tv.type_name (select gc.currency_name
from gld_exchangerate_types_vl tv from gld_currency_vl gc
where tv.type_code = ct.exchange_rate_type), where gc.currency_code = ct.currency_code),
(select a.bank_account_code (select tv.type_name
from csh_bank_account a from gld_exchangerate_types_vl tv
where a.bank_account_id = ct.bank_account_id) bank_account_code, where tv.type_code = ct.exchange_rate_type),
(select a.bank_account_name (select a.bank_account_code
from csh_bank_account a from csh_bank_account a
where a.bank_account_id = ct.bank_account_id) bank_account_name, where a.bank_account_id = ct.bank_account_id) bank_account_code,
(select a.bank_account_num (select a.bank_account_name
from csh_bank_account a from csh_bank_account a
where a.bank_account_id = ct.bank_account_id) bank_account_num, where a.bank_account_id = ct.bank_account_id) bank_account_name,
(select a.bank_account_code (select a.bank_account_num
from hls_bp_master_bank_account a from csh_bank_account a
where a.bank_account_id = ct.bp_bank_account_id) bp_bank_account_code, where a.bank_account_id = ct.bank_account_id) bank_account_num,
cr.bp_bank_account_name, (select a.bank_account_code
cr.notes description, from hls_bp_master_bank_account a
cr.csh_return_atm_id, where a.bank_account_id =
cr.csh_return_bp_id, ct.bp_bank_account_id) bp_bank_account_code,
(select a.bp_name cr.bp_bank_account_name,
from hls_bp_master a cr.notes description,
where a.bp_id = cr.csh_return_bp_id) csh_return_bp_name, cr.csh_return_atm_id,
(select hb.bp_code from hls_bp_master hb,con_contract cc where cc.contract_id=ct.ref_contract_id and hb.bp_id=cc.bp_id_tenant)bp_id_telnet_code, cr.csh_return_bp_id,
(select hb.bp_name from hls_bp_master hb,con_contract cc where cc.contract_id=ct.ref_contract_id and hb.bp_id=cc.bp_id_tenant)bp_id_telnet_n, (select a.bp_name
(select cc.contract_number from con_contract cc where cc.contract_id = ct.ref_contract_id) contract_number, from hls_bp_master a
(select a.bp_name where a.bp_id = cr.csh_return_bp_id) csh_return_bp_name,
from hls_bp_master a (select hb.bp_code
where a.bp_id = ct.bp_id) bp_agent_name from hls_bp_master hb, con_contract cc
from csh_transaction ct, csh_transaction_return cr where cc.contract_id = ct.ref_contract_id and hb.bp_id = cc.bp_id_tenant) bp_id_telnet_code,
where ct.transaction_id = cr.transaction_id (select hb.bp_name
)v from hls_bp_master hb, con_contract cc
where cc.contract_id = ct.ref_contract_id and hb.bp_id = cc.bp_id_tenant) bp_id_telnet_n,
(select cc.contract_number
from con_contract cc
where cc.contract_id = ct.ref_contract_id) contract_number,
(select a.bp_name
from hls_bp_master a
where a.bp_id = ct.bp_id) bp_agent_name,
nvl(cr.left_amount, 0) as left_amount
from csh_transaction ct, csh_transaction_return cr
where ct.transaction_id = cr.transaction_id
) v
#WHERE_CLAUSE# #WHERE_CLAUSE#
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
......
...@@ -2,25 +2,25 @@ ...@@ -2,25 +2,25 @@
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false"> <bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations> <bm:operations>
<bm:operation name="update"> <bm:operation name="update">
<bm:parameters>
<bm:parameter name="return_id" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@return_id"/>
</bm:parameters>
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
begin begin
hlcm_cux_deposit_pkg.execute_transaction_return(p_transaction_id=>${@transaction_id}, hlcm_cux_deposit_pkg.execute_transaction_return(p_transaction_id =>${@transaction_id},
p_return_date=>to_date(${@return_date},'yyyy-mm-dd hh24:mi:ss'), p_return_date =>to_date(${@return_date},
p_return_amount =>${@return_amount}, 'yyyy-mm-dd hh24:mi:ss'),
p_user_id =>${/session/@user_id}, p_return_amount =>${@return_amount},
p_return_id =>${@return_id}, p_user_id =>${/session/@user_id},
p_bp_bank_account_name =>${@bp_bank_account_name}, p_return_id =>${@return_id},
p_opposite_band_na =>${@opposite_band_na}, p_bp_bank_account_name =>${@bp_bank_account_name},
p_bp_bank_account_num =>${@bp_bank_account_num}, p_opposite_band_na =>${@opposite_band_na},
p_description =>${@description}, p_bp_bank_account_num =>${@bp_bank_account_num},
p_csh_return_atm_id=>${@csh_return_atm_id}, p_description =>${@description},
p_csh_return_bp_id=>${@csh_return_bp_id} p_csh_return_atm_id =>${@csh_return_atm_id},
); p_csh_return_bp_id =>${@csh_return_bp_id},
p_left_amount =>${@left_amount}
);
end;]]></bm:update-sql> end;
]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="execute"> <bm:operation name="execute">
<bm:parameters> <bm:parameters>
...@@ -31,10 +31,11 @@ ...@@ -31,10 +31,11 @@
begin begin
CSH_TRANSACTION_WFL_PKG.DEPOSIT_RETURN_WORKFLOW_START CSH_TRANSACTION_WFL_PKG.DEPOSIT_RETURN_WORKFLOW_START
( (
p_return_id=>${@return_id}, p_return_id=>${@return_id},
p_user_id=>${/session/@user_id} p_user_id=>${/session/@user_id}
); );
end;]]></bm:update-sql> end;
]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
......
...@@ -118,7 +118,8 @@ ...@@ -118,7 +118,8 @@
<a:field name="owner_user_id" required="true"/> <a:field name="owner_user_id" required="true"/>
<a:field name="owner_user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_data_owner_v_for_lov" lovWidth="500" prompt="AUT_OWNER_USER_AUTHORIZE.OWNER_USER_ID" required="true" title="选择单据所有者"> <a:field name="owner_user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_data_owner_v_for_lov" lovWidth="500" prompt="AUT_OWNER_USER_AUTHORIZE.OWNER_USER_ID" required="true" title="选择单据所有者">
<a:mapping> <a:mapping>
<a:map from="description" to="owner_user_desc"/> <!--<a:map from="description" to="owner_user_desc"/>-->
<a:map from="user_name" to="owner_user_desc"/>
<a:map from="user_id" to="owner_user_id"/> <a:map from="user_id" to="owner_user_id"/>
<a:map from="employee_name" to="owner_employee_name"/> <a:map from="employee_name" to="owner_employee_name"/>
</a:mapping> </a:mapping>
...@@ -128,7 +129,8 @@ ...@@ -128,7 +129,8 @@
<a:field name="authorized_user_id" required="true"/> <a:field name="authorized_user_id" required="true"/>
<a:field name="authorized_user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="AUT_OWNER_USER_AUTHORIZE.AUTHORIZED_USER_ID" required="true" title="用户选择"> <a:field name="authorized_user_desc" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="AUT_OWNER_USER_AUTHORIZE.AUTHORIZED_USER_ID" required="true" title="用户选择">
<a:mapping> <a:mapping>
<a:map from="description" to="authorized_user_desc"/> <!--<a:map from="description" to="authorized_user_desc"/>-->
<a:map from="user_name" to="authorized_user_desc"/>
<a:map from="employee_name" to="authorized_employee_name"/> <a:map from="employee_name" to="authorized_employee_name"/>
<a:map from="user_id" to="authorized_user_id"/> <a:map from="user_id" to="authorized_user_id"/>
</a:mapping> </a:mapping>
...@@ -175,6 +177,7 @@ ...@@ -175,6 +177,7 @@
<a:grid id="aut_owner_user_authorize_result_ds_grid" bindTarget="aut_owner_user_authorize_result_ds" marginHeight="170" marginWidth="30" navBar="true"> <a:grid id="aut_owner_user_authorize_result_ds_grid" bindTarget="aut_owner_user_authorize_result_ds" marginHeight="170" marginWidth="30" navBar="true">
<a:columns> <a:columns>
<a:column name="trx_category_desc" editorFunction="aut105trxCategoryFunction" prompt="AUT_OWNER_USER_AUTHORIZE.TRX_CATEGORY" width="140"/> <a:column name="trx_category_desc" editorFunction="aut105trxCategoryFunction" prompt="AUT_OWNER_USER_AUTHORIZE.TRX_CATEGORY" width="140"/>
<!--<a:column name="owner_user_desc" editorFunction="aut105lovFunction" prompt="AUT_OWNER_USER_AUTHORIZE.OWNER_USER_ID" width="120"/>-->
<a:column name="owner_user_desc" editorFunction="aut105lovFunction" prompt="AUT_OWNER_USER_AUTHORIZE.OWNER_USER_ID" width="120"/> <a:column name="owner_user_desc" editorFunction="aut105lovFunction" prompt="AUT_OWNER_USER_AUTHORIZE.OWNER_USER_ID" width="120"/>
<a:column name="owner_employee_name" prompt="EXP_EMPLOYEES.NAME" width="100"/> <a:column name="owner_employee_name" prompt="EXP_EMPLOYEES.NAME" width="100"/>
<a:column name="authorized_user_desc" editorFunction="aut105lovFunction" prompt="AUT_OWNER_USER_AUTHORIZE.AUTHORIZED_USER_ID" width="120"/> <a:column name="authorized_user_desc" editorFunction="aut105lovFunction" prompt="AUT_OWNER_USER_AUTHORIZE.AUTHORIZED_USER_ID" width="120"/>
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
var record = $('csh_transaction_deposit_return_maintain_ds').getCurrentRecord(); var record = $('csh_transaction_deposit_return_maintain_ds').getCurrentRecord();
var transaction_id = $('csh_transaction_receipt_return_maintain_ds').getCurrentRecord().get('transaction_id'); var transaction_id = $('csh_transaction_receipt_return_maintain_ds').getCurrentRecord().get('transaction_id');
var unwrite_off_amount = $('csh_transaction_receipt_return_maintain_ds').getCurrentRecord().get('unwrite_off_amount'); var unwrite_off_amount = $('csh_transaction_receipt_return_maintain_ds').getCurrentRecord().get('unwrite_off_amount');
var return_id = record.get('return_id');
// if (record.validateRecord()){ // if (record.validateRecord()){
if ($('csh_transaction_deposit_return_maintain_ds').validate()) { if ($('csh_transaction_deposit_return_maintain_ds').validate()) {
// Leaf.Masker.mask(Ext.getBody()); // Leaf.Masker.mask(Ext.getBody());
...@@ -81,10 +82,12 @@ ...@@ -81,10 +82,12 @@
bp_bank_account_num: record.get('bp_bank_account_num'), bp_bank_account_num: record.get('bp_bank_account_num'),
description: record.get('description'), description: record.get('description'),
csh_return_atm_id: csh_return_atm_id, csh_return_atm_id: csh_return_atm_id,
csh_return_bp_id: record.get('csh_return_bp_id') csh_return_bp_id: record.get('csh_return_bp_id'),
return_id: return_id,
left_amount: record.get('left_amount')
}, },
success: function (res) { success: function (res) {
var return_id = res.result.return_id; //var return_id = res.result.return_id;
Leaf.Masker.mask(Ext.getBody(), '正在提交退款工作流...'); Leaf.Masker.mask(Ext.getBody(), '正在提交退款工作流...');
Leaf.request({ Leaf.request({
url: $('csh560_start_wfl_link').getUrl(), url: $('csh560_start_wfl_link').getUrl(),
...@@ -144,6 +147,10 @@ ...@@ -144,6 +147,10 @@
} }
function attach_renderer(value, record, name) {
return '<a href="javascript:upload_attachment_win();" style="color:red">' + '附件上传' + '</a>';
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
...@@ -164,10 +171,12 @@ ...@@ -164,10 +171,12 @@
<a:field name="bp_bank_account_name" defaultValue="${/parameter/@bp_bank_account_name}"/> <a:field name="bp_bank_account_name" defaultValue="${/parameter/@bp_bank_account_name}"/>
<a:field name="opposite_band_na" defaultValue="${/parameter/@opposite_band_na}"/> <a:field name="opposite_band_na" defaultValue="${/parameter/@opposite_band_na}"/>
<a:field name="bp_bank_account_num" defaultValue="${/parameter/@bp_bank_account_num}"/> <a:field name="bp_bank_account_num" defaultValue="${/parameter/@bp_bank_account_num}"/>
<a:field name="return_id" defaultValue="${/parameter/@return_id}"/>
<a:field name="left_amount" defaultValue="${/parameter/@left_amount}"/>
</a:fields> </a:fields>
</a:dataSet> </a:dataSet>
<a:dataSet id="csh_deposit_cashflow_grid_ds" fetchAll="true" autoQuery="true" model="cus_deposit.CUS_DEPOSIT106.csh_deposit_cashflow_query" queryUrl="${/request/@context_path}/autocrud/cus_deposit.CUS_DEPOSIT106.csh_deposit_cashflow_query/query?return_id=${/parameter/@return_id}"/>
</a:dataSets> </a:dataSets>
<a:screenBody> <a:screenBody>
<a:screenTopToolbar> <a:screenTopToolbar>
...@@ -180,10 +189,10 @@ ...@@ -180,10 +189,10 @@
prompt="经济业务发生日" renderer="Leaf.formatDate" width="180"/> prompt="经济业务发生日" renderer="Leaf.formatDate" width="180"/>
<a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false" <a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false"
bindTarget="csh_transaction_deposit_return_maintain_ds" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH515.CSH_REFUND_AMOUNT"/> prompt="CSH515.CSH_REFUND_AMOUNT" width="170"/>
<a:numberField name="unwrite_off_amount" allowDecimals="true" allowFormat="true" <a:numberField name="unwrite_off_amount" allowDecimals="true" allowFormat="true"
allowNegative="false" bindTarget="csh_transaction_receipt_return_maintain_ds" allowNegative="false" bindTarget="csh_transaction_receipt_return_maintain_ds"
prompt="剩余可用金额" readOnly="true" width="170" allowdecimals="false"/> prompt="剩余可用金额" readOnly="true" width="170"/>
<a:lov name="csh_return_bp_name" bindTarget="csh_transaction_deposit_return_maintain_ds" <a:lov name="csh_return_bp_name" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="退款用户" width="185"/> prompt="退款用户" width="185"/>
</a:box> </a:box>
...@@ -191,24 +200,25 @@ ...@@ -191,24 +200,25 @@
<a:textField name="contract_number" bindTarget="csh_transaction_deposit_return_maintain_ds" <a:textField name="contract_number" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="合同编号" readOnly="true" width="180"/> prompt="合同编号" readOnly="true" width="180"/>
<a:textField name="bp_id_telnet_code" bindTarget="csh_transaction_deposit_return_maintain_ds" <a:textField name="bp_id_telnet_code" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="承租人编码" readOnly="true"/> prompt="承租人编码" readOnly="true" width="170"/>
<a:textField name="bp_id_telnet_n" bindTarget="csh_transaction_deposit_return_maintain_ds" <a:textField name="bp_id_telnet_n" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="承租人名称" readOnly="true" width="170"/> prompt="承租人名称" readOnly="true" width="170"/>
<!-- <a:datePicker name="lasted_account_date" bindTarget="csh_transaction_deposit_return_maintain_ds"--> <!-- <a:datePicker name="lasted_account_date" bindTarget="csh_transaction_deposit_return_maintain_ds"-->
<!-- prompt="最后一次入账时间" width="185" readOnly="true"/>--> <!-- prompt="最后一次入账时间" width="185" readOnly="true"/>-->
<a:numberField name="left_amount" allowDecimals="true" allowFormat="true"
allowNegative="false" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="合同剩余保证金" readOnly="true" width="185"/>
</a:box> </a:box>
<a:box column="4" labelWidth="115"> <a:box column="4" labelWidth="115">
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_deposit_return_maintain_ds" <a:textField name="bp_bank_account_name" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" width="180"/> prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" width="180"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_deposit_return_maintain_ds" <a:textField name="opposite_band_na" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/> prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME" width="170"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_deposit_return_maintain_ds" <a:textField name="bp_bank_account_num" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" width="170"/> prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" width="170"/>
<!--<a:numberField name="bp_bank_account_num" allowdecimals="false" bindTarget="csh_transaction_deposit_return_maintain_ds" <!--<a:numberField name="bp_bank_account_num" allowdecimals="false" bindTarget="csh_transaction_deposit_return_maintain_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" width="170"/>--> prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" width="170"/>-->
<a:hBox> <a:label name="attach" bindTarget="csh_transaction_deposit_return_maintain_ds" renderer="attach_renderer" prompt="附件" width="185"/>
<a>附件上传:</a><a href="javascript:upload_attachment_win()" style="color:red"> 附件上传</a>
</a:hBox>
</a:box> </a:box>
<a:box column="1"> <a:box column="1">
<a:textArea name="description" bindTarget="csh_transaction_deposit_return_maintain_ds" prompt="备注" <a:textArea name="description" bindTarget="csh_transaction_deposit_return_maintain_ds" prompt="备注"
...@@ -216,6 +226,20 @@ ...@@ -216,6 +226,20 @@
</a:box> </a:box>
</a:form> </a:form>
<a:grid id="csh_deposit_cashflow_grid_ds_id" bindTarget="csh_deposit_cashflow_grid_ds" marginHeight="200" marginWidth="80" navBar="true">
<!--<a:toolBar>
<a:button click="csh510_export" text="导出"/>
</a:toolBar>-->
<a:columns>
<a:column name="source_transaction_num" prompt="源单据编号" width="150" align="center"/>
<a:column name="transaction_amount" prompt="总额" align="right" renderer="Leaf.formatMoney"/>
<a:column name="deposit_source_type" prompt="类型" width="110" align="center"/>
<a:column name="transaction_date" prompt="时间" align="center" renderer="Leaf.formatDate"/>
<a:column name="transaction_num" prompt="目标单据编号" width="150" align="center"/>
<a:column name="transaction_deposit_amount" prompt="分配金额" align="right" renderer="Leaf.formatMoney"/>
<a:column name="contract_number" prompt="合同编号" width="150" align="center"/>
</a:columns>
</a:grid>
</a:screenBody> </a:screenBody>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
Leaf.onReady(init); Leaf.onReady(init);
......
...@@ -38,10 +38,14 @@ ...@@ -38,10 +38,14 @@
var record = $('csh_transaction_return_wfl_ds').getCurrentRecord(); var record = $('csh_transaction_return_wfl_ds').getCurrentRecord();
var return_id = record.get('return_id'); var return_id = record.get('return_id');
var file_name = "保证金退款-" + record.get('bp_agent_name') + "-" + record.get('return_amount') + "元"; var file_name = "保证金退款-" + record.get('bp_agent_name') + "-" + record.get('return_amount') + "元";
var url_l = $('csh_deposit_return_history_print_link_id').getUrl() + '?document_id=' + return_id + '&file_name=' + file_name + '&document_table=CSH_DEPOSIT_TRANSACTION_RETURN&batch_flag=Y&source_type=common'; var url_l = $('csh_deposit_return_history_print_link_id').getUrl() + '?document_id=' + return_id + '&file_name=' + encodeURI(file_name) + '&document_table=CSH_DEPOSIT_TRANSACTION_RETURN&batch_flag=Y&source_type=common';
window.open(href = url_l, target = "_self"); window.open(href = url_l, target = "_self");
} }
function attach_renderer(value, record, name) {
return '<a href="javascript:upload_attachment_win();" style="color:red">' + '附件查看' + '</a>';
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:dataSet id="csh_transaction_return_wfl_ds" autoPageSize="true" autoQuery="true" <a:dataSet id="csh_transaction_return_wfl_ds" autoPageSize="true" autoQuery="true"
...@@ -49,6 +53,7 @@ ...@@ -49,6 +53,7 @@
queryUrl="${/request/@context_path}/autocrud/cus_deposit.CUS_DEPOSIT106.csh_transaction_return_query/query?return_id=${/parameter/@return_id}"> queryUrl="${/request/@context_path}/autocrud/cus_deposit.CUS_DEPOSIT106.csh_transaction_return_query/query?return_id=${/parameter/@return_id}">
</a:dataSet> </a:dataSet>
<a:dataSet id="csh_deposit_cashflow_grid_ds" fetchAll="true" autoQuery="true" model="cus_deposit.CUS_DEPOSIT106.csh_deposit_cashflow_query" queryUrl="${/request/@context_path}/autocrud/cus_deposit.CUS_DEPOSIT106.csh_deposit_cashflow_query/query?return_id=${/parameter/@return_id}"/>
</a:dataSets> </a:dataSets>
<a:screenBody> <a:screenBody>
<a:screenTopToolbar> <a:screenTopToolbar>
...@@ -72,20 +77,23 @@ ...@@ -72,20 +77,23 @@
<a:textField name="contract_number" bindTarget="csh_transaction_return_wfl_ds" <a:textField name="contract_number" bindTarget="csh_transaction_return_wfl_ds"
prompt="合同编号" readOnly="true" width="180"/> prompt="合同编号" readOnly="true" width="180"/>
<a:textField name="bp_id_telnet_code" bindTarget="csh_transaction_return_wfl_ds" <a:textField name="bp_id_telnet_code" bindTarget="csh_transaction_return_wfl_ds"
prompt="承租人编码" readOnly="true"/> prompt="承租人编码" readOnly="true" width="170"/>
<a:textField name="bp_id_telnet_n" bindTarget="csh_transaction_return_wfl_ds" <a:textField name="bp_id_telnet_n" bindTarget="csh_transaction_return_wfl_ds"
prompt="承租人名称" readOnly="true" width="170"/> prompt="承租人名称" readOnly="true" width="185"/>
<!-- <a:datePicker name="lasted_account_date" bindTarget="csh_transaction_return_wfl_ds"--> <!--<a:datePicker name="lasted_account_date" bindTarget="csh_transaction_return_wfl_ds"-->
<!-- prompt="最后一次入账时间" width="185" readOnly="true"/>--> <!--prompt="最后一次入账时间" width="185" readOnly="true"/>-->
<a:numberField name="left_amount" allowDecimals="true" allowFormat="true"
allowNegative="false" bindTarget="csh_transaction_return_wfl_ds"
prompt="合同剩余保证金" readOnly="true" width="170"/>
</a:box> </a:box>
<a:box column="4" labelWidth="115"> <a:box column="4" labelWidth="115">
<a:textField name="bp_bank_account_name" bindTarget="csh_transaction_return_wfl_ds" <a:textField name="bp_bank_account_name" bindTarget="csh_transaction_return_wfl_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" readOnly="true" width="180"/> prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME" readOnly="true" width="180"/>
<a:textField name="opposite_band_na" bindTarget="csh_transaction_return_wfl_ds" <a:textField name="opposite_band_na" bindTarget="csh_transaction_return_wfl_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME" readOnly="true"/> prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME" readOnly="true" width="170"/>
<a:textField name="bp_bank_account_num" bindTarget="csh_transaction_return_wfl_ds" <a:textField name="bp_bank_account_num" bindTarget="csh_transaction_return_wfl_ds"
prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" readOnly="true" width="170"/> prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME" readOnly="true" width="185"/>
<a href="javascript:upload_attachment_win()" style="color:red">附件查看</a> <a:label name="attach" bindTarget="csh_transaction_return_wfl_ds" renderer="attach_renderer" prompt="附件" width="170"/>
<!--<a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_return_wfl_ds" prompt="CSH515.CSH_REFUND_AMOUNT" readOnly="true"/>--> <!--<a:numberField name="return_amount" allowDecimals="true" allowFormat="true" allowNegative="false" bindTarget="csh_transaction_return_wfl_ds" prompt="CSH515.CSH_REFUND_AMOUNT" readOnly="true"/>-->
<!--<a:textField name="bank_slip_num" bindTarget="csh_transaction_return_wfl_ds" prompt="银行流水号" readOnly="true"/>--> <!--<a:textField name="bank_slip_num" bindTarget="csh_transaction_return_wfl_ds" prompt="银行流水号" readOnly="true"/>-->
<!--<a:comboBox name="currency_name" bindTarget="csh_transaction_return_wfl_ds" prompt="HLS.CURRENCY" readOnly="true"/>--> <!--<a:comboBox name="currency_name" bindTarget="csh_transaction_return_wfl_ds" prompt="HLS.CURRENCY" readOnly="true"/>-->
...@@ -107,6 +115,20 @@ ...@@ -107,6 +115,20 @@
<!--<a:textField name="description" bindTarget="csh_transaction_return_wfl_ds" prompt="HLS.NOTE" width="849" readOnly="true"/>--> <!--<a:textField name="description" bindTarget="csh_transaction_return_wfl_ds" prompt="HLS.NOTE" width="849" readOnly="true"/>-->
</a:box> </a:box>
</a:form> </a:form>
<a:grid id="csh_deposit_cashflow_grid_ds_id" bindTarget="csh_deposit_cashflow_grid_ds" marginHeight="200" marginWidth="80" navBar="true">
<!--<a:toolBar>
<a:button click="csh510_export" text="导出"/>
</a:toolBar>-->
<a:columns>
<a:column name="source_transaction_num" prompt="源单据编号" width="150" align="center"/>
<a:column name="transaction_amount" prompt="总额" align="right" renderer="Leaf.formatMoney"/>
<a:column name="deposit_source_type" prompt="类型" width="110" align="center"/>
<a:column name="transaction_date" prompt="时间" align="center" renderer="Leaf.formatDate"/>
<a:column name="transaction_num" prompt="目标单据编号" width="150" align="center"/>
<a:column name="transaction_deposit_amount" prompt="分配金额" align="right" renderer="Leaf.formatMoney"/>
<a:column name="contract_number" prompt="合同编号" width="150" align="center"/>
</a:columns>
</a:grid>
</a:screenBody> </a:screenBody>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
Leaf.onReady(init); Leaf.onReady(init);
......
...@@ -134,14 +134,18 @@ ...@@ -134,14 +134,18 @@
para: { para: {
transaction_id: record.get('transaction_id') transaction_id: record.get('transaction_id')
}, },
success: function () { success: function (res) {
var return_id = res.result.return_id;
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
new Leaf.Window({ new Leaf.Window({
id: 'csh_transaction_deposit_link_winid', id: 'csh_transaction_deposit_link_winid',
params: { params: {
return_id: return_id,
bp_bank_account_name: record.get('bp_bank_account_name'), bp_bank_account_name: record.get('bp_bank_account_name'),
opposite_band_na: record.get('opposite_band_na'), opposite_band_na: record.get('opposite_band_na'),
bp_bank_account_num: record.get('bp_bank_account_num'), bp_bank_account_num: record.get('bp_bank_account_num'),
left_amount: record.get('left_amount'),
winId: 'csh_transaction_deposit_link_winid' winId: 'csh_transaction_deposit_link_winid'
}, },
url: url, url: url,
......
...@@ -507,6 +507,7 @@ ...@@ -507,6 +507,7 @@
var test_ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master'); var test_ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master');
if (ds.id == f_bp_create_ds_id) { if (ds.id == f_bp_create_ds_id) {
debugger;
var hd_ds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master'); var hd_ds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master');
record = $(hd_ds).getCurrentRecord(); record = $(hd_ds).getCurrentRecord();
if(record.get('bp_class')=='NP'){ if(record.get('bp_class')=='NP'){
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<a:init-procedure> <a:init-procedure>
<a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="prj.PRJ500D.sys_user_lv" <a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="prj.PRJ500D.sys_user_lv"
rootPath="user_name_path"/> rootPath="user_name_path"/>
<a:model-query defaultWhereClause="v.role_id = ${/session/@role_id} and v.role_code in (&apos;0006&apos;)" model="zjwfl.sys_role_flag" rootPath="role_flag_path"/>
<s:server-script import="contract_print_path.js"><![CDATA[ <s:server-script import="contract_print_path.js"><![CDATA[
$ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.file_path = con_print_path['con_print_path'];
$ctx.parameter.tomcat_source = con_print_path['tomcat_source']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source'];
...@@ -342,6 +343,42 @@ ...@@ -342,6 +343,42 @@
} }
} }
function prj501n_upload_file_new(id, name, query_only) {
debugger;
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('check_id')) {
var url;
/*if (query_only == 'Y' || '${/parameter/@function_usage}' == 'QUERY') {
if('${/model/role_flag_path/record/@sys_role_flag}' == 'Y') {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}else{
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}
} else {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}*/
if('${/model/role_flag_path/record/@sys_role_flag}' == 'Y') {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}else{
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'prj500_cdd_uploadFile_screen_id',
width: 850,
height: 400
});
win.on('close', function () {
record.ds.query();
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
}
}
function prj501n_bp_code_renderer(id, name, query_only) { function prj501n_bp_code_renderer(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {}; var param = {};
...@@ -388,10 +425,14 @@ ...@@ -388,10 +425,14 @@
//超链接渲染 //超链接渲染
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) { window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
debugger;
var link_function = ''; var link_function = '';
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment') { if (name == 'attachment') {
link_function = 'prj501n_upload_file'; link_function = 'prj501n_upload_file';
if(record.get('cdd_item') == 'ADD_ATTACH'){
link_function = 'prj501n_upload_file_new';
}
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'attach_file_name') { } else if (name == 'attach_file_name') {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<a:init-procedure> <a:init-procedure>
<a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="prj.PRJ500D.sys_user_lv" <a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="prj.PRJ500D.sys_user_lv"
rootPath="user_name_path"/> rootPath="user_name_path"/>
<a:model-query defaultWhereClause="v.role_id = ${/session/@role_id} and v.role_code in (&apos;0006&apos;)" model="zjwfl.sys_role_flag" rootPath="role_flag_path"/>
<s:server-script import="contract_print_path.js"><![CDATA[ <s:server-script import="contract_print_path.js"><![CDATA[
$ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.file_path = con_print_path['con_print_path'];
$ctx.parameter.tomcat_source = con_print_path['tomcat_source']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source'];
...@@ -232,6 +233,43 @@ ...@@ -232,6 +233,43 @@
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
} }
} }
function prj501n_upload_file_new(id, name, query_only) {
debugger;
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('check_id')) {
var url;
/*if (query_only == 'Y' || '${/parameter/@function_usage}' == 'QUERY') {
if('${/model/role_flag_path/record/@sys_role_flag}' == 'Y') {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}else{
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}
} else {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}*/
if('${/model/role_flag_path/record/@sys_role_flag}' == 'Y') {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}else{
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'prj500_cdd_uploadFile_screen_id',
width: 850,
height: 400
});
win.on('close', function () {
record.ds.query();
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
}
}
function prj501n_contract_number_renderer(id, name, query_only) { function prj501n_contract_number_renderer(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {}; var param = {};
...@@ -265,6 +303,9 @@ ...@@ -265,6 +303,9 @@
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment') { if (name == 'attachment') {
link_function = 'prj501n_upload_file'; link_function = 'prj501n_upload_file';
if(record.get('cdd_item') == 'ADD_ATTACH'){
link_function = 'prj501n_upload_file_new';
}
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'attach_file_name') { } else if (name == 'attach_file_name') {
......
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