<?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="Shipment Receipt And QA Release Report" pageWidth="612" pageHeight="792" columnWidth="592" leftMargin="15" rightMargin="5" topMargin="18" bottomMargin="10">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="418"/>
	<property name="ireport.y" value="0"/>
	<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
		<defaultValueExpression><![CDATA["C:/jboss-5.1.0.GA/server/default/deploy/ibase.ear/ibase.war/webitm/reports/jrxml"]]></defaultValueExpression>
	</parameter>
	<parameter name="ASN_NO__FR" class="java.lang.String"/>
	<parameter name="ASN_NO__TO" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT
        T.ASN_NO AS ASN_NO,
        T.PRO_NO AS PRO_NO,
        T.FIRST_REC_DATE AS FIRST_REC_DATE,
        T.LAST_REC_DATE AS LAST_REC_DATE,
        T.INVOICE_NO AS INVOICE_NO ,
        T.STATE_CODE AS STATE_CODE,
        T.CASE_NO AS CASE_NO,
        T.ITEM_CODE AS ITEM_CODE,
        T.ITEM_DESCR AS ITEM_DESCR,
        T.PURC_ORDER AS PURC_ORDER,
        T.LINE_NO__ORD AS LINE_NO__ORD,
        T.PACK_SIZE AS PACK_SIZE,
        T.LOT_HLD AS LOT_HLD,
        T.RATE AS RATE,
        T.QUANTITY AS QUANTITY,
        T.NOOF_CASES AS NOOF_CASES,
        T.QUANTITY * T.RATE AS VALUE,
        T.LOT_NO AS LOT_NO,
        T.EXP_DATE AS EXP_DATE
        FROM
