From 5f33edd1b8ddfa54b437945318a370ff44435847 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 29 Jul 2010 18:20:27 +0000 Subject: [PATCH] Bug : The trigger jrnx_ins does work when the j_qcode is NULL --- html/admin/sql/patch/upgrade84.sql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/html/admin/sql/patch/upgrade84.sql b/html/admin/sql/patch/upgrade84.sql index bd0fb95f3..48a77a1cf 100644 --- a/html/admin/sql/patch/upgrade84.sql +++ b/html/admin/sql/patch/upgrade84.sql @@ -44,6 +44,11 @@ $BODY$ declare n_fid bigint; begin + +if NEW.j_qcode is NULL then + return NEW; +end if; + NEW.j_qcode=trim(upper(NEW.j_qcode)); if length (NEW.j_qcode) = 0 then @@ -51,7 +56,7 @@ if length (NEW.j_qcode) = 0 then else select f_id into n_fid from fiche join jnt_fic_att_value using (f_id) join attr_value using(jft_id) where ad_id=23 and av_text=NEW.j_qcode; if NOT FOUND then - raise exception 'La fiche dont le quick code est % n''existe pas',sCode; + raise exception 'La fiche dont le quick code est % n''existe pas',NEW.j_qcode; end if; end if; return NEW;