<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-3-3 下午7:53:10  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CON_LEASE_CONTRACT">
    <bm:fields>
        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CON_LEASE_CONTRACT.CONTRACT_ID"/>
        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="CON_LEASE_CONTRACT.CONTRACT_NUMBER"/>
        <bm:field name="amount_acr" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_ACR" prompt="CON_LEASE_CONTRACT.AMOUNT_ACR"/>
        <bm:field name="amount_ast" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_AST" prompt="CON_LEASE_CONTRACT.AMOUNT_AST"/>
        <bm:field name="amount_tax" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_TAX" prompt="CON_LEASE_CONTRACT.AMOUNT_TAX"/>
        <bm:field name="amount_rvn" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_RVN" prompt="CON_LEASE_CONTRACT.AMOUNT_RVN"/>
        <bm:field name="contract_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_TYPE" prompt="CON_LEASE_CONTRACT.CONTRACT_TYPE"/>
        <bm:field name="lease_begin_date" databaseType="DATE" datatype="java.util.Date" physicalName="LEASE_BEGIN_DATE" prompt="CON_LEASE_CONTRACT.LEASE_BEGIN_DATE"/>
        <bm:field name="resp_center_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESP_CENTER_ID" prompt="CON_LEASE_CONTRACT.RESP_CENTER_ID"/>
        <bm:field name="resp_center_name" forInsert="false" forUpdate="false"/>
        <bm:field name="currency_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_CODE" prompt="CON_LEASE_CONTRACT.CURRENCY_CODE"/>
        <bm:field name="amount_tax_in" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_TAX_IN" prompt="CON_LEASE_CONTRACT.AMOUNT_TAX_IN"/>
        <bm:field name="tax_in_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_IN_CODE" prompt="CON_LEASE_CONTRACT.TAX_IN_CODE"/>
        <bm:field name="tax_out_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_OUT_CODE" prompt="CON_LEASE_CONTRACT.TAX_OUT_CODE"/>
        <bm:field name="customer_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CUSTOMER_CODE" prompt="CON_LEASE_CONTRACT.TAX_IN_CODE"/>
        <bm:field name="lease_item_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ITEM_CODE" prompt="CON_LEASE_CONTRACT.TAX_OUT_CODE"/>
        <bm:field name="loan_contract" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOAN_CONTRACT" prompt="CON_LEASE_CONTRACT.TAX_IN_CODE"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
    			select t1.contract_id,
				       t1.contract_number,
				       t1.amount_acr,
				       t1.amount_ast,
				       t1.amount_tax,
				       t1.amount_rvn,
				       t1.contract_type,
				       t1.lease_begin_date,
				       t1.resp_center_id,
				       (select r.responsibility_center_name
				          from fnd_responsibility_centers_vl r
				         where r.responsibility_center_id = t1.resp_center_id) as resp_center_name,
				       t1.currency_code,
				       t1.amount_tax_in,
				       t1.tax_in_code,
				       t1.tax_out_code,
				       t1.customer_code,
				       t1.lease_item_code,
				       t1.loan_contract
				  from con_lease_contract t1
    		]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="contract_id"/>
    </bm:primary-key>
</bm:model>
