<?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="Pending Orders" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="as_site_code" class="java.lang.String"/>
	<parameter name="frm_order_date" class="java.util.Date"/>
	<parameter name="to_order_date" class="java.util.Date"/>
	<queryString>
		<![CDATA[SELECT SORDER.SALE_ORDER,
SORDER.ORDER_DATE,
CUSTOMER.CUST_NAME,
CUSTOMER.CUST_CODE,
SORDER.CUST_PORD,
SORDDET.ITEM_CODE,
ITEM.DESCR AS ITEM_DESCR,
SORDER.STATUS,
SORDDET.QUANTITY,
SORDDET.RATE,
(SORDDET.QUANTITY*SORDDET.RATE) AS ORDER_VALUE,
DDF_GET_STOCK(SORDER.SITE_CODE,SORDDET.ITEM_CODE) AS STOCK_QTY,
DDF_GET_SITE_DESCR(SORDER.SITE_CODE) AS SITE_DESCR
FROM SORDER,SORDDET,ITEM,CUSTOMER
WHERE SORDER.SITE_CODE = '$P!{as_site_code}'
AND SORDER.CONFIRMED = 'Y'
AND SORDER.STATUS = 'P'
AND SORDER.ORDER_DATE BETWEEN $P{frm_order_date} AND $P{to_order_date}
AND SORDDET.SALE_ORDER = SORDER.SALE_ORDER
AND ITEM.ITEM_CODE = SORDDET.ITEM_CODE
AND CUSTOMER.CUST_CODE = SORDER.CUST_CODE]]>
	</queryString>
	<field name="SALE_ORDER" class="java.lang.String"/>
	<field name="ORDER_DATE" class="java.util.Date"/>
	<field name="CUST_NAME" class="java.lang.String"/>
	<field name="CUST_PORD" class="java.lang.String"/>
	<field name="ITEM_CODE" class="java.lang.String"/>
	<field name="ITEM_DESCR" class="java.lang.String"/>
	<field name="SITE_DESCR" class="java.lang.String"/>
	<field name="STATUS" class="java.lang.String"/>
	<field name="QUANTITY" class="java.lang.Double"/>
	<field name="RATE" class="java.lang.Double"/>
	<field name="ORDER_VALUE" class="java.lang.Double"/>
	<field name="STOCK_QTY" class="java.lang.Double"/>
	<field name="CUST_CODE" class="java.lang.String"/>
	<sortField name="CUST_NAME"/>
	<variable name="variable1" class="java.util.Date" resetType="None">
		<variableExpression><![CDATA[new java.util.Date()]]></variableExpression>
	</variable>
	<variable name="order_val_grp" class="java.lang.Double" resetType="Group" resetGroup="CUSTOMER" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double($F{ORDER_VALUE}.doubleValue())]]></variableExpression>
	</variable>
	<variable name="order_val_grand" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double($F{ORDER_VALUE}.doubleValue())]]></variableExpression>
	</variable>
	<group name="CUSTOMER" isReprintHeaderOnEachPage="true">
		<groupExpression><![CDATA[$F{CUST_CODE}]]></groupExpression>
		<groupHeader>
			<band height="19">
				<line>
					<reportElement x="0" y="0" width="750" height="1"/>
				</line>
				<textField isBlankWhenNull="true">
					<reportElement x="78" y="1" width="498" height="18"/>
					<textElement>
						<font fontName="Times New Roman" isBold="true"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_NAME}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement x="0" y="1" width="78" height="18"/>
					<textElement>
						<font fontName="Times New Roman" isBold="true"/>
					</textElement>
					<text><![CDATA[Customer Name : ]]></text>
				</staticText>
				<line>
					<reportElement x="0" y="17" width="750" height="1"/>
				</line>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="19">
				<textField pattern="0.00">
					<reportElement x="604" y="0" width="68" height="18" printWhenGroupChanges="CUSTOMER"/>
					<textElement textAlignment="Right">
						<font fontName="Times New Roman"/>
					</textElement>
					<textFieldExpression class="java.lang.Double"><![CDATA[$V{order_val_grp}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement x="475" y="1" width="126" height="18"/>
					<textElement textAlignment="Left">
						<font fontName="Times New Roman" isBold="true"/>
					</textElement>
					<text><![CDATA[Customer Code Wise Total]]></text>
				</staticText>
				<line>
					<reportElement x="0" y="0" width="750" height="1"/>
				</line>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<pageHeader>
		<band height="79" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="58" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Sale Order]]></text>
			</staticText>
			<staticText>
				<reportElement x="529" y="58" width="68" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Rate]]></text>
			</staticText>
			<line>
				<reportElement x="0" y="55" width="750" height="1"/>
			</line>
			<staticText>
				<reportElement x="14" y="26" width="711" height="18"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Pending Order]]></text>
			</staticText>
			<textField pattern="MM/dd/yy">
				<reportElement x="40" y="3" width="133" height="14"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$V{variable1}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="10" y="3" width="28" height="14"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Date:]]></text>
			</staticText>
			<staticText>
				<reportElement x="678" y="3" width="20" height="14"/>
				<textElement>
					<font fontName="Times New Roman" isBold="false"/>
				</textElement>
				<text><![CDATA[Page]]></text>
			</staticText>
			<staticText>
				<reportElement x="712" y="3" width="10" height="14"/>
				<textElement>
					<font fontName="Times New Roman" isBold="false"/>
				</textElement>
				<text><![CDATA[of]]></text>
			</staticText>
			<textField evaluationTime="Page">
				<reportElement x="700" y="3" width="13" height="14"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement x="725" y="3" width="15" height="14"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="14" y="3" width="711" height="18"/>
				<textElement textAlignment="Center">
					<font fontName="Times New Roman" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SITE_DESCR}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="115" y="58" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Order No.]]></text>
			</staticText>
			<staticText>
				<reportElement x="173" y="58" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Item Code]]></text>
			</staticText>
			<staticText>
				<reportElement x="235" y="58" width="183" height="18"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Item Description]]></text>
			</staticText>
			<staticText>
				<reportElement x="420" y="58" width="30" height="18"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Status]]></text>
			</staticText>
			<staticText>
				<reportElement x="451" y="58" width="70" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Quantity]]></text>
			</staticText>
			<staticText>
				<reportElement x="604" y="58" width="68" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Order Value]]></text>
			</staticText>
			<staticText>
				<reportElement x="680" y="58" width="68" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Stock Quantity]]></text>
			</staticText>
			<staticText>
				<reportElement x="57" y="58" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Order Date]]></text>
			</staticText>
		</band>
	</pageHeader>
	<detail>
		<band height="18" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SALE_ORDER}]]></textFieldExpression>
			</textField>
			<textField pattern="0.00">
				<reportElement x="529" y="0" width="68" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{RATE}]]></textFieldExpression>
			</textField>
			<textField pattern="MM/dd/yy">
				<reportElement x="57" y="0" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{ORDER_DATE}]]></textFieldExpression>
			</textField>
			<textField pattern="0.00">
				<reportElement x="680" y="0" width="68" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{ORDER_VALUE}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="115" y="0" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="173" y="0" width="52" height="18"/>
				<textElement>
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ITEM_CODE}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement x="235" y="0" width="183" height="18"/>
				<textElement>
					<font fontName="Times New Roman" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ITEM_DESCR}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement x="420" y="0" width="30" height="18"/>
				<textElement>
					<font fontName="Times New Roman" size="9"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{STATUS}]]></textFieldExpression>
			</textField>
			<textField pattern="0.00">
				<reportElement x="451" y="0" width="70" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{QUANTITY}]]></textFieldExpression>
			</textField>
			<textField pattern="0.00">
				<reportElement x="604" y="0" width="68" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{ORDER_VALUE}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band height="22" splitType="Stretch">
			<staticText>
				<reportElement x="475" y="3" width="126" height="18"/>
				<textElement textAlignment="Left">
					<font fontName="Times New Roman" isBold="true"/>
				</textElement>
				<text><![CDATA[Grand Total]]></text>
			</staticText>
			<textField pattern="0.00">
				<reportElement x="604" y="2" width="68" height="18"/>
				<textElement textAlignment="Right">
					<font fontName="Times New Roman"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{order_val_grand}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="0" y="0" width="750" height="1"/>
			</line>
			<line>
				<reportElement x="0" y="19" width="750" height="1"/>
			</line>
		</band>
	</summary>
</jasperReport>
