<?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="Rite_Aid_Shipping" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="96"/>
	<parameter name="DespId" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT
 		DISTINCT
     CASE WHEN DESPATCH."BOL_NO" IS NULL THEN ' ' ELSE DESPATCH."BOL_NO" END AS DESPATCH_BOL_NO,
     CASE WHEN DESPATCH."PRO_NO" IS NULL THEN ' ' ELSE DESPATCH."PRO_NO" END AS DESPATCH_PRO_NO,
     CASE WHEN SORDER."CUST_PORD" IS NULL THEN ' ' ELSE SORDER."CUST_PORD" END AS SORDER_CUST_PORD,
     CASE WHEN SORDER."DLV_ADD1" IS NULL THEN ' ' ELSE SORDER."DLV_ADD1" END AS SORDER_DLV_ADD1,
     CASE WHEN SORDER."DLV_ADD2" IS NULL THEN ' ' ELSE SORDER."DLV_ADD2" END AS SORDER_DLV_ADD2,
     CASE WHEN SORDER."DLV_ADD3" IS NULL THEN ' ' ELSE SORDER."DLV_ADD3" END AS SORDER_DLV_ADD3,
     CASE WHEN SORDER."DLV_CITY" IS NULL THEN ' ' ELSE SORDER."DLV_CITY" END AS SORDER_DLV_CITY,
     CASE WHEN SORDER."STATE_CODE__DLV" IS NULL THEN ' ' ELSE SORDER."STATE_CODE__DLV" END AS SORDER_STATE_CODE__DLV,
     CASE WHEN SORDER."DLV_PIN" IS NULL THEN ' ' ELSE SORDER."DLV_PIN" END AS SORDER_DLV_PIN,
     CASE WHEN SITE."ADD1"IS NULL THEN ' ' ELSE SITE."ADD1" END AS SITE_ADD1,
     CASE WHEN SITE."ADD2"IS NULL THEN ' ' ELSE SITE."ADD2" END AS SITE_ADD2,
     CASE WHEN SITE."CITY"IS NULL THEN ' 'ELSE SITE."CITY" END AS SITE_CITY,
     CASE WHEN SITE."PIN" IS NULL THEN ' 'ELSE SITE."PIN" END AS SITE_PIN,
     CASE WHEN SITE."STATE_CODE"IS NULL THEN ' ' ELSE SITE."STATE_CODE" END AS SITE_STATE_CODE,
     CASE WHEN ITEM."DESCR" IS NULL THEN ' ' ELSE ITEM."DESCR" END AS ITEM_DESCR,
     CASE WHEN ITEM."ITEM_CODE__UPC" IS NULL THEN ' ' ELSE ITEM."ITEM_CODE__UPC" END AS ITEM_ITEM_CODE__UPC,
     CASE WHEN DESPATCH."TRAN_CODE" IS NULL THEN ' ' ELSE DESPATCH."TRAN_CODE" END AS DESPATCH_TRAN_CODE,
     CASE WHEN DESPATCH."DESP_ID" IS NULL THEN ' ' ELSE DESPATCH."DESP_ID" END AS DESPATCH_TRAN_ID,
     CASE WHEN DESPATCH."NO_ART" IS NULL THEN 0 ELSE DESPATCH."NO_ART" END AS DESPATCH_NO_ART,
     CASE WHEN DESPATCHDET."SSCC_18" IS NULL THEN ' ' ELSE DESPATCHDET."SSCC_18" END AS DESPATCHDET_SSCC_18,
     CASE WHEN DESPATCHDET."CUST_ITEM__REF" IS NULL THEN ' ' ELSE DESPATCHDET."CUST_ITEM__REF" END AS DESPATCHDET_CUST_ITEM__REF
FROM
     "SITE" SITE ,
     "DESPATCH" DESPATCH ,
     "DESPATCHDET" DESPATCHDET ,
     "ITEM" ITEM ,
     "SORDER" SORDER

