<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="th_lista_cliente" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="814" leftMargin="14" rightMargin="14" topMargin="14" bottomMargin="14" uuid="e7910379-b296-485c-a885-202b65718627">
	<property name="ireport.zoom" value="1.5026296018031553"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<style name="Título" hAlign="Left" vAlign="Middle" isBlankWhenNull="true" fontSize="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false">
		<box topPadding="1" bottomPadding="1"/>
	</style>
	<style name="Filtros" hAlign="Left" vAlign="Middle" isBlankWhenNull="false" fontSize="7" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false">
		<box topPadding="2" bottomPadding="5">
			<bottomPen lineWidth="0.75"/>
		</box>
	</style>
	<style name="Data/Hora" hAlign="Right" vAlign="Middle" isBlankWhenNull="false" fontSize="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false">
		<box topPadding="1" bottomPadding="1">
			<bottomPen lineWidth="0.0"/>
		</box>
	</style>
	<style name="Apr-Clean" fill="Solid" hAlign="Center" vAlign="Middle" markup="none" isBlankWhenNull="true" fontSize="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false">
		<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
			<pen lineWidth="0.0"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.0" lineStyle="Dashed"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.0" lineStyle="Dashed"/>
		</box>
	</style>
	<style name="Apr-Duplo" fill="Solid" hAlign="Center" vAlign="Middle" markup="none" isBlankWhenNull="true" fontSize="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false">
		<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
			<pen lineWidth="0.0"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Linhas-Zebra" backcolor="#F5F7FA" hAlign="Left" vAlign="Middle" isBlankWhenNull="true" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false">
		<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
			<topPen lineWidth="0.0" lineColor="#FFFFFF"/>
			<leftPen lineWidth="0.0" lineColor="#FFFFFF"/>
			<bottomPen lineWidth="0.0" lineColor="#FFFFFF"/>
			<rightPen lineWidth="0.0" lineColor="#FFFFFF"/>
		</box>
		<conditionalStyle>
			<conditionExpression><![CDATA[new Boolean( $V{REPORT_COUNT}.intValue() % 2 == 0)]]></conditionExpression>
			<style mode="Opaque" backcolor="#F5F7FA" isBlankWhenNull="true" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
		</conditionalStyle>
	</style>
	<style name="Grupo1" hAlign="Left" vAlign="Middle" isBlankWhenNull="true" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false">
		<box topPadding="9" bottomPadding="3"/>
	</style>
	<style name="Total-Grupo" hAlign="Left" vAlign="Middle" isBlankWhenNull="true" fontSize="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false">
		<box topPadding="3" bottomPadding="2">
			<pen lineWidth="0.25"/>
			<topPen lineWidth="0.0"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="0.0"/>
			<rightPen lineWidth="0.0"/>
		</box>
	</style>
	<style name="Total-Rel" hAlign="Left" vAlign="Middle" isBlankWhenNull="false" fontSize="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false">
		<box topPadding="1" bottomPadding="1">
			<pen lineWidth="0.25"/>
			<topPen lineWidth="0.25"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="0.25"/>
			<rightPen lineWidth="0.0"/>
		</box>
	</style>
	<style name="Versão" hAlign="Left" vAlign="Middle" isBlankWhenNull="false" fontSize="7" isBold="true" isItalic="true" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false">
		<box topPadding="0" bottomPadding="1">
			<pen lineWidth="0.0"/>
			<topPen lineWidth="0.75" lineColor="#000000"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="0.0"/>
			<rightPen lineWidth="0.0"/>
		</box>
	</style>
	<parameter name="P_USU" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_RCA" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_MUN" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_UF" class="java.lang.String">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_ROTA" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_LOC" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_AGRUP" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_ORDEM" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_CLIBLOQ" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_GRUPOCLI" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_AV" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_RA" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_FORN" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_PRO" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<parameter name="P_DTCOMPDE" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="P_DTCOMP" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="P_DTCOMPATE" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="P_DTCADDE" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="P_DTCADATE" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="P_DTCAD" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select

/*****************************************
CABECALHO/RODAPE
*/

'Lista de Clientes - Plano especial' as relatorio,

to_char(now(),'dd/mm/yyyy HH24:MI')||' ('||coalesce((select usulogin from usu where usufunparcod=$P{P_USU}),'...')||')' as dtimpr,
'th_lista_cliente_plano_especial v26.05.05 - www.brsistemas.com.br' as versao,

