<!DOCTYPE openRPTDef>
<report>
 <title>Inventory History</title>
 <name>InventoryHistory</name>
 <description></description>
 <grid>
  <snap/>
  <show/>
  <x>0.05</x>
  <y>0.05</y>
 </grid>
 <size>Letter</size>
 <portrait/>
 <topmargin>50</topmargin>
 <bottommargin>50</bottommargin>
 <rightmargin>50</rightmargin>
 <leftmargin>50</leftmargin>
 <querysource>
  <name>detail</name>
  <sql>SELECT invhist_id,
       invhist_transdate,
       formatDateTime(invhist_transdate) AS f_transdate,
       invhist_transtype,
       whs1.warehous_code AS warehous_code,
       item_number,
       item_descrip1,
       item_descrip2,
       formatQty(invhist_invqty) AS transqty,
       (invhist_value_after-invhist_value_before) AS transvalue,
       formatMoney(invhist_value_after-invhist_value_before) AS f_transvalue,
       invhist_invuom,
       CASE WHEN (invhist_ordtype NOT LIKE '') THEN (invhist_ordtype || '-' || invhist_ordnumber)
            ELSE invhist_ordnumber
       END AS ordernumber,
       formatQty(invhist_qoh_before) AS qohbefore,
       formatQty(invhist_qoh_after) AS qohafter,
       CASE WHEN (invhist_costmethod='A') THEN &lt;? value("average") ?>
            WHEN (invhist_costmethod='S') THEN &lt;? value("standard") ?>
            WHEN (invhist_costmethod='J') THEN &lt;? value("job") ?>
            WHEN (invhist_costmethod='N') THEN &lt;? value("none") ?>
            ELSE &lt;? value("unknown") ?>
       END AS costmethod,
       formatMoney(invhist_value_before) AS valbefore,
       formatMoney(invhist_value_after) AS valafter,
       invhist_user AS username,
       invhist_posted,
       0 AS invdetail_id,
       '' AS locationname,
       '' AS detailqty,
       '' AS locationqtybefore,
       '' AS locationqtyafter,
       CASE WHEN (invhist_transtype='TW') THEN whs1.warehous_code
            WHEN (invhist_transtype='IB') THEN whs1.warehous_code
            WHEN (invhist_transtype='IM') THEN whs1.warehous_code
            WHEN (invhist_transtype='IT') THEN whs1.warehous_code
            WHEN (invhist_transtype='RB') THEN 'WIP'
            WHEN (invhist_transtype='RM') THEN 'WIP'
            WHEN (invhist_transtype='RP') THEN 'PURCH'
            WHEN (invhist_transtype='RR') THEN 'CUST'
            WHEN (invhist_transtype='RS') THEN 'SHIP'
            WHEN (invhist_transtype='SH') THEN whs1.warehous_code
            WHEN (invhist_transtype='SI') THEN whs1.warehous_code
            WHEN (invhist_transtype='SV') THEN whs1.warehous_code
	    WHEN (invhist_transtype='TR') THEN whs2.warehous_code
	    WHEN (invhist_transtype='TS') THEN whs1.warehous_code
            ELSE ''
       END AS locfrom,
       CASE WHEN (invhist_transtype='TW') THEN whs2.warehous_code
            WHEN (invhist_transtype='AD') THEN whs1.warehous_code
            WHEN (invhist_transtype='CC') THEN whs1.warehous_code
            WHEN (invhist_transtype='IB') THEN 'WIP'
            WHEN (invhist_transtype='IM') THEN 'WIP'
            WHEN (invhist_transtype='NN') THEN whs1.warehous_code
            WHEN (invhist_transtype='RB') THEN whs1.warehous_code
            WHEN (invhist_transtype='RM') THEN whs1.warehous_code
            WHEN (invhist_transtype='RP') THEN whs1.warehous_code
            WHEN (invhist_transtype='RR') THEN whs1.warehous_code
            WHEN (invhist_transtype='RS') THEN whs1.warehous_code
            WHEN (invhist_transtype='RT') THEN whs1.warehous_code
            WHEN (invhist_transtype='RX') THEN whs1.warehous_code
            WHEN (invhist_transtype='SH') THEN 'SHIP'
            WHEN (invhist_transtype='SI') THEN 'SCRAP'
            WHEN (invhist_transtype='SV') THEN 'SHIP'
	    WHEN (invhist_transtype='TR') THEN whs1.warehous_code
	    WHEN (invhist_transtype='TS') THEN whs2.warehous_code
            ELSE ''
       END AS locto
  FROM itemsite, item, whsinfo AS whs1, invhist LEFT OUTER JOIN whsinfo AS whs2 ON (invhist_xfer_warehous_id=whs2.warehous_id)
 WHERE ( (NOT invhist_hasdetail)
   AND (invhist_itemsite_id=itemsite_id)
   AND (itemsite_item_id=item_id)
   AND (itemsite_warehous_id=whs1.warehous_id)
  AND  (DATE(invhist_transdate) BETWEEN &lt;? value("startDate") ?> AND &lt;? value("endDate") ?> )
   AND (transType(invhist_transtype, &lt;? value("transType") ?>))
&lt;? if exists("orderType") ?>
  AND  (invhist_ordtype=&lt;? value("orderType") ?>)
&lt;? endif ?>
&lt;? if exists("orderNumber") ?>
  AND  (invhist_ordnumber ~ &lt;? value("orderNumber") ?>)
&lt;? endif ?>
&lt;? if exists("cohead_id") ?>
  AND  (invhist_ordtype='SO')
  AND  (invhist_ordnumber ~ (
    SELECT cohead_number 
    FROM cohead 
    WHERE cohead_id=&lt;? value("cohead_id") ?>))
&lt;? endif ?>
&lt;? if exists("pohead_id") ?>
  AND  (invhist_ordtype='PO')
  AND  (invhist_ordnumber ~ (
    SELECT pohead_number 
    FROM pohead 
    WHERE pohead_id=&lt;? value("pohead_id") ?>))
&lt;? endif ?>
&lt;? if exists("tohead_id") ?>
  AND  (invhist_ordtype='TO')
  AND  (invhist_ordnumber ~ (
    SELECT tohead_number 
    FROM tohead 
    WHERE tohead_id=&lt;? value("tohead_id") ?>))
&lt;? endif ?>
&lt;? if exists("wo_id") ?>
  AND  (invhist_ordtype='WO')
  AND  (invhist_ordnumber ~ formatWoNumber(&lt;? value("wo_id") ?>))
&lt;? endif ?>
&lt;? if exists("warehous_id") ?>
  AND  (itemsite_warehous_id=&lt;? value("warehous_id") ?>)
&lt;? endif ?>
&lt;? if exists("item_id") ?>
  AND  (itemsite_item_id=&lt;? value("item_id") ?>)
&lt;? endif ?>
&lt;? if exists("classcode_id") ?>
  AND  (item_classcode_id=&lt;? value("classcode_id") ?>)
&lt;? endif ?>
&lt;? if exists("itemgrp_id") ?>
  AND (item_id IN (SELECT itemgrpitem_item_id
		   FROM itemgrpitem
		   WHERE (itemgrpitem_itemgrp_id=&lt;? value("itemgrp_id") ?>)))
&lt;? endif ?>
&lt;? if exists("plancode_id") ?>
  AND  (itemsite_plancode_id=&lt;? value("plancode_id") ?>)
&lt;? endif ?>
&lt;? if exists("classcode_pattern") ?>
  AND  (item_classcode_id IN (SELECT classcode_id
			      FROM classcode
			      WHERE (classcode_code ~ &lt;? value ("classcode_pattern") ?>)))
&lt;? endif ?>
&lt;? if exists("itemgrp_pattern") ?>
  AND (item_id IN (SELECT itemgrpitem_item_id
		   FROM itemgrpitem, itemgrp
		   WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id)
		     AND  (itemgrp_name ~ &lt;? value ("itemgrp_pattern") ?>))))
