<?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="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.3310000000000073"/>
	<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,
		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 D.TRAN_CODE IS NULL THEN ' ' ELSE D.TRAN_CODE END 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,
		D.SORD_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,
		K.EXP_DATE AS EXP_DATE,
		CASE WHEN E.SSCC_18 IS NULL THEN ' ' ELSE E.SSCC_18 END AS SSCC_18
FROM
		SITE S, SORDER O, SORDDET T, DESPATCH D, STOCK K, ITEM I, DESPATCHDET E
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]]>
	</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="SORD_NO" class="java.lang.String"/>
	<field name="SORD_DATE" class="java.sql.Timestamp"/>
	<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.String" />
	<field name="LOT_NO" class="java.lang.String"/>
	<field name="EXP_DATE" class="java.sql.Timestamp" />
	<field name="SSCC_18" class="java.lang.String" />
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="432" splitType="Stretch">
			<rectangle>
				<reportElement mode="Transparent" x="0" y="0" width="288" height="432"/>
			</rectangle>
			<staticText>
				<reportElement x="10" y="10" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<text><![CDATA[From:]]></text>
			</staticText>
			<line>
				<reportElement x="126" y="0" width="1" height="72"/>
			</line>
			<staticText>
				<reportElement x="136" y="10" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<text><![CDATA[TO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="15" y="294" width="150" height="12"/>
				<textElement textAlignment="Left" verticalAlignment="Top">
					<font fontName="Arial" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[(00) Serial Shopping Container]]></text>
			</staticText>
			<staticText>
				<reportElement x="6" y="78" width="120" height="12"/>
				<textElement>
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<text><![CDATA[(420) Ship to Postal Code:]]></text>
			</staticText>
			<line>
				<reportElement x="0" y="288" width="288" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="216" width="288" height="1"/>
			</line>
			<staticText>
				<reportElement x="10" y="154" width="30" height="15"/>
				<textElement>
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[PO#:]]></text>
			</staticText>
			<line>
				<reportElement x="0" y="72" width="288" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="144" width="288" height="1"/>
			</line>
			<line>
				<reportElement x="208" y="217" width="1" height="72"/>
			</line>
			<line>
				<reportElement x="144" y="72" width="1" height="72"/>
			</line>
			<staticText>
				<reportElement x="150" y="78" width="120" height="12"/>
				<textElement>
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<text><![CDATA[CARRIER:]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="173" width="65" height="12"/>
				<textElement>
					<font fontName="Arial" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Bsn Txn#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="189" width="65" height="12"/>
				<textElement>
					<font fontName="Arial" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Bsn Txn Date:]]></text>
			</staticText>
			<staticText>
				<reportElement x="176" y="154" width="30" height="15"/>
				<textElement>
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Cust Item:]]></text>
			</staticText>
			<staticText>
				<reportElement x="176" y="173" width="30" height="12"/>
				<textElement>
					<font fontName="Arial" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[NDC#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="176" y="189" width="50" height="12"/>
				<textElement>
					<font fontName="Arial" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Casepack:]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="218" width="30" height="12"/>
				<textElement>
					<font fontName="Arial" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[LOT:]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" y="253" width="30" height="12"/>
				<textElement>
					<font fontName="Arial" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[EXP:]]></text>
			</staticText>
			<textField>
				<reportElement x="10" y="26" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="10" y="40" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="10" y="55" width="40" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{CITY}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="52" y="55" width="20" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{STATE_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="75" y="55" width="40" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="200" y="55" width="40" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="135" y="55" width="40" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_ADD3}+""+$F{DLV_CITY}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="135" y="40" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="135" y="26" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="177" y="55" width="20" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{STATE_CODE__DLV}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="152" y="97" width="120" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{TRAN_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="44" y="154" width="120" height="15"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="76" y="173" width="80" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORD_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="76" y="189" width="80" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORD_DATE}.equals(null)?"":(new SimpleDateFormat("dd/MM/yyyy").format($F{SORD_DATE}))]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="207" y="154" width="70" height="15"/>
				<textElement>
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{CUST_ITEM__REF}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="207" y="173" width="70" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ITEM_CODE__NDC11}.equals(null)?"":$F{ITEM_CODE__NDC11}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="227" y="189" width="50" height="12"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{NO_ART}.equals(null)?"":$F{NO_ART}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="40" y="218" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{LOT_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="43" y="253" width="100" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{EXP_DATE}.equals(null)?"":(new SimpleDateFormat("dd/MM/yyyy").format($F{EXP_DATE}))]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="16" y="311" width="150" height="30"/>
				<textElement textAlignment="Left" verticalAlignment="Top">
					<font fontName="Code 128C" size="14" isBold="false"/>
				</textElement>
				<text><![CDATA[(00) Serial Shopping Container]]></text>
			</staticText>
			<staticText>
				<reportElement x="7" y="97" width="120" height="27"/>
				<textElement>
					<font fontName="Code 128AB" size="24" isBold="true"/>
				</textElement>
				<text><![CDATA[(420) Ship to Postal Code:]]></text>
			</staticText>
			<textField>
				<reportElement x="41" y="232" width="97" height="12"/>
				<textElement>
					<font fontName="Code 128AB" size="14"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{LOT_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="40" y="267" width="100" height="10"/>
				<textElement>
					<font fontName="Code 128AB"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{EXP_DATE}.equals(null)?"":(new SimpleDateFormat("dd/MM/yyyy").format($F{EXP_DATE}))]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