'<b>Filtros:<b/> '
||'[Periodo de cadastro cliente: '||case when $P{P_DTCAD}='S' then 'Qualquer data' else to_char(cast($P{P_DTCADDE} as date),'dd/mm/yyyy')||' a '||to_char(cast($P{P_DTCADATE} as date),'dd/mm/yyyy') end||']'
||'[Periodo de compra: '||case when $P{P_DTCOMP}='S' then 'Qualquer data' else to_char(cast($P{P_DTCOMPDE} as date),'dd/mm/yyyy')||' a '||to_char(cast($P{P_DTCOMPATE} as date),'dd/mm/yyyy') end||']'
||case when $P{P_RCA}>0 then '[<b>RCA/VENDEDOR: </b>'||(select pardes from par where parcod=$P{P_RCA})||']' else '' end
||case when $P{P_FORN}>0 then '[<b>FORN/FORNECEDOR: </b>'||(select pardes from par where parcod=$P{P_FORN})||']' else '' end
||case when $P{P_PRO}>0 then '[<b>PRO/PRODUTO: </b>'||(select prodes from pro where procod=$P{P_PRO})||']' else '' end
||case when $P{P_RCA}>0 then '[<b>RCA/VENDEDOR: </b>'||(select pardes from par where parcod=$P{P_RCA})||']' else '' end
||case when $P{P_LOC}>0 then '[<b>Localidade: </b>'||(select locdes from loc where loccod=$P{P_LOC})||']' else '' end
||case when $P{P_UF}>'0' then '[<b>UF: </b>'||coalesce((select distinct munufsigla from mun where munufsigla=$P{P_UF}), 'TODOS')||']' else '' end
||case when $P{P_MUN}>0 then '[<b>Município: </b>'||(select mundes from mun where muncod=$P{P_MUN})||']' else '' end
||case when $P{P_ROTA}>0 then '[<b>Rota: </b>'||(select rotades from rota where rotacod=$P{P_ROTA})||']' else '' end
||case when $P{P_RA}>0 then '[<b>Ramo de Atividade: </b>'||(select rades from ra where racod=$P{P_RA})||']' else '' end
||case when $P{P_AV}>0 then '[<b>Área de Venda: </b>'||(select av_descricao from area_venda where av_codigo=$P{P_AV})||']' else '' end
||case when $P{P_GRUPOCLI}>0 then ', [<b>Grupo.Cli:</b> '||coalesce((select cg_descricao from cliente_grupo where cg_codigo=$P{P_GRUPOCLI}),'TODOS')||']' else '' end
||case when $P{P_CLIBLOQ}>0 then case
when $P{P_CLIBLOQ}=1 then ' Ativos'
when $P{P_CLIBLOQ}=2 then ' Inativos'
else '' end
else '' end

as filtro,

/*****************************************
*/

rcapar.parcod as gruporcacod,
rcapar.pardes as gruporcades,
rcapar.parfan as gruporcafan,
case
when $P{P_AGRUP}=1 then 'Geral'
when $P{P_AGRUP}=2 then cast(munufsigla||'-'||cliloc.locdes as varchar)
when $P{P_AGRUP}=3 then cast(munufsigla||'-'||mundes as varchar)
when $P{P_AGRUP}=4 then
	case
	when (cli_ate_seg='S' and cli_ate_ter='S' and cli_ate_qua='S' and cli_ate_qui='S' and cli_ate_sex='S') then '0-DIARIO'
	when cli_ate_seg='S' then '2-SEGUNDA'
	when cli_ate_ter='S' then '3-TERCA'
	when cli_ate_qua='S' then '4-QUARTA'
	when cli_ate_qui='S' then '5-QUINTA'
	when cli_ate_sex='S' then '6-SEXTA'
	when cli_ate_sab='S' then '7-SABADO'
	else 'NÃO DEFINIDO'
	end
