<?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="fatturedaordine" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="390bd8f3-1921-4ed5-a544-a1a939a1bf18">
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="758"/>
	<property name="ireport.y" value="0"/>
	<queryString>
		<![CDATA[select
	f.sezionale, f.numero, f.dataemissione, f.ins_time, f.totalefattura,
	o.codiceordine,  o.dataordine, o.ins_time, o.prezzoivato, o.gestionemanuale,
	af.ragsoc, af.cognome, af.nome,
	ao.ragsoc as ordineragsoc, ao.cognome as ordinecog, ao.nome as ordinenom
from testatefatture f
left join righefatture r on f.id=r.idtestatefatture
left join tariffeordine t on r.idtariffeordine = t.id
left join testateordini o on o.id = t.idtesordine
left join addtclienti c ON c.id = f.idclienti
left join anagraficapgf af on af.id = c.idanagraficapgf
left join addtclienti co ON co.id = o.idaddclienti
left join anagraficapgf ao on ao.id = co.idanagraficapgf

where o.codiceordine in
('O2018000035409','O2018000035406','O2018000035403','O2018000035400')
order by o.codiceordine]]>
	</queryString>
	<field name="sezionale" class="java.lang.String"/>
	<field name="numero" class="java.lang.Integer"/>
	<field name="dataemissione" class="java.sql.Date"/>
	<field name="ins_time" class="java.sql.Timestamp"/>
	<field name="totalefattura" class="java.lang.Double"/>
	<field name="codiceordine" class="java.lang.String"/>
	<field name="dataordine" class="java.sql.Date"/>
	<field name="prezzoivato" class="java.lang.Double"/>
	<field name="gestionemanuale" class="java.lang.Boolean"/>
	<field name="ragsoc" class="java.lang.String"/>
	<field name="cognome" class="java.lang.String"/>
	<field name="nome" class="java.lang.String"/>
	<field name="ordineragsoc" class="java.lang.String"/>
	<field name="ordinecog" class="java.lang.String"/>
	<field name="ordinenom" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="46" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="0" width="555" height="20" uuid="9530da63-7f70-42dd-aeb4-6365d274312d"/>
				<textElement>
					<font size="14"/>
				</textElement>
				<text><![CDATA[Elenco fatture da codici ordini]]></text>
			</staticText>
			<staticText>
				<reportElement x="0" y="20" width="132" height="20" uuid="1dc00276-298d-4a84-a734-c73a4f01b6fa"/>
				<text><![CDATA[Codici Ordine selezionati :]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="132" y="20" width="423" height="20" uuid="88dedc06-b325-41c7-a390-1d7382423bf2"/>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="13" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="41" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="20" width="100" height="20" uuid="b41ec962-b019-4cf9-8937-26b125baa440"/>
				<text><![CDATA[CODICE]]></text>
			</staticText>
			<staticText>
				<reportElement x="100" y="20" width="77" height="20" uuid="bab6212c-54c9-449d-96ed-7df5744e064b"/>
				<text><![CDATA[DATA]]></text>
			</staticText>
			<staticText>
				<reportElement x="421" y="21" width="55" height="20" uuid="45a85e32-dd07-4832-970c-fc7c590c0b20"/>
				<textElement>
					<paragraph leftIndent="2"/>
				</textElement>
				<text><![CDATA[NUMERO]]></text>
			</staticText>
			<staticText>
				<reportElement x="476" y="20" width="100" height="20" uuid="1a237841-befa-40e3-876e-0e4253391ff5"/>
				<textElement>
					<paragraph leftIndent="5"/>
				</textElement>
				<text><![CDATA[DATA]]></text>
			</staticText>
			<staticText>
				<reportElement x="0" y="0" width="420" height="20" uuid="0cda0a71-66d2-4e7b-9c98-032a406fb9a4"/>
				<textElement textAlignment="Center"/>
				<text><![CDATA[ORDINE]]></text>
			</staticText>
			<line>
				<reportElement x="420" y="0" width="1" height="40" uuid="8687afb2-7cb9-4fe0-8b6e-b5167a955946"/>
			</line>
			<line>
				<reportElement x="0" y="40" width="802" height="1" uuid="3e34c1e9-8fba-4187-9c0f-2c4bdce78392"/>
			</line>
			<staticText>
				<reportElement x="576" y="20" width="176" height="20" uuid="563034d3-87d3-4ead-84bf-6fcfeb3b36e8"/>
				<text><![CDATA[RAGIONE SOCIALE]]></text>
			</staticText>
			<staticText>
				<reportElement x="177" y="20" width="178" height="20" uuid="7130d3ca-f82b-4bc5-ad22-c443c7e5e569"/>
				<text><![CDATA[CLIENTE]]></text>
			</staticText>
			<staticText>
				<reportElement x="355" y="20" width="65" height="20" uuid="40629272-747c-4fd9-8572-ec157b48468f"/>
				<text><![CDATA[PREZZO]]></text>
			</staticText>
			<staticText>
				<reportElement x="752" y="20" width="50" height="20" uuid="b81536a3-1f89-44a0-8bba-ab0de5c61851"/>
				<text><![CDATA[TOTALE]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="33" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="100" height="20" uuid="e3d954a1-666e-4651-89e8-90d2b9d0bdcd"/>
				<textFieldExpression><![CDATA[$F{codiceordine}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yyyy">
				<reportElement x="100" y="0" width="77" height="20" uuid="53c204c2-3288-4b17-a29e-6b21af2465b1"/>
				<textFieldExpression><![CDATA[$F{dataordine}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="420" y="-1" width="1" height="34" uuid="c37cc538-30e5-45bf-8618-3f624afd54cb"/>
			</line>
			<textField pattern="dd/MM/yyyy">
				<reportElement x="476" y="0" width="100" height="15" uuid="5f76e6c9-5320-4ceb-a270-f0ed395ae866"/>
				<textElement textAlignment="Left">
					<paragraph leftIndent="5" rightIndent="2"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{dataemissione}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="576" y="15" width="176" height="15" uuid="7926f2e6-5361-4303-b5f6-873950946a19"/>
				<textFieldExpression><![CDATA[$F{cognome} + " " +$F{nome}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="177" y="0" width="178" height="15" uuid="575e3d4e-2ef3-4c45-8ce2-ad861bd57941"/>
				<textFieldExpression><![CDATA[$F{ordineragsoc}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="177" y="15" width="178" height="15" uuid="59db658c-24a5-4433-bb7a-1ffe81942505"/>
				<textFieldExpression><![CDATA[$F{ordinecog} + " " +$F{ordinenom}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="421" y="1" width="55" height="20" uuid="f56d2e76-62e2-4986-ac8f-722c6da89d0b"/>
				<textElement textAlignment="Right">
					<paragraph rightIndent="2"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{numero}+"/"+$F{sezionale}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00">
				<reportElement x="355" y="0" width="65" height="20" uuid="038a9cfc-5494-4f53-ab18-8fd3a55a1daf"/>
				<textElement textAlignment="Right">
					<paragraph rightIndent="2"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{prezzoivato}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00">
				<reportElement x="752" y="1" width="50" height="20" uuid="5a75d7f8-ccb9-497b-b21a-5cea35cd8548"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression><![CDATA[$F{totalefattura}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="576" y="0" width="176" height="15" uuid="f632e720-33ce-44b6-95cb-bef4b4bba405"/>
				<textFieldExpression><![CDATA[$F{ragsoc}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="476" y="15" width="100" height="15" uuid="afe5a241-cc94-4fcc-b8b0-3199fc7685fc"/>
				<textElement>
					<font size="6"/>
					<paragraph leftIndent="5"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ins_time}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="15" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="16" splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band height="10" splitType="Stretch"/>
	</summary>
</jasperReport>
