summaryrefslogtreecommitdiff
path: root/sql/modules/Defaults.sql
blob: 9f92b06ebbf8ed9de28f7a921b26e3ce364c9bb6 (plain)
  1. -- Probably want to move this to the Settings module -CT
  2. CREATE OR REPLACE FUNCTION defaults_get_defaultcurrency()
  3. RETURNS SETOF char(3) AS
  4. $$
  5. DECLARE defaultcurrency defaults.value%TYPE;
  6. BEGIN
  7. SELECT INTO defaultcurrency substr(value,1,3)
  8. FROM defaults
  9. WHERE setting_key = 'curr';
  10. RETURN NEXT defaultcurrency;
  11. END;
  12. $$ language plpgsql;
  13. COMMENT ON FUNCTION defaults_get_defaultcurrency() IS
  14. $$ This function return the default currency asigned by the program. $$;