<?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="chartsales" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="782" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" uuid="e112b412-18d4-43bb-bfc1-a7c390c29f70">
	<property name="ireport.scriptlethandling" value="0"/>
	<property name="ireport.encoding" value="UTF-8"/>
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<import value="net.sf.jasperreports.engine.*"/>
	<import value="java.util.*"/>
	<import value="net.sf.jasperreports.engine.data.*"/>
	<parameter name="ARG" class="java.lang.Object" isForPrompting="false"/>
	<queryString>
		<![CDATA[SELECT CATEGORIES.ID, CATEGORIES.NAME,
Sum(TICKETLINES.UNITS) AS QTY,
Sum((TICKETLINES.PRICE * TICKETLINES.UNITS) + ((TICKETLINES.PRICE * TAXES.RATE)* TICKETLINES.UNITS)) AS CATTOTAL
FROM (TICKETS INNER JOIN RECEIPTS ON TICKETS.ID = RECEIPTS.ID) INNER JOIN ((CATEGORIES INNER JOIN PRODUCTS ON CATEGORIES.ID = PRODUCTS.CATEGORY) INNER JOIN (TAXES INNER JOIN TICKETLINES ON TAXES.ID = TICKETLINES.TAXID) ON PRODUCTS.ID = TICKETLINES.PRODUCT) ON TICKETS.ID = TICKETLINES.TICKET

GROUP BY categories.NAME]]>
	</queryString>
	<field name="ID" class="java.lang.String"/>
	<field name="NAME" class="java.lang.String"/>
	<field name="QTY" class="java.lang.Double"/>
	<field name="CATTOTAL" class="java.lang.Double"/>
	<background>
		<band/>
	</background>
	<title>
		<band height="54">
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-10" mode="Transparent" x="0" y="0" width="375" height="30" forecolor="#33CCFF" backcolor="#FFFFFF" uuid="69e44e6c-86e5-4946-bc7d-81347f487361"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#FFFFFF"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Top" rotation="None">
					<font fontName="SansSerif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					<paragraph lineSpacing="Single"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{label.title.bycategory}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-19" mode="Opaque" x="647" y="0" width="135" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="e23f830c-8dc9-4980-b64c-ecadac76dc80"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Top" rotation="None">
					<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					<paragraph lineSpacing="Single"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{label.printed}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report" pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="false">
				<reportElement key="textField" x="647" y="14" width="135" height="15" uuid="95b8b2fa-9438-4151-83ea-6572050592de"/>
				<textElement textAlignment="Right">
					<font fontName="Arial" size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-10" mode="Opaque" x="0" y="33" width="50" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="bb5128eb-b94e-44cc-ace9-d4db9f47ae91"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None">
					<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					<paragraph lineSpacing="Single"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{label.period}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement key="textField-8" mode="Transparent" x="50" y="33" width="110" height="15" uuid="4fb626d6-608a-4c7c-a4c0-085b9b433e16"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#FFFFFF"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
					<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					<paragraph lineSpacing="Single"/>
				</textElement>
				<textFieldExpression><![CDATA[com.unicenta.format.Formats.TIMESTAMP.formatValue((java.util.Date)((Object[])((Object[])$P{ARG})[0])[1])]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement key="staticText-6" mode="Transparent" x="160" y="33" width="10" height="15" uuid="330aadca-d0f0-4844-962c-68bde20d553b"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#FFFFFF"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
					<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					<paragraph lineSpacing="Single"/>
				</textElement>
				<text><![CDATA[-
]]></text>
			</staticText>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement key="textField-9" mode="Transparent" x="170" y="33" width="110" height="15" uuid="4bd37982-8136-4a3a-886c-b1f35b6c5d08"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#FFFFFF"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None">
					<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					<paragraph lineSpacing="Single"/>
				</textElement>
				<textFieldExpression><![CDATA[com.unicenta.format.Formats.TIMESTAMP.formatValue((java.util.Date)((Object[])((Object[])$P{ARG})[0])[3])]]></textFieldExpression>
			</textField>
			<rectangle radius="5">
				<reportElement key="rectangle-1" mode="Opaque" x="0" y="50" width="782" height="2" forecolor="#33CCFF" backcolor="#33CCFF" uuid="618299eb-99bb-42b7-bd70-53fe43f20329"/>
				<graphicElement fill="Solid">
					<pen lineWidth="0.25" lineStyle="Solid"/>
				</graphicElement>
			</rectangle>
		</band>
	</title>
	<pageHeader>
		<band/>
	</pageHeader>
	<columnHeader>
		<band/>
	</columnHeader>
	<detail>
		<band/>
	</detail>
	<columnFooter>
		<band/>
	</columnFooter>
	<pageFooter>
		<band height="30">
			<staticText>
				<reportElement x="0" y="5" width="100" height="15" uuid="452a2f2c-8f4e-499b-b3e0-fbce7b041294"/>
				<textElement>
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<text><![CDATA[rpt:sales_chart_sales]]></text>
			</staticText>
		</band>
	</pageFooter>
	<summary>
		<band height="440">
			<stackedBar3DChart>
				<chart theme="default">
					<reportElement mode="Transparent" x="0" y="33" width="782" height="407" uuid="d477ed8e-fa4d-4428-9d3e-971b01375e64"/>
					<chartTitle position="Top"/>
					<chartSubtitle>
						<font size="8"/>
					</chartSubtitle>
					<chartLegend position="Bottom">
						<font size="8"/>
					</chartLegend>
				</chart>
				<categoryDataset>
					<categorySeries>
						<seriesExpression><![CDATA[$F{NAME}]]></seriesExpression>
						<categoryExpression><![CDATA[com.unicenta.format.Formats.CURRENCY.formatValue($F{CATTOTAL})]]></categoryExpression>
						<valueExpression><![CDATA[$F{QTY}]]></valueExpression>
					</categorySeries>
				</categoryDataset>
				<bar3DPlot>
					<plot labelRotation="75.0">
						<seriesColor seriesOrder="0" color="#1ABEF3"/>
						<seriesColor seriesOrder="1" color="#B6F90D"/>
						<seriesColor seriesOrder="2" color="#FFCC00"/>
						<seriesColor seriesOrder="3" color="#96B1B3"/>
						<seriesColor seriesOrder="4" color="#999900"/>
						<seriesColor seriesOrder="5" color="#251518"/>
						<seriesColor seriesOrder="6" color="#C5D1C9"/>
						<seriesColor seriesOrder="7" color="#3AE7F3"/>
						<seriesColor seriesOrder="8" color="#333353"/>
						<seriesColor seriesOrder="9" color="#45DE51"/>
						<seriesColor seriesOrder="10" color="#0F5B6A"/>
						<seriesColor seriesOrder="11" color="#9F86A1"/>
						<seriesColor seriesOrder="12" color="#7BBDEA"/>
						<seriesColor seriesOrder="13" color="#4B424F"/>
						<seriesColor seriesOrder="14" color="#C7A5BC"/>
						<seriesColor seriesOrder="15" color="#7FA826"/>
						<seriesColor seriesOrder="16" color="#CC6B9E"/>
						<seriesColor seriesOrder="17" color="#CFC486"/>
						<seriesColor seriesOrder="18" color="#2B4C9F"/>
						<seriesColor seriesOrder="19" color="#FE78CA"/>
					</plot>
					<itemLabel>
						<font size="5"/>
					</itemLabel>
					<categoryAxisLabelExpression><![CDATA[$R{label.axisx}]]></categoryAxisLabelExpression>
					<categoryAxisFormat labelRotation="75.0">
						<axisFormat>
							<labelFont>
								<font size="5"/>
							</labelFont>
						</axisFormat>
					</categoryAxisFormat>
					<valueAxisLabelExpression><![CDATA[$R{label.axisy}]]></valueAxisLabelExpression>
					<valueAxisFormat>
						<axisFormat>
							<labelFont>
								<font size="5"/>
							</labelFont>
							<tickLabelFont>
								<font size="8"/>
							</tickLabelFont>
						</axisFormat>
					</valueAxisFormat>
				</bar3DPlot>
			</stackedBar3DChart>
		</band>
	</summary>
</jasperReport>
