<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-6-24 下午5:16:21  
    $Revision: 1.0  
    $Purpose: 
-->
<ns1:model xmlns:s="leaf.plugin.script" xmlns:ns1="http://www.leaf-framework.org/schema/bm" alias="t1" extend="prj.PRJ501.prj_project_v" extendMode="reference">
    <ns1:fields>
        <ns1:field name="project_id" databasetype="NUMBER" datatype="java.lang.Long" physicalname="PROJECT_ID"/>
        <ns1:field name="company_id" databasetype="NUMBER" datatype="java.lang.Long" physicalname="COMPANY_ID"/>
        <ns1:field name="project_status" databasetype="VARCHAR2" datatype="java.lang.String" physicalname="PROJECT_STATUS"/>
        <ns1:field name="document_category" databasetype="VARCHAR2" datatype="java.lang.String" physicalname="DOCUMENT_CATEGORY"/>
        <ns1:field name="project_number" databasetype="VARCHAR2" datatype="java.lang.String" displayWidth="200" forDisplay="true" forQuery="true" physicalname="PROJECT_NUMBER" prompt="PRJ501.PRJ_PROJECT.PROJECT_NO"/>
        <ns1:field name="project_name" databasetype="VARCHAR2" datatype="java.lang.String" displayWidth="250" forDisplay="true" forQuery="true" physicalname="PROJECT_NAME" prompt="PRJ501.PRJ_PROJECT.PROJECT_NAME"/>
    </ns1:fields>
    <ns1:query-fields>
        <ns1:query-field name="project_name" queryExpression="t1.project_name like &apos;%&apos; || ${@project_name} || &apos;%&apos; "/>
        <ns1:query-field field="project_number" queryOperator="like"/>
        <ns1:query-field name="split_status_flag" queryExpression="t1.project_status not in (&apos;REJECT&apos;,&apos;CLOSED&apos;,&apos;CONTRACT_CREATED&apos;) and ${@split_status_flag}=&apos;Y&apos;"/>
        <ns1:query-field name="authorize_flag" queryExpression="(t1.company_id=${/session/@company_id} and t1.owner_user_id in (select owner_user_id from aut_owner_user_authorize t where authorized_user_id = ${/session/@user_id} and t.trx_category =&apos;CONTRACT&apos;and sysdate between t.start_date and nvl(t.end_date,sysdate)) and ${@authorize_flag}=&apos;Y&apos;)"/>
    </ns1:query-fields>
    <ns1:features>
        <s:bm-script><![CDATA[
            var cx = Packages.leaf.javascript.Context.getCurrentContext();
            Packages.leaf.plugin.script.engine.ScriptImportor.defineExternScript(cx, this, $ctx.getData(), "aut_authority_bm_validate.js");
        ]]></s:bm-script>
    </ns1:features>
</ns1:model>
