<!DOCTYPE openRPTDef>
<report>
 <title>Worksheet</title>
 <name>TimeExpenseSheet</name>
 <description></description>
 <parameter default="2000" active="true" listtype="dynamic" type="string" name="tehead_id">
  <description></description>
  <query>SELECT tehead_id, tehead_number || '-' || tehead_username FROM tehead ORDER By tehead_number DESC;</query>
 </parameter>
 <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>header</name>
  <sql>SELECT 
  tehead_number,
  formatDate(tehead_weekending) AS f_weekending,
  warehous_code,
  emp_code || ' - ' || COALESCE(cntct_name,'') AS f_employee,
  CASE WHEN (tehead_status='O') THEN 
    &lt;? value("open") ?> 
  WHEN (tehead_status='A') THEN
    &lt;? value("approved") ?> 
  ELSE &lt;? value("closed") ?>
  END AS f_status,
  tehead_notes
FROM te.tehead
 JOIN emp ON (tehead_emp_id=emp_id)
 JOIN whsinfo ON (warehous_id=tehead_warehous_id)
 LEFT OUTER JOIN cntct ON (emp_cntct_id=cntct_id)
WHERE (tehead_id=&lt;? value("tehead_id") ?>);
</sql>
 </querysource>
 <querysource>
  <name>time</name>
  <sql>SELECT
  teitem_tehead_id,
  formatDate(teitem_workdate) AS f_workdate,
  prj_number,
  prj_name,
  prjtask_number,
  prjtask_name,
  cust_number,
  cust_name,
  item_number,
  item_descrip1,
  formatQty(teitem_qty) AS f_hours,
  teitem_qty,
  CASE WHEN (teitem_billable) THEN
    formatMoney(teitem_total)
  ELSE ' -- ' END AS f_billing_total,
  CASE WHEN (teitem_billable) THEN
    teitem_total
  ELSE 0 END AS billing_total,
  formatBoolYN(teitem_billable) AS f_billable,
  teitem_notes
FROM te.teitem
  JOIN prjtask ON (teitem_prjtask_id=prjtask_id)
  JOIN prj ON (prjtask_prj_id=prj_id)
  JOIN item ON (item_id=teitem_item_id)
  LEFT OUTER JOIN custinfo ON (cust_id=teitem_cust_id)
WHERE ((teitem_tehead_id=&lt;? value("tehead_id") ?>)
  AND (teitem_type='T'))
ORDER BY teitem_tehead_id, teitem_workdate, teitem_linenumber;</sql>
 </querysource>
 <querysource>
  <name>expense</name>
  <sql>SELECT
  teitem_tehead_id,
  formatDate(teitem_workdate) AS f_workdate,
  prj_number,
  prj_name,
  prjtask_number,
  prjtask_name,
  cust_number,
  cust_name,
  item_number,
  item_descrip1,
  formatQty(teitem_qty) AS f_qty,
  teitem_qty,
  formatMoney(teitem_total) AS f_total,
  teitem_total,
  CASE WHEN (teitem_billable) THEN
    formatMoney(teitem_total)
  ELSE ' -- ' END AS f_billing_total,
  CASE WHEN (teitem_type = 'E') THEN
    teitem_total
  ELSE 0 END AS expense_total,
  CASE WHEN (teitem_billable) THEN
    teitem_total
  ELSE 0 END AS billing_total,
  formatBoolYN(teitem_billable) AS f_billable,
  teitem_notes
FROM te.teitem
  JOIN prjtask ON (teitem_prjtask_id=prjtask_id)
  JOIN prj ON (prjtask_prj_id=prj_id)
  JOIN item ON (item_id=teitem_item_id)
  LEFT OUTER JOIN custinfo ON (cust_id=teitem_cust_id)
WHERE ((teitem_tehead_id=&lt;? value("tehead_id") ?>)
  AND (teitem_type='E'))
ORDER BY teitem_workdate, teitem_linenumber;</sql>
 </querysource>
 <querysource>
  <name>prjsum</name>
  <sql>SELECT
  teitem_tehead_id,
  prj_number,
  SUM(teitem_qty) AS total_hours,
  SUM(teitem_total) AS billing_total,