else 'Geral' end as subgrupodes,
clipar.parcod as clicod,
clipar.pardes||'-'||clipar.parcnpjcpf as clides,
clipar.parfan as clifan,
clipar.parrua as cliend,
clipar.parbai as clibai,
clipar.parcep as clicep,
clipar.paremail as cliemail,
cliloc.locdes as clilocdes,
climun.mundes as climundes,
climun.munufsigla as cliuf,
case when clibloq='S' then 'Sim' else 'Não' end as clibloq,
case when clipar.pardddfone<'0' or clipar.pardddfone is null then clipar.parfone else '('||clipar.pardddfone||') '||clipar.parfone end as clifone,
clicontato,
clilim,
(select tctdoc from clitc join tc on tccod=clitctccod where clitccliparcod=clipar.parcod order by clitcseq desc limit 1)||' - '||cliplpg.plpgdes as clipgto,
clipar.paremail
from cli
join par clipar on cliparcod = clipar.parcod
join par rcapar on  rcapar.parcod =clircaparcod
join loc cliloc on cliloccod = cliloc.loccod
join rota clirota on locrotacod = clirota.rotacod
join mun climun on clipar.parmuncod = climun.muncod
join plpg cliplpg on cli_plano_pagamento = cliplpg.plpgcod
JOIN cliplpg cliplano ON cliplano.cliplpgcliparcod = cliparcod
left join
(
select
	fat_nf_dtemi,
	fat_forn_cod,
	fat_par_cod,
	fat_pro_cod
from sd.vw_fat) compra on clipar.parcod = compra.fat_par_cod

where 1=1
and case when $P{P_DTCAD}='S' then 1=1 else DATE(cli_dt_cad) between cast($P{P_DTCADDE} as date) and cast($P{P_DTCADATE} as date) end
and case when $P{P_DTCOMP}='S' then 1=1 else DATE(compra.fat_nf_dtemi) between DATE($P{P_DTCOMPDE}) and DATE($P{P_DTCOMPATE}) end
and case when $P{P_FORN}=0 then 1=1 else compra.fat_forn_cod=$P{P_FORN} end
and case when $P{P_PRO}=0 then 1=1 else compra.fat_pro_cod=$P{P_PRO} end
and case when $P{P_RCA}=0 then 1=1 else rcapar.parcod=$P{P_RCA} end
and case when $P{P_MUN}=0 then 1=1 else climun.muncod=$P{P_MUN} end
and case when $P{P_UF}='0' then 1=1 else climun.munufsigla=$P{P_UF} end
and case when $P{P_ROTA}=0 then 1=1 else clirota.rotacod=$P{P_ROTA} end
and case when $P{P_LOC}=0 then 1=1 else cliloc.loccod=$P{P_LOC} end
and case when $P{P_RA}=0 then 1=1 else cliracod=$P{P_RA} end
and case when $P{P_AV}=0 then 1=1 else cli_av_codigo=$P{P_AV} end
and case when $P{P_GRUPOCLI}=0 then 1=1 else cli_cg_codigo=$P{P_GRUPOCLI} end

group by clipar.parcod,rcapar.parcod, clipar.pardes,climun.munufsigla,climun.munufsigla,cliloc.locdes,climun.mundes,cli.cli_ate_seg,cli.cli_ate_ter,cli.cli_ate_qua
,cli.cli_ate_qui,cli.cli_ate_sex,cli.cli_ate_sab,cli.clibloq,clicontato,cli.clilim,cliplpg.plpgdes

union

select
/*****************************************
CABECALHO/RODAPE
*/

'Lista de Clientes' as relatorio,

to_char(now(),'dd/mm/yyyy HH24:MI')||' ('||coalesce((select usulogin from usu where usufunparcod=$P{P_USU}),'...')||')' as dtimpr,
'th_lista_cliente v25.04.07 - www.brsistemas.com.br' as versao,

