<?xml version="1.0" encoding="UTF-8"?>

<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="v.code=&apos;PENALTY_REDUCTION&apos;" fetchAll="true" model="basic.sys_code_default_value" rootPath="penalty_reduction_ds_path"/>
        <a:model-query defaultWhereClause="v.code=&apos;PENALTY_ACTIVE_FLAG&apos;" fetchAll="true" model="basic.sys_code_default_value" rootPath="active_flag_ds_path"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        function hand_fees_query() {
            $('hand_fees_grid_ds').query();
        }

        function hand_fees_reset(){
            $('hand_fees_form_ds').reset();
        }

        function hand_fees_export() {
            $('source_to_grid')._export(null,'罚息减免明细');
        }


        ]]></script>
        <a:dataSet id="contract_status_ds" lookupCode="CON500_CONTRACT_STATUS"/>
        <a:dataSet id="penalty_reduction_ds">
            <a:datas dataSource="/model/penalty_reduction_ds_path"/>
        </a:dataSet>
        <a:dataSet id="active_flag_ds">
            <a:datas dataSource="/model/active_flag_ds_path"/>
        </a:dataSet>
        <a:dataSets>
            <a:dataSet id="hand_fees_form_ds">
                <a:fields>
                    <a:field name="penalty_reduction_n" displayField="code_value_name" options="penalty_reduction_ds" returnField="penalty_reduction" valueField="code_value"/>
                    <a:field name="penalty_reduction" />
                    <a:field name="active_flag_n" displayField="code_value_name" options="active_flag_ds" returnField="active_flag" valueField="code_value"/>
                    <a:field name="active_flag" />
                    <a:field name="contract_status_n" displayField="code_value_name" options="contract_status_ds" returnField="contract_status" valueField="code_value"/>
                    <a:field name="__async__"  defaultValue="Y" prompt="异步导出"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hand_fees_grid_ds"
                       model="cont.CON1330.con_waiver_details"
                       queryDataSet="hand_fees_form_ds" selectable="true" selectionModel="single">
            </a:dataSet>
        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hand_fees_query" text="查询"/>
                <a:gridButton click="hand_fees_reset" text="重置"/>
                <a:gridButton click="hand_fees_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="100" title="查询条件">
                <a:textField name="contract_number" bindTarget="hand_fees_form_ds" prompt="合同编号"/>
                <a:textField name="bp_name" bindTarget="hand_fees_form_ds" prompt="客户名称"/>
                <a:textField name="bp_agent_name" bindTarget="hand_fees_form_ds" prompt="代理商名称"/>
                <a:datePicker name="base_date_from" bindTarget="hand_fees_form_ds" prompt="减免日期从" />
                <a:datePicker name="base_date_to" bindTarget="hand_fees_form_ds" prompt="减免日期到" />
                <a:comboBox name="penalty_reduction_n" bindTarget="hand_fees_form_ds" prompt="减免类型" />
                <a:numberField name="reduce_amount_total_from" bindTarget="hand_fees_form_ds" prompt="减免金额从"/>
                <a:numberField name="reduce_amount_total_to" bindTarget="hand_fees_form_ds" prompt="减免金额到"/>
                <a:textField name="created_by_n" bindTarget="hand_fees_form_ds" prompt="创建人"/>
                <a:comboBox name="active_flag_n" bindTarget="hand_fees_form_ds" prompt="操作状态" />
            </a:form>
            <a:grid id="source_to_grid" bindTarget="hand_fees_grid_ds" navBar="true" height="400" marginWidth="100">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="130"/>
                    <a:column name="bp_code" prompt="客户编号" width="100"/>
                    <a:column name="bp_name"  prompt="客户名称" width="100" />
                    <a:column name="bp_agent_code"  prompt="代理商编号" width="100"/>
                    <a:column name="bp_agent_name"  prompt="代理商名称" width="100"/>
                    <a:column name="division_n"  prompt="产品线" width="100" />
                    <a:column name="lease_channel_n"  prompt="商业模式" width="100"/>
                    <a:column name="business_type_n"  prompt="租赁类型" width="150"/>
                    <a:column name="pattern"  prompt="机型" width="150"/>
                    <a:column name="machine_number"  prompt="机号" width="150"/>
                    <a:column name="equipment_number"  prompt="装备号" width="150"/>
                    <a:column name="penalty_reduction_n"  prompt="减免类型" width="150"/>
                    <a:column name="base_date"  prompt="减免日期" width="200" renderer="Leaf.formatDate"/>
                    <a:column name="reduce_amount_total"  prompt="减免金额" width="150" renderer="Leaf.formatMoney"/>
                    <a:column name="reduce_amount_total_ratio"  prompt="减免比例" width="150"/>
                    <a:column name="created_by_n"  prompt="创建人" width="150"/>
                    <a:column name="penalty_batch_number"  prompt="减免批次号" width="150"/>
                    <a:column name="active_flag_n"  prompt="操作状态" width="150"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
