con_contract_balance_details.lview 12.4 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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-9-6 下午01:47:51  
    $Revision: 1.0  
    $Purpose: 租金明细
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="con_contract_balance_fine_link" url="${/request/@context_path}/modules/cont/CON305N/con_contract_balance_fine.lview"/>
        <script type="text/javascript"><![CDATA[
            function quit() {
                $('con_contract_balance_details_win').close();
            }
            
            //移除的数据不能导出
            function con_contract_balance_details_clear() {
                $('con_contract_balance_details_line_grid').clear();
            }
            
            function con_contract_balance_details_query() {
                $('con_contract_balance_details_line_ds').query();
            }
            
            function get_fine_details(value, record, name) {
                if (value != 0) {
                    var cashflow_id = record.get('cashflow_id');
                    return '<a href="#' + Math.random() + '"  onclick="open_window(' + cashflow_id + ')">' + Leaf.formatMoney(value) + '<a>';
                } else return Leaf.formatMoney(value);
            }
            
            function open_window(cashflow_id) {
                new Leaf.Window({
                    title: '收款明细及罚金计算表',
                    id: 'con_contract_balance_fine_win',
                    url: $('con_contract_balance_fine_link').getUrl(),
                    params: {
                        'cashflow_id': cashflow_id
                    },
                    width: 950,
                    height: 550
                });
            }
            
            function con_contract_balance_details_export() {
                set_export_parameter();
                $('con_contract_balance_details_line_grid')._export();
            }
            function con_contract_balance_details_line_load(ds) {
                var grid_id = $('con_contract_balance_details_line_grid');
                grid_id.hideColumn('principal');
                grid_id.hideColumn('total_amount');
                grid_id.hideColumn('interest');
                grid_id.hideColumn('received_principal');
                grid_id.hideColumn('received_interest');
                grid_id.hideColumn('outstanding_int_tax_incld');
                grid_id.hideColumn('outstanding_prin_tax_incld');
                grid_id.hideColumn('outstanding_rental_tax_incld');
                grid_id.hideColumn('cf_item');
            
                //var records=ds.getAll();
                // for(var i=0;i<records.length;i++){
                // var record=records[i];
                // if(!Ext.isEmpty(record.get('colour_scheme'))){
                // record.getField('times').setPropertity('tooltip','<span style="color:'+record.get('colour_scheme')+'">已逾期!</span>');
                // }
                // }
            
            }
            
            function times_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + value + '</span>';
            }
            
            function cf_item_desc_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + value + '</span>';
            }
            
            function due_date_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatDate(value) + '</span>';
            }
            
            function due_amount_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatMoney(value) + '</span>';
            }
            
            function last_received_date_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatDate(value) + '</span>';
            }
            
            function received_amount_renderer(value, record, name) {
                //return '<span style="color:red"></span>';
                return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatMoney(value) + '</span>';
            }
            
            function unpaid_amount_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatMoney(value) + '</span>';
            }
            
            function unpaid_fine_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatMoney(value) + '</span>';
            }
            
            function received_fine_renderer(value, record, name) {
                if (value > 0) {
            
                    return '<span style="color:' + record.get('colour_scheme') + '"><a href="javascript:open_window(' + record.get('cashflow_id') + ')">' + Leaf.formatMoney(value) + '</a></span>';
                } else {
                    return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatMoney(value) + '</span>';
                }
            }
            
            function total_amount_renderer(value, record, name) {
                return '<span style="color:' + record.get('colour_scheme') + '">' + Leaf.formatMoney(value) + '</span>';
            }
            
            
            function set_export_parameter(){
                var new_records=$('con_contract_balance_details_line_ds').getAll();
                var all_records=$('con_contract_balance_details_export_ds').getAll();
                if(new_records.length==all_records.length){
                    return;
                }
                var export_record;
                var choose_record;
                var list=[];
                for(var i=0;i<new_records.length;i++){
                     export_record=new_records[i];
                     choose_record=$('con_contract_balance_details_export_ds').find('cashflow_id',export_record.get('cashflow_id'));
                    if(choose_record){
                    	list.push(export_record.get('cashflow_id'));
                    }
                }
                list=list.join(',');
                $('con_contract_balance_details_line_ds').setQueryParameter('export_list',list);
            }
            
            function con_contract_balance_details_line_query(ds,qpara){
                // qpara['export_list']='';
                delete qpara['export_list'];
            }
        ]]></SCRIPT>
        <style><![CDATA[
        	a:link {color: #0000EE}  
        	a:hover {color: #ff8400} 
			a:active {color:#0A0A0A }
			a:visited {color:#0A0A0A} 
        ]]></style>
        <a:dataSets>
            <a:dataSet id="con_contract_balance_details_header_ds" autoQuery="true" queryUrl="${/request/@context_path}/autocrud/cont.CON305N.con_contract_balance_details_header/query?contract_id=${/parameter/@contract_id}"/>
            <a:dataSet id="con_contract_balance_details_export_ds" autoQuery="true" model="cont.CON305N.con_contract_balance_details_line" pageSize="100" queryUrl="${/request/@context_path}/autocrud/cont.CON305N.con_contract_balance_details_line/query?contract_id=${/parameter/@contract_id}" selectable="true"><![CDATA[
            ]]></a:dataSet>
            <a:dataSet id="con_contract_balance_details_line_ds" autoQuery="true" model="cont.CON305N.con_contract_balance_details_line" pageSize="100" queryUrl="${/request/@context_path}/autocrud/cont.CON305N.con_contract_balance_details_line/query?contract_id=${/parameter/@contract_id}" selectable="true">
                <a:events>
                    <a:event name="load" handler="con_contract_balance_details_line_load"/>
                    <a:event name="query" handler="con_contract_balance_details_line_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="quit" text="HLS.CLOSE"/>
                <!-- <a:gridButton click="con_contract_balance_details_clear" text="HLS.CLEAR"/>
                <a:gridButton click="con_contract_balance_details_query" text="HLS.QUERY"/> -->
                <a:gridButton click="con_contract_balance_details_export" text="HLS.EXPORT"/>
            </a:screenTopToolbar>
            <a:form title="CON305.SEARCH_RESULT">
                <a:box column="4" labelWidth="80">
                    <!-- <a:textField name="bp_id_tenant" bindTarget="con_contract_balance_details_header_ds" prompt="CON305.BP_ID_TENANT" readOnly="true"/> -->
                    <a:textField name="bp_name" bindTarget="con_contract_balance_details_header_ds" colspan="2" prompt="HLS.CUSTOMER_NAME" readOnly="true" width="328"/>
                    <a:textField name="contract_number" bindTarget="con_contract_balance_details_header_ds" prompt="HLS.CONTRACT_NUMBER" readOnly="true" width="120"/>
                    <a:textField name="document_type_desc" bindTarget="con_contract_balance_details_header_ds" prompt="HLS.CONTRACT_TYPE" readOnly="true" width="120"/>
                    <a:numberField name="total_rental" allowFormat="true" bindTarget="con_contract_balance_details_header_ds" prompt="CON305.TOTAL_RENTAL" readOnly="true" width="120"/>
                    <a:numberField name="total_received" allowFormat="true" bindTarget="con_contract_balance_details_header_ds" prompt="CON305.TOTAL_RENANT_RECEIVED" readOnly="true" width="120"/>
                    <a:numberField name="total_balance" allowFormat="true" bindTarget="con_contract_balance_details_header_ds" prompt="CON305.UNRECEIVED_TOTAL_RENANT" readOnly="true" width="120"/>
                    <a:numberField name="overdue_amount" allowFormat="true" bindTarget="con_contract_balance_details_header_ds" prompt="CON305.OVERDUE_AMOUNT" readOnly="true" width="120"/>
                </a:box>
            </a:form>
            <a:grid id="con_contract_balance_details_line_grid" bindTarget="con_contract_balance_details_line_ds" marginHeight="230" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="times" prompt="CON305.TIMES" renderer="times_renderer" width="50"/>
                    <a:column name="cf_item" prompt="HLS.CF_ITEM"/>
                    <a:column name="cf_item_desc" prompt="CON305.CF_ITEM" renderer="cf_item_desc_renderer" width="80"/>
                    <a:column name="due_amount" align="right" prompt="每期租金" renderer="due_amount_renderer"/>
                    <a:column name="principal" align="right" prompt="每期本金" renderer="Leaf.formatMoney"/>
                    <a:column name="interest" align="right" prompt="每期租息" renderer="Leaf.formatMoney"/>
                    <!-- <a:column name="last_received_date" prompt="CON305.LAST_RECEIVED_DATE" renderer="last_received_date_renderer"/> -->
                    <a:column name="due_date" prompt="还款日期" renderer="due_date_renderer" width="80"/>
                    <a:column name="received_amount" align="right" prompt="还款金额" renderer="received_amount_renderer"/>
                    <a:column name="received_principal" align="right" prompt="已还本金" renderer="Leaf.formatMoney"/>
                    <a:column name="received_interest" align="right" prompt="已还利息" renderer="Leaf.formatMoney"/>
                    <a:column name="unpaid_amount" align="right" prompt="欠付租金金额" renderer="unpaid_amount_renderer"/>
                    <a:column name="outstanding_rental_tax_incld" align="right" prompt="TRE503.RESIDUE_RENTAL" renderer="Leaf.formatMoney"/>
                    <a:column name="outstanding_prin_tax_incld" align="right" prompt="TRE503.UNPAY_PRINCIPAL" renderer="Leaf.formatMoney"/>
                    <a:column name="outstanding_int_tax_incld" align="right" prompt="TRE503.UNPAY_INTEREST" renderer="Leaf.formatMoney"/>
                    <a:column name="due_date" prompt="罚息计算日" renderer="due_date_renderer" width="80"/>
                    <a:column name="unpaid_fine" align="right" prompt="未支付罚息" renderer="unpaid_fine_renderer"/>
                    <a:column name="received_fine" align="right" prompt="已支付罚息" renderer="received_fine_renderer"/>
                    <a:column name="total_amount" align="right" prompt="CON305.RECEIVED_TOTAL_AMOUNT" renderer="total_amount_renderer"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>