28 require_once NOALYSS_INCLUDE.
'/database/class_stock_goods_sql.php';
66 $motif =
new IText(
'p_motif', $p_motif);
71 if (
count($idepo->value) == 0)
76 $idepo->selected = $p_depot;
90 $sg_code[
$e]->extra =
"[sql] fd_id = 500000";
91 $sg_code[
$e]->set_attribute(
"typecard", $sg_code[
$e]->
extra);
92 $sg_code[
$e]->set_attribute(
"label",
"label" .
$e);
93 $sg_code[
$e]->value = (isset(${
'sg_code' .
$e})) ? ${
'sg_code' .
$e} :
'';
94 $sg_quantity[
$e] =
new INum(
'sg_quantity' .
$e);
95 $sg_quantity[
$e]->value = (isset(${
'sg_quantity' .
$e})) ? ${
'sg_quantity' .
$e} :
'';
99 $label[
$e]->value = $cn->get_value(
"select vw_name from vw_fiche_attr where quick_code=$1", array($sg_code[
$e]->
value));
103 if ( isset (${
'sg_type'.$e})) {
104 $sg_type[
$e]=(${
'sg_type'.$e}==
'c')?
'OUT':
'IN';
106 if ( isset (${
'f_id'.$e})) {
110 $select_exercice=
new ISelect(
'p_exercice');
111 $select_exercice->value=$cn->make_array(
'select distinct p_exercice,p_exercice from parm_periode order by 1 desc');
113 require_once NOALYSS_TEMPLATE.
'/stock_inv.php';
122 throw new Exception(
'Date invalide');
125 $ch->setp(
"c_comment",
$p_array[
'p_motif']);
126 $ch->setp(
"r_id",
$p_array[
'p_depot']);
127 $ch->setp(
"c_date",
$p_array[
'p_date']);
128 $ch->setp(
'tech_user', $_SESSION[
'g_user']);
134 for ($i = 0; $i <
$nb; $i++)
137 if (
$p_array[
'sg_quantity' . $i] != 0 &&
146 $count=$cn->get_value(
'select count(*) from fiche_detail where ad_id=$1 and ad_value=$2',
149 throw new Exception(_(
"Code stock inutilisé").
h(
$stock));
153 $a->sg_quantity = abs(
$p_array[
'sg_quantity' . $i]);
154 $a->sg_type = (
$p_array[
'sg_quantity' . $i] > 0) ?
'd' :
'c';
156 $a->tech_user = $_SESSION[
'g_user'];
159 $a->c_id = $ch->c_id;
166 catch (Exception $exc)
168 error_log( $exc->getTraceAsString());
169 echo $exc->getMessage();
183 if ($g_user->can_write_repo(
$repo) ==
false)
188 $code->get_by_qcode($goods);
190 if ($code_marchandise ==
NOTFOUND || $code_marchandise==
'')
196 throw new Exception(
'Annee invalide erreur');
198 $Res = $p_cn->exec_sql(
"insert into stock_goods (
203 sg_type,sg_exercice,r_id ) values ($1,$2,$3,$4,$5,$6,$7)", array(
227 throw new Exception(_(
'Inventaire invalide'), 10);
229 throw new Exception(_(
'Dépôt invalide'), 20);
233 $periode->p_id=$cn->get_value(
"select min(p_id) from parm_periode where p_exercice=$1", array(
$year));
245 $periode->p_id=$cn->get_value(
"select min(p_id) from parm_periode where p_exercice=$1", array($next_year));
253 $array[
'p_motif']=_(
'Inventaire ').$year;
257 select sg_code,sum(coalesce(s_qin,0)-coalesce(s_qout,0)) tot_
258 from tmp_stockgood_detail
262 array($rowid,$depot));
NoAccess($js=1)
Echo no access and stop.
input($p_array=null, $p_readonly=false)
if an array if receive the keys are p_date p_depot f_idX f_id sg_codeX sg_type0
take_last_inventory($p_array)
Return an array, used by Stock_Goods::input.
For the periode tables parm_periode and jrn_periode.
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
global $g_user
Find the default module or the first one.
count($p_where="", $p_array=null)
function trim(s)
remove trailing and heading space
h($p_string)
to protect again bad characters which can lead to a cross scripting attack the string to be diplayed ...
Input HTML for the card show buttons, in the file, you have to add card.js How to use : ...
static insert_goods(&$p_cn, $p_array)
Insert into stock_goods from ACH and VEN.
if(isset($_REQUEST['gDossier'])&&$_REQUEST['gDossier']<>0) $repo
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
This class handles only the numeric input, the input will call a javascript to change comma to period...