<?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="walmat_ship_label" pageWidth="283" pageHeight="425" columnWidth="243" 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="57"/>
	<parameter name="WaveID" 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_TO" IS NULL THEN ' ' ELSE SORDER."DLV_TO" END AS SORDER_DLV_TO,
     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 SORDER."CUST_CODE" IS NULL THEN ' ' ELSE SORDER."CUST_CODE" END AS SORDER_CUST_CODE,
     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 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."QUANTITY" IS NULL THEN 0 ELSE DESPATCHDET."QUANTITY" END AS DESPATCHDET_QUANTITY,
	  CASE WHEN DESPATCHDET."LOC_CODE" IS NULL THEN ' ' ELSE DESPATCHDET."LOC_CODE" END AS DESPATCHDET_LOC_CODE,
     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,
     CASE WHEN PICK_ORD_HDR."PICK_ORDER" IS NULL THEN ' ' ELSE PICK_ORD_HDR."PICK_ORDER" END AS PICK_ORD_HDR_PICK_ORDER,
     (select
        count(pack_det.carton_no) from pack_hdr,pack_det
       where pack_hdr.tran_id = pack_det.tran_id
     )as "Total no of carton",
    CASE WHEN WAVE_TASK_DET.PTCN IS NULL THEN ' ' ELSE WAVE_TASK_DET.PTCN END AS WAVE_TASK_DET_PTCN
   FROM
     "SITE" SITE ,
    "DESPATCH" DESPATCH ,
     "DESPATCHDET" DESPATCHDET ,
     "SORDER" SORDER,
     "PICK_ORD_HDR" PICK_ORD_HDR,
    "PACK_HDR" PACK_HDR,
   WAVE_TASK_DET
    where
     SORDER.SALE_ORDER =  DESPATCH.SORD_NO
   AND SITE.SITE_CODE = SORDER.SITE_CODE
   AND DESPATCHDET.DESP_ID = DESPATCH.DESP_ID
   AND PACK_HDR.WAVE_ID = DESPATCH.WAVE_ID
   AND PICK_ORD_HDR.WAVE_ID = DESPATCH.WAVE_ID
   AND WAVE_TASK_DET.WAVE_ID = DESPATCH.WAVE_ID
   AND trim(DESPATCH.WAVE_ID) = TRIM('$P!{WaveID}')]]>
	</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="SORDER_CUST_CODE" 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="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_QUANTITY" class="java.lang.String"/>
	<field name="DESPATCHDET_LOC_CODE" class="java.lang.String"/>
	<field name="DESPATCHDET_SSCC_18" class="java.lang.String"/>
	<field name="DESPATCHDET_CUST_ITEM__REF" class="java.lang.String"/>
	<field name="PICK_ORD_HDR_PICK_ORDER" class="java.lang.String"/>
	<field name="Total no of carton" class="java.lang.String"/>
	<field name="SORDER_DLV_TO" 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{SORDER_DLV_PIN}.substring(0,4)) ) )]]></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{DESPATCHDET_SSCC_18}) ) )]]></variableExpression>
	</variable>
	<variable name="COMPUTE_3" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String($F{SORDER_DLV_CITY}.trim() + " "+$F{SORDER_STATE_CODE__DLV}.trim()+" "+$F{SORDER_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{SORDER_DLV_PIN}).substring(0,5))]]></variableExpression>
	</variable>
	<group name="cartoon">
		<groupExpression><![CDATA[$F{Total no of carton}]]></groupExpression>
		<groupHeader>
			<band/>
		</groupHeader>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="331" splitType="Stretch">
			<line>
				<reportElement x="242" y="1" width="1" height="330"/>
			</line>
			<line>
				<reportElement x="0" y="329" width="242" height="1"/>
			</line>
			<staticText>
				<reportElement x="5" y="2" width="76" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[FROM:]]></text>
			</staticText>
			<line>
				<reportElement x="1" y="193" width="242" height="1"/>
			</line>
			<line>
				<reportElement x="1" y="1" width="242" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="243" width="242" height="1"/>
			</line>
			<line>
				<reportElement x="138" y="131" width="1" height="62"/>
			</line>
			<line>
				<reportElement x="1" y="130" width="242" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="66" width="242" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="1" width="1" height="330"/>
			</line>
			<staticText>
				<reportElement x="6" y="133" width="100" height="11"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="6" isBold="false"/>
				</textElement>
				<text><![CDATA[(420) SHIP TO POSTAL CODE:]]></text>
			</staticText>
			<line>
				<reportElement x="99" y="1" width="1" height="64"/>
			</line>
			<staticText>
				<reportElement x="105" y="10" width="36" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[Carr:]]></text>
			</staticText>
			<staticText>
				<reportElement x="105" y="34" width="36" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[PRO#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="105" y="52" width="36" height="15"/>
				<textElement>
					<font fontName="Times New Roman" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[BOL#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="141" y="179" width="36" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[Ctl#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="141" y="139" width="38" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[PO#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="141" y="160" width="36" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[DEPT#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="5" y="71" width="18" height="21"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[TO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="1" y="244" width="178" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[(00) Serial Shipping Container]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="229" width="36" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[LOCN:]]></text>
			</staticText>
			<staticText>
				<reportElement x="4" y="216" width="36" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[SKU:]]></text>
			</staticText>
			<staticText>
				<reportElement x="155" y="229" width="36" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[QTY:]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="5" y="15" width="91" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_ADD1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="5" y="35" width="91" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_CITY}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="5" y="45" width="91" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_PIN}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="5" y="25" width="91" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_ADD2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="5" y="55" width="91" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_STATE_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="27" y="90" width="175" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SORDER_DLV_ADD2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="28" y="101" width="175" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SORDER_DLV_ADD3}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="28" y="111" width="175" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_3}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="27" y="80" width="175" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SORDER_DLV_ADD1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="137" y="10" width="105" height="23"/>
				<textElement>
					<font fontName="Times New Roman" size="9" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESPATCH_TRAN_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="137" y="52" width="105" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESPATCH_BOL_NO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="137" y="34" width="105" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESPATCH_PRO_NO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="163" y="139" width="79" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SORDER_CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="163" y="179" width="79" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{WAVE_TASK_DET_PTCN}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="52" y="217" width="69" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SORDER_CUST_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="52" y="230" width="69" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESPATCHDET_LOC_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="197" y="230" width="45" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESPATCHDET_QUANTITY}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Group" evaluationGroup="cartoon" isBlankWhenNull="true">
				<reportElement x="152" y="200" width="14" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{Total no of carton}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="142" y="200" width="11" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<text><![CDATA[OF]]></text>
			</staticText>
			<textField>
				<reportElement x="1" y="269" width="241" height="60"/>
				<textElement textAlignment="Center">
					<font fontName="Code 128AB" size="60"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="6" y="158" width="126" height="35"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Code 128AB" size="32"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_1}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Page" isBlankWhenNull="true">
				<reportElement x="135" y="200" width="11" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="101" y="200" width="29" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[CARTON]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="27" y="70" width="175" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="8" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SORDER_DLV_TO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="9" y="257" width="233" height="10"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["(00) "+$F{DESPATCHDET_SSCC_18}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="4" y="144" width="133" height="16"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_4}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
