fnd_interest_rate.lview 5.14 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
<?xml version="1.0" encoding="UTF-8"?>
<!--
	&author:xuls
	$date:2014/11/10
	$purpose:利率明细定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
			function rateScreen_close() {
            	$('fnd_int_rate_set').close();
        	}
        
	        function rateDs_grid_query() {
	            $('rateDs').query();
	        }
	    	
	        function rateDs_grid_add() {
	            var data={
	                currency : '${/parameter/@currency}',
	                int_rate_set : '${/parameter/@int_rate_set}'
	            };
	            $('rateDs_grid').showEditorByRecord($('rateDs').create(data));
	        }
	        
	        function rateDs_grid_remove() {
	            $('rateDs_grid').remove();
	        }
	        
	        function rateDs_grid_clear() {
	            $('rateDs_grid').clear();
	        }
	        
	        function rateDs_grid_save() {
	            var result_ds = $('rateDs');
	            result_ds.setSubmitParameter('int_rate_set','${/parameter/@int_rate_set}');
	            if (result_ds.validate()) {
	                result_ds.submit();
	            }
	        }
	        	        
			function editorFunction_rateDs_grid(record,name){
				if(record.isNew){
					if(name=='int_rate_set'){
						return 'rateDs_grid_editor_tf_upper';
					}
					else if(name=='currency')
					{
					    if(Ext.isEmpty('${/parameter/@currency}'))
					    {
					        return 'rateDs_grid_editor_comb';
					    }
					}
					else if(name=='valid_from')
					{
					    return 'rateDs_grid_editor_dp';
					}
					return '';
				}
				return '';
			}
			
			/* function render_rateDs_grid(value,record,name)
			{
			    if(name=='int_rate')
			    {
			        if(value == undefined)
			        {
			            return '';
			        }
			        return value.toFixed(2);
			    }
			} */
			function fnd253_int_rate_update(ds,record,name,value,oldvalue){
			  if(name=='ini_rate_display'){
			      if(value){
			          record.set('int_rate',value/100);
			      }
			      
			  }  
			}
			
		]]></script>
        <a:dataSets>
            <a:dataSet id="rateScreen_currencyDs" loadData="true" model="gld.gld_currency_vl"/>
            <a:dataSet id="rateDs" autoQuery="true" model="fnd.FND253.fnd_interest_rate" queryUrl="${/request/@context_path}/autocrud/fnd.FND253.fnd_interest_rate/query?int_rate_set=${/parameter/@int_rate_set}" selectable="true">
                <a:fields>
                    <a:field name="ini_rate_display" required="true"/>
                    <a:field name="months_from" required="true"/>
                    <a:field name="months_to" required="true"/>
                    <a:field name="description" required="true"/>
                    <a:field name="currency" displayField="currency_code" options="rateScreen_currencyDs" required="true" returnField="currency" valueField="currency_code"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="fnd253_int_rate_update"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="rateScreen_close" text="HLS.CLOSE"/>
                <a:gridButton click="rateDs_grid_query" text="HLS.QUERY"/>
                <a:gridButton click="rateDs_grid_add" text="HLS.NEW"/>
                <a:gridButton click="rateDs_grid_remove" text="HLS.REMOVE"/>
                <a:gridButton click="rateDs_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="rateDs_grid_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:grid id="rateDs_grid" bindTarget="rateDs" height="300" width="780">
                <a:columns>
                    <a:column name="currency" editorFunction="editorFunction_rateDs_grid" prompt="HLS.CURRENCY"/>
                    <a:column name="ini_rate_display" align="right" editor="rateDs_grid_editor_nf" prompt="FND251.FND_BASE_RATE.BASE_RATE" renderer="Leaf.formatMoney"/>
                    <a:column name="months_from" align="right" editor="rateDs_grid_editor_nf_integer" prompt="GLD_PERIOD_RULES.MONTH_FROM"/>
                    <a:column name="months_to" align="right" editor="rateDs_grid_editor_nf_integer" prompt="GLD_PERIOD_RULES.MONTH_TO"/>
                    <a:column name="description" editor="rateDs_grid_editor_tf" prompt="HLS.DESCRIPTION" width="250"/>
                </a:columns>
                <a:editors>
                    <a:textField id="rateDs_grid_editor_tf_upper" maxLength="30" typeCase="upper"/>
                    <a:textField id="rateDs_grid_editor_tf"/>
                    <a:numberField id="rateDs_grid_editor_nf" allowDecimals="true" decimalPrecision="2"/>
                    <a:numberField id="rateDs_grid_editor_nf_integer" allowDecimals="false" allowNegative="false"/>
                    <a:comboBox id="rateDs_grid_editor_comb"/>
                    <a:checkBox id="rateDs_grid_editor_check"/>
                    <a:datePicker id="rateDs_grid_editor_dp"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>