<?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" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a3586467-f7a1-4128-be17-358ed0b5b12e">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="144"/>
	<property name="ireport.callouts" value="##Thu Feb 05 15:33:47 CET 2015"/>
	<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"/>
	<style name="testo_totale" fontSize="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
	<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
		<defaultValueExpression><![CDATA["/var/www/vhosts/"+"local.dom"+"/spedizioniweb_stampe/fattura/"]]></defaultValueExpression>
	</parameter>
	<parameter name="idFattura" class="java.lang.Integer">
		<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select * from testatefatture
where id = $P{idFattura}]]>
	</queryString>
	<field name="id" class="java.lang.Integer"/>
	<field name="azienda" class="java.lang.String"/>
	<field name="capcliente" class="java.lang.String"/>
	<field name="cittacliente" class="java.lang.String"/>
	<field name="codfiscalecliente" class="java.lang.String"/>
	<field name="dataemissione" class="java.sql.Date"/>
	<field name="esercizio" class="java.lang.String"/>
	<field name="indirizzocliente" class="java.lang.String"/>
	<field name="ins_time" class="java.sql.Timestamp"/>
	<field name="ins_user" class="java.lang.String"/>
	<field name="isoprovcliente" class="java.lang.String"/>
	<field name="nazionecliente" class="java.lang.String"/>
	<field name="nominativocliente" class="java.lang.String"/>
	<field name="numero" class="java.lang.Integer"/>
	<field name="pagata" class="java.lang.Boolean"/>
	<field name="pivacliente" class="java.lang.String"/>
	<field name="sezionale" class="java.lang.String"/>
	<field name="status" class="java.lang.String"/>
	<field name="totalefattura" class="java.lang.Double"/>
	<field name="totaleimponibile" class="java.lang.Double"/>
	<field name="totaleimposta" class="java.lang.Double"/>
	<field name="upd_time" class="java.sql.Timestamp"/>
	<field name="upd_user" class="java.lang.String"/>
	<field name="idclienti" class="java.lang.Long"/>
	<field name="idutenti" class="java.lang.Long"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band height="160" splitType="Stretch">
			<rectangle radius="10">
				<reportElement style="Testo_normale" x="265" y="33" width="290" height="106" uuid="caf46baf-122b-4686-82f6-cf5009dfb7aa"/>
			</rectangle>
			<textField>
				<reportElement style="intestazione" x="0" y="139" width="358" height="20" uuid="be429e3d-62c2-4ee0-ab10-ce365b193297"/>
				<textFieldExpression><![CDATA["Fattura " + $F{numero} + "/" + $F{sezionale} + " del " +  new SimpleDateFormat("dd/MM/yyyy").format($F{dataemissione})]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement style="Testo_normale" mode="Opaque" x="277" y="44" width="43" height="12" uuid="bacc753c-2df6-48b8-8789-a39bfda3789f"/>
				<text><![CDATA[Spett.le]]></text>
			</staticText>
			<textField>
				<reportElement style="Testo_normale" x="277" y="59" width="267" height="12" uuid="f6e6375e-4cc8-4f10-9d61-11322f7922c9"/>
				<textElement>
					<font isBold="true" isUnderline="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{nominativocliente}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement style="Testo_normale" x="277" y="74" width="267" height="12" uuid="8b6ee843-acd4-4d00-a6e8-962857f7c897"/>
				<textFieldExpression><![CDATA[$F{indirizzocliente}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement style="Testo_normale" x="277" y="89" width="267" height="12" uuid="52b01335-d90b-4079-baaa-9ef1e88ab2b0"/>
				<textFieldExpression><![CDATA[$F{capcliente} + " - " + $F{cittacliente} + " " + ($F{isoprovcliente}!=null?"("+$F{isoprovcliente}+") - ":"")  + $F{nazionecliente}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement style="Testo_normale" x="342" y="104" width="202" height="12" uuid="95c03023-3f0f-45dd-a94b-c4ac01603aa1"/>
				<textFieldExpression><![CDATA[$F{pivacliente}!=null?$F{pivacliente}:""]]></textFieldExpression>
			</textField>
			<image>
				<reportElement x="0" y="0" width="240" height="90" uuid="0fc5a06a-151f-42a7-96d3-76725d493d96"/>
				<imageExpression><![CDATA[$P{SUBREPORT_DIR}+"logo.jpg"]]></imageExpression>
			</image>
			<textField>
				<reportElement style="Testo_normale" x="342" y="119" width="202" height="12" uuid="0e522613-09f2-48ff-867c-4e92404d628a"/>
				<textFieldExpression><![CDATA[($F{codfiscalecliente}!=null?$F{codfiscalecliente}:"")]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement style="Testo_normale" x="0" y="103" width="240" height="12" uuid="71cd4248-7778-416f-abd6-40c01112b96a"/>
				<text><![CDATA[VIA ROMA, 113]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="0" y="115" width="240" height="12" uuid="10dab476-a8ba-440e-97af-9dd06a14772a"/>
				<text><![CDATA[97100 - RAGUSA - RG]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="0" y="127" width="240" height="12" uuid="ec2bedc1-24c7-4fe6-86ca-4478a00ae08f"/>
				<text><![CDATA[P. IVA 00000000000]]></text>
			</staticText>
			<staticText>
				<reportElement x="358" y="139" width="196" height="20" uuid="03a11c88-58d8-41d7-a76c-1eb3a590ea32"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[-- COPIA DI CORTESIA --]]></text>
			</staticText>
			<staticText>
				<reportElement x="277" y="104" width="65" height="12" uuid="5f74264d-872c-47f9-97b7-8dad281e14a3"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[P.IVA]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="0" y="91" width="240" height="12" uuid="c1338690-7c71-40c5-99ce-be865ba05b13"/>
				<text><![CDATA[PINCO PALLINO]]></text>
			</staticText>
			<subreport>
				<reportElement x="1" y="44" width="239" height="48" uuid="2bb5d5c3-66be-4f90-b625-0584fc2b82f9"/>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "datiazienda.jasper"]]></subreportExpression>
			</subreport>
		</band>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="125" splitType="Stretch">
			<subreport>
				<reportElement x="0" y="0" width="555" height="125" uuid="5bde6df6-ab72-404f-a575-1eaf35df2a57"/>
				<subreportParameter name="SUBREPORT_DIR">
					<subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="idFattura">
					<subreportParameterExpression><![CDATA[$P{idFattura}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "so_fattura_corpo.jasper"]]></subreportExpression>
			</subreport>
		</band>
	</detail>
	<columnFooter>
		<band height="16" splitType="Stretch">
			<textField>
				<reportElement x="1" y="0" width="554" height="14" uuid="0cce9f59-739e-4c51-8f52-91106d7ebcc6"/>
				<textElement textAlignment="Justified">
					<font size="6"/>
					<paragraph spacingBefore="4"/>
				</textElement>
				<textFieldExpression><![CDATA["NOTE: "+
    ($F{dataemissione}.getYear() > 118  ?
    ($F{pivacliente} != null && $F{pivacliente} != ""
      ?
    "Documento non fiscale, la fattura elettronica e\' disponibile nella propria area riservata dell\'Agenzia delle Entrate se non direttamente recapitata dallo SdI all\'indirizzo telematico"
    :
    "Copia della fattura elettronica disponibile nella propria area riservata dell'Agenzia delle Entrate"
    )
    :"")]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="0" y="14" width="555" height="1" uuid="85c74ab8-5fca-4d38-8397-a3a88eb07cab"/>
			</line>
		</band>
	</columnFooter>
	<pageFooter>
		<band height="140" splitType="Stretch">
			<subreport>
				<reportElement x="0" y="0" width="400" height="110" uuid="7355b67a-101e-4d9d-a936-c36f5b701fac"/>
				<subreportParameter name="SUBREPORT_DIR">
					<subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="idFattura">
					<subreportParameterExpression><![CDATA[$P{idFattura}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="sezionale">
					<subreportParameterExpression><![CDATA[$F{sezionale}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "so_fattura_castiva.jasper"]]></subreportExpression>
			</subreport>
			<line>
				<reportElement x="400" y="0" width="1" height="110" uuid="a2d7097f-60f7-4e74-9ed5-67275308a360"/>
			</line>
			<staticText>
				<reportElement style="testo_totale" x="417" y="2" width="127" height="14" uuid="7409d82d-6d19-43fd-9ad3-a6150c03c9bd"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Totale Imponibile]]></text>
			</staticText>
			<textField pattern="€ #,##0.00">
				<reportElement style="testo_totale" x="417" y="14" width="127" height="14" uuid="4cfb52df-922f-4c08-a2e2-c8b7e9192fea"/>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA[$F{totaleimponibile}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement style="testo_totale" x="417" y="38" width="127" height="14" uuid="af1a8773-bf58-465d-a71e-f1024746a82f">
					<printWhenExpression><![CDATA[$F{totaleimposta} != 0.00]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Totale Imposta]]></text>
			</staticText>
			<textField pattern="€ #,##0.00">
				<reportElement style="testo_totale" x="417" y="54" width="127" height="14" uuid="ad00fbcd-fe48-4f51-8bfd-9cdca661bb4e">
					<printWhenExpression><![CDATA[$F{totaleimposta} != 0.00]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA[$F{totaleimposta}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement style="testo_totale" x="417" y="82" width="127" height="14" uuid="cfe6920f-36eb-4a62-8f1c-7dbccce82df2"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Totale Fattura]]></text>
			</staticText>
			<textField pattern="€ #,##0.00">
				<reportElement style="testo_totale" x="417" y="96" width="127" height="14" uuid="db692772-21a4-4e60-853f-248cf45538ae"/>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA[$F{totalefattura}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="454" y="120" width="80" height="20" uuid="06b1e7ad-ca2f-4614-b0a1-1cee81b90f05"/>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA["Pagina "+$V{PAGE_NUMBER}+" di"]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement x="534" y="120" width="21" height="20" uuid="246d69e8-fb9c-42ef-b694-1dfb11d1be52"/>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="0" y="120" width="320" height="20" uuid="f159d198-4bf6-41e7-88fb-5b9b2f8c0254"/>
				<textElement verticalAlignment="Middle"/>
				<text><![CDATA[www.spedizioniweb.it]]></text>
			</staticText>
		</band>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
