<!DOCTYPE openRPTDef>
<report>
 <title>Work Order History By Class Code</title>
 <name>WOHistoryByClassCode</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 loadFromDb="true">
  <name>Detail</name>
  <mqlgroup>workOrderHistory</mqlgroup>
  <mqlname>detail</mqlname>
 </querysource>
 <querysource>
  <name>head</name>
  <sql>SELECT &lt;? if exists("warehous_id") ?>
         ( SELECT warehous_code
             FROM whsinfo
            WHERE (warehous_id=&lt;? value("warehous_id") ?>) )
       &lt;? else ?>
         text('All Sites')
       &lt;? endif ?>
       AS warehouse,
       &lt;? if exists("classcode_id") ?>
         ( SELECT (classcode_code||'-'||classcode_descrip)
             FROM classcode
            WHERE (classcode_id=&lt;? value("classcode_id") ?>) )
       &lt;? elseif exists("classcode_pattern") ?>
         text(&lt;? value("classcode_pattern") ?>)
       &lt;? else ?>
         text('All Class Codes')
       &lt;? endif ?>
       AS classcode,
       &lt;? if exists("showOnlyTopLevel") ?>
         text('Only Show Top level Work Orders')
       &lt;? else ?>
         text('')
       &lt;? endif ?>
       AS lbl_toplevel,
       &lt;? if exists("showCosts") ?>
         text('Cost')
       &lt;? else ?>
         text('')
       &lt;? endif ?>
       AS lbl_cost
;</sql>
 </querysource>
 <rpthead>
  <height>172</height>
  <label>
   <rect>
    <x>430</x>
    <y>150</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Start Date</string>
  </label>
  <label>
   <rect>
    <x>5</x>
    <y>150</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>W/O #</string>
  </label>
  <label>
   <rect>
    <x>509</x>
    <y>150</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Due Date</string>
  </label>
  <label>
   <rect>
    <x>30</x>
    <y>105</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Site:</string>
  </label>
  <line>
   <xstart>5</xstart>
   <ystart>165</ystart>
   <xend>740</xend>
   <yend>165</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>30</x>
    <y>85</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Class Code(s):</string>
  </label>
  <label>
   <rect>
    <x>125</x>
    <y>150</y>
    <width>100</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item</string>
  </label>
  <label>
   <rect>
    <x>350</x>
    <y>150</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Received</string>
  </label>
  <label>
   <rect>
    <x>270</x>
    <y>150</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Ordered</string>
  </label>
  <label>
   <rect>
    <x>240</x>
    <y>10</y>
    <width>484</width>
    <height>38</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>18</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Work Order History By Class Code</string>
  </label>
  <label>
   <rect>
    <x>45</x>
    <y>150</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Status</string>
  </label>
  <field>
   <rect>
    <x>135</x>
    <y>85</y>
    <width>170</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>classcode</column>
   </data>
  </field>
  <label>
   <rect>
    <x>229</x>
    <y>150</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>UOM</string>
  </label>
  <field>
   <rect>
    <x>365</x>
    <y>85</y>
    <width>355</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>lbl_toplevel</column>
   </data>
  </field>
  <field>
   <rect>
    <x>135</x>
    <y>105</y>
    <width>170</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>warehouse</column>
   </data>
  </field>
  <label>
   <rect>
    <x>85</x>
    <y>150</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Site</string>
  </label>
  <field>
   <rect>
    <x>665</x>
    <y>151</y>
    <width>70</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>lbl_cost</column>
   </data>
  </field>
 </rpthead>
 <pghead>
  <firstpage/>
  <height>7</height>
 </pghead>
 <pghead>
  <height>32</height>
  <label>
   <rect>
    <x>125</x>
    <y>10</y>
    <width>100</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item</string>
  </label>
  <label>
   <rect>
    <x>509</x>
    <y>10</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Due Date</string>
  </label>
  <label>
   <rect>
    <x>45</x>
    <y>10</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Status</string>
  </label>
  <label>
   <rect>
    <x>85</x>
    <y>10</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Site</string>
  </label>
  <label>
   <rect>
    <x>350</x>
    <y>10</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Received</string>
  </label>
  <label>
   <rect>
    <x>270</x>
    <y>10</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Ordered</string>
  </label>
  <line>
   <xstart>5</xstart>
   <ystart>25</ystart>
   <xend>740</xend>
   <yend>25</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>430</x>
    <y>10</y>
    <width>80</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Start Date</string>
  </label>
  <label>
   <rect>
    <x>229</x>
    <y>10</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>UOM</string>
  </label>
  <label>
   <rect>
    <x>5</x>
    <y>10</y>
    <width>40</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>W/O #</string>
  </label>
  <field>
   <rect>
    <x>660</x>
    <y>8</y>
    <width>70</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>lbl_cost</column>
   </data>
  </field>
 </pghead>
 <section>
  <name>detail</name>
  <detail>
   <key>
    <query>Detail</query>
   </key>
   <height>52</height>
   <field>
    <rect>
     <x>5</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>Detail</query>
     <column>wonumber</column>
    </data>
   </field>
   <field>
    <rect>
     <x>85</x>
     <y>0</y>
     <width>40</width>
     <height>15</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>509</x>
     <y>0</y>
     <width>80</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>Detail</query>
     <column>f_wo_duedate</column>
    </data>
   </field>
   <field>
    <rect>
     <x>45</x>
     <y>0</y>
     <width>40</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>Detail</query>
     <column>wo_status</column>
    </data>
   </field>
   <field>
    <rect>
     <x>125</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>item_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>229</x>
     <y>0</y>
     <width>40</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>Detail</query>
     <column>uom_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>125</x>
     <y>30</y>
     <width>300</width>
     <height>15</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>670</x>
     <y>0</y>
     <width>70</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>Detail</query>
     <column>f_wo_postedvalue</column>
    </data>
   </field>
   <field>
    <rect>
     <x>270</x>
     <y>0</y>
     <width>80</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>Detail</query>
     <column>f_wo_qtyord</column>
    </data>
   </field>
   <field>
    <rect>
     <x>125</x>
     <y>15</y>
     <width>300</width>
     <height>15</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>350</x>
     <y>0</y>
     <width>80</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>Detail</query>
     <column>f_wo_qtyrcv</column>
    </data>
   </field>
   <line>
    <xstart>5</xstart>
    <ystart>45</ystart>
    <xend>740</xend>
    <yend>45</yend>
    <weight>0</weight>
   </line>
   <field>
    <rect>
     <x>430</x>
     <y>0</y>
     <width>80</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>Detail</query>
     <column>f_wo_startdate</column>
    </data>
   </field>
  </detail>
 </section>
 <pgfoot>
  <height>17</height>
  <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>
  <field>
   <rect>
    <x>95</x>
    <y>0</y>
    <width>113</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>5</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>
 </pgfoot>
</report>
