src/org/openbravo/erpCommon/ad_reports/ReportStandardCostsJR_srptcosts.jrxml
author David Baz Fayos <david.baz@openbravo.com>
Tue, 27 May 2008 15:26:10 +0000
changeset 1044 8691bbc94032
parent 0 0247c26f10c6
child 1859 f60af28f7794
permissions -rw-r--r--
Removed old frame parameter of windowTableId
<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
		 name="ReportStandardCostsJR_srptcosts"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Landscape"
		 pageWidth="505"
		 pageHeight="46"
		 columnWidth="505"
		 columnSpacing="0"
		 leftMargin="0"
		 rightMargin="0"
		 topMargin="0"
		 bottomMargin="0"
		 whenNoDataType="NoPages"
		 isTitleNewPage="false"
		 isSummaryNewPage="false">
	<property name="ireport.scriptlethandling" value="0" />
	<property name="ireport.encoding" value="UTF-8" />
	<import value="java.util.*" />
	<import value="net.sf.jasperreports.engine.*" />
	<import value="net.sf.jasperreports.engine.data.*" />

	<style 
		name="default"
		isDefault="false"
		vAlign="Middle"
		fontName="Bitstream Vera Sans"
		fontSize="10"
	/>
	<style 
		name="Report_Title"
		isDefault="false"
		leftPadding="5"
		fontName="Bitstream Vera Sans"
		fontSize="18"
	/>
	<style 
		name="Report_Subtitle"
		isDefault="false"
		forecolor="#555555"
		leftPadding="5"
		fontName="Bitstream Vera Sans"
		fontSize="14"
	/>
	<style 
		name="Report_Data_Label"
		isDefault="false"
		fontName="Bitstream Vera Sans"
		fontSize="11"
		isBold="true"
	/>
	<style 
		name="Report_Data_Field"
		isDefault="false"
		fontName="Bitstream Vera Sans"
		fontSize="11"
		isBold="false"
	/>
	<style 
		name="Total_Field"
		isDefault="false"
		mode="Opaque"
		forecolor="#000000"
		backcolor="#CCCCCC"
		vAlign="Middle"
		leftPadding="5"
		fontName="Bitstream Vera Sans"
		fontSize="10"
		isBold="true"
	/>
	<style 
		name="GroupHeader_DarkGray"
		isDefault="false"
		mode="Opaque"
		forecolor="#FFFFFF"
		backcolor="#555555"
		vAlign="Middle"
		leftPadding="5"
		fontName="Bitstream Vera Sans"
		fontSize="12"
		isBold="true"
	/>
	<style 
		name="Group_Data_Label"
		isDefault="false"
		fontName="Bitstream Vera Sans"
		fontSize="11"
		isBold="true"
	/>
	<style 
		name="Group_Data_Field"
		isDefault="false"
		fontName="Bitstream Vera Sans"
		fontSize="11"
	/>
	<style 
		name="Detail_Header"
		isDefault="false"
		mode="Opaque"
		forecolor="#FFFFFF"
		backcolor="#5D5D5D"
		vAlign="Middle"
		leftBorder="1Point"
		leftBorderColor="#FFFFFF"
		leftPadding="5"
		rightBorder="1Point"
		rightBorderColor="#FFFFFF"
		fontName="Bitstream Vera Sans"
		fontSize="10"
		isBold="true"
	/>
	<style 
		name="Detail_Line"
		isDefault="false"
		fontName="Bitstream Vera Sans"
		fontSize="8"
	>

		<conditionalStyle>
			<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
			<style 
				name="Detail_Line"
				isDefault="false"
				mode="Opaque"
				backcolor="#CCCCCC"
			/>
		</conditionalStyle>
	</style>
	<style 
		name="Total_Gray"
		isDefault="false"
		mode="Opaque"
		forecolor="#000000"
		backcolor="#CCCCCC"
	/>
	<style 
		name="Detail_Data_Label"
		isDefault="false"
		mode="Opaque"
		backcolor="#CCCCCC"
		fontName="Bitstream Vera Sans"
		fontSize="10"
		isBold="true"
	/>
	<style 
		name="Detail_Data_Field"
		isDefault="false"
		mode="Opaque"
		backcolor="#CCCCCC"
		fontName="Bitstream Vera Sans"
		fontSize="10"
	/>
	<style 
		name="Group_Footer"
		isDefault="false"
		fontName="Bitstream Vera Sans"
		fontSize="11"
		isBold="true"
	/>
	<style 
		name="Report_Footer"
		isDefault="true"
		vAlign="Middle"
		fontName="Bitstream Vera Sans"
		fontSize="11"
	/>

	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
	</parameter>
	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
		<defaultValueExpression ><![CDATA["(1000000)"]]></defaultValueExpression>
	</parameter>
	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
		<defaultValueExpression ><![CDATA["(0)"]]></defaultValueExpression>
	</parameter>
	<parameter name="SEQUENCE_ID" isForPrompting="false" class="java.math.BigDecimal">
		<defaultValueExpression ><![CDATA[new BigDecimal(1000004)]]></defaultValueExpression>
	</parameter>
	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
	<queryString><![CDATA[SELECT 1 AS LINEORDER, 
       AD_COLUMN_IDENTIFIER(to_char('M_PRODUCT'), to_char(M_PRODUCT_ID), $P{LANGUAGE}) AS CONCEPT,
       quantity*COALESCE(decrease,1)*COALESCE(rejected,1) AS QUANTITY,
       COALESCE(COST, 0) AS UNIT_COST,
       COALESCE(COST*quantity*COALESCE(decrease,1)*COALESCE(rejected,1),0) AS COST
FROM MA_SEQUENCEPRODUCT
WHERE MA_SEQUENCEPRODUCT.MA_SEQUENCE_ID = $P{SEQUENCE_ID}
  AND MA_SEQUENCEPRODUCT.PRODUCTIONTYPE = '-'
UNION ALL
SELECT 2 AS LINEORDER, 
       AD_COLUMN_IDENTIFIER(to_char('MA_SEQUENCE'), to_char(MA_SEQUENCE_ID), $P{LANGUAGE}) AS CONCEPT,
       1 AS QUANTITY, COALESCE(OUTSOURCINGCOST,0) AS UNIT_COST, COALESCE(OUTSOURCINGCOST,0) AS COST
FROM MA_SEQUENCE
WHERE MA_SEQUENCE_ID = $P{SEQUENCE_ID}
  AND OUTSOURCED = 'Y'
UNION ALL
SELECT 3 AS LINEORDER,
       AD_COLUMN_IDENTIFIER(to_char('MA_COSTCENTER'), to_char(MA_PROCESS.MA_COSTCENTER_ID), $P{LANGUAGE}) AS CONCEPT,
       1 AS QUANTITY, COALESCE(MA_SEQUENCE.COSTCENTERCOST,0) AS UNIT_COST, COALESCE(MA_SEQUENCE.COSTCENTERCOST,0) AS COST
FROM MA_SEQUENCE, MA_PROCESS
WHERE MA_SEQUENCE.MA_SEQUENCE_ID = $P{SEQUENCE_ID}
  AND MA_SEQUENCE.OUTSOURCED = 'N'
  AND MA_SEQUENCE.MA_PROCESS_ID = MA_PROCESS.MA_PROCESS_ID
UNION ALL
SELECT 4 AS LINEORDER,
       AD_COLUMN_IDENTIFIER(to_char('C_SALARY_CATEGORY'), to_char(MA_SEQUENCE_EMPLOYEE.C_SALARY_CATEGORY_ID), $P{LANGUAGE}) AS CONCEPT,
       1 AS QUANTITY, MA_SEQUENCE_EMPLOYEE.CALCCOST AS UNIT_COST, MA_SEQUENCE_EMPLOYEE.CALCCOST AS COST
FROM MA_SEQUENCE, MA_SEQUENCE_EMPLOYEE
WHERE MA_SEQUENCE.MA_SEQUENCE_ID = MA_SEQUENCE_EMPLOYEE.MA_SEQUENCE_ID
  AND MA_SEQUENCE.MA_SEQUENCE_ID = $P{SEQUENCE_ID}
  AND MA_SEQUENCE.OUTSOURCED = 'N'
UNION ALL
SELECT 5 AS LINEORDER,
       AD_COLUMN_IDENTIFIER(to_char('MA_MACHINE'), to_char(MA_SEQUENCE_MACHINE.MA_MACHINE_ID), $P{LANGUAGE}) AS CONCEPT,
       1 AS QUANTITY, MA_SEQUENCE_MACHINE.CALCCOST AS UNIT_COST, MA_SEQUENCE_MACHINE.CALCCOST AS COST
FROM MA_SEQUENCE, MA_SEQUENCE_MACHINE
WHERE MA_SEQUENCE.MA_SEQUENCE_ID = MA_SEQUENCE_MACHINE.MA_SEQUENCE_ID
  AND MA_SEQUENCE.MA_SEQUENCE_ID = $P{SEQUENCE_ID}
  AND MA_SEQUENCE.OUTSOURCED = 'N'
UNION ALL
SELECT 6 AS LINEORDER,
       AD_COLUMN_IDENTIFIER(to_char('MA_INDIRECT_COST'), to_char(MA_SEQUENCE_IC.MA_INDIRECT_COST_ID), $P{LANGUAGE}) AS CONCEPT,
       1 AS QUANTITY, MA_SEQUENCE_IC.CALCCOST AS UNIT_COST, MA_SEQUENCE_IC.CALCCOST AS COST
FROM MA_SEQUENCE, MA_SEQUENCE_IC
WHERE MA_SEQUENCE.MA_SEQUENCE_ID = MA_SEQUENCE_IC.MA_SEQUENCE_ID
  AND MA_SEQUENCE.MA_SEQUENCE_ID = $P{SEQUENCE_ID}
  AND MA_SEQUENCE.OUTSOURCED = 'N'
ORDER BY LINEORDER, QUANTITY DESC, COST DESC]]></queryString>

	<field name="LINEORDER" class="java.math.BigDecimal"/>
	<field name="CONCEPT" class="java.lang.String"/>
	<field name="QUANTITY" class="java.math.BigDecimal"/>
	<field name="UNIT_COST" class="java.math.BigDecimal"/>
	<field name="COST" class="java.math.BigDecimal"/>

	<variable name="DetailFieldTotal" class="java.lang.String" resetType="Report" calculation="Nothing">
	</variable>
	<variable name="COST_TOTAL" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
	</variable>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</title>
		<pageHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</pageHeader>
		<columnHeader>
			<band height="16"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						style="Detail_Header"
						x="0"
						y="0"
						width="272"
						height="16"
						key="element-90"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement>
						<font/>
					</textElement>
				<text><![CDATA[CONCEPT]]></text>
				</staticText>
				<staticText>
					<reportElement
						style="Detail_Header"
						x="272"
						y="0"
						width="75"
						height="16"
						key="element-90"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement>
						<font/>
					</textElement>
				<text><![CDATA[Quantity]]></text>
				</staticText>
				<staticText>
					<reportElement
						style="Detail_Header"
						x="347"
						y="0"
						width="75"
						height="16"
						key="element-90"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold"/>
					</textElement>
				<text><![CDATA[Cost]]></text>
				</staticText>
				<staticText>
					<reportElement
						style="Detail_Header"
						x="422"
						y="0"
						width="83"
						height="16"
						key="element-90"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold"/>
					</textElement>
				<text><![CDATA[Amount]]></text>
				</staticText>
			</band>
		</columnHeader>
		<detail>
			<band height="14"  isSplitAllowed="true" >
				<frame>					<reportElement
						style="Detail_Line"
						x="0"
						y="0"
						width="505"
						height="14"
						key="frame-1"
						stretchType="RelativeToBandHeight"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						style="default"
						x="422"
						y="0"
						width="83"
						height="14"
						key="textField-1"
						stretchType="RelativeToBandHeight"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#666666" leftPadding="5" rightBorder="1Point" rightBorderColor="#666666" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[($F{COST}!=null)?$P{NUMBERFORMAT}.format($F{COST}):new String(" ")]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						style="default"
						x="347"
						y="0"
						width="75"
						height="14"
						key="textField-2"
						stretchType="RelativeToBandHeight"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#666666" leftPadding="5" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[($F{UNIT_COST}!=null)?$P{NUMBERFORMAT}.format($F{UNIT_COST}):new String(" ")]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						style="default"
						x="272"
						y="0"
						width="75"
						height="14"
						key="textField-3"
						stretchType="RelativeToBandHeight"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#666666" leftPadding="5" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[($F{QUANTITY}!=null)?$P{NUMBERFORMAT}.format($F{QUANTITY}):new String(" ")]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						style="default"
						x="0"
						y="0"
						width="272"
						height="14"
						key="textField-4"
						stretchType="RelativeToBandHeight"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#666666" leftPadding="5" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONCEPT}]]></textFieldExpression>
				</textField>
				</frame>			</band>
		</detail>
		<columnFooter>
			<band height="16"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						style="Total_Field"
						x="422"
						y="1"
						width="83"
						height="15"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right">
						<font pdfFontName="Helvetica-Bold"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[($V{COST_TOTAL}!=null)?$P{NUMBERFORMAT}.format($V{COST_TOTAL}):new String(" ")]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						style="Report_Footer"
						x="272"
						y="1"
						width="150"
						height="15"
						key="staticText-1"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right">
						<font/>
					</textElement>
				<text><![CDATA[Sequence Total Cost: ]]></text>
				</staticText>
				<line direction="TopDown">
					<reportElement
						style="Report_Footer"
						x="0"
						y="0"
						width="505"
						height="0"
						forecolor="#666666"
						key="line-1"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
			</band>
		</columnFooter>
		<pageFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</pageFooter>
		<summary>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</summary>
</jasperReport>