<?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="McKesson shipping label" pageWidth="283" pageHeight="438" columnWidth="243" leftMargin="20" rightMargin="20" topMargin="2" bottomMargin="2">
	<property name="ireport.zoom" value="1.3310000000000073"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="80"/>
	<parameter name="DESP_ID_START" class="java.lang.String"/>
	<parameter name="DESP_ID_LAST" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT
		CASE WHEN S.ADD1 IS NULL THEN ' ' ELSE S.ADD1 END AS ADD1,
		CASE WHEN S.ADD2 IS NULL THEN ' ' ELSE S.ADD2 END AS ADD2,
		CASE WHEN S.CITY IS NULL THEN ' ' ELSE S.CITY END AS CITY,
		CASE WHEN S.PIN IS NULL THEN ' ' ELSE S.PIN END AS PIN,
		CASE WHEN S.STATE_CODE IS NULL THEN ' ' ELSE S.STATE_CODE END AS STATE_CODE,
		CASE WHEN O.DLV_ADD1 IS NULL THEN ' ' ELSE O.DLV_ADD1 END AS DLV_ADD1,
		CASE WHEN O.DLV_ADD2 IS NULL THEN ' ' ELSE O.DLV_ADD2 END AS DLV_ADD2,
		CASE WHEN O.DLV_ADD3 IS NULL THEN ' ' ELSE O.DLV_ADD3 END AS DLV_ADD3,
		CASE WHEN O.DLV_CITY IS NULL THEN ' ' ELSE O.DLV_CITY END AS DLV_CITY,
		CASE WHEN O.STATE_CODE__DLV IS NULL THEN ' ' ELSE O.STATE_CODE__DLV END AS STATE_CODE__DLV,
		CASE WHEN O.DLV_PIN IS NULL THEN ' ' ELSE O.DLV_PIN END AS DLV_PIN,
		(SELECT TRAN_NAME FROM TRANSPORTER WHERE TRAN_CODE = D.TRAN_CODE) AS TRAN_CODE,
		CASE WHEN O.CUST_PORD IS NULL THEN ' ' ELSE O.CUST_PORD END AS CUST_PORD,
		CASE WHEN D.SORD_NO IS NULL THEN ' ' ELSE  D.SORD_NO END AS SORD_NO,
		WT.CHG_DATE AS SORD_DATE,
		CASE WHEN T.CUST_ITEM__REF IS NULL THEN ' ' ELSE T.CUST_ITEM__REF END AS CUST_ITEM__REF,
		CASE WHEN I.ITEM_CODE__NDC11 IS NULL THEN ' ' ELSE I.ITEM_CODE__NDC11 END AS ITEM_CODE__NDC11,
		D.NO_ART AS NO_ART,
		CASE WHEN K.LOT_NO IS NULL THEN ' ' ELSE K.LOT_NO END AS LOT_NO,
		 CASE WHEN P.SSCC_18 IS NULL THEN CASE WHEN D.LR_NO IS NULL THEN '' ELSE D.LR_NO END ELSE P.SSCC_18 END AS SSCC_18,
        CASE WHEN E.EXP_DATE IS NULL THEN K.EXP_DATE ELSE E.EXP_DATE END AS EXP_DATE,
		SUBSTR(O.CUST_PORD,1,3) as cust_prod ,
		SUBSTR(O.CUST_PORD,4,6) as cust_prod1 ,
		SUBSTR(O.CUST_PORD,10) as cust_prod2,
		W.PTCN AS WAVE_TASK_DET_PTCN
FROM
		SITE S, SORDER O, SORDDET T, DESPATCH D, STOCK K, ITEM I, DESPATCHDET E, WAVE_TASK_DET W, WAVE_TASK WT,PACK_HDR P,SHIP_DOCS SD