'<b>Filtros:<b/> '
||'[Periodo de cadastro cliente: '||case when $P{P_DTCAD}='S' then 'Qualquer data' else to_char(cast($P{P_DTCADDE} as date),'dd/mm/yyyy')||' a '||to_char(cast($P{P_DTCADATE} as date),'dd/mm/yyyy') end||']'
||'[Periodo de compra: '||case when $P{P_DTCOMP}='S' then 'Qualquer data' else to_char(cast($P{P_DTCOMPDE} as date),'dd/mm/yyyy')||' a '||to_char(cast($P{P_DTCOMPATE} as date),'dd/mm/yyyy') end||']'
||case when $P{P_RCA}>0 then '[<b>RCA/VENDEDOR: </b>'||(select pardes from par where parcod=$P{P_RCA})||']' else '' end
||case when $P{P_FORN}>0 then '[<b>FORN/FORNECEDOR: </b>'||(select pardes from par where parcod=$P{P_FORN})||']' else '' end
||case when $P{P_PRO}>0 then '[<b>PRO/PRODUTO: </b>'||(select prodes from pro where procod=$P{P_PRO})||']' else '' end
||case when $P{P_RCA}>0 then '[<b>RCA/VENDEDOR: </b>'||(select pardes from par where parcod=$P{P_RCA})||']' else '' end
||case when $P{P_LOC}>0 then '[<b>Localidade: </b>'||(select locdes from loc where loccod=$P{P_LOC})||']' else '' end
||case when $P{P_UF}>'0' then '[<b>UF: </b>'||coalesce((select distinct munufsigla from mun where munufsigla=$P{P_UF}), 'TODOS')||']' else '' end
||case when $P{P_MUN}>0 then '[<b>Município: </b>'||(select mundes from mun where muncod=$P{P_MUN})||']' else '' end
||case when $P{P_ROTA}>0 then '[<b>Rota: </b>'||(select rotades from rota where rotacod=$P{P_ROTA})||']' else '' end
||case when $P{P_RA}>0 then '[<b>Ramo de Atividade: </b>'||(select rades from ra where racod=$P{P_RA})||']' else '' end
||case when $P{P_AV}>0 then '[<b>Área de Venda: </b>'||(select av_descricao from area_venda where av_codigo=$P{P_AV})||']' else '' end
||case when $P{P_GRUPOCLI}>0 then ', [<b>Grupo.Cli:</b> '||coalesce((select cg_descricao from cliente_grupo where cg_codigo=$P{P_GRUPOCLI}),'TODOS')||']' else '' end
||case when $P{P_CLIBLOQ}>0 then case
when $P{P_CLIBLOQ}=1 then ' Ativos'
when $P{P_CLIBLOQ}=2 then ' Inativos'
else '' end
else '' end

as filtro,

/*****************************************
*/
rcapar.parcod as gruporcacod,
rcapar.pardes as gruporcades,
rcapar.parfan as gruporcafan,
case
when $P{P_AGRUP}=1 then 'Geral'
when $P{P_AGRUP}=2 then cast(munufsigla||'-'||cliloc.locdes as varchar)
when $P{P_AGRUP}=3 then cast(munufsigla||'-'||mundes as varchar)
when $P{P_AGRUP}=4 then
	case
	when (cli_ate_seg='S' and cli_ate_ter='S' and cli_ate_qua='S' and cli_ate_qui='S' and cli_ate_sex='S') then '0-DIARIO'
	when cli_ate_seg='S' then '2-SEGUNDA'
	when cli_ate_ter='S' then '3-TERCA'
	when cli_ate_qua='S' then '4-QUARTA'
	when cli_ate_qui='S' then '5-QUINTA'
	when cli_ate_sex='S' then '6-SEXTA'
	when cli_ate_sab='S' then '7-SABADO'
	else 'NÃO DEFINIDO'
	end
else 'Geral' end as subgrupodes,
clipar.parcod as clicod,
clipar.pardes||'-'||clipar.parcnpjcpf as clides,
clipar.parfan as clifan,
clipar.parrua as cliend,
clipar.parbai as clibai,
clipar.parcep as clicep,
clipar.paremail as cliemail,
cliloc.locdes as clilocdes,
climun.mundes as climundes,
climun.munufsigla as cliuf,
case when clibloq='S' then 'Sim' else 'Não' end as clibloq,
case when clipar.pardddfone<'0' or clipar.pardddfone is null then clipar.parfone else '('||clipar.pardddfone||') '||clipar.parfone end as clifone,
clicontato,
clilim,
(select tctdoc from clitc join tc on tccod=clitctccod where clitccliparcod=clipar.parcod order by clitcseq desc limit 1)||' - '||cliplpg.plpgdes as clipgto,
clipar.paremail
from cli
join par clipar on cliparcod = clipar.parcod
join loc cliloc on cliloccod = cliloc.loccod
join rota clirota on locrotacod = clirota.rotacod
join mun climun on parmuncod = climun.muncod
join plpg cliplpg on cli_plano_pagamento = cliplpg.plpgcod
JOIN cliplpg cliplano ON cliplano.cliplpgcliparcod = cliparcod
left join clirca on clirca.clircacliparcod = clipar.parcod
LEFT JOIN par rcapar ON rcapar.parcod = clirca.clircarcaparcod
left join
(
select distinct
	fat_nf_dtemi,
	fat_forn_cod,
	fat_par_cod,
	fat_pro_cod
from sd.vw_fat) compra on clipar.parcod = compra.fat_par_cod

