<?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="Pembelian per Barang" pageWidth="595" pageHeight="842" columnWidth="539" leftMargin="28" rightMargin="28" topMargin="20" bottomMargin="20" isSummaryWithPageHeaderAndFooter="true" isFloatColumnFooter="true" uuid="c6b9fb73-1e47-4c03-9980-95e974de79b7">
	<property name="ireport.zoom" value="1.2396694214876032"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="header" class="java.lang.String"/>
	<parameter name="footer" class="java.lang.String"/>
	<parameter name="namaLaporan" class="java.lang.String"/>
	<parameter name="operator" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="tglCetak" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="tglAwal" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="grandTotal" class="java.lang.String"/>
	<parameter name="filter" class="java.lang.String"/>
	<parameter name="tglAkhir" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="user_id" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT
     tPembelian.`faktur` AS tPembelian_faktur,
     tPembelian.`tanggal` AS tPembelian_tanggal,
     tPembelian.`suplier` AS tPembelian_suplier,
     tPembelian.`total` AS tPembelian_total,
     tPembelian.`operator` AS tPembelian_operator,
     tPembelianDetail.`faktur` AS tPembelianDetail_faktur,
     tPembelianDetail.`nama` AS tPembelianDetail_nama,
     tPembelianDetail.`jumlah` AS tPembelianDetail_jumlah,
     tPembelianDetail.`satuan` AS tPembelianDetail_satuan,
     tPembelianDetail.`harga` AS tPembelianDetail_harga,
     tPembelianDetail.`total` AS tPembelianDetail_total,
     tPembelianDetail.`suplier` AS tPembelianDetail_suplier,
     tPembelianDetail.`expired` AS tPembelianDetail_expired,
     tPembelianDetail.`no_batch` AS tPembelianDetail_no_batch
FROM
     `tPembelianDetail` tPembelianDetail
     INNER JOIN `tPembelian` tPembelian
     ON tPembelianDetail.`faktur` = tPembelian.`faktur`
	AND tPembelianDetail.`user_id` = $P{user_id}
