<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-7-4 下午5:06:06  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="ACP_INVOICE_CONTRACT_V">
    <bm:fields>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
        <bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER" prompt="HLS.PROJECT_NUMBER"/>
        <bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME" prompt="HLS.PROJECT_NAME"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="HLS.CONTRACT_NUMBER"/>
        <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME" prompt="HLS.CONTRACT_NAME"/>
        <bm:field name="inception_of_lease" databaseType="DATE" datatype="java.util.Date" physicalName="INCEPTION_OF_LEASE" prompt="ACR.INCEPTION_OF_LEASE"/>
        <bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS" prompt="HLS.CONTRACT_STATUS"/>
        <bm:field name="contract_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_STATUS_DESC" prompt="HLS.CONTRACT_STATUS"/>
        <bm:field name="billing_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD"/>
        <bm:field name="billing_method_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD_DESC" prompt="HLS.BILLING_RULE"/>
        <bm:field name="billing_object_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BILLING_OBJECT_ID"/>
        <bm:field name="billing_object_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_OBJECT_CODE"/>
        <bm:field name="billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_OBJECT_NAME" prompt="销方对象名称"/>
        <bm:field name="object_tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OBJECT_TAX_REGISTRY_NUM" prompt="销方识别号"/>
        <bm:field name="tax_type_vat" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_TYPE_VAT"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="HLS.COMMENT"/>
        <bm:field name="invoice_title" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TITLE" prompt="ACR.INVOICE_TITLE"/>
        <bm:field name="invoice_bp_address_phone_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_ADDRESS_PHONE_NUM" prompt="ACR.INVOICE_BP_ADDRESS_PHONE_NUM"/>
        <bm:field name="invoice_bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_BANK_ACCOUNT" prompt="ACR.INVOICE_BP_BANK_ACCOUNT"/>
        <bm:field name="tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_REGISTRY_NUM"/>
        <bm:field name="prj_search_term_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRJ_SEARCH_TERM_1"/>
        <bm:field name="prj_search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRJ_SEARCH_TERM_2"/>
        <bm:field name="con_search_term_1" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CON_SEARCH_TERM_1"/>
        <bm:field name="con_search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CON_SEARCH_TERM_2"/>
        <bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE"/>
        <bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME"/>
        <bm:field name="pin_billing_object_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PIN_BILLING_OBJECT_NAME" prompt="购方对象名称"/>
        <bm:field name="pin_object_tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PIN_OBJECT_TAX_REGISTRY_NUM" prompt="购方识别号"/>
        <bm:field name="pay_req_print_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAY_REQ_PRINT_STATUS" prompt="打印状态"/>
        <bm:field name="spv_company_id"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <!--<bm:query-field name="project_number_from" queryExpression="t1.project_number &gt;=${@project_number_from}"/>
        <bm:query-field name="project_number_to" queryExpression="t1.project_number &lt;=${@project_number_to}"/>
        <bm:query-field name="contract_number_from" queryExpression="t1.contract_number &gt;=${@contract_number_from}"/>
        <bm:query-field name="contract_number_to" queryExpression="t1.contract_number &lt;=${@contract_number_to}"/>
        <bm:query-field name="bp_code_tenant_from" queryExpression="t1.billing_object_code &gt;=${@bp_code_tenant_from}"/>
        <bm:query-field name="bp_code_tenant_to" queryExpression="t1.billing_object_code &lt;=${@bp_code_tenant_to}"/>
        <bm:query-field name="lease_start_date_from" queryExpression="t1.lease_start_date &gt;= to_date(${@lease_start_date_from},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="lease_start_date_to" queryExpression="t1.lease_start_date &lt;= to_date(${@lease_start_date_to},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="document_type" queryExpression="t1.document_type=${@document_type}"/>
        <bm:query-field name="billing_method" queryExpression="t1.billing_method=${@billing_method}"/>
        <bm:query-field name="prj_search_term_1" queryExpression="t1.prj_search_term_1=${@prj_search_term_1}"/>
        <bm:query-field name="prj_search_term_2" queryExpression="t1.prj_search_term_2=${@prj_search_term_2}"/>
        <bm:query-field name="con_search_term_1" queryExpression="t1.con_search_term_1=${@con_search_term_1}"/>
        <bm:query-field name="con_search_term_2" queryExpression="t1.con_search_term_2=${@con_search_term_2}"/>
        <bm:query-field name="bp_name" queryExpression="t1.bp_name like &apos;%&apos;||${@bp_name}||&apos;%&apos; "/>-->
        <bm:query-field name="project_name" queryExpression="t1.project_name like &apos;%&apos;||${@project_name}||&apos;%&apos; "/>
        <bm:query-field name="contract_name" queryExpression="t1.contract_name like &apos;%&apos;||${@contract_name}||&apos;%&apos; "/>
        <bm:query-field name="contract_number" queryExpression="t1.contract_number like &apos;%&apos;||${@contract_number}||&apos;%&apos; "/>
        <!--<bm:query-field name="document_type" queryExpression="t1.document_type=${@document_type}"/>-->
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
        <bm:data-filter enforceOperations="query" expression="t1.contract_status!= &apos;PENDING&apos; and  exists (select 1               from yonda_doc_status_history t              where t.document_id = t1.contract_id                and t.document_category = &apos;CONTRACT&apos;                and t.status = &apos;280&apos;)"/>
        <bm:data-filter enforceOperations="query" expression="(hls_bp_credit_pkg.get_external_business_flag(t1.contract_id)=&apos;Y&apos; or (hls_bp_credit_pkg.get_external_business_flag(t1.contract_id)=&apos;N&apos;))"/>
        <!-- <bm:data-filter enforceOperations="query" expression="exists (select 1 from con_contract_cashflow where contract_id = t1.contract_id and cf_status = &apos;RELEASE&apos; AND cf_direction = &apos;OUTFLOW&apos; and billing_status != &apos;FULL&apos; and write_off_flag = &apos;FULL&apos;)"/> -->
        <!-- <bm:data-filter enforceOperations="query" expression="exists (select 1 from con_contract_cashflow where contract_id = t1.contract_id and cf_status = &apos;RELEASE&apos; AND cf_direction = &apos;OUTFLOW&apos; and billing_status != &apos;FULL&apos;)"/> -->
    </bm:data-filters>
</bm:model>
