Commit 1ce3db97 authored by liyuan.chen's avatar liyuan.chen

回租文本,项目附件上传,回租查询条件,商业伙伴配偶问题

parent 6e793bb3
...@@ -21,15 +21,15 @@ ...@@ -21,15 +21,15 @@
cf_item_n, cf_item_n,
times, times,
due_date, due_date,
to_char(due_amount, 'fm999,999,999,990.00') due_amount, to_char(due_amount, 'fm999,999,999,990.00') due_amount,
transaction_date, transaction_date,
write_off_date, write_off_date,
to_char(received_amount, 'fm999,999,999,990.00') received_amount, to_char(received_amount, 'fm999,999,999,990.00') received_amount,
to_char(unreceived_amount, 'fm999,999,999,990.00') unreceived_amount, to_char(unreceived_amount, 'fm999,999,999,990.00') unreceived_amount,
times_9, times_9,
to_char(due_amount_9, 'fm999,999,999,990.00') due_amount_9, to_char(due_amount_9, 'fm999,999,999,990.00') due_amount_9,
to_char(nvl(received_amount_9, 0), 'fm999,999,999,990.00') received_amount_9, to_char(nvl(received_amount_9, 0), 'fm999,999,999,990.00') received_amount_9,
to_char(unreceived_amount_9, 'fm999,999,999,990.00') unreceived_amount_9 to_char(unreceived_amount_9, 'fm999,999,999,990.00') unreceived_amount_9
from from
(select * (select *
From (Select From (Select
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
From hls_cashflow_item h From hls_cashflow_item h
Where h.cf_item = ccc.cf_item) cf_item_n, Where h.cf_item = ccc.cf_item) cf_item_n,
ccc.times, ccc.times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
...@@ -97,11 +97,22 @@ ...@@ -97,11 +97,22 @@
c.contract_id, c.contract_id,
cwo.cashflow_id, cwo.cashflow_id,
cwo.write_off_id, cwo.write_off_id,
(Select ccn.cf_item
ccc.cf_item, From con_contract_cashflow ccn
Where ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') As cf_item,
(Select h.description (Select h.description
From hls_cashflow_item h From hls_cashflow_item h,
Where h.cf_item = ccc.cf_item) cf_item_n, con_contract_cashflow ccn
Where h.cf_item = ccn.cf_item
And ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') cf_item_n,
ccc.times, ccc.times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(ccc.due_amount - (ccc.due_amount -
...@@ -109,7 +120,7 @@ ...@@ -109,7 +120,7 @@
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0) + cwo.write_off_due_amount) As due_amount, 0) + cwo.write_off_due_amount) As due_amount,
--收款日 --收款日
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date, to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date, to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date,
...@@ -120,7 +131,7 @@ ...@@ -120,7 +131,7 @@
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount 0)) As unreceived_amount
From con_contract_cashflow ccc, From con_contract_cashflow ccc,
con_contract c, con_contract c,
csh_write_off cwo, csh_write_off cwo,
...@@ -139,110 +150,113 @@ ...@@ -139,110 +150,113 @@
cwo.write_off_id) t2 cwo.write_off_id) t2
Where t1.transaction_date = t2.transaction_date (+) Where t1.transaction_date = t2.transaction_date (+)
And t1.times = t2.times (+) And t1.times = t2.times (+)
And t1.cf_item = t2.cf_item (+)
Union Union
Select nvl(t1.contract_id, t2.contract_id) contract_id, Select
nvl(t1.cashflow_id, t2.cashflow_id) cashflow_id, nvl(t1.contract_id, t2.contract_id) contract_id,
nvl(t1.write_off_id, t2.write_off_id) write_off_id, nvl(t1.cashflow_id, t2.cashflow_id) cashflow_id,
nvl(t1.cf_item, nvl(t1.write_off_id, t2.write_off_id) write_off_id,
(Select cc2.cf_item nvl(t1.cf_item,
From con_contract_cashflow cc2 (Select cc2.cf_item
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And rownum = 1)) cf_item, And cc2.cf_status = 'RELEASE'
nvl(t1.cf_item_n, And rownum = 1)) cf_item,
(Select h.description nvl(t1.cf_item_n,
From con_contract_cashflow cc2, hls_cashflow_item h (Select h.description
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2, hls_cashflow_item h
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And h.cf_item = cc2.cf_item And cc2.cf_status = 'RELEASE'
And rownum = 1)) cf_item_n, And h.cf_item = cc2.cf_item
nvl(t1.times, t2.times) As times, And rownum = 1)) cf_item_n,
nvl(t1.due_date, nvl(t1.times, t2.times) As times,
(Select to_char(cc2.due_date, 'yyyy-mm-dd') nvl(t1.due_date,
From con_contract_cashflow cc2 (Select to_char(cc2.due_date, 'yyyy-mm-dd')
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And rownum = 1)) due_date, And cc2.cf_status = 'RELEASE'
nvl(t1.due_amount, And rownum = 1)) due_date,
(Select cc2.due_amount nvl(t1.due_amount,
From con_contract_cashflow cc2 (Select cc2.due_amount
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0) And cc2.cf_status = 'RELEASE'
From con_contract_cashflow cc2 And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0)
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE'), And cc2.cf_direction = 'INFLOW'
0)) As due_amount, And cc2.cf_status = 'RELEASE'),
0)) As due_amount,
nvl(t1.transaction_date, t2.transaction_date) transaction_date, nvl(t1.transaction_date, t2.transaction_date) transaction_date,
nvl(t1.write_off_date, t2.write_off_date) write_off_date, nvl(t1.write_off_date, t2.write_off_date) write_off_date,
nvl(t1.received_amount, 0) As received_amount, nvl(t1.received_amount, 0) As received_amount,
nvl(t1.unreceived_amount, nvl(t1.unreceived_amount,
(Select cc2.due_amount (Select cc2.due_amount
From con_contract_cashflow cc2 From con_contract_cashflow cc2
Where cc2.contract_id = t2.contract_id Where cc2.contract_id = t2.contract_id
And cc2.times = t2.times And cc2.times = t2.times
And cc2.cf_item Not In (0, 9) And cc2.cf_item Not In (0, 9)
And cc2.cf_direction = 'INFLOW' And cc2.cf_direction = 'INFLOW'
And cc2.cf_status = 'RELEASE' And cc2.cf_status = 'RELEASE'
And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0) And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0)
From con_contract_cashflow cc2 From con_contract_cashflow cc2
Where cc2.contract_id = t2.contract_id Where cc2.contract_id = t2.contract_id
And cc2.times = t2.times And cc2.times = t2.times
And cc2.cf_item Not In (0, 9) And cc2.cf_item Not In (0, 9)
And cc2.cf_direction = 'INFLOW' And cc2.cf_direction = 'INFLOW'
And cc2.cf_status = 'RELEASE'), And cc2.cf_status = 'RELEASE'),
0)) As unreceived_amount, 0)) As unreceived_amount,
t2.times As times_9, t2.times As times_9,
nvl(t2.due_amount, 0) As due_amount_9, nvl(t2.due_amount, 0) As due_amount_9,
nvl(t2.received_amount, 0) As received_amount_9, nvl(t2.received_amount, 0) As received_amount_9,
nvl(t2.unreceived_amount, 0) As unreceived_amount_9 nvl(t2.unreceived_amount, 0) As unreceived_amount_9
From (Select c.contract_id, From (Select
c.contract_id,
cwo.cashflow_id, cwo.cashflow_id,
cwo.write_off_id, cwo.write_off_id,
ccc.cf_item, ccc.cf_item,
(Select h.description (Select h.description
From hls_cashflow_item h From hls_cashflow_item h
Where h.cf_item = ccc.cf_item) cf_item_n, Where h.cf_item = ccc.cf_item) cf_item_n,
ccc.times, ccc.times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0) + cwo.write_off_due_amount) As due_amount, 0) + cwo.write_off_due_amount) As due_amount,
--收款日 --收款日
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date, to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date, to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date,
--实收金额 --实收金额
cwo.write_off_due_amount received_amount, cwo.write_off_due_amount received_amount,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount 0)) As unreceived_amount
From con_contract_cashflow ccc, From con_contract_cashflow ccc,
con_contract c, con_contract c,
hls_bp_master h, hls_bp_master h,
csh_write_off cwo, csh_write_off cwo,
csh_transaction t csh_transaction t
Where cwo.cashflow_id = ccc.cashflow_id Where cwo.cashflow_id = ccc.cashflow_id
And ccc.contract_id = c.contract_id And ccc.contract_id = c.contract_id
And cwo.csh_transaction_id = t.transaction_id And cwo.csh_transaction_id = t.transaction_id
...@@ -256,36 +270,49 @@ ...@@ -256,36 +270,49 @@
ccc.cf_item, ccc.cf_item,
t.transaction_date, t.transaction_date,
cwo.write_off_id) t1, cwo.write_off_id) t1,
(Select c.contract_id, (Select
c.contract_id,
cwo.cashflow_id, cwo.cashflow_id,
cwo.write_off_id, cwo.write_off_id,
ccc.cf_item, (Select ccn.cf_item
From con_contract_cashflow ccn
Where ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') As cf_item,
(Select h.description (Select h.description
From hls_cashflow_item h From hls_cashflow_item h,
Where h.cf_item = ccc.cf_item) cf_item_n, con_contract_cashflow ccn
Where h.cf_item = ccn.cf_item
And ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') cf_item_n,
ccc.times, ccc.times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0) + cwo.write_off_due_amount) As due_amount, 0) + cwo.write_off_due_amount) As due_amount,
--收款日 --收款日
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date, to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date, to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date,
--实收金额 --实收金额
cwo.write_off_due_amount received_amount, cwo.write_off_due_amount received_amount,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount 0)) As unreceived_amount
From con_contract_cashflow ccc, From con_contract_cashflow ccc,
con_contract c, con_contract c,
csh_write_off cwo, csh_write_off cwo,
csh_transaction t csh_transaction t
Where cwo.cashflow_id = ccc.cashflow_id Where cwo.cashflow_id = ccc.cashflow_id
And ccc.contract_id = c.contract_id And ccc.contract_id = c.contract_id
And cwo.csh_transaction_id = t.transaction_id And cwo.csh_transaction_id = t.transaction_id
...@@ -298,8 +325,9 @@ ...@@ -298,8 +325,9 @@
ccc.cf_item, ccc.cf_item,
t.transaction_date, t.transaction_date,
cwo.write_off_id) t2 cwo.write_off_id) t2
Where t1.transaction_date(+) = t2.transaction_date Where t1.transaction_date (+) = t2.transaction_date
And t1.times(+) = t2.times And t1.times (+) = t2.times
And t1.cf_item (+) = t2.cf_item
Union Union
Select Select
...@@ -431,10 +459,22 @@ ...@@ -431,10 +459,22 @@
cwo.cashflow_id, cwo.cashflow_id,
cwo.write_off_id, cwo.write_off_id,
ccc.cf_item, (Select ccn.cf_item
From con_contract_cashflow ccn
Where ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') As cf_item,
(Select h.description (Select h.description
From hls_cashflow_item h From hls_cashflow_item h,
Where h.cf_item = ccc.cf_item) cf_item_n, con_contract_cashflow ccn
Where h.cf_item = ccn.cf_item
And ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') cf_item_n,
ccc.times, ccc.times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(ccc.due_amount - (ccc.due_amount -
...@@ -443,7 +483,7 @@ ...@@ -443,7 +483,7 @@
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= And tn.creation_date <=
cwo.creation_date), cwo.creation_date),
0) + cwo.write_off_due_amount) As due_amount, 0) + cwo.write_off_due_amount) As due_amount,
--收款日 --收款日
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date, to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date, to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date,
...@@ -455,7 +495,7 @@ ...@@ -455,7 +495,7 @@
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= And tn.creation_date <=
cwo.creation_date), cwo.creation_date),
0)) As unreceived_amount 0)) As unreceived_amount
From con_contract_cashflow ccc, From con_contract_cashflow ccc,
con_contract c, con_contract c,
csh_write_off cwo, csh_write_off cwo,
...@@ -474,110 +514,113 @@ ...@@ -474,110 +514,113 @@
cwo.write_off_id) t2 cwo.write_off_id) t2
Where t1.transaction_date = t2.transaction_date (+) Where t1.transaction_date = t2.transaction_date (+)
And t1.times = t2.times (+) And t1.times = t2.times (+)
And t1.cf_item = t2.cf_item (+)
Union Union
Select nvl(t1.contract_id, t2.contract_id) contract_id, Select
nvl(t1.cashflow_id, t2.cashflow_id) cashflow_id, nvl(t1.contract_id, t2.contract_id) contract_id,
nvl(t1.write_off_id, t2.write_off_id) write_off_id, nvl(t1.cashflow_id, t2.cashflow_id) cashflow_id,
nvl(t1.cf_item, nvl(t1.write_off_id, t2.write_off_id) write_off_id,
(Select cc2.cf_item nvl(t1.cf_item,
From con_contract_cashflow cc2 (Select cc2.cf_item
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And rownum = 1)) cf_item, And cc2.cf_status = 'RELEASE'
nvl(t1.cf_item_n, And rownum = 1)) cf_item,
(Select h.description nvl(t1.cf_item_n,
From con_contract_cashflow cc2, hls_cashflow_item h (Select h.description
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2, hls_cashflow_item h
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And h.cf_item = cc2.cf_item And cc2.cf_status = 'RELEASE'
And rownum = 1)) cf_item_n, And h.cf_item = cc2.cf_item
nvl(t1.times, t2.times) As times, And rownum = 1)) cf_item_n,
nvl(t1.due_date, nvl(t1.times, t2.times) As times,
(Select to_char(cc2.due_date, 'yyyy-mm-dd') nvl(t1.due_date,
From con_contract_cashflow cc2 (Select to_char(cc2.due_date, 'yyyy-mm-dd')
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And rownum = 1)) due_date, And cc2.cf_status = 'RELEASE'
nvl(t1.due_amount, And rownum = 1)) due_date,
(Select cc2.due_amount nvl(t1.due_amount,
From con_contract_cashflow cc2 (Select cc2.due_amount
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE' And cc2.cf_direction = 'INFLOW'
And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0) And cc2.cf_status = 'RELEASE'
From con_contract_cashflow cc2 And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0)
Where cc2.contract_id = t2.contract_id From con_contract_cashflow cc2
And cc2.times = t2.times Where cc2.contract_id = t2.contract_id
And cc2.cf_item Not In (0, 9) And cc2.times = t2.times
And cc2.cf_direction = 'INFLOW' And cc2.cf_item Not In (0, 9)
And cc2.cf_status = 'RELEASE'), And cc2.cf_direction = 'INFLOW'
0)) As due_amount, And cc2.cf_status = 'RELEASE'),
0)) As due_amount,
nvl(t1.transaction_date, t2.transaction_date) transaction_date, nvl(t1.transaction_date, t2.transaction_date) transaction_date,
nvl(t1.write_off_date, t2.write_off_date) write_off_date, nvl(t1.write_off_date, t2.write_off_date) write_off_date,
nvl(t1.received_amount, 0) As received_amount, nvl(t1.received_amount, 0) As received_amount,
nvl(t1.unreceived_amount, nvl(t1.unreceived_amount,
(Select cc2.due_amount (Select cc2.due_amount
From con_contract_cashflow cc2 From con_contract_cashflow cc2
Where cc2.contract_id = t2.contract_id Where cc2.contract_id = t2.contract_id
And cc2.times = t2.times And cc2.times = t2.times
And cc2.cf_item Not In (0, 9) And cc2.cf_item Not In (0, 9)
And cc2.cf_direction = 'INFLOW' And cc2.cf_direction = 'INFLOW'
And cc2.cf_status = 'RELEASE' And cc2.cf_status = 'RELEASE'
And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0) And rownum = 1) - nvl((Select nvl(Sum(cc2.received_amount), 0)
From con_contract_cashflow cc2 From con_contract_cashflow cc2
Where cc2.contract_id = t2.contract_id Where cc2.contract_id = t2.contract_id
And cc2.times = t2.times And cc2.times = t2.times
And cc2.cf_item Not In (0, 9) And cc2.cf_item Not In (0, 9)
And cc2.cf_direction = 'INFLOW' And cc2.cf_direction = 'INFLOW'
And cc2.cf_status = 'RELEASE'), And cc2.cf_status = 'RELEASE'),
0)) As unreceived_amount, 0)) As unreceived_amount,
t2.times As times_9, t2.times As times_9,
nvl(t2.due_amount, 0) As due_amount_9, nvl(t2.due_amount, 0) As due_amount_9,
nvl(t2.received_amount, 0) As received_amount_9, nvl(t2.received_amount, 0) As received_amount_9,
nvl(t2.unreceived_amount, 0) As unreceived_amount_9 nvl(t2.unreceived_amount, 0) As unreceived_amount_9
From (Select c.contract_id, From (Select
c.contract_id,
cwo.cashflow_id, cwo.cashflow_id,
cwo.write_off_id, cwo.write_off_id,
ccc.cf_item, ccc.cf_item,
(Select h.description (Select h.description
From hls_cashflow_item h From hls_cashflow_item h
Where h.cf_item = ccc.cf_item) cf_item_n, Where h.cf_item = ccc.cf_item) cf_item_n,
ccc.times, ccc.times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0) + cwo.write_off_due_amount) As due_amount, 0) + cwo.write_off_due_amount) As due_amount,
--收款日 --收款日
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date, to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date, to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date,
--实收金额 --实收金额
cwo.write_off_due_amount received_amount, cwo.write_off_due_amount received_amount,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount 0)) As unreceived_amount
From con_contract_cashflow ccc, From con_contract_cashflow ccc,
con_contract c, con_contract c,
hls_bp_master h, hls_bp_master h,
csh_write_off cwo, csh_write_off cwo,
csh_transaction t csh_transaction t
Where cwo.cashflow_id = ccc.cashflow_id Where cwo.cashflow_id = ccc.cashflow_id
And ccc.contract_id = c.contract_id And ccc.contract_id = c.contract_id
And cwo.csh_transaction_id = t.transaction_id And cwo.csh_transaction_id = t.transaction_id
...@@ -591,36 +634,49 @@ ...@@ -591,36 +634,49 @@
ccc.cf_item, ccc.cf_item,
t.transaction_date, t.transaction_date,
cwo.write_off_id) t1, cwo.write_off_id) t1,
(Select c.contract_id, (Select
c.contract_id,
cwo.cashflow_id, cwo.cashflow_id,
cwo.write_off_id, cwo.write_off_id,
ccc.cf_item, (Select ccn.cf_item
From con_contract_cashflow ccn
Where ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') As cf_item,
(Select h.description (Select h.description
From hls_cashflow_item h From hls_cashflow_item h,
Where h.cf_item = ccc.cf_item) cf_item_n, con_contract_cashflow ccn
Where h.cf_item = ccn.cf_item
And ccn.contract_id = ccc.contract_id
And ccn.times = ccc.times
And ccn.cf_item In (1, 250)
And ccn.cf_direction = 'INFLOW'
And ccn.cf_status = 'RELEASE') cf_item_n,
ccc.times, ccc.times,
to_char(ccc.due_date, 'yyyy-mm-dd') due_date, to_char(ccc.due_date, 'yyyy-mm-dd') due_date,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0) + cwo.write_off_due_amount) As due_amount, 0) + cwo.write_off_due_amount) As due_amount,
--收款日 --收款日
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date, to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date, to_char(cwo.write_off_date, 'yyyy-mm-dd') write_off_date,
--实收金额 --实收金额
cwo.write_off_due_amount received_amount, cwo.write_off_due_amount received_amount,
(ccc.due_amount - (ccc.due_amount -
nvl((Select Sum(tn.write_off_due_amount) nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount 0)) As unreceived_amount
From con_contract_cashflow ccc, From con_contract_cashflow ccc,
con_contract c, con_contract c,
csh_write_off cwo, csh_write_off cwo,
csh_transaction t csh_transaction t
Where cwo.cashflow_id = ccc.cashflow_id Where cwo.cashflow_id = ccc.cashflow_id
And ccc.contract_id = c.contract_id And ccc.contract_id = c.contract_id
And cwo.csh_transaction_id = t.transaction_id And cwo.csh_transaction_id = t.transaction_id
...@@ -633,8 +689,9 @@ ...@@ -633,8 +689,9 @@
ccc.cf_item, ccc.cf_item,
t.transaction_date, t.transaction_date,
cwo.write_off_id) t2 cwo.write_off_id) t2
Where t1.transaction_date(+) = t2.transaction_date Where t1.transaction_date (+) = t2.transaction_date
And t1.times(+) = t2.times And t1.times (+) = t2.times
And t1.cf_item (+) = t2.cf_item
Union Union
Select Select
......
...@@ -3,73 +3,79 @@ ...@@ -3,73 +3,79 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
select * from ( select *
Select cwo.cashflow_id, from (
t.transaction_num, Select
cwo.write_off_id, cwo.cashflow_id,
(Select v.code_value_name t.transaction_num,
From sys_code_values_v v cwo.write_off_id,
Where v.code = 'RECEIPT_TYPE' (Select v.code_value_name
And v.code_value = t.receipt_type) transaction_type, From sys_code_values_v v
c.contract_id, Where v.code = 'RECEIPT_TYPE'
cwo.times, And v.code_value = t.receipt_type) transaction_type,
ccc.cf_item, c.contract_id,
(Select h.description cwo.times,
From hls_cashflow_item h ccc.cf_item,
Where h.cf_item = ccc.cf_item) cf_item_n, (Select h.description
--代理店简称 From hls_cashflow_item h
(Select h.extra_nam Where h.cf_item = ccc.cf_item) cf_item_n,
From hls_bp_master h --代理店简称
Where h.bp_id = c.bp_id_agent_level1) extra_nam, (Select h.extra_nam
--合同编号 From hls_bp_master h
c.contract_number, Where h.bp_id = c.bp_id_agent_level1) extra_nam,
--机号 --合同编号
(Select ccli.machine_number c.contract_number,
From con_contract_lease_item ccli --机号
Where ccli.contract_id = c.contract_id) machine_number, (Select ccli.machine_number
--承租人编号,名称,身份证号 From con_contract_lease_item ccli
h.bp_code bp_id_tenant, Where ccli.contract_id = c.contract_id) machine_number,
h.bp_name, --承租人编号,名称,身份证号
decode(h.bp_class, 'NP', h.id_card_no, h.social_code) id_card_no, h.bp_code bp_id_tenant,
--合同总额 h.bp_name,
nvl(c.down_payment, 0) + nvl(c.total_rental, 0) total_amount, decode(h.bp_class, 'NP', h.id_card_no, h.social_code) id_card_no,
ccc.due_date, --合同总额
--收款日 nvl(c.down_payment, 0) + nvl(c.total_rental, 0) total_amount,
t.transaction_date, ccc.due_date,
-- ccc.due_amount, --收款日
(ccc.due_amount - nvl((Select Sum(tn.write_off_due_amount) t.transaction_date,
From csh_write_off tn -- ccc.due_amount,
Where tn.cashflow_id = cwo.cashflow_id (ccc.due_amount - nvl((Select Sum(tn.write_off_due_amount)
And tn.creation_date <= cwo.creation_date), From csh_write_off tn
0) + cwo.write_off_due_amount) As due_amount, Where tn.cashflow_id = cwo.cashflow_id
--t.transaction_num, And tn.creation_date <= cwo.creation_date),
cwo.write_off_date, 0) + cwo.write_off_due_amount) As due_amount,
--实收金额 --t.transaction_num,
cwo.write_off_due_amount received_amount, cwo.write_off_date,
--实收金额
cwo.write_off_due_amount received_amount,
(ccc.due_amount - nvl((Select Sum(tn.write_off_due_amount) (ccc.due_amount - nvl((Select Sum(tn.write_off_due_amount)
From csh_write_off tn From csh_write_off tn
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount 0)) As unreceived_amount,
From con_contract_cashflow ccc, c.BUSINESS_TYPE,
con_contract c, (select hbt.DESCRIPTION
hls_bp_master h, from hls_business_type hbt
csh_write_off cwo, where hbt.BUSINESS_TYPE = c.BUSINESS_TYPE) BUSINESS_TYPE_N
csh_transaction t From con_contract_cashflow ccc,
Where cwo.cashflow_id = ccc.cashflow_id con_contract c,
And ccc.contract_id = c.contract_id hls_bp_master h,
And cwo.csh_transaction_id = t.transaction_id csh_write_off cwo,
And nvl(cwo.reversed_flag, 'N') = 'N' csh_transaction t
And h.bp_id = c.bp_id_tenant Where cwo.cashflow_id = ccc.cashflow_id
And cwo.write_off_type In ('RECEIPT_CREDIT', 'DEPOSIT_CREDIT') And ccc.contract_id = c.contract_id
And ccc.cf_status = 'RELEASE' And cwo.csh_transaction_id = t.transaction_id
And cwo.write_off_due_amount > 0 And nvl(cwo.reversed_flag, 'N') = 'N'
Order By c.contract_id, And h.bp_id = c.bp_id_tenant
ccc.times, And cwo.write_off_type In ('RECEIPT_CREDIT', 'DEPOSIT_CREDIT')
ccc.cf_item, And ccc.cf_status = 'RELEASE'
t.transaction_date, And cwo.write_off_due_amount > 0
cwo.write_off_id ) t Order By c.contract_id,
ccc.times,
ccc.cf_item,
t.transaction_date,
cwo.write_off_id) t
#WHERE_CLAUSE# #WHERE_CLAUSE#
order by extra_nam, bp_id_tenant, contract_id,times,cf_item, due_amount desc, transaction_date,write_off_date order by extra_nam, bp_id_tenant, contract_id,times,cf_item, due_amount desc, transaction_date,write_off_date
]]></bm:query-sql> ]]></bm:query-sql>
...@@ -85,6 +91,7 @@ ...@@ -85,6 +91,7 @@
<bm:query-field name="transaction_num" queryExpression="t.transaction_num like &apos;%&apos; || ${@transaction_num} || &apos;%&apos;"/> <bm:query-field name="transaction_num" queryExpression="t.transaction_num like &apos;%&apos; || ${@transaction_num} || &apos;%&apos;"/>
<bm:query-field name="cf_item_n" queryExpression="t.cf_item_n like &apos;%&apos; || ${@cf_item_n} || &apos;%&apos;"/> <bm:query-field name="cf_item_n" queryExpression="t.cf_item_n like &apos;%&apos; || ${@cf_item_n} || &apos;%&apos;"/>
<bm:query-field name="extra_nam" queryExpression="t.extra_nam like &apos;%&apos; || ${@extra_nam} || &apos;%&apos;"/> <bm:query-field name="extra_nam" queryExpression="t.extra_nam like &apos;%&apos; || ${@extra_nam} || &apos;%&apos;"/>
<bm:query-field name="business_type" queryExpression="t.business_type = ${@business_type}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="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 = t.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)))"/> <bm:data-filter enforceOperations="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 = t.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)))"/>
......
...@@ -363,12 +363,17 @@ ...@@ -363,12 +363,17 @@
'yyyy-mm-dd')), 'yyyy-mm-dd')),
p_date2 =>sysdate, p_date2 =>sysdate,
p_type =>'SMALL'), p_type =>'SMALL'),
p_user_id => -1) overdue_times_af p_user_id => -1) overdue_times_af,
(select v.CODE_VALUE_NAME
from SYS_CODE_VALUES_V v
where v.CODE = 'CON500_CONTRACT_STATUS'
and v.CODE_VALUE = t.CONTRACT_STATUS
and v.CODE_ENABLED_FLAG = 'Y'
and v.CODE_VALUE_ENABLED_FLAG = 'Y') contract_status_n
FROM con_contract t, hls_bp_master h FROM con_contract t, hls_bp_master h
WHERE t.data_class = 'NORMAL' WHERE t.data_class = 'NORMAL'
AND t.bp_id_agent_level1 = h.bp_id AND t.bp_id_agent_level1 = h.bp_id
AND (t.contract_status IN ('INCEPT', AND (t.contract_status IN ('INCEPT',
'TERMINATING', 'TERMINATING',
'ETING', 'ETING',
'REPURING', 'REPURING',
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
||'-' ||'-'
|| ||
(SELECT (SELECT
t.project_number ct.contract_number
FROM FROM
con_contract ct, con_contract ct,
prj_project t prj_project t
......
...@@ -181,7 +181,8 @@ ...@@ -181,7 +181,8 @@
AND ccc.cf_status = 'RELEASE' AND ccc.cf_status = 'RELEASE'
AND ccc.cf_item IN (1, 8, 250) AND ccc.cf_item IN (1, 8, 250)
) total_due_amount, ) total_due_amount,
cc.contract_status/*, cc.contract_status,
cc.BUSINESS_TYPE/*,
(Select Count(1) (Select Count(1)
From con_contract_cashflow ccc From con_contract_cashflow ccc
Where ccc.contract_id = cc.contract_id Where ccc.contract_id = cc.contract_id
...@@ -317,6 +318,7 @@ ...@@ -317,6 +318,7 @@
queryExpression="t1.business_due_amount &lt;= ${@business_due_amount_to}"/> queryExpression="t1.business_due_amount &lt;= ${@business_due_amount_to}"/>
<bm:query-field name="owner_user_id" queryExpression="t1.owner_user_id = ${@owner_user_id}"/> <bm:query-field name="owner_user_id" queryExpression="t1.owner_user_id = ${@owner_user_id}"/>
<bm:query-field name="lease_organization" queryExpression="t1.lease_organization = ${@lease_organization}"/> <bm:query-field name="lease_organization" queryExpression="t1.lease_organization = ${@lease_organization}"/>
<bm:query-field name="business_type_n" queryExpression="t1.business_type = ${@business_type}"/>
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<bm:data-filter name="contract_status" enforceOperations="query" <bm:data-filter name="contract_status" enforceOperations="query"
......
...@@ -39,142 +39,154 @@ ...@@ -39,142 +39,154 @@
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT SELECT *
*
FROM FROM
(select * from (SELECT (select *
t1.node_id, from (SELECT
t1.workflow_code, t1.node_id,
t1.workflow_desc, t1.workflow_code,
t1.node_sequence_num, t1.workflow_desc,
t1.node_desc, t1.node_sequence_num,
t1.instance_id, t1.node_desc,
t1.action_taken, t1.instance_id,
t1.action_type, t1.action_taken,
t1.action_type_desc, t1.action_type,
t1.record_type, t1.action_type_desc,
decode(t1.workflow_code,'PROJECT_WFL', decode(t1.action_type,'1', t1.record_type,
(case when decode(t1.workflow_code, 'PROJECT_WFL', decode(t1.action_type, '1',
${/session/@role_id} in(2318,2319) then (case when
'同意' ${/session/@role_id} in (2318, 2319)
else then
t1.comment_text '同意'
end ),t1.comment_text),t1.comment_text) comment_text, else
-- t1.comment_text, t1.comment_text
t1.comment_text_out, end), t1.comment_text),
t1.record_id, t1.comment_text) comment_text,
t1.seq_number, -- t1.comment_text,
t1.rcpt_record_id, t1.comment_text_out,
t1.disabled_flag, t1.record_id,
t1.note, t1.seq_number,
t1.create_date_fmt, t1.rcpt_record_id,
t1.approver, t1.disabled_flag,
(cus_zj_wfl_pkg.check_agent_rcpt_record(p_rcpt_record_id => t1.rcpt_record_id))agent_flag, t1.note,
t1.record_approve_count, t1.create_date_fmt,
t1.instance_approve_count, t1.approver,
t1.node_hide_approve_record, (cus_zj_wfl_pkg.check_agent_rcpt_record(
t1.node_show_approve_ht, p_rcpt_record_id => t1.rcpt_record_id)) agent_flag,
t1.node_show_all_approve_ht, t1.record_approve_count,
t1.wfl_show_approve_ht, t1.instance_approve_count,
t1.wfl_show_all_approve_ht, t1.node_hide_approve_record,
(SELECT t1.node_show_approve_ht,
COUNT(1) t1.node_show_all_approve_ht,
FROM t1.wfl_show_approve_ht,
fnd_atm_attachment_multi m t1.wfl_show_all_approve_ht,
WHERE (SELECT COUNT(1)
m.table_name = 'ZJ_WFL_INSTANCE_NODE_RECIPIENT' AND FROM
m.table_pk_value = t1.rcpt_record_id fnd_atm_attachment_multi m
) attach_count, WHERE
(select u.bp_category from sys_user u where u.user_id=${/session/@user_id})bp_category m.table_name = 'ZJ_WFL_INSTANCE_NODE_RECIPIENT' AND
FROM m.table_pk_value = t1.rcpt_record_id
zj_wfl_approve_history_v t1 ) attach_count,
WHERE (select u.bp_category
t1.instance_id =${@instance_id} ) v where (v.bp_category != 'AGENT') from sys_user u
union all where u.user_id = ${/session/@user_id}) bp_category
select * from (SELECT FROM
t1.node_id, zj_wfl_approve_history_v t1
t1.workflow_code, WHERE
t1.workflow_desc, t1.instance_id = ${@instance_id}) v
t1.node_sequence_num, where (v.bp_category != 'AGENT')
t1.node_desc, union all
t1.instance_id, select *
t1.action_taken, from (SELECT
t1.action_type, t1.node_id,
t1.action_type_desc, t1.workflow_code,
t1.record_type, t1.workflow_desc,
decode(t1.workflow_code,'PROJECT_WFL', decode(t1.action_type,'1', t1.node_sequence_num,
(case when t1.node_desc,
${/session/@role_id} in(2318,2319) then t1.instance_id,
'同意' t1.action_taken,
else t1.action_type,
t1.comment_text t1.action_type_desc,
end ),t1.comment_text),t1.comment_text) comment_text, t1.record_type,
-- t1.comment_text, decode(t1.workflow_code, 'PROJECT_WFL', decode(t1.action_type, '1',
t1.comment_text_out, (case when
t1.record_id, ${/session/@role_id} in (2318, 2319)
t1.seq_number, then
t1.rcpt_record_id, '同意'
t1.disabled_flag, else
t1.note, t1.comment_text
t1.create_date_fmt, end), t1.comment_text),
t1.approver, t1.comment_text) comment_text,
(cus_zj_wfl_pkg.check_agent_rcpt_record(p_rcpt_record_id => t1.rcpt_record_id))agent_flag, -- t1.comment_text,
t1.record_approve_count, t1.comment_text_out,
t1.instance_approve_count, t1.record_id,
t1.node_hide_approve_record, t1.seq_number,
t1.node_show_approve_ht, t1.rcpt_record_id,
t1.node_show_all_approve_ht, t1.disabled_flag,
t1.wfl_show_approve_ht, t1.note,
t1.wfl_show_all_approve_ht, t1.create_date_fmt,
(SELECT t1.approver,
COUNT(1) (cus_zj_wfl_pkg.check_agent_rcpt_record(
FROM p_rcpt_record_id => t1.rcpt_record_id)) agent_flag,
fnd_atm_attachment_multi m t1.record_approve_count,
WHERE t1.instance_approve_count,
m.table_name = 'ZJ_WFL_INSTANCE_NODE_RECIPIENT' AND t1.node_hide_approve_record,
m.table_pk_value = t1.rcpt_record_id t1.node_show_approve_ht,
) attach_count, t1.node_show_all_approve_ht,
(select u.bp_category from sys_user u where u.user_id=${/session/@user_id})bp_category t1.wfl_show_approve_ht,
FROM t1.wfl_show_all_approve_ht,
zj_wfl_approve_history_v t1 (SELECT COUNT(1)
WHERE FROM
t1.instance_id =${@instance_id} ) v where (v.bp_category = 'AGENT' and v.record_type not like 'TRANSFER') fnd_atm_attachment_multi m
UNION WHERE
SELECT NULL AS node_id, m.table_name = 'ZJ_WFL_INSTANCE_NODE_RECIPIENT' AND
NULL AS workflow_code, m.table_pk_value = t1.rcpt_record_id
NULL AS workflow_desc, ) attach_count,
00 AS node_sequence_num, (select u.bp_category
'00--提交节点' AS node_desc, from sys_user u
zw.instance_id AS instance_id, where u.user_id = ${/session/@user_id}) bp_category
NULL AS action_taken, FROM
NULL AS action_type, zj_wfl_approve_history_v t1
('提交--' || (select zww.workflow_desc WHERE
from zj_wfl_workflow zww t1.instance_id = ${@instance_id}) v
where zww.workflow_id = zw.workflow_id)) AS action_type_desc, where (v.bp_category = 'AGENT' and v.record_type not like 'TRANSFER')
NULL AS record_type, UNION
'提交' AS comment_text, SELECT
NULL AS comment_text_out, NULL AS node_id,
NULL AS record_id, NULL AS workflow_code,
NULL AS seq_number, NULL AS workflow_desc,
NULL AS rcpt_record_id, 00 AS node_sequence_num,
NULL AS disabled_flag, '00--提交节点' AS node_desc,
NULL AS note, zw.instance_id AS instance_id,
to_char(zw.creation_date, 'yyyy-mm-dd hh24:mi:ss') AS create_date_fmt, NULL AS action_taken,
(SELECT su.description NULL AS action_type,
FROM sys_user su ('提交--' || (select zww.workflow_desc
WHERE su.user_id = zw.created_by) approver, from zj_wfl_workflow zww
'N' AS agent_flag, where zww.workflow_id = zw.workflow_id)) AS action_type_desc,
1 AS record_approve_count, NULL AS record_type,
1 AS instance_approve_count, '提交' AS comment_text,
'N' AS node_hide_approve_record, NULL AS comment_text_out,
NULL AS node_show_approve_ht, NULL AS record_id,
NULL AS node_show_all_approve_ht, NULL AS seq_number,
NULL AS wfl_show_approve_ht, NULL AS rcpt_record_id,
NULL AS wfl_show_all_approve_ht, NULL AS disabled_flag,
NULL AS attach_count, NULL AS note,
NULL AS bp_category to_char(zw.creation_date, 'yyyy-mm-dd hh24:mi:ss') AS create_date_fmt,
FROM zj_wfl_workflow_instance zw (SELECT su.description
WHERE zw.instance_id =${@instance_id} FROM sys_user su
WHERE su.user_id = zw.created_by) approver,
'N' AS agent_flag,
1 AS record_approve_count,
1 AS instance_approve_count,
'N' AS node_hide_approve_record,
NULL AS node_show_approve_ht,
NULL AS node_show_all_approve_ht,
NULL AS wfl_show_approve_ht,
NULL AS wfl_show_all_approve_ht,
NULL AS attach_count,
NULL AS bp_category
FROM zj_wfl_workflow_instance zw
WHERE zw.instance_id = ${@instance_id}
) t1 #WHERE_CLAUSE# ) t1 #WHERE_CLAUSE#
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
} catch (e) { } catch (e) {
raise_app_error(e); raise_app_error(e);
} }
if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_A4'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK'||record_data.templet_code == 'REPURCHASE_DEBT_OFFSET') { if (record_data.templet_code == 'FINANCE_LEASE_CONTRACT'||record_data.templet_code == 'FINANCE_LEASE_CONTRACT_A4'||record_data.templet_code == 'BUSINESS_CONTRACT'||record_data.templet_code == 'BUSINESS_CONTRACT_XJ'||record_data.templet_code=='LEASE_EXCHANGE'||record_data.templet_code=='LEASE_EXCHANGE_GN'||record_data.templet_code=='FINANCE_LEASE_CONTRACT_EX'||record_data.templet_code=='BUSINESS_CONTRACT_GK'||record_data.templet_code == 'REPURCHASE_DEBT_OFFSET'||record_data.templet_code == 'CON_CONTRACT_LEASE_BACK'||record_data.templet_code == 'CON_CONTRACT_MORTGAGE') {
// word转pdf // word转pdf
var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id; var pdf_file_path=datePath+guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
......
...@@ -332,6 +332,7 @@ ...@@ -332,6 +332,7 @@
<a:dataSet id="business_type_ds"> <a:dataSet id="business_type_ds">
<a:datas> <a:datas>
<a:record code_value="LEASE" code_value_name="直租"/> <a:record code_value="LEASE" code_value_name="直租"/>
<a:record code_value="LEASEBACK" code_value_name="售后回租"/>
</a:datas> </a:datas>
</a:dataSet> </a:dataSet>
<a:dataSet id="CON601_lease_organization_name_ds" loadData="true" <a:dataSet id="CON601_lease_organization_name_ds" loadData="true"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</a:init-procedure> </a:init-procedure>
<a:view> <a:view>
<a:link id="csh_payment_req_create_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_selected.lview"/> <a:link id="csh_payment_req_create_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_selected.lview"/>
<a:link id="csh_payment_req_history_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_print.lsc"/> <a:link id="csh_payment_req_history_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
<a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel" modelaction="update"/> <a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel" modelaction="update"/>
<a:link id="csh501_csh_payment_req_link1_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/> <a:link id="csh501_csh_payment_req_link1_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/>
......
...@@ -123,7 +123,10 @@ ...@@ -123,7 +123,10 @@
try { try {
$bm('csh.CSH501.csh_transaction_return_print').update({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table
});
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData()); var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id.toString(), 'COMMON'); brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id.toString(), 'COMMON');
} catch (e) { } catch (e) {
......
...@@ -457,7 +457,7 @@ ...@@ -457,7 +457,7 @@
} else if (value.length == 18) { } else if (value.length == 18) {
new_id_card = record.get('id_card_no'); new_id_card = record.get('id_card_no');
//自动带出籍贯 //自动带出籍贯
record.set('resident_addres', get_native_place(value)); //record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2))); record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4)); record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) { if (value.substr(16, 1) % 2 == 1) {
...@@ -485,8 +485,8 @@ ...@@ -485,8 +485,8 @@
new_id_card = record.get('id_card_no_leg'); new_id_card = record.get('id_card_no_leg');
record.set('resident_addres_sp', get_native_place(value)); //record.set('resident_addres_sp', get_native_place(value));
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2))); record.set('date_of_birth_sp', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4)); record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) { if (value.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE'); record.set('gender', 'MALE');
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<!-- <a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="prj.PRJ500D.sys_user_lv" rootPath="user_name_path"/> --> <!-- <a:model-query defaultWhereClause="t1.user_id=${/session/@user_id}" model="prj.PRJ500D.sys_user_lv" rootPath="user_name_path"/> -->
<a:model-query fetchAll="true" model="hls.HLS303.hls_bp_agentemployee_id" rootPath="employee_id_path"/> <a:model-query fetchAll="true" model="hls.HLS303.hls_bp_agentemployee_id" rootPath="employee_id_path"/>
<a:model-query fetchAll="true" model="prj.PRJ500D.amount_check" rootPath="amount_check"/> <a:model-query fetchAll="true" model="prj.PRJ500D.amount_check" rootPath="amount_check"/>
<a:model-query defaultWhereClause="v.role_id = ${/session/@role_id} and v.role_code in (&apos;HAND&apos;,&apos;0017&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'];
...@@ -270,6 +271,41 @@ ...@@ -270,6 +271,41 @@
} }
} }
function prj501n_upload_file_new(id, name, query_only) {
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,6 +424,9 @@ ...@@ -388,6 +424,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') {
if (value != null) { if (value != null) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +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"/> <a:model-query defaultWhereClause="v.role_id = ${/session/@role_id} and v.role_code in (&apos;HAND&apos;,&apos;0017&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'];
...@@ -344,7 +344,6 @@ ...@@ -344,7 +344,6 @@
} }
function prj501n_upload_file_new(id, name, query_only) { function prj501n_upload_file_new(id, name, query_only) {
debugger;
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('check_id')) { if (record.get('check_id')) {
var url; var url;
...@@ -425,7 +424,6 @@ ...@@ -425,7 +424,6 @@
//超链接渲染 //超链接渲染
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') {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +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"/> <a:model-query defaultWhereClause="v.role_id = ${/session/@role_id} and v.role_code in (&apos;HAND&apos;,&apos;0017&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'];
...@@ -235,7 +235,6 @@ ...@@ -235,7 +235,6 @@
} }
function prj501n_upload_file_new(id, name, query_only) { function prj501n_upload_file_new(id, name, query_only) {
debugger;
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('check_id')) { if (record.get('check_id')) {
var url; var url;
......
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