WHERE
$P!{filter}
ORDER BY tPembelianDetail.`nama`, tPembelianDetail.`tanggal`  ASC]]>
	</queryString>
	<field name="tPembelian_faktur" class="java.lang.String"/>
	<field name="tPembelian_tanggal" class="java.util.Date"/>
	<field name="tPembelian_suplier" class="java.lang.String"/>
	<field name="tPembelian_total" class="java.lang.Double"/>
	<field name="tPembelian_operator" class="java.lang.String"/>
	<field name="tPembelianDetail_faktur" class="java.lang.String"/>
	<field name="tPembelianDetail_nama" class="java.lang.String"/>
	<field name="tPembelianDetail_jumlah" class="java.lang.Double"/>
	<field name="tPembelianDetail_satuan" class="java.lang.String"/>
	<field name="tPembelianDetail_harga" class="java.lang.Double"/>
	<field name="tPembelianDetail_total" class="java.lang.Double"/>
	<field name="tPembelianDetail_suplier" class="java.lang.String"/>
	<field name="tPembelianDetail_expired" class="java.lang.String"/>
	<field name="tPembelianDetail_no_batch" class="java.lang.String"/>
	<variable name="grandTotal" class="java.lang.Double" resetType="Group" resetGroup="obat" calculation="Sum">
		<variableExpression><![CDATA[$F{tPembelianDetail_total}]]></variableExpression>
		<initialValueExpression><![CDATA[]]></initialValueExpression>
	</variable>
	<variable name="no_faktur" class="java.lang.Integer" resetType="Group" resetGroup="obat" incrementType="Report" calculation="DistinctCount">
		<variableExpression><![CDATA[$V{REPORT_COUNT}]]></variableExpression>
		<initialValueExpression><![CDATA[]]></initialValueExpression>
	</variable>
	<group name="obat">
		<groupExpression><![CDATA[$F{tPembelianDetail_nama}]]></groupExpression>
		<groupHeader>
			<band height="26">
				<textField>
					<reportElement mode="Opaque" x="0" y="7" width="539" height="12" backcolor="#E3E3E3" uuid="4aea55a1-a584-4df5-8dfe-8153c869b069"/>
					<textElement verticalAlignment="Middle">
						<font size="8"/>
					</textElement>
					<textFieldExpression><![CDATA[$F{tPembelianDetail_nama}]]></textFieldExpression>
				</textField>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="24">
				<line>
					<reportElement x="29" y="4" width="510" height="1" uuid="f4bc87a2-c447-44e4-8ed8-37bef0bddd55"/>
					<graphicElement>
						<pen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
					</graphicElement>
				</line>
				<textField pattern="Rp #,###">
					<reportElement x="245" y="4" width="90" height="15" uuid="d760c669-765a-4763-a9d6-6720c0044501"/>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font size="8" isBold="true" isItalic="false"/>
					</textElement>
					<textFieldExpression><![CDATA[$V{grandTotal}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement x="192" y="4" width="40" height="15" uuid="d7b83703-c74a-46b6-819e-2649f1fb7b04"/>
					<textElement verticalAlignment="Middle">
						<font size="8" isBold="true" isItalic="false"/>
					</textElement>
					<text><![CDATA[Total]]></text>
				</staticText>
			</band>
		</groupFooter>
	</group>
	<title>
		<band height="39" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="271" height="38" uuid="91c932bb-9f18-4c49-911a-0f2232a655d7"/>
				<textElement>
					<font size="10" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{header}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="32" splitType="Stretch">
			<textField>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="235" height="24" uuid="4555a4c8-0a9d-4107-af13-e80b3c2fe5f2"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font size="9" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{namaLaporan}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" x="235" y="0" width="304" height="24" uuid="4555a4c8-0a9d-4107-af13-e80b3c2fe5f2"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="9" isBold="false"/>
				</textElement>
				<textFieldExpression><![CDATA["Mulai tgl. " + $P{tglAwal} + " S/d " + $P{tglAkhir}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="24" splitType="Stretch">
			<line>
				<reportElement x="0" y="0" width="539" height="2" uuid="54969548-0c88-4cfd-9436-edd443dbe156"/>
				<graphicElement>
					<pen lineWidth="0.5"/>
				</graphicElement>
			</line>
			<line>
				<reportElement x="0" y="20" width="539" height="1" uuid="bd268265-e291-4029-8910-54db37895ec5"/>
				<graphicElement>
					<pen lineWidth="2.25" lineStyle="Double"/>
				</graphicElement>
			</line>
			<staticText>
				<reportElement x="30" y="0" width="79" height="20" uuid="9b93e04d-8356-4579-a1a1-35ed21a11c0e"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Faktur]]></text>
			</staticText>
			<staticText>
				<reportElement x="109" y="0" width="46" height="20" uuid="335f2834-2f7e-4827-8ab1-c74074789f28"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Tanggal]]></text>
			</staticText>
			<staticText>
				<reportElement x="268" y="0" width="67" height="20" uuid="f5ffe185-5cb3-496b-a523-7b7f241b0a6f"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[total]]></text>
			</staticText>
			<staticText>
				<reportElement x="464" y="0" width="75" height="20" uuid="8ccb7873-cd61-4294-981c-456cb7e7a55d"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Suplier]]></text>
			</staticText>
			<staticText>
				<reportElement x="0" y="0" width="29" height="20" uuid="25fa6f53-b532-448c-8434-cd2e51732650"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[No.]]></text>
			</staticText>
			<staticText>
				<reportElement x="182" y="0" width="36" height="20" uuid="aa425f4f-1022-4d81-b224-c59b7cb5e3fe"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Satuan]]></text>
			</staticText>
			<staticText>
				<reportElement x="218" y="0" width="50" height="20" uuid="b02fccae-05c7-48fa-858e-251e2fc5eb24"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Harga]]></text>
			</staticText>
			<staticText>
				<reportElement x="155" y="0" width="27" height="20" uuid="a826291a-116e-4145-aab2-5e1a0753c9ea"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Qty]]></text>
			</staticText>
			<staticText>
				<reportElement x="397" y="0" width="55" height="20" uuid="f5ffe185-5cb3-496b-a523-7b7f241b0a6f"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Expired]]></text>
			</staticText>
			<staticText>
				<reportElement x="336" y="0" width="61" height="20" uuid="6c4f910d-27ac-4929-b1b2-31ef34d770d8"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Batch]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="12" splitType="Stretch">
			<textField>
				<reportElement x="31" y="0" width="78" height="12" uuid="557f23b3-f7a4-42cd-a080-e3039eda5ec3"/>
				<textElement verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelian_faktur}]]></textFieldExpression>
			</textField>
			<textField pattern="dd-MM-yyyy">
				<reportElement x="109" y="0" width="46" height="12" uuid="baf72e91-b721-4709-9159-d616535270f4"/>
				<textElement verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelian_tanggal}]]></textFieldExpression>
			</textField>
			<textField pattern="#,###">
				<reportElement x="268" y="0" width="67" height="12" uuid="d3ab60ca-fb95-404c-98be-2f3c7bc25af7"/>
				<textElement textAlignment="Right" verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelianDetail_total}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement isPrintRepeatedValues="false" x="463" y="0" width="76" height="12" uuid="fe18222b-6eb4-4c0b-aec6-a694f1f420b5"/>
				<textElement textAlignment="Right" verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelian_suplier}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="1" y="0" width="28" height="12" uuid="cb0211d1-92f5-48ad-86c0-960caefa0290"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$V{no_faktur}]]></textFieldExpression>
			</textField>
			<textField pattern="#,###">
				<reportElement x="155" y="0" width="27" height="12" uuid="1a62f5d3-2950-42b6-9d35-9f382a7e8db8"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelianDetail_jumlah}]]></textFieldExpression>
			</textField>
			<textField pattern="#,###">
				<reportElement x="218" y="0" width="50" height="12" uuid="c8b0869b-8d24-4ecf-866d-70bbf20fb408"/>
				<textElement textAlignment="Right" verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelianDetail_harga}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="182" y="0" width="36" height="12" uuid="442b5015-73eb-4eef-b15b-e2e3bc347d3c"/>
				<textElement verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelianDetail_satuan}]]></textFieldExpression>
			</textField>
			<textField pattern="">
				<reportElement x="396" y="0" width="55" height="12" uuid="d3ab60ca-fb95-404c-98be-2f3c7bc25af7"/>
				<textElement textAlignment="Right" verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelianDetail_expired}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement x="335" y="0" width="61" height="12" uuid="5c7b5b38-39c0-4e5d-b28a-7ea701168f4e"/>
				<textElement textAlignment="Right" verticalAlignment="Top">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tPembelianDetail_no_batch}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="34" splitType="Stretch">
			<textField>
				<reportElement x="271" y="13" width="268" height="21" forecolor="#333333" uuid="a1d32d3e-1753-412d-b8cd-e712d19c2bcb"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA["Oleh : " + $P{operator}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="29" y="13" width="242" height="21" forecolor="#333333" uuid="32b2a99c-f549-431f-bd9b-61f79afc6eff"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{tglCetak}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="13" width="29" height="21" forecolor="#333333" uuid="a9290114-1fed-4182-8aa6-5b0a245fb47a"/>
				<textElement verticalAlignment="Middle" markup="none">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Cetak :]]></text>
			</staticText>
		</band>
	</columnFooter>
</jasperReport>
