Currency : financial ledger can be set to a specific currency

This commit is contained in:
Dany De Bontridder 2018-10-20 14:05:13 +02:00
parent 765a62b2f3
commit 7eb4644cf0
4 changed files with 91 additions and 18 deletions

View file

@ -19,4 +19,12 @@ EXCEPTION WHEN others THEN
RETURN FALSE;
END;
$$
LANGUAGE plpgsql;
LANGUAGE plpgsql;
ALTER TABLE public.jrn_def ADD currency_id int NULL;
ALTER TABLE public.jrn_def ALTER COLUMN currency_id SET DEFAULT 0;
update public.jrn_def set currency_id = 0 ;
ALTER TABLE public.jrn_def ALTER COLUMN currency_id SET NOT NULL;
ALTER TABLE public.jrn_def ADD CONSTRAINT jrn_def_currency_fk FOREIGN KEY (currency_id) REFERENCES public.currency(id);
COMMENT ON COLUMN public.jrn_def.currency_id IS 'Default currency for financial ledger';