<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
		 name="report14_debit_memo"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Portrait"
		 pageWidth="1008"
		 pageHeight="1275"
		 columnWidth="948"
		 columnSpacing="0"
		 leftMargin="30"
		 rightMargin="30"
		 topMargin="20"
		 bottomMargin="20"
		 whenNoDataType="AllSectionsNoDetail"
		 isTitleNewPage="false"
		 isSummaryNewPage="false">
	<property name="ireport.scriptlethandling" value="0" />
	<property name="ireport.encoding" value="UTF-8" />
	<import value="java.util.*" />
	<import value="net.sf.jasperreports.engine.*" />
	<import value="net.sf.jasperreports.engine.data.*" />

	<parameter name="date_from" isForPrompting="true" class="java.util.Date"/>
	<parameter name="date_end" isForPrompting="true" class="java.util.Date"/>
	<parameter name="username" isForPrompting="true" class="java.lang.String"/>
	<queryString><![CDATA[call spfreport14_debit_memo($P{date_from},$P{date_end})]]></queryString>

	<field name="ftcompany_name" class="java.lang.String"/>
	<field name="ftdm_no" class="java.lang.String"/>
	<field name="fdtrans_date" class="java.sql.Date"/>
	<field name="ftsupplier_code" class="java.lang.String"/>
	<field name="ftsupplier_name" class="java.lang.String"/>
	<field name="ftsales_invoice_no" class="java.lang.String"/>
	<field name="fdsales_invoice_date" class="java.sql.Date"/>
	<field name="fcinvoice_amount" class="java.math.BigDecimal"/>
	<field name="fcoutstanding_amount" class="java.math.BigDecimal"/>
	<field name="fcdebit_amount" class="java.math.BigDecimal"/>
	<field name="fttrans_type" class="java.lang.String"/>

	<sortField name="fttrans_type" />
	<sortField name="ftdm_no" />

	<variable name="urut" class="java.lang.Integer" resetType="Group" resetGroup="g_fttrans_type" calculation="Count">
		<variableExpression><![CDATA[new java.lang.Integer(0) ]]></variableExpression>
		<initialValueExpression><![CDATA[new java.lang.Integer(1) ]]></initialValueExpression>
	</variable>
	<variable name="g1_jml_invoice" class="java.math.BigDecimal" resetType="Group" resetGroup="g_ftdm_no" calculation="Sum">
		<variableExpression><![CDATA[$F{fcinvoice_amount}]]></variableExpression>
	</variable>
	<variable name="g1_sisa_invoice" class="java.math.BigDecimal" resetType="Group" resetGroup="g_ftdm_no" calculation="Sum">
		<variableExpression><![CDATA[$F{fcoutstanding_amount}]]></variableExpression>
	</variable>
	<variable name="g1_jml_debit_memo" class="java.math.BigDecimal" resetType="Group" resetGroup="g_ftdm_no" calculation="Sum">
		<variableExpression><![CDATA[$F{fcdebit_amount}]]></variableExpression>
	</variable>
	<variable name="g2_jml_invoice" class="java.math.BigDecimal" resetType="Group" resetGroup="g_fttrans_type" calculation="Sum">
		<variableExpression><![CDATA[$F{fcinvoice_amount}]]></variableExpression>
	</variable>
	<variable name="g2_jml_sisa_invoice" class="java.math.BigDecimal" resetType="Group" resetGroup="g_fttrans_type" calculation="Sum">
		<variableExpression><![CDATA[$F{fcoutstanding_amount}]]></variableExpression>
	</variable>
	<variable name="g2_jml_debit_memo" class="java.math.BigDecimal" resetType="Group" resetGroup="g_fttrans_type" calculation="Sum">
		<variableExpression><![CDATA[$F{fcdebit_amount}]]></variableExpression>
	</variable>

		<group  name="g_fttrans_type" >
			<groupExpression><![CDATA[$F{fttrans_type}]]></groupExpression>
			<groupHeader>
			<band height="26"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="4"
						y="6"
						width="262"
						height="16"
						key="textField"/>
					<box></box>
					<textElement>
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{fttrans_type}]]></textFieldExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						x="6"
						y="24"
						width="364"
						height="0"
						key="line-3"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
			</band>
			</groupHeader>
			<groupFooter>
			<band height="34"  isSplitAllowed="true" >
				<line direction="TopDown">
					<reportElement
						x="562"
						y="2"
						width="340"
						height="0"
						key="line-4"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="562"
						y="7"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{g2_jml_invoice}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="674"
						y="7"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{g2_jml_sisa_invoice}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="790"
						y="7"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold" isBold="true" isItalic="false" isUnderline="false"/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{g2_jml_debit_memo}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="450"
						y="5"
						width="24"
						height="20"
						key="staticText-23"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Jml .]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="474"
						y="6"
						width="81"
						height="16"
						key="textField-4"/>
					<box></box>
					<textElement>
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{fttrans_type}]]></textFieldExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						x="450"
						y="29"
						width="452"
						height="0"
						key="line-6"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
			</band>
			</groupFooter>
		</group>
		<group  name="g_ftdm_no" >
			<groupExpression><![CDATA[$F{ftdm_no}]]></groupExpression>
			<groupHeader>
			<band height="2"  isSplitAllowed="true" >
			</band>
			</groupHeader>
			<groupFooter>
			<band height="29"  isSplitAllowed="true" >
				<line direction="TopDown">
					<reportElement
						x="562"
						y="3"
						width="340"
						height="0"
						key="line-5"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="562"
						y="8"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{g1_jml_invoice}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="674"
						y="8"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{g1_sisa_invoice}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="790"
						y="8"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{g1_jml_debit_memo}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="450"
						y="8"
						width="24"
						height="20"
						key="staticText-22"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Jml .]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="474"
						y="8"
						width="88"
						height="18"
						key="textField-5"/>
					<box></box>
					<textElement>
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftdm_no}]]></textFieldExpression>
				</textField>
			</band>
			</groupFooter>
		</group>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="23"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="6"
						y="0"
						width="142"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftcompany_name}]]></textFieldExpression>
				</textField>
			</band>
		</title>
		<pageHeader>
			<band height="83"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="403"
						y="4"
						width="249"
						height="18"
						key="staticText-3"/>
					<box></box>
					<textElement textAlignment="Center">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[LAPORAN DEBIT MEMO]]></text>
				</staticText>
				<line direction="TopDown">
					<reportElement
						x="4"
						y="51"
						width="898"
						height="1"
						key="line-1"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<staticText>
					<reportElement
						x="4"
						y="30"
						width="92"
						height="20"
						key="staticText-11"/>
					<box></box>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<text><![CDATA[Periode transaksi :]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="dd-MMM-yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="102"
						y="30"
						width="92"
						height="18"
						key="textField-1"/>
					<box></box>
					<textElement>
						<font pdfFontName="Helvetica" isBold="false" isStrikeThrough="false" />
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[$P{date_from}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="194"
						y="30"
						width="25"
						height="17"
						key="staticText-12"/>
					<box></box>
					<textElement textAlignment="Center">
						<font/>
					</textElement>
				<text><![CDATA[s/d]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="dd-MMM-yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="219"
						y="30"
						width="100"
						height="18"
						key="textField-2"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[$P{date_end}]]></textFieldExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						x="0"
						y="77"
						width="902"
						height="0"
						key="line-2"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<staticText>
					<reportElement
						x="4"
						y="54"
						width="32"
						height="20"
						key="staticText-13"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[No.]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="36"
						y="55"
						width="92"
						height="20"
						key="staticText-14"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[No. Debit Memo]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="128"
						y="54"
						width="91"
						height="20"
						key="staticText-15"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Tgl. Kredit Memo]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="219"
						y="54"
						width="140"
						height="20"
						key="staticText-16"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Nama Customer]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="359"
						y="54"
						width="91"
						height="20"
						key="staticText-17"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[No. Invoice]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="450"
						y="55"
						width="112"
						height="20"
						key="staticText-18"/>
					<box></box>
					<textElement textAlignment="Left">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Tgl. Invoice]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="562"
						y="54"
						width="112"
						height="20"
						key="staticText-19"/>
					<box></box>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Jml. Invoice]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="674"
						y="55"
						width="112"
						height="20"
						key="staticText-20"/>
					<box></box>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Sisa Invoice]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="790"
						y="54"
						width="112"
						height="20"
						key="staticText-21"/>
					<box></box>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Jml. Debit Memo]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="664"
						y="-44"
						width="100"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Arial" size="12"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="764"
						y="-44"
						width="100"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font fontName="Arial" size="12"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER} + ""]]></textFieldExpression>
				</textField>
			</band>
		</pageHeader>
		<columnHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnHeader>
		<detail>
			<band height="24"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="4"
						y="5"
						width="32"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{urut}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="dd-MMM-yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="128"
						y="5"
						width="100"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[$F{fdtrans_date}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="359"
						y="5"
						width="91"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftsales_invoice_no}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="dd/MM/yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="450"
						y="5"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[$F{fdsales_invoice_date}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="562"
						y="5"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$F{fcinvoice_amount}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="674"
						y="5"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$F{fcoutstanding_amount}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="36"
						y="5"
						width="92"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftdm_no}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="790"
						y="5"
						width="112"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{g2_jml_debit_memo}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="228"
						y="5"
						width="131"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftsupplier_name}]]></textFieldExpression>
				</textField>
			</band>
		</detail>
		<columnFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnFooter>
		<pageFooter>
			<band height="34"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="591"
						y="9"
						width="100"
						height="18"
						key="textField-6"/>
					<box></box>
					<textElement>
						<font fontName="Arial" size="12"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$P{username}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="EEE, d MMM yyyy HH:mm:ss" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="694"
						y="9"
						width="205"
						height="18"
						key="textField-7"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Arial" pdfFontName="Helvetica-Oblique" size="12" isItalic="true"/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
				</textField>
			</band>
		</pageFooter>
		<summary>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</summary>
</jasperReport>
