<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-10-30 上午09:26:31  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="con_contract_payment_precondition_cdd_link_id" url="${/request/@context_path}/modules/cont/CON210/con_contract_payment_precondition_cdd.lview"/>
        <script type="text/javascript"><![CDATA[
            function payment_precondition_detail_clear() {
                $('con_contract_payment_precondition_detail_grid_id').clear();
            }
            
            function payment_precondition_detail_query() {
                $('con_contract_payment_precondition_detail_result_ds').query();
            }
            
            function see_payment_precondition_detail(value, record, name) {
                return '<a href="javascript:payment_precondition_detail_window(' + record.get('cashflow_id') + ',\'' + record.get('write_off_flag') + '\');">' + '${l:CON210.CON_CONTRACT_PAYMENT_PRECONDITION_DETAIL}' + '</a>';
            }
            
            function payment_precondition_detail_window(cashflow_id, write_off_flag) {
                new Leaf.Window({
                    id: 'con_contract_payment_precondition_cdd_winid',
                    url: $('con_contract_payment_precondition_cdd_link_id').getUrl(),
                    params: {
                        cashflow_id: cashflow_id,
                        contract_id: '${/parameter/@contract_id}',
                        project_id : '${/parameter/@project_id}',
                        write_off_flag: write_off_flag,
                        winid: 'con_contract_payment_precondition_cdd_winid'
                    },
                    title: '${l:CON210.CON_CONTRACT_PAYMENT_PRECONDITION_DEFINE_DETAIL}',
                    width: 700,
                    height: 450
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="con_contract_payment_precondition_detail_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="contract_id" defaultValue="${/parameter/@contract_id}"/>
                    <a:field name="cf_direction" defaultValue="OUTFLOW"/>
                    <a:field name="cf_item" defaultValue="109"/>
                    <a:field name="cf_type" defaultValue="109"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con_contract_payment_precondition_detail_result_ds" autoQuery="true" model="cont.CON500.con_contract_cashflow_v" queryDataSet="con_contract_payment_precondition_detail_query_ds" selectable="true"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="payment_precondition_detail_query" text="HLS.QUERY"/>
                <a:gridButton click="payment_precondition_detail_clear" text="HLS.CLEAR"/>
            </a:screenTopToolbar>
            <a:grid id="con_contract_payment_precondition_detail_grid_id" bindTarget="con_contract_payment_precondition_detail_result_ds" height="350" navBar="true" width="500">
                <a:columns>
                    <a:column name="due_amount" align="right" prompt="CON210.PAYMENT_PRECONDITION_DUE_AMOUNT" renderer="Leaf.formatNumber"/>
                    <a:column name="due_date" align="center" prompt="CON210.PAYMENT_PRECONDITION_DUE_DATE" renderer="Leaf.formatDate"/>
                    <a:column name="payment_precondition_status" align="center" prompt="HLS.STATUS"/>
                    <a:column name="payment_precondition_detail" align="center" prompt="CON210.CON_CONTRACT_PAYMENT_PRECONDITION" renderer="see_payment_precondition_detail"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
