<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2013-1-8 下午06:33:58  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_PAWNS">
    <bm:fields>
        <bm:field name="pawn_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAWN_ID" prompt="HLS_PAWNS.PAWN_ID"/>
        <bm:field name="description_id" databaseType="NUMBER" datatype="java.lang.Long" multiLanguage="true" multiLanguageDescField="pawn_name" physicalName="DESCRIPTION_ID" prompt="HLS_PAWNS.DESCRPITION_ID"/>
        <bm:field name="pawn_status" databaseType="VARCHAR2" datatype="java.lang.String" lookupCode="HLS_PAWN_STATUS" lookupField="pawn_status_des" physicalName="PAWN_STATUS" prompt="HLS_PAWNS.PAWN_STATUS"/>
        <bm:field name="pawn_status_des" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="lease_contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_CONTRACT_ID" prompt="HLS_PAWNS.LEASE_CONTRACT_ID"/>
        <bm:field name="lease_contract_code" expression="(select ch.contract_number from HLS_PRJ_CONTRACT_HDS ch where ch.contract_hds_id=lease_contract_id)" forInsert="false"/>
        <bm:field name="customer_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CUSTOMER_ID" prompt="HLS_PAWNS.BUSINESS_PARTNER_ID"/>
        <bm:field name="customer_name" expression="(select hpc.customer_name from HLS_PRJ_CUSTOMER hpc where hpc.customer_id=t1.customer_id)" forInsert="false"/>
        <bm:field name="pawn_contract_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAWN_CONTRACT_NO" prompt="HLS_PAWNS.PAWN_CONTRACT_NO"/>
        <bm:field name="quantity" databaseType="NUMBER" datatype="java.lang.Long" physicalName="QUANTITY" prompt="HLS_PAWNS.QUANTITY"/>
        <bm:field name="uom" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="UOM" prompt="HLS_PAWNS.UOM"/>
        <bm:field name="uom_name" databaseType="VARCHAR2" expression="(select k.description_text from fnd_uom_codes_vl k where k.uom_code=t1.uom)" forInsert="false"/>
        <bm:field name="pawn_value" databaseType="NUMBER" datatype="java.lang.Double" physicalName="PAWN_VALUE" prompt="HLS_PAWNS.PAWN_VALUE"/>
        <bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY" prompt="HLS_PAWNS.CURRENCY"/>
        <bm:field name="currency_name" databaseType="VARCHAR2" expression="(select p.currency_name from GLD_CURRENCY_VL p where p.currency_code=t1.currency)" forInsert="false"/>
        <bm:field name="pawn_register_no" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAWN_REGISTER_NO" prompt="HLS_PAWNS.PAWN_REGISTER_NO"/>
        <bm:field name="pawn_registed_dept" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAWN_REGISTED_DEPT" prompt="HLS_PAWNS.PAWN_REGISTED_DEPT"/>
        <bm:field name="pawn_location" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAWN_LOCATION" prompt="HLS_PAWNS.PAWN_LOCATION"/>
        <bm:field name="estate_license_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ESTATE_LICENSE_CODE" prompt="HLS_PAWNS.ESTATE_LICENSE_CODE"/>
        <bm:field name="housing_area" databaseType="NUMBER" datatype="java.lang.Double" physicalName="HOUSING_AREA" prompt="HLS_PAWNS.HOUSING_AREA"/>
        <bm:field name="land_certificate_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LAND_CERTIFICATE_CODE" prompt="HLS_PAWNS.LAND_CERTIFICATE_CODE"/>
        <bm:field name="land_area" databaseType="NUMBER" datatype="java.lang.Double" physicalName="LAND_AREA" prompt="HLS_PAWNS.LAND_AREA"/>
        <bm:field name="pawn_ownership" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAWN_OWNERSHIP" prompt="HLS_PAWNS.PAWN_OWNERSHIP"/>
        <bm:field name="pawn_occupied" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PAWN_OCCUPIED" prompt="HLS_PAWNS.PAWN_OCCUPIED"/>
        <bm:field name="start_date" databaseType="DATE" datatype="java.util.Date" physicalName="START_DATE" prompt="HLS_PAWNS.START_DATE"/>
        <bm:field name="end_date" databaseType="DATE" datatype="java.util.Date" physicalName="END_DATE" prompt="HLS_PAWNS.END_DATE"/>
        <bm:field name="att_submit_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ATT_SUBMIT_FLAG" prompt="HLS_PAWNS.ATT_SUBMIT_FLAG"/>
        <bm:field name="note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="NOTE" prompt="HLS_PAWNS.NOTE"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
        <f:multi-language-storage/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="pawn_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="pawn_id" queryExpression="t1.pawn_id=${/parameter/@pawn_id}"/>
        <bm:query-field name="pawn_name" queryExpression="exists(select 1 from fnd_descriptions fd where t1.description_id=fd.description_id and fd.description_text like ${@pawn_name})"/>
        <bm:query-field field="pawn_status" queryOperator="="/>
    </bm:query-fields>
</bm:model>