&lt;? endif ?>
&lt;? if exists("plancode_pattern") ?>
  AND (itemsite_plancode_id IN (SELECT plancode_id
				FROM plancode
				WHERE (plancode_code ~ &lt;? value("plancode_pattern") ?>)))
&lt;? endif ?>
&lt;? if exists("itemgrp") ?>
  AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem))
&lt;? endif ?>
)
UNION
SELECT invhist_id,
       invhist_transdate,
       formatDateTime(invhist_transdate) AS transdate,
       invhist_transtype,
       whs1.warehous_code AS warehous_code,
       item_number,
       item_descrip1,
       item_descrip2,
       formatQty(invhist_invqty) AS transqty,
       0 AS transvalue,
       formatMoney(invhist_value_after-invhist_value_before) AS f_transvalue,
       invhist_invuom,
       CASE WHEN (invhist_ordtype NOT LIKE '') THEN (invhist_ordtype || '-' || invhist_ordnumber)
            ELSE invhist_ordnumber
       END AS ordernumber,
       formatQty(invhist_qoh_before) AS qohbefore,
       formatQty(invhist_qoh_after) AS qohafter,
       CASE WHEN(invhist_costmethod='A') THEN text('Average')
            WHEN(invhist_costmethod='S') THEN text('Standard')
            WHEN(invhist_costmethod='J') THEN text('Job')
            WHEN(invhist_costmethod='N') THEN text('None')
            ELSE 'UNKNOWN'
       END AS costmethod,
       formatMoney(invhist_value_before) AS valbefore,
       formatMoney(invhist_value_after) AS valafter,
       invhist_user AS username,
       invhist_posted,
       invdetail_id,
       CASE WHEN (invdetail_location_id=-1) THEN formatlotserialnumber(invdetail_ls_id)
            WHEN (invdetail_ls_id IS NULL) THEN formatLocationName(invdetail_location_id)
            ELSE (formatLocationName(invdetail_location_id) || '-' || formatlotserialnumber(invdetail_ls_id))
       END AS locationname,
       formatQty(invdetail_qty) AS detailqty,
       formatQty(invdetail_qty_before) AS locationqtybefore,
       formatQty(invdetail_qty_after) AS locationqtyafter,
       CASE WHEN (invhist_transtype='TW') THEN whs1.warehous_code
            WHEN (invhist_transtype='IB') THEN whs1.warehous_code
            WHEN (invhist_transtype='IM') THEN whs1.warehous_code
            WHEN (invhist_transtype='IT') THEN whs1.warehous_code
            WHEN (invhist_transtype='RB') THEN 'WIP'
            WHEN (invhist_transtype='RM') THEN 'WIP'
            WHEN (invhist_transtype='RP') THEN 'PURCH'
            WHEN (invhist_transtype='RR') THEN 'CUST'
            WHEN (invhist_transtype='RS') THEN 'SHIP'
            WHEN (invhist_transtype='SH') THEN whs1.warehous_code
            WHEN (invhist_transtype='SI') THEN whs1.warehous_code
            WHEN (invhist_transtype='SV') THEN whs1.warehous_code
	    WHEN (invhist_transtype='TR') THEN whs2.warehous_code
	    WHEN (invhist_transtype='TS') THEN whs1.warehous_code
            ELSE ''
       END AS locfrom,
       CASE WHEN (invhist_transtype='TW') THEN whs2.warehous_code
            WHEN (invhist_transtype='AD') THEN whs1.warehous_code
            WHEN (invhist_transtype='CC') THEN whs1.warehous_code
            WHEN (invhist_transtype='IB') THEN 'WIP'
            WHEN (invhist_transtype='IM') THEN 'WIP'
            WHEN (invhist_transtype='NN') THEN whs1.warehous_code
            WHEN (invhist_transtype='RB') THEN whs1.warehous_code
            WHEN (invhist_transtype='RM') THEN whs1.warehous_code
            WHEN (invhist_transtype='RP') THEN whs1.warehous_code
            WHEN (invhist_transtype='RR') THEN whs1.warehous_code
            WHEN (invhist_transtype='RS') THEN whs1.warehous_code
            WHEN (invhist_transtype='RT') THEN whs1.warehous_code
            WHEN (invhist_transtype='RX') THEN whs1.warehous_code
            WHEN (invhist_transtype='SH') THEN 'SHIP'
            WHEN (invhist_transtype='SI') THEN 'SCRAP'
            WHEN (invhist_transtype='SV') THEN 'SHIP'
	    WHEN (invhist_transtype='TR') THEN whs1.warehous_code
	    WHEN (invhist_transtype='TS') THEN whs2.warehous_code
            ELSE ''
       END AS locto
  FROM itemsite, item, whsinfo AS whs1, invdetail, invhist LEFT OUTER JOIN whsinfo AS whs2 ON (invhist_xfer_warehous_id=whs2.warehous_id)
 WHERE ((invhist_hasdetail)
   AND (invhist_itemsite_id=itemsite_id)
   AND (itemsite_item_id=item_id)
   AND (itemsite_warehous_id=whs1.warehous_id)
   AND (invdetail_invhist_id=invhist_id)
   AND  (DATE(invhist_transdate) BETWEEN &lt;? value("startDate") ?> AND &lt;? value("endDate") ?> )
   AND (transType(invhist_transtype, &lt;? value("transType") ?>))
&lt;? if exists("orderType") ?>
  AND  (invhist_ordtype=&lt;? value("orderType") ?>)
&lt;? endif ?>
&lt;? if exists("orderNumber") ?>
  AND  (invhist_ordnumber ~ &lt;? value("orderNumber") ?>)
&lt;? endif ?>
&lt;? if exists("cohead_id") ?>
  AND  (invhist_ordtype='SO')
  AND  (invhist_ordnumber ~ (
    SELECT cohead_number 
    FROM cohead 
    WHERE cohead_id=&lt;? value("cohead_id") ?>))
&lt;? endif ?>
&lt;? if exists("pohead_id") ?>
  AND  (invhist_ordtype='PO')
  AND  (invhist_ordnumber ~ (
    SELECT pohead_number 
    FROM pohead 
    WHERE pohead_id=&lt;? value("pohead_id") ?>))
&lt;? endif ?>
&lt;? if exists("tohead_id") ?>
  AND  (invhist_ordtype='TO')
  AND  (invhist_ordnumber ~ (
    SELECT tohead_number 
    FROM tohead 
    WHERE tohead_id=&lt;? value("tohead_id") ?>))
&lt;? endif ?>
&lt;? if exists("wo_id") ?>
  AND  (invhist_ordtype='WO')
  AND  (invhist_ordnumber ~ formatWoNumber(&lt;? value("wo_id") ?>))
&lt;? endif ?>
&lt;? if exists("warehous_id") ?>
  AND  (itemsite_warehous_id=&lt;? value("warehous_id") ?>)
&lt;? endif ?>
&lt;? if exists("item_id") ?>
  AND  (itemsite_item_id=&lt;? value("item_id") ?>)
&lt;? endif ?>
&lt;? if exists("classcode_id") ?>
  AND  (item_classcode_id=&lt;? value("classcode_id") ?>)
&lt;? endif ?>
&lt;? if exists("itemgrp_id") ?>
  AND (item_id IN (SELECT itemgrpitem_item_id
		   FROM itemgrpitem
		   WHERE (itemgrpitem_itemgrp_id=&lt;? value("itemgrp_id") ?>)))
&lt;? endif ?>
&lt;? if exists("plancode_id") ?>
  AND  (itemsite_plancode_id=&lt;? value("plancode_id") ?>)
&lt;? endif ?>
&lt;? if exists("classcode_pattern") ?>
  AND  (item_classcode_id IN (SELECT classcode_id
			      FROM classcode
			      WHERE (classcode_code ~ &lt;? value ("classcode_pattern") ?>)))
&lt;? endif ?>
&lt;? if exists("itemgrp_pattern") ?>
  AND (item_id IN (SELECT itemgrpitem_item_id
		   FROM itemgrpitem, itemgrp
		   WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id)
		     AND  (itemgrp_name ~ &lt;? value ("itemgrp_pattern") ?>))))
