[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 101/238: Currency : SQL quant_fin is adapted
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 101/238: Currency : SQL quant_fin is adapted |
Date: |
Sat, 26 Oct 2019 04:40:43 -0400 (EDT) |
sparkyx pushed a commit to annotated tag rel7110
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] 176/238: Mantis #1626: AFFICHAGE BALANCE FICHE - soldes nuls au débit, (continued)
- [Noalyss-commit] [noalyss] 176/238: Mantis #1626: AFFICHAGE BALANCE FICHE - soldes nuls au débit, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 192/238: Mantis #0001618: Journaux - choix du type en premier, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 195/238: mantis #1690: Bug : impossible d'utiliser < dans Inplace_Edit Replace strip_tags , add a space before the "<", Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 228/238: Bug with p_jrn, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 223/238: Task #0001703: Faciliter effacement montants dans les filtres, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 234/238: fixup! Printtva , under some circumstance tva_summary::check fails, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 201/238: Merge branch 'dev7109' into entreprise, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 93/238: translate, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 98/238: Fin currency : detail operation show currency , rate and amount, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 104/238: Reverse for Currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 101/238: Currency : SQL quant_fin is adapted,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 100/238: Currency : financial use the rate depending of the operation date, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 108/238: acc_ledger_fin . translation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 99/238: Modify quant_fin , we add a column j_id to have a fk to jrnx and operation_currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 109/238: Indentation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 116/238: Database upgrade 131, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 111/238: Currency : sales in listing mode, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 115/238: Currency : ledger printing for FIN + detail operation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 127/238: Merge commit '3f53de417dd89e9a90a386404f93f8648155e046' into r700-currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 118/238: Currency : export CSV history for card and accounting, fix bug with unneeded oc_vat_amount + add the currency rate, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 114/238: Currency : purchase oneline + extended html and csv, Dany De Bontridder, 2019/10/26