<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-10-2 下午04:43:54  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.role_id=${/session/@role_id} and t1.company_id=${/session/@company_id}" fetchAll="true" model="hls.HLS109.hls_default_parameter" rootPath="hls_default_parameter_path"/>
        <a:model-query defaultWhereClause="fc.company_id=${/session/@company_id}" fetchAll="true" model="fnd.fnd_companies" rootPath="default_company_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="hls_bp_master_dynamic_update_link_id" url="${/request/@context_path}/modules/hls/HLS213/hls_bp_master_dynamic_update.lview"/>
        <a:link id="hls_bp_master_get_layout_code_link_id" model="hls.HLS213.hls_bp_master_get_layout_code" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            function hls202_lease_item_create() {
                if (!$('hls_bp_master_define_head_ds').validate()) {
                    return;
                }
                var head_record = $('hls_bp_master_define_head_ds').getAt(0);
                head_record.set('function_code', 'HLS202');
                head_record.set('function_usage', 'CREATE');
                head_record.set('master_type', 'LEASE_ITEM');
                head_record.set('default_value_dsid', 'hls_bp_master_define_head_ds');
                head_record.data['url_title'] = '${l:HLS201.HLS_LEASE_ITEM_CREATE}';
                var param = head_record.data;
                hls_doc_get_layout_code('hls_bp_master_get_layout_code_link_id', param, 'hls_bp_master_dynamic_update_link_id');
            }
        ]]></script>
        <a:screen-include screen="modules/hls/HLS213/hls_bp_master_get_layout_code.lview"/>
        <a:dataSets>
            <a:dataSet id="division_desc_ds" fetchAll="true" loadData="true" model="basic.hls_division_for_lov"/>
            <a:dataSet id="hls_bp_master_define_head_ds" autoCreate="true">
                <a:fields>
                    <a:field name="division_n" defaultValue="${/model/hls_default_parameter_path/record/@division_desc}" displayField="description" options="division_desc_ds" required="true" returnField="division" valueField="division"/>
                    <a:field name="division" defaultValue="${/model/hls_default_parameter_path/record/@division}"/>
                    <a:field name="company_id_n" defaultValue="${/model/default_company_path/record/@company_short_name}" lovGridHeight="350" lovHeight="500" lovService="fnd.fnd_companies_lov" lovWidth="500" readOnly="true" required="true" title="HLS.COMPANY">
                        <a:mapping>
                            <a:map from="company_id" to="company_id"/>
                            <a:map from="company_code" to="company_id_c"/>
                            <a:map from="company_short_name" to="company_id_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="company_id" defaultValue="${/model/default_company_path/record/@company_id}" required="true"/>
                    <a:field name="company_id_c" defaultValue="${/model/default_company_path/record/@company_code}" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls202_lease_item_create" text="HLS.CREATE"/>
            </a:screenTopToolbar>
            <a:form column="1" title="HLS201.HLS_LEASE_ITEM_CREATE" width="300">
                <a:lov name="company_id_n" bindTarget="hls_bp_master_define_head_ds" prompt="HLS.COMPANY" width="150"/>
                <a:comboBox name="division_n" bindTarget="hls_bp_master_define_head_ds" prompt="HLS.DIVISION" width="150"/>
            </a:form>
        </a:screenBody>
    </a:view>
</a:screen>
