<?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="tPenjualan" pageWidth="269" pageHeight="400" columnWidth="241" leftMargin="14" rightMargin="14" topMargin="14" bottomMargin="14" isIgnorePagination="true" uuid="c6b9fb73-1e47-4c03-9980-95e974de79b7">
	<property name="ireport.zoom" value="1.5026296018031564"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="header" class="java.lang.String"/>
	<parameter name="tanggal_awal" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="tagihan_awal" class="java.lang.Double"/>
	<parameter name="operator" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="faktur" class="java.lang.String"/>
	<parameter name="logo" class="java.lang.String"/>
	<parameter name="pelanggan" class="java.lang.String"/>
	<parameter name="title" class="java.lang.String"/>
	<parameter name="user_id" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT
  tanggal, keterangan, pemasukan, pengeluaran
FROM
  tCashflow
WHERE
   user_id = $P{user_id}
  AND tanggal >= $P{tanggal_awal}
  AND keterangan LIKE CONCAT('%', $P{faktur}, '%')
]]>
	</queryString>
	<field name="tanggal" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="keterangan" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="pemasukan" class="java.lang.Double">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="pengeluaran" class="java.lang.Double"/>
	<variable name="total_dibayar" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[$P{title}.equals("Piutang") ? $F{pemasukan} : $F{pengeluaran}]]></variableExpression>
	</variable>
	<title>
		<band height="39" splitType="Stretch">
			<textField>
				<reportElement key="header" x="0" y="0" width="241" height="38" uuid="91c932bb-9f18-4c49-911a-0f2232a655d7"/>
				<textElement>
					<font size="8" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{header}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="46" splitType="Stretch">
			<line>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="3" width="241" height="1" uuid="8ec38f7a-117f-4294-b253-db764ae27fe9"/>
				<graphicElement>
					<pen lineWidth="0.5" lineStyle="Solid"/>
				</graphicElement>
			</line>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="7" width="137" height="15" uuid="4555a4c8-0a9d-4107-af13-e80b3c2fe5f2"/>
				<textElement verticalAlignment="Bottom">
					<font size="8" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA["Histori Pembayaran " + $P{title}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" x="137" y="7" width="104" height="15" uuid="250bac09-7d69-45a9-9b65-ea17ddd44d9b"/>
				<textElement textAlignment="Right" verticalAlignment="Bottom">
					<font size="8" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{pelanggan}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="22" width="137" height="12" uuid="aeb1581d-9e33-41e8-9cef-210a0b0c0c42"/>
				<textElement verticalAlignment="Bottom">
					<font size="8" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{faktur}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="41" splitType="Stretch">
			<line>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="-4" width="241" height="1" uuid="d820df37-c486-43a0-b4bc-7c36f8e43b0f"/>
				<graphicElement>
					<pen lineWidth="0.5" lineStyle="Solid"/>
				</graphicElement>
			</line>
			<line>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="18" width="241" height="1" uuid="5b805588-24ed-4740-8437-c6217ee63978"/>
				<graphicElement>
					<pen lineWidth="2.0" lineStyle="Double"/>
				</graphicElement>
			</line>
			<staticText>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="58" height="15" uuid="ac6f1bf4-c44f-4d2b-8f66-cd9af0559bcd"/>
				<textElement verticalAlignment="Middle" markup="none">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Tanggal]]></text>
			</staticText>
			<staticText>
				<reportElement stretchType="RelativeToBandHeight" x="58" y="0" width="63" height="15" uuid="29d22955-8d49-424a-9336-9122c7185eba"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Tagihan awal]]></text>
			</staticText>
			<staticText>
				<reportElement key="laba" stretchType="RelativeToBandHeight" x="179" y="0" width="62" height="15" uuid="fff13fe0-02b9-4c1f-8c69-14bc619ec16b"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Sisa]]></text>
			</staticText>
			<staticText>
				<reportElement stretchType="RelativeToBandHeight" x="122" y="0" width="57" height="15" uuid="d4c6ecea-ad5d-44f8-a1f3-45dd0f111945"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Dibayar]]></text>
			</staticText>
			<textField pattern="dd-MM-yyyy">
				<reportElement stretchType="RelativeToBandHeight" x="0" y="25" width="58" height="11" uuid="7b3eccfb-67b7-481f-ba35-f6feab273e23"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{tanggal_awal}.substring(8, 10 ) +"/"+
$P{tanggal_awal}.substring(5, 7 ) +"/"+
$P{tanggal_awal}.substring(0, 4 )]]></textFieldExpression>
			</textField>
			<textField pattern="#,###">
				<reportElement stretchType="RelativeToBandHeight" x="58" y="25" width="64" height="11" uuid="897e29d1-f96f-414b-abcb-bd25d7ebe782"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{tagihan_awal}]]></textFieldExpression>
			</textField>
			<textField pattern="#,###" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" x="122" y="25" width="57" height="11" uuid="481e088a-597e-4656-8431-83d663198884"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
			</textField>
			<textField pattern="#,###">
				<reportElement stretchType="RelativeToBandHeight" x="179" y="25" width="62" height="11" uuid="a5b5906a-ead2-4a49-be05-525084e93ac8"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{tagihan_awal}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="38" width="241" height="1" uuid="ebde1adc-bf6f-4b1c-bf00-0e2655adca4f"/>
				<graphicElement>
					<pen lineWidth="0.25" lineStyle="Solid"/>
				</graphicElement>
			</line>
		</band>
	</columnHeader>
	<detail>
		<band height="16" splitType="Stretch">
			<textField pattern="dd-MM-yyyy">
				<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="58" height="11" uuid="250bac09-7d69-45a9-9b65-ea17ddd44d9b"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{tanggal}.substring(8, 10 ) +"/"+
$F{tanggal}.substring(5, 7 ) +"/"+
$F{tanggal}.substring(0, 4 )]]></textFieldExpression>
			</textField>
			<textField pattern="#,###">
				<reportElement key="laba" stretchType="RelativeToBandHeight" x="179" y="0" width="62" height="11" uuid="250bac09-7d69-45a9-9b65-ea17ddd44d9b"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{tagihan_awal} - $V{total_dibayar}]]></textFieldExpression>
			</textField>
			<textField pattern="#,###">
				<reportElement stretchType="RelativeToBandHeight" x="122" y="0" width="57" height="11" uuid="4af77704-1889-4865-befa-d0f1e63d1945"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{title}.equals("Piutang") ? $F{pemasukan} : $F{pengeluaran}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="13" width="241" height="1" uuid="2e600d62-cbea-4bdc-8d31-f24803ebe4c1"/>
				<graphicElement>
					<pen lineWidth="0.25" lineStyle="Solid"/>
				</graphicElement>
			</line>
		</band>
	</detail>
	<pageFooter>
		<band height="26">
			<textField>
				<reportElement x="137" y="14" width="104" height="12" backcolor="#666666" 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="14" width="108" height="12" forecolor="#333333" backcolor="#666666" uuid="1f83bf91-d9e3-45ac-bd6b-00c28e70f83f"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy hh:mm").format(new Date())]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement stretchType="RelativeToBandHeight" x="0" y="14" width="29" height="12" forecolor="#333333" uuid="fa6a6160-4775-4dc2-ad1f-035e97cd364a"/>
				<textElement verticalAlignment="Middle" markup="none">
					<font size="8"/>
				</textElement>
				<text><![CDATA[Cetak :]]></text>
			</staticText>
		</band>
	</pageFooter>
</jasperReport>
