<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:sel="www.shanghai-electric.com" xmlns:msg="leaf.application.features.msg" xmlns:a="http://www.leaf-framework.org/application" xmlns:task="leaf.application.task" xmlns:dr="leaf.plugin.excelreport" xmlns:mail="leaf.plugin.mail" xmlns:et="leaf.plugin.export.task" xmlns:p="uncertain.proc" trace="true">
    <a:init-procedure>
        <p:switch test="/parameter/@datasoure_type">
            <p:case value="unearned_finance_income">
                <a:model-query fetchAll="true" model="hls.HLS801.con_unearned_finance_income" rootPath="/model/datasource"/>
                <a:model-query fetchAll="true" model="hls.HLS801.hls_monthly_statement_excel_header" rootPath="/model/header"/>
                <dr:excel-report enableTask="false" filename="收入确认导出.xlsx">
                    <dr:styles>
                        <!-- <dr:cell-style name="title" align="ALIGN_CENTER" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" cell_style_id="1" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" cell_style_id="1" fontname="宋体" height="9"/>
                        </dr:cell-style> -->
                        <dr:cell-style name="cell1" align="ALIGN_CENTER" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="宋体" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="cell2" align="ALIGN_RIGHT" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="Arial" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="cell3" align="ALIGN_LEFT" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="宋体" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="cell4" align="ALIGN_CENTER" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="Arial" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="header" align="ALIGN_LEFT" borderbottom="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" cell_style_id="2" foregroundcolor="BLACK">
                            <dr:font bold="true" cell_style_id="2" fontname="宋体" height="10"/>
                        </dr:cell-style>
                    </dr:styles>
                    <dr:sheets>
                        <dr:sheet name="收入确认" autoSizeColumns="0,1,2,3,4,5,6,7,8,9,10,11" displayGridlines="false">
                            <dr:static-content>
                                <dr:cell-data cell="A" row="1" stylename="header" type="content" value="报表名"/>
                                <dr:cell-data cell="A" row="2" stylename="header" type="content" value="制表日期"/>
                                <dr:cell-data cell="A" row="3" stylename="header" type="content" value="期间"/>
                                <dr:cell-data cell="A" row="4" stylename="header" type="content" value="制表人"/>
                                <dr:cell-data cell="B" row="1" type="content" value="收入确认报表"/>
                                <dr:cell-data cell="B" row="2" type="content" value="${/model/header/record/@now_date}"/>
                                <dr:cell-data cell="B" row="3" type="content" value="${/parameter/@period_name}"/>
                                <dr:cell-data cell="B" row="4" type="content" value="${/model/header/record/@employee_name}"/>
                            </dr:static-content>
                            <dr:dynamic-content cell="A" dataModel="/model/datasource" row="5">
                                <dr:columns>
                                    <dr:table-column cellStyle="cell4" field="seq" title="序号" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell1" field="project_name" grouplevel="2" merged="true" title="租赁项目名称" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="finance_amount" grouplevel="2" merged="true" title="融资额" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="period" title="所属期间" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="interest" title="租息" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="int_rate_implicit" grouplevel="1" merged="true" title="利率" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="calc_period" title="当月计息期间" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="factor_days" title="当月计息天数" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="current_month_vat_income" grouplevel="2" merged="true" title="当月租息（含税）" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="current_month_income" grouplevel="2" merged="true" title="当月租息（不含税）" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell4" field="finance_income_recognized" title="收入确认标志" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell1" field="contract_id" grouplevel="2" merged="true" title="合同ID" titlestyle="header" type="content"/>
                                </dr:columns>
                            </dr:dynamic-content>
                        </dr:sheet>
                    </dr:sheets>
                </dr:excel-report>
            </p:case>
            <p:case value="accrued_interest">
                <a:model-query fetchAll="true" model="hls.HLS801.tre_accrued_interest" rootPath="/model/datasource"/>
                <a:model-query fetchAll="true" model="hls.HLS801.hls_monthly_statement_excel_header" rootPath="/model/header"/>
                <dr:excel-report enableTask="false" filename="计提利息导出.xlsx">
                    <dr:styles>
                        <!-- <dr:cell-style name="title" align="ALIGN_CENTER" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" cell_style_id="1" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" cell_style_id="1" fontname="宋体" height="9"/>
                        </dr:cell-style> -->
                        <dr:cell-style name="cell1" align="ALIGN_CENTER" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="宋体" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="cell2" align="ALIGN_RIGHT" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="Arial" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="cell3" align="ALIGN_LEFT" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="宋体" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="cell4" align="ALIGN_CENTER" borderbottom="BORDER_THIN" borderleft="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" vertical="VERTICAL_CENTER">
                            <dr:font bold="false" fontName="Arial" height="9"/>
                        </dr:cell-style>
                        <dr:cell-style name="cell" align="ALIGN_LEFT" borderbottom="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" cell_style_id="1">
                            <dr:font bold="false" cell_style_id="1" fontname="宋体" height="10"/>
                        </dr:cell-style>
                        <dr:cell-style name="header" align="ALIGN_LEFT" borderbottom="BORDER_THIN" borderright="BORDER_THIN" bordertop="BORDER_THIN" cell_style_id="2" foregroundcolor="BLACK">
                            <dr:font bold="true" cell_style_id="2" fontname="宋体" height="10"/>
                        </dr:cell-style>
                    </dr:styles>
                    <dr:sheets>
                        <dr:sheet name="计提利息" autoSizeColumns="0,1,2,3,4,5,6,7,8" displayGridlines="false">
                            <dr:static-content>
                                <dr:cell-data cell="A" row="1" stylename="header" type="content" value="报表名"/>
                                <dr:cell-data cell="A" row="2" stylename="header" type="content" value="制表日期"/>
                                <dr:cell-data cell="A" row="3" stylename="header" type="content" value="期间"/>
                                <dr:cell-data cell="A" row="4" stylename="header" type="content" value="制表人"/>
                                <dr:cell-data cell="B" row="1" type="content" value="计提利息报表"/>
                                <dr:cell-data cell="B" row="2" type="content" value="${/model/header/record/@now_date}"/>
                                <dr:cell-data cell="B" row="3" type="content" value="${/parameter/@period_name}"/>
                                <dr:cell-data cell="B" row="4" type="content" value="${/model/header/record/@employee_name}"/>
                            </dr:static-content>
                            <dr:dynamic-content cell="A" dataModel="/model/datasource" row="5">
                                <dr:columns>
                                    <dr:table-column cellStyle="cell3" field="contract_number" title="借款合同编号" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="business_type_desc" title="借款业务类型" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="withdraw_number" title="提款单据号" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="cf_item_desc" title="现金流项目" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="calc_start_date_n" title="日期从" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="calc_end_date_n" title="日期到" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="int_rate" title="利率" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell2" field="net_accrued_interest" title="应计利息" titlestyle="header" type="content"/>
                                    <dr:table-column cellStyle="cell3" field="recognized_flag" title="计提标志" titlestyle="header" type="content"/>
                                </dr:columns>
                            </dr:dynamic-content>
                        </dr:sheet>
                    </dr:sheets>
                </dr:excel-report>
            </p:case>
        </p:switch>
    </a:init-procedure>
</a:service>