WHERE
			 (D.DESP_ID BETWEEN $P{DESP_ID_START} AND $P{DESP_ID_LAST})
		AND O.SALE_ORDER = D.SORD_NO
		AND E.DESP_ID = D.DESP_ID
		AND S.SITE_CODE = O.SITE_CODE
		AND T.SALE_ORDER = O.SALE_ORDER
		AND T.ITEM_CODE = I.ITEM_CODE
		AND T.ITEM_CODE = K.ITEM_CODE
        AND E.SITE_CODE = K.SITE_CODE
        AND E.LOT_NO = K.LOT_NO
        AND E.LOT_SL = K.LOT_SL
        AND E.LOC_CODE = K.LOC_CODE
        AND W.WAVE_ID = WT.WAVE_ID(+)
        AND D.DESP_ID = SD.REF_ID(+)
        AND 'S-DSP' = SD.REF_SER(+)
        AND SD.PTCN = W.PTCN(+)
        AND 'M-PACK' = W.REF_SER(+)
        AND W.REF_ID = P.TRAN_ID(+)]]>
	</queryString>
	<field name="ADD1" class="java.lang.String"/>
	<field name="ADD2" class="java.lang.String"/>
	<field name="CITY" class="java.lang.String"/>
	<field name="PIN" class="java.lang.String"/>
	<field name="STATE_CODE" class="java.lang.String"/>
	<field name="DLV_ADD1" class="java.lang.String"/>
	<field name="DLV_ADD2" class="java.lang.String"/>
	<field name="DLV_ADD3" class="java.lang.String"/>
	<field name="DLV_CITY" class="java.lang.String"/>
	<field name="STATE_CODE__DLV" class="java.lang.String"/>
	<field name="DLV_PIN" class="java.lang.String"/>
	<field name="TRAN_CODE" class="java.lang.String"/>
	<field name="CUST_PORD" class="java.lang.String"/>
	<field name="CUST_PROD" class="java.lang.String"/>
	<field name="CUST_PROD1" class="java.lang.String"/>
	<field name="CUST_PROD2" class="java.lang.String"/>
	<field name="SORD_NO" class="java.lang.String"/>
	<field name="SORD_DATE" class="java.util.Date"/>
	<field name="CUST_ITEM__REF" class="java.lang.String"/>
	<field name="ITEM_CODE__NDC11" class="java.lang.String"/>
	<field name="NO_ART" class="java.lang.Integer"/>
	<field name="LOT_NO" class="java.lang.String"/>
	<field name="EXP_DATE" class="java.util.Date"/>
	<field name="SSCC_18" class="java.lang.String"/>
	<field name="WAVE_TASK_DET_PTCN" class="java.lang.String"/>
	<variable name="COMPUTE_1" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String(ibase.webitm.reports.sun.BaseReportGFMethods.gf_bar_code("420"+ibase.webitm.reports.utility.BaseReportMethods.trim($F{DLV_PIN}).substring(0,5) ) )]]></variableExpression>
	</variable>
	<variable name="COMPUTE_2" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String(ibase.webitm.reports.sun.BaseReportGFMethods.gf_bar_code("00"+ibase.webitm.reports.utility.BaseReportMethods.trim($F{SSCC_18}) ) )]]></variableExpression>
	</variable>
	<variable name="COMPUTE_3" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String(ibase.webitm.reports.sun.BaseReportGFMethods.gf_bar_code(ibase.webitm.reports.utility.BaseReportMethods.trim($F{LOT_NO}) ) )]]></variableExpression>
	</variable>
	<variable name="COMPUTE_4" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String(ibase.webitm.reports.sun.BaseReportGFMethods.gf_bar_code(ibase.webitm.reports.utility.BaseReportMethods.trim(new SimpleDateFormat("yyyyMMdd").format($F{EXP_DATE}))))]]></variableExpression>
	</variable>
	<variable name="COMPUTE_5" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String((ibase.webitm.reports.utility.BaseReportMethods.isNull($F{CUST_PROD}) ? " " : " - " +$F{CUST_PROD})+(ibase.webitm.reports.utility.BaseReportMethods.isNull($F{CUST_PROD1} ) ? " " : " - " +$F{CUST_PROD1})+ (ibase.webitm.reports.utility.BaseReportMethods.isNull($F{CUST_PROD2}) ? " " : " - " +$F{CUST_PROD2}))]]></variableExpression>
	</variable>
	<variable name="COMPUTE_6" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String("(420) "+ibase.webitm.reports.utility.BaseReportMethods.trim($F{DLV_PIN}).substring(0,5))]]></variableExpression>
	</variable>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="434" splitType="Stretch">
			<rectangle>
				<reportElement mode="Transparent" x="0" y="12" width="242" height="394"/>
			</rectangle>
			<staticText>
				<reportElement x="1" y="16" width="100" height="17"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[FROM:]]></text>
			</staticText>
			<line>
				<reportElement x="102" y="12" width="1" height="60"/>
				<graphicElement>
					<pen lineWidth="1.0"/>
				</graphicElement>
			</line>
			<staticText>
				<reportElement x="103" y="15" width="100" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="9" isBold="false"/>
				</textElement>
				<text><![CDATA[TO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="11" y="294" width="150" height="12"/>
				<textElement textAlignment="Left" verticalAlignment="Top">
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[(00)  SERIAL SHIPPING CONTAINER]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="75" width="120" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="false"/>
				</textElement>
				<text><![CDATA[(420)  Ship to Postal Code:]]></text>
			</staticText>
			<line>
				<reportElement x="0" y="288" width="242" height="1"/>
				<graphicElement>
					<pen lineWidth="3.0"/>
				</graphicElement>
			</line>
			<line>
				<reportElement x="0" y="216" width="242" height="1"/>
			</line>
			<staticText>
				<reportElement x="4" y="154" width="30" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[PO#:]]></text>
			</staticText>
			<line>
				<reportElement x="0" y="72" width="242" height="1"/>
				<graphicElement>
					<pen lineWidth="2.0"/>
				</graphicElement>
			</line>
			<line>
				<reportElement x="0" y="144" width="242" height="1"/>
			</line>
			<line>
				<reportElement x="179" y="217" width="1" height="72"/>
			</line>
			<line>
				<reportElement x="144" y="72" width="1" height="72"/>
			</line>
			<staticText>
				<reportElement x="147" y="78" width="79" height="12"/>
				<textElement>
					<font fontName="Times New Roman" isBold="false"/>
				</textElement>
				<text><![CDATA[CARRIER:]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="173" width="65" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="false"/>
				</textElement>
				<text><![CDATA[Bsn Txn#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="189" width="65" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="false"/>
				</textElement>
				<text><![CDATA[Bsn Txn Date:]]></text>
			</staticText>
			<staticText>
				<reportElement x="141" y="154" width="55" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[Cust Item:]]></text>
			</staticText>
			<staticText>
				<reportElement x="142" y="173" width="30" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="false"/>
				</textElement>
				<text><![CDATA[NDC#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="142" y="189" width="50" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="false"/>
				</textElement>
				<text><![CDATA[Casepack:]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="218" width="30" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[LOT:]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="253" width="30" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[EXP:]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="1" y="33" width="100" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ADD1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="1" y="45" width="100" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ADD2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="1" y="56" width="43" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CITY}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="43" y="56" width="29" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{STATE_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="72" y="57" width="29" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PIN}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="185" y="55" width="58" height="13"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_PIN}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="106" y="55" width="44" height="13"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_ADD3}+""+$F{DLV_CITY}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="106" y="43" width="136" height="12"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_ADD2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="105" y="30" width="137" height="12"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_ADD1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="151" y="55" width="34" height="13"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{STATE_CODE__DLV}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="147" y="92" width="96" height="12"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TRAN_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="38" y="154" width="98" height="15"/>
				<textElement verticalAlignment="Top">
					<font fontName="Times New Roman" size="10" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_5}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="70" y="173" width="66" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{WAVE_TASK_DET_PTCN}]]></textFieldExpression>
			</textField>
			<textField pattern="MM/dd/yy" isBlankWhenNull="true">
				<reportElement x="70" y="189" width="66" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{SORD_DATE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="187" y="154" width="53" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="10" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_ITEM__REF}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="173" y="173" width="61" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ITEM_CODE__NDC11}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="193" y="189" width="41" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$F{NO_ART}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="40" y="218" width="130" height="12"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOT_NO}]]></textFieldExpression>
			</textField>
			<textField pattern="MM/dd/yy" isBlankWhenNull="true">
				<reportElement x="32" y="253" width="130" height="12"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{EXP_DATE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="30" y="232" width="129" height="21"/>
				<textElement>
					<font fontName="Code 128AB" size="24"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_3}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="30" y="267" width="129" height="21"/>
				<textElement>
					<font fontName="Code 128AB" size="24"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_4}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="6" y="105" width="130" height="31"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Code 128AB" size="32"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="6" y="307" width="237" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["(00) "+$F{SSCC_18}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="3" y="319" width="239" height="75"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Code 128AB Tall" size="32"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="87" width="145" height="17"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_6}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
