<?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="repl_task_det" pageWidth="745" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="709" leftMargin="18" rightMargin="18" topMargin="3" bottomMargin="18">
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="P_REPL_ID" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT REPL_ORD_DET.REPL_ORDER,
       REPL_ORD_DET.SALE_ORDER,
       REPL_ORD_DET.LINE_NO__SORD,
       ITEM.ITEM_CODE||ITEM.DESCR ITEM_CODE ,
       REPL_ORD_DET.LOC_CODE,
       REPL_ORD_DET.LOT_NO,
       REPL_ORD_DET.LOT_SL,
       REPL_ORD_DET.NO_ART,
       REPL_ORD_DET.QUANTITY,
       REPL_ORD_DET.LOC_CODE__TO,
      (CASE WHEN WAVE_TASK_DET.WAVE_STATUS='V' THEN 'Verified' WHEN WAVE_TASK_DET.WAVE_STATUS='W'
      THEN 'Held' WHEN  WAVE_TASK_DET.WAVE_STATUS='C' THEN 'Created' else '' end) AS STATUS
FROM   REPL_ORD_DET,ITEM,REPL_ORD_HDR,REPL_ISS_HDR,WAVE_TASK_DET
WHERE  REPL_ORD_DET.ITEM_CODE   = ITEM.ITEM_CODE
AND    REPL_ORD_HDR.REPL_ORDER  = REPL_ORD_DET.REPL_ORDER
and    REPL_ORD_DET.REPL_ORDER  = WAVE_TASK_DET.REF_ID
--AND    WAVE_TASK_DET.REF_TYPE     IN ('') Except it records coming correct.
AND    REPL_ORD_HDR.WAVE_ID     =$P{P_REPL_ID}
and    REPL_ORD_HDR.REPL_ORDER =REPL_ISS_HDR.repl_order(+)
order by REPL_ORD_DET.REPL_ORDER,REPL_ORD_DET.LOC_CODE]]>
	</queryString>
	<field name="REPL_ORDER" class="java.lang.String"/>
	<field name="SALE_ORDER" class="java.lang.String"/>
	<field name="LINE_NO__SORD" class="java.lang.String"/>
	<field name="ITEM_CODE" class="java.lang.String"/>
	<field name="LOC_CODE" class="java.lang.String"/>
	<field name="LOT_NO" class="java.lang.String"/>
	<field name="LOT_SL" class="java.lang.String"/>
	<field name="NO_ART" class="java.lang.String"/>
	<field name="QUANTITY" class="java.lang.String"/>
	<field name="LOC_CODE__TO" class="java.lang.String"/>
	<field name="STATUS" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="17" splitType="Stretch">
			<staticText>
				<reportElement x="4" y="2" width="700" height="15"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Replenishment Tasks Details]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="29" splitType="Stretch">
			<staticText>
				<reportElement x="62" y="2" width="54" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Sale Order]]></text>
			</staticText>
			<staticText>
				<reportElement x="295" y="2" width="48" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Loc Code
From]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="2" width="55" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Repl Order]]></text>
			</staticText>
			<staticText>
				<reportElement x="610" y="3" width="46" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Loc Code
