<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-6-24 下午1:28:49  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view package="leaf.ui.std" template="default">
        <a:link id="attachment_downloadFile_link" url="${/request/@context_path}/downloadFile.lview"/>
        <div/>
        <script type="text/javascript"><![CDATA[
            function open_attachment_window(){
                    var val = $('early_terminationDs').getAt(0).get('et_agreement_id');
	        	    var url = $('attachment_downloadFile_link').getUrl() + '?table_name=CON_CONTRACT_ET_HD&header_id=' + val;
	                var win = new Leaf.Window({
	                    url: url,
	                    title: '附件查看',
	                    id: 'approve_downloadFile_id',
	                    width: 850,
	                    height: 400
	                });
	                win.on('close', function() {
	                });    
        	}
        ]]></script>
        <a:dataSets>
            <a:dataSet id="contract_et_Screen_mainDs" autoQuery="true" model="cont.CON370.con_contract_et_hd_maintain_query" queryUrl="${/request/@context_path}/autocrud/cont.CON370.con_contract_et_hd_maintain_query/query?et_agreement_id=${/parameter/@et_agreement_id}"/>
            <a:dataSet id="early_terminationDs" autoQuery="true" model="cont.CON370.con_contract_et_hd" queryUrl="${/request/@context_path}/autocrud/cont.CON370.con_contract_et_hd/query?et_agreement_id=${/parameter/@et_agreement_id}">
                <a:fields>
                    <a:field name="deposit_deduction_flag" readOnly="true"/>
                    <a:field name="balance_deduction_flag" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="receivedAmountDs" autoQuery="true" fetchAll="true" model="cont.CON370.con_contract_received_amount" queryUrl="${/request/@context_path}/autocrud/cont.CON370.con_contract_received_amount/query?et_agreement_id=${/parameter/@et_agreement_id}"/>
            <a:dataSet id="unreceivedAmountDs" autoQuery="true" fetchAll="true" model="cont.CON370.con_contract_unreceived_amount" queryUrl="${/request/@context_path}/autocrud/cont.CON370.con_contract_unreceived_amount/query?et_agreement_id=${/parameter/@et_agreement_id}"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="open_attachment_window" text="附件查看"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="110" marginWidth="60" title="HLS.QUERY_TITLE">
                <a:textField name="contract_number" bindTarget="contract_et_Screen_mainDs" prompt="合同编码" readonly="true"/>
                <a:textField name="contract_name" bindTarget="contract_et_Screen_mainDs" prompt="合同名称" readonly="true"/>
                <a:textField name="document_type_desc" bindTarget="contract_et_Screen_mainDs" prompt="合同类型" readonly="true"/>
                <a:textField name="document_category_desc" bindTarget="contract_et_Screen_mainDs" prompt="合同类别" readonly="true"/>
                <a:textField name="bp_name" bindTarget="contract_et_Screen_mainDs" prompt="承租人名称" readonly="true"/>
                <a:textField name="contract_status_desc" bindTarget="contract_et_Screen_mainDs" prompt="合同状态" readonly="true"/>
                <a:textField name="inception_of_lease" bindTarget="contract_et_Screen_mainDs" prompt="起租日期" readonly="true"/>
                <a:lov name="et_type_desc" bindTarget="contract_et_Screen_mainDs" prompt="提前结清类型" readonly="true"/>
                <a:lov name="et_profile_desc" bindTarget="contract_et_Screen_mainDs" prompt="提前结清规则" readonly="true"/>
                <a:textField name="overdue_status" bindTarget="contract_et_Screen_mainDs" prompt="是否逾期" readonly="true"/>
                <a:datePicker name="termination_date" bindTarget="contract_et_Screen_mainDs" prompt="提前结清日" readonly="true" renderer="Leaf.formatDate"/>
            </a:form>
            <div id="detail_flag_id">
                <a:form title="提前结清信息">
                    <a:form column="5" labelWidth="110" marginWidth="60">
                        <a:numberField name="overdue_amount" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="逾期租金" readOnly="true"/>
                        <a:numberField name="overdue_principal" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="逾期本金" readOnly="true"/>
                        <a:numberField name="overdue_interest" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="逾期利息" readOnly="true"/>
                        <a:numberField name="penalty" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="罚息" readOnly="true"/>
                        <a:numberField name="et_fee" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="多退少补金额" readOnly="true"/>
                        <a:numberField name="undue_amount" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="未到期租金" readOnly="true"/>
                        <a:numberField name="undue_principal" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="未到期本金" readOnly="true"/>
                        <a:numberField name="undue_interest" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="未到期利息" readOnly="true"/>
                        <a:numberField name="residual_value" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="留购金" readOnly="true"/>
                        <a:numberField name="ref_n05" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="退还保证金" readOnly="true"/>
                        <a:numberField name="ref_n06" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="未收牌照费" readOnly="true"/>
                        <a:numberField name="ref_n07" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="已支出拖车费" readOnly="true"/>
                        <a:numberField name="ref_n08" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="未支付保险费" readOnly="true"/>
                        <a:numberField name="ref_n09" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="未收手续费" readOnly="true"/>
                        <a:numberField name="et_total_amount" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="提前结清费用合计" readOnly="true"/>
                        <a:numberField name="others_fee" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="其它费用" readOnly="true"/>
                        <a:textField name="note" bindTarget="early_terminationDs" prompt="其它费用说明" readOnly="true"/>
                        <a:checkBox name="deposit_deduction_flag" bindTarget="early_terminationDs" prompt="是否抵扣保证金"/>
                        <a:checkBox name="balance_deduction_flag" bindTarget="early_terminationDs" prompt="是否抵扣多退少补"/>
                        <a:numberField name="total_amount" allowDecimals="true" allowFormat="true" bindTarget="early_terminationDs" decimalPrecision="2" prompt="扣除其它费用合计" readOnly="true"/>
                    </a:form>
                    <a:tabPanel marginHeight="400" marginWidth="60">
                        <a:tabs>
                            <a:tab prompt="未收金额" width="110">
                                <a:grid bindTarget="unreceivedAmountDs" marginHeight="430" marginWidth="100" navBar="true">
                                    <a:columns>
                                        <a:column name="times" prompt="期数"/>
                                        <a:column name="cf_type_dis" prompt="类型"/>
                                        <a:column name="due_amount" align="right" prompt="应收金额" renderer="Leaf.formatMoney"/>
                                        <a:column name="received_amount" align="right" prompt="已收金额" renderer="Leaf.formatMoney"/>
                                        <a:column name="due_date" prompt="预定支付日期"/>
                                        <a:column name="principal" align="right" prompt="本金" renderer="Leaf.formatMoney"/>
                                        <a:column name="interest" align="right" prompt="利息" renderer="Leaf.formatMoney"/>
                                        <a:column name="cf_status_dis" prompt="现金流状态"/>
                                    </a:columns>
                                </a:grid>
                            </a:tab>
                            <a:tab prompt="已收金额" width="110">
                                <a:grid bindTarget="receivedAmountDs" marginHeight="430" marginWidth="100" navBar="true">
                                    <a:columns>
                                        <a:column name="times" prompt="期数"/>
                                        <a:column name="cf_type_dis" prompt="类型"/>
                                        <a:column name="due_amount" align="right" prompt="应收金额" renderer="Leaf.formatMoney"/>
                                        <a:column name="received_amount" align="right" prompt="未收金额" renderer="Leaf.formatMoney"/>
                                        <a:column name="due_date" prompt="预定支付日期"/>
                                        <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="cf_status_dis" prompt="现金流状态"/>
                                    </a:columns>
                                </a:grid>
                            </a:tab>
                        </a:tabs>
                    </a:tabPanel>
                </a:form>
            </div>
        </a:screenBody>
    </a:view>
</a:screen>
