<!DOCTYPE openRPTDef>
<report>
 <title>Customer Order Acknowledgement</title>
 <name>CustOrderAcknowledgement</name>
 <description>Customer Order Acknowledgement</description>
 <grid>
  <snap/>
  <show/>
  <x>0.05</x>
  <y>0.05</y>
 </grid>
 <size>Letter</size>
 <portrait/>
 <topmargin>25</topmargin>
 <bottommargin>25</bottommargin>
 <rightmargin>25</rightmargin>
 <leftmargin>25</leftmargin>
 <querysource>
  <name>head</name>
  <sql>&lt;? if not exists("shiphead_id") ?>
--Run query if no shiphead_id passed - No Shipment Pack List
SELECT cust_number,
       formatsobarcode(cohead_id) AS order_barcode,
       formataddr(addr_line1, addr_line2, addr_line3, (addr_city || '  ' ||  addr_state || '  ' || addr_postalcode), addr_country) AS corr_address,
       formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || '  ' ||   cohead_billtostate || '  ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, 

  formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || '  ' ||   cohead_shiptostate || '  ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address,           

       trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact,
       cohead_fob,
       cohead_billtoname,
       cohead_billtoaddress1,
       cohead_billtoaddress2,
       cohead_billtoaddress3,
       (cohead_billtocity || '  ' || cohead_billtostate || '  ' || cohead_billtozipcode) AS billtocitystatezip,
       cntct_phone AS cust_phone,
       cohead_shiptoname,
       cohead_shiptoaddress1,
       cohead_shiptoaddress2,
       cohead_shiptoaddress3,
       (cohead_shiptocity || '  ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip,
       cohead_number,
       cohead_shipvia,
       cohead_shiptophone,
       cohead_custponumber,
       formatDate(cohead_orderdate) AS orderdate,
       cohead_shipcomments, 
       terms_descrip
  FROM cohead JOIN custinfo ON (cohead_cust_id=cust_id)
  JOIN terms ON (cohead_terms_id=terms_id)
  LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)
  LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id)
 WHERE (cohead_id=&lt;? value("sohead_id") ?>);

-------------------
&lt;? else ?>
--Run New Query for Header with shipment number
-----------------------------------------------

SELECT shiphead_number,

       cohead_number,
       formatsobarcode(cohead_id) AS order_barcode,
       cohead_shipvia,
       cohead_shiptophone,
       cohead_custponumber,
       formatDate(cohead_orderdate) AS orderdate,
       cohead_shipcomments,   
       cohead_billtoname,
       formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3,
                  (cohead_billtocity || '  ' ||   cohead_billtostate || '  ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address,
       cohead_shiptoname,
       formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3,
                  (cohead_shiptocity || '  ' ||   cohead_shiptostate || '  ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address,           

       cust_number,
       trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact,
       cntct_phone AS cust_phone,
       cohead_shipchrg_id,
       shipchrg_descrip,

       terms_descrip
  FROM shiphead
  JOIN cohead ON (cohead_id=shiphead_order_id)
  JOIN custinfo ON (cohead_cust_id=cust_id)
  JOIN terms ON (cohead_terms_id=terms_id)
  JOIN shipchrg ON (cohead_shipchrg_id = shipchrg_id)
  LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)
  LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id)
 WHERE (shiphead_id=&lt;? value("shiphead_id") ?>);

&lt;? endif ?></sql>
 </querysource>
 <querysource>
  <name>scheddate</name>
  <sql>&lt;? if not exists("shiphead_id") ?>
--Query without shipment number

SELECT formatDate(MIN(coitem_scheddate)) AS scheddate
  FROM coitem
 WHERE ((coitem_status &lt;> 'X') AND (coitem_cohead_id=&lt;? value("sohead_id") ?>));

--
&lt;? else ?>
--------------------------


SELECT formatDate(MIN(coitem_scheddate)) AS scheddate
  FROM coitem, shipitem
 WHERE ((coitem_status &lt;> 'X')
   AND  (coitem_id=shipitem_orderitem_id)
   AND  (shipitem_shiphead_id=&lt;? value("shiphead_id") ?>));

&lt;? endif ?></sql>
 </querysource>
 <querysource loadFromDb="true">
  <name>detail</name>
  <mqlgroup>salesOrderItems</mqlgroup>
  <mqlname>list</mqlname>
 </querysource>
 <querysource>
  <name>logo</name>
  <sql>SELECT image_data 
