<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-7-4 下午5:06:21  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="ACR_INVOICE_CONTRACT_CF_V" defaultOrderBy="t1.times,t1.due_date,t1.cf_item">
    <bm:fields>
        <bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID"/>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
        <bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" prompt="ACR510.ACR_INVOICE_CONTRACT_CF_V.CF_ITEM"/>
        <bm:field name="cf_item_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CF_ITEM_DESC" prompt="HLS.RECEIVE_PROJECT"/>
        <bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES" prompt="HLS.PERIOD_NUMBER"/>
        <bm:field name="last_received_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_RECEIVED_DATE" prompt="ACR.RECEIVED_DATE"/>
        <bm:field name="due_date" databaseType="DATE" datatype="java.util.Date" physicalName="DUE_DATE" prompt="ACR.DUE_DATE"/>
        <bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT" prompt="ACR.DUE_AMOUNT"/>
        <bm:field name="principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PRINCIPAL" prompt="HLS.PRINCIPAL_AMOUNT"/>
        <bm:field name="interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="INTEREST" prompt="HLS.PAYMENT_INTEREST_AMT"/>
        <bm:field name="received_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_AMOUNT" prompt="ACR.RECEIVED_AMOUNT"/>
        <bm:field name="received_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_PRINCIPAL" prompt="ACR.RECEIVED_PRINCIPAL"/>
        <bm:field name="received_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_INTEREST" prompt="ACR.RECEIVED_INTEREST"/>
        <bm:field name="billing_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BILLING_AMOUNT" prompt="ACR.BILLING_AMOUNT"/>
        <bm:field name="billing_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BILLING_PRINCIPAL" prompt="ACR.BILLING_PRINCIPAL"/>
        <bm:field name="billing_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="BILLING_INTEREST" prompt="ACR.BILLING_INTEREST"/>
        <bm:field name="vat_due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_DUE_AMOUNT" prompt="ACR.TAX_AMOUNT"/>
        <bm:field name="vat_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_PRINCIPAL" prompt="ACR.VAT_PRINCIPAL"/>
        <bm:field name="vat_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_INTEREST" prompt=""/>
        <bm:field name="net_due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_DUE_AMOUNT" prompt=""/>
        <bm:field name="net_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_PRINCIPAL" prompt=""/>
        <bm:field name="net_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_INTEREST" prompt=""/>
        <bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY" prompt="HLS.CURRENCY"/>
        <bm:field name="currency_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_DESC" prompt="HLS.CURRENCY"/>
        <bm:field name="exchange_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EXCHANGE_RATE" prompt="HLS.EXCHANGE_RATE"/>
        <bm:field name="exchange_rate_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE" prompt="HLS.EXCHANGE_RATE_TYPE"/>
        <bm:field name="exchange_rate_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE_DESC" prompt="HLS.EXCHANGE_RATE_TYPE_DESC"/>
        <bm:field name="exchange_rate_quotation" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_QUOTATION"/>
        <bm:field name="exchange_rate_quotation_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_QUOTATION_DESC" prompt="汇率报价方式"/>
        <bm:field name="overdue_status"/>
        <bm:field name="overdue_max_days"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:query-fields>
        <bm:query-field name="cf_item" queryExpression="t1.cf_item = ${@cf_item}"/>
        <bm:query-field name="due_date_from" queryExpression="t1.due_date &gt;= to_date(${@due_date_from},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="due_date_to" queryExpression="t1.due_date &lt;= to_date(${@due_date_to},&apos;yyyy-mm-dd&apos;)"/>
        <bm:query-field name="overdue_max_days_from" queryExpression="t1.overdue_max_days &gt;= ${@overdue_max_days_from}"/>
        <bm:query-field name="overdue_max_days_to" queryExpression="t1.overdue_max_days &lt;= ${@overdue_max_days_to}"/>
        <bm:query-field field="overdue_status" queryExpression="t1.overdue_status=${@overdue_status} and t1.write_off_flag != &apos;FULL&apos;"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.cf_item in(&apos;1&apos;,&apos;8&apos;,&apos;9&apos;,&apos;912&apos;,&apos;913&apos;)"/>
        <bm:data-filter enforceOperations="query" expression="t1.due_date &lt;= trunc(sysdate)"/>
        <bm:data-filter enforceOperations="query" expression="t1.write_off_flag != &apos;NOT&apos;"/>
        <bm:data-filter enforceOperations="query" expression="t1.contract_id = ${@contract_id}"/>
        <bm:data-filter enforceOperations="query" expression="t1.cf_status = &apos;RELEASE&apos;"/>
        <bm:data-filter enforceOperations="query" expression="t1.billing_status != &apos;FULL&apos; and t1.cf_direction=&apos;INFLOW&apos;"/>
        <!--         <bm:data-filter enforceOperations="query" expression="((t1.cf_type = 109) OR (t1.cf_type = 9 AND t1.write_off_flag != &apos;NOT&apos;) OR (t1.write_off_flag = &apos;FULL&apos; AND t1.cf_direction = &apos;INFLOW&apos;))"/>
        <bm:data-filter enforceOperations="query" expression="not exists (select 1 from con_contract_billing_method m where m.equipment_billing = &apos;Y&apos; and t1.cf_type = 2 and m.contract_id = t1.contract_id)"/> -->
    </bm:data-filters>
</bm:model>
