<?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="chartpiecategoryproductsales" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" uuid="d73a18b3-5531-42e3-a9c2-4b5aed9cde17">
	<property name="ireport.scriptlethandling" value="0"/>
	<property name="ireport.encoding" value="UTF-8"/>
	<property name="ireport.zoom" value="1.5"/>
	<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.`NAME` AS CAT,
     SUM(TICKETLINES.UNITS) AS UNITS,
     SUM((TICKETLINES.PRICE+TICKETLINES.PRICE*TAXES.RATE)*TICKETLINES.UNITS) AS TOTAL
FROM
     `TICKETLINES` TICKETLINES LEFT OUTER JOIN `PRODUCTS` PRODUCTS ON TICKETLINES.`PRODUCT` = PRODUCTS.`ID`
     LEFT OUTER JOIN `TAXES` TAXES ON TICKETLINES.`TAXID` = TAXES.`ID`
     LEFT OUTER JOIN `TICKETS` TICKETS ON TICKETLINES.`TICKET` = TICKETS.`ID`
     LEFT OUTER JOIN `RECEIPTS` RECEIPTS ON TICKETS.`ID` = RECEIPTS.`ID`
     LEFT OUTER JOIN `CATEGORIES` CATEGORIES ON PRODUCTS.`CATEGORY` = CATEGORIES.`ID`
WHERE
     LENGTH(CATEGORIES.NAME) > 1
GROUP BY
     CATEGORIES.ID
