FROM aut_trx_user_authorize a1, aut_owner_user_authorize a2
WHERE a1.trx_category = 'CONTRACT'
AND a1.trx_id = cc.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))))
And ( (decode(${/session/@user_id}, 10600, 1, 2) = 1
And exists (select 1 from hls_bp_master hb where hb.bp_id = cc.bp_id_agent_level1
And hb.bp_code in ('D00000028','D00000035','D00000016','D00000021','D00000039','D00000025','D00000034','D00000017','D00000018','D00000024','D00000032','D00000009','D00000012','D00000014','D00000015','D00000023')) )
or (decode(${/session/@user_id}, 10600, 1, 2) = 2) ) ) t1
(SELECT MIN(ccc.due_date)
FROM con_contract_cashflow ccc
WHERE ccc.contract_id = cc.contract_id
--AND ccc.overdue_status = 'Y'
AND ccc.due_date <= sysdate
AND ccc.cf_item in (1, 8, 9)
AND ccc.write_off_flag <> 'FULL') min_overdue_date,
<bm:data-filterenforceOperations="query"expression="t1.internal_period_num = ${@internal_period_num} and exists (Select 1 From con_contract c Where t1.contract_id = c.contract_id And c.data_class = 'NORMAL' And (c.contract_status = 'INCEPT' Or c.contract_status = 'TERMINATE' Or (c.contract_status = 'PENDING' And Exists (Select 1 From con_contract_et_hd e Where e.contract_id = c.contract_id And e.document_type = 'ET' And e.available_flag = 'Y' And e.status = 'NEW')) Or c.contract_status = 'ETING' Or (c.contract_status = 'PENDING' And Exists (Select 1 From con_contract_change_req cc Where cc.contract_id = c.contract_id And cc.document_type = 'PAYCARD' And cc.req_status In ('NEW'))))) and exists (select 1 from con_contract_cashflow c where c.cashflow_id = t1.cashflow_id and c.interest is not null)"/>
<bm:data-filterenforceOperations="query"expression="t1.internal_period_num = ${@internal_period_num} and exists (Select 1 From con_contract cc Where t1.contract_id = cc.contract_id And cc.data_class = 'NORMAL' And t1.cf_item In (1, 8) And ((t1.cf_item = 1 And cc.contract_status In ('TERMINATE', 'INCEPT', 'ETING', 'REPURING')) Or (t1.cf_item = 8 And cc.contract_status In ('TERMINATE', 'INCEPT'))) ) and exists (select 1 from con_contract_cashflow c where c.cashflow_id = t1.cashflow_id and c.interest is not null)"/>
<bm:data-filterenforceOperations="query"expression="t1.cashflow_id in (select cw.cashflow_id from con_contract_cashflow cw where cw.cf_direction not in ('NONCASH'))"/>
<!-- <bm:data-filter enforceOperations="query" expression="t1.contract_id in (select contract_id from con_contract t where nvl(t.fraud_flag,'N') !='Y')"/>-->
expression:"(Exists (Select 1 From con_contract_cashflow c1 Where c1.contract_id = t1.contract_id And c1.times = t1.times And ((nvl(t1.overdue_status, 'N') = 'Y' And t1.cf_item <> 9) Or (t1.cf_item = 9)) And nvl(c1.write_off_flag, 'NOT') <> 'FULL'))"