DROP FUNCTION IF EXISTS fn_GetRegisterCost;
CREATE FUNCTION fn_GetRegisterCost("RegisterID" UUID)
RETURNS decimal(31, 10) AS
 $$
Begin
	return
	(
		select sum(STO) from AKUZ.T_REGISTER_ITEM where Register = "RegisterID"
	);
END $$
language plpgsql stable;