(SELECT
        ASN_HDR.ASN_NO AS ASN_NO,
        ASN_HDR.PRO_NO AS PRO_NO,
        (SELECT MIN(PORCP.TRAN_DATE) FROM PORCP WHERE PORCP.ASN_NO =
ASN_HDR.ASN_NO) AS FIRST_REC_DATE,
        (SELECT MAX(PORCP.TRAN_DATE) FROM PORCP WHERE PORCP.ASN_NO =
ASN_HDR.ASN_NO) AS LAST_REC_DATE,
        ASN_HDR.INVOICE_NO AS INVOICE_NO ,
        (SELECT STATE_CODE FROM SITE WHERE SITE.SITE_CODE =
ASN_HDR.SITE_CODE) AS STATE_CODE,
        PORCPDET.PURC_ORDER AS PURC_ORDER,
        PORCPDET.LINE_NO__ORD AS LINE_NO__ORD,
        PORCPDET.ITEM_CODE AS ITEM_CODE,
        ITEM.DESCR AS ITEM_DESCR,
        ' ' AS CASE_NO,
        PORCPDET.LOT_NO AS LOT_NO,
        PORCPDET.EXPIRY_DATE AS EXP_DATE,
        ROUND(PORCPDET.QUANTITY__STDUOM / PORCPDET.NO_ART , 0) AS
PACK_SIZE,
        ' ' AS LOT_HLD,
        PORCPDET.RATE__STDUOM AS RATE,
        PORCPDET.QUANTITY__STDUOM AS QUANTITY,
        PORCPDET.NO_ART AS NOOF_CASES
        FROM ASN_HDR ASN_HDR,
        PORCP PORCP,
        PORCPDET PORCPDET,
        ITEM ITEM
        WHERE ASN_HDR.ASN_NO >= '$P!{ASN_NO__FR}' AND ASN_HDR.ASN_NO <=
'$P!{ASN_NO__TO}'
        AND PORCP.ASN_NO = ASN_HDR.ASN_NO
        AND PORCPDET.TRAN_ID = PORCP.TRAN_ID
        AND ITEM.ITEM_CODE = PORCPDET.ITEM_CODE
        ) T
        ORDER BY T.ASN_NO,PURC_ORDER,T.LINE_NO__ORD DESC]]>
	</queryString>
	<field name="ASN_NO" class="java.lang.String"/>
	<field name="PRO_NO" class="java.lang.String"/>
	<field name="FIRST_REC_DATE" class="java.util.Date"/>
	<field name="LAST_REC_DATE" class="java.util.Date"/>
	<field name="INVOICE_NO" class="java.lang.String"/>
	<field name="STATE_CODE" class="java.lang.String"/>
	<field name="CASE_NO" class="java.lang.String"/>
	<field name="ITEM_CODE" class="java.lang.String"/>
	<field name="ITEM_DESCR" class="java.lang.String"/>
	<field name="PURC_ORDER" class="java.lang.String"/>
	<field name="LINE_NO__ORD" class="java.lang.String"/>
	<field name="PACK_SIZE" class="java.lang.Double"/>
	<field name="LOT_HLD" class="java.lang.String"/>
	<field name="RATE" class="java.lang.Double"/>
	<field name="QUANTITY" class="java.lang.Double"/>
	<field name="NOOF_CASES" class="java.lang.Double"/>
	<field name="VALUE" class="java.lang.Double"/>
	<field name="LOT_NO" class="java.lang.String"/>
	<field name="EXP_DATE" class="java.util.Date"/>
	<sortField name="ASN_NO"/>
	<variable name="Compute_1" class="java.lang.String" resetType="None">
		<variableExpression><![CDATA[new java.lang.String($F{PURC_ORDER}+"/"+$F{LINE_NO__ORD})]]></variableExpression>
	</variable>
	<variable name="Compute_2" class="java.lang.String" resetType="None">
		<variableExpression><![CDATA[new java.lang.String($F{ITEM_CODE}+"  "+$F{ITEM_DESCR})]]></variableExpression>
	</variable>
	<variable name="compute_3" class="java.lang.Double" resetType="Group" resetGroup="LOT_NO">
		<variableExpression><![CDATA[new java.lang.Double($F{NOOF_CASES}.doubleValue())]]></variableExpression>
	</variable>
	<variable name="compute_4" class="java.lang.Double" resetType="Group" resetGroup="LOT_NO">
		<variableExpression><![CDATA[new java.lang.Double($F{QUANTITY}.doubleValue())]]></variableExpression>
	</variable>
	<group name="Ship_No" isStartNewPage="true" isResetPageNumber="true">
		<groupExpression><![CDATA[$F{ASN_NO}]]></groupExpression>
		<groupHeader>
			<band/>
		</groupHeader>
		<groupFooter>
			<band/>
		</groupFooter>
	</group>
	<group name="LOT_NO" isStartNewPage="true">
		<groupExpression><![CDATA[$F{LOT_NO}]]></groupExpression>
		<groupHeader>
			<band/>
		</groupHeader>
		<groupFooter>
			<band height="36">
				<line>
					<reportElement x="2" y="1" width="590" height="1"/>
					<graphicElement>
						<pen lineWidth="0.5" lineStyle="Dashed"/>
					</graphicElement>
				</line>
				<staticText>
					<reportElement x="263" y="4" width="41" height="21"/>
					<textElement textAlignment="Right">
						<font fontName="Courier New" size="7"/>
					</textElement>
					<text><![CDATA[Extended
Cost]]></text>
				</staticText>
				<textField pattern="0" isBlankWhenNull="true">
					<reportElement x="500" y="25" width="50" height="10"/>
					<textElement textAlignment="Right">
						<font fontName="Courier New" size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.Double"><![CDATA[$V{compute_3}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement x="352" y="4" width="41" height="21"/>
					<textElement textAlignment="Right">
						<font fontName="Courier New" size="7"/>
					</textElement>
					<text><![CDATA[Shipped
Units]]></text>
				</staticText>
				<staticText>
					<reportElement x="148" y="25" width="59" height="10"/>
					<textElement>
						<font fontName="Courier New" size="7"/>
					</textElement>
					<text><![CDATA[Lot Subtotals]]></text>
				</staticText>
				<textField pattern="0.0000" isBlankWhenNull="true">
					<reportElement x="254" y="25" width="50" height="10"/>
					<textElement textAlignment="Right">
						<font fontName="Courier New" size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.Double"><![CDATA[$F{VALUE}]]></textFieldExpression>
				</textField>
				<textField pattern="0" isBlankWhenNull="true">
					<reportElement x="430" y="25" width="50" height="10"/>
					<textElement textAlignment="Right">
						<font fontName="Courier New" size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.Double"><![CDATA[$V{compute_4}]]></textFieldExpression>
				</textField>
				<textField pattern="0" isBlankWhenNull="true">
					<reportElement x="343" y="25" width="50" height="10"/>
					<textElement textAlignment="Right">
						<font fontName="Courier New" size="7"/>
					</textElement>
					<textFieldExpression class="java.lang.Double"><![CDATA[$V{compute_4}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<pageHeader>
		<band height="150" splitType="Stretch">
			<textField pattern="MM/dd/yy">
				<reportElement x="482" y="26" width="40" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField pattern="HH:mm:ss">
				<reportElement x="532" y="26" width="51" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="10" y="29" width="70" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[WH/CO/DV     :]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="89" y="29" width="39" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{STATE_CODE}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="10" y="10" width="75" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[d_shp_qa_release]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="20" width="46" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[WM]]></text>
			</staticText>
			<staticText>
				<reportElement x="522" y="26" width="10" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[At ]]></text>
			</staticText>
			<staticText>
				<reportElement x="521" y="16" width="32" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Page :]]></text>
			</staticText>
			<staticText>
				<reportElement x="384" y="71" width="109" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Received From ....   :]]></text>
			</staticText>
			<staticText>
				<reportElement x="11" y="71" width="70" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[PRO#.......  :]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="59" width="70" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Shipment#..  :]]></text>
			</staticText>
			<staticText>
				<reportElement x="171" y="12" width="279" height="14"/>
				<textElement textAlignment="Center">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<text><![CDATA[Shipment Receipt And QA Release Report]]></text>
			</staticText>
			<staticText>
				<reportElement x="11" y="83" width="114" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[First Receipt Date ..:]]></text>
			</staticText>
			<staticText>
				<reportElement x="384" y="83" width="114" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[First Receipt Date ..:]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="89" y="59" width="60" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ASN_NO}]]></textFieldExpression>
			</textField>
			<textField pattern="MM/dd/yy" isBlankWhenNull="true">
				<reportElement x="131" y="83" width="60" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{FIRST_REC_DATE}]]></textFieldExpression>
			</textField>
			<textField pattern="MM/dd/yy" isBlankWhenNull="true">
				<reportElement x="505" y="83" width="60" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{LAST_REC_DATE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="89" y="71" width="60" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PRO_NO}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="2" y="121" width="590" height="8"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[==============================================================================================================================================]]></text>
			</staticText>
			<staticText>
				<reportElement x="104" y="110" width="29" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Lot]]></text>
			</staticText>
			<staticText>
				<reportElement x="11" y="110" width="25" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Case#]]></text>
			</staticText>
			<staticText>
				<reportElement x="430" y="103" width="49" height="16"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Received
