phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4233 - phpcompta/trunk/sql


From: phpcompta-dev
Subject: [Phpcompta-dev] r4233 - phpcompta/trunk/sql
Date: Wed, 26 Oct 2011 00:17:50 +0200 (CEST)

Author: danydb
Date: 2011-10-26 00:17:49 +0200 (Wed, 26 Oct 2011)
New Revision: 4233

Modified:
   phpcompta/trunk/sql/account_compute.sql
   phpcompta/trunk/sql/account_insert.sql
Log:
Fix bug with alphanum. accounting

Modified: phpcompta/trunk/sql/account_compute.sql
===================================================================
--- phpcompta/trunk/sql/account_compute.sql     2011-10-25 21:03:53 UTC (rev 
4232)
+++ phpcompta/trunk/sql/account_compute.sql     2011-10-25 22:17:49 UTC (rev 
4233)
@@ -10,6 +10,7 @@
        maxcode numeric;
        sResult account_type;
        bAlphanum bool;
+       sName text;
 begin
        select fd_class_base into class_base
        from

Modified: phpcompta/trunk/sql/account_insert.sql
===================================================================
--- phpcompta/trunk/sql/account_insert.sql      2011-10-25 21:03:53 UTC (rev 
4232)
+++ phpcompta/trunk/sql/account_insert.sql      2011-10-25 22:17:49 UTC (rev 
4233)
@@ -8,7 +8,7 @@
 declare
        nParent tmp_pcmn.pcm_val_parent%type;
        sName varchar;
-       nNew tmp_pcmn.pcm_val%type;
+       sNew tmp_pcmn.pcm_val%type;
        bAuto bool;
        nFd_id integer;
        sClass_Base fiche_def.fd_class_base%TYPE;
@@ -54,34 +54,30 @@
        else
        raise info 'p_account is  empty';
                select fd_id into nFd_id from fiche where f_id=p_f_id;
-
                bAuto:= account_auto(nFd_id);
-               
-       
+
                select fd_class_base into sClass_base from fiche_def where 
fd_id=nFd_id;
-               raise info 'sClass_Base : %',sClass_base;
-               if bAuto = true 
-                 then
+raise info 'sClass_Base : %',sClass_base;
+               if bAuto = true and sClass_base similar to '[[:digit:]]*'  then
                        raise info 'account generated automatically';
-                       nNew:=account_compute(p_f_id);
-                       raise info 'nNew %', nNew;
+                       sNew:=account_compute(p_f_id);
+                       raise info 'sNew %', sNew;
                        select ad_value into sName from
                                fiche_detail
                        where
                                ad_id=1 and f_id=p_f_id;
-                       nParent:=account_parent(nNew);
-                       perform account_add  (nNew,sName);
-                       perform attribut_insert(p_f_id,5,nNew);
+                       nParent:=account_parent(sNew);
+                       perform account_add  (sNew,sName);
+                       perform attribut_insert(p_f_id,5,sNew);
 
                else
-               
                -- if there is an account_base then it is the default
-                     select fd_class_base::account_type into nNew from 
fiche_def join fiche using (fd_id) where f_id=p_f_id;
-                       if nNew is null or length(trim(nNew)) = 0 then
+                     select fd_class_base::account_type into sNew from 
fiche_def join fiche using (fd_id) where f_id=p_f_id;
+                       if sNew is null or length(trim(sNew)) = 0 then
                                raise notice 'count is null';
                                 perform attribut_insert(p_f_id,5,null);
                        else
-                                perform attribut_insert(p_f_id,5,nNew);
+                                perform attribut_insert(p_f_id,5,sNew);
                        end if;
                end if;
        end if;




reply via email to

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