0000635: Historique des changements manuels de stock

This commit is contained in:
Dany De Bontridder 2012-06-18 16:23:36 +00:00
parent bab70ce4ce
commit bebf29e762
2 changed files with 29 additions and 0 deletions

View file

@ -43,3 +43,14 @@ for ($i=0;$i<count($array);$i++)
}
echo $st->input($p_array,true);
?>
<form method="POST">
<?=HtmlInput::hidden('c_id',$_GET['c_id']);?>
<p>
<? $ck=new ICheckBox("ok"," 1");
$ck->label= "Cochez pour confirmer effacement ";
echo $ck->input();?>
</p>
<?=HtmlInput::submit("del", "Effacer");?>
<?=HtmlInput::button_close($_GET['ctl'])?>
<?=HtmlInput::hidden('r_id',$p_array['p_depot'])?>
</form>

View file

@ -25,6 +25,24 @@
* @brief history of manuel change
*
*/
if ( isset($_POST['del']))
{
if (isset($_POST['ok']))
{
if ($g_user->can_write_repo($_POST['r_id']))
{
$cn->exec_sql('delete from stock_change where c_id=$1',array($_POST['c_id']));
}
else
{
alert("Vous ne pouvez pas modifier ce dépôt");
}
}
else
{
alert("Opération non effacée: vous n'avez pas confirmé");
}
}
$profile=$g_user->get_profile();
$a_change=$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_date from stock_change as sc
join stock_repository as sr on (sc.r_id=sr.r_id)