<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select
   l.invoice_hd_id,
   l.bp_code,
   l.description,
   l.vat_red_notice_num,
   l.ref_vat_invoice_code,
   l.ref_invoice_number,
   l.created_by_name，
   l.confirmed_by_name,
   l.received_by_name,
   l.invoice_kind_n,
   l.invoice_title,
   l.invoice_bp_address_phone_num,
   l.document_number,
   l.invoice_date,
   l.invoice_number,
   l.bp_name,
   l.bp_tax_registry_num,
   l.bp_address_phone_num,
   replace(l.bp_bank_account,' ','')bp_bank_account,
   l.product_name,
   l.product_code,
   l.specification,
   l.uom,
   l.quantity,
   l.price,
   l.tax_type_rate,
   l.tax_amount,
   l.total_amount,
   l.discount_amount,
   l.dicount_tax_amount,
   l.discount_rate,
   l.rec_man,
   l.rec_man_tax_num,
   l.del_man,
   l.del_man_tax_num,
   l.place_of_sending,
   l.car_type_num,
   l.car_ship_tonnage,
   l.product_info,
   l.code_version,
   l.tax_type_code,
   l.preferential_policy_flag,
   l.preferential_policy_content,
   l.zero_tax_rate_flag,
   l.reduce_amount
  from acr_invoice_interface_lv l
 where l.invoice_hd_id in
       (select t.invoice_hd_id
          from acr_interface_tmp t
         where t.session_id = ${/session/@session_id})]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="invoice_hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INVOICE_HD_ID"/>
        <bm:field name="bp_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="bp_code"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="description"/>
        <bm:field name="vat_red_notice_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="vat_red_notice_num"/>
        <bm:field name="ref_vat_invoice_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ref_vat_invoice_code"/>
        <bm:field name="ref_invoice_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ref_invoice_number"/>
        <bm:field name="created_by_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="created_by_name"/>
        <bm:field name="confirmed_by_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="confirmed_by_name"/>
        <bm:field name="received_by_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="received_by_name"/>
        <bm:field name="invoice_kind_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_N"/>
        <bm:field name="invoice_title" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_title"/>
        <bm:field name="invoice_bp_address_phone_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_bp_address_phone_num"/>
        <bm:field name="document_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_NUMBER"/>
        <bm:field name="invoice_date" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_DATE"/>
        <bm:field name="invoice_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_NUMBER"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME"/>
        <bm:field name="bp_tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TAX_REGISTRY_NUM"/>
        <bm:field name="bp_address_phone_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_ADDRESS_PHONE_NUM"/>
        <bm:field name="bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_BANK_ACCOUNT"/>
        <bm:field name="product_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCT_NAME"/>
        <bm:field name="product_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="product_code"/>
        <bm:field name="specification" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SPECIFICATION"/>
        <bm:field name="uom" databaseType="CHAR" datatype="java.lang.String" physicalName="UOM"/>
        <bm:field name="quantity" databaseType="NUMBER" datatype="java.lang.Long" physicalName="QUANTITY"/>
        <bm:field name="price" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRICE"/>
        <bm:field name="tax_type_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAX_TYPE_RATE"/>
        <bm:field name="tax_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAX_AMOUNT"/>
        <bm:field name="total_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_AMOUNT"/>
        <bm:field name="discount_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="discount_amount"/>
        <bm:field name="dicount_tax_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="dicount_tax_amount"/>
<!--        <bm:field name="product_item" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCT_ITEM"/>-->
<!--        <bm:field name="discount" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISCOUNT"/>-->
        <bm:field name="discount_rate" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISCOUNT_RATE"/>
<!--        <bm:field name="discount_tax" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DISCOUNT_TAX"/>-->
<!--        <bm:field name="line_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LINE_NAME"/>-->
        <bm:field name="rec_man" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REC_MAN"/>
        <bm:field name="rec_man_tax_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="rec_man_tax_num"/>
        <bm:field name="del_man" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="del_man"/>
        <bm:field name="del_man_tax_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="del_man_tax_num"/>
        <bm:field name="place_of_sending" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="place_of_sending"/>
        <bm:field name="car_type_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="car_type_num"/>
        <bm:field name="car_ship_tonnage" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="car_ship_tonnage"/>
        <bm:field name="product_info" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="product_info"/>
        <bm:field name="code_version" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="code_version"/>
        <bm:field name="tax_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="tax_type_code"/>
        <bm:field name="preferential_policy_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="preferential_policy_flag"/>
        <bm:field name="preferential_policy_content" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="preferential_policy_content"/>
        <bm:field name="zero_tax_rate_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="zero_tax_rate_flag"/>
        <bm:field name="reduce_amount" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="reduce_amount"/>
<!--        <bm:field name="check_man" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CHECK_MAN"/>-->
<!--        <bm:field name="notes" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTES"/>-->
<!--        <bm:field name="blue_number"/>-->
<!--        <bm:field name="blue_code"/>-->
<!--        <bm:field name="tax_number"/>-->
<!--        <bm:field name="benefit"/>-->
<!--        <bm:field name="benefit_notes"/>-->
    </bm:fields>
</bm:model>
