<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Version: 1.0
  ~
  ~ The contents of this file are subject to the OpenVPMS License Version
  ~ 1.0 (the 'License'); you may not use this file except in compliance with
  ~ the License. You may obtain a copy of the License at
  ~ http://www.openvpms.org/license/
  ~
  ~ Software distributed under the License is distributed on an 'AS IS' basis,
  ~ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  ~ for the specific language governing rights and limitations under the
  ~ License.
  ~
  ~ Copyright 2014 (C) OpenVPMS Ltd. All Rights Reserved.
  -->

<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="Receipt Items A5" pageWidth="421" pageHeight="595" columnWidth="421" leftMargin="0" rightMargin="0"
              topMargin="0" bottomMargin="0">
    <property name="ireport.scriptlethandling" value="0"/>
    <property name="ireport.encoding" value="UTF-8"/>
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <import value="org.openvpms.component.business.domain.im.party.Party"/>
    <import value="net.sf.jasperreports.engine.*"/>
    <import value="java.util.*"/>
    <import value="net.sf.jasperreports.engine.data.*"/>
    <field name="target.name" class="java.lang.String">
        <fieldDescription><![CDATA[Payment Type Name]]></fieldDescription>
    </field>
    <field name="target.amount" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[Payment Amount]]></fieldDescription>
    </field>
    <variable name="SUM_target.amount" class="java.math.BigDecimal" resetType="Page" calculation="Sum">
        <variableExpression><![CDATA[$F{target.amount}]]></variableExpression>
    </variable>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band splitType="Stretch"/>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="28" splitType="Stretch">
            <line>
                <reportElement key="line-1" x="0" y="2" width="409" height="1"/>
            </line>
            <line>
                <reportElement key="line-2" x="1" y="25" width="409" height="1"/>
            </line>
            <staticText>
                <reportElement key="staticText-7" x="61" y="3" width="99" height="19"/>
                <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 size="10" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <text><![CDATA[Payment Type]]></text>
            </staticText>
            <staticText>
                <reportElement key="staticText-8" x="312" y="3" width="97" height="19"/>
                <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">
                    <font size="10" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <text><![CDATA[Amount]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="25" splitType="Stretch">
            <textField isBlankWhenNull="false">
                <reportElement key="textField" x="61" y="4" width="178" height="18"/>
                <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/>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{target.name}]]></textFieldExpression>
            </textField>
            <textField pattern="##0.00" isBlankWhenNull="false">
                <reportElement key="textField" x="312" y="6" width="100" height="18"/>
                <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/>
                <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{target.amount}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band height="25" splitType="Stretch">
            <line>
                <reportElement key="line-3" x="1" y="1" width="407" height="1"/>
            </line>
            <staticText>
                <reportElement key="staticText-11" x="61" y="5" width="82" height="19"/>
                <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 size="10" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <text><![CDATA[TOTAL]]></text>
            </staticText>
            <textField pattern="##0.00" isBlankWhenNull="false">
                <reportElement key="textField" x="312" y="6" width="100" height="19"/>
                <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 size="10" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <textFieldExpression class="java.math.BigDecimal">
                    <![CDATA[$V{SUM_target.amount}]]></textFieldExpression>
            </textField>
        </band>
    </columnFooter>
    <pageFooter>
        <band splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band splitType="Stretch"/>
    </summary>
</jasperReport>