<?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="com_plan_comisiones_subreport1" language="groovy" pageWidth="570" pageHeight="555" orientation="Landscape" columnWidth="570" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/control_comisiones/com_plan_comisiones"/>
	<property name="ireport.jasperserver.url" value="http://192.168.2.43:8090/jasperserver/services/repository"/>
	<parameter name="vigencia" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_plan_comisiones" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="whereIdComisiones" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="num_doc" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT
tab0.num_doc as num_doc, tab0.razsoc as razsoc, tab0.num_doc||' - '||tab0.razsoc as completo_ter,
tab0.tipter_ter as tipter_ter,
tab0.tipoter_text as tipoter_text, tab0.tipter_ter||' - '||tab0.tipoter_text as completo_tipter,
tab0.nitocc as nitocc,
tab0.id_plan_comisiones as id_plan_comisiones,
tab0.vigencia as vigencia, tab0.id_transporte as id_transporte, tab0.sueldo as sueldo, tab0.cargo as cargo,
tab0.fecha_salida as fecha_salida,
tab0.dias as dias, tab0.codreg as codreg, tab0.total_comision as total_comision, tab0.estado as estado,
tab0.fecha_regreso as fecha_regreso,
tab0.gastos_taxis as gastos_taxis,
tab0.dias_manu as dias_manu, tab0.tipter as tipter, tab0.codobj as codobj, tab0.valor as valor,
tab0.valor_gasto as valor_gasto, tab0.viaticos as viaticos, tab0.acumulado_gastos as acumulado_gastos,
tab0.taxis as taxis, tab0.tarifa as tarifa,
tab1.descripcion as descripcion_trans,
tab2.desreg as desreg,
tab2.abreviatura as sede_abreviatura,
tab3.descripcion as tipo_comisionado,
tab0.id_comisiones,
tab4.proyecto

FROM COM_PLAN_COMISIONADOS_PLACOM_V tab0

JOIN TRANSPORTES tab1 ON tab0.id_transporte = tab1.id

JOIN REGIONALES tab2 ON tab0.codreg = tab2.codreg

JOIN COM_TIPO_COMISIONADO tab3 ON tab0.tipter = tab3.tipter

join COM_plan_comisiones_v tab4 on tab4.id_plan_comisiones=tab0.id_plan_comisiones and tab4.vigencia=tab0.vigencia

WHERE
tab0.id_plan_comisiones = $P{id_plan_comisiones}
AND tab0.vigencia = $P{vigencia}
and tab0.nitocc = $P{num_doc}
$P!{whereIdComisiones}
ORDER BY
tab0.vigencia ,
tab0.id_plan_comisiones ,
tab0.tipoter_text ,
tab0.nitocc]]>
	</queryString>
	<field name="NUM_DOC" class="java.math.BigDecimal"/>
	<field name="RAZSOC" class="java.lang.String"/>
	<field name="COMPLETO_TER" class="java.lang.String"/>
	<field name="TIPTER_TER" class="java.lang.String"/>
	<field name="TIPOTER_TEXT" class="java.lang.String"/>
	<field name="COMPLETO_TIPTER" class="java.lang.String"/>
	<field name="NITOCC" class="java.math.BigDecimal"/>
	<field name="ID_PLAN_COMISIONES" class="java.math.BigDecimal"/>
	<field name="VIGENCIA" class="java.math.BigDecimal"/>
	<field name="ID_TRANSPORTE" class="java.math.BigDecimal"/>
	<field name="SUELDO" class="java.math.BigDecimal"/>
	<field name="CARGO" class="java.math.BigDecimal"/>
	<field name="FECHA_SALIDA" class="java.sql.Timestamp"/>
	<field name="DIAS" class="java.math.BigDecimal"/>
	<field name="CODREG" class="java.lang.String"/>
	<field name="TOTAL_COMISION" class="java.math.BigDecimal"/>
	<field name="ESTADO" class="java.math.BigDecimal"/>
	<field name="FECHA_REGRESO" class="java.sql.Timestamp"/>
	<field name="GASTOS_TAXIS" class="java.math.BigDecimal"/>
	<field name="DIAS_MANU" class="java.math.BigDecimal"/>
	<field name="TIPTER" class="java.lang.String"/>
	<field name="CODOBJ" class="java.lang.String"/>
	<field name="VALOR" class="java.math.BigDecimal"/>
	<field name="VALOR_GASTO" class="java.math.BigDecimal"/>
	<field name="VIATICOS" class="java.math.BigDecimal"/>
	<field name="ACUMULADO_GASTOS" class="java.math.BigDecimal"/>
	<field name="TAXIS" class="java.math.BigDecimal"/>
	<field name="TARIFA" class="java.math.BigDecimal"/>
	<field name="DESCRIPCION_TRANS" class="java.lang.String"/>
	<field name="DESREG" class="java.lang.String"/>
	<field name="SEDE_ABREVIATURA" class="java.lang.String"/>
	<field name="TIPO_COMISIONADO" class="java.lang.String"/>
	<field name="ID_COMISIONES" class="java.math.BigDecimal"/>
	<field name="PROYECTO" class="java.lang.String"/>
	<variable name="sum_dias" class="java.math.BigDecimal" resetType="Group" resetGroup="TIPTER" calculation="Sum">
		<variableExpression><![CDATA[$F{DIAS}]]></variableExpression>
	</variable>
	<variable name="sum_valor" class="java.math.BigDecimal" resetType="Group" resetGroup="TIPTER" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR}]]></variableExpression>
	</variable>
	<variable name="sum_dias_total" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{DIAS}]]></variableExpression>
	</variable>
	<variable name="sum_valor_total" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR}]]></variableExpression>
	</variable>
	<group name="TIPTER">
		<groupExpression><![CDATA[$F{TIPTER_TER}]]></groupExpression>
	</group>
	<columnHeader>
		<band height="20" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="525" y="0" width="45" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Total comisión]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="335" y="0" width="190" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Objetos de Gasto]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="120" y="0" width="100" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Nombre]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="220" y="0" width="30" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Sede]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="310" y="0" width="25" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Días
viáticos]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="250" y="0" width="30" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Fecha Salida]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="280" y="0" width="30" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Fecha Regreso]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="80" y="0" width="40" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[No. Documento]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="0" y="0" width="80" height="20" forecolor="#000000" backcolor="#88C2F9"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Proyecto]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="10" splitType="Stretch">
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="120" y="0" width="100" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{RAZSOC}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="220" y="0" width="30" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SEDE_ABREVIATURA}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="310" y="0" width="25" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DIAS}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="250" y="0" width="30" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{FECHA_SALIDA}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="280" y="0" width="30" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{FECHA_REGRESO}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="525" y="0" width="45" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR}]]></textFieldExpression>
			</textField>
			<subreport>
				<reportElement stretchType="RelativeToBandHeight" x="335" y="0" width="190" height="10"/>
				<subreportParameter name="num_doc">
					<subreportParameterExpression><![CDATA[$F{NUM_DOC}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="vigencia">
					<subreportParameterExpression><![CDATA[$F{VIGENCIA}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="id_plan_comisiones">
					<subreportParameterExpression><![CDATA[$F{ID_PLAN_COMISIONES}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression class="java.lang.String"><![CDATA["repo:resol_modif_orig_subreport_1"]]></subreportExpression>
			</subreport>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="80" y="0" width="40" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NUM_DOC}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="0" width="80" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2" rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PROYECTO}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
</jasperReport>
