<!DOCTYPE openRPTDef>
<report>
 <title>Unposted Purchase Order Receipts</title>
 <name>UnpostedPoReceipts</name>
 <description></description>
 <parameter default="" active="true" listtype="static" type="bool" name="MultiWhs" >
  <description></description>
 </parameter>
 <parameter default="" active="true" listtype="static" type="string" name="na" >
  <description></description>
 </parameter>
 <parameter default="" active="true" listtype="static" type="string" name="nonInventory" >
  <description></description>
 </parameter>
 <size>Letter</size>
 <portrait/>
 <topmargin>50</topmargin>
 <bottommargin>50</bottommargin>
 <rightmargin>50</rightmargin>
 <leftmargin>50</leftmargin>
 <querysource>
  <name>detail</name>
  <sql>SELECT recv_id, recv_orderitem_id, recv_order_number, recv_order_type,
       orderhead_from,
       orderitem_linenumber,
       formatDate(recv_duedate) AS recv_duedate,
       warehous_code,
       COALESCE(item_number, &lt;? value("nonInventory") ?>) AS item_number,
       COALESCE(uom_name, &lt;? value("na") ?>) AS uom_name,
       recv_vend_item_number,
       recv_vend_uom,
       formatQty(orderitem_qty_ordered)  AS qty_ordered,
       formatQty(orderitem_qty_received) AS qty_received,
       formatQty(recv_qty)     AS recv_qty,
       formatDate(recv_date)   AS recv_date,
       formatDate(COALESCE(recv_gldistdate, recv_date)) AS recv_gldistdate
FROM orderhead JOIN
     orderitem ON ((orderitem_orderhead_id=orderhead_id)
	       AND (orderitem_orderhead_type=orderhead_type)) JOIN 
     recv  ON ((recv_orderitem_id=orderitem_id)
	   AND (recv_order_type=orderitem_orderhead_type)) LEFT OUTER JOIN
     (itemsite JOIN item ON (itemsite_item_id=item_id)
	       JOIN uom ON (item_inv_uom_id=uom_id)
               JOIN site() ON (itemsite_warehous_id=warehous_id)
       )
      ON (recv_itemsite_id=itemsite_id) LEFT OUTER JOIN
     vendinfo ON (orderhead_type='PO' AND orderhead_from_id=vend_id)
WHERE (NOT recv_posted)
ORDER BY orderhead_from, recv_order_number, orderitem_linenumber;
</sql>
 </querysource>
 <rpthead>
  <height>76</height>
  <line>
   <xstart>5</xstart>
   <ystart>70</ystart>
   <xend>745</xend>
   <yend>70</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>295</x>
    <y>10</y>
    <width>450</width>
    <height>37</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>18</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Unposted Purchase Order Receipts</string>
  </label>
 </rpthead>
 <section>
  <name>detail</name>
  <group>
   <name>ponumber</name>
   <column>recv_order_number</column>
   <head>
    <height>51</height>
    <label>
     <rect>
      <x>130</x>
      <y>31</y>
      <width>100</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Item Number</string>
    </label>
    <label>
     <rect>
      <x>600</x>
      <y>31</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Qty To Receive</string>
    </label>
    <label>
     <rect>
      <x>285</x>
      <y>31</y>
      <width>100</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Vendor Item Number</string>
    </label>
    <field>
     <rect>
      <x>100</x>
      <y>0</y>
      <width>27</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>recv_order_type</column>
     </data>
    </field>
    <label>
     <rect>
      <x>240</x>
      <y>31</y>
      <width>40</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>UOM</string>
    </label>
    <field>
     <rect>
      <x>100</x>
      <y>15</y>
      <width>200</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>orderhead_from</column>
     </data>
    </field>
    <label>
     <rect>
      <x>440</x>
      <y>31</y>
      <width>70</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Qty Ordered</string>
    </label>
    <label>
     <rect>
      <x>0</x>
      <y>0</y>
      <width>100</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Order #:</string>
    </label>
    <label>
     <rect>
      <x>40</x>
      <y>31</y>
      <width>80</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Due Date</string>
    </label>
    <field>
     <rect>
      <x>135</x>
      <y>0</y>
      <width>100</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>recv_order_number</column>
     </data>
    </field>
    <label>
     <rect>
      <x>0</x>
      <y>15</y>
      <width>80</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Vendor:</string>
    </label>
    <label>
     <rect>
      <x>520</x>
      <y>31</y>
      <width>70</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Qty Received</string>
    </label>
    <label>
     <rect>
      <x>0</x>
      <y>31</y>
      <width>35</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Line #</string>
    </label>
    <label>
     <rect>
      <x>685</x>
      <y>31</y>
      <width>80</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Receipt Date</string>
    </label>
    <label>
     <rect>
      <x>395</x>
      <y>31</y>
      <width>40</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>UOM</string>
    </label>
   </head>
  </group>
  <detail>
   <key>
    <query>detail</query>
   </key>
   <height>21</height>
   <field>
    <rect>
     <x>685</x>
     <y>0</y>
     <width>80</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>recv_date</column>
    </data>
   </field>
   <field>
    <rect>
     <x>130</x>
     <y>0</y>
     <width>100</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>item_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>395</x>
     <y>0</y>
     <width>40</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>recv_vend_uom</column>
    </data>
   </field>
   <field>
    <rect>
     <x>0</x>
     <y>0</y>
     <width>35</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>orderitem_linenumber</column>
    </data>
   </field>
   <field>
    <rect>
     <x>285</x>
     <y>0</y>
     <width>100</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>recv_vend_item_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>520</x>
     <y>0</y>
     <width>70</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>qty_received</column>
    </data>
   </field>
   <field>
    <rect>
     <x>40</x>
     <y>0</y>
     <width>80</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>recv_duedate</column>
    </data>
   </field>
   <field>
    <rect>
     <x>240</x>
     <y>0</y>
     <width>40</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>uom_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>600</x>
     <y>0</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>recv_qty</column>
    </data>
   </field>
   <field>
    <rect>
     <x>440</x>
     <y>0</y>
     <width>70</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>qty_ordered</column>
    </data>
   </field>
  </detail>
 </section>
 <pgfoot>
  <height>16</height>
  <field>
   <rect>
    <x>90</x>
    <y>0</y>
    <width>100</width>
    <height>15</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>
  <field>
   <rect>
    <x>705</x>
    <y>0</y>
    <width>40</width>
    <height>15</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>0</x>
    <y>0</y>
    <width>85</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Report Date:</string>
  </label>
  <label>
   <rect>
    <x>615</x>
    <y>0</y>
    <width>85</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Page:</string>
  </label>
 </pgfoot>
</report>
