AND invchead_id = invcitem_invchead_id ';
ELSIF pOrderType = 'B' AND (pDisplayType IN ('L','T')) THEN
_qry := 'SELECT taxhist_tax_id as tax_id, tax_code, tax_descrip, taxhist_tax, taxhist_sequence
FROM cobmisc, cobilltax LEFT OUTER JOIN tax ON (taxhist_tax_id=tax_id)
LEFT OUTER JOIN cobill ON (cobill_id=taxhist_parent_id)
AND invchead_id = invcitem_invchead_id ';
ELSIF pOrderType = 'B' AND (pDisplayType IN ('L','T')) THEN
_qry := 'SELECT taxhist_tax_id as tax_id, tax_code, tax_descrip, taxhist_tax, taxhist_sequence
FROM cobmisc, cobilltax LEFT OUTER JOIN tax ON (taxhist_tax_id=tax_id)
LEFT OUTER JOIN cobill ON (cobill_id=taxhist_parent_id)