<?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="263" leftMargin="10" rightMargin="10" topMargin="2" bottomMargin="2">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<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,
        C.CUST_NAME AS CUST_NAME,
		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,
		CASE WHEN T.CUST_ITEM__REF IS NULL THEN ' ' ELSE T.CUST_ITEM__REF  END AS CUST_ITEM__REF,
		CASE WHEN O.ORDER_TYPE IS NULL THEN ' ' ELSE O.ORDER_TYPE END AS ORDER_TYPE,
		CASE WHEN O.DEPT_CODE IS NULL THEN ' ' ELSE O.DEPT_CODE END AS DEPT_CODE,
		(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.LR_NO IS NULL THEN ' ' ELSE D.LR_NO END AS PRO_NO,
		CASE WHEN D.BOL_NO IS NULL THEN ' ' ELSE D.BOL_NO END AS BOL_NO,
		CASE WHEN C.STORE_NUMBER IS NULL THEN ' ' ELSE C.STORE_NUMBER END AS STORE_NUMBER,
		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 I.GTIN_CASE IS NULL THEN ' ' ELSE I.GTIN_CASE END AS SSCC_14
FROM
		SITE S, SORDER O, SORDDET T, DESPATCH D, DESPATCHDET E, CUSTOMER C , ITEM I, WAVE_TASK_DET W, 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 S.SITE_CODE = O.SITE_CODE
		AND E.DESP_ID = D.DESP_ID
		AND O.CUST_CODE__DLV = C.CUST_CODE
		AND T.SALE_ORDER = O.SALE_ORDER
		AND T.LINE_NO = E.LINE_NO__SORD
		AND I.ITEM_CODE = E.ITEM_CODE
		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="CUST_ITEM__REF" class="java.lang.String"/>
	<field name="ORDER_TYPE" class="java.lang.String"/>
	<field name="DEPT_CODE" class="java.lang.String"/>
	<field name="TRAN_CODE" class="java.lang.String"/>
	<field name="CUST_PORD" class="java.lang.String"/>
	<field name="PRO_NO" class="java.lang.String"/>
	<field name="BOL_NO" class="java.lang.String"/>
	<field name="STORE_NUMBER" class="java.lang.String"/>
	<field name="SSCC_18" class="java.lang.String"/>
	<field name="SSCC_14" class="java.lang.String"/>
	<field name="CUST_NAME" 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(ibase.webitm.reports.utility.BaseReportMethods.trim($F{SSCC_14}) ) )]]></variableExpression>
	</variable>
	<variable name="compute_3" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String($F{DLV_CITY}.trim() + " "+$F{STATE_CODE__DLV}.trim()+" "+$F{DLV_PIN}.trim())]]></variableExpression>
	</variable>
	<variable name="compute_4" 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="2" y="14" width="259" height="393"/>
			</rectangle>
			<staticText>
				<reportElement x="3" y="15" width="92" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[SHIP FROM:]]></text>
			</staticText>
			<line>
				<reportElement x="113" y="15" width="1" height="67"/>
			</line>
			<staticText>
				<reportElement x="115" y="15" width="100" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[SHIP TO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="5" y="86" width="124" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<text><![CDATA[(420) Ship to Postal Code:]]></text>
			</staticText>
			<line>
				<reportElement x="2" y="298" width="259" height="2"/>
			</line>
			<line>
				<reportElement x="2" y="226" width="259" height="1"/>
			</line>
			<staticText>
				<reportElement x="3" y="164" width="68" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[DC#]]></text>
			</staticText>
			<staticText>
				<reportElement x="72" y="164" width="34" height="15"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Type]]></text>
			</staticText>
			<line>
				<reportElement x="3" y="82" width="258" height="1"/>
			</line>
			<line>
				<reportElement x="3" y="154" width="258" height="1"/>
			</line>
			<line>
				<reportElement x="130" y="82" width="1" height="72"/>
			</line>
			<staticText>
				<reportElement x="133" y="114" width="29" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font fontName="Times New Roman" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[PRO#]]></text>
			</staticText>
			<staticText>
				<reportElement x="133" y="83" width="80" height="12"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[CARRIER:]]></text>
			</staticText>
			<staticText>
				<reportElement x="106" y="164" width="72" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[DEPT]]></text>
			</staticText>
			<staticText>
				<reportElement x="178" y="164" width="83" height="15"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Order #]]></text>
			</staticText>
			<staticText>
				<reportElement x="133" y="132" width="29" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font fontName="Times New Roman" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[B/L #]]></text>
			</staticText>
			<textField>
				<reportElement x="3" y="303" width="258" height="74"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Code 128AB" size="40" isBold="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{compute_2}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="27" y="204" width="45" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Top">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[WMIT :]]></text>
			</staticText>
			<textField>
				<reportElement x="2" y="39" width="111" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="3" y="51" width="57" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CITY}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="60" y="51" width="53" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{STATE_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="3" y="63" width="111" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="116" y="50" width="148" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="116" y="38" width="146" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="160" y="114" width="101" height="15"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PRO_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="160" y="132" width="101" height="15"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{BOL_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="133" y="96" width="129" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TRAN_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="4" y="180" width="67" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{STORE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="71" y="180" width="35" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ORDER_TYPE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="106" y="180" width="72" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DEPT_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="178" y="180" width="83" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="71" y="204" width="150" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_ITEM__REF}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="3" y="247" width="258" height="30"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SSCC_18}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="6" y="102" width="122" height="33"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Code 128AB" size="22"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{compute_1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="4" y="27" width="109" height="12"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="3" y="377" width="260" height="25"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SSCC_14}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="115" y="63" width="147" height="19"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{compute_3}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="6" y="134" width="122" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{compute_4}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="116" y="25" width="145" height="13"/>
				<textElement>
					<font size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_NAME}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