To]]></text>
			</staticText>
			<staticText>
				<reportElement x="345" y="2" width="84" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Lot No]]></text>
			</staticText>
			<staticText>
				<reportElement x="530" y="2" width="33" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Cases]]></text>
			</staticText>
			<staticText>
				<reportElement x="563" y="2" width="45" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Quantity]]></text>
			</staticText>
			<staticText>
				<reportElement x="158" y="2" width="134" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Item Description]]></text>
			</staticText>
			<staticText>
				<reportElement x="430" y="2" width="97" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[LPN]]></text>
			</staticText>
			<staticText>
				<reportElement x="121" y="2" width="35" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Sordln]]></text>
			</staticText>
			<line>
				<reportElement x="3" y="28" width="701" height="1"/>
			</line>
			<line>
				<reportElement x="3" y="1" width="701" height="1"/>
			</line>
			<line>
				<reportElement x="704" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="3" y="1" width="1" height="27"/>
			</line>
			<line>
				<reportElement x="60" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="118" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="156" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="293" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="344" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="429" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="528" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="562" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="608" y="2" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="657" y="2" width="1" height="26"/>
			</line>
			<staticText>
				<reportElement x="659" y="3" width="45" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Task Status]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="22" splitType="Stretch">
			<textField isBlankWhenNull="true">
				<reportElement x="346" y="0" width="82" height="21"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOT_NO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="431" y="0" width="96" height="21"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOT_SL}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="563" y="0" width="45" height="21"/>
				<textElement textAlignment="Right">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{QUANTITY}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="158" y="0" width="134" height="21"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ITEM_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="295" y="0" width="48" height="21"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOC_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="62" y="0" width="54" height="21"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SALE_ORDER}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="4" y="0" width="55" height="21"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{REPL_ORDER}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="529" y="0" width="32" height="21"/>
				<textElement textAlignment="Right">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NO_ART}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="610" y="0" width="46" height="21"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOC_CODE__TO}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="118" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="344" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="60" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="4" y="-1" width="701" height="1"/>
			</line>
			<line>
				<reportElement x="293" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="528" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="429" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="3" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="156" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="562" y="-1" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="3" y="21" width="701" height="1"/>
			</line>
			<textField isBlankWhenNull="true">
				<reportElement x="121" y="0" width="32" height="21"/>
				<textElement textAlignment="Right">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LINE_NO__SORD}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="704" y="0" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="657" y="0" width="1" height="22"/>
			</line>
			<line>
				<reportElement x="608" y="0" width="1" height="22"/>
			</line>
			<textField>
				<reportElement x="659" y="0" width="45" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{STATUS}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<noData>
		<band height="62">
			<staticText>
				<reportElement x="4" y="0" width="700" height="15"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Replenishment Tasks Details]]></text>
			</staticText>
			<line>
				<reportElement x="3" y="61" width="702" height="1"/>
			</line>
			<line>
				<reportElement x="3" y="41" width="1" height="20"/>
			</line>
			<line>
				<reportElement x="704" y="41" width="1" height="20"/>
			</line>
			<staticText>
				<reportElement x="4" y="42" width="700" height="18"/>
				<textElement textAlignment="Center">
					<font isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[NA]]></text>
			</staticText>
			<line>
				<reportElement x="562" y="16" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="608" y="16" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="3" y="41" width="701" height="1"/>
			</line>
			<line>
				<reportElement x="60" y="16" width="1" height="26"/>
			</line>
			<staticText>
				<reportElement x="529" y="16" width="32" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Cases]]></text>
			</staticText>
			<line>
				<reportElement x="429" y="16" width="1" height="26"/>
			</line>
			<staticText>
				<reportElement x="563" y="16" width="45" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Quantity]]></text>
			</staticText>
			<line>
				<reportElement x="3" y="15" width="1" height="27"/>
			</line>
			<line>
				<reportElement x="344" y="16" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="156" y="16" width="1" height="26"/>
			</line>
			<staticText>
				<reportElement x="345" y="16" width="84" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Lot No]]></text>
			</staticText>
			<staticText>
				<reportElement x="609" y="16" width="46" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Loc Code
To]]></text>
			</staticText>
			<line>
				<reportElement x="293" y="16" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="528" y="16" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="3" y="14" width="702" height="1"/>
			</line>
			<line>
				<reportElement x="118" y="16" width="1" height="26"/>
			</line>
			<staticText>
				<reportElement x="295" y="16" width="48" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Loc Code
From]]></text>
			</staticText>
			<staticText>
				<reportElement x="62" y="16" width="54" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Sale Order]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="16" width="55" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Repl Order]]></text>
			</staticText>
			<staticText>
				<reportElement x="430" y="16" width="97" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[LPN]]></text>
			</staticText>
			<staticText>
				<reportElement x="158" y="16" width="134" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Item Description]]></text>
			</staticText>
			<line>
				<reportElement x="704" y="15" width="1" height="26"/>
			</line>
			<staticText>
				<reportElement x="121" y="16" width="35" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Sordln]]></text>
			</staticText>
			<line>
				<reportElement x="656" y="15" width="1" height="26"/>
			</line>
			<staticText>
				<reportElement x="658" y="15" width="47" height="26"/>
				<textElement textAlignment="Center">
					<font size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Task Status]]></text>
			</staticText>
		</band>
	</noData>
</jasperReport>
