<?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="so_fattura_castiva" language="groovy" pageWidth="410" pageHeight="802" columnWidth="410" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="be722015-35c0-413b-ad70-9dc8cb2f0b78">
	<property name="ireport.zoom" value="3.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<style name="Testo_normale" hAlign="Left" vAlign="Middle" fontSize="8"/>
	<style name="intestazione" hAlign="Left" vAlign="Middle" fontSize="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
	<parameter name="idFattura" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="sezionale" class="java.lang.String"/>
	<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
		<defaultValueExpression><![CDATA["/var/www/html/parcelpilot/spedizioniweb_stampe/fattura/"]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select r.* , (r.imposta + r.imponibile) as totale, a.descrizione
    from righecastelletto as r
    join aliquoteiva as a on a.codice = r.codiceiva
    where idtestatefatture  = $P{idFattura}]]>
	</queryString>
	<field name="id" class="java.lang.Integer"/>
	<field name="aliquota" class="java.lang.Double"/>
	<field name="azienda" class="java.lang.String"/>
	<field name="codiceiva" class="java.lang.String"/>
	<field name="esercizio" class="java.lang.String"/>
	<field name="imponibile" class="java.lang.Double"/>
	<field name="imposta" class="java.lang.Double"/>
	<field name="ins_time" class="java.sql.Timestamp"/>
	<field name="ins_user" class="java.lang.String"/>
	<field name="status" class="java.lang.String"/>
	<field name="upd_time" class="java.sql.Timestamp"/>
	<field name="upd_user" class="java.lang.String"/>
	<field name="idtestatefatture" class="java.lang.Long"/>
	<field name="totale" class="java.lang.Double"/>
	<field name="descrizione" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band height="20" splitType="Stretch">
			<textField>
				<reportElement x="1" y="2" width="248" height="18" uuid="76bcd3c1-2e22-46eb-be5e-96ede77c6ad4"/>
				<textElement>
					<font size="14" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[($F{aliquota} != 0.00 ? "Riepilogo per aliquote IVA" : "Riepilogo")]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="19" splitType="Stretch">
			<staticText>
				<reportElement style="Testo_normale" x="1" y="2" width="34" height="12" uuid="ba5b9494-1289-474c-bae4-eccd7731ad11">
					<printWhenExpression><![CDATA[$F{aliquota} != 0.00]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right"/>
				<text><![CDATA[aliquota]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="35" y="2" width="45" height="12" uuid="d092fa8c-bd94-4706-8aee-b1d77f385275"/>
				<textElement textAlignment="Right"/>
				<text><![CDATA[imponibile]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="80" y="2" width="40" height="12" uuid="7801b978-5893-4788-b07d-19fcd41b6b9e">
					<printWhenExpression><![CDATA[$F{aliquota} != 0.00]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right"/>
				<text><![CDATA[imposta]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="120" y="2" width="40" height="12" uuid="be7f16b6-e16d-438d-902c-c0183d3ecffa"/>
				<textElement textAlignment="Right"/>
				<text><![CDATA[totale]]></text>
			</staticText>
			<line>
				<reportElement x="0" y="16" width="360" height="1" uuid="90a919dc-fd1b-405b-854b-caead4e5ad7d"/>
			</line>
		</band>
	</columnHeader>
	<detail>
		<band height="17" splitType="Stretch">
			<textField pattern="0.00 &apos;%&apos;">
				<reportElement style="Testo_normale" x="1" y="2" width="34" height="12" uuid="db731030-7eb2-48aa-bc1e-369ed1096db3">
					<printWhenExpression><![CDATA[$F{aliquota} != 0.00]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{aliquota}]]></textFieldExpression>
			</textField>
			<textField pattern="€ #,##0.00">
				<reportElement style="Testo_normale" x="35" y="2" width="45" height="12" uuid="d6c7a485-8d53-4c5d-add8-04dd4971605a"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{imponibile}]]></textFieldExpression>
			</textField>
			<textField pattern="€ #,##0.00">
				<reportElement style="Testo_normale" x="120" y="2" width="40" height="12" uuid="d49e8297-beb1-4072-af01-aac4a495c69a"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{totale}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement style="Testo_normale" x="165" y="2" width="195" height="13" uuid="536a4afe-0a98-4e81-b150-2c4398d01bc9"/>
				<textFieldExpression><![CDATA[$F{descrizione}]]></textFieldExpression>
			</textField>
			<textField pattern="€ #,##0.00">
				<reportElement style="Testo_normale" x="80" y="2" width="40" height="12" uuid="b815593f-e4a4-484f-8290-a071617a9b1e">
					<printWhenExpression><![CDATA[$F{aliquota} != 0.00]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{imposta}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="27" splitType="Stretch">
			<line>
				<reportElement x="0" y="0" width="360" height="1" uuid="1d6099a4-bb82-46bc-8273-36497e73c409">
					<printWhenExpression><![CDATA[$P{sezionale}.equals( 'd' )]]></printWhenExpression>
				</reportElement>
			</line>
			<subreport>
				<reportElement x="1" y="15" width="318" height="12" uuid="1295858c-0975-4b56-a4ed-edf581cb4bd4">
					<printWhenExpression><![CDATA[$P{sezionale}.equals( 'd' )]]></printWhenExpression>
				</reportElement>
				<subreportParameter name="sezionale">
					<subreportParameterExpression><![CDATA[$P{sezionale}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "iban.jasper"]]></subreportExpression>
			</subreport>
			<subreport>
				<reportElement x="1" y="1" width="318" height="14" uuid="e6a162e9-2f2a-4f48-9030-e9d682b8118a">
					<printWhenExpression><![CDATA[$P{sezionale}.equals( 'd' )]]></printWhenExpression>
				</reportElement>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "beneficiario.jasper"]]></subreportExpression>
			</subreport>
		</band>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
