initial stock when a new stock code is used

This commit is contained in:
sparkyx 2008-01-18 20:14:05 +00:00
parent 6534f4c092
commit 39c8f73c08
3 changed files with 52 additions and 4 deletions

View file

@ -788,16 +788,21 @@ function InsertStockGoods($p_cn,$p_j_id,$p_good,$p_quant,$p_type)
$Res=ExecSql($p_cn,$sql);
$r=pg_fetch_array($Res,0);
$f_id=$r['f_id'];
$user=new User($p_cn);
$exercice=$user->get_exercice();
if ( $exercice == 0 ) throw Exception ('Annee invalide erreur');
$Res=ExecSql($p_cn,"insert into stock_goods (
j_id,
f_id,
sg_code,
sg_quantity,
sg_type ) values (
sg_type,sg_exercice ) values (
$p_j_id,
$f_id,
'$code_marchandise',
$p_quant, '$p_type')
$p_quant, '$p_type',$exercice)
");
return $Res;
}