&lt;? endif ?>
&lt;? if exists("plancode_pattern") ?>
  AND (itemsite_plancode_id IN (SELECT plancode_id
				FROM plancode
				WHERE (plancode_code ~ &lt;? value("plancode_pattern") ?>)))
&lt;? endif ?>
&lt;? if exists("itemgrp") ?>
  AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem))
&lt;? endif ?>
);</sql>
 </querysource>
 <querysource>
  <name>footer</name>
  <sql>SELECT formatMoney(sum(invhist_value_after-invhist_value_before)) AS transvalue_total
FROM itemsite, item, whsinfo AS whs1, invhist LEFT OUTER JOIN
     whsinfo AS whs2 ON (invhist_xfer_warehous_id=whs2.warehous_id)
WHERE ( (invhist_itemsite_id=itemsite_id)
  AND  (itemsite_item_id=item_id) 
  AND  (itemsite_warehous_id=whs1.warehous_id)
  AND  (DATE(invhist_transdate) BETWEEN &lt;? value("startDate") ?> AND &lt;? value("endDate") ?> )
  AND  (transType(invhist_transtype, &lt;? value("transType") ?>))
&lt;? if exists("orderType") ?>
  AND  (invhist_ordtype=&lt;? value("orderType") ?>)
&lt;? endif ?>
&lt;? if exists("orderNumber") ?>
  AND  (invhist_ordnumber ~ &lt;? value("orderNumber") ?>)
  AND  (invhist_ordtype = 'SO')
&lt;? endif ?>
&lt;? if exists("warehous_id") ?>
  AND  (itemsite_warehous_id=&lt;? value("warehous_id") ?>)
&lt;? endif ?>
&lt;? if exists("item_id") ?>
  AND  (itemsite_item_id=&lt;? value("item_id") ?>)
&lt;? endif ?>
&lt;? if exists("classcode_id") ?>
  AND  (item_classcode_id=&lt;? value("classcode_id") ?>)
&lt;? elseif exists("itemgrp_id") ?>
  AND (item_id IN (SELECT itemgrpitem_item_id
		   FROM itemgrpitem
		   WHERE (itemgrpitem_itemgrp_id=&lt;? value("itemgrp_id") ?>)))
&lt;? elseif exists("plancode_id") ?>
  AND  (itemsite_plancode_id=&lt;? value("plancode_id") ?>)
&lt;? elseif exists("classcode_pattern") ?>
  AND  (item_classcode_id IN (SELECT classcode_id
			      FROM classcode
			      WHERE (classcode_code ~ &lt;? value ("classcode_pattern") ?>)))
&lt;? elseif exists("itemgrp_pattern") ?>
  AND (item_id IN (SELECT itemgrpitem_item_id
		   FROM itemgrpitem, itemgrp
		   WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id)
		     AND  (itemgrp_name ~ &lt;? value ("itemgrp_pattern") ?>))))
