<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-9-2 上午11:01:05  
    $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="GLD_JOURNAL_HEADERS">
    <bm:fields>
        <bm:field name="journal_header_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JOURNAL_HEADER_ID" prompt="GLD_JOURNAL_HEADERS.JOURNAL_HEADER_ID"/>
        <bm:field name="journal_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JOURNAL_NUM" prompt="GLD_JOURNAL_HEADERS.JOURNAL_NUM"/>
        <bm:field name="journal_date" databaseType="DATE" datatype="java.util.Date" physicalName="JOURNAL_DATE" prompt="GLD_JOURNAL_HEADERS.JOURNAL_DATE"/>
        <bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PERIOD_NAME" prompt="GLD_JOURNAL_HEADERS.PERIOD_NAME"/>
        <bm:field name="period_year" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PERIOD_YEAR" prompt="GLD_JOURNAL_HEADERS.PERIOD_YEAR"/>
        <bm:field name="period_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PERIOD_NUM" prompt="GLD_JOURNAL_HEADERS.PERIOD_NUM"/>
        <bm:field name="source_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SOURCE_CODE" prompt="GLD_JOURNAL_HEADERS.SOURCE_CODE"/>
        <bm:field name="source_code_desc" expression="(SELECT JE_TEMPLATE_DESC  FROM ( select a.je_template_code,A.JE_TEMPLATE_DESC from gld_je_template_hds a union select &apos;GLD&apos; je_transaction_code,&apos;总账&apos; gld_je_template_hds FROM DUAL ) T WHERE T.je_template_code = t1.source_code AND ROWNUM=1)" forInsert="false" forUpdate="false"/>
        <bm:field name="category_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CATEGORY_CODE" prompt="GLD_JOURNAL_HEADERS.CATEGORY_CODE"/>
        <bm:field name="currency_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_CODE" prompt="GLD_JOURNAL_HEADERS.CURRENCY_CODE"/>
        <bm:field name="exchange_rate_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE" prompt="GLD_JOURNAL_HEADERS.EXCHANGE_RATE_TYPE"/>
        <bm:field name="exchange_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EXCHANGE_RATE" prompt="GLD_JOURNAL_HEADERS.EXCHANGE_RATE"/>
        <bm:field name="attachment_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ATTACHMENT_NUM" prompt="GLD_JOURNAL_HEADERS.ATTACHMENT_NUM"/>
        <bm:field name="total_amount_dr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_AMOUNT_DR" prompt="GLD_JOURNAL_HEADERS.TOTAL_AMOUNT_DR"/>
        <bm:field name="total_amount_cr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_AMOUNT_CR" prompt="GLD_JOURNAL_HEADERS.TOTAL_AMOUNT_CR"/>
        <bm:field name="total_amount_fuc_dr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_AMOUNT_FUC_DR" prompt="GLD_JOURNAL_HEADERS.TOTAL_AMOUNT_FUC_DR"/>
        <bm:field name="total_amount_fuc_cr" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_AMOUNT_FUC_CR" prompt="GLD_JOURNAL_HEADERS.TOTAL_AMOUNT_FUC_CR"/>
        <bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="GLD_JOURNAL_HEADERS.STATUS"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="GLD_JOURNAL_HEADERS.DESCRIPTION"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${/session/@company_id}" physicalName="COMPANY_ID" prompt="GLD_JOURNAL_HEADERS.COMPANY_ID" updateExpression="${/session/@company_id}"/>
        <bm:field name="posted_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="POSTED_BY" prompt="GLD_JOURNAL_HEADERS.POSTED_BY"/>
        <bm:field name="approved_date" databaseType="DATE" datatype="java.util.Date" physicalName="APPROVED_DATE" prompt="GLD_JOURNAL_HEADERS.APPROVED_DATE"/>
        <bm:field name="approved_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="APPROVED_BY" prompt="GLD_JOURNAL_HEADERS.APPROVED_BY"/>
        <bm:field name="reversed_journal_header_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REVERSED_JOURNAL_HEADER_ID" prompt="GLD_JOURNAL_HEADERS.REVERSED_JOURNAL_HEADER_ID"/>
        <bm:field name="reversed_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REVERSED_FLAG" prompt="GLD_JOURNAL_HEADERS.REVERSED_FLAG"/>
        <bm:field name="reversed_date" databaseType="DATE" datatype="java.util.Date" physicalName="REVERSED_DATE" prompt="GLD_JOURNAL_HEADERS.REVERSED_DATE"/>
        <bm:field name="category_code_desc" expression="(select description from hls_document_type where document_type = t1.category_code and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>
        <bm:field name="currency_code_desc" expression="(select currency_name from gld_currency_vl where currency_code = t1.currency_code and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>
        <bm:field name="code_value_name" databaseType="VARCHAR2" datatype="java.lang.String" expression="(select code_value_name from sys_code_values_v where code=&apos;GLD_JE_STATUS&apos; and code_value=t1.status)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="journal_header_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="journal_header_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
