<?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="d_er1_part5" pageWidth="105" pageHeight="20" orientation="Landscape" columnWidth="105" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="H10_from_date_F" class="java.util.Date"/>
	<parameter name="H10_to_date_F" class="java.util.Date"/>
	<parameter name="H10_site_code_exc_F" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT *
FROM (
select invtrace.tran_date,
       invtrace.tran_id,
       ddf_get_gpno(invtrace.ref_ser,invtrace.ref_id) as gpno,
       ROW_NUMBER() OVER (ORDER BY invtrace.tran_date ASC,invtrace.tran_id ASC) as ROW_NUMBER
FROM
	invtrace ,
	item     ,
	site     ,
	siteitem ,
	invstat  ,
	location ,
	taxchap  ,
   despatch ,
   sorder
WHERE   invtrace.item_code  			= item.item_code
and	  site.site_code      			= invtrace.site_code
and	  invtrace.loc_code   			= location.loc_code
and	  location.inv_stat   			= invstat.inv_stat
and     despatch.desp_id(+) 			= invtrace.ref_id
and     despatch.sord_no    			= sorder.sale_order(+)
and	  invtrace.site_code  			= siteitem.site_code
and	  invtrace.item_code  			= siteitem.item_code
and	  taxchap.tax_chap(+) 			= item.tax_chap
AND     invtrace.ref_ser 				NOT IN ('I-PKI','I-PKR','XFRX')
AND     (invtrace.loc_code 			NOT IN ('INTR','EXSH','FROOM') )
AND     (siteitem.item_ser__rg1 = 'FS' or siteitem.item_ser__rg1 = 'EX' or siteitem.item_ser__rg1 = 'BD' or siteitem.item_ser__rg1 = 'RM1' or siteitem.item_ser__rg1 = 'PM1' or siteitem.item_ser__rg1 is null )
AND   (nvl(trim(taxchap.chap_type),'E')='E')
AND     (location.loc_group like '%BSR%' or location.loc_group like '%SAMP%' or  location.loc_group like '%EXP%' ) AND
      (invtrace.tran_date between $P{H10_from_date_F} and $P{H10_to_date_F}) and
      site.site_code__exc = $P{H10_site_code_exc_F}
     )
WHERE ROW_NUMBER = 1]]>
	</queryString>
	<field name="TRAN_DATE" class="java.util.Date"/>
	<field name="TRAN_ID" class="java.lang.String"/>
	<field name="GPNO" class="java.lang.String"/>
	<field name="ROW_NUMBER" 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="20" splitType="Stretch">
			<textField>
				<reportElement x="1" y="1" width="100" height="18"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{GPNO}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
