-- Group: timeexpensesheetitem
-- Name:  teitemnext
-- Notes: Find Next Item
-- Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple.
-- See www.xtuple.com/CPAL for the full text of the software license.

SELECT a.teitem_id
FROM te.teitem AS a, te.teitem AS b
WHERE ((a.teitem_tehead_id = b.teitem_tehead_id)
  AND (a.teitem_linenumber > b.teitem_linenumber)
  AND (b.teitem_id=<? value("teitem_id") ?>))
ORDER BY a.teitem_linenumber
LIMIT 1;
