order_by => "ORDER BY $orderby",
addl_from => 'JOIN cust_main USING (custnum)',
extra_sql => ' AND ' . $curuser->agentnums_sql,
order_by => "ORDER BY $orderby",
addl_from => 'JOIN cust_main USING (custnum)',
extra_sql => ' AND ' . $curuser->agentnums_sql,