noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 05/05: trim j_qcode


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 05/05: trim j_qcode
Date: Mon, 21 Mar 2016 09:00:42 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit a5796c85536445decbc35bd1d0b5db4ce15a4eef
Author: Dany De Bontridder <address@hidden>
Date:   Sat Mar 19 23:52:05 2016 +0100

    trim j_qcode
---
 include/sql/patch/upgrade123.sql |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/sql/patch/upgrade123.sql b/include/sql/patch/upgrade123.sql
index ef58ff8..9756738 100644
--- a/include/sql/patch/upgrade123.sql
+++ b/include/sql/patch/upgrade123.sql
@@ -15,7 +15,9 @@ if NEW.j_tech_per = -1 then
         raise exception 'PĂ©riode invalide';
 end if;
 
-if trim(coalesce(NEW.j_qcode,'')) = '' then
+NEW.j_qcode=trim(upper(NEW.j_qcode));
+
+if coalesce(NEW.j_qcode,'') = '' then
         -- how many card has this accounting
         select count(*) into nCount from fiche_detail where ad_id=5 and 
ad_value=NEW.j_poste;
         -- only one card is found , then we change the j_qcode by the card
@@ -23,12 +25,12 @@ if trim(coalesce(NEW.j_qcode,'')) = '' then
                 select f_id into n_fid from fiche_detail where ad_id = 5 and 
ad_value=NEW.j_poste;
                 select ad_value into sQcode  from fiche_detail where 
f_id=n_fid and ad_id = 23;
                 NEW.f_id := n_fid;
-                NEW.j_qcode = sQcode;
+                NEW.j_qcode = trim(sQcode);
         end if;
 
 end if;
 
-NEW.j_qcode=trim(upper(NEW.j_qcode));
+
 
 if length (NEW.j_qcode) = 0 then
     NEW.j_qcode=NULL;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]