<?xml version="1.0" encoding="UTF-8"?>
<!--
	$author:huangshengbo
	$date:2011/08/04
	$purpose:帐龄时段设置
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="fnd_aging_bucket_lines_link" url="${/request/@context_path}/modules/fnd/FND1300/fnd_aging_bucket_lines.lview"/>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <script type="text/javascript"><![CDATA[
			function queryFunction(){
				$('fnd_aging_buckets_result_ds').query();
			}
			function resetFunction(){
				$('fnd_aging_buckets_query_ds').reset();
			}
			function onrender(value,record,name){
				if(!record.isNew){
					var url=/*fnd_aging_bucket_lines.screen*/$('fnd_aging_bucket_lines_link').getUrl()+'?aging_bucket_id='+record.get('aging_bucket_id');
					return '<a href="javascript:openWindow(\''+url+'\')">' + '${l:FND_AGING_BUCKETS.SEE_DETIAL}' + '</a>';
				}
			}
			function openWindow(url){
				new Leaf.Window({
					id:'fnd_aging_bucket_lines',
					url:url,
					title:'${l:FND_AGING_BUCKETS.AGING_DETAILS}',
					height:510,
					width:690
				});
			}
			function editFunction(record,name){
				if(record.isNew){
					return 'editor_tf_upper';
				}
				return '';
			}
			        	function fnd_1300_grid_add(){
                $('fnd_1300_grid').showEditorByRecord($('fnd_aging_buckets_result_ds').create());
            }
            function fnd_1300_grid_clear(){
                $('fnd_1300_grid').clear();
            }
            function fnd_1300_grid_submit() {
                var result_ds = $('fnd_aging_buckets_result_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
            function fnd_1300_quit(){
                location.href = $('sys_service_welcome_link').getUrl();
                parent.shMenu('show');
            }
		]]></script>
        <a:dataSets>
            <a:dataSet id="fnd_aging_buckets_query_ds" model="fnd.FND1300.fnd_aging_buckets"/>
            <a:dataSet id="fnd_aging_buckets_result_ds" model="fnd.FND1300.fnd_aging_buckets" pageSize="15" queryDataSet="fnd_aging_buckets_query_ds" selectable="true">
                <a:fields>
                    <a:field name="aging_bucket_code" required="true"/>
                    <a:field name="description" required="true"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="fnd_1300_quit" text="HLS.EXIT"/>
                <a:gridButton click="queryFunction" text="HLS.QUERY"/>
                <a:gridButton click="fnd_1300_grid_add" text="HLS.NEW"/>
                <a:gridButton click="fnd_1300_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="fnd_1300_grid_submit" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="2" labelWidth="120" title="FND_AGING_BUCKETS.AGING_PERIOD">
                <a:textField name="aging_bucket_code" bindTarget="fnd_aging_buckets_query_ds" prompt="FND_AGING_BUCKETS.AGING_BUCKET_CODE" typeCase="upper"/>
                <a:textField name="description" bindTarget="fnd_aging_buckets_query_ds" prompt="FND_AGING_BUCKETS.AGING_BUCKET_NAME_ID"/>
            </a:form>
            <a:grid id="fnd_1300_grid" bindTarget="fnd_aging_buckets_result_ds" height="490" marginWidth="20" navBar="true" width="1000">
                <a:columns>
                    <a:column name="aging_bucket_code" align="left" editorFunction="editFunction" prompt="FND_AGING_BUCKETS.AGING_BUCKET_CODE" width="150"/>
                    <a:column name="description" align="left" editor="editor_tf" prompt="FND_AGING_BUCKETS.AGING_BUCKET_NAME_ID" width="200"/>
                    <a:column name="enabled_flag" align="center" editor="editor_ck" prompt="FND_AGING_BUCKETS.ENABLED_FLAG" width="100"/>
                    <a:column name="detail" align="center" prompt="FND_AGING_BUCKETS.SEE_DETIAL" renderer="onrender" width="100"/>
                </a:columns>
                <a:editors>
                    <a:textField id="editor_tf_upper" typeCase="upper"/>
                    <a:textField id="editor_tf"/>
                    <a:checkBox id="editor_ck"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>