<bm:fieldname="vender_id_n"expression="(select scv.bp_name from hls_bp_master scv where scv.enabled_flag='Y' and scv.bp_id = t1.vender_id)"forInsert="false"forUpdate="false"/>
<bm:fieldname="pay_method"/>
<bm:fieldname="pay_method_n"expression="(select code_value_name from sys_code_values_v scv where scv.code='PAY_METHODS' and scv.code_value = t1.pay_method)"forInsert="false"forUpdate="false"/>
<bm:fieldname="vender_id_n"expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag='Y' and scv.bp_id = t1.vender_id)))"forInsert="false"forUpdate="false"/>
<bm:fieldname="finance_type_n"expression="(select code_value_name from sys_code_values_v scv where scv.code='FINANCE_TYPE' and scv.code_value = t1.finance_type)"forInsert="false"forUpdate="false"/>
<bm:data-filterenforceOperations="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)))"/>
and exists (select 1 from con_contract c, hls_bp_master hb where c.contract_id = t.contract_id
and hb.bp_id = c.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) )"/>
AND ccc.write_off_flag <> 'FULL') over_due_amount,
AND ccc.write_off_flag <> 'FULL'
and ccc.cf_status = 'RELEASE') over_due_amount,
--营业最早逾期的预定支付日
(SELECT to_char(MIN(ccc.due_date),'yyyy-mm-dd')
...
...
@@ -163,8 +173,10 @@
FROM con_contract_cashflow ccw
WHERE ccw.contract_id = cc.contract_id
AND TRUNC(ccw.due_date)<=TRUNC(SYSDATE)
AND ccw.due_amount>ccw.received_amount
AND ccw.write_off_flag <> 'FULL')
AND ccw.due_amount>nvl(ccw.received_amount, 0)
AND ccw.write_off_flag <> 'FULL'
AND ccw.cf_status = 'RELEASE'
AND ccw.cf_direction = 'INFLOW')
AND ('Y' = 'Y' AND EXISTS
(SELECT 1
FROM aut_trx_user_authorize a1, aut_owner_user_authorize a2
...
...
@@ -176,7 +188,11 @@
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))))) t1
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
<bm:query-fieldname="bank_account_code_from"queryExpression="(select a.bank_account_code from csh_bank_account a where a.bank_account_id=t1.bank_account_id) >= ${@bank_account_code_from}"/>
<bm:query-fieldname="bank_account_code_to"queryExpression="(select a.bank_account_code from csh_bank_account a where a.bank_account_id=t1.bank_account_id) <= ${@bank_account_code_to}"/>
<bm:query-fieldname="receipt"queryExpression="(t1.transaction_type=${@receipt} or t1.transaction_type=${@advance_receipt} or t1.transaction_type=${@deposit} or t1.transaction_type=${@risk})"/>
and exists (select 1 from hls_bp_master hb where hb.bp_id = t1.bp_id
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) )"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-fieldname="query_amount_flag"queryExpression="((${@query_amount_flag}='1' and ((nvl(t1.transaction_amount,0)-nvl(t1.write_off_amount,0)-nvl(t1.returned_amount,0)) >0) )or(${@query_amount_flag}='2' and ((nvl(t1.transaction_amount,0)-nvl(t1.write_off_amount,0)-nvl(t1.returned_amount,0)) =0) )or (${@query_amount_flag}='3' and ((nvl(t1.transaction_amount,0)-nvl(t1.write_off_amount,0)-nvl(t1.returned_amount,0)) >=0)))"/>
<bm:fieldname="project_name"databaseType="VARCHAR2"datatype="java.lang.String"expression="(select p.project_name from prj_project p ,con_contract c where c.contract_id = t1.contract_id and p.project_id = c.project_id)"forInsert="false"forUpdate="false"/>
<bm:fieldname="finance_amount"databaseType="NUMBER"datatype="java.lang.Double"expression="(select c.finance_amount from con_contract c where c.contract_id = t1.contract_id)"forInsert="false"forUpdate="false"/>
<bm:fieldname="period"databaseType="VARCHAR2"datatype="java.lang.String"expression="((CASE WHEN t1.cf_item = 8 THEN (SELECT to_char(cf1.due_date,'yyyy/mm/dd') FROM con_contract_cashflow cf1 WHERE cf1.contract_id = t1.contract_id AND cf1.cf_item = t1.cf_item)||'-'||(SELECT TO_CHAR(cf.due_date, 'yyyy/mm/dd') FROM con_contract_cashflow cf WHERE cf.cashflow_id = t1.cashflow_id) ELSE ( (SELECT to_char(cf1.due_date,'yyyy/mm/dd') FROM con_contract_cashflow cf1 WHERE cf1.contract_id = t1.contract_id AND cf1.cf_item = t1.cf_item AND cf1.times = (SELECT cf.times - 1 FROM con_contract_cashflow cf WHERE cf.cashflow_id = t1.cashflow_id)) ||'-'|| (SELECT TO_CHAR(cf.due_date -1, 'yyyy/mm/dd') FROM con_contract_cashflow cf WHERE cf.cashflow_id = t1.cashflow_id))END))"forInsert="false"forUpdate="false"/>
<bm:fieldname="period"databaseType="VARCHAR2"datatype="java.lang.String"expression="((CASE WHEN t1.cf_item = 8 THEN (SELECT to_char(cf1.due_date,'yyyy/mm/dd') FROM con_contract_cashflow cf1 WHERE cf1.contract_id = t1.contract_id AND cf1.cf_item = t1.cf_item)|| '-' ||(SELECT TO_CHAR(cf.due_date, 'yyyy/mm/dd') FROM con_contract_cashflow cf WHERE cf.cashflow_id = t1.cashflow_id) ELSE ( (SELECT to_char(cf1.due_date,'yyyy/mm/dd') FROM con_contract_cashflow cf1 WHERE cf1.contract_id = t1.contract_id AND cf1.cf_item = t1.cf_item AND cf1.times = (SELECT cf.times - 1 FROM con_contract_cashflow cf WHERE cf.cashflow_id = t1.cashflow_id)) || nvl2((Select to_char(cf1.due_date, 'yyyy/mm/dd') From con_contract_cashflow cf1 Where cf1.contract_id = t1.contract_id And cf1.cf_item = t1.cf_item And cf1.times = (Select cf.times - 1 From con_contract_cashflow cf Where cf.cashflow_id = t1.cashflow_id)), '-', '') || (SELECT TO_CHAR(cf.due_date -1, 'yyyy/mm/dd') FROM con_contract_cashflow cf WHERE cf.cashflow_id = t1.cashflow_id))END))"forInsert="false"forUpdate="false"/>
<bm:fieldname="interest"databaseType="NUMBER"datatype="java.lang.Double"expression="(select c.interest from con_contract_cashflow c where c.cashflow_id = t1.cashflow_id)"forInsert="false"forUpdate="false"/>
<bm:fieldname="int_rate_implicit"databaseType="NUMBER"datatype="java.lang.Double"expression="round((select c.int_rate from con_contract c where c.contract_id = t1.contract_id),4)"forInsert="false"forUpdate="false"/>
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
AND h.je_transaction_code ='HL_SALES_TAX_ACT_NEW'
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period}
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n04 = l.journal_line_id))
GROUP BY l.reference1,
...
...
@@ -216,7 +214,64 @@ SELECT h.period_year,
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period}
AND ((hi.contract_id = l.source_doc_id AND li.cf_item IN (2))))
AND h.je_transaction_code ='HL_CSH_CONSOLIDATION_DALAY'
AND l.amount_dr IS NOT NULL
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
<bm:query-fieldname="approve_user_name"queryExpression="t1.approve_user_name like ${@approve_user_name}"/>
<bm:query-fieldname="approve_user_code"queryExpression="t1.approve_user_code like ${@approve_user_code}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filtername="query"expression="( (${/session/@role_id} = 2306 and t1.workflow_code in ('CONTRACT_INCEPT_WFL', 'DCFL_CSH_PAYMENT_REQ')) or (${/session/@role_id} in (2314, 2313, 2312) and t1.workflow_code in ('DCFL_CSH_PAYMENT_REQ')) or (${/session/@role_id} not in (2306, 2314, 2313, 2312) and 1 = 1))"/>
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
<a:model-querydefaultWhereClause="v.code='ZJ_WFL_WORKFLOW_STATUS' and v.code_value = '1'"model="zjwfl.sys_code_default_value"rootPath="workflow_status_default_value"/>
<a:model-querydefaultWhereClause="v.code='ZJ_WFL_WORKFLOW_STATUS' and v.code_value in ('1','10','-1','-1000')"model="zjwfl.sys_code_default_value"rootPath="workflow_status_list"/>
<a:model-querydefaultWhereClause="v.role_id = ${/session/@role_id} and v.role_code in ('0014','0013','0012','0006')"model="zjwfl.sys_role_flag"rootPath="role_flag_path"/>