[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 101/218: Currency : SQL quant_fin is adapted
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 101/218: Currency : SQL quant_fin is adapted |
Date: |
Thu, 12 Sep 2019 15:58:48 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
in repository noalyss.
commit 5d16283d952ff00646cee3796ea331dad25b3bcb
Author: Dany De Bontridder <address@hidden>
Date: Wed Nov 28 12:27:16 2018 +0100
Currency : SQL quant_fin is adapted
---
include/sql/patch/upgrade130.sql | 46 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/include/sql/patch/upgrade130.sql b/include/sql/patch/upgrade130.sql
new file mode 100644
index 0000000..cfecdda
--- /dev/null
+++ b/include/sql/patch/upgrade130.sql
@@ -0,0 +1,46 @@
+begin;
+
+CREATE OR REPLACE FUNCTION isnumeric(text) RETURNS BOOLEAN AS $$
+DECLARE x NUMERIC;
+BEGIN
+ x = $1::NUMERIC;
+ RETURN TRUE;
+EXCEPTION WHEN others THEN
+ RETURN FALSE;
+END;
+$$
+STRICT
+LANGUAGE plpgsql IMMUTABLE;
+
+CREATE OR REPLACE FUNCTION isdate(text,text) RETURNS BOOLEAN AS $$
+DECLARE x timestamp;
+BEGIN
+ x := to_date($1,$2);
+ RETURN TRUE;
+EXCEPTION WHEN others THEN
+ RETURN FALSE;
+END;
+$$
+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';
+
+
+alter table quant_fin add j_id bigint;
+
+with j_fin as (
+select jrnx.j_id,quant_fin.qf_id from quant_fin join jrn using (jr_id) join
jrnx on (j_grpt=jr_grpt_id and f_id=qf_other)
+)
+update quant_fin set j_id =j_fin.j_id from j_fin where
j_fin.qf_id=quant_fin.qf_id;
+
+alter table quant_fin add constraint jrnx_j_id_fk foreign key (j_id )
references jrnx(j_id) on delete cascade on update cascade;
+
+
+insert into version (val,v_description) values (131,'Currency : adapt
quant_fin');
+commit;
- [Noalyss-commit] [noalyss] 96/218: Merge branch 'master' into r700-currency, (continued)
- [Noalyss-commit] [noalyss] 96/218: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 73/218: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 74/218: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 76/218: Bug : cannot set group, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 69/218: Create lib for Tabs, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 77/218: Manage_Table : issue with the type select, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 80/218: Improve debug info, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 88/218: FIN : cosmetic : bug due the currency feature in the input there are 2 supplementary rows for total in EUR and CURRENCY. Those rows don't exist for FIN, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 85/218: Currency : financial ledger can be set to a specific currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 102/218: Version DB 131, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 101/218: Currency : SQL quant_fin is adapted,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 103/218: reverse for quant_fin, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 100/218: Currency : financial use the rate depending of the operation date, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 94/218: acc_ledger_fin : cosmetic : input, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 99/218: Modify quant_fin , we add a column j_id to have a fk to jrnx and operation_currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 108/218: acc_ledger_fin . translation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 111/218: Currency : sales in listing mode, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 106/218: Currency : adapt for bank saldo, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 112/218: currency : sale extended html , csv, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 110/218: Currency : All ledger's listing mode , html , csv and pdf, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 119/218: currency : adapt middle of payment, Dany De Bontridder, 2019/09/12