<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-2-26 下午2:37:49  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query defaultWhereClause="v.code=&apos;HLS005_CF_STATUS&apos; and v.code_value=&apos;RELEASE&apos;" model="basic.sys_code_default_value" rootPath="cf_status_default_record"/>
    </a:init-procedure>
    <a:view>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="bmLink_loadCashflowItem" model="hls.HLS006.hls_cashflow_item_company" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
        	
        	
        
        
        function cashflowItemScreen_quit() {
            location.href = $('sys_service_welcome_link').getUrl();
        }
    	
        function cashflowItemDs_grid_query() {
            $('cashflowItemDs').query();
        }
        
        function cashflowItemDs_grid_add() {
            $('cashflowItemDs_grid').showEditorByRecord($('cashflowItemDs').create());
        }
        
        function cashflowItemDs_grid_clear() {
            $('cashflowItemDs_grid').clear();
        }
        
        function cashflowItemDs_grid_save() {
            var result_ds = $('cashflowItemDs');
            if (result_ds.validate()) {
                result_ds.submit();
            }
        }
        
        function editorFunction_cashflowItemDs_grid(record,name)
        {
            if(record.isNew)
            {
                if(name=='cf_item')
                {
                    return 'cashflowItemDs_grid_lov';
                }
                return '';
            }
            return '';
        }
        
        function cashflowItem_load()
        {
            Leaf.request({
                url: $('bmLink_loadCashflowItem').getUrl(),
                success: function (res)
                {
                    $('cashflowItemDs').query();
                },
                scope: this
            });
        }
        
        
        ]]></script>
        <a:dataSets>
            <a:dataSet id="nc_cf_item_ds" lookupCode="NC_CF_ITEM"/>
            <a:dataSet id="cf_status_ds" lookupCode="HLS005_CF_STATUS"/>
            <a:dataSet id="cashflowItemScreen_basicDs" loadData="true" model="basic.sys_session_info">
                <a:fields>
                    <a:field name="company_short_name" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="cashflowItemDs" autoQuery="true" model="hls.HLS006.hls_cashflow_item_company" pageSize="20" selectable="true">
                <a:fields>
                    <a:field name="default_cf_status" defaultValue="${/model/cf_status_default_record/record/@code_value}"/>
                    <a:field name="default_cf_status_desc" defaultValue="${/model/cf_status_default_record/record/@code_value_name}" displayField="code_value_name" options="cf_status_ds" required="true" returnField="default_cf_status" valueField="code_value"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="calc_penalty" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="cf_item" lovGridHeight="300" lovHeight="500" lovService="hls.HLS005.hls_cashflow_item_v_lov" lovWidth="850" required="true" title="HLS005.HLS_CASHFLOW_ITEM.CF_ITEM">
                        <a:mapping>
                            <a:map from="cf_item" to="cf_item"/>
                            <a:map from="cf_item_desc" to="cf_item_desc"/>
                            <a:map from="cf_direction" to="cf_direction"/>
                            <a:map from="cf_direction_desc" to="cf_direction_desc"/>
                            <a:map from="cf_type" to="cf_type"/>
                            <a:map from="cf_type_desc" to="cf_type_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="ref_v01_n" displayField="code_value_name" options="nc_cf_item_ds" returnField="ref_v01" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="cashflowItemScreen_quit" text="HLS.EXIT"/>
                <a:gridButton click="cashflowItemDs_grid_query" text="HLS.QUERY"/>
                <a:gridButton click="cashflowItemDs_grid_add" text="HLS.NEW"/>
                <a:gridButton click="cashflowItemDs_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="cashflowItemDs_grid_save" text="HLS.SAVE"/>
                <a:gridButton click="cashflowItem_load" text="HLS.IMPORT"/>
            </a:screenTopToolbar>
            <a:form title=" ">
                <a:textField name="company_short_name" bindTarget="cashflowItemScreen_basicDs" prompt="HLS.COMPANY_SHORT_NAME"/>
            </a:form>
            <a:grid id="cashflowItemDs_grid" bindTarget="cashflowItemDs" marginHeight="180" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="cf_item" align="right" editorFunction="editorFunction_cashflowItemDs_grid" width="80"/>
                    <a:column name="cf_item_desc" width="150"/>
                    <a:column name="cf_type" align="right" width="80"/>
                    <a:column name="cf_type_desc" width="150"/>
                    <a:column name="cf_direction_desc" width="100"/>
                    <a:column name="default_cf_status_desc" editor="cashflowItemDs_grid_comb"/>
                    <a:column name="write_off_order" align="right" editor="cashflowItemDs_grid_nf_integer" width="100"/>
                    <a:column name="calc_penalty" editor="cashflowItemDs_grid_check"/>
                    <a:column name="billing_desc" editor="cashflowItemDs_grid_tf" width="150"/>
                    <a:column name="enabled_flag" editor="cashflowItemDs_grid_check" width="80"/>
                    <a:column name="ref_v01_n" editor="nc_cf_item_com" prompt="NC现金流量项目" width="200"/>
                </a:columns>
                <a:editors>
                    <a:textField id="cashflowItemDs_grid_tf_upper" maxLength="30" typeCase="upper"/>
                    <a:textField id="cashflowItemDs_grid_tf"/>
                    <a:numberField id="cashflowItemDs_grid_nf_integer" allowDecimals="false"/>
                    <a:checkBox id="cashflowItemDs_grid_check"/>
                    <a:comboBox id="cashflowItemDs_grid_comb"/>
                    <a:lov id="cashflowItemDs_grid_lov"/>
                    <a:comboBox id="nc_cf_item_com"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>