<?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_corpo" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="998bae12-488d-4d63-9f01-fc74d3785f5d">
	<property name="ireport.zoom" value="4.0"/>
	<property name="ireport.x" value="1110"/>
	<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>
	<queryString>
		<![CDATA[select distinct r.id, coalesce(o.dataordine,od.dataordine) dataordine, coalesce(o.codiceordine,od.codiceordine) codiceordine, r.descrizione, r.imponibile, r.imposta, r.aliquotaiva, r.totale
from righefatture r
left join tariffeordine t on t.id = r.idtariffeordine
left join testateordini o on o.id = t.idtesordine
left join addebitiordine ao on ao.id = r.idaddebitiordine
left join testateordini od on od.id = ao.idtesordine
where r.idtestatefatture = $P{idFattura}
order by codiceordine asc;]]>
	</queryString>
	<field name="id" class="java.lang.Integer"/>
	<field name="dataordine" class="java.sql.Date"/>
	<field name="codiceordine" class="java.lang.String"/>
	<field name="descrizione" class="java.lang.String"/>
	<field name="imponibile" class="java.lang.Double"/>
	<field name="imposta" class="java.lang.Double"/>
	<field name="aliquotaiva" class="java.lang.Double"/>
	<field name="totale" class="java.lang.Double"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="20" splitType="Stretch">
			<staticText>
				<reportElement style="Testo_normale" x="0" y="0" width="50" height="14" uuid="64dded03-b97e-4c52-923a-e1dfdaf1d51a"/>
				<textElement textAlignment="Center"/>
				<text><![CDATA[Data ordine]]></text>
			</staticText>
			<line>
				<reportElement x="0" y="19" width="555" height="1" uuid="8debfb29-f463-461d-a0b1-41023f2a1551"/>
			</line>
			<staticText>
				<reportElement style="Testo_normale" x="52" y="0" width="80" height="14" uuid="a3cf9bed-1ca1-4f74-bd98-5e2beb545ed9"/>
				<textElement textAlignment="Center"/>
				<text><![CDATA[Codice ordine]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="134" y="0" width="200" height="14" uuid="017b575c-40cc-4545-a9a8-92ff2f08b79b"/>
				<text><![CDATA[Descrizione]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="338" y="0" width="50" height="14" uuid="8208f2b1-cb27-42ab-a276-775841028aa6"/>
				<textElement textAlignment="Center"/>
				<text><![CDATA[Imponibile]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="390" y="0" width="40" height="14" uuid="2090caba-ba08-4408-a735-83b0813c24c2"/>
				<textElement textAlignment="Center"/>
				<text><![CDATA[IVA]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="430" y="0" width="50" height="14" uuid="3b6f0e7a-bb43-4989-8148-8e5fe471a374">
					<printWhenExpression><![CDATA[$F{id}.equals( '-9999' )]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Center"/>
				<text><![CDATA[Imposta]]></text>
			</staticText>
			<staticText>
				<reportElement style="Testo_normale" x="482" y="0" width="60" height="14" uuid="32c66452-3f6b-44c1-b25f-45622b87255c"/>
				<textElement textAlignment="Center"/>
				<text><![CDATA[Totale]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="20" splitType="Stretch">
			<textField pattern="dd/MM/yyyy">
				<reportElement style="Testo_normale" x="0" y="4" width="50" height="14" uuid="3622c1d6-9450-4563-95a3-36ba812140ff"/>
				<textFieldExpression><![CDATA[$F{dataordine}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="0" y="19" width="555" height="1" uuid="d2a09d18-199a-4bd0-9ae9-62b42634fe6f"/>
				<graphicElement>
					<pen lineWidth="0.5" lineStyle="Dashed"/>
				</graphicElement>
			</line>
			<textField>
				<reportElement style="Testo_normale" x="52" y="4" width="80" height="14" uuid="f77d5a3e-5d98-4a12-8e11-b81c5d5609a8"/>
				<textFieldExpression><![CDATA[$F{codiceordine}]]></textFieldExpression>
			</textField>
			<textField pattern="€ #,##0.00">
				<reportElement style="Testo_normale" x="430" y="4" width="50" height="14" uuid="a5120e10-88c4-47fe-8388-eca6b3f42339">
					<printWhenExpression><![CDATA[$F{id}.equals( '-9999' )]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{imposta}]]></textFieldExpression>
			</textField>
			<textField pattern="€ #,##0.00">
				<reportElement style="Testo_normale" x="482" y="4" width="60" height="14" uuid="ec555d92-9a1b-4ef0-8964-47b634808ff5"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{totale}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement style="Testo_normale" x="134" y="4" width="200" height="14" uuid="b2ae1f75-7149-43c6-a1b5-1f8f35bc9b25"/>
				<textFieldExpression><![CDATA[$F{descrizione}]]></textFieldExpression>
			</textField>
			<textField pattern="€ #,##0.00">
				<reportElement style="Testo_normale" x="338" y="4" width="50" height="14" uuid="7d6c1e38-4673-492d-af25-a91f39c9fb21"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{imponibile}]]></textFieldExpression>
			</textField>
			<textField pattern="0.00">
				<reportElement style="Testo_normale" x="390" y="4" width="40" height="14" uuid="70fdeefa-de26-4982-9eef-5c4f7a5c1d0e"/>
				<textElement textAlignment="Center"/>
				<textFieldExpression><![CDATA[$F{aliquotaiva}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
