<?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 fetchAll="true" model="basic.hls_lease_channel_for_lov" rootPath="con1300_lease_list"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        function contract_list_query() {
            $('contract_list_grid_ds').query();
        }

        function contract_list_reset(){
            $('contract_list_form_ds').reset();
        }

        function contract_list_export() {
            $('source_to_grid')._export();
        }


        ]]></script>
        <a:dataSet id="contract_status_ds" lookupCode="CON500_CONTRACT_STATUS"/>
        <a:dataSet id="con1300_lease_channel_ds">
            <a:datas dataSource="/model/con1300_lease_list"/>
        </a:dataSet>
        <a:dataSets>
            <a:dataSet id="contract_list_form_ds">
                <a:fields>
                    <a:field name="lease_channel_n" displayField="description" options="con1300_lease_channel_ds"
                             returnField="lease_channel" valueField="lease_channel"/>
                    <a:field name="lease_channel" />
                    <a:field name="contract_status_n" displayField="code_value_name" options="contract_status_ds" returnField="contract_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="contract_list_grid_ds"
                       model="cont.CON1300.equipment_invoice_manage_query"
                       queryDataSet="contract_list_form_ds" selectable="true" selectionModel="single">
            </a:dataSet>
        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="contract_list_query" text="查询"/>
                <a:gridButton click="contract_list_reset" text="重置"/>
                <a:gridButton click="contract_list_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="5" marginWidth="100" title="查询条件">
                <a:textField name="contract_number" bindTarget="contract_list_form_ds" prompt="合同编号"/>
                <a:comboBox name="lease_channel_n" bindTarget="contract_list_form_ds" prompt="商业模式" />
                <a:comboBox name="contract_status_n" bindTarget="contract_list_form_ds" prompt="合同状态" />
                <a:datePicker name="lease_execution_date_from" bindTarget="contract_list_form_ds" prompt="执行日期从" />
                <a:datePicker name="lease_execution_date_to" bindTarget="contract_list_form_ds" prompt="执行日期到" />
            </a:form>
            <a:grid id="source_to_grid" bindTarget="contract_list_grid_ds" navBar="true" height="400" marginWidth="100">
                <a:columns>
                    <a:column name="lease_execution_month" prompt="执行年月" width="130" renderer="Leaf.formatDate"/>
                    <a:column name="lease_channel_n" prompt="项目类别" width="100"/>
                    <a:column name="bp_agent_name"  prompt="代理商名称" width="100" />
                    <a:column name="creation_date"  prompt="申请日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="lease_execution_date"  prompt="执行日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="contract_number"  prompt="合同编号" width="100" />
                    <a:column name="contract_status_n"  prompt="合同状态" width="100" />
                    <a:column name="bp_name"  prompt="客户名称" width="100" />
                    <a:column name="division_n"  prompt="产品名称" width="100"/>
                    <a:column name="pattern"  prompt="机型" width="100"/>
                    <a:column name="machine_number"  prompt="机号" width="100"/>
                    <a:column name="lease_item_amount"  prompt="应收设备额" width="100" renderer="Leaf.formatMoney"/>
                    <!--<a:column name="net_amount"  prompt="实收设备发票额" width="100" renderer="Leaf.formatMoney"/>-->
                    <a:column name="total_amount"  prompt="实收设备发票额" width="100" renderer="Leaf.formatMoney"/>
                    <a:column name="due_amount"  prompt="账面设备额" width="100" renderer="Leaf.formatMoney"/>
                    <a:column prompt="差异对比">
                        <a:column name="lease_net" prompt="应收-实收" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="net_due" prompt="实收-账面" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="lease_due" prompt="应收-账面" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
