<!--<bm:field name="error_code" expression="(select aeih.error_code from acr_ele_invoice_hd aeih where aeih.invoice_hd_id = t1.invoice_hd_id)"/>
<bm:field name="error_message" expression="(select aeih.error_message from acr_ele_invoice_hd aeih where aeih.invoice_hd_id = t1.invoice_hd_id)"/>-->
<bm:fieldname="ele_invoice_status"
expression="nvl((select nvl(aeih.status, 'NEW') from acr_ele_invoice_hd aeih where aeih.invoice_hd_id = t1.invoice_hd_id),'NEW')"/>
<bm:fieldname="ele_invoice_status_desc"
expression="nvl((select decode(nvl(aeih.status, 'NEW'), 'NEW', '未传入', 'IMPORT', '已传入', 'DOWNLOAD', '已下载', 'FAILURE', '数据有误') from acr_ele_invoice_hd aeih where aeih.invoice_hd_id = t1.invoice_hd_id),'未传入')"/>
<bm:fieldname="ele_invoice_hd_id"
expression="(select aeih.ele_invoice_hd_id from acr_ele_invoice_hd aeih where aeih.invoice_hd_id = t1.invoice_hd_id)"/>
<bm:fieldname="swno"
expression="(select t.swno from (select aih.invoice_hd_id,aeih.status,aeih.swno from acr_ele_invoice_hd aeih, acr_invoice_hd aih where aeih.invoice_hd_id(+) = aih.invoice_hd_id) t where t.invoice_hd_id = t1.invoice_hd_id)"/>
<bm:fieldname="yfpdm"
expression="(select t.yfpdm from (select aih.invoice_hd_id,aeih.status,aeih.yfpdm from acr_ele_invoice_hd aeih, acr_invoice_hd aih where aeih.invoice_hd_id(+) = aih.invoice_hd_id) t where t.invoice_hd_id = t1.invoice_hd_id)"/>
<bm:fieldname="yfphm"
expression="(select t.yfphm from (select aih.invoice_hd_id,aeih.status,aeih.yfphm from acr_ele_invoice_hd aeih, acr_invoice_hd aih where aeih.invoice_hd_id(+) = aih.invoice_hd_id) t where t.invoice_hd_id = t1.invoice_hd_id)"/>
<bm:fieldname="billing_way"expression="(case when t1.invoice_date < to_date('20190101','yyyymmdd') then '20' else t1.billing_way end)"/>
<bm:fieldname="billing_way_desc"
expression="(Select v.code_value_name From sys_code_values_v v Where v.code = 'DS_INVOICE_CATEGORY' And v.code_value = (case when t1.invoice_date < to_date('20190101','yyyymmdd') then '20' else t1.billing_way end))"/>
<bm:fieldname="bp_agent_name"/>
<bm:fieldname="invoice_number"
expression="(nvl(t1.invoice_number,(Select he.yfphm From acr_ele_invoice_hd he Where he.invoice_hd_id = t1.invoice_hd_id)))"/>
<bm:fieldname="vat_invoice_code"
expression="(nvl(t1.vat_invoice_code,(Select he.yfpdm From acr_ele_invoice_hd he Where he.invoice_hd_id = t1.invoice_hd_id)) )"/>
queryExpression="(nvl(t1.express_status,'UNDELIVERED') !='RECEIVED' or ${@received_flag}='Y')"/>
<bm:query-fieldname="received_flag"queryExpression="(nvl(t1.express_status,'UNDELIVERED') !='RECEIVED' or ${@received_flag}='Y')"/>
queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
<bm:query-fieldname="query_project_number"
queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-fieldname="billing_way"queryExpression="(case when t1.invoice_date < to_date('20190101','yyyymmdd') then '20' else t1.billing_way end) = ${@billing_way}"/>
<bm:query-fieldname="query_contract_number"queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
<bm:query-fieldname="query_project_number"queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-fieldname="ele_invoice_status"queryExpression="nvl((select nvl(aeih.status, 'NEW') from acr_ele_invoice_hd aeih where aeih.invoice_hd_id = t1.invoice_hd_id),'NEW') = ${@ele_invoice_status}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filterenforceOperations="query"
expression="t1.company_id = ${/session/@company_id} and t1.reversed_flag = 'N'"/>
<bm:data-filterenforceOperations="query"
expression="(t1.invoice_status='CONFIRM' OR t1.invoice_status='POST')"/>
<bm:data-filterenforceOperations="query"
expression="(t1.invoice_kind = '0' or t1.invoice_kind = '2')"/>
<bm:data-filterenforceOperations="query"expression="t1.company_id = ${/session/@company_id} and t1.reversed_flag = 'N'"/>
<bm:data-filterenforceOperations="query"expression="(t1.invoice_status='CONFIRM' OR t1.invoice_status='POST')"/>
<bm:data-filterenforceOperations="query"expression="(t1.invoice_kind = '0' or t1.invoice_kind = '2')"/>