-- Group: timeexpensesheetitem
-- Name:  nextlinenum
-- Notes: 
-- 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  COALESCE(MAX(teitem_linenumber),0) +1 AS linenumber
FROM te.teitem
WHERE (teitem_tehead_id=<? value("tehead_id") ?>);
