<?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="Unnamed" pageWidth="810" pageHeight="620" orientation="Landscape" columnWidth="791" leftMargin="15" rightMargin="4" topMargin="5" bottomMargin="15">
	<property name="com.jasperassistant.designer.GridHeight" value="12"/>
	<property name="com.jasperassistant.designer.GridWidth" value="12"/>
	<property name="com.jasperassistant.designer.HGuides" value="0"/>
	<property name="com.jasperassistant.designer.DataSource" value="genral_ledger"/>
	<property name="com.jasperassistant.designer.SnapToGrid" value="false"/>
	<property name="com.jasperassistant.designer.Units" value="Inches"/>
	<property name="com.jasperassistant.designer.Grid" value="false"/>
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="295"/>
	<property name="ireport.y" value="0"/>
	<reportFont name="Report_Font" isDefault="false" fontName="Courier New" size="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
	<parameter name="as_date" class="java.util.Date"/>
	<parameter name="site_code" class="java.lang.String"/>
	<queryString>
		<![CDATA[select
		physcan.tran_date as trandate,
		physcandet.item_code as itemcd,
		physcandet.loc_code as loccd,
		physcandet.lot_no as lotno,
		physcandet.lot_sl as lotsl,
		physcandet.quantity as qty,
		physcandet.qty_physical as qtyphy,
		item.descr as itemdescr,
		invstat.inv_stat as invstat,
		invstat.descr as invstatdesc,
		(select count(distinct loc_code) from physcandet where
		(physcandet.qty_physical - physcandet.quantity) <> 0
		and 	physcandet.tran_id in (select a.tran_id from physcan a
		where 	a.tran_date =$P{as_date} )
		and  	invstat.stat_type <> 'S')
		as count1,
		(select count(distinct loc_code) from physcandet where
		physcandet.tran_id in (select b.tran_id from physcan b
		where 	b.tran_date =$P{as_date} )
		and  	invstat.stat_type <> 'S')
		as count2
from
		physcan,
		physcandet,
		item,
		invstat,
		location
where
	physcan.tran_id = physcandet.tran_id
and 	physcan.tran_date =$P{as_date}
and 	physcandet.item_code = item.item_code
and 	location.inv_stat = invstat.inv_stat
and	location.loc_code = physcandet.loc_code
and  	invstat.stat_type <> 'S'
order by invstat.stat_type,physcandet.loc_code]]>
	</queryString>
	<field name="qty" class="java.lang.Double"/>
	<field name="itemcd" class="java.lang.String"/>
	<field name="loccd" class="java.lang.String"/>
	<field name="lotno" class="java.lang.String"/>
	<field name="lotsl" class="java.lang.String"/>
	<field name="itemdescr" class="java.lang.String"/>
	<field name="invstat" class="java.lang.String"/>
	<field name="invstatdesc" class="java.lang.String"/>
	<field name="trandate" class="java.util.Date"/>
	<field name="qtyphy" class="java.lang.Double"/>
	<field name="count1" class="java.lang.Double"/>
	<field name="count2" class="java.lang.Double"/>
	<variable name="varPage01" class="java.lang.String" resetType="None">
		<variableExpression><![CDATA[new java.lang.String("Page " + ($V{PAGE_NUMBER}).intValue())]]></variableExpression>
	</variable>
	<variable name="varPgCount02" class="java.lang.String" resetType="None">
		<variableExpression><![CDATA[new java.lang.String(""+ " of " + ($V{PAGE_NUMBER}).intValue())]]></variableExpression>
	</variable>
	<variable name="variance_cal" class="java.lang.Double">
		<variableExpression><![CDATA[new java.lang.Double($F{qty}.doubleValue()-$F{qtyphy}.doubleValue())]]></variableExpression>
	</variable>
	<variable name="qty_cal" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double($F{qty}.doubleValue())]]></variableExpression>
	</variable>
	<variable name="qty_phy_cal_1" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double($F{qtyphy}.doubleValue())]]></variableExpression>
	</variable>
	<variable name="variance_cal_1" class="java.lang.Double">
		<variableExpression><![CDATA[new java.lang.Double($V{qty_cal}.doubleValue()-$V{qty_phy_cal_1}.doubleValue())]]></variableExpression>
	</variable>
	<variable name="unit_var" class="java.lang.Double">
		<variableExpression><![CDATA[new java.lang.Double(($V{qty_phy_cal_1}.doubleValue()/$V{qty_cal}.doubleValue())*100)]]></variableExpression>
	</variable>
	<variable name="loc_var" class="java.lang.Double">
		<variableExpression><![CDATA[new java.lang.Double((($F{count2}.doubleValue() - $F{count1}.doubleValue())/$F{count2}.doubleValue())*100)]]></variableExpression>
	</variable>
	<pageHeader>
		<band height="107" splitType="Stretch">
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="15" y="68" width="757" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[------------------------------------------------------------------------------------------------------------------------------------]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="14" y="94" width="758" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[------------------------------------------------------------------------------------------------------------------------------------]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="654" y="54" width="41" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Date:]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="16" y="81" width="98" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Inv Stat Descr]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="120" y="81" width="75" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Item Code]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="202" y="81" width="90" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Item Descr]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="305" y="81" width="70" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Location]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="383" y="81" width="85" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Lot No]]></text>
			</staticText>
			<textField evaluationTime="Page" pattern="" isBlankWhenNull="true">
				<reportElement positionType="Float" x="640" y="36" width="64" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{varPage01}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="true">
				<reportElement positionType="Float" x="704" y="36" width="49" height="13"/>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{varPgCount02}]]></textFieldExpression>
			</textField>
			<textField pattern="MM/dd/yy" isBlankWhenNull="true">
				<reportElement positionType="Float" x="698" y="54" width="70" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{trandate}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="15" y="54" width="69" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Site Code:]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="14" y="7" width="628" height="26">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Center">
					<font fontName="Courier New" size="20" isBold="false"/>
				</textElement>
				<text><![CDATA[Physical Scan Report]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="475" y="81" width="70" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[LPN]]></text>
			</staticText>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement positionType="Float" x="84" y="54" width="49" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isUnderline="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{site_code}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="553" y="81" width="67" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Stock Qty]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="622" y="81" width="78" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Physical Qty]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="703" y="81" width="69" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Variance]]></text>
			</staticText>
			<textField pattern="MM/dd/yy HH.mm.ss">
				<reportElement x="597" y="18" width="171" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<detail>
		<band height="15" splitType="Stretch">
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement positionType="Float" x="16" y="1" width="98" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isUnderline="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{invstatdesc}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement positionType="Float" x="202" y="1" width="90" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isUnderline="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{itemdescr}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yy" isBlankWhenNull="true">
				<reportElement positionType="Float" x="120" y="1" width="75" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isUnderline="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{itemcd}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="383" y="1" width="85" height="13"/>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{lotno}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="305" y="1" width="70" height="13"/>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{loccd}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="475" y="1" width="70" height="13"/>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{lotsl}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="622" y="1" width="78" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{qtyphy}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="553" y="1" width="67" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{qty}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="703" y="1" width="67" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{variance_cal}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band height="59">
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="553" y="3" width="67" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{qty_cal}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="622" y="3" width="78" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{qty_phy_cal_1}]]></textFieldExpression>
			</textField>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="703" y="3" width="67" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{variance_cal_1}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="182" y="31" width="91" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Unit Accuracy: ]]></text>
			</staticText>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="292" y="31" width="67" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{unit_var}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="133" y="16" width="91" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Summary ]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="182" y="46" width="110" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Location Accuracy: ]]></text>
			</staticText>
			<textField pattern="0.000" isBlankWhenNull="true">
				<reportElement positionType="Float" x="292" y="46" width="67" height="13"/>
				<textElement textAlignment="Right">
					<font fontName="Courier New" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{loc_var}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement positionType="Float" mode="Transparent" x="447" y="3" width="91" height="13">
					<printWhenExpression><![CDATA[new Boolean(true)]]></printWhenExpression>
				</reportElement>
				<textElement textAlignment="Left">
					<font fontName="Courier New" size="10" isBold="false"/>
				</textElement>
				<text><![CDATA[Total:]]></text>
			</staticText>
		</band>
	</summary>
</jasperReport>