Units]]></text>
			</staticText>
			<staticText>
				<reportElement x="277" y="104" width="18" height="17"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Ea/
Cs]]></text>
			</staticText>
			<staticText>
				<reportElement x="348" y="103" width="49" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Expectd
UnitCst]]></text>
			</staticText>
			<staticText>
				<reportElement x="500" y="103" width="50" height="17"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Received
Cases]]></text>
			</staticText>
			<staticText>
				<reportElement x="2" y="96" width="590" height="8"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[==============================================================================================================================================]]></text>
			</staticText>
			<staticText>
				<reportElement x="182" y="110" width="41" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[ExpDte]]></text>
			</staticText>
			<staticText>
				<reportElement x="318" y="104" width="18" height="17"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Lot
Hld]]></text>
			</staticText>
			<staticText>
				<reportElement x="2" y="129" width="25" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[PO#]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="32" y="129" width="78" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{Compute_1}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="120" y="129" width="61" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Invoice#. . :]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="191" y="129" width="78" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{INVOICE_NO}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="2" y="139" width="25" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[Item]]></text>
			</staticText>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement x="32" y="139" width="237" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{Compute_2}]]></textFieldExpression>
			</textField>
			<textField pattern="0" isBlankWhenNull="true">
				<reportElement x="548" y="16" width="15" height="10"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<detail>
		<band height="11" splitType="Stretch">
			<textField isBlankWhenNull="true">
				<reportElement x="11" y="0" width="93" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CASE_NO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="104" y="0" width="78" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOT_NO}]]></textFieldExpression>
			</textField>
			<textField pattern="yyyy/MM/dd" isBlankWhenNull="true">
				<reportElement x="182" y="0" width="83" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{EXP_DATE}]]></textFieldExpression>
			</textField>
			<textField pattern="0" isBlankWhenNull="true">
				<reportElement x="277" y="0" width="18" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{PACK_SIZE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="318" y="0" width="18" height="10"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOT_HLD}]]></textFieldExpression>
			</textField>
			<textField pattern="0" isBlankWhenNull="true">
				<reportElement x="430" y="0" width="49" height="10"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{QUANTITY}]]></textFieldExpression>
			</textField>
			<textField pattern="0.0000" isBlankWhenNull="true">
				<reportElement x="348" y="0" width="49" height="10"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{RATE}]]></textFieldExpression>
			</textField>
			<textField pattern="0" isBlankWhenNull="true">
				<reportElement x="500" y="0" width="50" height="10"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{NOOF_CASES}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="258">
			<staticText>
				<reportElement x="2" y="0" width="582" height="249"/>
				<textElement>
					<font fontName="Courier New" size="10"/>
				</textElement>
				<text><![CDATA[Quantity Verified By       ___________________________     Date    ___________

Phys Attrib Checked By  ___________________________     Date    ___________

Verify Docs: COB  _______  ASQ/RFQ  ______  Shpmnt Auth  ____________

FDA Rel  _____ InTrn Temp  ____ DEA Rel  _____  Check By  ______  Date  ______

Visual    Check  on  Product    ( if applicable )     Performed By  ______  Date  ______

Placement Under  ___  L/C By  _______   Date   ______

Distribution  Release Status Placed in BPCS System By  _____  Date  ______

L/C Removed in WMS System By  _____   Date  ______

Taro QA Remarks  ( if any )   _________________________________________________________

_______________________________________________________________________________________

_______________________________________________________________________________________
]]></text>
			</staticText>
			<staticText>
				<reportElement x="2" y="249" width="590" height="8"/>
				<textElement>
					<font fontName="Courier New" size="7"/>
				</textElement>
				<text><![CDATA[==============================================================================================================================================]]></text>
			</staticText>
		</band>
	</pageFooter>
</jasperReport>
