2 -- short cut to get the line before
5 CREATE OR REPLACE FUNCTION invfifo_cost_before_out(NUMERIC, integer,integer)
10 i_invfifo_qty_before ALIAS FOR $1;
11 i_location_id ALIAS FOR $2;
12 i_itemsite_id ALIAS FOR $3;
15 v_cost_before NUMERIC;
21 COALESCE(invfifo_cost_after,0.0)
27 invfifo_qty_after = i_invfifo_qty_before
29 invdetail_location_id = i_location_id
31 invhist_itemsite_id = i_itemsite_id
37 invfifo_qty_after DESC
40 RETURN COALESCE(v_cost_before,0);
44 LANGUAGE plpgsql VOLATILE
47 ALTER FUNCTION invfifo_cost_before_out(NUMERIC, integer,integer)