1 CREATE OR REPLACE FUNCTION detailedQOH(INTEGER, BOOLEAN) RETURNS NUMERIC AS '
2 -- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
3 -- See www.xtuple.com/CPAL for the full text of the software license.
5 pItemsiteid ALIAS FOR $1;
12 SELECT SUM(noNeg(itemloc_qty)) INTO _qoh
13 FROM itemloc LEFT OUTER JOIN location ON (itemloc_location_id=location_id)
14 WHERE ( ( (location_id IS NULL) OR (location_netable) )
15 AND (itemloc_itemsite_id=pItemsiteid) );
17 SELECT SUM(itemloc_qty) INTO _qoh
18 FROM itemloc LEFT OUTER JOIN location ON (itemloc_location_id=location_id)
19 WHERE ( ( (location_id IS NULL) OR (location_netable) )
20 AND (itemloc_itemsite_id=pItemsiteid) );
23 IF (_qoh IS NULL) THEN