FROM image 
WHERE ((image_name='logo'));</sql>
 </querysource>
 <querysource>
  <name>footer</name>
  <sql>SELECT formatMoney(calcSalesOrderAmt(cohead_id, 'S')) AS f_subtotal,
       formatMoney(calcSalesOrderAmt(cohead_id, 'T')) AS f_total,
       formatMoney(calcSalesOrderAmt(cohead_id, 'B')) AS f_balance,
       formatMoney(calcSalesOrderAmt(cohead_id, 'X')) AS f_tax,
       formatMoney(calcSalesOrderAmt(cohead_id, 'C')) AS f_credit,
       formatMoney(cohead_freight) AS f_freight,
       formatMoney(cohead_misc) AS f_misc
FROM cohead
WHERE (cohead_id=&lt;? value("sohead_id") ?>)
;</sql>
 </querysource>
 <querysource>
  <name>lastupdated</name>
  <sql>SELECT formatDate(MAX(lastupdated)) AS f_lastupdated
  FROM (SELECT cohead_lastupdated AS lastupdated
          FROM cohead
         WHERE (cohead_id=&lt;? value("sohead_id") ?>)
         UNION
        SELECT coitem_lastupdated AS lastupdated
          FROM coitem
         WHERE (coitem_cohead_id=&lt;? value("sohead_id") ?>) ) AS data;</sql>
 </querysource>
 <querysource>
  <name>currency</name>
  <sql>SELECT currConcat(curr_id) AS currConcat, curr_symbol