where
	SORDER.SALE_ORDER =  DESPATCH.SORD_NO
	AND SITE.SITE_CODE = SORDER.SITE_CODE
	AND DESPATCHDET.DESP_ID = DESPATCH.DESP_ID
	AND DESPATCHDET.ITEM_CODE = ITEM.ITEM_CODE
    AND trim(DESPATCH.DESP_ID) = trim($P{DespId})]]>
	</queryString>
	<field name="DESPATCH_BOL_NO" class="java.lang.String"/>
	<field name="DESPATCH_PRO_NO" class="java.lang.String"/>
	<field name="SORDER_CUST_PORD" class="java.lang.String"/>
	<field name="SORDER_DLV_ADD1" class="java.lang.String"/>
	<field name="SORDER_DLV_ADD2" class="java.lang.String"/>
	<field name="SORDER_DLV_ADD3" class="java.lang.String"/>
	<field name="SORDER_DLV_CITY" class="java.lang.String"/>
	<field name="SORDER_STATE_CODE__DLV" class="java.lang.String"/>
	<field name="SORDER_DLV_PIN" class="java.lang.String"/>
	<field name="SITE_ADD1" class="java.lang.String"/>
	<field name="SITE_ADD2" class="java.lang.String"/>
	<field name="SITE_CITY" class="java.lang.String"/>
	<field name="SITE_PIN" class="java.lang.String"/>
	<field name="SITE_STATE_CODE" class="java.lang.String"/>
	<field name="ITEM_DESCR" class="java.lang.String"/>
	<field name="ITEM_ITEM_CODE__UPC" class="java.lang.String"/>
	<field name="DESPATCH_TRAN_CODE" class="java.lang.String"/>
	<field name="DESPATCH_TRAN_ID" class="java.lang.String"/>
	<field name="DESPATCH_NO_ART" class="java.lang.String"/>
	<field name="DESPATCHDET_SSCC_18" class="java.lang.String"/>
	<field name="DESPATCHDET_CUST_ITEM__REF" 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="756" splitType="Stretch">
			<rectangle>
				<reportElement x="0" y="0" width="289" height="429"/>
			</rectangle>
			<line>
				<reportElement x="0" y="73" width="289" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="144" width="289" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="216" width="289" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="287" width="289" height="1"/>
			</line>
			<line>
				<reportElement x="127" y="0" width="1" height="73"/>
			</line>
			<line>
				<reportElement x="144" y="73" width="1" height="73"/>
			</line>
			<line>
				<reportElement x="126" y="216" width="1" height="73"/>
			</line>
			<staticText>
				<reportElement x="3" y="2" width="33" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[From:]]></text>
			</staticText>
			<staticText>
				<reportElement x="131" y="1" width="27" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[To:]]></text>
			</staticText>
			<staticText>
				<reportElement x="5" y="76" width="121" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[(420) Ship To Postal Code ]]></text>
			</staticText>
			<staticText>
				<reportElement x="148" y="77" width="51" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[CARRIER:]]></text>
			</staticText>
			<staticText>
				<reportElement x="148" y="113" width="24" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[PRO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="148" y="127" width="24" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[B/L:
]]></text>
			</staticText>
			<staticText>
				<reportElement x="5" y="148" width="27" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[PO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="5" y="166" width="27" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[Desc:]]></text>
			</staticText>
			<staticText>
				<reportElement x="5" y="200" width="27" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[Qty:]]></text>
			</staticText>
			<staticText>
				<reportElement x="5" y="183" width="27" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[Type:]]></text>
			</staticText>
			<staticText>
				<reportElement x="6" y="221" width="65" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[Rite Aid Item:]]></text>
			</staticText>
			<staticText>
				<reportElement x="131" y="220" width="27" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[UPC#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="291" width="43" height="13"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<text><![CDATA[sscc-18]]></text>
			</staticText>
			<textField>
				<reportElement x="2" y="16" width="104" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SITE_ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="2" y="26" width="103" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SITE_ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="2" y="36" width="103" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SITE_CITY}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="2" y="46" width="103" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SITE_PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="2" y="56" width="103" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SITE_STATE_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="131" y="14" width="105" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORDER_DLV_ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="131" y="24" width="105" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORDER_DLV_ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="132" y="34" width="105" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORDER_DLV_ADD3}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="132" y="43" width="105" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORDER_STATE_CODE__DLV}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="132" y="53" width="105" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORDER_DLV_PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="149" y="92" width="99" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DESPATCH_TRAN_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="176" y="114" width="86" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DESPATCH_PRO_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="176" y="127" width="86" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DESPATCH_PRO_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="36" y="149" width="69" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORDER_CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="37" y="166" width="69" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ITEM_DESCR}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="37" y="200" width="69" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DESPATCH_NO_ART}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="7" y="239" width="69" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DESPATCHDET_CUST_ITEM__REF}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="162" y="221" width="69" height="10"/>
				<textElement>
					<font size="7"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ITEM_ITEM_CODE__UPC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="32" y="328" width="192" height="30"/>
				<textElement>
					<font fontName="Code 128AB" size="24"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DESPATCHDET_SSCC_18}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="162" y="239" width="111" height="24"/>
				<textElement>
					<font fontName="Code 128AB" size="24"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ITEM_ITEM_CODE__UPC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="7" y="92" width="137" height="34"/>
				<textElement>
					<font fontName="Code 128AB" size="24"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SORDER_DLV_PIN}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
