Commit f7497c7a authored by 陆正友's avatar 陆正友

保证金抵扣

parent b030ac03
......@@ -3,37 +3,37 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from
(select t1.contract_id,
t1.dd_bank_account_num,
t1.dd_bank_account_name,
t1.contract_number,
t1.contract_name,
t1.bp_id_tenant,
t1.bp_id_agent_level1,
(select bp_name from hls_bp_master where bp_id = t1.bp_id_tenant) bp_name,
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'CON500_CONTRACT_STATUS'
AND sc.code_value = t1.contract_status) contract_status_desc,
t1.payment_deduction,t1.division
from con_contract t1
where
t1.contract_status in ('INCEPT','NEW','ETING','REPURING')
and t1.data_class = 'NORMAL'
and t1.company_id in ((
select company_id
from fnd_companies t
where t.company_id = ${/session/@company_id} or
t.parent_company_id = ${/session/@company_id}
union
select t.parent_company_id company_id
from fnd_companies t
where t.parent_company_id is not null
and (t.company_id = ${/session/@company_id} or t.parent_company_id = ${/session/@company_id})))
) t
#WHERE_CLAUSE#
]]></bm:query-sql>
select * from
(select t1.contract_id,
t1.dd_bank_account_num,
t1.dd_bank_account_name,
t1.contract_number,
t1.contract_name,
t1.bp_id_tenant,
t1.bp_id_agent_level1,
(select bp_name from hls_bp_master where bp_id = t1.bp_id_tenant) bp_name,
(SELECT sc.code_value_name
FROM sys_code_values_v sc
WHERE sc.code = 'CON500_CONTRACT_STATUS'
AND sc.code_value = t1.contract_status) contract_status_desc,
t1.payment_deduction,t1.division
from con_contract t1
where
t1.contract_status in ('INCEPT','NEW','ETING','REPURING')
and t1.data_class = 'NORMAL'
and t1.company_id in ((
select company_id
from fnd_companies t
where t.company_id = ${/session/@company_id} or
t.parent_company_id = ${/session/@company_id}
union
select t.parent_company_id company_id
from fnd_companies t
where t.parent_company_id is not null
and (t.company_id = ${/session/@company_id} or t.parent_company_id = ${/session/@company_id})))
) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
......@@ -60,11 +60,12 @@ select t.parent_company_id company_id
<!--<bm:query-field name="bp_id"
queryExpression="(t.bp_id_tenant = ${@bp_id} or t.bp_id_agent_level1 = ${@bp_id} or ((select bp_category from hls_bp_master where bp_id = ${@bp_id}) = 'VENDER'))"/>-->
<bm:query-field name="bp_id" queryExpression="(Exists (Select 1
From hls_bp_master h, hls_bp_master_role hbr
From hls_bp_master h, hls_bp_master_role hbr,con_contract_bp bp
Where h.bp_name in ( select hbm.bp_name from hls_bp_master hbm where hbm.bp_id= ${@bp_id})
and hbr.bp_id = h.bp_id
and hbr.bp_type = 'TENANT'
and h.bp_id = t.bp_id_tenant) Or not Exists
and h.bp_id= bp.bp_id
and hbr.bp_type in('TENANT','GUTA_NP')
and bp.contract_id=t.contract_id) Or not Exists
(Select 1
From hls_bp_master h, hls_bp_master_role hbr
Where h.bp_id = ${@bp_id}
......@@ -73,4 +74,18 @@ select t.parent_company_id company_id
))"/>
<bm:query-field name="bp_name" queryExpression="t.bp_name like '%' || ${@bp_name} || '%'"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter name="query" Expression=" exists
(select 1
from con_contract_cashflow ccc
where ccc.contract_id = t.contract_id
and ccc.cf_status = 'RELEASE'
and ccc.write_off_flag != 'FULL'
and ccc.cf_direction = 'INFLOW'
and ccc.cf_item not in (251)
and ((nvl(${@deposit_flag}, 'N') = 'Y' and cf_item in (1, 8, 9, 200, 11, 250)) or
(nvl(${@deposit_flag}, 'N') = 'N'))
and ccc.due_amount - nvl(ccc.received_amount, 0)>0
)"/>
</bm:data-filters>
</bm:model>
......@@ -148,7 +148,9 @@
</a:fields>
</a:dataSet>
<a:dataSet id="csh_lov_con_contract_ds" selectable="true" autoQuery="true" selectionModel="single"
model="csh.CSH531N.con_contract" queryDataSet="csh_query_con_ds">
model="csh.CSH531N.con_contract"
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.con_contract/query?deposit_flag=${/parameter/@deposit_flag}&amp;transaction_date=${/parameter/@transaction_date}"
queryDataSet="csh_query_con_ds">
<a:events>
<a:event name="indexchange" handler="indexChangeFunction"/>
</a:events>
......
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