<?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 model="basic.get_sys_default_time" rootPath="sys_default_time"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        function month_finance_query() {
            $('month_finance_grid_ds').query();
        }

        function month_finance_reset(){
            $('month_finance_form_ds').reset();
        }

        function month_finance_export() {
            $('source_to_grid')._export(null,'到期款明细');
        }

        ]]></script>

        <a:dataSets>
            <a:dataSet id="month_finance_form_ds">
                <a:fields>
                    <a:field name="select_year" defaultValue="${/model/sys_default_time/record/@now_year}"/>
                    <a:field name="__async__"  defaultValue="Y" prompt="异步导出"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="month_finance_grid_ds" autoQuery="false"
                       model="cont.CON1280.con_maturity_query"
                       queryDataSet="month_finance_form_ds" selectable="true" selectionModel="single">
            </a:dataSet>
        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="month_finance_query" text="查询"/>
                <a:gridButton click="month_finance_reset" text="重置"/>
                <a:gridButton click="month_finance_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="100" title="查询条件">
                <a:textField name="contract_number" bindTarget="month_finance_form_ds" prompt="合同编号" />
                <a:textField name="bp_agent_name" bindTarget="month_finance_form_ds" prompt="代理商名称" />
                <a:datePicker name="lease_execution_date_from" bindTarget="month_finance_form_ds" prompt="执行日期从"  />
                <a:datePicker name="lease_execution_date_to" bindTarget="month_finance_form_ds" prompt="执行日期到"  />
                <a:numberField allowDecimals="false" name="select_year" bindTarget="month_finance_form_ds" prompt="查询年度"  />
            </a:form>
            <a:grid id="source_to_grid" bindTarget="month_finance_grid_ds" navBar="true" height="400" marginWidth="100">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="120"/>
                    <a:column name="bp_code" prompt="客户编号" width="120"/>
                    <a:column name="bp_name" prompt="客户名称" width="120"/>
                    <a:column name="bp_agent_code"  prompt="代理商编号" width="100" />
                    <a:column name="bp_agent_name" prompt="代理商名称" />
                    <a:column name="division_n" prompt="产品线" />
                    <a:column name="lease_channel_n" prompt="商业模式" width="80" renderer="Leaf.formatDate"/>
                    <a:column name="business_type_n"  prompt="租赁类型" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="pattern"  prompt="机型" width="100" />
                    <a:column name="machine_number"  prompt="机号" width="100" />
                    <a:column name="equipment_number"  prompt="装备号" width="100" />
                    <a:column prompt="01月">
                        <a:column name="january_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="january_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="january_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="02月">
                        <a:column name="february_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="february_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="february_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="03月">
                        <a:column name="march_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="march_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="march_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="04月">
                        <a:column name="april_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="april_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="april_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="05月">
                        <a:column name="may_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="may_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="may_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="06月">
                        <a:column name="june_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="june_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="june_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="07月">
                        <a:column name="july_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="july_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="july_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="08月">
                        <a:column name="august_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="august_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="august_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="09月">
                        <a:column name="september_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="september_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="september_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="10月">
                        <a:column name="october_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="october_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="october_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="11月">
                        <a:column name="november_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="november_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="november_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="12月">
                        <a:column name="december_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="december_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="december_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="查询年度第二年">
                        <a:column name="second_years_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="second_years_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="second_years_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="查询年度第三年">
                        <a:column name="third_years_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="third_years_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="third_years_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="查询年度第四年">
                        <a:column name="fourth_years_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="fourth_years_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="fourth_years_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="查询年度第五年">
                        <a:column name="fifth_years_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="fifth_years_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="fifth_years_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="查询年度五年以后">
                        <a:column name="after_fifth_years_principal"  prompt="本金" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="after_fifth_years_interest"  prompt="利息" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="after_fifth_years_due_amount"  prompt="合计" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>