WHERE 1=1
and case when $P{P_DTCAD}='S' then 1=1 else DATE(cli_dt_cad) between cast($P{P_DTCADDE} as date) and cast($P{P_DTCADATE} as date) end
and case when $P{P_DTCOMP}='S' then 1=1 else DATE(compra.fat_nf_dtemi) between DATE($P{P_DTCOMPDE}) and DATE($P{P_DTCOMPATE}) end
and case when $P{P_FORN}=0 then 1=1 else compra.fat_forn_cod=$P{P_FORN} end
and case when $P{P_PRO}=0 then 1=1 else compra.fat_pro_cod=$P{P_PRO} end
and case when $P{P_RCA}=0 then 1=1 else rcapar.parcod=$P{P_RCA} end
and case when $P{P_MUN}=0 then 1=1 else climun.muncod=$P{P_MUN} end
and case when $P{P_UF}='0' then 1=1 else climun.munufsigla=$P{P_UF} end
and case when $P{P_ROTA}=0 then 1=1 else clirota.rotacod=$P{P_ROTA} end
and case when $P{P_LOC}=0 then 1=1 else cliloc.loccod=$P{P_LOC} end
and case when $P{P_RA}=0 then 1=1 else cliracod=$P{P_RA} end
and case when $P{P_AV}=0 then 1=1 else cli_av_codigo=$P{P_AV} end
and case when $P{P_GRUPOCLI}=0 then 1=1 else cli_cg_codigo=$P{P_GRUPOCLI} end

group by clipar.parcod, clipar.pardes,rcapar.parcod,climun.munufsigla,climun.munufsigla,cliloc.locdes,climun.mundes,cli.cli_ate_seg,cli.cli_ate_ter,cli.cli_ate_qua
,cli.cli_ate_qui,cli.cli_ate_sex,cli.cli_ate_sab,cli.clibloq,clicontato,cli.clilim,cliplpg.plpgdes

