<?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="passageirosViajar" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="953cc4ce-9ab8-45a3-b9b1-2c8621b7ac5f">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="DATA_INICIO" class="java.util.Date">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="DATA_FINAL" class="java.util.Date">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="EMPRESA_ID" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="LS_CATEGORIA" class="java.lang.String"/>
	<parameter name="USUARIO" class="java.lang.Integer"/>
	<parameter name="PASSAGEM_ABERTA" class="java.lang.String"/>
	<queryString>
		<![CDATA[select cj.numseriepreimpresa, nvl(cj.empresacorrida_id, ma.marca_id) empresacorrida_id,
       em.nombempresa, es.cveestado, cj.numfoliosistema, cj.fechorventa, cj.feccorrida,
       cj.preciopagado
  from boleto cj,
       empresa em,
       punto_venta pv,
       parada pa,
       ciudad ci,
       estado es,
       marca ma
 where cj.activo = 1
   and nvl(cj.empresacorrida_id, ma.empresa_id) = em.empresa_id
   and cj.marca_id = ma.marca_id
   and cj.puntoventa_id = pv.puntoventa_id
   and pv.parada_id = pa.parada_id
   and pa.ciudad_id = ci.ciudad_id
   and ci.estado_id = es.estado_id
   and nvl(cj.empresacorrida_id, ma.empresa_id) = $P{EMPRESA_ID}
   and cj.indcancelacion = 0 
   and cj.motivocancelacion_id is null
   $P!{LS_CATEGORIA}
   and trunc(cj.fechorventa) between trunc($P{DATA_INICIO}) and trunc($P{DATA_FINAL})
   $P!{PASSAGEM_ABERTA}
 order by em.nombempresa, es.cveestado, cj.fechorventa]]>
	</queryString>
	<field name="NUMSERIEPREIMPRESA" class="java.lang.String"/>
	<field name="EMPRESACORRIDA_ID" class="java.math.BigDecimal"/>
	<field name="NOMBEMPRESA" class="java.lang.String"/>
	<field name="CVEESTADO" class="java.lang.String"/>
	<field name="NUMFOLIOSISTEMA" class="java.lang.String"/>
	<field name="FECHORVENTA" class="java.sql.Timestamp"/>
	<field name="FECCORRIDA" class="java.sql.Timestamp"/>
	<field name="PRECIOPAGADO" class="java.math.BigDecimal"/>
	<variable name="NOMBEMPRESA_1" class="java.lang.Integer" resetType="Page" calculation="Count">
		<variableExpression><![CDATA[$F{NOMBEMPRESA}]]></variableExpression>
	</variable>
	<variable name="NUMFOLIOSISTEMA_1" class="java.lang.Integer" calculation="Count">
		<variableExpression><![CDATA[$F{NUMFOLIOSISTEMA}]]></variableExpression>
	</variable>
	<variable name="PRECIOPAGADO_1" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{PRECIOPAGADO}]]></variableExpression>
	</variable>
	<variable name="PRECIOPAGADO_2" class="java.math.BigDecimal" resetType="Group" resetGroup="CVEESTADO" calculation="Sum">
		<variableExpression><![CDATA[$F{PRECIOPAGADO}]]></variableExpression>
	</variable>
	<variable name="NUMFOLIOSISTEMA_2" class="java.lang.Integer" resetType="Group" resetGroup="CVEESTADO" calculation="Count">
		<variableExpression><![CDATA[$F{NUMFOLIOSISTEMA}]]></variableExpression>
	</variable>
	<group name="EMPRESACORRIDA_ID">
		<groupExpression><![CDATA[$F{EMPRESACORRIDA_ID}]]></groupExpression>
	</group>
	<group name="CVEESTADO">
		<groupExpression><![CDATA[$F{CVEESTADO}]]></groupExpression>
		<groupFooter>
			<band height="21">
				<line>
					<reportElement uuid="ff2d789e-d1a7-4a14-b562-9a16c3151581" x="3" y="2" width="550" height="1"/>
				</line>
				<line>
					<reportElement uuid="7f823bdb-3f3e-4ef8-a8f5-cff9b209950f" x="3" y="19" width="550" height="1"/>
				</line>
				<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
					<reportElement uuid="29243b22-1d58-42a5-9b9b-fdcf6d5f0af8" x="282" y="5" width="112" height="13"/>
					<textElement textAlignment="Right"/>
					<textFieldExpression><![CDATA[$V{PRECIOPAGADO_2}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="true">
					<reportElement uuid="04b267c9-2329-47c7-9b3f-752180765e40" x="124" y="5" width="100" height="13"/>
					<textElement textAlignment="Right"/>
					<textFieldExpression><![CDATA[$V{NUMFOLIOSISTEMA_2}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="cbc58601-2b80-474c-9772-123e4753148f" x="3" y="3" width="111" height="13"/>
					<textElement markup="none"/>
					<textFieldExpression><![CDATA["Total da UF: " + $F{CVEESTADO}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<pageHeader>
		<band height="74" splitType="Stretch">
			<textField>
				<reportElement uuid="8493f349-6c6a-4344-8cf2-0ea9c9b74864" x="0" y="0" width="186" height="27"/>
				<textElement>
					<font size="18" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{NOMBEMPRESA}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement uuid="423ba892-08af-4e8f-9377-a116e34bbc0c" x="0" y="27" width="186" height="18"/>
				<textElement>
					<font size="12"/>
				</textElement>
				<text><![CDATA[Passageiros a Viajar]]></text>
			</staticText>
			<textField>
				<reportElement uuid="16e1afb9-2daf-47fd-bd15-f22e00d67c79" x="0" y="45" width="392" height="13"/>
				<textElement markup="none"/>
				<textFieldExpression><![CDATA["Período: De " + new SimpleDateFormat("dd/MM/yyyy ").format($P{DATA_INICIO}) + " a " + new SimpleDateFormat("dd/MM/yyyy ").format($P{DATA_FINAL})]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="f892d882-409f-4f4f-b0d2-1628abb65e6f" x="309" y="9" width="244" height="13"/>
				<textElement textAlignment="Right" markup="none"/>
				<textFieldExpression><![CDATA["Data/Hora: " +
new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date())]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="1a4a2cbf-c63b-4e5b-b4f0-fcdc9ac79c0e" x="402" y="44" width="151" height="13"/>
				<textElement textAlignment="Right" markup="none"/>
				<textFieldExpression><![CDATA["Impresso por " + $P{USUARIO}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement uuid="d3ec23ad-49db-4b62-b775-031b1f69faf0" x="1" y="59" width="555" height="1"/>
			</line>
			<staticText>
				<reportElement uuid="76bbc785-56d6-40c1-88bc-a220572a1d4c" x="1" y="59" width="185" height="13"/>
				<textElement/>
				<text><![CDATA[Filtros: Período, Empresa, Categoria]]></text>
			</staticText>
			<textField>
				<reportElement uuid="b05e4015-9772-46c4-b7cf-1b49f76fd034" x="402" y="30" width="151" height="13"/>
				<textElement textAlignment="Right" markup="none"/>
				<textFieldExpression><![CDATA["Página: " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="16" splitType="Stretch">
			<staticText>
				<reportElement uuid="06a33996-ace7-4c67-95c6-75e6b077632d" x="63" y="2" width="46" height="13"/>
				<textElement/>
				<text><![CDATA[UF]]></text>
			</staticText>
			<staticText>
				<reportElement uuid="2315737d-4988-46fa-a22e-4fcfa7aef43b" x="114" y="2" width="72" height="13"/>
				<textElement/>
				<text><![CDATA[Número]]></text>
			</staticText>
			<staticText>
				<reportElement uuid="0045ae3e-0498-445b-8fc7-e92e8a431c31" x="190" y="2" width="59" height="13"/>
				<textElement/>
				<text><![CDATA[Emissão]]></text>
			</staticText>
			<staticText>
				<reportElement uuid="c517a149-9726-4621-8efb-4f662a422bd4" x="254" y="2" width="65" height="13"/>
				<textElement/>
				<text><![CDATA[Viagem]]></text>
			</staticText>
			<staticText>
				<reportElement uuid="9791a1f9-caa7-476f-8331-fabc1ee09e7d" x="330" y="2" width="64" height="13"/>
				<textElement textAlignment="Right"/>
				<text><![CDATA[Valor]]></text>
			</staticText>
			<line>
				<reportElement uuid="39b86da4-7678-4dc0-af7f-4d84dcb53ac6" x="0" y="15" width="555" height="1"/>
			</line>
			<line>
				<reportElement uuid="ac5ee316-a5a2-4bd9-8384-db2dbf7c9447" x="1" y="2" width="555" height="1"/>
			</line>
			<staticText>
				<reportElement uuid="2cc1f42a-e822-4317-ae00-808bf0da2133" x="3" y="3" width="55" height="13"/>
				<textElement/>
				<text><![CDATA[Série/Subs]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="16" splitType="Stretch">
			<textField isBlankWhenNull="true">
				<reportElement uuid="2a9e93e0-2af2-4a11-a6b7-928b09da8f95" x="63" y="1" width="46" height="13"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{CVEESTADO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement uuid="c6ccd2c0-3ce3-442f-b3a3-4c2ce1cb4e61" x="115" y="1" width="71" height="13"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{NUMFOLIOSISTEMA}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement uuid="93c9e2f4-2143-48f3-972b-1a50eb28530d" x="191" y="1" width="58" height="13"/>
				<textElement/>
				<textFieldExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy ").format($F{FECHORVENTA})]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement uuid="58b201d8-a164-47c5-94a2-96f27e779aac" x="254" y="1" width="65" height="13"/>
				<textElement/>
				<textFieldExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy ").format($F{FECCORRIDA})]]></textFieldExpression>
			</textField>
			<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
				<reportElement uuid="6b607479-5d7e-4234-a798-4ed9f4bfc81a" x="330" y="1" width="64" height="13"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{PRECIOPAGADO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement uuid="ff556fd3-09fe-46f0-aaaf-7a9d26c272a9" x="3" y="1" width="55" height="13"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{NUMSERIEPREIMPRESA}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<summary>
		<band height="17" splitType="Stretch">
			<textField isBlankWhenNull="true">
				<reportElement uuid="e1b9dc69-f615-4cbb-97d6-e449329e2397" x="124" y="1" width="100" height="13"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$V{NUMFOLIOSISTEMA_1}]]></textFieldExpression>
			</textField>
			<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
				<reportElement uuid="2b8ecb41-97ef-40eb-8db6-491211a24529" x="282" y="1" width="112" height="13"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$V{PRECIOPAGADO_1}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement uuid="e1c7c7fa-8e35-4b80-8e33-0b55046a581b" x="1" y="1" width="100" height="13"/>
				<textElement/>
				<text><![CDATA[Total]]></text>
			</staticText>
			<line>
				<reportElement uuid="f5fc9ff7-cb67-4c5b-a68b-21608306f806" x="1" y="14" width="552" height="1"/>
			</line>
		</band>
	</summary>
</jasperReport>
