<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.0.final using JasperReports Library version 6.20.0-2bc7ab61c56f459e8176eb05c7705e145cd400ad  -->
<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="Blank_Letter_1" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a80a680a-215e-413c-b7e2-1163d7d22a12">
	<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
	<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mysql orodiint_bsn"/>
	<queryString language="SQL">
		<![CDATA[SELECT
	pro.nombre AS promocion,
	COUNT( DETP.id_premio ) AS Premios_entregados,
	pro_premio.precio_unitario,
	pro_premio.premio,
	pro_premio.detalle,

	
		(COUNT( DETP.id_premio ) * 	pro_premio.precio_unitario )TOTAL_bs,
	
	
	MONTH ( gan.fecha ) mes ,
	
Upper (CONCAT(MONTHNAME(gan.fecha ), ' ', YEAR(gan.fecha )) 	) 
	 
	 as mes_ano ,
	 
	 
	 0.00 as Variable_1
	 
	 
FROM
	promocion AS pro
	INNER JOIN pro_ganador AS gan ON pro.id_promocion = gan.id_promocion
	INNER JOIN pro_det_premio AS DETP ON gan.premio = DETP.id_det_premio
	INNER JOIN pro_premio ON DETP.id_premio = pro_premio.id_premio 
WHERE
	( pro.estado = 1 ) 
GROUP BY
	pro.nombre,
	pro_premio.premio,
	pro_premio.detalle,
	pro_premio.cantidad,
	pro_premio.precio_unitario,
	MONTH ( gan.fecha ) ,
		Upper (CONCAT(MONTHNAME(gan.fecha ), ' ', YEAR(gan.fecha )) 	) 
ORDER BY
	mes_ano ,  TOTAL_bs ASC]]>
	</queryString>
	<field name="promocion" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.name" value="nombre"/>
		<property name="com.jaspersoft.studio.field.label" value="promocion"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="promocion"/>
	</field>
	<field name="Premios_entregados" class="java.lang.Long">
		<property name="com.jaspersoft.studio.field.name" value="Premios_entregados"/>
		<property name="com.jaspersoft.studio.field.label" value="Premios_entregados"/>
	</field>
	<field name="precio_unitario" class="java.math.BigDecimal">
		<property name="com.jaspersoft.studio.field.name" value="precio_unitario"/>
		<property name="com.jaspersoft.studio.field.label" value="precio_unitario"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="pro_premio"/>
	</field>
	<field name="premio" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.name" value="premio"/>
		<property name="com.jaspersoft.studio.field.label" value="premio"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="pro_premio"/>
	</field>
	<field name="detalle" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.name" value="detalle"/>
		<property name="com.jaspersoft.studio.field.label" value="detalle"/>
		<property name="com.jaspersoft.studio.field.tree.path" value="pro_premio"/>
	</field>
	<field name="TOTAL_bs" class="java.math.BigDecimal">
		<property name="com.jaspersoft.studio.field.name" value="TOTAL_bs"/>
		<property name="com.jaspersoft.studio.field.label" value="TOTAL_bs"/>
	</field>
	<field name="mes" class="java.lang.Integer">
		<property name="com.jaspersoft.studio.field.name" value="mes"/>
		<property name="com.jaspersoft.studio.field.label" value="mes"/>
	</field>
	<field name="mes_ano" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.name" value="mes_ano"/>
		<property name="com.jaspersoft.studio.field.label" value="mes_ano"/>
	</field>
	<field name="Variable_1" class="java.math.BigDecimal">
		<property name="com.jaspersoft.studio.field.name" value="Variable_1"/>
		<property name="com.jaspersoft.studio.field.label" value="Variable_1"/>
	</field>
	<variable name="Variable_1" class="java.math.BigDecimal" resetType="Group" resetGroup="premio" calculation="Sum">
		<variableExpression><![CDATA[$F{TOTAL_bs}]]></variableExpression>
	</variable>
	<group name="premio" minDetailsToStartFromTop="3">
		<groupExpression><![CDATA[$F{mes_ano}]]></groupExpression>
		<groupHeader>
			<band height="28">
				<property name="com.jaspersoft.studio.unit.height" value="px"/>
				<textField>
					<reportElement x="0" y="5" width="260" height="20" uuid="badb9d86-0cf3-4e34-a8c4-fe8797b4a72a"/>
					<textElement>
						<font isBold="true"/>
					</textElement>
					<textFieldExpression><![CDATA[$F{mes_ano}]]></textFieldExpression>
				</textField>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="10"/>
		</groupFooter>
	</group>
	<title>
		<band height="58" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="3" width="570" height="20" uuid="3bb334ac-4fc0-42e5-9afe-a85fd0317e73">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Center">
					<font size="13" isBold="true"/>
				</textElement>
				<text><![CDATA[RESUMEN DE PREMIOS DE LA PROMOCION:]]></text>
			</staticText>
			<textField>
				<reportElement x="0" y="24" width="570" height="20" uuid="2de6be50-84aa-40cb-baee-2332b960451e">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Center">
					<font size="13" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{promocion}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="41">
			<property name="com.jaspersoft.studio.unit.height" value="px"/>
			<staticText>
				<reportElement x="14" y="1" width="151" height="34" uuid="a451bb37-a9bf-4573-9697-b06e58d7580f">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="3d48083e-390b-49a9-9bb6-90c22bbd4357"/>
					<property name="com.jaspersoft.studio.unit.y" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[DETALLE]]></text>
			</staticText>
			<staticText>
				<reportElement x="378" y="1" width="90" height="34" uuid="f77052d0-f806-4ff0-8f7f-a3fdcc1d44db">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="3d48083e-390b-49a9-9bb6-90c22bbd4357"/>
					<property name="com.jaspersoft.studio.unit.y" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[PREMIOS ENTREGADOS]]></text>
			</staticText>
			<staticText>
				<reportElement x="480" y="1" width="90" height="34" uuid="fec3d120-46f7-4ed6-aeab-f5c38b1bdeee">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="3d48083e-390b-49a9-9bb6-90c22bbd4357"/>
					<property name="com.jaspersoft.studio.unit.y" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[TOTAL]]></text>
			</staticText>
			<staticText>
				<reportElement x="242" y="2" width="87" height="34" uuid="0938134d-7826-41dd-87a7-4852641a131d">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="3d48083e-390b-49a9-9bb6-90c22bbd4357"/>
					<property name="com.jaspersoft.studio.unit.y" value="px"/>
				</reportElement>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[PRECIO  UNITARIO]]></text>
			</staticText>
		</band>
	</pageHeader>
	<detail>
		<band height="18">
			<textField textAdjust="StretchHeight">
				<reportElement x="0" y="1" width="249" height="15" uuid="002e1c79-15a0-4cc8-ba41-59667550e86e">
					<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="3d48083e-390b-49a9-9bb6-90c22bbd4357"/>
					<property name="com.jaspersoft.studio.unit.y" value="px"/>
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textFieldExpression><![CDATA[$F{detalle}]]></textFieldExpression>
			</textField>
			<textField pattern="#,###.00#;(#,###.00#-)">
				<reportElement x="270" y="1" width="47" height="15" uuid="d55c7b4a-4010-4689-98f8-f42f48ef7644">
					<property name="com.jaspersoft.studio.unit.y" value="px"/>
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textFieldExpression><![CDATA[$F{precio_unitario}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.###;(#,##0.###-)">
				<reportElement x="401" y="1" width="54" height="15" uuid="c9a4525e-8a0c-4b86-802c-1a804e4f1130"/>
				<textElement textAlignment="Center"/>
				<textFieldExpression><![CDATA[$F{Premios_entregados}]]></textFieldExpression>
			</textField>
			<textField pattern="#,###.00#;(#,###.00#-)">
				<reportElement x="475" y="1" width="75" height="15" uuid="c410315a-293e-4e54-bc53-bc57c125883d">
					<property name="com.jaspersoft.studio.unit.y" value="px"/>
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{TOTAL_bs}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<pageFooter>
		<band height="35" splitType="Stretch">
			<textField pattern="d/M/yyyy h:mm a">
				<reportElement x="405" y="21" width="80" height="10" uuid="f35cdc76-0c1f-4a3d-9c25-dd5bb412a7fd">
					<property name="com.jaspersoft.studio.unit.height" value="px"/>
				</reportElement>
				<textElement verticalAlignment="Middle">
					<font fontName="Tahoma" size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="361" y="21" width="44" height="10" uuid="7abf745d-937e-4f8d-a865-083014bfa9a8"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font fontName="Tahoma" size="7"/>
				</textElement>
				<text><![CDATA[Impreso el :    ]]></text>
			</staticText>
			<textField>
				<reportElement x="360" y="10" width="100" height="10" uuid="dbe4c5ce-0796-446c-97e3-1dd0c1ef5d03"/>
				<textElement textAlignment="Right">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA["Pagina " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement x="460" y="10" width="100" height="10" uuid="e5129df7-8fb8-46f3-a0dd-6649dfd6b50d"/>
				<textElement textAlignment="Left">
					<font size="6"/>
				</textElement>
				<textFieldExpression><![CDATA[" de " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
</jasperReport>