FROM cohead, curr_symbol
WHERE (cohead_id = &lt;? value("sohead_id") ?>)
 AND  (cohead_curr_id = curr_id);</sql>
 </querysource>
 <rpthead>
  <height>426</height>
  <image>
   <rect>
    <x>6</x>
    <y>7</y>
    <width>426</width>
    <height>115</height>
   </rect>
   <mode>stretch</mode>
   <data>
    <query>logo</query>
    <column>image_data</column>
   </data>
  </image>
  <line>
   <xstart>210</xstart>
   <ystart>330</ystart>
   <xend>330</xend>
   <yend>330</yend>
   <weight>0</weight>
  </line>
  <label>
   <rect>
    <x>45</x>
    <y>305</y>
    <width>140</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>PO Number</string>
  </label>
  <field>
   <rect>
    <x>40</x>
    <y>335</y>
    <width>145</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cohead_custponumber</column>
   </data>
  </field>
  <field>
   <rect>
    <x>539</x>
    <y>39</y>
    <width>250</width>
    <height>25</height>
   </rect>
   <font>
    <face>Times New Roman</face>
    <size>20</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cohead_number</column>
   </data>
  </field>
  <label>
   <rect>
    <x>391</x>
    <y>8</y>
    <width>406</width>
    <height>30</height>
   </rect>
   <font>
    <face>Helvetica</face>
    <size>18</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Sales Order Acknowledgement</string>
  </label>
  <line>
   <xstart>470</xstart>
   <ystart>330</ystart>
   <xend>647</xend>
   <yend>330</yend>
   <weight>0</weight>
  </line>
  <field>
   <rect>
    <x>200</x>
    <y>335</y>
    <width>165</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>terms_descrip</column>
   </data>
  </field>
  <line>
   <xstart>45</xstart>
   <ystart>330</ystart>
   <xend>177</xend>
   <yend>330</yend>
   <weight>0</weight>
  </line>
  <field>
   <rect>
    <x>355</x>
    <y>335</y>
    <width>80</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <data>
    <query>scheddate</query>
    <column>scheddate</column>
   </data>
  </field>
  <line>
   <xstart>15</xstart>
   <ystart>415</ystart>
   <xend>785</xend>
   <yend>415</yend>
   <weight>2</weight>
  </line>
  <label>
   <rect>
    <x>510</x>
    <y>390</y>
    <width>67</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Balance</string>
  </label>
  <label>
   <rect>
    <x>535.987</x>
    <y>140.037</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>SHIP TO:</string>
  </label>
  <label>
   <rect>
    <x>520</x>
    <y>305</y>
    <width>57</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Ship Via:</string>
  </label>
  <label>
   <rect>
    <x>230</x>
    <y>310</y>
    <width>57</width>
    <height>16</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Terms</string>
  </label>
  <label>
   <rect>
    <x>130</x>
    <y>390</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Description</string>
  </label>
  <line>
   <xstart>360</xstart>
   <ystart>330</ystart>
   <xend>440</xend>
   <yend>330</yend>
   <weight>0</weight>
  </line>
  <field>
   <rect>
    <x>622</x>
    <y>70</y>
    <width>110</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>12</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>orderdate</column>
   </data>
  </field>
  <label>
   <rect>
    <x>360</x>
    <y>305</y>
    <width>70</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Ship Date</string>
  </label>
  <line>
   <xstart>269.976</xstart>
   <ystart>160.037</ystart>
   <xend>491.976</xend>
   <yend>160.037</yend>
   <weight>0</weight>
  </line>
  <label>
   <rect>
    <x>720</x>
    <y>390</y>
    <width>75</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Amount</string>
  </label>
  <field>
   <rect>
    <x>535.987</x>
    <y>170.037</y>
    <width>254.338</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>11</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cohead_shiptoname</column>
   </data>
  </field>
  <field>
   <rect>
    <x>455</x>
    <y>335</y>
    <width>195</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cohead_shipvia</column>
   </data>
  </field>
  <label>
   <rect>
    <x>650</x>
    <y>390</y>
    <width>60</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Price</string>
  </label>
  <field>
   <rect>
    <x>655</x>
    <y>335</y>
    <width>95</width>
    <height>16</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <hcenter/>
   <top/>
   <data>
    <query>head</query>
    <column>cohead_fob</column>
   </data>
  </field>
  <text>
   <rect>
    <x>270.976</x>
    <y>191.037</y>
    <width>256</width>
    <height>22.2821</height>
   </rect>
   <bottompad>10</bottompad>
   <font>
    <face>Arial</face>
    <size>11</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>billing_address</column>
   </data>
  </text>
  <label>
   <rect>
    <x>20</x>
    <y>390</y>
    <width>95</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item</string>
  </label>
  <text>
   <rect>
    <x>535.987</x>
    <y>190.037</y>
    <width>253.562</width>
    <height>20.2425</height>
   </rect>
   <bottompad>10</bottompad>
   <font>
    <face>Arial</face>
    <size>11</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>shipping_address</column>
   </data>
  </text>
  <label>
   <rect>
    <x>271.529</x>
    <y>140.037</y>
    <width>50</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>BILL TO:</string>
  </label>
  <line>
   <xstart>670</xstart>
   <ystart>330</ystart>
   <xend>750</xend>
   <yend>330</yend>
   <weight>0</weight>
  </line>
  <label>
   <rect>
    <x>435</x>
    <y>390</y>
    <width>70</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Ordered</string>
  </label>
  <label>
   <rect>
    <x>685</x>
    <y>305</y>
    <width>37</width>
    <height>20</height>
   </rect>
   <font>
    <face>Helvetica</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>FOB</string>
  </label>
  <label>
   <rect>
    <x>590</x>
    <y>390</y>
    <width>40</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>UOM</string>
  </label>
  <field>
   <rect>
    <x>271.976</x>
    <y>170.037</y>
    <width>256</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>11</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cohead_billtoname</column>
   </data>
  </field>
  <line>
   <xstart>535.987</xstart>
   <ystart>160.037</ystart>
   <xend>766.987</xend>
   <yend>160.037</yend>
   <weight>0</weight>
  </line>
  <text>
   <rect>
    <x>17.6809</x>
    <y>192.59</y>
    <width>222</width>
    <height>21.011</height>
   </rect>
   <bottompad>10</bottompad>
   <font>
    <face>Arial</face>
    <size>11</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>billing_address</column>
   </data>
  </text>
  <field>
   <rect>
    <x>17.6809</x>
    <y>171.59</y>
    <width>213</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>11</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cohead_billtoname</column>
   </data>
  </field>
  <line>
   <xstart>15.8119</xstart>
   <ystart>162.124</ystart>
   <xend>224.257</xend>
   <yend>162.137</yend>
   <weight>0</weight>
  </line>
  <label>
   <rect>
    <x>14.7743</x>
    <y>144.768</y>
    <width>165.637</width>
    <height>16.0854</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>9</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>CUSTOMER ADDRESS:</string>
  </label>
 </rpthead>
 <section>
  <name>detail</name>
  <group>
   <name>detail</name>
   <column>groupby</column>
   <foot>
    <height>36</height>
    <text>
     <rect>
      <x>37</x>
      <y>7</y>
      <width>707</width>
      <height>21</height>
     </rect>
     <bottompad>14</bottompad>
     <font>
      <face>Arial</face>
      <size>12</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>head</query>
      <column>cohead_shipcomments</column>
     </data>
    </text>
   </foot>
  </group>
  <group>
   <name>lineitem</name>
   <column>coitem_linenumber</column>
   <foot>
    <height>6</height>
   </foot>
  </group>
  <detail>
   <key>
    <query>detail</query>
   </key>
   <height>41</height>
   <field>
    <rect>
     <x>15</x>
     <y>0</y>
     <width>85</width>
     <height>20</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>9</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>item_number_cust</column>
    </data>
   </field>
   <field>
    <rect>
     <x>600</x>
     <y>5</y>
     <width>27</width>
     <height>17</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>9</size>
     <weight>normal</weight>
    </font>
    <left/>
    <top/>
    <data>
     <query>detail</query>
     <column>qty_uom</column>
    </data>
   </field>
   <field>
    <rect>
     <x>515</x>
     <y>0</y>
     <width>65</width>
     <height>20</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>9</size>
     <weight>normal</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>f_balance</column>
    </data>
   </field>
   <field>
    <rect>
     <x>640</x>
     <y>3</y>
     <width>56</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>9</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>f_price</column>
    </data>
   </field>
   <text>
    <rect>
     <x>125</x>
     <y>25</y>
     <width>435</width>
     <height>12</height>
    </rect>
    <bottompad>14</bottompad>
    <font>
     <face>Arial</face>
     <size>8</size>
     <weight>normal</weight>
    </font>
    <left/>
    <top/>
    <data>
     <query>detail</query>
     <column>coitem_memo</column>
    </data>
   </text>
   <field>
    <rect>
     <x>705</x>
     <y>3</y>
     <width>82</width>
     <height>17</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>9</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>f_extprice</column>
    </data>
   </field>
   <field>
    <rect>
     <x>435</x>
     <y>0</y>
     <width>65</width>
     <height>20</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>9</size>
     <weight>normal</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>f_qtyord</column>
    </data>
   </field>
   <field>
    <rect>
     <x>102</x>
     <y>0</y>
     <width>325</width>
     <height>20</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>9</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>item_descrip1_cust</column>
    </data>
   </field>
  </detail>
 </section>
 <pgfoot>
  <lastpage/>
  <height>233</height>
  <label>
   <rect>
    <x>510</x>
    <y>48</y>
    <width>115</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>MISCELLANEOUS</string>
  </label>
  <label>
   <rect>
    <x>390</x>
    <y>138</y>
    <width>170</width>
    <height>30</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>12</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Balance Due:</string>
  </label>
  <field>
   <rect>
    <x>670</x>
    <y>28</y>
    <width>97</width>
    <height>16</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>f_freight</column>
   </data>
  </field>
  <field>
   <rect>
    <x>670</x>
    <y>48</y>
    <width>97</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>f_misc</column>
   </data>
  </field>
  <label>
   <rect>
    <x>510</x>
    <y>33</y>
    <width>115</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>FREIGHT</string>
  </label>
  <field>
   <rect>
    <x>605</x>
    <y>133</y>
    <width>172</width>
    <height>32</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>16</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>f_balance</column>
   </data>
  </field>
  <label>
   <rect>
    <x>510</x>
    <y>13</y>
    <width>115</width>
    <height>12</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>SUBTOTAL</string>
  </label>
  <field>
   <rect>
    <x>675</x>
    <y>8</y>
    <width>92</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>f_subtotal</column>
   </data>
  </field>
  <label>
   <rect>
    <x>510</x>
    <y>68</y>
    <width>115</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>TAX</string>
  </label>
  <field>
   <rect>
    <x>670</x>
    <y>68</y>
    <width>97</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>f_tax</column>
   </data>
  </field>
  <field>
   <rect>
    <x>665</x>
    <y>88</y>
    <width>102</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>f_total</column>
   </data>
  </field>
  <label>
   <rect>
    <x>510</x>
    <y>88</y>
    <width>115</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>TOTAL</string>
  </label>
  <label>
   <rect>
    <x>510</x>
    <y>108</y>
    <width>115</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>CREDITS</string>
  </label>
  <field>
   <rect>
    <x>665</x>
    <y>108</y>
    <width>102</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>footer</query>
    <column>f_credit</column>
   </data>
  </field>
  <field>
   <rect>
    <x>635</x>
    <y>48</y>
    <width>30</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>currency</query>
    <column>curr_symbol</column>
   </data>
  </field>
  <field>
   <rect>
    <x>635</x>
    <y>68</y>
    <width>30</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>currency</query>
    <column>curr_symbol</column>
   </data>
  </field>
  <field>
   <rect>
    <x>635</x>
    <y>8</y>
    <width>30</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>currency</query>
    <column>curr_symbol</column>
   </data>
  </field>
  <field>
   <rect>
    <x>565</x>
    <y>143</y>
    <width>30</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
    <italic/>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>currency</query>
    <column>curr_symbol</column>
   </data>
  </field>
  <field>
   <rect>
    <x>635</x>
    <y>28</y>
    <width>30</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>currency</query>
    <column>curr_symbol</column>
   </data>
  </field>
  <field>
   <rect>
    <x>635</x>
    <y>88</y>
    <width>30</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>currency</query>
    <column>curr_symbol</column>
   </data>
  </field>
  <field>
   <rect>
    <x>635</x>
    <y>108</y>
    <width>30</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <right/>
   <vcenter/>
   <data>
    <query>currency</query>
    <column>curr_symbol</column>
   </data>
  </field>
 </pgfoot>
 <rptfoot>
  <height>28</height>
 </rptfoot>
</report>
