<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-1-15 下午04:28:33  
    $Revision: 1.0  
    $Purpose: 合同账户定义中现金流项目
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <script type="text/javascript"><![CDATA[
    		function cf_direction_renderer(value, record, name) {
    		    if (value == 'INFLOW') {
    		        return '<img src="${/request/@context_path}/images/inflow.png" style="margin-top:4px">';
    		    } else if (value == 'OUTFLOW') {
    		        return '<img src="${/request/@context_path}/images/outflow.png" style="margin-top:4px">';
    		    }
    		}
    		
    		function cf_back() {
    		    $('${/parameter/@lovid}').win.close();
    		}
    		
    		function cf_confirm() {
    		    var select_records = $('con_contract_bank_account_cf_ds').getSelected();
    		    var records_length = select_records.length;
    		    var cf_item_string, cf_item_desc_string;
    		    var recordSave = $('con_contract_bank_account_cf_ds').create();
    		    for (i = 0;i < records_length;i++) {
    		        if (cf_item_string || cf_item_string === 0) {
    		            cf_item_string += ',' + select_records[i].get('cf_item');
    		            cf_item_desc_string += ',' + select_records[i].get('cf_item_desc');
    		        } else {
    		            cf_item_string = select_records[i].get('cf_item');
    		            cf_item_desc_string = select_records[i].get('cf_item_desc');
    		        }
    		    }
    		    recordSave.set('cf_item',cf_item_string);
    			recordSave.set('cf_item_desc',cf_item_desc_string);
    			$('${/parameter/@lovid}').commit(recordSave);
    			
    			
    		}
		]]></script>
        <a:dataSets>
            <a:dataSet id="con_contract_bank_account_cf_ds" autoQuery="true" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/cont.CON601.con_contract_bank_account_cf_item_query/query" selectable="true"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="cf_back" text="HLS.CLOSE"/>
                <a:gridButton click="cf_confirm" text="HLS.CONFIRM"/>
            </a:screenTopToolbar>
            <a:form title="HLS.CF_ITEM_DESC">
                <a:grid bindTarget="con_contract_bank_account_cf_ds" height="350" width="400">
                    <a:columns>
                        <a:column name="cf_direction" align="center" prompt="CON601.CF_DIRECTION" renderer="cf_direction_renderer" width="50"/>
                        <a:column name="cf_item_desc" prompt="HLS.CF_ITEM_DESC" width="150"/>
                    </a:columns>
                </a:grid>
            </a:form>
        </a:screenBody>
    </a:view>
</a:screen>
