<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Eugene Song
    $Date: 2018年8月24日14:28:51
    $Revision: 1.0
    $Purpose: 保证金管理
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true"
                       model="basic.csh_payment_method_for_lov" rootPath="payment_method_path"/>
    </a:init-procedure>

    <a:view>
        <a:link id="csh1000_deducate_detail_link"
                url="${/request/@context_path}/modules/csh/CSH710N/csh_deduction_detail_n.lview"/>
        <a:link id="csh_payment_req_create_link"
                url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_selected.lview"/>
        <a:link id="csh_deposit_detail_link"
                url="${/request/@context_path}/modules/csh/CSH1000/csh_deposit_source.lview"/>
        <a:link id="csh_deposit_agent_detail_link"
                url="${/request/@context_path}/modules/csh/CSH1000/csh_agent_deposit_source.lview"/>

        <!--<a:link id="csh_transaction_receipt_write_off_detail_link"
                url="${/request/@context_path}/modules/csh/CSH513/csh_transaction_receipt_write_off_detail.lview"/>-->
        <a:link id="csh_transaction_return_link"
                url="${/request/@context_path}/modules/csh/CSH1000/csh_deposit_return.lview"/>
        <a:link id="csh_deposit_pool_detail_link"
                url="${/request/@context_path}/modules/csh/CSH1000/csh_deposit_pool_source.lview"/>

        <a:link id="csh_transaction_receipt_write_off_detail_link"
                url="${/request/@context_path}/modules/csh/CSH531N/csh_write_off_interface.lview"/>


        <a:link id="csh560_check_wfl_link" model="csh.CSH560.return_workflow_start" modelaction="query"/>
        <a:link id="csh515_get_layout_link" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="csh515_amount_return_link" url="${/request/@context_path}/modules/csh/CSH515/csh_amount_return.lview"/>

        <script type="text/javascript"><![CDATA[

        function csh_deposit_query() {
            $('csh_deposit_pool_ds').query();
            $('csh_deposit_ds').query();
            $('csh_agent_deposit_ds').query();
            $('csh_deposit_purpose_ds').query();
        }

        function csh_deposit_reset() {
            $('csh_deposit_pool_query_ds').reset();
            $('csh_deposit_query_ds').reset();
            $('csh_agent_deposit_query_ds').reset();
            $('csh_deposit_purpose_query_ds').reset();
        }

        function detail_function(value, record, name) {
            return '<a href="javascript:detail_window(' + record.get('outflow_id') + ',' + record.get('inflow_id') + ');">明细</a>';
        }


        function detail_window(outflow_id, inflow_id) {

            var win = new Leaf.Window({
                id: 'csh_deposit_detail_winid',
                params: {
                    outflow_id: outflow_id,
                    inflow_id: inflow_id,
                    winid: 'csh_deposit_detail_winid'
                },
                url: $('csh_deposit_detail_link').getUrl(),
                title: '来源用途明细',
                fullScreen: true
            });
            win.on('close', function () {
                csh_deposit_query();
            });

        }

        function agent_detail_function(value, record, name){
            return '<a href="javascript:agent_detail_window(' + record.get('outflow_id') + ',' + record.get('inflow_id') + ');">明细</a>';
        }

        function agent_detail_window(outflow_id, inflow_id) {

            var win = new Leaf.Window({
                id: 'csh_deposit_agent_detail_winid',
                params: {
                    outflow_id: outflow_id,
                    inflow_id: inflow_id,
                    winid: 'csh_deposit_agent_detail_winid'
                },
                url: $('csh_deposit_agent_detail_link').getUrl(),
                title: '来源用途明细',
                fullScreen: true
            });
            win.on('close', function () {
                csh_deposit_query();
            });

        }


        function deduction_function(value, record, name) {
            return '<a href="javascript:deduction_window(' + record.get('outflow_id') + ',\'' + record.get('bp_id') + '\',\'' + record.get('contract_number') + '\');">抵扣</a>';

        }

        function deduction_window(cashflow_id, bp_id, contract_number) {
            var win = new Leaf.Window({
                id: 'csh710n_deducate_detail_link',
                params: {
                    bp_id: bp_id,
                    contract_number: contract_number,
                    cashflow_id: cashflow_id,
                    winid: 'csh710n_deducate_detail_link'
                },
                url: $('csh1000_deducate_detail_link').getUrl(),
                title: '${l:CSH710.PAYMENT_DECUCATE}',
                fullScreen: true
            });
            win.on('close', function () {
                csh_deposit_query();
            });
        }


        function refund_function(value, record, name) {
            return '<a href="javascript:refund_window(' + record.get('outflow_id') + ');">退款</a>';
        }

        function refund_window(outflow_id) {

            var url = $('csh_payment_req_create_link').getUrl();
            var win = new Leaf.Window({
                url: url,
                params: {
                    winid: 'csh_payment_req_create_win_id',
                    outflow_id: outflow_id
                },
                title: '付款申请页面',
                id: 'csh_payment_req_create_win_id',
                fullScreen: true
            });
            win.on('close', function () {
                csh_deposit_query();
            });


        }


        function detail_pool_function(value, record, name) {
            return '<a href="javascript:detail_pool_window(' + record.get('transaction_id') + ');">明细</a>';
        }

        function detail_pool_window(transaction_id){
            var win = new Leaf.Window({
                id: 'csh_deposit_pool_detail_winid',
                params: {
                    transaction_id: transaction_id,
                    winid: 'csh_deposit_pool_detail_winid'
                },
                url: $('csh_deposit_pool_detail_link').getUrl(),
                title: '来源用途明细',
                fullScreen: true
            });
            win.on('close', function () {
                csh_deposit_query();
            });
        }


        function deduction_pool_function(value, record, name) {

            //url = $('csh_transaction_receipt_write_off_detail_link').getUrl() + '?transaction_id=' + record.get('transaction_id') + '&transaction_date=' + record.get('transaction_date') + '&bp_id1=${/parameter/@bp_id}' + '&transaction_type=' + record.get('transaction_type') + '&auto_filt_penalty=N&auto_filt_prinicipal_interest=Y&bp_limit_flag=${/parameter/@bp_limit_flag}';

            return '<a href="javascript:deduction_pool_window(\''  + record.id + '\');">抵扣</a>';
        }

        function deduction_pool_window(id) {




            /*var limit_flag = '${/parameter/@limit_flag}' || 'N';
            var limit2_flag = '${/parameter/@limit2_flag}' || 'N';
            new Leaf.Window({
                id: 'receipt_write_off_detail_link_winid',
                params: {
                    winId: 'receipt_write_off_detail_link_winid',
                    limit_flag: limit_flag,
                    limit2_flag: limit2_flag
                },
                url: url,
                title: '${l:CSH513.CSH_RECEIPT_WRITE_OFF}',
                fullScreen: true
            }).on('close', function () {
                csh_deposit_query();
            });*/


            var ds = $('csh_deposit_pool_ds');
            var record = ds.findById(id);

            var win = new Leaf.Window({
                id: 'receipt_write_off_detail_link_winid',
                params: {
                    transaction_id: record.get('transaction_id'),
                    bank_slip_num: record.get('bank_slip_num'),
                    company_id: record.get('company_id'),
                    transaction_date: Leaf.formatDate(record.get('transaction_date')),
                    internal_period_num: record.get('internal_period_num'),
                    period_name: record.get('period_name'),
                    bp_bank_account_num: record.get('bp_bank_account_num'),
                    bp_bank_account_name: record.get('bp_bank_account_name'),
                    bp_id: record.get('bp_id'),
                    winid: 'receipt_write_off_detail_link_winid'
                },
                url: $('csh_transaction_receipt_write_off_detail_link').getUrl(),
                title: '明细',
                fullScreen: true
            });

            win.on('close', function () {
                ds.query(ds.currentPage);
            });



        }

        function refund_pool_function(value, record, name) {

            return '<a href="javascript:refund_pool_window();">退款</a>';

        }

        function refund_pool_window() {

            /*new Leaf.Window({
                id: 'csh_transaction_return_window',
                url: $('csh_transaction_return_link').getUrl(),
                params: {
                    winId: 'csh_transaction_return_window'
                },
                title: '${l:CSH515.CSH_REFUND}',
                fullScreen: true
            });*/

            var record = $('csh_deposit_pool_ds').getCurrentRecord();
            var transaction_id = record.get('transaction_id');
            var returned_amount = record.get('returned_amount')||0;
            var write_off_amount = record.get('write_off_amount')||0;
            var transaction_amount = record.get('transaction_amount')||0;
            var bp_id = record.get('bp_id');
            var remain_total_amount = record.get('remain_total_amount');
            Leaf.request({
                url: $('csh560_check_wfl_link').getUrl(),
                para: {
                    bp_id: bp_id
                },
                success: function(res) {
                    var check_flag = res.result.record.check_flag;
                    if (check_flag == 'Y' || check_flag == 'D'){
                        Leaf.showMessage('提示','已经有工作流在审批中');
                    }else{
                        if (transaction_amount <=0){
                            Leaf.showMessage('提示','该笔收款没有金额可以被退还');
                            return;
                        }
                        var param = record.data;
                        param['function_code'] = 'CSH560R';
                        param['url_title'] = '收款退款';
                        param['bp_id'] = bp_id;
                        param['transaction_id'] = transaction_id;
                        param['write_off_amount'] = write_off_amount;
                        param['returned_amount'] = returned_amount;
                        param['transaction_amount'] = transaction_amount;
                        param['remain_total_amount'] = remain_total_amount;
                        param['winid'] = 'csh515_amount_return_winid';
                        hls_doc_get_layout_code('csh515_get_layout_link', param, 'csh515_amount_return_link', 'csh_deposit_pool_ds');
                    }
                },
                error: function(res) {
                },
                faliure: function() {
                },
                scope: this
            });










        }

        function onLoad_csh515_receipt_post(ds) {
            var record = ds.getCurrentRecord();
            if (record) {
                record.getField('bp_bank_account_code').setLovPara('bp_id', record.get('bp_id'));
            }
        }

        function csh_deposit_pool_import() {
            $('csh_deposit_pool')._export(null,'保证金池');
        }

        function bp_csh_deposit_import() {
            $('bp_csh_deposit')._export(null,'客户保证金');
        }

        function csh_agent_deposit_import() {
            $('csh_agent_deposit')._export(null,'代理商代付客户保证金');
        }

        function csh_deposit_purpose_import() {
            $('csh_deposit_purpose')._export(null,'保证金用途明细查询');
        }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="payment_method_ds">
                <a:datas dataSource="/model/payment_method_path"/>
            </a:dataSet>

            <a:dataSet id="deposit_type_ds">
                <a:datas>
                    <a:record code_value="保证金池" code_value_name="保证金池"/>
                    <a:record code_value="客户保证金" code_value_name="客户保证金"/>
                    <a:record code_value="代理商代付客户保证金" code_value_name="代理商代付客户保证金"/>
                </a:datas>
            </a:dataSet>
            <a:dataSet id="write_off_type_ds_1">
                <a:datas>
                    <a:record code_value="(抵扣记录:保证金池核销债权)" code_value_name="(抵扣记录:保证金池核销债权)"/>
                    <a:record code_value="(退款记录:保证金池退款)" code_value_name="(退款记录:保证金池退款)"/>
                    <a:record code_value="核销为保证金池" code_value_name="核销为保证金池"/>
                    <a:record code_value="(抵扣记录:应付客户保证金的抵扣)" code_value_name="(抵扣记录:应付客户保证金的抵扣)"/>
                    <a:record code_value="(退款记录:应付客户保证金的支付)" code_value_name="(退款记录:应付客户保证金的支付)"/>
                    <a:record code_value="核销为客户保证金" code_value_name="核销为客户保证金"/>
                    <a:record code_value="(抵扣记录:代理商代付应付客户保证金的抵扣)" code_value_name="(抵扣记录:代理商代付应付客户保证金的抵扣)"/>
                    <a:record code_value="(退款记录:代理商代付应付客户保证金的支付)" code_value_name="(退款记录:代理商代付应付客户保证金的支付)"/>
                    <a:record code_value="核销为代理商代付客户保证金" code_value_name="核销为代理商代付客户保证金"/>
                </a:datas>
            </a:dataSet>
            <a:dataSet id="cf_item_ds">
                <a:datas>
                    <a:record code_value="51" code_value_name="保证金"/>
                    <a:record code_value="52" code_value_name="保证金退还"/>
                    <a:record code_value="508" code_value_name="代理商代付客户保证金"/>
                    <a:record code_value="509" code_value_name="代理商代付客户保证金退还"/>
                </a:datas>
            </a:dataSet>


            <a:dataSet id="csh_deposit_pool_query_ds">
                <a:fields>
                    <a:field name="agent_name"/>
                    <a:field name="agent_code"/>
                </a:fields>
            </a:dataSet>

            <a:dataSet id="csh_deposit_query_ds">
                <a:fields>
                    <a:field name="contract_number"/>
                    <a:field name="contract_name"/>
                </a:fields>
            </a:dataSet>


            <a:dataSet id="csh_agent_deposit_query_ds">
                <a:fields>
                    <a:field name="agent_name"/>
                    <a:field name="agent_code"/>
                    <a:field name="contract_number"/>
                    <a:field name="contract_name"/>
                </a:fields>
            </a:dataSet>

            <a:dataSet id="csh_deposit_purpose_query_ds">
                <a:fields>
                    <a:field name="deposit_type" displayField="code_value_name" options="deposit_type_ds"
                             returnField="deposit_type" valueField="code_value"/>
                    <a:field name="write_off_type" displayField="code_value_name" options="write_off_type_ds_1"
                             returnField="write_off_type" valueField="code_value"/>
                    <a:field name="cf_item_n" displayField="code_value_name" options="cf_item_ds" returnField="cf_item"
                             valueField="code_value"/>
                    <a:field name="cf_item"/>
                </a:fields>
            </a:dataSet>

            <!-- 保证金池 -->
            <a:dataSet id="csh_deposit_pool_ds" autoQuery="false" model="csh.CSH1000.csh_deposit_pool"
                       queryDataSet="csh_deposit_pool_query_ds" selectable="true">
                <a:fields>
                    <a:field name="payment_method_display" displayField="description" options="payment_method_ds"
                             returnField="payment_method_id" valueField="payment_method_id"/>
                    <a:field name="bank_account_code" autoComplete="true" autoCompleteField="bank_account_num"
                             lovGridHeight="350" lovHeight="550" lovLabelWidth="90"
                             lovService="csh.CSH101.csh_bank_account_lov" lovWidth="580"
                             title="CSH511.BANK_ACCOUNT_CODE">
                        <a:mapping>
                            <a:map from="precision" to="precision"/>
                            <a:map from="bank_account_id" to="bank_account_id"/>
                            <a:map from="bank_account_num" to="bank_account_num"/>
                            <a:map from="bank_account_name" to="bank_account_name"/>
                            <a:map from="bank_account_code" to="bank_account_code"/>
                            <a:map from="currency_code" to="currency_code"/>
                            <a:map from="currency_name" to="currency_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_bank_account_code" autoComplete="true" autoCompleteField="bank_account_num"
                             lovGridHeight="350" lovHeight="550" lovLabelWidth="90"
                             lovService="basic.hls_bp_master_bank_account_v_for_lov?enabled_flag=Y&amp;bp_enabled_flag=Y"
                             lovWidth="580" title="CSH511.BANK_ACCOUNT_CODE">
                        <a:mapping>
                            <a:map from="bank_account_id" to="bp_bank_account_id"/>
                            <a:map from="bank_account_num" to="bp_bank_account_num"/>
                            <a:map from="bank_account_name" to="bp_bank_account_name"/>
                            <a:map from="bank_account_code" to="bp_bank_account_code"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="onLoad_csh515_receipt_post"/>
                </a:events>

            </a:dataSet>
            <!-- 客户保证金 -->
            <a:dataSet id="csh_deposit_ds" autoQuery="false" model="csh.CSH1000.csh_deposit"
                       queryDataSet="csh_deposit_query_ds" selectable="true">

            </a:dataSet>
            <!-- 代理商代付客户保证金 -->
            <a:dataSet id="csh_agent_deposit_ds" autoQuery="false" model="csh.CSH1000.csh_agent_deposit"
                       queryDataSet="csh_agent_deposit_query_ds"
                       selectable="true">

            </a:dataSet>
            <!-- 保证金用途 -->
            <a:dataSet id="csh_deposit_purpose_ds" autoQuery="false" model="csh.CSH1000.csh_deposit_purpose"
                       queryDataSet="csh_deposit_purpose_query_ds"
                       selectable="true">
                <a:fields>
                    <a:field name="write_off_date" datatype="date"/>
                </a:fields>
            </a:dataSet>


        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="csh_deposit_query" text="HLS.QUERY"/>
                <a:gridButton click="csh_deposit_reset" text="HLS.RESET"/>
            </a:screenTopToolbar>
            <a:tabPanel marginHeight="80" marginWidth="30">
                <a:tabs>
                    <a:tab prompt="保证金池" width="150">
                        <a:form column="4" marginWidth="90" title="查询条件">
                            <a:textField name="agent_name" bindTarget="csh_deposit_pool_query_ds" prompt="代理商名称"/>
                            <a:textField name="agent_code" bindTarget="csh_deposit_pool_query_ds" prompt="代理商编码"/>
                            <a:numberField name="balance_amount_from" bindTarget="csh_deposit_pool_query_ds" prompt="保证金池总余额从"/>
                            <a:numberField name="balance_amount_to" bindTarget="csh_deposit_pool_query_ds" prompt="保证金池总余额到"/>
                        </a:form>
                        <a:grid id = "csh_deposit_pool" bindTarget="csh_deposit_pool_ds" marginHeight="220" marginWidth="90" navBar="true">
                            <a:toolBar>
                                <a:button click="csh_deposit_pool_import" text="导出"/>
                            </a:toolBar>
                            <a:columns>
                                <a:column name="agent_name" prompt="代理商名称" width="200"/>
                                <a:column name="agent_code" prompt="代理商编码" width="150"/>
                                <a:column name="transaction_amount" prompt="发生总额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="deduction_amount" prompt="抵扣总额" width="150"
                                          align="right" renderer="Leaf.formatMoney"/>
                                <a:column name="refund_amount" prompt="退款总额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="balance_amount" prompt="保证金池总余额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="balance_amount_5" prompt="5%余额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="detail" align="center" prompt="来源用途明细" renderer="detail_pool_function"
                                          width="100"/>
                                <a:column name="deduction" align="center" prompt="抵扣操作"
                                          renderer="deduction_pool_function"
                                          width="100"/>
                                <a:column name="refund" align="center" prompt="退款操作" renderer="refund_pool_function"
                                          width="100"/>
                            </a:columns>
                        </a:grid>
                    </a:tab>

                    <a:tab prompt="客户保证金" width="150">
                        <a:form column="3" marginWidth="90" title="查询条件">
                            <a:textField name="agent_name" bindTarget="csh_deposit_query_ds" prompt="代理商名称"/>
                            <a:textField name="contract_number" bindTarget="csh_deposit_query_ds" prompt="合同编号"/>
                            <a:textField name="tenant_name" bindTarget="csh_deposit_query_ds" prompt="客户名称"/>
                            <a:numberField name="balance_amount_from" bindTarget="csh_deposit_query_ds" prompt="余额从"/>
                            <a:numberField name="balance_amount_to" bindTarget="csh_deposit_query_ds" prompt="余额到"/>
                        </a:form>
                        <a:grid id="bp_csh_deposit" bindTarget="csh_deposit_ds" marginHeight="220" marginWidth="90" navBar="true">
                            <a:toolBar>
                                <a:button click="bp_csh_deposit_import" text="导出"/>
                            </a:toolBar>
                            <a:columns>
                                <a:column name="contract_number" prompt="合同编号" width="150"/>
                                <a:column name="tenant_name" prompt="客户名称" width="250"/>
                                <a:column name="finance_amount" prompt="融资额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>0
                                <a:column name="agent_name" prompt="代理商" width="250"/>
                                <a:column name="deposit" prompt="发生总额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="deduction_amount" prompt="抵扣总额" width="150"
                                          align="right" renderer="Leaf.formatMoney"/>
                                <a:column name="refund_amount" prompt="退款总额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="balance_amount" prompt="余额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="detail" align="center" prompt="来源用途明细" renderer="detail_function"
                                          width="100"/>
                                <a:column name="deduction" align="center" prompt="抵扣操作" renderer="deduction_function"
                                          width="100"/>
                                <a:column name="refund" align="center" prompt="退款操作" renderer="refund_function"
                                          width="100"/>
                            </a:columns>
                        </a:grid>
                    </a:tab>
                    <a:tab prompt="代理商代付客户保证金" width="150">
                        <a:form column="3" marginWidth="90" title="查询条件">
                            <a:textField name="agent_name" bindTarget="csh_agent_deposit_query_ds" prompt="代理商名称"/>
                            <a:textField name="contract_number" bindTarget="csh_agent_deposit_query_ds" prompt="合同编号"/>
                            <a:textField name="tenant_name" bindTarget="csh_agent_deposit_query_ds" prompt="客户名称"/>
                            <a:numberField name="balance_amount_from" bindTarget="csh_agent_deposit_query_ds" prompt="余额从"/>
                            <a:numberField name="balance_amount_to" bindTarget="csh_agent_deposit_query_ds" prompt="余额到"/>
                        </a:form>
                        <a:grid id="csh_agent_deposit" bindTarget="csh_agent_deposit_ds" marginHeight="220" marginWidth="90" navBar="true">
                            <a:toolBar>
                                <a:button click="csh_agent_deposit_import" text="导出"/>
                            </a:toolBar>
                            <a:columns>
                                <a:column name="contract_number" prompt="合同编号" width="150"/>
                                <a:column name="tenant_name" prompt="客户名称" width="250"/>
                                <a:column name="finance_amount" prompt="融资额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="agent_name" prompt="代理商" width="250"/>
                                <a:column name="deposit" prompt="发生总额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="deduction_amount" prompt="抵扣总额" width="150"
                                          align="right" renderer="Leaf.formatMoney"/>
                                <a:column name="refund_amount" prompt="退款总额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="balance_amount" prompt="余额" width="150" align="right"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="detail" align="center" prompt="来源用途明细" renderer="agent_detail_function"
                                          width="100"/>
                                <a:column name="deduction" align="center" prompt="抵扣操作" renderer="deduction_function"
                                          width="100"/>
                                <a:column name="refund" align="center" prompt="退款操作" renderer="refund_function"
                                          width="100"/>
                            </a:columns>
                        </a:grid>
                    </a:tab>
                    <a:tab prompt="保证金用途明细查询" width="150">
                        <a:form column="4" marginWidth="90" title="查询条件">
                            <a:comboBox name="deposit_type" bindTarget="csh_deposit_purpose_query_ds" prompt="保证金类型"/>
                            <a:comboBox name="write_off_type" bindTarget="csh_deposit_purpose_query_ds" prompt="核销类型"/>
                            <a:textField name="contract_number" bindTarget="csh_deposit_purpose_query_ds"
                                         prompt="合同编号"/>
                            <a:textField name="agent_name" bindTarget="csh_deposit_purpose_query_ds" prompt="代理商名称"/>
                            <!--<a:datePicker name="write_off_date" bindTarget="csh_deposit_purpose_query_ds"
                                          prompt="核销日期"/>-->
                            <a:datePicker name="write_off_date_from" bindTarget="csh_deposit_purpose_query_ds"
                                          prompt="核销日期从"/>
                            <a:datePicker name="write_off_date_to" bindTarget="csh_deposit_purpose_query_ds"
                                          prompt="核销日期到"/>
                            <a:numberField name="write_off_due_amount" bindTarget="csh_deposit_purpose_query_ds"
                                           prompt="核销金额"/>
                            <a:textField name="bp_name" bindTarget="csh_deposit_purpose_query_ds" prompt="退款/核销对象"/>
                            <a:comboBox name="cf_item_n" bindTarget="csh_deposit_purpose_query_ds" prompt="现金流项目"/>
                        </a:form>
                        <a:grid id="csh_deposit_purpose" bindTarget="csh_deposit_purpose_ds" marginHeight="260" marginWidth="90" navBar="true">
                            <a:toolBar>
                                <a:button click="csh_deposit_purpose_import" text="导出"/>
                            </a:toolBar>
                            <a:columns>
                                <a:column name="deposit_type" prompt="保证金类型" width="100"/>
                                <a:column name="write_off_type" prompt="核销类型" width="200"/>
                                <a:column name="write_off_classification_n" align="center" prompt="核销分类" width="100"/>
                                <a:column name="agent_name" prompt="代理商名称" width="200"/>
                                <a:column name="write_off_date" prompt="核销日期" align="center"
                                          renderer="Leaf.formatDate"/>
                                <a:column name="write_off_due_amount" align="right" prompt="核销金额" width="150"
                                          renderer="Leaf.formatMoney"/>
                                <a:column name="bp_name" prompt="退款/核销对象" width="250"/>
                                <a:column name="contract_number" prompt="合同号" width="150"/>
                                <a:column name="times" prompt="期项" align="center" width="80"/>
                                <a:column name="cf_item_n" align="center" prompt="现金流项目" width="80"/>
                                <a:column name="description" prompt="核销备注" width="150"/>
                            </a:columns>
                        </a:grid>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
        </a:screenBody>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>

    </a:view>
</a:screen>