<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-11-20 下午01:52:34  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <script type="text/javascript"><![CDATA[
            
            
            function on_hls_lease_item_list_load(ds) {
                var records = ds.getAll();
                var show_flag = 'N';
                if (records.length) {
                    for (var i = 0;i < records.length;i++) {
                        var record = records[i];
                        for (var name in record.data) {
                            if (!record.get(name) && show_flag == 'N') {
                                $('hls_lease_item_detail_grid_ds').hideColumn(name);
                                show_flag = 'N';
                            } else {
                                $('hls_lease_item_detail_grid_ds').showColumn(name);
                                show_flag = 'Y';
                            }
                        }
                    }
                }
                var li_list_type = '${/parameter/@li_list_type}';
                if (li_list_type == 'LEASE') {
                    $('hls_lease_item_detail_grid_ds').hideColumn('uom');
                    $('hls_lease_item_detail_grid_ds').hideColumn('asset_num');
                    $('hls_lease_item_detail_grid_ds').hideColumn('manufacturer');
                    $('hls_lease_item_detail_grid_ds').hideColumn('posted_date');
                    $('hls_lease_item_detail_grid_ds').hideColumn('net_asset_value');
                    $('hls_lease_item_detail_grid_ds').hideColumn('invoice_amt');
                    $('hls_lease_item_detail_grid_ds').hideColumn('invoice_num');
                    $('hls_lease_item_detail_grid_ds').hideColumn('invoice_date');
                } else if (li_list_type == 'LEASE_BACK') {
                    $('hls_lease_item_detail_grid_ds').hideColumn('price');
                    $('hls_lease_item_detail_grid_ds').hideColumn('total_amount');
                    $('hls_lease_item_detail_grid_ds').hideColumn('vender');
                }
            }
            
            function con_lease_item_list_close(){
                $('lease_item_list_win').close();
            }
            
            function con_lease_item_list_clear(){
                $('hls_lease_item_detail_grid_ds').clear();
            }
            
            function con_lease_item_list_query(){
                $('hls_lease_item_detail_result_ds').query();
            }
        
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls_lease_item_detail_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS203.hls_lease_item_list" queryUrl="${/request/@context_path}/autocrud/hls.HLS203.hls_lease_item_list/query?lease_item_id=${/parameter/@contract_lease_item_id}" selectable="true">
                <a:events>
                    <a:event name="load" handler="on_hls_lease_item_list_load"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton id="con_lease_item_list_close_btn" click="con_lease_item_list_close" text="HLS.CLOSE"/>
                <a:gridButton id="con_lease_item_list_clear_btn" click="con_lease_item_list_clear" text="HLS.CLEAR"/>
                <a:gridButton id="con_lease_item_list_query_btn" click="con_lease_item_list_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:grid id="hls_lease_item_detail_grid_ds" bindTarget="hls_lease_item_detail_result_ds" height="300" navBar="true" width="850">
                <a:columns>
                    <a:column name="seq"/>
                    <a:column name="asset_num"/>
                    <a:column name="asset_name" width="200"/>
                    <a:column name="specification"/>
                    <a:column name="manufacturer"/>
                    <a:column name="vender" width="200"/>
                    <a:column name="installation_site"/>
                    <a:column name="quantity"/>
                    <a:column name="price"/>
                    <a:column name="total_amount"/>
                    <a:column name="uom"/>
                    <a:column name="posted_date" renderer="Leaf.formatDate"/>
                    <a:column name="net_asset_value" align="right" renderer="Leaf.formatMoney"/>
                    <a:column name="invoice_amt" align="right" renderer="Leaf.formatMoney"/>
                    <a:column name="invoice_num"/>
                    <a:column name="invoice_date" renderer="Leaf.formatDate"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
