<?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="Stock_to_Dock_label" pageWidth="283" pageHeight="425" columnWidth="283" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="14"/>
	<parameter name="REPLORDER" class="java.lang.String"/>
	<parameter name="PTCN" class="java.lang.String"/>
	<queryString>
		<![CDATA[select site.descr as site_descr,
site.add1 as site_add1,
site.add2 as site_add2,
site.city as site_city,
site.state_code as site_state_code,
site.pin as site_pin,
(SELECT CUST_NAME FROM CUSTOMER WHERE CUST_CODE = T.CUST_CODE__DLV) as cust_name,
T.DLV_ADD1,
T.DLV_ADD2,
T.DLV_PIN,
t.DLV_CITY AS DLV_CITY,
T.DLV_STATE AS DLV_STATE,
T.DLV_PIN AS DLV_PIN,
substr(T.DLV_PIN,0,5) AS DLV_PIN_SUB,
(SELECT TRAN_NAME FROM TRANSPORTER WHERE TRAN_CODE = T.TRAN_CODE) AS TRAN_NAME,
T.CUST_PORD AS CUST_PORD,
T.ITEM_CODE AS ITEM_CODE,
T.LOC_CODE AS LOC_CODE,
T.NO_ART AS NO_ART,
T.QUANTITY AS QUANTITY,
T.QTY_EACHES AS QTY_EACHES,
T.NOOF_CARTONS,
T.LINE_NO AS PICK_LINE_NO,
CM.CARTON_NO  AS SSCC_18,
1 AS CARTON_NO1

 from  (

select r.REPL_ORDER REPL_ORDER,
r.ORDER_DATE,
r.SITE_CODE,
r.SALE_ORDER,
r.WAVE_ID,
r.ORDER_TYPE,
r.CHG_USER,
r.CHG_DATE,
r.CHG_TERM,
rd.LINE_NO,
rd.LINE_NO__SORD,
rd.ITEM_CODE,
rd.LOC_CODE,
rd.LOT_NO,
rd.LOT_SL,
rd.NO_ART,
rd.QUANTITY,
rd.EXP_LEV   ,
i.unit,
i.COUNT_CODE__MFG,
SO.CUST_CODE__DLV AS CUST_CODE__DLV,
SO.CUST_PORD AS CUST_PORD,
SO.DLV_ADD1 AS DLV_ADD1,
SO.DLV_ADD2 AS DLV_ADD2,
SO.DLV_CITY AS DLV_CITY,
SO.STATE_CODE__DLV DLV_STATE,
SO.DLV_PIN AS DLV_PIN,
SO.TRAN_CODE AS TRAN_CODE,
(RD.QUANTITY / RD.NO_ART) AS QTY_EACHES,
(SELECT SUM(NO_ART) FROM repl_ord_det RD1 WHERE RD1.REPL_ORDER = RD.REPL_ORDER
	AND RD1.LOC_CODE = RD.LOC_CODE AND RD1.ITEM_CODE = RD.ITEM_CODE) AS NOOF_CARTONS
from repl_ord_hdr r, repl_ord_det rd,item i,SORDER SO
where r.repl_order = rd.repl_order
and i.item_code = rd.item_code
and r.repl_order = '$P!{REPLORDER}'
AND SO.SALE_ORDER = R.SALE_ORDER
AND r.order_type in ('D','L')
union all
select p.PICK_ORDER PICK_ORDER,
p.ORDER_DATE ORDER_DATE,
p.SITE_CODE SITE_CODE,
p.SALE_ORDER,
p.WAVE_ID,
p.PICK_TYPE,
p.CHG_USER,
p.CHG_DATE,
p.CHG_TERM,
pd.LINE_NO,
pd.LINE_NO__SORD,
pd.ITEM_CODE,
pd.LOC_CODE,
pd.LOT_NO,
pd.LOT_SL,
pd.NO_ART,
pd.QUANTITY,
pd.EXP_LEV ,
i.unit,
i.COUNT_CODE__MFG,
SO.CUST_CODE__DLV AS CUST_CODE__DLV,
SO.CUST_PORD AS CUST_PORD,
SO.DLV_ADD1 AS DLV_ADD1,
SO.DLV_ADD2 AS DLV_ADD2,
SO.DLV_CITY AS DLV_CITY,
SO.STATE_CODE__DLV DLV_STATE,
SO.DLV_PIN AS DLV_PIN,
SO.TRAN_CODE AS TRAN_CODE,
(PD.QUANTITY / PD.NO_ART) AS QTY_EACHES,
(SELECT SUM(NO_ART) FROM pick_ord_det PD1 WHERE PD1.PICK_ORDER = PD.PICK_ORDER
	AND PD1.LOC_CODE = PD.LOC_CODE AND PD1.ITEM_CODE = PD.ITEM_CODE) AS NOOF_CARTONS
from pick_ord_hdr p, pick_ord_det pd,item i, SORDER SO
where p.pick_order = pd.pick_order
and i.item_code = pd.item_code
and p.pick_order = '$P!{REPLORDER}'
AND SO.SALE_ORDER = P.SALE_ORDER
AND p.pick_type in ('D','L')
) t,
CARTON_MASTER CM,
SITE
WHERE CM.PICK_ORDER = T.REPL_ORDER
AND CM.LINE_NO__PICK = T.LINE_NO
AND SITE.SITE_CODE = T.SITE_CODE
order by t.loc_code,T.ITEM_CODE,T.LINE_NO]]>
	</queryString>
	<field name="TRAN_NAME" class="java.lang.String"/>
	<field name="CARTON_NO1" class="java.lang.Double"/>
	<field name="CUST_PORD" class="java.lang.String"/>
	<field name="DLV_ADD1" class="java.lang.String"/>
	<field name="DLV_ADD2" class="java.lang.String"/>
	<field name="DLV_CITY" class="java.lang.String"/>
	<field name="DLV_STATE" class="java.lang.String"/>
	<field name="DLV_PIN" class="java.lang.String"/>
	<field name="QTY_EACHES" 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="cust_name" class="java.lang.String"/>
	<field name="ITEM_CODE" class="java.lang.String"/>
	<field name="LOC_CODE" class="java.lang.String"/>
	<field name="SSCC_18" class="java.lang.String"/>
	<field name="NO_ART" class="java.lang.Integer"/>
	<field name="SITE_DESCR" class="java.lang.String"/>
	<field name="DLV_PIN_SUB" 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_SUB})) )]]></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.utility.BaseReportMethods.isNull($F{DLV_CITY}) ? " " : ($F{DLV_CITY}).trim())+" "+(ibase.webitm.reports.utility.BaseReportMethods.isNull($F{DLV_STATE} ) ? " " : ($F{DLV_STATE}).trim())+" "+ (ibase.webitm.reports.utility.BaseReportMethods.isNull($F{DLV_PIN}) ? " " :($F{DLV_PIN}).trim()))]]></variableExpression>
	</variable>
	<variable name="COMPUTE_4" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String((ibase.webitm.reports.utility.BaseReportMethods.isNull($F{SITE_CITY}) ? " " : ($F{SITE_CITY}).trim())+"  "+(ibase.webitm.reports.utility.BaseReportMethods.isNull($F{SITE_STATE_CODE} ) ? " " : ($F{SITE_STATE_CODE}).trim())+" "+ (ibase.webitm.reports.utility.BaseReportMethods.isNull($F{SITE_PIN}) ? " " :($F{SITE_PIN}).trim()))]]></variableExpression>
	</variable>
	<variable name="COMPUTE_5" 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>
	<variable name="COMPUTE_6" class="java.lang.Integer" resetType="Group" resetGroup="Location" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Integer($F{CARTON_NO1}.intValue())]]></variableExpression>
	</variable>
	<variable name="compute_7" class="java.lang.String">
		<variableExpression><![CDATA[new java.lang.String("(00) "+ibase.webitm.reports.utility.BaseReportMethods.trim($F{SSCC_18}))]]></variableExpression>
	</variable>
	<group name="Location" isStartNewPage="true">
		<groupExpression><![CDATA[$F{LOC_CODE}]]></groupExpression>
		<groupHeader>
			<band/>
		</groupHeader>
		<groupFooter>
			<band height="12">
				<subreport>
					<reportElement isPrintRepeatedValues="false" x="6" y="2" width="254" height="10" printWhenGroupChanges="Location"/>
					<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression>
					<subreportParameter name="LOC_CODE">
						<subreportParameterExpression><![CDATA[$F{LOC_CODE}]]></subreportParameterExpression>
					</subreportParameter>
					<subreportParameter name="REPLORDER">
						<subreportParameterExpression><![CDATA[$P{REPLORDER}]]></subreportParameterExpression>
					</subreportParameter>
					<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
					<subreportExpression class="java.io.InputStream"><![CDATA[new FileInputStream("/data/jboss-5.1.0.GA/server/default/deploy/ibase.ear/ibase.war/webitm/reports/jrxml/pick_task_break.jasper")]]></subreportExpression>
				</subreport>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="330" splitType="Stretch">
			<line>
				<reportElement x="4" y="327" width="256" height="1">
					<printWhenExpression><![CDATA[new Boolean(false)]]></printWhenExpression>
				</reportElement>
			</line>
			<staticText>
				<reportElement x="6" y="17" width="76" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[FROM:]]></text>
			</staticText>
			<line>
				<reportElement x="4" y="193" width="256" height="1"/>
			</line>
			<line>
				<reportElement x="4" y="243" width="256" height="1"/>
			</line>
			<line>
				<reportElement x="138" y="131" width="1" height="62"/>
			</line>
			<line>
				<reportElement x="4" y="130" width="256" height="1"/>
			</line>
			<line>
				<reportElement x="4" y="73" width="256" height="1"/>
			</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="120" y="12" width="1" height="61"/>
			</line>
			<staticText>
				<reportElement x="123" y="20" width="32" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[Carr:]]></text>
			</staticText>
			<staticText>
				<reportElement x="123" y="40" width="32" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[Pro#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="123" y="60" width="32" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[BOL#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="141" y="179" width="28" 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="28" 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="28" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="false"/>
				</textElement>
				<text><![CDATA[DEPT#:]]></text>
			</staticText>
			<staticText>
				<reportElement x="7" y="77" width="18" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[TO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="10" 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="9" 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="9" 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="160" 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="6" y="26" width="113" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_DESCR}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="6" y="46" width="113" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_ADD2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="6" y="56" width="113" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_4}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="6" y="36" width="113" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_ADD1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="27" y="98" width="230" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_ADD2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="28" y="108" width="230" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_3}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="27" y="88" width="230" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DLV_ADD1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="157" y="20" width="100" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TRAN_NAME}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="169" y="139" width="91" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="169" y="179" width="88" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{PTCN}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="57" y="217" width="69" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ITEM_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="57" y="230" width="69" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOC_CODE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="202" y="230" width="55" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{QTY_EACHES}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Group" evaluationGroup="Location" isBlankWhenNull="true">
				<reportElement x="157" y="200" width="14" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$F{NO_ART}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="147" y="200" width="11" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<text><![CDATA[OF]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="8" y="267" width="249" height="60"/>
				<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 isBlankWhenNull="true">
				<reportElement x="6" y="154" width="132" height="35"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Code 128AB" size="24"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_1}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Page" isBlankWhenNull="true">
				<reportElement x="140" y="200" width="11" height="11"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{COMPUTE_6}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="106" 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="78" width="230" height="10"/>
				<textElement>
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{cust_name}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="8" y="143" width="126" height="10"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{COMPUTE_5}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="9" y="257" width="251" height="10"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{compute_7}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="3" y="10" width="257" height="1">
					<printWhenExpression><![CDATA[new Boolean(false)]]></printWhenExpression>
				</reportElement>
			</line>
			<line>
				<reportElement x="260" y="10" width="1" height="318">
					<printWhenExpression><![CDATA[new Boolean(false)]]></printWhenExpression>
				</reportElement>
			</line>
			<line>
				<reportElement x="4" y="11" width="1" height="316">
					<printWhenExpression><![CDATA[new Boolean(false)]]></printWhenExpression>
				</reportElement>
			</line>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
