bbb35452-98a9-4328-a1e7-e30413284dbd<?xml version="1.0" encoding="UTF-8"?>

<foxreport>
<locale name="zh_CN"/>
<title text="报表参数"/>
<parms>
<parm name="hotels" text="开始日期" class="java.lang.String" value="" fixed="false" visiable="true" index="0" refid="jtextfield"/>
<parm name="end" text="结束日期" class="java.lang.String" value="" fixed="false" visiable="true" index="1" refid="jtextfield"/>
<parm name="begin" text="" class="java.lang.String" value="" fixed="false" visiable="false" index="2" refid="jadvtextarea"/>
</parms>
<pramform store="class" builder="com.foxhis.report.DefaultReportParmBuilder" dialog="false">com.foxhis.lps.reportcond.ReportHotelRadioPanel</pramform>
<engine/>
<syntax>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;&lt;jatools Class="jatools.ReportDocument" Name="jatools report template"&gt;&lt;VariableContext&gt;&lt;Item0 Class="Parameter" Name="m_flag"&gt;&lt;Name&gt;m_flag&lt;/Name&gt;&lt;Type1&gt;java.lang.Integer&lt;/Type1&gt;&lt;DefaultValue&gt;1&lt;/DefaultValue&gt;&lt;/Item0&gt;&lt;Item1 Class="Parameter" Name="$color_even"&gt;&lt;Name&gt;$color_even&lt;/Name&gt;&lt;Type1&gt;java.lang.String&lt;/Type1&gt;&lt;DefaultValue&gt;#5599AA&lt;/DefaultValue&gt;&lt;Prompt&gt;#5599AA&lt;/Prompt&gt;&lt;/Item1&gt;&lt;Item2 Class="jatools.data.Formula" Name="print_time"&gt;&lt;Text&gt;return "打印时间："+format(new Date(),  "yyyy-MM-dd HH:mm") +  " " + empno;
&lt;/Text&gt;&lt;/Item2&gt;&lt;/VariableContext&gt;&lt;Page&gt;&lt;Children ItemClass="PagePanel"&gt;&lt;Item0&gt;&lt;Width&gt;955&lt;/Width&gt;&lt;Height&gt;1366&lt;/Height&gt;&lt;Children ItemClass="Table"&gt;&lt;Item0&gt;&lt;NodePath&gt;hzq&lt;/NodePath&gt;&lt;X&gt;2&lt;/X&gt;&lt;Y&gt;2&lt;/Y&gt;&lt;Children&gt;&lt;Item0 Class="RowPanel"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;RowSpan&gt;5&lt;/RowSpan&gt;&lt;ColSpan&gt;7&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;PrintStyle&gt;print-mode:everypage;&lt;/PrintStyle&gt;&lt;Children&gt;&lt;Item0 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;4&lt;/Row&gt;&lt;Col&gt;3&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item0&gt;&lt;Item1 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;3&lt;/Row&gt;&lt;Col&gt;6&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item1&gt;&lt;Item2 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;3&lt;/Row&gt;&lt;Col&gt;5&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item2&gt;&lt;Item3 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;3&lt;/Row&gt;&lt;Col&gt;4&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item3&gt;&lt;Item4 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;3&lt;/Row&gt;&lt;Col&gt;3&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item4&gt;&lt;Item5 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;3&lt;/Row&gt;&lt;Col&gt;2&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item5&gt;&lt;Item6 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;3&lt;/Row&gt;&lt;Col&gt;1&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item6&gt;&lt;Item7 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;3&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item7&gt;&lt;Item8 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;6&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item8&gt;&lt;Item9 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;5&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item9&gt;&lt;Item10 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;4&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item10&gt;&lt;Item11 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;3&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item11&gt;&lt;Item12 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;2&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item12&gt;&lt;Item13 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;1&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item13&gt;&lt;Item14 Class="Label"&gt;&lt;Cell&gt;&lt;Row&gt;0&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item14&gt;&lt;Item15 Class="Text"&gt;&lt;Variable&gt;="统计日期："+begin+" 到 "+end&lt;/Variable&gt;&lt;Cell&gt;&lt;Row&gt;4&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;ColSpan&gt;3&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;/Item15&gt;&lt;Item16 Class="Text"&gt;&lt;Variable&gt;=hoteldesc&lt;/Variable&gt;&lt;Font&gt;&lt;Face&gt;宋体&lt;/Face&gt;&lt;Style&gt;1&lt;/Style&gt;&lt;Size&gt;16&lt;/Size&gt;&lt;/Font&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;1&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;ColSpan&gt;7&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;/Item16&gt;&lt;Item17 Class="Text"&gt;&lt;Variable&gt;=reportname&lt;/Variable&gt;&lt;Font&gt;&lt;Face&gt;宋体&lt;/Face&gt;&lt;Style&gt;1&lt;/Style&gt;&lt;Size&gt;16&lt;/Size&gt;&lt;/Font&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;2&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;ColSpan&gt;7&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;/Item17&gt;&lt;Item18 Class="Text"&gt;&lt;Variable&gt;=printtime&lt;/Variable&gt;&lt;HorizontalAlignment&gt;2&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;4&lt;/Row&gt;&lt;Col&gt;4&lt;/Col&gt;&lt;ColSpan&gt;3&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;/Item18&gt;&lt;/Children&gt;&lt;/Item0&gt;&lt;Item1 Class="Label"&gt;&lt;Text&gt;日期&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;5&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item1&gt;&lt;Item2 Class="Label"&gt;&lt;Text&gt;渠道&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;5&lt;/Row&gt;&lt;Col&gt;1&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item2&gt;&lt;Item3 Class="Label"&gt;&lt;Text&gt;渠道描述&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;5&lt;/Row&gt;&lt;Col&gt;2&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item3&gt;&lt;Item4 Class="Label"&gt;&lt;Text&gt;房数&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;5&lt;/Row&gt;&lt;Col&gt;3&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item4&gt;&lt;Item5 Class="Label"&gt;&lt;Text&gt;房费&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;5&lt;/Row&gt;&lt;Col&gt;4&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item5&gt;&lt;Item6 Class="Label"&gt;&lt;Text&gt;房数占比&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;5&lt;/Row&gt;&lt;Col&gt;5&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item6&gt;&lt;Item7 Class="Label"&gt;&lt;Text&gt;房费占比&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;5&lt;/Row&gt;&lt;Col&gt;6&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item7&gt;&lt;Item8 Class="RowPanel"&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;ColSpan&gt;7&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;Children ItemClass="Text"&gt;&lt;Item0&gt;&lt;Variable&gt;=$.ff/index1.ff{$.date}&lt;/Variable&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;2&lt;/HorizontalAlignment&gt;&lt;Format Class="DecimalFormat"&gt;&lt;Pattern&gt;0.00%&lt;/Pattern&gt;&lt;/Format&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;6&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item0&gt;&lt;Item1&gt;&lt;Variable&gt;=$.occ/index1.occ{$.date}&lt;/Variable&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;2&lt;/HorizontalAlignment&gt;&lt;Format Class="DecimalFormat"&gt;&lt;Pattern&gt;0.00%&lt;/Pattern&gt;&lt;/Format&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;5&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item1&gt;&lt;Item2&gt;&lt;Variable&gt;=$.ff&lt;/Variable&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;2&lt;/HorizontalAlignment&gt;&lt;Format Class="DecimalFormat"&gt;&lt;Pattern&gt;0.00&lt;/Pattern&gt;&lt;/Format&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;4&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item2&gt;&lt;Item3&gt;&lt;Variable&gt;=$.occ&lt;/Variable&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;2&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;3&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item3&gt;&lt;Item4&gt;&lt;Variable&gt;=$.descript&lt;/Variable&gt;&lt;Border/&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;2&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item4&gt;&lt;Item5&gt;&lt;Variable&gt;=$.channel&lt;/Variable&gt;&lt;Border/&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;1&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item5&gt;&lt;Item6&gt;&lt;Variable&gt;=$.date&lt;/Variable&gt;&lt;Border/&gt;&lt;PrintStyle&gt;united-level:1;&lt;/PrintStyle&gt;&lt;Cell&gt;&lt;Row&gt;6&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item6&gt;&lt;/Children&gt;&lt;NodePath&gt;Row&lt;/NodePath&gt;&lt;/Item8&gt;&lt;Item9 Class="Label"&gt;&lt;Text&gt;总计：&lt;/Text&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;Cell&gt;&lt;Row&gt;7&lt;/Row&gt;&lt;Col&gt;0&lt;/Col&gt;&lt;ColSpan&gt;3&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;/Item9&gt;&lt;Item10 Class="Text"&gt;&lt;Variable&gt;=$.occ.sum()&lt;/Variable&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;2&lt;/HorizontalAlignment&gt;&lt;Cell&gt;&lt;Row&gt;7&lt;/Row&gt;&lt;Col&gt;3&lt;/Col&gt;&lt;/Cell&gt;&lt;/Item10&gt;&lt;Item11 Class="Text"&gt;&lt;Variable&gt;=$.ff.sum()&lt;/Variable&gt;&lt;BackColor&gt;-3355444&lt;/BackColor&gt;&lt;Border/&gt;&lt;HorizontalAlignment&gt;1&lt;/HorizontalAlignment&gt;&lt;Format Class="DecimalFormat"&gt;&lt;Pattern&gt;0.00&lt;/Pattern&gt;&lt;/Format&gt;&lt;Cell&gt;&lt;Row&gt;7&lt;/Row&gt;&lt;Col&gt;4&lt;/Col&gt;&lt;ColSpan&gt;3&lt;/ColSpan&gt;&lt;/Cell&gt;&lt;/Item11&gt;&lt;/Children&gt;&lt;ColumnWidths&gt;80,80,245,105,145,70,70&lt;/ColumnWidths&gt;&lt;RowHeights&gt;20,20,20,20,20,20,20,20&lt;/RowHeights&gt;&lt;/Item0&gt;&lt;/Children&gt;&lt;Type&gt;102&lt;/Type&gt;&lt;/Item0&gt;&lt;/Children&gt;&lt;PageFormat&gt;&lt;Width&gt;992&lt;/Width&gt;&lt;Height&gt;1403&lt;/Height&gt;&lt;Left&gt;18&lt;/Left&gt;&lt;Top&gt;18&lt;/Top&gt;&lt;Right&gt;19&lt;/Right&gt;&lt;Bottom&gt;19&lt;/Bottom&gt;&lt;/PageFormat&gt;&lt;/Page&gt;&lt;NodeSource&gt;&lt;Children ItemClass="DatasetNodeSource"&gt;&lt;Item0&gt;&lt;Children ItemClass="RowNodeSource"&gt;&lt;Item0/&gt;&lt;/Children&gt;&lt;Reader Class="com.foxhis.data.reader.SelfReader"&gt;&lt;Name&gt;hzq&lt;/Name&gt;&lt;Sql&gt;select rsv.date,rsv.channel,rsv.descript,sum(rsv.occ) as occ,sum(rsv.ff) as ff from
(select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*rd.setrate) as ff
from master m,basecode b,rsvsaccnt r,rsvsrc_dailyrate rd 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and rd.hotelid =r.hotelid and rd.accnt =r.accnt and rd.date=r.begindate and rd.id=r.id and r.id&amp;lt;&amp;gt;0
group by r.begindate,m.channel,b.descript 
union all
select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*mr.setrate) as ff
from master m,basecode b,rsvsaccnt r,master_rate mr 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and mr.hotelid =r.hotelid and mr.accnt =r.accnt and mr.date=r.begindate and r.id=0
group by r.begindate,m.channel,b.descript) rsv 
group by rsv.date,rsv.channel,rsv.descript
order by rsv.date,rsv.channel,rsv.descript
;&lt;/Sql&gt;&lt;Description&gt;select rsv.date,rsv.channel,rsv.descript,sum(rsv.occ) as occ,sum(rsv.ff) as ff from
(select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*rd.setrate) as ff
from master m,basecode b,rsvsaccnt r,rsvsrc_dailyrate rd 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and rd.hotelid =r.hotelid and rd.accnt =r.accnt and rd.date=r.begindate and rd.id=r.id and r.id&amp;lt;&amp;gt;0
group by r.begindate,m.channel,b.descript 
union all
select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*mr.setrate) as ff
from master m,basecode b,rsvsaccnt r,master_rate mr 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and mr.hotelid =r.hotelid and mr.accnt =r.accnt and mr.date=r.begindate and r.id=0
group by r.begindate,m.channel,b.descript) rsv 
group by rsv.date,rsv.channel,rsv.descript
order by rsv.date,rsv.channel,rsv.descript
;&lt;/Description&gt;&lt;/Reader&gt;&lt;TagName&gt;hzq&lt;/TagName&gt;&lt;/Item0&gt;&lt;Item1&gt;&lt;Children ItemClass="IndexNodeSource"&gt;&lt;Item0&gt;&lt;IndexFields Len="1"&gt;date&lt;/IndexFields&gt;&lt;TagName&gt;index1&lt;/TagName&gt;&lt;/Item0&gt;&lt;/Children&gt;&lt;Reader Class="com.foxhis.data.reader.SelfReader"&gt;&lt;Name&gt;rsv&lt;/Name&gt;&lt;Sql&gt;select rsv.date,sum(rsv.occ) as occ,sum(rsv.ff) as ff from
(select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*rd.setrate) as ff
from master m,basecode b,rsvsaccnt r,rsvsrc_dailyrate rd 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and rd.hotelid =r.hotelid and rd.accnt =r.accnt and rd.date=r.begindate and rd.id=r.id and r.id&amp;lt;&amp;gt;0
group by r.begindate,m.channel,b.descript 
union all
select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*mr.setrate) as ff
from master m,basecode b,rsvsaccnt r,master_rate mr 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and mr.hotelid =r.hotelid and mr.accnt =r.accnt and mr.date=r.begindate and r.id=0
group by r.begindate,m.channel,b.descript) rsv 
group by rsv.date
order by rsv.date
;&lt;/Sql&gt;&lt;Description&gt;select rsv.date,sum(rsv.occ) as occ,sum(rsv.ff) as ff from
(select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*rd.setrate) as ff
from master m,basecode b,rsvsaccnt r,rsvsrc_dailyrate rd 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and rd.hotelid =r.hotelid and rd.accnt =r.accnt and rd.date=r.begindate and rd.id=r.id and r.id&amp;lt;&amp;gt;0
group by r.begindate,m.channel,b.descript 
union all
select r.begindate as date,m.channel,b.descript,sum(ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0)) as occ,sum((ifnull(r.definite,0)+ifnull(r.tentative,0)+ifnull(r.houseuse,0))*mr.setrate) as ff
from master m,basecode b,rsvsaccnt r,master_rate mr 
where r.hotelid='${hotels}' and r.begindate&amp;gt;='${begin}' and r.begindate&amp;lt;='${end}' and m.accnt not like 'L%' and m.hotelid=r.hotelid and m.accnt=r.accnt and m.channel=b.code and b.cat='channel' and (((b.hotelid='${groupid}' and b.share='T') or (b.hotelid='${brandid}' and b.share='T') or b.hotelid='${hotels}') or ((( b.hotelid='${brandid}' or b.hotelid='${groupid}' ))  and b.distribute='T' and b.code in (select code from code_hotellink where cat='channel' and hotelid='${hotels}'))) 
and mr.hotelid =r.hotelid and mr.accnt =r.accnt and mr.date=r.begindate and r.id=0
group by r.begindate,m.channel,b.descript) rsv 
group by rsv.date
order by rsv.date
;&lt;/Description&gt;&lt;/Reader&gt;&lt;TagName&gt;rsv&lt;/TagName&gt;&lt;/Item1&gt;&lt;/Children&gt;&lt;/NodeSource&gt;&lt;/jatools&gt;</syntax>
</foxreport>