CASE WHEN (
           (checkprivilege('MaintainEmpCostSelf')) 
          AND 
           (current_user = (SELECT tehead_username 
                            FROM te.tehead 
                            WHERE teitem_tehead_id = tehead_id)
           )
           )
           THEN SUM(teitem_empcost * teitem_qty)
           ELSE 0 END AS cost_total,
CASE WHEN (
           (checkprivilege('MaintainEmpCostSelf')) 
          AND 
           (current_user = (SELECT tehead_username 
                            FROM te.tehead 
                            WHERE teitem_tehead_id = tehead_id)
           )
           )
           THEN 'Cost'
           ELSE 'No Priv' END AS title

FROM te.teitem
  JOIN prjtask ON (teitem_prjtask_id=prjtask_id)
  JOIN prj ON (prjtask_prj_id=prj_id)
  JOIN item ON (item_id=teitem_item_id)
  LEFT OUTER JOIN custinfo ON (cust_id=teitem_cust_id)
WHERE ((teitem_tehead_id=&lt;? value("tehead_id") ?>)
  AND (teitem_type='T'))
GROUP BY teitem_tehead_id, prj_number;</sql>
 </querysource>
 <querysource>
  <name>prjexpsum</name>
  <sql>SELECT
  teitem_tehead_id,
  prj_number,
  SUM(teitem_total) AS total
FROM te.teitem
  JOIN prjtask ON (teitem_prjtask_id=prjtask_id)
  JOIN prj ON (prjtask_prj_id=prj_id)
  JOIN item ON (item_id=teitem_item_id)
  LEFT OUTER JOIN custinfo ON (cust_id=teitem_cust_id)
WHERE ((teitem_tehead_id=&lt;? value("tehead_id") ?>)
  AND (teitem_type='E'))