order by gruporcacod]]>
	</queryString>
	<field name="relatorio" class="java.lang.String"/>
	<field name="dtimpr" class="java.lang.String"/>
	<field name="versao" class="java.lang.String"/>
	<field name="filtro" class="java.lang.String"/>
	<field name="gruporcacod" class="java.lang.Integer"/>
	<field name="gruporcades" class="java.lang.String"/>
	<field name="gruporcafan" class="java.lang.String"/>
	<field name="subgrupodes" class="java.lang.String"/>
	<field name="clicod" class="java.lang.Integer"/>
	<field name="clides" class="java.lang.String"/>
	<field name="clifan" class="java.lang.String"/>
	<field name="cliend" class="java.lang.String"/>
	<field name="clibai" class="java.lang.String"/>
	<field name="clicep" class="java.lang.String"/>
	<field name="cliemail" class="java.lang.String"/>
	<field name="clilocdes" class="java.lang.String"/>
	<field name="climundes" class="java.lang.String"/>
	<field name="cliuf" class="java.lang.String"/>
	<field name="clibloq" class="java.lang.String"/>
	<field name="clifone" class="java.lang.String"/>
	<field name="clicontato" class="java.lang.String"/>
	<field name="clilim" class="java.math.BigDecimal"/>
	<field name="clipgto" class="java.lang.String"/>
	<field name="paremail" class="java.lang.String"/>
	<variable name="clicod_1" class="java.lang.Integer" resetType="Group" resetGroup="SubGrupo" calculation="Count">
		<variableExpression><![CDATA[$F{clicod}]]></variableExpression>
	</variable>
	<variable name="clicod_2" class="java.lang.Integer" resetType="Group" resetGroup="RCA" calculation="Count">
		<variableExpression><![CDATA[$F{clicod}]]></variableExpression>
	</variable>
	<variable name="clicod_3" class="java.lang.Integer" calculation="Count">
		<variableExpression><![CDATA[$F{clicod}]]></variableExpression>
	</variable>
	<group name="RCA" isReprintHeaderOnEachPage="true">
		<groupExpression><![CDATA[$F{gruporcafan}]]></groupExpression>
		<groupHeader>
			<band height="24" splitType="Prevent">
				<textField>
					<reportElement style="Grupo1" x="0" y="0" width="814" height="24" uuid="9342e69d-af36-4d03-ab72-b8888f933c33"/>
					<textElement verticalAlignment="Middle">
						<font isBold="true"/>
					</textElement>
					<textFieldExpression><![CDATA[$F{gruporcades}]]></textFieldExpression>
				</textField>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="13">
				<textField>
					<reportElement style="Total-Grupo" x="0" y="0" width="814" height="13" uuid="818c4367-b705-4b74-b498-10c6ab5596c1"/>
					<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
						<font size="6" isBold="true"/>
					</textElement>
					<textFieldExpression><![CDATA["Quantidade de clientes do RCA: "+$V{clicod_2}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<group name="SubGrupo" isReprintHeaderOnEachPage="true">
		<groupExpression><![CDATA[$F{subgrupodes}]]></groupExpression>
		<groupHeader>
			<band height="27" splitType="Prevent">
				<staticText>
					<reportElement style="Apr-Clean" x="0" y="15" width="25" height="12" uuid="e896ef4f-3af5-4ebe-a6ba-c16d30ed8bff"/>
					<textElement textAlignment="Left">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Cód.Cli]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="684" y="15" width="50" height="12" uuid="909bb0ec-c143-4934-a308-94504209c85e"/>
					<textElement textAlignment="Right">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Limite]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="25" y="15" width="165" height="12" uuid="c4bf5e5e-f5f1-48a6-b2d5-b2bd3a5e745d"/>
					<textElement textAlignment="Left">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Cliente]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="190" y="15" width="122" height="12" uuid="30ed049d-d365-4164-a37b-eecce0aa094e"/>
					<textElement textAlignment="Left">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Nome Fantasia]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="531" y="15" width="70" height="12" uuid="0f6330d4-30f3-4410-84c9-2a627495f373"/>
					<textElement textAlignment="Left">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Cidade]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="601" y="15" width="18" height="12" uuid="cf705e80-693d-4015-bd40-f065f6cd720f"/>
					<textElement textAlignment="Left">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Bloq]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="619" y="15" width="65" height="12" uuid="49115203-d302-4d8c-a90d-ab0c701383b3"/>
					<textElement textAlignment="Center">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Telefone]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="734" y="15" width="80" height="12" uuid="f2befba6-a46f-4fb2-9901-c27322561de6"/>
					<textElement>
						<font size="6"/>
					</textElement>
					<text><![CDATA[Pagto Padrão]]></text>
				</staticText>
				<textField>
					<reportElement style="Grupo1" x="0" y="0" width="814" height="15" uuid="89305608-9dae-4d59-a6f7-76f6099a11a4"/>
					<box topPadding="3" leftPadding="10" bottomPadding="3"/>
					<textElement verticalAlignment="Middle">
						<font size="7" isBold="true"/>
					</textElement>
					<textFieldExpression><![CDATA[$F{subgrupodes}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement style="Apr-Clean" x="312" y="15" width="149" height="12" uuid="afddfb52-14ff-4e13-851e-087c0ffad53b"/>
					<textElement textAlignment="Left">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Endereço]]></text>
				</staticText>
				<staticText>
					<reportElement style="Apr-Clean" x="461" y="15" width="70" height="12" uuid="e024a2d6-835b-4a07-84c7-03520b7af954"/>
					<textElement textAlignment="Left">
						<font size="6"/>
					</textElement>
					<text><![CDATA[Email]]></text>
				</staticText>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="13">
				<textField>
					<reportElement style="Total-Grupo" x="0" y="0" width="814" height="13" uuid="4abe211d-76c0-4d6e-84b5-fadf17eeb995"/>
					<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
						<font size="6" isBold="true"/>
					</textElement>
					<textFieldExpression><![CDATA["Quantidade de clientes " +$F{subgrupodes}+ ": "+$V{clicod_1}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<pageHeader>
		<band height="33" splitType="Stretch">
			<textField isStretchWithOverflow="true">
				<reportElement style="Filtros" stretchType="RelativeToBandHeight" x="0" y="17" width="814" height="16" uuid="a97b5470-fd34-4afd-b0ee-42ad543689a3"/>
				<box leftPadding="1" rightPadding="1"/>
				<textElement verticalAlignment="Middle" markup="html">
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{filtro}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement style="Data/Hora" x="566" y="0" width="248" height="17" uuid="1a30eeab-720b-4e64-9b1f-b06f483a1049"/>
				<box leftPadding="3" rightPadding="2"/>
				<textElement textAlignment="Right">
					<font size="8" isBold="false"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{dtimpr}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement style="Título" x="0" y="0" width="566" height="17" uuid="1c06d63c-600b-4240-911e-b6d5485eea01"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="10" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{relatorio}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<detail>
		<band height="12" splitType="Prevent">
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="25" height="12" uuid="02776981-f56e-4390-b4ec-3693fe4f418a"/>
				<textElement textAlignment="Center">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{clicod}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="531" y="0" width="70" height="12" uuid="08980bf6-1c03-49cc-8f0b-9f2e0b952097"/>
				<textElement textAlignment="Left">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{climundes}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="601" y="0" width="18" height="12" uuid="191000eb-8615-4e69-8341-c139e3355c87"/>
				<textElement textAlignment="Center">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{clibloq}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="619" y="0" width="65" height="12" uuid="806aaa80-252c-459a-ac33-1298ad4075a7"/>
				<textElement textAlignment="Center">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{clifone}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="684" y="0" width="50" height="12" uuid="e90e173f-abc8-46c7-a651-3bdc82e7a8e6"/>
				<textElement textAlignment="Right">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{clilim}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="734" y="0" width="80" height="12" uuid="e471f52d-93f1-4939-8f11-1ebfbb250d84"/>
				<textElement textAlignment="Center">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{clipgto}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="25" y="0" width="165" height="12" uuid="277fa7d1-08f7-4657-aea3-8c02d76bb687"/>
				<textElement textAlignment="Left">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{clides}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="190" y="0" width="122" height="12" uuid="c74f5b6c-72bc-4016-8b08-9f00931463b3"/>
				<textElement textAlignment="Left">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{clifan}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="312" y="0" width="149" height="12" uuid="0f4fc6d6-566e-47d7-8eea-7eb67536ddd8"/>
				<textElement textAlignment="Left">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{cliend}+" - "+$F{clibai}+" - "+$F{clicep}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement style="Linhas-Zebra" positionType="Float" stretchType="RelativeToBandHeight" x="461" y="0" width="70" height="12" uuid="de381d19-bb4b-4336-b6e5-b4d8476ccd5b"/>
				<textElement textAlignment="Left">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{cliemail}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<pageFooter>
		<band height="22" splitType="Stretch">
			<textField>
				<reportElement style="Versão" x="657" y="6" width="99" height="15" uuid="c10f6055-cc6b-4ff8-aaa8-d41cf221a09d"/>
				<box leftPadding="3" rightPadding="2"/>
				<textElement textAlignment="Right">
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA["Página "+$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement style="Versão" x="0" y="6" width="657" height="15" uuid="3bb55df0-6cdd-41e9-b9cc-e3c7aeb44d06"/>
				<box leftPadding="3" rightPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="7" isItalic="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{versao}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement style="Versão" x="756" y="6" width="58" height="15" uuid="37a3a4a7-651c-47d8-a164-ab19f3a1772e"/>
				<box leftPadding="3" rightPadding="2"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band height="12">
			<textField>
				<reportElement style="Total-Rel" x="0" y="0" width="814" height="12" uuid="0030a546-15d3-4e3e-ae0e-4fabaef02421"/>
				<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
					<font size="7" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA["Número de registros: "+$V{clicod_3}]]></textFieldExpression>
			</textField>
		</band>
	</summary>
	<noData>
		<band height="37">
			<staticText>
				<reportElement x="180" y="0" width="487" height="37" uuid="6dc4d10d-5a57-4f14-ba15-7d3d3de6d438"/>
				<textElement textAlignment="Center">
					<font size="14" isBold="true"/>
				</textElement>
				<text><![CDATA[Este relatório não possui informações referente aos filtros informados. Tente filtrar com outras informações.]]></text>
			</staticText>
		</band>
	</noData>
</jasperReport>
