CREATE OR REPLACE FUNCTION core.get_currency_code_by_office_id(office_id integer) RETURNS text LANGUAGE plpgsql STABLE AS $function$ BEGIN RETURN office.offices.currency_code FROM office.offices WHERE office.offices.office_id=$1; END $function$