diff --git a/include/class_fiche.php b/include/class_fiche.php
index b179073e3..4cb7a5565 100644
--- a/include/class_fiche.php
+++ b/include/class_fiche.php
@@ -539,7 +539,7 @@ class Fiche
$w->label = $attr->ad_text;
$w->name = "av_text" . $attr->ad_id;
- $r.="
" . td($w->label, ' class="input_text" ') . td($w->input()) . td("$msg")."
";
+ $r.="" . td($w->label, ' class="input_text" ') . td($w->input()." $msg")."
";
}
$r.= '';
return $r;
@@ -926,33 +926,6 @@ class Fiche
}
- if ( $id == ATTR_DEF_STOCK )
- {
- $st=$this->cn->count_sql('select * from stock_goods where '.
- " f_id=".$this->id);
- if ( $st == 0 )
- {
- $exercice=$g_user->get_exercice();
- if ( $exercice == 0 ) throw new Exception ('Annee invalide erreur');
-
- $str_stock=sprintf('insert into stock_goods(f_id,sg_quantity,sg_comment,sg_code,sg_type,sg_exercice) '.
- ' values (%d,0,\'%s\',upper(\'%s\'),\'d\',\'%s\')',
- $this->id,
- 'initial',
- sql_string($value),
- $exercice);
-
- $this->cn->exec_sql($str_stock);
- }
- else
- {
- $str_stock=sprintf("update stock_goods set sg_code=upper('%s') where f_id=%d",
- sql_string($value),
- $this->id);
- $this->cn->exec_sql($str_stock);
- }
- }
-
// account
if ($id == ATTR_DEF_ACCOUNT)
{
diff --git a/include/class_fiche_def.php b/include/class_fiche_def.php
index ea8ac2d45..7a4963ed5 100644
--- a/include/class_fiche_def.php
+++ b/include/class_fiche_def.php
@@ -402,7 +402,7 @@ class Fiche_Def
$span_mod=''.$l_line['quick_code']
+ $_REQUEST['fiche'].'&ac='.$_REQUEST['ac'].'">'.$l_line['quick_code']
.' | ';
echo $span_mod.''.h($l_line['vw_name'])." | ";
diff --git a/include/fiche.inc.php b/include/fiche.inc.php
index 6c267ea4a..83ae84dfe 100644
--- a/include/fiche.inc.php
+++ b/include/fiche.inc.php
@@ -304,7 +304,7 @@ if ( isset ( $_GET["action"]) )
if ( $write != 0 )
{
$iselect=new ISelect('move_to');
- $iselect->value=$cn->make_array('select fd_id,fd_label from fiche_def '); //where frd_id='.$fiche->get_fiche_def_ref_id());
+ $iselect->value=$cn->make_array('select fd_id,fd_label from fiche_def order by fd_label'); //where frd_id='.$fiche->get_fiche_def_ref_id());
echo HtmlInput::submit("update_fiche","Mise à jour");
echo HtmlInput::submit("delete" ,"Effacer cette fiche","onclick=\"return confirm('"._('Vous confirmez ?')."');\"");
@@ -401,15 +401,14 @@ if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) )
$fiche_def=new Fiche_Def($cn,$_POST['fiche']);
$fiche_def->Get();
echo ''.$fiche_def->label.'
';
- $url=$_SERVER['REQUEST_URI'];
$fiche=new Fiche($cn,0);
-
- echo '';
@@ -454,7 +453,7 @@ if ( isset ($_POST["add_fiche"]) )
echo '';
$fiche=new Fiche($cn);
$fiche->Save($_REQUEST['fiche']);
- $fiche_def=new Fiche_Def($cn,$_GET['fiche']);
+ $fiche_def=new Fiche_Def($cn,$_REQUEST['fiche']);
$fiche_def->myList();
diff --git a/include/template/stock_histo.php b/include/template/stock_histo.php
index 908a9fee4..a36785b3d 100644
--- a/include/template/stock_histo.php
+++ b/include/template/stock_histo.php
@@ -53,13 +53,13 @@
=$row['cdate']?>
- =$row['sg_code']?>
+ =HtmlInput::card_detail($row['sg_code'],"",' class="line" ')?>
|
=$row['r_name']?>
|
- =HtmlInput::card_detail($row['qcode'],$row['fname'])?>
+ =HtmlInput::card_detail($row['qcode'],$row['fname'],' class="line" ')?>
|
=HtmlInput::detail_op($row['jr_id'],$row['jr_internal'])?>
diff --git a/include/user_common.php b/include/user_common.php
index 4fc709191..b5b1953a3 100644
--- a/include/user_common.php
+++ b/include/user_common.php
@@ -51,6 +51,9 @@ require_once("class_acc_operation.php");
*/
function InsertStockGoods($p_cn, $p_j_id, $p_good, $p_quant, $p_type,$p_depot)
{
+ /**
+ *@todo function insertStockGoods doit être déplacée dans class_stock
+ */
global $g_user;
if ( $g_user->can_write_repo($p_depot) == false )
return false;
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 0d68c0f5f..e85346db2 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -308,6 +308,7 @@ begin
insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,9,'Code stock '||rt_row);
insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,23,'STOCK'||n_fid::text);
update fiche_detail set ad_value='STOCK'||n_fid::text where ad_id=19 and ad_value=rt_row;
+ update stock_goods set sg_code='STOCK'||n_fid::text where sg_code=rt_row;
end loop;
end;
@@ -315,4 +316,8 @@ $body$ language plpgsql;
select migrate_stock();
+select migrate_stock();
+
drop function migrate_stock();
+
+update attr_def set ad_type='card', ad_extra='[sql] fd_id = 500000 ' where ad_id=19;
\ No newline at end of file
|