diff --git a/html/index.php b/html/index.php
index a71fc7705..42e128c9f 100644
--- a/html/index.php
+++ b/html/index.php
@@ -203,7 +203,7 @@ if ( strlen(domaine) > 0 )
echo '
-version 6.7.2.1 - '.$my_domain.'
+version 6.7.2.2 - '.$my_domain.'
diff --git a/include/class_stock.php b/include/class_stock.php
index dd1a8f981..4bd6f3384 100644
--- a/include/class_stock.php
+++ b/include/class_stock.php
@@ -328,8 +328,9 @@ class Stock extends Stock_Sql
sg_type='c'
and j_id is null
and r_id in (select r_id from profile_sec_repository where p_id=$1)
- and sg_date <= to_date($2,'DD.MM.YYYY')
- group by r_id,trim(sg_code),f_id
+ and sg_date >= ( select min(p_start) from parm_periode where p_exercice=$2)
+ and sg_date <= ( select max(p_end) from parm_periode where p_exercice=$2)
+ group by r_id,trim(sg_code),f_id
";
$cn->exec_sql($sql_repo_detail, array($g_user->get_profile(), $periode->p_exercice));
return $tmp_id;
diff --git a/include/class_user.php b/include/class_user.php
index db1d19c7d..7c4404878 100644
--- a/include/class_user.php
+++ b/include/class_user.php
@@ -799,7 +799,7 @@ class User
$r=array();
if ($p_access=='R')
{
- $r=$this->db->get_array("select u.r_id,r_name
+ $r=$this->db->get_array("select distinct u.r_id,r_name
from
profile_sec_repository as u
join stock_repository as s on(u.r_id=s.r_id)
@@ -811,7 +811,7 @@ class User
}
if ($p_access == 'W')
{
- $r=$this->db->get_array("select u.r_id,r_name
+ $r=$this->db->get_array("select distinct u.r_id,r_name
from
profile_sec_repository as u
join stock_repository as s on(u.r_id=s.r_id)