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.
8 pItemsiteid ALIAS FOR $1;
15 SELECT SUM(noNeg(itemloc_qty)) INTO _qoh
16 FROM itemloc, location
17 WHERE ( (itemloc_location_id=location_id)
18 AND (NOT location_netable)
19 AND (itemloc_itemsite_id=pItemsiteid) );
21 SELECT SUM(itemloc_qty) INTO _qoh
22 FROM itemloc, location
23 WHERE ( (itemloc_location_id=location_id)
24 AND (NOT location_netable)
25 AND (itemloc_itemsite_id=pItemsiteid) );
28 IF (_qoh IS NULL) THEN