<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2015-10-23 上午10:37:17  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
					select h.invoice_hd_id,
					       h.contract_id,
					       (select c.contract_number
					          from con_contract c
					         where c.contract_id = h.contract_id) contract_number,
					       to_char(h.invoice_date,'yyyy/mm/dd')invoice_date ,
					       h.currency,
					        (select g.currency_name from  gld_currency_vl g where g.currency_code=h.currency )currency_name ,
					       h.bp_name agent_name,
					       (select m.bp_name from hls_bp_master m where m.bp_id = h.bp_id) bp_tenant_name,
					       (select cid.item_frame_number
				          from con_contract_lease_item cli, con_contract_item_detail cid
				         where cli.contract_lease_item_id = cid.contract_lease_item_id
				           and cli.contract_id = h.contract_id and rownum=1) item_frame_number
					  from acp_invoice_hd h
					 where h.invoice_hd_id =${@invoice_hd_id}
  ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