GROUP BY teitem_tehead_id, prj_number;</sql>
 </querysource>
 <rpthead>
  <height>110</height>
  <label>
   <rect>
    <x>295</x>
    <y>5</y>
    <width>450</width>
    <height>37</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>18</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Worksheet</string>
  </label>
  <label>
   <rect>
    <x>35</x>
    <y>50</y>
    <width>83</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Week Of:</string>
  </label>
  <label>
   <rect>
    <x>35</x>
    <y>65</y>
    <width>83</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Site:</string>
  </label>
  <label>
   <rect>
    <x>35</x>
    <y>80</y>
    <width>83</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Employee:</string>
  </label>
  <label>
   <rect>
    <x>35</x>
    <y>35</y>
    <width>83</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Sheet #:</string>
  </label>
  <label>
   <rect>
    <x>260</x>
    <y>80</y>
    <width>83</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Status:</string>
  </label>
  <field>
   <rect>
    <x>135</x>
    <y>35</y>
    <width>175</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>header</query>
    <column>tehead_number</column>
   </data>
  </field>
  <field>
   <rect>
    <x>135</x>
    <y>50</y>
    <width>175</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>header</query>
    <column>f_weekending</column>
   </data>
  </field>
  <field>
   <rect>
    <x>135</x>
    <y>65</y>
    <width>175</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>header</query>
    <column>warehous_code</column>
   </data>
  </field>
  <field>
   <rect>
    <x>135</x>
    <y>80</y>
    <width>175</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>header</query>
    <column>f_employee</column>
   </data>
  </field>
  <field>
   <rect>
    <x>355</x>
    <y>80</y>
    <width>100</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>header</query>
    <column>f_status</column>
   </data>
  </field>
  <label>
   <rect>
    <x>5</x>
    <y>115</y>
    <width>450</width>
    <height>22</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>12</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Time</string>
  </label>
 </rpthead>
 <pghead>
  <firstpage/>
  <height>6</height>
 </pghead>
 <pghead>
  <height>14</height>
 </pghead>
 <section>
  <name>time</name>
  <group>
   <name>timefoot</name>
   <column>teitem_tehead_id</column>
   <head>
    <height>70</height>
    <label>
     <rect>
      <x>108.667</x>
      <y>45.3333</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Customer #:</string>
    </label>
    <label>
     <rect>
      <x>198.667</x>
      <y>31.3333</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Name</string>
    </label>
    <label>
     <rect>
      <x>383.667</x>
      <y>45.3333</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Description</string>
    </label>
    <label>
     <rect>
      <x>198.667</x>
      <y>45.3333</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Name</string>
    </label>
    <label>
     <rect>
      <x>9.33333</x>
      <y>31.3333</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Work Date</string>
    </label>
    <label>
     <rect>
      <x>480</x>
      <y>31.3</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Hours</string>
    </label>
    <label>
     <rect>
      <x>625.333</x>
      <y>31.3333</y>
      <width>50</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <hcenter/>
     <vcenter/>
     <string>Billable</string>
    </label>
    <label>
     <rect>
      <x>300.667</x>
      <y>45.3333</y>
      <width>75</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>298.667</x>
      <y>31.3333</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Task #</string>
    </label>
    <label>
     <rect>
      <x>383.667</x>
      <y>30.6667</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Name</string>
    </label>
    <label>
     <rect>
      <x>109.333</x>
      <y>31.3333</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Project #:</string>
    </label>
    <label>
     <rect>
      <x>655</x>
      <y>31.3333</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Billing Total</string>
    </label>
    <line>
     <xstart>3.33333</xstart>
     <ystart>61.333</ystart>
     <xend>743.333</xend>
     <yend>61.333</yend>
     <weight>2</weight>
    </line>
   </head>
   <foot>
    <height>15</height>
   </foot>
  </group>
  <detail>
   <key>
    <query>time</query>
   </key>
   <height>45</height>
   <field>
    <rect>
     <x>625</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>f_billable</column>
    </data>
   </field>
   <field>
    <rect>
     <x>200</x>
     <y>5</y>
     <width>90</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>prj_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>385</x>
     <y>5</y>
     <width>100</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>prjtask_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>110</x>
     <y>5</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>prj_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>670</x>
     <y>5</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>f_billing_total</column>
    </data>
   </field>
   <field>
    <rect>
     <x>490</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>f_hours</column>
    </data>
   </field>
   <field>
    <rect>
     <x>10</x>
     <y>5</y>
     <width>90</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>f_workdate</column>
    </data>
   </field>
   <field>
    <rect>
     <x>300</x>
     <y>5</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>prjtask_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>110</x>
     <y>15</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>cust_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>200</x>
     <y>15</y>
     <width>90</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>cust_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>300</x>
     <y>15</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>item_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>385</x>
     <y>15</y>
     <width>100</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>time</query>
     <column>item_descrip1</column>
    </data>
   </field>
   <text>
    <rect>
     <x>10</x>
     <y>30</y>
     <width>370</width>
     <height>15</height>
    </rect>
    <bottompad>0</bottompad>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <top/>
    <data>
     <query>time</query>
     <column>teitem_notes</column>
    </data>
   </text>
  </detail>
 </section>
 <section>
  <name>projsum</name>
  <pagebreak when="at end"/>
  <group>
   <name>prj_sum</name>
   <column>teitem_tehead_id</column>
   <pagebreak when="after foot"/>
   <head>
    <height>50</height>
    <label>
     <rect>
      <x>5</x>
      <y>10</y>
      <width>190</width>
      <height>22</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>12</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Project Time Summary</string>
    </label>
    <label>
     <rect>
      <x>380</x>
      <y>30</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Project #</string>
    </label>
    <label>
     <rect>
      <x>465</x>
      <y>30</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Total Hours</string>
    </label>
    <label>
     <rect>
      <x>685</x>
      <y>30</y>
      <width>60</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Billing Total</string>
    </label>
    <line>
     <xstart>3.33333</xstart>
     <ystart>46.333</ystart>
     <xend>743.333</xend>
     <yend>46.333</yend>
     <weight>2</weight>
    </line>
    <field>
     <rect>
      <x>615</x>
      <y>30</y>
      <width>50</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>prjsum</query>
      <column>title</column>
     </data>
    </field>
   </head>
   <foot>
    <height>30</height>
    <field>
     <rect>
      <x>695</x>
      <y>5</y>
      <width>50</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>prjsum</query>
      <column>billing_total</column>
     </data>
     <format builtin="true">money</format>
     <tracktotal subtotal="true"/>
    </field>
    <field>
     <rect>
      <x>505</x>
      <y>5</y>
      <width>50</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>prjsum</query>
      <column>total_hours</column>
     </data>
     <format builtin="true">qty</format>
     <tracktotal subtotal="true"/>
    </field>
    <line>
     <xstart>360</xstart>
     <ystart>5</ystart>
     <xend>745</xend>
     <yend>5</yend>
     <weight>2</weight>
    </line>
    <line>
     <xstart>420</xstart>
     <ystart>5</ystart>
     <xend>520</xend>
     <yend>5</yend>
     <weight>0</weight>
    </line>
    <field>
     <rect>
      <x>615</x>
      <y>5</y>
      <width>50</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>prjsum</query>
      <column>cost_total</column>
     </data>
     <format builtin="true">money</format>
     <tracktotal subtotal="true"/>
    </field>
   </foot>
  </group>
  <detail>
   <key>
    <query>prjsum</query>
   </key>
   <height>25</height>
   <field>
    <rect>
     <x>695</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>prjsum</query>
     <column>billing_total</column>
    </data>
    <format builtin="true">money</format>
   </field>
   <field>
    <rect>
     <x>615</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>prjsum</query>
     <column>cost_total</column>
    </data>
    <format builtin="true">money</format>
   </field>
   <field>
    <rect>
     <x>380</x>
     <y>5</y>
     <width>115</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>prjsum</query>
     <column>prj_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>505</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>prjsum</query>
     <column>total_hours</column>
    </data>
    <format builtin="true">qty</format>
   </field>
  </detail>
 </section>
 <section>
  <name>expense</name>
  <group>
   <name>expdetail</name>
   <column>teitem_tehead_id</column>
   <head>
    <height>65</height>
    <label>
     <rect>
      <x>109.333</x>
      <y>44</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Customer #:</string>
    </label>
    <label>
     <rect>
      <x>199.333</x>
      <y>30</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Name</string>
    </label>
    <label>
     <rect>
      <x>384.333</x>
      <y>44</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Description</string>
    </label>
    <label>
     <rect>
      <x>199.333</x>
      <y>44</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Name</string>
    </label>
    <label>
     <rect>
      <x>10</x>
      <y>30</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Work Date</string>
    </label>
    <label>
     <rect>
      <x>5</x>
      <y>5</y>
      <width>450</width>
      <height>22</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>12</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Expenses</string>
    </label>
    <label>
     <rect>
      <x>465</x>
      <y>30</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Quantity</string>
    </label>
    <label>
     <rect>
      <x>625.333</x>
      <y>30</y>
      <width>50</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <hcenter/>
     <vcenter/>
     <string>Billable</string>
    </label>
    <label>
     <rect>
      <x>301.333</x>
      <y>44</y>
      <width>75</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>299.333</x>
      <y>30</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Task #</string>
    </label>
    <label>
     <rect>
      <x>384.333</x>
      <y>29.3333</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Name</string>
    </label>
    <label>
     <rect>
      <x>110</x>
      <y>30</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Project #:</string>
    </label>
    <label>
     <rect>
      <x>670</x>
      <y>30</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Billing Total</string>
    </label>
    <label>
     <rect>
      <x>550</x>
      <y>30</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Total</string>
    </label>
   </head>
   <foot>
    <height>35</height>
    <field>
     <rect>
      <x>670</x>
      <y>5</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>expense</query>
      <column>billing_total</column>
     </data>
     <format builtin="true">money</format>
     <tracktotal subtotal="true"/>
    </field>
    <label>
     <rect>
      <x>370</x>
      <y>3.33</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Total Expenses:</string>
    </label>
    <field>
     <rect>
      <x>550</x>
      <y>3.33</y>
      <width>75</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>expense</query>
      <column>expense_total</column>
     </data>
     <format builtin="true">money</format>
     <tracktotal subtotal="true"/>
    </field>
   </foot>
  </group>
  <detail>
   <key>
    <query>expense</query>
   </key>
   <height>50</height>
   <field>
    <rect>
     <x>300</x>
     <y>20</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>item_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>385</x>
     <y>20</y>
     <width>100</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>item_descrip1</column>
    </data>
   </field>
   <field>
    <rect>
     <x>300</x>
     <y>5</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>prjtask_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>385</x>
     <y>5</y>
     <width>100</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>prjtask_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>490</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>f_qty</column>
    </data>
   </field>
   <field>
    <rect>
     <x>625</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>f_billable</column>
    </data>
   </field>
   <field>
    <rect>
     <x>670</x>
     <y>5</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>f_billing_total</column>
    </data>
   </field>
   <field>
    <rect>
     <x>110</x>
     <y>20</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>cust_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>200</x>
     <y>5</y>
     <width>90</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>prj_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>110</x>
     <y>5</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>prj_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>200</x>
     <y>20</y>
     <width>90</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>cust_name</column>
    </data>
   </field>
   <field>
    <rect>
     <x>10</x>
     <y>5</y>
     <width>90</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>f_workdate</column>
    </data>
   </field>
   <field>
    <rect>
     <x>550</x>
     <y>5</y>
     <width>75</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>expense</query>
     <column>f_total</column>
    </data>
   </field>
   <line>
    <xstart>4.13052</xstart>
    <ystart>-5.20281</ystart>
    <xend>744.13</xend>
    <yend>-5.20281</yend>
    <weight>2</weight>
   </line>
   <text>
    <rect>
     <x>110</x>
     <y>35</y>
     <width>600</width>
     <height>15</height>
    </rect>
    <bottompad>0</bottompad>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <top/>
    <data>
     <query>expense</query>
     <column>teitem_notes</column>
    </data>
   </text>
  </detail>
 </section>
 <section>
  <name>prjexpsum</name>
  <group>
   <name>prjexpsum</name>
   <column>teitem_tehead_id</column>
   <head>
    <height>60</height>
    <label>
     <rect>
      <x>5</x>
      <y>5</y>
      <width>230</width>
      <height>22</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>12</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Project Expense Summary</string>
    </label>
    <label>
     <rect>
      <x>685</x>
      <y>35</y>
      <width>60</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <string>Expenses</string>
    </label>
    <label>
     <rect>
      <x>370</x>
      <y>35</y>
      <width>90</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Project #</string>
    </label>
    <line>
     <xstart>4.13052</xstart>
     <ystart>53.1454</ystart>
     <xend>744.13</xend>
     <yend>53.1454</yend>
     <weight>2</weight>
    </line>
   </head>
   <foot>
    <height>40</height>
    <field>
     <rect>
      <x>695</x>
      <y>5</y>
      <width>50</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>8</size>
      <weight>bold</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>prjexpsum</query>
      <column>total</column>
     </data>
     <format builtin="true">money</format>
     <tracktotal subtotal="true"/>
    </field>
    <line>
     <xstart>655</xstart>
     <ystart>5</ystart>
     <xend>745</xend>
     <yend>5</yend>
     <weight>2</weight>
    </line>
   </foot>
  </group>
  <detail>
   <key>
    <query>prjexpsum</query>
   </key>
   <height>25</height>
   <field>
    <rect>
     <x>370</x>
     <y>5</y>
     <width>115</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>prjexpsum</query>
     <column>prj_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>695</x>
     <y>5</y>
     <width>50</width>
     <height>15</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>bold</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>prjexpsum</query>
     <column>total</column>
    </data>
    <format builtin="true">money</format>
   </field>
  </detail>
 </section>
 <pgfoot>
  <height>25</height>
  <field>
   <rect>
    <x>680</x>
    <y>5</y>
    <width>15</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>
  <field>
   <rect>
    <x>90</x>
    <y>5</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>
  <label>
   <rect>
    <x>0</x>
    <y>5</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>630</x>
    <y>5</y>
    <width>45</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Page:</string>
  </label>
  <label>
   <rect>
    <x>690</x>
    <y>5</y>
    <width>15</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>of</string>
  </label>
  <field>
   <rect>
    <x>710</x>
    <y>5</y>
    <width>20</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_count</column>
   </data>
  </field>
 </pgfoot>
 <rptfoot>
  <height>30</height>
  <text>
   <rect>
    <x>110</x>
    <y>5</y>
    <width>600</width>
    <height>15</height>
   </rect>
   <bottompad>0</bottompad>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>header</query>
    <column>tehead_notes</column>
   </data>
  </text>
  <label>
   <rect>
    <x>10</x>
    <y>5</y>
    <width>90</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Notes:</string>
  </label>
 </rptfoot>
</report>
