<?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="Venta" pageWidth="612" pageHeight="792" whenNoDataType="BlankPage" columnWidth="532" leftMargin="40" rightMargin="40" topMargin="20" bottomMargin="20" isFloatColumnFooter="true" uuid="75b63c28-3726-4e1d-894d-7c17cf086cff">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<style name="Title" forecolor="#FFFFFF" fontName="Arial" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/>
	<style name="SubTitle" forecolor="#666666" fontName="Arial" fontSize="18"/>
	<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
	<style name="Detail" fontName="Arial" fontSize="12"/>
	<parameter name="EMPRESA" class="java.lang.String" isForPrompting="false"/>
	<parameter name="USUARIO" class="java.lang.String" isForPrompting="false"/>
	<parameter name="FECHA_INI" class="java.util.Date" isForPrompting="false"/>
	<parameter name="FECHA_FIN" class="java.util.Date" isForPrompting="false"/>
	<queryString>
		<![CDATA[SELECT SUM(d.precio*d.salida) monto, i.nombre impuesto, i.valor, pr.valor iva FROM propiedades pr, operacionesalmacen o INNER JOIN detalleoperacion d on o.idoperacion = d.idoperacion INNER JOIN productos p on d.idproducto = p.idproducto LEFT JOIN impuestos i ON p.idimpuesto = i.idimpuesto INNER JOIN documentos doc on o.iddocumento = doc.iddocumento WHERE pr.descripcion = 'iva' AND o.DTYPE = 'Ventas' AND o.estado = 1 AND o.fecha BETWEEN $P{FECHA_INI} AND $P{FECHA_FIN} GROUP BY p.idimpuesto, i.nombre, i.valor, pr.valor ORDER BY i.nombre]]>
	</queryString>
	<field name="monto" class="java.lang.Double"/>
	<field name="impuesto" class="java.lang.String"/>
	<field name="valor" class="java.lang.Double"/>
	<field name="iva" class="java.lang.Double"/>
	<variable name="valor" class="java.lang.Double">
		<variableExpression><![CDATA[($F{impuesto}== null?$F{iva}:$F{valor})/100]]></variableExpression>
	</variable>
	<variable name="montoTot" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[$F{monto}]]></variableExpression>
	</variable>
	<variable name="v_impuesto" class="java.lang.Double">
		<variableExpression><![CDATA[($F{monto}/(1+$V{valor}))*$V{valor}]]></variableExpression>
	</variable>
	<variable name="v_impuestoTot" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[$V{v_impuesto}]]></variableExpression>
	</variable>
	<group name="impuesto">
		<groupExpression><![CDATA[$F{impuesto}]]></groupExpression>
		<groupHeader>
			<band/>
		</groupHeader>
		<groupFooter>
			<band/>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band height="75" splitType="Stretch">
			<textField pattern="">
				<reportElement x="0" y="41" width="532" height="18" uuid="63d66c12-8cff-4839-8635-0de732c835ea"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA["Del " + new SimpleDateFormat("dd-MMM-yyyy").format($P{FECHA_INI}) + "  Al  " + new SimpleDateFormat("dd-MMM-yyyy").format($P{FECHA_FIN})]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="0" y="0" width="532" height="21" uuid="cc27c705-0491-4516-bdac-6a69b0799ade"/>
				<box>
					<bottomPen lineWidth="0.5" lineStyle="Double"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="14" isBold="true"/>
				</textElement>
				<text><![CDATA[RESUMEN DE VENTAS CON IMPUESTOS]]></text>
			</staticText>
			<textField>
				<reportElement x="0" y="21" width="532" height="20" uuid="cf020205-ab20-4d39-bf80-32a8ca051aec"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="11" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band/>
	</columnHeader>
	<detail>
		<band height="15">
			<textField isBlankWhenNull="true">
				<reportElement x="0" y="0" width="175" height="15" uuid="db986958-a26a-4b67-b6c6-de7f23609db6"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="10" isBold="false"/>
				</textElement>
				<textFieldExpression><![CDATA[($F{impuesto}== null? "IVA":$F{impuesto})]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.0000;-#,##0.0000" isBlankWhenNull="true">
				<reportElement x="275" y="0" width="75" height="15" uuid="9aa903ca-9bbb-4442-8783-fe8400f6ae13"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$V{v_impuesto}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;-#,##0.00">
				<reportElement x="175" y="0" width="100" height="15" uuid="97420905-74d7-421a-bb8a-aa5c369ae64b"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{monto}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<summary>
		<band height="20">
			<textField pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement x="175" y="0" width="100" height="20" uuid="ba947f47-7f35-49b3-8852-849758700fae"/>
				<box leftPadding="2" rightPadding="2">
					<topPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$V{montoTot}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement x="275" y="0" width="75" height="20" uuid="22275416-2471-4bbd-98a4-52c7821c0e0b"/>
				<box leftPadding="2" rightPadding="2">
					<topPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$V{v_impuestoTot}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="0" y="0" width="175" height="20" uuid="d74c23d9-02e1-4b64-9d72-9021b2fe2750"/>
				<box leftPadding="2" rightPadding="2"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[TOTAL GENERAL]]></text>
			</staticText>
		</band>
	</summary>
</jasperReport>
