34require_once NOALYSS_INCLUDE.
'/database/stock_goods_sql.class.php';
72 $motif =
new IText(
'p_motif', $p_motif);
77 if (empty($idepo->value) )
82 $idepo->selected = $p_depot;
96 $sg_code[
$e]->extra =
"[sql] fd_id = 500000";
97 $sg_code[
$e]->set_attribute(
"typecard", $sg_code[
$e]->
extra);
98 $sg_code[
$e]->set_attribute(
"label",
"label" .
$e);
99 $sg_code[
$e]->value = (isset(${
'sg_code' .
$e})) ? ${
'sg_code' .
$e} :
'';
100 $sg_quantity[
$e] =
new INum(
'sg_quantity' .
$e);
101 $sg_quantity[
$e]->value = (isset(${
'sg_quantity' .
$e})) ? ${
'sg_quantity' .
$e} :
'';
103 $label[
$e]->style=
"vertical-align:top;";
104 if (trim($sg_code[
$e]->
value) !=
'')
106 $label[
$e]->value =
$cn->get_value(
"select vw_name from vw_fiche_attr where quick_code=$1", array($sg_code[
$e]->
value));
110 if ( isset (${
'sg_type'.$e})) {
111 $sg_type[
$e]=(${
'sg_type'.$e}==
'c')?
'OUT':
'IN';
113 if ( isset (${
'f_id'.$e})) {
117 $select_exercice=
new ISelect(
'p_exercice');
118 $select_exercice->value=
$cn->make_array(
'select distinct p_exercice,p_exercice from parm_periode order by 1 desc');
120 require_once NOALYSS_TEMPLATE.
'/stock_inv.php';
129 throw new Exception(
'Date invalide');
132 $ch->setp(
"c_comment",
$p_array[
'p_motif']);
133 $ch->setp(
"r_id",
$p_array[
'p_depot']);
134 $ch->setp(
"c_date",
$p_array[
'p_date']);
135 $ch->setp(
'tech_user', $_SESSION[SESSION_KEY.
'g_user']);
153 $count=
$cn->get_value(
'select count(*) from fiche_detail where ad_id=$1 and ad_value=$2',
156 throw new Exception(_(
"Code stock inutilisé").
h(
$stock));
161 $a->sg_type = (
$p_array[
'sg_quantity' .
$i] > 0) ?
'd' :
'c';
163 $a->tech_user = $_SESSION[SESSION_KEY.
'g_user'];
166 $a->c_id = $ch->c_id;
173 catch (Exception $exc)
176 echo $exc->getMessage();
195 $code->get_by_qcode($goods);
197 if ($code_marchandise ==
NOTFOUND || $code_marchandise==
'')
203 throw new Exception(
'Annee invalide erreur');
205 $Res = $p_cn->exec_sql(
"insert into stock_goods (
210 sg_type,sg_exercice,r_id ) values ($1,$2,$3,$4,$5,$6,$7)", array(
234 throw new Exception(_(
'Inventaire invalide'), 10);
236 throw new Exception(_(
'Dépôt invalide'), 20);
240 $periode->p_id=
$cn->get_value(
"select min(p_id) from parm_periode where p_exercice=$1", array(
$year));
252 $periode->p_id=
$cn->get_value(
"select min(p_id) from parm_periode where p_exercice=$1", array($next_year));
260 $array[
'p_motif']=_(
'Inventaire ').$year;
264 select sg_code,sum(coalesce(s_qin,0)-coalesce(s_qout,0)) tot_
265 from tmp_stockgood_detail
269 array($rowid,$depot));
echo_warning($p_string)
warns
record_log($p_message)
Record an error message into the log file of the server.
global $g_user
if no group available , then stop
h( $row[ 'oa_description'])
catch(Exception $e) $exercice
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Input HTML for the card show buttons, in the file, you have to add card.js How to use :
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...
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
For the periode tables parm_periode and jrn_periode.
ORM abstract of the table public.stock_change.
ORM abstract of the table public.stock_goods.
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
static insert_goods(&$p_cn, $p_array)
Insert into stock_goods from ACH and VEN.
take_last_inventory($p_array)
Return an array, used by Stock_Goods::input.
count($p_where="", $p_array=null)
return the number of count in the table corresponding to the where condition
const NOTFOUND(!defined("SYSINFO_DISPLAY"))