<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="TBL_CUST_DOCMASTER">
    <bm:fields>
        <bm:field name="invkind" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVKIND" prompt="TBL_CUST_DOCMASTER.INVKIND"/>
        <bm:field name="documentnr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENTNR" prompt="TBL_CUST_DOCMASTER.DOCUMENTNR"/>
        <bm:field name="documentdate" databaseType="DATE" datatype="java.util.Date" physicalName="DOCUMENTDATE" prompt="TBL_CUST_DOCMASTER.DOCUMENTDATE"/>
        <bm:field name="customernr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CUSTOMERNR" prompt="TBL_CUST_DOCMASTER.CUSTOMERNR"/>
        <bm:field name="customername" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CUSTOMERNAME" prompt="TBL_CUST_DOCMASTER.CUSTOMERNAME"/>
        <bm:field name="customertaxnr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CUSTOMERTAXNR" prompt="TBL_CUST_DOCMASTER.CUSTOMERTAXNR"/>
        <bm:field name="customeraddresstel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CUSTOMERADDRESSTEL" prompt="TBL_CUST_DOCMASTER.CUSTOMERADDRESSTEL"/>
        <bm:field name="customerbankaccountnr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CUSTOMERBANKACCOUNTNR" prompt="TBL_CUST_DOCMASTER.CUSTOMERBANKACCOUNTNR"/>
        <bm:field name="memo" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MEMO" prompt="TBL_CUST_DOCMASTER.MEMO"/>
        <bm:field name="rednoticenr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REDNOTICENR" prompt="TBL_CUST_DOCMASTER.REDNOTICENR"/>
        <bm:field name="refinvtypecode" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REFINVTYPECODE" prompt="TBL_CUST_DOCMASTER.REFINVTYPECODE"/>
        <bm:field name="refinvnr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REFINVNR" prompt="TBL_CUST_DOCMASTER.REFINVNR"/>
        <bm:field name="invoicer" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICER" prompt="TBL_CUST_DOCMASTER.INVOICER"/>
        <bm:field name="checker" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CHECKER" prompt="TBL_CUST_DOCMASTER.CHECKER"/>
        <bm:field name="payee" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAYEE" prompt="TBL_CUST_DOCMASTER.PAYEE"/>
        <bm:field name="sellerbankaccountnr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SELLERBANKACCOUNTNR" prompt="TBL_CUST_DOCMASTER.SELLERBANKACCOUNTNR"/>
        <bm:field name="selleraddresstel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SELLERADDRESSTEL" prompt="TBL_CUST_DOCMASTER.SELLERADDRESSTEL"/>
        <bm:field name="productnr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCTNR" prompt="TBL_CUST_DOCMASTER.PRODUCTNR"/>
        <bm:field name="productname" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCTNAME" prompt="TBL_CUST_DOCMASTER.PRODUCTNAME"/>
        <bm:field name="productspec" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCTSPEC" prompt="TBL_CUST_DOCMASTER.PRODUCTSPEC"/>
        <bm:field name="productunit" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRODUCTUNIT" prompt="TBL_CUST_DOCMASTER.PRODUCTUNIT"/>
        <bm:field name="productquantity" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRODUCTQUANTITY" prompt="TBL_CUST_DOCMASTER.PRODUCTQUANTITY"/>
        <bm:field name="productvalue" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRODUCTVALUE" prompt="TBL_CUST_DOCMASTER.PRODUCTVALUE"/>
        <bm:field name="taxrate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAXRATE" prompt="TBL_CUST_DOCMASTER.TAXRATE"/>
        <bm:field name="producttax" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRODUCTTAX" prompt="TBL_CUST_DOCMASTER.PRODUCTTAX"/>
        <bm:field name="discountvalue" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DISCOUNTVALUE" prompt="TBL_CUST_DOCMASTER.DISCOUNTVALUE"/>
        <bm:field name="discounttax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DISCOUNTTAX" prompt="TBL_CUST_DOCMASTER.DISCOUNTTAX"/>
        <bm:field name="machinenr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MACHINENR" prompt="TBL_CUST_DOCMASTER.MACHINENR"/>
        <!-- 不含税单价 -->
        <bm:field name="productvalue_before" databaseType="NUMBER" datatype="java.lang.Double" expression="(t1.productvalue -t1.producttax)"/>
        <!-- 含税总额 -->
        <bm:field name="productvalue_total" databaseType="VARCHAR2" datatype="java.lang.String" expression="(t1.productvalue*t1.productquantity)"/>
        <!-- 税率总额 -->
        <bm:field name="producttax_total" databaseType="NUMBER" datatype="java.lang.Double" expression="(t1.producttax*t1.productquantity)"/>
        <!-- 不含税总额 -->
        <bm:field name="net_amount" databaseType="NUMBER" datatype="java.lang.Double" expression="(t1.productvalue*t1.productquantity-t1.producttax*t1.productquantity)"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field field="customername" queryOperator="like"/>
        <bm:query-field field="productname" queryOperator="like"/>
        <bm:query-field name="document_number_f" queryExpression="t1.documentnr  &gt;=  ${@document_number_f}"/>
        <bm:query-field name="document_number_t" queryExpression="t1.documentnr  &lt;=  ${@document_number_t}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="documentnr" expression="(select h.vat_interface_status from  ACR_INVOICE_HD h where  h.document_number=t1.documentnr) =&apos;TRANSFERED&apos;"/>
    </bm:data-filters>
</bm:model>