&lt;? elseif exists("plancode_pattern") ?>
  AND (itemsite_plancode_id IN (SELECT plancode_id
				FROM plancode
				WHERE (plancode_code ~ &lt;? value("plancode_pattern") ?>)))
&lt;? elseif exists("itemgrp") ?>
  AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem))
&lt;? endif ?>
)</sql>
 </querysource>
 <rpthead>
  <height>242</height>
  <label>
   <rect>
    <x>5</x>
    <y>200</y>
    <width>50</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Site</string>
  </label>
  <label>
   <rect>
    <x>660</x>
    <y>211</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Area To</string>
  </label>
  <label>
   <rect>
    <x>660</x>
    <y>222</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Val. After</string>
  </label>
  <label>
   <rect>
    <x>660</x>
    <y>200</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>QOH After</string>
  </label>
  <label>
   <rect>
    <x>200</x>
    <y>211</y>
    <width>228</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item Description</string>
  </label>
  <label>
   <rect>
    <x>585</x>
    <y>222</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Val. Before</string>
  </label>
  <label>
   <rect>
    <x>60</x>
    <y>200</y>
    <width>130</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Time</string>
  </label>
  <line>
   <xstart>5</xstart>
   <ystart>237</ystart>
   <xend>745</xend>
   <yend>237</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>5.68571</x>
    <y>211</y>
    <width>50</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Type</string>
  </label>
  <label>
   <rect>
    <x>586</x>
    <y>211</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Area From</string>
  </label>
  <label>
   <rect>
    <x>585</x>
    <y>200</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>QOH Before</string>
  </label>
  <label>
   <rect>
    <x>200</x>
    <y>200</y>
    <width>228</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item Number</string>
  </label>
  <label>
   <rect>
    <x>510</x>
    <y>211</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Cost Method</string>
  </label>
  <label>
   <rect>
    <x>432</x>
    <y>200</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>UOM</string>
  </label>
  <label>
   <rect>
    <x>60</x>
    <y>211</y>
    <width>130</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Order Number</string>
  </label>
  <label>
   <rect>
    <x>508</x>
    <y>200</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Qty</string>
  </label>
  <label>
   <rect>
    <x>60</x>
    <y>222</y>
    <width>130</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Username</string>
  </label>
  <label>
   <rect>
    <x>510</x>
    <y>222</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Value</string>
  </label>
  <label>
   <rect>
    <x>430</x>
    <y>7</y>
    <width>310</width>
    <height>30</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>18</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Inventory History</string>
  </label>
  <text>
   <rect>
    <x>10</x>
    <y>37</y>
    <width>725</width>
    <height>15</height>
   </rect>
   <bottompad>12</bottompad>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Parameter Query</query>
    <column>filter</column>
   </data>
  </text>
 </rpthead>
 <pghead>
  <firstpage/>
  <height>2</height>
 </pghead>
 <pghead>
  <height>51</height>
  <label>
   <rect>
    <x>10</x>
    <y>0</y>
    <width>32</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Site</string>
  </label>
  <label>
   <rect>
    <x>585</x>
    <y>12</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Area From</string>
  </label>
  <label>
   <rect>
    <x>585</x>
    <y>0</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>QOH Before</string>
  </label>
  <label>
   <rect>
    <x>586.32</x>
    <y>25</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Val. Before</string>
  </label>
  <label>
   <rect>
    <x>200</x>
    <y>0</y>
    <width>228</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item Number</string>
  </label>
  <label>
   <rect>
    <x>510</x>
    <y>12</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Cost Method</string>
  </label>
  <label>
   <rect>
    <x>10</x>
    <y>12</y>
    <width>32</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Type</string>
  </label>
  <label>
   <rect>
    <x>60</x>
    <y>0</y>
    <width>130</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Time</string>
  </label>
  <label>
   <rect>
    <x>660</x>
    <y>12</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Area To</string>
  </label>
  <label>
   <rect>
    <x>200</x>
    <y>12</y>
    <width>228</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item Description</string>
  </label>
  <label>
   <rect>
    <x>432</x>
    <y>0</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>UOM</string>
  </label>
  <label>
   <rect>
    <x>60</x>
    <y>25</y>
    <width>130</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Username</string>
  </label>
  <label>
   <rect>
    <x>665</x>
    <y>25</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Val. After</string>
  </label>
  <line>
   <xstart>5</xstart>
   <ystart>45</ystart>
   <xend>745</xend>
   <yend>45</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>660</x>
    <y>0</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>QOH After</string>
  </label>
  <label>
   <rect>
    <x>60</x>
    <y>12</y>
    <width>130</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Order Number</string>
  </label>
  <label>
   <rect>
    <x>508</x>
    <y>0</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Qty</string>
  </label>
  <label>
   <rect>
    <x>510</x>
    <y>25</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Value</string>
  </label>
 </pghead>
 <section>
  <name>detail</name>
  <group>
   <name>invhist_id</name>
   <column>invhist_id</column>
   <head>
    <height>45</height>
    <field>
     <rect>
      <x>60</x>
      <y>0</y>
      <width>132</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>f_transdate</column>
     </data>
    </field>
    <field>
     <rect>
      <x>200</x>
      <y>0</y>
      <width>228</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>item_number</column>
     </data>
    </field>
    <field>
     <rect>
      <x>200</x>
      <y>25</y>
      <width>228</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>item_descrip2</column>
     </data>
    </field>
    <field>
     <rect>
      <x>660</x>
      <y>25</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>valafter</column>
     </data>
    </field>
    <field>
     <rect>
      <x>60</x>
      <y>12</y>
      <width>132</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>ordernumber</column>
     </data>
    </field>
    <field>
     <rect>
      <x>585</x>
      <y>0</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>qohbefore</column>
     </data>
    </field>
    <field>
     <rect>
      <x>5</x>
      <y>0</y>
      <width>50</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <hcenter/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>warehous_code</column>
     </data>
    </field>
    <field>
     <rect>
      <x>432</x>
      <y>0</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <hcenter/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>invhist_invuom</column>
     </data>
    </field>
    <field>
     <rect>
      <x>60</x>
      <y>25</y>
      <width>132</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>username</column>
     </data>
    </field>
    <field>
     <rect>
      <x>585</x>
      <y>25</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>valbefore</column>
     </data>
    </field>
    <field>
     <rect>
      <x>660</x>
      <y>12</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>locto</column>
     </data>
    </field>
    <field>
     <rect>
      <x>660</x>
      <y>0</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>qohafter</column>
     </data>
    </field>
    <field>
     <rect>
      <x>5</x>
      <y>12</y>
      <width>50</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <hcenter/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>invhist_transtype</column>
     </data>
    </field>
    <field>
     <rect>
      <x>510</x>
      <y>0</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>transqty</column>
     </data>
    </field>
    <field>
     <rect>
      <x>585</x>
      <y>12</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>locfrom</column>
     </data>
    </field>
    <field>
     <rect>
      <x>200</x>
      <y>12</y>
      <width>228</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>item_descrip1</column>
     </data>
    </field>
    <field>
     <rect>
      <x>510</x>
      <y>12</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>costmethod</column>
     </data>
    </field>
    <field>
     <rect>
      <x>510</x>
      <y>25</y>
      <width>72</width>
      <height>12</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>f_transvalue</column>
     </data>
    </field>
   </head>
   <foot>
    <height>9</height>
    <line>
     <xstart>5</xstart>
     <ystart>5</ystart>
     <xend>745</xend>
     <yend>5</yend>
     <weight>0</weight>
    </line>
   </foot>
  </group>
  <detail>
   <key>
    <query>detail</query>
   </key>
   <height>16</height>
   <field>
    <rect>
     <x>585</x>
     <y>0</y>
     <width>72</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>locationqtybefore</column>
    </data>
   </field>
   <field>
    <rect>
     <x>200</x>
     <y>0</y>
     <width>228</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>locationname</column>
    </data>
   </field>
   <field>
    <rect>
     <x>508</x>
     <y>0</y>
     <width>72</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>detailqty</column>
    </data>
   </field>
   <field>
    <rect>
     <x>660</x>
     <y>0</y>
     <width>72</width>
     <height>12</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>locationqtyafter</column>
    </data>
   </field>
  </detail>
 </section>
 <pgfoot>
  <height>14</height>
  <label>
   <rect>
    <x>0</x>
    <y>0</y>
    <width>85</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Report Date:</string>
  </label>
  <field>
   <rect>
    <x>705</x>
    <y>0</y>
    <width>40</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>Context Query</query>
    <column>page_number</column>
   </data>
  </field>
  <label>
   <rect>
    <x>612</x>
    <y>0</y>
    <width>85</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Page:</string>
  </label>
  <field>
   <rect>
    <x>90</x>
    <y>0</y>
    <width>100</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>Context Query</query>
    <column>report_date</column>
   </data>
  </field>
 </pgfoot>
 <rptfoot>
  <height>20</height>
  <field>
   <rect>
    <x>510</x>
    <y>5</y>
    <width>72</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>transvalue_total</column>
   </data>
  </field>
  <label>
   <rect>
    <x>5</x>
    <y>5</y>
    <width>130</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Total:</string>
  </label>
 </rptfoot>
</report>
