<!DOCTYPE openRPTDef>
<report>
 <title>Packing List (Shipment)</title>
 <name>PackingList-Shipment</name>
 <description>Non-Hybrid version - driven only by shiphead_id parameter - Packing List showing the contents of a particular shipment - Shows RA# if SO is a replacement order for and RA</description>
 <parameter default="324" active="true" listtype="static" type="string" name="shiphead_id">
  <description></description>
 </parameter>
 <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>SELECT shiphead_number, 'S/O #:' AS ordertype,
       cohead_number AS ordernumber,
       formatsobarcode(cohead_id) AS order_barcode,
       COALESCE(shiphead_shipvia, cohead_shipvia) AS shipvia,
       cohead_shiptophone AS shiptophone,
       cohead_custponumber,
       formatDate(cohead_orderdate) AS orderdate,
       cohead_shipcomments AS shipcomments,   
       cohead_billtoname AS billtoname,
       formataddr(cohead_billtoaddress1, cohead_billtoaddress2,
                  cohead_billtoaddress3,
                  (cohead_billtocity || '  ' ||   cohead_billtostate ||
                  '  ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address,
       cohead_shiptoname AS 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,
       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)
  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;? if exists("MultiWhs") ?>
UNION
SELECT shiphead_number, 'T/O #:' AS ordertype,
       tohead_number AS ordernumber,
       formattobarcode(tohead_id) AS order_barcode,
       shiphead_shipvia AS shipvia,
       tohead_destphone AS shiptophone,
       TEXT(' ') AS cohead_custponumber,
       formatDate(tohead_orderdate) AS orderdate,
       tohead_shipcomments AS shipcomments,
       tohead_srcname AS billtoname,
       formataddr(tohead_srcaddress1, tohead_srcaddress2,
                   tohead_srcaddress3,
                  (tohead_srccity || ' ' || tohead_srcstate ||
                   ' ' || tohead_srcpostalcode), tohead_srccountry) AS billing_address,
       tohead_destname AS shiptoname,
       formataddr(tohead_destaddress1, tohead_destaddress2,
                   tohead_destaddress3,
                  (tohead_destcity || ' ' || tohead_deststate ||
                   ' ' || tohead_destpostalcode), tohead_destcountry) AS shipping_address,
       'Transfer Order' AS cust_number,
       tohead_destcntct_name AS cust_contact,
       tohead_destphone AS cust_phone,
       '' AS terms_descrip
  FROM shiphead, tohead
 WHERE ((tohead_id=shiphead_order_id)
   AND  (shiphead_order_type='TO')
   AND  (shiphead_id=&lt;? value("shiphead_id") ?>)
)
&lt;? endif ?>;</sql>
 </querysource>
 <querysource>
  <name>scheddate</name>
  <sql>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") ?>));</sql>
 </querysource>
 <querysource>
  <name>detail</name>
  <sql>SELECT 1 AS groupby,
       coitem_linenumber AS sortline, coitem_subnumber AS sortsubline,
       formatsolinenumber(coitem_id) AS linenumber,
       coitem_memo AS memo,
       CASE WHEN (coitem_custpn != '') THEN coitem_custpn
            ELSE item_number
       END AS item_number,
       formatitemsitebarcode(itemsite_id) AS item_barcode,
       formatsoitembarcode(coitem_id) AS orderitem_barcode,
--     In 2.3 replaced the next line:
--     uom_name,
--     with:
       (select uom_name from uom where uom_id = coitem_qty_uom_id) AS uom_name,
       itemsellinguom(item_id) AS shipuom,
       CASE WHEN (coitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip1
            ELSE item_descrip1
       END AS item_descrip1,
       CASE WHEN (coitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip2
            ELSE item_descrip2
       END AS item_descrip2,

       formatQty(coitem_qtyord) AS ordered,
       (SELECT formatQty(SUM(shipitem_qty)) FROM shipitem WHERE ((shipitem_shiphead_id=&lt;? value("shiphead_id") ?>) AND (shipitem_orderitem_id=coitem_id))) AS shipped,

       CASE WHEN (coitem_status='O' AND (SELECT cust_creditstatus
                                           FROM custinfo,cohead
                                          WHERE coitem_cohead_id=cohead_id
                                            AND (cust_id=cohead_cust_id))='H') THEN 'H'
            WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed)
                                            FROM cohead, invchead, invcitem
                                           WHERE ((invchead_ordernumber=cohead_number)
                                             AND  (invcitem_invchead_id=invchead_id)
                                             AND  (invcitem_item_id=item_id)
                                             AND  (invcitem_warehous_id=itemsite_warehous_id)
                                             AND  (invcitem_linenumber=coitem_linenumber)
                                             AND  (cohead_id=coitem_cohead_id))) >= coitem_qtyord)) THEN 'I'
            WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed)
                                            FROM cohead, invchead, invcitem
                                           WHERE ((invchead_ordernumber=cohead_number)
                                             AND  (invcitem_invchead_id=invchead_id)
                                             AND  (invcitem_item_id=item_id)
                                             AND  (invcitem_warehous_id=itemsite_warehous_id)
                                             AND  (invcitem_linenumber=coitem_linenumber)
                                             AND  (cohead_id=coitem_cohead_id))) > 0)) THEN 'P'
            WHEN (coitem_status='O' AND (qtyAvailable(itemsite_id) - qtyAllocated(itemsite_id, CURRENT_DATE)
                                         + qtyOrdered(itemsite_id, CURRENT_DATE))
                                          >= (coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) THEN 'R'
            ELSE coitem_status
       END AS f_status,
       CASE
         WHEN (getPacklistItemLotSerial(shipitem_shiphead_id, coitem_id) = '') THEN
           ''
         ELSE
           'Serial #/Lot Information:'
       END AS lotserial_title,
       getPacklistItemLotSerial(shipitem_shiphead_id, coitem_id) AS lotserial,
       CASE
         WHEN (getPacklistCharName(shipitem_shiphead_id, coitem_id) = '') THEN
           ''
         ELSE
           'Characteristics:'
       END AS char_title,
       getPacklistCharName(shipitem_shiphead_id, coitem_id) AS char_name,
       getPacklistCharValue(shipitem_shiphead_id, coitem_id) AS char_value
  FROM shipitem
       JOIN coitem ON (coitem_id=shipitem_orderitem_id)
       JOIN itemsite ON (itemsite_id=coitem_itemsite_id)
       JOIN item ON (item_id=itemsite_item_id)
       JOIN uom ON (uom_id=item_inv_uom_id)
       LEFT OUTER JOIN itemalias ON (itemalias_item_id=item_id AND itemalias_number=coitem_custpn) 
 WHERE ( (coitem_status &lt;> 'X')
   AND (shipitem_shiphead_id=&lt;? value("shiphead_id") ?>)
)
&lt;? if exists("MultiWhs") ?>
UNION
SELECT 2 AS groupby,
       toitem_linenumber AS sortline, 0 AS sortsubline,
       CAST(toitem_linenumber AS text) AS linenumber,
       toitem_notes AS memo,
       item_number,
       formatitemsitebarcode(itemsite_id) AS item_barcode,
       formattoitembarcode(toitem_id) AS orderitem_barcode,
       uom_name,
       itemsellinguom(item_id) AS shipuom,
       item_descrip1,
       item_descrip2,

       formatQty(toitem_qty_ordered) AS ordered,

       (SELECT formatQty(SUM(shipitem_qty))
        FROM shipitem
        WHERE ((shipitem_shiphead_id=&lt;? value("shiphead_id") ?>)
          AND  (shipitem_orderitem_id=toitem_id))
       ) AS shipped,

       toitem_status AS f_status,
       CASE
         WHEN (getPacklistItemLotSerial(shiphead_id, toitem_id) = '') THEN
           ''
         ELSE
           'Serial #/Lot Information:'
       END AS lotserial_title,
       getPacklistItemLotSerial(shiphead_id, toitem_id) AS lotserial,
       '' AS char_title,
       '' AS char_name,
       '' AS char_value
  FROM itemsite, item, toitem, tohead, shipitem, shiphead, uom
 WHERE ((toitem_item_id=item_id)
   AND  (item_inv_uom_id=uom_id)
   AND  (item_id=itemsite_item_id)
   AND  (toitem_tohead_id=tohead_id)
   AND  (toitem_status &lt;> 'X')
   AND  (tohead_src_warehous_id=itemsite_warehous_id)
   AND  (toitem_id=shipitem_orderitem_id)
   AND  (shipitem_shiphead_id=shiphead_id)
   AND  (shiphead_order_type='TO')
   AND  (shiphead_id=&lt;? value("shiphead_id") ?>)
)
&lt;? endif ?>
ORDER BY sortline, sortsubline;</sql>
 </querysource>
 <querysource>
  <name>logo</name>
  <sql>SELECT image_data 
FROM image 
WHERE ((image_name='logo'));</sql>
 </querysource>
 <querysource>
  <name>so_ra_relation</name>
  <sql>--added in 2.3 to show RA link to S/O if the SO
--was created as the result of a replacement RA
&lt;? if exists("EnableReturnAuth") ?>
select 
'RA #' AS ratext,
rahead_number
from
rahead, cohead, shiphead
where 
rahead_new_cohead_id = cohead_id
and cohead_id = shiphead_order_id
and shiphead_id = &lt;? value("shiphead_id") ?>;
&lt;? else ?>
select 
'' AS ratext,
'' AS rahead_number
&lt;? endif ?></sql>
 </querysource>
 <rpthead>
  <height>463</height>
  <image>
   <rect>
    <x>375</x>
    <y>0</y>
    <width>425</width>
    <height>100</height>
   </rect>
   <mode>stretch</mode>
   <data>
    <query>logo</query>
    <column>image_data</column>
   </data>
  </image>
  <field>
   <rect>
    <x>170</x>
    <y>112</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>ordernumber</column>
   </data>
  </field>
  <label>
   <rect>
    <x>10</x>
    <y>10</y>
    <width>355</width>
    <height>50</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>20</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Shipment Packing List</string>
  </label>
  <label>
   <rect>
    <x>85</x>
    <y>440</y>
    <width>200</width>
    <height>15</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item Description</string>
  </label>
  <label>
   <rect>
    <x>10</x>
    <y>85</y>
    <width>150</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Shipment #:</string>
  </label>
  <label>
   <rect>
    <x>525</x>
    <y>425</y>
    <width>75</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>Verified</string>
  </label>
  <field>
   <rect>
    <x>170</x>
    <y>175</y>
    <width>170</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cust_number</column>
   </data>
  </field>
  <barcode>
   <rect>
    <x>375</x>
    <y>202</y>
    <width>307</width>
    <height>25</height>
   </rect>
   <format>3of9</format>
   <maxlength>20</maxlength>
   <left/>
   <narrowBarWidth>0.01</narrowBarWidth>
   <data>
    <query>head</query>
    <column>cohead_custponumber</column>
   </data>
  </barcode>
  <label>
   <rect>
    <x>375</x>
    <y>400</y>
    <width>75</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>12</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Terms:</string>
  </label>
  <field>
   <rect>
    <x>480</x>
    <y>285</y>
    <width>300</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>shiptoname</column>
   </data>
  </field>
  <line>
   <xstart>0</xstart>
   <ystart>425</ystart>
   <xend>797</xend>
   <yend>425</yend>
   <weight>0</weight>
  </line>
  <label>
   <rect>
    <x>10</x>
    <y>202</y>
    <width>150</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Customer P/O #:</string>
  </label>
  <label>
   <rect>
    <x>10</x>
    <y>252</y>
    <width>150</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Sched. Date:</string>
  </label>
  <label>
   <rect>
    <x>10</x>
    <y>231</y>
    <width>150</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Order Date:</string>
  </label>
  <label>
   <rect>
    <x>25</x>
    <y>400</y>
    <width>95</width>
    <height>25</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>12</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <string>Attention:</string>
  </label>
  <barcode>
   <rect>
    <x>375</x>
    <y>175</y>
    <width>177</width>
    <height>25</height>
   </rect>
   <format>3of9</format>
   <maxlength>10</maxlength>
   <left/>
   <narrowBarWidth>0.01</narrowBarWidth>
   <data>
    <query>head</query>
    <column>cust_number</column>
   </data>
  </barcode>
  <field>
   <rect>
    <x>170</x>
    <y>85</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>shiphead_number</column>
   </data>
  </field>
  <field>
   <rect>
    <x>10</x>
    <y>145</y>
    <width>150</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>so_ra_relation</query>
    <column>ratext</column>
   </data>
  </field>
  <field>
   <rect>
    <x>10</x>
    <y>112</y>
    <width>150</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>ordertype</column>
   </data>
  </field>
  <label>
   <rect>
    <x>295</x>
    <y>425</y>
    <width>40</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <hcenter/>
   <vcenter/>
   <string>UOM</string>
  </label>
  <text>
   <rect>
    <x>480</x>
    <y>305</y>
    <width>300</width>
    <height>15</height>
   </rect>
   <bottompad>10</bottompad>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>shipping_address</column>
   </data>
  </text>
  <label>
   <rect>
    <x>10</x>
    <y>285</y>
    <width>75</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Bill To:</string>
  </label>
  <field>
   <rect>
    <x>480</x>
    <y>252</y>
    <width>300</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>shipvia</column>
   </data>
  </field>
  <field>
   <rect>
    <x>455</x>
    <y>400</y>
    <width>320</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>12</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>terms_descrip</column>
   </data>
  </field>
  <field>
   <rect>
    <x>170</x>
    <y>231</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>orderdate</column>
   </data>
  </field>
  <field>
   <rect>
    <x>170</x>
    <y>202</y>
    <width>170</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>cohead_custponumber</column>
   </data>
  </field>
  <line>
   <xstart>0</xstart>
   <ystart>455</ystart>
   <xend>797</xend>
   <yend>455</yend>
   <weight>0</weight>
  </line>
  <label>
   <rect>
    <x>375</x>
    <y>252</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Ship Via:</string>
  </label>
  <label>
   <rect>
    <x>5</x>
    <y>425</y>
    <width>75</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Order Line</string>
  </label>
  <label>
   <rect>
    <x>345</x>
    <y>425</y>
    <width>80</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Ordered</string>
  </label>
  <barcode>
   <rect>
    <x>375</x>
    <y>112</y>
    <width>231</width>
    <height>25</height>
   </rect>
   <format>128</format>
   <maxlength>10</maxlength>
   <left/>
   <narrowBarWidth>0.01</narrowBarWidth>
   <data>
    <query>head</query>
    <column>order_barcode</column>
   </data>
  </barcode>
  <field>
   <rect>
    <x>90</x>
    <y>285</y>
    <width>300</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>head</query>
    <column>billtoname</column>
   </data>
  </field>
  <field>
   <rect>
    <x>170</x>
    <y>252</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>scheddate</query>
    <column>scheddate</column>
   </data>
  </field>
  <label>
   <rect>
    <x>432</x>
    <y>425</y>
    <width>80</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <right/>
   <vcenter/>
   <string>Shipped</string>
  </label>
  <label>
   <rect>
    <x>85</x>
    <y>425</y>
    <width>200</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Item Number</string>
  </label>
  <field>
   <rect>
    <x>170</x>
    <y>145</y>
    <width>170</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <data>
    <query>so_ra_relation</query>
    <column>rahead_number</column>
   </data>
  </field>
  <label>
   <rect>
    <x>375</x>
    <y>285</y>
    <width>100</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Ship To:</string>
  </label>
  <field>
   <rect>
    <x>112</x>
    <y>400</y>
    <width>250</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>12</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>cust_contact</column>
   </data>
  </field>
  <text>
   <rect>
    <x>90</x>
    <y>305</y>
    <width>300</width>
    <height>15</height>
   </rect>
   <bottompad>10</bottompad>
   <font>
    <face>Arial</face>
    <size>10</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>billing_address</column>
   </data>
  </text>
  <label>
   <rect>
    <x>10</x>
    <y>175</y>
    <width>150</width>
    <height>20</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>normal</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Customer #:</string>
  </label>
 </rpthead>
 <section>
  <name>detail</name>
  <group>
   <name>characteristic</name>
   <column>linenumber</column>
   <foot>
    <height>35</height>
    <text>
     <rect>
      <x>130</x>
      <y>5</y>
      <width>195</width>
      <height>17</height>
     </rect>
     <bottompad>14</bottompad>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>char_name</column>
     </data>
    </text>
    <text>
     <rect>
      <x>10</x>
      <y>5</y>
      <width>103</width>
      <height>17</height>
     </rect>
     <bottompad>14</bottompad>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>char_title</column>
     </data>
    </text>
    <text>
     <rect>
      <x>370</x>
      <y>5</y>
      <width>195</width>
      <height>17</height>
     </rect>
     <bottompad>14</bottompad>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>char_value</column>
     </data>
    </text>
   </foot>
  </group>
  <group>
   <name>lotserial</name>
   <column>linenumber</column>
   <foot>
    <height>29</height>
    <text>
     <rect>
      <x>10</x>
      <y>5</y>
      <width>185</width>
      <height>17</height>
     </rect>
     <bottompad>14</bottompad>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>lotserial_title</column>
     </data>
    </text>
    <text>
     <rect>
      <x>228</x>
      <y>5</y>
      <width>550</width>
      <height>17</height>
     </rect>
     <bottompad>14</bottompad>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>lotserial</column>
     </data>
    </text>
   </foot>
  </group>
  <group>
   <name>line</name>
   <column>linenumber</column>
   <foot>
    <height>82</height>
    <label>
     <rect>
      <x>610</x>
      <y>0</y>
      <width>50</width>
      <height>17</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Status:</string>
    </label>
    <field>
     <rect>
      <x>430</x>
      <y>0</y>
      <width>80</width>
      <height>20</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>shipped</column>
     </data>
    </field>
    <text>
     <rect>
      <x>70</x>
      <y>55</y>
      <width>665</width>
      <height>17</height>
     </rect>
     <bottompad>14</bottompad>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>memo</column>
     </data>
    </text>
    <field>
     <rect>
      <x>80</x>
      <y>0</y>
      <width>200</width>
      <height>20</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>11</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>item_number</column>
     </data>
    </field>
    <line>
     <xstart>545</xstart>
     <ystart>15</ystart>
     <xend>595</xend>
     <yend>15</yend>
     <weight>1</weight>
    </line>
    <field>
     <rect>
      <x>290</x>
      <y>0</y>
      <width>40</width>
      <height>20</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <hcenter/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>uom_name</column>
     </data>
    </field>
    <field>
     <rect>
      <x>340</x>
      <y>0</y>
      <width>80</width>
      <height>20</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <right/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>ordered</column>
     </data>
    </field>
    <field>
     <rect>
      <x>80</x>
      <y>35</y>
      <width>300</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>11</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>item_descrip2</column>
     </data>
    </field>
    <field>
     <rect>
      <x>670</x>
      <y>0</y>
      <width>50</width>
      <height>17</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>f_status</column>
     </data>
    </field>
    <barcode>
     <rect>
      <x>415</x>
      <y>20</y>
      <width>380</width>
      <height>30</height>
     </rect>
     <format>128</format>
     <maxlength>15</maxlength>
     <right/>
     <narrowBarWidth>0.01</narrowBarWidth>
     <data>
      <query>detail</query>
      <column>item_barcode</column>
     </data>
    </barcode>
    <field>
     <rect>
      <x>80</x>
      <y>20</y>
      <width>300</width>
      <height>15</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>11</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>item_descrip1</column>
     </data>
    </field>
    <field>
     <rect>
      <x>5</x>
      <y>0</y>
      <width>42</width>
      <height>20</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>11</size>
      <weight>bold</weight>
     </font>
     <left/>
     <vcenter/>
     <data>
      <query>detail</query>
      <column>linenumber</column>
     </data>
    </field>
    <label>
     <rect>
      <x>10</x>
      <y>55</y>
      <width>55</width>
      <height>17</height>
     </rect>
     <font>
      <face>Arial</face>
      <size>10</size>
      <weight>normal</weight>
     </font>
     <left/>
     <vcenter/>
     <string>Notes:</string>
    </label>
   </foot>
  </group>
  <detail>
   <key>
    <query>detail</query>
   </key>
   <height>9</height>
  </detail>
 </section>
 <section>
  <name>packlist</name>
  <detail>
   <key>
    <query>head</query>
   </key>
   <height>41</height>
   <text>
    <rect>
     <x>5</x>
     <y>10</y>
     <width>625</width>
     <height>17</height>
    </rect>
    <bottompad>14</bottompad>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>head</query>
     <column>shipcomments</column>
    </data>
   </text>
   <line>
    <xstart>5</xstart>
    <ystart>5</ystart>
    <xend>842</xend>
    <yend>5</yend>
    <weight>0</weight>
   </line>
  </detail>
 </section>
 <pgfoot>
  <height>57</height>
  <field>
   <rect>
    <x>455</x>
    <y>7</y>
    <width>80</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>ordernumber</column>
   </data>
  </field>
  <label>
   <rect>
    <x>695</x>
    <y>5</y>
    <width>37</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <top/>
   <string>Page:</string>
  </label>
  <label>
   <rect>
    <x>25</x>
    <y>5</y>
    <width>61</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <right/>
   <top/>
   <string>Print Date: </string>
  </label>
  <field>
   <rect>
    <x>735</x>
    <y>5</y>
    <width>45</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Context Query</query>
    <column>page_number</column>
   </data>
  </field>
  <field>
   <rect>
    <x>90</x>
    <y>5</y>
    <width>95</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>Context Query</query>
    <column>report_date</column>
   </data>
  </field>
  <field>
   <rect>
    <x>365</x>
    <y>7</y>
    <width>80</width>
    <height>17</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>8</size>
    <weight>normal</weight>
   </font>
   <left/>
   <top/>
   <data>
    <query>head</query>
    <column>ordertype</column>
   </data>
  </field>
 </pgfoot>
 <rptfoot>
  <height>94</height>
  <label>
   <rect>
    <x>10</x>
    <y>45</y>
    <width>160</width>
    <height>35</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Completed By:</string>
  </label>
  <line>
   <xstart>540</xstart>
   <ystart>70</ystart>
   <xend>790</xend>
   <yend>70</yend>
   <weight>0</weight>
  </line>
  <label>
   <rect>
    <x>415</x>
    <y>45</y>
    <width>165</width>
    <height>30</height>
   </rect>
   <font>
    <face>Arial</face>
    <size>14</size>
    <weight>bold</weight>
   </font>
   <left/>
   <vcenter/>
   <string>Checked By:</string>
  </label>
  <line>
   <xstart>160</xstart>
   <ystart>70</ystart>
   <xend>407</xend>
   <yend>70</yend>
   <weight>0</weight>
  </line>
 </rptfoot>
</report>
