billing/input-files/DEMO/jasper/CLASSIC/invoice/invoice_detail_cat_line.jrxml
2025-02-18 14:52:38 +03:00

284 lines
14 KiB
XML

<?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="Invoice_detail" language="groovy" pageWidth="595" pageHeight="842" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="169c5323-2cc3-4a80-bb5b-169e57c4a4d9">
<property name="ireport.zoom" value="1.3310000000000004"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="xmlDateFormat" class="java.lang.String" isForPrompting="false">
<parameterDescription><![CDATA[]]></parameterDescription>
<defaultValueExpression><![CDATA["dd/MM/yyyy"]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[/invoice/detail/userAccounts/userAccount/categories/category/subCategories/subCategory/line]]>
</queryString>
<field name="userAccountCode" class="java.lang.String">
<fieldDescription><![CDATA[ancestor::userAccount/@code]]></fieldDescription>
</field>
<field name="lineLabel" class="java.lang.String">
<fieldDescription><![CDATA[label]]></fieldDescription>
</field>
<field name="lineCode" class="java.lang.String">
<fieldDescription><![CDATA[@code]]></fieldDescription>
</field>
<field name="quantity" class="java.lang.Double">
<fieldDescription><![CDATA[sum(quantity)]]></fieldDescription>
</field>
<field name="amountWithoutTax" class="java.lang.Double">
<fieldDescription><![CDATA[sum(amountWithoutTax)]]></fieldDescription>
</field>
<field name="unitAmountWithoutTax" class="java.lang.Double">
<fieldDescription><![CDATA[unitAmountWithoutTax]]></fieldDescription>
</field>
<field name="unit" class="java.lang.String">
<fieldDescription><![CDATA[unit]]></fieldDescription>
</field>
<field name="usageDate" class="java.lang.String">
<fieldDescription><![CDATA[usageDate]]></fieldDescription>
</field>
<field name="count1" class="java.lang.Integer">
<fieldDescription><![CDATA[count(/invoice/detail/userAccounts/userAccount/categories/category/subCategories/subCategory/line)]]></fieldDescription>
</field>
<field name="userAccountDescription" class="java.lang.String">
<fieldDescription><![CDATA[ancestor::userAccount/@description]]></fieldDescription>
</field>
<field name="gasCurrentIndex" class="java.lang.Double">
<fieldDescription><![CDATA[/invoice/detail/userAccounts/userAccount/customFields/customField[@code="CF_ENERGY_GAS_INDEX_CURRENT"]]]></fieldDescription>
</field>
<field name="elecCurrentIndex" class="java.lang.Double">
<fieldDescription><![CDATA[/invoice/detail/userAccounts/userAccount/customFields/customField[@code="CF_ENERGY_ELEC_INDEX_CURRENT"]]]></fieldDescription>
</field>
<field name="invoiceCategory" class="java.lang.String">
<fieldDescription><![CDATA[ancestor::category/@label]]></fieldDescription>
</field>
<field name="periodEndDate" class="java.lang.String">
<fieldDescription><![CDATA[@periodEndDate]]></fieldDescription>
</field>
<field name="periodStartDate" class="java.lang.String">
<fieldDescription><![CDATA[@periodStartDate]]></fieldDescription>
</field>
<field name="lineNewIndex" class="java.lang.String">
<fieldDescription><![CDATA[edr/@parameter3]]></fieldDescription>
</field>
<field name="linePreviousIndex" class="java.lang.String">
<fieldDescription><![CDATA[edr/@parameter4]]></fieldDescription>
</field>
<sortField name="userAccountCode"/>
<sortField name="invoiceCategory"/>
<sortField name="lineLabel"/>
<sortField name="usageDate"/>
<sortField name="unitAmountWithoutTax"/>
<filterExpression><![CDATA[$F{count1}>0]]></filterExpression>
<group name="1 - User Account">
<groupExpression><![CDATA[$F{userAccountCode}]]></groupExpression>
<groupHeader>
<band height="22">
<textField>
<reportElement x="15" y="0" width="196" height="21" uuid="95b74ef3-110e-43be-a8df-56a87534535d"/>
<box leftPadding="10">
<bottomPen lineWidth="0.0" lineStyle="Dashed" lineColor="#FF9900"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="true" isItalic="true" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{userAccountDescription}]]></textFieldExpression>
</textField>
<line>
<reportElement x="15" y="21" width="565" height="1" forecolor="#CCCCCC" uuid="e38b2196-1239-4c11-a5ca-3c92f0b123e3"/>
<graphicElement>
<pen lineWidth="0.5" lineStyle="Dotted" lineColor="#999999"/>
</graphicElement>
</line>
<textField pattern="###0" isBlankWhenNull="true">
<reportElement x="305" y="0" width="77" height="21" uuid="e1913eb9-3d99-4fa7-ab0c-16f1b69bfc25"/>
<box leftPadding="10">
<bottomPen lineWidth="0.0" lineStyle="Dashed" lineColor="#FF9900"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="true" isItalic="true" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{gasCurrentIndex}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="384" y="0" width="91" height="22" uuid="ae3bdb32-8222-4b48-81bd-85461133acd9">
<printWhenExpression><![CDATA[$F{elecCurrentIndex} != null]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[electricity index: ]]></text>
</staticText>
<staticText>
<reportElement x="238" y="0" width="67" height="22" uuid="7c207b43-ff7d-4c7c-a246-0db4b507e5a4">
<printWhenExpression><![CDATA[$F{gasCurrentIndex} != null]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[gas index: ]]></text>
</staticText>
<textField pattern="###0" isBlankWhenNull="true">
<reportElement x="475" y="0" width="105" height="22" uuid="3d128546-b7f9-434b-8281-246a9d8c494e"/>
<box leftPadding="10">
<bottomPen lineWidth="0.0" lineStyle="Dashed" lineColor="#FF9900"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="true" isItalic="true" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{elecCurrentIndex}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
</group>
<group name="2 - Invoice Category">
<groupExpression><![CDATA[$F{invoiceCategory}]]></groupExpression>
<groupHeader>
<band height="22">
<textField>
<reportElement x="15" y="0" width="565" height="20" uuid="dffb857e-236e-4b3c-9145-cc701f05fd2c"/>
<textElement verticalAlignment="Bottom">
<font fontName="DejaVu Sans" size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{invoiceCategory}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
</group>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="45">
<staticText>
<reportElement x="342" y="15" width="69" height="30" uuid="30ee010a-a3a6-43bb-924d-ca53f5503199"/>
<box rightPadding="2"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Unit price]]></text>
</staticText>
<staticText>
<reportElement x="15" y="15" width="259" height="30" uuid="6a8d5a74-a558-4313-a52d-d8130494a348"/>
<box leftPadding="2"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Items]]></text>
</staticText>
<staticText>
<reportElement x="287" y="14" width="53" height="30" uuid="07015adc-0831-43f0-9322-94a0a427ece0"/>
<box leftPadding="2"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Date]]></text>
</staticText>
<staticText>
<reportElement x="464" y="15" width="43" height="30" uuid="26c5e737-d1c2-4c13-a385-e3698101e829"/>
<box leftPadding="0" rightPadding="2"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Unit]]></text>
</staticText>
<line>
<reportElement x="15" y="44" width="565" height="1" forecolor="#CCCCCC" uuid="49fddbb7-327b-4080-b5d7-05bd11bed13d"/>
<graphicElement>
<pen lineWidth="0.5" lineStyle="Dotted" lineColor="#999999"/>
</graphicElement>
</line>
<staticText>
<reportElement x="413" y="15" width="50" height="30" uuid="0c0d4407-2e83-433a-94b4-340a7acf82be"/>
<box rightPadding="2"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Quantity]]></text>
</staticText>
<staticText>
<reportElement x="508" y="15" width="76" height="29" uuid="1e896989-522b-46a3-b16c-2bc0439663d1"/>
<box rightPadding="2"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" isBold="true"/>
</textElement>
<text><![CDATA[Total w/o Tax]]></text>
</staticText>
</band>
</pageHeader>
<detail>
<band height="16">
<textField>
<reportElement x="15" y="0" width="259" height="15" uuid="aebac6ee-7be4-4a44-9230-ee3968716f66">
<printWhenExpression><![CDATA[($F{lineNewIndex} == null) || $F{lineNewIndex}.equals("")]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{lineLabel}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="15" y="0" width="259" height="15" uuid="048e2961-1622-446a-8fc1-8021d8c72655">
<printWhenExpression><![CDATA[!($F{lineNewIndex} == null) && !$F{lineNewIndex}.equals("")]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{lineLabel}+" (index: "+ $F{linePreviousIndex} + " to " + $F{lineNewIndex} + ")"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.000" isBlankWhenNull="true">
<reportElement positionType="Float" x="511" y="0" width="73" height="15" isPrintWhenDetailOverflows="true" uuid="36419c39-6603-4092-9dbe-b643b28ad12a"/>
<box rightPadding="2"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{amountWithoutTax}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#0.0000" isBlankWhenNull="true">
<reportElement positionType="Float" mode="Transparent" x="342" y="0" width="69" height="15" isPrintWhenDetailOverflows="true" uuid="0ca42a84-59db-46b9-a4d3-227e7163639c"/>
<box leftPadding="0" rightPadding="2"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{unitAmountWithoutTax}]]></textFieldExpression>
</textField>
<line>
<reportElement x="15" y="15" width="565" height="1" forecolor="#999999" uuid="3b4bb476-6f45-44a1-9025-a797860912ec"/>
<graphicElement>
<pen lineWidth="0.5" lineStyle="Dotted" lineColor="#999999"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement positionType="Float" x="464" y="1" width="43" height="15" isPrintWhenDetailOverflows="true" uuid="60b3330f-b794-40e2-bb15-3e1ec1ad0502"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{unit}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#0.00" isBlankWhenNull="true">
<reportElement positionType="Float" x="416" y="0" width="46" height="15" isPrintWhenDetailOverflows="true" uuid="720b0a0c-ab58-47fe-acad-85f690554947"/>
<box leftPadding="0" rightPadding="2"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[($F{periodEndDate}.equals("")||$F{lineCode}.contains("_USG"))?$F{quantity}:($F{quantity}.doubleValue() != $F{quantity}.longValue()?"prorata":"")]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="yyyy-MM-dd" isBlankWhenNull="true">
<reportElement x="167" y="0" width="173" height="15" uuid="a3729a4b-61ce-4e22-8dc7-177cd79b03e2">
<printWhenExpression><![CDATA[$F{periodEndDate}.equals("")||$F{lineCode}.contains("_USG")]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat($P{xmlDateFormat}).parse($F{usageDate})]]></textFieldExpression>
</textField>
<textField>
<reportElement x="145" y="0" width="195" height="15" uuid="0b36d6a2-36fe-4a4f-be78-34122e8fd2cc">
<printWhenExpression><![CDATA[!($F{periodEndDate}.equals("")||$F{lineCode}.contains("_USG"))]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="9"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat('yyyy-MM-dd').format(new SimpleDateFormat($P{xmlDateFormat}).parse($F{periodStartDate})) + " to " + new SimpleDateFormat('yyyy-MM-dd').format(new SimpleDateFormat($P{xmlDateFormat}).parse($F{periodEndDate}))]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>