<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-8-28 上午09:27:41  
    $Revision: 1.0  
    $Purpose: 租赁物创建
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="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_lease_item_link" url="${/request/@context_path}/modules/hls/HLS202N/hls_lease_item_create.lview"/>
        <a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            //确定
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_lease_item');
                var record = $(ds_id).getCurrentRecord();
                if ($(ds_id).validate()) {
                    record.set('function_code', 'HLS202D');
                    record.set('function_usage', 'CREATE');
                    record.set('document_category', 'LEASE_ITEM');
                    record.set('default_value_dsid', ds_id);
                    record.data['url_title'] = '租赁物创建';
                    var param = record.data;
                    hls_doc_get_layout_code('get_layout_code_link_id', param, 'hls_lease_item_link');
                }
            };
            
            Leaf.onReady(function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_lease_item');
                var head_record = $(ds_id).getAt(0);
                if (head_record) {
                    // head_record.set('division_n', '${/model/hls_default_parameter_path/record/@division_desc}');
                    // head_record.set('division', '${/model/hls_default_parameter_path/record/@division}');
                    head_record.set('company_id', '${/model/hls_default_parameter_path/record/@company_id}');
                    head_record.set('company_id_n', '${/model/hls_default_parameter_path/record/@company_short_name}');
                    head_record.set('company_id_c', '${/model/hls_default_parameter_path/record/@company_code}');
                }
            });
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
