Bug #0001245: Type actif - passif pour nouvelle fiche à partir de fiche
Erreur dans PARM_POSTE pour la compta française
This commit is contained in:
parent
8f95aeed5d
commit
0b55332b02
7 changed files with 73 additions and 6 deletions
|
|
@ -113,8 +113,11 @@ class Database extends DatabaseCore
|
|||
}
|
||||
|
||||
/**
|
||||
* \brief loop to apply all the path to a folder or
|
||||
* a template
|
||||
* \brief loop to apply all the path to a folder or a template
|
||||
* Upgrade check if the folder $p_name needs to be upgrade thanks the variable DBVERSION
|
||||
* and run all the SQL script named upgradeX.sql from the folder noalyss/include/sql/patch
|
||||
* until X equal DBVERSION-1
|
||||
*
|
||||
* \param $p_name database name
|
||||
*
|
||||
*/
|
||||
|
|
@ -142,8 +145,7 @@ class Database extends DatabaseCore
|
|||
echo "<li>Patching " . $p_name .
|
||||
" from the version " . $this->get_version() . " to $to ";
|
||||
|
||||
$this->execute_script(NOALYSS_INCLUDE . '/sql/patch/upgrade' . $i . '.sql');
|
||||
echo $succeed;
|
||||
|
||||
|
||||
if (!DEBUG)
|
||||
ob_start();
|
||||
|
|
@ -214,9 +216,17 @@ class Database extends DatabaseCore
|
|||
$country = $this->get_value("select pr_value from parameter where pr_id='MY_COUNTRY'");
|
||||
$this->execute_script(NOALYSS_INCLUDE . "/sql/patch/upgrade61." . $country . ".sql");
|
||||
}
|
||||
/**
|
||||
* Bug in parm_code for FRANCE
|
||||
*/
|
||||
if ($i == 141 ) {
|
||||
$country = $this->get_value("select pr_value from parameter where pr_id='MY_COUNTRY'");
|
||||
$this->execute_script(NOALYSS_INCLUDE . "/sql/patch/upgrade141." . $country . ".sql");
|
||||
}
|
||||
|
||||
if (!DEBUG)
|
||||
ob_end_clean();
|
||||
|
||||
}
|
||||
}
|
||||
echo '</ul>';
|
||||
|
|
|
|||
|
|
@ -330,7 +330,13 @@ class Dossier
|
|||
$cn->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade check if the folder ACCOUNT_REPOSITORY needs to be upgrade thanks the variable DBVERSIONREPO
|
||||
* and run all the SQL script named ac-upgradeX.sql from the folder noalyss/include/sql/patch
|
||||
* until X equal DBVERSIONREPO-1
|
||||
* After it will call the function apply_patch, remove_inexistant_user and clean_orphan_log for each folder
|
||||
*
|
||||
*/
|
||||
static function upgrade()
|
||||
{
|
||||
$rep=new Database();
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
|
|||
if ( ! defined ("SYSINFO_DISPLAY")) {
|
||||
define ("SYSINFO_DISPLAY",TRUE);
|
||||
}
|
||||
define ("DBVERSION",141);
|
||||
define ("DBVERSION",143);
|
||||
define ("MONO_DATABASE",25);
|
||||
define ("DBVERSIONREPO",18);
|
||||
define ('NOTFOUND','--not found--');
|
||||
|
|
|
|||
3
include/sql/patch/upgrade141.BE.sql
Normal file
3
include/sql/patch/upgrade141.BE.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
begin;
|
||||
insert into version (val,v_description) values (142,'Bug dans PARM_POSTE');
|
||||
commit ;
|
||||
5
include/sql/patch/upgrade141.FR.sql
Normal file
5
include/sql/patch/upgrade141.FR.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
begin;
|
||||
update parm_poste set p_type='PAS' where p_value='40';
|
||||
|
||||
insert into version (val,v_description) values (142,'Bug dans PARM_POSTE');
|
||||
commit ;
|
||||
0
include/sql/patch/upgrade141.sql
Normal file
0
include/sql/patch/upgrade141.sql
Normal file
43
include/sql/patch/upgrade142.sql
Normal file
43
include/sql/patch/upgrade142.sql
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
begin;
|
||||
|
||||
CREATE OR REPLACE FUNCTION comptaproc.find_pcm_type(pp_value account_type)
|
||||
RETURNS text
|
||||
AS $function$
|
||||
declare
|
||||
str_type parm_poste.p_type%TYPE;
|
||||
str_value parm_poste.p_type%TYPE;
|
||||
nLength integer;
|
||||
begin
|
||||
str_value:=pp_value;
|
||||
nLength:=length(str_value::text);
|
||||
|
||||
while nLength > 0 loop
|
||||
select p_type into str_type from parm_poste where p_value=str_value;
|
||||
if FOUND then
|
||||
raise info 'Type of %s is %s',str_value,str_type;
|
||||
return str_type;
|
||||
end if;
|
||||
nLength:=nLength-1;
|
||||
str_value:=substring(str_value::text from 1 for nLength)::account_type;
|
||||
end loop;
|
||||
-- Si non trouvé dans PARM_POSTE, prend le type du premier parent trouvé
|
||||
--
|
||||
str_value := pp_value;
|
||||
nLength:=length(str_value::text);
|
||||
str_value:=substring(str_value::text from 1 for nLength)::account_type;
|
||||
while nLength > 0 loop
|
||||
select pcm_type into str_type from tmp_pcmn tp where pcm_val=str_value;
|
||||
if FOUND then
|
||||
raise info 'Type of %s is %s',str_value,str_type;
|
||||
return str_type;
|
||||
end if;
|
||||
nLength:=nLength-1;
|
||||
str_value:=substring(str_value::text from 1 for nLength)::account_type;
|
||||
end loop;
|
||||
-- si ni parent ou parm_poste alors return CON
|
||||
return 'CON';
|
||||
end;
|
||||
$function$
|
||||
LANGUAGE plpgsql;
|
||||
insert into version (val,v_description) values (143,'Corrige function find_pcm_type');
|
||||
commit ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue