-CREATE OR REPLACE FUNCTION itemCost(INTEGER) RETURNS NUMERIC STABLE AS $$
--- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
+CREATE OR REPLACE FUNCTION itemCost(pItemid INTEGER,
+ pCustid INTEGER,
+ pShiptoid INTEGER,
+ pQty NUMERIC,
+ pQtyUOM INTEGER,
+ pPriceUOM INTEGER,
+ pCurrid INTEGER,
+ pEffective DATE,
+ pAsOf DATE,
+ pSiteid INTEGER) RETURNS NUMERIC STABLE AS $$
+-- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
+-- See www.xtuple.com/CPAL for the full text of the software license.
+--
+-- Overload for future costing enhancements
+--
+DECLARE
+ _cost NUMERIC := 0.0;
+BEGIN
+ SELECT itemcost(itemsite_id) INTO _cost
+ FROM itemsite
+ WHERE (itemsite_item_id=pItemid)
+ AND (itemsite_warehous_id=pSiteid);
+
+ RETURN _cost;
+END;
+$$ LANGUAGE 'plpgsql';
+
+CREATE OR REPLACE FUNCTION itemCost(pItemsiteid INTEGER) RETURNS NUMERIC STABLE AS $$
+-- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.