<?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="customersdiary" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" uuid="5375a590-d290-4db2-95a1-6d6136385f72">
	<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 
RECEIPTS.DATENEW,
     TICKETS.TICKETID,
     PAYMENTS.PAYMENT,
     PAYMENTS.TOTAL,
     CUSTOMERS.TAXID,
     CUSTOMERS.NAME
FROM
     RECEIPTS INNER JOIN TICKETS ON RECEIPTS.ID = TICKETS.ID
     INNER JOIN PAYMENTS ON RECEIPTS.ID = PAYMENTS.RECEIPT
     INNER JOIN CUSTOMERS ON TICKETS.CUSTOMER = CUSTOMERS.ID
WHERE
     (PAYMENTS.PAYMENT = 'debt'
  OR PAYMENTS.PAYMENT = 'debtpaid')
ORDER BY
     CUSTOMERS.NAME ASC]]>
	</queryString>
	<field name="DATENEW" class="java.util.Date"/>
	<field name="TICKETID" class="java.lang.String"/>
	<field name="PAYMENT" class="java.lang.String"/>
	<field name="TOTAL" class="java.lang.Double"/>
	<field name="TAXID" class="java.lang.String"/>
	<field name="NAME" class="java.lang.String"/>
	<variable name="CUSTOMER_TOTAL" class="java.lang.Double" resetType="Group" resetGroup="Customer" calculation="Sum">
		<variableExpression><![CDATA[$F{TOTAL}]]></variableExpression>
		<initialValueExpression><![CDATA[new Double(0.0)]]></initialValueExpression>
	</variable>
	<group name="Customer">
		<groupExpression><![CDATA[$F{NAME}]]></groupExpression>
		<groupHeader>
			<band height="35">
				<textField isBlankWhenNull="false">
					<reportElement key="textField" x="0" y="2" width="100" height="15" uuid="c34778cd-2524-4ab7-8892-185b8aed54c7"/>
					<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 verticalAlignment="Middle">
						<font fontName="SansSerif" size="11" isBold="true" pdfFontName="Helvetica"/>
					</textElement>
					<textFieldExpression><![CDATA[$F{TAXID}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="false">
					<reportElement key="textField" x="100" y="2" width="328" height="15" uuid="2d358582-caa8-4876-89e0-0b2f0c887b25"/>
					<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 verticalAlignment="Middle">
						<font fontName="SansSerif" size="11" isBold="true" pdfFontName="Helvetica"/>
					</textElement>
					<textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>
				</textField>
				<line>
					<reportElement key="line-1" x="0" y="33" width="535" height="1" uuid="f5d8a3a6-cc87-4f28-a228-4d32e7749da1"/>
					<graphicElement>
						<pen lineWidth="0.25" lineStyle="Solid"/>
					</graphicElement>
				</line>
				<textField isBlankWhenNull="false">
					<reportElement key="textField-6" x="0" y="17" width="151" height="15" uuid="b5c9a757-6edf-40e0-8dce-4dc58ec2dfad"/>
					<textElement verticalAlignment="Bottom">
						<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{label.date}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="false">
					<reportElement key="textField-7" x="151" y="17" width="77" height="15" uuid="7cfa98f0-2fc7-487c-aa9a-5498b795ebbd"/>
					<textElement verticalAlignment="Bottom">
						<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{label.ticket}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="false">
					<reportElement key="textField-8" x="255" y="17" width="100" height="15" uuid="316e5ae4-8d3a-499f-94c2-33670514c820"/>
					<textElement verticalAlignment="Bottom">
						<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{label.payment}]]></textFieldExpression>
				</textField>
				<textField isBlankWhenNull="false">
					<reportElement key="textField-9" x="434" y="17" width="100" height="15" uuid="745aeb32-080b-4f02-a0d9-1f8e5d4e3c55"/>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font fontName="SansSerif" size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
				</textField>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="27">
				<line>
					<reportElement key="line-2" x="434" y="2" width="100" height="1" uuid="1a7d3569-d67c-4ea4-9707-8a62fbbd437c"/>
					<graphicElement>
						<pen lineWidth="0.25" lineStyle="Solid"/>
					</graphicElement>
				</line>
				<textField pattern="##0.000" isBlankWhenNull="false">
					<reportElement key="textField" x="434" y="5" width="100" height="16" uuid="9ca3405b-3ade-4e0a-9f73-cd4ae3b766d6"/>
					<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">
						<font fontName="SansSerif" size="12" isBold="true" pdfFontName="Helvetica"/>
					</textElement>
					<textFieldExpression><![CDATA[com.unicenta.format.Formats.CURRENCY.formatValue($V{CUSTOMER_TOTAL})]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band/>
	</background>
	<title>
		<band/>
	</title>
	<pageHeader>
		<band height="52">
			<textField pattern="" isBlankWhenNull="true">
				<reportElement key="textField-1" mode="Transparent" x="50" y="33" width="110" height="15" uuid="4d81224d-3acf-4010-b17d-58f2db015b61"/>
				<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>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement key="textField-2" mode="Transparent" x="170" y="33" width="110" height="15" uuid="2d336def-e94f-408d-9f97-0c46a89c8a45"/>
				<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>
			<staticText>
				<reportElement key="staticText-1" mode="Transparent" x="160" y="33" width="10" height="15" uuid="3e3f0b74-da2c-4206-8722-1f690f4851a7"/>
				<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="false">
				<reportElement key="textField-3" mode="Transparent" x="0" y="0" width="375" height="30" forecolor="#33CCFF" backcolor="#FFFFFF" uuid="0bc99a0c-383d-4734-9796-d0a969f299da"/>
				<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.Diary}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-2" mode="Opaque" x="400" y="0" width="135" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="9a19c747-842a-4928-ba36-9baa448d56d7"/>
				<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="dd/MM/yyyy h.mm a" isBlankWhenNull="false">
				<reportElement key="textField-3" x="400" y="15" width="135" height="15" uuid="7a6cf4b5-4da5-4d8b-8e46-79d3c35ee5a8"/>
				<textElement textAlignment="Right">
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-4" mode="Opaque" x="1" y="33" width="50" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="d4e80eaa-7b39-40bc-9762-7f17ea8e3e16"/>
				<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>
			<rectangle radius="5">
				<reportElement key="rectangle-1" mode="Opaque" x="0" y="50" width="535" height="2" forecolor="#33CCFF" backcolor="#33CCFF" uuid="ccb6fd38-2820-48fe-8655-1ac44d651b29"/>
				<graphicElement fill="Solid"/>
			</rectangle>
		</band>
	</pageHeader>
	<columnHeader>
		<band/>
	</columnHeader>
	<detail>
		<band height="16">
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="0" y="0" width="151" height="15" uuid="78a0d15b-b1f2-4ea6-9767-9ad1b50fad31"/>
				<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>
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[com.unicenta.format.Formats.DATE.formatValue($F{DATENEW})]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="151" y="0" width="77" height="15" uuid="f993a965-39b9-49f5-a597-4ee2ddf6653e"/>
				<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>
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{TICKETID}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="255" y="0" width="100" height="15" uuid="618fc67f-0a64-4bc0-8c77-93c029b18d83"/>
				<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>
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{PAYMENT}]]></textFieldExpression>
			</textField>
			<textField pattern="###0.000" isBlankWhenNull="false">
				<reportElement key="textField" x="434" y="0" width="100" height="15" uuid="56e8c256-0203-4c53-bd9a-1d3e4573cab7"/>
				<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">
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[com.unicenta.format.Formats.CURRENCY.formatValue($F{TOTAL})]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band/>
	</columnFooter>
	<pageFooter>
		<band height="30">
			<textField pattern="" isBlankWhenNull="false">
				<reportElement key="textField-4" mode="Opaque" x="484" y="10" width="20" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="acb3ba99-6670-4f53-9597-bf968353c1d0"/>
				<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>
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement key="textField-5" mode="Opaque" x="514" y="10" width="20" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="bcbe5ee2-fea4-493d-957a-dba1f04995e1"/>
				<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>
			<staticText>
				<reportElement key="staticText-2" mode="Opaque" x="504" y="10" width="10" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="a46309e9-ae0a-4f7c-9ed1-b56ccefd04fc"/>
				<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>
			<line>
				<reportElement key="line-3" mode="Opaque" x="1" y="5" width="534" height="1" forecolor="#000000" backcolor="#FFFFFF" uuid="d182161e-5792-402a-a5d3-09901f510c6f"/>
				<graphicElement fill="Solid">
					<pen lineWidth="0.25" lineStyle="Solid"/>
				</graphicElement>
			</line>
			<staticText>
				<reportElement x="0" y="10" width="100" height="15" uuid="7ad9c038-a750-4eda-8320-a1120990a9ce"/>
				<textElement>
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<text><![CDATA[rpt:customers_diary]]></text>
			</staticText>
		</band>
	</pageFooter>
	<summary>
		<band/>
	</summary>
</jasperReport>
