1 CREATE OR REPLACE FUNCTION detailedQOH(pItemsiteid INTEGER,
2 pABS BOOLEAN) RETURNS NUMERIC AS $$
3 -- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
4 -- See www.xtuple.com/CPAL for the full text of the software license.
11 SELECT SUM(noNeg(itemloc_qty)) INTO _qoh
13 WHERE (itemloc_itemsite_id=pItemsiteid);
15 SELECT SUM(itemloc_qty) INTO _qoh
17 WHERE (itemloc_itemsite_id=pItemsiteid);
20 IF (_qoh IS NULL) THEN