[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 18/33: Bug : currency_id was nullable script
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 18/33: Bug : currency_id was nullable script compatible PSQL 10 |
Date: |
Thu, 11 Nov 2021 06:02:47 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 096cfc4a20cdab91d36dcacd5b4b2860b6d0596e
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Mon Oct 11 18:28:17 2021 +0200
Bug : currency_id was nullable
script compatible PSQL 10
---
include/constant.php | 2 +-
include/sql/patch/upgrade168.sql | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/include/constant.php b/include/constant.php
index 819f8b5..ce5670e 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -116,7 +116,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
if ( ! defined ("SYSINFO_DISPLAY")) {
define ("SYSINFO_DISPLAY",TRUE);
}
-define ("DBVERSION",168);
+define ("DBVERSION",169);
define ("MONO_DATABASE",25);
define ("DBVERSIONREPO",20);
define ('NOTFOUND','--not found--');
diff --git a/include/sql/patch/upgrade168.sql b/include/sql/patch/upgrade168.sql
new file mode 100644
index 0000000..9d884bf
--- /dev/null
+++ b/include/sql/patch/upgrade168.sql
@@ -0,0 +1,34 @@
+begin;
+
+update jrn set currency_id = 0,currency_rate=1,currency_rate_ref = 1 where
currency_id is null or currency_rate is null or currency_rate_ref is null;
+
+
+
+
+CREATE OR REPLACE FUNCTION comptaproc.jrn_currency()
+ RETURNS trigger
+ AS $function$
+begin
+ if new.currency_id is null then
+ new.currency_id := 0;
+ new.currency_rate := 1;
+ new.currency_rate_ref := 1;
+ end if;
+ return new;
+end;
+$function$
+LANGUAGE plpgsql;
+
+create trigger t_jrn_currency before
+insert or update
+ on
+ public.jrn for each row execute procedure comptaproc.jrn_currency();
+
+
+ALTER TABLE public.jrn ALTER COLUMN currency_id SET NOT NULL;
+ALTER TABLE public.jrn ALTER COLUMN currency_rate SET NOT NULL;
+ALTER TABLE public.jrn ALTER COLUMN currency_rate_ref SET NOT NULL;
+
+
+insert into version (val,v_description) values (169,'Fix bug currency_id is
null, from IMPORTBANK');
+commit ;
- [Noalyss-commit] [noalyss] 10/33: For Misc Operation in currency , show the currency amount / row, (continued)
- [Noalyss-commit] [noalyss] 10/33: For Misc Operation in currency , show the currency amount / row, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 11/33: Bug for reversed operation when currency are used, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 03/33: Improve HttpInput::extract , the array is set and not passed anymore, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 05/33: Bug : pour non-assujetti , pas de calcul en devise, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 07/33: Bug for reversed operation when currency are used, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 14/33: Typo, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 13/33: Compute.php it happens that the argument are not numeric, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 16/33: Documentation, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 15/33: Bug #2079 : 0002079: Recherche de carte : guillement ne passe pas, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 21/33: Cosmetic #2082 : OD parfois ajout différence de change, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 18/33: Bug : currency_id was nullable script compatible PSQL 10,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 20/33: Cosmetic #0002080 : NOT-FOUND, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 22/33: Cosmetic #0002081: PRINTTVA : l'export PDF de la TVA, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 23/33: Fix : date before 2000 throws an exception, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 25/33: Improve ACC_LEDGER compute internal ledger code in base 36, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 27/33: Operation ANC : Bug with decimal, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 28/33: Bug #2085: Comptabilité analytique : erreur dans les balances croisées, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 29/33: Task #0002087: Improve COMPTA/MENUFIN/FREC, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 30/33: Task #0002088: Export PDF de ANCBCC, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 17/33: Cosmetic bug : if no rows found , throw a warning, Dany De Bontridder, 2021/11/11
- [Noalyss-commit] [noalyss] 19/33: Task #0002068: Pas de champ recherche dans la liste de fiches, Dany De Bontridder, 2021/11/11