diff --git a/html/user_login.php b/html/user_login.php
index e79c6f0f7..f67553434 100644
--- a/html/user_login.php
+++ b/html/user_login.php
@@ -25,7 +25,7 @@
include_once ("ac_common.php");
require_once('class_database.php');
require_once('class_itext.php');
-html_page_start($_SESSION['g_theme']);
+@html_page_start($_SESSION['g_theme']);
$rep=new Database();
include_once ("class_user.php");
$User=new User($rep);
diff --git a/include/class_html_input.php b/include/class_html_input.php
index 38aff2e49..e93678f8e 100755
--- a/include/class_html_input.php
+++ b/include/class_html_input.php
@@ -643,6 +643,16 @@ class HtmlInput
from stock_repository join user_sec_repository using (r_id)
where
ur_right='W' and p_id=".sql_string($profile).
+ " order by 2" );
+ return $sel;
+ }
+ if ($p_mode == 'R')
+ {
+ $sel->value=$p_cn->make_array("
+ select r_id,r_name
+ from stock_repository join user_sec_repository using (r_id)
+ where
+ p_id=".sql_string($profile).
" order by 2" );
return $sel;
}
diff --git a/include/class_periode.php b/include/class_periode.php
index 19acfeccc..eb3b91c85 100644
--- a/include/class_periode.php
+++ b/include/class_periode.php
@@ -440,18 +440,20 @@ class Periode
*the this->p_id must be set
*\return a string with the date (DD.MM.YYYY)
*/
- public function first_day()
+ public function first_day($p=0)
{
- list($p_start,$p_end)=$this->get_date_limit($this->p_id);
+ if ($p==0) $p=$this->p_id;
+ list($p_start,$p_end)=$this->get_date_limit($p);
return $p_start;
}
/*!\brief return the last day of periode
*the this->p_id must be set
*\return a string with the date (DD.MM.YYYY)
*/
- public function last_day()
+ public function last_day($p=0)
{
- list($p_start,$p_end)=$this->get_date_limit($this->p_id);
+ if ($p==0) $p=$this->p_id;
+ list($p_start,$p_end)=$this->get_date_limit($p);
return $p_end;
}
@@ -500,12 +502,12 @@ class Periode
throw new Exception('Erreur insertion période');
}
}
- if ( $nb_periode==12 && $this->insert('01.12.'.$p_exercice,'31.12.'.$p_exercice,$p_exercice) != 0 )
- {
+ if ( $nb_periode==12 && $this->insert('01.12.'.$p_exercice,'31.12.'.$p_exercice,$p_exercice) != 0 )
+ {
throw new Exception('Erreur insertion période');
}
- if ( $nb_periode==13)
- {
+ if ( $nb_periode==13)
+ {
if ($this->insert('01.12.'.$p_exercice,'30.12.'.$p_exercice,$p_exercice) != 0 ) throw new Exception('Erreur insertion période');
if ($this->insert('31.12.'.$p_exercice,'31.12.'.$p_exercice,$p_exercice) != 0 ) throw new Exception('Erreur insertion période');
}
diff --git a/include/stock_histo.inc.php b/include/stock_histo.inc.php
new file mode 100644
index 000000000..f1980fdd6
--- /dev/null
+++ b/include/stock_histo.inc.php
@@ -0,0 +1,48 @@
+get_exercice();
+ $periode = new Periode($cn);
+ list($periode_start, $periode_end) = $periode->get_limit($exercice);
+
+ $array['wdate_start'] = $periode_start->first_day();
+ $array['wdate_end'] =$periode_end->last_day();
+}
+
+$stock->history($array);
+
+?>
diff --git a/include/template/stock_histo.php b/include/template/stock_histo.php
new file mode 100644
index 000000000..908a9fee4
--- /dev/null
+++ b/include/template/stock_histo.php
@@ -0,0 +1,83 @@
+
+
+ =$nav_bar?>
+
+
+ | =$tb->get_header(0);?> |
+ =$tb->get_header(1);?> |
+ =$tb->get_header(2);?> |
+ =$tb->get_header(3);?> |
+ Opération |
+ =$tb->get_header(4);?> |
+ =$tb->get_header(5);?> |
+ =$tb->get_header(6);?> |
+ =$tb->get_header(7);?> |
+
+
+
+ for ($i=0;$i<$max_row;$i++):
+ $row=Database::fetch_array($res, $i);
+ $class=($i%2==0)?' class="even" ':' class="odd" ';
+ ?>
+ >
+ |
+ =$row['cdate']?>
+ |
+
+ =$row['sg_code']?>
+ |
+
+ =$row['r_name']?>
+ |
+
+ =HtmlInput::card_detail($row['qcode'],$row['fname'])?>
+ |
+
+ =HtmlInput::detail_op($row['jr_id'],$row['jr_internal'])?>
+ |
+
+ =$row['ccomment']?>
+ |
+
+ =nbm($row['j_montant'])?>
+ |
+
+ =nbm($row['sg_quantity'])?>
+ |
+
+ =$row['direction']?>
+ |
+
+ endfor;?>
+
+ =$nav_bar?>
+
\ No newline at end of file
diff --git a/include/template/stock_histo_search.php b/include/template/stock_histo_search.php
new file mode 100644
index 000000000..d270a1ec0
--- /dev/null
+++ b/include/template/stock_histo_search.php
@@ -0,0 +1,70 @@
+
+
+ = HtmlInput::title_box("Recherche", "histo_search_d", "hide")?>
+
+
+
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 9c57e61ee..594da0cc0 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -269,4 +269,21 @@ alter table user_sec_action_profile add constraint user_sec_action_profile_p_id_
ALTER TABLE stock_goods ADD COLUMN r_id bigint;
update stock_goods set r_id=1;
CREATE INDEX fk_stock_good_repository_r_id ON stock_goods (r_id );
-alter table action_gestion drop ag_cal;
\ No newline at end of file
+alter table action_gestion drop ag_cal;
+
+
+update menu_ref set me_file=null where me_code='STOCK';
+
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) values ('STOCK_HISTO','stock_histo.inc.php','Historique stock','Historique des mouvement de stock','ME');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) values ('STOCK_STATE','stock_state.inc.php','Etat des stock','Etat des stock','ME');
+
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) values ('STOCK_HISTO','STOCK',1,10,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) values ('STOCK_STATE','STOCK',1,20,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) values ('STOCK_HISTO','STOCK',2,10,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display) values ('STOCK_STATE','STOCK',2,20,'E');
+
+-- clean stock_goods
+delete from stock_goods where sg_code is null or sg_code='' or sg_code not in (select ad_value from fiche_detail as fd where ad_id=19 and ad_value is not null);
+
+CREATE INDEX fki_jrnx_j_grpt ON jrnx (j_grpt );
+CREATE INDEX fki_jrn_jr_grpt_id ON jrn (jr_grpt_id );
\ No newline at end of file