1 CREATE OR REPLACE FUNCTION detailedNNQOH(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, location
14 WHERE ( (itemloc_location_id=location_id)
15 AND (NOT location_netable)
16 AND (itemloc_itemsite_id=pItemsiteid) );
18 SELECT SUM(itemloc_qty) INTO _qoh
19 FROM itemloc, location
20 WHERE ( (itemloc_location_id=location_id)
21 AND (NOT location_netable)
22 AND (itemloc_itemsite_id=pItemsiteid) );
25 IF (_qoh IS NULL) THEN