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

<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:view>
        <script type="text/javascript"><![CDATA[
        function equipment_invoice_query() {
            $('equipment_invoice_grid_ds').query();
        }

        function equipment_invoice_reset(){
            $('equipment_invoice_form_ds').reset();
        }

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


        ]]></script>
        <a:dataSet id="contract_status_ds" lookupCode="CON500_CONTRACT_STATUS"/>
        <a:dataSet id="invoice_status_ds" lookupCode="ACP517_INVOICE_STATUS"/>
        <a:dataSet id="nvl_invoice_number" lookupCode="YES_NO"/>
        <a:dataSets>
            <a:dataSet id="equipment_invoice_form_ds">
                <a:fields>
                    <a:field name="contract_status_n" displayField="code_value_name" options="contract_status_ds" returnField="contract_status" valueField="code_value"/>
                    <a:field name="invoice_status_n" displayField="code_value_name" options="invoice_status_ds" returnField="invoice_status" valueField="code_value"/>
                    <a:field name="nvl_invoice_number" displayField="code_value_name" options="nvl_invoice_number" returnField="nvl_invoice_number_n" valueField="code_value"/>
                    <a:field name="nvl_invoice_number_n" />
                </a:fields>
            </a:dataSet>
            <a:dataSet id="equipment_invoice_grid_ds"
                       model="cont.CON1310.equipment_invoice_detail"
                       queryDataSet="equipment_invoice_form_ds" selectable="true" selectionModel="single">
            </a:dataSet>
        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="equipment_invoice_query" text="查询"/>
                <a:gridButton click="equipment_invoice_reset" text="重置"/>
                <a:gridButton click="equipment_invoice_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="100" title="查询条件">
                <a:textField name="contract_number" bindTarget="equipment_invoice_form_ds" prompt="合同编号"/>
                <a:textField name="bp_name" bindTarget="equipment_invoice_form_ds" prompt="承租人"/>
                <a:comboBox name="invoice_status_n" bindTarget="equipment_invoice_form_ds" prompt="发票状态"/>
                <a:textField name="invoice_code" bindTarget="equipment_invoice_form_ds" prompt="发票代码"/>
                <a:textField name="invoice_number" bindTarget="equipment_invoice_form_ds" prompt="发票号码"/>
                <a:datePicker name="invoice_date_date_from" bindTarget="equipment_invoice_form_ds" prompt="开票日期从" />
                <a:datePicker name="invoice_date_date_to" bindTarget="equipment_invoice_form_ds" prompt="开票日期到" />
                <a:comboBox name="nvl_invoice_number" bindTarget="equipment_invoice_form_ds" prompt="发票号码是否为空"/>
                <a:datePicker name="lease_execution_date_from" bindTarget="equipment_invoice_form_ds" prompt="执行日期从" />
                <a:datePicker name="lease_execution_date_to" bindTarget="equipment_invoice_form_ds" prompt="执行日期到" />
            </a:form>
            <a:grid id="source_to_grid" bindTarget="equipment_invoice_grid_ds" navBar="true" height="400" marginWidth="100">
                <a:columns>
                    <a:column prompt="合同信息">
                        <a:column name="contract_number" prompt="合同编号" width="130"/>
                        <a:column name="bp_agent_name" prompt="代理商名称" width="130"/>
                        <a:column name="contract_status_n" prompt="合同状态" width="100"/>
                        <a:column name="lease_execution_date"  prompt="合同执行日期" width="100" renderer="Leaf.formatDate"/>
                        <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="lease_tax_amount"  prompt="不含税金额" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="lease_no_tax_amount"  prompt="税额" width="100" renderer="Leaf.formatMoney"/>
                    </a:column>
                    <a:column prompt="发票信息">
                        <a:column name="invoice_type_n"  prompt="发票类型" width="100"/>
                        <a:column name="invoice_code"  prompt="发票代码" width="100"/>
                        <a:column name="invoice_number"  prompt="发票号码" width="100"/>
                        <a:column name="invoice_date"  prompt="开票日期" width="100" renderer="Leaf.formatDate"/>
                        <a:column name="net_amount"  prompt="金额（不含税）" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="tax_amount"  prompt="税额" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="total_amount" prompt="价税合计" width="100" renderer="Leaf.formatMoney"/>
                        <a:column name="invoice_status_n" prompt="发票状态" width="100"/>
                        <a:column name="specification" prompt="机型-发票" width="100"/>
                        <a:column name="note" prompt="备注" width="100"/>
                        <a:column name="sellername" prompt="销售方" width="100"/>
                    </a:column>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
