"; $l_sessid=(isset($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID']; $r.=""; $r.=" Date "; $r.=" Echéance "; $r.=" Description"; $r.=" Montant "; $r.="Op. Concernée"; $r.=""; for ($i=0; $i < $Max;$i++) { $row=pg_fetch_array($Res,$i); if ( $i % 2 == 0 ) $tr=''; else $tr=''; $r.=$tr; // date $r.=""; $r.=$row['jr_date']; $r.=""; // echeance $r.=""; $r.=$row['jr_ech']; $r.=""; // comment $r.=""; $r.=sprintf(' %s', "Détail",$row['jr_grpt_id'],$l_sessid,$row['jr_comment']); $r.=""; $r.=""; // Amount $r.=""; $r.=$row['jr_montant']; $r.=""; // Rapt $r.=""; $r.=''; $r.=$row['jr_rapt']; $r.=""; $r.=""; // TODO Add print if ( isCentralize($p_cn,$row['jr_id']) == 0 ) { $r.=sprintf('', "Annulation",$row['jr_grpt_id'],$l_sessid); } // end row $r.=""; } $r.=""; return $r; } /* function InsertStockGoods($p_cn,$j_id,$a_good[$i],$a_quant[$i],'c'); ************************************************** * Purpose : Insert data into stock_goods, * * parm : * - $p_cn database connection * - $p_j_id the j_id * - $p_goods the goods * - $p_quant quantity * - $p_type c for credit or d for debit * gen : * - none * return: * none */ function InsertStockGoods($p_cn,$p_j_id,$p_good,$p_quant,$p_type) { $Res=ExecSql($p_cn,"insert into stock_goods ( j_id, f_id, sg_quantity, sg_type ) values ( $p_j_id, $p_good, $p_quant, '$p_type') "); } /* function withStock($p_cn,$p_f_id) ************************************************** * Purpose : return true if we manage stock for it * value is stored in attr_value * * parm : * - $p_cn database connection * - $p_f_id fiche.f_id * gen : * - none * return: * none */ function withStock($p_cn,$p_f_id) { $a=getFicheAttribut($p_cn,$p_f_id, ATTR_DEF_STOCK); if ( $a == "1" ) return true; return false; } /* function VerifyDate ($p_cn,$p_user,$p_date) ************************************************** * Purpose : Verify if * the date is a valid date * the date is in the default period * the period is not closed * * parm : * - db connection * - user * - date * gen : * - none * return: * - null if error or date if ok */ function VerifyOperationDate($p_cn,$p_user,$p_date) { // Verify the date if ( isDate($p_date) == null ) { echo_error("Invalid date $p_date"); echo_debug("Invalid date $p_date"); echo ""; return null; } // userPref contient la periode par default $userPref=GetUserPeriode($p_cn,$p_user); list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$userPref); // Date dans la periode active echo_debug ("date start periode $l_date_start date fin periode $l_date_end date demandée $p_date"); if ( cmpDate($p_date,$l_date_start)<0 || cmpDate($p_date,$l_date_end)>0 ) { $msg="Not in the active periode please change your preference"; echo_error($msg); echo_error($msg); echo ""; return null; } // Periode fermée if ( PeriodeClosed ($p_cn,$userPref)=='t' ) { $msg="This periode is closed please change your preference"; echo_error($msg); echo_error($msg); echo ""; return null; } return $p_date; }