<?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="report01_outstanding_so"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Landscape"
		 pageWidth="910"
		 pageHeight="765"
		 columnWidth="894"
		 columnSpacing="0"
		 leftMargin="8"
		 rightMargin="8"
		 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="customer_code" isForPrompting="true" class="java.lang.String"/>
	<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 spsreport01_outstanding_so($P{customer_code},$P{date_from},$P{date_end})]]></queryString>

	<field name="ftcompany_name" class="java.lang.String"/>
	<field name="ftso_no" class="java.lang.String"/>
	<field name="fdso_date" class="java.sql.Date"/>
	<field name="ftreff_no" class="java.lang.String"/>
	<field name="ftcustomer_code" class="java.lang.String"/>
	<field name="ftcustomer_name" class="java.lang.String"/>
	<field name="ftitem_code" class="java.lang.String"/>
	<field name="ftitem_name" class="java.lang.String"/>
	<field name="fnqtyso" class="java.lang.Double"/>
	<field name="fnqtyout" class="java.lang.Double"/>
	<field name="fnqty_outstanding" class="java.lang.Double"/>

	<variable name="urut" class="java.lang.Integer" resetType="Group" resetGroup="g_supplier" calculation="Count">
		<variableExpression><![CDATA[new java.lang.Integer(0) ]]></variableExpression>
		<initialValueExpression><![CDATA[new java.lang.Integer(1) ]]></initialValueExpression>
	</variable>
	<variable name="qty_outstanding" class="java.lang.Double" resetType="Report" calculation="Nothing">
		<variableExpression><![CDATA[new java.lang.Double(($F{fnqtyso}.doubleValue()) - ($F{fnqtyout}.doubleValue()))]]></variableExpression>
	</variable>
	<variable name="total_so" class="java.lang.Double" resetType="Group" resetGroup="g_supplier" calculation="Sum">
		<variableExpression><![CDATA[$F{fnqtyso}]]></variableExpression>
	</variable>
	<variable name="total_out" class="java.lang.Double" resetType="Group" resetGroup="g_supplier" calculation="Sum">
		<variableExpression><![CDATA[$F{fnqtyout}]]></variableExpression>
	</variable>
	<variable name="total_outstanding" class="java.lang.Double" resetType="Group" resetGroup="g_supplier" calculation="Sum">
		<variableExpression><![CDATA[$F{fnqty_outstanding}]]></variableExpression>
	</variable>
	<variable name="gtotal_so" class="java.lang.Double" resetType="Group" resetGroup="g_company" calculation="Sum">
		<variableExpression><![CDATA[$F{fnqtyso}]]></variableExpression>
	</variable>
	<variable name="gtotal_out" class="java.lang.Double" resetType="Group" resetGroup="g_company" calculation="Sum">
		<variableExpression><![CDATA[$F{fnqtyout}]]></variableExpression>
	</variable>
	<variable name="gtotal_outstanding" class="java.lang.Double" resetType="Group" resetGroup="g_company" calculation="Sum">
		<variableExpression><![CDATA[$F{fnqty_outstanding}]]></variableExpression>
	</variable>

		<group  name="g_company" >
			<groupExpression><![CDATA[$F{ftcompany_name}]]></groupExpression>
			<groupHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
			</groupHeader>
			<groupFooter>
			<band height="50"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="704"
						y="0"
						width="80"
						height="23"
						key="textField-8"/>
					<box>					<pen lineWidth="0.0" lineStyle="Solid"/>
					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
					<rightPen lineWidth="0.0" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{gtotal_out}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="784"
						y="0"
						width="80"
						height="23"
						key="textField-9"/>
					<box>					<pen lineWidth="0.0" lineStyle="Solid"/>
					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
					<rightPen lineWidth="0.0" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{gtotal_outstanding}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="624"
						y="0"
						width="80"
						height="23"
						key="textField-10"/>
					<box>					<pen lineWidth="0.0" lineStyle="Solid"/>
					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
					<rightPen lineWidth="0.0" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{gtotal_so}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="0"
						y="0"
						width="624"
						height="23"
						key="staticText-16"/>
					<box>					<pen lineWidth="0.0" lineStyle="Solid"/>
					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
					<rightPen lineWidth="0.0" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[GRAND TOTAL : ]]></text>
				</staticText>
			</band>
			</groupFooter>
		</group>
		<group  name="g_supplier" >
			<groupExpression><![CDATA[$F{ftcustomer_code}]]></groupExpression>
			<groupHeader>
			<band height="17"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="0"
						width="624"
						height="17"
						key="textField"/>
					<box>					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftcustomer_name}]]></textFieldExpression>
				</textField>
			</band>
			</groupHeader>
			<groupFooter>
			<band height="20"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="624"
						y="2"
						width="80"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{total_so}]]></textFieldExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						x="2"
						y="1"
						width="864"
						height="0"
						key="line-1"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="704"
						y="2"
						width="80"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{total_out}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="784"
						y="2"
						width="80"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{total_outstanding}]]></textFieldExpression>
				</textField>
			</band>
			</groupFooter>
		</group>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</title>
		<pageHeader>
			<band height="77"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="0"
						width="864"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="12" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftcompany_name}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="0"
						y="18"
						width="864"
						height="18"
						key="staticText-1"/>
					<box></box>
					<textElement textAlignment="Center">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="12" isBold="true"/>
					</textElement>
				<text><![CDATA[LAPORAN OUTSTANDING SO]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="0"
						y="36"
						width="112"
						height="23"
						key="staticText-2"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<text><![CDATA[Periode : ]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="dd-MMM-yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="112"
						y="36"
						width="210"
						height="23"
						key="textField-2"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[" s/d " + new SimpleDateFormat("dd-MMM-yyyy").format($P{date_end})]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="0"
						y="59"
						width="32"
						height="18"
						key="staticText-4"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[No.]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="32"
						y="59"
						width="80"
						height="18"
						key="staticText-5"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Tgl. SO]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="322"
						y="59"
						width="302"
						height="18"
						key="staticText-7"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Nama Barang]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="624"
						y="59"
						width="80"
						height="18"
						key="staticText-8"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Qty SO]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="704"
						y="-18"
						width="80"
						height="18"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="10"/>
					</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="784"
						y="-18"
						width="80"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER} + ""]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="704"
						y="59"
						width="80"
						height="18"
						key="staticText-10"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Qty Dikirim]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="784"
						y="59"
						width="80"
						height="18"
						key="staticText-11"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Outstanding]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="112"
						y="59"
						width="90"
						height="18"
						key="staticText-13"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[No. SO]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="202"
						y="59"
						width="120"
						height="18"
						key="staticText-15"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[No. Reff]]></text>
				</staticText>
			</band>
		</pageHeader>
		<columnHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnHeader>
		<detail>
			<band height="18"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="0"
						width="32"
						height="18"
						key="textField"
						stretchType="RelativeToTallestObject"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{urut}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" pattern="d/M/yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="32"
						y="0"
						width="80"
						height="18"
						key="textField"
						stretchType="RelativeToTallestObject"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[$F{fdso_date}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="322"
						y="0"
						width="302"
						height="18"
						key="textField"
						stretchType="RelativeToTallestObject"
						isPrintWhenDetailOverflows="true"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftitem_name}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="624"
						y="0"
						width="80"
						height="18"
						key="textField"
						stretchType="RelativeToTallestObject"
						isPrintInFirstWholeBand="true"
						isPrintWhenDetailOverflows="true"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$F{fnqtyso}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="704"
						y="0"
						width="80"
						height="18"
						key="textField"
						stretchType="RelativeToTallestObject"
						isPrintWhenDetailOverflows="true"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$F{fnqtyout}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="784"
						y="0"
						width="80"
						height="18"
						key="textField-5"
						stretchType="RelativeToTallestObject"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$F{fnqty_outstanding}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="112"
						y="0"
						width="90"
						height="18"
						key="textField-6"
						stretchType="RelativeToTallestObject"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftso_no}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="202"
						y="0"
						width="120"
						height="18"
						key="textField-7"
						stretchType="RelativeToTallestObject"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftreff_no}]]></textFieldExpression>
				</textField>
			</band>
		</detail>
		<columnFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnFooter>
		<pageFooter>
			<band height="31"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" pattern="EEE, d MMM yyyy HH:mm:ss" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="704"
						y="13"
						width="160"
						height="18"
						key="textField-3"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" pdfFontName="Helvetica-Oblique" size="10" 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>