ORDER BY
     CATEGORIES.NAME ASC]]>
	</queryString>
	<field name="CAT" class="java.lang.String"/>
	<field name="UNITS" class="java.lang.Double"/>
	<field name="TOTAL" class="java.lang.Double"/>
	<title>
		<band height="52">
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-25" mode="Transparent" x="0" y="0" width="375" height="30" forecolor="#33CCFF" backcolor="#FFFFFF" uuid="19688817-97de-4b9b-a334-4b8f8625314e"/>
				<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.pie}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-10" mode="Opaque" x="400" y="0" width="135" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="f33b28ea-36f1-4503-bc8c-3a6b46d66d83"/>
				<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="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.printed}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report" pattern="EEEEE dd MMMMM yyyy" isBlankWhenNull="false">
				<reportElement key="textField" x="400" y="19" width="135" height="15" uuid="f410a7e8-5d4b-4448-b007-eb9da73a5402"/>
				<textElement textAlignment="Right">
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-19" mode="Opaque" x="0" y="33" width="50" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="b49ae8ea-e94e-4a2d-8101-885c9047a2df"/>
				<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="ae1392ff-2cf7-4645-ad5a-4d9ed609aac4"/>
				<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.DATE.formatValue((java.util.Date)((Object[])((Object[])$P{ARG})[0])[1])]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement key="staticText-1" mode="Transparent" x="160" y="33" width="10" height="15" uuid="89d6c90c-cae6-4cce-b522-567439026d8a"/>
				<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="0eec4fd4-123f-4443-a2af-92179893c836"/>
				<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.DATE.formatValue((java.util.Date)((Object[])((Object[])$P{ARG})[0])[3])]]></textFieldExpression>
			</textField>
			<rectangle radius="5">
				<reportElement key="rectangle-2" mode="Opaque" x="0" y="50" width="535" height="2" forecolor="#33CCFF" backcolor="#33CCFF" uuid="dddf65d2-d40f-407d-b1b0-00207c11558b"/>
				<graphicElement fill="Solid">
					<pen lineWidth="0.25" lineStyle="Solid"/>
				</graphicElement>
			</rectangle>
		</band>
	</title>
	<pageFooter>
		<band height="30">
			<line>
				<reportElement key="line-3" mode="Opaque" x="0" y="5" width="535" height="1" forecolor="#000000" backcolor="#FFFFFF" uuid="72eb1f65-99b4-44a3-ad39-b36bd135a5f0"/>
				<graphicElement fill="Solid">
					<pen lineWidth="0.25" lineStyle="Solid"/>
				</graphicElement>
			</line>
			<staticText>
				<reportElement x="0" y="10" width="100" height="15" uuid="2644099e-bb17-4b63-89b6-19b09b4f00ab"/>
				<textElement>
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<text><![CDATA[rpt:piesalescat]]></text>
			</staticText>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-6" mode="Opaque" x="478" y="10" width="20" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="fc5657fc-2585-4d04-aa03-651c7521ba11"/>
				<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="Top" 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[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement key="staticText-5" mode="Opaque" x="504" y="10" width="10" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="333cf9a4-e772-45a7-95fd-f0b329a65d66"/>
				<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="Top" 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 evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement key="textField-7" mode="Opaque" x="514" y="10" width="20" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="4cb2eff2-9038-4641-8113-92e24ed03239"/>
				<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="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					<paragraph lineSpacing="Single"/>
				</textElement>
				<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band height="654">
			<pie3DChart>
				<chart isShowLegend="true" renderType="svg" theme="default">
					<reportElement isPrintRepeatedValues="false" mode="Transparent" x="0" y="0" width="535" height="320" uuid="ef7f1ba3-372a-4131-8d7e-08f2f9de3b1d"/>
					<chartTitle position="Top">
						<font fontName="SansSerif" size="12" isBold="true" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
						<titleExpression><![CDATA[$R{label.pietitleunit}]]></titleExpression>
					</chartTitle>
					<chartSubtitle>
						<font fontName="SansSerif" size="10" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</chartSubtitle>
					<chartLegend position="Bottom">
						<font fontName="SansSerif" size="8" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</chartLegend>
				</chart>
				<pieDataset>
					<keyExpression><![CDATA[$F{CAT}]]></keyExpression>
					<valueExpression><![CDATA[$F{UNITS}]]></valueExpression>
					<labelExpression><![CDATA[com.unicenta.format.Formats.DOUBLE.formatValue(new Double($F{UNITS}.doubleValue()))]]></labelExpression>
				</pieDataset>
				<pie3DPlot isCircular="true">
					<plot>
						<seriesColor seriesOrder="0" color="#8ECE4C"/>
						<seriesColor seriesOrder="1" color="#79C8D9"/>
						<seriesColor seriesOrder="2" color="#2FDE29"/>
						<seriesColor seriesOrder="3" color="#BCC30B"/>
						<seriesColor seriesOrder="4" color="#699425"/>
						<seriesColor seriesOrder="5" color="#ED8D5D"/>
						<seriesColor seriesOrder="6" color="#9344C4"/>
						<seriesColor seriesOrder="7" color="#1430C5"/>
						<seriesColor seriesOrder="8" color="#8F0B77"/>
						<seriesColor seriesOrder="9" color="#C4B65F"/>
						<seriesColor seriesOrder="10" color="#74B550"/>
						<seriesColor seriesOrder="11" color="#440AB1"/>
						<seriesColor seriesOrder="12" color="#9C73E4"/>
						<seriesColor seriesOrder="13" color="#514D7B"/>
						<seriesColor seriesOrder="14" color="#276974"/>
						<seriesColor seriesOrder="15" color="#99F90B"/>
						<seriesColor seriesOrder="16" color="#3009F0"/>
						<seriesColor seriesOrder="17" color="#5972C9"/>
						<seriesColor seriesOrder="18" color="#051F2A"/>
						<seriesColor seriesOrder="19" color="#21E5AB"/>
					</plot>
					<itemLabel>
						<font size="8"/>
					</itemLabel>
				</pie3DPlot>
			</pie3DChart>
			<pie3DChart>
				<chart isShowLegend="true" renderType="svg" theme="default">
					<reportElement positionType="FixRelativeToBottom" mode="Transparent" x="0" y="334" width="535" height="320" uuid="2a8dd68e-485c-47b2-998d-3c1cb7a5aa34"/>
					<chartTitle position="Top">
						<font fontName="SansSerif" size="12" isBold="true" pdfFontName="Helvetica" pdfEncoding="Cp1252"/>
						<titleExpression><![CDATA[$R{label.pietitlecost}]]></titleExpression>
					</chartTitle>
					<chartSubtitle>
						<font fontName="SansSerif" size="8" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</chartSubtitle>
					<chartLegend position="Bottom">
						<font fontName="SansSerif" size="8" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</chartLegend>
				</chart>
				<pieDataset>
					<keyExpression><![CDATA[$F{CAT}]]></keyExpression>
					<valueExpression><![CDATA[$F{TOTAL}]]></valueExpression>
					<labelExpression><![CDATA[com.unicenta.format.Formats.CURRENCY.formatValue($F{TOTAL}).toString()]]></labelExpression>
				</pieDataset>
				<pie3DPlot isShowLabels="true" isCircular="true">
					<plot>
						<seriesColor seriesOrder="0" color="#221E95"/>
						<seriesColor seriesOrder="1" color="#7CAC6A"/>
						<seriesColor seriesOrder="2" color="#705E66"/>
						<seriesColor seriesOrder="3" color="#1FE9BC"/>
						<seriesColor seriesOrder="4" color="#F438AC"/>
						<seriesColor seriesOrder="5" color="#5BFA7D"/>
						<seriesColor seriesOrder="6" color="#8102B2"/>
						<seriesColor seriesOrder="7" color="#28B7A5"/>
						<seriesColor seriesOrder="8" color="#F71423"/>
						<seriesColor seriesOrder="9" color="#A22F54"/>
						<seriesColor seriesOrder="10" color="#48C216"/>
						<seriesColor seriesOrder="11" color="#0FACB1"/>
						<seriesColor seriesOrder="12" color="#58C85C"/>
						<seriesColor seriesOrder="13" color="#511287"/>
						<seriesColor seriesOrder="14" color="#90599B"/>
						<seriesColor seriesOrder="15" color="#96527D"/>
						<seriesColor seriesOrder="16" color="#FCD118"/>
						<seriesColor seriesOrder="17" color="#A06F33"/>
						<seriesColor seriesOrder="18" color="#C49752"/>
						<seriesColor seriesOrder="19" color="#830930"/>
					</plot>
					<itemLabel>
						<font size="8"/>
					</itemLabel>
				</pie3DPlot>
			</pie3DChart>
		</band>
	</summary>
</jasperReport>
