diff --git a/doc/developper/Doxyfile b/doc/developper/Doxyfile index 0b2500e64..4bcc02b8f 100644 --- a/doc/developper/Doxyfile +++ b/doc/developper/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- PROJECT_NAME = phpcompta PROJECT_NUMBER = 1 -OUTPUT_DIRECTORY = /home/dany/developpement/phpcompta-dev/phpcompta/doc/developper +OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO @@ -24,8 +24,8 @@ ABBREVIATE_BRIEF = "The $name class" \ the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = /home/dany/tmp/doxygen-1.4.6/bin/ +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO @@ -81,7 +81,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = /home/dany/developpement/phpcompta-dev/phpcompta/include /home/dany/developpement/phpcompta-dev/phpcompta/html +INPUT = ../../include ../../html FILE_PATTERNS = *.c \ *.cc \ *.cxx \ @@ -125,7 +125,7 @@ FILE_PATTERNS = *.c \ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = a?.php b?.php ?.php +EXCLUDE_PATTERNS = a?.php b?.php ?.php test*.php EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO @@ -137,7 +137,7 @@ FILTER_SOURCE_FILES = NO # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES -INLINE_SOURCES = NO +INLINE_SOURCES = YES STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES @@ -164,7 +164,7 @@ CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO -TOC_EXPAND = NO +TOC_EXPAND = YES DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO diff --git a/doc/developper/html/ac__common_8php-source.html b/doc/developper/html/ac__common_8php-source.html index dce42e88b..4289b13ad 100644 --- a/doc/developper/html/ac__common_8php-source.html +++ b/doc/developper/html/ac__common_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/ac_common.php Source File +phpcompta: ac_common.php Source File
Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages
+include

ac_common.php

Go to the documentation of this file.
00001 <?
 00002 
 00003 /*
@@ -193,16 +193,16 @@
 00286   if ( $max==0) return null;
 00287   for ($i=0;$i<$max;$i++) {
 00288     $row=pg_fetch_row($a);
-00289     $r[$i]['value']=$row[0];
+00289     $r[$i]['value']=$row[0];
 00290     $r[$i]['label']=$row[1];
 00291   }
 00292   // add a blank item ?
 00293   if ( $p_null == 1 ) {
 00294   for ($i=$max;$i!=0;$i--) {
-00295     $r[$i]['value']=    $r[$i-1]['value'];
+00295     $r[$i]['value']=    $r[$i-1]['value'];
 00296     $r[$i]['label']=    $r[$i-1]['label'];
 00297   }
-00298   $r[0]['value']=-1;
+00298   $r[0]['value']=-1;
 00299   $r[0]['label']=" ";
 00300   } //   if ( $p_null == 1 ) 
 00301 
@@ -244,7 +244,7 @@
 00375   return $p_html;
 00376 }
 00377 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/ac__common_8php.html b/doc/developper/html/ac__common_8php.html index 4ef5f00f6..dab4d6bbb 100644 --- a/doc/developper/html/ac__common_8php.html +++ b/doc/developper/html/ac__common_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/ac_common.php File Reference +phpcompta: ac_common.php File Reference +include

ac_common.php File Reference

common utilities for a lot of procedure, classe More...

@@ -123,7 +123,23 @@ Definition at line 53 References isDate().

-Referenced by VerifData(), and VerifyOperationDate(). +Referenced by VerifData(), and VerifyOperationDate().

00053                                        {
+00054   $l_date=isDate($p_date);
+00055   $l2_date=isDate($p_date_oth);
+00056   if ($l_date == null || $l2_date == null ) {
+00057     echo "erreur date";
+00058     return null;
+00059   }
+00060   $l_adate=explode(".",$l_date);
+00061   $l2_adate=explode(".",$l2_date);
+00062   $l_mkdate=mktime(0,0,0,$l_adate[1],$l_adate[0],$l_adate[2]);
+00063   $l2_mkdate=mktime(0,0,0,$l2_adate[1],$l2_adate[0],$l2_adate[2]);
+00064   // si $p_date > $p_date_oth return > 0
+00065   return $l_mkdate-$l2_mkdate;
+00066 }
+
+

+

@@ -161,7 +177,15 @@ Decode the html for the widegt richtext and remove newline.

Returns:
the html code without new line

-Definition at line 371 of file ac_common.php. +Definition at line 371 of file ac_common.php.

00371                         {
+00372   $p_html=str_replace('%0D','',$p_html);
+00373   $p_html=str_replace('%0A','',$p_html);
+00374   $p_html=urldecode($p_html);
+00375   return $p_html;
+00376 }
+
+

+

@@ -203,7 +227,15 @@ Definition at line 36 References echo_debug().

-Referenced by AddFiche(), AddForm(), AddModele(), DeleteRapt(), ExecSql(), form_verify_input(), FormAchInput(), FormAchView(), FormatString(), FormFin(), FormODS(), FormVenInput(), FormVenteView(), GetFicheJrn(), getPeriodeName(), GetTvaPoste(), Imp(), InsertRapt(), isValid(), Remove(), Document_modele::Save(), save_upload_document(), fiche::update(), UpdateFiche(), UpdateJrn(), UpdateModele(), VerifData(), and VerifyOperationDate(). +Referenced by AddFiche(), AddForm(), AddModele(), DeleteRapt(), ExecSql(), form_verify_input(), FormAchInput(), FormAchView(), FormatString(), FormFin(), FormODS(), FormVenInput(), FormVenteView(), GetFicheJrn(), getPeriodeName(), GetTvaPoste(), Imp(), InsertRapt(), isValid(), Remove(), Document_modele::Save(), save_upload_document(), fiche::update(), UpdateFiche(), UpdateJrn(), UpdateModele(), VerifData(), and VerifyOperationDate().

00036                                   {
+00037         $fdebug=fopen("/tmp/phpcompta_error.log","a+");
+00038         fwrite($fdebug,date("Ymd H:i:s").$p_log."\n");
+00039         fclose($fdebug);
+00040         echo_debug($p_log);
+00041 }
+
+

+

@@ -247,7 +279,12 @@ warns

Definition at line 269 of file ac_common.php.

-Referenced by GetFicheJrn(), and IsFicheOfJrn(). +Referenced by GetFicheJrn(), and IsFicheOfJrn().

00270 {
+00271   echo '<H2 class="info">'.$p_string."</H2>";
+00272 }
+
+

+

@@ -282,7 +319,13 @@ call cmpDate

Definition at line 120 of file ac_common.php.

-References isDate(). +References isDate().

00120                              {
+00121   if ( isDate($p_date)== null) return "null";
+00122   return "'".$p_date."'";
+00123 }
+
+

+

@@ -324,7 +367,21 @@ Definition at line 208 References echo_error().

-Referenced by AddFiche(), AddForm(), AddModele(), action::Confirm(), fiche::CountByDef(), action::Display(), fiche::GetByQCode(), fiche::insert(), InsertJrn(), ListJrn(), RecordFin(), RecordInvoice(), RecordSell(), Remove(), parm_code::Save(), Document_modele::Save(), action::SaveStage2(), ShowActionList(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), fiche::update(), action::Update(), UpdateComment(), UpdateFiche(), UpdateForm(), Own::UpdateRow(), and ViewJrn(). +Referenced by AddFiche(), AddForm(), AddModele(), action::Confirm(), fiche::CountByDef(), action::Display(), fiche::GetByQCode(), fiche::insert(), InsertJrn(), ListJrn(), RecordFin(), RecordInvoice(), RecordSell(), Remove(), parm_code::Save(), Document_modele::Save(), action::SaveStage2(), ShowActionList(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), fiche::update(), action::Update(), UpdateComment(), UpdateFiche(), UpdateForm(), Own::UpdateRow(), and ViewJrn().

00209 {
+00210   if ( !isset ($p_string) ) {
+00211     echo_error("ac_common.php FormatString p_string empty");
+00212     return null;
+00213   }
+00214   $p_string=trim($p_string);
+00215   if (strlen($p_string) == 0 ) return null;
+00216   $p_string=str_replace("\'","'",$p_string);
+00217   $p_string=str_replace("''","'",$p_string);
+00218   $p_string=str_replace("'","\'",$p_string);
+00219   return $p_string;
+00220 }
+
+

+

@@ -377,7 +434,20 @@ Return the period corresponding to the date.

Definition at line 355 of file ac_common.php.

-References $a, and ExecSql(). +References $a, and ExecSql().

00355                                            {
+00356   $R=ExecSql($p_cn,"select p_id from parm_periode where
+00357               p_start <= to_date('$p_date','DD.MM.YYYY')
+00358            and p_end  >= to_date('$p_date','DD.MM.YYYY')
+00359            ");
+00360   if ( pg_NumRows($R) == 0 ) 
+00361     return -1;
+00362   $a=pg_fetch_array($R,0);
+00363 
+00364   return $a['p_id'];
+00365 }
+
+

+

@@ -429,7 +499,18 @@ Definition at line 335 References $a, and ExecSql().

-Referenced by ParseFormula(). +Referenced by ParseFormula().

00335                                             {
+00336   $R=ExecSql($p_cn,"select p_id from parm_periode where
+00337               to_char(p_start,'DD.MM.YYYY') = '01.$p_date'");
+00338   if ( pg_NumRows($R) == 0 ) 
+00339     return -1;
+00340   $a=pg_fetch_array($R,0);
+00341 
+00342   return $a['p_id'];
+00343 }
+
+

+

@@ -486,7 +567,18 @@ Show the periode which found thanks its id.

Definition at line 315 of file ac_common.php.

-References $a, $ret, and echo_error(). +References $a, $ret, and echo_error().

00315                                                     {
+00316   if ( $pos != 'p_start' and 
+00317        $pos != 'p_end')
+00318     echo_error('ac_common.php'."-".__LINE__.'  UNDEFINED PERIODE');
+00319   $ret=execSql($p_cn,"select to_char($pos,'Mon YYYY') as t from parm_periode where p_id=$p_id");
+00320   if (pg_NumRows($ret) == 0) return null;
+00321   $a=pg_fetch_array($ret,0);
+00322   return $a['t'];
+00323 }
+
+

+

@@ -518,7 +610,12 @@ Button logout.

Returns:
nothing

-Definition at line 182 of file ac_common.php. +Definition at line 182 of file ac_common.php.

00182                               {
+00183         echo "<A class=\"mtitle\" HREF=logout.php> Logout </A>";
+00184 }
+
+

+

@@ -575,7 +672,41 @@ Default page header for each page.

Definition at line 133 of file ac_common.php.

-References $cn, $Res, $style, DbConnect(), and ExecSql(). +References $cn, $Res, $style, DbConnect(), and ExecSql().

00134 {       
+00135   include_once ("postgres.php");
+00136  ini_set('magic_quotes_gpc','Off');
+00137 
+00138  $cn=DbConnect();
+00139  if ( $p_theme != "") {
+00140    $Res=ExecSql($cn,"select the_filestyle from theme
+00141                    where the_name='".$p_theme."'");
+00142     if (pg_NumRows($Res)==0) 
+00143       $style="style.css";
+00144     else {
+00145       $s=pg_fetch_array($Res,0);
+00146       $style=$s['the_filestyle'];
+00147     }
+00148  }else {
+00149    $style="style.css";
+00150  } // end if
+00151  echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">';
+00152  echo "<HTML>";
+00153 
+00154  if ( $p_script2 != "" )
+00155    $p_script2='<script src="'.$p_script2.'" type="text/javascript"></script>';
+00156 
+00157  echo "<HEAD> 
+00158       <TITLE>PhpCompta</TITLE>
+00159       <META http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">
+00160       <LINK REL=\"stylesheet\" type=\"text/css\" href=\"$style\" media=\"screen\">
+00161       <link rel=\"stylesheet\" type=\"text/css\" href=\"style-print.css\" media=\"print\">".
+00162    $p_script2. "
+00163         </HEAD><script src=\"scripts.js\" type=\"text/javascript\"></script>";
+00164  echo "<BODY $p_script>";
+00165 }
+
+

+

@@ -606,7 +737,13 @@ end tag

-Definition at line 170 of file ac_common.php. +Definition at line 170 of file ac_common.php.

00171 {
+00172         echo "</BODY>";
+00173         echo "</HTML>";
+00174 }
+
+

+

@@ -652,7 +789,27 @@ Definition at line 97 References echo_debug().

-Referenced by cmpDate(), action::Confirm(), form_verify_input(), formatDate(), ListJrn(), VerifData(), VerifyOperationDate(), and ViewJrn(). +Referenced by cmpDate(), action::Confirm(), form_verify_input(), formatDate(), ListJrn(), VerifData(), VerifyOperationDate(), and ViewJrn().

00097                            {
+00098   if ( strlen (trim($p_date)) == 0 ) return null;
+00099   if (! ereg ("^[0-9]{1,2}\.[0-9]{1,2}\.20[0-9]{2}",$p_date) ) {
+00100 
+00101     return null;
+00102   } else {
+00103     $l_date=explode(".",$p_date);
+00104     if ( $l_date[2] > 2020 ) {
+00105       return null;
+00106     }
+00107     echo_debug('ac_common.php',__LINE__,' date = '.var_export($l_date,true));
+00108     if ( checkdate ($l_date[1],$l_date[0],$l_date[2]) == false) {
+00109       return null;
+00110     }
+00111 
+00112   }// !ereg
+00113   return $p_date;
+00114 }
+
+

+

@@ -694,7 +851,18 @@ check if the argument is a number

Definition at line 76 of file ac_common.php.

-Referenced by AddFiche(), AddModele(), ComputeTotalVat(), ComputeVat(), DeleteRapt(), form_verify_input(), FormAchInput(), FormAchView(), FormODS(), FormVenInput(), FormVenteView(), fiche::insert(), InsertRapt(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Remove(), Document_modele::Save(), and fiche::update(). +Referenced by AddFiche(), AddModele(), ComputeTotalVat(), ComputeVat(), DeleteRapt(), form_verify_input(), FormAchInput(), FormAchView(), FormODS(), FormVenInput(), FormVenteView(), fiche::insert(), InsertRapt(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Remove(), Document_modele::Save(), and fiche::update().

00076                           {
+00077   if ( strlen (trim($p_int)) == 0 ) return 0;
+00078   $p_int=trim($p_int);
+00079   if (! ereg ("^-{0,1}[0-9]+.{0,1}[0-9]*$",$p_int) ) {
+00080     return 0;
+00081   } else {
+00082     return 1;
+00083   }// !ereg
+00084 }
+
+

+

@@ -750,9 +918,33 @@ make a array with the sql

Definition at line 282 of file ac_common.php.

-References $a, $i, $r, $row, label, and value. +References $a, $i, $r, $row, label, and value.

-Referenced by action::Confirm(), action::Display(), Document_modele::form(), FormAchInput(), FormVenInput(), FormVenteView(), and ShowFormTransfert(). +Referenced by action::Confirm(), action::Display(), Document_modele::form(), FormAchInput(), FormVenInput(), FormVenteView(), and ShowFormTransfert().

00282                                             {
+00283 
+00284   $a=pg_exec($p_cn,$p_sql);
+00285   $max=pg_NumRows($a);
+00286   if ( $max==0) return null;
+00287   for ($i=0;$i<$max;$i++) {
+00288     $row=pg_fetch_row($a);
+00289     $r[$i]['value']=$row[0];
+00290     $r[$i]['label']=$row[1];
+00291   }
+00292   // add a blank item ?
+00293   if ( $p_null == 1 ) {
+00294   for ($i=$max;$i!=0;$i--) {
+00295     $r[$i]['value']=    $r[$i-1]['value'];
+00296     $r[$i]['label']=    $r[$i-1]['label'];
+00297   }
+00298   $r[0]['value']=-1;
+00299   $r[0]['label']=" ";
+00300   } //   if ( $p_null == 1 ) 
+00301 
+00302   return $r;
+00303 }
+
+

+

@@ -786,7 +978,18 @@ Echo no access and stop.

Definition at line 192 of file ac_common.php.

-References exit. +References exit.

00192                     {
+00193   echo "<BR><BR><BR><BR><BR><BR>";
+00194   echo "<P ALIGN=center><BLINK>
+00195         <FONT size=+12 COLOR=RED>
+00196         You haven't access
+00197         </FONT></BLINK></P></BODY></HTML>";
+00198                 
+00199   exit -1;
+00200 }
+
+

+

@@ -855,10 +1058,42 @@ Definition at line 228 References $ret.

-Referenced by MenuAdmin(), ShowJrn(), ShowMenuAdvanced(), ShowMenuCompta(), ShowMenuDocument(), and ShowMenuParam(). +Referenced by MenuAdmin(), ShowJrn(), ShowMenuAdvanced(), ShowMenuCompta(), ShowMenuDocument(), and ShowMenuParam().

00229 {
+00230   $ret="<TABLE $p_extra>";
+00231   // direction Vertical
+00232   if ( $p_dir == 'V') {
+00233     foreach ($p_array as $all=>$href){
+00234       $title="";
+00235       if ( isset ($href[2] )) 
+00236         $title=$href[2];
+00237       $ret.='<TR><TD CLASS="'.$class.'"><A class="'.$class_ref.'" HREF="'.$href[0].'" title="'.$title.'">'.$href[1].'</A></TD></TR>';
+00238     }
+00239   }
+00240       //direction Horizontal
+00241   else if ( $p_dir == 'H' ) {
+00242     $ret.="<TR>";
+00243     foreach ($p_array as $all=>$href){
+00244       $title="";
+00245       if ( isset ($href[2] )) 
+00246         $title=$href[2];
+00247       if ( $default== $href[0]) {
+00248       $ret.='<TD CLASS="selectedcell">'.$href[1].'</TD>';
+00249 
+00250       } else {
+00251       $ret.='<TD CLASS="'.$class.'"><A class="'.$class_ref.'" HREF="'.$href[0].'" title="'.$title.'">'.$href[1].'</A></TD>';
+00252       }
+00253     }
+00254     $ret.="</TR>";
+00255   }
+00256     $ret.="</TABLE>";
+00257   return $ret;
+00258 }
+
+

+ -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/action_8inc_8php-source.html b/doc/developper/html/action_8inc_8php-source.html index de47fcc12..000ec1fcd 100644 --- a/doc/developper/html/action_8inc_8php-source.html +++ b/doc/developper/html/action_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/action.inc.php Source File +phpcompta: action.inc.php Source File +include

action.inc.php

Go to the documentation of this file.
00001 <?
 00002 /*
 00003  *   This file is part of PhpCompta.
@@ -34,7 +34,7 @@
 00028 require_once("class_widget.php");
 00029 require_once("class_action.php");
 00030 
-00038 function ShowActionList($cn,$retour,$h_url)
+00038 function ShowActionList($cn,$retour,$h_url)
 00039 {
 00040   // show the search menu
 00041   ?>
@@ -45,297 +45,305 @@
 00046    $a=(isset($_GET['query']))?$_GET['query']:"";
 00047    printf ('<span>Titre ou référence: <input type="text" name="query" value="%s"></span>',
 00048            $a);
-00049    $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
+00049    $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
 00050    echo JS_SEARCH_CARD;
 00051    $w=new widget('js_search_only');
-00052    $w->name='qcode';
+00052    $w->name='qcode_query';
 00053    $w->value=$qcode;
 00054    $w->label='Quick Code';
 00055    $w->extra='4,9,14,16,8';
 00056    $w->table=0;
 00057    $sp= new widget("span");
-00058    echo $sp->IOValue("qcode_label","",$qcode);
-00059    echo $w->IOValue();
-00060 
-00061 
-00062 ?>
-00063 <input type="submit" name="submit_query" value="recherche">
-00064 <input type="hidden" name="sa" value="list">
-00065 <input type="hidden" name="p_action" value="suivi_courrier">
-00066 </form>
-00067 </span>
-00068 
-00069 <?
-00070 ?>
-00071 <form method="get" action="commercial.php">
-00072 <input type="submit" name="submit_query" value="Ajout Action">
-00073 <input type="hidden" name="p_action" value="suivi_courrier">
-00074 <input type="hidden" name="sa" value="add_action">
-00075 <input type="hidden" name="tiers" value=<? echo '"'.$qcode.'"';?>>
-00076    <? // if called from another menu, url is set
-00077    echo $h_url;
-00078    echo $retour; ?>
-00079 </form>
+00058 
+00059    echo $sp->IOValue("qcode_query_label","",$qcode);
+00060    echo $w->IOValue();
+00061 ?>
+00062 <input type="submit" name="submit_query" value="recherche">
+00063 <input type="hidden" name="sa" value="list">
+00064 <input type="hidden" name="p_action" value="suivi_courrier">
+00065 </form>
+00066 </span>
+00067 
+00068 <?
+00069 ?>
+00070 <form method="get" action="commercial.php">
+00071 <input type="submit" name="submit_query" value="Ajout Action">
+00072 <input type="hidden" name="p_action" value="suivi_courrier">
+00073 <input type="hidden" name="sa" value="add_action">
+00074 <input type="hidden" name="tiers" value=<? echo '"'.$qcode_dest.'"';?>>
+00075    <? // if called from another menu, url is set
+00076    echo $h_url;
+00077    echo $retour; ?>
+00078 </form>
+00079 
 00080 
-00081 
-00082 <?
-00083     // show the  action in 
-00084     $act=new action($cn);
-00088    $query="";
-00089 
-00090    if ( isset($_REQUEST['query']) )
-00091    {
-00092 
-00093      // if a query is request build the sql stmt
-00094      $query="and (ag_title ~* '".FormatString($_REQUEST['query'])."' ".
-00095        "or ag_ref ='".trim(FormatString($_REQUEST['query']))."'".
-00096        ")"; 
-00097    }
-00098  
-00099    $str="";
-00100    if ( isset($_GET['qcode'] )) 
-00101      {
-00102 
-00103         // verify that qcode is not empty
-00104         if ( strlen(trim($_REQUEST['qcode'] )) != 0 )
-00105          { 
-00106 
-00107            $fiche=new Fiche($cn);
-00108            $fiche->GetByQCode($_REQUEST['qcode']);
-00109            $str=" and f_id= ".$fiche->id;
-00110          }
-00111      }
-00112 
-00113    $r=$act->myList(ACTION,$query.$str);
-00114    echo $r;
-00115  }
-00116 
-00117 // We need a sub action (3rd level)
-00118   // show a list of already taken action 
-00119   // propose to add one 
-00120   // permit also a search
-00121   // show detail
-00122 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
-00123 
-00124 if ( $sub_action == "" ) $sub_action="list";
-00125 
-00126 // if correction is asked go to directly to add_action
-00127 if (isset($_POST['corr'] )) 
-00128 {
-00129   $ag_comment=urldecode($_POST['ag_comment']);
-00130   $sub_action="add_action";
-00131 }
-00132 // if this page is called from another menu (customer, supplier,...)
-00133 // a button back is added
-00134 // TODO add function for generating url, hidden tags...
-00135 $retour='<A HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
-00136 $h_url="";
-00137 
-00138 if ( isset ($_REQUEST['url'])) 
-00139 {
-00140      $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
-00141      $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
-00142 }
-00143 //----------------------------------------------------------------------
-00144 // Update the detail
-00145 // Add a new action related to this one or update 
-00146 //----------------------------------------------------------------------
-00147 if ( $sub_action=="update" )
-00148 {
-00149   // Update the modification
-00150   if ( isset($_POST['save']))
-00151     {
-00152       $act=new action($cn);
-00153       $act=new action($cn);
-00154       
-00155       $act->ag_id=$_POST['ag_id'];
-00156       $act->ag_comment=$_POST['ag_comment'];
-00157       $act->ag_timestamp=$_POST['ag_timestamp'];
-00158       $act->d_state=$_POST['d_state'];
-00159       $act->dt_id=(isset($_POST['dt_id']))?$_POST['dt_id']:0;
-00160       $act->qcode=$_POST['qcode'];
-00161       $act->ag_title=$_POST['ag_title'];
-00162       $act->d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
-00163       if ( $act->Update() == false ) {
-00164         $sub_action="detail";
-00165       } 
-00166       else 
-00167         {
-00168           ShowActionList($cn,$retour,$h_url);
-00169         }
-00170     }
-00171   //----------------------------------------------------------------------
-00172   // Add a related action 
+00081 <?
+00082     // show the  action in 
+00083     $act=new action($cn);
+00087    $query="";
+00088 
+00089    if ( isset($_REQUEST['query']) )
+00090    {
+00091 
+00092      // if a query is request build the sql stmt
+00093      $query="and (ag_title ~* '".FormatString($_REQUEST['query'])."' ".
+00094        "or ag_ref ='".trim(FormatString($_REQUEST['query']))."'".
+00095        ")"; 
+00096    }
+00097  
+00098    $str="";
+00099    if ( isset($_GET['qcode_query'] )) 
+00100      {
+00101 
+00102         // verify that qcode is not empty
+00103         if ( strlen(trim($_REQUEST['qcode_query'] )) != 0 )
+00104          { 
+00105 
+00106            $fiche=new Fiche($cn);
+00107            $fiche->GetByQCode($_REQUEST['qcode_query']);
+00108            $str=" and (f_id_exp= ".$fiche->id." or ".
+00109              "f_id_dest".$fiche->id.")";
+00110 
+00111          }
+00112      }
+00113 
+00114    $r=$act->myList(ACTION,$query.$str);
+00115    echo $r;
+00116  }
+00117 
+00118 // We need a sub action (3rd level)
+00119   // show a list of already taken action 
+00120   // propose to add one 
+00121   // permit also a search
+00122   // show detail
+00123 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
+00124 
+00125 if ( $sub_action == "" ) $sub_action="list";
+00126 
+00127 // if correction is asked go to directly to add_action
+00128 if (isset($_POST['corr'] )) 
+00129 {
+00130   $ag_comment=urldecode($_POST['ag_comment']);
+00131   $sub_action="add_action";
+00132 }
+00133 // if this page is called from another menu (customer, supplier,...)
+00134 // a button back is added
+00135 // TODO add function for generating url, hidden tags...
+00136 $retour='<A HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
+00137 $h_url="";
+00138 
+00139 if ( isset ($_REQUEST['url'])) 
+00140 {
+00141      $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
+00142      $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
+00143 }
+00144 //----------------------------------------------------------------------
+00145 // Update the detail
+00146 // Add a new action related to this one or update 
+00147 //----------------------------------------------------------------------
+00148 if ( $sub_action=="update" )
+00149 {
+00150   // Update the modification
+00151   if ( isset($_POST['save']))
+00152     {
+00153       $act=new action($cn);
+00154       $act=new action($cn);
+00155       
+00156       $act->ag_id=$_POST['ag_id'];
+00157       $act->ag_comment=$_POST['ag_comment'];
+00158       $act->ag_timestamp=$_POST['ag_timestamp'];
+00159       $act->d_state=$_POST['d_state'];
+00160       $act->dt_id=(isset($_POST['dt_id']))?$_POST['dt_id']:0;
+00161       $act->qcode_exp=$_POST['qcode_exp'];
+00162       $act->qcode_dest=$_POST['qcode_dest'];
+00163       $act->ag_title=$_POST['ag_title'];
+00164       $act->d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
+00165       if ( $act->Update() == false ) {
+00166         $sub_action="detail";
+00167       } 
+00168       else 
+00169         {
+00170           ShowActionList($cn,$retour,$h_url);
+00171         }
+00172     }
 00173   //----------------------------------------------------------------------
-00174 if ( isset ($_POST['add_action_here']) )
-00175 {
-00176       $act=new action($cn);
-00177       $act->ag_ref_ag_id=$_POST['ag_id'];
-00178       
-00179       //----------------------------------------
-00180       // puis comme ajout normal (copier / coller )
-00181       echo $retour;
-00182       $act->ag_id=0;
-00183       $act->ag_ref_ag_id=$_POST['ag_id'];
-00184       $act->ag_timestamp=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
-00185       $act->qcode=isset($_POST['tiers'])?$_REQUEST['tiers']:"";
-00186       $act->d_id=0;
-00187       $act->dt_id=isset($_POST['dt_id'])?$_REQUEST['dt_id']:"";
-00188       $act->d_state=(isset($_POST['d_state']))?$_POST['d_state']:"";
-00189       $act->ag_ref="";
-00190       $act->ag_title=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
-00191       echo '<div class="u_redcontent">';
-00192       echo JS_SEARCH_CARD;
-00193       // Add hidden tag
-00194       echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
-00195       
-00196       $act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
-00197       echo $act->Display('NEW',false);
+00174   // Add a related action 
+00175   //----------------------------------------------------------------------
+00176 if ( isset ($_POST['add_action_here']) )
+00177 {
+00178       $act=new action($cn);
+00179       $act->ag_ref_ag_id=$_POST['ag_id'];
+00180       
+00181       //----------------------------------------
+00182       // puis comme ajout normal (copier / coller )
+00183       echo $retour;
+00184       $act->ag_id=0;
+00185       $act->ag_ref_ag_id=$_POST['ag_id'];
+00186       $act->ag_timestamp=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
+00187       $act->qcode_dest=isset($_POST['tiers'])?$_REQUEST['tiers']:"";
+00188       $act->qcode_exp=isset($_POST['qcode_exp'])?$_REQUEST['qcode_exp']:"";
+00189       $act->d_id=0;
+00190       $act->dt_id=isset($_POST['dt_id'])?$_REQUEST['dt_id']:"";
+00191       $act->d_state=(isset($_POST['d_state']))?$_POST['d_state']:"";
+00192       $act->ag_ref="";
+00193       $act->ag_title=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
+00194       echo '<div class="u_redcontent">';
+00195       echo JS_SEARCH_CARD;
+00196       // Add hidden tag
+00197       echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
 00198       
-00199       echo '<input type="hidden" name="p_action" value="suivi_courrier">';
-00200       echo '<input type="hidden" name="sa" value="save_action_st1">';
+00199       $act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
+00200       echo $act->Display('NEW',false);
 00201       
-00202       echo $h_url;
-00203       echo '<input type="submit" name="save_action_st1" value="Sauver"></p>'.
-00204         '</form>'.
-00205         '</div>';
-00206       
-00207     }
-00208   
-00209   
-00210 }
-00211 //--------------------------------------------------------------------------------
-00212 // Show the detail of an action
-00213 // permit the update
-00214 if ( $sub_action=='detail' )
-00215 {
-00216   echo '<div class="u_redcontent">';
-00217   $act=new action($cn);
-00218   $act->ag_id=$_REQUEST['ag_id'];
-00219   echo $act->get();
-00220   $act->ag_comment=Decode($act->ag_comment);
-00221   echo '<form name="RTEDemo" action="commercial.php"  enctype="multipart/form-data"  method="post"  onsubmit="return submitForm();" >';
-00222   echo JS_SEARCH_CARD;
-00223   echo $act->display('UPD',false);
-00224   echo '<input type="hidden" name="p_action" value="suivi_courrier">';
-00225   echo '<input type="hidden" name="sa" value="update">';
-00226   $upload=new widget("file");
-00227   $upload->name="file_upload";
-00228   $upload->value="";
-00229   echo "Enregistrer le fichier ".$upload->IOValue();
-00230   echo $upload->Submit("save","Sauve");
-00231   echo $upload->Submit("add_action_here","Ajoute une action à celle-ci");
-00232   echo '</form>';
-00234   echo $retour;
-00235   echo '</div>';
-00236 }
-00237 //--------------------------------------------------------------------------------
-00238 // Show a list of the action
-00239 if ( $sub_action == "list" )
-00240      ShowActionList($cn,$retour,$h_url);
-00241        
-00242 //--------------------------------------------------------------------------------
-00243 // Add an action
-00244 if ( $sub_action == "add_action" ) 
-00245 {
-00246   echo $retour;
-00247   $act=new action($cn);
-00248   $act->ag_id=0;
-00249   $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:"0";
-00250   $act->ag_timestamp=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
-00251   $act->qcode=isset($_POST['tiers'])?$_REQUEST['tiers']:"";
-00252   $act->d_id=0;
-00253   $act->dt_id=isset($_POST['dt_id'])?$_REQUEST['dt_id']:"";
-00254   $act->d_state=(isset($_POST['d_state']))?$_POST['d_state']:"";
-00255   $act->ag_ref="";
-00256   $act->ag_title=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
-00257   echo '<div class="u_redcontent">';
-00258   echo JS_SEARCH_CARD;
-00259   // Add hidden tag
-00260   echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
-00261 
-00262   $act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
-00263   echo $act->Display('NEW',false);
-00264 
-00265   echo '<input type="hidden" name="p_action" value="suivi_courrier">';
-00266   echo '<input type="hidden" name="sa" value="save_action_st1">';
-00267 
-00268   echo $h_url;
-00269   echo '<input type="submit" name="save_action_st1" value="Sauver"></p>'.
-00270     '</form>'.
-00271     '</div>';
-00272 
-00273 }
-00274 //--------------------------------------------------------------------------------
-00275 // Save Action
-00276 // Stage 1 : show the result and confirm
-00277 //--------------------------------------------------------------------------------
-00278 if  ( $sub_action == "save_action_st1" ) 
-00279 {
-00280   $act=new action($cn);
-00281   $act->ag_timestamp=$_POST['ag_timestamp'];
-00282   $act->ag_comment=$_POST['ag_comment'];
-00283   $act->ag_timestamp=$_POST['ag_timestamp'];
-00284   $act->d_state=$_POST['d_state'];
-00285   $act->dt_id=$_POST['dt_id'];
-00286   $act->qcode=$_POST['qcode'];
-00287   $act->ag_title=$_POST['ag_title'];
-00288   $act->d_id=0;
-00289   $act->ag_id=$_POST['ag_id'];
-00290   $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0;
-00291       
-00292   echo $act->Confirm();
-00293 }
-00294 //--------------------------------------------------------------------------------
-00295 // Save Action
-00296 // Stage 2 : Save the action and propose to save a file
-00297 //--------------------------------------------------------------------------------
-00298 if  ( $sub_action == "save_action_st2" ) 
-00299 {
-00300   $act=new action($cn);
-00301 
-00302   $act->ag_comment=$_POST['ag_comment'];
-00303   $act->ag_timestamp=$_POST['ag_timestamp'];
-00304   $act->d_state=$_POST['d_state'];
-00305   $act->dt_id=$_POST['dt_id'];
-00306   $act->qcode=$_POST['tiers'];
-00307   $act->ag_title=$_POST['ag_title'];
-00308   $act->d_id=0;
-00309   $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0;
-00310   $act->md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
-00311 
-00312   $act->gen=isset($_POST['p_gen'])?'on':'off';
-00313   // insert into action_gestion
-00314   echo $act->SaveStage2();
-00315   echo '<A HREF="commercial.php?p_action=suivi_courrier"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>';
-00316 }
+00202       echo '<input type="hidden" name="p_action" value="suivi_courrier">';
+00203       echo '<input type="hidden" name="sa" value="save_action_st1">';
+00204       
+00205       echo $h_url;
+00206       echo '<input type="submit" name="save_action_st1" value="Sauver"></p>'.
+00207         '</form>'.
+00208         '</div>';
+00209       
+00210     }
+00211   
+00212   
+00213 }
+00214 //--------------------------------------------------------------------------------
+00215 // Show the detail of an action
+00216 // permit the update
+00217 if ( $sub_action=='detail' )
+00218 {
+00219   echo '<div class="u_redcontent">';
+00220   $act=new action($cn);
+00221   $act->ag_id=$_REQUEST['ag_id'];
+00222   echo $act->get();
+00223   $act->ag_comment=Decode($act->ag_comment);
+00224   echo '<form name="RTEDemo" action="commercial.php"  enctype="multipart/form-data"  method="post"  onsubmit="return submitForm();" >';
+00225   echo JS_SEARCH_CARD;
+00226   echo $act->display('UPD',false);
+00227   echo '<input type="hidden" name="p_action" value="suivi_courrier">';
+00228   echo '<input type="hidden" name="sa" value="update">';
+00229   $upload=new widget("file");
+00230   $upload->name="file_upload";
+00231   $upload->value="";
+00232   echo "Enregistrer le fichier ".$upload->IOValue();
+00233   echo $upload->Submit("save","Sauve");
+00234   echo $upload->Submit("add_action_here","Ajoute une action à celle-ci");
+00235   echo '</form>';
+00237   echo $retour;
+00238   echo '</div>';
+00239 }
+00240 //--------------------------------------------------------------------------------
+00241 // Show a list of the action
+00242 if ( $sub_action == "list" )
+00243      ShowActionList($cn,$retour,$h_url);
+00244        
+00245 //--------------------------------------------------------------------------------
+00246 // Add an action
+00247 if ( $sub_action == "add_action" ) 
+00248 {
+00249   echo $retour;
+00250   $act=new action($cn);
+00251   $act->ag_id=0;
+00252   $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:"0";
+00253   $act->ag_timestamp=(isset($_POST['ag_timestamp']))?$_POST['ag_timestamp']:"";
+00254   $act->qcode_dest=isset($_POST['tiers'])?$_REQUEST['tiers']:"";
+00255   $act->qcode_exp=isset($_POST['qcode_exp'])?$_REQUEST['qcode_exp']:"";
+00256   $act->d_id=0;
+00257   $act->dt_id=isset($_POST['dt_id'])?$_REQUEST['dt_id']:"";
+00258   $act->d_state=(isset($_POST['d_state']))?$_POST['d_state']:"";
+00259   $act->ag_ref="";
+00260   $act->ag_title=(isset($_POST['ag_title']))?$_POST['ag_title']:"";
+00261   echo '<div class="u_redcontent">';
+00262   echo JS_SEARCH_CARD;
+00263   // Add hidden tag
+00264   echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
+00265 
+00266   $act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
+00267   echo $act->Display('NEW',false);
+00268 
+00269   echo '<input type="hidden" name="p_action" value="suivi_courrier">';
+00270   echo '<input type="hidden" name="sa" value="save_action_st1">';
+00271 
+00272   echo $h_url;
+00273   echo '<input type="submit" name="save_action_st1" value="Sauver"></p>'.
+00274     '</form>'.
+00275     '</div>';
+00276 
+00277 }
+00278 //--------------------------------------------------------------------------------
+00279 // Save Action
+00280 // Stage 1 : show the result and confirm
+00281 //--------------------------------------------------------------------------------
+00282 if  ( $sub_action == "save_action_st1" ) 
+00283 {
+00284   $act=new action($cn);
+00285   $act->ag_timestamp=$_POST['ag_timestamp'];
+00286   $act->ag_comment=$_POST['ag_comment'];
+00287   $act->ag_timestamp=$_POST['ag_timestamp'];
+00288   $act->d_state=$_POST['d_state'];
+00289   $act->dt_id=$_POST['dt_id'];
+00290   $act->qcode_exp=$_POST['qcode_exp'];
+00291   $act->qcode_dest=$_POST['qcode_dest'];
+00292   $act->ag_title=$_POST['ag_title'];
+00293   $act->d_id=0;
+00294   $act->ag_id=$_POST['ag_id'];
+00295   $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0;
+00296       
+00297   echo $act->Confirm();
+00298 }
+00299 //--------------------------------------------------------------------------------
+00300 // Save Action
+00301 // Stage 2 : Save the action and propose to save a file
+00302 //--------------------------------------------------------------------------------
+00303 if  ( $sub_action == "save_action_st2" ) 
+00304 {
+00305   $act=new action($cn);
+00306 
+00307   $act->ag_comment=$_POST['ag_comment'];
+00308   $act->ag_timestamp=$_POST['ag_timestamp'];
+00309   $act->d_state=$_POST['d_state'];
+00310   $act->dt_id=$_POST['dt_id'];
+00311   $act->qcode_dest=$_POST['tiers'];
+00312   $act->qcode_exp=$_POST['qcode_exp'];
+00313   $act->ag_title=$_POST['ag_title'];
+00314   $act->d_id=0;
+00315   $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0;
+00316   $act->md_id=(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
 00317 
-00318 //--------------------------------------------------------------------------------
-00319 // Save Document
-00320 // Stage 3 : Save the document
-00321 //--------------------------------------------------------------------------------
-00322 if  ( $sub_action == "save_action_st3" ) 
-00323 {
-00324   echo_debug("action.inc.php",__LINE__,'Stage 3');
-00325   $act=new action($cn);
-00326   $act->ag_id=$_POST['ag_id'];
-00327   $act->ag_ref_ag_idid=$_POST['ag_ref_ag_id'];
-00328   $act->ag_comment=$_POST['ag_comment'];
-00329   $act->ag_timestamp=$_POST['ag_timestamp'];
-00330   $act->d_state=$_POST['d_state'];
-00331   $act->dt_id=$_POST['dt_id'];
-00332   $act->qcode=$_POST['qcode'];
-00333   $act->ag_title=$_POST['ag_title'];
-00334   $d_id=(isset($_POST['d_id']))?$_POST['d_id']:0;
-00335   $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0;
-00336   echo $act->SaveStage3($d_id);
-00337   
-00338   ShowActionList($cn,$retour,$h_url);
-00339 
-00340 }
-00341 //---------------------------------------------------------------------
-00342 
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +00318 $act->gen=isset($_POST['p_gen'])?'on':'off'; +00319 // insert into action_gestion +00320 echo $act->SaveStage2(); +00321 echo '<A HREF="commercial.php?p_action=suivi_courrier"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>'; +00322 } +00323 +00324 //-------------------------------------------------------------------------------- +00325 // Save Document +00326 // Stage 3 : Save the document +00327 //-------------------------------------------------------------------------------- +00328 if ( $sub_action == "save_action_st3" ) +00329 { +00330 echo_debug("action.inc.php",__LINE__,'Stage 3'); +00331 $act=new action($cn); +00332 $act->ag_id=$_POST['ag_id']; +00333 $act->ag_ref_ag_idid=$_POST['ag_ref_ag_id']; +00334 $act->ag_comment=$_POST['ag_comment']; +00335 $act->ag_timestamp=$_POST['ag_timestamp']; +00336 $act->d_state=$_POST['d_state']; +00337 $act->dt_id=$_POST['dt_id']; +00338 $act->qcode_dest=$_POST['qcode_dest']; +00339 $act->qcode_exp=$_POST['qcode_exp']; +00340 +00341 $act->ag_title=$_POST['ag_title']; +00342 $d_id=(isset($_POST['d_id']))?$_POST['d_id']:0; +00343 $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0; +00344 echo $act->SaveStage3($d_id); +00345 +00346 ShowActionList($cn,$retour,$h_url); +00347 +00348 } +00349 //--------------------------------------------------------------------- +00350 +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/action_8inc_8php.html b/doc/developper/html/action_8inc_8php.html index 84f94040c..936d2abf7 100644 --- a/doc/developper/html/action_8inc_8php.html +++ b/doc/developper/html/action_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/action.inc.php File Reference +phpcompta: action.inc.php File Reference +include

action.inc.php File Reference

Page who manage the different action (meeting, letter). More...

@@ -14,9 +14,9 @@ Go to the source code of this file. - + - + @@ -37,29 +37,31 @@ - + - + - + - + - + - + - + - + - + - + - + - + + +

Functions

 ShowActionList ($cn, $retour, $h_url)
 ShowActionList ($cn, $retour, $h_url)
 Show the list of action, this code should be common to several webpage. But for the moment we keep like that because it is used only by this file.
 Show the list of action, this code should be common to several webpage. But for the moment we keep like that because it is used only by this file.

Variables

 $sub_action = (isset($_REQUEST['sa']))?$_REQUEST['sa']:""
$act dt_id = (isset($_POST['dt_id']))?$_POST['dt_id']:0
 class for the table document_type pk document_type
$act qcode = $_POST['qcode']
$act qcode_exp = $_POST['qcode_exp']
$act ag_title = $_POST['ag_title']
$act qcode_dest = $_POST['qcode_dest']
$act d_id = (isset($_POST['d_id']))?$_POST['d_id']:0
$act ag_title = $_POST['ag_title']
$act ag_ref_ag_id = $_POST['ag_id']
$act d_id = (isset($_POST['d_id']))?$_POST['d_id']:0
$act ag_ref = ""
$act ag_ref_ag_id = $_POST['ag_id']
 $upload = new widget("file")
$act ag_ref = ""
$upload name = "file_upload"
 $upload = new widget("file")
$upload value = ""
$upload name = "file_upload"
$act md_id = (isset($_POST['gen_doc']))?$_POST['gen_doc']:0
$upload value = ""
$act gen = isset($_POST['p_gen'])?'on':'off'
$act md_id = (isset($_POST['gen_doc']))?$_POST['gen_doc']:0
$act ag_ref_ag_idid = $_POST['ag_ref_ag_id']
$act gen = isset($_POST['p_gen'])?'on':'off'
 $d_id = (isset($_POST['d_id']))?$_POST['d_id']:0
$act ag_ref_ag_idid = $_POST['ag_ref_ag_id']
 $d_id = (isset($_POST['d_id']))?$_POST['d_id']:0


Detailed Description

@@ -68,7 +70,7 @@ Page who manage the different action (meeting, letter).

Definition in file action.inc.php.


Function Documentation

-

+

+References $a, $act, $fiche, $h_url, $qcode, $r, $retour, $sp, $w, FormatString(), name, and value.
00039 {
+00040   // show the search menu
+00041   ?>
+00042 <div class="u_content">
+00043 <span>
+00044 <form method="get" action="commercial.php">
+00045 <?
+00046    $a=(isset($_GET['query']))?$_GET['query']:"";
+00047    printf ('<span>Titre ou référence: <input type="text" name="query" value="%s"></span>',
+00048            $a);
+00049    $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
+00050    echo JS_SEARCH_CARD;
+00051    $w=new widget('js_search_only');
+00052    $w->name='qcode_query';
+00053    $w->value=$qcode;
+00054    $w->label='Quick Code';
+00055    $w->extra='4,9,14,16,8';
+00056    $w->table=0;
+00057    $sp= new widget("span");
+00058 
+00059    echo $sp->IOValue("qcode_query_label","",$qcode);
+00060    echo $w->IOValue();
+00061 ?>
+00062 <input type="submit" name="submit_query" value="recherche">
+00063 <input type="hidden" name="sa" value="list">
+00064 <input type="hidden" name="p_action" value="suivi_courrier">
+00065 </form>
+00066 </span>
+00067 
+00068 <?
+00069 ?>
+00070 <form method="get" action="commercial.php">
+00071 <input type="submit" name="submit_query" value="Ajout Action">
+00072 <input type="hidden" name="p_action" value="suivi_courrier">
+00073 <input type="hidden" name="sa" value="add_action">
+00074 <input type="hidden" name="tiers" value=<? echo '"'.$qcode_dest.'"';?>>
+00075    <? // if called from another menu, url is set
+00076    echo $h_url;
+00077    echo $retour; ?>
+00078 </form>
+00079 
+00080 
+00081 <?
+00082     // show the  action in 
+00083     $act=new action($cn);
+00087    $query="";
+00088 
+00089    if ( isset($_REQUEST['query']) )
+00090    {
+00091 
+00092      // if a query is request build the sql stmt
+00093      $query="and (ag_title ~* '".FormatString($_REQUEST['query'])."' ".
+00094        "or ag_ref ='".trim(FormatString($_REQUEST['query']))."'".
+00095        ")"; 
+00096    }
+00097  
+00098    $str="";
+00099    if ( isset($_GET['qcode_query'] )) 
+00100      {
+00101 
+00102         // verify that qcode is not empty
+00103         if ( strlen(trim($_REQUEST['qcode_query'] )) != 0 )
+00104          { 
+00105 
+00106            $fiche=new Fiche($cn);
+00107            $fiche->GetByQCode($_REQUEST['qcode_query']);
+00108            $str=" and (f_id_exp= ".$fiche->id." or ".
+00109              "f_id_dest".$fiche->id.")";
+00110 
+00111          }
+00112      }
+00113 
+00114    $r=$act->myList(ACTION,$query.$str);
+00115    echo $r;
+00116  }
+
+

+

@@ -122,7 +124,84 @@ Show the list of action, this code should be common to several webpage. But for

Definition at line 38 of file action.inc.php.

-References $a, $act, $fiche, $h_url, $qcode, $r, $retour, $sp, $w, FormatString(), name, qcode, and value.


Variable Documentation

@@ -148,18 +227,18 @@ References $a,

-Definition at line 153 of file action.inc.php. +Definition at line 154 of file action.inc.php.

Referenced by Document::Replace(), and ShowActionList(). -

+

@@ -175,9 +254,9 @@ Referenced by Docum

-Definition at line 334 of file action.inc.php. +Definition at line 342 of file action.inc.php.

-Referenced by action::Display(), and action::SaveStage3(). +Referenced by action::Display(), and action::SaveStage3().

- +
$d_id = (isset($_POST['d_id']))?$_POST['d_id']:0 $d_id = (isset($_POST['d_id']))?$_POST['d_id']:0

@@ -202,9 +281,9 @@ Referenced by action:

-Definition at line 136 of file action.inc.php. +Definition at line 137 of file action.inc.php.

-Referenced by action::Confirm(), and ShowActionList(). +Referenced by action::Confirm(), and ShowActionList().

@@ -229,9 +308,9 @@ Referenced by action:

-Definition at line 135 of file action.inc.php. +Definition at line 136 of file action.inc.php.

-Referenced by action::Confirm(), and ShowActionList(). +Referenced by action::Confirm(), and ShowActionList().

@@ -256,10 +335,10 @@ Referenced by action:

-Definition at line 122 of file action.inc.php. +Definition at line 123 of file action.inc.php. -

+

+Referenced by action::SaveStage2().
@@ -281,9 +360,9 @@ Definition at line 122<

-Definition at line 226 of file action.inc.php. +Definition at line 229 of file action.inc.php.

-Referenced by action::SaveStage2().

@@ -308,9 +387,9 @@ Referenced by action:

-Definition at line 156 of file action.inc.php. +Definition at line 157 of file action.inc.php.

-Referenced by action::Confirm(), action::get(), action::SaveStage2(), and action::Update(). +Referenced by action::Confirm(), action::get(), action::SaveStage2(), and action::Update().

@@ -335,18 +414,18 @@ Referenced by action:

-Definition at line 155 of file action.inc.php. +Definition at line 156 of file action.inc.php.

-Referenced by Document::blank(), action::Display(), Document::get(), Document::Replace(), action::SaveStage2(), action::SaveStage3(), and action::Update(). +Referenced by Document::blank(), action::Display(), Document::get(), Document::Replace(), action::SaveStage2(), action::SaveStage3(), and action::Update(). -

+

@@ -362,18 +441,18 @@ Referenced by Docum

-Definition at line 189 of file action.inc.php. +Definition at line 192 of file action.inc.php.

-Referenced by action::Display(), action::get(), action::myList(), and action::SaveStage2(). +Referenced by action::Display(), action::get(), action::myList(), and action::SaveStage2().

- +
act ag_ref = "" act ag_ref = ""
-

+

@@ -389,18 +468,18 @@ Referenced by action:

-Definition at line 177 of file action.inc.php. +Definition at line 179 of file action.inc.php.

-Referenced by action::Display(), action::get(), and action::myList(). +Referenced by action::Display(), action::get(), and action::myList().

- +
act ag_ref_ag_id = $_POST['ag_id'] act ag_ref_ag_id = $_POST['ag_id']
-

+

@@ -416,7 +495,7 @@ Referenced by action:

-Definition at line 327 of file action.inc.php. +Definition at line 333 of file action.inc.php.

- +
$act ag_ref_ag_idid = $_POST['ag_ref_ag_id'] $act ag_ref_ag_idid = $_POST['ag_ref_ag_id']

@@ -441,18 +520,18 @@ Definition at line 327<

-Definition at line 157 of file action.inc.php. +Definition at line 158 of file action.inc.php.

-Referenced by action::Confirm(), action::Display(), and action::get(). +Referenced by action::Confirm(), action::Display(), and action::get(). -

+

@@ -468,18 +547,18 @@ Referenced by action:

-Definition at line 161 of file action.inc.php. +Definition at line 163 of file action.inc.php.

-Referenced by action::get(), action::myList(), and action::SaveStage2(). +Referenced by action::get(), action::myList(), and action::SaveStage2().

- +
act ag_title = $_POST['ag_title'] act ag_title = $_POST['ag_title']
-

+

@@ -495,9 +574,9 @@ Referenced by action:

-Definition at line 162 of file action.inc.php. +Definition at line 164 of file action.inc.php.

-Referenced by Document::blank(), action::Display(), Document::Document(), action::get(), action::myList(), Document::remove(), Document::SaveGenerated(), action::SaveStage3(), and action::Update(). +Referenced by Document::blank(), action::Display(), Document::Document(), action::get(), action::myList(), Document::remove(), Document::SaveGenerated(), action::SaveStage3(), and action::Update().

- +
act d_id = (isset($_POST['d_id']))?$_POST['d_id']:0 act d_id = (isset($_POST['d_id']))?$_POST['d_id']:0

@@ -522,9 +601,9 @@ Referenced by Docum

-Definition at line 158 of file action.inc.php. +Definition at line 159 of file action.inc.php.

-Referenced by action::Confirm(), action::Display(), Document::get(), action::get(), and action::SaveStage2(). +Referenced by action::Confirm(), action::Display(), Document::get(), action::get(), and action::SaveStage2().

@@ -551,18 +630,18 @@ class for the table document_type pk document_type

-Definition at line 159 of file action.inc.php. +Definition at line 160 of file action.inc.php.

-Referenced by action::Confirm(), action::Display(), Document_type::document_type(), Document_modele::form(), Document_type::get(), action::get(), action::SaveStage2(), action::SaveStage3(), and action::Update(). +Referenced by action::Confirm(), action::Display(), Document_type::document_type(), Document_modele::form(), Document_type::get(), action::get(), action::SaveStage2(), action::SaveStage3(), and action::Update(). -

+

@@ -578,10 +657,10 @@ Referenced by action:

-Definition at line 312 of file action.inc.php. +Definition at line 318 of file action.inc.php.

- +
$act gen = isset($_POST['p_gen'])?'on':'off' $act gen = isset($_POST['p_gen'])?'on':'off'
-

+

+Referenced by Document_modele::Document_modele(), Document_modele::myList(), Document_modele::Save(), and action::SaveStage2().
@@ -603,12 +682,12 @@ Definition at line 312<

-Definition at line 310 of file action.inc.php. +Definition at line 316 of file action.inc.php.

-Referenced by Document_modele::Document_modele(), Document_modele::myList(), Document_modele::Save(), and action::SaveStage2().

-

+

+Referenced by ChangeStock(), cl_user::Check(), cl_user::cl_user(), action::Confirm(), EncodeFiche(), EncodeForm(), EncodeModele(), form_verify_input(), FormAchView(), FormFin(), FormODS(), FormVenteView(), Supplier::GetFromPoste(), Customer::GetFromPoste(), cl_user::GetGlobalPref(), rapport::GetName(), poste::GetName(), jrn::GetName(), fiche::insert(), cl_user::insert_default_global_pref(), widget::IOValue(), jrn_navigation_bar(), MakeListingVat(), new_fiche(), Cpdf::o_font(), Cpdf::openFont(), rapport::rapport(), RecordJrn(), Document_modele::Save(), save_upload_document(), action::SaveStage2(), Cpdf::selectFont(), ShowActionList(), ShowFormTransfert(), contact::Summary(), u_ShowMenuRecherche(), fiche::update(), UpdateJrn(), Document::Upload(), Customer::VatListing(), VerifData(), VerifImport(), ViewFiche(), and ViewImp().
@@ -630,18 +709,18 @@ Referenced by 227 of file action.inc.php. +Definition at line 230 of file action.inc.php.

-Referenced by ChangeStock(), cl_user::Check(), cl_user::cl_user(), action::Confirm(), EncodeFiche(), EncodeForm(), EncodeModele(), form_verify_input(), FormAchView(), FormFin(), FormODS(), FormVenteView(), Supplier::GetFromPoste(), Customer::GetFromPoste(), cl_user::GetGlobalPref(), rapport::GetName(), poste::GetName(), jrn::GetName(), fiche::insert(), cl_user::insert_default_global_pref(), widget::IOValue(), jrn_navigation_bar(), MakeListingVat(), new_fiche(), Cpdf::o_font(), Cpdf::openFont(), rapport::rapport(), RecordJrn(), Document_modele::Save(), save_upload_document(), action::SaveStage2(), Cpdf::selectFont(), ShowActionList(), ShowFormTransfert(), contact::Summary(), u_ShowMenuRecherche(), fiche::update(), UpdateJrn(), Document::Upload(), Customer::VatListing(), VerifData(), VerifImport(), ViewFiche(), and ViewImp().

-

+

@@ -657,12 +736,39 @@ Referenced by ChangeStoc

-Definition at line 160 of file action.inc.php. +Definition at line 162 of file action.inc.php.

-Referenced by action::Display(), action::get(), Document::Replace(), ShowActionList(), and u_ShowMenuRecherche(). +Referenced by action::Display(), and action::get().

- +
act qcode = $_POST['qcode'] act qcode_dest = $_POST['qcode_dest']
-

+

+ + + + +
+ + + + +
act qcode_exp = $_POST['qcode_exp']
+
+ + + + + +
+   + + +

+ +

+Definition at line 161 of file action.inc.php. +

+Referenced by action::Display(), and action::get().

+

+Referenced by ChangeStock(), action::Confirm(), widget::debug(), fiche_def_ref::Display(), DisplayDetailModele(), EncodeFiche(), EncodeForm(), Cezpdf::ezTable(), FormFin(), FormODS(), FormVenteView(), jrn::GetDefLine(), fiche::insert(), cl_user::insert_default_global_pref(), widget::IOValue(), jrn_navigation_bar(), fiche_def_ref::LoadAll(), make_array(), new_fiche(), Cpdf::o_fontDescriptor(), Document::ParseDocument(), RecordJrn(), action::SaveStage2(), ShowActionList(), contact::Summary(), u_ShowMenuRecherche(), fiche::update(), cl_user::update_global_pref(), UpdateJrn(), VerifImport(), ViewFiche(), ViewImp(), and widget::widget().
@@ -684,12 +790,12 @@ Referenced by action:

-Definition at line 228 of file action.inc.php. +Definition at line 231 of file action.inc.php.

-Referenced by ChangeStock(), action::Confirm(), widget::debug(), fiche_def_ref::Display(), DisplayDetailModele(), EncodeFiche(), EncodeForm(), Cezpdf::ezTable(), FormFin(), FormODS(), FormVenteView(), jrn::GetDefLine(), fiche::insert(), cl_user::insert_default_global_pref(), widget::IOValue(), jrn_navigation_bar(), fiche_def_ref::LoadAll(), make_array(), new_fiche(), Cpdf::o_fontDescriptor(), Document::ParseDocument(), RecordJrn(), action::SaveStage2(), ShowActionList(), contact::Summary(), u_ShowMenuRecherche(), fiche::update(), cl_user::update_global_pref(), UpdateJrn(), VerifImport(), ViewFiche(), ViewImp(), and widget::widget().

-


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/admin__repo_8php-source.html b/doc/developper/html/admin__repo_8php-source.html index 77220321d..a88adb7fa 100644 --- a/doc/developper/html/admin__repo_8php-source.html +++ b/doc/developper/html/admin__repo_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/admin_repo.php Source File +phpcompta: admin_repo.php Source File +html

admin_repo.php

Go to the documentation of this file.
00001 <?
 00002 
 00003 /*
@@ -318,7 +318,7 @@
 00314 
 00315 html_page_stop();
 00316 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/admin__repo_8php.html b/doc/developper/html/admin__repo_8php.html index ac98195fb..0f1ce01a2 100644 --- a/doc/developper/html/admin__repo_8php.html +++ b/doc/developper/html/admin__repo_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/admin_repo.php File Reference +phpcompta: admin_repo.php File Reference +html

admin_repo.php File Reference

Administration of the repository : creation of user, folder, security, templates... Accessible only by the administrator. More...

@@ -262,7 +262,7 @@ Referenced by GetNumberLi

Definition at line 119 of file admin_repo.php.

-Referenced by action::Confirm(), action::Display(), and u_ShowDossier(). +Referenced by action::Confirm(), action::Display(), and u_ShowDossier().

@@ -571,7 +571,7 @@ Definition at line 117< Definition at line 42 of file admin_repo.php. -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/annotated.html b/doc/developper/html/annotated.html index b1f752cd8..4dfe3c97b 100644 --- a/doc/developper/html/annotated.html +++ b/doc/developper/html/annotated.html @@ -32,7 +32,7 @@ SupplierClass Supplier are a specific kind of card widgetClass widget This class is used to create all the HTML INPUT TYPE and some specials which works with javascript like js_search -
Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/annulation_8php-source.html b/doc/developper/html/annulation_8php-source.html index 1273f7687..957f222d3 100644 --- a/doc/developper/html/annulation_8php-source.html +++ b/doc/developper/html/annulation_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/annulation.php Source File +phpcompta: annulation.php Source File +html

annulation.php

Go to the documentation of this file.
00001 <?
 00002 /*
 00003  *   This file is part of PhpCompta.
@@ -84,16 +84,16 @@
 00078 <span>
 00079 <FORM METHOD="POST" ACTION="annulation.php?p_jrn=<?echo $_GET['p_jrn'];?>&jrn_op=<?echo $_GET['jrn_op'];?>">
 00080 <INPUT TYPE="HIDDEN" NAME="annul">
-00081 <INPUT TYPE="HIDDEN" NAME="p_id" value="<? echo $_POST['p_id']; ?>">
-00082 <INPUT TYPE="HIDDEN" NAME="op_date" value="<? echo $_POST['op_date']; ?>">
-00083 <INPUT TYPE="SUBMIT" NAME="confirm" value="Oui"> 
+00081 <INPUT TYPE="HIDDEN" NAME="p_id" value="<? echo $_POST['p_id']; ?>">
+00082 <INPUT TYPE="HIDDEN" NAME="op_date" value="<? echo $_POST['op_date']; ?>">
+00083 <INPUT TYPE="SUBMIT" NAME="confirm" value="Oui"> 
 00084 </FORM>
 00085 
 00086 <FORM METHOD="GET" ACTION="annulation.php">
-00087 <INPUT TYPE="HIDDEN" NAME="p_jrn" value="<? echo $_REQUEST['p_jrn']; ?>">
-00088 <INPUT TYPE="HIDDEN" NAME="p_id" value="<? echo $_REQUEST['p_id']; ?>">
-00089 <INPUT TYPE="HIDDEN" NAME="jrn_op" value="<? echo $_REQUEST['jrn_op']; ?>">
-00090 <INPUT TYPE="SUBMIT" NAME="not_confirm" value="non">
+00087 <INPUT TYPE="HIDDEN" NAME="p_jrn" value="<? echo $_REQUEST['p_jrn']; ?>">
+00088 <INPUT TYPE="HIDDEN" NAME="p_id" value="<? echo $_REQUEST['p_id']; ?>">
+00089 <INPUT TYPE="HIDDEN" NAME="jrn_op" value="<? echo $_REQUEST['jrn_op']; ?>">
+00090 <INPUT TYPE="SUBMIT" NAME="not_confirm" value="non">
 00091 </form>
 00092 </span>
 00093 <?
@@ -287,14 +287,14 @@
 00281 
 00282 echo '
 00283 
-00284 <input type="hidden" name="p_id" value="'.$_GET['jrn_op'].'">
-00285 <input type="submit" name="annul"  value="Mise à zéro">
-00286 <input type="button" name="cancel" value="Retour" onClick="window.close();">
+00284 <input type="hidden" name="p_id" value="'.$_GET['jrn_op'].'">
+00285 <input type="submit" name="annul"  value="Mise à zéro">
+00286 <input type="button" name="cancel" value="Retour" onClick="window.close();">
 00287 </form>';
 00288 
 00289 html_page_stop();
 00290 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/annulation_8php.html b/doc/developper/html/annulation_8php.html index f4030d336..1a4532e51 100644 --- a/doc/developper/html/annulation_8php.html +++ b/doc/developper/html/annulation_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/annulation.php File Reference +phpcompta: annulation.php File Reference +html

annulation.php File Reference

in a popup window manage the deletion of the operations More...

@@ -303,7 +303,7 @@ Definition at line 55251 of file annulation.php. -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/bal__csv_8php-source.html b/doc/developper/html/bal__csv_8php-source.html index f08828a5d..e7d72e76d 100644 --- a/doc/developper/html/bal__csv_8php-source.html +++ b/doc/developper/html/bal__csv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/bal_csv.php Source File +phpcompta: bal_csv.php Source File +html

bal_csv.php

Go to the documentation of this file.
00001 <?
 00002 /*
 00003  *   This file is part of PhpCompta.
@@ -71,7 +71,7 @@
 00065  
 00066 
 00067 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/bal__csv_8php.html b/doc/developper/html/bal__csv_8php.html index 1dbab2ecc..470d9fc3c 100644 --- a/doc/developper/html/bal__csv_8php.html +++ b/doc/developper/html/bal__csv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/bal_csv.php File Reference +phpcompta: bal_csv.php File Reference +html

bal_csv.php File Reference

Return the balance in CSV format. More...

@@ -156,7 +156,7 @@ Definition at line 35 Definition at line 40 of file bal_csv.php. -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/balance_8php-source.html b/doc/developper/html/balance_8php-source.html index ee4797251..3c6818478 100644 --- a/doc/developper/html/balance_8php-source.html +++ b/doc/developper/html/balance_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/balance.php Source File +phpcompta: balance.php Source File +include

balance.php

Go to the documentation of this file.
00001 
 00002 <?
 00003 /*
@@ -92,7 +92,7 @@
 00090 
 00091 //$a=FormPeriodeMult($cn);
 00092 //echo $a;
-00093 echo '<input type="submit" name="view" value="ok">';
+00093 echo '<input type="submit" name="view" value="ok">';
 00094 
 00095 
 00096 //-----------------------------------------------------
@@ -139,7 +139,7 @@
 00137  }// end submit
 00138   echo "</div>";
 00139 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/balance_8php.html b/doc/developper/html/balance_8php.html index 8f00ccfb9..be1275938 100644 --- a/doc/developper/html/balance_8php.html +++ b/doc/developper/html/balance_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/balance.php File Reference +phpcompta: balance.php File Reference +include

balance.php File Reference

Show the balance and let you print it or export to PDF file included by user_impress. More...

@@ -73,7 +73,7 @@ Definition in file balance.php

Definition at line 113 of file balance.php.

-Referenced by Cezpdf::alink(), Cpdf::ARC4(), fiche::blank(), Cezpdf::Cezpdf(), ComputeTotalVat(), ComputeVat(), action::Confirm(), fiche::CountByDef(), DbConnect(), fiche::Display(), action::Display(), Cpdf::ellipse(), action::get(), GetDataJrnPdf(), GetFicheJrn(), getFicheNameCode(), rapport::GetName(), GetParent(), getPeriodeFromDate(), getPeriodeFromMonth(), getPeriodeName(), GetRappel(), jrn::GetRow(), Balance::GetRow(), GetTvaPoste(), GetUserProperty(), GetVersion(), isValid(), ListJrn(), make_array(), MakeListingVat(), Document_modele::myList(), RecordJrn(), ShowActionList(), Supplier::Summary(), Customer::Summary(), Cezpdf::uline(), UpdateFiche(), UpdateJrn(), and withStock(). +Referenced by Cezpdf::alink(), Cpdf::ARC4(), fiche::blank(), Cezpdf::Cezpdf(), ComputeTotalVat(), ComputeVat(), action::Confirm(), fiche::CountByDef(), DbConnect(), fiche::Display(), action::Display(), Cpdf::ellipse(), GetDataJrnPdf(), GetFicheJrn(), getFicheNameCode(), rapport::GetName(), GetParent(), getPeriodeFromDate(), getPeriodeFromMonth(), getPeriodeName(), GetRappel(), jrn::GetRow(), Balance::GetRow(), GetTvaPoste(), GetUserProperty(), GetVersion(), isValid(), ListJrn(), make_array(), MakeListingVat(), Document_modele::myList(), RecordJrn(), ShowActionList(), Supplier::Summary(), Customer::Summary(), Cezpdf::uline(), UpdateFiche(), UpdateJrn(), and withStock().

@@ -356,7 +356,7 @@ Definition at line 70 o

Definition at line 36 of file balance.php.

-Referenced by AddFiche(), cl_user::Check(), action::Display(), ExecSql(), ExecuteScript(), FormAchInput(), FormAchView(), FormFin(), FormVenInput(), FormVenteView(), GetFicheJrn(), NoAccess(), Document::ParseDocument(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Document_modele::Save(), and TransferCSV(). +Referenced by AddFiche(), cl_user::Check(), action::Display(), ExecSql(), ExecuteScript(), FormAchInput(), FormAchView(), FormFin(), FormVenInput(), FormVenteView(), GetFicheJrn(), NoAccess(), Document::ParseDocument(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Document_modele::Save(), and TransferCSV().

@@ -413,7 +413,7 @@ Definition at line 71 o Referenced by fiche::blank(), ListJrn(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), VerifImport(), ViewFiche(), ViewRecord(), and widget::widget(). -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/bilan_8php-source.html b/doc/developper/html/bilan_8php-source.html index df7463711..8586a12cd 100644 --- a/doc/developper/html/bilan_8php-source.html +++ b/doc/developper/html/bilan_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/bilan.php Source File +phpcompta: bilan.php Source File +html

bilan.php

Go to the documentation of this file.
00001 <?
 00002 /*
 00003  *   This file is part of PhpCompta.
@@ -143,7 +143,7 @@
 00137 
 00138  }// rtf file is read
 00139 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/bilan_8php.html b/doc/developper/html/bilan_8php.html index 8d5b1d22c..8a8c14838 100644 --- a/doc/developper/html/bilan_8php.html +++ b/doc/developper/html/bilan_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/bilan.php File Reference +phpcompta: bilan.php File Reference +html

bilan.php File Reference

send a Bilan in RTF format More...

@@ -324,7 +324,7 @@ Referenced by Cezpdf:: Definition at line 33 of file bilan.php. -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/cbc__be_8inc_8php-source.html b/doc/developper/html/cbc__be_8inc_8php-source.html index 436c0579b..04accfcae 100644 --- a/doc/developper/html/cbc__be_8inc_8php-source.html +++ b/doc/developper/html/cbc__be_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/cbc_be.inc.php Source File +phpcompta: cbc_be.inc.php Source File +include

cbc_be.inc.php

Go to the documentation of this file.
00001 <?
 00002 /*
 00003  *   This file is part of PhpCompta.
@@ -69,7 +69,7 @@
 00064 fclose($handle);
 00065 echo "Encore rien désolé";
 00066 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/cbc__be_8inc_8php.html b/doc/developper/html/cbc__be_8inc_8php.html index 0143778aa..566996c14 100644 --- a/doc/developper/html/cbc__be_8inc_8php.html +++ b/doc/developper/html/cbc__be_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/cbc_be.inc.php File Reference +phpcompta: cbc_be.inc.php File Reference +include

cbc_be.inc.php File Reference

This file must be included to parse the CVS from the CBC Bank. More...

@@ -47,10 +47,10 @@ Definition in file cbc_be.inc

Definition at line 28 of file cbc_be.inc.php.

-Referenced by Centralise(), cl_user::cl_user(), Cezpdf::ezTable(), Document::Generate(), parm_code::Get(), fiche_def::Get(), Document_modele::Get(), Document::get(), action::get(), fiche_def::GetAll(), fiche::getAttribut(), fiche_def::GetAttribut(), fiche::GetByDef(), fiche::GetByType(), Supplier::GetFromPoste(), Customer::GetFromPoste(), cl_user::GetGlobalPref(), cl_user::GetPreferences(), ListJrn(), fiche_def_ref::LoadAll(), make_array(), Document_modele::myList(), action::myList(), Cpdf::openFont(), Own::Own(), Document::Send(), ShowDossier(), and fiche::strAttribut(). +Referenced by Centralise(), cl_user::cl_user(), Cezpdf::ezTable(), Document::Generate(), parm_code::Get(), fiche_def::Get(), Document_modele::Get(), Document::get(), action::get(), fiche_def::GetAll(), fiche::getAttribut(), fiche_def::GetAttribut(), fiche::GetByDef(), fiche::GetByType(), Supplier::GetFromPoste(), Customer::GetFromPoste(), cl_user::GetGlobalPref(), cl_user::GetPreferences(), ListJrn(), fiche_def_ref::LoadAll(), make_array(), Document_modele::myList(), action::myList(), Cpdf::openFont(), Own::Own(), Document::Send(), ShowDossier(), and fiche::strAttribut(). -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/central_8php-source.html b/doc/developper/html/central_8php-source.html index 22aa8e97a..da3179949 100644 --- a/doc/developper/html/central_8php-source.html +++ b/doc/developper/html/central_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/central.php Source File +phpcompta: central.php Source File +html

central.php

Go to the documentation of this file.
00001 <?
 00002 
 00003 /*
@@ -81,7 +81,7 @@
 00075 if ( $ret != null) {
 00076   echo '<FORM METHOD="POST" action="central.php">';
 00077   echo $ret;
-00078   echo '<INPUT TYPE="SUBMIT" name="central" VALUE="Centralise">';
+00078   echo '<INPUT TYPE="SUBMIT" name="central" VALUE="Centralise">';
 00079   echo '</FORM>';
 00080 } else {
 00081   echo '<H2 class="info"> Aucune période à centraliser</H2>';
@@ -90,7 +90,7 @@
 00084 echo "</DIV>";
 00085 html_page_stop();
 00086 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/central_8php.html b/doc/developper/html/central_8php.html index 5d6496abc..023b92ff9 100644 --- a/doc/developper/html/central_8php.html +++ b/doc/developper/html/central_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/central.php File Reference +phpcompta: central.php File Reference +html

central.php File Reference

concerns the centralisation of the operations More...

@@ -102,7 +102,7 @@ Definition at line 35 o Definition at line 37 of file central.php. -


Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/central__inc_8php-source.html b/doc/developper/html/central__inc_8php-source.html index 1622deeef..318e47d20 100644 --- a/doc/developper/html/central__inc_8php-source.html +++ b/doc/developper/html/central__inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/central_inc.php Source File +phpcompta: central_inc.php Source File +include

central_inc.php

Go to the documentation of this file.
00001 <?
 00002 /*
 00003  *   This file is part of PhpCompta.
@@ -145,7 +145,7 @@
 00162 }
 00163 
 00164 ?>
-

Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/central__inc_8php.html b/doc/developper/html/central__inc_8php.html index 6a6a8ccf1..df94ad34e 100644 --- a/doc/developper/html/central__inc_8php.html +++ b/doc/developper/html/central__inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/central_inc.php File Reference +phpcompta: central_inc.php File Reference +include

central_inc.php File Reference

Concerns the centralization operations. More...

@@ -76,7 +76,121 @@ Definition at line 36<

References $MaxJrn, $MaxLine, $Res, $Res2, $Ret, $row, $sql, Commit(), EndSql(), ExecSql(), and StartSql().

-Referenced by ShowMenuAdvanced(). +Referenced by ShowMenuAdvanced().

00036                                       {
+00037 $sql="insert into centralized( c_j_id,
+00038             c_date ,
+00039             c_internal,
+00040             c_montant,
+00041             c_debit,
+00042             c_poste,
+00043             c_description,
+00044             c_grp,
+00045             c_jrn_def,
+00046             c_comment,
+00047             c_rapt,
+00048             c_periode) select j_id,
+00049                                  j_date,
+00050                                  jr_internal,
+00051                                  j_montant,
+00052                                  j_debit ,
+00053                                  j_poste ,
+00054                                  j_text ,
+00055                                  j_grpt ,
+00056                                  j_jrn_def,
+00057                                  jr_comment,
+00058                                  j_rapt, 
+00059                                  j_tech_per 
+00060             from jrnx left join jrn on jr_grpt_id=j_grpt 
+00061             where  
+00062             j_tech_per =".$p_periode." 
+00063             order by j_date,j_grpt,j_debit desc ";
+00064  $Res=StartSql($p_cn);
+00065  $Res=ExecSql($p_cn,$sql);
+00066  if ($Res==false) { rollback($p_cn); EndSql($p_cn); return ERROR;}
+00067  $Res=ExecSql($p_cn,"update jrnx set j_centralized='t' where j_tech_per=".$p_periode);
+00068  if ($Res==false) { rollback($p_cn); EndSql($p_cn); return ERROR;}
+00069 // Set correctly the number of operation id (jr_opid) for each journal
+00070 // get the existing jrn_def_id 
+00071 //--
+00072  $Res = ExecSql($p_cn,"select jrn_def_id from jrn_def");
+00073  $MaxJrn=pg_NumRows($Res);
+00074  // for each jrn_def_id
+00075  for ( $i=0; $i < $MaxJrn;$i++) {
+00076    $row=pg_fetch_array($Res,$i);
+00077    // get the op related to that jrn_def_id
+00078    $sql=sprintf("select jr_id from jrn 
+00079          where
+00080          jr_tech_per=%d
+00081          and jr_def_id = %d
+00082          order by jr_date,jr_grpt_id desc",
+00083                 $p_periode,
+00084                 $row['jrn_def_id']
+00085                 );
+00086 
+00087    $Res2=ExecSql($p_cn,$sql);
+00088    $MaxLine=pg_NumRows($Res2);
+00089    for ($e=0;$e < $MaxLine;$e++) {
+00090      // each line is updated with a sequence
+00091      $line=pg_fetch_array($Res2,$e);
+00092      $jr_id=$line['jr_id'];
+00093      $sql=sprintf ("update jrn set 
+00094                  jr_opid = (select nextval('s_jrn_%d'))
+00095                  where jr_id =%d",
+00096                    $row['jrn_def_id'],
+00097                    $jr_id); 
+00098      $Ret=ExecSql($p_cn,$sql);
+00099      if ($Res==false) { rollback($p_cn); EndSql($p_cn); return ERROR;}
+00100    }
+00101  }
+00102    // Put jr_c_opid in centralized                 
+00103    // for each jrn_def_id
+00104    // get the op related to that jrn_def_id
+00105    $sql=sprintf("select jr_id from jrn 
+00106          where
+00107          jr_tech_per=%d
+00108             order by jr_date,jr_grpt_id desc",
+00109                 $p_periode
+00110                 );
+00111 
+00112    $Res2=ExecSql($p_cn,$sql);
+00113    $MaxLine=pg_NumRows($Res2);
+00114    for ($e=0;$e < $MaxLine;$e++) {
+00115      // each line is updated with a sequence
+00116      $line=pg_fetch_array($Res2,$e);
+00117      $jr_id=$line['jr_id'];
+00118      $sql=sprintf ("update jrn set 
+00119                  jr_c_opid = (select nextval('s_central'))
+00120                  where jr_id =%d",
+00121                    $jr_id); 
+00122      $Ret=ExecSql($p_cn,$sql);
+00123      if ($Ret==false) { rollback($p_cn); EndSql($p_cn); return ERROR;}
+00124    }
+00125    // Set the order of the jrn
+00126    $Res=ExecSql($p_cn,"select c_id from centralized 
+00127                  inner join jrn on c_grp = jr_grpt_id
+00128                  order by jr_c_opid, c_debit desc");
+00129    for ( $e=0;$e < pg_NumRows($Res);$e++) {
+00130      $row=pg_fetch_array($Res,$e);
+00131      $sql=sprintf ("update centralized set  
+00132                  c_order = (select nextval('s_central_order'))
+00133                  where c_id = %d",$row['c_id']);
+00134      $Res2=ExecSql($p_cn,$sql); 
+00135       if ($Res2==false) { rollback($p_cn); EndSql($p_cn); return ERROR;}
+00136 
+00137    }
+00138    if ( ExecSql($p_cn,"update parm_periode set p_central=true where p_id=$p_periode") == false)
+00139      { rollback($p_cn); EndSql($p_cn); return ERROR;}
+00140 
+00141  
+00142  
+00143  
+00144  Commit($p_cn);
+00145  EndSql($p_cn);
+00146  return NOERROR;
+00147 }
+
+

+

@@ -124,10 +238,16 @@ p_jnr_id jrn.jr_id gen :

    Definition at line 159 of file central_inc.php.

    -References $Res, and ExecSql(). +References $Res, and ExecSql().

    00159                                        {
    +00160   $Res=ExecSql($p_cn,"select c_id from centralized where c_j_id=$p_jrn_id");
    +00161   return pg_NumRows($Res);
    +00162 }
    +
    +

    + -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/check__priv_8php-source.html b/doc/developper/html/check__priv_8php-source.html index dad512e74..fd465654f 100644 --- a/doc/developper/html/check__priv_8php-source.html +++ b/doc/developper/html/check__priv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/check_priv.php Source File +phpcompta: check_priv.php Source File +include

    check_priv.php

    Go to the documentation of this file.
    00001 <?
     00002 
     00003 /*
    @@ -158,7 +158,7 @@
     00206 }
     00207 
     00208 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/check__priv_8php.html b/doc/developper/html/check__priv_8php.html index 46bfe8ef8..4cf847a6e 100644 --- a/doc/developper/html/check__priv_8php.html +++ b/doc/developper/html/check__priv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/check_priv.php File Reference +phpcompta: check_priv.php File Reference +include

    check_priv.php File Reference

    Tools for checking the security. More...

    @@ -92,7 +92,18 @@ Check if an user is allowed to do an action.

    Definition at line 146 of file check_priv.php.

    -References $cn, $Res, CheckIsAdmin(), DbConnect(), and ExecSql(). +References $cn, $Res, CheckIsAdmin(), DbConnect(), and ExecSql().

    00147 {
    +00148   if ( CheckIsAdmin ($p_login) ) return 1;
    +00149   $cn=DbConnect($p_dossier);
    +00150   $Res=ExecSql($cn,"select * from user_sec_act where ua_login='$p_login' and ua_act_id=$p_action_id");
    +00151   $Count=pg_NumRows($Res);
    +00152   if ( $Count == 0 ) return 0;
    +00153   if ( $Count == 1 ) return 1;
    +00154   echo "<H2 class=\"error\"> Invalid action !!! $Count select * from user_sec_act where ua_login='$p_login' and ua_act_id=$p_action_id </H2>";
    +00155 }
    +
    +

    +

    @@ -142,7 +153,23 @@ Check if an user has acces to a folder.

    Definition at line 192 of file check_priv.php.

    -References $cn, $sql, CheckIsAdmin(), CountSql(), and DbConnect(). +References $cn, $sql, CheckIsAdmin(), CountSql(), and DbConnect().

    00193 {
    +00194   if ( CheckIsAdmin ($p_user) ) return 1;
    +00195   $cn=DbConnect();
    +00196   $sql="select  dos_id from ac_users 
    +00197                   natural join jnt_use_dos 
    +00198                   natural join  ac_dossier 
    +00199                   join  priv_user on ( priv_jnt=jnt_id)
    +00200           where use_active=1 
    +00201          and use_login='$p_user' 
    +00202          and dos_id='$p_dossier' 
    +00203          and priv_priv != 'NO'";
    +00204   return CountSql($cn,$sql);
    +00205 
    +00206 }
    +
    +

    +

    @@ -188,7 +215,21 @@ Definition at line 167<

    References $cn, $sql, CountSql(), and DbConnect().

    -Referenced by CheckAction(), CheckDossier(), and CheckJrn(). +Referenced by CheckAction(), CheckDossier(), and CheckJrn().

    00168 {
    +00169   if ( $p_user == 'phpcompta') return 1;
    +00170   $sql="select use_id from ac_users where use_login='$p_user'
    +00171                 and use_active=1 and use_admin=1 ";
    +00172   $cn=DbConnect();
    +00173   
    +00174   $isAdmin=CountSql($cn,$sql);
    +00175 
    +00176 
    +00177   return $isAdmin;
    +00178 
    +00179 }
    +
    +

    +

    @@ -252,10 +293,99 @@ Definition at line 46 References $cn, $Res, $Res2, CheckIsAdmin(), CountSql(), DbConnect(), echo_debug(), and ExecSql().

    -Referenced by ShowMenuJrnUser(). +Referenced by ShowMenuJrnUser().

    00047 {
    +00048   if ( CheckIsAdmin( $p_user) == 1 ) return 2;
    +00049   $cn=DbConnect($p_dossier);
    +00050   // Special
    +00051   // p_jrn = 0 ==> grand livre access if there is no uj_prix=X
    +00052   // or detail
    +00053   if ( $p_jrn == 0 ) {
    +00054     if ( $p_detail == false) {
    +00055       //    $n_jrn=CountSql($cn,"select jrn_def_id from jrn_def");
    +00056       $n_for=CountSql($cn,"select jrn_def_id,uj_priv 
    +00057                  from jrn_def left join user_sec_jrn on uj_jrn_id=jrn_def_id
    +00058                     where uj_login='$p_user' and uj_priv='X'");
    +00059       if ( $n_for == 0 ) 
    +00060         return 2;
    +00061       else 
    +00062         return 0;
    +00063     } else {
    +00064       // For a detail, at least one jrn must be accessible
    +00065       $n_for=CountSql($cn, " select jrn_def_id,uj_priv 
    +00066                  from jrn_def left join user_sec_jrn on uj_jrn_id=jrn_def_id
    +00067                     where uj_login='$p_user' and uj_priv !='X'");
    +00068       if ( $n_for == 0 ) 
    +00069         return 0;
    +00070       else 
    +00071         return 2;
    +00072     }
    +00073     
    +00074  
    +00075   }
    +00076 
    +00077   // droit spécifique
    +00078   $Res2=ExecSql($cn,"select jrn_def_id,uj_priv 
    +00079                  from jrn_def left join user_sec_jrn on uj_jrn_id=jrn_def_id
    +00080                     where uj_login='$p_user' and jrn_def_id=$p_jrn");
    +00081 
    +00082   $PrivJrn=pg_NumRows($Res2);
    +00083   $cn=DbConnect();
    +00084   // droit par défaut
    +00085   $Res=ExecSql($cn,"  select * 
    +00086                        from ac_users left join jnt_use_dos using (use_id) 
    +00087                        left join priv_user on (priv_jnt=jnt_id) 
    +00088                       where use_login='$p_user' and
    +00089                        dos_id=$p_dossier");
    +00090 
    +00091   $DefRight=pg_NumRows($Res);
    +00092   echo_debug ("PrivJrn = $PrivJrn DefRight $DefRight");
    +00093   // Si les droits par défaut == 0, alors user n'a pas accès au dossier
    +00094   if ( $DefRight == 0 ) return 0;
    +00095   $Def=pg_fetch_array($Res,0);
    +00096 
    +00097   // Si les droits par défaut == NO, alors user n'a pas accès au dossier
    +00098   if ( $Def['priv_priv'] == "NO" ) return 0;
    +00099 
    +00100   if ( $Def['priv_priv'] == "W") {
    +00101   // Si droit pas défaut == écriture      
    +00102     if ( $PrivJrn == 0 ) {
    +00103       // Pas de droit spécifique sur jrn => droit par défaut = W
    +00104       return 2;
    +00105     }
    +00106     $Priv=pg_fetch_array($Res2,0);
    +00107     
    +00108     if ( $Priv['uj_priv'] == "X" ) return 0;
    +00109     if ( $Priv['uj_priv'] == "R" ) return 1;
    +00110     if ( $Priv['uj_priv'] == "W" ) return 2;
    +00111     echo '<H2 class="error"> Undefined right</H2>';
    +00112     echo_debug ("Droit Journal $Priv[uj_priv]");
    +00113     return 0;
    +00114   }
    +00115   if ( $Def['priv_priv'] == "R") {
    +00116   // Si droit pas défaut == Lire
    +00117     if ( $PrivJrn == 0 ) {
    +00118       // Pas de droit spécifique sur jrn => droit par défaut = Lire
    +00119       return 1;
    +00120     }
    +00121     $Priv=pg_fetch_array($Res2,0);
    +00122     
    +00123     if ( $Priv['uj_priv'] == "X" ) return 0;
    +00124     if ( $Priv['uj_priv'] == "R" ) return 1;
    +00125     if ( $Priv['uj_priv'] == "W" ) return 2;
    +00126     echo_debug ("Droit Journal $Priv[uj_priv]");
    +00127     echo '<H2 class="error"> Undefined right</H2>';
    +00128     return 0;
    +00129   }
    +00130   echo '<H2 class="error"> Undefined default right</H2>';
    +00131   return 0;
    +00132 
    +00133 }
    +
    +

    + -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classAttribut.html b/doc/developper/html/classAttribut.html index c7883074d..26bd0e9dd 100644 --- a/doc/developper/html/classAttribut.html +++ b/doc/developper/html/classAttribut.html @@ -56,7 +56,13 @@ Definition at line

    -Definition at line 33 of file class_attribut.php. +Definition at line 33 of file class_attribut.php.

    00033                               {
    +00034     $this->ad_id=$p_ad_id;
    +00035     $this->cn=-1;
    +00036   }
    +
    +

    +


    Field Documentation

    @@ -161,8 +167,8 @@ Definition at line
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:09 2006 for phpcompta by  +
  • class_attribut.php
+
Generated on Thu Jun 29 21:21:24 2006 for phpcompta by  doxygen 1.4.4
diff --git a/doc/developper/html/classBalance.html b/doc/developper/html/classBalance.html index 907127d5b..b578e69a0 100644 --- a/doc/developper/html/classBalance.html +++ b/doc/developper/html/classBalance.html @@ -57,7 +57,13 @@ Definition at line 2

-Definition at line 33 of file class_balance.php. +Definition at line 33 of file class_balance.php.

00033                           {
+00034     $this->db=$p_cn;
+00035     $this->central='N';
+00036   }
+
+

+


Member Function Documentation

@@ -110,7 +116,70 @@ retrieve all the row from the ledger in the range of a periode

Definition at line 53 of file class_balance.php.

-References $a, $array, $i, $M, $r, $Res, $sql, ExecSql(), GetPosteLibelle(), and label. +References $a, $array, $i, $M, $r, $Res, $sql, ExecSql(), GetPosteLibelle(), and label.

00053                                                  {
+00054     // compute periode
+00055     if ( $p_from_periode==$p_to_periode ) {
+00056       $per_sql=" j_tech_per = $p_from_periode ";
+00057     } else {
+00058       $per_sql = "j_tech_per >=  $p_from_periode and j_tech_per <= $p_to_periode ";
+00059     }
+00060 
+00061 
+00062     // if centralized
+00063     $cent="";
+00064 
+00065     if ( $this->central=='Y' ) { $cent="j_centralized = true and "; }
+00066 
+00067     // build query
+00068     $sql="select j_poste,sum(deb) as sum_deb, sum(cred) as sum_cred from 
+00069           ( select j_poste,
+00070              case when j_debit='t' then j_montant else 0 end as deb,
+00071              case when j_debit='f' then j_montant else 0 end as cred
+00072           from jrnx join tmp_pcmn on j_poste=pcm_val
+00073               where 
+00074              $cent
+00075             $per_sql ) as m group by j_poste order by j_poste::text";
+00076 
+00077     $Res=ExecSql($this->db,$sql);
+00078 
+00079     $tot_cred=  0.0;
+00080     $tot_deb=  0.0;
+00081     $tot_deb_saldo=0.0;
+00082     $tot_cred_saldo=0.0;
+00083     $M=pg_NumRows($Res);
+00084     // Load the array
+00085     for ($i=0; $i <$M;$i++) {
+00086       $r=pg_fetch_array($Res,$i);
+00087       $a['poste']=$r['j_poste'];
+00088       $a['label']=substr(GetPosteLibelle($this->db,$r['j_poste'],1),0,40);
+00089       $a['sum_deb']=round($r['sum_deb'],2);
+00090       $a['sum_cred']=round($r['sum_cred'],2);
+00091       $a['solde_deb']=round(( $a['sum_deb']  >=  $a['sum_cred'] )? $a['sum_deb']- $a['sum_cred']:0,2);
+00092       $a['solde_cred']=round(( $a['sum_deb'] <=  $a['sum_cred'] )?$a['sum_cred']-$a['sum_deb']:0,2);
+00093       $array[$i]=$a;
+00094       $tot_cred+=  $a['sum_cred'];
+00095       $tot_deb+= $a['sum_deb']; 
+00096       $tot_deb_saldo+= $a['solde_deb'];
+00097       $tot_cred_saldo+= $a['solde_cred'];
+00098       
+00099       
+00100     }//for i
+00101     // Add the saldo
+00102     $i+=1;
+00103     $a['poste']="";
+00104     $a['label']="<b> Totaux </b>";
+00105     $a['sum_deb']=$tot_deb;
+00106     $a['sum_cred']=$tot_cred;
+00107     $a['solde_deb']=$tot_deb_saldo;
+00108     $a['solde_cred']=$tot_cred_saldo;
+00109     $array[$i]=$a;
+00110     $this->row=$array;
+00111     return $array;
+00112 
+00113   }
+
+

+


Field Documentation

@@ -190,8 +259,8 @@ Definition at line 3
The documentation for this class was generated from the following file:
-
Generated on Thu Jun 29 00:04:09 2006 for phpcompta by  +
  • class_balance.php +
    Generated on Thu Jun 29 21:21:24 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classCezpdf.html b/doc/developper/html/classCezpdf.html index e6d21b54f..9071df63b 100644 --- a/doc/developper/html/classCezpdf.html +++ b/doc/developper/html/classCezpdf.html @@ -130,7 +130,111 @@ Definition at line 28<

    References $a, $size, Cpdf::Cpdf(), Cpdf::getFirstPageId(), and size.

    -Referenced by Creport::Creport(). +Referenced by Creport::Creport().

    00028                                                     {
    +00029         // Assuming that people don't want to specify the paper size using the absolute coordinates
    +00030         // allow a couple of options:
    +00031         // orientation can be 'portrait' or 'landscape'
    +00032         // or, to actually set the coordinates, then pass an array in as the first parameter.
    +00033         // the defaults are as shown.
    +00034         // 
    +00035         // -------------------------
    +00036         // 2002-07-24 - Nicola Asuni (info@tecnick.com):
    +00037         // Added new page formats (45 standard ISO paper formats and 4 american common formats)
    +00038         // paper cordinates are calculated in this way: (inches * 72) where 1 inch = 2.54 cm
    +00039         // 
    +00040         // Now you may also pass a 2 values array containing the page width and height in centimeters
    +00041         // -------------------------
    +00042 
    +00043         if (!is_array($paper)){
    +00044                 switch (strtoupper($paper)){
    +00045                         case '4A0': {$size = array(0,0,4767.87,6740.79); break;}
    +00046                         case '2A0': {$size = array(0,0,3370.39,4767.87); break;}
    +00047                         case 'A0': {$size = array(0,0,2383.94,3370.39); break;}
    +00048                         case 'A1': {$size = array(0,0,1683.78,2383.94); break;}
    +00049                         case 'A2': {$size = array(0,0,1190.55,1683.78); break;}
    +00050                         case 'A3': {$size = array(0,0,841.89,1190.55); break;}
    +00051                         case 'A4': default: {$size = array(0,0,595.28,841.89); break;}
    +00052                         case 'A5': {$size = array(0,0,419.53,595.28); break;}
    +00053                         case 'A6': {$size = array(0,0,297.64,419.53); break;}
    +00054                         case 'A7': {$size = array(0,0,209.76,297.64); break;}
    +00055                         case 'A8': {$size = array(0,0,147.40,209.76); break;}
    +00056                         case 'A9': {$size = array(0,0,104.88,147.40); break;}
    +00057                         case 'A10': {$size = array(0,0,73.70,104.88); break;}
    +00058                         case 'B0': {$size = array(0,0,2834.65,4008.19); break;}
    +00059                         case 'B1': {$size = array(0,0,2004.09,2834.65); break;}
    +00060                         case 'B2': {$size = array(0,0,1417.32,2004.09); break;}
    +00061                         case 'B3': {$size = array(0,0,1000.63,1417.32); break;}
    +00062                         case 'B4': {$size = array(0,0,708.66,1000.63); break;}
    +00063                         case 'B5': {$size = array(0,0,498.90,708.66); break;}
    +00064                         case 'B6': {$size = array(0,0,354.33,498.90); break;}
    +00065                         case 'B7': {$size = array(0,0,249.45,354.33); break;}
    +00066                         case 'B8': {$size = array(0,0,175.75,249.45); break;}
    +00067                         case 'B9': {$size = array(0,0,124.72,175.75); break;}
    +00068                         case 'B10': {$size = array(0,0,87.87,124.72); break;}
    +00069                         case 'C0': {$size = array(0,0,2599.37,3676.54); break;}
    +00070                         case 'C1': {$size = array(0,0,1836.85,2599.37); break;}
    +00071                         case 'C2': {$size = array(0,0,1298.27,1836.85); break;}
    +00072                         case 'C3': {$size = array(0,0,918.43,1298.27); break;}
    +00073                         case 'C4': {$size = array(0,0,649.13,918.43); break;}
    +00074                         case 'C5': {$size = array(0,0,459.21,649.13); break;}
    +00075                         case 'C6': {$size = array(0,0,323.15,459.21); break;}
    +00076                         case 'C7': {$size = array(0,0,229.61,323.15); break;}
    +00077                         case 'C8': {$size = array(0,0,161.57,229.61); break;}
    +00078                         case 'C9': {$size = array(0,0,113.39,161.57); break;}
    +00079                         case 'C10': {$size = array(0,0,79.37,113.39); break;}
    +00080                         case 'RA0': {$size = array(0,0,2437.80,3458.27); break;}
    +00081                         case 'RA1': {$size = array(0,0,1729.13,2437.80); break;}
    +00082                         case 'RA2': {$size = array(0,0,1218.90,1729.13); break;}
    +00083                         case 'RA3': {$size = array(0,0,864.57,1218.90); break;}
    +00084                         case 'RA4': {$size = array(0,0,609.45,864.57); break;}
    +00085                         case 'SRA0': {$size = array(0,0,2551.18,3628.35); break;}
    +00086                         case 'SRA1': {$size = array(0,0,1814.17,2551.18); break;}
    +00087                         case 'SRA2': {$size = array(0,0,1275.59,1814.17); break;}
    +00088                         case 'SRA3': {$size = array(0,0,907.09,1275.59); break;}
    +00089                         case 'SRA4': {$size = array(0,0,637.80,907.09); break;}
    +00090                         case 'LETTER': {$size = array(0,0,612.00,792.00); break;}
    +00091                         case 'LEGAL': {$size = array(0,0,612.00,1008.00); break;}
    +00092                         case 'EXECUTIVE': {$size = array(0,0,521.86,756.00); break;}
    +00093                         case 'FOLIO': {$size = array(0,0,612.00,936.00); break;}
    +00094                 }
    +00095                 switch (strtolower($orientation)){
    +00096                         case 'landscape':
    +00097                                 $a=$size[3];
    +00098                                 $size[3]=$size[2];
    +00099                                 $size[2]=$a;
    +00100                                 break;
    +00101                 }
    +00102         } else {
    +00103                 if (count($paper)>2) {
    +00104                         // then an array was sent it to set the size
    +00105                         $size = $paper;
    +00106                 }
    +00107                 else { //size in centimeters has been passed
    +00108                         $size[0] = 0;
    +00109                         $size[1] = 0;
    +00110                         $size[2] = ( $paper[0] / 2.54 ) * 72;
    +00111                         $size[3] = ( $paper[1] / 2.54 ) * 72;
    +00112                 }
    +00113         }
    +00114         $this->Cpdf($size);
    +00115         $this->ez['pageWidth']=$size[2];
    +00116         $this->ez['pageHeight']=$size[3];
    +00117         
    +00118         // also set the margins to some reasonable defaults
    +00119         $this->ez['topMargin']=30;
    +00120         $this->ez['bottomMargin']=30;
    +00121         $this->ez['leftMargin']=30;
    +00122         $this->ez['rightMargin']=30;
    +00123         
    +00124         // set the current writing position to the top of the first page
    +00125         $this->y = $this->ez['pageHeight']-$this->ez['topMargin'];
    +00126         // and get the ID of the page that was created during the instancing process.
    +00127         $this->ezPages[1]=$this->getFirstPageId();
    +00128         $this->ezPageCount=1;
    +00129 }
    +
    +

    +


    Member Function Documentation

    @@ -174,7 +278,51 @@ Definition at line 147

    References $a, $i, $start, and start.

    -Referenced by ezTable(). +Referenced by ezTable().

    01473                                  {
    +01474   // a callback function to support the formation of clickable links within the document
    +01475   $lineFactor=0.05; // the thickness of the line as a proportion of the height. also the drop of the line.
    +01476   switch($info['status']){
    +01477     case 'start':
    +01478     case 'sol':
    +01479       // the beginning of the link
    +01480       // this should contain the URl for the link as the 'p' entry, and will also contain the value of 'nCallback'
    +01481       if (!isset($this->ez['links'])){
    +01482         $this->ez['links']=array();
    +01483       }
    +01484       $i = $info['nCallback'];
    +01485       $this->ez['links'][$i] = array('x'=>$info['x'],'y'=>$info['y'],'angle'=>$info['angle'],'decender'=>$info['decender'],'height'=>$info['height'],'url'=>$info['p']);
    +01486       if ($internal==0){
    +01487         $this->saveState();
    +01488         $this->setColor(0,0,1);
    +01489         $this->setStrokeColor(0,0,1);
    +01490         $thick = $info['height']*$lineFactor;
    +01491         $this->setLineStyle($thick);
    +01492       }
    +01493       break;
    +01494     case 'end':
    +01495     case 'eol':
    +01496       // the end of the link
    +01497       // assume that it is the most recent opening which has closed
    +01498       $i = $info['nCallback'];
    +01499       $start = $this->ez['links'][$i];
    +01500       // add underlining
    +01501       if ($internal){
    +01502         $this->addInternalLink($start['url'],$start['x'],$start['y']+$start['decender'],$info['x'],$start['y']+$start['decender']+$start['height']);
    +01503       } else {
    +01504         $a = deg2rad((float)$start['angle']-90.0);
    +01505         $drop = $start['height']*$lineFactor*1.5;
    +01506         $dropx = cos($a)*$drop;
    +01507         $dropy = -sin($a)*$drop;
    +01508         $this->line($start['x']-$dropx,$start['y']-$dropy,$info['x']-$dropx,$info['y']-$dropy);
    +01509         $this->addLink($start['url'],$start['x'],$start['y']+$start['decender'],$info['x'],$start['y']+$start['decender']+$start['height']);
    +01510         $this->restoreState();
    +01511       }
    +01512       break;
    +01513   }
    +01514 }
    +
    +

    +

    @@ -219,7 +367,16 @@ Referenced by ezTable(

    -Definition at line 1460 of file class.ezpdf.php. +Definition at line 1460 of file class.ezpdf.php.

    01460                                                          {
    +01461   // execute the given template on the current document.
    +01462   if (!isset($this->ez['templates'][$id])){
    +01463     return;
    +01464   }
    +01465   eval($this->ez['templates'][$id]['code']);
    +01466 }
    +
    +

    +

    @@ -251,7 +408,41 @@ Definition at line 146

    Definition at line 144 of file class.ezpdf.php.

    -References Cpdf::$options, and width. +References Cpdf::$options, and width.

    00144                                          {
    +00145   // start from the current y-position, make the set number of columne
    +00146   if (isset($this->ez['columns']) && $this->ez['columns']==1){
    +00147     // if we are already in a column mode then just return.
    +00148     return;
    +00149   }
    +00150   $def=array('gap'=>10,'num'=>2);
    +00151   foreach($def as $k=>$v){
    +00152     if (!isset($options[$k])){
    +00153       $options[$k]=$v;
    +00154     }
    +00155   }
    +00156   // setup the columns
    +00157   $this->ez['columns']=array('on'=>1,'colNum'=>1);
    +00158 
    +00159   // store the current margins
    +00160   $this->ez['columns']['margins']=array(
    +00161      $this->ez['leftMargin']
    +00162     ,$this->ez['rightMargin']
    +00163     ,$this->ez['topMargin']
    +00164     ,$this->ez['bottomMargin']
    +00165   );
    +00166   // and store the settings for the columns
    +00167   $this->ez['columns']['options']=$options;
    +00168   // then reset the margins to suit the new columns
    +00169   // safe enough to assume the first column here, but start from the current y-position
    +00170   $this->ez['topMargin']=$this->ez['pageHeight']-$this->y;
    +00171   $width=($this->ez['pageWidth']-$this->ez['leftMargin']-$this->ez['rightMargin']-($options['num']-1)*$options['gap'])/$options['num'];
    +00172   $this->ez['columns']['width']=$width;
    +00173   $this->ez['rightMargin']=$this->ez['pageWidth']-$this->ez['leftMargin']-$width;
    +00174   
    +00175 }
    +
    +

    +

    @@ -280,7 +471,18 @@ References Cpdf::$option

    -Definition at line 177 of file class.ezpdf.php. +Definition at line 177 of file class.ezpdf.php.

    00177                         {
    +00178   if (isset($this->ez['columns']) && $this->ez['columns']['on']==1){
    +00179     $this->ez['columns']['on']=0;
    +00180     $this->ez['leftMargin']=$this->ez['columns']['margins'][0];
    +00181     $this->ez['rightMargin']=$this->ez['columns']['margins'][1];
    +00182     $this->ez['topMargin']=$this->ez['columns']['margins'][2];
    +00183     $this->ez['bottomMargin']=$this->ez['columns']['margins'][3];
    +00184   }
    +00185 }
    +
    +

    +

    @@ -309,7 +511,13 @@ Definition at line 177

    -Definition at line 266 of file class.ezpdf.php. +Definition at line 266 of file class.ezpdf.php.

    00266                                  {
    +00267   // return the strict numbering (1,2,3,4..) number of the current page
    +00268   return $this->ezPageCount;
    +00269 }
    +
    +

    +

    @@ -374,7 +582,127 @@ Definition at line 266

    Definition at line 1301 of file class.ezpdf.php.

    -References width. +References width.

    01301                                                                                            {
    +01302         //beta ezimage function
    +01303         if (stristr($image,'://'))//copy to temp file
    +01304         {
    +01305                 $fp = @fopen($image,"rb");
    +01306                 while(!feof($fp))
    +01307                 {
    +01308                         $cont.= fread($fp,1024);
    +01309                 }
    +01310                 fclose($fp);
    +01311                 $image = tempnam ("/tmp", "php-pdf");
    +01312                 $fp2 = @fopen($image,"w");
    +01313                 fwrite($fp2,$cont);
    +01314                 fclose($fp2);
    +01315                 $temp = true;
    +01316         }
    +01317 
    +01318         if (!(file_exists($image))) return false; //return immediately if image file does not exist
    +01319         $imageInfo = getimagesize($image);
    +01320         switch ($imageInfo[2]){
    +01321                 case 2:
    +01322                         $type = "jpeg";
    +01323                         break;
    +01324                 case 3:
    +01325                         $type = "png";
    +01326                         break;
    +01327                 default:
    +01328                         return false; //return if file is not jpg or png
    +01329         }
    +01330         if ($width == 0) $width = $imageInfo[0]; //set width
    +01331         $ratio = $imageInfo[0]/$imageInfo[1];
    +01332 
    +01333         //get maximum width of image
    +01334         if (isset($this->ez['columns']) && $this->ez['columns']['on'] == 1)
    +01335         {
    +01336                 $bigwidth = $this->ez['columns']['width'] - ($pad * 2);
    +01337         }
    +01338         else
    +01339         {
    +01340                 $bigwidth = $this->ez['pageWidth'] - ($pad * 2);
    +01341         }
    +01342         //fix width if larger than maximum or if $resize=full
    +01343         if ($resize == 'full' || $resize == 'width' || $width > $bigwidth)
    +01344         {
    +01345                 $width = $bigwidth;
    +01346 
    +01347         }
    +01348 
    +01349         $height = ($width/$ratio); //set height
    +01350 
    +01351         //fix size if runs off page
    +01352         if ($height > ($this->y - $this->ez['bottomMargin'] - ($pad * 2)))
    +01353         {
    +01354                 if ($resize != 'full')
    +01355                 {
    +01356                         $this->ezNewPage();
    +01357                 }
    +01358                 else
    +01359                 {
    +01360                         $height = ($this->y - $this->ez['bottomMargin'] - ($pad * 2)); //shrink height
    +01361                         $width = ($height*$ratio); //fix width
    +01362                 }
    +01363         }
    +01364 
    +01365         //fix x-offset if image smaller than bigwidth
    +01366         if ($width < $bigwidth)
    +01367         {
    +01368                 //center if justification=center
    +01369                 if ($just == 'center')
    +01370                 {
    +01371                         $offset = ($bigwidth - $width) / 2;
    +01372                 }
    +01373                 //move to right if justification=right
    +01374                 if ($just == 'right')
    +01375                 {
    +01376                         $offset = ($bigwidth - $width);
    +01377                 }
    +01378                 //leave at left if justification=left
    +01379                 if ($just == 'left')
    +01380                 {
    +01381                         $offset = 0;
    +01382                 }
    +01383         }
    +01384 
    +01385 
    +01386         //call appropriate function
    +01387         if ($type == "jpeg"){
    +01388                 $this->addJpegFromFile($image,$this->ez['leftMargin'] + $pad + $offset, $this->y + $this->getFontHeight($this->ez['fontSize']) - $pad - $height,$width);
    +01389         }
    +01390 
    +01391         if ($type == "png"){
    +01392                 $this->addPngFromFile($image,$this->ez['leftMargin'] + $pad + $offset, $this->y + $this->getFontHeight($this->ez['fontSize']) - $pad - $height,$width);
    +01393         }
    +01394         //draw border
    +01395         if ($border != '')
    +01396         {
    +01397         if (!(isset($border['color'])))
    +01398         {
    +01399                 $border['color']['red'] = .5;
    +01400                 $border['color']['blue'] = .5;
    +01401                 $border['color']['green'] = .5;
    +01402         }
    +01403         if (!(isset($border['width']))) $border['width'] = 1;
    +01404         if (!(isset($border['cap']))) $border['cap'] = 'round';
    +01405         if (!(isset($border['join']))) $border['join'] = 'round';
    +01406         
    +01407 
    +01408         $this->setStrokeColor($border['color']['red'],$border['color']['green'],$border['color']['blue']);
    +01409         $this->setLineStyle($border['width'],$border['cap'],$border['join']);
    +01410         $this->rectangle($this->ez['leftMargin'] + $pad + $offset, $this->y + $this->getFontHeight($this->ez['fontSize']) - $pad - $height,$width,$height);
    +01411 
    +01412         }
    +01413         // move y below image
    +01414         $this->y = $this->y - $pad - $height;
    +01415         //remove tempfile for remote images
    +01416         if ($temp == true) unlink($image);
    +01417 
    +01418 }
    +
    +

    +

    @@ -419,7 +747,24 @@ References width. <

    -Definition at line 187 of file class.ezpdf.php. +Definition at line 187 of file class.ezpdf.php.

    00187                                                          {
    +00188   // puts the document into insert mode. new pages are inserted until this is re-called with status=0
    +00189   // by default pages wil be inserted at the start of the document
    +00190   switch($status){
    +00191     case '1':
    +00192       if (isset($this->ezPages[$pageNum])){
    +00193         $this->ez['insertMode']=1;
    +00194         $this->ez['insertOptions']=array('id'=>$this->ezPages[$pageNum],'pos'=>$pos);
    +00195       }
    +00196       break;
    +00197     case '0':
    +00198       $this->ez['insertMode']=0;
    +00199       break;
    +00200   }
    +00201 }
    +
    +

    +

    @@ -452,7 +797,48 @@ Definition at line 204

    References Cpdf::newPage(), and width.

    -Referenced by ezPrvtTableColumnHeadings(), ezSetDy(), ezSetMargins(), ezSetY(), ezTable(), and ezText(). +Referenced by ezPrvtTableColumnHeadings(), ezSetDy(), ezSetMargins(), ezSetY(), ezTable(), and ezText().

    00204                     {
    +00205   $pageRequired=1;
    +00206   if (isset($this->ez['columns']) && $this->ez['columns']['on']==1){
    +00207     // check if this is just going to a new column
    +00208     // increment the column number
    +00209 //echo 'HERE<br>';
    +00210     $this->ez['columns']['colNum']++;
    +00211 //echo $this->ez['columns']['colNum'].'<br>';
    +00212     if ($this->ez['columns']['colNum'] <= $this->ez['columns']['options']['num']){
    +00213       // then just reset to the top of the next column
    +00214       $pageRequired=0;
    +00215     } else {
    +00216       $this->ez['columns']['colNum']=1;
    +00217       $this->ez['topMargin']=$this->ez['columns']['margins'][2];
    +00218     }
    +00219 
    +00220     $width = $this->ez['columns']['width'];
    +00221     $this->ez['leftMargin']=$this->ez['columns']['margins'][0]+($this->ez['columns']['colNum']-1)*($this->ez['columns']['options']['gap']+$width);
    +00222     $this->ez['rightMargin']=$this->ez['pageWidth']-$this->ez['leftMargin']-$width;
    +00223   }
    +00224 //echo 'left='.$this->ez['leftMargin'].'   right='.$this->ez['rightMargin'].'<br>';
    +00225 
    +00226   if ($pageRequired){
    +00227     // make a new page, setting the writing point back to the top
    +00228     $this->y = $this->ez['pageHeight']-$this->ez['topMargin'];
    +00229     // make the new page with a call to the basic class.
    +00230     $this->ezPageCount++;
    +00231     if (isset($this->ez['insertMode']) && $this->ez['insertMode']==1){
    +00232       $id = $this->ezPages[$this->ezPageCount] = $this->newPage(1,$this->ez['insertOptions']['id'],$this->ez['insertOptions']['pos']);
    +00233       // then manipulate the insert options so that inserted pages follow each other
    +00234       $this->ez['insertOptions']['id']=$id;
    +00235       $this->ez['insertOptions']['pos']='after';
    +00236     } else {
    +00237       $this->ezPages[$this->ezPageCount] = $this->newPage();
    +00238     }
    +00239   } else {
    +00240     $this->y = $this->ez['pageHeight']-$this->ez['topMargin'];
    +00241   }
    +00242 }
    +
    +

    +

    @@ -484,7 +870,13 @@ Referenced by ezPrvtTa

    Definition at line 461 of file class.ezpdf.php.

    -References ezPRVTcleanUp(), and Cpdf::output(). +References ezPRVTcleanUp(), and Cpdf::output().

    00461                              {
    +00462   $this->ezPRVTcleanUp();
    +00463   return $this->output($options);
    +00464 }
    +
    +

    +

    @@ -518,7 +910,16 @@ Definition at line 119

    References $search.

    -Referenced by ezTable(), and ezText(). +Referenced by ezTable(), and ezText().

    01195                              {
    +01196   // this function will intially be used to implement underlining support, but could be used for a range of other
    +01197   // purposes
    +01198   $search = array('<u>','<U>','</u>','</U>');
    +01199   $replace = array('<c:uline>','<c:uline>','</c:uline>','</c:uline>');
    +01200   return str_replace($search,$replace,$text);
    +01201 }
    +
    +

    +

    @@ -551,7 +952,77 @@ Definition at line 377

    References $l, $num, $tmp, $w, Cpdf::addText(), Cpdf::closeObject(), ezPRVTpageNumberSearch(), Cpdf::getTextWidth(), Cpdf::reopenObject(), and size.

    -Referenced by ezPRVTcleanUp(). +Referenced by ezPRVTcleanUp().

    00377                                {
    +00378   // this will go through the pageNumbering array and add the page numbers are required
    +00379   if (isset($this->ez['pageNumbering'])){
    +00380     $totalPages1 = $this->ezPageCount;
    +00381     $tmp1=$this->ez['pageNumbering'];
    +00382     $status=0;
    +00383     foreach($tmp1 as $i=>$tmp){
    +00384       // do each of the page numbering systems
    +00385       // firstly, find the total pages for this one
    +00386       $k = $this->ezPRVTpageNumberSearch('stopt',$tmp);
    +00387       if ($k && $k>0){
    +00388         $totalPages = $k-1;
    +00389       } else {
    +00390         $l = $this->ezPRVTpageNumberSearch('stoptn',$tmp);
    +00391         if ($l && $l>0){
    +00392           $totalPages = $l;
    +00393         } else {
    +00394           $totalPages = $totalPages1;
    +00395         }
    +00396       }
    +00397       foreach ($this->ezPages as $pageNum=>$id){
    +00398         if (isset($tmp[$pageNum])){
    +00399           if (is_array($tmp[$pageNum])){
    +00400             // then this must be starting page numbers
    +00401             $status=1;
    +00402             $info = $tmp[$pageNum];
    +00403             $info['dnum']=$info['num']-$pageNum;
    +00404             // also check for the special case of the numbering stopping and starting on the same page
    +00405             if (isset($info['stopn']) || isset($info['stoptn']) ){
    +00406               $status=2;
    +00407             }
    +00408           } else if ($tmp[$pageNum]=='stop' || $tmp[$pageNum]=='stopt'){
    +00409             // then we are stopping page numbers
    +00410             $status=0;
    +00411           } else if ($status==1 && ($tmp[$pageNum]=='stoptn' || $tmp[$pageNum]=='stopn')){
    +00412             // then we are stopping page numbers
    +00413             $status=2;
    +00414           }
    +00415         }
    +00416         if ($status){
    +00417           // then add the page numbering to this page
    +00418           if (strlen($info['num'])){
    +00419             $num=$pageNum+$info['dnum'];
    +00420           } else {
    +00421             $num=$pageNum;
    +00422           }
    +00423           $total = $totalPages+$num-$pageNum;
    +00424           $pat = str_replace('{PAGENUM}',$num,$info['pattern']);
    +00425           $pat = str_replace('{TOTALPAGENUM}',$total,$pat);
    +00426           $this->reopenObject($id);
    +00427           switch($info['pos']){
    +00428             case 'right':
    +00429               $this->addText($info['x'],$info['y'],$info['size'],$pat);
    +00430               break;
    +00431             default:
    +00432               $w=$this->getTextWidth($info['size'],$pat);
    +00433               $this->addText($info['x']-$w,$info['y'],$info['size'],$pat);
    +00434               break;
    +00435           }
    +00436           $this->closeObject();
    +00437         }
    +00438         if ($status==2){
    +00439           $status=0;
    +00440         }
    +00441       }
    +00442     }
    +00443   }
    +00444 }
    +
    +

    +

    @@ -584,7 +1055,12 @@ Definition at line 448

    References ezPRVTaddPageNumbers().

    -Referenced by ezOutput(), and ezStream(). +Referenced by ezOutput(), and ezStream().

    00448                         {
    +00449   $this->ezPRVTaddPageNumbers();
    +00450 }
    +
    +

    +

    @@ -627,7 +1103,22 @@ Definition at line 591

    References $w, Cpdf::getTextWidth(), Cpdf::line(), and size.

    -Referenced by ezTable(). +Referenced by ezTable().

    00591                                         {
    +00592   // will calculate the maximum width, taking into account that the text may be broken
    +00593   // by line breaks.
    +00594   $mx=0;
    +00595   $lines = explode("\n",$text);
    +00596   foreach ($lines as $line){
    +00597     $w = $this->getTextWidth($size,$line);
    +00598     if ($w>$mx){
    +00599       $mx=$w;
    +00600     }
    +00601   }
    +00602   return $mx;
    +00603 }
    +
    +

    +

    @@ -670,7 +1161,23 @@ Definition at line 360

    References $i.

    -Referenced by ezPRVTaddPageNumbers(). +Referenced by ezPRVTaddPageNumbers().

    00360                                            {
    +00361   foreach($tmp as $i=>$v){
    +00362     if (is_array($v)){
    +00363       if (isset($v[$lbl])){
    +00364         return $i;
    +00365       }
    +00366     } else {
    +00367       if ($v==$lbl){
    +00368         return $i;
    +00369       }
    +00370     }
    +00371   }
    +00372   return 0;
    +00373 }
    +
    +

    +

    @@ -755,7 +1262,71 @@ Definition at line 526

    References $ok, Cpdf::$options, $y, ezNewPage(), ezSetY(), ezText(), size, start, and Cpdf::transaction().

    -Referenced by ezTable(). +Referenced by ezTable().

    00526                                                                                                              {
    +00527   // uses ezText to add the text, and returns the height taken by the largest heading
    +00528   // this page will move the headings to a new page if they will not fit completely on this one
    +00529   // transaction support will be used to implement this
    +00530 
    +00531   if (isset($optionsAll['cols'])){
    +00532     $options = $optionsAll['cols'];
    +00533   } else {
    +00534     $options = array();
    +00535   }
    +00536   
    +00537   $mx=0;
    +00538   $startPage = $this->ezPageCount;
    +00539   $secondGo=0;
    +00540 
    +00541   // $y is the position at which the top of the table should start, so the base
    +00542   // of the first text, is $y-$height-$gap-$decender, but ezText starts by dropping $height
    +00543   
    +00544   // the return from this function is the total cell height, including gaps, and $y is adjusted
    +00545   // to be the postion of the bottom line
    +00546   
    +00547   // begin the transaction
    +00548   $this->transaction('start');
    +00549   $ok=0;
    +00550 //  $y-=$gap-$decender;
    +00551   $y-=$gap;
    +00552   while ($ok==0){
    +00553     foreach($cols as $colName=>$colHeading){
    +00554       $this->ezSetY($y);
    +00555       if (isset($options[$colName]) && isset($options[$colName]['justification'])){
    +00556         $justification = $options[$colName]['justification'];
    +00557       } else {
    +00558         $justification = 'left';
    +00559       }
    +00560       $this->ezText($colHeading,$size,array('aleft'=> $pos[$colName],'aright'=>($maxWidth[$colName]+$pos[$colName]),'justification'=>$justification));
    +00561       $dy = $y-$this->y;
    +00562       if ($dy>$mx){
    +00563         $mx=$dy;
    +00564       }
    +00565     }
    +00566     $y = $y - $mx - $gap + $decender;
    +00567 //    $y -= $mx-$gap+$decender;
    +00568     
    +00569     // now, if this has moved to a new page, then abort the transaction, move to a new page, and put it there
    +00570     // do not check on the second time around, to avoid an infinite loop
    +00571     if ($this->ezPageCount != $startPage && $secondGo==0){
    +00572       $this->transaction('rewind');
    +00573       $this->ezNewPage();
    +00574       $y = $this->y - $gap-$decender;
    +00575       $ok=0;
    +00576       $secondGo=1;
    +00577 //      $y = $store_y;
    +00578       $mx=0;
    +00579 
    +00580     } else {
    +00581       $this->transaction('commit');
    +00582       $ok=1;
    +00583     }
    +00584   }
    +00585 
    +00586   return $mx+$gap*2-$decender;
    +00587 }
    +
    +

    +

    @@ -852,7 +1423,35 @@ Definition at line 497

    References $n, $x, Cpdf::line(), Cpdf::setLineStyle(), and Cpdf::setStrokeColor().

    -Referenced by ezTable(). +Referenced by ezTable().

    00497                                                                                       {
    +00498   $x0=1000;
    +00499   $x1=0;
    +00500   $this->setStrokeColor($col[0],$col[1],$col[2]);
    +00501   $cnt=0;
    +00502   $n = count($pos);
    +00503   foreach($pos as $x){
    +00504     $cnt++;
    +00505     if ($cnt==1 || $cnt==$n){
    +00506       $this->setLineStyle($outer);
    +00507     } else {
    +00508       $this->setLineStyle($inner);
    +00509     }
    +00510     $this->line($x-$gap/2,$y0,$x-$gap/2,$y2);
    +00511     if ($x>$x1){ $x1=$x; };
    +00512     if ($x<$x0){ $x0=$x; };
    +00513   }
    +00514   $this->setLineStyle($outer);
    +00515   $this->line($x0-$gap/2-$outer/2,$y0,$x1-$gap/2+$outer/2,$y0);
    +00516   // only do the second line if it is different to the first, AND each row does not have
    +00517   // a line on it.
    +00518   if ($y0!=$y1 && $opt<2){
    +00519     $this->line($x0-$gap/2,$y1,$x1-$gap/2,$y1);
    +00520   }
    +00521   $this->line($x0-$gap/2-$outer/2,$y2,$x1-$gap/2+$outer/2,$y2);
    +00522 }
    +
    +

    +

    @@ -905,7 +1504,16 @@ Referenced by ezTable(

    Definition at line 134 of file class.ezpdf.php.

    -References $right, and ezSetMargins(). +References $right, and ezSetMargins().

    00134                                                   {
    +00135         $top = ( $top / 2.54 ) * 72;
    +00136         $bottom = ( $bottom / 2.54 ) * 72;
    +00137         $left = ( $left / 2.54 ) * 72;
    +00138         $right = ( $right / 2.54 ) * 72;
    +00139         $this->ezSetMargins($top,$bottom,$left,$right);
    +00140 }
    +
    +

    +

    @@ -946,7 +1554,24 @@ References $right, an

    Definition at line 479 of file class.ezpdf.php.

    -References ezNewPage(). +References ezNewPage().

    00479                              {
    +00480   // used to change the vertical position of the writing point.
    +00481   // changes up by a positive increment, so enter a negative number to go
    +00482   // down the page
    +00483   // if $mod is set to 'makeSpace' and a new page is forced, then the pointed will be moved 
    +00484   // down on the new page, this will allow space to be reserved for graphics etc.
    +00485   $this->y += $dy;
    +00486   if ( $this->y < $this->ez['bottomMargin']){
    +00487     // then make a new page
    +00488     $this->ezNewPage();
    +00489     if ($mod=='makeSpace'){
    +00490       $this->y += $dy;
    +00491     }
    +00492   }
    +00493 }
    +
    +

    +

    @@ -1001,7 +1626,26 @@ Definition at line 246

    References $right, and ezNewPage().

    -Referenced by ezSetCmMargins(). +Referenced by ezSetCmMargins().

    00246                                                 {
    +00247   // sets the margins to new values
    +00248   $this->ez['topMargin']=$top;
    +00249   $this->ez['bottomMargin']=$bottom;
    +00250   $this->ez['leftMargin']=$left;
    +00251   $this->ez['rightMargin']=$right;
    +00252   // check to see if this means that the current writing position is outside the 
    +00253   // writable area
    +00254   if ($this->y > $this->ez['pageHeight']-$top){
    +00255     // then move y down
    +00256     $this->y = $this->ez['pageHeight']-$top;
    +00257   }
    +00258   if ( $this->y < $bottom){
    +00259     // then make a new page
    +00260     $this->ezNewPage();
    +00261   }
    +00262 }  
    +
    +

    +

    @@ -1035,7 +1679,17 @@ Definition at line 468

    References $y, and ezNewPage().

    -Referenced by ezPrvtTableColumnHeadings(), and ezTable(). +Referenced by ezPrvtTableColumnHeadings(), and ezTable().

    00468                    {
    +00469   // used to change the vertical position of the writing point.
    +00470   $this->y = $y;
    +00471   if ( $this->y < $this->ez['bottomMargin']){
    +00472     // then make a new page
    +00473     $this->ezNewPage();
    +00474   }
    +00475 }
    +
    +

    +

    @@ -1090,7 +1744,32 @@ Definition at line 273

    References $i, and size.

    -Referenced by ezWhatPageNumber(). +Referenced by ezWhatPageNumber().

    00273                                                               {PAGENUM} of {TOTALPAGENUM}',$num=''){
    +00274   // put page numbers on the pages from here.
    +00275   // place then on the 'pos' side of the coordinates (x,y).
    +00276   // pos can be 'left' or 'right'
    +00277   // use the given 'pattern' for display, where (PAGENUM} and {TOTALPAGENUM} are replaced
    +00278   // as required.
    +00279   // if $num is set, then make the first page this number, the number of total pages will
    +00280   // be adjusted to account for this.
    +00281   // Adjust this function so that each time you 'start' page numbers then you effectively start a different batch
    +00282   // return the number of the batch, so that they can be stopped in a different order if required.
    +00283   if (!$pos || !strlen($pos)){
    +00284     $pos='left';
    +00285   }
    +00286   if (!$pattern || !strlen($pattern)){
    +00287     $pattern='{PAGENUM} of {TOTALPAGENUM}';
    +00288   }
    +00289   if (!isset($this->ez['pageNumbering'])){
    +00290     $this->ez['pageNumbering']=array();
    +00291   }
    +00292   $i = count($this->ez['pageNumbering']);
    +00293   $this->ez['pageNumbering'][$i][$this->ezPageCount]=array('x'=>$x,'y'=>$y,'pos'=>$pos,'pattern'=>$pattern,'num'=>$num,'size'=>$size);
    +00294   return $i;
    +00295 }
    +
    +

    +

    @@ -1137,7 +1816,35 @@ Referenced by ezWhatPa

    Definition at line 331 of file class.ezpdf.php.

    -References $i. +References $i.

    00331                                                      {
    +00332   // if stopTotal=1 then the totalling of pages for this number will stop too
    +00333   // if $next=1, then do this page, but not the next, else do not do this page either
    +00334   // if $i is set, then stop that particular pagenumbering sequence.
    +00335   if (!isset($this->ez['pageNumbering'])){
    +00336     $this->ez['pageNumbering']=array();
    +00337   }
    +00338   if ($next && isset($this->ez['pageNumbering'][$i][$this->ezPageCount]) && is_array($this->ez['pageNumbering'][$i][$this->ezPageCount])){
    +00339     // then this has only just been started, this will over-write the start, and nothing will appear
    +00340     // add a special command to the start block, telling it to stop as well
    +00341     if ($stopTotal){
    +00342       $this->ez['pageNumbering'][$i][$this->ezPageCount]['stoptn']=1;
    +00343     } else {
    +00344       $this->ez['pageNumbering'][$i][$this->ezPageCount]['stopn']=1;
    +00345     }
    +00346   } else {
    +00347     if ($stopTotal){
    +00348       $this->ez['pageNumbering'][$i][$this->ezPageCount]='stopt';
    +00349     } else {
    +00350       $this->ez['pageNumbering'][$i][$this->ezPageCount]='stop';
    +00351     }
    +00352     if ($next){
    +00353       $this->ez['pageNumbering'][$i][$this->ezPageCount].='n';
    +00354     }
    +00355   }
    +00356 }
    +
    +

    +

    @@ -1169,7 +1876,13 @@ References $i.

    Definition at line 454 of file class.ezpdf.php.

    -References ezPRVTcleanUp(), and Cpdf::stream(). +References ezPRVTcleanUp(), and Cpdf::stream().

    00454                               {
    +00455   $this->ezPRVTcleanUp();
    +00456   $this->stream($options);
    +00457 }
    +
    +

    +

    @@ -1222,7 +1935,595 @@ References ezPRVTclean

    Definition at line 607 of file class.ezpdf.php.

    -References $height, $ok, Cpdf::$options, $p, $row, $start, $t, $w, $x, $y, Cpdf::addObject(), Cpdf::addText(), Cpdf::addTextWrap(), alink(), Cpdf::closeObject(), ezNewPage(), ezProcessText(), ezPrvtGetTextWidth(), ezPrvtTableColumnHeadings(), ezPrvtTableDrawLines(), ezSetY(), Cpdf::filledRectangle(), Cpdf::getFontDecender(), Cpdf::getFontHeight(), Cpdf::getTextWidth(), Cpdf::line(), Cpdf::newPage(), Cpdf::openObject(), Cpdf::reopenObject(), Cpdf::restoreState(), Cpdf::saveState(), Cpdf::setColor(), Cpdf::setLineStyle(), Cpdf::setStrokeColor(), start, Cpdf::transaction(), value, and width. +References $height, $ok, Cpdf::$options, $p, $row, $start, $t, $w, $x, $y, Cpdf::addObject(), Cpdf::addText(), Cpdf::addTextWrap(), alink(), Cpdf::closeObject(), ezNewPage(), ezProcessText(), ezPrvtGetTextWidth(), ezPrvtTableColumnHeadings(), ezPrvtTableDrawLines(), ezSetY(), Cpdf::filledRectangle(), Cpdf::getFontDecender(), Cpdf::getFontHeight(), Cpdf::getTextWidth(), Cpdf::line(), Cpdf::newPage(), Cpdf::openObject(), Cpdf::reopenObject(), Cpdf::restoreState(), Cpdf::saveState(), Cpdf::setColor(), Cpdf::setLineStyle(), Cpdf::setStrokeColor(), start, Cpdf::transaction(), value, and width.

    00607                                                        {
    +00608   // add a table of information to the pdf document
    +00609   // $data is a two dimensional array
    +00610   // $cols (optional) is an associative array, the keys are the names of the columns from $data
    +00611   // to be presented (and in that order), the values are the titles to be given to the columns
    +00612   // $title (optional) is the title to be put on the top of the table
    +00613   //
    +00614   // $options is an associative array which can contain:
    +00615   // 'showLines'=> 0,1,2, default is 1 (show outside and top lines only), 2=> lines on each row
    +00616   // 'showHeadings' => 0 or 1
    +00617   // 'shaded'=> 0,1,2,3 default is 1 (1->alternate lines are shaded, 0->no shading, 2-> both shaded, second uses shadeCol2)
    +00618   // 'shadeCol' => (r,g,b) array, defining the colour of the shading, default is (0.8,0.8,0.8)
    +00619   // 'shadeCol2' => (r,g,b) array, defining the colour of the shading of the other blocks, default is (0.7,0.7,0.7)
    +00620   // 'fontSize' => 10
    +00621   // 'textCol' => (r,g,b) array, text colour
    +00622   // 'titleFontSize' => 12
    +00623   // 'rowGap' => 2 , the space added at the top and bottom of each row, between the text and the lines
    +00624   // 'colGap' => 5 , the space on the left and right sides of each cell
    +00625   // 'lineCol' => (r,g,b) array, defining the colour of the lines, default, black.
    +00626   // 'xPos' => 'left','right','center','centre',or coordinate, reference coordinate in the x-direction
    +00627   // 'xOrientation' => 'left','right','center','centre', position of the table w.r.t 'xPos' 
    +00628   // 'width'=> <number> which will specify the width of the table, if it turns out to not be this
    +00629   //    wide, then it will stretch the table to fit, if it is wider then each cell will be made
    +00630   //    proportionalty smaller, and the content may have to wrap.
    +00631   // 'maxWidth'=> <number> similar to 'width', but will only make table smaller than it wants to be
    +00632   // 'options' => array(<colname>=>array('justification'=>'left','width'=>100,'link'=>linkDataName),<colname>=>....)
    +00633   //             allow the setting of other paramaters for the individual columns
    +00634   // 'minRowSpace'=> the minimum space between the bottom of each row and the bottom margin, in which a new row will be started
    +00635   //                  if it is less, then a new page would be started, default=-100
    +00636   // 'innerLineThickness'=>1
    +00637   // 'outerLineThickness'=>1
    +00638   // 'splitRows'=>0, 0 or 1, whether or not to allow the rows to be split across page boundaries
    +00639   // 'protectRows'=>number, the number of rows to hold with the heading on page, ie, if there less than this number of
    +00640   //                rows on the page, then move the whole lot onto the next page, default=1
    +00641   //
    +00642   // note that the user will have had to make a font selection already or this will not 
    +00643   // produce a valid pdf file.
    +00644   
    +00645   if (!is_array($data)){
    +00646     return;
    +00647   }
    +00648   
    +00649   if (!is_array($cols)){
    +00650     // take the columns from the first row of the data set
    +00651     reset($data);
    +00652     list($k,$v)=each($data);
    +00653     if (!is_array($v)){
    +00654       return;
    +00655     }
    +00656     $cols=array();
    +00657     foreach($v as $k1=>$v1){
    +00658       $cols[$k1]=$k1;
    +00659     }
    +00660   }
    +00661   
    +00662   if (!is_array($options)){
    +00663     $options=array();
    +00664   }
    +00665 
    +00666   $defaults = array(
    +00667     'shaded'=>1,'showLines'=>1,'shadeCol'=>array(0.8,0.8,0.8),'shadeCol2'=>array(0.7,0.7,0.7),'fontSize'=>10,'titleFontSize'=>12
    +00668     ,'titleGap'=>5,'lineCol'=>array(0,0,0),'gap'=>5,'xPos'=>'centre','xOrientation'=>'centre'
    +00669     ,'showHeadings'=>1,'textCol'=>array(0,0,0),'width'=>0,'maxWidth'=>0,'cols'=>array(),'minRowSpace'=>-100,'rowGap'=>2,'colGap'=>5
    +00670     ,'innerLineThickness'=>1,'outerLineThickness'=>1,'splitRows'=>0,'protectRows'=>1
    +00671     );
    +00672 
    +00673   foreach($defaults as $key=>$value){
    +00674     if (is_array($value)){
    +00675       if (!isset($options[$key]) || !is_array($options[$key])){
    +00676         $options[$key]=$value;
    +00677       }
    +00678     } else {
    +00679       if (!isset($options[$key])){
    +00680         $options[$key]=$value;
    +00681       }
    +00682     }
    +00683   }
    +00684   $options['gap']=2*$options['colGap'];
    +00685   
    +00686   $middle = ($this->ez['pageWidth']-$this->ez['rightMargin'])/2+($this->ez['leftMargin'])/2;
    +00687   // figure out the maximum widths of the text within each column
    +00688   $maxWidth=array();
    +00689   foreach($cols as $colName=>$colHeading){
    +00690     $maxWidth[$colName]=0;
    +00691   }
    +00692   // find the maximum cell widths based on the data
    +00693   foreach($data as $row){
    +00694     foreach($cols as $colName=>$colHeading){
    +00695       $w = $this->ezPrvtGetTextWidth($options['fontSize'],(string)$row[$colName])*1.01;
    +00696       if ($w > $maxWidth[$colName]){
    +00697         $maxWidth[$colName]=$w;
    +00698       }
    +00699     }
    +00700   }
    +00701   // and the maximum widths to fit in the headings
    +00702   foreach($cols as $colName=>$colTitle){
    +00703     $w = $this->ezPrvtGetTextWidth($options['fontSize'],(string)$colTitle)*1.01;
    +00704     if ($w > $maxWidth[$colName]){
    +00705       $maxWidth[$colName]=$w;
    +00706     }
    +00707   }
    +00708   
    +00709   // calculate the start positions of each of the columns
    +00710   $pos=array();
    +00711   $x=0;
    +00712   $t=$x;
    +00713   $adjustmentWidth=0;
    +00714   $setWidth=0;
    +00715   foreach($maxWidth as $colName => $w){
    +00716     $pos[$colName]=$t;
    +00717     // if the column width has been specified then set that here, also total the
    +00718     // width avaliable for adjustment
    +00719     if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['width']) && $options['cols'][$colName]['width']>0){
    +00720       $t=$t+$options['cols'][$colName]['width'];
    +00721       $maxWidth[$colName] = $options['cols'][$colName]['width']-$options['gap'];
    +00722       $setWidth += $options['cols'][$colName]['width'];
    +00723     } else {
    +00724       $t=$t+$w+$options['gap'];
    +00725       $adjustmentWidth += $w;
    +00726       $setWidth += $options['gap'];
    +00727     }
    +00728   }
    +00729   $pos['_end_']=$t;
    +00730 
    +00731   // if maxWidth is specified, and the table is too wide, and the width has not been set,
    +00732   // then set the width.
    +00733   if ($options['width']==0 && $options['maxWidth'] && ($t-$x)>$options['maxWidth']){
    +00734     // then need to make this one smaller
    +00735     $options['width']=$options['maxWidth'];
    +00736   }
    +00737 
    +00738   if ($options['width'] && $adjustmentWidth>0 && $setWidth<$options['width']){
    +00739     // first find the current widths of the columns involved in this mystery
    +00740     $cols0 = array();
    +00741     $cols1 = array();
    +00742     $xq=0;
    +00743     $presentWidth=0;
    +00744     $last='';
    +00745     foreach($pos as $colName=>$p){
    +00746       if (!isset($options['cols'][$last]) || !isset($options['cols'][$last]['width']) || $options['cols'][$last]['width']<=0){
    +00747         if (strlen($last)){
    +00748           $cols0[$last]=$p-$xq -$options['gap'];
    +00749           $presentWidth += ($p-$xq - $options['gap']);
    +00750         }
    +00751       } else {
    +00752         $cols1[$last]=$p-$xq;
    +00753       }
    +00754       $last=$colName;
    +00755       $xq=$p;
    +00756     }
    +00757     // $cols0 contains the widths of all the columns which are not set
    +00758     $neededWidth = $options['width']-$setWidth;
    +00759     // if needed width is negative then add it equally to each column, else get more tricky
    +00760     if ($presentWidth<$neededWidth){
    +00761       foreach($cols0 as $colName=>$w){
    +00762         $cols0[$colName]+= ($neededWidth-$presentWidth)/count($cols0);
    +00763       }
    +00764     } else {
    +00765     
    +00766       $cnt=0;
    +00767       while ($presentWidth>$neededWidth && $cnt<100){
    +00768         $cnt++; // insurance policy
    +00769         // find the widest columns, and the next to widest width
    +00770         $aWidest = array();
    +00771         $nWidest=0;
    +00772         $widest=0;
    +00773         foreach($cols0 as $colName=>$w){
    +00774           if ($w>$widest){
    +00775             $aWidest=array($colName);
    +00776             $nWidest = $widest;
    +00777             $widest=$w;
    +00778           } else if ($w==$widest){
    +00779             $aWidest[]=$colName;
    +00780           }
    +00781         }
    +00782         // then figure out what the width of the widest columns would have to be to take up all the slack
    +00783         $newWidestWidth = $widest - ($presentWidth-$neededWidth)/count($aWidest);
    +00784         if ($newWidestWidth > $nWidest){
    +00785           // then there is space to set them to this
    +00786           foreach($aWidest as $colName){
    +00787             $cols0[$colName] = $newWidestWidth;
    +00788           }
    +00789           $presentWidth=$neededWidth;
    +00790         } else {
    +00791           // there is not space, reduce the size of the widest ones down to the next size down, and we
    +00792           // will go round again
    +00793           foreach($aWidest as $colName){
    +00794             $cols0[$colName] = $nWidest;
    +00795           }
    +00796           $presentWidth=$presentWidth-($widest-$nWidest)*count($aWidest);
    +00797         }
    +00798       }
    +00799     }
    +00800     // $cols0 now contains the new widths of the constrained columns.
    +00801     // now need to update the $pos and $maxWidth arrays
    +00802     $xq=0;
    +00803     foreach($pos as $colName=>$p){
    +00804       $pos[$colName]=$xq;
    +00805       if (!isset($options['cols'][$colName]) || !isset($options['cols'][$colName]['width']) || $options['cols'][$colName]['width']<=0){
    +00806         if (isset($cols0[$colName])){
    +00807           $xq += $cols0[$colName] + $options['gap'];
    +00808           $maxWidth[$colName]=$cols0[$colName];
    +00809         }
    +00810       } else {
    +00811         if (isset($cols1[$colName])){
    +00812           $xq += $cols1[$colName];
    +00813         }
    +00814       }
    +00815     }
    +00816 
    +00817     $t=$x+$options['width'];
    +00818     $pos['_end_']=$t;
    +00819   }
    +00820 
    +00821   // now adjust the table to the correct location across the page
    +00822   switch ($options['xPos']){
    +00823     case 'left':
    +00824       $xref = $this->ez['leftMargin'];
    +00825       break;
    +00826     case 'right':
    +00827       $xref = $this->ez['pageWidth'] - $this->ez['rightMargin'];
    +00828       break;
    +00829     case 'centre':
    +00830     case 'center':
    +00831       $xref = $middle;
    +00832       break;
    +00833     default:
    +00834       $xref = $options['xPos'];
    +00835       break;
    +00836   }
    +00837   switch ($options['xOrientation']){
    +00838     case 'left':
    +00839       $dx = $xref-$t;
    +00840       break;
    +00841     case 'right':
    +00842       $dx = $xref;
    +00843       break;
    +00844     case 'centre':
    +00845     case 'center':
    +00846       $dx = $xref-$t/2;
    +00847       break;
    +00848   }
    +00849 
    +00850 
    +00851   foreach($pos as $k=>$v){
    +00852     $pos[$k]=$v+$dx;
    +00853   }
    +00854   $x0=$x+$dx;
    +00855   $x1=$t+$dx;
    +00856 
    +00857   $baseLeftMargin = $this->ez['leftMargin'];
    +00858   $basePos = $pos;
    +00859   $baseX0 = $x0;
    +00860   $baseX1 = $x1;
    +00861   
    +00862   // ok, just about ready to make me a table
    +00863   $this->setColor($options['textCol'][0],$options['textCol'][1],$options['textCol'][2]);
    +00864   $this->setStrokeColor($options['shadeCol'][0],$options['shadeCol'][1],$options['shadeCol'][2]);
    +00865 
    +00866   $middle = ($x1+$x0)/2;
    +00867 
    +00868   // start a transaction which will be used to regress the table, if there are not enough rows protected
    +00869   if ($options['protectRows']>0){
    +00870     $this->transaction('start');
    +00871     $movedOnce=0;
    +00872   }
    +00873   $abortTable = 1;
    +00874   while ($abortTable){
    +00875   $abortTable=0;
    +00876 
    +00877   $dm = $this->ez['leftMargin']-$baseLeftMargin;
    +00878   foreach($basePos as $k=>$v){
    +00879     $pos[$k]=$v+$dm;
    +00880   }
    +00881   $x0=$baseX0+$dm;
    +00882   $x1=$baseX1+$dm;
    +00883   $middle = ($x1+$x0)/2;
    +00884 
    +00885 
    +00886   // if the title is set, then do that
    +00887   if (strlen($title)){
    +00888     $w = $this->getTextWidth($options['titleFontSize'],$title);
    +00889     $this->y -= $this->getFontHeight($options['titleFontSize']);
    +00890     if ($this->y < $this->ez['bottomMargin']){
    +00891       $this->ezNewPage();
    +00892         // margins may have changed on the newpage
    +00893         $dm = $this->ez['leftMargin']-$baseLeftMargin;
    +00894         foreach($basePos as $k=>$v){
    +00895           $pos[$k]=$v+$dm;
    +00896         }
    +00897         $x0=$baseX0+$dm;
    +00898         $x1=$baseX1+$dm;
    +00899         $middle = ($x1+$x0)/2;
    +00900       $this->y -= $this->getFontHeight($options['titleFontSize']);
    +00901     }
    +00902     $this->addText($middle-$w/2,$this->y,$options['titleFontSize'],$title);
    +00903     $this->y -= $options['titleGap'];
    +00904   }
    +00905 
    +00906         // margins may have changed on the newpage
    +00907         $dm = $this->ez['leftMargin']-$baseLeftMargin;
    +00908         foreach($basePos as $k=>$v){
    +00909           $pos[$k]=$v+$dm;
    +00910         }
    +00911         $x0=$baseX0+$dm;
    +00912         $x1=$baseX1+$dm;
    +00913   
    +00914   $y=$this->y; // to simplify the code a bit
    +00915   
    +00916   // make the table
    +00917   $height = $this->getFontHeight($options['fontSize']);
    +00918   $decender = $this->getFontDecender($options['fontSize']);
    +00919 
    +00920   
    +00921   
    +00922   $y0=$y+$decender;
    +00923   $dy=0;
    +00924   if ($options['showHeadings']){
    +00925     // this function will move the start of the table to a new page if it does not fit on this one
    +00926     $headingHeight = $this->ezPrvtTableColumnHeadings($cols,$pos,$maxWidth,$height,$decender,$options['rowGap'],$options['fontSize'],$y,$options);
    +00927     $y0 = $y+$headingHeight;
    +00928     $y1 = $y;
    +00929 
    +00930 
    +00931     $dm = $this->ez['leftMargin']-$baseLeftMargin;
    +00932     foreach($basePos as $k=>$v){
    +00933       $pos[$k]=$v+$dm;
    +00934     }
    +00935     $x0=$baseX0+$dm;
    +00936     $x1=$baseX1+$dm;
    +00937 
    +00938   } else {
    +00939     $y1 = $y0;
    +00940   }
    +00941   $firstLine=1;
    +00942 
    +00943   
    +00944   // open an object here so that the text can be put in over the shading
    +00945   if ($options['shaded']){
    +00946     $this->saveState();
    +00947     $textObjectId = $this->openObject();
    +00948     $this->closeObject();
    +00949     $this->addObject($textObjectId);
    +00950     $this->reopenObject($textObjectId);
    +00951   }
    +00952   
    +00953   $cnt=0;
    +00954   $newPage=0;
    +00955   foreach($data as $row){
    +00956     $cnt++;
    +00957     // the transaction support will be used to prevent rows being split
    +00958     if ($options['splitRows']==0){
    +00959       $pageStart = $this->ezPageCount;
    +00960       if (isset($this->ez['columns']) && $this->ez['columns']['on']==1){
    +00961         $columnStart = $this->ez['columns']['colNum'];
    +00962       }
    +00963       $this->transaction('start');
    +00964       $row_orig = $row;
    +00965       $y_orig = $y;
    +00966       $y0_orig = $y0;
    +00967       $y1_orig = $y1;
    +00968     }
    +00969     $ok=0;
    +00970     $secondTurn=0;
    +00971     while(!$abortTable && $ok == 0){
    +00972 
    +00973     $mx=0;
    +00974     $newRow=1;
    +00975     while(!$abortTable && ($newPage || $newRow)){
    +00976       
    +00977       $y-=$height;
    +00978       if ($newPage || $y<$this->ez['bottomMargin'] || (isset($options['minRowSpace']) && $y<($this->ez['bottomMargin']+$options['minRowSpace'])) ){
    +00979         // check that enough rows are with the heading
    +00980         if ($options['protectRows']>0 && $movedOnce==0 && $cnt<=$options['protectRows']){
    +00981           // then we need to move the whole table onto the next page
    +00982           $movedOnce = 1;
    +00983           $abortTable = 1;
    +00984         }
    +00985       
    +00986         $y2=$y-$mx+2*$height+$decender-$newRow*$height;
    +00987         if ($options['showLines']){
    +00988           if (!$options['showHeadings']){
    +00989             $y0=$y1;
    +00990           }
    +00991           $this->ezPrvtTableDrawLines($pos,$options['gap'],$x0,$x1,$y0,$y1,$y2,$options['lineCol'],$options['innerLineThickness'],$options['outerLineThickness'],$options['showLines']);
    +00992         }
    +00993         if ($options['shaded']){
    +00994           $this->closeObject();
    +00995           $this->restoreState();
    +00996         }
    +00997         $this->ezNewPage();
    +00998         // and the margins may have changed, this is due to the possibility of the columns being turned on
    +00999         // as the columns are managed by manipulating the margins
    +01000 
    +01001         $dm = $this->ez['leftMargin']-$baseLeftMargin;
    +01002         foreach($basePos as $k=>$v){
    +01003           $pos[$k]=$v+$dm;
    +01004         }
    +01005 //        $x0=$x0+$dm;
    +01006 //        $x1=$x1+$dm;
    +01007         $x0=$baseX0+$dm;
    +01008         $x1=$baseX1+$dm;
    +01009   
    +01010         if ($options['shaded']){
    +01011           $this->saveState();
    +01012           $textObjectId = $this->openObject();
    +01013           $this->closeObject();
    +01014           $this->addObject($textObjectId);
    +01015           $this->reopenObject($textObjectId);
    +01016         }
    +01017         $this->setColor($options['textCol'][0],$options['textCol'][1],$options['textCol'][2],1);
    +01018         $y = $this->ez['pageHeight']-$this->ez['topMargin'];
    +01019         $y0=$y+$decender;
    +01020         $mx=0;
    +01021         if ($options['showHeadings']){
    +01022           $this->ezPrvtTableColumnHeadings($cols,$pos,$maxWidth,$height,$decender,$options['rowGap'],$options['fontSize'],$y,$options);
    +01023           $y1=$y;
    +01024         } else {
    +01025           $y1=$y0;
    +01026         }
    +01027         $firstLine=1;
    +01028         $y -= $height;
    +01029       }
    +01030       $newRow=0;
    +01031       // write the actual data
    +01032       // if these cells need to be split over a page, then $newPage will be set, and the remaining
    +01033       // text will be placed in $leftOvers
    +01034       $newPage=0;
    +01035       $leftOvers=array();
    +01036 
    +01037       foreach($cols as $colName=>$colTitle){
    +01038         $this->ezSetY($y+$height);
    +01039         $colNewPage=0;
    +01040         if (isset($row[$colName])){
    +01041           if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['link']) && strlen($options['cols'][$colName]['link'])){
    +01042             
    +01043             $lines = explode("\n",$row[$colName]);
    +01044             if (isset($row[$options['cols'][$colName]['link']]) && strlen($row[$options['cols'][$colName]['link']])){
    +01045               foreach($lines as $k=>$v){
    +01046                 $lines[$k]='<c:alink:'.$row[$options['cols'][$colName]['link']].'>'.$v.'</c:alink>';
    +01047               }
    +01048             }
    +01049           } else {
    +01050             $lines = explode("\n",$row[$colName]);
    +01051           }
    +01052         } else {
    +01053           $lines = array();
    +01054         }
    +01055         $this->y -= $options['rowGap'];
    +01056         foreach ($lines as $line){
    +01057           $line = $this->ezProcessText($line);
    +01058           $start=1;
    +01059 
    +01060           while (strlen($line) || $start){
    +01061             $start=0;
    +01062             if (!$colNewPage){
    +01063               $this->y=$this->y-$height;
    +01064             }
    +01065             if ($this->y < $this->ez['bottomMargin']){
    +01066   //            $this->ezNewPage();
    +01067               $newPage=1;  // whether a new page is required for any of the columns
    +01068               $colNewPage=1; // whether a new page is required for this column
    +01069             }
    +01070             if ($colNewPage){
    +01071               if (isset($leftOvers[$colName])){
    +01072                 $leftOvers[$colName].="\n".$line;
    +01073               } else {
    +01074                 $leftOvers[$colName] = $line;
    +01075               }
    +01076               $line='';
    +01077             } else {
    +01078               if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['justification']) ){
    +01079                 $just = $options['cols'][$colName]['justification'];
    +01080               } else {
    +01081                 $just='left';
    +01082               }
    +01083 
    +01084               $line=$this->addTextWrap($pos[$colName],$this->y,$maxWidth[$colName],$options['fontSize'],$line,$just);
    +01085             }
    +01086           }
    +01087         }
    +01088   
    +01089         $dy=$y+$height-$this->y+$options['rowGap'];
    +01090         if ($dy-$height*$newPage>$mx){
    +01091           $mx=$dy-$height*$newPage;
    +01092         }
    +01093       }
    +01094       // set $row to $leftOvers so that they will be processed onto the new page
    +01095       $row = $leftOvers;
    +01096       // now add the shading underneath
    +01097       if ($options['shaded'] && $cnt%2==0){
    +01098         $this->closeObject();
    +01099         $this->setColor($options['shadeCol'][0],$options['shadeCol'][1],$options['shadeCol'][2],1);
    +01100         $this->filledRectangle($x0-$options['gap']/2,$y+$decender+$height-$mx,$x1-$x0,$mx);
    +01101         $this->reopenObject($textObjectId);
    +01102       }
    +01103 
    +01104       if ($options['shaded']==2 && $cnt%2==1){
    +01105         $this->closeObject();
    +01106         $this->setColor($options['shadeCol2'][0],$options['shadeCol2'][1],$options['shadeCol2'][2],1);
    +01107         $this->filledRectangle($x0-$options['gap']/2,$y+$decender+$height-$mx,$x1-$x0,$mx);
    +01108         $this->reopenObject($textObjectId);
    +01109       }
    +01110 
    +01111       if ($options['showLines']>1){
    +01112         // then draw a line on the top of each block
    +01113 //        $this->closeObject();
    +01114         $this->saveState();
    +01115         $this->setStrokeColor($options['lineCol'][0],$options['lineCol'][1],$options['lineCol'][2],1);
    +01116 //        $this->line($x0-$options['gap']/2,$y+$decender+$height-$mx,$x1-$x0,$mx);
    +01117         if ($firstLine){
    +01118           $this->setLineStyle($options['outerLineThickness']);
    +01119           $firstLine=0;
    +01120         } else {
    +01121           $this->setLineStyle($options['innerLineThickness']);
    +01122         }
    +01123         $this->line($x0-$options['gap']/2,$y+$decender+$height,$x1-$options['gap']/2,$y+$decender+$height);
    +01124         $this->restoreState();
    +01125 //        $this->reopenObject($textObjectId);
    +01126       }
    +01127     } // end of while 
    +01128     $y=$y-$mx+$height;
    +01129     
    +01130     // checking row split over pages
    +01131     if ($options['splitRows']==0){
    +01132       if ( ( ($this->ezPageCount != $pageStart) || (isset($this->ez['columns']) && $this->ez['columns']['on']==1 && $columnStart != $this->ez['columns']['colNum'] ))  && $secondTurn==0){
    +01133         // then we need to go back and try that again !
    +01134         $newPage=1;
    +01135         $secondTurn=1;
    +01136         $this->transaction('rewind');
    +01137         $row = $row_orig;
    +01138         $y = $y_orig;
    +01139         $y0 = $y0_orig;
    +01140         $y1 = $y1_orig;
    +01141         $ok=0;
    +01142 
    +01143         $dm = $this->ez['leftMargin']-$baseLeftMargin;
    +01144         foreach($basePos as $k=>$v){
    +01145           $pos[$k]=$v+$dm;
    +01146         }
    +01147         $x0=$baseX0+$dm;
    +01148         $x1=$baseX1+$dm;
    +01149 
    +01150       } else {
    +01151         $this->transaction('commit');
    +01152         $ok=1;
    +01153       }
    +01154     } else {
    +01155       $ok=1;  // don't go round the loop if splitting rows is allowed
    +01156     }
    +01157     
    +01158     }  // end of while to check for row splitting
    +01159     if ($abortTable){
    +01160       if ($ok==0){
    +01161         $this->transaction('abort');
    +01162       }
    +01163       // only the outer transaction should be operational
    +01164       $this->transaction('rewind');
    +01165       $this->ezNewPage();
    +01166       break;
    +01167     }
    +01168     
    +01169   } // end of foreach ($data as $row)
    +01170   
    +01171   } // end of while ($abortTable)
    +01172 
    +01173   // table has been put on the page, the rows guarded as required, commit.
    +01174   $this->transaction('commit');
    +01175 
    +01176   $y2=$y+$decender;
    +01177   if ($options['showLines']){
    +01178     if (!$options['showHeadings']){
    +01179       $y0=$y1;
    +01180     }
    +01181     $this->ezPrvtTableDrawLines($pos,$options['gap'],$x0,$x1,$y0,$y1,$y2,$options['lineCol'],$options['innerLineThickness'],$options['outerLineThickness'],$options['showLines']);
    +01182   }
    +01183 
    +01184   // close the object for drawing the text on top
    +01185   if ($options['shaded']){
    +01186     $this->closeObject();
    +01187     $this->restoreState();
    +01188   }
    +01189   
    +01190   $this->y=$y;
    +01191   return $y;
    +01192 }
    +
    +

    +

    @@ -1277,7 +2578,102 @@ Definition at line 120

    References $height, Cpdf::$options, $right, $size, $start, Cpdf::addTextWrap(), ezNewPage(), ezProcessText(), Cpdf::getFontHeight(), Cpdf::line(), size, and start.

    -Referenced by ezPrvtTableColumnHeadings(). +Referenced by ezPrvtTableColumnHeadings().

    01205                                                        {
    +01206   // this will add a string of text to the document, starting at the current drawing
    +01207   // position.
    +01208   // it will wrap to keep within the margins, including optional offsets from the left
    +01209   // and the right, if $size is not specified, then it will be the last one used, or
    +01210   // the default value (12 I think).
    +01211   // the text will go to the start of the next line when a return code "\n" is found.
    +01212   // possible options are:
    +01213   // 'left'=> number, gap to leave from the left margin
    +01214   // 'right'=> number, gap to leave from the right margin
    +01215   // 'aleft'=> number, absolute left position (overrides 'left')
    +01216   // 'aright'=> number, absolute right position (overrides 'right')
    +01217   // 'justification' => 'left','right','center','centre','full'
    +01218 
    +01219   // only set one of the next two items (leading overrides spacing)
    +01220   // 'leading' => number, defines the total height taken by the line, independent of the font height.
    +01221   // 'spacing' => a real number, though usually set to one of 1, 1.5, 2 (line spacing as used in word processing)
    +01222   
    +01223   // if $test is set then this should just check if the text is going to flow onto a new page or not, returning true or false
    +01224   
    +01225   // apply the filtering which will make the underlining function.
    +01226   $text = $this->ezProcessText($text);
    +01227   
    +01228   $newPage=false;
    +01229   $store_y = $this->y;
    +01230   
    +01231   if (is_array($options) && isset($options['aleft'])){
    +01232     $left=$options['aleft'];
    +01233   } else {
    +01234     $left = $this->ez['leftMargin'] + ((is_array($options) && isset($options['left']))?$options['left']:0);
    +01235   }
    +01236   if (is_array($options) && isset($options['aright'])){
    +01237     $right=$options['aright'];
    +01238   } else {
    +01239     $right = $this->ez['pageWidth'] - $this->ez['rightMargin'] - ((is_array($options) && isset($options['right']))?$options['right']:0);
    +01240   }
    +01241   if ($size<=0){
    +01242     $size = $this->ez['fontSize'];
    +01243   } else {
    +01244     $this->ez['fontSize']=$size;
    +01245   }
    +01246   
    +01247   if (is_array($options) && isset($options['justification'])){
    +01248     $just = $options['justification'];
    +01249   } else {
    +01250     $just = 'left';
    +01251   }
    +01252   
    +01253   // modifications to give leading and spacing based on those given by Craig Heydenburg 1/1/02
    +01254   if (is_array($options) && isset($options['leading'])) { ## use leading instead of spacing
    +01255     $height = $options['leading'];
    +01256         } else if (is_array($options) && isset($options['spacing'])) {
    +01257     $height = $this->getFontHeight($size) * $options['spacing'];
    +01258         } else {
    +01259                 $height = $this->getFontHeight($size);
    +01260         }
    +01261 
    +01262   
    +01263   $lines = explode("\n",$text);
    +01264   foreach ($lines as $line){
    +01265     $start=1;
    +01266     while (strlen($line) || $start){
    +01267       $start=0;
    +01268       $this->y=$this->y-$height;
    +01269       if ($this->y < $this->ez['bottomMargin']){
    +01270         if ($test){
    +01271           $newPage=true;
    +01272         } else {
    +01273           $this->ezNewPage();
    +01274           // and then re-calc the left and right, in case they have changed due to columns
    +01275         }
    +01276       }
    +01277       if (is_array($options) && isset($options['aleft'])){
    +01278         $left=$options['aleft'];
    +01279       } else {
    +01280         $left = $this->ez['leftMargin'] + ((is_array($options) && isset($options['left']))?$options['left']:0);
    +01281       }
    +01282       if (is_array($options) && isset($options['aright'])){
    +01283         $right=$options['aright'];
    +01284       } else {
    +01285         $right = $this->ez['pageWidth'] - $this->ez['rightMargin'] - ((is_array($options) && isset($options['right']))?$options['right']:0);
    +01286       }
    +01287       $line=$this->addTextWrap($left,$this->y,$right-$left,$size,$line,$just,0,$test);
    +01288     }
    +01289   }
    +01290 
    +01291   if ($test){
    +01292     $this->y=$store_y;
    +01293     return $newPage;
    +01294   } else {
    +01295     return $this->y;
    +01296   }
    +01297 }
    +
    +

    +

    @@ -1320,7 +2716,38 @@ Definition at line 299

    References $num, $start, Cpdf::addMessage(), and ezStartPageNumbers().

    -Referenced by Creport::rf(). +Referenced by Creport::rf().

    00299                                         {
    +00300   // given a particular generic page number (ie, document numbered sequentially from beginning),
    +00301   // return the page number under a particular page numbering scheme ($i)
    +00302   $num=0;
    +00303   $start=1;
    +00304   $startNum=1;
    +00305   if (!isset($this->ez['pageNumbering']))
    +00306   {
    +00307     $this->addMessage('WARNING: page numbering called for and wasn\'t started with ezStartPageNumbers');
    +00308     return 0;
    +00309   }
    +00310   foreach($this->ez['pageNumbering'][$i] as $k=>$v){
    +00311     if ($k<=$pageNum){
    +00312       if (is_array($v)){
    +00313         // start block
    +00314         if (strlen($v['num'])){
    +00315           // a start was specified
    +00316           $start=$v['num'];
    +00317           $startNum=$k;
    +00318           $num=$pageNum-$startNum+$start;
    +00319         }
    +00320       } else {
    +00321         // stop block
    +00322         $num=0;
    +00323       }
    +00324     }
    +00325   }
    +00326   return $num;
    +00327 }
    +
    +

    +

    @@ -1350,7 +2777,12 @@ Referenced by Creport::rf()<

    -Definition at line 1469 of file class.ezpdf.php. +Definition at line 1469 of file class.ezpdf.php.

    01469                      {
    +01470   $this->alink($info,1);
    +01471 }
    +
    +

    +

    @@ -1382,7 +2814,43 @@ Definition at line 146

    Definition at line 1423 of file class.ezpdf.php.

    -References $code. +References $code.

    01423                                     {
    +01424   // this function will load the requested template ($file includes full or relative pathname)
    +01425   // the code for the template will be modified to make it name safe, and then stored in 
    +01426   // an array for later use
    +01427   // The id of the template will be returned for the user to operate on it later
    +01428   if (!file_exists($templateFile)){
    +01429     return -1;
    +01430   }
    +01431 
    +01432   $code = implode('',file($templateFile));
    +01433   if (!strlen($code)){
    +01434     return;
    +01435   }
    +01436 
    +01437   $code = trim($code);
    +01438   if (substr($code,0,5)=='<?php'){
    +01439     $code = substr($code,5);
    +01440   }
    +01441   if (substr($code,-2)=='?>'){
    +01442     $code = substr($code,0,strlen($code)-2);
    +01443   }
    +01444   if (isset($this->ez['numTemplates'])){
    +01445     $newNum = $this->ez['numTemplates'];
    +01446     $this->ez['numTemplates']++;
    +01447   } else {
    +01448     $newNum=0;
    +01449     $this->ez['numTemplates']=1;
    +01450     $this->ez['templates']=array();
    +01451   }
    +01452 
    +01453   $this->ez['templates'][$newNum]['code']=$code;
    +01454 
    +01455   return $newNum;
    +01456 }
    +
    +

    +

    @@ -1414,7 +2882,42 @@ References $code.

    Definition at line 1518 of file class.ezpdf.php.

    -References $a, $i, $start, and start. +References $a, $i, $start, and start.

    01518                      {
    +01519   // a callback function to support underlining
    +01520   $lineFactor=0.05; // the thickness of the line as a proportion of the height. also the drop of the line.
    +01521   switch($info['status']){
    +01522     case 'start':
    +01523     case 'sol':
    +01524     
    +01525       // the beginning of the underline zone
    +01526       if (!isset($this->ez['links'])){
    +01527         $this->ez['links']=array();
    +01528       }
    +01529       $i = $info['nCallback'];
    +01530       $this->ez['links'][$i] = array('x'=>$info['x'],'y'=>$info['y'],'angle'=>$info['angle'],'decender'=>$info['decender'],'height'=>$info['height']);
    +01531       $this->saveState();
    +01532       $thick = $info['height']*$lineFactor;
    +01533       $this->setLineStyle($thick);
    +01534       break;
    +01535     case 'end':
    +01536     case 'eol':
    +01537       // the end of the link
    +01538       // assume that it is the most recent opening which has closed
    +01539       $i = $info['nCallback'];
    +01540       $start = $this->ez['links'][$i];
    +01541       // add underlining
    +01542       $a = deg2rad((float)$start['angle']-90.0);
    +01543       $drop = $start['height']*$lineFactor*1.5;
    +01544       $dropx = cos($a)*$drop;
    +01545       $dropy = -sin($a)*$drop;
    +01546       $this->line($start['x']-$dropx,$start['y']-$dropy,$info['x']-$dropx,$info['y']-$dropy);
    +01547       $this->restoreState();
    +01548       break;
    +01549   }
    +01550 }
    +
    +

    +


    Field Documentation

    @@ -1521,8 +3024,8 @@ Referenced by ezPrvtTa
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:09 2006 for phpcompta by  +
  • class.ezpdf.php +
    Generated on Thu Jun 29 21:21:24 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classCpdf.html b/doc/developper/html/classCpdf.html index 3d1f10b46..8e83da64b 100644 --- a/doc/developper/html/classCpdf.html +++ b/doc/developper/html/classCpdf.html @@ -279,7 +279,17 @@ Definition at line 197 References newDocument(), and setFontFamily().

    -Referenced by Cezpdf::Cezpdf(). +Referenced by Cezpdf::Cezpdf().

    00197                                             {
    +00198   $this->newDocument($pageSize);
    +00199   
    +00200   // also initialize the font families that are known about already
    +00201   $this->setFontFamily('init');
    +00202 //  $this->fileIdentifier = md5('xxxxxxxx'.time());
    +00203 
    +00204 }
    +
    +

    +


    Member Function Documentation

    @@ -311,7 +321,12 @@ Referenced by Cezpdf:: add content to the currently active object

    private

    -Definition at line 1648 of file class.pdf.php. +Definition at line 1648 of file class.pdf.php.

    01648                              {
    +01649   $this->objects[$this->currentContents]['c'].=$content;
    +01650 }
    +
    +

    +

    @@ -370,7 +385,19 @@ create a labelled destination within the document

    Definition at line 2969 of file class.pdf.php.

    -Referenced by Creport::rf(). +Referenced by Creport::rf().

    02969                                                      {
    +02970   // associates the given label with the destination, it is done this way so that a destination can be specified after
    +02971   // it has been linked to
    +02972   // styles are the same as the 'openHere' function
    +02973   $this->numObj++;
    +02974   $this->o_destination($this->numObj,'new',array('page'=>$this->currentPage,'type'=>$style,'p1'=>$a,'p2'=>$b,'p3'=>$c));
    +02975   $id = $this->numObj;
    +02976   // store the label->idf relationship, note that this means that labels can be used only once
    +02977   $this->destinations["$label"]=$id;
    +02978 }
    +
    +

    +

    @@ -433,7 +460,64 @@ Referenced by Creport::rf()<

    add an image into the document, from a GD object this function is not all that reliable, and I would probably encourage people to use the file based functions

    -Definition at line 2870 of file class.pdf.php. +Definition at line 2870 of file class.pdf.php.

    02870                                                     {
    +02871   // add a new image into the current location, as an external object
    +02872   // add the image at $x,$y, and with width and height as defined by $w & $h
    +02873   
    +02874   // note that this will only work with full colour images and makes them jpg images for display
    +02875   // later versions could present lossless image formats if there is interest.
    +02876   
    +02877   // there seems to be some problem here in that images that have quality set above 75 do not appear
    +02878   // not too sure why this is, but in the meantime I have restricted this to 75.  
    +02879   if ($quality>75){
    +02880     $quality=75;
    +02881   }
    +02882 
    +02883   // if the width or height are set to zero, then set the other one based on keeping the image
    +02884   // height/width ratio the same, if they are both zero, then give up :)
    +02885   $imageWidth=imagesx($img);
    +02886   $imageHeight=imagesy($img);
    +02887   
    +02888   if ($w<=0 && $h<=0){
    +02889     return;
    +02890   }
    +02891   if ($w==0){
    +02892     $w=$h/$imageHeight*$imageWidth;
    +02893   }
    +02894   if ($h==0){
    +02895     $h=$w*$imageHeight/$imageWidth;
    +02896   }
    +02897   
    +02898   // gotta get the data out of the img..
    +02899 
    +02900   // so I write to a temp file, and then read it back.. soo ugly, my apologies.
    +02901   $tmpDir='/tmp';
    +02902   $tmpName=tempnam($tmpDir,'img');
    +02903   imagejpeg($img,$tmpName,$quality);
    +02904   $fp=fopen($tmpName,'rb');
    +02905 
    +02906   $tmp = get_magic_quotes_runtime();
    +02907   set_magic_quotes_runtime(0);
    +02908   $fp = @fopen($tmpName,'rb');
    +02909   if ($fp){
    +02910     $data='';
    +02911     while(!feof($fp)){
    +02912       $data .= fread($fp,1024);
    +02913     }
    +02914     fclose($fp);
    +02915   } else {
    +02916     $error = 1;
    +02917     $errormsg = 'trouble opening file';
    +02918   }
    +02919 //  $data = fread($fp,filesize($tmpName));
    +02920   set_magic_quotes_runtime($tmp);
    +02921 //  fclose($fp);
    +02922   unlink($tmpName);
    +02923   $this->addJpegImage_common($data,$x,$y,$w,$h,$imageWidth,$imageHeight);
    +02924 }
    +
    +

    +

    @@ -472,7 +556,22 @@ Definition at line 2870<

    add content to the documents info object

    -Definition at line 2590 of file class.pdf.php. +Definition at line 2590 of file class.pdf.php.

    02590                                  {
    +02591   // this will only work if the label is one of the valid ones.
    +02592   // modify this so that arrays can be passed as well.
    +02593   // if $label is an array then assume that it is key=>value pairs
    +02594   // else assume that they are both scalar, anything else will probably error
    +02595   if (is_array($label)){
    +02596     foreach ($label as $l=>$v){
    +02597       $this->o_info($this->infoObject,$l,$v);
    +02598     }
    +02599   } else {
    +02600     $this->o_info($this->infoObject,$label,$value);
    +02601   }
    +02602 }
    +
    +

    +

    @@ -531,7 +630,14 @@ add a link in the document to an internal destination (ie. within the document)

    Definition at line 1173 of file class.pdf.php.

    -References label. +References label.

    01173                                                 {
    +01174   $this->numObj++;
    +01175   $info = array('type'=>'ilink','label'=>$label,'rect'=>array($x0,$y0,$x1,$y1));
    +01176   $this->o_annotation($this->numObj,'new',$info);
    +01177 }
    +
    +

    +

    @@ -588,7 +694,48 @@ References label. add a JPEG image into the document, from a file

    -Definition at line 2825 of file class.pdf.php. +Definition at line 2825 of file class.pdf.php.

    02825                                               {
    +02826   // attempt to add a jpeg image straight from a file, using no GD commands
    +02827   // note that this function is unable to operate on a remote file.
    +02828 
    +02829   if (!file_exists($img)){
    +02830     return;
    +02831   }
    +02832 
    +02833   $tmp=getimagesize($img);
    +02834   $imageWidth=$tmp[0];
    +02835   $imageHeight=$tmp[1];
    +02836 
    +02837   if (isset($tmp['channels'])){
    +02838     $channels = $tmp['channels'];
    +02839   } else {
    +02840     $channels = 3;
    +02841   }
    +02842 
    +02843   if ($w<=0 && $h<=0){
    +02844     $w=$imageWidth;
    +02845   }
    +02846   if ($w==0){
    +02847     $w=$h/$imageHeight*$imageWidth;
    +02848   }
    +02849   if ($h==0){
    +02850     $h=$w*$imageHeight/$imageWidth;
    +02851   }
    +02852 
    +02853   $fp=fopen($img,'rb');
    +02854 
    +02855   $tmp = get_magic_quotes_runtime();
    +02856   set_magic_quotes_runtime(0);
    +02857   $data = fread($fp,filesize($img));
    +02858   set_magic_quotes_runtime($tmp);
    +02859   
    +02860   fclose($fp);
    +02861 
    +02862   $this->addJpegImage_common($data,$x,$y,$w,$h,$imageWidth,$imageHeight,$channels);
    +02863 }
    +
    +

    +

    @@ -664,7 +811,23 @@ Definition at line 2825< common code used by the two JPEG adding functions

    private

    -Definition at line 2931 of file class.pdf.php. +Definition at line 2931 of file class.pdf.php.

    02931                                                                                          {
    +02932   // note that this function is not to be called externally
    +02933   // it is just the common code between the GD and the file options
    +02934   $this->numImages++;
    +02935   $im=$this->numImages;
    +02936   $label='I'.$im;
    +02937   $this->numObj++;
    +02938   $this->o_image($this->numObj,'new',array('label'=>$label,'data'=>$data,'iw'=>$imageWidth,'ih'=>$imageHeight,'channels'=>$channels));
    +02939 
    +02940   $this->objects[$this->currentContents]['c'].="\nq";
    +02941   $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$w)." 0 0 ".sprintf('%.3f',$h)." ".sprintf('%.3f',$x)." ".sprintf('%.3f',$y)." cm";
    +02942   $this->objects[$this->currentContents]['c'].="\n/".$label.' Do';
    +02943   $this->objects[$this->currentContents]['c'].="\nQ";
    +02944 }
    +
    +

    +

    @@ -721,7 +884,14 @@ Definition at line 2931<

    add a link in the document to an external URL

    -Definition at line 1164 of file class.pdf.php. +Definition at line 1164 of file class.pdf.php.

    01164                                       {
    +01165   $this->numObj++;
    +01166   $info = array('type'=>'link','url'=>$url,'rect'=>array($x0,$y0,$x1,$y1));
    +01167   $this->o_annotation($this->numObj,'new',$info);
    +01168 }
    +
    +

    +

    @@ -753,7 +923,12 @@ used to add messages for use in debugging

    Definition at line 3022 of file class.pdf.php.

    -Referenced by Cezpdf::ezWhatPageNumber(), and o_font(). +Referenced by Cezpdf::ezWhatPageNumber(), and o_font().

    03022                              {
    +03023   $this->messages.=$message."\n";
    +03024 }
    +
    +

    +

    @@ -794,7 +969,51 @@ after an object has been created, it wil only show if it has been added, using t

    Definition at line 2544 of file class.pdf.php.

    -Referenced by Cezpdf::ezTable(). +Referenced by Cezpdf::ezTable().

    02544                                       {
    +02545   // add the specified object to the page
    +02546   if (isset($this->looseObjects[$id]) && $this->currentContents!=$id){
    +02547     // then it is a valid object, and it is not being added to itself
    +02548     switch($options){
    +02549       case 'all':
    +02550         // then this object is to be added to this page (done in the next block) and 
    +02551         // all future new pages. 
    +02552         $this->addLooseObjects[$id]='all';
    +02553       case 'add':
    +02554         if (isset($this->objects[$this->currentContents]['onPage'])){
    +02555           // then the destination contents is the primary for the page
    +02556           // (though this object is actually added to that page)
    +02557           $this->o_page($this->objects[$this->currentContents]['onPage'],'content',$id);
    +02558         }
    +02559         break;
    +02560       case 'even':
    +02561         $this->addLooseObjects[$id]='even';
    +02562         $pageObjectId=$this->objects[$this->currentContents]['onPage'];
    +02563         if ($this->objects[$pageObjectId]['info']['pageNum']%2==0){
    +02564           $this->addObject($id); // hacky huh :)
    +02565         }
    +02566         break;
    +02567       case 'odd':
    +02568         $this->addLooseObjects[$id]='odd';
    +02569         $pageObjectId=$this->objects[$this->currentContents]['onPage'];
    +02570         if ($this->objects[$pageObjectId]['info']['pageNum']%2==1){
    +02571           $this->addObject($id); // hacky huh :)
    +02572         }
    +02573         break;
    +02574       case 'next':
    +02575         $this->addLooseObjects[$id]='all';
    +02576         break;
    +02577       case 'nexteven':
    +02578         $this->addLooseObjects[$id]='even';
    +02579         break;
    +02580       case 'nextodd':
    +02581         $this->addLooseObjects[$id]='odd';
    +02582         break;
    +02583     }
    +02584   }
    +02585 }
    +
    +

    +

    @@ -851,7 +1070,193 @@ Referenced by Cezpdf::

    add a PNG image into the document, from a file this should work with remote files

    -Definition at line 2637 of file class.pdf.php. +Definition at line 2637 of file class.pdf.php.

    02637                                               {
    +02638   // read in a png file, interpret it, then add to the system
    +02639   $error=0;
    +02640   $tmp = get_magic_quotes_runtime();
    +02641   set_magic_quotes_runtime(0);
    +02642   $fp = @fopen($file,'rb');
    +02643   if ($fp){
    +02644     $data='';
    +02645     while(!feof($fp)){
    +02646       $data .= fread($fp,1024);
    +02647     }
    +02648     fclose($fp);
    +02649   } else {
    +02650     $error = 1;
    +02651     $errormsg = 'trouble opening file: '.$file;
    +02652   }
    +02653   set_magic_quotes_runtime($tmp);
    +02654   
    +02655   if (!$error){
    +02656     $header = chr(137).chr(80).chr(78).chr(71).chr(13).chr(10).chr(26).chr(10);
    +02657     if (substr($data,0,8)!=$header){
    +02658       $error=1;
    +02659       $errormsg = 'this file does not have a valid header';
    +02660     }
    +02661   }
    +02662 
    +02663   if (!$error){
    +02664     // set pointer
    +02665     $p = 8;
    +02666     $len = strlen($data);
    +02667     // cycle through the file, identifying chunks
    +02668     $haveHeader=0;
    +02669     $info=array();
    +02670     $idata='';
    +02671     $pdata='';
    +02672     while ($p<$len){
    +02673       $chunkLen = $this->PRVT_getBytes($data,$p,4);
    +02674       $chunkType = substr($data,$p+4,4);
    +02675 //      echo $chunkType.' - '.$chunkLen.'<br>';
    +02676     
    +02677       switch($chunkType){
    +02678         case 'IHDR':
    +02679           // this is where all the file information comes from
    +02680           $info['width']=$this->PRVT_getBytes($data,$p+8,4);
    +02681           $info['height']=$this->PRVT_getBytes($data,$p+12,4);
    +02682           $info['bitDepth']=ord($data[$p+16]);
    +02683           $info['colorType']=ord($data[$p+17]);
    +02684           $info['compressionMethod']=ord($data[$p+18]);
    +02685           $info['filterMethod']=ord($data[$p+19]);
    +02686           $info['interlaceMethod']=ord($data[$p+20]);
    +02687 //print_r($info);
    +02688           $haveHeader=1;
    +02689           if ($info['compressionMethod']!=0){
    +02690             $error=1;
    +02691             $errormsg = 'unsupported compression method';
    +02692           }
    +02693           if ($info['filterMethod']!=0){
    +02694             $error=1;
    +02695             $errormsg = 'unsupported filter method';
    +02696           }
    +02697           break;
    +02698         case 'PLTE':
    +02699           $pdata.=substr($data,$p+8,$chunkLen);
    +02700           break;
    +02701         case 'IDAT':
    +02702           $idata.=substr($data,$p+8,$chunkLen);
    +02703           break;
    +02704         case 'tRNS': 
    +02705           //this chunk can only occur once and it must occur after the PLTE chunk and before IDAT chunk 
    +02706           //print "tRNS found, color type = ".$info['colorType']."<BR>"; 
    +02707           $transparency = array();
    +02708           if ($info['colorType'] == 3) { // indexed color, rbg 
    +02709           /* corresponding to entries in the plte chunk 
    +02710           Alpha for palette index 0: 1 byte 
    +02711           Alpha for palette index 1: 1 byte 
    +02712           ...etc... 
    +02713           */ 
    +02714             // there will be one entry for each palette entry. up until the last non-opaque entry.
    +02715             // set up an array, stretching over all palette entries which will be o (opaque) or 1 (transparent)
    +02716             $transparency['type']='indexed';
    +02717             $numPalette = strlen($pdata)/3;
    +02718             $trans=0;
    +02719             for ($i=$chunkLen;$i>=0;$i--){
    +02720               if (ord($data[$p+8+$i])==0){
    +02721                 $trans=$i;
    +02722               }
    +02723             }
    +02724             $transparency['data'] = $trans;
    +02725             
    +02726           } elseif($info['colorType'] == 0) { // grayscale 
    +02727           /* corresponding to entries in the plte chunk 
    +02728           Gray: 2 bytes, range 0 .. (2^bitdepth)-1 
    +02729           */ 
    +02730 //            $transparency['grayscale']=$this->PRVT_getBytes($data,$p+8,2); // g = grayscale 
    +02731             $transparency['type']='indexed';
    +02732             $transparency['data'] = ord($data[$p+8+1]);
    +02733           
    +02734           } elseif($info['colorType'] == 2) { // truecolor 
    +02735           /* corresponding to entries in the plte chunk 
    +02736           Red: 2 bytes, range 0 .. (2^bitdepth)-1 
    +02737           Green: 2 bytes, range 0 .. (2^bitdepth)-1 
    +02738           Blue: 2 bytes, range 0 .. (2^bitdepth)-1 
    +02739           */ 
    +02740             $transparency['r']=$this->PRVT_getBytes($data,$p+8,2); // r from truecolor 
    +02741             $transparency['g']=$this->PRVT_getBytes($data,$p+10,2); // g from truecolor 
    +02742             $transparency['b']=$this->PRVT_getBytes($data,$p+12,2); // b from truecolor 
    +02743           
    +02744           } else { 
    +02745           //unsupported transparency type 
    +02746           } 
    +02747           // KS End new code 
    +02748           break; 
    +02749         default:
    +02750           break;
    +02751       }
    +02752     
    +02753       $p += $chunkLen+12;
    +02754     }
    +02755     
    +02756     if(!$haveHeader){
    +02757       $error = 1;
    +02758       $errormsg = 'information header is missing';
    +02759     }
    +02760     if (isset($info['interlaceMethod']) && $info['interlaceMethod']){
    +02761       $error = 1;
    +02762       $errormsg = 'There appears to be no support for interlaced images in pdf.';
    +02763     }
    +02764   }
    +02765 
    +02766   if (!$error && $info['bitDepth'] > 8){
    +02767     $error = 1;
    +02768     $errormsg = 'only bit depth of 8 or less is supported';
    +02769   }
    +02770 
    +02771   if (!$error){
    +02772     if ($info['colorType']!=2 && $info['colorType']!=0 && $info['colorType']!=3){
    +02773       $error = 1;
    +02774       $errormsg = 'transparancey alpha channel not supported, transparency only supported for palette images.';
    +02775     } else {
    +02776       switch ($info['colorType']){
    +02777         case 3:
    +02778           $color = 'DeviceRGB';
    +02779           $ncolor=1;
    +02780           break;
    +02781         case 2:
    +02782           $color = 'DeviceRGB';
    +02783           $ncolor=3;
    +02784           break;
    +02785         case 0:
    +02786           $color = 'DeviceGray';
    +02787           $ncolor=1;
    +02788           break;
    +02789       }
    +02790     }
    +02791   }
    +02792   if ($error){
    +02793     $this->addMessage('PNG error - ('.$file.') '.$errormsg);
    +02794     return;
    +02795   }
    +02796   if ($w==0){
    +02797     $w=$h/$info['height']*$info['width'];
    +02798   }
    +02799   if ($h==0){
    +02800     $h=$w*$info['height']/$info['width'];
    +02801   }
    +02802 //print_r($info);
    +02803   // so this image is ok... add it in.
    +02804   $this->numImages++;
    +02805   $im=$this->numImages;
    +02806   $label='I'.$im;
    +02807   $this->numObj++;
    +02808 //  $this->o_image($this->numObj,'new',array('label'=>$label,'data'=>$idata,'iw'=>$w,'ih'=>$h,'type'=>'png','ic'=>$info['width']));
    +02809   $options = array('label'=>$label,'data'=>$idata,'bitsPerComponent'=>$info['bitDepth'],'pdata'=>$pdata
    +02810                                       ,'iw'=>$info['width'],'ih'=>$info['height'],'type'=>'png','color'=>$color,'ncolor'=>$ncolor);
    +02811   if (isset($transparency)){
    +02812     $options['transparency']=$transparency;
    +02813   }
    +02814   $this->o_image($this->numObj,'new',$options);
    +02815 
    +02816   $this->objects[$this->currentContents]['c'].="\nq";
    +02817   $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$w)." 0 0 ".sprintf('%.3f',$h)." ".sprintf('%.3f',$x)." ".sprintf('%.3f',$y)." cm";
    +02818   $this->objects[$this->currentContents]['c'].="\n/".$label.' Do';
    +02819   $this->objects[$this->currentContents]['c'].="\nQ";
    +02820 }
    +
    +

    +

    @@ -916,7 +1321,96 @@ add text to the document, at a specified location, size and angle on the page

    Definition at line 2156 of file class.pdf.php.

    -Referenced by Creport::dots(), Cezpdf::ezPRVTaddPageNumbers(), and Cezpdf::ezTable(). +Referenced by Creport::dots(), Cezpdf::ezPRVTaddPageNumbers(), and Cezpdf::ezTable().

    02156                                                                {
    +02157   if (!$this->numFonts){$this->selectFont('./fonts/Helvetica');}
    +02158 
    +02159   // if there are any open callbacks, then they should be called, to show the start of the line
    +02160   if ($this->nCallback>0){
    +02161     for ($i=$this->nCallback;$i>0;$i--){
    +02162       // call each function
    +02163       $info = array('x'=>$x,'y'=>$y,'angle'=>$angle,'status'=>'sol','p'=>$this->callback[$i]['p'],'nCallback'=>$this->callback[$i]['nCallback'],'height'=>$this->callback[$i]['height'],'decender'=>$this->callback[$i]['decender']);
    +02164       $func = $this->callback[$i]['f'];
    +02165       $this->$func($info);
    +02166     }
    +02167   }
    +02168   if ($angle==0){
    +02169     $this->objects[$this->currentContents]['c'].="\n".'BT '.sprintf('%.3f',$x).' '.sprintf('%.3f',$y).' Td';
    +02170   } else {
    +02171     $a = deg2rad((float)$angle);
    +02172     $tmp = "\n".'BT ';
    +02173     $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' ';
    +02174     $tmp .= sprintf('%.3f',$x).' '.sprintf('%.3f',$y).' Tm';
    +02175     $this->objects[$this->currentContents]['c'] .= $tmp;
    +02176   }
    +02177   if ($wordSpaceAdjust!=0 || $wordSpaceAdjust != $this->wordSpaceAdjust){
    +02178     $this->wordSpaceAdjust=$wordSpaceAdjust;
    +02179     $this->objects[$this->currentContents]['c'].=' '.sprintf('%.3f',$wordSpaceAdjust).' Tw';
    +02180   }
    +02181   $len=strlen($text);
    +02182   $start=0;
    +02183   for ($i=0;$i<$len;$i++){
    +02184     $f=1;
    +02185     $directive = $this->PRVTcheckTextDirective($text,$i,$f);
    +02186     if ($directive){
    +02187       // then we should write what we need to
    +02188       if ($i>$start){
    +02189         $part = substr($text,$start,$i-$start);
    +02190         $this->objects[$this->currentContents]['c'].=' /F'.$this->currentFontNum.' '.sprintf('%.1f',$size).' Tf ';
    +02191         $this->objects[$this->currentContents]['c'].=' ('.$this->filterText($part).') Tj';
    +02192       }
    +02193       if ($f){
    +02194         // then there was nothing drastic done here, restore the contents
    +02195         $this->setCurrentFont();
    +02196       } else {
    +02197         $this->objects[$this->currentContents]['c'] .= ' ET';
    +02198         $f=1;
    +02199         $xp=$x;
    +02200         $yp=$y;
    +02201         $directive = $this->PRVTcheckTextDirective1($text,$i,$f,1,$xp,$yp,$size,$angle,$wordSpaceAdjust);
    +02202         
    +02203         // restart the text object
    +02204           if ($angle==0){
    +02205             $this->objects[$this->currentContents]['c'].="\n".'BT '.sprintf('%.3f',$xp).' '.sprintf('%.3f',$yp).' Td';
    +02206           } else {
    +02207             $a = deg2rad((float)$angle);
    +02208             $tmp = "\n".'BT ';
    +02209             $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' ';
    +02210             $tmp .= sprintf('%.3f',$xp).' '.sprintf('%.3f',$yp).' Tm';
    +02211             $this->objects[$this->currentContents]['c'] .= $tmp;
    +02212           }
    +02213           if ($wordSpaceAdjust!=0 || $wordSpaceAdjust != $this->wordSpaceAdjust){
    +02214             $this->wordSpaceAdjust=$wordSpaceAdjust;
    +02215             $this->objects[$this->currentContents]['c'].=' '.sprintf('%.3f',$wordSpaceAdjust).' Tw';
    +02216           }
    +02217       }
    +02218       // and move the writing point to the next piece of text
    +02219       $i=$i+$directive-1;
    +02220       $start=$i+1;
    +02221     }
    +02222     
    +02223   }
    +02224   if ($start<$len){
    +02225     $part = substr($text,$start);
    +02226     $this->objects[$this->currentContents]['c'].=' /F'.$this->currentFontNum.' '.sprintf('%.1f',$size).' Tf ';
    +02227     $this->objects[$this->currentContents]['c'].=' ('.$this->filterText($part).') Tj';
    +02228   }
    +02229   $this->objects[$this->currentContents]['c'].=' ET';
    +02230 
    +02231   // if there are any open callbacks, then they should be called, to show the end of the line
    +02232   if ($this->nCallback>0){
    +02233     for ($i=$this->nCallback;$i>0;$i--){
    +02234       // call each function
    +02235       $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,$text);
    +02236       $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'eol','p'=>$this->callback[$i]['p'],'nCallback'=>$this->callback[$i]['nCallback'],'height'=>$this->callback[$i]['height'],'decender'=>$this->callback[$i]['decender']);
    +02237       $func = $this->callback[$i]['f'];
    +02238       $this->$func($info);
    +02239     }
    +02240   }
    +02241 
    +02242 }
    +
    +

    +

    @@ -993,7 +1487,118 @@ add text to the page, but ensure that it fits within a certain width if it does

    Definition at line 2331 of file class.pdf.php.

    -Referenced by Cezpdf::ezTable(), and Cezpdf::ezText(). +Referenced by Cezpdf::ezTable(), and Cezpdf::ezText().

    02331                                                                                      {
    +02332   // this will display the text, and if it goes beyond the width $width, will backtrack to the 
    +02333   // previous space or hyphen, and return the remainder of the text.
    +02334 
    +02335   // $justification can be set to 'left','right','center','centre','full'
    +02336 
    +02337   // need to store the initial text state, as this will change during the width calculation
    +02338   // but will need to be re-set before printing, so that the chars work out right
    +02339   $store_currentTextState = $this->currentTextState;
    +02340 
    +02341   if (!$this->numFonts){$this->selectFont('./fonts/Helvetica');}
    +02342   if ($width<=0){
    +02343     // error, pretend it printed ok, otherwise risking a loop
    +02344     return '';
    +02345   }
    +02346   $w=0;
    +02347   $break=0;
    +02348   $breakWidth=0;
    +02349   $len=strlen($text);
    +02350   $cf = $this->currentFont;
    +02351   $tw = $width/$size*1000;
    +02352   for ($i=0;$i<$len;$i++){
    +02353     $f=1;
    +02354     $directive = $this->PRVTcheckTextDirective($text,$i,$f);
    +02355     if ($directive){
    +02356       if ($f){
    +02357         $this->setCurrentFont();
    +02358         $cf = $this->currentFont;
    +02359       }
    +02360       $i=$i+$directive-1;
    +02361     } else {
    +02362       $cOrd = ord($text[$i]);
    +02363       if (isset($this->fonts[$cf]['differences'][$cOrd])){
    +02364         // then this character is being replaced by another
    +02365         $cOrd2 = $this->fonts[$cf]['differences'][$cOrd];
    +02366       } else {
    +02367         $cOrd2 = $cOrd;
    +02368       }
    +02369   
    +02370       if (isset($this->fonts[$cf]['C'][$cOrd2]['WX'])){
    +02371         $w+=$this->fonts[$cf]['C'][$cOrd2]['WX'];
    +02372       }
    +02373       if ($w>$tw){
    +02374         // then we need to truncate this line
    +02375         if ($break>0){
    +02376           // then we have somewhere that we can split :)
    +02377           if ($text[$break]==' '){
    +02378             $tmp = substr($text,0,$break);
    +02379           } else {
    +02380             $tmp = substr($text,0,$break+1);
    +02381           }
    +02382           $adjust=0;
    +02383           $this->PRVTadjustWrapText($tmp,$breakWidth,$width,$x,$adjust,$justification);
    +02384 
    +02385           // reset the text state
    +02386           $this->currentTextState = $store_currentTextState;
    +02387           $this->setCurrentFont();
    +02388           if (!$test){
    +02389             $this->addText($x,$y,$size,$tmp,$angle,$adjust);
    +02390           }
    +02391           return substr($text,$break+1);
    +02392         } else {
    +02393           // just split before the current character
    +02394           $tmp = substr($text,0,$i);
    +02395           $adjust=0;
    +02396           $ctmp=ord($text[$i]);
    +02397           if (isset($this->fonts[$cf]['differences'][$ctmp])){
    +02398             $ctmp=$this->fonts[$cf]['differences'][$ctmp];
    +02399           }
    +02400           $tmpw=($w-$this->fonts[$cf]['C'][$ctmp]['WX'])*$size/1000;
    +02401           $this->PRVTadjustWrapText($tmp,$tmpw,$width,$x,$adjust,$justification);
    +02402           // reset the text state
    +02403           $this->currentTextState = $store_currentTextState;
    +02404           $this->setCurrentFont();
    +02405           if (!$test){
    +02406             $this->addText($x,$y,$size,$tmp,$angle,$adjust);
    +02407           }
    +02408           return substr($text,$i);
    +02409         }
    +02410       }
    +02411       if ($text[$i]=='-'){
    +02412         $break=$i;
    +02413         $breakWidth = $w*$size/1000;
    +02414       }
    +02415       if ($text[$i]==' '){
    +02416         $break=$i;
    +02417         $ctmp=ord($text[$i]);
    +02418         if (isset($this->fonts[$cf]['differences'][$ctmp])){
    +02419           $ctmp=$this->fonts[$cf]['differences'][$ctmp];
    +02420         }
    +02421         $breakWidth = ($w-$this->fonts[$cf]['C'][$ctmp]['WX'])*$size/1000;
    +02422       }
    +02423     }
    +02424   }
    +02425   // then there was no need to break this line
    +02426   if ($justification=='full'){
    +02427     $justification='left';
    +02428   }
    +02429   $adjust=0;
    +02430   $tmpw=$w*$size/1000;
    +02431   $this->PRVTadjustWrapText($text,$tmpw,$width,$x,$adjust,$justification);
    +02432   // reset the text state
    +02433   $this->currentTextState = $store_currentTextState;
    +02434   $this->setCurrentFont();
    +02435   if (!$test){
    +02436     $this->addText($x,$y,$size,$text,$angle,$adjust,$angle);
    +02437   }
    +02438   return '';
    +02439 }
    +
    +

    +

    @@ -1025,7 +1630,27 @@ ARC4 encrypt a text string

    Definition at line 1138 of file class.pdf.php.

    -References $a, $b, $c, and $t. +References $a, $b, $c, and $t.

    01138                     {
    +01139   $len=strlen($text);
    +01140   $a=0;
    +01141   $b=0;
    +01142   $c = $this->arc4;
    +01143   $out='';
    +01144   for ($i=0;$i<$len;$i++){
    +01145     $a = ($a+1)%256;
    +01146     $t= $c[$a];
    +01147     $b = ($b+ord($t))%256;
    +01148     $c[$a]=$c[$b];
    +01149     $c[$b]=$t;
    +01150     $k = ord($c[(ord($c[$a])+ord($c[$b]))%256]);
    +01151     $out.=chr(ord($text[$i]) ^ $k);
    +01152   }
    +01153   
    +01154   return $out;
    +01155 }
    +
    +

    +

    @@ -1057,7 +1682,31 @@ initialize the ARC4 encryption

    Definition at line 1112 of file class.pdf.php.

    -References $i, and $t. +References $i, and $t.

    01112                            {
    +01113   $this->arc4 = '';
    +01114   // setup the control array
    +01115   if (strlen($key)==0){
    +01116     return;
    +01117   }
    +01118   $k = '';
    +01119   while(strlen($k)<256){
    +01120     $k.=$key;
    +01121   }
    +01122   $k=substr($k,0,256);
    +01123   for ($i=0;$i<256;$i++){
    +01124     $this->arc4 .= chr($i);
    +01125   }
    +01126   $j=0;
    +01127   for ($i=0;$i<256;$i++){
    +01128     $t = $this->arc4[$i];
    +01129     $j = ($j + ord($t) + ord($k[$i]))%256;
    +01130     $this->arc4[$i]=$this->arc4[$j];
    +01131     $this->arc4[$j]=$t;
    +01132   }    
    +01133 }
    +
    +

    +

    @@ -1086,7 +1735,11 @@ References $i, and should be used for internal checks, not implemented as yet

    -Definition at line 1214 of file class.pdf.php. +Definition at line 1214 of file class.pdf.php.

    01214                        {
    +01215 }
    +
    +

    +

    @@ -1117,7 +1770,20 @@ close an object

    Definition at line 2518 of file class.pdf.php.

    -Referenced by Cezpdf::ezPRVTaddPageNumbers(), and Cezpdf::ezTable(). +Referenced by Cezpdf::ezPRVTaddPageNumbers(), and Cezpdf::ezTable().

    02518                       {
    +02519   // close the object, as long as there was one open in the first place, which will be indicated by
    +02520   // an objectId on the stack.
    +02521   if ($this->nStack>0){
    +02522     $this->currentContents=$this->stack[$this->nStack]['c'];
    +02523     $this->currentPage=$this->stack[$this->nStack]['p'];
    +02524     $this->nStack--;
    +02525     // easier to probably not worry about removing the old entries, they will be overwritten
    +02526     // if there are new ones.
    +02527   }
    +02528 }
    +
    +

    +

    @@ -1192,7 +1858,15 @@ Referenced by Cezpdf::

    draw a bezier curve based on 4 control points

    -Definition at line 1682 of file class.pdf.php. +Definition at line 1682 of file class.pdf.php.

    01682                                                {
    +01683   // in the current line style, draw a bezier curve from (x0,y0) to (x3,y3) using the other two points
    +01684   // as the control points for the curve.
    +01685   $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x0).' '.sprintf('%.3f',$y0).' m '.sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1);
    +01686   $this->objects[$this->currentContents]['c'].= ' '.sprintf('%.3f',$x2).' '.sprintf('%.3f',$y2).' '.sprintf('%.3f',$x3).' '.sprintf('%.3f',$y3).' c S';
    +01687 }
    +
    +

    +

    @@ -1282,7 +1956,71 @@ draws an ellipse in the current line style centered at $x0,$y0, radii $r1,$r2 if

    Definition at line 1713 of file class.pdf.php.

    -References $a, $c1, $i, and $tmp. +References $a, $c1, $i, and $tmp.

    01713                                                                                             {
    +01714   if ($r1==0){
    +01715     return;
    +01716   }
    +01717   if ($r2==0){
    +01718     $r2=$r1;
    +01719   }
    +01720   if ($nSeg<2){
    +01721     $nSeg=2;
    +01722   }
    +01723 
    +01724   $astart = deg2rad((float)$astart);
    +01725   $afinish = deg2rad((float)$afinish);
    +01726   $totalAngle =$afinish-$astart;
    +01727 
    +01728   $dt = $totalAngle/$nSeg;
    +01729   $dtm = $dt/3;
    +01730 
    +01731   if ($angle != 0){
    +01732     $a = -1*deg2rad((float)$angle);
    +01733     $tmp = "\n q ";
    +01734     $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' ';
    +01735     $tmp .= sprintf('%.3f',$x0).' '.sprintf('%.3f',$y0).' cm';
    +01736     $this->objects[$this->currentContents]['c'].= $tmp;
    +01737     $x0=0;
    +01738     $y0=0;
    +01739   }
    +01740 
    +01741   $t1 = $astart;
    +01742   $a0 = $x0+$r1*cos($t1);
    +01743   $b0 = $y0+$r2*sin($t1);
    +01744   $c0 = -$r1*sin($t1);
    +01745   $d0 = $r2*cos($t1);
    +01746 
    +01747   $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$a0).' '.sprintf('%.3f',$b0).' m ';
    +01748   for ($i=1;$i<=$nSeg;$i++){
    +01749     // draw this bit of the total curve
    +01750     $t1 = $i*$dt+$astart;
    +01751     $a1 = $x0+$r1*cos($t1);
    +01752     $b1 = $y0+$r2*sin($t1);
    +01753     $c1 = -$r1*sin($t1);
    +01754     $d1 = $r2*cos($t1);
    +01755     $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',($a0+$c0*$dtm)).' '.sprintf('%.3f',($b0+$d0*$dtm));
    +01756     $this->objects[$this->currentContents]['c'].= ' '.sprintf('%.3f',($a1-$c1*$dtm)).' '.sprintf('%.3f',($b1-$d1*$dtm)).' '.sprintf('%.3f',$a1).' '.sprintf('%.3f',$b1).' c';
    +01757     $a0=$a1;
    +01758     $b0=$b1;
    +01759     $c0=$c1;
    +01760     $d0=$d1;    
    +01761   }
    +01762   if ($fill){
    +01763     $this->objects[$this->currentContents]['c'].=' f';
    +01764   } else {
    +01765     if ($close){
    +01766       $this->objects[$this->currentContents]['c'].=' s'; // small 's' signifies closing the path as well
    +01767     } else {
    +01768       $this->objects[$this->currentContents]['c'].=' S';
    +01769     }
    +01770   }
    +01771   if ($angle !=0){
    +01772     $this->objects[$this->currentContents]['c'].=' Q';
    +01773   }
    +01774 }
    +
    +

    +

    @@ -1314,7 +2052,19 @@ initialize the encryption for processing a particular object

    Definition at line 1098 of file class.pdf.php.

    -References $tmp. +References $tmp.

    01098                          {
    +01099   $tmp = $this->encryptionKey;
    +01100   $hex = dechex($id);
    +01101   if (strlen($hex)<6){
    +01102     $hex = substr('000000',0,6-strlen($hex)).$hex;
    +01103   }
    +01104   $tmp.= chr(hexdec(substr($hex,4,2))).chr(hexdec(substr($hex,2,2))).chr(hexdec(substr($hex,0,2))).chr(0).chr(0);
    +01105   $key = $this->md5_16($tmp);
    +01106   $this->ARC4_init(substr($key,0,10));
    +01107 }
    +
    +

    +

    @@ -1389,7 +2139,12 @@ References $

    draw a filled ellipse

    -Definition at line 1699 of file class.pdf.php. +Definition at line 1699 of file class.pdf.php.

    01699                                                                                  {
    +01700   return $this->ellipse($x0,$y0,$r1,$r2=0,$angle,$nSeg,$astart,$afinish,1,1);
    +01701 }
    +
    +

    +

    @@ -1444,7 +2199,12 @@ Definition at line 1835<

    References width.

    -Referenced by Cezpdf::ezTable(). +Referenced by Cezpdf::ezTable().

    01835                                                 {
    +01836   $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' '.sprintf('%.3f',$width).' '.sprintf('%.3f',$height).' re f';
    +01837 }
    +
    +

    +

    @@ -1477,7 +2237,21 @@ private

    Definition at line 1958 of file class.pdf.php.

    -Referenced by o_info(). +Referenced by o_info().

    01958                           {
    +01959   $text = str_replace('\\','\\\\',$text);
    +01960   $text = str_replace('(','\(',$text);
    +01961   $text = str_replace(')','\)',$text);
    +01962   $text = str_replace('&lt;','<',$text);
    +01963   $text = str_replace('&gt;','>',$text);
    +01964   $text = str_replace('&#039;','\'',$text);
    +01965   $text = str_replace('&quot;','"',$text);
    +01966   $text = str_replace('&amp;','&',$text);
    +01967 
    +01968   return $text;
    +01969 }
    +
    +

    +

    @@ -1508,7 +2282,12 @@ function for the user to find out what the ID is of the first page that was crea

    Definition at line 1639 of file class.pdf.php.

    -Referenced by Cezpdf::Cezpdf(). +Referenced by Cezpdf::Cezpdf().

    01639                          {
    +01640   return $this->firstPageId;
    +01641 }
    +
    +

    +

    @@ -1542,7 +2321,17 @@ Definition at line 1943<

    References $h, and $size.

    -Referenced by Cezpdf::ezTable(). +Referenced by Cezpdf::ezTable().

    01943                                {
    +01944   // note that this will most likely return a negative value
    +01945   if (!$this->numFonts){
    +01946     $this->selectFont('./fonts/Helvetica');
    +01947   }
    +01948   $h = $this->fonts[$this->currentFont]['FontBBox'][1];
    +01949   return $size*$h/1000;
    +01950 }
    +
    +

    +

    @@ -1576,7 +2365,17 @@ Definition at line 1929<

    References $h, and $size.

    -Referenced by Cezpdf::ezTable(), and Cezpdf::ezText(). +Referenced by Cezpdf::ezTable(), and Cezpdf::ezText().

    01929                              {
    +01930   if (!$this->numFonts){
    +01931     $this->selectFont('./fonts/Helvetica');
    +01932   }
    +01933   // for the current font, and the given size, what is the height of the font in user units
    +01934   $h = $this->fonts[$this->currentFont]['FontBBox'][3]-$this->fonts[$this->currentFont]['FontBBox'][1];
    +01935   return $size*$h/1000;
    +01936 }
    +
    +

    +

    @@ -1617,7 +2416,55 @@ calculate how wide a given text string will be on a page, at a given size. this

    Definition at line 2248 of file class.pdf.php.

    -Referenced by Cezpdf::ezPRVTaddPageNumbers(), Cezpdf::ezPrvtGetTextWidth(), and Cezpdf::ezTable(). +Referenced by Cezpdf::ezPRVTaddPageNumbers(), Cezpdf::ezPrvtGetTextWidth(), and Cezpdf::ezTable().

    02248                                   {
    +02249   // this function should not change any of the settings, though it will need to
    +02250   // track any directives which change during calculation, so copy them at the start
    +02251   // and put them back at the end.
    +02252   $store_currentTextState = $this->currentTextState;
    +02253 
    +02254   if (!$this->numFonts){
    +02255     $this->selectFont('./fonts/Helvetica');
    +02256   }
    +02257 
    +02258   // converts a number or a float to a string so it can get the width
    +02259   $text = "$text";
    +02260 
    +02261   // hmm, this is where it all starts to get tricky - use the font information to
    +02262   // calculate the width of each character, add them up and convert to user units
    +02263   $w=0;
    +02264   $len=strlen($text);
    +02265   $cf = $this->currentFont;
    +02266   for ($i=0;$i<$len;$i++){
    +02267     $f=1;
    +02268     $directive = $this->PRVTcheckTextDirective($text,$i,$f);
    +02269     if ($directive){
    +02270       if ($f){
    +02271         $this->setCurrentFont();
    +02272         $cf = $this->currentFont;
    +02273       }
    +02274       $i=$i+$directive-1;
    +02275     } else {
    +02276       $char=ord($text[$i]);
    +02277       if (isset($this->fonts[$cf]['differences'][$char])){
    +02278         // then this character is being replaced by another
    +02279         $name = $this->fonts[$cf]['differences'][$char];
    +02280         if (isset($this->fonts[$cf]['C'][$name]['WX'])){
    +02281           $w+=$this->fonts[$cf]['C'][$name]['WX'];
    +02282         }
    +02283       } else if (isset($this->fonts[$cf]['C'][$char]['WX'])){
    +02284         $w+=$this->fonts[$cf]['C'][$char]['WX'];
    +02285       }
    +02286     }
    +02287   }
    +02288   
    +02289   $this->currentTextState = $store_currentTextState;
    +02290   $this->setCurrentFont();
    +02291 
    +02292   return $w*$size/1000;
    +02293 }
    +
    +

    +

    @@ -1670,7 +2517,12 @@ draw a line from one set of coordinates to another

    Definition at line 1675 of file class.pdf.php.

    -Referenced by Creport::dots(), Cezpdf::ezPrvtGetTextWidth(), Cezpdf::ezPrvtTableDrawLines(), Cezpdf::ezTable(), and Cezpdf::ezText(). +Referenced by Creport::dots(), Cezpdf::ezPrvtGetTextWidth(), Cezpdf::ezPrvtTableDrawLines(), Cezpdf::ezTable(), and Cezpdf::ezText().

    01675                               {
    +01676   $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' m '.sprintf('%.3f',$x2).' '.sprintf('%.3f',$y2).' l S';
    +01677 }
    +
    +

    +

    @@ -1702,7 +2554,17 @@ calculate the 16 byte version of the 128 bit md5 digest of the string

    Definition at line 1086 of file class.pdf.php.

    -References $tmp. +References $tmp.

    01086                         {
    +01087   $tmp = md5($string);
    +01088   $out='';
    +01089   for ($i=0;$i<=30;$i=$i+2){
    +01090     $out.=chr(hexdec(substr($tmp,$i,2)));
    +01091   }
    +01092   return $out;
    +01093 }
    +
    +

    +

    @@ -1735,7 +2597,38 @@ private

    Definition at line 1267 of file class.pdf.php.

    -Referenced by Cpdf(). +Referenced by Cpdf().

    01267                                                   {
    +01268   $this->numObj=0;
    +01269   $this->objects = array();
    +01270 
    +01271   $this->numObj++;
    +01272   $this->o_catalog($this->numObj,'new');
    +01273 
    +01274   $this->numObj++;
    +01275   $this->o_outlines($this->numObj,'new');
    +01276 
    +01277   $this->numObj++;
    +01278   $this->o_pages($this->numObj,'new');
    +01279 
    +01280   $this->o_pages($this->numObj,'mediaBox',$pageSize);
    +01281   $this->currentNode = 3;
    +01282 
    +01283   $this->numObj++;
    +01284   $this->o_procset($this->numObj,'new');
    +01285 
    +01286   $this->numObj++;
    +01287   $this->o_info($this->numObj,'new');
    +01288 
    +01289   $this->numObj++;
    +01290   $this->o_page($this->numObj,'new');
    +01291 
    +01292   // need to store the first page id as there is no way to get it to the user during 
    +01293   // startup
    +01294   $this->firstPageId = $this->currentContents;
    +01295 }
    +
    +

    +

    @@ -1784,7 +2677,52 @@ Definition at line 1851<

    References $opt.

    -Referenced by Cezpdf::ezNewPage(), and Cezpdf::ezTable(). +Referenced by Cezpdf::ezNewPage(), and Cezpdf::ezTable().

    01851                                               {
    +01852 
    +01853   // if there is a state saved, then go up the stack closing them
    +01854   // then on the new page, re-open them with the right setings
    +01855   
    +01856   if ($this->nStateStack){
    +01857     for ($i=$this->nStateStack;$i>=1;$i--){
    +01858       $this->restoreState($i);
    +01859     }
    +01860   }
    +01861 
    +01862   $this->numObj++;
    +01863   if ($insert){
    +01864     // the id from the ezPdf class is the od of the contents of the page, not the page object itself
    +01865     // query that object to find the parent
    +01866     $rid = $this->objects[$id]['onPage'];
    +01867     $opt= array('rid'=>$rid,'pos'=>$pos);
    +01868     $this->o_page($this->numObj,'new',$opt);
    +01869   } else {
    +01870     $this->o_page($this->numObj,'new');
    +01871   }
    +01872   // if there is a stack saved, then put that onto the page
    +01873   if ($this->nStateStack){
    +01874     for ($i=1;$i<=$this->nStateStack;$i++){
    +01875       $this->saveState($i);
    +01876     }
    +01877   }  
    +01878   // and if there has been a stroke or fill colour set, then transfer them
    +01879   if ($this->currentColour['r']>=0){
    +01880     $this->setColor($this->currentColour['r'],$this->currentColour['g'],$this->currentColour['b'],1);
    +01881   }
    +01882   if ($this->currentStrokeColour['r']>=0){
    +01883     $this->setStrokeColor($this->currentStrokeColour['r'],$this->currentStrokeColour['g'],$this->currentStrokeColour['b'],1);
    +01884   }
    +01885 
    +01886   // if there is a line style set, then put this in too
    +01887   if (strlen($this->currentLineStyle)){
    +01888     $this->objects[$this->currentContents]['c'].="\n".$this->currentLineStyle;
    +01889   }
    +01890 
    +01891   // the call to the o_page object set currentContents to the present page, so this can be returned as the page id
    +01892   return $this->currentContents;
    +01893 }
    +
    +

    +

    @@ -1831,7 +2769,47 @@ an action object, used to link to URLS initially

    Definition at line 726 of file class.pdf.php.

    -References $o, $res, and label. +References $o, $res, and label.

    00726                                           {
    +00727   if ($action!='new'){
    +00728     $o =& $this->objects[$id];
    +00729   }
    +00730   switch ($action){
    +00731     case 'new':
    +00732       if (is_array($options)){
    +00733         $this->objects[$id]=array('t'=>'action','info'=>$options,'type'=>$options['type']);
    +00734       } else {
    +00735         // then assume a URI action
    +00736         $this->objects[$id]=array('t'=>'action','info'=>$options,'type'=>'URI');
    +00737       }
    +00738       break;
    +00739     case 'out':
    +00740       if ($this->encrypted){
    +00741         $this->encryptInit($id);
    +00742       }
    +00743       $res="\n".$id." 0 obj\n<< /Type /Action";
    +00744       switch($o['type']){
    +00745         case 'ilink':
    +00746           // there will be an 'label' setting, this is the name of the destination
    +00747           $res.="\n/S /GoTo\n/D ".$this->destinations[(string)$o['info']['label']]." 0 R";
    +00748           break;
    +00749         case 'URI':
    +00750           $res.="\n/S /URI\n/URI (";
    +00751           if ($this->encrypted){
    +00752             $res.=$this->filterText($this->ARC4($o['info']));
    +00753           } else {
    +00754             $res.=$this->filterText($o['info']);
    +00755           }
    +00756           $res.=")";
    +00757           break;
    +00758       }
    +00759       $res.="\n>>\nendobj";
    +00760       return $res;
    +00761       break;
    +00762   }
    +00763 }
    +
    +

    +

    @@ -1878,7 +2856,57 @@ an annotation object, this will add an annotation to the current page. initially

    Definition at line 769 of file class.pdf.php.

    -References $label, $o, $res, and label. +References $label, $o, $res, and label.

    00769                                               {
    +00770   if ($action!='new'){
    +00771     $o =& $this->objects[$id];
    +00772   }
    +00773   switch ($action){
    +00774     case 'new':
    +00775       // add the annotation to the current page
    +00776       $pageId = $this->currentPage;
    +00777       $this->o_page($pageId,'annot',$id);
    +00778       // and add the action object which is going to be required
    +00779       switch($options['type']){
    +00780         case 'link':
    +00781           $this->objects[$id]=array('t'=>'annotation','info'=>$options);
    +00782           $this->numObj++;
    +00783           $this->o_action($this->numObj,'new',$options['url']);
    +00784           $this->objects[$id]['info']['actionId']=$this->numObj;
    +00785           break;
    +00786         case 'ilink':
    +00787           // this is to a named internal link
    +00788           $label = $options['label'];
    +00789           $this->objects[$id]=array('t'=>'annotation','info'=>$options);
    +00790           $this->numObj++;
    +00791           $this->o_action($this->numObj,'new',array('type'=>'ilink','label'=>$label));
    +00792           $this->objects[$id]['info']['actionId']=$this->numObj;
    +00793           break;
    +00794       }
    +00795       break;
    +00796     case 'out':
    +00797       $res="\n".$id." 0 obj\n<< /Type /Annot";
    +00798       switch($o['info']['type']){
    +00799         case 'link':
    +00800         case 'ilink':
    +00801           $res.= "\n/Subtype /Link";
    +00802           break;
    +00803       }
    +00804       $res.="\n/A ".$o['info']['actionId']." 0 R";
    +00805       $res.="\n/Border [0 0 0]";
    +00806       $res.="\n/H /I";
    +00807       $res.="\n/Rect [ ";
    +00808       foreach($o['info']['rect'] as $v){
    +00809         $res.= sprintf("%.4f ",$v);
    +00810       }
    +00811       $res.="]";
    +00812       $res.="\n>>\nendobj";
    +00813       return $res;
    +00814       break;
    +00815   }
    +00816 }
    +
    +

    +

    @@ -1927,7 +2955,55 @@ Definition at line 297 References $action, $o, $options, $res, o_viewerPreferences(), and openHere().

    -Referenced by o_outlines(), and o_pages(). +Referenced by o_outlines(), and o_pages().

    00297                                            {
    +00298   if ($action!='new'){
    +00299     $o =& $this->objects[$id];
    +00300   }
    +00301   switch ($action){
    +00302     case 'new':
    +00303       $this->objects[$id]=array('t'=>'catalog','info'=>array());
    +00304       $this->catalogId=$id;
    +00305       break;
    +00306     case 'outlines':
    +00307     case 'pages':
    +00308     case 'openHere':
    +00309       $o['info'][$action]=$options;
    +00310       break;
    +00311     case 'viewerPreferences':
    +00312       if (!isset($o['info']['viewerPreferences'])){
    +00313         $this->numObj++;
    +00314         $this->o_viewerPreferences($this->numObj,'new');
    +00315         $o['info']['viewerPreferences']=$this->numObj;
    +00316       }
    +00317       $vp = $o['info']['viewerPreferences'];
    +00318       $this->o_viewerPreferences($vp,'add',$options);
    +00319       break;
    +00320     case 'out':
    +00321       $res="\n".$id." 0 obj\n".'<< /Type /Catalog';
    +00322       foreach($o['info'] as $k=>$v){
    +00323         switch($k){
    +00324           case 'outlines':
    +00325             $res.="\n".'/Outlines '.$v.' 0 R';
    +00326             break;
    +00327           case 'pages':
    +00328             $res.="\n".'/Pages '.$v.' 0 R';
    +00329             break;
    +00330           case 'viewerPreferences':
    +00331             $res.="\n".'/ViewerPreferences '.$o['info']['viewerPreferences'].' 0 R';
    +00332             break;
    +00333           case 'openHere':
    +00334             $res.="\n".'/OpenAction '.$o['info']['openHere'].' 0 R';
    +00335             break;
    +00336         }
    +00337       }
    +00338       $res.=" >>\nendobj";
    +00339       return $res;
    +00340       break;
    +00341   }
    +00342 }
    +
    +

    +

    @@ -1974,7 +3050,55 @@ the contents objects hold all of the content which appears on pages

    Definition at line 890 of file class.pdf.php.

    -References $o, $res, and $tmp. +References $o, $res, and $tmp.

    00890                                             {
    +00891   if ($action!='new'){
    +00892     $o =& $this->objects[$id];
    +00893   }
    +00894   switch ($action){
    +00895     case 'new':
    +00896       $this->objects[$id]=array('t'=>'contents','c'=>'','info'=>array());
    +00897       if (strlen($options) && intval($options)){
    +00898         // then this contents is the primary for a page
    +00899         $this->objects[$id]['onPage']=$options;
    +00900       } else if ($options=='raw'){
    +00901         // then this page contains some other type of system object
    +00902         $this->objects[$id]['raw']=1;
    +00903       }
    +00904       break;
    +00905     case 'add':
    +00906       // add more options to the decleration
    +00907       foreach ($options as $k=>$v){
    +00908         $o['info'][$k]=$v;
    +00909       }
    +00910     case 'out':
    +00911       $tmp=$o['c'];
    +00912       $res= "\n".$id." 0 obj\n";
    +00913       if (isset($this->objects[$id]['raw'])){
    +00914         $res.=$tmp;
    +00915       } else {
    +00916         $res.= "<<";
    +00917         if (function_exists('gzcompress') && $this->options['compression']){
    +00918           // then implement ZLIB based compression on this content stream
    +00919           $res.=" /Filter /FlateDecode";
    +00920           $tmp = gzcompress($tmp);
    +00921         }
    +00922         if ($this->encrypted){
    +00923           $this->encryptInit($id);
    +00924           $tmp = $this->ARC4($tmp);
    +00925         }
    +00926         foreach($o['info'] as $k=>$v){
    +00927           $res .= "\n/".$k.' '.$v;
    +00928         }
    +00929         $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream";
    +00930       }
    +00931       $res.="\nendobj\n";
    +00932       return $res;
    +00933       break;
    +00934   }
    +00935 }
    +
    +

    +

    @@ -2021,7 +3145,40 @@ destination object, used to specify the location for the user to jump to, presen

    Definition at line 224 of file class.pdf.php.

    -References $action, $o, $options, $res, and $tmp. +References $action, $o, $options, $res, and $tmp.

    00224                                                {
    +00225   if ($action!='new'){
    +00226     $o =& $this->objects[$id];
    +00227   }
    +00228   switch($action){
    +00229     case 'new':
    +00230       $this->objects[$id]=array('t'=>'destination','info'=>array());
    +00231       $tmp = '';
    +00232       switch ($options['type']){
    +00233         case 'XYZ':
    +00234         case 'FitR':
    +00235           $tmp =  ' '.$options['p3'].$tmp;
    +00236         case 'FitH':
    +00237         case 'FitV':
    +00238         case 'FitBH':
    +00239         case 'FitBV':
    +00240           $tmp =  ' '.$options['p1'].' '.$options['p2'].$tmp;
    +00241         case 'Fit':
    +00242         case 'FitB':
    +00243           $tmp =  $options['type'].$tmp;
    +00244           $this->objects[$id]['info']['string']=$tmp;
    +00245           $this->objects[$id]['info']['page']=$options['page'];
    +00246       }
    +00247       break;
    +00248     case 'out':
    +00249       $tmp = $o['info'];
    +00250       $res="\n".$id." 0 obj\n".'['.$tmp['page'].' 0 R /'.$tmp['string']."]\nendobj\n";
    +00251       return $res;
    +00252       break;
    +00253   }
    +00254 }
    +
    +

    +

    @@ -2068,7 +3225,71 @@ encryption object.

    Definition at line 1015 of file class.pdf.php.

    -References $action, $o, $res, and $tmp. +References $action, $o, $res, and $tmp.

    01015                                               {
    +01016   if ($action!='new'){
    +01017     $o =& $this->objects[$id];
    +01018   }
    +01019   switch($action){
    +01020     case 'new':
    +01021       // make the new object
    +01022       $this->objects[$id]=array('t'=>'encryption','info'=>$options);
    +01023       $this->arc4_objnum=$id;
    +01024       // figure out the additional paramaters required
    +01025       $pad = chr(0x28).chr(0xBF).chr(0x4E).chr(0x5E).chr(0x4E).chr(0x75).chr(0x8A).chr(0x41).chr(0x64).chr(0x00).chr(0x4E).chr(0x56).chr(0xFF).chr(0xFA).chr(0x01).chr(0x08).chr(0x2E).chr(0x2E).chr(0x00).chr(0xB6).chr(0xD0).chr(0x68).chr(0x3E).chr(0x80).chr(0x2F).chr(0x0C).chr(0xA9).chr(0xFE).chr(0x64).chr(0x53).chr(0x69).chr(0x7A);
    +01026       $len = strlen($options['owner']);
    +01027       if ($len>32){
    +01028         $owner = substr($options['owner'],0,32);
    +01029       } else if ($len<32){
    +01030         $owner = $options['owner'].substr($pad,0,32-$len);
    +01031       } else {
    +01032         $owner = $options['owner'];
    +01033       }
    +01034       $len = strlen($options['user']);
    +01035       if ($len>32){
    +01036         $user = substr($options['user'],0,32);
    +01037       } else if ($len<32){
    +01038         $user = $options['user'].substr($pad,0,32-$len);
    +01039       } else {
    +01040         $user = $options['user'];
    +01041       }
    +01042       $tmp = $this->md5_16($owner);
    +01043       $okey = substr($tmp,0,5);
    +01044       $this->ARC4_init($okey);
    +01045       $ovalue=$this->ARC4($user);
    +01046       $this->objects[$id]['info']['O']=$ovalue;
    +01047       // now make the u value, phew.
    +01048       $tmp = $this->md5_16($user.$ovalue.chr($options['p']).chr(255).chr(255).chr(255).$this->fileIdentifier);
    +01049       $ukey = substr($tmp,0,5);
    +01050 
    +01051       $this->ARC4_init($ukey);
    +01052       $this->encryptionKey = $ukey;
    +01053       $this->encrypted=1;
    +01054       $uvalue=$this->ARC4($pad);
    +01055 
    +01056       $this->objects[$id]['info']['U']=$uvalue;
    +01057       $this->encryptionKey=$ukey;
    +01058      
    +01059       // initialize the arc4 array
    +01060       break;
    +01061     case 'out':
    +01062       $res= "\n".$id." 0 obj\n<<";
    +01063       $res.="\n/Filter /Standard";
    +01064       $res.="\n/V 1";
    +01065       $res.="\n/R 2";
    +01066       $res.="\n/O (".$this->filterText($o['info']['O']).')';
    +01067       $res.="\n/U (".$this->filterText($o['info']['U']).')';
    +01068       // and the p-value needs to be converted to account for the twos-complement approach
    +01069       $o['info']['p'] = (($o['info']['p']^255)+1)*-1;
    +01070       $res.="\n/P ".($o['info']['p']);
    +01071       $res.="\n>>\nendobj\n";
    +01072       
    +01073       return $res;
    +01074       break;
    +01075   }
    +01076 }
    +
    +

    +

    @@ -2115,7 +3336,89 @@ an object to hold the font description

    Definition at line 475 of file class.pdf.php.

    -References $o, $options, $res, addMessage(), name, o_fontEncoding(), and o_pages(). +References $o, $options, $res, addMessage(), name, o_fontEncoding(), and o_pages().

    00475                                         {
    +00476   if ($action!='new'){
    +00477     $o =& $this->objects[$id];
    +00478   }
    +00479   switch ($action){
    +00480     case 'new':
    +00481       $this->objects[$id]=array('t'=>'font','info'=>array('name'=>$options['name'],'SubType'=>'Type1'));
    +00482       $fontNum=$this->numFonts;
    +00483       $this->objects[$id]['info']['fontNum']=$fontNum;
    +00484       // deal with the encoding and the differences
    +00485       if (isset($options['differences'])){
    +00486         // then we'll need an encoding dictionary
    +00487         $this->numObj++;
    +00488         $this->o_fontEncoding($this->numObj,'new',$options);
    +00489         $this->objects[$id]['info']['encodingDictionary']=$this->numObj;
    +00490       } else if (isset($options['encoding'])){
    +00491         // we can specify encoding here
    +00492         switch($options['encoding']){
    +00493           case 'WinAnsiEncoding':
    +00494           case 'MacRomanEncoding':
    +00495           case 'MacExpertEncoding':
    +00496             $this->objects[$id]['info']['encoding']=$options['encoding'];
    +00497             break;
    +00498           case 'none':
    +00499             break;
    +00500           default:
    +00501             $this->objects[$id]['info']['encoding']='WinAnsiEncoding';
    +00502             break;
    +00503         }
    +00504       } else {
    +00505         $this->objects[$id]['info']['encoding']='WinAnsiEncoding';
    +00506       }
    +00507       // also tell the pages node about the new font
    +00508       $this->o_pages($this->currentNode,'font',array('fontNum'=>$fontNum,'objNum'=>$id));
    +00509       break;
    +00510     case 'add':
    +00511       foreach ($options as $k=>$v){
    +00512         switch ($k){
    +00513           case 'BaseFont':
    +00514             $o['info']['name'] = $v;
    +00515             break;
    +00516           case 'FirstChar':
    +00517           case 'LastChar':
    +00518           case 'Widths':
    +00519           case 'FontDescriptor':
    +00520           case 'SubType':
    +00521           $this->addMessage('o_font '.$k." : ".$v);
    +00522             $o['info'][$k] = $v;
    +00523             break;
    +00524         }
    +00525      }
    +00526       break;
    +00527     case 'out':
    +00528       $res="\n".$id." 0 obj\n<< /Type /Font\n/Subtype /".$o['info']['SubType']."\n";
    +00529       $res.="/Name /F".$o['info']['fontNum']."\n";
    +00530       $res.="/BaseFont /".$o['info']['name']."\n";
    +00531       if (isset($o['info']['encodingDictionary'])){
    +00532         // then place a reference to the dictionary
    +00533         $res.="/Encoding ".$o['info']['encodingDictionary']." 0 R\n";
    +00534       } else if (isset($o['info']['encoding'])){
    +00535         // use the specified encoding
    +00536         $res.="/Encoding /".$o['info']['encoding']."\n";
    +00537       }
    +00538       if (isset($o['info']['FirstChar'])){
    +00539         $res.="/FirstChar ".$o['info']['FirstChar']."\n";
    +00540       }
    +00541       if (isset($o['info']['LastChar'])){
    +00542         $res.="/LastChar ".$o['info']['LastChar']."\n";
    +00543       }
    +00544       if (isset($o['info']['Widths'])){
    +00545         $res.="/Widths ".$o['info']['Widths']." 0 R\n";
    +00546       }
    +00547       if (isset($o['info']['FontDescriptor'])){
    +00548         $res.="/FontDescriptor ".$o['info']['FontDescriptor']." 0 R\n";
    +00549       }
    +00550       $res.=">>\nendobj";
    +00551       return $res;
    +00552       break;
    +00553   }
    +00554 }
    +
    +

    +

    @@ -2162,7 +3465,56 @@ a font descriptor, needed for including additional fonts

    Definition at line 559 of file class.pdf.php.

    -References $o, $res, label, and value. +References $o, $res, label, and value.

    00559                                                   {
    +00560   if ($action!='new'){
    +00561     $o =& $this->objects[$id];
    +00562   }
    +00563   switch ($action){
    +00564     case 'new':
    +00565       $this->objects[$id]=array('t'=>'fontDescriptor','info'=>$options);
    +00566       break;
    +00567     case 'out':
    +00568       $res="\n".$id." 0 obj\n<< /Type /FontDescriptor\n";
    +00569       foreach ($o['info'] as $label => $value){
    +00570         switch ($label){
    +00571           case 'Ascent':
    +00572           case 'CapHeight':
    +00573           case 'Descent':
    +00574           case 'Flags':
    +00575           case 'ItalicAngle':
    +00576           case 'StemV':
    +00577           case 'AvgWidth':
    +00578           case 'Leading':
    +00579           case 'MaxWidth':
    +00580           case 'MissingWidth':
    +00581           case 'StemH':
    +00582           case 'XHeight':
    +00583           case 'CharSet':
    +00584             if (strlen($value)){
    +00585               $res.='/'.$label.' '.$value."\n";
    +00586             }
    +00587             break;
    +00588           case 'FontFile':
    +00589           case 'FontFile2':
    +00590           case 'FontFile3':
    +00591             $res.='/'.$label.' '.$value." 0 R\n";
    +00592             break;
    +00593           case 'FontBBox':
    +00594             $res.='/'.$label.' ['.$value[0].' '.$value[1].' '.$value[2].' '.$value[3]."]\n";
    +00595             break;
    +00596           case 'FontName':
    +00597             $res.='/'.$label.' /'.$value."\n";
    +00598             break;
    +00599         }
    +00600       }
    +00601       $res.=">>\nendobj";
    +00602       return $res;
    +00603       break;
    +00604   }
    +00605 }
    +
    +

    +

    @@ -2211,7 +3563,42 @@ Definition at line 610 References $label, $num, $o, $res, and label.

    -Referenced by o_font(). +Referenced by o_font().

    00610                                                 {
    +00611   if ($action!='new'){
    +00612     $o =& $this->objects[$id];
    +00613   }
    +00614   switch ($action){
    +00615     case 'new':
    +00616       // the options array should contain 'differences' and maybe 'encoding'
    +00617       $this->objects[$id]=array('t'=>'fontEncoding','info'=>$options);
    +00618       break;
    +00619     case 'out':
    +00620       $res="\n".$id." 0 obj\n<< /Type /Encoding\n";
    +00621       if (!isset($o['info']['encoding'])){
    +00622         $o['info']['encoding']='WinAnsiEncoding';
    +00623       }
    +00624       if ($o['info']['encoding']!='none'){
    +00625         $res.="/BaseEncoding /".$o['info']['encoding']."\n";
    +00626       }
    +00627       $res.="/Differences \n[";
    +00628       $onum=-100;
    +00629       foreach($o['info']['differences'] as $num=>$label){
    +00630         if ($num!=$onum+1){
    +00631           // we cannot make use of consecutive numbering
    +00632           $res.= "\n".$num." /".$label;
    +00633         } else {
    +00634           $res.= " /".$label;
    +00635         }
    +00636         $onum=$num;
    +00637       }
    +00638       $res.="\n]\n>>\nendobj";
    +00639       return $res;
    +00640       break;
    +00641   }
    +00642 }
    +
    +

    +

    @@ -2258,7 +3645,80 @@ an image object, will be an XObject in the document, includes description and da

    Definition at line 940 of file class.pdf.php.

    -References $action, $o, $res, $tmp, and label. +References $action, $o, $res, $tmp, and label.

    00940                                          {
    +00941   if ($action!='new'){
    +00942     $o =& $this->objects[$id];
    +00943   }
    +00944   switch($action){
    +00945     case 'new':
    +00946       // make the new object
    +00947       $this->objects[$id]=array('t'=>'image','data'=>$options['data'],'info'=>array());
    +00948       $this->objects[$id]['info']['Type']='/XObject';
    +00949       $this->objects[$id]['info']['Subtype']='/Image';
    +00950       $this->objects[$id]['info']['Width']=$options['iw'];
    +00951       $this->objects[$id]['info']['Height']=$options['ih'];
    +00952       if (!isset($options['type']) || $options['type']=='jpg'){
    +00953         if (!isset($options['channels'])){
    +00954           $options['channels']=3;
    +00955         }
    +00956         switch($options['channels']){
    +00957           case 1:
    +00958             $this->objects[$id]['info']['ColorSpace']='/DeviceGray';
    +00959             break;
    +00960           default:
    +00961             $this->objects[$id]['info']['ColorSpace']='/DeviceRGB';
    +00962             break;
    +00963         }
    +00964         $this->objects[$id]['info']['Filter']='/DCTDecode';
    +00965         $this->objects[$id]['info']['BitsPerComponent']=8;
    +00966       } else if ($options['type']=='png'){
    +00967         $this->objects[$id]['info']['Filter']='/FlateDecode';
    +00968         $this->objects[$id]['info']['DecodeParms']='<< /Predictor 15 /Colors '.$options['ncolor'].' /Columns '.$options['iw'].' /BitsPerComponent '.$options['bitsPerComponent'].'>>';
    +00969         if (strlen($options['pdata'])){
    +00970           $tmp = ' [ /Indexed /DeviceRGB '.(strlen($options['pdata'])/3-1).' ';
    +00971           $this->numObj++;
    +00972           $this->o_contents($this->numObj,'new');
    +00973           $this->objects[$this->numObj]['c']=$options['pdata'];
    +00974           $tmp.=$this->numObj.' 0 R';
    +00975           $tmp .=' ]';
    +00976           $this->objects[$id]['info']['ColorSpace'] = $tmp;
    +00977           if (isset($options['transparency'])){
    +00978             switch($options['transparency']['type']){
    +00979               case 'indexed':
    +00980                 $tmp=' [ '.$options['transparency']['data'].' '.$options['transparency']['data'].'] ';
    +00981                 $this->objects[$id]['info']['Mask'] = $tmp;
    +00982                 break;
    +00983             }
    +00984           }
    +00985         } else {
    +00986           $this->objects[$id]['info']['ColorSpace']='/'.$options['color'];
    +00987         }
    +00988         $this->objects[$id]['info']['BitsPerComponent']=$options['bitsPerComponent'];
    +00989       }
    +00990       // assign it a place in the named resource dictionary as an external object, according to
    +00991       // the label passed in with it.
    +00992       $this->o_pages($this->currentNode,'xObject',array('label'=>$options['label'],'objNum'=>$id));
    +00993       // also make sure that we have the right procset object for it.
    +00994       $this->o_procset($this->procsetObjectId,'add','ImageC');
    +00995       break;
    +00996     case 'out':
    +00997       $tmp=$o['data'];
    +00998       $res= "\n".$id." 0 obj\n<<";
    +00999       foreach($o['info'] as $k=>$v){
    +01000         $res.="\n/".$k.' '.$v;
    +01001       }
    +01002       if ($this->encrypted){
    +01003         $this->encryptInit($id);
    +01004         $tmp = $this->ARC4($tmp);
    +01005       }
    +01006       $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream\nendobj\n";
    +01007       return $res;
    +01008       break;
    +01009   }
    +01010 }
    +
    +

    +

    @@ -2305,7 +3765,49 @@ define the document information

    Definition at line 682 of file class.pdf.php.

    -References $o, $res, and filterText(). +References $o, $res, and filterText().

    00682                                         {
    +00683   if ($action!='new'){
    +00684     $o =& $this->objects[$id];
    +00685   }
    +00686   switch ($action){
    +00687     case 'new':
    +00688       $this->infoObject=$id;
    +00689       $date='D:'.date('Ymd');
    +00690       $this->objects[$id]=array('t'=>'info','info'=>array('Creator'=>'R and OS php pdf writer, http://www.ros.co.nz','CreationDate'=>$date));
    +00691       break;
    +00692     case 'Title':
    +00693     case 'Author':
    +00694     case 'Subject':
    +00695     case 'Keywords':
    +00696     case 'Creator':
    +00697     case 'Producer':
    +00698     case 'CreationDate':
    +00699     case 'ModDate':
    +00700     case 'Trapped':
    +00701       $o['info'][$action]=$options;
    +00702       break;
    +00703     case 'out':
    +00704       if ($this->encrypted){
    +00705         $this->encryptInit($id);
    +00706       }
    +00707       $res="\n".$id." 0 obj\n<<\n";
    +00708       foreach ($o['info']  as $k=>$v){
    +00709         $res.='/'.$k.' (';
    +00710         if ($this->encrypted){
    +00711           $res.=$this->filterText($this->ARC4($v));
    +00712         } else {
    +00713           $res.=$this->filterText($v);
    +00714         }
    +00715         $res.=")\n";
    +00716       }
    +00717       $res.=">>\nendobj";
    +00718       return $res;
    +00719       break;
    +00720   }
    +00721 }
    +
    +

    +

    @@ -2352,7 +3854,35 @@ define the outlines in the doc, empty for now

    Definition at line 445 of file class.pdf.php.

    -References $o, $options, $res, and o_catalog(). +References $o, $options, $res, and o_catalog().

    00445                                             {
    +00446   if ($action!='new'){
    +00447     $o =& $this->objects[$id];
    +00448   }
    +00449   switch ($action){
    +00450     case 'new':
    +00451       $this->objects[$id]=array('t'=>'outlines','info'=>array('outlines'=>array()));
    +00452       $this->o_catalog($this->catalogId,'outlines',$id);
    +00453       break;
    +00454     case 'outline':
    +00455       $o['info']['outlines'][]=$options;
    +00456       break;
    +00457     case 'out':
    +00458       if (count($o['info']['outlines'])){
    +00459         $res="\n".$id." 0 obj\n<< /Type /Outlines /Kids [";
    +00460         foreach($o['info']['outlines'] as $k=>$v){
    +00461           $res.=$v." 0 R ";
    +00462         }
    +00463         $res.="] /Count ".count($o['info']['outlines'])." >>\nendobj";
    +00464       } else {
    +00465         $res="\n".$id." 0 obj\n<< /Type /Outlines /Count 0 >>\nendobj";
    +00466       }
    +00467       return $res;
    +00468       break;
    +00469   }
    +00470 }
    +
    +

    +

    @@ -2399,7 +3929,74 @@ a page object, it also creates a contents object to hold its contents

    Definition at line 821 of file class.pdf.php.

    -References $count, $o, and $res. +References $count, $o, and $res.

    00821                                         {
    +00822   if ($action!='new'){
    +00823     $o =& $this->objects[$id];
    +00824   }
    +00825   switch ($action){
    +00826     case 'new':
    +00827       $this->numPages++;
    +00828       $this->objects[$id]=array('t'=>'page','info'=>array('parent'=>$this->currentNode,'pageNum'=>$this->numPages));
    +00829       if (is_array($options)){
    +00830         // then this must be a page insertion, array shoudl contain 'rid','pos'=[before|after]
    +00831         $options['id']=$id;
    +00832         $this->o_pages($this->currentNode,'page',$options);
    +00833       } else {
    +00834         $this->o_pages($this->currentNode,'page',$id);
    +00835       }
    +00836       $this->currentPage=$id;
    +00837       //make a contents object to go with this page
    +00838       $this->numObj++;
    +00839       $this->o_contents($this->numObj,'new',$id);
    +00840       $this->currentContents=$this->numObj;
    +00841       $this->objects[$id]['info']['contents']=array();
    +00842       $this->objects[$id]['info']['contents'][]=$this->numObj;
    +00843       $match = ($this->numPages%2 ? 'odd' : 'even');
    +00844       foreach($this->addLooseObjects as $oId=>$target){
    +00845         if ($target=='all' || $match==$target){
    +00846           $this->objects[$id]['info']['contents'][]=$oId;
    +00847         }
    +00848       }
    +00849       break;
    +00850     case 'content':
    +00851       $o['info']['contents'][]=$options;
    +00852       break;
    +00853     case 'annot':
    +00854       // add an annotation to this page
    +00855       if (!isset($o['info']['annot'])){
    +00856         $o['info']['annot']=array();
    +00857       }
    +00858       // $options should contain the id of the annotation dictionary
    +00859       $o['info']['annot'][]=$options;
    +00860       break;
    +00861     case 'out':
    +00862       $res="\n".$id." 0 obj\n<< /Type /Page";
    +00863       $res.="\n/Parent ".$o['info']['parent']." 0 R";
    +00864       if (isset($o['info']['annot'])){
    +00865         $res.="\n/Annots [";
    +00866         foreach($o['info']['annot'] as $aId){
    +00867           $res.=" ".$aId." 0 R";
    +00868         }
    +00869         $res.=" ]";
    +00870       }
    +00871       $count = count($o['info']['contents']);
    +00872       if ($count==1){
    +00873         $res.="\n/Contents ".$o['info']['contents'][0]." 0 R";
    +00874       } else if ($count>1){
    +00875         $res.="\n/Contents [\n";
    +00876         foreach ($o['info']['contents'] as $cId){
    +00877           $res.=$cId." 0 R\n";
    +00878         }
    +00879         $res.="]";
    +00880       }
    +00881       $res.="\n>>\nendobj";
    +00882       return $res;
    +00883       break;
    +00884   }
    +00885 }
    +
    +

    +

    @@ -2448,7 +4045,103 @@ Definition at line 347 References $i, $o, $options, $res, $tmp, label, and o_catalog().

    -Referenced by o_font(), and o_procset(). +Referenced by o_font(), and o_procset().

    00347                                          {
    +00348   if ($action!='new'){
    +00349     $o =& $this->objects[$id];
    +00350   }
    +00351   switch ($action){
    +00352     case 'new':
    +00353       $this->objects[$id]=array('t'=>'pages','info'=>array());
    +00354       $this->o_catalog($this->catalogId,'pages',$id);
    +00355       break;
    +00356     case 'page':
    +00357       if (!is_array($options)){
    +00358         // then it will just be the id of the new page
    +00359         $o['info']['pages'][]=$options;
    +00360       } else {
    +00361         // then it should be an array having 'id','rid','pos', where rid=the page to which this one will be placed relative
    +00362         // and pos is either 'before' or 'after', saying where this page will fit.
    +00363         if (isset($options['id']) && isset($options['rid']) && isset($options['pos'])){
    +00364           $i = array_search($options['rid'],$o['info']['pages']);
    +00365           if (isset($o['info']['pages'][$i]) && $o['info']['pages'][$i]==$options['rid']){
    +00366             // then there is a match
    +00367             // make a space
    +00368             switch ($options['pos']){
    +00369               case 'before':
    +00370                 $k = $i;
    +00371                 break;
    +00372               case 'after':
    +00373                 $k=$i+1;
    +00374                 break;
    +00375               default:
    +00376                 $k=-1;
    +00377                 break;
    +00378             }
    +00379             if ($k>=0){
    +00380               for ($j=count($o['info']['pages'])-1;$j>=$k;$j--){
    +00381                 $o['info']['pages'][$j+1]=$o['info']['pages'][$j];
    +00382               }
    +00383               $o['info']['pages'][$k]=$options['id'];
    +00384             }
    +00385           }
    +00386         } 
    +00387       }
    +00388       break;
    +00389     case 'procset':
    +00390       $o['info']['procset']=$options;
    +00391       break;
    +00392     case 'mediaBox':
    +00393       $o['info']['mediaBox']=$options; // which should be an array of 4 numbers
    +00394       break;
    +00395     case 'font':
    +00396       $o['info']['fonts'][]=array('objNum'=>$options['objNum'],'fontNum'=>$options['fontNum']);
    +00397       break;
    +00398     case 'xObject':
    +00399       $o['info']['xObjects'][]=array('objNum'=>$options['objNum'],'label'=>$options['label']);
    +00400       break;
    +00401     case 'out':
    +00402       if (count($o['info']['pages'])){
    +00403         $res="\n".$id." 0 obj\n<< /Type /Pages\n/Kids [";
    +00404         foreach($o['info']['pages'] as $k=>$v){
    +00405           $res.=$v." 0 R\n";
    +00406         }
    +00407         $res.="]\n/Count ".count($this->objects[$id]['info']['pages']);
    +00408         if ((isset($o['info']['fonts']) && count($o['info']['fonts'])) || isset($o['info']['procset'])){
    +00409           $res.="\n/Resources <<";
    +00410           if (isset($o['info']['procset'])){
    +00411             $res.="\n/ProcSet ".$o['info']['procset']." 0 R";
    +00412           }
    +00413           if (isset($o['info']['fonts']) && count($o['info']['fonts'])){
    +00414             $res.="\n/Font << ";
    +00415             foreach($o['info']['fonts'] as $finfo){
    +00416               $res.="\n/F".$finfo['fontNum']." ".$finfo['objNum']." 0 R";
    +00417             }
    +00418             $res.=" >>";
    +00419           }
    +00420           if (isset($o['info']['xObjects']) && count($o['info']['xObjects'])){
    +00421             $res.="\n/XObject << ";
    +00422             foreach($o['info']['xObjects'] as $finfo){
    +00423               $res.="\n/".$finfo['label']." ".$finfo['objNum']." 0 R";
    +00424             }
    +00425             $res.=" >>";
    +00426           }
    +00427           $res.="\n>>";
    +00428           if (isset($o['info']['mediaBox'])){
    +00429             $tmp=$o['info']['mediaBox'];
    +00430             $res.="\n/MediaBox [".sprintf('%.3f',$tmp[0]).' '.sprintf('%.3f',$tmp[1]).' '.sprintf('%.3f',$tmp[2]).' '.sprintf('%.3f',$tmp[3]).']';
    +00431           }
    +00432         }
    +00433         $res.="\n >>\nendobj";
    +00434       } else {
    +00435         $res="\n".$id." 0 obj\n<< /Type /Pages\n/Count 0\n>>\nendobj";
    +00436       }
    +00437       return $res;
    +00438     break;
    +00439   }
    +00440 }
    +
    +

    +

    @@ -2495,7 +4188,40 @@ the document procset, solves some problems with printing to old PS printers

    Definition at line 647 of file class.pdf.php.

    -References $o, $options, $res, label, and o_pages(). +References $o, $options, $res, label, and o_pages().

    00647                                            {
    +00648   if ($action!='new'){
    +00649     $o =& $this->objects[$id];
    +00650   }
    +00651   switch ($action){
    +00652     case 'new':
    +00653       $this->objects[$id]=array('t'=>'procset','info'=>array('PDF'=>1,'Text'=>1));
    +00654       $this->o_pages($this->currentNode,'procset',$id);
    +00655       $this->procsetObjectId=$id;
    +00656       break;
    +00657     case 'add':
    +00658       // this is to add new items to the procset list, despite the fact that this is considered
    +00659       // obselete, the items are required for printing to some postscript printers
    +00660       switch ($options) {
    +00661         case 'ImageB':
    +00662         case 'ImageC':
    +00663         case 'ImageI':
    +00664           $o['info'][$options]=1;
    +00665           break;
    +00666       }
    +00667       break;
    +00668     case 'out':
    +00669       $res="\n".$id." 0 obj\n[";
    +00670       foreach ($o['info'] as $label=>$val){
    +00671         $res.='/'.$label.' ';
    +00672       }
    +00673       $res.="]\nendobj";
    +00674       return $res;
    +00675       break;
    +00676   }
    +00677 }
    +
    +

    +

    @@ -2544,7 +4270,43 @@ Definition at line 259 References $o, and $res.

    -Referenced by o_catalog(). +Referenced by o_catalog().

    00259                                                      {
    +00260   if ($action!='new'){
    +00261     $o =& $this->objects[$id];
    +00262   }
    +00263   switch ($action){
    +00264     case 'new':
    +00265       $this->objects[$id]=array('t'=>'viewerPreferences','info'=>array());
    +00266       break;
    +00267     case 'add':
    +00268       foreach($options as $k=>$v){
    +00269         switch ($k){
    +00270           case 'HideToolbar':
    +00271           case 'HideMenubar':
    +00272           case 'HideWindowUI':
    +00273           case 'FitWindow':
    +00274           case 'CenterWindow':
    +00275           case 'NonFullScreenPageMode':
    +00276           case 'Direction':
    +00277             $o['info'][$k]=$v;
    +00278           break;
    +00279         }
    +00280       }
    +00281       break;
    +00282     case 'out':
    +00283 
    +00284       $res="\n".$id." 0 obj\n".'<< ';
    +00285       foreach($o['info'] as $k=>$v){
    +00286         $res.="\n/".$k.' '.$v;
    +00287       }
    +00288       $res.="\n>>\n";
    +00289       return $res;
    +00290       break;
    +00291   }
    +00292 }
    +
    +

    +

    @@ -2577,7 +4339,111 @@ private

    Definition at line 1306 of file class.pdf.php.

    -References $bits, $data, $file, $i, $row, $tmp, and name. +References $bits, $data, $file, $i, $row, $tmp, and name.

    01306                         {
    +01307   // assume that $font contains both the path and perhaps the extension to the file, split them
    +01308   $pos=strrpos($font,'/');
    +01309   if ($pos===false){
    +01310     $dir = './';
    +01311     $name = $font;
    +01312   } else {
    +01313     $dir=substr($font,0,$pos+1);
    +01314     $name=substr($font,$pos+1);
    +01315   }
    +01316 
    +01317   if (substr($name,-4)=='.afm'){
    +01318     $name=substr($name,0,strlen($name)-4);
    +01319   }
    +01320   $this->addMessage('openFont: '.$font.' - '.$name);
    +01321   if (file_exists($dir.'php_'.$name.'.afm')){
    +01322     $this->addMessage('openFont: php file exists '.$dir.'php_'.$name.'.afm');
    +01323     $tmp = file($dir.'php_'.$name.'.afm');
    +01324     $this->fonts[$font]=unserialize($tmp[0]);
    +01325     if (!isset($this->fonts[$font]['_version_']) || $this->fonts[$font]['_version_']<1){
    +01326       // if the font file is old, then clear it out and prepare for re-creation
    +01327       $this->addMessage('openFont: clear out, make way for new version.');
    +01328       unset($this->fonts[$font]);
    +01329     }
    +01330   }
    +01331   if (!isset($this->fonts[$font]) && file_exists($dir.$name.'.afm')){
    +01332     // then rebuild the php_<font>.afm file from the <font>.afm file
    +01333     $this->addMessage('openFont: build php file from '.$dir.$name.'.afm');
    +01334     $data = array();
    +01335     $file = file($dir.$name.'.afm');
    +01336     foreach ($file as $rowA){
    +01337       $row=trim($rowA);
    +01338       $pos=strpos($row,' ');
    +01339       if ($pos){
    +01340         // then there must be some keyword
    +01341         $key = substr($row,0,$pos);
    +01342         switch ($key){
    +01343           case 'FontName':
    +01344           case 'FullName':
    +01345           case 'FamilyName':
    +01346           case 'Weight':
    +01347           case 'ItalicAngle':
    +01348           case 'IsFixedPitch':
    +01349           case 'CharacterSet':
    +01350           case 'UnderlinePosition':
    +01351           case 'UnderlineThickness':
    +01352           case 'Version':
    +01353           case 'EncodingScheme':
    +01354           case 'CapHeight':
    +01355           case 'XHeight':
    +01356           case 'Ascender':
    +01357           case 'Descender':
    +01358           case 'StdHW':
    +01359           case 'StdVW':
    +01360           case 'StartCharMetrics':
    +01361             $data[$key]=trim(substr($row,$pos));
    +01362             break;
    +01363           case 'FontBBox':
    +01364             $data[$key]=explode(' ',trim(substr($row,$pos)));
    +01365             break;
    +01366           case 'C':
    +01367             //C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ;
    +01368             $bits=explode(';',trim($row));
    +01369             $dtmp=array();
    +01370             foreach($bits as $bit){
    +01371               $bits2 = explode(' ',trim($bit));
    +01372               if (strlen($bits2[0])){
    +01373                 if (count($bits2)>2){
    +01374                   $dtmp[$bits2[0]]=array();
    +01375                   for ($i=1;$i<count($bits2);$i++){
    +01376                     $dtmp[$bits2[0]][]=$bits2[$i];
    +01377                   }
    +01378                 } else if (count($bits2)==2){
    +01379                   $dtmp[$bits2[0]]=$bits2[1];
    +01380                 }
    +01381               }
    +01382             }
    +01383             if ($dtmp['C']>=0){
    +01384               $data['C'][$dtmp['C']]=$dtmp;
    +01385               $data['C'][$dtmp['N']]=$dtmp;
    +01386             } else {
    +01387               $data['C'][$dtmp['N']]=$dtmp;
    +01388             }
    +01389             break;
    +01390           case 'KPX':
    +01391             //KPX Adieresis yacute -40
    +01392             $bits=explode(' ',trim($row));
    +01393             $data['KPX'][$bits[1]][$bits[2]]=$bits[3];
    +01394             break;
    +01395         }
    +01396       }
    +01397     }
    +01398     $data['_version_']=1;
    +01399     $this->fonts[$font]=$data;
    +01400     $fp = fopen($dir.'php_'.$name.'.afm','w');
    +01401     fwrite($fp,serialize($data));
    +01402     fclose($fp);
    +01403   } else if (!isset($this->fonts[$font])){
    +01404     $this->addMessage('openFont: no font file found');
    +01405 //    echo 'Font not Found '.$font;
    +01406   }
    +01407 }
    +
    +

    +

    @@ -2630,7 +4496,25 @@ specify where the document should open when it first starts

    Definition at line 2949 of file class.pdf.php.

    -Referenced by o_catalog(). +Referenced by o_catalog().

    02949                                         {
    +02950   // this function will open the document at a specified page, in a specified style
    +02951   // the values for style, and the required paramters are:
    +02952   // 'XYZ'  left, top, zoom
    +02953   // 'Fit'
    +02954   // 'FitH' top
    +02955   // 'FitV' left
    +02956   // 'FitR' left,bottom,right
    +02957   // 'FitB'
    +02958   // 'FitBH' top
    +02959   // 'FitBV' left
    +02960   $this->numObj++;
    +02961   $this->o_destination($this->numObj,'new',array('page'=>$this->currentPage,'type'=>$style,'p1'=>$a,'p2'=>$b,'p3'=>$c));
    +02962   $id = $this->catalogId;
    +02963   $this->o_catalog($id,'openHere',$this->numObj);
    +02964 }
    +
    +

    +

    @@ -2661,7 +4545,20 @@ make a loose object, the output will go into this object, until it is closed, th

    Definition at line 2490 of file class.pdf.php.

    -Referenced by Cezpdf::ezTable(). +Referenced by Cezpdf::ezTable().

    02490                      {
    +02491   $this->nStack++;
    +02492   $this->stack[$this->nStack]=array('c'=>$this->currentContents,'p'=>$this->currentPage);
    +02493   // add a new object of the content type, to hold the data flow
    +02494   $this->numObj++;
    +02495   $this->o_contents($this->numObj,'new');
    +02496   $this->currentContents=$this->numObj;
    +02497   $this->looseObjects[$this->numObj]=1;
    +02498   
    +02499   return $this->numObj;
    +02500 }
    +
    +

    +

    @@ -2695,7 +4592,48 @@ Definition at line 1220<

    References $tmp.

    -Referenced by Cezpdf::ezOutput(). +Referenced by Cezpdf::ezOutput().

    01220                          {
    +01221 
    +01222   if ($debug){
    +01223     // turn compression off
    +01224     $this->options['compression']=0;
    +01225   }
    +01226 
    +01227   if ($this->arc4_objnum){
    +01228     $this->ARC4_init($this->encryptionKey);
    +01229   }
    +01230 
    +01231   $this->checkAllHere();
    +01232 
    +01233   $xref=array();
    +01234   $content="%PDF-1.3\n%âãÏÓ\n";
    +01235 //  $content="%PDF-1.3\n";
    +01236   $pos=strlen($content);
    +01237   foreach($this->objects as $k=>$v){
    +01238     $tmp='o_'.$v['t'];
    +01239     $cont=$this->$tmp($k,'out');
    +01240     $content.=$cont;
    +01241     $xref[]=$pos;
    +01242     $pos+=strlen($cont);
    +01243   }
    +01244   $content.="\nxref\n0 ".(count($xref)+1)."\n0000000000 65535 f \n";
    +01245   foreach($xref as $p){
    +01246     $content.=substr('0000000000',0,10-strlen($p)).$p." 00000 n \n";
    +01247   }
    +01248   $content.="\ntrailer\n  << /Size ".(count($xref)+1)."\n     /Root 1 0 R\n     /Info ".$this->infoObject." 0 R\n";
    +01249   // if encryption has been applied to this document then add the marker for this dictionary
    +01250   if ($this->arc4_objnum > 0){
    +01251     $content .= "/Encrypt ".$this->arc4_objnum." 0 R\n";
    +01252   }
    +01253   if (strlen($this->fileIdentifier)){
    +01254     $content .= "/ID[<".$this->fileIdentifier."><".$this->fileIdentifier.">]\n";
    +01255   }
    +01256   $content .= "  >>\nstartxref\n".$pos."\n%%EOF\n";
    +01257   return $content;
    +01258 }
    +
    +

    +

    @@ -2770,7 +4708,12 @@ Referenced by Cezpdf::

    draw a part of an ellipse

    -Definition at line 1692 of file class.pdf.php. +Definition at line 1692 of file class.pdf.php.

    01692                                                                          {
    +01693   $this->ellipse($x0,$y0,$r1,$r2,$angle,$nSeg,$astart,$afinish,0);
    +01694 }
    +
    +

    +

    @@ -2815,7 +4758,21 @@ Definition at line 1692<

    draw a polygon, the syntax for this is similar to the GD polygon command

    -Definition at line 1818 of file class.pdf.php. +Definition at line 1818 of file class.pdf.php.

    01818                              {
    +01819   $this->objects[$this->currentContents]['c'].="\n";
    +01820   $this->objects[$this->currentContents]['c'].=sprintf('%.3f',$p[0]).' '.sprintf('%.3f',$p[1]).' m ';
    +01821   for ($i=2;$i<$np*2;$i=$i+2){
    +01822     $this->objects[$this->currentContents]['c'].= sprintf('%.3f',$p[$i]).' '.sprintf('%.3f',$p[$i+1]).' l ';
    +01823   }
    +01824   if ($f==1){
    +01825     $this->objects[$this->currentContents]['c'].=' f';
    +01826   } else {
    +01827     $this->objects[$this->currentContents]['c'].=' S';
    +01828   }
    +01829 }
    +
    +

    +

    @@ -2861,7 +4818,18 @@ Definition at line 1818< extract an integer from a position in a byte stream

    private

    -Definition at line 2623 of file class.pdf.php. +Definition at line 2623 of file class.pdf.php.

    02623                                         {
    +02624   // return the integer represented by $num bytes from $pos within $data
    +02625   $ret=0;
    +02626   for ($i=0;$i<$num;$i++){
    +02627     $ret=$ret*256;
    +02628     $ret+=ord($data[$pos+$i]);
    +02629   }
    +02630   return $ret;
    +02631 }
    +
    +

    +

    @@ -2925,7 +4893,33 @@ Definition at line 2623< do a part of the calculation for sorting out the justification of the text

    private

    -Definition at line 2300 of file class.pdf.php. +Definition at line 2300 of file class.pdf.php.

    02300                                                                              {
    +02301   switch ($justification){
    +02302     case 'left':
    +02303       return;
    +02304       break;
    +02305     case 'right':
    +02306       $x+=$width-$actual;
    +02307       break;
    +02308     case 'center':
    +02309     case 'centre':
    +02310       $x+=($width-$actual)/2;
    +02311       break;
    +02312     case 'full':
    +02313       // count the number of words
    +02314       $words = explode(' ',$text);
    +02315       $nspaces=count($words)-1;
    +02316       if ($nspaces>0){
    +02317         $adjust = ($width-$actual)/$nspaces;
    +02318       } else {
    +02319         $adjust=0;
    +02320       }
    +02321       break;
    +02322   }
    +02323 }
    +
    +

    +

    @@ -2971,7 +4965,14 @@ Definition at line 2300< wrapper function for PRVTcheckTextDirective1

    private

    -Definition at line 1993 of file class.pdf.php. +Definition at line 1993 of file class.pdf.php.

    01993                                               {
    +01994   $x=0;
    +01995   $y=0;
    +01996   return $this->PRVTcheckTextDirective1($text,$i,$f,0,$x,$y);
    +01997 }
    +
    +

    +

    @@ -3053,7 +5054,153 @@ Definition at line 1993< checks if the text stream contains a control directive if so then makes some changes and returns the number of characters involved in the directive this has been re-worked to include everything neccesary to fins the current writing point, so that the location can be sent to the callback function if required if the directive does not require a font change, then $f should be set to 0

    private

    -Definition at line 2008 of file class.pdf.php. +Definition at line 2008 of file class.pdf.php.

    02008                                                                                                   {
    +02009   $directive = 0;
    +02010   $j=$i;
    +02011   if ($text[$j]=='<'){
    +02012     $j++;
    +02013     switch($text[$j]){
    +02014       case '/':
    +02015         $j++;
    +02016         if (strlen($text) <= $j){
    +02017           return $directive;
    +02018         }
    +02019         switch($text[$j]){
    +02020           case 'b':
    +02021           case 'i':
    +02022             $j++;
    +02023             if ($text[$j]=='>'){
    +02024               $p = strrpos($this->currentTextState,$text[$j-1]);
    +02025               if ($p !== false){
    +02026                 // then there is one to remove
    +02027                 $this->currentTextState = substr($this->currentTextState,0,$p).substr($this->currentTextState,$p+1);
    +02028               }
    +02029               $directive=$j-$i+1;
    +02030             }
    +02031             break;
    +02032           case 'c':
    +02033             // this this might be a callback function
    +02034             $j++;
    +02035             $k = strpos($text,'>',$j);
    +02036             if ($k!==false && $text[$j]==':'){
    +02037               // then this will be treated as a callback directive
    +02038               $directive = $k-$i+1;
    +02039               $f=0;
    +02040               // split the remainder on colons to get the function name and the paramater
    +02041               $tmp = substr($text,$j+1,$k-$j-1);
    +02042               $b1 = strpos($tmp,':');
    +02043               if ($b1!==false){
    +02044                 $func = substr($tmp,0,$b1);
    +02045                 $parm = substr($tmp,$b1+1);
    +02046               } else {
    +02047                 $func=$tmp;
    +02048                 $parm='';
    +02049               }
    +02050               if (!isset($func) || !strlen(trim($func))){
    +02051                 $directive=0;
    +02052               } else {
    +02053                 // only call the function if this is the final call
    +02054                 if ($final){
    +02055                   // need to assess the text position, calculate the text width to this point
    +02056                   // can use getTextWidth to find the text width I think
    +02057                   $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,substr($text,0,$i));
    +02058                   $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'end','p'=>$parm,'nCallback'=>$this->nCallback);
    +02059                   $x=$tmp[0];
    +02060                   $y=$tmp[1];
    +02061                   $ret = $this->$func($info);
    +02062                   if (is_array($ret)){
    +02063                     // then the return from the callback function could set the position, to start with, later will do font colour, and font
    +02064                     foreach($ret as $rk=>$rv){
    +02065                       switch($rk){
    +02066                         case 'x':
    +02067                         case 'y':
    +02068                           $$rk=$rv;
    +02069                           break;
    +02070                       }
    +02071                     }
    +02072                   }
    +02073                   // also remove from to the stack
    +02074                   // for simplicity, just take from the end, fix this another day
    +02075                   $this->nCallback--;
    +02076                   if ($this->nCallback<0){
    +02077                     $this->nCallBack=0;
    +02078                   }
    +02079                 }
    +02080               }
    +02081             }
    +02082             break;
    +02083         }
    +02084         break;
    +02085       case 'b':
    +02086       case 'i':
    +02087         $j++;
    +02088         if ($text[$j]=='>'){
    +02089           $this->currentTextState.=$text[$j-1];
    +02090           $directive=$j-$i+1;
    +02091         }
    +02092         break;
    +02093       case 'C':
    +02094         $noClose=1;
    +02095       case 'c':
    +02096         // this this might be a callback function
    +02097         $j++;
    +02098         $k = strpos($text,'>',$j);
    +02099         if ($k!==false && $text[$j]==':'){
    +02100           // then this will be treated as a callback directive
    +02101           $directive = $k-$i+1;
    +02102           $f=0;
    +02103           // split the remainder on colons to get the function name and the paramater
    +02104 //          $bits = explode(':',substr($text,$j+1,$k-$j-1));
    +02105           $tmp = substr($text,$j+1,$k-$j-1);
    +02106           $b1 = strpos($tmp,':');
    +02107           if ($b1!==false){
    +02108             $func = substr($tmp,0,$b1);
    +02109             $parm = substr($tmp,$b1+1);
    +02110           } else {
    +02111             $func=$tmp;
    +02112             $parm='';
    +02113           }
    +02114           if (!isset($func) || !strlen(trim($func))){
    +02115             $directive=0;
    +02116           } else {
    +02117             // only call the function if this is the final call, ie, the one actually doing printing, not measurement
    +02118             if ($final){
    +02119               // need to assess the text position, calculate the text width to this point
    +02120               // can use getTextWidth to find the text width I think
    +02121               // also add the text height and decender
    +02122               $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,substr($text,0,$i));
    +02123               $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'start','p'=>$parm,'f'=>$func,'height'=>$this->getFontHeight($size),'decender'=>$this->getFontDecender($size));
    +02124               $x=$tmp[0];
    +02125               $y=$tmp[1];
    +02126               if (!isset($noClose) || !$noClose){
    +02127                 // only add to the stack if this is a small 'c', therefore is a start-stop pair
    +02128                 $this->nCallback++;
    +02129                 $info['nCallback']=$this->nCallback;
    +02130                 $this->callback[$this->nCallback]=$info;
    +02131               }
    +02132               $ret = $this->$func($info);
    +02133               if (is_array($ret)){
    +02134                 // then the return from the callback function could set the position, to start with, later will do font colour, and font
    +02135                 foreach($ret as $rk=>$rv){
    +02136                   switch($rk){
    +02137                     case 'x':
    +02138                     case 'y':
    +02139                       $$rk=$rv;
    +02140                       break;
    +02141                   }
    +02142                 }
    +02143               }
    +02144             }
    +02145           }
    +02146         }
    +02147         break;
    +02148     }
    +02149   } 
    +02150   return $directive;
    +02151 }
    +
    +

    +

    @@ -3117,7 +5264,19 @@ Definition at line 2008< given a start position and information about how text is to be laid out, calculate where on the page the text will end

    private

    -Definition at line 1977 of file class.pdf.php. +Definition at line 1977 of file class.pdf.php.

    01977                                                           {
    +01978   // given this information return an array containing x and y for the end position as elements 0 and 1
    +01979   $w = $this->getTextWidth($size,$text);
    +01980   // need to adjust for the number of spaces in this text
    +01981   $words = explode(' ',$text);
    +01982   $nspaces=count($words)-1;
    +01983   $w += $wa*$nspaces;
    +01984   $a = deg2rad((float)$angle);
    +01985   return array(cos($a)*$w+$x,-sin($a)*$w+$y);
    +01986 }
    +
    +

    +

    @@ -3170,7 +5329,12 @@ draw a rectangle, note that it is the width and height of the rectangle which ar

    Definition at line 1843 of file class.pdf.php.

    -References width. +References width.

    01843                                           {
    +01844   $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' '.sprintf('%.3f',$width).' '.sprintf('%.3f',$height).' re S';
    +01845 }
    +
    +

    +

    @@ -3202,7 +5366,18 @@ open an existing object for editing

    Definition at line 2505 of file class.pdf.php.

    -Referenced by Cezpdf::ezPRVTaddPageNumbers(), and Cezpdf::ezTable(). +Referenced by Cezpdf::ezPRVTaddPageNumbers(), and Cezpdf::ezTable().

    02505                           {
    +02506    $this->nStack++;
    +02507    $this->stack[$this->nStack]=array('c'=>$this->currentContents,'p'=>$this->currentPage);
    +02508    $this->currentContents=$id;
    +02509    // also if this object is the primary contents for a page, then set the current page to its parent
    +02510    if (isset($this->objects[$id]['onPage'])){
    +02511      $this->currentPage = $this->objects[$id]['onPage'];
    +02512    }
    +02513 }
    +
    +

    +

    @@ -3234,7 +5409,21 @@ restore a previously saved state

    Definition at line 2471 of file class.pdf.php.

    -Referenced by Creport::dots(), and Cezpdf::ezTable(). +Referenced by Creport::dots(), and Cezpdf::ezTable().

    02471                                  {
    +02472   if (!$pageEnd){
    +02473     $n = $this->nStateStack;
    +02474     $this->currentColour = $this->stateStack[$n]['col'];
    +02475     $this->currentStrokeColour = $this->stateStack[$n]['str'];
    +02476     $this->objects[$this->currentContents]['c'].="\n".$this->stateStack[$n]['lin'];
    +02477     $this->currentLineStyle = $this->stateStack[$n]['lin'];
    +02478     unset($this->stateStack[$n]);
    +02479     $this->nStateStack--;
    +02480   }
    +02481   $this->objects[$this->currentContents]['c'].="\nQ";
    +02482 }
    +
    +

    +

    @@ -3266,7 +5455,29 @@ this will be called at a new page to return the state to what it was on the end

    Definition at line 2447 of file class.pdf.php.

    -Referenced by Creport::dots(), and Cezpdf::ezTable(). +Referenced by Creport::dots(), and Cezpdf::ezTable().

    02447                               {
    +02448   if ($pageEnd){
    +02449     // this will be called at a new page to return the state to what it was on the 
    +02450     // end of the previous page, before the stack was closed down
    +02451     // This is to get around not being able to have open 'q' across pages
    +02452     $opt = $this->stateStack[$pageEnd]; // ok to use this as stack starts numbering at 1
    +02453     $this->setColor($opt['col']['r'],$opt['col']['g'],$opt['col']['b'],1);
    +02454     $this->setStrokeColor($opt['str']['r'],$opt['str']['g'],$opt['str']['b'],1);
    +02455     $this->objects[$this->currentContents]['c'].="\n".$opt['lin'];
    +02456 //    $this->currentLineStyle = $opt['lin'];
    +02457   } else {
    +02458     $this->nStateStack++;
    +02459     $this->stateStack[$this->nStateStack]=array(
    +02460       'col'=>$this->currentColour
    +02461      ,'str'=>$this->currentStrokeColour
    +02462      ,'lin'=>$this->currentLineStyle
    +02463     );
    +02464   }
    +02465   $this->objects[$this->currentContents]['c'].="\nq";
    +02466 }
    +
    +

    +

    @@ -3313,7 +5524,190 @@ if the font is not loaded then load it and make the required object else just ma

    Definition at line 1417 of file class.pdf.php.

    -References $d, $data, $i, $list, $num, $tmp, extra, name, and width. +References $d, $data, $i, $list, $num, $tmp, extra, name, and width.

    01417                                                   {
    +01418   if (!isset($this->fonts[$fontName])){
    +01419     // load the file
    +01420     $this->openFont($fontName);
    +01421     if (isset($this->fonts[$fontName])){
    +01422       $this->numObj++;
    +01423       $this->numFonts++;
    +01424       $pos=strrpos($fontName,'/');
    +01425 //      $dir=substr($fontName,0,$pos+1);
    +01426       $name=substr($fontName,$pos+1);
    +01427       if (substr($name,-4)=='.afm'){
    +01428         $name=substr($name,0,strlen($name)-4);
    +01429       }
    +01430       $options=array('name'=>$name);
    +01431       if (is_array($encoding)){
    +01432         // then encoding and differences might be set
    +01433         if (isset($encoding['encoding'])){
    +01434           $options['encoding']=$encoding['encoding'];
    +01435         }
    +01436         if (isset($encoding['differences'])){
    +01437           $options['differences']=$encoding['differences'];
    +01438         }
    +01439       } else if (strlen($encoding)){
    +01440         // then perhaps only the encoding has been set
    +01441         $options['encoding']=$encoding;
    +01442       }
    +01443       $fontObj = $this->numObj;
    +01444       $this->o_font($this->numObj,'new',$options);
    +01445       $this->fonts[$fontName]['fontNum']=$this->numFonts;
    +01446       // if this is a '.afm' font, and there is a '.pfa' file to go with it ( as there
    +01447       // should be for all non-basic fonts), then load it into an object and put the
    +01448       // references into the font object
    +01449       $basefile = substr($fontName,0,strlen($fontName)-4);
    +01450       if (file_exists($basefile.'.pfb')){
    +01451         $fbtype = 'pfb';
    +01452       } else if (file_exists($basefile.'.ttf')){
    +01453         $fbtype = 'ttf';
    +01454       } else {
    +01455         $fbtype='';
    +01456       }
    +01457       $fbfile = $basefile.'.'.$fbtype;
    +01458       
    +01459 //      $pfbfile = substr($fontName,0,strlen($fontName)-4).'.pfb';
    +01460 //      $ttffile = substr($fontName,0,strlen($fontName)-4).'.ttf';
    +01461       $this->addMessage('selectFont: checking for - '.$fbfile);
    +01462       if (substr($fontName,-4)=='.afm' && strlen($fbtype) ){
    +01463         $adobeFontName = $this->fonts[$fontName]['FontName'];
    +01464 //        $fontObj = $this->numObj;
    +01465         $this->addMessage('selectFont: adding font file - '.$fbfile.' - '.$adobeFontName);
    +01466         // find the array of fond widths, and put that into an object.
    +01467         $firstChar = -1;
    +01468         $lastChar = 0;
    +01469         $widths = array();
    +01470         foreach ($this->fonts[$fontName]['C'] as $num=>$d){
    +01471           if (intval($num)>0 || $num=='0'){
    +01472             if ($lastChar>0 && $num>$lastChar+1){
    +01473               for($i=$lastChar+1;$i<$num;$i++){
    +01474                 $widths[] = 0;
    +01475               }
    +01476             }
    +01477             $widths[] = $d['WX'];
    +01478             if ($firstChar==-1){
    +01479               $firstChar = $num;
    +01480             }
    +01481             $lastChar = $num;
    +01482           }
    +01483         }
    +01484         // also need to adjust the widths for the differences array
    +01485         if (isset($options['differences'])){
    +01486           foreach($options['differences'] as $charNum=>$charName){
    +01487             if ($charNum>$lastChar){
    +01488               for($i=$lastChar+1;$i<=$charNum;$i++){
    +01489                 $widths[]=0;
    +01490               }
    +01491               $lastChar=$charNum;
    +01492             }
    +01493             if (isset($this->fonts[$fontName]['C'][$charName])){
    +01494               $widths[$charNum-$firstChar]=$this->fonts[$fontName]['C'][$charName]['WX'];
    +01495             }
    +01496           }
    +01497         }
    +01498         $this->addMessage('selectFont: FirstChar='.$firstChar);
    +01499         $this->addMessage('selectFont: LastChar='.$lastChar);
    +01500         $this->numObj++;
    +01501         $this->o_contents($this->numObj,'new','raw');
    +01502         $this->objects[$this->numObj]['c'].='[';
    +01503         foreach($widths as $width){
    +01504           $this->objects[$this->numObj]['c'].=' '.$width;
    +01505         }
    +01506         $this->objects[$this->numObj]['c'].=' ]';
    +01507         $widthid = $this->numObj;
    +01508 
    +01509         // load the pfb file, and put that into an object too.
    +01510         // note that pdf supports only binary format type 1 font files, though there is a 
    +01511         // simple utility to convert them from pfa to pfb.
    +01512         $fp = fopen($fbfile,'rb');
    +01513         $tmp = get_magic_quotes_runtime();
    +01514         set_magic_quotes_runtime(0);
    +01515         $data = fread($fp,filesize($fbfile));
    +01516         set_magic_quotes_runtime($tmp);
    +01517         fclose($fp);
    +01518 
    +01519         // create the font descriptor
    +01520         $this->numObj++;
    +01521         $fontDescriptorId = $this->numObj;
    +01522         $this->numObj++;
    +01523         $pfbid = $this->numObj;
    +01524         // determine flags (more than a little flakey, hopefully will not matter much)
    +01525         $flags=0;
    +01526         if ($this->fonts[$fontName]['ItalicAngle']!=0){ $flags+=pow(2,6); }
    +01527         if ($this->fonts[$fontName]['IsFixedPitch']=='true'){ $flags+=1; }
    +01528         $flags+=pow(2,5); // assume non-sybolic
    +01529 
    +01530         $list = array('Ascent'=>'Ascender','CapHeight'=>'CapHeight','Descent'=>'Descender','FontBBox'=>'FontBBox','ItalicAngle'=>'ItalicAngle');
    +01531         $fdopt = array(
    +01532          'Flags'=>$flags
    +01533          ,'FontName'=>$adobeFontName
    +01534          ,'StemV'=>100  // don't know what the value for this should be!
    +01535         );
    +01536         foreach($list as $k=>$v){
    +01537           if (isset($this->fonts[$fontName][$v])){
    +01538             $fdopt[$k]=$this->fonts[$fontName][$v];
    +01539           }
    +01540         }
    +01541 
    +01542         if ($fbtype=='pfb'){
    +01543           $fdopt['FontFile']=$pfbid;
    +01544         } else if ($fbtype=='ttf'){
    +01545           $fdopt['FontFile2']=$pfbid;
    +01546         }
    +01547         $this->o_fontDescriptor($fontDescriptorId,'new',$fdopt);        
    +01548 
    +01549         // embed the font program
    +01550         $this->o_contents($this->numObj,'new');
    +01551         $this->objects[$pfbid]['c'].=$data;
    +01552         // determine the cruicial lengths within this file
    +01553         if ($fbtype=='pfb'){
    +01554           $l1 = strpos($data,'eexec')+6;
    +01555           $l2 = strpos($data,'00000000')-$l1;
    +01556           $l3 = strlen($data)-$l2-$l1;
    +01557           $this->o_contents($this->numObj,'add',array('Length1'=>$l1,'Length2'=>$l2,'Length3'=>$l3));
    +01558         } else if ($fbtype=='ttf'){
    +01559           $l1 = strlen($data);
    +01560           $this->o_contents($this->numObj,'add',array('Length1'=>$l1));
    +01561         }
    +01562 
    +01563 
    +01564         // tell the font object about all this new stuff
    +01565         $tmp = array('BaseFont'=>$adobeFontName,'Widths'=>$widthid
    +01566                                       ,'FirstChar'=>$firstChar,'LastChar'=>$lastChar
    +01567                                       ,'FontDescriptor'=>$fontDescriptorId);
    +01568         if ($fbtype=='ttf'){
    +01569           $tmp['SubType']='TrueType';
    +01570         }
    +01571         $this->addMessage('adding extra info to font.('.$fontObj.')');
    +01572         foreach($tmp as $fk=>$fv){
    +01573           $this->addMessage($fk." : ".$fv);
    +01574         }
    +01575         $this->o_font($fontObj,'add',$tmp);
    +01576 
    +01577       } else {
    +01578         $this->addMessage('selectFont: pfb or ttf file not found, ok if this is one of the 14 standard fonts');
    +01579       }
    +01580 
    +01581 
    +01582       // also set the differences here, note that this means that these will take effect only the 
    +01583       //first time that a font is selected, else they are ignored
    +01584       if (isset($options['differences'])){
    +01585         $this->fonts[$fontName]['differences']=$options['differences'];
    +01586       }
    +01587     }
    +01588   }
    +01589   if ($set && isset($this->fonts[$fontName])){
    +01590     // so if for some reason the font was not set in the last one then it will not be selected
    +01591     $this->currentBaseFont=$fontName;
    +01592     // the next line means that if a new font is selected, then the current text state will be
    +01593     // applied to it as well.
    +01594     $this->setCurrentFont();
    +01595   }
    +01596   return $this->currentFontNum;
    +01597 }
    +
    +

    +

    @@ -3366,7 +5760,15 @@ sets the colour for fill operations

    Definition at line 1655 of file class.pdf.php.

    -Referenced by Cezpdf::ezTable(). +Referenced by Cezpdf::ezTable().

    01655                                     {
    +01656   if ($r>=0 && ($force || $r!=$this->currentColour['r'] || $g!=$this->currentColour['g'] || $b!=$this->currentColour['b'])){
    +01657     $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$r).' '.sprintf('%.3f',$g).' '.sprintf('%.3f',$b).' rg';
    +01658     $this->currentColour=array('r'=>$r,'g'=>$g,'b'=>$b);
    +01659   }
    +01660 }
    +
    +

    +

    @@ -3397,7 +5799,32 @@ sets up the current font, based on the font families, and the current text state private

    -Definition at line 1611 of file class.pdf.php. +Definition at line 1611 of file class.pdf.php.

    01611                          {
    +01612   if (strlen($this->currentBaseFont)==0){
    +01613     // then assume an initial font
    +01614     $this->selectFont('./fonts/Helvetica.afm');
    +01615   }
    +01616   $cf = substr($this->currentBaseFont,strrpos($this->currentBaseFont,'/')+1);
    +01617   if (strlen($this->currentTextState)
    +01618     && isset($this->fontFamilies[$cf]) 
    +01619       && isset($this->fontFamilies[$cf][$this->currentTextState])){
    +01620     // then we are in some state or another
    +01621     // and this font has a family, and the current setting exists within it
    +01622     // select the font, then return it
    +01623     $nf = substr($this->currentBaseFont,0,strrpos($this->currentBaseFont,'/')+1).$this->fontFamilies[$cf][$this->currentTextState];
    +01624     $this->selectFont($nf,'',0);
    +01625     $this->currentFont = $nf;
    +01626     $this->currentFontNum = $this->fonts[$nf]['fontNum'];
    +01627   } else {
    +01628     // the this font must not have the right family member for the current state
    +01629     // simply assume the base font
    +01630     $this->currentFont = $this->currentBaseFont;
    +01631     $this->currentFontNum = $this->fonts[$this->currentFont]['fontNum'];    
    +01632   }
    +01633 }
    +
    +

    +

    @@ -3444,7 +5871,35 @@ set the encryption of the document can be used to turn it on and/or set the pass

    Definition at line 1184 of file class.pdf.php.

    -References $p, and print. +References $p, and print.

    01184                                                               {
    +01185   $p=bindec(11000000);
    +01186 
    +01187   $options = array(
    +01188      'print'=>4
    +01189     ,'modify'=>8
    +01190     ,'copy'=>16
    +01191     ,'add'=>32
    +01192   );
    +01193   foreach($pc as $k=>$v){
    +01194     if ($v && isset($options[$k])){
    +01195       $p+=$options[$k];
    +01196     } else if (isset($options[$v])){
    +01197       $p+=$options[$v];
    +01198     }
    +01199   }
    +01200   // implement encryption on the document
    +01201   if ($this->arc4_objnum == 0){
    +01202     // then the block does not exist already, add it.
    +01203     $this->numObj++;
    +01204     if (strlen($ownerPass)==0){
    +01205       $ownerPass=$userPass;
    +01206     }
    +01207     $this->o_encryption($this->numObj,'new',array('user'=>$userPass,'owner'=>$ownerPass,'p'=>$p));
    +01208   }
    +01209 }
    +
    +

    +

    @@ -3485,7 +5940,42 @@ define font families, this is used to initialize the font families for the defau

    Definition at line 2985 of file class.pdf.php.

    -Referenced by Cpdf(). +Referenced by Cpdf().

    02985                                            {
    +02986   if (!is_array($options)){
    +02987     if ($family=='init'){
    +02988       // set the known family groups
    +02989       // these font families will be used to enable bold and italic markers to be included
    +02990       // within text streams. html forms will be used... <b></b> <i></i>
    +02991       $this->fontFamilies['Helvetica.afm']=array(
    +02992          'b'=>'Helvetica-Bold.afm'
    +02993         ,'i'=>'Helvetica-Oblique.afm'
    +02994         ,'bi'=>'Helvetica-BoldOblique.afm'
    +02995         ,'ib'=>'Helvetica-BoldOblique.afm'
    +02996       );
    +02997       $this->fontFamilies['Courier.afm']=array(
    +02998          'b'=>'Courier-Bold.afm'
    +02999         ,'i'=>'Courier-Oblique.afm'
    +03000         ,'bi'=>'Courier-BoldOblique.afm'
    +03001         ,'ib'=>'Courier-BoldOblique.afm'
    +03002       );
    +03003       $this->fontFamilies['Times-Roman.afm']=array(
    +03004          'b'=>'Times-Bold.afm'
    +03005         ,'i'=>'Times-Italic.afm'
    +03006         ,'bi'=>'Times-BoldItalic.afm'
    +03007         ,'ib'=>'Times-BoldItalic.afm'
    +03008       );
    +03009     }
    +03010   } else {
    +03011     // the user is trying to set a font family
    +03012     // note that this can also be used to set the base ones to something else
    +03013     if (strlen($family)){
    +03014       $this->fontFamilies[$family] = $options;
    +03015     }
    +03016   }
    +03017 }
    +
    +

    +

    @@ -3546,7 +6036,34 @@ Definition at line 1789<

    References width.

    -Referenced by Creport::dots(), Cezpdf::ezPrvtTableDrawLines(), and Cezpdf::ezTable(). +Referenced by Creport::dots(), Cezpdf::ezPrvtTableDrawLines(), and Cezpdf::ezTable().

    01789                                                                   {
    +01790 
    +01791   // this is quite inefficient in that it sets all the parameters whenever 1 is changed, but will fix another day
    +01792   $string = '';
    +01793   if ($width>0){
    +01794     $string.= $width.' w';
    +01795   }
    +01796   $ca = array('butt'=>0,'round'=>1,'square'=>2);
    +01797   if (isset($ca[$cap])){
    +01798     $string.= ' '.$ca[$cap].' J';
    +01799   }
    +01800   $ja = array('miter'=>0,'round'=>1,'bevel'=>2);
    +01801   if (isset($ja[$join])){
    +01802     $string.= ' '.$ja[$join].' j';
    +01803   }
    +01804   if (is_array($dash)){
    +01805     $string.= ' [';
    +01806     foreach ($dash as $len){
    +01807       $string.=' '.$len;
    +01808     }
    +01809     $string.= ' ] '.$phase.' d';
    +01810   }
    +01811   $this->currentLineStyle = $string;
    +01812   $this->objects[$this->currentContents]['c'].="\n".$string;
    +01813 }
    +
    +

    +

    @@ -3585,7 +6102,19 @@ Referenced by Creport::dots(

    set the viewer preferences of the document, it is up to the browser to obey these.

    -Definition at line 2607 of file class.pdf.php. +Definition at line 2607 of file class.pdf.php.

    02607                                         {
    +02608   // this will only work if the label is one of the valid ones.
    +02609   if (is_array($label)){
    +02610     foreach ($label as $l=>$v){
    +02611       $this->o_catalog($this->catalogId,'viewerPreferences',array($l=>$v));
    +02612     }
    +02613   } else {
    +02614     $this->o_catalog($this->catalogId,'viewerPreferences',array($label=>$value));
    +02615   }
    +02616 }
    +
    +

    +

    @@ -3638,7 +6167,15 @@ sets the colour for stroke operations

    Definition at line 1665 of file class.pdf.php.

    -Referenced by Cezpdf::ezPrvtTableDrawLines(), and Cezpdf::ezTable(). +Referenced by Cezpdf::ezPrvtTableDrawLines(), and Cezpdf::ezTable().

    01665                                           {
    +01666   if ($r>=0 && ($force || $r!=$this->currentStrokeColour['r'] || $g!=$this->currentStrokeColour['g'] || $b!=$this->currentStrokeColour['b'])){
    +01667     $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$r).' '.sprintf('%.3f',$g).' '.sprintf('%.3f',$b).' RG';
    +01668     $this->currentStrokeColour=array('r'=>$r,'g'=>$g,'b'=>$b);
    +01669   }
    +01670 }
    +
    +

    +

    @@ -3668,7 +6205,16 @@ Referenced by Cezpdf::

    stop an object from appearing on pages from this point on

    -Definition at line 2533 of file class.pdf.php. +Definition at line 2533 of file class.pdf.php.

    02533                         {
    +02534   // if an object has been appearing on pages up to now, then stop it, this page will
    +02535   // be the last one that could contian it.
    +02536   if (isset($this->addLooseObjects[$id])){
    +02537     $this->addLooseObjects[$id]='';
    +02538   }
    +02539 }
    +
    +

    +

    @@ -3702,7 +6248,35 @@ Definition at line 1899<

    References $tmp.

    -Referenced by Cezpdf::ezStream(). +Referenced by Cezpdf::ezStream().

    01899                             {
    +01900   // setting the options allows the adjustment of the headers
    +01901   // values at the moment are:
    +01902   // 'Content-Disposition'=>'filename'  - sets the filename, though not too sure how well this will 
    +01903   //        work as in my trial the browser seems to use the filename of the php file with .pdf on the end
    +01904   // 'Accept-Ranges'=>1 or 0 - if this is not set to 1, then this header is not included, off by default
    +01905   //    this header seems to have caused some problems despite tha fact that it is supposed to solve
    +01906   //    them, so I am leaving it off by default.
    +01907   // 'compress'=> 1 or 0 - apply content stream compression, this is on (1) by default
    +01908   if (!is_array($options)){
    +01909     $options=array();
    +01910   }
    +01911   if ( isset($options['compress']) && $options['compress']==0){
    +01912     $tmp = $this->output(1);
    +01913   } else {
    +01914     $tmp = $this->output();
    +01915   }
    +01916   header("Content-type: application/pdf");
    +01917   header("Content-Length: ".strlen(ltrim($tmp)));
    +01918   $fileName = (isset($options['Content-Disposition'])?$options['Content-Disposition']:'file.pdf');
    +01919   header("Content-Disposition: inline; filename=".$fileName);
    +01920   if (isset($options['Accept-Ranges']) && $options['Accept-Ranges']==1){
    +01921     header("Accept-Ranges: ".strlen(ltrim($tmp))); 
    +01922   }
    +01923   echo ltrim($tmp);
    +01924 }
    +
    +

    +

    @@ -3734,7 +6308,52 @@ a few functions which should allow the document to be treated transactionally.

    Definition at line 3029 of file class.pdf.php.

    -Referenced by Cezpdf::ezPrvtTableColumnHeadings(), and Cezpdf::ezTable(). +Referenced by Cezpdf::ezPrvtTableColumnHeadings(), and Cezpdf::ezTable().

    03029                              {
    +03030   switch ($action){
    +03031     case 'start':
    +03032       // store all the data away into the checkpoint variable
    +03033       $data = get_object_vars($this);
    +03034       $this->checkpoint = $data;
    +03035       unset($data);
    +03036       break;
    +03037     case 'commit':
    +03038       if (is_array($this->checkpoint) && isset($this->checkpoint['checkpoint'])){
    +03039         $tmp = $this->checkpoint['checkpoint'];
    +03040         $this->checkpoint = $tmp;
    +03041         unset($tmp);
    +03042       } else {
    +03043         $this->checkpoint='';
    +03044       }
    +03045       break;
    +03046     case 'rewind':
    +03047       // do not destroy the current checkpoint, but move us back to the state then, so that we can try again
    +03048       if (is_array($this->checkpoint)){
    +03049         // can only abort if were inside a checkpoint
    +03050         $tmp = $this->checkpoint;
    +03051         foreach ($tmp as $k=>$v){
    +03052           if ($k != 'checkpoint'){
    +03053             $this->$k=$v;
    +03054           }
    +03055         }
    +03056         unset($tmp);
    +03057       }
    +03058       break;
    +03059     case 'abort':
    +03060       if (is_array($this->checkpoint)){
    +03061         // can only abort if were inside a checkpoint
    +03062         $tmp = $this->checkpoint;
    +03063         foreach ($tmp as $k=>$v){
    +03064           $this->$k=$v;
    +03065         }
    +03066         unset($tmp);
    +03067       }
    +03068       break;
    +03069   }
    +03070 
    +03071 }
    +
    +

    +


    Field Documentation

    @@ -4716,8 +7335,8 @@ Definition at line 134
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:09 2006 for phpcompta by  +
  • class.pdf.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classCreport.html b/doc/developper/html/classCreport.html index 457a6e3aa..811473225 100644 --- a/doc/developper/html/classCreport.html +++ b/doc/developper/html/classCreport.html @@ -68,7 +68,12 @@ Definition at line 24 of

    Definition at line 28 of file readme.php.

    -References Cezpdf::Cezpdf(). +References Cezpdf::Cezpdf().

    00028                        {
    +00029   $this->Cezpdf($p,$o);
    +00030 }
    +
    +

    +


    Member Function Documentation

    @@ -101,7 +106,35 @@ References Cezpdf::Cez

    Definition at line 43 of file readme.php.

    -References $size, $tmp, $xpos, Cpdf::addText(), Cpdf::line(), Cpdf::restoreState(), Cpdf::saveState(), Cpdf::setLineStyle(), and size. +References $size, $tmp, $xpos, Cpdf::addText(), Cpdf::line(), Cpdf::restoreState(), Cpdf::saveState(), Cpdf::setLineStyle(), and size.

    00043                     {
    +00044   // draw a dotted line over to the right and put on a page number
    +00045   $tmp = $info['p'];
    +00046   $lvl = $tmp[0];
    +00047   $lbl = substr($tmp,1);
    +00048   $xpos = 520;
    +00049 
    +00050   switch($lvl){
    +00051     case '1':
    +00052       $size=16;
    +00053       $thick=1;
    +00054       break;
    +00055     case '2':
    +00056       $size=12;
    +00057       $thick=0.5;
    +00058       break;
    +00059   }
    +00060 
    +00061   $this->saveState();
    +00062   $this->setLineStyle($thick,'round','',array(0,10));
    +00063   $this->line($xpos,$info['y'],$info['x']+5,$info['y']);
    +00064   $this->restoreState();
    +00065   $this->addText($xpos+5,$info['y'],$size,$lbl);
    +00066 
    +00067 
    +00068 }
    +
    +

    +

    @@ -133,7 +166,19 @@ References $size, Definition at line 32 of file readme.php.

    -References $num, $tmp, Cpdf::addDestination(), and Cezpdf::ezWhatPageNumber(). +References $num, $tmp, Cpdf::addDestination(), and Cezpdf::ezWhatPageNumber().

    00032                   {
    +00033   // this callback records all of the table of contents entries, it also places a destination marker there
    +00034   // so that it can be linked too
    +00035   $tmp = $info['p'];
    +00036   $lvl = $tmp[0];
    +00037   $lbl = rawurldecode(substr($tmp,1));
    +00038   $num=$this->ezWhatPageNumber($this->ezGetCurrentPageNumber());
    +00039   $this->reportContents[] = array($lbl,$num,$lvl );
    +00040   $this->addDestination('toc'.(count($this->reportContents)-1),'FitH',$info['y']+$info['height']);
    +00041 }
    +
    +

    +


    Field Documentation

    @@ -163,8 +208,8 @@ Definition at line 26 of
    The documentation for this class was generated from the following file:
      -
    • /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/readme.php
    -
    Generated on Thu Jun 29 00:04:09 2006 for phpcompta by  +
  • readme.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classCustomer.html b/doc/developper/html/classCustomer.html index 5af32d445..9a4123387 100644 --- a/doc/developper/html/classCustomer.html +++ b/doc/developper/html/classCustomer.html @@ -87,7 +87,14 @@ Constructor /* only a db connection is needed.

    Definition at line 49 of file class_customer.php.

    -References fiche::fiche(). +References fiche::fiche().

    00049                                    {
    +00050       $this->fiche_def_ref=FICHE_TYPE_CLIENT;
    +00051       fiche::fiche($p_cn,$p_id) ;
    +00052 
    +00053   }
    +
    +

    +


    Member Function Documentation

    @@ -122,9 +129,26 @@ Get all info contains in the view thanks to the poste elt (account).

    Definition at line 57 of file class_customer.php.

    -References $Res, $row, $sql, ExecSql(), f_id, and name. +References $Res, $row, $sql, ExecSql(), f_id, and name.

    -Referenced by VatListing(). +Referenced by VatListing().

    00057                                     {
    +00058     $this->poste=($p_poste==0)?$this->poste:$p_poste;
    +00059     $sql="select * from vw_client where poste_comptable=".$this->poste;
    +00060     $Res=ExecSql($this->cn,$sql);
    +00061     if ( pg_NumRows($Res) == 0) return null;
    +00062     // There is only _one_ row by customer
    +00063     $row=pg_fetch_array($Res,0);
    +00064     $this->name=$row['name'];
    +00065     $this->id=$row['f_id'];    
    +00066     $this->street=$row['rue'];    
    +00067     $this->cp=$row['code_postal'];
    +00068     $this->country=$row['pays'];
    +00069     $this->vat_number=$row['tva_num'];
    +00070 
    +00071   }
    +
    +

    +

    @@ -160,7 +184,80 @@ parm :

      Definition at line 195 of file class_customer.php.

      -References $a, $bar, $e, $offset, $page, $r, $search, $url, fiche::CountByDef(), FormatString(), fiche::GetAll(), jrn_navigation_bar(), poste, and table. +References $a, $bar, $e, $offset, $page, $r, $search, $url, fiche::CountByDef(), FormatString(), fiche::GetAll(), jrn_navigation_bar(), poste, and table.

      00196     {
      +00197       $p_search=FormatString($p_search);
      +00198       $url=urlencode($_SERVER['REQUEST_URI']);
      +00199       $script=$_SERVER['SCRIPT_NAME'];
      +00200       // Creation of the nav bar
      +00201       // Get the max numberRow
      +00202       $all_client=$this->CountByDef($this->fiche_def_ref,$p_search); 
      +00203       // Get offset and page variable
      +00204       $offset=( isset ($_REQUEST['offset'] )) ?$_REQUEST['offset']:0;
      +00205       $page=(isset($_REQUEST['page']))?$_REQUEST['page']:1;
      +00206       $bar=jrn_navigation_bar($offset,$all_client,$_SESSION['g_pagesize'],$page);
      +00207       // set a filter ?
      +00208       $search="";
      +00209       if ( trim($p_search) != "" )
      +00210         {
      +00211           $search=" and f_id in
      +00212 (select f_id from jnt_fic_att_value 
      +00213                   join fiche using (f_id) 
      +00214                   join attr_value using (jft_id)
      +00215                 where
      +00216                 ad_id=1 and av_text ~* '$p_search')";
      +00217         }
      +00218       // Get The result Array
      +00219       $step_client=$this->GetAll($offset,$search);
      +00220       if ( $all_client == 0 ) return "";
      +00221       $r=$bar;
      +00222       $r.='<table>
      +00223 <TR style="background-color:lightgrey;">
      +00224 <TH>Quick Code</TH>
      +00225 <th>Nom</th>
      +00226 <th>Adresse</th>
      +00227 <th>Solde</th>
      +00228 <th colspan="3">Action </th>
      +00229 </TR>';
      +00230       if ( sizeof ($step_client ) == 0 )
      +00231         return $r;
      +00232       foreach ($step_client as $client ) {
      +00233         $r.="<TR>";
      +00234         $e=sprintf('<A HREF="%s?p_action=client&sa=detail&f_id=%d&url=%s" title="Détail"> ',
      +00235                     $script,$client->id,$url);
      +00236 
      +00237         $r.="<TD> $e".$client->strAttribut(ATTR_DEF_QUICKCODE)."</A></TD>";
      +00238         $r.="<TD>".$client->strAttribut(ATTR_DEF_NAME)."</TD>";
      +00239         $r.="<TD>".$client->strAttribut(ATTR_DEF_ADRESS).
      +00240           " ".$client->strAttribut(ATTR_DEF_CP).
      +00241           " ".$client->strAttribut(ATTR_DEF_PAYS).
      +00242           "</TD>";
      +00243 
      +00244         $post=new poste($this->cn,$client->strAttribut(ATTR_DEF_ACCOUNT));
      +00245         $a=$post->GetSoldeDetail();
      +00246         $r.=sprintf('<TD align="right"> %15.2f&euro;</TD>',$a['solde']);
      +00247         $r.="<TD>";
      +00248 
      +00249         $r.=sprintf('<A HREF="%s?p_action=contact&qcode=%s&url=%s" title="Contact">Contact</A></td>',
      +00250                     $script,$client->strAttribut(ATTR_DEF_QUICKCODE),$url);
      +00251         $r.=sprintf('<td><A HREF="%s?p_action=suivi_courrier&sa=list&qcode=%s&url=%s" title="Action">Courrier</A></td> ',
      +00252                     $script,$client->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
      +00253 
      +00254 
      +00255 
      +00256         $r.='<td><A HREF="commercial.php?p_action=facture&sa=list&qcode='.$client->strAttribut(ATTR_DEF_QUICKCODE).'&url='.$url.'" title="Historique Facture">Facture</A></td>';
      +00257 
      +00258         $r.='</TD>';
      +00259 
      +00260         $r.="</TR>";
      +00261 
      +00262       }
      +00263       $r.="</TABLE>";
      +00264       $r.=$bar;
      +00265       return $r;
      +00266     }
      +
      +

      +

      @@ -201,7 +298,110 @@ Get all the info for making a vat listing for the vat administration.

      Definition at line 84 of file class_customer.php.

      -References $a_Res, $c, $customer, $e, $Res, $Res2, $sql, $t, ExecSql(), GetFromPoste(), and name. +References $a_Res, $c, $customer, $e, $Res, $Res2, $sql, $t, ExecSql(), GetFromPoste(), and name.

      00084                                {
      +00085     $cond_sql=" and A.j_date = B.j_date 
      +00086       and extract(year from A.j_date) ='$p_year'";
      +00087     
      +00088     // BASE ACCOUNT
      +00089     // for belgium
      +00090     $s=new parm_code($this->cn,'VENTE');
      +00091     $s->Get();
      +00092     $SOLD=$s->p_value;
      +00093 
      +00094     $c=new parm_code($this->cn,'CUSTOMER');
      +00095     $c->Get();
      +00096     $CUSTOMER=$c->p_value;
      +00097 
      +00098     $t=new parm_code($this->cn,'COMPTE_TVA');
      +00099     $t->Get();
      +00100     $TVA=$t->p_value;
      +00101     // Get all the sell operation
      +00102     //----
      +00103     $sql="select  j_grpt 
      +00104       from
      +00105 jrnx as A
      +00106  join jrnx as B using (j_grpt)
      +00107 where
      +00108        A.j_poste like '".$CUSTOMER."%' and
      +00109        B.j_poste like '".$SOLD."%' 
      +00110       $cond_sql
      +00111 ";
      +00112 
      +00113     $Res=ExecSql($this->cn,$sql);
      +00114     // Foreach operation 
      +00115     // where 7% or tva account are involved
      +00116     // and store the result in an array (a_Res)
      +00117     //---
      +00118     $a_Res=array();
      +00119     for ($i=0; $i < pg_NumRows($Res);$i++) {
      +00120       // Get each row
      +00121       //---
      +00122       $row1=pg_fetch_array($Res,$i);
      +00123   
      +00124       // select the operation
      +00125       //----
      +00126       $Res2=ExecSql($this->cn,"select j_poste,j_montant,j_debit from jrnx where j_grpt=".$row1['j_grpt']); 
      +00127       $a_row=array();
      +00128       // Store the result in the array 
      +00129       //---
      +00130       for ($e=0;$e < pg_NumRows($Res2);$e++) {
      +00131         $a_row[]=pg_fetch_array($Res2,$e);
      +00132       }
      +00133       
      +00134       // Seek the customer
      +00135       //---
      +00136       foreach ($a_row as $e) {
      +00137         if ( substr($e['j_poste'],0, strlen($CUSTOMER))==$CUSTOMER) {
      +00138           $customer=$e['j_poste'];
      +00139           // Retrieve name and vat number
      +00140           $this->GetFromPoste($customer);
      +00141           $a_Res[$customer]['name']=$this->name;
      +00142           $a_Res[$customer]['vat_number']=$this->vat_number;
      +00143           break;
      +00144           
      +00145         }
      +00146       }// foreach $a
      +00147       // Store the amount in the array
      +00148       //---
      +00149       foreach ($a_row as $e) {
      +00150         $amount=0;
      +00151         $tva=0;
      +00152         if ( substr($e['j_poste'],0, strlen($SOLD))==$SOLD) {
      +00153           $amount=($e['j_debit']=='f')?$e['j_montant']:$e['j_montant']*-1;
      +00154         }
      +00155         if ( substr($e['j_poste'],0, strlen($TVA))==$TVA) {
      +00156           $tva=($e['j_debit']=='f')?$e['j_montant']:$e['j_montant']*-1;
      +00157         }
      +00158         // store sold
      +00159         //---
      +00160         $a_Res[$customer]['amount']=(isset($a_Res[$customer]['amount']))?$a_Res[$customer]['amount']:0;         
      +00161   $a_Res[$customer]['amount']+=$amount;
      +00162 
      +00163         // store vat
      +00164         //---
      +00165         $a_Res[$customer]['tva']=(isset($a_Res[$customer]['tva']))?$a_Res[$customer]['tva']:0;
      +00166         $a_Res[$customer]['tva']+=$tva;  
      +00167   
      +00168         // store customef info
      +00169         //---
      +00170         $a_Res[$customer]['customer']=$customer;
      +00171 
      +00172   //if not submitted to VAT, remove from list:
      +00173   //STAN: currently commented out because I don't know if it is really what we need.
      +00174   //Dany : yes we need it because the decla. concerns only the registered customer at the VAT 
      +00175         if (!isset($a_Res[$customer]['vat_number']) || strcmp($a_Res[$customer]['vat_number'], "") == 0)
      +00176           {
      +00177             unset($a_Res[$customer]);
      +00178           }
      +00179         
      +00180       }// foreach $a
      +00181 
      +00182     }
      +00183     return $a_Res;
      +00184   }
      +
      +

      +


      Field Documentation

      @@ -356,8 +556,8 @@ Definition at line
      The documentation for this class was generated from the following file:
      -
      Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    • class_customer.php
    +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classDocument.html b/doc/developper/html/classDocument.html index e1aa6ba2f..63ac2e917 100644 --- a/doc/developper/html/classDocument.html +++ b/doc/developper/html/classDocument.html @@ -109,9 +109,15 @@ Definition at line

    Definition at line 42 of file class_document.php.

    -References d_id. +References d_id.

    -Referenced by SaveGenerated(). +Referenced by SaveGenerated().

    00043     {
    +00044       $this->db=$p_cn;
    +00045       $this->d_id=$p_d_id;
    +00046     } 
    +
    +

    +


    Member Function Documentation

    @@ -147,7 +153,16 @@ a_ref

    Definition at line 326 of file class_document.php.

    -References $r. +References $r.

    00327     {
    +00328       if ( $this->d_id == 0 )
    +00329         return '';
    +00330       $r="";
    +00331       $r='<A HREF="show_document.php?d_id='.$this->d_id.'">Document</A>';
    +00332       return $r;
    +00333     }
    +
    +

    +

    @@ -180,7 +195,20 @@ insert a minimal document and set the d_id

    Definition at line 49 of file class_document.php.

    -References $sql, ag_id, d_id, ExecSql(), and NextSequence(). +References $sql, ag_id, d_id, ExecSql(), and NextSequence().

    00050     {
    +00051       $this->d_id=NextSequence($this->db,"document_d_id_seq");
    +00052       // affect a number
    +00053       $this->d_number=NextSequence($this->db,"seq_doc_type_".$this->md_type);
    +00054       $sql=sprintf('insert into document(d_id,ag_id,d_number) values(%d,%d,%d)',
    +00055                    $this->d_id,
    +00056                    $this->ag_id,
    +00057                    $this->d_number);
    +00058       ExecSql($this->db,$sql);
    +00059 
    +00060     }
    +
    +

    +

    @@ -220,7 +248,70 @@ Generate the document, Call $this->Replace to replace tag by value.

    Definition at line 71 of file class_document.php.

    -References $Res, $ret, $row, Commit(), echo_debug(), ExecSql(), md_type, NextSequence(), ParseDocument(), SaveGenerated(), and StartSql(). +References $Res, $ret, $row, Commit(), echo_debug(), ExecSql(), md_type, NextSequence(), ParseDocument(), SaveGenerated(), and StartSql().

    00072     {
    +00073       // create a temp directory in /tmp to unpack file and to parse it
    +00074       $dirname=tempnam('/tmp','doc_');
    +00075       echo $dirname;
    +00076       unlink($dirname);
    +00077       mkdir ($dirname);
    +00078       echo_debug('class_action',__LINE__,"Dirname is $dirname");
    +00079       // Retrieve the lob and save it into $dirname
    +00080       StartSql($this->db);
    +00081       $dm_info="select md_type,md_lob,md_filename,md_mimetype 
    +00082                    from document_modele where md_id=".$this->md_id;
    +00083       $Res=ExecSql($this->db,$dm_info);
    +00084 
    +00085       $row=pg_fetch_array($Res,0);
    +00086       $this->d_lob=$row['md_lob'];
    +00087       $this->d_filename=$row['md_filename'];
    +00088       $this->d_mimetype=$row['md_mimetype'];
    +00089 
    +00090       echo_debug('class_document',__LINE__,"OID is ".$row['md_lob']);
    +00092       chdir($dirname);
    +00093       $filename=$row['md_filename'];
    +00094       pg_lo_export($this->db,$row['md_lob'],$filename);
    +00095       $type="n";
    +00096       echo_debug('class_document',__LINE__,'The document type is '.$row['md_mimetype']);
    +00097       // if the doc is a OOo, we need to unzip it first
    +00098       // and the name of the file to change is always content.xml
    +00099       if ( strpos($row['md_mimetype'],'vnd.oasis') != 0 )
    +00100         {
    +00101           echo_debug('class_document',__LINE__,'Unzip the OOo');
    +00102           system("unzip ".$filename);
    +00103           // Remove the file we do  not need anymore
    +00104           unlink($filename);
    +00105           $file_to_parse="content.xml";
    +00106           $type="OOo";
    +00107         }
    +00108       else 
    +00109         $file_to_parse=$filename;
    +00110       // affect a number
    +00111       $this->d_number=NextSequence($this->db,"seq_doc_type_".$row['md_type']);
    +00112 
    +00113 
    +00114       // parse the document - return the doc number ?
    +00115       $this->ParseDocument($dirname,$file_to_parse,$type);
    +00116 
    +00117       Commit($this->db);
    +00118       // if the doc is a OOo, we need to re-zip it 
    +00119       if ( strpos($row['md_mimetype'],'vnd.oasis') != 0 )
    +00120         {
    +00121           system ("zip -r ".$filename." *");
    +00122           $file_to_parse=$filename;
    +00123         }
    +00124       // Create a directory 
    +00125       mkdir ($_SERVER['DOCUMENT_ROOT'].$dirname);
    +00126 
    +00127       // we need to rename the new generated file
    +00128       rename($dirname."/".$file_to_parse,$_SERVER['DOCUMENT_ROOT'].$dirname.'/'.$file_to_parse);
    +00129       $ret=sprintf('<A HREF="%s">Document généré</A>',
    +00130                    $dirname.'/'.$file_to_parse);
    +00131       $this->SaveGenerated($_SERVER['DOCUMENT_ROOT'].$dirname."/".$file_to_parse);
    +00132       return $ret;
    +00133     }
    +
    +

    +

    @@ -253,7 +344,24 @@ Get complete all the data member thx info from the database.

    Definition at line 375 of file class_document.php.

    -References $ret, $row, $sql, ag_id, and d_state. +References $ret, $row, $sql, ag_id, and d_state.

    00376     {
    +00377       $sql="select * from document where d_id=".$this->d_id;
    +00378       $ret=Exec($this->db,$sql);
    +00379       if ( pg_num_rows($ret) == 0 )
    +00380         return;
    +00381       $row=pg_fetch_array($ret,0);
    +00382       $this->ag_id=$row['ag_id'];
    +00383       $this->d_mimetype=$row['d_mimetype'];
    +00384       $this->d_filename=$row['d_filename'];
    +00385       $this->d_lob=$row['d_lob'];
    +00386       $this->d_number=$row[''];
    +00387       $this->d_state=$row['ag_id'];
    +00388       $this->d_number=$row['d_number'];
    +00389 
    +00390     }
    +
    +

    +

    @@ -292,7 +400,17 @@ Move a document from the table document into the concerned row the document is n

    Definition at line 733 of file class_document.php.

    -References $sql, and ExecSql(). +References $sql, and ExecSql().

    00734     {
    +00735 
    +00736       $sql=sprintf("update jrn set jr_pj=%s,jr_pj_name='%s',jr_pj_type='%s' where jr_internal='%s'",
    +00737                    $this->d_lob,$this->d_filename,$this->d_mimetype,$p_internal);
    +00738       ExecSql($this->db,$sql);
    +00739       // clean the table document
    +00740       $this->remove();
    +00741     }
    +
    +

    +

    @@ -352,9 +470,90 @@ ParseDocument

    Definition at line 145 of file class_document.php.

    -References $h, echo_debug(), exit, Replace(), and value. +References $h, echo_debug(), exit, Replace(), and value.

    -Referenced by Generate(). +Referenced by Generate().

    00146     {
    +00147 
    +00148       echo_debug('class_document',__LINE__,'Begin parsing of '.$p_dir.' '.$p_file.'Type = '.$p_type);
    +00149       
    +00156       // open the document
    +00157       $infile_name=$p_dir."/".$p_file;
    +00158       echo_debug("class_document.php",__LINE__,"Open the document $p_dir/$p_file");
    +00159       $h=fopen($infile_name,"r");
    +00160       $output_name=tempnam($_SERVER["DOCUMENT_ROOT"]."/tmp","gen_doc_");
    +00161       $output_file=fopen($output_name,"w+");
    +00162       // check if the opening is sucessfull
    +00163       if (  $h == false ) 
    +00164         {
    +00165           echo "cannot open $p_dir $p_file ";
    +00166           exit();
    +00167         }
    +00168       if ( $output_file == false) 
    +00169         {
    +00170           echo "ne peut pas ouvrir le fichier de sortie";
    +00171           exit();
    +00172         }
    +00173       // compute the regex
    +00174       if ( $p_type=='OOo')
    +00175         {
    +00176           $regex="&lt;&lt;[A-Z]+_*[A-Z]*_*[A-Z]*_*[0-9]*&gt;&gt;";
    +00177           $lt="&lt;";
    +00178           $gt="&gt;";
    +00179         }
    +00180       else
    +00181         {
    +00182           $regex="<<[A-Z]+_*[A-Z]*_*[A-Z]*_*[0-9]*>>";
    +00183           $lt="<";
    +00184           $gt=">";
    +00185         }
    +00186       //read the file
    +00187       while(! feof($h)) 
    +00188         {
    +00189           // replace the tag
    +00190           $buffer=fgets($h);
    +00191           // search in the buffer the magic << and >>
    +00192           // while ereg finds something to replace
    +00193           while ( ereg ($regex,$buffer,$f) )
    +00194             {
    +00195 
    +00196             echo_debug('class_document',__LINE__,'var_export '.var_export( $f,true));
    +00197             foreach ( $f as $pattern )
    +00198               {
    +00199                 echo_debug('class_document',__LINE__, "pattern");
    +00200                 echo_debug('class_document',__LINE__, var_export($pattern,true));
    +00201                 $to_remove=$pattern;
    +00202                 // we remove the < and > from the pattern
    +00203                 $pattern=str_replace($lt,'',$pattern);
    +00204                 $pattern=str_replace($gt,'',$pattern);
    +00205 
    +00206 
    +00207                 // if the pattern if found we replace it
    +00208                 $value=$this->Replace($pattern);
    +00209                 // replace into the $buffer
    +00210                 // take the position in the buffer 
    +00211                 $pos=strpos($buffer,$to_remove);
    +00212                 // get the length of the string to remove
    +00213                 $len=strlen($to_remove);
    +00214                 $buffer=substr_replace($buffer,$value,$pos,$len);
    +00215 
    +00216                 //              echo_debug('class_document',__LINE__, $buffer);
    +00217                 // if the pattern if found we replace it
    +00218                 echo_debug('class_document',__LINE__,"Transform $pattern by $value");
    +00219               }
    +00220           }
    +00221           // write into the output_file
    +00222           fwrite($output_file,$buffer);
    +00223 
    +00224         }
    +00225       fclose($h);
    +00226       fclose($output_file);
    +00227       rename ($output_name,$infile_name);
    +00228       // Save the document into the database
    +00229 
    +00230     }
    +
    +

    +

    @@ -387,7 +586,13 @@ remove a row from the table document, the lob object is not deleted because can

    Definition at line 722 of file class_document.php.

    -References $sql, d_id, and ExecSql(). +References $sql, d_id, and ExecSql().

    00723     {
    +00724       $sql='delete from document where d_id='.$this->d_id;
    +00725       ExecSql($this->db,$sql);
    +00726     }
    +
    +

    +

    @@ -433,9 +638,297 @@ replace the TAG by the real value, this value can be into the database or in $_P

    Definition at line 423 of file class_document.php.

    -References $act, $my, $p, $poste, $qcode, $r, ag_id, break, fiche, GetTvaRate(), MY_COMMUNE, MY_CP, MY_FAX, MY_NAME, MY_NUMBER, MY_PAYS, MY_STREET, MY_TEL, MY_TVA, and qcode. +References $act, $my, $p, $poste, $qcode, $r, ag_id, break, fiche, GetTvaRate(), MY_COMMUNE, MY_CP, MY_FAX, MY_NAME, MY_NUMBER, MY_PAYS, MY_STREET, MY_TEL, and MY_TVA.

    -Referenced by ParseDocument(). +Referenced by ParseDocument().

    00424     {
    +00425       $r="Tag inconnu";
    +00426       static $counter=0;
    +00427       switch ($p_tag)
    +00428         {
    +00429         case 'DATE':
    +00430           $r=' Date inconnue ';
    +00431           // Date are in $_REQUEST['ag_date'] 
    +00432           // or $_POST['e_date']
    +00433           if ( isset ($_REQUEST['ag_date']))
    +00434             $r=$_REQUEST['ag_date'];
    +00435           if ( isset ($_REQUEST['e_date']))
    +00436             $r=$_REQUEST['e_date'];
    +00437 
    +00438           break; 
    +00439           //
    +00440           //  the company priv
    +00441 
    +00442         case 'MY_NAME':
    +00443           $my=new own($this->db);
    +00444           $r=$my->MY_NAME;
    +00445           break;
    +00446         case 'MY_CP':
    +00447           $my=new own($this->db);
    +00448           $r=$my->MY_CP;
    +00449           break;
    +00450         case 'MY_COMMUNE':
    +00451           $my=new own($this->db);
    +00452           $r=$my->MY_COMMUNE;
    +00453           break;
    +00454         case 'MY_TVA':
    +00455           $my=new own($this->db);
    +00456           $r=$my->MY_TVA;
    +00457           break;
    +00458         case 'MY_STREET':
    +00459           $my=new own($this->db);
    +00460           $r=$my->MY_STREET;
    +00461           break;
    +00462         case 'MY_NUMBER':
    +00463           $my=new own($this->db);
    +00464           $r=$my->MY_NUMBER;
    +00465           break;
    +00466         case 'MY_TEL':
    +00467           $my=new own($this->db);
    +00468           $r=$my->MY_TEL;
    +00469           break;
    +00470         case 'MY_FAX':
    +00471           $my=new own($this->db);
    +00472           $r=$my->MY_FAX;
    +00473           break;
    +00474         case 'MY_PAYS':
    +00475           $my=new own($this->db);
    +00476           $r=$my->MY_PAYS;
    +00477           break;
    +00478 
    +00479           // customer 
    +00480           /*\note The CUST_* are retrieved thx the $_REQUEST['tiers'] 
    +00481            * which contains the quick_code
    +00482            */
    +00483         case 'SOLDE':
    +00484           $tiers=new fiche($this->db);
    +00485           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
    +00486           $tiers->Getbyqcode($qcode,false);
    +00487           $p=$tiers->strAttribut(ATTR_DEF_ACCOUNT);
    +00488           $poste=new Poste($this->db,$p);
    +00489           $r=$poste->GetSolde(' true' );
    +00490           break;
    +00491         case 'CUST_NAME':
    +00492           $tiers=new fiche($this->db);
    +00493           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
    +00494           $tiers->getByQcode($qcode,false);
    +00495           $r=$tiers->strAttribut(ATTR_DEF_NAME);
    +00496           break;
    +00497         case 'CUST_ADDR_1':
    +00498           $tiers=new fiche($this->db);
    +00499           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
    +00500           $tiers->getByQcode($qcode,false);
    +00501           $r=$tiers->strAttribut(ATTR_DEF_ADRESS);
    +00502           
    +00503           break ;
    +00504         case 'CUST_CP':
    +00505           $tiers=new fiche($this->db);
    +00506           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
    +00507           $tiers->getByQcode($qcode,false);
    +00508           $r=$tiers->strAttribut(ATTR_DEF_CP);
    +00509 
    +00510           break;
    +00511         case 'CUST_CO':
    +00512           $tiers=new fiche($this->db);
    +00513           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
    +00514           $tiers->getByQcode($qcode,false);
    +00515           $r=$tiers->strAttribut(ATTR_DEF_PAYS);
    +00516 
    +00517           break; 
    +00518         case 'CUST_VAT':
    +00519           $tiers=new fiche($this->db);
    +00520           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
    +00521           $tiers->getByQcode($qcode,false);
    +00522           $r=$tiers->strAttribut(ATTR_DEF_NUMTVA);
    +00523           break; 
    +00524           // Marchandise in $_POST['e_march*']
    +00525           // \see user_form_achat.php or user_form_ven.php
    +00526         case 'NUMBER':
    +00527           $r=$this->d_number;
    +00528           break;
    +00529         case 'REFERENCE':
    +00530           $act=new action($this->db);
    +00531           $act->ag_id=$this->ag_id;
    +00532           $act->get();
    +00533           $r=$act->ag_ref;
    +00534           break;
    +00535 
    +00536           /*
    +00537            *  - [VEN_ART_NAME]
    +00538            *  - [VEN_ART_PRICE]
    +00539            *  - [VEN_ART_QUANT]
    +00540            *  - [VEN_ART_TVA_CODE]
    +00541            *  - [VEN_ART_TVA_AMOUNT]
    +00542            *  - [VEN_ART_STOCK_CODE]
    +00543            *  - [VEN_HTVA]
    +00544            *  - [VEN_TVAC]
    +00545            *  - [VEN_TVA]
    +00546            *  - [TOTAL_VEN_HTVA]
    +00547            */
    +00548         case 'MARCH_NEXT':
    +00549           $counter++;
    +00550           $r='';
    +00551           break;
    +00552           
    +00553         case 'VEN_ART_NAME':
    +00554           extract ($_POST);
    +00555           $id='e_march'.$counter;
    +00556           // check if the march exists
    +00557           if ( ! isset (${$id})) return "";
    +00558           // check that something is sold
    +00559           if ( ${'e_march'.$counter.'_sell'} != 0 && ${'e_quant'.$counter} != 0 )
    +00560             {
    +00561               $f=new fiche($this->db);
    +00562               $f->GetByQCode(${$id},false);
    +00563               $r=$f->strAttribut(ATTR_DEF_NAME);
    +00564             } else $r = "";
    +00565           break;
    +00566 
    +00567         case 'VEN_ART_PRICE':
    +00568           extract ($_POST);
    +00569           $id='e_march'.$counter.'_sell' ;
    +00570           if ( !isset (${$id}) ) return "";
    +00571           $r=${$id};
    +00572           break;
    +00573 
    +00574         case 'TVA_CODE':
    +00575           extract ($_POST);
    +00576           $id='e_march'.$counter.'_tva_id';
    +00577           if ( !isset (${$id}) ) return "";
    +00578           if ( ${$id} == -1 ) return "";
    +00579           $qt='e_quant'.$counter;
    +00580           $price='e_march'.$counter.'_sell' ;
    +00581           if ( ${$price} == 0 || ${$qt} == 0 
    +00582                || strlen(trim( $price )) ==0 
    +00583                || strlen(trim($qt)) ==0)
    +00584             return "";
    +00585 
    +00586           $r=${$id};
    +00587           break;
    +00588 
    +00589         case 'TVA_LABEL':
    +00590           extract ($_POST);
    +00591           $id='e_march'.$counter.'_tva_id';
    +00592           if ( !isset (${$id}) ) return "";
    +00593           $tva=GetTvaRate($this->db,${$id});
    +00594           if ( $tva == null || $tva==0 ) return "";
    +00595           $r=$tva['tva_label'];
    +00596           break;
    +00597 
    +00598 
    +00599         case 'TVA_AMOUNT':
    +00600           extract ($_POST);
    +00601           $qt='e_quant'.$counter;
    +00602           $price='e_march'.$counter.'_sell' ;
    +00603           $tva='e_march'.$counter.'_tva_id';
    +00604           if ( !isset (${'e_march'.$counter}) ) return "";
    +00605           // check that something is sold
    +00606           if ( ${$price} == 0 || ${$qt} == 0 
    +00607                || strlen(trim( $price )) ==0 
    +00608                || strlen(trim($qt)) ==0)
    +00609             return "";
    +00610           $a_tva=GetTvaRate($this->db,${$tva});
    +00611           echo_debug('class_document',__LINE__,'Tva  :'.var_export($a_tva,true));
    +00612           // if no vat returns 0
    +00613           if ( sizeof($a_tva) == 0 ) return "";
    +00614           $r=round(${$price},2)*${$qt}*$a_tva['tva_rate'];
    +00615           $r=round($r,2);
    +00616           break;
    +00617 
    +00618         case 'VEN_ART_QUANT':
    +00619           extract ($_POST);
    +00620           $id='e_quant'.$counter;
    +00621           if ( !isset (${$id}) ) return "";
    +00622           // check that something is sold
    +00623           if ( ${'e_march'.$counter.'_sell'} == 0 
    +00624                || ${'e_quant'.$counter} == 0 
    +00625                || strlen(trim( ${'e_march'.$counter.'_sell'} )) ==0 
    +00626                || strlen(trim(${'e_quant'.$counter})) ==0 )
    +00627             return "";
    +00628           $r=${$id};
    +00629           break;
    +00630 
    +00631         case 'VEN_HTVA':
    +00632           extract ($_POST);
    +00633           $id='e_march'.$counter.'_sell' ;
    +00634           $quant='e_quant'.$counter;
    +00635           if ( !isset (${$id}) ) return "";
    +00636 
    +00637           // check that something is sold
    +00638           if ( ${'e_march'.$counter.'_sell'} == 0 || ${'e_quant'.$counter} == 0 
    +00639                || strlen(trim( ${'e_march'.$counter.'_sell'} )) ==0 
    +00640                || strlen(trim(${'e_quant'.$counter})) ==0)
    +00641             return "";
    +00647           $r=round(${$id}*${$quant},2); 
    +00648           break;
    +00649 
    +00650         case 'VEN_TVAC':
    +00651           extract ($_POST);
    +00652           $id='e_march'.$counter.'_sell' ;
    +00653           $quant='e_quant'.$counter;
    +00654           // if it is exist
    +00655           if ( ! isset(${$id})) 
    +00656             return "";
    +00657           // check that something is sold
    +00658           if ( ${'e_march'.$counter.'_sell'} == 0 || ${'e_quant'.$counter} == 0 )
    +00659             return "";
    +00664           $r=${$id}*${$quant}; 
    +00665           $tva=GetTvaRate($this->db,${'e_march'.$counter.'_tva_id'});
    +00666           // if there is no vat we return now
    +00667           if ( $tva == null || $tva == 0 ) return $r;
    +00668           // we compute with the vat included
    +00669           $r=$r+$r*$tva['tva_rate'];
    +00670           $r=round($r,2);
    +00671           break;
    +00672         case 'TOTAL_VEN_HTVA':
    +00673           extract($_POST);
    +00674           echo_debug('class_document',__LINE__,'TOTAL_VEN_TVA item :'.$nb_item);
    +00675 
    +00676           $sum=0.0;
    +00677           for ($i=0;$i<$nb_item;$i++)
    +00678             {
    +00679               $sell='e_march'.$i.'_sell';
    +00680               $qt='e_quant'.$i;
    +00681               echo_debug('class_document',__LINE__,'sell :'.$sell.' qt = '.$qt);
    +00682 
    +00683               echo_debug('class_document',__LINE__,'counter :'.$i.' sur '.$nb_item);
    +00684               if ( ! isset (${$sell}) ) break;
    +00685               echo_debug('class_document',__LINE__,'sell :'.${$sell}.' qt = '.${$qt});
    +00686 
    +00687               if ( strlen(trim(${$sell})) == 0 ||
    +00688                    strlen(trim(${$qt})) == 0 ||
    +00689                    ${$qt}==0 || ${$sell}==0)
    +00690                 continue;
    +00691               $sum+=${$sell}*${$qt};
    +00692               echo_debug('class_document',__LINE__,'sum :'.$sum);
    +00693 
    +00694             }
    +00695           $r=round($sum,2);
    +00696           break;
    +00697         case 'TOTAL_VEN_TVAC':
    +00698           extract($_POST);
    +00699           $sum=0.0;
    +00700           for ($i=0;$i<$nb_item;$i++)
    +00701             {
    +00702               $tva=GetTvaRate($this->db,${'e_march'.$i.'_tva_id'});
    +00703               $tva_rate=( $tva == null || $tva == 0 )?0.0:$tva['tva_rate'];
    +00704               echo_debug('class_document',__LINE__,' :'.$i.' sur '.$nb_item);
    +00705               $sell=${'e_march'.$i.'_sell'};
    +00706               $qt=${'e_quant'.$i};
    +00707               echo_debug('class_document',__LINE__,'sell :'.$sell.' qt = '.$qt);
    +00708 
    +00709               $sum+=$sell*$qt*(1+$tva_rate);
    +00710               //              $sum+=${'e_march'.$i.'_sell'}*${'e_quant'.$i}*(1+$tva_rate);
    +00711             }
    +00712           $r=round($sum,2);
    +00713 
    +00714           break;
    +00715 
    +00716         }
    +00717       return $r;
    +00718     }
    +
    +

    +

    @@ -475,9 +968,36 @@ SaveGenerated

    Parameters:

    Definition at line 238 of file class_document.php.

    -References $doc, $sql, Commit(), d_id, Document(), echo_debug(), ExecSql(), GetSequence(), Rollback(), and StartSql(). +References $doc, $sql, Commit(), d_id, Document(), echo_debug(), ExecSql(), GetSequence(), Rollback(), and StartSql().

    -Referenced by Generate(). +Referenced by Generate().

    00239     {
    +00240       echo_debug('class_document',__LINE__,'Save generated');
    +00241       // We save the generated file
    +00242       $doc=new Document($this->db);
    +00243       StartSql($this->db);
    +00244       $this->d_lob=pg_lo_import($this->db,$p_file);
    +00245       if ( $this->d_lob == false ) { 
    +00246         Rollback($this->db); echo_debug('class_document',__LINE__,"can't save file $p_file");
    +00247         return 1; }
    +00248     
    +00249       $sql=sprintf("insert into document(ag_id,d_lob,d_number,d_filename,d_mimetype,d_state) 
    +00250                         values (%d,%s,%d,'%s','%s',%d)",
    +00251                    $this->ag_id,
    +00252                    $this->d_lob,
    +00253                    $this->d_number,
    +00254                    $this->d_filename,
    +00255                    $this->d_mimetype,
    +00256                    $this->d_state
    +00257                    );
    +00258       ExecSql($this->db,$sql);
    +00259       $this->d_id=GetSequence($this->db,"document_d_id_seq");
    +00260       echo_debug('class_document',__LINE__,'document sauvé : d_id'.$this->d_id);
    +00261       Commit($this->db);
    +00262       return 0;
    +00263     }
    +
    +

    +

    @@ -508,7 +1028,44 @@ Referenced by Gener

    Definition at line 337 of file class_document.php.

    -References $file, $ret, $row, $tmp, Commit(), ExecSql(), and StartSql(). +References $file, $ret, $row, $tmp, Commit(), ExecSql(), and StartSql().

    00338     {
    +00339       // retrieve the template and generate document
    +00340       StartSql($this->db);
    +00341       $ret=ExecSql($this->db,
    +00342                    "select d_id,d_lob,d_filename,d_mimetype from document where d_id=".$this->d_id );
    +00343       if ( pg_num_rows ($ret) == 0 )
    +00344         return;
    +00345       $row=pg_fetch_array($ret,0);
    +00346       //the document  is saved into file $tmp
    +00347       $tmp=tempnam('/tmp/','document_');
    +00348       pg_lo_export($this->db,$row['d_lob'],$tmp);
    +00349       $this->d_mimetype=$row['d_mimetype'];
    +00350       $this->d_filename=$row['d_filename'];
    +00351 
    +00352       // send it to stdout
    +00353       ini_set('zlib.output_compression','Off');
    +00354       header("Pragma: public");
    +00355       header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    +00356       header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    +00357       header("Cache-Control: must-revalidate");
    +00358       header('Content-type: "'.$this->d_mimetype.'"');
    +00359       header('Content-Disposition: attachment;filename="'.$this->d_filename.'"',FALSE);
    +00360       header("Accept-Ranges: bytes");
    +00361       $file=fopen($tmp,'r');
    +00362       while ( !feof ($file) )
    +00363         {
    +00364           echo fread($file,8192);
    +00365         }
    +00366       fclose($file);
    +00367       
    +00368       unlink ($tmp);
    +00369       
    +00370       Commit($this->db);
    +00371       
    +00372     }
    +
    +

    +

    @@ -543,7 +1100,58 @@ Upload

    Definition at line 271 of file class_document.php.

    -References $old_oid, $r, $ret, $sql, Commit(), ExecSql(), name, Rollback(), and StartSql(). +References $old_oid, $r, $ret, $sql, Commit(), ExecSql(), name, Rollback(), and StartSql().

    00272     {
    +00273 
    +00274       // nothing to save
    +00275       if ( sizeof($_FILES) == 0 ) return;
    +00276 
    +00277       // Start Transaction
    +00278       StartSql($this->db);
    +00279       $new_name=tempnam('/tmp','doc_');
    +00280 
    +00281 
    +00282       // check if a file is submitted
    +00283       if ( strlen($_FILES['file_upload']['tmp_name']) != 0 )
    +00284         {
    +00285           // upload the file and move it to temp directory
    +00286           if ( move_uploaded_file($_FILES['file_upload']['tmp_name'],$new_name))
    +00287           {
    +00288             $oid=pg_lo_import($this->db,$new_name);
    +00289             // check if the lob is in the database
    +00290             if ( $oid == false ) 
    +00291               {
    +00292                 Rollback($this->db);
    +00293                 return 1;
    +00294               }
    +00295           }
    +00296           // the upload in the database is successfull
    +00297           $this->d_lob=$oid;
    +00298           $this->d_filename=$_FILES['file_upload']['name'];
    +00299           $this->d_mimetype=$_FILES['file_upload']['type'];
    +00300           // now we have to update the col.
    +00301           // We retrieve the row to remove a possible existing lob (replace)
    +00302           $sql="select d_lob from document where d_id=".$this->d_id;
    +00303           $ret=ExecSql($this->db,$sql);
    +00304 
    +00305           if (pg_num_rows($ret) != 0)  
    +00306             {
    +00307               // a result is found, the old oid is keept in order to
    +00308               // remove it later
    +00309               $r=pg_fetch_array($ret,0) ;
    +00310               $old_oid=$r['d_lob'] ;
    +00311               if (strlen($old_oid) != 0) { pg_lo_unlink ($this->db,$old_oid);}
    +00312             }
    +00313           // Update the table
    +00314           $sql=sprintf("update document set d_lob=%s,d_filename='%s',d_mimetype='%s' where d_id=%d",
    +00315                        $this->d_lob,$this->d_filename,$this->d_mimetype,$this->d_id);
    +00316           ExecSql($this->db,$sql);
    +00317         }
    +00318       Commit($this->db);
    +00319 
    +00320     }
    +
    +

    +


    Field Documentation

    @@ -748,8 +1356,8 @@ Definition at line
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_document.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classDocument__modele.html b/doc/developper/html/classDocument__modele.html index 24a273ea2..06b97f959 100644 --- a/doc/developper/html/classDocument__modele.html +++ b/doc/developper/html/classDocument__modele.html @@ -88,7 +88,13 @@ Definition at line 37 of file class_document_modele.php.

    -References $p_id, and md_id. +References $p_id, and md_id.

    00037                                            {
    +00038     $this->cn=$p_cn;    
    +00039     $this->md_id=$p_id;
    +00040   }
    +
    +

    +


    Member Function Documentation

    @@ -123,7 +129,26 @@ Remove a template.

    Definition at line 179 of file class_document_modele.php.

    -References $r, $res, $sql, Commit(), ExecSql(), and StartSql(). +References $r, $res, $sql, Commit(), ExecSql(), and StartSql().

    00180     {
    +00181       StartSql($this->cn);
    +00182       // first we unlink the document
    +00183       $sql="select md_lob from document_modele where md_id=".$this->md_id;
    +00184       $res=ExecSql($this->cn,$sql);
    +00185       $r=pg_fetch_array($res,0);
    +00186       // if a lob is found
    +00187       if ( strlen ($r['md_lob']) != 0 )
    +00188         {
    +00189           // we remove it first
    +00190           pg_lo_unlink($r['md_lob']);
    +00191         }
    +00192       // now we can delete the row
    +00193       $sql="delete from document_modele where md_id =".$this->md_id;
    +00194       $sql=ExecSql($this->cn,$sql);
    +00195       Commit($this->cn);
    +00196     }
    +
    +

    +

    @@ -164,9 +189,40 @@ show the form for loading a template

    Definition at line 252 of file class_document_modele.php.

    -References $h, $r, $start, $t, $w, dt_id, and make_array(). +References $h, $r, $start, $t, $w, dt_id, and make_array().

    -Referenced by myList(). +Referenced by myList().

    00253     {
    +00254       $r="<p>";
    +00255       $r.='<form enctype="multipart/form-data"  action="'.$p_action.'" method="post">';
    +00256       $t=new widget("text");
    +00257       $t->name="md_name";
    +00258       $r.=" Nom ".$t->IOValue()."";
    +00259       $r.="Type de document ";
    +00260       $w=new widget("select");
    +00261       $w->name="md_type";
    +00262       $w->value=make_array($this->cn,'select dt_id,dt_value from document_type');
    +00263       $r.=$w->IOValue();
    +00264       $r.="</p><p>";
    +00265       $f=new widget("file");
    +00266       $f->name="doc";
    +00267       $r.="fichier ".$f->IOValue()."";
    +00268       // we need to add the sub action as hidden
    +00269       $h=new widget("hidden");
    +00270       $h->name="sa";
    +00271       $h->value="add_document";
    +00272       $r.=$h->IOValue();
    +00273       $start=new widget("text");
    +00274       $start->name="start_seq";
    +00275       $start->size=9;
    +00276       $start->value="0";
    +00277       $r.=" Numerotation commence a ".$start->IOValue()."";
    +00278       $r.=$w->Submit('add_document','Ajout');
    +00279       $r.="</form></p>";
    +00280       return $r;
    +00281     }
    +
    +

    +

    @@ -215,7 +271,47 @@ Parse and remplace the tag in the invoice By the value found in quant_sold.

    Definition at line 204 of file class_document_modele.php.

    -References $file, $ret, $row, $tmp, Commit(), ExecSql(), and StartSql(). +References $file, $ret, $row, $tmp, Commit(), ExecSql(), and StartSql().

    00205     {
    +00206       // retrieve info from the table invoice
    +00207       
    +00208       // retrieve the template and generate document
    +00209       StartSql($this->cn);
    +00210       $ret=ExecSql($cn,"select iv_name,iv_file from invoice where iv_id".$this->iv_id);
    +00211       if ( pg_num_rows ($ret) == 0 )
    +00212         return;
    +00213       $row=pg_fetch_array($ret,0);
    +00214       //the template is saved into file $tmp
    +00215       $tmp=tempnam('/tmp/','invoice_');
    +00216       pg_lo_export($cn,$row['iv_file'],$tmp);
    +00217       // Parse the file 
    +00218       
    +00219       
    +00220       
    +00221       
    +00222       // send it to stdout
    +00223       ini_set('zlib.output_compression','Off');
    +00224       header("Pragma: public");
    +00225       header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    +00226       header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    +00227       header("Cache-Control: must-revalidate");
    +00228       header('Content-type: rtf/x-application');
    +00229       header('Content-Disposition: attachment;filename="invoice'.$p_internal.'.rtf"',FALSE);
    +00230       header("Accept-Ranges: bytes");
    +00231       $file=fopen($tmp,'r');
    +00232       while ( !feof ($file) )
    +00233         {
    +00234           echo fread($file,8192);
    +00235         }
    +00236       fclose($file);
    +00237       
    +00238       unlink ($tmp);
    +00239       
    +00240       Commit($cn);
    +00241       
    +00242     }
    +
    +

    +

    @@ -249,7 +345,47 @@ References $

    Definition at line 49 of file class_document_modele.php.

    -References $a, $all, $c, $r, $Res, $row, $sql, ExecSql(), form(), md_id, and md_name. +References $a, $all, $c, $r, $Res, $row, $sql, ExecSql(), form(), md_id, and md_name.

    00049                     { 
    +00050     $sql="select md_id,md_name,dt_value from document_modele join document_type on(dt_id=md_type)";
    +00051     $Res=ExecSql($this->cn,$sql);
    +00052     $all=pg_fetch_all($Res);
    +00053     if ( pg_NumRows($Res) == 0 ) return "";
    +00054     $r='<p><form method="post">';
    +00055     $r.="<table>";
    +00056     $r.="<tr> <th> Nom </th> <th>Type</Th><th>Fichier</th><th> Effacer</th>"; 
    +00057     $r.="</tr>";
    +00058     foreach ( $all as $row) {
    +00059       $r.="<tr>";
    +00060       $r.="<td>";
    +00061       $r.=$row['md_name'];
    +00062       $r.="</td>";
    +00063       $r.="<td>";
    +00064       $r.=$row['dt_value'];
    +00065       $r.="</td>";
    +00066       $r.="<td>";
    +00067       $r.='<A HREF="show_document_modele.php?md_id='.$row['md_id'].'">Document</a>';
    +00068       $r.="</td>";
    +00069       $r.="<TD>";
    +00070       $c=new widget("checkbox");
    +00071       $c->name="dm_remove_".$row['md_id'];
    +00072       $r.=$c->IOValue();
    +00073       $r.="</td>";
    +00074       $r.="</tr>";
    +00075     } 
    +00076     $r.="</table>";
    +00077     
    +00078     // need hidden parameter for subaction
    +00079     $a=new widget("hidden");
    +00080     $a->name="sa";
    +00081     $a->value="rm_template";
    +00082     $r.=$a->IOValue();
    +00083     $r.=$a->Submit("rm_template","Effacer la sélection");
    +00084     $r.="</form></p>";
    +00085     return $r;
    +00086   }
    +
    +

    +

    @@ -286,7 +422,80 @@ none

    Definition at line 103 of file class_document_modele.php.

    -References $old_oid, $r, $ret, $Ret, $sql, Commit(), echo_debug(), echo_error(), ExecSql(), exit, FormatString(), isNumber(), md_id, name, NextSequence(), Rollback(), start, and StartSql(). +References $old_oid, $r, $ret, $Ret, $sql, Commit(), echo_debug(), echo_error(), ExecSql(), exit, FormatString(), isNumber(), md_id, name, NextSequence(), Rollback(), start, and StartSql().

    00104     {
    +00105       // if name is empty return immediately
    +00106       if ( trim(strlen($this->md_name))==0) 
    +00107         return;
    +00108       // Start transaction
    +00109       StartSql($this->cn);
    +00110       // Save data into the table invoice
    +00111       // if $this->md_id == -1 it means it is a new document model
    +00112       // so first we have to insert it
    +00113       // the name and the type must be set before calling save
    +00114       if ( $this->md_id == -1) 
    +00115         {
    +00116 
    +00117           // insert into the table document_modele
    +00118           $this->name=FormatString($this->md_name);
    +00119           $this->md_id=NextSequence($this->cn,'document_modele_md_id_seq');
    +00120           $sql=sprintf("insert into document_modele(md_id,md_name,md_type) 
    +00121                               values (%d,'%s',%d)",
    +00122                              $this->md_id,$this->name,$this->md_type);
    +00123           $Ret=ExecSql($this->cn,$sql);
    +00124           // create the sequence for this modele of document
    +00125           $this->md_sequence="document_".NextSequence($this->cn,"document_seq");
    +00126           // if start is not equal to 0 and he's a number than the user
    +00127           // request a number change
    +00128           echo_debug('class_document_modele',__LINE__, "this->start ".$this->start." a number ".isNumber($this->start));
    +00129 
    +00130           if ( $this->start != 0 && isNumber($this->start) == 1 )
    +00131             {
    +00132               $sql="alter sequence seq_doc_type_".$this->md_type." restart ".$this->start;
    +00133               ExecSql($this->cn,$sql);
    +00134             }
    +00135           
    +00136         }
    +00137       // Save the file
    +00138       $new_name=tempnam('/tmp','document_');
    +00139       echo_debug('class_document_modele.php',__LINE__,"new name=".$new_name);
    +00140       if ( strlen ($_FILES['doc']['tmp_name']) != 0 ) 
    +00141         {
    +00142           if (move_uploaded_file($_FILES['doc']['tmp_name'],
    +00143                                  $new_name)) 
    +00144             {
    +00145                     // echo "Image saved";
    +00146               $oid= pg_lo_import($this->cn,$new_name);
    +00147               if ( $oid == false ) 
    +00148                 {
    +00149                   echo_error('class_document_modele.php',__LINE__,"cannot upload document");
    +00150                   Rollback($cn);
    +00151                   return;
    +00152                 }
    +00153               echo_debug('class_document_modele.php',__LINE__,"Loading document");
    +00154               // Remove old document
    +00155               $ret=ExecSql($this->cn,"select md_lob from document_modele where md_id=".$this->md_id);
    +00156               if (pg_num_rows($ret) != 0) 
    +00157                 {
    +00158                   $r=pg_fetch_array($ret,0);
    +00159                   $old_oid=$r['md_lob'];
    +00160                   if (strlen($old_oid) != 0) 
    +00161                     pg_lo_unlink($this->cn,$old_oid);
    +00162                 }
    +00163               // Load new document
    +00164               ExecSql($this->cn,"update document_modele set md_lob=".$oid.", md_mimetype='".$_FILES['doc']['type']."' ,md_filename='".$_FILES['doc']['name']."' where md_id=".$this->md_id);
    +00165               Commit($this->cn);
    +00166             }
    +00167           else 
    +00168             {
    +00169               echo "<H1>Error</H1>";
    +00170               Rollback($this->cn);
    +00171               exit;
    +00172             }
    +00173         }
    +00174     }
    +
    +

    +


    Field Documentation

    @@ -466,8 +675,8 @@ Definition at line class_document_modele.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_document_modele.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classDocument__type.html b/doc/developper/html/classDocument__type.html index a92bf4386..be9194287 100644 --- a/doc/developper/html/classDocument__type.html +++ b/doc/developper/html/classDocument__type.html @@ -57,7 +57,13 @@ document_type
    Parameters:

    Definition at line 35 of file class_document_type.php.

    -References dt_id. +References dt_id.

    00036     {
    +00037       $this->db=$p_cn;
    +00038       $this->dt_id=-1;
    +00039     }
    +
    +

    +

    @@ -90,12 +96,21 @@ Get all the data for this dt_id.

    Definition at line 43 of file class_document_type.php.

    -References $r, $sql, dt_id, and ExecSql(). +References $r, $sql, dt_id, and ExecSql().

    00044     {
    +00045       $sql="select * from document_type where dt_id=".$this->dt_id;
    +00046       $R=ExecSql($this->db,$sql);
    +00047       $r=pg_fetch_array($R,0);
    +00048       $this->dt_id=$r['dt_id'];
    +00049       $this->dt_value=$r['dt_value'];
    +00050     }
    +
    +

    +


    The documentation for this class was generated from the following file: -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_document_type.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classOwn.html b/doc/developper/html/classOwn.html index 0a88bfea6..72447fa3c 100644 --- a/doc/developper/html/classOwn.html +++ b/doc/developper/html/classOwn.html @@ -58,7 +58,21 @@ Definition at line 28 Definition at line 31 of file class_own.php.

    -References $Res, $row, and ExecSql(). +References $Res, $row, and ExecSql().

    00031                       {
    +00032     $this->db=$p_cn;
    +00033     $Res=ExecSql($p_cn,"select * from parameter where pr_id like 'MY_%'");
    +00034     for ($i = 0;$i < pg_NumRows($Res);$i++) {
    +00035       $row=pg_fetch_array($Res,$i);
    +00036       $key=$row['pr_id'];
    +00037       $elt=$row['pr_value'];
    +00038       // store value here
    +00039       $this->{"$key"}=$elt;
    +00040     }
    +00041 
    +00042   }
    +
    +

    +


    Member Function Documentation

    @@ -92,7 +106,21 @@ save data

    Definition at line 62 of file class_own.php.

    -References MY_COMMUNE, MY_CP, MY_FAX, MY_NAME, MY_NUMBER, MY_PAYS, MY_STREET, MY_TEL, and MY_TVA. +References MY_COMMUNE, MY_CP, MY_FAX, MY_NAME, MY_NUMBER, MY_PAYS, MY_STREET, MY_TEL, and MY_TVA.

    00062                   {
    +00063     $this->UpdateRow('MY_NAME');
    +00064     $this->UpdateRow('MY_TVA');
    +00065     $this->UpdateRow('MY_STREET');
    +00066     $this->UpdateRow('MY_NUMBER');
    +00067     $this->UpdateRow('MY_CP');
    +00068     $this->UpdateRow('MY_TEL');
    +00069     $this->UpdateRow('MY_PAYS');
    +00070     $this->UpdateRow('MY_COMMUNE');
    +00071     $this->UpdateRow('MY_FAX');
    +00072 
    +00073   }
    +
    +

    +

    @@ -131,7 +159,13 @@ Update a row.

    Definition at line 51 of file class_own.php.

    -References FormatString(). +References FormatString().

    00051                               {
    +00052     $value=FormatString($this->{"$p_attr"});
    +00053     $Res=ExecSql($this->db,"update parameter set pr_value='$value' where pr_id='$p_attr'");
    +00054   }
    +
    +

    +


    Field Documentation

    @@ -161,8 +195,8 @@ Definition at line 29
    The documentation for this class was generated from the following file:
      -
    • /home/dany/developpement/phpcompta-dev/phpcompta/include/class_own.php
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_own.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/class_8ezpdf_8php-source.html b/doc/developper/html/class_8ezpdf_8php-source.html index 9fa43ebec..2d2e9e54e 100644 --- a/doc/developper/html/class_8ezpdf_8php-source.html +++ b/doc/developper/html/class_8ezpdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/class.ezpdf.php Source File +phpcompta: class.ezpdf.php Source File +html » addon

    class.ezpdf.php

    Go to the documentation of this file.
    00001 <?php
     00002 
     00003 include_once('class.pdf.php');
    @@ -679,8 +679,8 @@
     00670     ,'innerLineThickness'=>1,'outerLineThickness'=>1,'splitRows'=>0,'protectRows'=>1
     00671     );
     00672 
    -00673   foreach($defaults as $key=>$value){
    -00674     if (is_array($value)){
    +00673   foreach($defaults as $key=>$value){
    +00674     if (is_array($value)){
     00675       if (!isset($options[$key]) || !is_array($options[$key])){
     00676         $options[$key]=$value;
     00677       }
    @@ -1562,7 +1562,7 @@
     01553 
     01554 }
     01555 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/class_8ezpdf_8php.html b/doc/developper/html/class_8ezpdf_8php.html index e56eb4e7f..7dc159ded 100644 --- a/doc/developper/html/class_8ezpdf_8php.html +++ b/doc/developper/html/class_8ezpdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/class.ezpdf.php File Reference +phpcompta: class.ezpdf.php File Reference +html » addon

    class.ezpdf.php File Reference

    Go to the source code of this file. @@ -15,7 +15,7 @@
    class  Cezpdf
    -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/class_8pdf_8php-source.html b/doc/developper/html/class_8pdf_8php-source.html index e4719448b..90ea71538 100644 --- a/doc/developper/html/class_8pdf_8php-source.html +++ b/doc/developper/html/class_8pdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/class.pdf.php Source File +phpcompta: class.pdf.php Source File +html » addon

    class.pdf.php

    Go to the documentation of this file.
    00001 <?php
     00023 class Cpdf {
     00024 
    @@ -300,7 +300,7 @@
     00478   }
     00479   switch ($action){
     00480     case 'new':
    -00481       $this->objects[$id]=array('t'=>'font','info'=>array('name'=>$options['name'],'SubType'=>'Type1'));
    +00481       $this->objects[$id]=array('t'=>'font','info'=>array('name'=>$options['name'],'SubType'=>'Type1'));
     00482       $fontNum=$this->numFonts;
     00483       $this->objects[$id]['info']['fontNum']=$fontNum;
     00484       // deal with the encoding and the differences
    @@ -385,7 +385,7 @@
     00566       break;
     00567     case 'out':
     00568       $res="\n".$id." 0 obj\n<< /Type /FontDescriptor\n";
    -00569       foreach ($o['info'] as $label => $value){
    +00569       foreach ($o['info'] as $label => $value){
     00570         switch ($label){
     00571           case 'Ascent':
     00572           case 'CapHeight':
    @@ -400,7 +400,7 @@
     00581           case 'StemH':
     00582           case 'XHeight':
     00583           case 'CharSet':
    -00584             if (strlen($value)){
    +00584             if (strlen($value)){
     00585               $res.='/'.$label.' '.$value."\n";
     00586             }
     00587             break;
    @@ -1051,8 +1051,8 @@
     01314     $name=substr($font,$pos+1);
     01315   }
     01316 
    -01317   if (substr($name,-4)=='.afm'){
    -01318     $name=substr($name,0,strlen($name)-4);
    +01317   if (substr($name,-4)=='.afm'){
    +01318     $name=substr($name,0,strlen($name)-4);
     01319   }
     01320   $this->addMessage('openFont: '.$font.' - '.$name);
     01321   if (file_exists($dir.'php_'.$name.'.afm')){
    @@ -1153,10 +1153,10 @@
     01424       $pos=strrpos($fontName,'/');
     01425 //      $dir=substr($fontName,0,$pos+1);
     01426       $name=substr($fontName,$pos+1);
    -01427       if (substr($name,-4)=='.afm'){
    -01428         $name=substr($name,0,strlen($name)-4);
    +01427       if (substr($name,-4)=='.afm'){
    +01428         $name=substr($name,0,strlen($name)-4);
     01429       }
    -01430       $options=array('name'=>$name);
    +01430       $options=array('name'=>$name);
     01431       if (is_array($encoding)){
     01432         // then encoding and differences might be set
     01433         if (isset($encoding['encoding'])){
    @@ -2597,7 +2597,7 @@
     03073 } // end of class
     03074 
     03075 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/class_8pdf_8php.html b/doc/developper/html/class_8pdf_8php.html index 4c9bc6eaa..f440edaaa 100644 --- a/doc/developper/html/class_8pdf_8php.html +++ b/doc/developper/html/class_8pdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/class.pdf.php File Reference +phpcompta: class.pdf.php File Reference +html » addon

    class.pdf.php File Reference

    Go to the source code of this file. @@ -18,7 +18,7 @@
    class  Cpdf
    -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/class__action_8php-source.html b/doc/developper/html/class__action_8php-source.html index a5ca79224..fb52870f6 100644 --- a/doc/developper/html/class__action_8php-source.html +++ b/doc/developper/html/class__action_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_action.php Source File +phpcompta: class_action.php Source File +include

    class_action.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -34,645 +34,717 @@
     00025 require_once("user_common.php");
     00046 class action 
     00047 {
    -00061   var $db;
    -00062   var $ag_comment;
    -00063   var $ag_timestamp;
    -00064   var $dt_id;
    -00065   var $d_state;
    -00066   var $d_number;
    -00067   var $d_filename;
    -00068   var $d_mimetype;
    -00069   var $ag_title;
    -00070   var $f_id;
    -00071   var $ag_ref_ag_id;
    -00076   function action ($p_cn)
    -00077     {
    -00078       $this->db=$p_cn;
    -00079       $this->f_id=0;
    -00080 
    -00081     }
    -00082   //----------------------------------------------------------------------
    -00099   function Display($p_view,$p_gen) 
    -00100     {
    -00101       echo_debug('class_action',__LINE__,'Display()  :'.var_export($_POST,true));
    -00102       echo_debug('class_action',__LINE__,'Display $this  :'.var_export($this,true));
    -00103 
    -00104 
    -00105       if ( $p_view=='UPD')
    -00106         {
    -00107           $upd=true;    
    -00108           $readonly=false;
    -00109         }
    -00110       elseif ($p_view=="NEW")
    -00111         {
    -00112           $upd=false;
    -00113           $readonly=false;
    -00114         }
    -00115       elseif ($p_view=='READ')
    -00116         {
    -00117           $upd=true;
    -00118           $readonly=true;
    -00119         }
    -00120       else
    -00121         {
    -00122           exit('class_action'.__LINE__.'action::Display error unknown parameter'.$p_view);
    -00123 
    -00124         }
    -00125       // Compute the widget
    -00126       // Date 
    -00127       $date=new widget("text");
    -00128       $date->readonly=$readonly;
    -00129       $date->name="ag_timestamp";
    -00130       $date->value=$this->ag_timestamp;
    -00131       
    -00132       
    -00133       // for insert mode only
    -00134       if ( $upd == false )
    -00135         {
    -00136           // Doc Type
    -00137           $doc_type=new widget("select");
    -00138           $doc_type->name="dt_id";
    -00139           $doc_type->value=make_array($this->db,"select dt_id,dt_value from document_type where dt_id in (".ACTION.")");
    -00140           $doc_type->selected=$this->dt_id;
    -00141           $doc_type->readonly=false;
    -00142           $str_doc_type=$doc_type->IOValue();
    -00143           echo_debug('class_action',__LINE__,var_export($doc_type,true));
    -00144         }
    -00145       else {
    -00146         // Doc Type
    -00147         $doc_type=new widget("hidden");
    -00148         $doc_type->name="dt_id";
    -00149         $doc_type->value=$this->dt_id;
    -00150         $str_doc_type=$doc_type->IOValue()." ".getDbValue($this->db,"select dt_value from document_type where dt_id=".$this->dt_id);
    -00151       }
    -00152 
    -00153       // Description
    -00154       $desc=new widget('RICHTEXT');
    -00155       $desc->width=500;
    -00156       $desc->heigh=250;
    -00157       $desc->name="ag_comment";
    -00158       $desc->readonly=$readonly;
    -00159       $desc->value=urldecode($this->ag_comment);
    -00160 
    -00161       // state
    -00162       // Retrieve the value
    -00163       if ( $p_view != 'READ' )
    -00164         {
    -00165           $a=make_array($this->db,"select s_id,s_value from document_state ");
    -00166           $state=new widget("select");
    -00167           $state->readonly=$readonly;
    -00168           $state->name="d_state";
    -00169           $state->value=$a;
    -00170           $state->selected=$this->d_state;
    -00171           $str_state=$state->IOValue();
    -00172         } else {
    -00173           $str_state=getDbValue($this->db,"select s_value from document_state where s_id=".$this->d_state);
    -00174           $g=new widget("hidden");
    -00175           $str_state.=$g->IOValue('d_state',$this->d_state);
    -00176         }
    -00177       // Retrieve the value if there is an attached doc
    -00178       $doc_ref="";
    -00179       // Document id
    -00180 
    -00181       $h2=new widget("hidden");
    -00182       $h2->name="d_id";
    -00183       $h2->value=$this->d_id;
    -00184       
    -00185       if ( $this->d_id != 0 && $this->d_id != "" )
    -00186         {
    -00187           $h2->readonly=($p_view=='NEW')?false:true;
    -00188           $doc=new Document($this->db,$this->d_id);
    -00189           $d_id=new widget("hidden");
    -00190           $doc_ref="<p> Document ".$doc->a_ref().'</p>';
    -00191           $doc_ref.=$h2->IOValue().$d_id->IOValue('d_id',$this->d_id);
    -00192           
    -00193         }
    -00194 
    -00195 
    -00196       // title
    -00197       $title=new widget("text");
    -00198       $title->readonly=$readonly;
    -00199       $title->name="ag_title";
    -00200       $title->value=FormatString($this->ag_title);
    -00201 
    -00202       // ag_ref
    -00203       // Always false for update
    -00204       $ag_ref=new widget("text");
    -00205       $ag_ref->readonly=true;
    -00206       $ag_ref->name="ag_ref";
    -00207       $ag_ref->value=FormatString($this->ag_ref);
    -00208       $client_label=new widget("span");
    -00209 
    -00210       // f_id
    -00211       if ( $this->qcode != '- ERROR -' && trim($this->qcode) != "")
    -00212         {
    -00213           $tiers=new fiche($this->db);
    -00214           $tiers->GetByQCode($this->qcode);
    -00215           $qcode_label=$tiers->strAttribut(1);
    -00216         } else {
    -00217           echo "f_id $this->f_id";
    -00218           $qcode_label=($this->f_id==0 || trim($this->qcode)=="")?'Interne ':'Error';
    -00219         }
    -00220       $h_ag_id=new widget("hidden");
    -00221       // if concerns another action : show the link otherwise nothing
    -00222       $lag_ref_ag_id="";
    -00223       
    -00224       if ( $this->ag_ref_ag_id != 0 )
    -00225         {
    -00226           $lag_ref_ag_id='<a class="mtitle" href="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.
    -00227             $this->ag_ref_ag_id.'">'.
    -00228             $this->GetAgRef("ag_ref_ag_id")."</A>";
    -00229         }  
    -00230 
    -00231       $w=new widget('js_search_only');
    -00232       $w->readonly=$readonly;
    -00233       $w->name='qcode';
    -00234       $w->value=($this->f_id != 0)?$this->qcode:"";
    -00235       $w->label="";
    -00236       $w->extra='4,8,9,14,16';
    -00237       $sp= new widget("span");
    -00238       $h_agrefid=new widget('hidden');
    -00239 
    -00240       // Preparing the return string
    -00241       $r="";
    -00242       $r.=JS_SEARCH_CARD;
    -00243       $r.= "<p>Date : ".$date->IOValue()." Reference  ". $this->ag_ref."</p>";
    -00244       $r.="<p>Concerne :".$lag_ref_ag_id."</p>";
    -00245       $r.= '<p>Type d\' action';
    -00246       echo_debug('class_action',__LINE__,"str_doc_type $str_doc_type");
    -00247       $r.= $str_doc_type."</p>";
    -00248 
    -00249       // state
    -00250       $r.="<p>Etat :".$str_state;
    -00251 
    -00252 
    -00253       $r.= "</p><p> ";
    -00254       $r.=$w->IOValue();
    -00255       $r.=$sp->IOValue('qcode_label',$qcode_label)."</TD></TR>";
    -00256 
    -00257       $r.="</p>";
    -00258       echo_debug('class_action',__LINE__,' ag_id is '.$this->ag_id);
    -00259 
    -00260       $r.= "<p> Titre : ".$title->IOValue().' Ref :'.$ag_ref->IOValue();
    -00261       $r.= $doc_ref;
    -00262       $r.= "<p>Description :".$desc->IOValue()."</p>";
    -00263 
    -00264       //hidden
    -00265       $r.="<p>";
    -00266       $r.=$h2->IOValue();
    -00267       $r.=$h_agrefid->IOValue("ag_ref_ag_id",$this->ag_ref_ag_id); 
    -00268       $r.=$h_ag_id->IOValue('ag_id',$this->ag_id);
    -00269       $r.="</p>";
    -00270 
    -00271       // show the list of the concern operation
    -00272       if ( CountSql($this->db,'select * from action_gestion where ag_ref_ag_id!=0 and ag_ref_ag_id='.$this->ag_id.' limit 5') >0 )
    -00273         $r.=$this->myList(ACTION," and ag_ref_ag_id=".$this->ag_id);
    -00274       return $r;
    -00275  
    -00276     }
    -00277   //----------------------------------------------------------------------
    -00280   function get()
    -00281     {
    -00282       echo_debug('class_action',__LINE__,'Action::Get() ');
    -00283       $sql="select ag_id, ag_comment,to_char (ag_timestamp,'DD-MM-YYYY') as ag_timestamp,".
    -00284         " f_id,ag_title,ag_comment,ag_ref,d_id,ag_type,d_state,  ".
    -00285         " ag_ref_ag_id ".
    -00286         " from action_gestion left join document using (ag_id) where ag_id=".$this->ag_id;
    -00287       $r=ExecSql($this->db,$sql);
    -00288       $row=pg_fetch_all($r);
    -00289       if ( $row==false) return;
    -00290       $this->ag_comment=$row[0]['ag_comment'];
    -00291       $this->ag_timestamp=$row[0]['ag_timestamp'];
    -00292       $this->f_id=$row[0]['f_id'];
    -00293       $this->ag_title=$row[0]['ag_title'];
    -00294       $this->ag_type=$row[0]['ag_type'];
    -00295       $this->ag_ref=$row[0]['ag_ref'];
    -00296       $this->ag_ref_ag_id=$row[0]['ag_ref_ag_id'];
    -00297       $this->d_id=$row[0]['d_id'];
    -00298       //
    -00299       echo_debug('class_action',__LINE__,' Document id = '.$this->d_id);
    -00300       // if there is no document set 0 to d_id
    -00301       if ( $this->d_id == "" ) 
    -00302         $this->d_id=0;
    -00303       // if there is a document fill the object
    -00304       if ($this->d_id != 0 )
    -00305         {
    -00306           $this->state=$row['0']['d_state'];
    -00307           $this->d_state=$row[0]['d_state'];
    -00308         }
    -00309       echo_debug('class_action',__LINE__,' After test Document id = '.$this->d_id);
    -00310       $this->dt_id=$this->ag_type;
    -00311       $a=new fiche($this->db,$this->f_id);
    -00312       $this->qcode=$a->strAttribut(ATTR_DEF_QUICKCODE);
    -00313       echo_debug('class_action',__LINE__,'Detail end ()  :'.var_export($_POST,true));
    -00314       echo_debug('class_action',__LINE__,'Detail $this  :'.var_export($this,true));
    -00315 
    -00316     }
    -00325   function Confirm()
    -00326     {
    -00327       echo_debug('class_action',__LINE__,'confirm()  :'.var_export($_POST,true));
    -00328       echo_debug('class_action',__LINE__,'confirm $this  :'.var_export($this,true));
    -00330       if ( isDate($this->ag_timestamp) == null )
    -00331         {
    -00332           // if the date is invalid, default date is today
    -00333           $this->ag_timestamp=date("d.m.Y");
    -00334         }
    -00335       // Compute the widget
    -00336       // Date 
    -00337       $date=new widget("text");
    -00338       $date->readonly=true;
    -00339       $date->name="ag_timestamp";
    -00340       $date->value=$this->ag_timestamp;
    -00341       // Doc Type
    -00342       $doc_type=new widget("hidden");
    -00343       $doc_type->name="dt_id";
    -00344       $doc_type->value=$this->dt_id;
    -00345       $a=ExecSql($this->db,"select dt_value from document_type where dt_id=".$this->dt_id);
    -00346       $v=pg_fetch_array($a,0);
    -00347       $str_type=$v[0];
    -00348       if ( isset ($_REQUEST['url'])) 
    -00349         {
    -00350           $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
    -00351           $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
    -00352         }
    -00353       else 
    -00354         { 
    -00355           $retour="";
    -00356           $h_url="";
    -00357         }
    -00358 
    -00359       // state
    -00360       $a=ExecSql($this->db,"select s_value from document_state where s_id=".$this->d_state);
    -00361       $v=pg_fetch_array($a,0);
    -00362       $str_state=$v[0];
    -00363       $state=new widget("hidden");
    -00364       $state->name="d_state";
    -00365       $state->value=$this->d_state;
    -00366         
    -00367       // title
    -00368       $title=new widget("text");
    -00369       $title->readonly=true;
    -00370       $title->name="ag_title";
    -00371       $title->value=FormatString($this->ag_title);
    -00372 
    -00373       // Description
    -00374       $desc=new widget('textarea');
    -00375       $desc->name="ag_comment";
    -00376       $desc->readonly=" disabled ";
    -00377       $desc->value=$this->ag_comment;
    -00378       // Propose to generate a document
    -00379       $gen=new widget ("checkbox");
    -00380       $gen->name="p_gen";
    -00381       $doc_gen=new widget("select");
    -00382       $doc_gen->name="gen_doc";
    -00383       $doc_gen->value=make_array($this->db,
    -00384                                  "select md_id,md_name from document_modele where md_type=".$this->dt_id);
    -00385 
    -00386       $h_agrefid=new widget('hidden');
    -00387 
    -00388       // f_id
    -00389       if ( trim($this->qcode) =="" && $this->dt_id==1)
    -00390         {
    -00391           // internal document
    -00392           $f_id=0; // internal document
    -00393           $name="interne";
    -00394         }
    -00395       elseif ( trim($this->qcode) !="" && $this->dt_id != 1 )
    -00396         {
    -00397           $tiers=new fiche($this->db);
    -00398           $tiers->GetByQCode($this->qcode);
    -00399           $f_id=$tiers->id;
    -00400           $name=$tiers->strAttribut(1);
    -00401         }
    -00402       else {
    -00403         $name="ERROR";
    -00404         $f_id=-1;
    -00405       }
    -00406 
    -00407       // Preparing the return string
    -00408       $r=$retour."<form method=\"post\">";
    -00409       $r.="<p>Date : ".$date->IOValue()."</p>";
    -00410       $r.="<p>Etat $str_state".$state->IOValue()."</p>";
    -00411       $r.="<p>Type du document $str_type".$doc_type->IOValue()."</p>";
    -00412       $r.="<p> Tiers : ".$this->qcode." ".$name.'</p>';
    -00413       $r.="<p> Titre : ".$title->IOValue();
    -00414       $r.="<p>Description :".$desc->IOValue()."</p>";
    -00415 
    -00416       // if no document exist for this type then do not display the question
    -00417       if ( sizeof($doc_gen->value) != 0) 
    -00418         $r.="<p> G&eacute;n&eacute;rer un document ".$gen->IOValue()." ".$doc_gen->IOValue()."</p>";
    -00419         
    +00063   var $db;
    +00064   var $ag_comment;
    +00065   var $ag_timestamp;
    +00066   var $dt_id;
    +00067   var $d_state;
    +00068   var $d_number;
    +00069   var $d_filename;
    +00070   var $d_mimetype;
    +00071   var $ag_title;
    +00072   var $f_id;
    +00073   var $ag_ref_ag_id;
    +00078   function action ($p_cn)
    +00079     {
    +00080       $this->db=$p_cn;
    +00081       $this->f_id=0;
    +00082 
    +00083     }
    +00084   //----------------------------------------------------------------------
    +00101   function Display($p_view,$p_gen) 
    +00102     {
    +00103       echo_debug('class_action',__LINE__,'Display()  :'.var_export($_POST,true));
    +00104       echo_debug('class_action',__LINE__,'Display $this  :'.var_export($this,true));
    +00105 
    +00106 
    +00107       if ( $p_view=='UPD')
    +00108         {
    +00109           $upd=true;    
    +00110           $readonly=false;
    +00111         }
    +00112       elseif ($p_view=="NEW")
    +00113         {
    +00114           $upd=false;
    +00115           $readonly=false;
    +00116         }
    +00117       elseif ($p_view=='READ')
    +00118         {
    +00119           $upd=true;
    +00120           $readonly=true;
    +00121         }
    +00122       else
    +00123         {
    +00124           exit('class_action'.__LINE__.'action::Display error unknown parameter'.$p_view);
    +00125 
    +00126         }
    +00127       // Compute the widget
    +00128       // Date 
    +00129       $date=new widget("text");
    +00130       $date->readonly=$readonly;
    +00131       $date->name="ag_timestamp";
    +00132       $date->value=$this->ag_timestamp;
    +00133       
    +00134       
    +00135       // for insert mode only
    +00136       if ( $upd == false )
    +00137         {
    +00138           // Doc Type
    +00139           $doc_type=new widget("select");
    +00140           $doc_type->name="dt_id";
    +00141           $doc_type->value=make_array($this->db,"select dt_id,dt_value from document_type where dt_id in (".ACTION.")");
    +00142           $doc_type->selected=$this->dt_id;
    +00143           $doc_type->readonly=false;
    +00144           $str_doc_type=$doc_type->IOValue();
    +00145           echo_debug('class_action',__LINE__,var_export($doc_type,true));
    +00146         }
    +00147       else {
    +00148         // Doc Type
    +00149         $doc_type=new widget("hidden");
    +00150         $doc_type->name="dt_id";
    +00151         $doc_type->value=$this->dt_id;
    +00152         $str_doc_type=$doc_type->IOValue()." ".getDbValue($this->db,"select dt_value from document_type where dt_id=".$this->dt_id);
    +00153       }
    +00154 
    +00155       // Description
    +00156       $desc=new widget('RICHTEXT');
    +00157       $desc->width=500;
    +00158       $desc->heigh=250;
    +00159       $desc->name="ag_comment";
    +00160       $desc->readonly=$readonly;
    +00161       $desc->value=urldecode($this->ag_comment);
    +00162 
    +00163       // state
    +00164       // Retrieve the value
    +00165       if ( $p_view != 'READ' )
    +00166         {
    +00167           $a=make_array($this->db,"select s_id,s_value from document_state ");
    +00168           $state=new widget("select");
    +00169           $state->readonly=$readonly;
    +00170           $state->name="d_state";
    +00171           $state->value=$a;
    +00172           $state->selected=$this->d_state;
    +00173           $str_state=$state->IOValue();
    +00174         } else {
    +00175           $str_state=getDbValue($this->db,"select s_value from document_state where s_id=".$this->d_state);
    +00176           $g=new widget("hidden");
    +00177           $str_state.=$g->IOValue('d_state',$this->d_state);
    +00178         }
    +00179       // Retrieve the value if there is an attached doc
    +00180       $doc_ref="";
    +00181       // Document id
    +00182 
    +00183       $h2=new widget("hidden");
    +00184       $h2->name="d_id";
    +00185       $h2->value=$this->d_id;
    +00186       
    +00187       if ( $this->d_id != 0 && $this->d_id != "" )
    +00188         {
    +00189           $h2->readonly=($p_view=='NEW')?false:true;
    +00190           $doc=new Document($this->db,$this->d_id);
    +00191           $d_id=new widget("hidden");
    +00192           $doc_ref="<p> Document ".$doc->a_ref().'</p>';
    +00193           $doc_ref.=$h2->IOValue().$d_id->IOValue('d_id',$this->d_id);
    +00194           
    +00195         }
    +00196 
    +00197 
    +00198       // title
    +00199       $title=new widget("text");
    +00200       $title->readonly=$readonly;
    +00201       $title->name="ag_title";
    +00202       $title->value=FormatString($this->ag_title);
    +00203 
    +00204       // ag_ref
    +00205       // Always false for update
    +00206       $ag_ref=new widget("text");
    +00207       $ag_ref->readonly=true;
    +00208       $ag_ref->name="ag_ref";
    +00209       $ag_ref->value=FormatString($this->ag_ref);
    +00210       $client_label=new widget("span");
    +00211 
    +00212       // f_id_dest destination
    +00213       if ( $this->qcode_dest != '- ERROR -' && trim($this->qcode_dest) != "")
    +00214         {
    +00215           $tiers=new fiche($this->db);
    +00216           $tiers->GetByQCode($this->qcode_dest);
    +00217           $qcode_dest_label=$tiers->strAttribut(1);
    +00218         } else {
    +00219           //      echo "f_id $this->f_id";
    +00220           $qcode_dest_label=($this->f_id==0 || trim($this->qcode_dest)=="")?'Interne ':'Error';
    +00221         }
    +00222       // f_id_exp sender
    +00223       if ( $this->qcode_exp != '- ERROR -' && trim($this->qcode_exp) != "")
    +00224         {
    +00225           $tiers=new fiche($this->db);
    +00226           $tiers->GetByQCode($this->qcode_exp);
    +00227           $qcode_exp_label=$tiers->strAttribut(1);
    +00228         } else {
    +00229           echo "f_id $this->f_id";
    +00230           $qcode_exp_label=($this->f_id_exp==0 || trim($this->qcode_exp)=="")?'Interne ':'Error';
    +00231         }
    +00232 
    +00233       $h_ag_id=new widget("hidden");
    +00234       // if concerns another action : show the link otherwise nothing
    +00235       $lag_ref_ag_id="";
    +00236       
    +00237       if ( $this->ag_ref_ag_id != 0 )
    +00238         {
    +00239     //      $this->GetAgRef("ag_ref_ag_id")."</A>";
    +00240 
    +00241           $lag_ref_ag_id='<a class="mtitle" href="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.
    +00242             $this->ag_ref_ag_id.'">'.
    +00243             $this->getDBValue($this->db,"select ag_ref from action_gestion where ag_id=".$this->ag_ref_ag_id).
    +00244             "</A>";
    +00245         }  
    +00246       // sender
    +00247       $w=new widget('js_search_only');
    +00248       $w->readonly=$readonly;
    +00249       $w->name='qcode_exp';
    +00250       $w->value=($this->f_id_exp != 0)?$this->qcode_exp:"";
    +00251       $w->label="";
    +00252       $w->extra='4,8,9,14,16';
    +00253       $sp= new widget("span");
    +00254       $h_agrefid=new widget('hidden');
    +00255       // destination
    +00256       $wdest=new widget('js_search_only');
    +00257       $wdest->readonly=$readonly;
    +00258       $wdest->name='qcode_dest';
    +00259       $wdest->value=($this->f_id_dest != 0)?$this->qcode_dest:"";
    +00260       $wdest->label="";
    +00261       $wdest->extra='4,8,9,14,16';
    +00262       $spdest= new widget("span");
    +00263       $h_agrefid=new widget('hidden');
    +00264 
    +00265       // Preparing the return string
    +00266       $r="";
    +00267       $r.=JS_SEARCH_CARD;
    +00268       $r.= "<p>Date : ".$date->IOValue()." Reference  ". $this->ag_ref."</p>";
    +00269       $r.="<p>Concerne :".$lag_ref_ag_id."</p>";
    +00270       $r.= '<p>Type d\' action';
    +00271       echo_debug('class_action',__LINE__,"str_doc_type $str_doc_type");
    +00272       $r.= $str_doc_type."</p>";
    +00273 
    +00274       // state
    +00275       $r.="<p>Etat :".$str_state;
    +00276 
    +00277 
    +00278       $r.= "</p><p> ";
    +00279       $r.=$w->IOValue();
    +00280       $r.=$sp->IOValue('qcode_exp_label',$qcode_exp_label)."</TD></TR>";
    +00281  
    +00282       $r.=$wdest->IOValue();
    +00283       $r.=$spdest->IOValue('qcode_dest_label',$qcode_dest_label)."</TD></TR>";
    +00284 
    +00285 
    +00286       $r.="</p>";
    +00287       echo_debug('class_action',__LINE__,' ag_id is '.$this->ag_id);
    +00288 
    +00289       $r.= "<p> Titre : ".$title->IOValue().' Ref :'.$ag_ref->IOValue();
    +00290       $r.= $doc_ref;
    +00291       $r.= "<p>Description :".$desc->IOValue()."</p>";
    +00292 
    +00293       //hidden
    +00294       $r.="<p>";
    +00295       $r.=$h2->IOValue();
    +00296       $r.=$h_agrefid->IOValue("ag_ref_ag_id",$this->ag_ref_ag_id); 
    +00297       $r.=$h_ag_id->IOValue('ag_id',$this->ag_id);
    +00298       $r.="</p>";
    +00299 
    +00300       // show the list of the concern operation
    +00301       if ( CountSql($this->db,'select * from action_gestion where ag_ref_ag_id!=0 and ag_ref_ag_id='.$this->ag_id);
    +00302         $r.=$this->myList(ACTION," and ag_ref_ag_id=".$this->ag_id);
    +00303       return $r;
    +00304  
    +00305     }
    +00306   //----------------------------------------------------------------------
    +00309   function get()
    +00310     {
    +00311       echo_debug('class_action',__LINE__,'Action::Get() ');
    +00312       $sql="select ag_id, ag_comment,to_char (ag_timestamp,'DD-MM-YYYY') as ag_timestamp,".
    +00313         " f_id_dest,f_id_exp,ag_title,ag_comment,ag_ref,d_id,ag_type,d_state,  ".
    +00314         " ag_ref_ag_id ".
    +00315         " from action_gestion left join document using (ag_id) where ag_id=".$this->ag_id;
    +00316       $r=ExecSql($this->db,$sql);
    +00317       $row=pg_fetch_all($r);
    +00318       if ( $row==false) return;
    +00319       $this->ag_comment=$row[0]['ag_comment'];
    +00320       $this->ag_timestamp=$row[0]['ag_timestamp'];
    +00321       $this->f_id_dest=$row[0]['f_id_dest'];
    +00322       $this->f_id_exp=$row[0]['f_id_exp'];
    +00323       $this->ag_title=$row[0]['ag_title'];
    +00324       $this->ag_type=$row[0]['ag_type'];
    +00325       $this->ag_ref=$row[0]['ag_ref'];
    +00326       $this->ag_ref_ag_id=$row[0]['ag_ref_ag_id'];
    +00327       $this->d_id=$row[0]['d_id'];
    +00328       //
    +00329       echo_debug('class_action',__LINE__,' Document id = '.$this->d_id);
    +00330       // if there is no document set 0 to d_id
    +00331       if ( $this->d_id == "" ) 
    +00332         $this->d_id=0;
    +00333       // if there is a document fill the object
    +00334       if ($this->d_id != 0 )
    +00335         {
    +00336           $this->state=$row['0']['d_state'];
    +00337           $this->d_state=$row[0]['d_state'];
    +00338         }
    +00339       echo_debug('class_action',__LINE__,' After test Document id = '.$this->d_id);
    +00340       $this->dt_id=$this->ag_type;
    +00341       $adest=new fiche($this->db,$this->f_id_dest);
    +00342       $this->qcode_dest=$adest->strAttribut(ATTR_DEF_QUICKCODE);
    +00343       $aexp=new fiche($this->db,$this->f_id_exp);
    +00344       $this->qcode_exp=$aexp->strAttribut(ATTR_DEF_QUICKCODE);
    +00345 
    +00346       echo_debug('class_action',__LINE__,'Detail end ()  :'.var_export($_POST,true));
    +00347       echo_debug('class_action',__LINE__,'Detail $this  :'.var_export($this,true));
    +00348 
    +00349     }
    +00358   function Confirm()
    +00359     {
    +00360       echo_debug('class_action',__LINE__,'confirm()  :'.var_export($_POST,true));
    +00361       echo_debug('class_action',__LINE__,'confirm $this  :'.var_export($this,true));
    +00363       if ( isDate($this->ag_timestamp) == null )
    +00364         {
    +00365           // if the date is invalid, default date is today
    +00366           $this->ag_timestamp=date("d.m.Y");
    +00367         }
    +00368       // Compute the widget
    +00369       // Date 
    +00370       $date=new widget("text");
    +00371       $date->readonly=true;
    +00372       $date->name="ag_timestamp";
    +00373       $date->value=$this->ag_timestamp;
    +00374       // Doc Type
    +00375       $doc_type=new widget("hidden");
    +00376       $doc_type->name="dt_id";
    +00377       $doc_type->value=$this->dt_id;
    +00378       $a=ExecSql($this->db,"select dt_value from document_type where dt_id=".$this->dt_id);
    +00379       $v=pg_fetch_array($a,0);
    +00380       $str_type=$v[0];
    +00381       if ( isset ($_REQUEST['url'])) 
    +00382         {
    +00383           $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
    +00384           $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
    +00385         }
    +00386       else 
    +00387         { 
    +00388           $retour="";
    +00389           $h_url="";
    +00390         }
    +00391 
    +00392       // state
    +00393       $a=ExecSql($this->db,"select s_value from document_state where s_id=".$this->d_state);
    +00394       $v=pg_fetch_array($a,0);
    +00395       $str_state=$v[0];
    +00396       $state=new widget("hidden");
    +00397       $state->name="d_state";
    +00398       $state->value=$this->d_state;
    +00399         
    +00400       // title
    +00401       $title=new widget("text");
    +00402       $title->readonly=true;
    +00403       $title->name="ag_title";
    +00404       $title->value=FormatString($this->ag_title);
    +00405 
    +00406       // Description
    +00407       $desc=new widget('textarea');
    +00408       $desc->name="ag_comment";
    +00409       $desc->readonly=" disabled ";
    +00410       $desc->value=$this->ag_comment;
    +00411       // Propose to generate a document
    +00412       $gen=new widget ("checkbox");
    +00413       $gen->name="p_gen";
    +00414       $doc_gen=new widget("select");
    +00415       $doc_gen->name="gen_doc";
    +00416       $doc_gen->value=make_array($this->db,
    +00417                                  "select md_id,md_name from document_modele where md_type=".$this->dt_id);
    +00418 
    +00419       $h_agrefid=new widget('hidden');
     00420 
    -00421       // Add the hidden tag
    -00422       $r.='<input type="hidden" name="sa" value="save_action_st2">';
    -00423       $r.='<input type="hidden" name="p_action" value="suivi_courrier">';
    -00424       $r.='<input type="hidden" name="tiers" value="'.$this->qcode.'">';
    -00425       $r.=      $h_agrefid->IOValue("ag_ref_ag_id",$this->ag_ref_ag_id);
    -00426         
    -00427       // retrieve customer
    -00428 
    -00429 
    -00430       if ( $f_id != -1 )
    -00431         $r.=$desc->Submit("Save","Sauve");
    -00432       $r.=$desc->Submit("corr","Corrige");
    -00433 
    -00434       $r.=$h_url."</form>";
    -00435       return $r;
    -00436     }
    -00444   function SaveStage2() 
    -00445     {
    -00446       echo_debug('class_action',__LINE__,'saveStage2()  :'.var_export($_POST,true));
    -00447       echo_debug('class_action',__LINE__,' saveStage2()  $this  :'.var_export($this,true));
    -00448 
    -00449       // Get The sequence id, 
    -00450       $seq_name="seq_doc_type_".$this->dt_id;
    -00451       $str_file="";
    -00452       $add_file='';
    -00453       // f_id
    -00454       $tiers=new fiche($this->db);
    -00455       $tiers->GetByQCode($this->qcode);
    -00456       if ( trim($this->ag_title) == "") 
    -00457         {
    -00458           $doc_mod=new document_type($this->db);
    -00459           $doc_mod->dt_id=$this->dt_id;
    -00460           $doc_mod->get();
    -00461           $this->ag_title=$doc_mod->dt_value;
    -00462         }
    -00463       echo_debug('class_action',__LINE__," tiers->id  ".$tiers->id);
    -00464       $this->ag_id=NextSequence($this->db,'action_gestion_ag_id_seq');
    -00465       // Create the reference 
    -00466       $ref=$this->dt_id.'/'.$this->ag_id;
    -00467       $this->ag_ref=$ref;
    -00470       //we remove newline 
    -00471       $this->ag_comment=str_replace("+%OA+","",$this->ag_comment);
    -00472       $this->ag_comment=str_replace("+%OD+","",$this->ag_comment);
    -00473       $this->ag_comment=str_replace("%OD","",$this->ag_comment);
    -00474       $this->ag_comment=str_replace("%OA","",$this->ag_comment);
    -00475       // save into the database
    -00476       $sql=sprintf("insert into action_gestion(ag_id,ag_timestamp,ag_type,ag_title,f_id,ag_comment,ag_ref,ag_ref_ag_id) ".
    -00477                    " values (%d,to_date('%s','DD-MM-YYYY'),'%d','%s',%d,'%s','%s',%d)",
    -00478                    $this->ag_id,
    -00479                    $this->ag_timestamp,
    -00480                    $this->dt_id,
    -00481                    FormatString($this->ag_title),
    -00482                    $tiers->id,
    -00483                    $this->ag_comment,
    -00484                    $ref,
    -00485                    $this->ag_ref_ag_id
    -00486                    );
    -00487       ExecSql($this->db,$sql);
    -00488 
    -00489 
    -00490 
    -00491       // the lob filename and the mimetype needed if we want to generate a doc.
    -00492       if ( $this->gen == 'on' ) 
    -00493         {
    -00494           $doc=new Document($this->db);
    -00495           $doc->f_id=$tiers->id;
    -00496           $doc->md_id=$this->md_id;
    -00497           $doc->ag_id=$this->ag_id;
    -00498           $doc->d_state=$this->d_state;
    -00499           $str_file=$doc->Generate();
    -00500           $d='<input type="hidden" name="d_id" value="'.$doc->d_id.'">';
    -00501         }
    -00502       $r="";
    -00503       // readonly and upload of a file
    -00504       $r.="<hr>";
    -00505       $r.='<form enctype="multipart/form-data" method="post">';
    -00506       $r.=$this->Display('READ',false);
    -00507       // Add the hidden tag
    -00508       $r.='<input type="hidden" name="sa" value="save_action_st3">';
    -00509       $r.='<input type="hidden" name="p_action" value="suivi_courrier">';
    -00510       // add the d_id
    -00511       $r.='<input type="hidden" name="d_id" value="'.$this->d_id.'">'; 
    -00512       // ag_comment must be saved in urlcode
    -00513       $r.='<input type="hidden" name="ag_comment" value="'.urlencode($this->ag_comment).'">';
    -00514       // Value for the generated document
    -00515       if ( $this->gen == 'on' ) 
    -00516         {
    -00517           $r.='<input type="hidden" name="d_id" value="'.$doc->d_id.'">';
    -00518           $r.="Sauver le document généré :";
    -00519           $r.=$str_file;
    -00520           $checkbox=new widget("checkbox");
    -00521           $checkbox->name="save_generate";
    -00522           $r.=$checkbox->IOValue();
    -00523           $r.="<hr>";
    -00524         }
    -00525       $upload=new widget("file");
    -00526       $upload->name="file_upload";
    -00527       $upload->value="";
    -00528       $r.="Enregistrer le fichier ".$upload->IOValue();
    -00529       $r.=$upload->Submit("save","Sauve le fichier");
    -00530       $r.="</form>";
    -00531       return $r;
    -00532     }
    -00538   function SaveStage3($d_id) 
    -00539     {
    -00540       echo_debug('class_action',__LINE__,'SaveStage3()  :'.var_export($_POST,true));
    -00541       echo_debug('class_action',__LINE__,'SaveStage3  :'.var_export($this,true));
    +00421        // f_id
    +00422        if ( trim($this->qcode_dest) =="")
    +00423          {
    +00424            // internal document
    +00425            $f_id_dest=0; // internal document
    +00426            $namedest="interne";
    +00427          }
    +00428        else // ( trim($this->qcode_dest) !=""  )
    +00429          {
    +00430            $tiers=new fiche($this->db);
    +00431            $tiers->GetByQCode($this->qcode_dest);
    +00432            $f_id=$tiers->id;
    +00433            $namedest=$tiers->strAttribut(1);
    +00434                 if ( $namedest == '- ERROR  -') $this->f_id_dest=-1;    
    +00435          }
    +00436  
    +00437        // f_id
    +00438        if ( trim($this->qcode_exp) =="")
    +00439          {
    +00440            // internal document
    +00441            $f_id_exp=0; // internal document
    +00442            $nameexp="interne";
    +00443          }
    +00444        else // ( trim($this->qcode_exp) !=""  )
    +00445          {
    +00446            $tiers=new fiche($this->db);
    +00447            $tiers->GetByQCode($this->qcode_exp);
    +00448            $f_id=$tiers->id;
    +00449            $nameexp=$tiers->strAttribut(1);
    +00450                 if ( $nameexp == '- ERROR  -') $this->f_id_exp=-1;      
    +00451          }
    +00452  
    +00453 
    +00454 
    +00455       // Preparing the return string
    +00456       $r=$retour."<form method=\"post\">";
    +00457       $r.="<p>Date : ".$date->IOValue()."</p>";
    +00458       $r.="<p>Etat $str_state".$state->IOValue()."</p>";
    +00459       $r.="<p>Type du document $str_type".$doc_type->IOValue()."</p>";
    +00460       $r.="<p> Expediteur : ".$this->qcode_exp." ".$nameexp.'</p>';
    +00461       $r.="<p> Destinataire : ".$this->qcode_dest." ".$namedest.'</p>';
    +00462       $r.="<p> Titre : ".$title->IOValue();
    +00463       $r.="<p>Description :".$desc->IOValue()."</p>";
    +00464 
    +00465       // if no document exist for this type then do not display the question
    +00466       if ( sizeof($doc_gen->value) != 0) 
    +00467         $r.="<p> G&eacute;n&eacute;rer un document ".$gen->IOValue()." ".$doc_gen->IOValue()."</p>";
    +00468         
    +00469 
    +00470       // Add the hidden tag
    +00471       $r.='<input type="hidden" name="sa" value="save_action_st2">';
    +00472       $r.='<input type="hidden" name="p_action" value="suivi_courrier">';
    +00473       $r.='<input type="hidden" name="tiers" value="'.$this->qcode_dest.'">';
    +00474       $r.=      $h_agrefid->IOValue("ag_ref_ag_id",$this->ag_ref_ag_id);
    +00475         
    +00476       // retrieve customer
    +00477 
    +00478 
    +00479       if ( $f_id != -1 )
    +00480         $r.=$desc->Submit("Save","Sauve");
    +00481       $r.=$desc->Submit("corr","Corrige");
    +00482 
    +00483       $r.=$h_url."</form>";
    +00484       return $r;
    +00485     }
    +00493   function SaveStage2() 
    +00494     {
    +00495       echo_debug('class_action',__LINE__,'saveStage2()  :'.var_export($_POST,true));
    +00496       echo_debug('class_action',__LINE__,' saveStage2()  $this  :'.var_export($this,true));
    +00497 
    +00498       // Get The sequence id, 
    +00499       $seq_name="seq_doc_type_".$this->dt_id;
    +00500       $str_file="";
    +00501       $add_file='';
    +00502       // f_id dest
    +00503       $tiers=new fiche($this->db);
    +00504       $tiers->GetByQCode($this->qcode_dest);
    +00505 
    +00506       // f_id exp
    +00507       $exp=new fiche($this->db);
    +00508       $exp->GetByQCode($this->qcode_exp);
    +00509 
    +00510       if ( trim($this->ag_title) == "") 
    +00511         {
    +00512           $doc_mod=new document_type($this->db);
    +00513           $doc_mod->dt_id=$this->dt_id;
    +00514           $doc_mod->get();
    +00515           $this->ag_title=$doc_mod->dt_value;
    +00516         }
    +00517       echo_debug('class_action',__LINE__," tiers->id  ".$tiers->id);
    +00518       $this->ag_id=NextSequence($this->db,'action_gestion_ag_id_seq');
    +00519       // Create the reference 
    +00520       $ref=$this->dt_id.'/'.$this->ag_id;
    +00521       $this->ag_ref=$ref;
    +00524       //we remove newline 
    +00525       $this->ag_comment=str_replace("%OD","",$this->ag_comment);
    +00526       $this->ag_comment=str_replace("%OA","",$this->ag_comment);
    +00527       // save into the database
    +00528       $sql=sprintf("insert into action_gestion".
    +00529                    "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,f_id_exp,ag_comment,ag_ref,ag_ref_ag_id) ".
    +00530                    " values (%d,to_date('%s','DD-MM-YYYY'),'%d','%s',%d,%d,'%s','%s',%d)",
    +00531                    $this->ag_id,
    +00532                    $this->ag_timestamp,
    +00533                    $this->dt_id,
    +00534                    FormatString($this->ag_title),
    +00535                    $tiers->id,
    +00536                    $exp->id,
    +00537                    $this->ag_comment,
    +00538                    $ref,
    +00539                    $this->ag_ref_ag_id
    +00540                    );
    +00541       ExecSql($this->db,$sql);
     00542 
    -00543       // if we save the generated doc
    -00544       if ( isset($_POST['save_generate']))
    -00545         {
    -00546           return;
    -00547         }
    -00548 
    -00549       // Upload a new document
    -00550       $doc=new Document($this->db);
    -00551       $doc->ag_id=$this->ag_id;
    -00552       // if there is a document and it is not an update
    -00553       if ( sizeof($_FILES) !=0 && $d_id==0) 
    -00554         {
    -00555           $doc->md_type=$this->dt_id;
    -00556           $doc->blank();
    -00557         }
    -00558       else 
    -00559         $doc->d_id=$d_id;
    -00560 
    -00561       $doc->Upload($this->ag_id);
    -00562     }
    -00563 
    -00572   function myList($p_filter="",$p_search="")
    -00573     {
    -00574       $sql="
    -00575    select ag_id,to_char(ag_timestamp,'DD-MM-YYYY') as my_date,ag_ref_ag_id,f_id,ag_title,d_id,md_type,dt_value,ag_ref 
    -00576    from action_gestion 
    -00577       left outer join document using (ag_id)
    -00578       left outer join document_modele on (ag_type=md_type) 
    -00579       join document_type on (ag_type=dt_id)
    -00580    where dt_id in ($p_filter) $p_search order by ag_timestamp desc,ag_ref desc";
    -00581       $max_line=CountSql($this->db,$sql);
    -00582       $step=$_SESSION['g_pagesize'];
    -00583       $page=(isset($_GET['offset']))?$_GET['page']:1;
    -00584       $offset=(isset($_GET['offset']))?$_GET['offset']:0;
    -00585       $limit=" LIMIT $step OFFSET $offset ";  
    -00586       $bar=jrn_navigation_bar($offset,$max_line,$step,$page);
    -00587 
    -00588       $Res=ExecSql($this->db,$sql.$limit);
    -00589       $a_row=pg_fetch_all($Res);
    -00590       //      $r='<div class="u_redcontent">';
    -00591       $r="";
    -00592       $r.=$bar;
    -00593       $r.="<table>";
    -00594       $r.="<tr>";
    -00595       $r.="<th>Date</th>";
    -00596       $r.="<th>Société</th>";
    -00597       $r.="<th>Titre</th>";
    -00598       $r.="<th>type</th>";
    -00599       $r.="<th>Référence</th>";
    -00600       $r.="<th>concerne</th>";
    -00601       $r.="<th>Document</th>";
    -00602       $r.="</tr>";
    -00603 
    -00604       // if there are no records return a message
    -00605       if ( sizeof ($a_row) == 0 or $a_row == false ) 
    -00606         {
    -00607           $r='<div class="u_redcontent">';
    -00608           $r.='<hr>Aucun enregistrement trouvé';
    -00609           $r.="</div>";
    -00610           return $r;
    -00611 
    -00612         }
    -00613       echo JS_SEARCH_CARD;
    -00614       foreach ($a_row as $row )
    -00615         {
    -00616           $f=new fiche($this->db);
    -00617           $f->id=$row['f_id'];
    -00618           $qcode=$f->strAttribut(ATTR_DEF_QUICKCODE);
    -00619 
    -00620           $r.="<tr>";
    -00621           $r.="<td>".$row['my_date']."</td>";
    -00622           $q=($qcode=="- ERROR -")?"Interne":$qcode;
    -00623           $js=sprintf("javascript:showfiche('%s','%s')",
    -00624                       $_REQUEST['PHPSESSID'],$q);
    -00625           if ( $q != 'Interne' )
    -00626             {
    -00627               $r.="<td>".'<A HREF="'.$js.'">'.$q." : ".$f->getName().'</A></td>';
    -00628             }
    -00629           else
    -00630             $r.="<td>Interne </td>";
    -00631 
    -00632           // show reference
    -00633           if ( $row['ag_ref_ag_id'] != 0 ) 
    -00634             {
    -00635               $retSqlStmt=ExecSql($this->db,
    -00636                                   "select ag_ref from action_gestion where ag_id=".$row['ag_ref_ag_id']);
    -00637               $retSql=pg_fetch_all($retSqlStmt);
    -00638               $ref="";
    -00639               foreach ($retSql as $line) 
    -00640                 {
    -00641                   $ref.='<A  href="commercial.php?p_action=suivi_courrier&query='.$line['ag_ref'].'">'.
    -00642                     $line['ag_ref']."<A>";
    -00643                 }
    -00644             }
    -00645           else 
    -00646             $ref="";
    -00647 
    -00648           $r.='<td><A HREF="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.$row['ag_id'].'">'.
    -00649             $row['ag_title']."</A></td>";
    -00650           $r.="<td>".$row['dt_value']."</td>";
    -00651           $r.="<td>".$row['ag_ref']."</td>";
    -00652           $r.="<td>".$ref."</td>";
    -00653           $doc=new Document($this->db,$row['d_id']);
    -00654           $r.="<td>".$doc->a_ref()."</td>";
    -00655           $r.="</tr>";
    -00656 
    -00657         }
    -00658       $r.="</table>";
    +00543 
    +00544 
    +00545       // the lob filename and the mimetype needed if we want to generate a doc.
    +00546       if ( $this->gen == 'on' ) 
    +00547         {
    +00548           $doc=new Document($this->db);
    +00549           $doc->f_id=$tiers->id;
    +00550           $doc->md_id=$this->md_id;
    +00551           $doc->ag_id=$this->ag_id;
    +00552           $doc->d_state=$this->d_state;
    +00553           $str_file=$doc->Generate();
    +00554           $d='<input type="hidden" name="d_id" value="'.$doc->d_id.'">';
    +00555         }
    +00556       $r="";
    +00557       // readonly and upload of a file
    +00558       $r.="<hr>";
    +00559       $r.='<form enctype="multipart/form-data" method="post">';
    +00560       $r.=$this->Display('READ',false);
    +00561       // Add the hidden tag
    +00562       $r.='<input type="hidden" name="sa" value="save_action_st3">';
    +00563       $r.='<input type="hidden" name="p_action" value="suivi_courrier">';
    +00564       // add the d_id
    +00565       $r.='<input type="hidden" name="d_id" value="'.$this->d_id.'">'; 
    +00566       // ag_comment must be saved in urlcode
    +00567       $r.='<input type="hidden" name="ag_comment" value="'.urlencode($this->ag_comment).'">';
    +00568       // Value for the generated document
    +00569       if ( $this->gen == 'on' ) 
    +00570         {
    +00571           $r.='<input type="hidden" name="d_id" value="'.$doc->d_id.'">';
    +00572           $r.="Sauver le document généré :";
    +00573           $r.=$str_file;
    +00574           $checkbox=new widget("checkbox");
    +00575           $checkbox->name="save_generate";
    +00576           $r.=$checkbox->IOValue();
    +00577           $r.="<hr>";
    +00578         }
    +00579       $upload=new widget("file");
    +00580       $upload->name="file_upload";
    +00581       $upload->value="";
    +00582       $r.="Enregistrer le fichier ".$upload->IOValue();
    +00583       $r.=$upload->Submit("save","Sauve le fichier");
    +00584       $r.="</form>";
    +00585       return $r;
    +00586     }
    +00592   function SaveStage3($d_id) 
    +00593     {
    +00594       echo_debug('class_action',__LINE__,'SaveStage3()  :'.var_export($_POST,true));
    +00595       echo_debug('class_action',__LINE__,'SaveStage3  :'.var_export($this,true));
    +00596 
    +00597       // if we save the generated doc
    +00598       if ( isset($_POST['save_generate']))
    +00599         {
    +00600           return;
    +00601         }
    +00602 
    +00603       // Upload a new document
    +00604       $doc=new Document($this->db);
    +00605       $doc->ag_id=$this->ag_id;
    +00606       // if there is a document and it is not an update
    +00607       if ( sizeof($_FILES) !=0 && $d_id==0) 
    +00608         {
    +00609           $doc->md_type=$this->dt_id;
    +00610           $doc->blank();
    +00611         }
    +00612       else 
    +00613         $doc->d_id=$d_id;
    +00614 
    +00615       $doc->Upload($this->ag_id);
    +00616     }
    +00617 
    +00626   function myList($p_filter="",$p_search="")
    +00627     {
    +00628       $sql="
    +00629    select ag_id,to_char(ag_timestamp,'DD-MM-YYYY') as my_date,ag_ref_ag_id,f_id_dest,f_id_exp".
    +00630         ",ag_title,d_id,md_type,dt_value,ag_ref 
    +00631    from action_gestion 
    +00632       left outer join document using (ag_id)
    +00633       left outer join document_modele on (ag_type=md_type) 
    +00634       join document_type on (ag_type=dt_id)
    +00635    where dt_id in ($p_filter) $p_search order by ag_timestamp desc,ag_ref desc";
    +00636       $max_line=CountSql($this->db,$sql);
    +00637       $step=$_SESSION['g_pagesize'];
    +00638       $page=(isset($_GET['offset']))?$_GET['page']:1;
    +00639       $offset=(isset($_GET['offset']))?$_GET['offset']:0;
    +00640       $limit=" LIMIT $step OFFSET $offset ";  
    +00641       $bar=jrn_navigation_bar($offset,$max_line,$step,$page);
    +00642 
    +00643       $Res=ExecSql($this->db,$sql.$limit);
    +00644       $a_row=pg_fetch_all($Res);
    +00645       //      $r='<div class="u_redcontent">';
    +00646       $r="";
    +00647       $r.=$bar;
    +00648       $r.="<table>";
    +00649       $r.="<tr>";
    +00650       $r.="<th>Date</th>";
    +00651       $r.="<th>Destinataire</th>";
    +00652       $r.="<th>Expéditeur</th>";
    +00653       $r.="<th>Titre</th>";
    +00654       $r.="<th>type</th>";
    +00655       $r.="<th>Référence</th>";
    +00656       $r.="<th>concerne</th>";
    +00657       $r.="<th>Document</th>";
    +00658       $r.="</tr>";
     00659 
    -00660       $r.=$bar;
    -00661       //$r.="</div>";
    -00662       return $r;
    -00663     }
    -00664   //----------------------------------------------------------------------
    -00669   function Update()
    -00670     {
    -00671       echo_debug('class_action',__LINE__,'Update() $_POST()  :'.var_export($_POST,true));
    -00672       echo_debug('class_action',__LINE__,'Update()  $this  :'.var_export($this,true));
    -00673 
    -00674       // if ag_id == 0 nothing to do
    -00675       if ( $this->ag_id == 0 ) return ;
    -00676 
    -00677 
    -00678       // retrieve customer
    -00679       // f_id
    -00680      
    -00681       if ( trim($this->qcode) =="" )
    -00682         {
    -00683           // internal document
    -00684           $this->f_id=0; // internal document
    -00685         }
    -00686       else
    -00687         {
    -00688           $tiers=new fiche($this->db);
    -00689           if ( $tiers->GetByQCode($this->qcode) ==1 ) // Error we cannot retrieve this qcode
    -00690             return false; 
    -00691           else
    -00692             $this->f_id=$tiers->id;
    +00660       // if there are no records return a message
    +00661       if ( sizeof ($a_row) == 0 or $a_row == false ) 
    +00662         {
    +00663           $r='<div class="u_redcontent">';
    +00664           $r.='<hr>Aucun enregistrement trouvé';
    +00665           $r.="</div>";
    +00666           return $r;
    +00667 
    +00668         }
    +00669       echo JS_SEARCH_CARD;
    +00670       foreach ($a_row as $row )
    +00671         {
    +00672 
    +00673           $r.="<tr>";
    +00674           $r.="<td>".$row['my_date']."</td>";
    +00675           // Expediteur
    +00676           $fexp=new fiche($this->db);
    +00677           $fexp->id=$row['f_id_exp'];
    +00678           $qcode_exp=$f->strAttribut(ATTR_DEF_QUICKCODE);
    +00679 
    +00680           $qexp=($qcode_exp=="- ERROR -")?"Interne":$qcode_exp;
    +00681           $jsexp=sprintf("javascript:showfiche('%s','%s')",
    +00682                       $_REQUEST['PHPSESSID'],$qexp);
    +00683           if ( $qexp != 'Interne' )
    +00684             {
    +00685               $r.="<td>".'<A HREF="'.$jsexp.'">'.$qexp." : ".$fexp->getName().'</A></td>';
    +00686             }
    +00687           else
    +00688             $r.="<td>Interne </td>";
    +00689           // Destinataire
    +00690           $fdest=new fiche($this->db);
    +00691           $fdest->id=$row['f_id_dest'];
    +00692           $qcode_dest=$fdest->strAttribut(ATTR_DEF_QUICKCODE);
     00693 
    -00694         }
    -00695 
    -00696       //remove newline from ag_comment
    -00697       $this->ag_comment=str_replace("\n","",$this->ag_comment);
    -00698       $this->ag_comment=str_replace("\r","",$this->ag_comment);
    -00699 
    -00700       // url encoded
    -00701       $this->ag_comment=urlencode($this->ag_comment);
    -00702 
    -00703       // bug PHP : sometimes the newline remains
    -00704       $this->ag_comment=str_replace("%A0","",$this->ag_comment);
    -00705       $this->ag_comment=str_replace("%0D","",$this->ag_comment);
    -00706       $this->ag_comment=str_replace("+%A0+","",$this->ag_comment);
    -00707       $this->ag_comment=str_replace("+%0D+","",$this->ag_comment);
    -00708 
    -00709 
    -00710       $sql=sprintf("update action_gestion set ag_comment='%s',".
    -00711                    " ag_timestamp=to_date('%s','DD.MM.YYYY'),".
    -00712                    " ag_title='%s',".
    -00713                    " ag_type=%d, ".
    -00714                    " f_id=%d, ".
    -00715                    " ag_ref_ag_id=%d".
    -00716                    " where ag_id = %d",
    -00717                    $this->ag_comment,
    -00718                    $this->ag_timestamp,
    -00719                    FormatString($this->ag_title),
    -00720                    $this->dt_id,
    -00721                    $this->f_id,
    -00722                    $this->ag_ref_ag_id,
    -00723                    $this->ag_id);
    -00724       ExecSql($this->db,$sql);
    -00725       
    -00726       if ( sizeof($_FILES) !=0 ) 
    -00727         {
    -00728           // Upload a new document
    -00729           $doc=new Document($this->db);
    -00730           if ( $this->d_id !=0 )
    -00731             {
    -00732               $doc->d_id=$this->d_id;
    -00733             } else {
    -00734               // we need to increment the counter 
    -00735               $doc->ag_id=$this->ag_id;
    -00736               $doc->md_type=$this->dt_id;
    -00737               $doc->blank();
    -00738             }
    -00739           $doc->Upload($this->ag_id);
    -00740       
    -00741         }
    -00742            
    -00743       return true;
    -00744     }
    -00750   function GetAgRef($p_method)
    -00751     {
    -00752       if ($p_method=="ag_ref_ag_id")
    -00753         $sql="select ag_ref from action_gestion where ag_id=".$this->ag_ref_ag_id;
    -00754       elseif ($p_method=="ag_id")
    -00755         $sql="select ag_ref from action_gestion where ag_id=".$this->ag_id;
    -00756       return Getdbvalue($this->db,$sql);
    -00757 
    -00758     }
    -00759 
    -00760 }
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +00694 $qdest=($qcode_dest=="- ERROR -")?"Interne":$qcode_dest; +00695 $jsdest=sprintf("javascript:showfiche('%s','%s')", +00696 $_REQUEST['PHPSESSID'],$qdest); +00697 if ( $qdest != 'Interne' ) +00698 { +00699 $r.="<td>".'<A HREF="'.$jsdest.'">'.$qdest." : ".$fdest->getName().'</A></td>'; +00700 } +00701 else +00702 $r.="<td>Interne </td>"; +00703 +00704 // show reference +00705 if ( $row['ag_ref_ag_id'] != 0 ) +00706 { +00707 $retSqlStmt=ExecSql($this->db, +00708 "select ag_ref from action_gestion where ag_id=".$row['ag_ref_ag_id']); +00709 $retSql=pg_fetch_all($retSqlStmt); +00710 $ref=""; +00711 foreach ($retSql as $line) +00712 { +00713 $ref.='<A href="commercial.php?p_action=suivi_courrier&query='.$line['ag_ref'].'">'. +00714 $line['ag_ref']."<A>"; +00715 } +00716 } +00717 else +00718 $ref=""; +00719 +00720 $r.='<td><A HREF="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.$row['ag_id'].'">'. +00721 $row['ag_title']."</A></td>"; +00722 $r.="<td>".$row['dt_value']."</td>"; +00723 $r.="<td>".$row['ag_ref']."</td>"; +00724 $r.="<td>".$ref."</td>"; +00725 $doc=new Document($this->db,$row['d_id']); +00726 $r.="<td>".$doc->a_ref()."</td>"; +00727 $r.="</tr>"; +00728 +00729 } +00730 $r.="</table>"; +00731 +00732 $r.=$bar; +00733 //$r.="</div>"; +00734 return $r; +00735 } +00736 //---------------------------------------------------------------------- +00741 function Update() +00742 { +00743 echo_debug('class_action',__LINE__,'Update() $_POST() :'.var_export($_POST,true)); +00744 echo_debug('class_action',__LINE__,'Update() $this :'.var_export($this,true)); +00745 +00746 // if ag_id == 0 nothing to do +00747 if ( $this->ag_id == 0 ) return ; +00748 +00749 +00750 // retrieve customer +00751 // f_id +00752 +00753 if ( trim($this->qcode) =="" ) +00754 { +00755 // internal document +00756 $this->f_id=0; // internal document +00757 } +00758 else +00759 { +00760 $tiers=new fiche($this->db); +00761 if ( $tiers->GetByQCode($this->qcode) ==1 ) // Error we cannot retrieve this qcode +00762 return false; +00763 else +00764 $this->f_id=$tiers->id; +00765 +00766 } +00767 +00768 //remove newline from ag_comment +00769 $this->ag_comment=str_replace("\n","",$this->ag_comment); +00770 $this->ag_comment=str_replace("\r","",$this->ag_comment); +00771 +00772 // url encoded +00773 $this->ag_comment=urlencode($this->ag_comment); +00774 +00775 // bug PHP : sometimes the newline remains +00776 $this->ag_comment=str_replace("%A0","",$this->ag_comment); +00777 $this->ag_comment=str_replace("%0D","",$this->ag_comment); +00778 $this->ag_comment=str_replace("+%A0+","",$this->ag_comment); +00779 $this->ag_comment=str_replace("+%0D+","",$this->ag_comment); +00780 +00781 +00782 $sql=sprintf("update action_gestion set ag_comment='%s',". +00783 " ag_timestamp=to_date('%s','DD.MM.YYYY'),". +00784 " ag_title='%s',". +00785 " ag_type=%d, ". +00786 " f_id_exp=%d, ". +00787 " f_id_dest=%d, ". +00788 " ag_ref_ag_id=%d". +00789 " where ag_id = %d", +00790 $this->ag_comment, +00791 $this->ag_timestamp, +00792 FormatString($this->ag_title), +00793 $this->dt_id, +00794 $this->f_id_exp, +00795 $this->f_id_dest, +00796 $this->ag_ref_ag_id, +00797 $this->ag_id); +00798 ExecSql($this->db,$sql); +00799 +00800 if ( sizeof($_FILES) !=0 ) +00801 { +00802 // Upload a new document +00803 $doc=new Document($this->db); +00804 if ( $this->d_id !=0 ) +00805 { +00806 $doc->d_id=$this->d_id; +00807 } else { +00808 // we need to increment the counter +00809 $doc->ag_id=$this->ag_id; +00810 $doc->md_type=$this->dt_id; +00811 $doc->blank(); +00812 } +00813 $doc->Upload($this->ag_id); +00814 +00815 } +00816 +00817 return true; +00818 } +00824 // function GetAgRef($p_method) +00825 // { +00826 // if ($p_method=="ag_ref_ag_id") +00827 // $sql="select ag_ref from action_gestion where ag_id=".$this->ag_ref_ag_id; +00828 // elseif ($p_method=="ag_id") +00829 // $sql="select ag_ref from action_gestion where ag_id=".$this->ag_id; +00830 // return Getdbvalue($this->db,$sql); +00831 +00832 // } +00833 +00834 } +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/class__action_8php.html b/doc/developper/html/class__action_8php.html index e05d3257f..3a9a9efae 100644 --- a/doc/developper/html/class__action_8php.html +++ b/doc/developper/html/class__action_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_action.php File Reference +phpcompta: class_action.php File Reference +include

    class_action.php File Reference

    class_action for manipulating actions action can be :
    • an invoice
    • a meeting
    • an order
    • a letter
    More... @@ -29,7 +29,7 @@ class_action for manipulating actions action can be :

      The table document_type are the possible actions

      -Definition in file class_action.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_action.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__attribut_8php-source.html b/doc/developper/html/class__attribut_8php-source.html index ce6f28a35..5e7be2771 100644 --- a/doc/developper/html/class__attribut_8php-source.html +++ b/doc/developper/html/class__attribut_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_attribut.php Source File +phpcompta: class_attribut.php Source File +include

      class_attribut.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -52,7 +52,7 @@
       00060   
       00061   return $p_attribut;
       00062 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__attribut_8php.html b/doc/developper/html/class__attribut_8php.html index 036bfbbef..6b5c94dbb 100644 --- a/doc/developper/html/class__attribut_8php.html +++ b/doc/developper/html/class__attribut_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_attribut.php File Reference +phpcompta: class_attribut.php File Reference +include

      class_attribut.php File Reference

      Manage the attribut of the card. More...

      @@ -67,10 +67,25 @@ Definition at line

      References $i, and $t.

      -Referenced by fiche::getAttribut(). +Referenced by fiche::getAttribut().

      00050                                         {
      +00051   for ($i=0;$i< sizeof($p_attribut)-1;$i++) {
      +00052       if ( $p_attribut[$i]->ad_id > $p_attribut[$i+1]->ad_id ) {
      +00053         // then swap them
      +00054         $t=$p_attribut[$i];
      +00055         $p_attribut[$i]=$p_attribut[$i+1];
      +00056         $p_attribut[$i+1] = $t;
      +00057         $i=0;
      +00058       }
      +00059     }
      +00060   
      +00061   return $p_attribut;
      +00062 }
      +
      +

      + -


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__balance_8php-source.html b/doc/developper/html/class__balance_8php-source.html index a81dc5b2c..2c3bb2572 100644 --- a/doc/developper/html/class__balance_8php-source.html +++ b/doc/developper/html/class__balance_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_balance.php Source File +phpcompta: class_balance.php Source File +include

      class_balance.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -100,7 +100,7 @@
       00112 
       00113   }
       00114 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__balance_8php.html b/doc/developper/html/class__balance_8php.html index 863e03b7d..75a16892d 100644 --- a/doc/developper/html/class__balance_8php.html +++ b/doc/developper/html/class__balance_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_balance.php File Reference +phpcompta: class_balance.php File Reference +include

      class_balance.php File Reference

      Class for manipulating data to print the balance of account. More...

      @@ -23,7 +23,7 @@ Class for manipulating data to print the balance of account.

      -Definition in file class_balance.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_balance.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__contact_8php-source.html b/doc/developper/html/class__contact_8php-source.html index 989002b98..f102e1aab 100644 --- a/doc/developper/html/class__contact_8php-source.html +++ b/doc/developper/html/class__contact_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_contact.php Source File +phpcompta: class_contact.php Source File +include

      class_contact.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -86,9 +86,9 @@
       00094       $and="?";
       00095       $get=$_GET;
       00096       if ( isset ($get) ) {
      -00097         foreach ($get as $name=>$value ) {
      +00097         foreach ($get as $name=>$value ) {
       00098           // we clean the parameter offset, step, page and size
      -00099           if (  ! in_array($name,array('f_id','detail'))) {
      +00099           if (  ! in_array($name,array('f_id','detail'))) {
       00100             $url.=$and.$name."=".$value;
       00101             $and="&";
       00102           }// if
      @@ -129,7 +129,7 @@
       00137     }
       00138 
       00139 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__contact_8php.html b/doc/developper/html/class__contact_8php.html index c22726e41..42ad74c2f 100644 --- a/doc/developper/html/class__contact_8php.html +++ b/doc/developper/html/class__contact_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_contact.php File Reference +phpcompta: class_contact.php File Reference +include

      class_contact.php File Reference

      class for the contact, contact are derived from ficheContact are a card which are own by a another card (customer, supplier...) More...

      @@ -23,7 +23,7 @@ class for the contact, contact are derived from ficheContact are a card which ar

      -Definition in file class_contact.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_contact.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__customer_8php-source.html b/doc/developper/html/class__customer_8php-source.html index d53492bf2..43ee4f30e 100644 --- a/doc/developper/html/class__customer_8php-source.html +++ b/doc/developper/html/class__customer_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_customer.php Source File +phpcompta: class_customer.php Source File +include

      class_customer.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -57,7 +57,7 @@
       00061     if ( pg_NumRows($Res) == 0) return null;
       00062     // There is only _one_ row by customer
       00063     $row=pg_fetch_array($Res,0);
      -00064     $this->name=$row['name'];
      +00064     $this->name=$row['name'];
       00065     $this->id=$row['f_id'];    
       00066     $this->street=$row['rue'];    
       00067     $this->cp=$row['code_postal'];
      @@ -122,7 +122,7 @@
       00138           $customer=$e['j_poste'];
       00139           // Retrieve name and vat number
       00140           $this->GetFromPoste($customer);
      -00141           $a_Res[$customer]['name']=$this->name;
      +00141           $a_Res[$customer]['name']=$this->name;
       00142           $a_Res[$customer]['vat_number']=$this->vat_number;
       00143           break;
       00144           
      @@ -242,7 +242,7 @@
       00268 }
       00269 
       00270 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__customer_8php.html b/doc/developper/html/class__customer_8php.html index 77aad7501..b92eddcba 100644 --- a/doc/developper/html/class__customer_8php.html +++ b/doc/developper/html/class__customer_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_customer.php File Reference +phpcompta: class_customer.php File Reference +include

      class_customer.php File Reference

      Derived from class fiche Customer are a specific kind of card. More...

      @@ -23,7 +23,7 @@ Derived from class fiche Customer ar

      -Definition in file class_customer.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_customer.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__document_8php-source.html b/doc/developper/html/class__document_8php-source.html index dcbaa9120..8aeae2fbe 100644 --- a/doc/developper/html/class__document_8php-source.html +++ b/doc/developper/html/class__document_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document.php Source File +phpcompta: class_document.php Source File +include

      class_document.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -45,14 +45,14 @@
       00042   function Document($p_cn,$p_d_id=0)
       00043     {
       00044       $this->db=$p_cn;
      -00045       $this->d_id=$p_d_id;
      +00045       $this->d_id=$p_d_id;
       00046     } 
       00049   function blank()
       00050     {
      -00051       $this->d_id=NextSequence($this->db,"document_d_id_seq");
      +00051       $this->d_id=NextSequence($this->db,"document_d_id_seq");
       00052       // affect a number
       00053       $this->d_number=NextSequence($this->db,"seq_doc_type_".$this->md_type);
      -00054       $sql=sprintf('insert into document(d_id,ag_id,d_number) values(%d,%d,%d)',
      +00054       $sql=sprintf('insert into document(d_id,ag_id,d_number) values(%d,%d,%d)',
       00055                    $this->d_id,
       00056                    $this->ag_id,
       00057                    $this->d_number);
      @@ -185,7 +185,7 @@
       00211                 $pos=strpos($buffer,$to_remove);
       00212                 // get the length of the string to remove
       00213                 $len=strlen($to_remove);
      -00214                 $buffer=substr_replace($buffer,$value,$pos,$len);
      +00214                 $buffer=substr_replace($buffer,$value,$pos,$len);
       00215 
       00216                 //              echo_debug('class_document',__LINE__, $buffer);
       00217                 // if the pattern if found we replace it
      @@ -223,8 +223,8 @@
       00256                    $this->d_state
       00257                    );
       00258       ExecSql($this->db,$sql);
      -00259       $this->d_id=GetSequence($this->db,"document_d_id_seq");
      -00260       echo_debug('class_document',__LINE__,'document sauvé : d_id'.$this->d_id);
      +00259       $this->d_id=GetSequence($this->db,"document_d_id_seq");
      +00260       echo_debug('class_document',__LINE__,'document sauvé : d_id'.$this->d_id);
       00261       Commit($this->db);
       00262       return 0;
       00263     }
      @@ -255,7 +255,7 @@
       00295           }
       00296           // the upload in the database is successfull
       00297           $this->d_lob=$oid;
      -00298           $this->d_filename=$_FILES['file_upload']['name'];
      +00298           $this->d_filename=$_FILES['file_upload']['name'];
       00299           $this->d_mimetype=$_FILES['file_upload']['type'];
       00300           // now we have to update the col.
       00301           // We retrieve the row to remove a possible existing lob (replace)
      @@ -404,7 +404,7 @@
       00483         case 'SOLDE':
       00484           $tiers=new fiche($this->db);
       00485           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
      -00486           $tiers->Getbyqcode($qcode,false);
      +00486           $tiers->Getbyqcode($qcode,false);
       00487           $p=$tiers->strAttribut(ATTR_DEF_ACCOUNT);
       00488           $poste=new Poste($this->db,$p);
       00489           $r=$poste->GetSolde(' true' );
      @@ -412,34 +412,34 @@
       00491         case 'CUST_NAME':
       00492           $tiers=new fiche($this->db);
       00493           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
      -00494           $tiers->getByQcode($qcode,false);
      +00494           $tiers->getByQcode($qcode,false);
       00495           $r=$tiers->strAttribut(ATTR_DEF_NAME);
       00496           break;
       00497         case 'CUST_ADDR_1':
       00498           $tiers=new fiche($this->db);
       00499           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
      -00500           $tiers->getByQcode($qcode,false);
      +00500           $tiers->getByQcode($qcode,false);
       00501           $r=$tiers->strAttribut(ATTR_DEF_ADRESS);
       00502           
       00503           break ;
       00504         case 'CUST_CP':
       00505           $tiers=new fiche($this->db);
       00506           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
      -00507           $tiers->getByQcode($qcode,false);
      +00507           $tiers->getByQcode($qcode,false);
       00508           $r=$tiers->strAttribut(ATTR_DEF_CP);
       00509 
       00510           break;
       00511         case 'CUST_CO':
       00512           $tiers=new fiche($this->db);
       00513           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
      -00514           $tiers->getByQcode($qcode,false);
      +00514           $tiers->getByQcode($qcode,false);
       00515           $r=$tiers->strAttribut(ATTR_DEF_PAYS);
       00516 
       00517           break; 
       00518         case 'CUST_VAT':
       00519           $tiers=new fiche($this->db);
       00520           $qcode=isset($_REQUEST['tiers'])?$_REQUEST['tiers']:$_REQUEST['e_client'];
      -00521           $tiers->getByQcode($qcode,false);
      +00521           $tiers->getByQcode($qcode,false);
       00522           $r=$tiers->strAttribut(ATTR_DEF_NUMTVA);
       00523           break; 
       00524           // Marchandise in $_POST['e_march*']
      @@ -630,7 +630,7 @@
       00718     }
       00722   function remove()
       00723     {
      -00724       $sql='delete from document where d_id='.$this->d_id;
      +00724       $sql='delete from document where d_id='.$this->d_id;
       00725       ExecSql($this->db,$sql);
       00726     }
       00733   function MoveDocumentPj($p_internal)
      @@ -645,7 +645,7 @@
       00742 
       00743 
       00744 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__document_8php.html b/doc/developper/html/class__document_8php.html index e7826b6ad..15b763ea1 100644 --- a/doc/developper/html/class__document_8php.html +++ b/doc/developper/html/class__document_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document.php File Reference +phpcompta: class_document.php File Reference +include

      class_document.php File Reference

      Class Document corresponds to the table document. More...

      @@ -23,7 +23,7 @@ Class Document corresponds to the ta

      -Definition in file class_document.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_document.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__document__modele_8php-source.html b/doc/developper/html/class__document__modele_8php-source.html index a17898f59..1020c8221 100644 --- a/doc/developper/html/class__document__modele_8php-source.html +++ b/doc/developper/html/class__document__modele_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document_modele.php Source File +phpcompta: class_document_modele.php Source File +include

      class_document_modele.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -38,7 +38,7 @@
       00036   //Constructor parameter = database connexion
       00037   function Document_modele($p_cn,$p_id=-1) {
       00038     $this->cn=$p_cn;    
      -00039     $this->md_id=$p_id;
      +00039     $this->md_id=$p_id;
       00040   }
       00041   
       00049   function myList() { 
      @@ -63,7 +63,7 @@
       00068       $r.="</td>";
       00069       $r.="<TD>";
       00070       $c=new widget("checkbox");
      -00071       $c->name="dm_remove_".$row['md_id'];
      +00071       $c->name="dm_remove_".$row['md_id'];
       00072       $r.=$c->IOValue();
       00073       $r.="</td>";
       00074       $r.="</tr>";
      @@ -94,8 +94,8 @@
       00115         {
       00116 
       00117           // insert into the table document_modele
      -00118           $this->name=FormatString($this->md_name);
      -00119           $this->md_id=NextSequence($this->cn,'document_modele_md_id_seq');
      +00118           $this->name=FormatString($this->md_name);
      +00119           $this->md_id=NextSequence($this->cn,'document_modele_md_id_seq');
       00120           $sql=sprintf("insert into document_modele(md_id,md_name,md_type) 
       00121                               values (%d,'%s',%d)",
       00122                              $this->md_id,$this->name,$this->md_type);
      @@ -140,7 +140,7 @@
       00161                     pg_lo_unlink($this->cn,$old_oid);
       00162                 }
       00163               // Load new document
      -00164               ExecSql($this->cn,"update document_modele set md_lob=".$oid.", md_mimetype='".$_FILES['doc']['type']."' ,md_filename='".$_FILES['doc']['name']."' where md_id=".$this->md_id);
      +00164               ExecSql($this->cn,"update document_modele set md_lob=".$oid.", md_mimetype='".$_FILES['doc']['type']."' ,md_filename='".$_FILES['doc']['name']."' where md_id=".$this->md_id);
       00165               Commit($this->cn);
       00166             }
       00167           else 
      @@ -242,7 +242,7 @@
       00282 
       00283 }
       00284 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__document__modele_8php.html b/doc/developper/html/class__document__modele_8php.html index f1085fb1c..c4be43c07 100644 --- a/doc/developper/html/class__document__modele_8php.html +++ b/doc/developper/html/class__document__modele_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document_modele.php File Reference +phpcompta: class_document_modele.php File Reference +include

      class_document_modele.php File Reference

      Class for the document template. More...

      @@ -23,7 +23,7 @@ Class for the document template.

      -Definition in file class_document_modele.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_document_modele.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__document__type_8php-source.html b/doc/developper/html/class__document__type_8php-source.html index 4d2c5ad2d..fc21f36be 100644 --- a/doc/developper/html/class__document__type_8php-source.html +++ b/doc/developper/html/class__document__type_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document_type.php Source File +phpcompta: class_document_type.php Source File +include

      class_document_type.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -44,7 +44,7 @@
       00050     }
       00051 
       00052 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__document__type_8php.html b/doc/developper/html/class__document__type_8php.html index 8e5d85d0f..f49e6e470 100644 --- a/doc/developper/html/class__document__type_8php.html +++ b/doc/developper/html/class__document__type_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document_type.php File Reference +phpcompta: class_document_type.php File Reference +include

      class_document_type.php File Reference

      class for the table document_type More...

      @@ -22,7 +22,7 @@ class for the table document_type

      -Definition in file class_document_type.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_document_type.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__fiche_8php-source.html b/doc/developper/html/class__fiche_8php-source.html index dd958e42e..f75623c13 100644 --- a/doc/developper/html/class__fiche_8php-source.html +++ b/doc/developper/html/class__fiche_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_fiche.php Source File +phpcompta: class_fiche.php Source File +include

      class_fiche.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -430,10 +430,10 @@
       00550                    $fiche_id,$p_fiche_def);
       00551       $Ret=ExecSql($this->cn,$sql);
       00552       // parse the $_POST array
      -00553       foreach ($_POST as $name=>$value ) 
      +00553       foreach ($_POST as $name=>$value ) 
       00554         {
       00555           echo_debug ("class_fiche",__LINE__,"Name = $name value $value") ;
      -00556           list ($id) = sscanf ($name,"av_text%d");
      +00556           list ($id) = sscanf ($name,"av_text%d");
       00557           if ( $id == null ) continue;
       00558           echo_debug("class_fiche",__LINE__,"add $id");
       00559           
      @@ -443,7 +443,7 @@
       00563             {
       00564               echo_debug("Modify ATTR_DEF_QUICKCODE");
       00565               $sql=sprintf("select insert_quick_code(%d,'%s')",
      -00566                            $fiche_id,FormatString($value));
      +00566                            $fiche_id,FormatString($value));
       00567               ExecSql($this->cn,$sql);
       00568               continue;
       00569             }
      @@ -451,7 +451,7 @@
       00571           if ( $id == ATTR_DEF_NAME ) 
       00572             {
       00573               echo_debug("Modify ATTR_DEF_NAME");
      -00574               if ( strlen(trim($value)) == 0 )
      +00574               if ( strlen(trim($value)) == 0 )
       00575                 $value="pas de nom";
       00576               
       00577             }
      @@ -459,7 +459,7 @@
       00579           if ( $id == ATTR_DEF_ACCOUNT ) 
       00580             {
       00581               echo_debug("Modify ATTR_DEF_ACCOUNT");
      -00582               $v=FormatString($value);
      +00582               $v=FormatString($value);
       00583               if ( isNumber($v) == 1 )
       00584                 {
       00585                   $sql=sprintf("select account_insert(%d,%d)",
      @@ -480,7 +480,7 @@
       00600             {
       00601               echo_debug("Modify ATTR_DEF_TVA");
       00602               // Verify if the rate exists, if not then do not update
      -00603               if ( strlen(trim($value)) != 0 ) 
      +00603               if ( strlen(trim($value)) != 0 ) 
       00604                 {
       00605                   if ( CountSql($this->cn,"select * from tva_rate where tva_id=".$value) == 0) 
       00606                     {
      @@ -495,14 +495,14 @@
       00615               $exist=CountSql($this->cn,"select f_id from fiche join fiche_def using (fd_id) ".
       00616                               " join jnt_fic_att_value using (f_id) join attr_value using (jft_id) ".
       00617                               " where frd_id in (8,9,14) and ad_id=".ATTR_DEF_QUICKCODE.
      -00618                               " and av_text='".FormatString($value)."'");
      +00618                               " and av_text='".FormatString($value)."'");
       00619               if ( $exist == 0 ) 
       00620                 {
       00621                   $value="Attention : pas de société  ";
       00622                 }
       00623             }
       00624           // Normal traitement
      -00625           $value2=FormatString($value);
      +00625           $value2=FormatString($value);
       00626 
       00627           $sql=sprintf("select attribut_insert(%d,%d,'%s')",
       00628                        $fiche_id,$id,$value2);
      @@ -519,10 +519,10 @@
       00642  function update() 
       00643      {
       00644        // parse the $_POST array
      -00645        foreach ($_POST as $name=>$value ) 
      +00645        foreach ($_POST as $name=>$value ) 
       00646          {
       00647            echo_debug ("class_fiche",__LINE__,"Name = $name value $value") ;
      -00648            list ($id) = sscanf ($name,"av_text%d");
      +00648            list ($id) = sscanf ($name,"av_text%d");
       00649            if ( $id == null ) continue;
       00650            echo_debug("class_fiche",__LINE__,"modify $id");
       00651            
      @@ -542,7 +542,7 @@
       00665              {
       00666                echo_debug("Modify ATTR_DEF_QUICKCODE");
       00667                $sql=sprintf("select update_quick_code(%d,'%s')",
      -00668                             $jft_id,FormatString($value));
      +00668                             $jft_id,FormatString($value));
       00669                ExecSql($this->cn,$sql);
       00670                continue;
       00671              }
      @@ -550,7 +550,7 @@
       00673            if ( $id == ATTR_DEF_NAME ) 
       00674              {
       00675                echo_debug("Modify ATTR_DEF_NAME");
      -00676                if ( strlen(trim($value)) == 0 )
      +00676                if ( strlen(trim($value)) == 0 )
       00677                  continue;
       00678                
       00679              }
      @@ -558,7 +558,7 @@
       00681            if ( $id == ATTR_DEF_ACCOUNT ) 
       00682              {
       00683                echo_debug("Modify ATTR_DEF_ACCOUNT");
      -00684                $v=FormatString($value);
      +00684                $v=FormatString($value);
       00685                if ( isNumber($v) == 1 )
       00686                  {
       00687                    $sql=sprintf("select account_update(%d,%d)",
      @@ -578,7 +578,7 @@
       00701              {
       00702                echo_debug("Modify ATTR_DEF_TVA");
       00703                // Verify if the rate exists, if not then do not update
      -00704                if ( strlen(trim($value)) != 0 ) 
      +00704                if ( strlen(trim($value)) != 0 ) 
       00705                  {
       00706                    if ( CountSql($this->cn,"select * from tva_rate where tva_id=".$value) == 0) 
       00707                      {
      @@ -592,7 +592,7 @@
       00715                $exist=CountSql($this->cn,"select f_id from fiche join fiche_def using (fd_id) ".
       00716                                " join jnt_fic_att_value using (f_id) join attr_value using (jft_id) ".
       00717                                " where frd_id in (8,9,14) and ad_id=".ATTR_DEF_QUICKCODE.
      -00718                                " and av_text='".FormatString($value)."'");
      +00718                                " and av_text='".FormatString($value)."'");
       00719  
       00720  
       00721                if ( $exist == 0 ) 
      @@ -602,7 +602,7 @@
       00725              }
       00726            
       00727            // Normal traitement
      -00728            $value2=FormatString($value);
      +00728            $value2=FormatString($value);
       00729            $sql=sprintf("update attr_value set av_text='%s' where jft_id=%d",
       00730                         $value2,$jft_id);
       00731            ExecSql($this->cn,$sql);
      @@ -649,7 +649,7 @@
       00783     }
       00784 }
       00785 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__fiche_8php.html b/doc/developper/html/class__fiche_8php.html index 9585f2b80..cfbc223eb 100644 --- a/doc/developper/html/class__fiche_8php.html +++ b/doc/developper/html/class__fiche_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_fiche.php File Reference +phpcompta: class_fiche.php File Reference +include

      class_fiche.php File Reference

      define Class fiche and fiche def, those class are using class attribut More...

      @@ -26,7 +26,7 @@ define Class fiche and fiche def, those class are using class attribut

      -Definition in file class_fiche.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_fiche.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__fiche__def_8php-source.html b/doc/developper/html/class__fiche__def_8php-source.html index 2709ae7fe..476f9f99c 100644 --- a/doc/developper/html/class__fiche__def_8php-source.html +++ b/doc/developper/html/class__fiche__def_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_fiche_def.php Source File +phpcompta: class_fiche_def.php Source File +include

      class_fiche_def.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -53,7 +53,7 @@
       00060         {
       00061           $o=new fiche_def_ref($this->db);
       00062 
      -00063           foreach (  $this->attribut as  $value)
      +00063           foreach (  $this->attribut as  $value)
       00064             {
       00065               $o->$value=$row[$value];
       00066             }
      @@ -65,7 +65,7 @@
       00078   function Display() 
       00079     {
       00080       $r="";
      -00081       foreach ( $this->attribut as $value) 
      +00081       foreach ( $this->attribut as $value) 
       00082         {
       00083           $r.="<TD>".$this->$value.'</TD>';
       00084         }
      @@ -103,7 +103,7 @@
       00141 
       00142 }
       00143 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__fiche__def_8php.html b/doc/developper/html/class__fiche__def_8php.html index 41a6e2a43..b3e16f761 100644 --- a/doc/developper/html/class__fiche__def_8php.html +++ b/doc/developper/html/class__fiche__def_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_fiche_def.php File Reference +phpcompta: class_fiche_def.php File Reference +include

      class_fiche_def.php File Reference

      fiche_def_ref, a fiche is owned by fiche_def which is owned by fiche_def_ref More...

      @@ -23,7 +23,7 @@

      -Definition in file class_fiche_def.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_fiche_def.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__jrn_8php-source.html b/doc/developper/html/class__jrn_8php-source.html index 85fcf7349..5c63a76d4 100644 --- a/doc/developper/html/class__jrn_8php-source.html +++ b/doc/developper/html/class__jrn_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_jrn.php Source File +phpcompta: class_jrn.php Source File +include

      class_jrn.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -39,8 +39,8 @@
       00033   }
       00034   function GetName() {
       00035     if ( $this->id==0 ) {
      -00036       $this->name=" Grand Livre ";
      -00037       return $this->name;
      +00036       $this->name=" Grand Livre ";
      +00037       return $this->name;
       00038     }
       00039 
       00040     $Res=ExecSql($this->db,"select jrn_def_name from ".
      @@ -49,7 +49,7 @@
       00043     $Max=pg_NumRows($Res);
       00044     if ($Max==0) return null;
       00045     $ret=pg_fetch_array($Res,0);
      -00046     $this->name=$ret['jrn_def_name'];
      +00046     $this->name=$ret['jrn_def_name'];
       00047     return $ret['jrn_def_name'];
       00048   }
       00049 
      @@ -294,10 +294,10 @@
       00326         $Res=pg_fetch_all($r);
       00327         echo_debug('class_jrn',__LINE__,$Res);
       00328         if ( sizeof($Res) == 0 ) return 1;
      -00329         return $Res[0]['value'];
      +00329         return $Res[0]['value'];
       00330 }
       00331 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__jrn_8php.html b/doc/developper/html/class__jrn_8php.html index 28909c28b..b8900c3ec 100644 --- a/doc/developper/html/class__jrn_8php.html +++ b/doc/developper/html/class__jrn_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_jrn.php File Reference +phpcompta: class_jrn.php File Reference +include

      class_jrn.php File Reference

      Go to the source code of this file. @@ -16,7 +16,7 @@
       Class for jrn. More...
      -


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__own_8php-source.html b/doc/developper/html/class__own_8php-source.html index d2863f0b7..9de2f5ee8 100644 --- a/doc/developper/html/class__own_8php-source.html +++ b/doc/developper/html/class__own_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_own.php Source File +phpcompta: class_own.php Source File +include

      class_own.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -61,7 +61,7 @@
       00073   }
       00074 
       00075 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__own_8php.html b/doc/developper/html/class__own_8php.html index 14dd2ce3a..e21fc0104 100644 --- a/doc/developper/html/class__own_8php.html +++ b/doc/developper/html/class__own_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_own.php File Reference +phpcompta: class_own.php File Reference +include

      class_own.php File Reference

      Class to manage the company parameter (address, name...). More...

      @@ -23,7 +23,7 @@ Class to manage the company parameter (address, name...).

      -Definition in file class_own.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_own.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__parm__code_8php-source.html b/doc/developper/html/class__parm__code_8php-source.html index 01fd11033..f7b0063ce 100644 --- a/doc/developper/html/class__parm__code_8php-source.html +++ b/doc/developper/html/class__parm__code_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_parm_code.php Source File +phpcompta: class_parm_code.php Source File +include

      class_parm_code.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -114,7 +114,7 @@
       00152   }
       00153 
       00154 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__parm__code_8php.html b/doc/developper/html/class__parm__code_8php.html index ba853f05a..ccc800e4c 100644 --- a/doc/developper/html/class__parm__code_8php.html +++ b/doc/developper/html/class__parm__code_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_parm_code.php File Reference +phpcompta: class_parm_code.php File Reference +include

      class_parm_code.php File Reference

      Manage the table parm_code which contains the custom parameter for the module accountancy. More...

      @@ -23,7 +23,7 @@ Manage the table parm_code which c

      -Definition in file class_parm_code.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_parm_code.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__poste_8php-source.html b/doc/developper/html/class__poste_8php-source.html index 304505381..82bdf3652 100644 --- a/doc/developper/html/class__poste_8php-source.html +++ b/doc/developper/html/class__poste_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_poste.php Source File +phpcompta: class_poste.php Source File +include

      class_poste.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -76,11 +76,11 @@
       00087                   pcm_val=".$this->id);
       00088       if ( pg_NumRows($ret) != 0) {
       00089         $r=pg_fetch_array($ret);
      -00090         $this->name=$r['pcm_lib'];
      +00090         $this->name=$r['pcm_lib'];
       00091       } else {
      -00092         $this->name="Poste inconnu";
      +00092         $this->name="Poste inconnu";
       00093       }
      -00094     return $this->name;
      +00094     return $this->name;
       00095   }
       00100   function get()
       00101     {
      @@ -130,7 +130,7 @@
       00158                'solde'=>abs($r['sum_deb']-$r['sum_cred']));
       00159 }
       00160 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__poste_8php.html b/doc/developper/html/class__poste_8php.html index 361686eed..34a2555a7 100644 --- a/doc/developper/html/class__poste_8php.html +++ b/doc/developper/html/class__poste_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_poste.php File Reference +phpcompta: class_poste.php File Reference +include

      class_poste.php File Reference

      Manage the account. More...

      @@ -23,7 +23,7 @@ Manage the account.

      -Definition in file class_poste.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_poste.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__rapport_8php-source.html b/doc/developper/html/class__rapport_8php-source.html index 4905733c7..d1310bbcd 100644 --- a/doc/developper/html/class__rapport_8php-source.html +++ b/doc/developper/html/class__rapport_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_rapport.php Source File +phpcompta: class_rapport.php Source File +include

      class_rapport.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -34,14 +34,14 @@
       00033   function rapport($p_cn,$p_id) {
       00034     $this->db=$p_cn;
       00035     $this->id=$p_id;
      -00036     $this->name='UNDEF';
      +00036     $this->name='UNDEF';
       00037   }
       00040   function GetName() {
       00041     $ret=execSql($this->db,"select fr_label from formdef where fr_id=".$this->id);
      -00042     if (pg_NumRows($ret) == 0) return $this->name;
      +00042     if (pg_NumRows($ret) == 0) return $this->name;
       00043     $a=pg_fetch_array($ret,0);
      -00044     $this->name=$a['fr_label'];
      -00045     return $this->name;
      +00044     $this->name=$a['fr_label'];
      +00045     return $this->name;
       00046   }
       00053    function GetRow($p_start,$p_end) {
       00054 
      @@ -72,7 +72,7 @@
       00079   }
       00080 }
       00081 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__rapport_8php.html b/doc/developper/html/class__rapport_8php.html index 83ec7e3a2..825d0ef8b 100644 --- a/doc/developper/html/class__rapport_8php.html +++ b/doc/developper/html/class__rapport_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_rapport.php File Reference +phpcompta: class_rapport.php File Reference +include

      class_rapport.php File Reference

      Create, view, modify and parse report. More...

      @@ -23,7 +23,7 @@ Create, view, modify and parse report.

      -Definition in file class_rapport.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_rapport.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__user_8php-source.html b/doc/developper/html/class__user_8php-source.html index cb6824917..4a89b9897 100644 --- a/doc/developper/html/class__user_8php-source.html +++ b/doc/developper/html/class__user_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_user.php Source File +phpcompta: class_user.php Source File +include

      class_user.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -50,7 +50,7 @@
       00051     $this->admin=( isset($_SESSION['use_admin']) )?$_SESSION['use_admin']:0;
       00052     
       00053     if ( isset($_SESSION['use_name']) )
      -00054       $this->name=$_SESSION['use_name'];
      +00054       $this->name=$_SESSION['use_name'];
       00055     if ( isset($_SESSION['use_first_name']) )
       00056       $this->first_name=$_SESSION['use_first_name'];
       00057     } 
      @@ -70,7 +70,7 @@
       00071       if (($Max=pg_NumRows($Res)) == 0 ) return -1;
       00072       $row=pg_fetch_array($Res,0);
       00073       $this->first_name=$row['use_first_name'];
      -00074       $this->name=$row['use_name'];
      +00074       $this->name=$row['use_name'];
       00075       $this->active=$row['use_active'];
       00076       $this->login=$row['use_login'];
       00077       $this->admin=$row['use_admin'];
      @@ -101,7 +101,7 @@
       00107               $_SESSION['use_first_name']=$r['use_first_name'];
       00108               
       00109               $this->admin=$_SESSION['use_admin'];
      -00110               $this->name=$_SESSION['use_name'];
      +00110               $this->name=$_SESSION['use_name'];
       00111               $this->first_name=$_SESSION['use_first_name'];
       00112               $this->GetGlobalPref();
       00113 
      @@ -220,7 +220,7 @@
       00277   }
       00278   // save array into g_ variable
       00279   $array_pref=array ('g_theme'=>'THEME','g_pagesize'=>'PAGESIZE');
      -00280   foreach ($array_pref as $name=>$parameter ) {
      +00280   foreach ($array_pref as $name=>$parameter ) {
       00281           if ( ! isset ($line[$parameter]) ) {
       00282                   echo_debug("Missing pref : ".$parameter);
       00283                   $this->insert_default_global_pref($parameter);
      @@ -241,14 +241,14 @@
       00306         $Sql="insert into user_global_pref(user_id,parameter_type,parameter_value) 
       00307                                 values ('%s','%s','%s')";
       00308         if ( $p_type == "" ) {
      -00309                 foreach ( $default_parameter as $name=>$value) {
      -00310                         $Insert=sprintf($Sql,$this->id,$name,$value);
      +00309                 foreach ( $default_parameter as $name=>$value) {
      +00310                         $Insert=sprintf($Sql,$this->id,$name,$value);
       00311                         ExecSql($cn,$Insert);
       00312                 }
       00313         }
       00314         else {
       00315                 $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
      -00316                 $Insert=sprintf($Sql,$this->id,$p_type,$value);
      +00316                 $Insert=sprintf($Sql,$this->id,$p_type,$value);
       00317                 ExecSql($cn,$Insert);
       00318         }
       00319 
      @@ -263,7 +263,7 @@
       00336                         where parameter_type='%s' and 
       00337                                 user_id='%s'";
       00338         $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
      -00339         $Update=sprintf($Sql,$value,$p_type,$this->id);
      +00339         $Update=sprintf($Sql,$value,$p_type,$this->id);
       00340         ExecSql($cn,$Update);
       00341 
       00342  }//end function
      @@ -277,7 +277,7 @@
       00353 
       00354 }
       00355 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__user_8php.html b/doc/developper/html/class__user_8php.html index a59360034..a6533d993 100644 --- a/doc/developper/html/class__user_8php.html +++ b/doc/developper/html/class__user_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_user.php File Reference +phpcompta: class_user.php File Reference +include

      class_user.php File Reference

      Data & function about connected users. More...

      @@ -23,7 +23,7 @@ Data & function about connected users.

      -Definition in file class_user.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_user.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__widget_8php-source.html b/doc/developper/html/class__widget_8php-source.html index 670bdad5c..dbdb8c185 100644 --- a/doc/developper/html/class__widget_8php-source.html +++ b/doc/developper/html/class__widget_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_widget.php Source File +phpcompta: class_widget.php Source File +include

      class_widget.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -47,7 +47,7 @@
       00067     $this->size=20;
       00068     $this->width=50;
       00069     $this->heigh=20;
      -00070     $this->value="";
      +00070     $this->value="";
       00071     $this->selected="";
       00072     $this->table=0;
       00073     $this->label="";
      @@ -60,8 +60,8 @@
       00089   function IOValue($p_name=null,$p_value=null,$p_label="") {
       00090     
       00091     if ( $p_name != null)
      -00092       $this->name=$p_name;
      -00093     $this->value=($p_value===null)?$this->value:$p_value;
      +00092       $this->name=$p_name;
      +00093     $this->value=($p_value===null)?$this->value:$p_value;
       00094     $this->label=($p_label == "")?$this->label:$p_label;
       00095     
       00096     // Input text type
      @@ -69,7 +69,7 @@
       00098     if (strtoupper($this->type)=="TEXT") {
       00099       if ( $this->readonly==false) {
       00100         $r="<INPUT style=\"border:solid 1px blue;\" TYPE=\"TEXT\" NAME=\"$this->name\" VALUE=\"$this->value\" TABINDEX=\"$this->tabindex\" SIZE=\"$this->size\" ".$disabled.">";} else {
      -00101             $r=sprintf('<span>%s</span><input type="hidden" name="%s" value="%s">', $this->value,$this->name,$this->value);
      +00101             $r=sprintf('<span>%s</span><input type="hidden" name="%s" value="%s">', $this->value,$this->name,$this->value);
       00102         }
       00103         
       00104       if ($this->table==1) {
      @@ -83,7 +83,7 @@
       00112     }
       00113     // Hidden field
       00114     if (strtoupper($this->type)=="HIDDEN") {
      -00115       $r='<INPUT TYPE="HIDDEN" name="'.$this->name.'" value="'.$this->value.'">';
      +00115       $r='<INPUT TYPE="HIDDEN" name="'.$this->name.'" value="'.$this->value.'">';
       00116       if ( $this->readonly==true) return "";
       00117       return $r;
       00118     }
      @@ -95,9 +95,9 @@
       00124           $r="<SELECT  NAME=\"$this->name\">";
       00125           for ( $i=0;$i<sizeof($this->value);$i++) 
       00126             {
      -00127               $checked=($this->selected==$this->value[$i]['value'])?"SELECTED":"";
      +00127               $checked=($this->selected==$this->value[$i]['value'])?"SELECTED":"";
       00128               $r.='<OPTION VALUE="'.$this->value[$i]['value'].'" '.$checked.'>';
      -00129               $r.=$this->value[$i]['label'];
      +00129               $r.=$this->value[$i]['label'];
       00130             }
       00131           $r.="</SELECT>";
       00132         } else 
      @@ -106,7 +106,7 @@
       00135             echo_debug('class_widget.php',__LINE__,"this->selected = ".$this->selected); 
       00136             for ( $i=0;$i<sizeof($this->value);$i++) 
       00137               {
      -00138                 echo_debug('class_widget.php',__LINE__,"check for ".$this->value[$i]['value']);
      +00138                 echo_debug('class_widget.php',__LINE__,"check for ".$this->value[$i]['value']);
       00139                 if ($this->selected==$this->value[$i]['value'] ) 
       00140                   {
       00141                     $r=$this->value[$i]['label'];
      @@ -123,7 +123,7 @@
       00152     // Password
       00153     if (strtoupper($this->type)=="PASSWORD") {
       00154       if ( $this->readonly==true) return "";
      -00155       $r='<input type="password" name="'.$this->name;
      +00155       $r='<input type="password" name="'.$this->name;
       00156       $r.='">';
       00157       if ($this->table==1) {
       00158         $r="<TD> $this->label </TD><TD> $r </TD>";
      @@ -135,13 +135,13 @@
       00164     if (strtoupper($this->type)=="CHECKBOX") {
       00165       if ( $this->readonly == true) {
       00166         $check=( $this->selected==true )?"checked":"unchecked";
      -00167         $r='<input type="CHECKBOX" name="'.$this->name.'"';
      +00167         $r='<input type="CHECKBOX" name="'.$this->name.'"';
       00168         $r.="  $check";
       00169         $r.=' disabled>';
       00170 
       00171       } else {
       00172         $check=( $this->selected==true )?"checked":"unchecked";
      -00173         $r='<input type="CHECKBOX" name="'.$this->name.'"';
      +00173         $r='<input type="CHECKBOX" name="'.$this->name.'"';
       00174         $r.="  $check";
       00175         $r.=' '.$disabled.'>';
       00176       }
      @@ -160,7 +160,7 @@
       00189         $r=$check;
       00190       } else {
       00191         $check=( $this->selected==true||$this->selected=='t' )?"checked":"unchecked";
      -00192         $r='<input type="RADIO" name="'.$this->name.'"';
      +00192         $r='<input type="RADIO" name="'.$this->name.'"';
       00193         $r.=" VALUE=\"$this->value\"";
       00194         $r.="  $check";
       00195         $r.=' '.$disabled.'>';
      @@ -177,17 +177,17 @@
       00206     if (strtoupper($this->type)=="TEXTAREA") {
       00207       if ( $this->readonly == false ) {
       00208         $r="";
      -00209         $r.='<TEXTAREA name="'.$this->name.'"';
      +00209         $r.='<TEXTAREA name="'.$this->name.'"';
       00210         $r.=" rows=\"$this->heigh\" ";
       00211         $r.=" cols=\"$this->width\" ";
       00212         $r.=' '.$disabled.'>';
      -00213         $r.=$this->value;
      +00213         $r.=$this->value;
       00214 
       00215         $r.="</TEXTAREA>";
       00216       } else {
       00217         $r='<p>';
      -00218         $r.=$this->value;
      -00219         $r.=sprintf('<input type="hidden" name="%s" value="%s">',
      +00218         $r.=$this->value;
      +00219         $r.=sprintf('<input type="hidden" name="%s" value="%s">',
       00220                     $this->name,urlencode($this->value));
       00221         $r.='</p>';
       00222 
      @@ -226,7 +226,7 @@
       00260             //  Removing new line
       00261             
       00262             //      $msg=urlencode($this->value);
      -00263             $msg=$this->value;
      +00263             $msg=$this->value;
       00264             $msg=str_replace("%OA","",$msg);
       00265             $msg=str_replace("%OD","",$msg);
       00266             $msg=str_replace("\n","",$msg);
      @@ -253,7 +253,7 @@
       00287     //file
       00288     if (strtoupper($this->type)=="FILE") {
       00289       if ( $this->readonly == false ) {
      -00290         $r='<INPUT TYPE="file" name="'.$this->name.'" VALUE="'.$this->value.'">';
      +00290         $r='<INPUT TYPE="file" name="'.$this->name.'" VALUE="'.$this->value.'">';
       00291 
       00292       }
       00293       if ( $this->table==1) $r="<TD>$this->label</TD><TD>$r</TD>"; 
      @@ -267,7 +267,7 @@
       00301       // Do we need to filter ??
       00302       if ( $this->extra2 == null ) {
       00303       $r=sprintf('<TD>
      -00304          <INPUT TYPE="button" onClick=SearchPoste(\'%s\',\'%s\',\'%s\') value="Search">
      +00304          <INPUT TYPE="button" onClick=SearchPoste(\'%s\',\'%s\',\'%s\') value="Search">
       00305             %s</TD><TD> 
       00306 
       00307              <INPUT   TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
      @@ -282,7 +282,7 @@
       00316 
       00317     } else { // $p_list is not null, so we have a filter
       00318       $r=sprintf('<TD>
      -00319          <INPUT TYPE="button" onClick=SearchPosteFilter(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
      +00319          <INPUT TYPE="button" onClick=SearchPosteFilter(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
       00320             %s</TD><TD> 
       00321 
       00322              <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
      @@ -298,7 +298,7 @@
       00332 
       00333       } //else
       00334       } else {
      -00335       $r=sprintf('<TD><input type="hidden" name="%s" value="%s">
      +00335       $r=sprintf('<TD><input type="hidden" name="%s" value="%s">
       00336                   %s
       00337 
       00338                  </TD>',
      @@ -317,9 +317,9 @@
       00351     $l_sessid=$_REQUEST['PHPSESSID'];
       00352     if  ( $this->readonly == false ) {
       00353       $r=sprintf('<TD>
      -00354          <INPUT TYPE="button" onClick=NewCard(\'%s\',\'%s\',\'%s\',\'%s\') value="New">
      +00354          <INPUT TYPE="button" onClick=NewCard(\'%s\',\'%s\',\'%s\',\'%s\') value="New">
       00355          </TD><TD>
      -00356          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
      +00356          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
       00357             %s <INPUT TYPE="Text"    NAME="%s" VALUE="%s" SIZE="8" TABINDEX="%s">
       00358                  ',
       00359                $l_sessid,
      @@ -358,7 +358,7 @@
       00394       if ( $this->table==1)
       00395         {
       00396           $r=sprintf('<TD>
      -00397          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
      +00397          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
       00398             %s</TD><TD> <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8" TABINDEX="%s">
       00399                  ',
       00400                $l_sessid,
      @@ -374,7 +374,7 @@
       00410       else
       00411         {
       00412           $r=sprintf('
      -00413          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
      +00413          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
       00414             %s <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8" TABINDEX="%s">           ',
       00415                $l_sessid,
       00416                $this->extra,
      @@ -437,7 +437,7 @@
       00473     if ( $this->readonly == false) {
       00474       $l_sessid=$_REQUEST['PHPSESSID'];
       00475       $r=sprintf('<TD>
      -00476          <INPUT TYPE="button" onClick=SearchJrn(\'%s\',\'%s\') value="Search">
      +00476          <INPUT TYPE="button" onClick=SearchJrn(\'%s\',\'%s\') value="Search">
       00477             %s</TD><TD> 
       00478 
       00479              <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
      @@ -450,7 +450,7 @@
       00486                  );
       00487     } else {
       00488       $r=sprintf("<TD><span>%s</span>",$this->value);
      -00489       $r.=sprintf('<input type="hidden" name="%s" value="%s"></TD>', $this->name,$this->value);
      +00489       $r.=sprintf('<input type="hidden" name="%s" value="%s"></TD>', $this->name,$this->value);
       00490     }
       00491 
       00492     return $r;
      @@ -462,7 +462,7 @@
       00498   function debug() {
       00499     echo "Type ".$this->type."<br>";
       00500     echo "name ".$this->name."<br>";
      -00501     echo "value". $this->value."<br>";
      +00501     echo "value". $this->value."<br>";
       00502     $readonly=($this->readonly==false)?"false":"true";
       00503     echo "read only".$readonly."<br>";
       00504   }
      @@ -474,7 +474,7 @@
       00510   }
       00511 
       00512 }
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/class__widget_8php.html b/doc/developper/html/class__widget_8php.html index 3b3af5c7d..a31407ae2 100644 --- a/doc/developper/html/class__widget_8php.html +++ b/doc/developper/html/class__widget_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/class_widget.php File Reference +phpcompta: class_widget.php File Reference +include

      class_widget.php File Reference

      This class is used to create all the HTML INPUT TYPE. More...

      @@ -23,7 +23,7 @@ This class is used to create all the HTML INPUT TYPE.

      -Definition in file class_widget.php.


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file class_widget.php.
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/classaction.html b/doc/developper/html/classaction.html index c11f003e6..a7214c67a 100644 --- a/doc/developper/html/classaction.html +++ b/doc/developper/html/classaction.html @@ -28,7 +28,7 @@  SaveStage2 ()  Save the document and propose to save the generated document or to upload one, the data are included except the file. Temporary the generated document is savethe ag_comment is already urlencoded.
      SaveStage3 ($d_id) + SaveStage3 ($d_id)  Upload the document or save the generated document.
       myList ($p_filter="", $p_search="") @@ -37,9 +37,6 @@  Update ()  Update the data into the database.
      GetAgRef ($p_method) - - GetAgRef returns the ag_ref value of the ag_id or ag_ref_ag_id passed as parameter. This function doesn't change the current object.

      Data Fields

       $db @@ -108,9 +105,16 @@ constructor
      Parameters:

      -Definition at line 76 of file class_action.php. +Definition at line 78 of file class_action.php.

      -References f_id. +References f_id.

      00079     {
      +00080       $this->db=$p_cn;
      +00081       $this->f_id=0;
      +00082 
      +00083     }
      +
      +

      +


      Member Function Documentation

      @@ -145,9 +149,137 @@ Confirm

      Todo:
      add the hour

      -Definition at line 325 of file class_action.php. +Definition at line 358 of file class_action.php.

      -References $a, $desc, $f_id, $h_url, $r, $retour, ag_comment, ag_timestamp, d_state, dt_id, echo_debug(), ExecSql(), f_id, fiche, FormatString(), isDate(), make_array(), name, and value. +References $a, $desc, $f_id, $h_url, $r, $retour, ag_comment, ag_timestamp, d_state, dt_id, echo_debug(), ExecSql(), f_id, fiche, FormatString(), isDate(), make_array(), name, and value.

      00359     {
      +00360       echo_debug('class_action',__LINE__,'confirm()  :'.var_export($_POST,true));
      +00361       echo_debug('class_action',__LINE__,'confirm $this  :'.var_export($this,true));
      +00363       if ( isDate($this->ag_timestamp) == null )
      +00364         {
      +00365           // if the date is invalid, default date is today
      +00366           $this->ag_timestamp=date("d.m.Y");
      +00367         }
      +00368       // Compute the widget
      +00369       // Date 
      +00370       $date=new widget("text");
      +00371       $date->readonly=true;
      +00372       $date->name="ag_timestamp";
      +00373       $date->value=$this->ag_timestamp;
      +00374       // Doc Type
      +00375       $doc_type=new widget("hidden");
      +00376       $doc_type->name="dt_id";
      +00377       $doc_type->value=$this->dt_id;
      +00378       $a=ExecSql($this->db,"select dt_value from document_type where dt_id=".$this->dt_id);
      +00379       $v=pg_fetch_array($a,0);
      +00380       $str_type=$v[0];
      +00381       if ( isset ($_REQUEST['url'])) 
      +00382         {
      +00383           $retour=sprintf('<A HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
      +00384           $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
      +00385         }
      +00386       else 
      +00387         { 
      +00388           $retour="";
      +00389           $h_url="";
      +00390         }
      +00391 
      +00392       // state
      +00393       $a=ExecSql($this->db,"select s_value from document_state where s_id=".$this->d_state);
      +00394       $v=pg_fetch_array($a,0);
      +00395       $str_state=$v[0];
      +00396       $state=new widget("hidden");
      +00397       $state->name="d_state";
      +00398       $state->value=$this->d_state;
      +00399         
      +00400       // title
      +00401       $title=new widget("text");
      +00402       $title->readonly=true;
      +00403       $title->name="ag_title";
      +00404       $title->value=FormatString($this->ag_title);
      +00405 
      +00406       // Description
      +00407       $desc=new widget('textarea');
      +00408       $desc->name="ag_comment";
      +00409       $desc->readonly=" disabled ";
      +00410       $desc->value=$this->ag_comment;
      +00411       // Propose to generate a document
      +00412       $gen=new widget ("checkbox");
      +00413       $gen->name="p_gen";
      +00414       $doc_gen=new widget("select");
      +00415       $doc_gen->name="gen_doc";
      +00416       $doc_gen->value=make_array($this->db,
      +00417                                  "select md_id,md_name from document_modele where md_type=".$this->dt_id);
      +00418 
      +00419       $h_agrefid=new widget('hidden');
      +00420 
      +00421        // f_id
      +00422        if ( trim($this->qcode_dest) =="")
      +00423          {
      +00424            // internal document
      +00425            $f_id_dest=0; // internal document
      +00426            $namedest="interne";
      +00427          }
      +00428        else // ( trim($this->qcode_dest) !=""  )
      +00429          {
      +00430            $tiers=new fiche($this->db);
      +00431            $tiers->GetByQCode($this->qcode_dest);
      +00432            $f_id=$tiers->id;
      +00433            $namedest=$tiers->strAttribut(1);
      +00434                 if ( $namedest == '- ERROR  -') $this->f_id_dest=-1;    
      +00435          }
      +00436  
      +00437        // f_id
      +00438        if ( trim($this->qcode_exp) =="")
      +00439          {
      +00440            // internal document
      +00441            $f_id_exp=0; // internal document
      +00442            $nameexp="interne";
      +00443          }
      +00444        else // ( trim($this->qcode_exp) !=""  )
      +00445          {
      +00446            $tiers=new fiche($this->db);
      +00447            $tiers->GetByQCode($this->qcode_exp);
      +00448            $f_id=$tiers->id;
      +00449            $nameexp=$tiers->strAttribut(1);
      +00450                 if ( $nameexp == '- ERROR  -') $this->f_id_exp=-1;      
      +00451          }
      +00452  
      +00453 
      +00454 
      +00455       // Preparing the return string
      +00456       $r=$retour."<form method=\"post\">";
      +00457       $r.="<p>Date : ".$date->IOValue()."</p>";
      +00458       $r.="<p>Etat $str_state".$state->IOValue()."</p>";
      +00459       $r.="<p>Type du document $str_type".$doc_type->IOValue()."</p>";
      +00460       $r.="<p> Expediteur : ".$this->qcode_exp." ".$nameexp.'</p>';
      +00461       $r.="<p> Destinataire : ".$this->qcode_dest." ".$namedest.'</p>';
      +00462       $r.="<p> Titre : ".$title->IOValue();
      +00463       $r.="<p>Description :".$desc->IOValue()."</p>";
      +00464 
      +00465       // if no document exist for this type then do not display the question
      +00466       if ( sizeof($doc_gen->value) != 0) 
      +00467         $r.="<p> G&eacute;n&eacute;rer un document ".$gen->IOValue()." ".$doc_gen->IOValue()."</p>";
      +00468         
      +00469 
      +00470       // Add the hidden tag
      +00471       $r.='<input type="hidden" name="sa" value="save_action_st2">';
      +00472       $r.='<input type="hidden" name="p_action" value="suivi_courrier">';
      +00473       $r.='<input type="hidden" name="tiers" value="'.$this->qcode_dest.'">';
      +00474       $r.=      $h_agrefid->IOValue("ag_ref_ag_id",$this->ag_ref_ag_id);
      +00475         
      +00476       // retrieve customer
      +00477 
      +00478 
      +00479       if ( $f_id != -1 )
      +00480         $r.=$desc->Submit("Save","Sauve");
      +00481       $r.=$desc->Submit("corr","Corrige");
      +00482 
      +00483       $r.=$h_url."</form>";
      +00484       return $r;
      +00485     }
      +
      +

      +

      @@ -197,11 +329,217 @@ Display

      Note:
      If ag_id is not equal to zero then
      Returns:
      string containing the html code

      -Definition at line 99 of file class_action.php. +Definition at line 101 of file class_action.php.

      -References $a, $d_id, $desc, $doc, $r, $sp, $w, ag_id, ag_ref, ag_ref_ag_id, ag_timestamp, CountSql(), d_id, d_state, dt_id, echo_debug(), exit, f_id, fiche, FormatString(), GetAgRef(), getDbValue(), make_array(), myList(), and qcode. +References $a, $d_id, $desc, $doc, $r, $sp, $w, ag_id, ag_ref, ag_ref_ag_id, ag_timestamp, CountSql(), d_id, d_state, dt_id, echo_debug(), exit, f_id, fiche, FormatString(), getDbValue(), make_array(), qcode_dest, and qcode_exp.

      -Referenced by SaveStage2(). +Referenced by SaveStage2().

      00102     {
      +00103       echo_debug('class_action',__LINE__,'Display()  :'.var_export($_POST,true));
      +00104       echo_debug('class_action',__LINE__,'Display $this  :'.var_export($this,true));
      +00105 
      +00106 
      +00107       if ( $p_view=='UPD')
      +00108         {
      +00109           $upd=true;    
      +00110           $readonly=false;
      +00111         }
      +00112       elseif ($p_view=="NEW")
      +00113         {
      +00114           $upd=false;
      +00115           $readonly=false;
      +00116         }
      +00117       elseif ($p_view=='READ')
      +00118         {
      +00119           $upd=true;
      +00120           $readonly=true;
      +00121         }
      +00122       else
      +00123         {
      +00124           exit('class_action'.__LINE__.'action::Display error unknown parameter'.$p_view);
      +00125 
      +00126         }
      +00127       // Compute the widget
      +00128       // Date 
      +00129       $date=new widget("text");
      +00130       $date->readonly=$readonly;
      +00131       $date->name="ag_timestamp";
      +00132       $date->value=$this->ag_timestamp;
      +00133       
      +00134       
      +00135       // for insert mode only
      +00136       if ( $upd == false )
      +00137         {
      +00138           // Doc Type
      +00139           $doc_type=new widget("select");
      +00140           $doc_type->name="dt_id";
      +00141           $doc_type->value=make_array($this->db,"select dt_id,dt_value from document_type where dt_id in (".ACTION.")");
      +00142           $doc_type->selected=$this->dt_id;
      +00143           $doc_type->readonly=false;
      +00144           $str_doc_type=$doc_type->IOValue();
      +00145           echo_debug('class_action',__LINE__,var_export($doc_type,true));
      +00146         }
      +00147       else {
      +00148         // Doc Type
      +00149         $doc_type=new widget("hidden");
      +00150         $doc_type->name="dt_id";
      +00151         $doc_type->value=$this->dt_id;
      +00152         $str_doc_type=$doc_type->IOValue()." ".getDbValue($this->db,"select dt_value from document_type where dt_id=".$this->dt_id);
      +00153       }
      +00154 
      +00155       // Description
      +00156       $desc=new widget('RICHTEXT');
      +00157       $desc->width=500;
      +00158       $desc->heigh=250;
      +00159       $desc->name="ag_comment";
      +00160       $desc->readonly=$readonly;
      +00161       $desc->value=urldecode($this->ag_comment);
      +00162 
      +00163       // state
      +00164       // Retrieve the value
      +00165       if ( $p_view != 'READ' )
      +00166         {
      +00167           $a=make_array($this->db,"select s_id,s_value from document_state ");
      +00168           $state=new widget("select");
      +00169           $state->readonly=$readonly;
      +00170           $state->name="d_state";
      +00171           $state->value=$a;
      +00172           $state->selected=$this->d_state;
      +00173           $str_state=$state->IOValue();
      +00174         } else {
      +00175           $str_state=getDbValue($this->db,"select s_value from document_state where s_id=".$this->d_state);
      +00176           $g=new widget("hidden");
      +00177           $str_state.=$g->IOValue('d_state',$this->d_state);
      +00178         }
      +00179       // Retrieve the value if there is an attached doc
      +00180       $doc_ref="";
      +00181       // Document id
      +00182 
      +00183       $h2=new widget("hidden");
      +00184       $h2->name="d_id";
      +00185       $h2->value=$this->d_id;
      +00186       
      +00187       if ( $this->d_id != 0 && $this->d_id != "" )
      +00188         {
      +00189           $h2->readonly=($p_view=='NEW')?false:true;
      +00190           $doc=new Document($this->db,$this->d_id);
      +00191           $d_id=new widget("hidden");
      +00192           $doc_ref="<p> Document ".$doc->a_ref().'</p>';
      +00193           $doc_ref.=$h2->IOValue().$d_id->IOValue('d_id',$this->d_id);
      +00194           
      +00195         }
      +00196 
      +00197 
      +00198       // title
      +00199       $title=new widget("text");
      +00200       $title->readonly=$readonly;
      +00201       $title->name="ag_title";
      +00202       $title->value=FormatString($this->ag_title);
      +00203 
      +00204       // ag_ref
      +00205       // Always false for update
      +00206       $ag_ref=new widget("text");
      +00207       $ag_ref->readonly=true;
      +00208       $ag_ref->name="ag_ref";
      +00209       $ag_ref->value=FormatString($this->ag_ref);
      +00210       $client_label=new widget("span");
      +00211 
      +00212       // f_id_dest destination
      +00213       if ( $this->qcode_dest != '- ERROR -' && trim($this->qcode_dest) != "")
      +00214         {
      +00215           $tiers=new fiche($this->db);
      +00216           $tiers->GetByQCode($this->qcode_dest);
      +00217           $qcode_dest_label=$tiers->strAttribut(1);
      +00218         } else {
      +00219           //      echo "f_id $this->f_id";
      +00220           $qcode_dest_label=($this->f_id==0 || trim($this->qcode_dest)=="")?'Interne ':'Error';
      +00221         }
      +00222       // f_id_exp sender
      +00223       if ( $this->qcode_exp != '- ERROR -' && trim($this->qcode_exp) != "")
      +00224         {
      +00225           $tiers=new fiche($this->db);
      +00226           $tiers->GetByQCode($this->qcode_exp);
      +00227           $qcode_exp_label=$tiers->strAttribut(1);
      +00228         } else {
      +00229           echo "f_id $this->f_id";
      +00230           $qcode_exp_label=($this->f_id_exp==0 || trim($this->qcode_exp)=="")?'Interne ':'Error';
      +00231         }
      +00232 
      +00233       $h_ag_id=new widget("hidden");
      +00234       // if concerns another action : show the link otherwise nothing
      +00235       $lag_ref_ag_id="";
      +00236       
      +00237       if ( $this->ag_ref_ag_id != 0 )
      +00238         {
      +00239     //      $this->GetAgRef("ag_ref_ag_id")."</A>";
      +00240 
      +00241           $lag_ref_ag_id='<a class="mtitle" href="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.
      +00242             $this->ag_ref_ag_id.'">'.
      +00243             $this->getDBValue($this->db,"select ag_ref from action_gestion where ag_id=".$this->ag_ref_ag_id).
      +00244             "</A>";
      +00245         }  
      +00246       // sender
      +00247       $w=new widget('js_search_only');
      +00248       $w->readonly=$readonly;
      +00249       $w->name='qcode_exp';
      +00250       $w->value=($this->f_id_exp != 0)?$this->qcode_exp:"";
      +00251       $w->label="";
      +00252       $w->extra='4,8,9,14,16';
      +00253       $sp= new widget("span");
      +00254       $h_agrefid=new widget('hidden');
      +00255       // destination
      +00256       $wdest=new widget('js_search_only');
      +00257       $wdest->readonly=$readonly;
      +00258       $wdest->name='qcode_dest';
      +00259       $wdest->value=($this->f_id_dest != 0)?$this->qcode_dest:"";
      +00260       $wdest->label="";
      +00261       $wdest->extra='4,8,9,14,16';
      +00262       $spdest= new widget("span");
      +00263       $h_agrefid=new widget('hidden');
      +00264 
      +00265       // Preparing the return string
      +00266       $r="";
      +00267       $r.=JS_SEARCH_CARD;
      +00268       $r.= "<p>Date : ".$date->IOValue()." Reference  ". $this->ag_ref."</p>";
      +00269       $r.="<p>Concerne :".$lag_ref_ag_id."</p>";
      +00270       $r.= '<p>Type d\' action';
      +00271       echo_debug('class_action',__LINE__,"str_doc_type $str_doc_type");
      +00272       $r.= $str_doc_type."</p>";
      +00273 
      +00274       // state
      +00275       $r.="<p>Etat :".$str_state;
      +00276 
      +00277 
      +00278       $r.= "</p><p> ";
      +00279       $r.=$w->IOValue();
      +00280       $r.=$sp->IOValue('qcode_exp_label',$qcode_exp_label)."</TD></TR>";
      +00281  
      +00282       $r.=$wdest->IOValue();
      +00283       $r.=$spdest->IOValue('qcode_dest_label',$qcode_dest_label)."</TD></TR>";
      +00284 
      +00285 
      +00286       $r.="</p>";
      +00287       echo_debug('class_action',__LINE__,' ag_id is '.$this->ag_id);
      +00288 
      +00289       $r.= "<p> Titre : ".$title->IOValue().' Ref :'.$ag_ref->IOValue();
      +00290       $r.= $doc_ref;
      +00291       $r.= "<p>Description :".$desc->IOValue()."</p>";
      +00292 
      +00293       //hidden
      +00294       $r.="<p>";
      +00295       $r.=$h2->IOValue();
      +00296       $r.=$h_agrefid->IOValue("ag_ref_ag_id",$this->ag_ref_ag_id); 
      +00297       $r.=$h_ag_id->IOValue('ag_id',$this->ag_id);
      +00298       $r.="</p>";
      +00299 
      +00300       // show the list of the concern operation
      +00301       if ( CountSql($this->db,'select * from action_gestion where ag_ref_ag_id!=0 and ag_ref_ag_id='.$this->ag_id);
      +00302         $r.=$this->myList(ACTION," and ag_ref_ag_id=".$this->ag_id);
      +00303       return $r;
      +00304  
      +00305     }
      +
      +

      +

      @@ -232,53 +570,53 @@ This function shows the detail of an action thanks the ag_id.

      -Definition at line 280 of file class_action.php. +Definition at line 309 of file class_action.php. +

      +References $r, $row, $sql, ag_comment, ag_ref, ag_ref_ag_id, ag_timestamp, ag_title, d_id, d_state, dt_id, echo_debug(), ExecSql(), fiche, qcode_dest, and qcode_exp.

      00310     {
      +00311       echo_debug('class_action',__LINE__,'Action::Get() ');
      +00312       $sql="select ag_id, ag_comment,to_char (ag_timestamp,'DD-MM-YYYY') as ag_timestamp,".
      +00313         " f_id_dest,f_id_exp,ag_title,ag_comment,ag_ref,d_id,ag_type,d_state,  ".
      +00314         " ag_ref_ag_id ".
      +00315         " from action_gestion left join document using (ag_id) where ag_id=".$this->ag_id;
      +00316       $r=ExecSql($this->db,$sql);
      +00317       $row=pg_fetch_all($r);
      +00318       if ( $row==false) return;
      +00319       $this->ag_comment=$row[0]['ag_comment'];
      +00320       $this->ag_timestamp=$row[0]['ag_timestamp'];
      +00321       $this->f_id_dest=$row[0]['f_id_dest'];
      +00322       $this->f_id_exp=$row[0]['f_id_exp'];
      +00323       $this->ag_title=$row[0]['ag_title'];
      +00324       $this->ag_type=$row[0]['ag_type'];
      +00325       $this->ag_ref=$row[0]['ag_ref'];
      +00326       $this->ag_ref_ag_id=$row[0]['ag_ref_ag_id'];
      +00327       $this->d_id=$row[0]['d_id'];
      +00328       //
      +00329       echo_debug('class_action',__LINE__,' Document id = '.$this->d_id);
      +00330       // if there is no document set 0 to d_id
      +00331       if ( $this->d_id == "" ) 
      +00332         $this->d_id=0;
      +00333       // if there is a document fill the object
      +00334       if ($this->d_id != 0 )
      +00335         {
      +00336           $this->state=$row['0']['d_state'];
      +00337           $this->d_state=$row[0]['d_state'];
      +00338         }
      +00339       echo_debug('class_action',__LINE__,' After test Document id = '.$this->d_id);
      +00340       $this->dt_id=$this->ag_type;
      +00341       $adest=new fiche($this->db,$this->f_id_dest);
      +00342       $this->qcode_dest=$adest->strAttribut(ATTR_DEF_QUICKCODE);
      +00343       $aexp=new fiche($this->db,$this->f_id_exp);
      +00344       $this->qcode_exp=$aexp->strAttribut(ATTR_DEF_QUICKCODE);
      +00345 
      +00346       echo_debug('class_action',__LINE__,'Detail end ()  :'.var_export($_POST,true));
      +00347       echo_debug('class_action',__LINE__,'Detail $this  :'.var_export($this,true));
      +00348 
      +00349     }
      +

      -References $a, $r, $row, $sql, ag_comment, ag_ref, ag_ref_ag_id, ag_timestamp, ag_title, d_id, d_state, dt_id, echo_debug(), ExecSql(), f_id, fiche, and qcode. - - -

      - - -
      - - - - - - - - - -
      action::GetAgRef p_method  ) 
      - - - - - -
      -   - - -

      -GetAgRef returns the ag_ref value of the ag_id or ag_ref_ag_id passed as parameter. This function doesn't change the current object. -

      -

      Parameters:
      - - -
      $p_method : can be ag_ref_ag_id or ag_id
      -
      -
      Returns:
      string with the ag_ref
      - -

      -Definition at line 750 of file class_action.php. -

      -References $sql. -

      -Referenced by Display().

      @@ -324,11 +662,120 @@ myList($p_filter="")
      Parameters:
      Returns:
      string containing html code

      -Definition at line 572 of file class_action.php. +Definition at line 626 of file class_action.php.

      -References $_SESSION, $bar, $doc, $limit, $offset, $page, $qcode, $r, $Res, $row, $sql, $step, ag_ref, ag_ref_ag_id, ag_title, CountSql(), d_id, ExecSql(), f_id, fiche, and jrn_navigation_bar(). +References $_SESSION, $bar, $doc, $limit, $offset, $page, $r, $Res, $row, $sql, $step, ag_ref, ag_ref_ag_id, ag_title, CountSql(), d_id, ExecSql(), fiche, and jrn_navigation_bar().

      00627     {
      +00628       $sql="
      +00629    select ag_id,to_char(ag_timestamp,'DD-MM-YYYY') as my_date,ag_ref_ag_id,f_id_dest,f_id_exp".
      +00630         ",ag_title,d_id,md_type,dt_value,ag_ref 
      +00631    from action_gestion 
      +00632       left outer join document using (ag_id)
      +00633       left outer join document_modele on (ag_type=md_type) 
      +00634       join document_type on (ag_type=dt_id)
      +00635    where dt_id in ($p_filter) $p_search order by ag_timestamp desc,ag_ref desc";
      +00636       $max_line=CountSql($this->db,$sql);
      +00637       $step=$_SESSION['g_pagesize'];
      +00638       $page=(isset($_GET['offset']))?$_GET['page']:1;
      +00639       $offset=(isset($_GET['offset']))?$_GET['offset']:0;
      +00640       $limit=" LIMIT $step OFFSET $offset ";  
      +00641       $bar=jrn_navigation_bar($offset,$max_line,$step,$page);
      +00642 
      +00643       $Res=ExecSql($this->db,$sql.$limit);
      +00644       $a_row=pg_fetch_all($Res);
      +00645       //      $r='<div class="u_redcontent">';
      +00646       $r="";
      +00647       $r.=$bar;
      +00648       $r.="<table>";
      +00649       $r.="<tr>";
      +00650       $r.="<th>Date</th>";
      +00651       $r.="<th>Destinataire</th>";
      +00652       $r.="<th>Expéditeur</th>";
      +00653       $r.="<th>Titre</th>";
      +00654       $r.="<th>type</th>";
      +00655       $r.="<th>Référence</th>";
      +00656       $r.="<th>concerne</th>";
      +00657       $r.="<th>Document</th>";
      +00658       $r.="</tr>";
      +00659 
      +00660       // if there are no records return a message
      +00661       if ( sizeof ($a_row) == 0 or $a_row == false ) 
      +00662         {
      +00663           $r='<div class="u_redcontent">';
      +00664           $r.='<hr>Aucun enregistrement trouvé';
      +00665           $r.="</div>";
      +00666           return $r;
      +00667 
      +00668         }
      +00669       echo JS_SEARCH_CARD;
      +00670       foreach ($a_row as $row )
      +00671         {
      +00672 
      +00673           $r.="<tr>";
      +00674           $r.="<td>".$row['my_date']."</td>";
      +00675           // Expediteur
      +00676           $fexp=new fiche($this->db);
      +00677           $fexp->id=$row['f_id_exp'];
      +00678           $qcode_exp=$f->strAttribut(ATTR_DEF_QUICKCODE);
      +00679 
      +00680           $qexp=($qcode_exp=="- ERROR -")?"Interne":$qcode_exp;
      +00681           $jsexp=sprintf("javascript:showfiche('%s','%s')",
      +00682                       $_REQUEST['PHPSESSID'],$qexp);
      +00683           if ( $qexp != 'Interne' )
      +00684             {
      +00685               $r.="<td>".'<A HREF="'.$jsexp.'">'.$qexp." : ".$fexp->getName().'</A></td>';
      +00686             }
      +00687           else
      +00688             $r.="<td>Interne </td>";
      +00689           // Destinataire
      +00690           $fdest=new fiche($this->db);
      +00691           $fdest->id=$row['f_id_dest'];
      +00692           $qcode_dest=$fdest->strAttribut(ATTR_DEF_QUICKCODE);
      +00693 
      +00694           $qdest=($qcode_dest=="- ERROR -")?"Interne":$qcode_dest;
      +00695           $jsdest=sprintf("javascript:showfiche('%s','%s')",
      +00696                       $_REQUEST['PHPSESSID'],$qdest);
      +00697           if ( $qdest != 'Interne' )
      +00698             {
      +00699               $r.="<td>".'<A HREF="'.$jsdest.'">'.$qdest." : ".$fdest->getName().'</A></td>';
      +00700             }
      +00701           else
      +00702             $r.="<td>Interne </td>";
      +00703 
      +00704           // show reference
      +00705           if ( $row['ag_ref_ag_id'] != 0 ) 
      +00706             {
      +00707               $retSqlStmt=ExecSql($this->db,
      +00708                                   "select ag_ref from action_gestion where ag_id=".$row['ag_ref_ag_id']);
      +00709               $retSql=pg_fetch_all($retSqlStmt);
      +00710               $ref="";
      +00711               foreach ($retSql as $line) 
      +00712                 {
      +00713                   $ref.='<A  href="commercial.php?p_action=suivi_courrier&query='.$line['ag_ref'].'">'.
      +00714                     $line['ag_ref']."<A>";
      +00715                 }
      +00716             }
      +00717           else 
      +00718             $ref="";
      +00719 
      +00720           $r.='<td><A HREF="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.$row['ag_id'].'">'.
      +00721             $row['ag_title']."</A></td>";
      +00722           $r.="<td>".$row['dt_value']."</td>";
      +00723           $r.="<td>".$row['ag_ref']."</td>";
      +00724           $r.="<td>".$ref."</td>";
      +00725           $doc=new Document($this->db,$row['d_id']);
      +00726           $r.="<td>".$doc->a_ref()."</td>";
      +00727           $r.="</tr>";
      +00728 
      +00729         }
      +00730       $r.="</table>";
      +00731 
      +00732       $r.=$bar;
      +00733       //$r.="</div>";
      +00734       return $r;
      +00735     }
      +

      -Referenced by Display(). +

      @@ -361,9 +808,102 @@ SaveStage2

      Returns:

      -Definition at line 444 of file class_action.php. +Definition at line 493 of file class_action.php.

      -References $d, $doc, $r, $sql, $str_file, $upload, ag_comment, ag_id, ag_ref, ag_title, d_state, Display(), dt_id, echo_debug(), ExecSql(), fiche, FormatString(), md_id, name, NextSequence(), and value. +References $d, $doc, $r, $sql, $str_file, $upload, ag_comment, ag_id, ag_ref, ag_title, d_state, Display(), dt_id, echo_debug(), ExecSql(), fiche, FormatString(), md_id, name, NextSequence(), and value.

      00494     {
      +00495       echo_debug('class_action',__LINE__,'saveStage2()  :'.var_export($_POST,true));
      +00496       echo_debug('class_action',__LINE__,' saveStage2()  $this  :'.var_export($this,true));
      +00497 
      +00498       // Get The sequence id, 
      +00499       $seq_name="seq_doc_type_".$this->dt_id;
      +00500       $str_file="";
      +00501       $add_file='';
      +00502       // f_id dest
      +00503       $tiers=new fiche($this->db);
      +00504       $tiers->GetByQCode($this->qcode_dest);
      +00505 
      +00506       // f_id exp
      +00507       $exp=new fiche($this->db);
      +00508       $exp->GetByQCode($this->qcode_exp);
      +00509 
      +00510       if ( trim($this->ag_title) == "") 
      +00511         {
      +00512           $doc_mod=new document_type($this->db);
      +00513           $doc_mod->dt_id=$this->dt_id;
      +00514           $doc_mod->get();
      +00515           $this->ag_title=$doc_mod->dt_value;
      +00516         }
      +00517       echo_debug('class_action',__LINE__," tiers->id  ".$tiers->id);
      +00518       $this->ag_id=NextSequence($this->db,'action_gestion_ag_id_seq');
      +00519       // Create the reference 
      +00520       $ref=$this->dt_id.'/'.$this->ag_id;
      +00521       $this->ag_ref=$ref;
      +00524       //we remove newline 
      +00525       $this->ag_comment=str_replace("%OD","",$this->ag_comment);
      +00526       $this->ag_comment=str_replace("%OA","",$this->ag_comment);
      +00527       // save into the database
      +00528       $sql=sprintf("insert into action_gestion".
      +00529                    "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,f_id_exp,ag_comment,ag_ref,ag_ref_ag_id) ".
      +00530                    " values (%d,to_date('%s','DD-MM-YYYY'),'%d','%s',%d,%d,'%s','%s',%d)",
      +00531                    $this->ag_id,
      +00532                    $this->ag_timestamp,
      +00533                    $this->dt_id,
      +00534                    FormatString($this->ag_title),
      +00535                    $tiers->id,
      +00536                    $exp->id,
      +00537                    $this->ag_comment,
      +00538                    $ref,
      +00539                    $this->ag_ref_ag_id
      +00540                    );
      +00541       ExecSql($this->db,$sql);
      +00542 
      +00543 
      +00544 
      +00545       // the lob filename and the mimetype needed if we want to generate a doc.
      +00546       if ( $this->gen == 'on' ) 
      +00547         {
      +00548           $doc=new Document($this->db);
      +00549           $doc->f_id=$tiers->id;
      +00550           $doc->md_id=$this->md_id;
      +00551           $doc->ag_id=$this->ag_id;
      +00552           $doc->d_state=$this->d_state;
      +00553           $str_file=$doc->Generate();
      +00554           $d='<input type="hidden" name="d_id" value="'.$doc->d_id.'">';
      +00555         }
      +00556       $r="";
      +00557       // readonly and upload of a file
      +00558       $r.="<hr>";
      +00559       $r.='<form enctype="multipart/form-data" method="post">';
      +00560       $r.=$this->Display('READ',false);
      +00561       // Add the hidden tag
      +00562       $r.='<input type="hidden" name="sa" value="save_action_st3">';
      +00563       $r.='<input type="hidden" name="p_action" value="suivi_courrier">';
      +00564       // add the d_id
      +00565       $r.='<input type="hidden" name="d_id" value="'.$this->d_id.'">'; 
      +00566       // ag_comment must be saved in urlcode
      +00567       $r.='<input type="hidden" name="ag_comment" value="'.urlencode($this->ag_comment).'">';
      +00568       // Value for the generated document
      +00569       if ( $this->gen == 'on' ) 
      +00570         {
      +00571           $r.='<input type="hidden" name="d_id" value="'.$doc->d_id.'">';
      +00572           $r.="Sauver le document généré :";
      +00573           $r.=$str_file;
      +00574           $checkbox=new widget("checkbox");
      +00575           $checkbox->name="save_generate";
      +00576           $r.=$checkbox->IOValue();
      +00577           $r.="<hr>";
      +00578         }
      +00579       $upload=new widget("file");
      +00580       $upload->name="file_upload";
      +00581       $upload->value="";
      +00582       $r.="Enregistrer le fichier ".$upload->IOValue();
      +00583       $r.=$upload->Submit("save","Sauve le fichier");
      +00584       $r.="</form>";
      +00585       return $r;
      +00586     }
      +
      +

      +

      @@ -400,9 +940,35 @@ SaveStage3

      Parameters:

      -Definition at line 538 of file class_action.php. +Definition at line 592 of file class_action.php.

      -References $d_id, $doc, ag_id, d_id, dt_id, and echo_debug(). +References $d_id, $doc, ag_id, d_id, dt_id, and echo_debug().

      00593     {
      +00594       echo_debug('class_action',__LINE__,'SaveStage3()  :'.var_export($_POST,true));
      +00595       echo_debug('class_action',__LINE__,'SaveStage3  :'.var_export($this,true));
      +00596 
      +00597       // if we save the generated doc
      +00598       if ( isset($_POST['save_generate']))
      +00599         {
      +00600           return;
      +00601         }
      +00602 
      +00603       // Upload a new document
      +00604       $doc=new Document($this->db);
      +00605       $doc->ag_id=$this->ag_id;
      +00606       // if there is a document and it is not an update
      +00607       if ( sizeof($_FILES) !=0 && $d_id==0) 
      +00608         {
      +00609           $doc->md_type=$this->dt_id;
      +00610           $doc->blank();
      +00611         }
      +00612       else 
      +00613         $doc->d_id=$d_id;
      +00614 
      +00615       $doc->Upload($this->ag_id);
      +00616     }
      +
      +

      +

      @@ -434,9 +1000,88 @@ Update the data into the database.

      Returns:
      true on success otherwise false

      -Definition at line 669 of file class_action.php. +Definition at line 741 of file class_action.php.

      -References $doc, $sql, ag_comment, ag_id, d_id, dt_id, echo_debug(), ExecSql(), f_id, fiche, FormatString(), and return. +References $doc, $sql, ag_comment, ag_id, d_id, dt_id, echo_debug(), ExecSql(), f_id, fiche, FormatString(), and return.

      00742     {
      +00743       echo_debug('class_action',__LINE__,'Update() $_POST()  :'.var_export($_POST,true));
      +00744       echo_debug('class_action',__LINE__,'Update()  $this  :'.var_export($this,true));
      +00745 
      +00746       // if ag_id == 0 nothing to do
      +00747       if ( $this->ag_id == 0 ) return ;
      +00748 
      +00749 
      +00750       // retrieve customer
      +00751       // f_id
      +00752      
      +00753       if ( trim($this->qcode) =="" )
      +00754         {
      +00755           // internal document
      +00756           $this->f_id=0; // internal document
      +00757         }
      +00758       else
      +00759         {
      +00760           $tiers=new fiche($this->db);
      +00761           if ( $tiers->GetByQCode($this->qcode) ==1 ) // Error we cannot retrieve this qcode
      +00762             return false; 
      +00763           else
      +00764             $this->f_id=$tiers->id;
      +00765 
      +00766         }
      +00767 
      +00768       //remove newline from ag_comment
      +00769       $this->ag_comment=str_replace("\n","",$this->ag_comment);
      +00770       $this->ag_comment=str_replace("\r","",$this->ag_comment);
      +00771 
      +00772       // url encoded
      +00773       $this->ag_comment=urlencode($this->ag_comment);
      +00774 
      +00775       // bug PHP : sometimes the newline remains
      +00776       $this->ag_comment=str_replace("%A0","",$this->ag_comment);
      +00777       $this->ag_comment=str_replace("%0D","",$this->ag_comment);
      +00778       $this->ag_comment=str_replace("+%A0+","",$this->ag_comment);
      +00779       $this->ag_comment=str_replace("+%0D+","",$this->ag_comment);
      +00780 
      +00781 
      +00782       $sql=sprintf("update action_gestion set ag_comment='%s',".
      +00783                    " ag_timestamp=to_date('%s','DD.MM.YYYY'),".
      +00784                    " ag_title='%s',".
      +00785                    " ag_type=%d, ".
      +00786                    " f_id_exp=%d, ".
      +00787                    " f_id_dest=%d, ".
      +00788                    " ag_ref_ag_id=%d".
      +00789                    " where ag_id = %d",
      +00790                    $this->ag_comment,
      +00791                    $this->ag_timestamp,
      +00792                    FormatString($this->ag_title),
      +00793                    $this->dt_id,
      +00794                    $this->f_id_exp,
      +00795                    $this->f_id_dest,
      +00796                    $this->ag_ref_ag_id,
      +00797                    $this->ag_id);
      +00798       ExecSql($this->db,$sql);
      +00799       
      +00800       if ( sizeof($_FILES) !=0 ) 
      +00801         {
      +00802           // Upload a new document
      +00803           $doc=new Document($this->db);
      +00804           if ( $this->d_id !=0 )
      +00805             {
      +00806               $doc->d_id=$this->d_id;
      +00807             } else {
      +00808               // we need to increment the counter 
      +00809               $doc->ag_id=$this->ag_id;
      +00810               $doc->md_type=$this->dt_id;
      +00811               $doc->blank();
      +00812             }
      +00813           $doc->Upload($this->ag_id);
      +00814       
      +00815         }
      +00816            
      +00817       return true;
      +00818     }
      +
      +

      +


      Field Documentation

      @@ -462,7 +1107,7 @@ References $d

      description (ag_gestion.ag_comment)

      -Definition at line 62 of file class_action.php. +Definition at line 64 of file class_action.php.

      @@ -471,7 +1116,7 @@ Definition at line 62 - +
      action::$ag_ref_ag_id action::$ag_ref_ag_id
      @@ -485,10 +1130,11 @@ Definition at line
      62

      -concern previous action

      Todo:
      replace attribut from class document document by an object document
      +concern previous action

      +

      Todo:
      replace attribut from class document document by an object document

      -Definition at line 71 of file class_action.php. +Definition at line 73 of file class_action.php.

      @@ -513,7 +1159,7 @@ Definition at line 71

      document date (ag_gestion.ag_timestamp)

      -Definition at line 63 of file class_action.php. +Definition at line 65 of file class_action.php.

      @@ -522,7 +1168,7 @@ Definition at line 63 - +
      action::$ag_title action::$ag_title
      @@ -538,7 +1184,7 @@ Definition at line
      63

      title document

      -Definition at line 69 of file class_action.php. +Definition at line 71 of file class_action.php.

      @@ -563,7 +1209,7 @@ Definition at line 69

      filename's document

      -Definition at line 67 of file class_action.php. +Definition at line 69 of file class_action.php.

      @@ -588,7 +1234,7 @@ Definition at line 67

      document's filename

      -Definition at line 68 of file class_action.php. +Definition at line 70 of file class_action.php.

      @@ -613,7 +1259,7 @@ Definition at line 68

      number of the document

      -Definition at line 66 of file class_action.php. +Definition at line 68 of file class_action.php.

      @@ -638,7 +1284,7 @@ Definition at line 66

      stage of the document (printed, send to client...)

      -Definition at line 65 of file class_action.php. +Definition at line 67 of file class_action.php.

      @@ -663,7 +1309,7 @@ Definition at line 65

      database connexion

      -Definition at line 61 of file class_action.php. +Definition at line 63 of file class_action.php.

      @@ -688,7 +1334,7 @@ Definition at line 61

      type of the document (document_type.dt_id)

      -Definition at line 64 of file class_action.php. +Definition at line 66 of file class_action.php.

      @@ -711,16 +1357,16 @@ Definition at line 64

      -fiche id +

      -Definition at line 70 of file class_action.php. +Definition at line 72 of file class_action.php.

      -Referenced by Confirm(). +Referenced by Confirm().


      The documentation for this class was generated from the following file: -
      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    • class_action.php
    +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classcl__user.html b/doc/developper/html/classcl__user.html index 6ea106c64..3fd9f3a34 100644 --- a/doc/developper/html/classcl__user.html +++ b/doc/developper/html/classcl__user.html @@ -103,7 +103,49 @@ Definition at line 33 Definition at line 40 of file class_user.php.

    -References $_SESSION, $cn, $p_id, $Res, $row, $Sql, DbConnect(), echo_debug(), isValid(), and name. +References $_SESSION, $cn, $p_id, $Res, $row, $Sql, DbConnect(), echo_debug(), isValid(), and name.

    00040                                    {
    +00041     // if p_id is not set then check the connected user
    +00042     if ( $p_id == -1 ) {
    +00043           echo_debug('class_user.php',__LINE__," g_user = ".$_SESSION['g_user']);
    +00044     $this->id=$_SESSION['g_user'];
    +00045     $this->pass=$_SESSION['g_pass'];
    +00046     $this->valid=(isset ($_SESSION['isValid']))?1:0;
    +00047     $this->db=$p_cn;
    +00048     if ( isset($_SESSION['g_theme']) )
    +00049       $this->theme=$_SESSION['g_theme'];
    +00050     
    +00051     $this->admin=( isset($_SESSION['use_admin']) )?$_SESSION['use_admin']:0;
    +00052     
    +00053     if ( isset($_SESSION['use_name']) )
    +00054       $this->name=$_SESSION['use_name'];
    +00055     if ( isset($_SESSION['use_first_name']) )
    +00056       $this->first_name=$_SESSION['use_first_name'];
    +00057     } 
    +00058     else // if p_id is set get data of another user
    +00059       {
    +00060       $this->id=$p_id;
    +00061       $this->db=$p_cn;
    +00062       $Sql="select use_first_name,
    +00063              use_name,
    +00064              use_login,
    +00065              use_active,
    +00066              use_admin,
    +00067                      from ac_users
    +00068              where use_id=$p_id";
    +00069       $cn=DbConnect(); 
    +00070       $Res=pg_exec($cn,$Sql);
    +00071       if (($Max=pg_NumRows($Res)) == 0 ) return -1;
    +00072       $row=pg_fetch_array($Res,0);
    +00073       $this->first_name=$row['use_first_name'];
    +00074       $this->name=$row['use_name'];
    +00075       $this->active=$row['use_active'];
    +00076       $this->login=$row['use_login'];
    +00077       $this->admin=$row['use_admin'];
    +00078     } 
    +00079   }
    +
    +

    +


    Member Function Documentation

    @@ -145,7 +187,22 @@ References $_SESSION

    Definition at line 158 of file class_user.php.

    -References $sql, Admin(), and CountSql(). +References $sql, Admin(), and CountSql().

    00158                                       {
    +00159     $this->Admin();
    +00160     if ( $this->admin==1) return true;
    +00161     $sql=CountSql($p_cn,"select uj_id 
    +00162                              from user_sec_jrn 
    +00163                              where
    +00164                              uj_priv in ('R','W')
    +00165                              and uj_jrn_id=".$p_jrn_id.
    +00166                   "  and uj_login = '".$this->id."'");
    +00167     if ( $sql != 0 ) return true;
    +00168     return false;
    +00169         
    +00170   }
    +
    +

    +

    @@ -181,7 +238,24 @@ Definition at line 143<

    References $cn, $pass5, $res, $sql, CountSql(), and DbConnect().

    -Referenced by AccessJrn(). +Referenced by AccessJrn().

    00143                    {
    +00144     $res=0;
    +00145     
    +00146     if ( $this->id != 'phpcompta') {
    +00147       $pass5=md5($this->pass);
    +00148       $sql="select use_id from ac_users where use_login='$this->id'
    +00149                 and use_active=1 and use_admin=1 and use_pass='$pass5'";
    +00150       
    +00151       $cn=DbConnect();
    +00152       
    +00153       $this->admin=CountSql($cn,$sql);
    +00154     } else $this->admin=1;
    +00155     
    +00156     return $this->admin;
    +00157   }
    +
    +

    +

    @@ -214,7 +288,57 @@ Check if user is active and exists in therepository Automatically redirect.

    Definition at line 85 of file class_user.php.

    -References $_SESSION, $cn, $pass5, $r, $res, $ret, $sql, DbConnect(), echo_debug(), exit, GetGlobalPref(), and name. +References $_SESSION, $cn, $pass5, $r, $res, $ret, $sql, DbConnect(), echo_debug(), exit, GetGlobalPref(), and name.

    00086   {
    +00087         
    +00088         $res=0;
    +00089         $pass5=md5($this->pass);
    +00090         if  ( $this->valid == 1 ) { return; }
    +00091         $cn=DbConnect();
    +00092         if ( $cn != false ) {
    +00093           $sql="select ac_users.use_login,ac_users.use_active, ac_users.use_pass,
    +00094                     use_admin,use_first_name,use_name
    +00095                                 from ac_users  
    +00096                                  where ac_users.use_login='$this->id' 
    +00097                                         and ac_users.use_active=1
    +00098                                         and ac_users.use_pass='$pass5'";
    +00099             echo_debug('class_user.php',__LINE__,"Sql = $sql");
    +00100             $ret=pg_exec($cn,$sql);
    +00101             $res=pg_NumRows($ret);
    +00102             echo_debug('class_user.php',__LINE__,"Number of found rows : $res");
    +00103             if ( $res >0 ) {
    +00104               $r=pg_fetch_array($ret,0);
    +00105               $_SESSION['use_admin']=$r['use_admin'];
    +00106               $_SESSION['use_name']=$r['use_name'];
    +00107               $_SESSION['use_first_name']=$r['use_first_name'];
    +00108               
    +00109               $this->admin=$_SESSION['use_admin'];
    +00110               $this->name=$_SESSION['use_name'];
    +00111               $this->first_name=$_SESSION['use_first_name'];
    +00112               $this->GetGlobalPref();
    +00113 
    +00114             }
    +00115           }
    +00116           
    +00117         if ( $res == 0  ) {
    +00118                 echo '<META HTTP-EQUIV="REFRESH" content="4;url=index.html">';
    +00119                 echo "<BR><BR><BR><BR><BR><BR>";
    +00120                 echo "<P ALIGN=center><BLINK>
    +00121                         <FONT size=+12 COLOR=RED>
    +00122                         Invalid user <BR> or<BR> Invalid password 
    +00123                         </FONT></BLINK></P></BODY></HTML>";
    +00124                 session_unset();
    +00125                 
    +00126                 exit -1;                        
    +00127         } else {
    +00128           $this->valid=1;
    +00129         }
    +00130         
    +00131         return $ret;
    +00132         
    +00133   }
    +
    +

    +

    @@ -269,7 +393,19 @@ Check if an user is allowed to do an action.

    Definition at line 237 of file class_user.php.

    -References $Res, and ExecSql(). +References $Res, and ExecSql().

    00238 {
    +00239 
    +00240   if ( $this->admin==1 ) return 1;
    +00241 
    +00242   $Res=ExecSql($p_cn,"select * from user_sec_act where ua_login='".$this->id."' and ua_act_id=$p_action_id");
    +00243   $Count=pg_NumRows($Res);
    +00244   if ( $Count == 0 ) return 0;
    +00245   if ( $Count == 1 ) return 1;
    +00246   echo "<H2 class=\"error\"> Invalid action !!! $Count select * from user_sec_act where ua_login='$p_login' and ua_act_id=$p_action_id </H2>";
    +00247 }
    +
    +

    +

    @@ -302,7 +438,15 @@ Return the year of current Periode it is the parm_periode.p_exercice col.

    Definition at line 346 of file class_user.php.

    -References $r, $Ret, $sql, and ExecSql(). +References $r, $Ret, $sql, and ExecSql().

    00347 {
    +00348   $sql="select p_exercice from parm_periode where p_id=".$this->GetPeriode();
    +00349   $Ret=ExecSql($this->db,$sql);
    +00350   $r=pg_fetch_array($Ret,0);
    +00351   return $r['p_exercice'];
    +00352 }
    +
    +

    +

    @@ -340,9 +484,43 @@ Get the global preferences from user_global_pref in the account_repository db.

    Definition at line 257 of file class_user.php.

    -References $_SESSION, $cn, $Max, $Res, $row, echo_debug(), ExecSql(), insert_default_global_pref(), and name. +References $_SESSION, $cn, $Max, $Res, $row, echo_debug(), ExecSql(), insert_default_global_pref(), and name.

    -Referenced by Check(). +Referenced by Check().

    00258 {
    +00259         echo_debug('class_user.php',__LINE__,"function GetGlobalPref");
    +00260   $cn=Dbconnect();
    +00261   // Load everything in an array
    +00262   $Res=ExecSql ($cn,"select parameter_type,parameter_value from 
    +00263                   user_global_pref
    +00264                   where user_id='".$this->id."'");
    +00265   $Max=pg_NumRows($Res);
    +00266   if (  $Max == 0 ) {
    +00267           $this->insert_default_global_pref();
    +00268           $this->GetGlobalPref();
    +00269           return;
    +00270           }
    +00271   // Load value into array
    +00272   $line=array();
    +00273   for ($i=0;$i<$Max;$i++) {
    +00274     $row=pg_fetch_array($Res,$i);
    +00275     $type=$row['parameter_type']; 
    +00276     $line[$type]=$row['parameter_value'];;
    +00277   }
    +00278   // save array into g_ variable
    +00279   $array_pref=array ('g_theme'=>'THEME','g_pagesize'=>'PAGESIZE');
    +00280   foreach ($array_pref as $name=>$parameter ) {
    +00281           if ( ! isset ($line[$parameter]) ) {
    +00282                   echo_debug("Missing pref : ".$parameter);
    +00283                   $this->insert_default_global_pref($parameter);
    +00284                 $this->GetGlobalPref();
    +00285                 return;
    +00286                 }       
    +00287     $_SESSION[$name]=$line[$parameter];
    +00288   }
    +00289 }
    +
    +

    +

    @@ -371,7 +549,11 @@ Referenced by Check()

    -Definition at line 135 of file class_user.php. +Definition at line 135 of file class_user.php.

    00135                     {
    +00136   }
    +
    +

    +

    @@ -411,7 +593,13 @@ Get the default periode from the user's preferences.

    Definition at line 192 of file class_user.php.

    -References $array, and GetPreferences(). +References $array, and GetPreferences().

    00192                       {
    +00193   $array=$this->GetPreferences();
    +00194   return $array['PERIODE'];
    +00195 }
    +
    +

    +

    @@ -453,7 +641,30 @@ Definition at line 204<

    References $Res, $row, $sql, and ExecSql().

    -Referenced by GetPeriode(). +Referenced by GetPeriode().

    00205 {
    +00206   // si preference n'existe pas, les créer
    +00207   $sql="select parameter_type,parameter_value from user_local_pref where user_id='".$this->id."'";
    +00208   $Res=ExecSql($this->db,$sql);
    +00209   if (pg_NumRows($Res) == 0 ) {
    +00210     // default periode
    +00211     $sql=sprintf("insert into user_local_pref (user_id,parameter_value,parameter_type) 
    +00212                  select '%s',min(p_id),'PERIODE' from parm_periode where p_closed=false",
    +00213                  $this->id);
    +00214     $Res=ExecSql($this->db,$sql);
    +00215 
    +00216     $l_array=$this->GetPreferences();
    +00217   } else {
    +00218     for ( $i =0;$i < pg_NumRows($Res);$i++) {
    +00219       $row= pg_fetch_array($Res,0);
    +00220       $type=$row['parameter_type'];
    +00221       $l_array[$type]=$row['parameter_value'];
    +00222     }
    +00223   }
    +00224   return $l_array;
    +00225 }
    +
    +

    +

    @@ -501,9 +712,34 @@ insert default pref if no parameter are given insert all the existing parameter

    Definition at line 299 of file class_user.php.

    -References $cn, $Sql, echo_debug(), ExecSql(), name, and value. +References $cn, $Sql, echo_debug(), ExecSql(), name, and value.

    -Referenced by GetGlobalPref(). +Referenced by GetGlobalPref().

    00299                                                             {
    +00300         echo_debug('class_user.php',__LINE__,"function insert_default_global_pref");
    +00301         echo_debug('class_user.php',__LINE__,"parameter p_type $p_type p_value  $p_value");
    +00302 
    +00303         $default_parameter= array("THEME"=>"Light",
    +00304                 "PAGESIZE"=>"50");
    +00305         $cn=Dbconnect();
    +00306         $Sql="insert into user_global_pref(user_id,parameter_type,parameter_value) 
    +00307                                 values ('%s','%s','%s')";
    +00308         if ( $p_type == "" ) {
    +00309                 foreach ( $default_parameter as $name=>$value) {
    +00310                         $Insert=sprintf($Sql,$this->id,$name,$value);
    +00311                         ExecSql($cn,$Insert);
    +00312                 }
    +00313         }
    +00314         else {
    +00315                 $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
    +00316                 $Insert=sprintf($Sql,$this->id,$p_type,$value);
    +00317                 ExecSql($cn,$Insert);
    +00318         }
    +00319 
    +00320 
    +00321 }
    +
    +

    +

    @@ -543,7 +779,13 @@ Set the selected periode in the user's preferences.

    Definition at line 178 of file class_user.php.

    -References $Res, $sql, and ExecSql(). +References $Res, $sql, and ExecSql().

    00178                                 {
    +00179   $sql="update user_local_pref set parameter_value='$p_periode' where user_id='$this->id' and parameter_type='PERIODE'";
    +00180   $Res=ExecSql($this->db,$sql);
    +00181 }
    +
    +

    +

    @@ -592,7 +834,21 @@ update default pref if value is not given then use the default value

    Definition at line 331 of file class_user.php.

    -References $cn, $Sql, ExecSql(), and value. +References $cn, $Sql, ExecSql(), and value.

    00331                                                  {
    +00332         $default_parameter= array("THEME"=>"Light",
    +00333                 "PAGESIZE"=>"50");
    +00334         $cn=Dbconnect();
    +00335         $Sql="update user_global_pref set parameter_value='%s' 
    +00336                         where parameter_type='%s' and 
    +00337                                 user_id='%s'";
    +00338         $value=($p_value=="")?$default_parameter[$p_type]:$p_value;
    +00339         $Update=sprintf($Sql,$value,$p_type,$this->id);
    +00340         ExecSql($cn,$Update);
    +00341 
    +00342  }//end function
    +
    +

    +


    Field Documentation

    @@ -722,8 +978,8 @@ Definition at line 38
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:09 2006 for phpcompta by  +
  • class_user.php +
    Generated on Thu Jun 29 21:21:24 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classcontact.html b/doc/developper/html/classcontact.html index 118a34f08..0fa02819a 100644 --- a/doc/developper/html/classcontact.html +++ b/doc/developper/html/classcontact.html @@ -72,7 +72,14 @@ constructor

    Definition at line 36 of file class_contact.php.

    -References fiche::fiche(). +References fiche::fiche().

    00037     {
    +00038       $this->fiche_def_ref=FICHE_TYPE_CONTACT;
    +00039       fiche::fiche($p_cn,$p_id) ;
    +00040       $this->company="";
    +00041     }
    +
    +

    +


    Member Function Documentation

    @@ -114,7 +121,96 @@ Summary

    Definition at line 50 of file class_contact.php.

    -References $bar, $contact, $offset, $page, $r, $search, $url, fiche::CountByDef(), f_id, fiche::fiche(), FormatString(), fiche::GetAll(), jrn_navigation_bar(), name, table, and value. +References $bar, $contact, $offset, $page, $r, $search, $url, fiche::CountByDef(), f_id, fiche::fiche(), FormatString(), fiche::GetAll(), jrn_navigation_bar(), name, table, and value.

    00051     {
    +00052       $p_search=FormatString($p_search);
    +00053       $extra_sql="";
    +00054       if ( $this->company != "") 
    +00055         {
    +00056           $extra_sql="and f_id in (select f_id from jnt_fic_att_value join 
    +00057 attr_value using (jft_id) where av_text='".$this->company."' and ad_id=".ATTR_DEF_COMPANY.") ";
    +00058         }
    +00059       $url=urlencode($_SERVER['REQUEST_URI']);
    +00060       $script=$_SERVER['SCRIPT_NAME'];
    +00061       // Creation of the nav bar
    +00062       // Get the max numberRow
    +00063       $all_contact=$this->CountByDef($this->fiche_def_ref,$p_search,$extra_sql); 
    +00064       // Get offset and page variable
    +00065       $offset=( isset ($_REQUEST['offset'] )) ?$_REQUEST['offset']:0;
    +00066       $page=(isset($_REQUEST['page']))?$_REQUEST['page']:1;
    +00067       $bar=jrn_navigation_bar($offset,$all_contact,$_SESSION['g_pagesize'],$page);
    +00068       // set a filter ?
    +00069       $search="";
    +00070       if ( trim($p_search) != "" )
    +00071         {
    +00072           $search=" and f_id in
    +00073 (select f_id from jnt_fic_att_value 
    +00074                   join fiche using (f_id) 
    +00075                   join attr_value using (jft_id)
    +00076                 where
    +00077                 ad_id=1 and av_text ~* '$p_search') ";
    +00078         }
    +00079       // Get The result Array
    +00080       $step_contact=$this->GetAll($offset,$search.$extra_sql);
    +00081       if ( $all_contact == 0 ) return "";
    +00082       $r=$bar;
    +00083       $r.='<table border="0">
    +00084 <TR style="background-color:lightgrey;">
    +00085 <th>Nom</th>
    +00086 <th>Téléphone</th>
    +00087 <th>email</th>
    +00088 <th>Fax</th>
    +00089 <th colspan="2">Société</th>
    +00090 </TR>';
    +00091       $base=$_SERVER['SCRIPT_NAME'];
    +00092       // Compute the url
    +00093       $url="";
    +00094       $and="?";
    +00095       $get=$_GET;
    +00096       if ( isset ($get) ) {
    +00097         foreach ($get as $name=>$value ) {
    +00098           // we clean the parameter offset, step, page and size
    +00099           if (  ! in_array($name,array('f_id','detail'))) {
    +00100             $url.=$and.$name."=".$value;
    +00101             $and="&";
    +00102           }// if
    +00103         }//foreach
    +00104       }// if
    +00105 
    +00106       if ( sizeof ($step_contact ) == 0 )
    +00107         return $r;
    +00108       echo JS_SEARCH_CARD;
    +00109       foreach ($step_contact as $contact ) {
    +00110         $l_company=new fiche($this->cn);
    +00111         $l_company->GetByQCode($contact->strAttribut(ATTR_DEF_COMPANY),false);
    +00112         $l_company_name=$l_company->strAttribut(ATTR_DEF_NAME);
    +00113         if ( $l_company_name == '- ERROR -' ) $l_company_name="";
    +00114         // add popup for detail
    +00115         if ( $l_company_name !="")
    +00116           {
    +00117             $l_company_name=sprintf("<A HREF=\"javascript:showfiche('%s','%s')\">%s  - %s</A>",
    +00118                                     $_REQUEST['PHPSESSID'],
    +00119                                     $contact->strAttribut(ATTR_DEF_COMPANY),
    +00120                                     $contact->strAttribut(ATTR_DEF_COMPANY),
    +00121                                     $l_company_name
    +00122                                     );
    +00123           }
    +00124         $r.="<TR>";
    +00125         $r.='<TD><A HREF="'.$url."&sa=detail&f_id=".$contact->id."\">".$contact->strAttribut(ATTR_DEF_NAME)."</A></TD>";
    +00126         $r.="<TD>".$contact->strAttribut(ATTR_DEF_TEL)."</TD>";
    +00127         $r.="<TD>".$contact->strAttribut(ATTR_DEF_EMAIL)."</TD>".
    +00128             "<TD> ".$contact->strAttribut(ATTR_DEF_FAX)."</TD>".
    +00129             "<TD> ".$l_company_name. "</TD>";
    +00130 
    +00131         $r.="</TR>";
    +00132 
    +00133       }
    +00134       $r.="</TABLE>";
    +00135       $r.=$bar;
    +00136       return $r;
    +00137     }
    +
    +

    +


    Field Documentation

    @@ -144,8 +240,8 @@ Definition at line 3
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:09 2006 for phpcompta by  +
  • class_contact.php +
    Generated on Thu Jun 29 21:21:24 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classfiche.html b/doc/developper/html/classfiche.html index 2b40daf88..52e2ae512 100644 --- a/doc/developper/html/classfiche.html +++ b/doc/developper/html/classfiche.html @@ -129,7 +129,13 @@ Definition at line 155

    References $p_id.

    -Referenced by Admin::Admin(), contact::contact(), Customer::Customer(), GetByDef(), GetByType(), contact::Summary(), and Supplier::Supplier(). +Referenced by Admin::Admin(), contact::contact(), Customer::Customer(), GetByDef(), GetByType(), contact::Summary(), and Supplier::Supplier().

    00155                                 {
    +00156     $this->cn=$p_cn;
    +00157     $this->id=$p_id;
    +00158   }
    +
    +

    +


    Member Function Documentation

    @@ -170,7 +176,59 @@ insert a new record show a blank card to be filled

    Definition at line 399 of file class_fiche.php.

    -References $a, $array, $label, $msg, $r, $ret_sql, $sql, $w, echo_debug(), ExecSql(), and table. +References $a, $array, $label, $msg, $r, $ret_sql, $sql, $w, echo_debug(), ExecSql(), and table.

    00400     {
    +00401       // array = array of attribute object sorted on ad_id
    +00402       $f=new fiche_def($this->cn,$p_fiche_def);
    +00403       $array=$f->getAttribut();
    +00404       $r='<table>';
    +00405       foreach ($array as $attr)
    +00406         {
    +00407           $msg="";
    +00408           if ( $attr->ad_id == ATTR_DEF_ACCOUNT) 
    +00409             {
    +00410               $r.=JS_SEARCH_POSTE;
    +00411               $w=new widget("js_search_poste");
    +00412               //  account created automatically
    +00413               $sql="select account_auto($p_fiche_def)";
    +00414               echo_debug("class_fiche",__LINE__,$sql);
    +00415               $ret_sql=ExecSql($this->cn,$sql);
    +00416               $a=pg_fetch_array($ret_sql,0);
    +00417               if ( $a['account_auto'] == 't' )
    +00418                 $msg="<TD> <font color=\"red\">Rappel: Poste créé automatiquement !</font></TD> ";
    +00419 
    +00420              }
    +00421           elseif ( $attr->ad_id == ATTR_DEF_TVA) 
    +00422             {
    +00423               $r.=JS_TVA;
    +00424               $w=new widget("js_tva");
    +00425             }
    +00426           elseif ( $attr->ad_id == ATTR_DEF_COMPANY )
    +00427             {
    +00428               $r.=JS_SEARCH_CARD;
    +00429               $w=new widget("js_search");
    +00430               // filter on frd_id
    +00431               $w->extra=FICHE_TYPE_CLIENT.','.FICHE_TYPE_FOURNISSEUR.','.FICHE_TYPE_ADM_TAX; 
    +00432               $w->extra2=0;      // jrn = 0
    +00433               $label=new widget("span");
    +00434               $label->name="av_text".$attr->ad_id."_label";
    +00435               $msg=$label->IOValue();
    +00436             }
    +00437           else
    +00438             {
    +00439               $w=new widget("text");
    +00440             }
    +00441           $w->table=1;
    +00442           $w->label=$attr->ad_text;
    +00443           $w->name="av_text".$attr->ad_id;
    +00444 
    +00445           $r.="<TR>".$w->IOValue()."$msg </TR>";
    +00446         }
    +00447       $r.= '</table>';
    +00448       return $r;
    +00449     }
    +
    +

    +

    @@ -229,7 +287,25 @@ Definition at line 291

    References $a, $Ret, $sql, ExecSql(), and FormatString().

    -Referenced by Supplier::Summary(), Customer::Summary(), contact::Summary(), and Admin::Summary(). +Referenced by Supplier::Summary(), Customer::Summary(), contact::Summary(), and Admin::Summary().

    00291                                                         {
    +00292      $sql="select * 
    +00293            from
    +00294                fiche join fiche_Def using (fd_id)
    +00295             where frd_id=".$p_frd_id;
    +00296      if ( $p_search != "" ) 
    +00297        {
    +00298          $a=FormatString($p_search);
    +00299          $sql="select * from vw_fiche_attr where frd_id=".$p_frd_id.
    +00300            " and vw_name ~* '$p_search'";
    +00301        }
    +00302 
    +00303     $Ret=ExecSql($this->cn,$sql.$p_sql);
    +00304     
    +00305     return pg_NumRows($Ret) ;
    +00306   }
    +
    +

    +

    @@ -269,7 +345,69 @@ Display object instance, getAttribute sort the attribute and add missing ones.

    Definition at line 461 of file class_fiche.php.

    -References $a, $label, $msg, $r, $ret, $ret_sql, $sql, $w, echo_debug(), and ExecSql(). +References $a, $label, $msg, $r, $ret, $ret_sql, $sql, $w, echo_debug(), and ExecSql().

    00462     {
    +00463       $this->GetAttribut();
    +00464       $attr=$this->attribut;
    +00465 
    +00466       $ret="<table>";
    +00467 
    +00468       foreach ( $attr as $r) 
    +00469         {
    +00470           $msg="";
    +00471           if ( $p_readonly) 
    +00472             {
    +00473               $w=new widget("text");
    +00474             }
    +00475           if ($p_readonly==false)
    +00476             {
    +00477               if ( $r->ad_id == ATTR_DEF_ACCOUNT) 
    +00478                 {
    +00479                   $ret.=JS_SEARCH_POSTE;
    +00480                   $w=new widget("js_search_poste");
    +00481                   //  account created automatically
    +00482                   $sql="select account_auto($this->fiche_def)";
    +00483                   echo_debug("class_fiche",__LINE__,$sql);
    +00484                   $ret_sql=ExecSql($this->cn,$sql);
    +00485                   $a=pg_fetch_array($ret_sql,0);
    +00486                   if ( $a['account_auto'] == 't' )
    +00487                     $msg="<TD> <font color=\"red\">si vide le Poste sera créer automatiquement</font></TD> ";
    +00488                 }
    +00489               elseif ( $r->ad_id == ATTR_DEF_TVA) 
    +00490                 {
    +00491                   $ret.=JS_TVA;
    +00492                   $w=new widget("js_tva");
    +00493             }
    +00494               elseif ( $r->ad_id == ATTR_DEF_COMPANY )
    +00495                 {
    +00496                   $ret.=JS_SEARCH_CARD;
    +00497                   $w=new widget("js_search");
    +00498                   // filter on frd_id
    +00499                   $w->extra=FICHE_TYPE_CLIENT.','.FICHE_TYPE_FOURNISSEUR.','.FICHE_TYPE_ADM_TAX; 
    +00500                   $w->extra2=0;      // jrn = 0
    +00501                   $label=new widget("span");
    +00502                   $label->name="av_text".$r->ad_id."_label";
    +00503                   $msg=$label->IOValue();
    +00504                 }
    +00505             
    +00506               else 
    +00507                 {
    +00508                   $w=new widget("text");
    +00509                 }
    +00510             }
    +00511           $w->label=$r->ad_text;
    +00512           $w->value=$r->av_text;
    +00513           $w->name="av_text".$r->ad_id;
    +00514           $w->readonly=$p_readonly;
    +00515           $w->table=1;
    +00516 
    +00517           $ret.="<TR>".$w->IOValue()."$msg </TR>";
    +00518         }
    +00519       $ret.="</table>";
    +00520       return $ret;
    +00521     }
    +
    +

    +

    @@ -302,7 +440,13 @@ Synonum of fiche::getAttribut.

    Definition at line 770 of file class_fiche.php.

    -References echo_debug(), and getAttribut(). +References echo_debug(), and getAttribut().

    00771      {
    +00772        echo_debug('class_client',__LINE__,'Get');
    +00773        fiche::getAttribut();
    +00774      }
    +
    +

    +

    @@ -354,7 +498,12 @@ Definition at line 780

    References GetByDef().

    -Referenced by Supplier::Summary(), Customer::Summary(), contact::Summary(), and Admin::Summary(). +Referenced by Supplier::Summary(), Customer::Summary(), contact::Summary(), and Admin::Summary().

    00781      {
    +00782        return fiche::GetByDef($this->fiche_def_ref,$p_offset,$p_search);
    +00783     }
    +
    +

    +

    @@ -389,7 +538,58 @@ Definition at line 190

    References $e, $flag, $i, $Max, $Ret, $row, $sql, $t, ExecSql(), return, and SortAttributeById().

    -Referenced by Get(), and GetByQCode(). +Referenced by Get(), and GetByQCode().

    00190                          {
    +00191     if ( $this->id == 0){
    +00192       return;
    +00193     }
    +00194      $sql="select * 
    +00195            from jnt_fic_att_value 
    +00196                natural join fiche 
    +00197                natural join attr_value
    +00198                left join attr_def using (ad_id) where f_id=".$this->id.
    +00199        " order by ad_id";
    +00200 
    +00201     $Ret=ExecSql($this->cn,$sql);
    +00202     if ( ($Max=pg_NumRows($Ret)) == 0 )
    +00203       return ;
    +00204     for ($i=0;$i<$Max;$i++) {
    +00205       $row=pg_fetch_array($Ret,$i);
    +00206       $this->fiche_def=$row['fd_id'];
    +00207       $t=new Attribut ($row['ad_id']);
    +00208       $t->ad_text=$row['ad_text'];
    +00209       $t->av_text=$row['av_text'];
    +00210       $this->attribut[$i]=$t;
    +00211     }
    +00212     $e=new Fiche_def($this->cn,$this->fiche_def);
    +00213     $e->GetAttribut();
    +00214 
    +00215     if ( sizeof($this->attribut) != sizeof($e->attribut ) ) {
    +00216 
    +00217       // !!! Missing attribute
    +00218       foreach ($e->attribut as $f ) {
    +00219         $flag=0;
    +00220         foreach ($this->attribut as $g ) {
    +00221           if ( $g->ad_id == $f->ad_id ) 
    +00222             $flag=1;
    +00223         }
    +00224         if ( $flag == 0 ) { 
    +00225           // there's a missing one, we insert it
    +00226           $t=new Attribut ($f->ad_id);
    +00227           $t->av_text="";
    +00228           $t->ad_text=$f->ad_text;
    +00229           $this->attribut[$Max]=$t;
    +00230           $Max++;
    +00231         } // if flag == 0
    +00232 
    +00233       }// foreach 
    +00234       $this->attribut=SortAttributeById($this->attribut);
    +00235 
    +00236 
    +00237     }//missing attribut
    +00238   }
    +
    +

    +

    @@ -447,7 +647,42 @@ Definition at line 317

    References $_SESSION, $all, $i, $limit, $Ret, $row, $sql, $t, ExecSql(), f_id, fiche(), and return.

    -Referenced by GetAll(). +Referenced by GetAll().

    00317                                                          {
    +00318     if ( $p_offset == -1 ) 
    +00319       {
    +00320         $sql="select * 
    +00321            from
    +00322                fiche join fiche_Def using (fd_id)
    +00323             where frd_id=".$p_frd_id." $p_search order by f_id";
    +00324       } 
    +00325     else 
    +00326       {
    +00327         $limit=$_SESSION['g_pagesize'];
    +00328         $sql="select * 
    +00329            from
    +00330                fiche join fiche_Def using (fd_id)
    +00331             where frd_id=".$p_frd_id." $p_search order by f_id
    +00332            limit ".$limit." offset ".$p_offset;
    +00333 
    +00334       }
    +00335 
    +00336     $Ret=ExecSql($this->cn,$sql);
    +00337     if ( ($Max=pg_NumRows($Ret)) == 0 )
    +00338       return ;
    +00339     $all[0]=new fiche($this->cn);
    +00340 
    +00341     for ($i=0;$i<$Max;$i++) {
    +00342       $row=pg_fetch_array($Ret,$i);
    +00343       $t=new fiche($this->cn,$row['f_id']);
    +00344       $t->getAttribut();
    +00345       $all[$i]=$t;
    +00346 
    +00347     }
    +00348     return $all;
    +00349   }
    +
    +

    +

    @@ -497,7 +732,26 @@ GetByQCode($p_qcode)

    Parameters:

    Definition at line 167 of file class_fiche.php.

    -References $r, $Res, $sql, echo_debug(), ExecSql(), f_id, FormatString(), getAttribut(), and size(). +References $r, $Res, $sql, echo_debug(), ExecSql(), f_id, FormatString(), getAttribut(), and size().

    00168     {
    +00169 
    +00170       $p_qcode=FormatString($p_qcode);
    +00171       $sql="select f_id from jnt_fic_att_value join attr_value 
    +00172            using (jft_id)  where ad_id=23 and av_text='".$p_qcode."'";
    +00173       $Res=ExecSql($this->cn,$sql);
    +00174       $r=pg_fetch_all($Res);
    +00175       echo_debug('fiche',__LINE__,'result:'.var_export($r).'size '.sizeof($r));
    +00176       if ( $r == null  ) 
    +00177         return 1;
    +00178       $this->id=$r[0]['f_id'];
    +00179       echo_debug('class_fiche',__LINE__,'f_id = '.$this->id);
    +00180 
    +00181       if ( $p_all )
    +00182         $this->getAttribut();
    +00183       return 0;
    +00184     }
    +
    +

    +

    @@ -537,7 +791,30 @@ Get all the card where the fiche_def.fd_id is given in parameter.

    Definition at line 260 of file class_fiche.php.

    -References $all, $i, $Ret, $row, $sql, $t, ExecSql(), f_id, fiche(), and return. +References $all, $i, $Ret, $row, $sql, $t, ExecSql(), f_id, fiche(), and return.

    00260                                {
    +00261      $sql="select * 
    +00262            from
    +00263                fiche 
    +00264             where fd_id=".$p_fd_id;
    +00265 
    +00266 
    +00267     $Ret=ExecSql($this->cn,$sql);
    +00268     if ( ($Max=pg_NumRows($Ret)) == 0 )
    +00269       return ;
    +00270     $all[0]=new fiche($this->cn);
    +00271 
    +00272     for ($i=0;$i<$Max;$i++) {
    +00273       $row=pg_fetch_array($Ret,$i);
    +00274       $t=new fiche($this->cn,$row['f_id']);
    +00275       $t->getAttribut();
    +00276       $all[$i]=$t;
    +00277 
    +00278     }
    +00279     return $all;
    +00280   }
    +
    +

    +

    @@ -570,7 +847,18 @@ return the name of a card

    Definition at line 758 of file class_fiche.php.

    -References $r, $Res, $sql, and ExecSql(). +References $r, $Res, $sql, and ExecSql().

    00759      {
    +00760        $sql="select av_text from jnt_fic_att_value join attr_value 
    +00761             using (jft_id)  where ad_id=1 and f_id=".$this->id;
    +00762        $Res=ExecSql($this->cn,$sql);
    +00763        $r=pg_fetch_all($Res);
    +00764        if ( sizeof($r) == 0 ) 
    +00765          return 1;
    +00766        return $r[0]['av_text'];
    +00767      }
    +
    +

    +

    @@ -609,9 +897,104 @@ insert a new record

    Definition at line 542 of file class_fiche.php.

    -References $fiche_id, $Ret, $sql, Commit(), CountSql(), echo_debug(), ExecSql(), FormatString(), isNumber(), name, NextSequence(), StartSql(), and value. +References $fiche_id, $Ret, $sql, Commit(), CountSql(), echo_debug(), ExecSql(), FormatString(), isNumber(), name, NextSequence(), StartSql(), and value.

    -Referenced by Save(). +Referenced by Save().

    00543     {
    +00544       $fiche_id=NextSequence($this->cn,'s_fiche');
    +00545       $this->id=$fiche_id;
    +00546       // first we create the card
    +00547       StartSql($this->cn);
    +00548       $sql=sprintf("insert into fiche(f_id,fd_id)". 
    +00549                    " values (%d,%d)",
    +00550                    $fiche_id,$p_fiche_def);
    +00551       $Ret=ExecSql($this->cn,$sql);
    +00552       // parse the $_POST array
    +00553       foreach ($_POST as $name=>$value ) 
    +00554         {
    +00555           echo_debug ("class_fiche",__LINE__,"Name = $name value $value") ;
    +00556           list ($id) = sscanf ($name,"av_text%d");
    +00557           if ( $id == null ) continue;
    +00558           echo_debug("class_fiche",__LINE__,"add $id");
    +00559           
    +00560           // Special traitement
    +00561           // quickcode
    +00562           if ( $id == ATTR_DEF_QUICKCODE) 
    +00563             {
    +00564               echo_debug("Modify ATTR_DEF_QUICKCODE");
    +00565               $sql=sprintf("select insert_quick_code(%d,'%s')",
    +00566                            $fiche_id,FormatString($value));
    +00567               ExecSql($this->cn,$sql);
    +00568               continue;
    +00569             }
    +00570           // name
    +00571           if ( $id == ATTR_DEF_NAME ) 
    +00572             {
    +00573               echo_debug("Modify ATTR_DEF_NAME");
    +00574               if ( strlen(trim($value)) == 0 )
    +00575                 $value="pas de nom";
    +00576               
    +00577             }
    +00578           // account
    +00579           if ( $id == ATTR_DEF_ACCOUNT ) 
    +00580             {
    +00581               echo_debug("Modify ATTR_DEF_ACCOUNT");
    +00582               $v=FormatString($value);
    +00583               if ( isNumber($v) == 1 )
    +00584                 {
    +00585                   $sql=sprintf("select account_insert(%d,%d)",
    +00586                                $this->id,$v);
    +00587                   $Ret=ExecSql($this->cn,$sql);
    +00588                 }
    +00589               if ( strlen(trim($v))==0  )
    +00590                 {
    +00591                   $sql=sprintf("select account_insert(%d,null)",
    +00592                                $this->id);
    +00593                   $Ret=ExecSql($this->cn,$sql);
    +00594                 }
    +00595               
    +00596               continue;
    +00597             }
    +00598         // TVA
    +00599           if ( $id == ATTR_DEF_TVA ) 
    +00600             {
    +00601               echo_debug("Modify ATTR_DEF_TVA");
    +00602               // Verify if the rate exists, if not then do not update
    +00603               if ( strlen(trim($value)) != 0 ) 
    +00604                 {
    +00605                   if ( CountSql($this->cn,"select * from tva_rate where tva_id=".$value) == 0) 
    +00606                     {
    +00607                       echo_debug("class_fiche",__LINE__,"Tva invalide $value");
    +00608                       continue;
    +00609                     }
    +00610                 }
    +00611             }
    +00612           // The contact has a company attribut
    +00613           if ( $id == ATTR_DEF_COMPANY ) 
    +00614             {
    +00615               $exist=CountSql($this->cn,"select f_id from fiche join fiche_def using (fd_id) ".
    +00616                               " join jnt_fic_att_value using (f_id) join attr_value using (jft_id) ".
    +00617                               " where frd_id in (8,9,14) and ad_id=".ATTR_DEF_QUICKCODE.
    +00618                               " and av_text='".FormatString($value)."'");
    +00619               if ( $exist == 0 ) 
    +00620                 {
    +00621                   $value="Attention : pas de société  ";
    +00622                 }
    +00623             }
    +00624           // Normal traitement
    +00625           $value2=FormatString($value);
    +00626 
    +00627           $sql=sprintf("select attribut_insert(%d,%d,'%s')",
    +00628                        $fiche_id,$id,$value2);
    +00629           ExecSql($this->cn,$sql);
    +00630         }
    +00631       Commit($this->cn);
    +00632       return;
    +00633       
    +00634 
    +00635     }
    +
    +

    +

    @@ -644,7 +1027,26 @@ remove a card

    Definition at line 738 of file class_fiche.php.

    -References $Res, $sql, and ExecSql(). +References $Res, $sql, and ExecSql().

    00739      {
    +00740        if ( $this->id==0 ) return;
    +00741        // verify if that card has not been used is a ledger
    +00742        $sql="select fiche_used(".$this->id.") as result";
    +00743        $Res=ExecSql($this->cn,$sql);
    +00744        
    +00745        // fetch the result
    +00746        list($result)=pg_fetch_row($Res,0);
    +00747  
    +00748        if ( $result == 0 ) 
    +00749          {
    +00750            $sql="select fiche_delete (".$this->id.")";
    +00751            $Res=ExecSql($this->cn,$sql);
    +00752            return 0;
    +00753          }
    +00754        return 1;
    +00755      }
    +
    +

    +

    @@ -683,7 +1085,16 @@ Save a card, call insert or update.

    Definition at line 528 of file class_fiche.php.

    -References insert(), and update(). +References insert(), and update().

    00529     {
    +00530       // new card or only a update ?
    +00531       if ( $this->id == 0 ) 
    +00532         $this->insert($p_fiche_def);
    +00533       else
    +00534         $this->update();
    +00535     }
    +
    +

    +

    @@ -712,7 +1123,17 @@ References insert()

    -Definition at line 350 of file class_fiche.php. +Definition at line 350 of file class_fiche.php.

    00350                        {
    +00351     echo "<TR><TD> ".
    +00352       $this->id."</TD>".
    +00353       "<TR> <TD>".
    +00354       $this->attribut_value."</TD>".
    +00355       "<TR> <TD>".
    +00356       $this->attribut_def."</TD></TR>";
    +00357   }
    +
    +

    +

    @@ -746,7 +1167,15 @@ give the size of a card object

    Definition at line 246 of file class_fiche.php.

    -Referenced by GetByQCode(). +Referenced by GetByQCode().

    00246                   {
    +00247     if ( isset ($this->ad_id))
    +00248       return sizeof($this->ad_id);
    +00249     else
    +00250       return 0;
    +00251   }
    +
    +

    +

    @@ -787,7 +1216,32 @@ return the string of the given attribute (attr_def.ad_id)

    Definition at line 366 of file class_fiche.php.

    -References $e, $Res, $row, $sql, and ExecSql(). +References $e, $Res, $row, $sql, and ExecSql().

    00367     {
    +00368       if ( sizeof ($this->attribut) == 0 ) 
    +00369         {
    +00370           if ($this->id==0) return '- ERROR -';
    +00371           // object is not in memory we need to look into the database
    +00372           $sql="select av_text from attr_value join jnt_fic_att_value using(jft_id)
    +00373                 where f_id=".$this->id." and ad_id=".$p_ad_id;
    +00374           $Res=ExecSql($this->cn,$sql);
    +00375           $row=pg_fetch_all($Res);
    +00376           // if not found return error
    +00377           if ( $row == false ) 
    +00378             return ' - ERROR -';
    +00379           
    +00380           return $row[0]['av_text'];
    +00381         }
    +00382 
    +00383       foreach ($this->attribut as $e)
    +00384         {
    +00385           if ( $e->ad_id == $p_ad_id ) 
    +00386             return $e->av_text;
    +00387         }
    +00388         return '- ERROR -';
    +00389     }
    +
    +

    +

    @@ -821,9 +1275,104 @@ update a card

    Definition at line 642 of file class_fiche.php.

    -References $Ret, $sql, $tmp, CountSql(), echo_debug(), echo_error(), ExecSql(), FormatString(), isNumber(), name, and value. +References $Ret, $sql, $tmp, CountSql(), echo_debug(), echo_error(), ExecSql(), FormatString(), isNumber(), name, and value.

    -Referenced by Save(). +Referenced by Save().

    00643      {
    +00644        // parse the $_POST array
    +00645        foreach ($_POST as $name=>$value ) 
    +00646          {
    +00647            echo_debug ("class_fiche",__LINE__,"Name = $name value $value") ;
    +00648            list ($id) = sscanf ($name,"av_text%d");
    +00649            if ( $id == null ) continue;
    +00650            echo_debug("class_fiche",__LINE__,"modify $id");
    +00651            
    +00652            // retrieve jft_id to update table attr_value
    +00653            $sql=" select jft_id from jnt_fic_att_value where ad_id=$id and f_id=$this->id";
    +00654            $Ret=ExecSql($this->cn,$sql);
    +00655            if ( pg_NumRows($Ret) != 1 ) {
    +00656              echo_error ("class_fiche ".__LINE__." INVALID ID !!! ");
    +00657              return;
    +00658            }
    +00659            $tmp=pg_fetch_array($Ret,0);
    +00660            $jft_id=$tmp['jft_id'];
    +00661            
    +00662            // Special traitement
    +00663            // quickcode
    +00664            if ( $id == ATTR_DEF_QUICKCODE) 
    +00665              {
    +00666                echo_debug("Modify ATTR_DEF_QUICKCODE");
    +00667                $sql=sprintf("select update_quick_code(%d,'%s')",
    +00668                             $jft_id,FormatString($value));
    +00669                ExecSql($this->cn,$sql);
    +00670                continue;
    +00671              }
    +00672            // name
    +00673            if ( $id == ATTR_DEF_NAME ) 
    +00674              {
    +00675                echo_debug("Modify ATTR_DEF_NAME");
    +00676                if ( strlen(trim($value)) == 0 )
    +00677                  continue;
    +00678                
    +00679              }
    +00680            // account
    +00681            if ( $id == ATTR_DEF_ACCOUNT ) 
    +00682              {
    +00683                echo_debug("Modify ATTR_DEF_ACCOUNT");
    +00684                $v=FormatString($value);
    +00685                if ( isNumber($v) == 1 )
    +00686                  {
    +00687                    $sql=sprintf("select account_update(%d,%d)",
    +00688                                 $this->id,$v);
    +00689                    $Ret=ExecSql($this->cn,$sql);
    +00690                  }
    +00691                if ( strlen (trim($v)) == 0 ) 
    +00692                  {
    +00693                    $sql=sprintf("select account_update(%d,null)",
    +00694                                 $this->id);
    +00695                    $Ret=ExecSql($this->cn,$sql);
    +00696                    continue;
    +00697                  }
    +00698              }
    +00699          // TVA
    +00700            if ( $id == ATTR_DEF_TVA ) 
    +00701              {
    +00702                echo_debug("Modify ATTR_DEF_TVA");
    +00703                // Verify if the rate exists, if not then do not update
    +00704                if ( strlen(trim($value)) != 0 ) 
    +00705                  {
    +00706                    if ( CountSql($this->cn,"select * from tva_rate where tva_id=".$value) == 0) 
    +00707                      {
    +00708                        echo_debug("class_fiche",__LINE__,"Tva invalide $value");
    +00709                        continue;
    +00710                      }
    +00711                  }
    +00712              }
    +00713            if ( $id == ATTR_DEF_COMPANY ) 
    +00714              {
    +00715                $exist=CountSql($this->cn,"select f_id from fiche join fiche_def using (fd_id) ".
    +00716                                " join jnt_fic_att_value using (f_id) join attr_value using (jft_id) ".
    +00717                                " where frd_id in (8,9,14) and ad_id=".ATTR_DEF_QUICKCODE.
    +00718                                " and av_text='".FormatString($value)."'");
    +00719  
    +00720  
    +00721                if ( $exist == 0 ) 
    +00722                  {
    +00723                    $value="Attention : pas de société ";
    +00724                  }
    +00725              }
    +00726            
    +00727            // Normal traitement
    +00728            $value2=FormatString($value);
    +00729            $sql=sprintf("update attr_value set av_text='%s' where jft_id=%d",
    +00730                         $value2,$jft_id);
    +00731            ExecSql($this->cn,$sql);
    +00732          }
    +00733        return;
    +00734        
    +00735      }
    +
    +

    +


    Field Documentation

    @@ -953,8 +1502,8 @@ Definition at line 150
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_fiche.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classfiche__def.html b/doc/developper/html/classfiche__def.html index 7cdf59e94..f86e788ab 100644 --- a/doc/developper/html/classfiche__def.html +++ b/doc/developper/html/classfiche__def.html @@ -92,7 +92,13 @@ Definition at line 39<

    References $p_id.

    -Referenced by GetAll(). +Referenced by GetAll().

    00039                                       {
    +00040     $this->cn=$p_cn;
    +00041     $this->id=$p_id;
    +00042   }
    +
    +

    +


    Member Function Documentation

    @@ -127,7 +133,17 @@ Display a fiche_def object into a table.

    Definition at line 129 of file class_fiche.php.

    -References $r. +References $r.

    00130    {
    +00131 
    +00132      $r=sprintf("<TD>%s</TD>",$this->id);
    +00133      $r.=sprintf("<TD>%s</TD>",$this->label);
    +00134      $r.=sprintf("<TD>%s</TD>",$this->class_base);
    +00135      $r.=sprintf("<TD>%s</TD>",$this->fiche_def);
    +00136      return $r;
    +00137    }
    +
    +

    +

    @@ -160,7 +176,23 @@ Get attribut of the fiche_def.

    Definition at line 74 of file class_fiche.php.

    -References $Ret, $row, $sql, ExecSql(), frd_id, label, and return. +References $Ret, $row, $sql, ExecSql(), frd_id, label, and return.

    00074                  {
    +00075     if ( $this->id == 0 ) 
    +00076       return 0;
    +00077     $sql="select * from fiche_def ".
    +00078       " where fd_id=".$this->id;
    +00079     $Ret=ExecSql($this->cn,$sql);
    +00080     if ( ($Max=pg_NumRows($Ret)) == 0 )
    +00081       return ;
    +00082     $row=pg_fetch_array($Ret,0);
    +00083     $this->label=$row['fd_label'];
    +00084     $this->class_base=$row['fd_class_base'];
    +00085     $this->fiche_def=$row['frd_id'];
    +00086     $this->create_account=$row['fd_create_account'];
    +00087   }
    +
    +

    +

    @@ -194,7 +226,25 @@ Get all the fiche_def.

    Definition at line 94 of file class_fiche.php.

    -References $i, $Ret, $row, $sql, ExecSql(), fiche_def(), frd_id, and return. +References $i, $Ret, $row, $sql, ExecSql(), fiche_def(), frd_id, and return.

    00094                    {
    +00095    $sql="select * from fiche_def ";
    +00096 
    +00097     $Ret=ExecSql($this->cn,$sql);
    +00098     if ( ($Max=pg_NumRows($Ret)) == 0 )
    +00099       return ;
    +00100 
    +00101     for ( $i = 0; $i < $Max;$i++) {
    +00102       $row=pg_fetch_array($Ret,$i);
    +00103       $this->all[$i]=new fiche_def($this->cn,$row['fd_id']);
    +00104       $this->all[$i]->label=$row['fd_label'];
    +00105       $this->all[$i]->class_base=$row['fd_class_base'];
    +00106       $this->all[$i]->fiche_def=$row['frd_id'];
    +00107       $this->all[$i]->create_account=$row['fd_create_account'];
    +00108     }
    +00109   }
    +
    +

    +

    @@ -228,7 +278,26 @@ Get attribut of a fiche_def.

    Definition at line 51 of file class_fiche.php.

    -References $i, $Ret, $row, $sql, $t, ExecSql(), and return. +References $i, $Ret, $row, $sql, $t, ExecSql(), and return.

    00051                          {
    +00052     $sql="select * from jnt_fic_attr ".
    +00053       " natural join attr_def where fd_id=".$this->id.
    +00054       " order by ad_id";
    +00055 
    +00056     $Ret=ExecSql($this->cn,$sql);
    +00057 
    +00058     if ( ($Max=pg_NumRows($Ret)) == 0 )
    +00059       return ;
    +00060     for ($i=0;$i < $Max;$i++) {
    +00061       $row=pg_fetch_array($Ret,$i);
    +00062       $t = new Attribut($row['ad_id']);
    +00063       $t->ad_text=$row['ad_text'];
    +00064       $this->attribut[$i]=$t;
    +00065     }
    +00066     return $this->attribut;
    +00067   }
    +
    +

    +

    @@ -268,7 +337,13 @@ Check in vw_fiche_def if a fiche has a attribut X.

    Definition at line 119 of file class_fiche.php.

    -References CountSql(). +References CountSql().

    00119                                 {
    +00120    return (CountSql($this->cn,"select * from vw_fiche_def where ad_id=$p_attr and fd_id=".$this->id)>0)?true:false;
    +00121 
    +00122  }
    +
    +

    +


    Field Documentation

    @@ -473,8 +548,8 @@ Definition at line 33<
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_fiche.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classfiche__def__ref.html b/doc/developper/html/classfiche__def__ref.html index c23735384..d66b74395 100644 --- a/doc/developper/html/classfiche__def__ref.html +++ b/doc/developper/html/classfiche__def__ref.html @@ -86,7 +86,14 @@ Definition at line frd_class_base, frd_id, and frd_text.

    -Referenced by LoadAll(). +Referenced by LoadAll().

    00039     {
    +00040       $this->db=$p_cn;
    +00041       $this->frd_id=$p_frd_id;
    +00042       $this->attribut=array('frd_id','frd_text','frd_class_base');
    +00043     }
    +
    +

    +


    Member Function Documentation

    @@ -122,7 +129,17 @@ tag.

    Definition at line 78 of file class_fiche_def.php.

    -References $r, and value. +References $r, and value.

    00079     {
    +00080       $r="";
    +00081       foreach ( $this->attribut as $value) 
    +00082         {
    +00083           $r.="<TD>".$this->$value.'</TD>';
    +00084         }
    +00085       return $r;
    +00086     }
    +
    +

    +

    @@ -156,7 +173,18 @@ Get the data with the p_code and complete the current object.

    Definition at line 131 of file class_fiche_def.php.

    -References $r, $Res, $sql, ExecSql(), frd_class_base, and frd_text. +References $r, $Res, $sql, ExecSql(), frd_class_base, and frd_text.

    00132     {
    +00133       $sql="select * from  fiche_def_ref ".
    +00134         " where frd_id=".$this->frd_id;
    +00135       $Res=ExecSql($this->db,$sql);
    +00136       if ( pg_NumRows($Res) == 0 ) return null;
    +00137       $r=pg_fetch_array($Res,0);
    +00138       $this->frd_text=$r['frd_text'];
    +00139       $this->frd_class_base=$r['frd_class_base'];
    +00140     }
    +
    +

    +

    @@ -193,7 +221,20 @@ parm :

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_fiche_def.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classjrn.html b/doc/developper/html/classjrn.html index 58290ef0a..9c0c32446 100644 --- a/doc/developper/html/classjrn.html +++ b/doc/developper/html/classjrn.html @@ -75,7 +75,14 @@ Definition at line 24 Definition at line 29 of file class_jrn.php.

    -References $p_id. +References $p_id.

    00029                             {
    +00030     $this->id=$p_id;
    +00031     $this->db=$p_cn;
    +00032     $this->row=null;
    +00033   }
    +
    +

    +


    Member Function Documentation

    @@ -114,7 +121,18 @@ GetDefLine Get the number of lines of a journal
    Parameters:<

    Definition at line 321 of file class_jrn.php.

    -References $r, $Res, $sql, echo_debug(), ExecSql(), and value. +References $r, $Res, $sql, echo_debug(), ExecSql(), and value.

    00322 {
    +00323         $sql_cred=($p_cred=='cred')?'jrn_cred_max_line':'jrn_deb_max_line';
    +00324         $sql="select $sql_cred as value from jrn_def where jrn_def_id=".$this->id;
    +00325         $r=ExecSql($this->db,$sql);
    +00326         $Res=pg_fetch_all($r);
    +00327         echo_debug('class_jrn',__LINE__,$Res);
    +00328         if ( sizeof($Res) == 0 ) return 1;
    +00329         return $Res[0]['value'];
    +00330 }
    +
    +

    +

    @@ -145,7 +163,24 @@ References $r

    Definition at line 34 of file class_jrn.php.

    -References $Max, $Res, $ret, ExecSql(), and name. +References $Max, $Res, $ret, ExecSql(), and name.

    00034                      {
    +00035     if ( $this->id==0 ) {
    +00036       $this->name=" Grand Livre ";
    +00037       return $this->name;
    +00038     }
    +00039 
    +00040     $Res=ExecSql($this->db,"select jrn_def_name from ".
    +00041                " jrn_def where jrn_def_id=".
    +00042                $this->id);
    +00043     $Max=pg_NumRows($Res);
    +00044     if ($Max==0) return null;
    +00045     $ret=pg_fetch_array($Res,0);
    +00046     $this->name=$ret['jrn_def_name'];
    +00047     return $ret['jrn_def_name'];
    +00048   }
    +
    +

    +

    @@ -217,7 +252,170 @@ gen :

      Definition at line 65 of file class_jrn.php.

      -References $a, $array, $Max, $Res, $Sql, echo_debug(), and ExecSql(). +References $a, $array, $Max, $Res, $Sql, echo_debug(), and ExecSql().

      00065                                                                       {
      +00066 
      +00067   echo_debug('class_jrn.php',__LINE__,"GetRow ( $p_from,$p_to,$cent,$p_limit,$p_offset)");
      +00068 
      +00069     if ( $p_from == $p_to ) 
      +00070       $periode=" jr_tech_per = $p_from ";
      +00071     else
      +00072       $periode = "(jr_tech_per >= $p_from and jr_tech_per <= $p_to) ";
      +00073     $cond_limite=($p_limit!=-1)?" limit ".$p_limit." offset ".$p_offset:"";
      +00074 
      +00075     // Grand livre == 0
      +00076     if ( $this->id != 0 ) {
      +00077 
      +00078       if ( $cent=='off' ) {
      +00079         echo_debug('class_jrn.php',__LINE__,"journaux non  centralisé");
      +00080         // Journaux non centralisés
      +00081         $Res=ExecSql($this->db,"select j_id,j_id as int_j_id,to_char(j_date,'DD.MM.YYYY') as j_date,
      +00082                       jr_internal,
      +00083                 case j_debit when 't' then j_montant::text else '   ' end as deb_montant,
      +00084                 case j_debit when 'f' then j_montant::text else '   ' end as cred_montant,
      +00085                 j_debit as debit,j_poste as poste,jr_montant , ".
      +00086                "pcm_lib as description,j_grpt as grp,jr_comment||' ('||jr_internal||')' as jr_comment ,
      +00087                 jr_rapt as oc, j_tech_per as periode from jrnx left join jrn on ".
      +00088                  "jr_grpt_id=j_grpt ".
      +00089                  " left join tmp_pcmn on pcm_val=j_poste ".
      +00090                  " where j_jrn_def=".$this->id.
      +00091                " and ".$periode." order by j_date::date asc,jr_internal,j_debit desc ".
      +00092                  $cond_limite);
      +00093     }else {
      +00094       // Journaux centralisés
      +00095       echo_debug('class_jrn.php',__LINE__,"journaux centralisé");
      +00096       $Sql="select jr_opid as j_id,
      +00097                     c_order as int_j_id,
      +00098             to_char (c_date,'DD.MM.YYYY') as j_date ,
      +00099             c_internal as jr_internal,
      +00100             case c_debit when 't' then c_montant::text else '   ' end as deb_montant,
      +00101             case c_debit when 'f' then c_montant::text else '   ' end as cred_montant,
      +00102             c_debit as j_debit,
      +00103             c_poste as poste,
      +00104             pcm_lib as description,
      +00105             jr_comment||' ('||c_internal||')' as jr_comment,
      +00106             jr_montant,
      +00107             c_grp as grp,
      +00108             c_comment as comment,
      +00109             c_rapt as oc,
      +00110             c_periode as periode 
      +00111             from centralized left join jrn on ".
      +00112                 "jr_grpt_id=c_grp left join tmp_pcmn on pcm_val=c_poste where ".
      +00113                 " c_jrn_def=".$this->id." and ".
      +00114                 $periode." order by c_order ";
      +00115       $Res=ExecSql($this->db,$Sql.$cond_limite);
      +00116 
      +00117     }
      +00118   } else {
      +00119     // Grand Livre
      +00120     if ( $cent == 'off') {
      +00121       echo_debug('class_jrn.php',__LINE__,"Grand livre non centralisé");
      +00122       // Non centralisé
      +00123       $Res=ExecSql($this->db,"select j_id,j_id as int_j_id,to_char(j_date,'DD.MM.YYYY') as j_date,
      +00124                       jr_internal,
      +00125                 case j_debit when 't' then j_montant::text else '   ' end as deb_montant,
      +00126                 case j_debit when 'f' then j_montant::text else '   ' end as cred_montant,
      +00127                 j_debit as debit,j_poste as poste,".
      +00128                "pcm_lib as description,j_grpt as grp,
      +00129                 jr_comment||' ('||jr_internal||')' as jr_comment,
      +00130                 jr_montant,
      +00131                 jr_rapt as oc, j_tech_per as periode from jrnx left join jrn on ".
      +00132                  "jr_grpt_id=j_grpt left join tmp_pcmn on pcm_val=j_poste where ".
      +00133                "  ".$periode." order by j_date::date,j_grpt,j_debit desc   ".
      +00134                $cond_limite);
      +00135 
      +00136     } else {
      +00137       echo_debug('class_jrn.php',__LINE__,"Grand livre  centralisé");
      +00138       // Centralisé
      +00139       $Sql="select jr_c_opid as j_id,
      +00140                    c_order as int_j_id,
      +00141 
      +00142             c_j_id,
      +00143             to_char (c_date,'DD.MM.YYYY') as j_date ,
      +00144             c_internal as jr_internal,
      +00145             case c_debit when 't' then c_montant::text else '   ' end as deb_montant,
      +00146             case c_debit when 'f' then c_montant::text else '   ' end as cred_montant,
      +00147             c_debit as j_debit,
      +00148             c_poste as poste,
      +00149             pcm_lib as description,
      +00150             jr_comment||' ('||c_internal||')' as jr_comment,
      +00151             jr_montant,
      +00152             c_grp as grp,
      +00153             c_comment||' ('||c_internal||')' as comment,
      +00154             c_rapt as oc,
      +00155             c_periode as periode 
      +00156             from centralized left join jrn on ".
      +00157                 "jr_grpt_id=c_grp left join tmp_pcmn on pcm_val=c_poste where ".
      +00158                 $periode." order by c_order ";
      +00159     $Res=ExecSql($this->db,$Sql.$cond_limite);
      +00160     } // Grand Livre
      +00161   }
      +00162 
      +00163 
      +00164   $array=array();
      +00165   $Max=pg_NumRows($Res);
      +00166   if ($Max==0) return null;
      +00167   $case="";
      +00168   $tot_deb=0;
      +00169   $tot_cred=0;
      +00170   for ($i=0;$i<$Max;$i++) {
      +00171     $line=pg_fetch_array($Res,$i);
      +00172     $mont_deb=($line['deb_montant']!=0)?sprintf("% 8.2f",$line['deb_montant']):"";
      +00173     $mont_cred=($line['cred_montant']!=0)?sprintf("% 8.2f",$line['cred_montant']):"";
      +00174     $jr_montant=($line['jr_montant']!=0)?sprintf("% 8.2f",$line['jr_montant']):"";
      +00175     $tot_deb+=$line['deb_montant'];
      +00176     $tot_cred+=$line['cred_montant'];
      +00177     echo_debug('class_jrn.php',__LINE__," GetRow : mont_Deb ".$mont_deb);
      +00178     echo_debug('class_jrn.php',__LINE__," GetRow : mont_cred ".$mont_cred);
      +00179 
      +00180     if ( $case != $line['grp'] ) {
      +00181       $case=$line['grp'];
      +00182       $array[]=array (
      +00183                       'int_j_id' => $line['int_j_id'],
      +00184                       'j_id'=>$line['j_id'],
      +00185                       'j_date' => $line['j_date'],
      +00186                       'internal'=>$line['jr_internal'],
      +00187                       'deb_montant'=>'',
      +00188                       'cred_montant'=>'<b><i>'.$jr_montant.'</i></b>',
      +00189                       'description'=>'<b><i>'.$line['jr_comment'].'</i></b>',
      +00190                       'poste' => $line['oc'],
      +00191                       'periode' =>$line['periode'] );
      +00192 
      +00193       $array[]=array (
      +00194                       'int_j_id' => $line['int_j_id'],
      +00195                       'j_id'=>'', 
      +00196                       'j_date' => '',
      +00197                       'internal'=>'',
      +00198                       'deb_montant'=>$mont_deb,
      +00199                       'cred_montant'=>$mont_cred,
      +00200                       'description'=>$line['description'],
      +00201                       'poste' => $line['poste'],
      +00202                       'periode' => $line['periode']
      +00203                       );
      +00204     
      +00205     }else {
      +00206       $array[]=array (
      +00207                       'int_j_id' => $line['int_j_id'],
      +00208                       'j_id'=>'',
      +00209                       'j_date' => '',
      +00210                       'internal'=>'',
      +00211                       'deb_montant'=>$mont_deb,
      +00212                       'cred_montant'=>$mont_cred,
      +00213                       'description'=>$line['description'],
      +00214                       'poste' => $line['poste'],
      +00215                       'periode' => $line['periode']);
      +00216 
      +00217     }
      +00218       
      +00219 
      +00220   }
      +00221   echo_debug('class_jrn.php',__LINE__,"Total debit $tot_deb,credit $tot_cred");
      +00222   $this->row=$array;
      +00223   $a=array($array,$tot_deb,$tot_cred);
      +00224   return $a;
      +00225   }
      +
      +

      +

      @@ -290,7 +488,79 @@ gen :

        Definition at line 243 of file class_jrn.php.

        -References $array, $id, $jrn, $Res, $sql, echo_debug(), and ExecSql(). +References $array, $id, $jrn, $Res, $sql, echo_debug(), and ExecSql().

        00244   {
        +00245     
        +00246     echo_debug('class_jrn.php',__LINE__,"GetRowSimple ( $p_from,$p_to,$cent,$p_limit,$p_offset)");
        +00247     // Periode check
        +00248     //---
        +00249     if ( $p_from == $p_to ) 
        +00250       $periode=" jr_tech_per = $p_from ";
        +00251     else
        +00252       $periode = "(jr_tech_per >= $p_from and jr_tech_per <= $p_to) ";
        +00253     $cond_limite=($p_limit!=-1)?" limit ".$p_limit." offset ".$p_offset:"";
        +00254     // Grand-livre : id= 0
        +00255     //---
        +00256     $jrn=($this->id == 0 )?"":"and jrn_def_id = ".$this->id;
        +00257     // Non Centralise si cent=off
        +00258     //--
        +00259     if ($cent=='off') 
        +00260       {// Non centralisé
        +00261         //---
        +00262         $sql=" 
        +00263     SELECT jrn.jr_id as jr_id ,
        +00264            jrn.jr_id as num , 
        +00265            jrn.jr_def_id as jr_def_id, 
        +00266            jrn.jr_montant as montant, 
        +00267            jrn.jr_comment as comment, 
        +00268            to_char(jrn.jr_date,'DD-MM-YYYY') as date, 
        +00269            jr_internal,
        +00270            jrn.jr_grpt_id as grpt_id, 
        +00271            jrn.jr_pj_name as pj,
        +00272             jrn_def_type
        +00273    FROM jrn join jrn_def on (jrn_def_id=jr_def_id)
        +00274 where $periode $jrn order by jr_date";
        +00275 
        +00276 
        +00277         
        +00278       } 
        +00279     else 
        +00280       {
        +00281         //Centralisé
        +00282         //---
        +00283         $id=($this->id == 0 ) ?"jr_c_opid as num":"jr_opid as num";
        +00284         $sql="
        +00285     SELECT jrn.jr_id as jr_id ,
        +00286            $id , 
        +00287            jrn.jr_def_id as jr_def_id, 
        +00288            jrn.jr_montant as montant, 
        +00289            jrn.jr_comment as comment, 
        +00290            to_char(jrn.jr_date,'DD-MM-YYYY') as date, 
        +00291            jr_internal,
        +00292            jrn.jr_grpt_id as grpt_id, 
        +00293            jrn.jr_pj_name as pj,
        +00294             jrn_def_type
        +00295    FROM jrn join jrn_def on (jrn_def_id=jr_def_id)
        +00296        where 
        +00297          $periode $jrn and 
        +00298          jr_opid is not null
        +00299          order by jr_date";
        +00300       }// end else $cent=='off'
        +00301     //load all data into an array
        +00302     //---
        +00303     $Res=ExecSql($this->db,$sql);
        +00304     if ( pg_NumRows($Res) == 0 ) 
        +00305       {
        +00306         return null;
        +00307       } 
        +00308 
        +00309 
        +00310     $array=pg_fetch_all($Res); 
        +00311 
        +00312     return $array;  
        +00313   }// end function GetRowSimple
        +
        +

        +


        Field Documentation

        @@ -397,8 +667,8 @@ Definition at line 28
        The documentation for this class was generated from the following file:
          -
        • /home/dany/developpement/phpcompta-dev/phpcompta/include/class_jrn.php
        -
        Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
      • class_jrn.php
      +
      Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/classparm__code.html b/doc/developper/html/classparm__code.html index c66530e11..b062ce01d 100644 --- a/doc/developper/html/classparm__code.html +++ b/doc/developper/html/classparm__code.html @@ -86,7 +86,15 @@ Definition at line $p_id, and Get().

      -Referenced by LoadAll(). +Referenced by LoadAll().

      00037     {
      +00038       $this->db=$p_cn;
      +00039       $this->p_code=$p_id;
      +00040       if ( $p_id != -1 )
      +00041         $this->Get();
      +00042     }
      +
      +

      +


      Member Function Documentation

      @@ -122,7 +130,17 @@ tag.

      Definition at line 96 of file class_parm_code.php.

      -References $r. +References $r.

      00097     {
      +00098       $r="";
      +00099       $r.= '<TD>'.$this->p_code.'</TD>';
      +00100       $r.= '<TD>'.$this->p_comment.'</TD>';
      +00101       $r.= '<TD>'.$this->p_value.'</TD>';
      +00102 
      +00103       return $r;
      +00104     }
      +
      +

      +

      @@ -158,7 +176,21 @@ Definition at line $Res, $row, $sql, ExecSql(), p_comment, and p_value.

      -Referenced by parm_code(). +Referenced by parm_code().

      00141                  {
      +00142     if ( $this->p_code == -1 ) return "p_code non initialisé";
      +00143     $sql=sprintf("select * from parm_code where p_code='%s' ",
      +00144                  $this->p_code);
      +00145     $Res=ExecSql($this->db,$sql);
      +00146 
      +00147     if ( pg_NumRows($Res) == 0 ) return 'INCONNU';
      +00148     $row= pg_fetch_array($Res,0);
      +00149     $this->p_value=$row['p_value'];
      +00150     $this->p_comment=$row['p_comment'];
      +00151 
      +00152   }
      +
      +

      +

      @@ -193,7 +225,28 @@ tag.

      Definition at line 112 of file class_parm_code.php.

      -References $comment, $poste, $r, p_comment, and p_value. +References $comment, $poste, $r, p_comment, and p_value.

      00113     {
      +00114       $comment=new widget("text");
      +00115       $comment->name='p_comment';
      +00116       $comment->value=$this->p_comment;
      +00117       $value=new widget("text");
      +00118       $value->name='p_value';
      +00119       $value->value=$this->p_value;
      +00120       $poste=new widget("text");
      +00121       $poste->SetReadOnly(true);
      +00122       $poste->name='p_code';
      +00123       $poste->value=$this->p_code;
      +00124       $r="";
      +00125       $r.= '<TD>'.$poste->IOValue().'</TD>';
      +00126       $r.= '<TD>'.$comment->IOValue().'</TD>';
      +00127       $r.= '<TD>'.$value->IOValue().'</TD>';
      +00128 
      +00129       return $r;
      +00130       
      +00131     }
      +
      +

      +

      @@ -227,7 +280,26 @@ Load all parmCode return an array of parm_code object.

      Definition at line 52 of file class_parm_code.php.

      -References $array, $idx, $o, $r, $Res, $sql, ExecSql(), and parm_code(). +References $array, $idx, $o, $r, $Res, $sql, ExecSql(), and parm_code().

      00052                      {
      +00053     $sql="select * from parm_code order by p_code";
      +00054     $Res=ExecSql($this->db,$sql);
      +00055     $r= pg_fetch_all($Res);
      +00056     $idx=0;
      +00057     $array=array();
      +00058 
      +00059     if ( $r === false ) return null;
      +00060     foreach ($r as $row )
      +00061       {
      +00062         $o=new parm_code($this->db,$row['p_code']);
      +00063         $array[$idx]=$o;
      +00064         $idx++;
      +00065       }
      +00066     
      +00067     return $array;
      +00068   }
      +
      +

      +

      @@ -261,7 +333,21 @@ update a parm_object into the database p_code is _not_ updatable

      Definition at line 76 of file class_parm_code.php.

      -References $Res, $sql, ExecSql(), FormatString(), p_comment, and p_value. +References $Res, $sql, ExecSql(), FormatString(), p_comment, and p_value.

      00077     {
      +00078       // if p_code=="" nothing to save
      +00079       if ( $this->p_code== -1) return;
      +00080       $this->p_comment=FormatString($this->p_comment);
      +00081       $this->p_value=FormatString($this->p_value);
      +00082       $this->p_code=FormatString($this->p_code);
      +00083       $sql="update parm_code set ".
      +00084         "p_comment='".$this->p_comment."'  ".
      +00085         ",p_value='".$this->p_value."'  ".
      +00086         "where p_code='".$this->p_code."'";
      +00087       $Res=ExecSql($this->db,$sql);
      +00088     }
      +
      +

      +


      Field Documentation

      @@ -366,8 +452,8 @@ Definition at line class_parm_code.php
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_parm_code.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classposte.html b/doc/developper/html/classposte.html index d27d0df1e..7263bdb39 100644 --- a/doc/developper/html/classposte.html +++ b/doc/developper/html/classposte.html @@ -84,7 +84,13 @@ Definition at line 28<

    Definition at line 34 of file class_poste.php.

    -References $p_id. +References $p_id.

    00034                               {
    +00035     $this->db=$p_cn;
    +00036     $this->id=$p_id;
    +00037   }
    +
    +

    +


    Member Function Documentation

    @@ -119,7 +125,19 @@ Get all the value for this object from the database the data member are set.

    Definition at line 100 of file class_poste.php.

    -References $r, $ret, ExecSql(), and label. +References $r, $ret, ExecSql(), and label.

    00101     {
    +00102       $ret=ExecSql($this->db,"select pcm_lib,pcm_val_parent from 
    +00103                               tmp_pcmn where pcm_val=".$this->id);
    +00104       $r=pg_fetch_all($ret);
    +00105 
    +00106       if ( ! $r ) return false;
    +00107       $this->label=$r[0]['pcm_lib'];
    +00108       $this->parent=$r[0]['pcm_val_parent'];
    +00109       return true;
    +00110     }
    +
    +

    +

    @@ -153,7 +171,21 @@ Return the name of a account it doesn't change any data member.

    Definition at line 84 of file class_poste.php.

    -References $r, $ret, and name. +References $r, $ret, and name.

    00084                      {
    +00085     $ret=pg_exec($this->db,
    +00086                  "select pcm_lib from tmp_pcmn where
    +00087                   pcm_val=".$this->id);
    +00088       if ( pg_NumRows($ret) != 0) {
    +00089         $r=pg_fetch_array($ret);
    +00090         $this->name=$r['pcm_lib'];
    +00091       } else {
    +00092         $this->name="Poste inconnu";
    +00093       }
    +00094     return $this->name;
    +00095   }
    +
    +

    +

    @@ -203,7 +235,40 @@ Get dat for poste.

    Definition at line 48 of file class_poste.php.

    -References $array, $i, $Max, $Res, and ExecSql(). +References $array, $i, $Max, $Res, and ExecSql().

    00049     {
    +00050       if ( $p_from == $p_to ) 
    +00051         $periode=" jr_tech_per = $p_from ";
    +00052       else
    +00053         $periode = "(jr_tech_per >= $p_from and jr_tech_per <= $p_to) ";
    +00054       
    +00055       $Res=ExecSql($this->db,"select to_char(j_date,'DD.MM.YYYY') as j_date,".
    +00056                "case when j_debit='t' then j_montant else 0 end as deb_montant,".
    +00057                "case when j_debit='f' then j_montant else 0 end as cred_montant,".
    +00058                " jr_comment as description,jrn_def_name as jrn_name,".
    +00059                "j_debit, jr_internal ".
    +00060                " from jrnx left join jrn_def on jrn_def_id=j_jrn_def ".
    +00061                " left join jrn on jr_grpt_id=j_grpt".
    +00062                " where j_poste=".$this->id." and ".$periode.
    +00063                " order by j_date::date");
    +00064       $array=array();
    +00065       $tot_cred=0.0;
    +00066       $tot_deb=0.0;
    +00067       $Max=pg_NumRows($Res);
    +00068       if ( $Max == 0 ) return null;
    +00069       for ($i=0;$i<$Max;$i++) {
    +00070         $array[]=pg_fetch_array($Res,$i);
    +00071         if ($array[$i]['j_debit']=='t') {
    +00072           $tot_deb+=$array[$i]['deb_montant'] ;
    +00073         } else {
    +00074           $tot_cred+=$array[$i]['cred_montant'] ;
    +00075         }
    +00076       }
    +00077       $this->row=$array;
    +00078   return array($array,$tot_deb,$tot_cred);
    +00079 }
    +
    +

    +

    @@ -238,7 +303,25 @@ give the balance of an account

    Definition at line 119 of file class_poste.php.

    -References $Max, $r, $Res, and ExecSql(). +References $Max, $r, $Res, and ExecSql().

    00119                               {
    +00120   $Res=ExecSql($this->db,"select sum(deb) as sum_deb, sum(cred) as sum_cred from 
    +00121           ( select j_poste, 
    +00122              case when j_debit='t' then j_montant else 0 end as deb, 
    +00123              case when j_debit='f' then j_montant else 0 end as cred 
    +00124           from jrnx join tmp_pcmn on j_poste=pcm_val 
    +00125               where  
    +00126             j_poste like ('$this->id'::text) and
    +00127             $p_cond
    +00128           ) as m  ");
    +00129   $Max=pg_NumRows($Res);
    +00130   if ($Max==0) return 0;
    +00131   $r=pg_fetch_array($Res,0);
    +00132   
    +00133   return abs($r['sum_deb']-$r['sum_cred']);
    +00134 }
    +
    +

    +

    @@ -273,7 +356,28 @@ give the balance of an account

    Definition at line 141 of file class_poste.php.

    -References $Max, $r, $Res, and ExecSql(). +References $Max, $r, $Res, and ExecSql().

    00141                                     {
    +00142         if ( $p_cond != "") $p_cond=" and ".$p_cond;
    +00143   $Res=ExecSql($this->db,"select sum(deb) as sum_deb, sum(cred) as sum_cred from 
    +00144           ( select j_poste, 
    +00145              case when j_debit='t' then j_montant else 0 end as deb, 
    +00146              case when j_debit='f' then j_montant else 0 end as cred 
    +00147           from jrnx join tmp_pcmn on j_poste=pcm_val 
    +00148               where  
    +00149             j_poste like ('$this->id'::text)
    +00150             $p_cond
    +00151           ) as m  ");
    +00152   $Max=pg_NumRows($Res);
    +00153   if ($Max==0) return 0;
    +00154   $r=pg_fetch_array($Res,0);
    +00155   
    +00156   return array('debit'=>$r['sum_deb'],
    +00157                'credit'=>$r['sum_cred'],
    +00158                'solde'=>abs($r['sum_deb']-$r['sum_cred']));
    +00159 }
    +
    +

    +


    Field Documentation

    @@ -403,8 +507,8 @@ Definition at line 33<
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_poste.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classrapport.html b/doc/developper/html/classrapport.html index d0707ec3f..66861dd24 100644 --- a/doc/developper/html/classrapport.html +++ b/doc/developper/html/classrapport.html @@ -74,7 +74,14 @@ Constructor.

    Definition at line 33 of file class_rapport.php.

    -References $p_id, and name. +References $p_id, and name.

    00033                                 {
    +00034     $this->db=$p_cn;
    +00035     $this->id=$p_id;
    +00036     $this->name='UNDEF';
    +00037   }
    +
    +

    +


    Member Function Documentation

    @@ -108,7 +115,16 @@ Return the report's name.

    Definition at line 40 of file class_rapport.php.

    -References $a, $ret, and name. +References $a, $ret, and name.

    00040                      {
    +00041     $ret=execSql($this->db,"select fr_label from formdef where fr_id=".$this->id);
    +00042     if (pg_NumRows($ret) == 0) return $this->name;
    +00043     $a=pg_fetch_array($ret,0);
    +00044     $this->name=$a['fr_label'];
    +00045     return $this->name;
    +00046   }
    +
    +

    +

    @@ -157,7 +173,36 @@ return all the row and parse formula from a report

    Definition at line 53 of file class_rapport.php.

    -References $col, $l_line, $Max, $Res, ExecSql(), and ParseFormula(). +References $col, $l_line, $Max, $Res, ExecSql(), and ParseFormula().

    00053                                     {
    +00054 
    +00055    $Res=ExecSql($this->db,"select fo_id ,
    +00056                      fo_fr_id,
    +00057                      fo_pos,
    +00058                      fo_label,
    +00059                      fo_formula,
    +00060                      fr_label from form
    +00061                       inner join formdef on fr_id=fo_fr_id
    +00062                      where fr_id =".$this->id.
    +00063                      "order by fo_pos");
    +00064     $Max=pg_NumRows($Res);
    +00065     if ($Max==0) {      $this->row=0;return null;}
    +00066     $col=array();
    +00067     for ($i=0;$i<$Max;$i++) {
    +00068       $l_line=pg_fetch_array($Res,$i);
    +00069         $col[]=ParseFormula($this->db,
    +00070                             $l_line['fo_label'],
    +00071                             $l_line['fo_formula'],
    +00072                             $p_start,
    +00073                             $p_end
    +00074                             );
    +00075      
    +00076     } //for ($i
    +00077     $this->row=$col;
    +00078     return $col;
    +00079   }
    +
    +

    +


    Field Documentation

    @@ -237,8 +282,8 @@ Definition at line 3
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_rapport.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/classwidget.html b/doc/developper/html/classwidget.html index f780d12e2..2bf468e8a 100644 --- a/doc/developper/html/classwidget.html +++ b/doc/developper/html/classwidget.html @@ -86,7 +86,22 @@ Definition at line 31

    Definition at line 64 of file class_widget.php.

    -References disabled, heigh, label, readonly, selected, size, table, value, and width. +References disabled, heigh, label, readonly, selected, size, table, value, and width.

    00064                               {
    +00065     $this->type=$p_type;
    +00066     $this->readonly=false;
    +00067     $this->size=20;
    +00068     $this->width=50;
    +00069     $this->heigh=20;
    +00070     $this->value="";
    +00071     $this->selected="";
    +00072     $this->table=0;
    +00073     $this->label="";
    +00074     $this->disabled=false;
    +00075     $this->tabindex=32767;
    +00076   }
    +
    +

    +


    Member Function Documentation

    @@ -118,7 +133,16 @@ References disabled<

    Definition at line 498 of file class_widget.php.

    -References $readonly, readonly, and value. +References $readonly, readonly, and value.

    00498                    {
    +00499     echo "Type ".$this->type."<br>";
    +00500     echo "name ".$this->name."<br>";
    +00501     echo "value". $this->value."<br>";
    +00502     $readonly=($this->readonly==false)?"false":"true";
    +00503     echo "read only".$readonly."<br>";
    +00504   }
    +
    +

    +

    @@ -178,7 +202,409 @@ function IOValue($p_name,$p_value="",$p_label="")

    Definition at line 89 of file class_widget.php.

    -References $check, $disabled, $i, $msg, $r, disabled, echo_debug(), label, name, readonly, selected, and value. +References $check, $disabled, $i, $msg, $r, disabled, echo_debug(), label, name, readonly, selected, and value.

    00089                                                            {
    +00090     
    +00091     if ( $p_name != null)
    +00092       $this->name=$p_name;
    +00093     $this->value=($p_value===null)?$this->value:$p_value;
    +00094     $this->label=($p_label == "")?$this->label:$p_label;
    +00095     
    +00096     // Input text type
    +00097     $disabled = $this->disabled ? "DISABLED" : "";
    +00098     if (strtoupper($this->type)=="TEXT") {
    +00099       if ( $this->readonly==false) {
    +00100         $r="<INPUT style=\"border:solid 1px blue;\" TYPE=\"TEXT\" NAME=\"$this->name\" VALUE=\"$this->value\" TABINDEX=\"$this->tabindex\" SIZE=\"$this->size\" ".$disabled.">";} else {
    +00101             $r=sprintf('<span>%s</span><input type="hidden" name="%s" value="%s">', $this->value,$this->name,$this->value);
    +00102         }
    +00103         
    +00104       if ($this->table==1) {
    +00105         if ( $this->label != "") {
    +00106           $r="<TD  style=\"border:groove 1px blue;\">".$this->label."</TD><TD>".$r."</TD>";
    +00107         }else {
    +00108           $r="<TD>".$r."</TD>";
    +00109         }
    +00110       }
    +00111       return $r;
    +00112     }
    +00113     // Hidden field
    +00114     if (strtoupper($this->type)=="HIDDEN") {
    +00115       $r='<INPUT TYPE="HIDDEN" name="'.$this->name.'" value="'.$this->value.'">';
    +00116       if ( $this->readonly==true) return "";
    +00117       return $r;
    +00118     }
    +00119     // Select value
    +00120     if ( strtoupper($this->type) == "SELECT") {
    +00121       if ($this->readonly==false )
    +00122         {
    +00123           //echo "<b>Selected <b>".$this->selected;
    +00124           $r="<SELECT  NAME=\"$this->name\">";
    +00125           for ( $i=0;$i<sizeof($this->value);$i++) 
    +00126             {
    +00127               $checked=($this->selected==$this->value[$i]['value'])?"SELECTED":"";
    +00128               $r.='<OPTION VALUE="'.$this->value[$i]['value'].'" '.$checked.'>';
    +00129               $r.=$this->value[$i]['label'];
    +00130             }
    +00131           $r.="</SELECT>";
    +00132         } else 
    +00133           {
    +00134             $r="";
    +00135             echo_debug('class_widget.php',__LINE__,"this->selected = ".$this->selected); 
    +00136             for ( $i=0;$i<sizeof($this->value);$i++) 
    +00137               {
    +00138                 echo_debug('class_widget.php',__LINE__,"check for ".$this->value[$i]['value']);
    +00139                 if ($this->selected==$this->value[$i]['value'] ) 
    +00140                   {
    +00141                     $r=$this->value[$i]['label'];
    +00142         
    +00143                   }
    +00144               }
    +00145           }
    +00146       if ( $this->table==1) {
    +00147         $r="<TD> $r </TD>";
    +00148         if ( $this->label != "") $r="<TD> $this->label</TD>".$r;
    +00149       }
    +00150       return $r;
    +00151     }
    +00152     // Password
    +00153     if (strtoupper($this->type)=="PASSWORD") {
    +00154       if ( $this->readonly==true) return "";
    +00155       $r='<input type="password" name="'.$this->name;
    +00156       $r.='">';
    +00157       if ($this->table==1) {
    +00158         $r="<TD> $this->label </TD><TD> $r </TD>";
    +00159       }
    +00160       return $r;
    +00161     }
    +00162 
    +00163     // Checkbox
    +00164     if (strtoupper($this->type)=="CHECKBOX") {
    +00165       if ( $this->readonly == true) {
    +00166         $check=( $this->selected==true )?"checked":"unchecked";
    +00167         $r='<input type="CHECKBOX" name="'.$this->name.'"';
    +00168         $r.="  $check";
    +00169         $r.=' disabled>';
    +00170 
    +00171       } else {
    +00172         $check=( $this->selected==true )?"checked":"unchecked";
    +00173         $r='<input type="CHECKBOX" name="'.$this->name.'"';
    +00174         $r.="  $check";
    +00175         $r.=' '.$disabled.'>';
    +00176       }
    +00177       if ($this->table==1) {
    +00178         $r="<TD> $this->label </TD><TD> $r </TD>";
    +00179       } else {
    +00180         $r=$r." $this->label";
    +00181       }
    +00182       return $r;
    +00183     }
    +00184 
    +00185     //radio
    +00186     if (strtoupper($this->type)=="RADIO") {
    +00187       if ( $this->readonly == true) {
    +00188         $check=( $this->selected==true || $this->selected=='t' )?"Yes":"no";
    +00189         $r=$check;
    +00190       } else {
    +00191         $check=( $this->selected==true||$this->selected=='t' )?"checked":"unchecked";
    +00192         $r='<input type="RADIO" name="'.$this->name.'"';
    +00193         $r.=" VALUE=\"$this->value\"";
    +00194         $r.="  $check";
    +00195         $r.=' '.$disabled.'>';
    +00196       }
    +00197       if ($this->table==1) {
    +00198         $r="<TD> $this->label </TD><TD> $r </TD>";
    +00199       } else {
    +00200         $r=$this->label.$r;
    +00201       }
    +00202       return $r;
    +00203     }
    +00204 
    +00205     //textarea
    +00206     if (strtoupper($this->type)=="TEXTAREA") {
    +00207       if ( $this->readonly == false ) {
    +00208         $r="";
    +00209         $r.='<TEXTAREA name="'.$this->name.'"';
    +00210         $r.=" rows=\"$this->heigh\" ";
    +00211         $r.=" cols=\"$this->width\" ";
    +00212         $r.=' '.$disabled.'>';
    +00213         $r.=$this->value;
    +00214 
    +00215         $r.="</TEXTAREA>";
    +00216       } else {
    +00217         $r='<p>';
    +00218         $r.=$this->value;
    +00219         $r.=sprintf('<input type="hidden" name="%s" value="%s">',
    +00220                     $this->name,urlencode($this->value));
    +00221         $r.='</p>';
    +00222 
    +00223       }
    +00224       if ($this->table==1) {
    +00225         $r="<TD> $this->label </TD><TD> $r </TD>";
    +00226       }
    +00227       return $r;
    +00228     }
    +00229 
    +00230     //----------------------------------------------------------------------
    +00231 
    +00232     //----------------------------------------------------------------------
    +00233     // Rich Text
    +00239     if ( strtoupper($this->type)=='RICHTEXT')
    +00240       {
    +00241             $r= ' <script language="JavaScript" type="text/javascript"> '.
    +00242               '<!-- '."\n".
    +00243               "\nfunction submitForm() {\n".
    +00244               " updateRTE('".$this->name."');\n ".
    +00245               " return true; \n".
    +00246               "} \n".
    +00247               'initRTE("images/", "", "");'."\n".
    +00248               '//-->'."\n".
    +00249               '</script>'.
    +00250               '<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>'.
    +00251               'Note Interne : '.
    +00252               '<script language="JavaScript" type="text/javascript">'."\n".
    +00253               '<!--'."\n";
    +00254               //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
    +00255 
    +00256             echo_debug('class_widget',__LINE__,'to write is '.$this->name);
    +00257             /*\! brief 
    +00258              *\note the value must be urlencoded
    +00259              */
    +00260             //  Removing new line
    +00261             
    +00262             //      $msg=urlencode($this->value);
    +00263             $msg=$this->value;
    +00264             $msg=str_replace("%OA","",$msg);
    +00265             $msg=str_replace("%OD","",$msg);
    +00266             $msg=str_replace("\n","",$msg);
    +00267             $msg=str_replace("\r","",$msg);
    +00268 
    +00269             $read=($this->readonly==false)?"false":"true";          
    +00270 
    +00271 
    +00272             $r.=sprintf(" writeRichText('%s','%s',%d,%d,true,%s);\n",
    +00273                         $this->name,
    +00274                         $msg,
    +00275                         $this->width,
    +00276                         $this->heigh, 
    +00277                         $read);
    +00278             $r.= "\n//-->".
    +00279               "</script>";
    +00280             echo_debug ('class_widget',__LINE__,"writeRichText '$r'");
    +00281 
    +00282             return $r;
    +00283           
    +00284       }
    +00285 
    +00286     //----------------------------------------------------------------------
    +00287     //file
    +00288     if (strtoupper($this->type)=="FILE") {
    +00289       if ( $this->readonly == false ) {
    +00290         $r='<INPUT TYPE="file" name="'.$this->name.'" VALUE="'.$this->value.'">';
    +00291 
    +00292       }
    +00293       if ( $this->table==1) $r="<TD>$this->label</TD><TD>$r</TD>"; 
    +00294       return $r;
    +00295     }
    +00296   // input type == js_search_poste => button search for the account
    +00297     if ( strtolower($this->type)=="js_search_poste") {
    +00298      
    +00299       $l_sessid=$_REQUEST['PHPSESSID'];
    +00300       if ( $this->readonly == false ) {
    +00301       // Do we need to filter ??
    +00302       if ( $this->extra2 == null ) {
    +00303       $r=sprintf('<TD>
    +00304          <INPUT TYPE="button" onClick=SearchPoste(\'%s\',\'%s\',\'%s\') value="Search">
    +00305             %s</TD><TD> 
    +00306 
    +00307              <INPUT   TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
    +00308                  </TD>',
    +00309                  $l_sessid,
    +00310                  $this->name,
    +00311                  $this->extra,
    +00312                  $this->label,
    +00313                  $this->name,
    +00314                  $this->value 
    +00315                  );
    +00316 
    +00317     } else { // $p_list is not null, so we have a filter
    +00318       $r=sprintf('<TD>
    +00319          <INPUT TYPE="button" onClick=SearchPosteFilter(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
    +00320             %s</TD><TD> 
    +00321 
    +00322              <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
    +00323                  </TD>',
    +00324                  $l_sessid,
    +00325                  $this->name,
    +00326                  $this->extra2,
    +00327                  $this->extra,
    +00328                  $this->label,
    +00329                  $this->name,
    +00330                  $this->value 
    +00331                  );
    +00332 
    +00333       } //else
    +00334       } else {
    +00335       $r=sprintf('<TD><input type="hidden" name="%s" value="%s">
    +00336                   %s
    +00337 
    +00338                  </TD>',
    +00339                  $this->name, 
    +00340                  $this->value ,
    +00341                  $this->value 
    +00342                  );
    +00343 
    +00344       } //else if readonly == true
    +00345       return $r;
    +00346 
    +00347     } // end js_search_poste
    +00348 
    +00349   // input type == js_search => button search for card
    +00350   if ( strtolower($this->type)=="js_search") {
    +00351     $l_sessid=$_REQUEST['PHPSESSID'];
    +00352     if  ( $this->readonly == false ) {
    +00353       $r=sprintf('<TD>
    +00354          <INPUT TYPE="button" onClick=NewCard(\'%s\',\'%s\',\'%s\',\'%s\') value="New">
    +00355          </TD><TD>
    +00356          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
    +00357             %s <INPUT TYPE="Text"    NAME="%s" VALUE="%s" SIZE="8" TABINDEX="%s">
    +00358                  ',
    +00359                $l_sessid,
    +00360                $this->extra, // deb or cred
    +00361                $this->name,
    +00362                $this->extra2, //jrn
    +00363                $l_sessid,
    +00364                $this->extra,
    +00365                $this->name,
    +00366                $this->extra2,
    +00367                $this->label,
    +00368                $this->name,
    +00369                $this->value, 
    +00370          $this->tabindex
    +00371                );
    +00372     } else {
    +00373       // readonly == true
    +00374       $r=sprintf('<TD>            %s</TD>
    +00375                  <TD> 
    +00376                  <INPUT TYPE="hidden" NAME="%s" VALUE="%s" SIZE="8">
    +00377                  </TD>',
    +00378                $this->label,
    +00379                $this->name,
    +00380                $this->value 
    +00381                  );
    +00382 
    +00383     }
    +00384     return $r;
    +00385   }// poste==js_search
    +00386 
    +00387 
    +00388   // input type == js_search => button search for card
    +00391   if ( strtolower($this->type)=="js_search_only") {
    +00392     $l_sessid=$_REQUEST['PHPSESSID'];
    +00393     if  ( $this->readonly == false ) {
    +00394       if ( $this->table==1)
    +00395         {
    +00396           $r=sprintf('<TD>
    +00397          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
    +00398             %s</TD><TD> <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8" TABINDEX="%s">
    +00399                  ',
    +00400                $l_sessid,
    +00401                $this->extra,
    +00402                $this->name,
    +00403                $this->extra2,
    +00404                $this->label,
    +00405                $this->name,
    +00406                $this->value, 
    +00407          $this->tabindex
    +00408                );
    +00409         }
    +00410       else
    +00411         {
    +00412           $r=sprintf('
    +00413          <INPUT TYPE="button" onClick=SearchCard(\'%s\',\'%s\',\'%s\',\'%s\') value="Search">
    +00414             %s <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8" TABINDEX="%s">           ',
    +00415                $l_sessid,
    +00416                $this->extra,
    +00417                $this->name,
    +00418                $this->extra2,
    +00419                $this->label,
    +00420                $this->name,
    +00421                $this->value, 
    +00422                $this->tabindex
    +00423                );
    +00424         }
    +00425     } else {
    +00426       // readonly == true
    +00427       $r=sprintf('<TD>            %s</TD>
    +00428                  <TD> 
    +00429                  <INPUT TYPE="hidden" NAME="%s" VALUE="%s" SIZE="8">
    +00430                  </TD>',
    +00431                $this->label,
    +00432                $this->name,
    +00433                $this->value 
    +00434                  );
    +00435 
    +00436     }
    +00437     return $r;
    +00438   }// poste==js_search_only
    +00439 
    +00440 
    +00441 
    +00442 
    +00443 
    +00444   // type=span
    +00445   if ( strtolower($this->type)=="span") {
    +00446     $r=sprintf('<span id="%s"  >%s </span>',
    +00447                $this->name,
    +00448                $this->value
    +00449                );
    +00450 
    +00451     return $r;
    +00452   }// end type = span
    +00453 
    +00454    // input type == js_tva
    +00455    if ( strtolower($this->type)=="js_tva") {
    +00456      $id=sprintf("<span id=%s></span>",$this->label);
    +00457         $r=sprintf('%s<TD> <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="3" onChange="ChangeTVA(\'%s\',\'%s\');">',
    +00458                   $id,
    +00459                $this->name,
    +00460                $this->value,
    +00461                $this->label,
    +00462                $this->name);
    +00463      $l_sessid=$_REQUEST['PHPSESSID'];
    +00464      $r.=sprintf("<input type=\"button\" value=\"Tva\" 
    +00465         onClick=\"
    +00466                            ShowTva('%s','%s');\"></TD>",
    +00467                 $l_sessid,$this->name);
    +00468      return $r;
    +00469    }
    +00470 
    +00471   // input type == js_concerned => button search for the concerned operations
    +00472   if ( strtolower($this->type)=="js_concerned") {
    +00473     if ( $this->readonly == false) {
    +00474       $l_sessid=$_REQUEST['PHPSESSID'];
    +00475       $r=sprintf('<TD>
    +00476          <INPUT TYPE="button" onClick=SearchJrn(\'%s\',\'%s\') value="Search">
    +00477             %s</TD><TD> 
    +00478 
    +00479              <INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
    +00480                  </TD>',
    +00481                  $l_sessid,
    +00482                  $this->name,
    +00483                  $this->label,
    +00484                  $this->name,
    +00485                  $this->value 
    +00486                  );
    +00487     } else {
    +00488       $r=sprintf("<TD><span>%s</span>",$this->value);
    +00489       $r.=sprintf('<input type="hidden" name="%s" value="%s"></TD>', $this->name,$this->value);
    +00490     }
    +00491 
    +00492     return $r;
    +00493   }// end js_concerned
    +00494   return "INVALID WIDGET $this->type ";
    +00495   } //end function
    +
    +

    +

    @@ -208,7 +634,12 @@ References $check

    -Definition at line 508 of file class_widget.php. +Definition at line 508 of file class_widget.php.

    00508                             {
    +00509     return '<INPUT TYPE="SUBMIT"  VALUE="'.$p_value.'">';
    +00510   }
    +
    +

    +

    @@ -240,7 +671,12 @@ Definition at line 50

    Definition at line 77 of file class_widget.php.

    -References readonly. +References readonly.

    00077                                 {
    +00078     $this->readonly=$p_read;
    +00079   }
    +
    +

    +

    @@ -279,7 +715,12 @@ References readonly.

    -Definition at line 505 of file class_widget.php. +Definition at line 505 of file class_widget.php.

    00505                                      {
    +00506     return '<INPUT TYPE="SUBMIT" NAME="'.$p_name.'" VALUE="'.$p_value.'">';
    +00507   }
    +
    +

    +


    Field Documentation

    @@ -590,8 +1031,8 @@ Definition at line 54
    The documentation for this class was generated from the following file:
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
  • class_widget.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/client_8inc_8php-source.html b/doc/developper/html/client_8inc_8php-source.html index 4a2848b3e..852d78af8 100644 --- a/doc/developper/html/client_8inc_8php-source.html +++ b/doc/developper/html/client_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/client.inc.php Source File +phpcompta: client.inc.php Source File +include

    client.inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -48,7 +48,7 @@
     00043 // Add card
     00044 if ( $sub_action=="insert" )
     00045 {
    -00046   $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
    +00046   $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
     00047                   urldecode($_REQUEST['url']));
     00048 
     00049   $customer=new Customer($cn);
    @@ -77,19 +77,19 @@
     00072 //Display a blank card 
     00073 if ( $sub_action=="blank") 
     00074 {
    -00075   $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
    +00075   $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
     00076                   "commercial.php?p_action=client");
     00077   echo '<div class="u_redcontent">';
     00078 
     00079   echo $retour;
     00080   $c=new Customer($cn);
     00081   echo '<form method="post" action="commercial.php"';
    -00082   echo '<input type="hidden" name="p_action" value="client">';
    -00083   echo '<input type="hidden" name="sa" value="insert">';
    -00084   echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
    -00085   echo '<input type="hidden" name="url" value="'.$_GET['url'].'">';
    +00082   echo '<input type="hidden" name="p_action" value="client">';
    +00083   echo '<input type="hidden" name="sa" value="insert">';
    +00084   echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
    +00085   echo '<input type="hidden" name="url" value="'.$_GET['url'].'">';
     00086   echo $c->blank($_GET['fd_id']);
    -00087   echo '<input type="Submit" value="Sauve">';
    +00087   echo '<input type="Submit" value="Sauve">';
     00088   echo '</form>';
     00089   echo $retour;
     00090   echo '</div>';
    @@ -104,17 +104,17 @@
     00099 <form method="get" action="commercial.php">
     00100 <?
     00101    $a=(isset($_GET['query']))?$_GET['query']:"";
    -00102    printf ('<input type="text" name="query" value="%s">',
    +00102    printf ('<input type="text" name="query" value="%s">',
     00103            $a);
     00104 ?>
    -00105 <input type="submit" name="submit_query" value="recherche">
    -00106 <input type="hidden" name="p_action" value="client">
    +00105 <input type="submit" name="submit_query" value="recherche">
    +00106 <input type="hidden" name="p_action" value="client">
     00107 </form>
     00108 </span>
     00109 <span>
     00110 <form method="get" action="commercial.php">
    -00111 <input type="hidden" name="url" <?      $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
    -00112 <input type="hidden" name="p_action" value="client">
    +00111 <input type="hidden" name="url" <?      $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
    +00112 <input type="hidden" name="p_action" value="client">
     00113 
     00114 <?
     00115  $w=new widget("select");
    @@ -123,8 +123,8 @@
     00118              " frd_id=".FICHE_TYPE_CLIENT);
     00119  echo $w->IOValue();
     00120 ?>
    -00121 <input type="hidden" name="sa" value="blank">
    -00122 <input type="submit" name="submit_query" value="Ajout Client">
    +00121 <input type="hidden" name="sa" value="blank">
    +00122 <input type="submit" name="submit_query" value="Ajout Client">
     00123 
     00124 </form>
     00125 </span>
    @@ -167,7 +167,7 @@
     00162 }
     00163 html_page_stop();
     00164 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/client_8inc_8php.html b/doc/developper/html/client_8inc_8php.html index 4ba0f6226..3652702d1 100644 --- a/doc/developper/html/client_8inc_8php.html +++ b/doc/developper/html/client_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/client.inc.php File Reference +phpcompta: client.inc.php File Reference +include

    client.inc.php File Reference

    Called from the module "Gestion" to manage the customer. More...

    @@ -140,7 +140,7 @@ Referenced by Custo

    -Initial value:

    sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
    +Initial value:
    sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
                       urldecode($_REQUEST['url']))
     

    @@ -299,7 +299,7 @@ Definition at line 116< Definition at line 117 of file client.inc.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/commercial_8php-source.html b/doc/developper/html/commercial_8php-source.html index 7803c7837..1b41f5271 100644 --- a/doc/developper/html/commercial_8php-source.html +++ b/doc/developper/html/commercial_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/commercial.php Source File +phpcompta: commercial.php Source File +html

    commercial.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -153,7 +153,7 @@
     00151 {
     00152   require_once("bank.inc.php");
     00153 }
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/commercial_8php.html b/doc/developper/html/commercial_8php.html index 1130c6e29..005817f27 100644 --- a/doc/developper/html/commercial_8php.html +++ b/doc/developper/html/commercial_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/commercial.php File Reference +phpcompta: commercial.php File Reference +html

    commercial.php File Reference

    Base of the module "Gestion", the p_action indicates what file must included and this file will manage the request (customer, supplier, contact,...). More...

    @@ -55,7 +55,7 @@ Definition in file commercial.p

    Definition at line 35 of file commercial.php.

    -Referenced by cl_user::Check(), cl_user::cl_user(), fiche::GetByDef(), cl_user::GetGlobalPref(), jrn_navigation_bar(), ListJrn(), action::myList(), ShowDossier(), TransferCSV(), and ViewFiche(). +Referenced by cl_user::Check(), cl_user::cl_user(), fiche::GetByDef(), cl_user::GetGlobalPref(), jrn_navigation_bar(), ListJrn(), action::myList(), ShowDossier(), TransferCSV(), and ViewFiche().

    @@ -158,7 +158,7 @@ Definition at line 4143 of file commercial.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/constant_8php-source.html b/doc/developper/html/constant_8php-source.html index 3507947ab..6c5b402dd 100644 --- a/doc/developper/html/constant_8php-source.html +++ b/doc/developper/html/constant_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/constant.php Source File +phpcompta: constant.php Source File +include

    constant.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -342,53 +342,43 @@
     00338 </script>
     00339 ");
     00340 // One line calculator
    -00341 define ("JS_CALC_LINE","
    -00342 
    -00343 <form name=\"calc_line\" onSubmit=\"cal()\">
    -00344 <input type=\"text\" size=\"20\" name=\"calculator\" onBlur=\"cal()\">
    -00345 Answer:<span id=\"name\"></span>
    -00346 <br>
    -00347 
    -00348 <!-- <input type=\"button\" name=\"B1\" value=\"Calculate\" > -->
    -00349 
    -00350 <input type=\"reset\" name=\"B2\" value=\"Reset\"><br>
    -00351 
    -00352 
    -00353 </form>
    -00354 <SCRIPT  language=\"javascript\">
    -00355 
    -00356 function cal()
    -00357 {
    -00358   document.getElementById(\"name\").innerHTML=
    -00359   eval(document.calc_line.calculator.value)
    -00360 }
    -00361 </script>
    -00362 
    -00363 
    -00364 
    -00365 "
    -00366 );
    -00367 
    -00368 define ("JS_TVA","<script  language=\"javascript\">
    -00369 
    -00370 function ChangeTVA(p_ctl,p_value) {
    -00371         if (document.getElementById(p_ctl) ) {
    -00372           var f=document.getElementsByName(p_value);
    -00373           for ( var i=0; i < f.length ; i++) {
    -00374                   document.getElementById(p_ctl).innerHTML=f[i].value;
    -00375         }
    -00376         }
    -00377 }
    -00378 
    -00379 </script>");
    -00380 // Sql string
    -00381 define ("SQL_LIST_ALL_INVOICE","");
    -00382 
    -00383 define ("SQL_LIST_UNPAID_INVOICE"," where (jr_rapt is null or jr_rapt = '') and jr_valid = true "); 
    -00384 define ("SQL_LIST_UNPAID_INVOICE_DATE_LIMIT" ," where (jr_rapt is null or jr_rapt = '') 
    -00385                        and to_date(to_char(jr_ech,'DD.MM.YYYY'),'DD.MM.YYYY') < to_date(to_char(now(),'DD.MM.YYYY'),'DD.MM.YYYY') and jr_valid = true" );
    -00386 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +00341 define ("JS_CALC_LINE",' +00342 <div style="border:outset black 2px; position:float; float:right;background-color:white;font-family:sans-serif;font-size:9pt;"> +00343 <script type="text/javascript" language="javascript" src="js/calc.js"> +00344 </script> +00345 <h2 class="info"> Calculette</H2> +00346 <span id="listing"> </span> +00347 <br> +00348 <span id="sub_total"> </span> +00349 <span id="result"> </span> +00350 <form name="calc_line" method="GET" onSubmit="cal();return false;" > +00351 <input type="text" size="30" id="inp" name="calculator"> +00352 <input type="button" value="Efface tout" onClick="Clean();return false;" > +00353 </form> +00354 </div> +00355 ' +00356 ); +00357 +00358 define ("JS_TVA","<script language=\"javascript\"> +00359 +00360 function ChangeTVA(p_ctl,p_value) { +00361 if (document.getElementById(p_ctl) ) { +00362 var f=document.getElementsByName(p_value); +00363 for ( var i=0; i < f.length ; i++) { +00364 document.getElementById(p_ctl).innerHTML=f[i].value; +00365 } +00366 } +00367 } +00368 +00369 </script>"); +00370 // Sql string +00371 define ("SQL_LIST_ALL_INVOICE",""); +00372 +00373 define ("SQL_LIST_UNPAID_INVOICE"," where (jr_rapt is null or jr_rapt = '') and jr_valid = true "); +00374 define ("SQL_LIST_UNPAID_INVOICE_DATE_LIMIT" ," where (jr_rapt is null or jr_rapt = '') +00375 and to_date(to_char(jr_ech,'DD.MM.YYYY'),'DD.MM.YYYY') < to_date(to_char(now(),'DD.MM.YYYY'),'DD.MM.YYYY') and jr_valid = true" ); +00376 ?> +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/constant_8php.html b/doc/developper/html/constant_8php.html index a9d71a5ef..6499dc126 100644 --- a/doc/developper/html/constant_8php.html +++ b/doc/developper/html/constant_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/constant.php File Reference +phpcompta: constant.php File Reference +include

    constant.php File Reference

    Contains all the variable + the javascript and some parameter. More...

    @@ -1567,7 +1567,7 @@ Definition at line 170

    -Definition at line 368 of file constant.php. +Definition at line 358 of file constant.php.

    @@ -2217,7 +2217,7 @@ Definition at line 50

    -Definition at line 381 of file constant.php. +Definition at line 371 of file constant.php.

    @@ -2242,7 +2242,7 @@ Definition at line 381

    -Definition at line 383 of file constant.php. +Definition at line 373 of file constant.php.

    @@ -2267,7 +2267,7 @@ Definition at line 383

    -Definition at line 384 of file constant.php. +Definition at line 374 of file constant.php.

    @@ -2370,7 +2370,7 @@ Definition at line 59 Definition at line 89 of file constant.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/contact_8inc_8php-source.html b/doc/developper/html/contact_8inc_8php-source.html index 2f8bf8d2c..ba8633e7a 100644 --- a/doc/developper/html/contact_8inc_8php-source.html +++ b/doc/developper/html/contact_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/contact.inc.php Source File +phpcompta: contact.inc.php Source File +include

    contact.inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -36,8 +36,8 @@
     00034 // TODO add function for generating url, hidden tags...
     00035 if ( isset ($_REQUEST['url'])) 
     00036 {
    -00037      $retour=sprintf('<A class="mtitle" HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
    -00038      $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
    +00037      $retour=sprintf('<A class="mtitle" HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
    +00038      $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
     00039 }
     00040 else 
     00041 { 
    @@ -88,19 +88,19 @@
     00086 //Display a blank card 
     00087 if ( $sub_action=="blank") 
     00088 {
    -00089   $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
    +00089   $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>',
     00090                   "commercial.php?p_action=contact");
     00091   echo '<div class="u_redcontent">';
     00092 
     00093   echo $retour;
     00094   $c=new contact($cn);
     00095   echo '<form method="post" action="commercial.php"';
    -00096   echo '<input type="hidden" name="p_action" value="client">';
    -00097   echo '<input type="hidden" name="sa" value="insert">';
    -00098   echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
    -00099   echo '<input type="hidden" name="url" value="'.$_GET['url'].'">';
    +00096   echo '<input type="hidden" name="p_action" value="client">';
    +00097   echo '<input type="hidden" name="sa" value="insert">';
    +00098   echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
    +00099   echo '<input type="hidden" name="url" value="'.$_GET['url'].'">';
     00100   echo $c->blank($_GET['fd_id']);
    -00101   echo '<input type="Submit" value="Sauve">';
    +00101   echo '<input type="Submit" value="Sauve">';
     00102   echo '</form>';
     00103   echo $retour;
     00104   echo '</div>';
    @@ -115,17 +115,17 @@
     00113 <form method="get" action="commercial.php">
     00114 <?
     00115    $a=(isset($_GET['query']))?$_GET['query']:"";
    -00116    printf ('<input type="text" name="query" value="%s">',
    +00116    printf ('<input type="text" name="query" value="%s">',
     00117            $a);
     00118 ?>
    -00119 <input type="submit" name="submit_query" value="recherche">
    -00120 <input type="hidden" name="p_action" value="contact">
    +00119 <input type="submit" name="submit_query" value="recherche">
    +00120 <input type="hidden" name="p_action" value="contact">
     00121 </form>
     00122 </span>
     00123 <span>
     00124 <form method="get" action="commercial.php">
    -00125 <input type="hidden" name="url" <?      $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
    -00126 <input type="hidden" name="p_action" value="contact">
    +00125 <input type="hidden" name="url" <?      $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
    +00126 <input type="hidden" name="p_action" value="contact">
     00127 
     00128 <?
     00129  $w=new widget("select");
    @@ -141,36 +141,36 @@
     00139  echo $w->IOValue();
     00140 
     00141 ?>
    -00142 <input type="hidden" name="sa" value="blank">
    -00143 <input type="submit" name="submit_query" value="Ajout Contact">
    +00142 <input type="hidden" name="sa" value="blank">
    +00143 <input type="submit" name="submit_query" value="Ajout Contact">
     00144 
     00145 </form>
     00146 </span>
     00147 
     00148 <form>
     00149 <?
    -00150    $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
    +00150    $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
     00151  echo JS_SEARCH_CARD;
     00152  $w=new widget('js_search_only');
    -00153  $w->name='qcode';
    +00153  $w->name='qcode';
     00154  $w->value=$qcode;
    -00155  $w->label='qcode';
    +00155  $w->label='qcode';
     00156  $w->extra='4,8,9,14';
     00157  $sp= new widget("span");
    -00158  echo $sp->IOValue("qcode_label",$qcode)."</TD></TR>";
    +00158  echo $sp->IOValue("qcode_label",$qcode)."</TD></TR>";
     00159 
     00160  echo $w->IOValue();
     00161 
     00162 ?>
    -00163 <input type="submit" name="submit_query" value="recherche">
    -00164 <input type="hidden" name="p_action" value="contact">
    +00163 <input type="submit" name="submit_query" value="recherche">
    +00164 <input type="hidden" name="p_action" value="contact">
     00165 
     00166 </FORM>
     00167 <?
     00168    $contact=new Contact($cn);
     00169  $search=(isset($_GET['query']))?$_GET['query']:"";
     00170  // check if a company is asked if yes, add a condition
    -00171  if ( $qcode != "" )
    +00171  if ( $qcode != "" )
     00172    {
     00173      $contact->company=$qcode;
     00174    }
    @@ -210,7 +210,7 @@
     00208 html_page_stop();
     00209 
     00210 
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/contact_8inc_8php.html b/doc/developper/html/contact_8inc_8php.html index f77f49330..8cc940edc 100644 --- a/doc/developper/html/contact_8inc_8php.html +++ b/doc/developper/html/contact_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/contact.inc.php File Reference +phpcompta: contact.inc.php File Reference +include

    contact.inc.php File Reference

    File for adding contact, contact is a kind of fichethe contact class is derived from the class fiche the contact is in fact a card but more specific This file is included from the module "Gestion". More...

    @@ -28,9 +28,9 @@ $w value$qcode = (isset($_GET['qcode']))?$_GET['qcode']:"" + $qcode = (isset($_GET['qcode']))?$_GET['qcode']:"" -$w label = 'qcode' +$w label = 'qcode' $w extra = '4,8,9,14' @@ -130,7 +130,7 @@ Definition at line 38< - +
    $qcode = (isset($_GET['qcode']))?$_GET['qcode']:"" $qcode = (isset($_GET['qcode']))?$_GET['qcode']:""
    @@ -305,7 +305,7 @@ Definition at line
    156 - +
    $w label = 'qcode' $w label = 'qcode'
    @@ -376,7 +376,7 @@ Definition at line
    130 Definition at line 131 of file contact.inc.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/debug_8php-source.html b/doc/developper/html/debug_8php-source.html index a3acc579f..70936adeb 100644 --- a/doc/developper/html/debug_8php-source.html +++ b/doc/developper/html/debug_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/debug.php Source File +phpcompta: debug.php Source File +include

    debug.php

    Go to the documentation of this file.
    00001 <?
     00002 
     00003 /*
    @@ -40,7 +40,7 @@
     00040 }
     00041 
     00042 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/debug_8php.html b/doc/developper/html/debug_8php.html index 05f3aa82a..8a6cce7d5 100644 --- a/doc/developper/html/debug_8php.html +++ b/doc/developper/html/debug_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/debug.php File Reference +phpcompta: debug.php File Reference +include

    debug.php File Reference

    Debug procedure. More...

    @@ -77,10 +77,19 @@ print debug

    Definition at line 34 of file debug.php.

    -Referenced by AddFiche(), AddForm(), AddModele(), fiche::blank(), cl_user::Check(), CheckJrn(), cl_user::cl_user(), ComputeTotalVat(), ComputeVat(), action::Confirm(), DbConnect(), DefModele(), DeleteRapt(), fiche::Display(), action::Display(), DisplayDetailModele(), echo_error(), EncodeFiche(), EncodeForm(), ExecSql(), form_verify_input(), FormAchInput(), FormVenInput(), Document::Generate(), fiche::Get(), action::get(), get_quick_key(), GetAllUser(), GetArray(), fiche::GetByQCode(), GetClass(), GetCreateAccount(), GetData(), GetDataJrnJrId(), GetDataJrnPdf(), jrn::GetDefLine(), cl_user::GetGlobalPref(), GetNextFiche(), GetParent(), GetPriv(), GetRappel(), jrn::GetRow(), jrn::GetRowSimple(), ImpHtml(), fiche::insert(), cl_user::insert_default_global_pref(), InsertJrn(), InsertJrnx(), InsertRapt(), InsertStockGoods(), widget::IOValue(), isDate(), new_fiche(), Document::ParseDocument(), ParseFormula(), RecordFin(), RecordInvoice(), RecordJrn(), RecordSell(), Document_modele::Save(), save_upload_document(), Document::SaveGenerated(), action::SaveStage2(), action::SaveStage3(), ShowDossier(), ShowMenuCompta(), ShowMenuJrnUser(), ShowPeriode(), u_ShowMenuRecherche(), fiche::update(), action::Update(), UpdateFiche(), UpdateForm(), UpdateJrn(), UpdateModele(), VerifData(), VerifyOperationDate(), ViewImp(), ViewJrn(), ViewRec(), and ViewRecord(). +Referenced by AddFiche(), AddForm(), AddModele(), fiche::blank(), cl_user::Check(), CheckJrn(), cl_user::cl_user(), ComputeTotalVat(), ComputeVat(), action::Confirm(), DbConnect(), DefModele(), DeleteRapt(), fiche::Display(), action::Display(), DisplayDetailModele(), echo_error(), EncodeFiche(), EncodeForm(), ExecSql(), form_verify_input(), FormAchInput(), FormVenInput(), Document::Generate(), fiche::Get(), action::get(), get_quick_key(), GetAllUser(), GetArray(), fiche::GetByQCode(), GetClass(), GetCreateAccount(), GetData(), GetDataJrnJrId(), GetDataJrnPdf(), jrn::GetDefLine(), cl_user::GetGlobalPref(), GetNextFiche(), GetParent(), GetPriv(), GetRappel(), jrn::GetRow(), jrn::GetRowSimple(), ImpHtml(), fiche::insert(), cl_user::insert_default_global_pref(), InsertJrn(), InsertJrnx(), InsertRapt(), InsertStockGoods(), widget::IOValue(), isDate(), new_fiche(), Document::ParseDocument(), ParseFormula(), RecordFin(), RecordInvoice(), RecordJrn(), RecordSell(), Document_modele::Save(), save_upload_document(), Document::SaveGenerated(), action::SaveStage2(), action::SaveStage3(), ShowDossier(), ShowMenuCompta(), ShowMenuJrnUser(), ShowPeriode(), u_ShowMenuRecherche(), fiche::update(), action::Update(), UpdateFiche(), UpdateForm(), UpdateJrn(), UpdateModele(), VerifData(), VerifyOperationDate(), ViewImp(), ViewJrn(), ViewRec(), and ViewRecord().

    00034                                                   {
    +00035   if ( DEBUG=='true' ) {
    +00036     $f=fopen ("/tmp/phpcompta.log","a+");
    +00037     fwrite($f,"$file $line $msg\n");
    +00038     fclose ($f);
    +00039   }
    +00040 }
    +
    +

    + -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/decla_8BE_8inc_8php-source.html b/doc/developper/html/decla_8BE_8inc_8php-source.html index 2e442cef5..442925d50 100644 --- a/doc/developper/html/decla_8BE_8inc_8php-source.html +++ b/doc/developper/html/decla_8BE_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/decla.BE.inc.php Source File +phpcompta: decla.BE.inc.php Source File +include

    decla.BE.inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -56,7 +56,7 @@
     00062     if ( strlen(trim($client['tva'])) != 0 ) {
     00063       $rec_id++;
     00064       $a.=sprintf("%06d",$rec_id);
    -00065       $a.=sprintf("% 32s",$client['name']);
    +00065       $a.=sprintf("% 32s",$client['name']);
     00066       $a.=str_repeat(" ",51);
     00067       $a.=sprintf("BE%s",$client['vat_number']);
     00068       $a.=sprintf("%010d",$client['amount']*100);
    @@ -78,7 +78,7 @@
     00084   $a.="\r\n";
     00085   return $a;
     00086 }
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/decla_8BE_8inc_8php.html b/doc/developper/html/decla_8BE_8inc_8php.html index 0da279b4f..348432b04 100644 --- a/doc/developper/html/decla_8BE_8inc_8php.html +++ b/doc/developper/html/decla_8BE_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/decla.BE.inc.php File Reference +phpcompta: decla.BE.inc.php File Reference +include

    decla.BE.inc.php File Reference

    Go to the source code of this file. @@ -65,10 +65,63 @@ parm : -array gen : -none return:

      Definition at line 36 of file decla.BE.inc.php.

      -References $a, $b, $client, $my, and name. +References $a, $b, $client, $my, and name.

      00036                                                 {
      +00037   // declarant
      +00038   //--
      +00039   require_once("class_own.php");
      +00040   // load the data
      +00041   $my=new Own($p_cn);
      +00042   //Make the first record
      +00043   $a="000000";
      +00044   $a.=sprintf("% 32s",$my->MY_NAME);
      +00045   $b=$my->MY_STREET.",".$my->MY_NUMBER;
      +00046   $a.=sprintf("% 24s",$b);
      +00047   $b=$my->MY_CP." ".$my->MY_COMMUNE;
      +00048   $a.=sprintf("% 27s",$b);
      +00049   $a.="BE";
      +00050   $a.=sprintf("%9s",$my->MY_TVA);
      +00051   // special zone
      +00052   $a.=sprintf("% 20s",' ');
      +00053   //
      +00054   $a.="E";
      +00055   $a.=$p_year;
      +00056   $a.="\n";
      +00057   // customer record
      +00058   $rec_id=0;
      +00059   $tot_amount=0;
      +00060   $tot_tva=0;
      +00061   foreach ($p_array as $client) {
      +00062     if ( strlen(trim($client['tva'])) != 0 ) {
      +00063       $rec_id++;
      +00064       $a.=sprintf("%06d",$rec_id);
      +00065       $a.=sprintf("% 32s",$client['name']);
      +00066       $a.=str_repeat(" ",51);
      +00067       $a.=sprintf("BE%s",$client['vat_number']);
      +00068       $a.=sprintf("%010d",$client['amount']*100);
      +00069       $a.=sprintf("%010d",$client['tva']*100);
      +00070       $a.=str_repeat(" ",10);
      +00071       $a.="\n";
      +00072       $tot_amount=+$client['amount']*100;
      +00073       $tot_tva+=$client['tva']*100;
      +00074     }
      +00075   }
      +00076     //Last Record
      +00077   $a.="999999";
      +00078   $a.=sprintf("%016d",$tot_amount);
      +00079   $a.=sprintf("%016d",$tot_tva);
      +00080   $a.=str_repeat(" ",51);
      +00081   $a.="BE";
      +00082   $a.=$my->MY_TVA;
      +00083   $a.=str_repeat(" ",28);
      +00084   $a.="\r\n";
      +00085   return $a;
      +00086 }
      +
      +

      +

    -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/dir_000000.html b/doc/developper/html/dir_000000.html index e677a5c5e..c21cde854 100644 --- a/doc/developper/html/dir_000000.html +++ b/doc/developper/html/dir_000000.html @@ -1,19 +1,354 @@ -phpcompta: /home/dany/developpement/ Directory Reference +phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/ Directory Reference -

    developpement Directory Reference

    +include +

    include Directory Reference

    - - + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + + + +

    +

    + + + +

    +

    + + + + + +

    +

    + + + + + +

    +

    + + + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + + + +

    +

    + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +


    Directories

    directory  phpcompta-dev

    Files

    file  ac_common.php [code]
     common utilities for a lot of procedure, classe
    file  action.inc.php [code]
     Page who manage the different action (meeting, letter).
    file  admin.inc.php [code]
     Called from the module "Gestion" to manage the customer.
    file  balance.php [code]
     Show the balance and let you print it or export to PDF file included by user_impress.
    file  bank.inc.php [code]
     the purpose off this file encode expense and to record them
    file  cbc_be.inc.php [code]
     This file must be included to parse the CVS from the CBC Bank.
    file  central_inc.php [code]
     Concerns the centralization operations.
    file  check_priv.php [code]
     Tools for checking the security.
    file  class_action.php [code]
     class_action for manipulating actions action can be :
      +
    • an invoice
    • a meeting
    • an order
    • a letter
    +
    file  class_admin.php [code]
     Derived from class fiche Administration are a specific kind of card concerned only by official (or not) administration.
    file  class_attribut.php [code]
     Manage the attribut of the card.
    file  class_balance.php [code]
     Class for manipulating data to print the balance of account.
    file  class_contact.php [code]
     class for the contact, contact are derived from ficheContact are a card which are own by a another card (customer, supplier...)
    file  class_customer.php [code]
     Derived from class fiche Customer are a specific kind of card.
    file  class_document.php [code]
     Class Document corresponds to the table document.
    file  class_document_modele.php [code]
     Class for the document template.
    file  class_document_type.php [code]
     class for the table document_type
    file  class_fiche.php [code]
     define Class fiche and fiche def, those class are using class attribut
    file  class_fiche_def.php [code]
     fiche_def_ref, a fiche is owned by fiche_def which is owned by fiche_def_ref
    file  class_jrn.php [code]
    file  class_own.php [code]
     Class to manage the company parameter (address, name...).
    file  class_parm_code.php [code]
     Manage the table parm_code which contains the custom parameter for the module accountancy.
    file  class_poste.php [code]
     Manage the account.
    file  class_rapport.php [code]
     Create, view, modify and parse report.
    file  class_supplier.php [code]
     Derived from class fiche Supplier are a specific kind of card.
    file  class_user.php [code]
     Data & function about connected users.
    file  class_widget.php [code]
     This class is used to create all the HTML INPUT TYPE.
    file  client.inc.php [code]
     Called from the module "Gestion" to manage the customer.
    file  constant.php [code]
     Contains all the variable + the javascript and some parameter.
    file  contact.inc.php [code]
     File for adding contact, contact is a kind of fichethe contact class is derived from the class fiche the contact is in fact a card but more specific This file is included from the module "Gestion".
    file  debug.php [code]
     Debug procedure.
    file  decla.BE.inc.php [code]
    file  depense.inc.php [code]
    file  document_modele.inc.php [code]
     Manage the document template.
    file  error.php [code]
     Obsolete ?
    file  eub_be.inc.php [code]
     File included to parse CSV from EUB Bank.
    file  facture.inc.php [code]
     the purpose off this file is to create invoices, to record them and to generate them, and of course to save them into the database
    file  facture_inc.php [code]
    file  fiche_def.inc.php [code]
     Let customise the fiche_def_ref for the user.
    file  fiche_inc.php [code]
     Function for managing card, redundant with the class fiche.
    file  form_inc.php [code]
    file  fortis_be.inc.php [code]
     File to include : parse the CSV file from fortis Bank Belgium.
    file  import_inc.php [code]
    file  impress_bilan.php [code]
     form who call the printing of the bilan in RTF file included by user_impress
    file  impress_fiche.php [code]
    file  impress_inc.php [code]
    file  impress_jrn.php [code]
     ask for Printing the ledger (pdf,html)
    file  impress_listing_client.php [code]
     print the listing of customer for vat
    file  impress_poste.php [code]
     Print account (html or pdf) file included from user_impress.
    file  impress_rapport.php [code]
     print first the report in html and propose to print it in pdf file included by user_impress
    file  ing_be.inc.php [code]
     File to be included to parse CSV from ING Belgium.
    file  jrn.php [code]
     work with the ledger
    file  periode.inc.php [code]
     Still used ?
    file  poste.inc.php [code]
     p_action contains the main action (always poste here) action contains the sub action
    file  poste.php [code]
    file  postgres.php [code]
     Contains the procedure for connecting to postgresql.
    file  pref.inc.php [code]
    file  preference.php [code]
     include file for the periode form, currency,...
    file  stock_inc.php [code]
     Function for managing the stock.
    file  supplier.inc.php [code]
     Called from the module "Gestion" to manage the customer.
    file  tva.inc.php [code]
     included file for customizing with the vat (account,rate...)
    file  user_action_ach.php [code]
     included file for the ledger of expenses
    file  user_action_fin.php [code]
     included file for the financial ledger
    file  user_action_gl.php [code]
     included file for the great ledger
    file  user_action_ods.php [code]
     included file for the miscellaneous operation ledger
    file  user_action_ven.php [code]
     Manage the ledger of type VEN.
    file  user_common.php [code]
     Common functions.
    file  user_form_ach.php [code]
     Functions for the ledger of expenses.
    file  user_form_fin.php [code]
     Functions for the financial ledger.
    file  user_form_ods.php [code]
     Functions for the ledger of misc. operation.
    file  user_form_ven.php [code]
     Functions for the ledger of sold.
    file  user_menu.php [code]
     Nearly all the menu are here, some of them returns a HTML string, others echo directly the result.
    file  user_update.php [code]
     Check if still used.
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/dir_000001.html b/doc/developper/html/dir_000001.html index 107fb04ae..6b3f407ec 100644 --- a/doc/developper/html/dir_000001.html +++ b/doc/developper/html/dir_000001.html @@ -1,19 +1,288 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/ Directory Reference +phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/ Directory Reference -

    phpcompta-dev Directory Reference

    +html +

    html Directory Reference

    - + + + + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +

    +

    + + + +


    Directories

    directory  phpcompta
    directory  addon
    directory  admin

    Files

    file  admin_repo.php [code]
     Administration of the repository : creation of user, folder, security, templates... Accessible only by the administrator.
    file  annulation.php [code]
     in a popup window manage the deletion of the operations
    file  bal_csv.php [code]
     Return the balance in CSV format.
    file  bilan.php [code]
     send a Bilan in RTF format
    file  central.php [code]
     concerns the centralisation of the operations
    file  commercial.php [code]
     Base of the module "Gestion", the p_action indicates what file must included and this file will manage the request (customer, supplier, contact,...).
    file  ecrit_ouv.php [code]
     for reporting the saldo of account to the next year.
    file  export_ouv.php [code]
     Send the final balance in CSV this balance is used to open an exercice.
    file  fiche.php [code]
     module to manage the card (removing, listing, creating, modify attribut)
    file  fiche_csv.php [code]
     Send a CSV file with card.
    file  fiche_new.php [code]
     Create a new card in a popup window.
    file  fiche_search.php [code]
     Search a card in a popup window.
    file  form.php [code]
     handle your own report: create or view report
    file  form_csv.php [code]
     Send a report in CSV format.
    file  form_pdf.php [code]
     Send a report in PDF.
    file  import.php [code]
     for importing Bank operations
    file  index.php [code]
     default page where user access
    file  info.php [code]
    file  jrn_add.php [code]
     To add a ledger.
    file  jrn_csv.php [code]
     Send a ledger in CSV format.
    file  jrn_detail.php [code]
     Show and let modify ledger parameter.
    file  jrn_op_detail.php [code]
     Show the detail of a operation in a popup windows.
    file  jrn_pdf.php [code]
     Send a ledger in a pdf format.
    file  jrn_search.php [code]
     Search a operation from a ledger into a popup window, used for the "rapprochement".
    file  jrn_update.php [code]
     create, modify parameter ledger
    file  line_update.php [code]
     Modify the "Plan Comptable".
    file  listing_client.php [code]
     Electronic declaration for VAT BELGIUM --> experimental.
    file  login.php [code]
     Login page.
    file  logout.php [code]
     Logout.
    file  modify_op.php [code]
     Update a operation in a popup window : add a document.
    file  not_implemented.php [code]
    file  parametre.php [code]
     Parametre module.
    file  pcmn_update.php [code]
     concerns the management of the "Plan Comptable"
    file  poste_csv.php [code]
     Send the poste list in csv.
    file  poste_pdf.php [code]
     send the account list in PDF
    file  poste_search.php [code]
     Search a account in a popup window.
    file  print_balance.php [code]
     Print the balance in pdf format.
    file  priv_user.php [code]
     Users Security.
    file  recherche.php [code]
     Search module.
    file  sec_pdf.php [code]
     Print the user security in pdf.
    file  send_jrn_pdf.php [code]
     Print the ledger in pdf.
    file  send_poste_pdf.php [code]
     Print the account in pdf.
    file  show_document.php [code]
     retrieve a document
    file  show_document_modele.php [code]
     send the document template
    file  show_fiche.php [code]
     This file show in a popup window the detail a of card in read only mode the parameter are q (for qcode) & PHPSESSID.
    file  show_pj.php [code]
    file  show_tva.php [code]
     Popup window to let the user choose the vat.
    file  stock.php [code]
     Manage the stock by year.
    file  user_advanced.php [code]
     Obsolete.
    file  user_compta.php [code]
     main page of the accountancy module
    file  user_impress.php [code]
     Main page for the printing.
    file  user_jrn.php [code]
     Main page for encoding in the ledger.
    file  user_login.php [code]
     Welcome page where the folder and module are choosen.
    file  user_pref.php [code]
     Page for the personal preference (theme, password,...).
    file  user_sec.php [code]
     Set the security for an user.
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/dir_000002.html b/doc/developper/html/dir_000002.html index 99c6ec9b3..d9a4a5f1b 100644 --- a/doc/developper/html/dir_000002.html +++ b/doc/developper/html/dir_000002.html @@ -1,21 +1,23 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/ Directory Reference +phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/ Directory Reference -

    phpcompta Directory Reference

    +html » addon +

    addon Directory Reference

    - - + + - + + +

    Directories

    directory  html

    Files

    file  class.ezpdf.php [code]
    directory  include
    file  class.pdf.php [code]
    file  readme.php [code]
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/dir_000003.html b/doc/developper/html/dir_000003.html index 91a5b11b5..9a27bab59 100644 --- a/doc/developper/html/dir_000003.html +++ b/doc/developper/html/dir_000003.html @@ -1,292 +1,19 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/ Directory Reference +phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/admin/ Directory Reference -

    html Directory Reference

    +html » admin +

    admin Directory Reference

    - - - - - - + - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - - - -

    -

    - - - -

    -

    - - - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -


    Directories

    directory  addon
    directory  admin

    Files

    file  admin_repo.php [code]
    file  setup.php [code]
     Administration of the repository : creation of user, folder, security, templates... Accessible only by the administrator.
    file  annulation.php [code]
     in a popup window manage the deletion of the operations
    file  bal_csv.php [code]
     Return the balance in CSV format.
    file  bilan.php [code]
     send a Bilan in RTF format
    file  central.php [code]
     concerns the centralisation of the operations
    file  commercial.php [code]
     Base of the module "Gestion", the p_action indicates what file must included and this file will manage the request (customer, supplier, contact,...).
    file  ecrit_ouv.php [code]
     for reporting the saldo of account to the next year.
    file  export_ouv.php [code]
     Send the final balance in CSV this balance is used to open an exercice.
    file  fiche.php [code]
     module to manage the card (removing, listing, creating, modify attribut)
    file  fiche_csv.php [code]
     Send a CSV file with card.
    file  fiche_new.php [code]
     Create a new card in a popup window.
    file  fiche_search.php [code]
     Search a card in a popup window.
    file  form.php [code]
     handle your own report: create or view report
    file  form_csv.php [code]
     Send a report in CSV format.
    file  form_pdf.php [code]
     Send a report in PDF.
    file  import.php [code]
     for importing Bank operations
    file  index.php [code]
     default page where user access
    file  info.php [code]
    file  jrn_add.php [code]
     To add a ledger.
    file  jrn_csv.php [code]
     Send a ledger in CSV format.
    file  jrn_detail.php [code]
     Show and let modify ledger parameter.
    file  jrn_op_detail.php [code]
     Show the detail of a operation in a popup windows.
    file  jrn_pdf.php [code]
     Send a ledger in a pdf format.
    file  jrn_search.php [code]
     Search a operation from a ledger into a popup window, used for the "rapprochement".
    file  jrn_update.php [code]
     create, modify parameter ledger
    file  line_update.php [code]
     Modify the "Plan Comptable".
    file  listing_client.php [code]
     Electronic declaration for VAT BELGIUM --> experimental.
    file  login.php [code]
     Login page.
    file  logout.php [code]
     Logout.
    file  modify_op.php [code]
     Update a operation in a popup window : add a document.
    file  not_implemented.php [code]
    file  parametre.php [code]
     Parametre module.
    file  pcmn_update.php [code]
     concerns the management of the "Plan Comptable"
    file  poste_csv.php [code]
     Send the poste list in csv.
    file  poste_pdf.php [code]
     send the account list in PDF
    file  poste_search.php [code]
     Search a account in a popup window.
    file  print_balance.php [code]
     Print the balance in pdf format.
    file  priv_user.php [code]
     Users Security.
    file  recherche.php [code]
     Search module.
    file  sec_pdf.php [code]
     Print the user security in pdf.
    file  send_jrn_pdf.php [code]
     Print the ledger in pdf.
    file  send_poste_pdf.php [code]
     Print the account in pdf.
    file  show_document.php [code]
     retrieve a document
    file  show_document_modele.php [code]
     send the document template
    file  show_fiche.php [code]
     This file show in a popup window the detail a of card in read only mode the parameter are q (for qcode) & PHPSESSID.
    file  show_pj.php [code]
    file  show_tva.php [code]
     Popup window to let the user choose the vat.
    file  stock.php [code]
     Manage the stock by year.
    file  test.php [code]
    file  test_smarty.php [code]
    file  user_advanced.php [code]
     Obsolete.
    file  user_compta.php [code]
     main page of the accountancy module
    file  user_impress.php [code]
     Main page for the printing.
    file  user_jrn.php [code]
     Main page for encoding in the ledger.
    file  user_login.php [code]
     Welcome page where the folder and module are choosen.
    file  user_pref.php [code]
     Page for the personal preference (theme, password,...).
    file  user_sec.php [code]
     Set the security for an user.
    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/dirs.html b/doc/developper/html/dirs.html index ffcfb0202..61ec68f15 100644 --- a/doc/developper/html/dirs.html +++ b/doc/developper/html/dirs.html @@ -6,23 +6,14 @@

    phpcompta Directories

    This directory hierarchy is sorted roughly, but not completely, alphabetically: -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/document__modele_8inc_8php-source.html b/doc/developper/html/document__modele_8inc_8php-source.html index 2eb95dd19..ab7c0a3ac 100644 --- a/doc/developper/html/document__modele_8inc_8php-source.html +++ b/doc/developper/html/document__modele_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/document_modele.inc.php Source File +phpcompta: document_modele.inc.php Source File +include

    document_modele.inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -58,11 +58,11 @@
     00053   require_once("class_document_modele.php");
     00054   // Get all the document to remove
     00055 
    -00056   foreach ( $_POST as $name=>$value )
    +00056   foreach ( $_POST as $name=>$value )
     00057     {
    -00058       echo_debug(__FILE__,__LINE__,"name = ".$name);
    -00059       echo_debug(__FILE__,__LINE__,"value = ".$value);
    -00060       list ($id) = sscanf ($name,"dm_remove_%d");
    +00058       echo_debug(__FILE__,__LINE__,"name = ".$name);
    +00059       echo_debug(__FILE__,__LINE__,"value = ".$value);
    +00060       list ($id) = sscanf ($name,"dm_remove_%d");
     00061       echo_debug(__FILE__,__LINE__,"id = ".$id);
     00062       if ( $id == null ) continue;
     00063       // a document has to be removed
    @@ -79,7 +79,7 @@
     00074 //-----------------------------------------------------
     00075 echo $doc->myList();
     00076 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/document__modele_8inc_8php.html b/doc/developper/html/document__modele_8inc_8php.html index c999bdbf1..badfee1f3 100644 --- a/doc/developper/html/document__modele_8inc_8php.html +++ b/doc/developper/html/document__modele_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/document_modele.inc.php File Reference +phpcompta: document_modele.inc.php File Reference +include

    document_modele.inc.php File Reference

    Manage the document template. More...

    @@ -57,7 +57,7 @@ Definition in file d

    Definition at line 31 of file document_modele.inc.php.

    -Referenced by action::Display(), action::myList(), Document::SaveGenerated(), action::SaveStage2(), action::SaveStage3(), and action::Update(). +Referenced by action::Display(), action::myList(), Document::SaveGenerated(), action::SaveStage2(), action::SaveStage3(), and action::Update().

    @@ -191,7 +191,7 @@ Definition at line Cezpdf::alink(), Cezpdf::ezPrvtTableColumnHeadings(), Cezpdf::ezTable(), Cezpdf::ezText(), Document_modele::Save(), and Cezpdf::uline(). -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/ecrit__ouv_8php-source.html b/doc/developper/html/ecrit__ouv_8php-source.html index 057d06381..8f6542b83 100644 --- a/doc/developper/html/ecrit__ouv_8php-source.html +++ b/doc/developper/html/ecrit__ouv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/ecrit_ouv.php Source File +phpcompta: ecrit_ouv.php Source File +html

    ecrit_ouv.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -182,7 +182,7 @@
     00177 echo '</div>';
     00178 html_page_stop(); 
     00179 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/ecrit__ouv_8php.html b/doc/developper/html/ecrit__ouv_8php.html index 3971fb422..668f67635 100644 --- a/doc/developper/html/ecrit__ouv_8php.html +++ b/doc/developper/html/ecrit__ouv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/ecrit_ouv.php File Reference +phpcompta: ecrit_ouv.php File Reference +html

    ecrit_ouv.php File Reference

    for reporting the saldo of account to the next year. More...

    @@ -295,7 +295,7 @@ Definition at line 6972 of file ecrit_ouv.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/error_8php-source.html b/doc/developper/html/error_8php-source.html index f578c9345..90cab7dab 100644 --- a/doc/developper/html/error_8php-source.html +++ b/doc/developper/html/error_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/error.php Source File +phpcompta: error.php Source File +include

    error.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -63,7 +63,7 @@
     00065 }
     00066 
     00067 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/error_8php.html b/doc/developper/html/error_8php.html index c79da24b3..2a9ad8a3a 100644 --- a/doc/developper/html/error_8php.html +++ b/doc/developper/html/error_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/error.php File Reference +phpcompta: error.php File Reference +include

    error.php File Reference

    Obsolete ? More...

    @@ -58,10 +58,45 @@ Following the error code show adialog box.

  • -Definition at line 33 of file error.php. +Definition at line 33 of file error.php.

    00033                                   {
    +00034 
    +00035     switch( $p_result) {
    +00036       case NOERROR:
    +00037         break;
    +00038     case BADPARM:
    +00039       break;
    +00040     case BADDATE:
    +00041       echo "<SCRIPT> alert('Invalid Date'); </SCRIPT>";
    +00042       break;
    +00043     case NOTPERIODE:
    +00044         echo "<SCRIPT> alert('Date n\'est pas dans la période par défaut, changez vos préférences'); </SCRIPT>";
    +00045         break;
    +00046     case PERIODCLOSED:
    +00047       echo "<SCRIPT> alert('La date est dans une période cloturé'); </SCRIPT>"; 
    +00048       break;
    +00049     case INVALID_ECH:
    +00050         echo "<SCRIPT> alert('Invalid Echeance Date'); </SCRIPT>";
    +00051         break;
    +00052     case RAPPT_ALREADY_USED:
    +00053       echo '<SCRIPT>alert("Ne peut enregister le rapprochement l\'opération '.$p_rapt. " est déjà utilisée\")</SCRIPT>";
    +00054       break;
    +00055     case RAPPT_NOT_EXIST:
    +00056         echo '<SCRIPT>alert("Ne peut enregister le rapprochement l\'opération '.$p_rapt. " n\'existe pas \")</SCRIPT>";
    +00057         break;
    +00058     case DIFF_AMOUNT:
    +00059       echo "<SCRIPT>alert(\"Le Montant au débit n'est pas égal au montant au crédit\"); </SCRIPT>";
    +00060       break;
    +00061     case RAPPT_NOMATCH_AMOUNT:
    +00062         echo '<SCRIPT>alert("Ne peut enregister le rapprochement l\'opération '.$p_rapt. " les montants ne correspondent pas \")</SCRIPT>";
    +00063         break;
    +00064     }
    +00065 }
    +
    +

    + -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/eub__be_8inc_8php-source.html b/doc/developper/html/eub__be_8inc_8php-source.html index d0c40d667..611daaf6e 100644 --- a/doc/developper/html/eub__be_8inc_8php-source.html +++ b/doc/developper/html/eub__be_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/eub_be.inc.php Source File +phpcompta: eub_be.inc.php Source File +include

    eub_be.inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -83,7 +83,7 @@
     00078 } // file is read
     00079 fclose($handle);
     00080 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/eub__be_8inc_8php.html b/doc/developper/html/eub__be_8inc_8php.html index 7c9171c4c..874273243 100644 --- a/doc/developper/html/eub__be_8inc_8php.html +++ b/doc/developper/html/eub__be_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/eub_be.inc.php File Reference +phpcompta: eub_be.inc.php File Reference +include

    eub_be.inc.php File Reference

    File included to parse CSV from EUB Bank. More...

    @@ -210,7 +210,7 @@ Definition at line 55< Referenced by AddFiche(), cl_user::cl_user(), Get_attr_def(), Get_attr_min(), GetCreateAccount(), GetDataJrnPdf(), jrn::GetRow(), cl_user::insert_default_global_pref(), RecordJrn(), and cl_user::update_global_pref(). -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/export__ouv_8php-source.html b/doc/developper/html/export__ouv_8php-source.html index deaf31ad9..66dd18597 100644 --- a/doc/developper/html/export__ouv_8php-source.html +++ b/doc/developper/html/export__ouv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/export_ouv.php Source File +phpcompta: export_ouv.php Source File +html

    export_ouv.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -102,7 +102,7 @@
     00097  
     00098 }
     00099 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/export__ouv_8php.html b/doc/developper/html/export__ouv_8php.html index 0044d5462..fd220c661 100644 --- a/doc/developper/html/export__ouv_8php.html +++ b/doc/developper/html/export__ouv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/export_ouv.php File Reference +phpcompta: export_ouv.php File Reference +html

    export_ouv.php File Reference

    Send the final balance in CSV this balance is used to open an exercice. More...

    @@ -327,7 +327,7 @@ Definition at line 4978 of file export_ouv.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/facture_8inc_8php-source.html b/doc/developper/html/facture_8inc_8php-source.html index 0c9471c28..8f35e67ab 100644 --- a/doc/developper/html/facture_8inc_8php-source.html +++ b/doc/developper/html/facture_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/facture.inc.php Source File +phpcompta: facture.inc.php Source File +include

    facture.inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -48,8 +48,8 @@
     00046 
     00047 if ( isset ($_REQUEST['url'])) 
     00048 {
    -00049   $retour=sprintf('<A class="mtitle" HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
    -00050   $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
    +00049   $retour=sprintf('<A class="mtitle" HREF="%s"><input type="button" value="Retour"></A>',urldecode($_REQUEST['url']));
    +00050   $h_url=sprintf('<input type="hidden" name="url" value="%s">',urldecode($_REQUEST['url']));
     00051 }
     00052 
     00053 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
    @@ -68,18 +68,18 @@
     00066     {
     00067       // reset all the paid flag because the checkbox is post only
     00068       // when checked
    -00069       foreach ($_GET as $name=>$paid) 
    +00069       foreach ($_GET as $name=>$paid) 
     00070         {
    -00071             list($ad) = sscanf($name,"set_jr_id%d");
    +00071             list($ad) = sscanf($name,"set_jr_id%d");
     00072             if ( $ad == null ) continue;
     00073             $sql="update jrn set jr_rapt='' where jr_id=$ad";
     00074             $Res=ExecSql($cn,$sql);
     00075             
     00076         }
     00077         // set a paid flag for the checked box
    -00078       foreach ($_GET as $name=>$paid) 
    +00078       foreach ($_GET as $name=>$paid) 
     00079         {
    -00080           list ($id) = sscanf ($name,"rd_paid%d");
    +00080           list ($id) = sscanf ($name,"rd_paid%d");
     00081           
     00082           if ( $id == null ) continue;
     00083           //      echo "Mise à jour $id";
    @@ -117,9 +117,9 @@
     00115   $w->selected=$current;
     00116 
     00117   echo 'Période  '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider');
    -00118   $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
    +00118   $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
     00119   printf ('<span>Tiers QuickCode: <input type="text" name="qcode" value="%s"></span>',
    -00120            $qcode);
    +00120            $qcode);
     00121 
     00122   // Show list of sell
     00123   // Date - date of payment - Customer - amount
    @@ -130,7 +130,7 @@
     00128 
     00129   $l="";
     00130   // check if qcode contains something
    -00131   if ( $qcode != "" )
    +00131   if ( $qcode != "" )
     00132     {
     00133       // add a condition to filter on the quick code
     00134       $l=" and jr_grpt_id in (select j_grpt from jrnx where j_qcode='$qcode') ";
    @@ -244,7 +244,7 @@
     00242   echo $form;
     00243   echo '</div>';
     00244 }
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/facture_8inc_8php.html b/doc/developper/html/facture_8inc_8php.html index 9d02f4cc2..5754c8518 100644 --- a/doc/developper/html/facture_8inc_8php.html +++ b/doc/developper/html/facture_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/facture.inc.php File Reference +phpcompta: facture.inc.php File Reference +include

    facture.inc.php File Reference

    the purpose off this file is to create invoices, to record them and to generate them, and of course to save them into the database More...

    @@ -38,7 +38,7 @@ $w selected = $current - $qcode = (isset($_GET['qcode']))?$_GET['qcode']:"" + $qcode = (isset($_GET['qcode']))?$_GET['qcode']:""  $step = $_SESSION['g_pagesize'] @@ -323,7 +323,7 @@ Definition at line 112 - +
    $qcode = (isset($_GET['qcode']))?$_GET['qcode']:"" $qcode = (isset($_GET['qcode']))?$_GET['qcode']:""
    @@ -441,7 +441,7 @@ Definition at line
    125

    Definition at line 197 of file facture.inc.php.

    -Referenced by action::SaveStage2(). +Referenced by action::SaveStage2().

    @@ -543,7 +543,7 @@ Definition at line 196

    Definition at line 194 of file facture.inc.php.

    -Referenced by action::action(), action::Confirm(), action::Display(), action::get(), fiche::GetByDef(), fiche::GetByQCode(), fiche::GetByType(), GetFicheJrn(), getFicheNameCode(), Supplier::GetFromPoste(), Customer::GetFromPoste(), InsertStockGoods(), action::myList(), contact::Summary(), and action::Update(). +Referenced by action::action(), action::Confirm(), action::Display(), fiche::GetByDef(), fiche::GetByQCode(), fiche::GetByType(), GetFicheJrn(), getFicheNameCode(), Supplier::GetFromPoste(), Customer::GetFromPoste(), InsertStockGoods(), contact::Summary(), and action::Update().

    @@ -646,7 +646,7 @@ Definition at line 115 Definition at line 100 of file facture.inc.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche_8php-source.html b/doc/developper/html/fiche_8php-source.html index bffee6597..2beac4bcc 100644 --- a/doc/developper/html/fiche_8php-source.html +++ b/doc/developper/html/fiche_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche.php Source File +phpcompta: fiche.php Source File +html

    fiche.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -185,7 +185,7 @@
     00179 }
     00180 html_page_stop();
     00181 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche_8php.html b/doc/developper/html/fiche_8php.html index 8979987b0..f85d63f43 100644 --- a/doc/developper/html/fiche_8php.html +++ b/doc/developper/html/fiche_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche.php File Reference +phpcompta: fiche.php File Reference +html

    fiche.php File Reference

    module to manage the card (removing, listing, creating, modify attribut) More...

    @@ -75,7 +75,7 @@ Definition at line 35 of Definition at line 37 of file fiche.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche__csv_8php-source.html b/doc/developper/html/fiche__csv_8php-source.html index f0b685be6..155815462 100644 --- a/doc/developper/html/fiche__csv_8php-source.html +++ b/doc/developper/html/fiche__csv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_csv.php Source File +phpcompta: fiche_csv.php Source File +html

    fiche_csv.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -103,7 +103,7 @@
     00098  }
     00099   exit;
     00100 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche__csv_8php.html b/doc/developper/html/fiche__csv_8php.html index 24970f546..b7844900e 100644 --- a/doc/developper/html/fiche__csv_8php.html +++ b/doc/developper/html/fiche__csv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_csv.php File Reference +phpcompta: fiche_csv.php File Reference +html

    fiche_csv.php File Reference

    Send a CSV file with card. More...

    @@ -212,7 +212,7 @@ Definition at line 3699 of file fiche_csv.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche__def_8inc_8php-source.html b/doc/developper/html/fiche__def_8inc_8php-source.html index 6045d32a5..a0d5786b0 100644 --- a/doc/developper/html/fiche__def_8inc_8php-source.html +++ b/doc/developper/html/fiche__def_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/fiche_def.inc.php Source File +phpcompta: fiche_def.inc.php Source File +include

    fiche_def.inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -80,7 +80,7 @@
     00075   echo '</form>';
     00076   echo '</div>';
     00077 }
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche__def_8inc_8php.html b/doc/developper/html/fiche__def_8inc_8php.html index 54ec1a0da..44ce5e594 100644 --- a/doc/developper/html/fiche__def_8inc_8php.html +++ b/doc/developper/html/fiche__def_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/fiche_def.inc.php File Reference +phpcompta: fiche_def.inc.php File Reference +include

    fiche_def.inc.php File Reference

    Let customise the fiche_def_ref for the user. More...

    @@ -274,7 +274,7 @@ Definition at line Referenced by fiche_def_ref::fiche_def_ref(), fiche_def_ref::Get(), Get_fiche_def_ref(), fiche_def_ref::Input(), and fiche_def_ref::Save(). -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche__inc_8php-source.html b/doc/developper/html/fiche__inc_8php-source.html index a95ec4a16..909b27cd9 100644 --- a/doc/developper/html/fiche__inc_8php-source.html +++ b/doc/developper/html/fiche__inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/fiche_inc.php Source File +phpcompta: fiche_inc.php Source File +include

    fiche_inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -204,8 +204,8 @@
     00227 
     00228   $ch_col="</TD><TD>";
     00229   $ch_li='</TR><TR>';
    -00230   echo '<FORM action="fiche.php" method="post" name="fiche">';
    -00231   echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
    +00230   echo '<FORM action="fiche.php" method="post" name="fiche">';
    +00231   echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
     00232   $l_sessid=$_REQUEST['PHPSESSID'];
     00233 
     00234   echo JS_SHOW_TVA;
    @@ -225,12 +225,12 @@
     00248     $Res=ExecSql($p_cn,$sql);
     00249     $Max=pg_NumRows($Res);
     00250     // Put the card modele id (fiche_def.fd_id)
    -00251     echo '<INPUT TYPE="HIDDEN" name="fd_id" value="'.$p_type.'">';
    +00251     echo '<INPUT TYPE="HIDDEN" name="fd_id" value="'.$p_type.'">';
     00252     for ($i=0;$i < $Max;$i++) {
     00253       $l_line=pg_fetch_array($Res,$i);
     00254 
     00255       // The number of the attribute
    -00256       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="ad_id%d" value="%s">',
    +00256       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="ad_id%d" value="%s">',
     00257                    $i,$l_line['ad_id']);
     00258 
     00259       $but_search_poste="";
    @@ -249,8 +249,8 @@
     00272    }
     00273     echo '</TR>';
     00274     echo '</TABLE>';
    -00275     echo '<INPUT TYPE="HIDDEN" name="inc" value="'.$Max.'">';
    -00276     echo '<INPUT TYPE="SUBMIT" name="add_fiche" value="ajoute">';
    +00275     echo '<INPUT TYPE="HIDDEN" name="inc" value="'.$Max.'">';
    +00276     echo '<INPUT TYPE="SUBMIT" name="add_fiche" value="ajoute">';
     00277     echo '</FORM>';
     00278   }else {
     00279     // Array is not null so we have to find the card's data from the database
    @@ -270,9 +270,9 @@
     00293     $Max=pg_NumRows($Res);
     00294     echo_debug('fiche_inc.php',__LINE__,"Max ==== $Max");    
     00295 
    -00296     echo '<INPUT TYPE="HIDDEN" name="f_id" value="'.$p_type.'">';
    -00297     echo '<INPUT TYPE="HIDDEN" name="f_label" value="'.$label.'">';
    -00298     echo '<INPUT TYPE="HIDDEN" name="max" value="'.$Max.'">';
    +00296     echo '<INPUT TYPE="HIDDEN" name="f_id" value="'.$p_type.'">';
    +00297     echo '<INPUT TYPE="HIDDEN" name="f_label" value="'.$label.'">';
    +00298     echo '<INPUT TYPE="HIDDEN" name="max" value="'.$Max.'">';
     00299 
     00300     for ($i=0;$i < $Max;$i++) {
     00301       // fetch the data
    @@ -283,7 +283,7 @@
     00306 
     00307       $but_search_poste="";
     00308       if ( $l_line['ad_id'] == ATTR_DEF_ACCOUNT ) {
    -00309         printf('<INPUT TYPE="HIDDEN" name="class" value="%s">',
    +00309         printf('<INPUT TYPE="HIDDEN" name="class" value="%s">',
     00310                $l_line['av_text']);
     00311       // Javascript for searching the account
     00312         $ctl_name="av_text$i";
    @@ -296,11 +296,11 @@
     00319       }
     00320       
     00321       // hide ad_id
    -00322       $ad=sprintf('<input type="hidden" name="ad_id%d" value="%s">',
    +00322       $ad=sprintf('<input type="hidden" name="ad_id%d" value="%s">',
     00323                   $l_line['ad_id'],$l_line['av_text']);
     00324       
     00325       // in hidden we put the jft_id
    -00326       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="jft_id%d" value="%s">',
    +00326       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="jft_id%d" value="%s">',
     00327                    $i,$l_line['jft_id']);
     00328       printf ('<TR><TD> %s </TD><TD><INPUT TYPE="TEXT" NAME="av_text%d" VALUE="%s">%s %s %s</TD></TR>',
     00329               $l_line['ad_text'], $i, $l_line['av_text'],$Hid,$but_search_poste,$ad);
    @@ -308,7 +308,7 @@
     00331     }
     00332     echo '</TR>';
     00333     echo '</TABLE>';
    -00334     echo '<INPUT TYPE="SUBMIT" name="update_fiche" value="Mis à jour">';
    +00334     echo '<INPUT TYPE="SUBMIT" name="update_fiche" value="Mis à jour">';
     00335     echo '</FORM>';
     00336   }
     00337 }
    @@ -376,8 +376,8 @@
     00439     }
     00440     echo '</table>';
     00441     echo '<FORM METHOD="POST" action="fiche.php">';
    -00442     echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
    -00443     echo '<INPUT TYPE="SUBMIT" name="add" Value="Ajout fiche">';
    +00442     echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
    +00443     echo '<INPUT TYPE="SUBMIT" name="add" Value="Ajout fiche">';
     00444     echo '</FORM>';
     00445     echo $bar;
     00446 
    @@ -550,7 +550,7 @@
     00669   echo '<BR>Classe de base <INPUT TYPE="TEXT" NAME="class_base">';
     00670   echo $p_js;
     00671   echo '<INPUT TYPE="HIDDEN" NAME="inc" VALUE="1">';
    -00672   echo '<BR><INPUT TYPE="SUBMIT" name="record_model" VALUE="Ajoute modèle">';
    +00672   echo '<BR><INPUT TYPE="SUBMIT" name="record_model" VALUE="Ajoute modèle">';
     00673   echo '</FORM>';
     00674 }
     00689 function DefModele ($p_cn,$p_js,$p_array=null,$p_ligne=1) 
    @@ -1042,7 +1042,7 @@
     01406     if ( ${"ad_id$i"} == ATTR_DEF_NAME ) {
     01407       printf('Label</TD><TD><INPUT TYPE="TEXT" NAME="label" VALUE="%s">',
     01408              $label);
    -01409       printf('</td><TD><input type="submit" NAME="change_name" value="Change Nom">');
    +01409       printf('</td><TD><input type="submit" NAME="change_name" value="Change Nom">');
     01410     } else {
     01411       // The attr.
     01412       printf('%s ',
    @@ -1150,7 +1150,7 @@
     01556     return 1;
     01557 }
     01558 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/fiche__inc_8php.html b/doc/developper/html/fiche__inc_8php.html index 3625b1fe3..b469bd4f5 100644 --- a/doc/developper/html/fiche__inc_8php.html +++ b/doc/developper/html/fiche__inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/fiche_inc.php File Reference +phpcompta: fiche_inc.php File Reference +include

    fiche_inc.php File Reference

    Function for managing card, redundant with the class fiche. More...

    @@ -190,7 +190,180 @@ ajoute une nouvelle fiche

    Definition at line 38 of file fiche_inc.php.

    -References $flag, $num, $p_parent, $Res, $sql, $Sql, CountSql(), echo_debug(), echo_error(), ExecSql(), exit, FormatString(), Get_attr_def(), GetBaseFiche(), GetCreateAccount(), GetNextFiche(), GetSequence(), and isNumber(). +References $flag, $num, $p_parent, $Res, $sql, $Sql, CountSql(), echo_debug(), echo_error(), ExecSql(), exit, FormatString(), Get_attr_def(), GetBaseFiche(), GetCreateAccount(), GetNextFiche(), GetSequence(), and isNumber().

    00038                                           {
    +00039   // TODO ADD ROLLBACK !!!
    +00040   echo_debug('fiche_inc.php',__LINE__," AddFiche($p_cn,$p_type,$p_array) ");
    +00041   // Push the array in element starting with p
    +00042   //
    +00043   foreach ($p_array as $key=>$element){
    +00044     ${"p_$key"}=$element;
    +00045     echo_debug('fiche_inc.php',__LINE__,"p_$key=$element;");
    +00046   }
    +00047   // First verify that the name is not null
    +00048   // av_text.ATTR_DEF_NAME
    +00049   if ( strlen(trim($p_av_text0 )) ==0 )
    +00050     return;
    +00051 
    +00052   // First Get the attr of the fiche
    +00053   $field=Get_attr_def($p_cn,$p_fd_id);
    +00054 
    +00055   $flag=1;
    +00056 
    +00057   // Create the Fiche
    +00058   $Sql="insert into fiche (fd_id) values (".$p_fd_id.")";
    +00059   $Res=ExecSql($p_cn,$Sql);
    +00060 
    +00061   // Get is f_id (sequence)
    +00062   $l_f_id=GetSequence($p_cn,'s_fiche');
    +00063 
    +00064   // Should we Create accounts for each cards
    +00065   $create=GetCreateAccount($p_cn,$p_fd_id);
    +00066 
    +00067 
    +00068   // Is a account given ?
    +00069   for ( $i = 0; $i < $p_inc;$i++) {
    +00070     //Except for the class base
    +00071     if ( ${"p_ad_id$i"} == ATTR_DEF_ACCOUNT ) {
    +00072       if (strlen (trim(${"p_av_text$i"})) == 0 or
    +00073           isNumber(${"p_av_text$i"}) == 0 )
    +00074         {
    +00075           break;
    +00076         }
    +00077       // if account already exist do nothing in tmp_pcmn otherwise add it
    +00078       if (CountSql($p_cn,"select pcm_val from tmp_pcmn where pcm_val=".${"p_av_text$i"}) == 0 )
    +00079         {
    +00080           $len=strlen(${"p_av_text$i"})-1;
    +00081           // Mother account
    +00082           $p_parent=substr(${"p_av_text$i"},0,$len);
    +00083           while (CountSql($p_cn,"select pcm_val from tmp_pcmn where pcm_val=$p_parent") == 0 and
    +00084                  $len > 0 ) {
    +00085             $len--;
    +00086             $p_parent=substr(${"p_av_text$i"},0,$len);
    +00087           }
    +00088           // If no parent found
    +00089           if ( $len <= 0 ) {
    +00090             echo_error ("No parent found");
    +00091             exit("No parent found for ".${"p_av_text$i"});
    +00092 
    +00093           } // if $len == 0
    +00094           $lib=FormatString($p_av_text0);
    +00095           $sql=sprintf("insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) 
    +00096                 values (%s,'%s',%d)",
    +00097                        ${"p_av_text$i"},
    +00098                        $lib,
    +00099                        $p_parent);
    +00100 
    +00101           // Add if into tmp_pcmn
    +00102           $Res=ExecSql($p_cn,$Sql);
    +00103         }
    +00104       // Add it the jnt table
    +00105       // 5 is always for the account post
    +00106       $Sql=sprintf("insert into jnt_fic_att_value (f_id,ad_id) values (%d,%d)",
    +00107                    $l_f_id,ATTR_DEF_ACCOUNT);
    +00108       $Res=ExecSql($p_cn,$Sql);
    +00109       
    +00110       // Get the jft_id sequence (s_jnt_fic_att_value)
    +00111       $l_jft_id=GetSequence($p_cn,'s_jnt_fic_att_value');
    +00112       
    +00113       
    +00114       // Add it the attr_value table
    +00115       $Sql=sprintf("insert into attr_value(jft_id,av_text) values (%d,'%s')",
    +00116                    $l_jft_id,${"p_av_text$i"});
    +00117       $Res=ExecSql($p_cn,$Sql);
    +00118       // If create == 0 we don't create automatically an account
    +00119       $create=0;      
    +00120     }
    +00121 
    +00122   } // for $i...
    +00123 
    +00124   echo_debug ( " create = $create ");
    +00125   if ( $create == 1 ) {
    +00126     // We create an account for each
    +00127     // Get The Class Base
    +00128     $base=GetBaseFiche($p_cn,$p_type);
    +00129     
    +00130     // If a specific post account is needed created it
    +00131     
    +00132     if ( $base !=null  ) {
    +00133       // if the class base is not null, create it in the tmp_pcmn
    +00134       $num=GetNextFiche($p_cn,$base);
    +00135 
    +00136       $lib=FormatString($p_av_text0);
    +00137       $sql=sprintf("insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) 
    +00138                 values (%s,'%s',%d)",
    +00139                    $num,
    +00140                    $lib,
    +00141                    $base);
    +00142       echo_debug($sql);
    +00143       $Res=ExecSql($p_cn,$sql);
    +00144       // Add it the jnt table
    +00145       // 5 is always for the account post
    +00146       $Sql=sprintf("insert into jnt_fic_att_value (f_id,ad_id) values (%d,%d)",
    +00147                    $l_f_id,ATTR_DEF_ACCOUNT);
    +00148       $Res=ExecSql($p_cn,$Sql);
    +00149       
    +00150       // Get the jft_id sequence (s_jnt_fic_att_value)
    +00151       $l_jft_id=GetSequence($p_cn,'s_jnt_fic_att_value');
    +00152       
    +00153       
    +00154       // Add it the attr_value table
    +00155       $Sql=sprintf("insert into attr_value(jft_id,av_text) values (%d,'%s')",
    +00156                    $l_jft_id,$num);
    +00157       $Res=ExecSql($p_cn,$Sql);
    +00158     }
    +00159   }// end create accounts for each cards
    +00160 
    +00161 
    +00162   // Add the others attribut in jnt_fic_att_value and after in attr_value
    +00163   for ( $i = 0; $i < $p_inc;$i++) {
    +00164     //Except for the class base
    +00165        if ( ${"p_ad_id$i"} == ATTR_DEF_ACCOUNT ) continue;
    +00166 
    +00167     // Special treatment for QuickCode
    +00168        if ( ${"p_ad_id$i"} == ATTR_DEF_QUICKCODE ) {
    +00169          $sql=sprintf("select insert_quick_code(%d,'%s')",
    +00170                       $l_f_id,FormatString(${"p_av_text$i"}));
    +00171          $Res=ExecSql($p_cn,$sql);
    +00172          continue;
    +00173        }
    +00174     // Add it the jnt table
    +00175     $Sql=sprintf("insert into jnt_fic_att_value (f_id,ad_id) values (%d,%d)",
    +00176                  $l_f_id,${"p_ad_id$i"});
    +00177     $Res=ExecSql($p_cn,$Sql);
    +00178 
    +00179     // Get the jft_id sequence (s_jnt_fic_att_value)
    +00180     $l_jft_id=GetSequence($p_cn,'s_jnt_fic_att_value');
    +00181 
    +00182     // test the vat rate
    +00183     if (  ${"p_ad_id$i"} == ATTR_DEF_TVA ) {
    +00184       // is a rate given 
    +00185       if ( strlen(trim(${"p_av_text$i"})) != 0 and 
    +00186            isNumber(${"p_av_text$i"}) == 1) {
    +00187         // is a valid rate ?
    +00188         if ( CountSql($p_cn,"select * from tva_rate where tva_id='".${"p_av_text$i"}."'") == 0 ) {
    +00189           // the rate doesn't exist
    +00190           ${"p_av_text$i"}=1;
    +00191           // warning
    +00192           echo_error('invalid rate') ;
    +00193           echo '<script>
    +00194                 alert("Attention tva invalid, valeur par défaut =1 ");
    +00195               </script>';
    +00196           
    +00197         }
    +00198       }// if a rate is given
    +00199     }
    +00200     $text=FormatString(${"p_av_text$i"});
    +00201     // Add it the attr_value table
    +00202     $Sql=sprintf("insert into attr_value(jft_id,av_text) values (%d,'%s')",
    +00203                  $l_jft_id,$text);
    +00204     $Res=ExecSql($p_cn,$Sql);
    +00205 
    +00206   }
    +00207 
    +00208 }
    +
    +

    +

    @@ -239,7 +412,102 @@ array gen :

      Definition at line 761 of file fiche_inc.php.

      -References $Res, $sql, echo_debug(), echo_error(), ExecSql(), FormatString(), Get_attr_min(), GetBaseFicheDefault(), GetSequence(), and isNumber(). +References $Res, $sql, echo_debug(), echo_error(), ExecSql(), FormatString(), Get_attr_min(), GetBaseFicheDefault(), GetSequence(), and isNumber().

      00761                                    {
      +00762   echo_debug('fiche_inc.php',__LINE__,"AddModele");
      +00763   // Show what we receive for debug purpose only
      +00764   //
      +00765   foreach ( $p_array as $key=>$element ) {
      +00766     echo_debug('fiche_inc.php',__LINE__,"p_$key $element");
      +00767     ${"p_$key"}=$element;
      +00768   }
      +00769   // Format correctly the name of the cat. of card
      +00770   $p_nom_mod=FormatString($p_nom_mod);
      +00771   echo_debug('fiche_inc.php',__LINE__,"Adding $p_nom_mod");
      +00772    // Format the p_class_base 
      +00773   // must be an integer
      +00774   if ( isNumber($p_class_base) == 0 && FormatString($p_class_base) != null ) {
      +00775     echo_error ('p_class_base is NOT a number');
      +00776   }
      +00777   if ( strlen(trim($p_nom_mod)) == 0 ) 
      +00778     return;
      +00779 
      +00780   // $p_FICHE_REF cannot be null !!! (== fiche_def_ref.frd_id
      +00781   if (! isset ($p_FICHE_REF) or strlen($p_FICHE_REF) == 0 ) {
      +00782     echo_error ("AddModele : fiche_ref MUST NOT be null or empty");
      +00783     return;
      +00784   }
      +00785   // build the sql request for fiche_def
      +00786   // and insert into fiche_def
      +00787   // if p_class_base is null get the default class base from
      +00788   // fiche_def_ref
      +00789   if ( FormatString($p_class_base) == null )
      +00790     { // p_class is null
      +00791       // So we take the default one
      +00792       $p_class_base=GetBaseFicheDefault($p_cn,$p_FICHE_REF);
      +00793     }
      +00794   // Set the value of fiche_def.fd_create_account
      +00795   if ( isset($p_create)) 
      +00796     $p_create='true';
      +00797   else
      +00798     $p_create='false';
      +00799 
      +00800   // Class is valid ?
      +00801   if ( FormatString($p_class_base) != null) {
      +00802 
      +00803     // p_class is a valid number
      +00804     $sql=sprintf("insert into fiche_def(fd_label,fd_class_base,frd_id,fd_create_account) 
      +00805                 values ('%s',%s,%d,'%s')",
      +00806                  $p_nom_mod,$p_class_base,$p_FICHE_REF,$p_create);
      +00807     $Res=ExecSql($p_cn,$sql);
      +00808 
      +00809     // p_class must be added to tmp_pcmn 
      +00810     $sql=sprintf("select account_add(%d,'%s')",
      +00811                  $p_class_base,$p_nom_mod);
      +00812 
      +00813     $Res=ExecSql($p_cn,$sql);
      +00814 
      +00815     // Get the fd_id
      +00816     $fd_id=GetSequence($p_cn,'s_fdef');
      +00817 
      +00818     // Add the class_base if needed
      +00819 
      +00820     if ( $p_create=='true' ) {
      +00821       $sql=sprintf("insert into jnt_fic_attr(fd_id,ad_id) 
      +00822                      values (%d,%d)",$fd_id,ATTR_DEF_ACCOUNT);
      +00823       $Res=ExecSql($p_cn,$sql);
      +00824     }
      +00825   } else {
      +00826     //There is no class base not even as default
      +00827     $sql=sprintf("insert into fiche_def(fd_label,frd_id,fd_create_account) values ('%s',%d,'%s')",
      +00828                  $p_nom_mod,$p_FICHE_REF,$p_create);
      +00829 
      +00830   $Res=ExecSql($p_cn,$sql);
      +00831 
      +00832   // Get the fd_id
      +00833   $fd_id=GetSequence($p_cn,'s_fdef');
      +00834 
      +00835   }
      +00836 
      +00837   // Get the default attr_def from attr_min
      +00838   $def_attr=Get_attr_min($p_cn,$p_FICHE_REF);
      +00839 
      +00840    //if defaut attr not null 
      +00841   // build the sql insert for the table attr_def
      +00842   if (sizeof($def_attr) != 0 ) {
      +00843     // insert all the mandatory fields into jnt_fiche_attr
      +00844     foreach ( $def_attr as $i=>$v) {
      +00845       $sql=sprintf("insert into jnt_fic_Attr(fd_id,ad_id)
      +00846                    values (%d,%s)",
      +00847                    $fd_id,$v['ad_id']);
      +00848       ExecSql($p_cn,$sql);
      +00849     }
      +00850   }
      +00851   
      +00852   
      +00853 }
      +
      +

      +

      @@ -304,7 +572,65 @@ DefModele

      Definition at line 689 of file fiche_inc.php.

      -References $check, echo_debug(), Get_fiche_def_ref(), and METHOD. +References $check, echo_debug(), Get_fiche_def_ref(), and METHOD.

      00690 {
      +00691   echo_debug('fiche_inc.php',__LINE__,"DefModele ($p_array,$p_ligne=1) ");
      +00692 
      +00693   // Creating form
      +00694   $display='<FORM ACTION="fiche.php" METHOD="POST">';
      +00695 
      +00696   // Number of line of the card
      +00697   $display.='<INPUT TYPE="HIDDEN" NAME="INC" VALUE="'.$p_ligne.'">';
      +00698 
      +00699   // Table of input
      +00700   $display.='<TABLE BORDER="0" CELLSPACING="0">';
      +00701   
      +00702   
      +00703   //Name of the CARD (fiche_def.fd_label)
      +00704   $display.='<TR><TD> Catégorie de fiche </TD>';
      +00705   $display.='<TD><INPUT TYPE="INPUT" NAME="nom_mod">';
      +00706   $display.='</TD></TR>';
      +00707 
      +00708   // Class base fiche_def.fd_class_base (optional)
      +00709   $display.='<TR><TD> Classe de base </TD>';
      +00710   $display.='<TD><INPUT TYPE="INPUT" NAME="class_base"> '.$p_js;
      +00711   $display.='</TD></TR>';
      +00712   // Checkbox for the creation of a post
      +00713   $display.='<TR><TD> <INPUT TYPE="CHECKBOX" NAME="create" CHECKED>Cr&eacute;ation automatique du poste comptable</TD></TR>';
      +00714 
      +00715   //display the different template
      +00716   $ref=Get_fiche_def_ref($p_cn);
      +00717 
      +00718   // check if $ref is an array 
      +00719   // and display the choice
      +00720 
      +00721   // select by default the first choice
      +00722   $check="CHECKED";
      +00723   if ( sizeof($ref)  ) {
      +00724     foreach ($ref as $i=>$v) {
      +00725       $display.='<TR><TD COLSPAN="2">';
      +00726 
      +00727       $display.='<INPUT TYPE="RADIO" NAME="FICHE_REF" VALUE="'.$v['id'].'"'.$check.'>';
      +00728       $display.=$v['text'];
      +00729       // if a class base exist in fiche_def_ref, we display it
      +00730       if ( sizeof ($v['class']) != 0 ) 
      +00731            $display.="&nbsp;&nbsp<I>Class base = ".$v['class']."</I>";
      +00732       $display.="</TD></TR>";
      +00733       $check="";
      +00734     }
      +00735  
      +00736   }
      +00737   // closing the form
      +00738   $display.='</TABLE>';
      +00739   $display.='<INPUT TYPE="SUBMIT" NAME="add_modele" VALUE="Sauve">';
      +00740   $display.='</FORM>';
      +00741 
      +00742   // display it
      +00743   echo $display;
      +00744 
      +00745 }
      +
      +

      +

      @@ -360,9 +686,58 @@ parm :

        Definition at line 1390 of file fiche_inc.php.

        -References $i, $l, $M, $Res, echo_debug(), ExecSql(), label, and value. +References $i, $l, $M, $Res, echo_debug(), ExecSql(), label, and value.

        -Referenced by UpdateModele(). +Referenced by UpdateModele().

        01391 {
        +01392   echo_debug('fiche_inc.php',__LINE__,"DisplayDetailModele");
        +01393 
        +01394   foreach ($p_array as $v=>$i) { 
        +01395     echo_debug('fiche_inc.php',__LINE__,"v == $v i==$i");
        +01396     ${"$v"}=$i;
        +01397   }
        +01398   echo '<FORM action="fiche.php" method="get">';
        +01399   echo '<INPUT TYPE="HIDDEN" NAME="fd_id" VALUE="'.$fd_id.'">';
        +01400 
        +01401   printf("<TABLE>");
        +01402   // Display each attribute
        +01403   for ($i=0;$i<$MaxLine;$i++) {
        +01404     echo '<TR><td>';
        +01405     // Can change the name
        +01406     if ( ${"ad_id$i"} == ATTR_DEF_NAME ) {
        +01407       printf('Label</TD><TD><INPUT TYPE="TEXT" NAME="label" VALUE="%s">',
        +01408              $label);
        +01409       printf('</td><TD><input type="submit" NAME="change_name" value="Change Nom">');
        +01410     } else {
        +01411       // The attr.
        +01412       printf('%s ',
        +01413              ${"ad_text$i"});
        +01414     }
        +01415     echo '</td></tr>';
        +01416   }
        +01417 
        +01418   // Show the possible attribute which are not already attribute of the model
        +01419   // of card
        +01420   $Res=ExecSql($p_cn,"select ad_id,ad_text from attr_def 
        +01421                        where ad_id not in (select ad_id from fiche_def natural join jnt_fic_attr
        +01422                            where fd_id=$fd_id)");
        +01423   $M=pg_NumRows($Res);
        +01424 
        +01425   // Show the unused attribute
        +01426   echo '<TR> <TD>';
        +01427   echo '<SELECT NAME="ad_id">';
        +01428   for ($i=0;$i<$M;$i++) {
        +01429     $l=pg_fetch_array($Res,$i);
        +01430     printf('<OPTION VALUE="%s"> %s',
        +01431            $l['ad_id'],$l['ad_text']);
        +01432   }
        +01433   echo '</SELECT>';
        +01434   echo '</TD><TD> <INPUT TYPE="SUBMIT" Value="Add that line" NAME="add_ligne"></TD></TR>';
        +01435   printf("</TABLE>");
        +01436   echo '</FORM>';
        +01437 }
        +
        +

        +

        @@ -420,9 +795,124 @@ DANY: Oui je suis assez d'accord avec toi

  • Definition at line 225 of file fiche_inc.php.

    -References $l_line, $label, $Max, $Res, $sql, echo_debug(), ExecSql(), getFicheNameById(), name, and value. +References $l_line, $label, $Max, $Res, $sql, echo_debug(), ExecSql(), getFicheNameById(), name, and value.

    -Referenced by ViewFicheDetail(). +Referenced by ViewFicheDetail().

    00225                                                   {
    +00226   echo_debug('fiche_inc.php',__LINE__,"function EncodeFiche($p_cn,$p_type) ");
    +00227 
    +00228   $ch_col="</TD><TD>";
    +00229   $ch_li='</TR><TR>';
    +00230   echo '<FORM action="fiche.php" method="post" name="fiche">';
    +00231   echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
    +00232   $l_sessid=$_REQUEST['PHPSESSID'];
    +00233 
    +00234   echo JS_SHOW_TVA;
    +00235   echo JS_SEARCH_POSTE;
    +00236   echo "<TABLE>";
    +00237   if ($p_array == null) {
    +00238     // Array is null so we display a blank form
    +00239     //    echo '<H2 class="info">'.getFicheName($p_cn,$p_type).'</H2>';
    +00240     echo '<H2 class="info">New </H2>';
    +00241     $p_f_id="";
    +00242     echo_debug('fiche_inc.php',__LINE__,"Array is null");
    +00243     // Find all the attribute of the existing cards
    +00244     // --> Get_attr_def 
    +00245     $sql="select frd_id,ad_id,ad_text from  fiche_def join jnt_fic_attr using (fd_id)
    +00246            join attr_def using (ad_id) where fd_id=".$p_type." order by ad_id";
    +00247 
    +00248     $Res=ExecSql($p_cn,$sql);
    +00249     $Max=pg_NumRows($Res);
    +00250     // Put the card modele id (fiche_def.fd_id)
    +00251     echo '<INPUT TYPE="HIDDEN" name="fd_id" value="'.$p_type.'">';
    +00252     for ($i=0;$i < $Max;$i++) {
    +00253       $l_line=pg_fetch_array($Res,$i);
    +00254 
    +00255       // The number of the attribute
    +00256       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="ad_id%d" value="%s">',
    +00257                    $i,$l_line['ad_id']);
    +00258 
    +00259       $but_search_poste="";
    +00260       // Javascript for searching the account
    +00261       if ( $l_line ['ad_id'] == ATTR_DEF_ACCOUNT ) {
    +00262         $ctl_name="av_text$i";
    +00263         $but_search_poste='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$l_sessid.'\',\''.$ctl_name.'\')">';
    +00264       } 
    +00265       // Javascript for showing the tva
    +00266       if ( $l_line ['ad_id'] == ATTR_DEF_TVA ) {
    +00267         $but_search_poste='<INPUT TYPE="BUTTON" VALUE="Montre" OnClick="ShowTva(\''.$l_sessid.'\', \'av_text'.$i.'\')">';
    +00268       }
    +00269       // content of the attribute
    +00270       printf ('<TR><TD> %s </TD><TD><INPUT TYPE="TEXT" NAME="av_text%d">%s %s</TD></TR>',
    +00271               $l_line['ad_text'], $i,$Hid,$but_search_poste);
    +00272    }
    +00273     echo '</TR>';
    +00274     echo '</TABLE>';
    +00275     echo '<INPUT TYPE="HIDDEN" name="inc" value="'.$Max.'">';
    +00276     echo '<INPUT TYPE="SUBMIT" name="add_fiche" value="ajoute">';
    +00277     echo '</FORM>';
    +00278   }else {
    +00279     // Array is not null so we have to find the card's data from the database
    +00280     // and display them
    +00281 
    +00282     // Display the card name
    +00283     $label=getFicheNameById($p_cn,$p_type);
    +00284     echo '<H2 class="info">'.$label.'</H2>';
    +00285 
    +00286     // Find all the data related to the card
    +00287     $sql="select av_text,ad_id,ad_text,jft_id from attr_value
    +00288         natural join attr_def 
    +00289         natural join jnt_fic_att_value 
    +00290         natural join fiche where f_id=$p_type order by ad_id";
    +00291 
    +00292     $Res=ExecSql($p_cn,$sql);
    +00293     $Max=pg_NumRows($Res);
    +00294     echo_debug('fiche_inc.php',__LINE__,"Max ==== $Max");    
    +00295 
    +00296     echo '<INPUT TYPE="HIDDEN" name="f_id" value="'.$p_type.'">';
    +00297     echo '<INPUT TYPE="HIDDEN" name="f_label" value="'.$label.'">';
    +00298     echo '<INPUT TYPE="HIDDEN" name="max" value="'.$Max.'">';
    +00299 
    +00300     for ($i=0;$i < $Max;$i++) {
    +00301       // fetch the data
    +00302       $l_line=pg_fetch_array($Res,$i);
    +00303 
    +00304       // Put also the class in a special variable
    +00305       // useful when we want to update the PCMN
    +00306 
    +00307       $but_search_poste="";
    +00308       if ( $l_line['ad_id'] == ATTR_DEF_ACCOUNT ) {
    +00309         printf('<INPUT TYPE="HIDDEN" name="class" value="%s">',
    +00310                $l_line['av_text']);
    +00311       // Javascript for searching the account
    +00312         $ctl_name="av_text$i";
    +00313         $but_search_poste='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$l_sessid.'\',\''.$ctl_name.'\')">';
    +00314       } 
    +00315         
    +00316       // Javascript for showing the tva
    +00317       if ( $l_line ['ad_id'] == ATTR_DEF_TVA ) {
    +00318         $but_search_poste='<INPUT TYPE="BUTTON" VALUE="Montre" OnClick="ShowTva(\''.$l_sessid.'\',\'av_text'.$i.'\')">';
    +00319       }
    +00320       
    +00321       // hide ad_id
    +00322       $ad=sprintf('<input type="hidden" name="ad_id%d" value="%s">',
    +00323                   $l_line['ad_id'],$l_line['av_text']);
    +00324       
    +00325       // in hidden we put the jft_id
    +00326       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="jft_id%d" value="%s">',
    +00327                    $i,$l_line['jft_id']);
    +00328       printf ('<TR><TD> %s </TD><TD><INPUT TYPE="TEXT" NAME="av_text%d" VALUE="%s">%s %s %s</TD></TR>',
    +00329               $l_line['ad_text'], $i, $l_line['av_text'],$Hid,$but_search_poste,$ad);
    +00330       
    +00331     }
    +00332     echo '</TR>';
    +00333     echo '</TABLE>';
    +00334     echo '<INPUT TYPE="SUBMIT" name="update_fiche" value="Mis à jour">';
    +00335     echo '</FORM>';
    +00336   }
    +00337 }
    +
    +

    +

    @@ -458,7 +948,19 @@ EncodeModele

    Definition at line 664 of file fiche_inc.php.

    -References METHOD, and name. +References METHOD, and name.

    00665 {
    +00666   echo '<H2 CLASS="info"> Ajout d\'un modèle</H2>';
    +00667   echo '<FORM ACTION="fiche.php" METHOD="post">';
    +00668   echo '<BR>Libellé <INPUT TYPE="TEXT" NAME="nom_mod">';
    +00669   echo '<BR>Classe de base <INPUT TYPE="TEXT" NAME="class_base">';
    +00670   echo $p_js;
    +00671   echo '<INPUT TYPE="HIDDEN" NAME="inc" VALUE="1">';
    +00672   echo '<BR><INPUT TYPE="SUBMIT" name="record_model" VALUE="Ajoute modèle">';
    +00673   echo '</FORM>';
    +00674 }
    +
    +

    +

    @@ -509,7 +1011,30 @@ Definition at line 1181<

    References $array, $i, $Num, $Res, $Sql, and ExecSql().

    -Referenced by AddFiche(). +Referenced by AddFiche().

    01181                                           {
    +01182   // find the min attr for the fiche_def_ref
    +01183   $Sql="select ad_id,ad_text from attr_def 
    +01184          natural join jnt_fic_attr
    +01185          natural join fiche_def
    +01186       where
    +01187       fd_id= $p_fiche_def order by ad_id";
    +01188   $Res=ExecSql($p_cn,$Sql);
    +01189   $Num=pg_NumRows($Res);
    +01190 
    +01191   // test the number of returned rows
    +01192   if ($Num == 0 ) return null;
    +01193 
    +01194   // Get Results & Store them in a array
    +01195   for ($i=0;$i<$Num;$i++) {
    +01196     $f=pg_fetch_array($Res,$i);
    +01197     $array[$i]['ad_id']=$f['ad_id'];
    +01198     $array[$i]['ad_text']=$f['ad_text'];
    +01199   }
    +01200   return $array;
    +01201 }
    +
    +

    +

    @@ -560,7 +1085,29 @@ Definition at line 1149<

    References $array, $i, $Num, $Res, $Sql, and ExecSql().

    -Referenced by AddModele(). +Referenced by AddModele().

    01149                                               {
    +01150   // find the min attr for the fiche_def_ref
    +01151   $Sql="select ad_id,ad_text from attr_min natural join attr_def 
    +01152          natural join fiche_def_ref
    +01153       where
    +01154       frd_id= $p_fiche_def_ref";
    +01155   $Res=ExecSql($p_cn,$Sql);
    +01156   $Num=pg_NumRows($Res);
    +01157 
    +01158   // test the number of returned rows
    +01159   if ($Num == 0 ) return null;
    +01160 
    +01161   // Get Results & Store them in a array
    +01162   for ($i=0;$i<$Num;$i++) {
    +01163     $f=pg_fetch_array($Res,$i);
    +01164     $array[$i]['ad_id']=$f['ad_id'];
    +01165     $array[$i]['ad_text']=$f['ad_text'];
    +01166   }
    +01167   return $array;
    +01168 }
    +
    +

    +

    @@ -598,7 +1145,30 @@ Definition at line 1115<

    References $array, $i, $Max, $Res, ExecSql(), frd_class_base, frd_id, and frd_text.

    -Referenced by DefModele(). +Referenced by DefModele().

    01116 {
    +01117   // get all the data from fiche_def_ref
    +01118   $Res=ExecSql($p_cn, "select frd_id,frd_text,frd_class_base 
    +01119                           from fiche_def_ref
    +01120                        order by frd_text");
    +01121 
    +01122   // check if the result is valid
    +01123   $Max=pg_NumRows($Res);
    +01124   if ( $Max == 0) return null;
    +01125 
    +01126   // store the result in a array
    +01127   for ($i=0;$i<$Max;$i++) {
    +01128     $f=pg_fetch_array($Res,$i);
    +01129     $array[$i]['id']=$f['frd_id'];
    +01130     $array[$i]['text']=$f['frd_text'];
    +01131     $array[$i]['class']=$f['frd_class_base'];
    +01132   }
    +01133 
    +01134   // return result
    +01135   return $array;
    +01136 }
    +
    +

    +

    @@ -649,7 +1219,16 @@ Definition at line 352 References $Res, and ExecSql().

    -Referenced by AddFiche(). +Referenced by AddFiche().

    00352                                      {
    +00353   $base=null;
    +00354   $Res=ExecSql($p_cn,"select fd_class_base from fiche_def where fd_id=".$p_type);
    +00355   if ( pg_NumRows($Res) == 0 ) return null;
    +00356   $base=pg_fetch_array($Res,0);
    +00357   return $base['fd_class_base'];
    +00358 }
    +
    +

    +

    @@ -700,7 +1279,16 @@ Definition at line 374 References $Res, ExecSql(), and frd_class_base.

    -Referenced by AddModele(). +Referenced by AddModele().

    00374                                             {
    +00375   $base=null;
    +00376   $Res=ExecSql($p_cn,"select frd_class_base from fiche_def_ref where frd_id=".$p_type);
    +00377   if ( pg_NumRows($Res) == 0 ) return null;
    +00378   $base=pg_fetch_array($Res,0);
    +00379   return $base['frd_class_base'];
    +00380 }
    +
    +

    +

    @@ -751,7 +1339,27 @@ Definition at line 1313<

    References $Res, $sql, echo_debug(), and ExecSql().

    -Referenced by Remove(). +Referenced by Remove().

    01313                                 {
    +01314   echo_debug('fiche_inc.php',__LINE__,"GetClass($p_fid)");
    +01315   
    +01316   // the account class is in the av_text with the ad_id=5 in 
    +01317   // attr_Def
    +01318   $sql="select av_text from attr_value 
    +01319                      natural join jnt_fic_att_value
    +01320                       natural join attr_def 
    +01321                     where
    +01322                       ad_id=".ATTR_DEF_ACCOUNT." and f_id=$p_fid";
    +01323   // Exec
    +01324   $Res=ExecSql($p_cn,$sql);
    +01325   if (pg_NumRows($Res) == 0 ) return null;
    +01326 
    +01327   // Fetch the data and return it
    +01328   $f=pg_fetch_array($Res,0);
    +01329   return $f['av_text'];
    +01330 }
    +
    +

    +

    @@ -801,7 +1409,33 @@ Definition at line 1214<

    References $Num, $Res, $Sql, echo_debug(), and ExecSql().

    -Referenced by AddFiche(), and Remove(). +Referenced by AddFiche(), and Remove().

    01214                                               {
    +01215   // find the min attr for the fiche_def_ref
    +01216   $Sql="select fd_create_account
    +01217       from fiche_def
    +01218         where
    +01219       fd_id= $p_fiche_def";
    +01220   $Res=ExecSql($p_cn,$Sql);
    +01221   $Num=pg_NumRows($Res);
    +01222 
    +01223   // test the number of returned rows
    +01224   if ($Num == 0 ) return 0;
    +01225 
    +01226 
    +01227   for ($i=0;$i<$Num;$i++) {
    +01228     $f=pg_fetch_array($Res,$i);
    +01229     echo_debug ("fd_create_account == ".$f['fd_create_account']);
    +01230     if ( $f['fd_create_account']=='t') {
    +01231       echo_debug('fiche_inc.php',__LINE__,"fd_create_account return 1");
    +01232       return 1;
    +01233     }
    +01234   }
    +01235   echo_debug('fiche_inc.php',__LINE__,"fd_create_account return 0");
    +01236   return 0;
    +01237 }
    +
    +

    +

    @@ -852,7 +1486,39 @@ Definition at line 895 References $array, $Max, $Res, ExecSql(), and label.

    -Referenced by UpdateModele(). +Referenced by UpdateModele().

    00895                                        {
    +00896   $Res=ExecSql($p_cn,"select fd_class_base,ad_id,ad_text from 
    +00897                           fiche_def
    +00898                           natural join jnt_fic_attr
    +00899                           natural join attr_def
    +00900                           where
    +00901                           fd_id=$p_fiche");
    +00902   $Max=pg_NumRows($Res) ;
    +00903   if ($Max==0) return null;
    +00904 
    +00905   // store the data in an array
    +00906   for ($i=0; $i < $Max;$i++) {
    +00907     $line=pg_fetch_array($Res,$i);
    +00908     if ($i == 0 ) {
    +00909       $array['label']=GetFicheDefName($p_cn,$p_fiche);
    +00910       $array['class_base']=$line['fd_class_base'];
    +00911       $array['fd_id']=$p_fiche;
    +00912     }//if $i == 0
    +00913 
    +00914     //Label
    +00915     $text=sprintf("ad_id%d",$i);
    +00916     $array[$text]=$line['ad_id'];
    +00917     //isd_id
    +00918     $text=sprintf("ad_text%d",$i);
    +00919     $array[$text]=$line['ad_text'];
    +00920 
    +00921   }//for
    +00922   $array['ligne']=$Max;
    +00923   return $array;
    +00924 }
    +
    +

    +

    @@ -912,7 +1578,32 @@ Definition at line 1474<

    References $Res, and ExecSql().

    -Referenced by FormAchView(), FormVenteView(), and withStock(). +Referenced by FormAchView(), FormVenteView(), and withStock().

    01474                                                   {
    +01475   // Retrieve the attribute with the ad_id 1
    +01476   // 1 is always the name
    +01477 
    +01478   if ( $p_attr != "") {
    +01479     $Res=ExecSql($p_cn,"select av_text from 
    +01480                     attr_value
    +01481                     natural join jnt_fic_att_value 
    +01482                     natural join fiche 
    +01483                     where
    +01484                     ad_id=$p_attr 
    +01485                     and f_id=(select f_id from vw_poste_qcode where j_qcode='$p_id') ");
    +01486     if ( pg_NumRows($Res) == 0 ) return NULL;
    +01487     $st=pg_fetch_array($Res,0);
    +01488     return $st['av_text'];
    +01489   } else {
    +01490     // Get attribut from the view
    +01491     $Res=ExecSql($p_cn,"select * from vw_fiche_attr where quick_code='$p_id'");
    +01492     if ( pg_NumRows($Res) == 0 ) return null;
    +01493     $st=pg_fetch_array($Res,0);
    +01494     return $st;
    +01495   }
    +01496 }
    +
    +

    +

    @@ -964,7 +1655,26 @@ Definition at line 1282<

    References $Res, $sql, and ExecSql().

    -Referenced by Remove(), and ViewFicheDetail(). +Referenced by Remove(), and ViewFicheDetail().

    01283 {
    +01284   // Sql stmt
    +01285   $sql="select fd_id from fiche_def join fiche using (fd_id) 
    +01286       where f_id=$p_f_id";
    +01287   // Execute it
    +01288   $Res=ExecSql($p_cn,$sql);
    +01289 
    +01290   // nothing is found
    +01291   if ( pg_NumRows($Res) == 0 ) return null;
    +01292 
    +01293   // Fetch the data
    +01294   $f=pg_fetch_array($Res,0);
    +01295 
    +01296   // return the value
    +01297   return $f['fd_id'];
    +01298 
    +01299 }
    +
    +

    +

    @@ -1014,7 +1724,15 @@ string fiche_def.fd_label

    Definition at line 1038 of file fiche_inc.php.

    -References $Res, and ExecSql(). +References $Res, and ExecSql().

    01038                                       {
    +01039   $Res=ExecSql($p_cn,"select fd_label from fiche_def where fd_id=$p_id");
    +01040   if ( pg_NumRows($Res) == 0 ) return "Unknown";
    +01041   $st=pg_fetch_array($Res,0);
    +01042   return $st['fd_label'];
    +01043 }
    +
    +

    +

    @@ -1066,7 +1784,26 @@ Definition at line 1251<

    References $Res, $sql, ExecSql(), and frd_id.

    -Referenced by UpdateFiche(). +Referenced by UpdateFiche().

    01252 {
    +01253   // Sql stmt
    +01254   $sql="select frd_id from fiche_def join fiche using (fd_id) 
    +01255       where f_id=$p_f_id";
    +01256   // Execute it
    +01257   $Res=ExecSql($p_cn,$sql);
    +01258 
    +01259   // nothing is found
    +01260   if ( pg_NumRows($Res) == 0 ) return null;
    +01261 
    +01262   // Fetch the data
    +01263   $f=pg_fetch_array($Res,0);
    +01264 
    +01265   // return the value
    +01266   return $f['frd_id'];
    +01267 
    +01268 }
    +
    +

    +

    @@ -1123,7 +1860,54 @@ j_jrn journal_id

      Definition at line 1057 of file fiche_inc.php.

      -References $a, $i, $list, $Max, $Res, $sql, echo_error(), echo_warning(), ExecSql(), exit, and f_id. +References $a, $i, $list, $Max, $Res, $sql, echo_error(), echo_warning(), ExecSql(), exit, and f_id.

      01058 {
      +01059   $get="";
      +01060   if ( $p_type == 'deb' ) {
      +01061     $get='jrn_def_fiche_deb';
      +01062   }
      +01063   if ( $p_type == 'cred' ) {
      +01064     $get='jrn_def_fiche_cred';
      +01065   }
      +01066   if ( $get == "" ) {
      +01067     echo_error("Invalid p_type function GetFicheJrn($p_cn,$p_jrn,$p_type)");
      +01068     exit -1;
      +01069   }
      +01070   $Res=ExecSql($p_cn,"select $get as fiche from jrn_def where jrn_def_id=$p_jrn");
      +01071   $Max=pg_NumRows($Res);
      +01072   if ( $Max==0) {
      +01073     echo_warning("No rows");
      +01074     return null;
      +01075   }
      +01076   // Normally Max must be == 1
      +01077   $list=pg_fetch_array($Res,0);
      +01078   if ( $list['fiche']=="") {
      +01079     echo_warning("No fiche");
      +01080     return null;
      +01081   }
      +01082   
      +01083  $sql="select f_id,av_text as f_label 
      +01084         from fiche natural join jnt_fic_att_value
      +01085         natural join attr_def
      +01086         natural join attr_value
      +01087         natural join fiche_def
      +01088         where ad_id=1 and
      +01089            fd_id in (".$list['fiche'].")  order by f_label";
      +01090 
      +01091   $Res=ExecSql($p_cn,$sql);
      +01092   $Max=pg_NumRows($Res);
      +01093   if ($Max==0 ) return null;
      +01094   // Get The result and put it into an array
      +01095   for ($i=0;$i<$Max;$i++) {
      +01096     $line=pg_fetch_array($Res,$i);
      +01097     $f_id=$line['f_id'];
      +01098     $f_label=$line['f_label'];
      +01099     $a[$i]=array($f_id,$f_label);
      +01100   }
      +01101   return $a;
      +01102 }
      +
      +

      +

      @@ -1175,7 +1959,19 @@ Definition at line 988 References $Res, and ExecSql().

      -Referenced by FormAchView(), and FormVenteView(). +Referenced by FormAchView(), and FormVenteView().

      00988                                    {
      +00989   // Retrieve the attribute with the ad_id 1
      +00990   // 1 is always the name
      +00991 
      +00992   $Res=ExecSql($p_cn,"select vw_name from 
      +00993                         vw_fiche_attr where quick_code='$p_id'");
      +00994   if ( pg_NumRows($Res) == 0 ) return "Unknown";
      +00995   $st=pg_fetch_array($Res,0);
      +00996   return $st['vw_name'];
      +00997 }
      +
      +

      +

      @@ -1227,7 +2023,24 @@ Definition at line 1010<

      References $Res, and ExecSql().

      -Referenced by EncodeFiche(). +Referenced by EncodeFiche().

      01010                                        {
      +01011   // Retrieve the attribute with the ad_id 1
      +01012   // 1 is always the name
      +01013    $Res=ExecSql($p_cn,"select av_text from
      +01014                      attr_value
      +01015                      natural join jnt_fic_att_value
      +01016                      natural join fiche
      +01017                      where
      +01018                      f_id=$p_id and
      +01019                      ad_id=".ATTR_DEF_NAME);
      +01020 
      +01021   if ( pg_NumRows($Res) == 0 ) return "Unknown";
      +01022   $st=pg_fetch_array($Res,0);
      +01023   return $st['av_text'];
      +01024 }
      +
      +

      +

      @@ -1278,7 +2091,24 @@ Definition at line 462 References $l_line, $Max, $Res, $ret, echo_debug(), and ExecSql().

      -Referenced by AddFiche(). +Referenced by AddFiche().

      00462                                      {
      +00463   $Res=ExecSql($p_cn,"select max(pcm_val) as maxcode from tmp_pcmn where pcm_val_parent = $p_base");
      +00464  $Max=pg_NumRows($Res);
      +00465  echo_debug('fiche_inc.php',__LINE__,"$Max=pg_NumRows");
      +00466   $l_line=pg_fetch_array($Res,0);
      +00467   $ret=$l_line['maxcode'];
      +00468  if ( $ret == "" ) {
      +00469    $ret=sprintf("%d%04d",$p_base,0);
      +00470    return $ret+1;
      +00471 
      +00472  }
      +00473 
      +00474   echo_debug('fiche_inc.php',__LINE__,"ret $ret");
      +00475   return $ret+1;
      +00476 }
      +
      +

      +

      @@ -1329,7 +2159,18 @@ Definition at line 1450<

      References $a, CountSql(), and echo_debug().

      -Referenced by UpdateFiche(). +Referenced by UpdateFiche().

      01451 {
      +01452   $len=strlen($p_val)-1;
      +01453   for ($i=$len-1;$i>0;$i--) {
      +01454     $a=substr($p_val,0,$i);
      +01455     echo_debug ("parent == $a len =1");
      +01456     if (CountSql($p_cn,"select pcm_val from tmp_pcmn where pcm_val=$a") == 1)
      +01457       return $a;
      +01458   }
      +01459 }
      +
      +

      +

      @@ -1385,7 +2226,17 @@ InsertModeleLine

      Definition at line 1343 of file fiche_inc.php.

      -References $Res, $sql, and ExecSql(). +References $Res, $sql, and ExecSql().

      01344 {
      +01345   // Insert a new attribute for the model
      +01346   // it means insert a row in jnt_fic_attr
      +01347   $sql=sprintf("insert into jnt_fic_attr (fd_id,ad_id) values (%d,%d)", 
      +01348                $p_fid,$p_adid);
      +01349   $Res=ExecSql($p_cn,$sql);
      +01350                        
      +01351 }
      +
      +

      +

      @@ -1451,7 +2302,52 @@ Definition at line 1514<

      References $list, $Max, $Res, $sql, echo_warning(), and ExecSql().

      -Referenced by form_verify_input(). +Referenced by form_verify_input().

      01515 {
      +01516   $get="";
      +01517   if ( $p_type == 'deb' ) {
      +01518     $get='jrn_def_fiche_deb';
      +01519   }
      +01520   if ( $p_type == 'cred' ) {
      +01521     $get='jrn_def_fiche_cred';
      +01522   }
      +01523   if ( $get != "" ) {
      +01524     $Res=ExecSql($p_cn,"select $get as fiche from jrn_def where jrn_def_id=$p_jrn");
      +01525   } else {
      +01526     // Get all the fiche type (deb and cred)
      +01527     $Res=ExecSql($p_cn," select jrn_def_fiche_cred as fiche  
      +01528                          from jrn_def where jrn_def_id=$p_jrn
      +01529                         union
      +01530                          select jrn_def_fiche_deb 
      +01531                          from jrn_def where jrn_def_id=$p_jrn"
      +01532                  );
      +01533   }
      +01534   $Max=pg_NumRows($Res);
      +01535   if ( $Max==0) {
      +01536     echo_warning("No rows");
      +01537     return null;
      +01538   }
      +01539   // Normally Max must be == 1
      +01540   $list=pg_fetch_array($Res,0);
      +01541   if ( $list['fiche']=="") {
      +01542     echo_warning("No fiche");
      +01543     return null;
      +01544   }
      +01545   
      +01546  $sql="select *
      +01547         from vw_fiche_attr
      +01548         where  
      +01549            fd_id in (".$list['fiche'].") and quick_code='$p_fiche'"; 
      +01550 
      +01551   $Res=ExecSql($p_cn,$sql);
      +01552   $Max=pg_NumRows($Res);
      +01553   if ($Max==0 ) 
      +01554     return 0;
      +01555   else
      +01556     return 1;
      +01557 }
      +
      +

      +

      @@ -1500,7 +2396,46 @@ Remove

      Definition at line 938 of file fiche_inc.php.

      -References $Res, CountSql(), echo_error(), ExecSql(), FormatString(), GetClass(), GetCreateAccount(), GetFicheDef(), and isNumber(). +References $Res, CountSql(), echo_error(), ExecSql(), FormatString(), GetClass(), GetCreateAccount(), GetFicheDef(), and isNumber().

      00938                                 {
      +00939   if ( ! isset ($p_cn) ||
      +00940        ! isset ($p_fid) ) {
      +00941     echo_error ("Remove Missing Parameter p_cn = $p_cn p_fid=$p_fid");
      +00942     return;
      +00943   }
      +00944   // if the card has its own account in PCMN
      +00945   // Get the fiche_def.fd_id from fiche.f_id
      +00946   $fd_id=GetFicheDef($p_cn,$p_fid);
      +00947   if ( GetCreateAccount($p_cn,$fd_id) == 1 ) {
      +00948     // Retrieve the class 
      +00949     $class=GetClass($p_cn,$p_fid);
      +00950 
      +00951     // if class is not NULL and if we use it before, we can't remove it
      +00952     if (FormatString($class) != null && 
      +00953            CountSql($p_cn,"select * from jrnx where j_poste=$class") != 0 ) {
      +00954       echo "<SCRIPT> alert('Impossible ce poste est utilisé dans un journal'); </SCRIPT>";
      +00955       return;
      +00956     } else {
      +00957       // Remove in PCMN
      +00958       if ( trim(strlen($class)) != 0 and isNumber($class) == 1)
      +00959            ExecSql($p_cn,"delete from tmp_pcmn where pcm_val=".$class);
      +00960     }
      +00961 
      +00962   }
      +00963   // Remove from attr_value
      +00964   $Res=ExecSql($p_cn,"delete from attr_value 
      +00965                         where jft_id in (select jft_id 
      +00966                                           from jnt_fic_att_value 
      +00967                                                 natural join fiche where f_id=$p_fid)");
      +00968   // Remove from jnt_fic_att_value
      +00969   $Res=ExecSql($p_cn,"delete from jnt_fic_att_value where f_id=$p_fid");
      +00970   
      +00971   // Remove from fiche
      +00972   $Res=ExecSql($p_cn,"delete from fiche where f_id=$p_fid");
      +00973     
      +00974 }
      +
      +

      +

      @@ -1557,7 +2492,18 @@ the fiche_def.fd_id, id of the cat of the model

        Definition at line 1364 of file fiche_inc.php.

        -References $Res, $sql, and ExecSql(). +References $Res, $sql, and ExecSql().

        01365 {
        +01366   // Insert a new attribute for the model
        +01367   // it means insert a row in jnt_fic_attr
        +01368   $sql=sprintf("update   fiche_def set fd_label='%s' where 
        +01369                   fd_id=%d", 
        +01370                $p_label,$p_fid);
        +01371   $Res=ExecSql($p_cn,$sql);
        +01372                        
        +01373 }
        +
        +

        +

        @@ -1606,7 +2552,131 @@ p_array gen :

          Definition at line 530 of file fiche_inc.php.

          -References $a, $label, $Res, $sql, CountSql(), echo_debug(), echo_error(), ExecSql(), FormatString(), GetFicheDefRef(), GetParent(), and label. +References $a, $label, $Res, $sql, CountSql(), echo_debug(), echo_error(), ExecSql(), FormatString(), GetFicheDefRef(), GetParent(), and label.

          00530                                      {
          +00531 
          +00532   echo_debug ('fiche_inc.php',__LINE__,"UpdateFiche");
          +00533   $tva_error=false;
          +00534   foreach ( $p_array as $key=> $element) {
          +00535     echo_debug('fiche_inc.php',__LINE__,"UF  $key => $element");
          +00536     ${"$key"}=$element;
          +00537     // Get the name
          +00538     if ( $key == "ad_id".ATTR_DEF_NAME ) {
          +00539       $label=$element;
          +00540       if (strlen(trim($label))== 0  ) 
          +00541         return;
          +00542     }
          +00543     // Get the class base
          +00544     if ( $key=="ad_id".ATTR_DEF_ACCOUNT) {
          +00545       $class=$element;
          +00546     }
          +00547     // Get the vat and
          +00548     // test the vat rate
          +00549     if ( $key == 'ad_id'.ATTR_DEF_TVA ) {
          +00550       // is a valid rate ?
          +00551       if ( strlen(trim($element)) == 0 ) continue;
          +00552       if ( CountSql($p_cn,"select * from tva_rate where tva_id='".$element."'") == 0 ) {
          +00553         // warning
          +00554         echo_error('invalid rate') ;
          +00555         echo '<script>
          +00556                 alert("Attention tva invalid remis à sa valeur par défaut ");
          +00557               </script>';
          +00558         $tva_error=true;
          +00559       }
          +00560     }
          +00561   }
          +00562   // If each card has it own account must also update the tmp_pcm table
          +00563   //
          +00564   $fd_ref=GetFicheDefRef($p_cn,$fiche);
          +00565   // Update all the others data
          +00566   for ( $i =0 ; $i < $max ; $i++) {
          +00567     // Format text
          +00568     $text=FormatString( ${"av_text$i"});
          +00569     // Check if we don't try to update a QUICK CODE
          +00570     $Res=ExecSql($p_cn,"select ad_id from jnt_fic_att_value where jft_id=".${"jft_id$i"});
          +00571     $a=pg_fetch_array($Res,0);
          +00572     if ( $a['ad_id'] != ATTR_DEF_QUICKCODE) 
          +00573       {
          +00574         $sql=sprintf("update attr_value set av_text='%s' where jft_id=%d",
          +00575                      $text,
          +00576                      ${"jft_id$i"});
          +00577       }
          +00578     else
          +00579       {
          +00580         $sql=sprintf("select update_quick_code(%d,'%s')",
          +00581                      ${"jft_id$i"},
          +00582                      $text);
          +00583       }
          +00584     // Execute SQL
          +00585     $Res=ExecSql($p_cn,$sql);
          +00586   }
          +00587     // Update tva to his default value
          +00588   if ( $tva_error == true ) { 
          +00589     $sql="update attr_value set av_text=1 where jft_id = ( select jft_id from jnt_fic_att_value 
          +00590                     natural join fiche natural join attr_def 
          +00591                  where ad_id=".ATTR_DEF_TVA." and f_id=$fiche)";
          +00592     $Res=ExecSql($p_cn,$sql);
          +00593   } 
          +00594 
          +00595   // Update the PCMN if needed
          +00596   $sql="select av_text from attr_value natural join jnt_fic_att_value
          +00597         where f_id=$fiche and ad_id=".ATTR_DEF_ACCOUNT;
          +00598   $Res=ExecSql($p_cn,$sql);
          +00599 
          +00600   if ( pg_NumRows($Res) != 0 ) {
          +00601     // it means that a account exists
          +00602     // Retrieve the name and the ad_id 5
          +00603     $f=pg_fetch_array($Res,0);
          +00604     $class_old=$f['av_text'];
          +00605 
          +00606     // if the class changed
          +00607     if ( $class != $class_old and $class != "" ) {
          +00608       if ( CountSql($p_cn,"select * from jrnx where j_poste=$class") or 
          +00609            CountSql($p_cn,"select * from jrnx where j_poste=$class_old" ))
          +00610       {
          +00611         // No change if the account is already used 
          +00612         echo_error("Not possible to change the account, already used");
          +00613       } else {
          +00614         if ( CountSql($p_cn,"select * from tmp_pcmn where pcm_val=".$class) ==0)
          +00615           // we have to insert 
          +00616           {
          +00617             // First we must use a parent
          +00618             $parent=GetParent($p_cn,$class);
          +00619             $Res=ExecSql($p_cn,
          +00620                          "insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) 
          +00621                          values ($class,'$f_label',$parent)");
          +00622           }
          +00623       }
          +00624         $class=$class_old;
          +00625     } else // $class=""
          +00626       {
          +00627 
          +00628         echo_debug('fiche_inc.php',__LINE__,"new account ");
          +00629         $class=$class_old;
          +00630         if ( CountSql($p_cn,"select * from tmp_pcmn where pcm_val=".$class) == 0 ) {
          +00631           // First we must use a parent
          +00632           $parent=GetParent($p_cn,$class);
          +00633           $Res=ExecSql($p_cn,
          +00634                        "insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) 
          +00635                          values ($class,'$f_label',$parent)");
          +00636         }
          +00637       }
          +00638     
          +00639 
          +00640     // Change the name in TMP_PCMN
          +00641     // Get the new name
          +00642     $f_label=FormatString($f_label);
          +00643     ExecSql($p_cn,"update tmp_pcmn set pcm_lib='".$f_label."' where pcm_val=".$class);
          +00644 
          +00645 
          +00646   }
          +00647   // Update of TMP_PCMN if a class base is given (ad_id=5)
          +00648 
          +00649 
          +00650 
          +00651 }
          +
          +

          +

          @@ -1655,7 +2725,21 @@ p_fiche fichedef(f_id) gen :

            Definition at line 869 of file fiche_inc.php.

            -References $array, DisplayDetailModele(), echo_debug(), echo_error(), and GetDataModele(). +References $array, DisplayDetailModele(), echo_debug(), echo_error(), and GetDataModele().

            00869                                       {
            +00870 
            +00871   $array=GetDataModele($p_cn,$p_fiche);
            +00872   if ($array==null) {
            +00873     echo_error ("fiche_inc:UpdateModele Fiche non trouvée");
            +00874     return;
            +00875   }
            +00876   echo '<H2 class="info">'.getFicheDefName($p_cn,$p_fiche).'</H2>';
            +00877   foreach ( $array as $key=>$element) echo_debug('fiche_inc.php',__LINE__,"$key => $element");
            +00878   DisplayDetailModele($p_cn,$array,$array['ligne']);
            +00879 
            +00880 }
            +
            +

            +

            @@ -1704,7 +2788,63 @@ $p_type fiche_def.fd_id catg of card gen :

              Definition at line 394 of file fiche_inc.php.

              -References $_SESSION, $bar, $l_line, $Max, $offset, $page, $Res, $sql_limit, $sql_offset, $step, CountSql(), ExecSql(), jrn_navigation_bar(), METHOD, name, table, and value. +References $_SESSION, $bar, $l_line, $Max, $offset, $page, $Res, $sql_limit, $sql_offset, $step, CountSql(), ExecSql(), jrn_navigation_bar(), METHOD, name, table, and value.

              00394                                   {
              +00395   require_once("user_common.php");
              +00396   echo '<H2 class="info">'.getFicheDefName($p_cn,$p_type).'</H2>';
              +00397 
              +00398    $step=$_SESSION['g_pagesize'];
              +00399    $sql_limit="";
              +00400    $sql_offset="";
              +00401    if ( $step != -1 ) {
              +00402      $page=(isset($_GET['page']))?$_GET['page']:1;
              +00403      $offset=(isset($_GET['offset']))?$_GET['offset']:0;
              +00404      $max_line=CountSql($p_cn,"select f_id,av_text  from 
              +00405                           fiche join jnt_fic_att_value using (f_id) 
              +00406                                 join attr_value using (jft_id)
              +00407                        where fd_id='".$p_type."' and ad_id=".ATTR_DEF_NAME." order by f_id");
              +00408      $sql_limit=" limit ".$step;
              +00409      $sql_offset=" offset ".$offset;
              +00410      $bar=jrn_navigation_bar($offset,$max_line,$step,$page);
              +00411    }
              +00412    
              +00413   // Get all name the cards of the select category
              +00414   // 1 for attr_def.ad_id is always the name
              +00415     $Res=ExecSql($p_cn,"select f_id,av_text,j_qcode  from 
              +00416                           fiche join jnt_fic_att_value using (f_id) 
              +00417                                 join attr_value using (jft_id)
              +00418                                 left outer join vw_poste_qcode using(f_id)
              +00419                        where fd_id='".$p_type.
              +00420                        "' and ad_id=".ATTR_DEF_NAME." order by f_id $sql_offset $sql_limit ");
              +00421     $Max=pg_NumRows($Res);
              +00422     echo $bar;
              +00423 
              +00424     echo '<table>';
              +00425     for ( $i = 0; $i < $Max; $i++) {
              +00426       $l_line=pg_fetch_array($Res,$i);
              +00427       if ( $i%2 == 0) 
              +00428         echo '<TR class="odd">';
              +00429       else
              +00430         echo '<TR class="even">';
              +00431 
              +00432       $span_mod='<TD><A href="fiche.php?action=detail&fiche_id='.$l_line['f_id'].'">'.$l_line['j_qcode'].'</A></TD>';
              +00433       $span_del='<TD>'.
              +00434         '<A  href="fiche.php?f_fd_id='.$p_type.'&action=delete&fiche_id='.$l_line['f_id'].
              +00435         '"> delete</A></td>';
              +00436 
              +00437       echo $span_del.$span_mod.'<TD>'.$l_line['av_text']."</TD>";
              +00438       echo '</tr>';
              +00439     }
              +00440     echo '</table>';
              +00441     echo '<FORM METHOD="POST" action="fiche.php">';
              +00442     echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
              +00443     echo '<INPUT TYPE="SUBMIT" name="add" Value="Ajout fiche">';
              +00444     echo '</FORM>';
              +00445     echo $bar;
              +00446 
              +00447 }
              +
              +

              +

              @@ -1753,10 +2893,35 @@ id de la fiche fiche(f_id) gen :

                Definition at line 492 of file fiche_inc.php.

                -References $Res, $sql, EncodeFiche(), ExecSql(), and GetFicheDef(). +References $Res, $sql, EncodeFiche(), ExecSql(), and GetFicheDef().

                00492                                       {
                +00493   
                +00494   // Retrieve the fiche_def.fd_id of the card
                +00495   $fd_id=GetFicheDef($p_cn,$p_id);
                +00496 
                +00497   //Update the default attribute of a card if is model has changed
                +00498   $sql="insert into jnt_fic_att_value (f_id,ad_id) 
                +00499         select $p_id, ad_id 
                +00500               from jnt_fic_attr 
                +00501         where fd_id=$fd_id and 
                +00502         ad_id not in (select ad_id from jnt_fic_att_value where
                +00503         f_id=$p_id)";
                +00504 
                +00505  $Res=ExecSql($p_cn,$sql);
                +00506 
                +00507  // add a empty string to attr_value
                +00508  $sql="insert into attr_value select jft_id,'' from jnt_fic_att_value
                +00509          where f_id=$p_id and jft_id not in (select jft_id from attr_value natural join jnt_fic_att_value where 
                +00510          f_id = $p_id)"; 
                +00511  $Res=ExecSql($p_cn,$sql);
                +00512 
                +00513   EncodeFiche ($p_cn,$p_id,1);
                +00514 }
                +
                +

                + -


                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/fiche__new_8php-source.html b/doc/developper/html/fiche__new_8php-source.html index cd111971b..d7edf39f5 100644 --- a/doc/developper/html/fiche__new_8php-source.html +++ b/doc/developper/html/fiche__new_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_new.php Source File +phpcompta: fiche_new.php Source File +html

                fiche_new.php

                Go to the documentation of this file.
                00001 <?
                 00002 /*
                 00003  *   This file is part of PHPCOMPTA
                @@ -66,7 +66,7 @@
                 00061   $ch_col="</TD><TD>";
                 00062   $ch_li='</TR><TR>';
                 00063   $r='<FORM action="fiche_new.php" method="post">';
                -00064   $r.='<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
                +00064   $r.='<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
                 00065   $l_sessid=(isset ($_POST["PHPSESSID"]))?$_POST["PHPSESSID"]:$_GET["PHPSESSID"];
                 00066 
                 00067   $r.=JS_SHOW_TVA;
                @@ -83,12 +83,12 @@
                 00078     $Res=ExecSql($p_cn,$sql);
                 00079     $Max=pg_NumRows($Res);
                 00080     // Put the card modele id (fiche_def.fd_id)
                -00081     $r.='<INPUT TYPE="HIDDEN" name="fd_id" value="'.$p_type.'">';
                +00081     $r.='<INPUT TYPE="HIDDEN" name="fd_id" value="'.$p_type.'">';
                 00082     for ($i=0;$i < $Max;$i++) {
                 00083       $l_line=pg_fetch_array($Res,$i);
                 00084 
                 00085       // The number of the attribute
                -00086       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="ad_id%d" value="%s">',
                +00086       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="ad_id%d" value="%s">',
                 00087                    $i,$l_line['ad_id']);
                 00088 
                 00089       $but_search_poste="";
                @@ -105,8 +105,8 @@
                 00100               $l_line['ad_text'], $i,$Hid,$but_search_poste);
                 00101    }  
                 00102     $r.="</TABLE>";
                -00103     $r.='<INPUT TYPE="SUBMIT" name="add_fiche" value="Mis à jour">';
                -00104     $r.= '<INPUT TYPE="HIDDEN" name="inc" value="'.$Max.'">';
                +00103     $r.='<INPUT TYPE="SUBMIT" name="add_fiche" value="Mis à jour">';
                +00104     $r.= '<INPUT TYPE="HIDDEN" name="inc" value="'.$Max.'">';
                 00105     $r.='</FORM>';
                 00106     return $r;
                 00107 }
                @@ -192,15 +192,15 @@
                 00187     echo "Choix catégories fiche";
                 00188     echo '<FORM METHOD="POST" ACTION="'.$_SERVER['REQUEST_URI'].'">';
                 00189     foreach ($a as $element) {
                -00190       printf('<INPUT TYPE="RADIO" NAME="cat" value="%s">%s<br>',
                +00190       printf('<INPUT TYPE="RADIO" NAME="cat" value="%s">%s<br>',
                 00191              $element,GetFicheDefName($cn,$element));
                 00192     
                 00193   }
                -00194     echo '<INPUT TYPE="SUBMIT" value="Choisir">';
                +00194     echo '<INPUT TYPE="SUBMIT" value="Choisir">';
                 00195     echo "<FORM>";
                 00196   }
                 00197 ?>
                -

                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/fiche__new_8php.html b/doc/developper/html/fiche__new_8php.html index f6ad0f705..4fd3ae4c4 100644 --- a/doc/developper/html/fiche__new_8php.html +++ b/doc/developper/html/fiche__new_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_new.php File Reference +phpcompta: fiche_new.php File Reference +html

                fiche_new.php File Reference

                Create a new card in a popup window. More...

                @@ -78,7 +78,57 @@ Definition in file fiche_new.ph

                Definition at line 60 of file fiche_new.php.

                -References $l_line, $Max, $r, $Res, $sql, echo_debug(), ExecSql(), name, and value. +References $l_line, $Max, $r, $Res, $sql, echo_debug(), ExecSql(), name, and value.

                00060                                   {
                +00061   $ch_col="</TD><TD>";
                +00062   $ch_li='</TR><TR>';
                +00063   $r='<FORM action="fiche_new.php" method="post">';
                +00064   $r.='<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
                +00065   $l_sessid=(isset ($_POST["PHPSESSID"]))?$_POST["PHPSESSID"]:$_GET["PHPSESSID"];
                +00066 
                +00067   $r.=JS_SHOW_TVA;
                +00068   $r.=JS_SEARCH_POSTE;
                +00069   $r.="<TABLE>";
                +00070   echo '<H2 class="info">New </H2>';
                +00071   $p_f_id="";
                +00072   echo_debug('fiche_new.php',__LINE__,"Array is null");
                +00073   // Find all the attribute of the existing cards
                +00074   // --> Get_attr_def 
                +00075     $sql="select frd_id,ad_id,ad_text from  fiche_def join jnt_fic_attr using (fd_id)
                +00076            join attr_def using (ad_id) where fd_id=".$p_type." order by ad_id";
                +00077 
                +00078     $Res=ExecSql($p_cn,$sql);
                +00079     $Max=pg_NumRows($Res);
                +00080     // Put the card modele id (fiche_def.fd_id)
                +00081     $r.='<INPUT TYPE="HIDDEN" name="fd_id" value="'.$p_type.'">';
                +00082     for ($i=0;$i < $Max;$i++) {
                +00083       $l_line=pg_fetch_array($Res,$i);
                +00084 
                +00085       // The number of the attribute
                +00086       $Hid=sprintf('<INPUT TYPE="HIDDEN" name="ad_id%d" value="%s">',
                +00087                    $i,$l_line['ad_id']);
                +00088 
                +00089       $but_search_poste="";
                +00090       // Javascript for searching the account
                +00091       if ( $l_line ['ad_id'] == ATTR_DEF_ACCOUNT ) {
                +00092         $but_search_poste='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$l_sessid.'\',\'av_text'.$i.'\')">';
                +00093       } 
                +00094       // Javascript for showing the tva
                +00095       if ( $l_line ['ad_id'] == ATTR_DEF_TVA ) {
                +00096         $but_search_poste='<INPUT TYPE="BUTTON" VALUE="Montre" OnClick="ShowTva(\''.$l_sessid.'\',\'av_text'.$i.'\')">';
                +00097       }
                +00098       // content of the attribute
                +00099       $r.= sprintf('<TR><TD> %s </TD><TD><INPUT TYPE="TEXT" NAME="av_text%d">%s %s</TD></TR>',
                +00100               $l_line['ad_text'], $i,$Hid,$but_search_poste);
                +00101    }  
                +00102     $r.="</TABLE>";
                +00103     $r.='<INPUT TYPE="SUBMIT" name="add_fiche" value="Mis à jour">';
                +00104     $r.= '<INPUT TYPE="HIDDEN" name="inc" value="'.$Max.'">';
                +00105     $r.='</FORM>';
                +00106     return $r;
                +00107 }
                +
                +

                +


                Variable Documentation

                @@ -286,7 +336,7 @@ Definition at line 31116 of file fiche_new.php. -
                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/fiche__search_8php-source.html b/doc/developper/html/fiche__search_8php-source.html index f35444354..9b5eb6779 100644 --- a/doc/developper/html/fiche__search_8php-source.html +++ b/doc/developper/html/fiche__search_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_search.php Source File +phpcompta: fiche_search.php Source File +html

                fiche_search.php

                Go to the documentation of this file.
                00001 <?
                 00002 /*
                 00003  *   This file is part of PhpCompta.
                @@ -84,8 +84,8 @@
                 00079 }
                 00080 ?>
                 00081 <script language="javascript">
                -00082 function SetData (name_ctl,value,value_2,value_3,value_4,value_5,value_6) {
                -00083   self.opener.SetData(name_ctl,value,value_2,value_3,value_4,value_5,value_6);
                +00082 function SetData (name_ctl,value,value_2,value_3,value_4,value_5,value_6) {
                +00083   self.opener.SetData(name_ctl,value,value_2,value_3,value_4,value_5,value_6);
                 00084   window.close();
                 00085 }
                 00086 </script>
                @@ -103,7 +103,7 @@
                 00098 
                 00099 $r.="<FORM METHOD=\"POST\" ACTION=\"".$_SERVER['REQUEST_URI']."\">";
                 00100 $r.="Recherche : ".'<INPUT TYPE="TEXT" NAME="fic_search" VALUE="'.$e_fic_search.'">';
                -00101 $r.='<INPUT TYPE="submit" name="search" value="Go">';
                +00101 $r.='<INPUT TYPE="submit" name="search" value="Go">';
                 00102 //$r.="</FORM>";
                 00103 $r.="<div>";
                 00104 echo $r;
                @@ -162,7 +162,7 @@
                 00160     $class="odd";
                 00161   $text=FormatString($row['vw_name']);
                 00162   $r.="<span class=\"$class\">";
                -00163   $r.=sprintf ('<input name="%s" type="button" onClick="'."SetData('%s','%s','%s','%s','%s','%s','%s')".'" value="%s">',
                +00163   $r.=sprintf ('<input name="%s" type="button" onClick="'."SetData('%s','%s','%s','%s','%s','%s','%s')".'" value="%s">',
                 00164         "select" . $i,
                 00165               $e_name,
                 00166               $row['quick_code'] ,
                @@ -189,7 +189,7 @@
                 00187 
                 00188 html_page_stop();
                 00189 ?>
                -

                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/fiche__search_8php.html b/doc/developper/html/fiche__search_8php.html index 87b2ad762..4991bcc2e 100644 --- a/doc/developper/html/fiche__search_8php.html +++ b/doc/developper/html/fiche__search_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_search.php File Reference +phpcompta: fiche_search.php File Reference +html

                fiche_search.php File Reference

                Search a card in a popup window. More...

                @@ -264,7 +264,7 @@ Definition at line 11 Definition at line 32 of file fiche_search.php. -


                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/files.html b/doc/developper/html/files.html index 781c6bafb..ad3afb798 100644 --- a/doc/developper/html/files.html +++ b/doc/developper/html/files.html @@ -6,144 +6,142 @@

                phpcompta File List

                Here is a list of all files with brief descriptions: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                /home/dany/developpement/phpcompta-dev/phpcompta/html/admin_repo.php [code]Administration of the repository : creation of user, folder, security, templates... Accessible only by the administrator
                /home/dany/developpement/phpcompta-dev/phpcompta/html/annulation.php [code]In a popup window manage the deletion of the operations
                /home/dany/developpement/phpcompta-dev/phpcompta/html/bal_csv.php [code]Return the balance in CSV format
                /home/dany/developpement/phpcompta-dev/phpcompta/html/bilan.php [code]Send a Bilan in RTF format
                /home/dany/developpement/phpcompta-dev/phpcompta/html/central.php [code]Concerns the centralisation of the operations
                /home/dany/developpement/phpcompta-dev/phpcompta/html/commercial.php [code]Base of the module "Gestion", the p_action indicates what file must included and this file will manage the request (customer, supplier, contact,...)
                /home/dany/developpement/phpcompta-dev/phpcompta/html/ecrit_ouv.php [code]For reporting the saldo of account to the next year
                /home/dany/developpement/phpcompta-dev/phpcompta/html/export_ouv.php [code]Send the final balance in CSV this balance is used to open an exercice
                /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche.php [code]Module to manage the card (removing, listing, creating, modify attribut)
                /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_csv.php [code]Send a CSV file with card
                /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_new.php [code]Create a new card in a popup window
                /home/dany/developpement/phpcompta-dev/phpcompta/html/fiche_search.php [code]Search a card in a popup window
                /home/dany/developpement/phpcompta-dev/phpcompta/html/form.php [code]Handle your own report: create or view report
                /home/dany/developpement/phpcompta-dev/phpcompta/html/form_csv.php [code]Send a report in CSV format
                /home/dany/developpement/phpcompta-dev/phpcompta/html/form_pdf.php [code]Send a report in PDF
                /home/dany/developpement/phpcompta-dev/phpcompta/html/import.php [code]For importing Bank operations
                /home/dany/developpement/phpcompta-dev/phpcompta/html/index.php [code]Default page where user access
                /home/dany/developpement/phpcompta-dev/phpcompta/html/info.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_add.php [code]To add a ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_csv.php [code]Send a ledger in CSV format
                /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_detail.php [code]Show and let modify ledger parameter
                /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_op_detail.php [code]Show the detail of a operation in a popup windows
                /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_pdf.php [code]Send a ledger in a pdf format
                /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_search.php [code]Search a operation from a ledger into a popup window, used for the "rapprochement"
                /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_update.php [code]Create, modify parameter ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/html/line_update.php [code]Modify the "Plan Comptable"
                /home/dany/developpement/phpcompta-dev/phpcompta/html/listing_client.php [code]Electronic declaration for VAT BELGIUM --> experimental
                /home/dany/developpement/phpcompta-dev/phpcompta/html/login.php [code]Login page
                /home/dany/developpement/phpcompta-dev/phpcompta/html/logout.php [code]Logout
                /home/dany/developpement/phpcompta-dev/phpcompta/html/modify_op.php [code]Update a operation in a popup window : add a document
                /home/dany/developpement/phpcompta-dev/phpcompta/html/not_implemented.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/parametre.php [code]Parametre module
                /home/dany/developpement/phpcompta-dev/phpcompta/html/pcmn_update.php [code]Concerns the management of the "Plan Comptable"
                /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_csv.php [code]Send the poste list in csv
                /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_pdf.php [code]Send the account list in PDF
                /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_search.php [code]Search a account in a popup window
                /home/dany/developpement/phpcompta-dev/phpcompta/html/print_balance.php [code]Print the balance in pdf format
                /home/dany/developpement/phpcompta-dev/phpcompta/html/priv_user.php [code]Users Security
                /home/dany/developpement/phpcompta-dev/phpcompta/html/recherche.php [code]Search module
                /home/dany/developpement/phpcompta-dev/phpcompta/html/sec_pdf.php [code]Print the user security in pdf
                /home/dany/developpement/phpcompta-dev/phpcompta/html/send_jrn_pdf.php [code]Print the ledger in pdf
                /home/dany/developpement/phpcompta-dev/phpcompta/html/send_poste_pdf.php [code]Print the account in pdf
                /home/dany/developpement/phpcompta-dev/phpcompta/html/show_document.php [code]Retrieve a document
                /home/dany/developpement/phpcompta-dev/phpcompta/html/show_document_modele.php [code]Send the document template
                /home/dany/developpement/phpcompta-dev/phpcompta/html/show_fiche.php [code]This file show in a popup window the detail a of card in read only mode the parameter are q (for qcode) & PHPSESSID
                /home/dany/developpement/phpcompta-dev/phpcompta/html/show_pj.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/show_tva.php [code]Popup window to let the user choose the vat
                /home/dany/developpement/phpcompta-dev/phpcompta/html/stock.php [code]Manage the stock by year
                /home/dany/developpement/phpcompta-dev/phpcompta/html/test.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/test_smarty.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/user_advanced.php [code]Obsolete
                /home/dany/developpement/phpcompta-dev/phpcompta/html/user_compta.php [code]Main page of the accountancy module
                /home/dany/developpement/phpcompta-dev/phpcompta/html/user_impress.php [code]Main page for the printing
                /home/dany/developpement/phpcompta-dev/phpcompta/html/user_jrn.php [code]Main page for encoding in the ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/html/user_login.php [code]Welcome page where the folder and module are choosen
                /home/dany/developpement/phpcompta-dev/phpcompta/html/user_pref.php [code]Page for the personal preference (theme, password,...)
                /home/dany/developpement/phpcompta-dev/phpcompta/html/user_sec.php [code]Set the security for an user
                /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/class.ezpdf.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/class.pdf.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/readme.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/html/admin/setup.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/ac_common.php [code]Common utilities for a lot of procedure, classe
                /home/dany/developpement/phpcompta-dev/phpcompta/include/action.inc.php [code]Page who manage the different action (meeting, letter)
                /home/dany/developpement/phpcompta-dev/phpcompta/include/admin.inc.php [code]Called from the module "Gestion" to manage the customer
                /home/dany/developpement/phpcompta-dev/phpcompta/include/balance.php [code]Show the balance and let you print it or export to PDF file included by user_impress
                /home/dany/developpement/phpcompta-dev/phpcompta/include/bank.inc.php [code]Purpose off this file encode expense and to record them
                /home/dany/developpement/phpcompta-dev/phpcompta/include/cbc_be.inc.php [code]This file must be included to parse the CVS from the CBC Bank
                /home/dany/developpement/phpcompta-dev/phpcompta/include/central_inc.php [code]Concerns the centralization operations
                /home/dany/developpement/phpcompta-dev/phpcompta/include/check_priv.php [code]Tools for checking the security
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_action.php [code]Class_action for manipulating actions action can be :
                  +
                ac_common.php [code]Common utilities for a lot of procedure, classe
                action.inc.php [code]Page who manage the different action (meeting, letter)
                admin.inc.php [code]Called from the module "Gestion" to manage the customer
                admin_repo.php [code]Administration of the repository : creation of user, folder, security, templates... Accessible only by the administrator
                annulation.php [code]In a popup window manage the deletion of the operations
                bal_csv.php [code]Return the balance in CSV format
                balance.php [code]Show the balance and let you print it or export to PDF file included by user_impress
                bank.inc.php [code]Purpose off this file encode expense and to record them
                bilan.php [code]Send a Bilan in RTF format
                cbc_be.inc.php [code]This file must be included to parse the CVS from the CBC Bank
                central.php [code]Concerns the centralisation of the operations
                central_inc.php [code]Concerns the centralization operations
                check_priv.php [code]Tools for checking the security
                class.ezpdf.php [code]
                class.pdf.php [code]
                class_action.php [code]Class_action for manipulating actions action can be :
                • an invoice
                • a meeting
                • an order
                • a letter
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_admin.php [code]Derived from class fiche Administration are a specific kind of card concerned only by official (or not) administration
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_attribut.php [code]Manage the attribut of the card
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_balance.php [code]Class for manipulating data to print the balance of account
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_contact.php [code]Class for the contact, contact are derived from ficheContact are a card which are own by a another card (customer, supplier...)
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_customer.php [code]Derived from class fiche Customer are a specific kind of card
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document.php [code]Class Document corresponds to the table document
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document_modele.php [code]Class for the document template
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_document_type.php [code]Class for the table document_type
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_fiche.php [code]Define Class fiche and fiche def, those class are using class attribut
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_fiche_def.php [code]Fiche_def_ref, a fiche is owned by fiche_def which is owned by fiche_def_ref
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_jrn.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_own.php [code]Class to manage the company parameter (address, name...)
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_parm_code.php [code]Manage the table parm_code which contains the custom parameter for the module accountancy
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_poste.php [code]Manage the account
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_rapport.php [code]Create, view, modify and parse report
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_supplier.php [code]Derived from class fiche Supplier are a specific kind of card
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_user.php [code]Data & function about connected users
                /home/dany/developpement/phpcompta-dev/phpcompta/include/class_widget.php [code]This class is used to create all the HTML INPUT TYPE
                /home/dany/developpement/phpcompta-dev/phpcompta/include/client.inc.php [code]Called from the module "Gestion" to manage the customer
                /home/dany/developpement/phpcompta-dev/phpcompta/include/constant.php [code]Contains all the variable + the javascript and some parameter
                /home/dany/developpement/phpcompta-dev/phpcompta/include/contact.inc.php [code]File for adding contact, contact is a kind of fichethe contact class is derived from the class fiche the contact is in fact a card but more specific This file is included from the module "Gestion"
                /home/dany/developpement/phpcompta-dev/phpcompta/include/debug.php [code]Debug procedure
                /home/dany/developpement/phpcompta-dev/phpcompta/include/decla.BE.inc.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/depense.inc.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/document_modele.inc.php [code]Manage the document template
                /home/dany/developpement/phpcompta-dev/phpcompta/include/error.php [code]Obsolete ?
                /home/dany/developpement/phpcompta-dev/phpcompta/include/eub_be.inc.php [code]File included to parse CSV from EUB Bank
                /home/dany/developpement/phpcompta-dev/phpcompta/include/facture.inc.php [code]Purpose off this file is to create invoices, to record them and to generate them, and of course to save them into the database
                /home/dany/developpement/phpcompta-dev/phpcompta/include/facture_inc.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/fiche_def.inc.php [code]Let customise the fiche_def_ref for the user
                /home/dany/developpement/phpcompta-dev/phpcompta/include/fiche_inc.php [code]Function for managing card, redundant with the class fiche
                /home/dany/developpement/phpcompta-dev/phpcompta/include/form_inc.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/fortis_be.inc.php [code]File to include : parse the CSV file from fortis Bank Belgium
                /home/dany/developpement/phpcompta-dev/phpcompta/include/import_inc.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_bilan.php [code]Form who call the printing of the bilan in RTF file included by user_impress
                /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_fiche.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_inc.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_jrn.php [code]Ask for Printing the ledger (pdf,html)
                /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_listing_client.php [code]Print the listing of customer for vat
                /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_poste.php [code]Print account (html or pdf) file included from user_impress
                /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_rapport.php [code]Print first the report in html and propose to print it in pdf file included by user_impress
                /home/dany/developpement/phpcompta-dev/phpcompta/include/ing_be.inc.php [code]File to be included to parse CSV from ING Belgium
                /home/dany/developpement/phpcompta-dev/phpcompta/include/jrn.php [code]Work with the ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/include/periode.inc.php [code]Still used ?
                /home/dany/developpement/phpcompta-dev/phpcompta/include/poste.inc.php [code]P_action contains the main action (always poste here) action contains the sub action
                /home/dany/developpement/phpcompta-dev/phpcompta/include/poste.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/postgres.php [code]Contains the procedure for connecting to postgresql
                /home/dany/developpement/phpcompta-dev/phpcompta/include/pref.inc.php [code]
                /home/dany/developpement/phpcompta-dev/phpcompta/include/preference.php [code]Include file for the periode form, currency,..
                /home/dany/developpement/phpcompta-dev/phpcompta/include/stock_inc.php [code]Function for managing the stock
                /home/dany/developpement/phpcompta-dev/phpcompta/include/supplier.inc.php [code]Called from the module "Gestion" to manage the customer
                /home/dany/developpement/phpcompta-dev/phpcompta/include/tva.inc.php [code]Included file for customizing with the vat (account,rate...)
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ach.php [code]Included file for the ledger of expenses
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_fin.php [code]Included file for the financial ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_gl.php [code]Included file for the great ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ods.php [code]Included file for the miscellaneous operation ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ven.php [code]Manage the ledger of type VEN
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_common.php [code]Common functions
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ach.php [code]Functions for the ledger of expenses
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_fin.php [code]Functions for the financial ledger
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ods.php [code]Functions for the ledger of misc. operation
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ven.php [code]Functions for the ledger of sold
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_menu.php [code]Nearly all the menu are here, some of them returns a HTML string, others echo directly the result
                /home/dany/developpement/phpcompta-dev/phpcompta/include/user_update.php [code]Check if still used
                class_admin.php [code]Derived from class fiche Administration are a specific kind of card concerned only by official (or not) administration
                class_attribut.php [code]Manage the attribut of the card
                class_balance.php [code]Class for manipulating data to print the balance of account
                class_contact.php [code]Class for the contact, contact are derived from ficheContact are a card which are own by a another card (customer, supplier...)
                class_customer.php [code]Derived from class fiche Customer are a specific kind of card
                class_document.php [code]Class Document corresponds to the table document
                class_document_modele.php [code]Class for the document template
                class_document_type.php [code]Class for the table document_type
                class_fiche.php [code]Define Class fiche and fiche def, those class are using class attribut
                class_fiche_def.php [code]Fiche_def_ref, a fiche is owned by fiche_def which is owned by fiche_def_ref
                class_jrn.php [code]
                class_own.php [code]Class to manage the company parameter (address, name...)
                class_parm_code.php [code]Manage the table parm_code which contains the custom parameter for the module accountancy
                class_poste.php [code]Manage the account
                class_rapport.php [code]Create, view, modify and parse report
                class_supplier.php [code]Derived from class fiche Supplier are a specific kind of card
                class_user.php [code]Data & function about connected users
                class_widget.php [code]This class is used to create all the HTML INPUT TYPE
                client.inc.php [code]Called from the module "Gestion" to manage the customer
                commercial.php [code]Base of the module "Gestion", the p_action indicates what file must included and this file will manage the request (customer, supplier, contact,...)
                constant.php [code]Contains all the variable + the javascript and some parameter
                contact.inc.php [code]File for adding contact, contact is a kind of fichethe contact class is derived from the class fiche the contact is in fact a card but more specific This file is included from the module "Gestion"
                debug.php [code]Debug procedure
                decla.BE.inc.php [code]
                depense.inc.php [code]
                document_modele.inc.php [code]Manage the document template
                ecrit_ouv.php [code]For reporting the saldo of account to the next year
                error.php [code]Obsolete ?
                eub_be.inc.php [code]File included to parse CSV from EUB Bank
                export_ouv.php [code]Send the final balance in CSV this balance is used to open an exercice
                facture.inc.php [code]Purpose off this file is to create invoices, to record them and to generate them, and of course to save them into the database
                facture_inc.php [code]
                fiche.php [code]Module to manage the card (removing, listing, creating, modify attribut)
                fiche_csv.php [code]Send a CSV file with card
                fiche_def.inc.php [code]Let customise the fiche_def_ref for the user
                fiche_inc.php [code]Function for managing card, redundant with the class fiche
                fiche_new.php [code]Create a new card in a popup window
                fiche_search.php [code]Search a card in a popup window
                form.php [code]Handle your own report: create or view report
                form_csv.php [code]Send a report in CSV format
                form_inc.php [code]
                form_pdf.php [code]Send a report in PDF
                fortis_be.inc.php [code]File to include : parse the CSV file from fortis Bank Belgium
                import.php [code]For importing Bank operations
                import_inc.php [code]
                impress_bilan.php [code]Form who call the printing of the bilan in RTF file included by user_impress
                impress_fiche.php [code]
                impress_inc.php [code]
                impress_jrn.php [code]Ask for Printing the ledger (pdf,html)
                impress_listing_client.php [code]Print the listing of customer for vat
                impress_poste.php [code]Print account (html or pdf) file included from user_impress
                impress_rapport.php [code]Print first the report in html and propose to print it in pdf file included by user_impress
                index.php [code]Default page where user access
                info.php [code]
                ing_be.inc.php [code]File to be included to parse CSV from ING Belgium
                jrn.php [code]Work with the ledger
                jrn_add.php [code]To add a ledger
                jrn_csv.php [code]Send a ledger in CSV format
                jrn_detail.php [code]Show and let modify ledger parameter
                jrn_op_detail.php [code]Show the detail of a operation in a popup windows
                jrn_pdf.php [code]Send a ledger in a pdf format
                jrn_search.php [code]Search a operation from a ledger into a popup window, used for the "rapprochement"
                jrn_update.php [code]Create, modify parameter ledger
                line_update.php [code]Modify the "Plan Comptable"
                listing_client.php [code]Electronic declaration for VAT BELGIUM --> experimental
                login.php [code]Login page
                logout.php [code]Logout
                modify_op.php [code]Update a operation in a popup window : add a document
                not_implemented.php [code]
                parametre.php [code]Parametre module
                pcmn_update.php [code]Concerns the management of the "Plan Comptable"
                periode.inc.php [code]Still used ?
                poste.inc.php [code]P_action contains the main action (always poste here) action contains the sub action
                poste.php [code]
                poste_csv.php [code]Send the poste list in csv
                poste_pdf.php [code]Send the account list in PDF
                poste_search.php [code]Search a account in a popup window
                postgres.php [code]Contains the procedure for connecting to postgresql
                pref.inc.php [code]
                preference.php [code]Include file for the periode form, currency,..
                print_balance.php [code]Print the balance in pdf format
                priv_user.php [code]Users Security
                readme.php [code]
                recherche.php [code]Search module
                sec_pdf.php [code]Print the user security in pdf
                send_jrn_pdf.php [code]Print the ledger in pdf
                send_poste_pdf.php [code]Print the account in pdf
                setup.php [code]
                show_document.php [code]Retrieve a document
                show_document_modele.php [code]Send the document template
                show_fiche.php [code]This file show in a popup window the detail a of card in read only mode the parameter are q (for qcode) & PHPSESSID
                show_pj.php [code]
                show_tva.php [code]Popup window to let the user choose the vat
                stock.php [code]Manage the stock by year
                stock_inc.php [code]Function for managing the stock
                supplier.inc.php [code]Called from the module "Gestion" to manage the customer
                tva.inc.php [code]Included file for customizing with the vat (account,rate...)
                user_action_ach.php [code]Included file for the ledger of expenses
                user_action_fin.php [code]Included file for the financial ledger
                user_action_gl.php [code]Included file for the great ledger
                user_action_ods.php [code]Included file for the miscellaneous operation ledger
                user_action_ven.php [code]Manage the ledger of type VEN
                user_advanced.php [code]Obsolete
                user_common.php [code]Common functions
                user_compta.php [code]Main page of the accountancy module
                user_form_ach.php [code]Functions for the ledger of expenses
                user_form_fin.php [code]Functions for the financial ledger
                user_form_ods.php [code]Functions for the ledger of misc. operation
                user_form_ven.php [code]Functions for the ledger of sold
                user_impress.php [code]Main page for the printing
                user_jrn.php [code]Main page for encoding in the ledger
                user_login.php [code]Welcome page where the folder and module are choosen
                user_menu.php [code]Nearly all the menu are here, some of them returns a HTML string, others echo directly the result
                user_pref.php [code]Page for the personal preference (theme, password,...)
                user_sec.php [code]Set the security for an user
                user_update.php [code]Check if still used
                -
                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form_8php-source.html b/doc/developper/html/form_8php-source.html index 99c80d3dc..c4610413b 100644 --- a/doc/developper/html/form_8php-source.html +++ b/doc/developper/html/form_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/form.php Source File +phpcompta: form.php Source File +html

                form.php

                Go to the documentation of this file.
                00001 <?
                 00002 /*
                 00003  *   This file is part of PhpCompta.
                @@ -118,7 +118,7 @@
                 00112 //echo "</DIV>";
                 00113 html_page_stop();
                 00114 ?>
                -

                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form_8php.html b/doc/developper/html/form_8php.html index e8f245a30..1a45d735f 100644 --- a/doc/developper/html/form_8php.html +++ b/doc/developper/html/form_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/form.php File Reference +phpcompta: form.php File Reference +html

                form.php File Reference

                handle your own report: create or view report More...

                @@ -129,7 +129,7 @@ Definition at line 37 of f Definition at line 91 of file form.php. -


                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form__csv_8php-source.html b/doc/developper/html/form__csv_8php-source.html index 8c79b4f51..744809a8d 100644 --- a/doc/developper/html/form__csv_8php-source.html +++ b/doc/developper/html/form__csv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/form_csv.php Source File +phpcompta: form_csv.php Source File +html

                form_csv.php

                Go to the documentation of this file.
                00001 <?
                 00002 /*
                 00003  *   This file is part of PhpCompta.
                @@ -104,7 +104,7 @@
                 00098    }
                 00099   exit;
                 00100 ?>
                -

                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form__csv_8php.html b/doc/developper/html/form__csv_8php.html index ec373b622..1c11c353a 100644 --- a/doc/developper/html/form__csv_8php.html +++ b/doc/developper/html/form__csv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/form_csv.php File Reference +phpcompta: form_csv.php File Reference +html

                form_csv.php File Reference

                Send a report in CSV format. More...

                @@ -102,7 +102,7 @@ Definition at line 40 Definition at line 36 of file form_csv.php. -


                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form__inc_8php-source.html b/doc/developper/html/form__inc_8php-source.html index b13503b9c..fd3ece748 100644 --- a/doc/developper/html/form__inc_8php-source.html +++ b/doc/developper/html/form__inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/form_inc.php Source File +phpcompta: form_inc.php Source File +include

                form_inc.php

                Go to the documentation of this file.
                00001 <?
                 00002 
                 00003 /*
                @@ -55,9 +55,9 @@
                 00056   echo "<FORM ACTION=\"form.php\" METHOD=\"POST\">";
                 00057   printf ("Nom du rapport : <INPUT TYPE=\"TEXT\" NAME=\"form_nom\" VALUE=\"%s\">",
                 00058           $form_nom);
                -00059   printf ('<INPUT TYPE="HIDDEN" NAME="line" value="%s"',
                +00059   printf ('<INPUT TYPE="HIDDEN" NAME="line" value="%s"',
                 00060           $p_line);
                -00061 if ( isset ($fr_id))   printf ('<INPUT TYPE="HIDDEN" NAME="fr_id" value="%s"',
                +00061 if ( isset ($fr_id))   printf ('<INPUT TYPE="HIDDEN" NAME="fr_id" value="%s"',
                 00062           $fr_id);
                 00063 
                 00064   echo '<TABLE>';
                @@ -94,12 +94,12 @@
                 00095   }
                 00096   echo "</TABLE>";
                 00097   if ( isset($fr_id)){
                -00098     echo '<INPUT TYPE="submit" value="Enregistre" name="update">';
                +00098     echo '<INPUT TYPE="submit" value="Enregistre" name="update">';
                 00099   }else {
                -00100     echo '<INPUT TYPE="submit" value="Enregistre" name="record">';
                +00100     echo '<INPUT TYPE="submit" value="Enregistre" name="record">';
                 00101   }
                -00102   echo '<INPUT TYPE="submit" value="Ajoute une ligne" name="add_line">';
                -00103   echo '<INPUT TYPE="submit" value="Efface ce rapport" name="del_form">';
                +00102   echo '<INPUT TYPE="submit" value="Ajoute une ligne" name="add_line">';
                +00103   echo '<INPUT TYPE="submit" value="Efface ce rapport" name="del_form">';
                 00104 
                 00105   echo "</FORM>";
                 00106 
                @@ -242,7 +242,7 @@
                 00303 }
                 00304 
                 00305 ?>
                -

                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form__inc_8php.html b/doc/developper/html/form__inc_8php.html index 35ff642fd..2dbbff168 100644 --- a/doc/developper/html/form__inc_8php.html +++ b/doc/developper/html/form__inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/form_inc.php File Reference +phpcompta: form_inc.php File Reference +include

                form_inc.php File Reference

                Go to the source code of this file. @@ -84,7 +84,46 @@ Add a report.

                Definition at line 267 of file form_inc.php.

                -References $n, $Res, $sql, CheckFormula(), echo_debug(), echo_error(), ExecSql(), FormatString(), and GetSequence(). +References $n, $Res, $sql, CheckFormula(), echo_debug(), echo_error(), ExecSql(), FormatString(), and GetSequence().

                00267                                  {
                +00268   foreach ($p_array as $key=>$element) {
                +00269     echo_debug ("AddForm $key = $element");
                +00270     ${"$key"}=$element;
                +00271   }
                +00272 
                +00273   if ( !isset ($form_nom) ||
                +00274        ! isset ($line) ) {
                +00275     echo_error("Nom ou ligne non défini");
                +00276     return;
                +00277   }
                +00278   $form_nom=(FormatString($form_nom)==null)?"NoName":FormatString($form_nom);
                +00279   $sql="insert into formdef (fr_label) values ('".$form_nom."')";
                +00280   $Res=ExecSql($p_cn,$sql);
                +00281   $n=GetSequence($p_cn,"s_formdef");
                +00282 
                +00283   for ($i=0;$i < $line;$i++) {
                +00284       ${"text$i"}=FormatString(${"text$i"});
                +00285       ${"form$i"}=FormatString(${"form$i"});
                +00286       if ( ${"text$i"} != null ) {
                +00287         //      ${"form$i"}=(${"form$i"}==null)?${"form$i"}:"'".${"form$i"}."'";
                +00288         ${"form$i"}=(${"form$i"}==null)?"null":"'".${"form$i"}."'";
                +00289         CheckFormula(${"form$i"});
                +00290         $sql=sprintf("insert into form (fo_fr_id,
                +00291                                   fo_pos,
                +00292                                   fo_label,
                +00293                                   fo_formula) values
                +00294                                   ( %d,
                +00295                                     %d,
                +00296                                     '%s',
                +00297                                     %s)",
                +00298                    $n,$i+1,${"text$i"},${"form$i"}
                +00299                    );
                +00300         $Res=ExecSql($p_cn,$sql);
                +00301     }//if
                +00302   }//for $i
                +00303 }
                +
                +

                +

                @@ -133,7 +172,13 @@ parm :

                Parameters:

                Definition at line 134 of file form_inc.php.

                -References ExecSql(). +References ExecSql().

                00134                                  {
                +00135   ExecSql($p_cn,"delete from form where fo_fr_id=$p_id");
                +00136   ExecSql($p_cn,"delete from formdef where fr_id=$p_id");
                +00137 }
                +
                +

                +

                @@ -189,9 +234,85 @@ parm :

                Parameters:

                Definition at line 34 of file form_inc.php.

                -References $search, echo_debug(), name, size, and value. +References $search, echo_debug(), name, size, and value.

                -Referenced by ViewForm(). +Referenced by ViewForm().

                00034                                                      {
                +00035   //  echo '<SCRIPT LANGUAGE="javascript" SRC="win_search_poste.js"></SCRIPT>';
                +00036   include_once("constant.php");
                +00037   echo JS_SEARCH_POSTE;
                +00038    $search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$p_sessid."','not')\">";
                +00039   for ( $i =0 ; $i <= $p_line; $i++) {
                +00040     ${"text$i"}="";
                +00041     ${"form$i"}="";
                +00042     ${"pos$i"}="";
                +00043   }
                +00044   if ( $p_array != null ) {
                +00045     foreach ( $p_array as $key=> $element ) {
                +00046       ${"$key"}=$element;
                +00047       echo_debug ("EncodeForm $key = $element");
                +00048 
                +00049     }
                +00050     
                +00051   } else {
                +00052     $form_nom="";
                +00053     $text0="";
                +00054     $form0="";
                +00055   }
                +00056   echo "<FORM ACTION=\"form.php\" METHOD=\"POST\">";
                +00057   printf ("Nom du rapport : <INPUT TYPE=\"TEXT\" NAME=\"form_nom\" VALUE=\"%s\">",
                +00058           $form_nom);
                +00059   printf ('<INPUT TYPE="HIDDEN" NAME="line" value="%s"',
                +00060           $p_line);
                +00061 if ( isset ($fr_id))   printf ('<INPUT TYPE="HIDDEN" NAME="fr_id" value="%s"',
                +00062           $fr_id);
                +00063 
                +00064   echo '<TABLE>';
                +00065   echo "<TR>";
                +00066   if ( isset($fr_id) )   echo "<TH> Position </TH>";
                +00067   echo "<TH> Texte </TH>";
                +00068   echo "<TH> Formule</TH>";
                +00069 
                +00070   echo '</TR>';
                +00071   for ( $i =0 ; $i < $p_line;$i++) {
                +00072     echo "<TR>";
                +00073     // si fr_id != null alors les donnees viennent de 
                +00074     // GetDataForm: ce n'est pas un nouvel enregistrement
                +00075     //
                +00076     if ( isset($fr_id)) {
                +00077       echo "<TD>";
                +00078       printf ('<input TYPE="TEXT" NAME="pos%d" size="3" VALUE="%s">',
                +00079               $i,${"pos$i"});
                +00080       echo '</TD>';
                +00081     }
                +00082 
                +00083     echo "<TD>";
                +00084     printf ('<input TYPE="TEXT" NAME="text%d" size="25" VALUE="%s">',
                +00085             $i,${"text$i"});
                +00086     echo '</TD>';
                +00087 
                +00088     echo "<TD>";
                +00089     printf ('<input TYPE="TEXT" NAME="form%d" SIZE="25" VALUE="%s">',
                +00090             $i,${"form$i"});
                +00091     echo $search;
                +00092     echo '</TD>';
                +00093 
                +00094     echo "</TR>";
                +00095   }
                +00096   echo "</TABLE>";
                +00097   if ( isset($fr_id)){
                +00098     echo '<INPUT TYPE="submit" value="Enregistre" name="update">';
                +00099   }else {
                +00100     echo '<INPUT TYPE="submit" value="Enregistre" name="record">';
                +00101   }
                +00102   echo '<INPUT TYPE="submit" value="Ajoute une ligne" name="add_line">';
                +00103   echo '<INPUT TYPE="submit" value="Efface ce rapport" name="del_form">';
                +00104 
                +00105   echo "</FORM>";
                +00106 
                +00107 }
                +
                +

                +

                @@ -245,7 +366,32 @@ Definition at line 149 References $array, $l_line, $Max, $p_id, $Res, and ExecSql().

                -Referenced by ViewForm(). +Referenced by ViewForm().

                00149                                   {
                +00150   $Res=ExecSql($p_cn,"select fo_id,fo_fr_id,fo_pos,fo_label,fo_formula from form where fo_fr_id=$p_id
                +00151                       order by fo_pos");
                +00152   $Max=pg_NumRows($Res);
                +00153   for ( $i=0;$i<$Max;$i++){
                +00154     $l_line=pg_fetch_array($Res,$i);
                +00155 
                +00156     // get the fo_id
                +00157     $text=sprintf("fo_id%d",$i);
                +00158     $array[$text]=$l_line['fo_id'];
                +00159     // get the fo_label
                +00160     $text=sprintf("text%d",$i);
                +00161     $array[$text]=$l_line['fo_label'];
                +00162     // get the fo_formula
                +00163     $text=sprintf("form%d",$i);
                +00164     $array[$text]=$l_line['fo_formula'];
                +00165     // get the pos
                +00166     $text=sprintf("pos%d",$i);
                +00167     $array[$text]=$l_line['fo_pos'];
                +00168   } //for
                +00169   $array["fr_id"]=$p_id;
                +00170   return $array;
                +00171 }
                +
                +

                +

                @@ -297,7 +443,15 @@ Definition at line 195 References $Res, and ExecSql().

                -Referenced by ViewForm(). +Referenced by ViewForm().

                00195                                   {
                +00196   $Res=ExecSql($p_cn,"select fr_label from formdef where fr_id=".$p_id);
                +00197   if ( pg_NumRows($Res) == 0 ) return null;
                +00198   $name=pg_fetch_array($Res,0);
                +00199   return $name['fr_label'];
                +00200 }
                +
                +

                +

                @@ -349,7 +503,14 @@ Definition at line 180 References $count, $Res, and ExecSql().

                -Referenced by ViewForm(). +Referenced by ViewForm().

                00180                                     {
                +00181   $Res=ExecSql($p_cn,"select * from form where fo_fr_id=".$p_id);
                +00182   $count=pg_NumRows($Res);
                +00183   return $count;
                +00184 }
                +
                +

                +

                @@ -398,7 +559,61 @@ Update a report.

                Definition at line 208 of file form_inc.php.

                -References $i, $o, $Res, $sql, CheckFormula(), echo_debug(), ExecSql(), and FormatString(). +References $i, $o, $Res, $sql, CheckFormula(), echo_debug(), ExecSql(), and FormatString().

                00208                                     {
                +00209   foreach ($p_array as $key=>$element) {
                +00210     echo_debug ("UpdateForm $key = $element");
                +00211     ${"$key"}=$element;
                +00212   }
                +00213   $Res=ExecSql($p_cn,"update formdef set fr_label='".FormatString($form_nom)."' where fr_id=".$fr_id);
                +00214   $Res=ExecSql($p_cn,"delete from form where fo_fr_id=".$fr_id);
                +00215   // Test les positions
                +00216   for ($i =0; $i <$line;$i++) {
                +00217     echo_debug ("position =".${"pos$i"});
                +00218     if ( (string) ${"pos$i"} != (string) (int) ${"pos$i"}) {
                +00219       ${"pos$i"}=$i+1;
                +00220     }
                +00221     if ( ${"pos$i"} > $line || ${"pos$i"} < 0) { 
                +00222       ${"pos$i"}=$i+1;
                +00223       echo_debug('form_inc.php',__LINE__,"position trop grand max = $line+1 ");
                +00224     }
                +00225   }
                +00226   for ($i =0; $i <$line;$i++) {
                +00227     for ( $o=$i+1; $o < $line;$o++) {
                +00228       if ( ${"pos$i"} == ${"pos$o"} ) {
                +00229         ${"pos$o"}=$o+1;
                +00230       }
                +00231     }
                +00232   }
                +00233   for ( $i=0;$i<$line;$i++) {
                +00234     if ( strlen(trim(${"text$i"})) != 0) {
                +00235       ${"text$i"}=FormatString(${"text$i"});
                +00236       ${"form$i"}=FormatString(${"form$i"});
                +00237       if ( ${"text$i"} != null ) {
                +00238         if ( CheckFormula(${"form$i"}) == false ) 
                +00239           ${"form$i"}="!!!!!!! FORMULE INVALIDE ".${"form$i"};
                +00240 
                +00241         ${"form$i"}=(${"form$i"}==null)?"null":"'".${"form$i"}."'";
                +00242         $sql=sprintf("insert into form (fo_fr_id,
                +00243                                   fo_pos,
                +00244                                   fo_label,
                +00245                                   fo_formula) values
                +00246                                   ( %d,
                +00247                                     %d,
                +00248                                     '%s',
                +00249                                     %s)",
                +00250                      $fr_id,${"pos$i"},
                +00251                      ${"text$i"},
                +00252                      ${"form$i"}
                +00253                      );
                +00254         $Res=ExecSql($p_cn,$sql);
                +00255       }
                +00256     }//if
                +00257   }//for
                +00258 
                +00259 }
                +
                +

                +

                @@ -454,10 +669,21 @@ parm :

                Parameters:

                Definition at line 117 of file form_inc.php.

                -References $array, $l_line, EncodeForm(), GetDataForm(), GetFormName(), and GetNumberLine(). +References $array, $l_line, EncodeForm(), GetDataForm(), GetFormName(), and GetNumberLine().

                00117                                          {
                +00118   $array=GetDataForm($p_cn,$p_id);
                +00119   $l_nom=GetFormName($p_cn,$p_id);
                +00120   $array['form_nom']=$l_nom;
                +00121 
                +00122   $l_line=GetNumberLine($p_cn,$p_id);
                +00123   EncodeForm($l_line,$p_sessid,$array);
                +00124 
                +00125 }
                +
                +

                + -


                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form__pdf_8php-source.html b/doc/developper/html/form__pdf_8php-source.html index f1fdad389..5fb50b9c1 100644 --- a/doc/developper/html/form__pdf_8php-source.html +++ b/doc/developper/html/form__pdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/form_pdf.php Source File +phpcompta: form_pdf.php Source File +html

                form_pdf.php

                Go to the documentation of this file.
                00001 <?
                 00002 
                 00003 /*
                @@ -111,7 +111,7 @@
                 00106 $pdf->ezStream();
                 00107 
                 00108 ?>
                -

                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/form__pdf_8php.html b/doc/developper/html/form__pdf_8php.html index ee9d92d08..e5ae36874 100644 --- a/doc/developper/html/form__pdf_8php.html +++ b/doc/developper/html/form__pdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/form_pdf.php File Reference +phpcompta: form_pdf.php File Reference +html

                form_pdf.php File Reference

                Send a report in PDF. More...

                @@ -75,7 +75,7 @@ Definition at line 33 Definition at line 42 of file form_pdf.php. -


                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/fortis__be_8inc_8php-source.html b/doc/developper/html/fortis__be_8inc_8php-source.html index b77f6de18..12e5c8885 100644 --- a/doc/developper/html/fortis__be_8inc_8php-source.html +++ b/doc/developper/html/fortis__be_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/fortis_be.inc.php Source File +phpcompta: fortis_be.inc.php Source File +include

                fortis_be.inc.php

                Go to the documentation of this file.
                00001 <?
                 00002 /*
                 00003  *   This file is part of PhpCompta.
                @@ -116,7 +116,7 @@
                 00111 } // file is read
                 00112 fclose($handle);
                 00113 ?>
                -

                Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/fortis__be_8inc_8php.html b/doc/developper/html/fortis__be_8inc_8php.html index 62ad98ca3..823d26ad9 100644 --- a/doc/developper/html/fortis__be_8inc_8php.html +++ b/doc/developper/html/fortis__be_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/fortis_be.inc.php File Reference +phpcompta: fortis_be.inc.php File Reference +include

                fortis_be.inc.php File Reference

                File to include : parse the CSV file from fortis Bank Belgium. More...

                @@ -301,7 +301,7 @@ Definition at line Definition at line 71 of file fortis_be.inc.php. -


                Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                diff --git a/doc/developper/html/functions.html b/doc/developper/html/functions.html index 094b98a2e..d25a71a6e 100644 --- a/doc/developper/html/functions.html +++ b/doc/developper/html/functions.html @@ -117,7 +117,7 @@ Here is a list of all struct and union fields with links to the structures/union : Supplier, Customer, Admin
              • $wordSpaceAdjust : Cpdf
              • $y : Cezpdf
              -
              Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/functions_0x61.html b/doc/developper/html/functions_0x61.html index 990b53edd..9fcc3df6e 100644 --- a/doc/developper/html/functions_0x61.html +++ b/doc/developper/html/functions_0x61.html @@ -34,7 +34,7 @@ Here is a list of all struct and union fields with links to the structures/union : Cpdf
            • ARC4_init() : Cpdf
            • Attribut() : Attribut
            -
            Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
            Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
            diff --git a/doc/developper/html/functions_0x62.html b/doc/developper/html/functions_0x62.html index 8f19cd09a..95ac0db1e 100644 --- a/doc/developper/html/functions_0x62.html +++ b/doc/developper/html/functions_0x62.html @@ -15,7 +15,7 @@ Here is a list of all struct and union fields with links to the structures/union
          • Balance() : Balance
          • blank() : fiche, Document
          -
          Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
          Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
          diff --git a/doc/developper/html/functions_0x63.html b/doc/developper/html/functions_0x63.html index eb482aa0c..ea480e4d6 100644 --- a/doc/developper/html/functions_0x63.html +++ b/doc/developper/html/functions_0x63.html @@ -26,7 +26,7 @@ Here is a list of all struct and union fields with links to the structures/union : Creport
        • curve() : Cpdf
        • Customer() : Customer
        -
        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
        diff --git a/doc/developper/html/functions_0x64.html b/doc/developper/html/functions_0x64.html index 3c3901a5c..44d9c60af 100644 --- a/doc/developper/html/functions_0x64.html +++ b/doc/developper/html/functions_0x64.html @@ -20,7 +20,7 @@ Here is a list of all struct and union fields with links to the structures/union : Document_modele
      • document_type() : Document_type
      • dots() : Creport
      -
      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/functions_0x65.html b/doc/developper/html/functions_0x65.html index bbc61a363..312dc7877 100644 --- a/doc/developper/html/functions_0x65.html +++ b/doc/developper/html/functions_0x65.html @@ -40,7 +40,7 @@ Here is a list of all struct and union fields with links to the structures/union : Cezpdf
    • ezText() : Cezpdf
    • ezWhatPageNumber() : Cezpdf
    -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x66.html b/doc/developper/html/functions_0x66.html index c550a2710..baafb3692 100644 --- a/doc/developper/html/functions_0x66.html +++ b/doc/developper/html/functions_0x66.html @@ -20,7 +20,7 @@ Here is a list of all struct and union fields with links to the structures/union : Cpdf
  • filterText() : Cpdf
  • form() : Document_modele -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x67.html b/doc/developper/html/functions_0x67.html index 3953a70dd..8f615612e 100644 --- a/doc/developper/html/functions_0x67.html +++ b/doc/developper/html/functions_0x67.html @@ -15,8 +15,7 @@ Here is a list of all struct and union fields with links to the structures/union
  • Generate() : Document
  • Get() : parm_code, fiche_def_ref, fiche, fiche_def, Document_modele
  • get() -: poste, Document_type, Document, action
  • GetAgRef() -: action
  • GetAll() +: poste, Document_type, Document, action
  • GetAll() : fiche, fiche_def
  • GetAttribut() : fiche_def
  • getAttribut() : fiche
  • GetByDef() @@ -40,7 +39,7 @@ Here is a list of all struct and union fields with links to the structures/union : poste
  • GetSoldeDetail() : poste
  • getTextWidth() : Cpdf -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x68.html b/doc/developper/html/functions_0x68.html index bbfa4d06c..02d34eb76 100644 --- a/doc/developper/html/functions_0x68.html +++ b/doc/developper/html/functions_0x68.html @@ -14,7 +14,7 @@ Here is a list of all struct and union fields with links to the structures/union

    - h -

    -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x69.html b/doc/developper/html/functions_0x69.html index 507f5b7a3..7fc72776b 100644 --- a/doc/developper/html/functions_0x69.html +++ b/doc/developper/html/functions_0x69.html @@ -18,7 +18,7 @@ Here is a list of all struct and union fields with links to the structures/union : fiche
  • insert_default_global_pref() : cl_user
  • IOValue() : widget -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x6a.html b/doc/developper/html/functions_0x6a.html index 31ee97265..ff2337785 100644 --- a/doc/developper/html/functions_0x6a.html +++ b/doc/developper/html/functions_0x6a.html @@ -14,7 +14,7 @@ Here is a list of all struct and union fields with links to the structures/union

    - j -

    -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x6c.html b/doc/developper/html/functions_0x6c.html index 67b4cc1d0..2e11badee 100644 --- a/doc/developper/html/functions_0x6c.html +++ b/doc/developper/html/functions_0x6c.html @@ -16,7 +16,7 @@ Here is a list of all struct and union fields with links to the structures/union : Cpdf
  • LoadAll() : parm_code, fiche_def_ref
  • loadTemplate() : Cezpdf -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x6d.html b/doc/developper/html/functions_0x6d.html index 272959615..76fc8eaaa 100644 --- a/doc/developper/html/functions_0x6d.html +++ b/doc/developper/html/functions_0x6d.html @@ -16,7 +16,7 @@ Here is a list of all struct and union fields with links to the structures/union : Cpdf
  • MoveDocumentPj() : Document
  • myList() : Document_modele, action -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x6e.html b/doc/developper/html/functions_0x6e.html index 15a7c6c66..6885b4b61 100644 --- a/doc/developper/html/functions_0x6e.html +++ b/doc/developper/html/functions_0x6e.html @@ -15,7 +15,7 @@ Here is a list of all struct and union fields with links to the structures/union
  • newDocument() : Cpdf
  • newPage() : Cpdf -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x6f.html b/doc/developper/html/functions_0x6f.html index 2ea0457a5..8e53f6b7b 100644 --- a/doc/developper/html/functions_0x6f.html +++ b/doc/developper/html/functions_0x6f.html @@ -34,7 +34,7 @@ Here is a list of all struct and union fields with links to the structures/union : Cpdf
  • output() : Cpdf
  • Own() : Own -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x70.html b/doc/developper/html/functions_0x70.html index 6196a3522..ebec652d7 100644 --- a/doc/developper/html/functions_0x70.html +++ b/doc/developper/html/functions_0x70.html @@ -23,7 +23,7 @@ Here is a list of all struct and union fields with links to the structures/union : Cpdf
  • PRVTcheckTextDirective1() : Cpdf
  • PRVTgetTextPosition() : Cpdf -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x72.html b/doc/developper/html/functions_0x72.html index 07cdb5ffa..4e1c07029 100644 --- a/doc/developper/html/functions_0x72.html +++ b/doc/developper/html/functions_0x72.html @@ -21,7 +21,7 @@ Here is a list of all struct and union fields with links to the structures/union : widget
  • restoreState() : Cpdf
  • rf() : Creport -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x73.html b/doc/developper/html/functions_0x73.html index 40e6d863f..ca2a38df0 100644 --- a/doc/developper/html/functions_0x73.html +++ b/doc/developper/html/functions_0x73.html @@ -37,7 +37,7 @@ Here is a list of all struct and union fields with links to the structures/union : widget
  • Summary() : Supplier, Customer, contact, Admin
  • Supplier() : Supplier -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x74.html b/doc/developper/html/functions_0x74.html index 89e063809..1dcde1da1 100644 --- a/doc/developper/html/functions_0x74.html +++ b/doc/developper/html/functions_0x74.html @@ -14,7 +14,7 @@ Here is a list of all struct and union fields with links to the structures/union

    - t -

    • transaction() : Cpdf
    -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x75.html b/doc/developper/html/functions_0x75.html index 390eca745..b3872d813 100644 --- a/doc/developper/html/functions_0x75.html +++ b/doc/developper/html/functions_0x75.html @@ -19,7 +19,7 @@ Here is a list of all struct and union fields with links to the structures/union : cl_user
  • UpdateRow() : Own
  • Upload() : Document -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x76.html b/doc/developper/html/functions_0x76.html index fbd3f4da2..c41302336 100644 --- a/doc/developper/html/functions_0x76.html +++ b/doc/developper/html/functions_0x76.html @@ -14,7 +14,7 @@ Here is a list of all struct and union fields with links to the structures/union

    - v -

    -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_0x77.html b/doc/developper/html/functions_0x77.html index af385cc5d..875e0642f 100644 --- a/doc/developper/html/functions_0x77.html +++ b/doc/developper/html/functions_0x77.html @@ -14,7 +14,7 @@ Here is a list of all struct and union fields with links to the structures/union

    - w -

    -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_func.html b/doc/developper/html/functions_func.html index 1e30314b5..9cf9ad427 100644 --- a/doc/developper/html/functions_func.html +++ b/doc/developper/html/functions_func.html @@ -104,8 +104,7 @@
  • Generate() : Document
  • Get() : parm_code, fiche_def_ref, fiche, fiche_def, Document_modele
  • get() -: poste, Document_type, Document, action
  • GetAgRef() -: action
  • GetAll() +: poste, Document_type, Document, action
  • GetAll() : fiche, fiche_def
  • GetAttribut() : fiche_def
  • getAttribut() : fiche
  • GetByDef() @@ -244,7 +243,7 @@

    - w -

    -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/functions_vars.html b/doc/developper/html/functions_vars.html index c08ccda33..058a52344 100644 --- a/doc/developper/html/functions_vars.html +++ b/doc/developper/html/functions_vars.html @@ -117,7 +117,7 @@ : Supplier, Customer, Admin
  • $wordSpaceAdjust : Cpdf
  • $y : Cezpdf -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals.html b/doc/developper/html/globals.html index eb25694c1..0cb7ec769 100644 --- a/doc/developper/html/globals.html +++ b/doc/developper/html/globals.html @@ -14,7 +14,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

    - $ -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x5f.html b/doc/developper/html/globals_0x5f.html index 785e0d3b1..61a64da0e 100644 --- a/doc/developper/html/globals_0x5f.html +++ b/doc/developper/html/globals_0x5f.html @@ -19,7 +19,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : readme.php
  • __pad4__ : readme.php
  • __pad5__ : readme.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x61.html b/doc/developper/html/globals_0x61.html index 77cb1b340..7613909dd 100644 --- a/doc/developper/html/globals_0x61.html +++ b/doc/developper/html/globals_0x61.html @@ -19,11 +19,11 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : fiche_inc.php
  • ag_comment : action.inc.php
  • ag_id : facture.inc.php, action.inc.php
  • ag_ref -: action.inc.php
  • ag_ref_ag_id -: action.inc.php
  • ag_ref_ag_idid -: action.inc.php
  • ag_timestamp +: action.inc.php
  • ag_ref_ag_id +: action.inc.php
  • ag_ref_ag_idid +: action.inc.php
  • ag_timestamp : action.inc.php
  • ag_title -: action.inc.php
  • ALL +: action.inc.php
  • ALL : constant.php
  • ALL_FICHE_DEF_REF : constant.php
  • AlterSequence() : postgres.php
  • AnalyzeError() @@ -46,7 +46,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : constant.php
  • ATTR_DEF_TVA_NON_DEDUCTIBLE : constant.php
  • ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP : constant.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x62.html b/doc/developper/html/globals_0x62.html index 0cb9e7f48..454737334 100644 --- a/doc/developper/html/globals_0x62.html +++ b/doc/developper/html/globals_0x62.html @@ -20,7 +20,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : user_impress.php
  • BQE : constant.php
  • break : user_impress.php, readme.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x63.html b/doc/developper/html/globals_0x63.html index bd759275f..7c3cd1022 100644 --- a/doc/developper/html/globals_0x63.html +++ b/doc/developper/html/globals_0x63.html @@ -12,8 +12,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

    - c -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x64.html b/doc/developper/html/globals_0x64.html index b29ee6b37..7c056e678 100644 --- a/doc/developper/html/globals_0x64.html +++ b/doc/developper/html/globals_0x64.html @@ -13,7 +13,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

    - d -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x65.html b/doc/developper/html/globals_0x65.html index 2bd05e57e..324f79750 100644 --- a/doc/developper/html/globals_0x65.html +++ b/doc/developper/html/globals_0x65.html @@ -30,7 +30,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : user_sec.php, user_jrn.php, show_tva.php, show_pj.php, show_document_modele.php, sec_pdf.php, print_balance.php, poste_csv.php, pcmn_update.php, parametre.php, modify_op.php, line_update.php, jrn_update.php, jrn_search.php, jrn_detail.php, jrn_csv.php, jrn_add.php, fiche_csv.php, export_ouv.php, ecrit_ouv.php, bal_csv.php, annulation.php, admin_repo.php, user_update.php, user_action_ven.php, user_action_ods.php, user_action_gl.php, user_action_fin.php, user_action_ach.php, impress_rapport.php, impress_poste.php, impress_jrn.php, balance.php
  • EXP_IMP_ECR : constant.php
  • extra : contact.inc.php, bank.inc.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x66.html b/doc/developper/html/globals_0x66.html index 5b648c45b..0a552b492 100644 --- a/doc/developper/html/globals_0x66.html +++ b/doc/developper/html/globals_0x66.html @@ -40,7 +40,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : fiche_def.inc.php
  • frd_id : fiche_def.inc.php
  • frd_text : fiche_def.inc.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x67.html b/doc/developper/html/globals_0x67.html index 8aa176c83..d796e92b3 100644 --- a/doc/developper/html/globals_0x67.html +++ b/doc/developper/html/globals_0x67.html @@ -13,7 +13,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

    - g -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x68.html b/doc/developper/html/globals_0x68.html index 923f1c3b8..54540a4b8 100644 --- a/doc/developper/html/globals_0x68.html +++ b/doc/developper/html/globals_0x68.html @@ -17,7 +17,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : ac_common.php
  • html_page_start() : ac_common.php
  • html_page_stop() : ac_common.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x69.html b/doc/developper/html/globals_0x69.html index d85b79b20..7b2206597 100644 --- a/doc/developper/html/globals_0x69.html +++ b/doc/developper/html/globals_0x69.html @@ -30,7 +30,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : fiche_inc.php
  • isNumber() : ac_common.php
  • isValid() : user_common.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x6a.html b/doc/developper/html/globals_0x6a.html index 04f131ff5..f553b623c 100644 --- a/doc/developper/html/globals_0x6a.html +++ b/doc/developper/html/globals_0x6a.html @@ -24,7 +24,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : constant.php
  • JS_VIEW_JRN_DETAIL : constant.php
  • JS_VIEW_JRN_MODIFY : constant.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x6c.html b/doc/developper/html/globals_0x6c.html index 6e4738d87..2fce0d5d6 100644 --- a/doc/developper/html/globals_0x6c.html +++ b/doc/developper/html/globals_0x6c.html @@ -17,7 +17,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : constant.php
  • list_client : user_impress.php
  • ListJrn() : user_common.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x6d.html b/doc/developper/html/globals_0x6d.html index b95e49b2b..a16a0beb3 100644 --- a/doc/developper/html/globals_0x6d.html +++ b/doc/developper/html/globals_0x6d.html @@ -15,7 +15,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
  • make_array() : ac_common.php
  • MakeListingVat() : decla.BE.inc.php
  • md_id -: facture.inc.php, document_modele.inc.php, action.inc.php
  • md_name +: facture.inc.php, document_modele.inc.php, action.inc.php
  • md_name : document_modele.inc.php
  • md_type : document_modele.inc.php
  • MENU_FACT : constant.php
  • MENU_FICHE @@ -34,7 +34,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : parametre.php
  • MY_TEL : parametre.php
  • MY_TVA : parametre.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x6e.html b/doc/developper/html/globals_0x6e.html index 27c2d2362..c057f306f 100644 --- a/doc/developper/html/globals_0x6e.html +++ b/doc/developper/html/globals_0x6e.html @@ -13,7 +13,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

    - n -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x6f.html b/doc/developper/html/globals_0x6f.html index c9c05a0df..4c316385b 100644 --- a/doc/developper/html/globals_0x6f.html +++ b/doc/developper/html/globals_0x6f.html @@ -15,7 +15,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
  • ODS : constant.php
  • OPEN : constant.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x70.html b/doc/developper/html/globals_0x70.html index 98476f165..1d17f6930 100644 --- a/doc/developper/html/globals_0x70.html +++ b/doc/developper/html/globals_0x70.html @@ -24,7 +24,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : user_impress.php
  • PosteForm() : poste.php
  • print : impress_rapport.php, impress_poste.php, impress_listing_client.php, impress_jrn.php, impress_bilan.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x72.html b/doc/developper/html/globals_0x72.html index afa0b08d6..b419d6ad8 100644 --- a/doc/developper/html/globals_0x72.html +++ b/doc/developper/html/globals_0x72.html @@ -27,7 +27,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : priv_user.php, parametre.php, listing_client.php, jrn_search.php, form.php, fiche_new.php, admin_repo.php, user_action_ach.php, periode.inc.php, impress_listing_client.php
  • Rollback() : postgres.php
  • ros_logo() : readme.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x73.html b/doc/developper/html/globals_0x73.html index e121f9d68..0512541aa 100644 --- a/doc/developper/html/globals_0x73.html +++ b/doc/developper/html/globals_0x73.html @@ -18,7 +18,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : constant.php
  • selected : user_action_ven.php, user_action_ods.php, user_action_gl.php, user_action_fin.php, user_action_ach.php, impress_jrn.php, impress_fiche.php, facture.inc.php, depense.inc.php, bank.inc.php
  • SetInternalCode() : jrn.php
  • ShowActionList() -: action.inc.php
  • ShowDevise() +: action.inc.php
  • ShowDevise() : preference.php
  • ShowDossier() : postgres.php
  • ShowFormTransfert() : import_inc.php
  • ShowItem() @@ -45,9 +45,9 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : postgres.php
  • STOCK_READ : constant.php
  • STOCK_WRITE : constant.php
  • success< br > -: test.php, setup.php
  • SyncRight() +: setup.php
  • SyncRight() : postgres.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x74.html b/doc/developper/html/globals_0x74.html index fa999f645..5e345291b 100644 --- a/doc/developper/html/globals_0x74.html +++ b/doc/developper/html/globals_0x74.html @@ -13,10 +13,9 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

    - t -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x75.html b/doc/developper/html/globals_0x75.html index 9b68d6d29..a02579202 100644 --- a/doc/developper/html/globals_0x75.html +++ b/doc/developper/html/globals_0x75.html @@ -21,7 +21,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li : form_inc.php
  • UpdateJrn() : jrn.php
  • UpdateModele() : fiche_inc.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x76.html b/doc/developper/html/globals_0x76.html index 379dd2b68..ea07bb510 100644 --- a/doc/developper/html/globals_0x76.html +++ b/doc/developper/html/globals_0x76.html @@ -13,7 +13,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

    - v -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x77.html b/doc/developper/html/globals_0x77.html index 29210b63c..c23dfd4c1 100644 --- a/doc/developper/html/globals_0x77.html +++ b/doc/developper/html/globals_0x77.html @@ -15,7 +15,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
  • width : tva.inc.php
  • withStock() : user_common.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_0x79.html b/doc/developper/html/globals_0x79.html index 1bec36abf..b18d5d77e 100644 --- a/doc/developper/html/globals_0x79.html +++ b/doc/developper/html/globals_0x79.html @@ -14,7 +14,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li

    - y -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_enum.html b/doc/developper/html/globals_enum.html index 588c16ab9..ca5c05339 100644 --- a/doc/developper/html/globals_enum.html +++ b/doc/developper/html/globals_enum.html @@ -134,7 +134,7 @@

    - y -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_func.html b/doc/developper/html/globals_func.html index 7b508639e..bf9e73c41 100644 --- a/doc/developper/html/globals_func.html +++ b/doc/developper/html/globals_func.html @@ -190,7 +190,7 @@ : postgres.php
  • SaveModeleName() : fiche_inc.php
  • SetInternalCode() : jrn.php
  • ShowActionList() -: action.inc.php
  • ShowDevise() +: action.inc.php
  • ShowDevise() : preference.php
  • ShowDossier() : postgres.php
  • ShowFormTransfert() : import_inc.php
  • ShowItem() @@ -243,7 +243,7 @@

    - w -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars.html b/doc/developper/html/globals_vars.html index eab0f3fa7..54ef69607 100644 --- a/doc/developper/html/globals_vars.html +++ b/doc/developper/html/globals_vars.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -14,7 +14,7 @@

    - $ -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x5f.html b/doc/developper/html/globals_vars_0x5f.html index 7175f9916..7d1079523 100644 --- a/doc/developper/html/globals_vars_0x5f.html +++ b/doc/developper/html/globals_vars_0x5f.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -19,7 +19,7 @@ : readme.php

  • __pad4__ : readme.php
  • __pad5__ : readme.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x61.html b/doc/developper/html/globals_vars_0x61.html index d2a09fea8..b34ee2239 100644 --- a/doc/developper/html/globals_vars_0x61.html +++ b/doc/developper/html/globals_vars_0x61.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -15,12 +15,12 @@

  • ag_comment : action.inc.php
  • ag_id : facture.inc.php, action.inc.php
  • ag_ref -: action.inc.php
  • ag_ref_ag_id -: action.inc.php
  • ag_ref_ag_idid -: action.inc.php
  • ag_timestamp +: action.inc.php
  • ag_ref_ag_id +: action.inc.php
  • ag_ref_ag_idid +: action.inc.php
  • ag_timestamp : action.inc.php
  • ag_title -: action.inc.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +: action.inc.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x62.html b/doc/developper/html/globals_vars_0x62.html index 41503cbf2..c710db389 100644 --- a/doc/developper/html/globals_vars_0x62.html +++ b/doc/developper/html/globals_vars_0x62.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -16,7 +16,7 @@ : user_impress.php

  • bilan : user_impress.php
  • break : user_impress.php, readme.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x63.html b/doc/developper/html/globals_vars_0x63.html index 6fea5aa37..4368967b5 100644 --- a/doc/developper/html/globals_vars_0x63.html +++ b/doc/developper/html/globals_vars_0x63.html @@ -16,7 +16,7 @@ : test_smarty.php
  • compile_dir : test_smarty.php
  • config_dir : test_smarty.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 18:58:49 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x64.html b/doc/developper/html/globals_vars_0x64.html index a055ac1c6..671b6c5be 100644 --- a/doc/developper/html/globals_vars_0x64.html +++ b/doc/developper/html/globals_vars_0x64.html @@ -6,18 +6,18 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    - d -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x65.html b/doc/developper/html/globals_vars_0x65.html index 415f19d39..ecf6a76fb 100644 --- a/doc/developper/html/globals_vars_0x65.html +++ b/doc/developper/html/globals_vars_0x65.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -16,7 +16,7 @@ : user_sec.php

  • exit : user_sec.php, user_jrn.php, show_tva.php, show_pj.php, show_document_modele.php, sec_pdf.php, print_balance.php, poste_csv.php, pcmn_update.php, parametre.php, modify_op.php, line_update.php, jrn_update.php, jrn_search.php, jrn_detail.php, jrn_csv.php, jrn_add.php, fiche_csv.php, export_ouv.php, ecrit_ouv.php, bal_csv.php, annulation.php, admin_repo.php, user_update.php, user_action_ven.php, user_action_ods.php, user_action_gl.php, user_action_fin.php, user_action_ach.php, impress_rapport.php, impress_poste.php, impress_jrn.php, balance.php
  • extra : contact.inc.php, bank.inc.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x66.html b/doc/developper/html/globals_vars_0x66.html index e600ad072..8dc1f5a77 100644 --- a/doc/developper/html/globals_vars_0x66.html +++ b/doc/developper/html/globals_vars_0x66.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -18,7 +18,7 @@ : fiche_def.inc.php

  • frd_id : fiche_def.inc.php
  • frd_text : fiche_def.inc.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x68.html b/doc/developper/html/globals_vars_0x68.html index 3b33ad5e9..6cb98e2c2 100644 --- a/doc/developper/html/globals_vars_0x68.html +++ b/doc/developper/html/globals_vars_0x68.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -14,7 +14,7 @@

    - h -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x69.html b/doc/developper/html/globals_vars_0x69.html index 6c95eefc6..96a43f2d5 100644 --- a/doc/developper/html/globals_vars_0x69.html +++ b/doc/developper/html/globals_vars_0x69.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -14,7 +14,7 @@

    - i -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x6c.html b/doc/developper/html/globals_vars_0x6c.html index dbc685113..7cd401670 100644 --- a/doc/developper/html/globals_vars_0x6c.html +++ b/doc/developper/html/globals_vars_0x6c.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -15,7 +15,7 @@

  • label : export_ouv.php, ecrit_ouv.php, impress_rapport.php, impress_poste.php, impress_listing_client.php, impress_jrn.php, impress_bilan.php, contact.inc.php, bank.inc.php, balance.php
  • list_client : user_impress.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x6d.html b/doc/developper/html/globals_vars_0x6d.html index a1a8008a8..ec151e04c 100644 --- a/doc/developper/html/globals_vars_0x6d.html +++ b/doc/developper/html/globals_vars_0x6d.html @@ -6,14 +6,14 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    - m -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x6e.html b/doc/developper/html/globals_vars_0x6e.html index d1d2ca184..542c49d0d 100644 --- a/doc/developper/html/globals_vars_0x6e.html +++ b/doc/developper/html/globals_vars_0x6e.html @@ -6,15 +6,15 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    - n -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +: ecrit_ouv.php, user_action_ven.php, user_action_ods.php, user_action_gl.php, user_action_fin.php, user_action_ach.php, tva.inc.php, supplier.inc.php, poste.inc.php, facture.inc.php, depense.inc.php, contact.inc.php, client.inc.php, bank.inc.php, admin.inc.php, action.inc.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x70.html b/doc/developper/html/globals_vars_0x70.html index fbc19cfde..106055db1 100644 --- a/doc/developper/html/globals_vars_0x70.html +++ b/doc/developper/html/globals_vars_0x70.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -17,7 +17,7 @@ : poste.inc.php

  • poste : user_impress.php
  • print : impress_rapport.php, impress_poste.php, impress_listing_client.php, impress_jrn.php, impress_bilan.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x72.html b/doc/developper/html/globals_vars_0x72.html index f5b01574f..ea3047b81 100644 --- a/doc/developper/html/globals_vars_0x72.html +++ b/doc/developper/html/globals_vars_0x72.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -16,7 +16,7 @@ : user_impress.php

  • readonly : ecrit_ouv.php
  • return : priv_user.php, parametre.php, listing_client.php, jrn_search.php, form.php, fiche_new.php, admin_repo.php, user_action_ach.php, periode.inc.php, impress_listing_client.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x73.html b/doc/developper/html/globals_vars_0x73.html index 87390c9e1..9bc2a0b45 100644 --- a/doc/developper/html/globals_vars_0x73.html +++ b/doc/developper/html/globals_vars_0x73.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -16,8 +16,8 @@ : user_action_ven.php, user_action_ods.php, user_action_gl.php, user_action_fin.php, user_action_ach.php, impress_jrn.php, impress_fiche.php, facture.inc.php, depense.inc.php, bank.inc.php

  • size : annulation.php, tva.inc.php
  • start : document_modele.inc.php
  • success< br > -: test.php, setup.php -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +: setup.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x74.html b/doc/developper/html/globals_vars_0x74.html index b0d885c31..786f1a76f 100644 --- a/doc/developper/html/globals_vars_0x74.html +++ b/doc/developper/html/globals_vars_0x74.html @@ -6,16 +6,15 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    - t -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +: parametre.php, ecrit_ouv.php, impress_rapport.php, impress_poste.php, impress_listing_client.php, impress_jrn.php, impress_bilan.php, balance.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x76.html b/doc/developper/html/globals_vars_0x76.html index eb47d3767..4c9aecaff 100644 --- a/doc/developper/html/globals_vars_0x76.html +++ b/doc/developper/html/globals_vars_0x76.html @@ -6,15 +6,15 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    - v -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +: ecrit_ouv.php, user_action_ven.php, user_action_ods.php, user_action_gl.php, user_action_fin.php, user_action_ach.php, tva.inc.php, supplier.inc.php, poste.inc.php, facture.inc.php, depense.inc.php, contact.inc.php, client.inc.php, bank.inc.php, admin.inc.php, action.inc.php +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/globals_vars_0x77.html b/doc/developper/html/globals_vars_0x77.html index d004b6061..f0148a135 100644 --- a/doc/developper/html/globals_vars_0x77.html +++ b/doc/developper/html/globals_vars_0x77.html @@ -6,7 +6,7 @@ -
    $ | _ | a | b | c | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w
    +
    $ | _ | a | b | d | e | f | g | h | i | l | m | n | p | q | r | s | t | v | w

    @@ -14,7 +14,7 @@

    - w -

    -
    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/hierarchy.html b/doc/developper/html/hierarchy.html index d70738c07..16caa56ea 100644 --- a/doc/developper/html/hierarchy.html +++ b/doc/developper/html/hierarchy.html @@ -36,7 +36,7 @@
  • rapport
  • widget -
    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/import_8php-source.html b/doc/developper/html/import_8php-source.html index d310b955f..fc6c90bf2 100644 --- a/doc/developper/html/import_8php-source.html +++ b/doc/developper/html/import_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/import.php Source File +phpcompta: import.php Source File +html

    import.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -102,7 +102,7 @@
     00097 
     00098 html_page_stop();
     00099 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/import_8php.html b/doc/developper/html/import_8php.html index 8f11d972b..ccefe44db 100644 --- a/doc/developper/html/import_8php.html +++ b/doc/developper/html/import_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/import.php File Reference +phpcompta: import.php File Reference +html

    import.php File Reference

    for importing Bank operations More...

    @@ -75,7 +75,7 @@ Definition at line 52 of Definition at line 38 of file import.php. -


    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/import__inc_8php-source.html b/doc/developper/html/import__inc_8php-source.html index a12ef190c..26f3b5b92 100644 --- a/doc/developper/html/import__inc_8php-source.html +++ b/doc/developper/html/import__inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/import_inc.php Source File +phpcompta: import_inc.php Source File +include

    import_inc.php

    Go to the documentation of this file.
    00001 <?
     00002 /*
     00003  *   This file is part of PhpCompta.
    @@ -63,13 +63,13 @@
     00072         $i=1;
     00073         while($val = pg_fetch_array($Res)){
     00074                 echo '<form METHOD="POST" action="import.php?action=verif">';
    -00075                 echo '<input type="hidden" name="code" value="'.$val['code'].'">';
    +00075                 echo '<input type="hidden" name="code" value="'.$val['code'].'">';
     00076                 echo '<table border="1" width="500">';
     00077                 echo '<tr><td width="200">'.$val['code'].'</td><td width="200">'.$val['date_exec'].'</td><td width="100">'.$val['montant'].' EUR</td><tr/>';
     00078                 echo '<tr><td height="50" colspan="3">'.$val['detail'].'</td><tr/>';
    -00079                 echo '<tr><td>Poste Comptable : <input type="text" size="10" name="poste"></td>';
    +00079                 echo '<tr><td>Poste Comptable : <input type="text" size="10" name="poste"></td>';
     00080                 echo "<td>n° compte : ".$val['num_compte']."</td>";
    -00081                 echo '<td><input type="submit" value="modifier"></td><tr/>';
    +00081                 echo '<td><input type="submit" value="modifier"></td><tr/>';
     00082                 echo '</table>';
     00083                 echo '</FORM>';
     00084                 $i++;
    @@ -150,7 +150,7 @@
     00174 function ShowFormTransfert($p_cn){
     00175 $w=new widget("select");
     00176   echo '<FORM METHOD="POST" action="import.php?action=import" enctype="multipart/form-data">';
    -00177   echo '<INPUT TYPE="file" name="fupload" size="20"><br>';
    +00177   echo '<INPUT TYPE="file" name="fupload" size="20"><br>';
     00178   // ask for the journal target 
     00179   $jrn=make_array ($p_cn,"select jrn_def_id,jrn_def_name from jrn_def where jrn_def_type='FIN';");
     00180   $w->label='Journal';
    @@ -166,7 +166,7 @@
     00190   echo '</FORM>';
     00191 }
     00192 ?>
    -

    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
    diff --git a/doc/developper/html/import__inc_8php.html b/doc/developper/html/import__inc_8php.html index 9d3a7dff9..e6c438bf5 100644 --- a/doc/developper/html/import__inc_8php.html +++ b/doc/developper/html/import__inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/import_inc.php File Reference +phpcompta: import_inc.php File Reference +include

    import_inc.php File Reference

    Go to the source code of this file. @@ -95,7 +95,28 @@ Parse the file and insert the record into the table import_tmp. Insert in a temp

    Definition at line 37 of file import_inc.php.

    -References Commit(), print, and StartSql(). +References Commit(), print, and StartSql().

    00038 {
    +00039         if(!$handle = fopen($file, "r")) {
    +00040                 print 'could not open file. quitting';
    +00041                 die;
    +00042         }
    +00043 
    +00044 StartSql($p_cn);
    +00045 
    +00046         
    +00047 // include the right format for CSV --> given by the <form
    +00048                 include($p_format_csv);
    +00049 
    +00050         
    +00051         echo "Importation terminée.";
    +00052 
    +00053 // if importation succeeds then we can commit the change
    +00054 Commit($p_cn);
    +00055 
    +00056 }
    +
    +

    +

    @@ -131,7 +152,27 @@ parm : database connection

      Definition at line 174 of file import_inc.php.

      -References $jrn, $w, make_array(), METHOD, name, and size. +References $jrn, $w, make_array(), METHOD, name, and size.

      00174                                  {
      +00175 $w=new widget("select");
      +00176   echo '<FORM METHOD="POST" action="import.php?action=import" enctype="multipart/form-data">';
      +00177   echo '<INPUT TYPE="file" name="fupload" size="20"><br>';
      +00178   // ask for the journal target 
      +00179   $jrn=make_array ($p_cn,"select jrn_def_id,jrn_def_name from jrn_def where jrn_def_type='FIN';");
      +00180   $w->label='Journal';
      +00181   echo $w->label." :".$w->IOValue('import_jrn',$jrn)."<br>";
      +00182   // choose the bank account
      +00183   $bq=make_array($p_cn,"select pcm_val,pcm_lib from tmp_pcmn where pcm_val like '550%'");
      +00184   $w->label='Banque';
      +00185   echo "Compte en banque :".$w->IOValue('import_bq',$bq)."<br>";
      +00186   $format_csv=make_array($p_cn,"select include_file,name from format_csv_banque;");
      +00187   $w->label="Format import";
      +00188   echo $w->label.$w->IOValue('format_csv',$format_csv).'<br>';
      +00189   echo '<INPUT TYPE="SUBMIT" Value="Import fiche">';
      +00190   echo '</FORM>';
      +00191 }
      +
      +

      +

      @@ -174,7 +215,81 @@ Transfert data into the ledger.

      Definition at line 90 of file import_inc.php.

      -References $_SESSION, $code, $date_exec, $end, $jrn, $Max, $montant, $poste_comptable, $r, $Res, $Res2, $seq, $sql, $start, $val, Commit(), ExecSql(), exit, InsertJrn(), InsertJrnx(), NextSequence(), Rollback(), SetInternalCode(), and StartSql(). +References $_SESSION, $code, $date_exec, $end, $jrn, $Max, $montant, $poste_comptable, $r, $Res, $Res2, $seq, $sql, $start, $val, Commit(), ExecSql(), exit, InsertJrn(), InsertJrnx(), NextSequence(), Rollback(), SetInternalCode(), and StartSql().

      00090                                      {
      +00091         //on obtient la période courante
      +00092         //$p_user = $_SESSION['g_user'];
      +00093         //$periode = GetUserPeriode($p_cn,$p_user);
      +00094         //$periode = $p_user->GetPeriode();
      +00095         // on trouve les dates frontières de cette période
      +00096         $sql = "select p_start,p_end from parm_periode where p_id = '".$periode."'";
      +00097         $Res=ExecSql($p_cn,$sql);
      +00098         $val = pg_fetch_array($Res);
      +00099         $start = $val['p_start'];   $end = $val['p_end'];
      +00100         
      +00101         $sql = "select * from import_tmp where poste_comptable is not null and  poste_comptable <> '' 
      +00102             AND ok <> TRUE AND date_exec BETWEEN '".$start."' and '".$end."'";
      +00103         $Res=ExecSql($p_cn,$sql);
      +00104         //echo "boucle: ".sizeof($Res)."<br/>";
      +00105         //while($val = pg_fetch_array($Res)){
      +00106         $Max=pg_NumRows($Res);
      +00107         echo $Max." opérations à transférer.<br/>";
      +00108         for ($i = 0;$i < $Max;$i++) {
      +00109                 $val=pg_fetch_array($Res,$i);
      +00110                 
      +00111                 $code=$val['code']; $date_exec=$val['date_exec']; $montant=$val['montant']; $num_compte=$val['num_compte']; 
      +00112                 $poste_comptable=$val['poste_comptable'];$bq_account=$val['bq_account'];
      +00113                 $jrn=$val['jrn'];
      +00114 
      +00115                 list($annee, $mois, $jour) = explode("-", $date_exec);
      +00116                 $date_exec = $jour.".".$mois.".".$annee;
      +00117 
      +00118                 // Vérification que le poste comptable trouvé existe
      +00119                 $sqltest = "select * from tmp_pcmn WHERE pcm_val='".$poste_comptable."'";
      +00120                 $Restest=ExecSql($p_cn,$sqltest);
      +00121                 $test=pg_NumRows($Restest);
      +00122                 if($test == 0) {
      +00123                         $sqlupdate = "update import_tmp set poste_comptable='' WHERE code='".$code."' AND num_compte='".$num_compte."'";
      +00124                         $Resupdate=ExecSql($p_cn,$sqlupdate);
      +00125                         echo "Poste comptable erronné pour l'opération ".$num_compte."-".$code.", réinitialisation du poste comptable<br/>";
      +00126                 } else {
      +00127 
      +00128                 // Finances
      +00129         
      +00130                 //$seq = GetNextId($p_cn,'j_grpt')+1;
      +00131                 $seq=NextSequence($p_cn,'s_grpt');
      +00132                 $p_user = $_SESSION['g_user'];
      +00133                 //$periode = GetUserPeriode($p_cn,$p_user);
      +00134                 //$periode = $User->GetPeriode();
      +00135                 StartSql($p_cn);
      +00136 
      +00137                 $r=InsertJrnx($p_cn,"d",$p_user,$jrn,$bq_account,$date_exec,$montant,$seq,$periode);
      +00138                 if ( $r == false) { $Rollback($p_cn);exit("error 'import_inc.php' __LINE__");}
      +00139         
      +00140                 $r=InsertJrnx($p_cn,"c",$p_user,$jrn,$poste_comptable,$date_exec,$montant,$seq,$periode);
      +00141                 if ( $r == false) { $Rollback($p_cn);exit("error 'import_inc.php' __LINE__");}
      +00142 
      +00143                 //remove annoying double-quote
      +00144                 $num_compte=str_replace('"','',$num_compte);
      +00145                 $code=str_replace('\"','',$code);
      +00146         
      +00147                 $r=InsertJrn($p_cn,$date_exec,NULL,$jrn,$num_compte." ".$code,$montant,$seq,$periode);
      +00148                 if ( $r == false ) { Rollback($p_cn); exit(" Error 'import_inc.php' __LINE__");}
      +00149                   
      +00150                 //$sql = "insert into jrn (jr_def_id,jr_montant,jr_comment,jr_date,jr_grpt_id,jr_tech_per) values ( ".$p_jrn.", abs(".round($montant,2)."), '".$num_compte." ".$code."','".$date_valeur."','".$seq."','".$periode."')";
      +00151                 SetInternalCode($p_cn,$seq,$jrn);
      +00152 
      +00153 
      +00154                 echo "Tranfer de l'opération ".$code." effectué<br/>";
      +00155                 $sql2 = "update import_tmp set ok=TRUE where code='".$code."'";
      +00156                 $Res2=ExecSql($p_cn,$sql2);
      +00157 
      +00158                 Commit($p_cn);
      +00159                 }
      +00160         }
      +00161 }
      +
      +

      +

      @@ -224,7 +339,13 @@ Update import_tmp with the bank account.

      Definition at line 60 of file import_inc.php.

      -References $code, $Res, $sql, and ExecSql(). +References $code, $Res, $sql, and ExecSql().

      00060                                         {
      +00061         $sql = "update import_tmp set poste_comptable='".$poste."' where code='".$code."'";
      +00062         $Res=ExecSql($p_cn,$sql);
      +00063 }
      +
      +

      +

      @@ -258,10 +379,32 @@ Verify the import.

      Definition at line 67 of file import_inc.php.

      -References $i, $Num, $Res, $sql, $val, ExecSql(), METHOD, name, size, table, value, and width. +References $i, $Num, $Res, $sql, $val, ExecSql(), METHOD, name, size, table, value, and width.

      00067                            {
      +00068         $sql = "select * from import_tmp where poste_comptable='' or poste_comptable is null";
      +00069         $Res=ExecSql($p_cn,$sql);
      +00070         $Num=pg_NumRows($Res);
      +00071         echo $Num." opérations à complèter.<br/><br/>";
      +00072         $i=1;
      +00073         while($val = pg_fetch_array($Res)){
      +00074                 echo '<form METHOD="POST" action="import.php?action=verif">';
      +00075                 echo '<input type="hidden" name="code" value="'.$val['code'].'">';
      +00076                 echo '<table border="1" width="500">';
      +00077                 echo '<tr><td width="200">'.$val['code'].'</td><td width="200">'.$val['date_exec'].'</td><td width="100">'.$val['montant'].' EUR</td><tr/>';
      +00078                 echo '<tr><td height="50" colspan="3">'.$val['detail'].'</td><tr/>';
      +00079                 echo '<tr><td>Poste Comptable : <input type="text" size="10" name="poste"></td>';
      +00080                 echo "<td>n° compte : ".$val['num_compte']."</td>";
      +00081                 echo '<td><input type="submit" value="modifier"></td><tr/>';
      +00082                 echo '</table>';
      +00083                 echo '</FORM>';
      +00084                 $i++;
      +00085         }
      +00086 }
      +
      +

      + -


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/impress__bilan_8php-source.html b/doc/developper/html/impress__bilan_8php-source.html index 0a1cf7c00..f555f0704 100644 --- a/doc/developper/html/impress__bilan_8php-source.html +++ b/doc/developper/html/impress__bilan_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_bilan.php Source File +phpcompta: impress_bilan.php Source File +include

      impress_bilan.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -61,7 +61,7 @@
       00059 echo '</FORM>';
       00060 echo '</div>';
       00061 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/impress__bilan_8php.html b/doc/developper/html/impress__bilan_8php.html index 79dc58026..5dd0068f2 100644 --- a/doc/developper/html/impress__bilan_8php.html +++ b/doc/developper/html/impress__bilan_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_bilan.php File Reference +phpcompta: impress_bilan.php File Reference +include

      impress_bilan.php File Reference

      form who call the printing of the bilan in RTF file included by user_impress More...

      @@ -244,7 +244,7 @@ Referenced by ExecuteScript() Definition at line 39 of file impress_bilan.php. -


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/impress__fiche_8php-source.html b/doc/developper/html/impress__fiche_8php-source.html index ad478eff1..398036b4f 100644 --- a/doc/developper/html/impress__fiche_8php-source.html +++ b/doc/developper/html/impress__fiche_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_fiche.php Source File +phpcompta: impress_fiche.php Source File +include

      impress_fiche.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -151,7 +151,7 @@
       00142  }
       00143 
       00144 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/impress__fiche_8php.html b/doc/developper/html/impress__fiche_8php.html index d55f8e0d6..b0251e759 100644 --- a/doc/developper/html/impress__fiche_8php.html +++ b/doc/developper/html/impress__fiche_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_fiche.php File Reference +phpcompta: impress_fiche.php File Reference +include

      impress_fiche.php File Reference

      Go to the source code of this file. @@ -407,7 +407,7 @@ Definition at line 5 Definition at line 66 of file impress_fiche.php.
      -


      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/impress__inc_8php-source.html b/doc/developper/html/impress__inc_8php-source.html index 8b5608d4c..bdf6ebbcf 100644 --- a/doc/developper/html/impress__inc_8php-source.html +++ b/doc/developper/html/impress__inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_inc.php Source File +phpcompta: impress_inc.php Source File +include

      impress_inc.php

      Go to the documentation of this file.
      00001 <?
       00002 /*
       00003  *   This file is part of PhpCompta.
      @@ -56,15 +56,15 @@
       00060       echo '<FORM ACTION=send_poste_pdf.php METHOD="GET">';
       00061   }
       00062   echo $periode;
      -00063   echo '<INPUT TYPE="HIDDEN" NAME="type" value="'.$type.'">';
      -00064   echo '<INPUT TYPE="HIDDEN" NAME="action" value="'.$action.'">';
      +00063   echo '<INPUT TYPE="HIDDEN" NAME="type" value="'.$type.'">';
      +00064   echo '<INPUT TYPE="HIDDEN" NAME="action" value="'.$action.'">';
       00065 
       00066   echo $centr;
       00067 
       00068   if ( isset($filter))
      -00069     echo '<INPUT TYPE="HIDDEN" NAME="filter" value="'.$filter.'">';
      +00069     echo '<INPUT TYPE="HIDDEN" NAME="filter" value="'.$filter.'">';
       00070   if ( isset ($p_id)) {
      -00071     echo '<INPUT TYPE="HIDDEN" NAME="p_id" value="'.$p_id.'">';
      +00071     echo '<INPUT TYPE="HIDDEN" NAME="p_id" value="'.$p_id.'">';
       00072   } else {
       00073     include_once("poste.php");
       00074     echo "<BR>";
      @@ -72,7 +72,7 @@
       00076     echo ' <BR>Tous les postes ';
       00077     echo '<INPUT TYPE="checkbox" NAME="all_poste"><BR>';
       00078   }
      -00079   echo '<INPUT TYPE="SUBMIT" name="print" Value="Executer">';
      +00079   echo '<INPUT TYPE="SUBMIT" name="print" Value="Executer">';
       00080 
       00081   echo '</FORM>';
       00082   echo "</DIV>";
      @@ -738,7 +738,7 @@
       00893 }
       00894 
       00895 ?>
      -

      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
      diff --git a/doc/developper/html/impress__inc_8php.html b/doc/developper/html/impress__inc_8php.html index 0ae4edb5c..e9785b85c 100644 --- a/doc/developper/html/impress__inc_8php.html +++ b/doc/developper/html/impress__inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/impress_inc.php File Reference +phpcompta: impress_inc.php File Reference +include

      impress_inc.php File Reference

      Go to the source code of this file. @@ -71,7 +71,34 @@ parm :

        Definition at line 869 of file impress_inc.php.

        -Referenced by AddForm(), ParseFormula(), and UpdateForm(). +Referenced by AddForm(), ParseFormula(), and UpdateForm().

        00869                                  {
        +00870   // the ereg gets too complex if we want to add a test
        +00871   // for parenthesis, math function...
        +00872   // So I prefer remove them before testing
        +00873   $p_string=str_replace("round","",$p_string);
        +00874   $p_string=str_replace("abs","",$p_string);
        +00875   $p_string=str_replace("(","",$p_string);
        +00876   $p_string=str_replace(")","",$p_string);
        +00877   // for  the inline test like $a=(cond)?value:other;
        +00878   $p_string=str_replace("?","+",$p_string);
        +00879   $p_string=str_replace(":","+",$p_string);
        +00880   $p_string=str_replace(">=","+",$p_string);
        +00881   $p_string=str_replace("<=","+",$p_string);
        +00882   $p_string=str_replace(">","+",$p_string);
        +00883   $p_string=str_replace("<","+",$p_string);
        +00884   // eat Space 
        +00885   $p_string=str_replace(" ","",$p_string);
        +00886 
        +00887   if ( ereg ("^(\\$[a-zA-Z]*[0-9]*=){0,1}((\[{0,1}[0-9]+\.*[0-9]*%{0,1}\]{0,1})+ *([+-\*/])* *(\[{0,1}[0-9]+\.*[0-9]*%{0,1}\]{0,1})*)*(([+-\*/])*\\$([a-zA-Z])+[0-9]*([+-\*/])*)* *( *FROM=[0-9][0-0].20[0-9][0-9]){0,1}$",$p_string) == false)
        +00888     {
        +00889       return false;
        +00890     } else {
        +00891       return true;
        +00892   }
        +00893 }
        +
        +

        +

      @@ -120,7 +147,43 @@ Definition at line 374

      References $cond, and $old.

      -Referenced by GetDataGrpt(), GetDataJrn(), GetDataJrnPdf(), and ImpHtml(). +Referenced by GetDataGrpt(), GetDataJrn(), GetDataJrnPdf(), and ImpHtml().

      00374                                                               {
      +00375   if ( count($p_periode) == 1) {
      +00376     return $p_field."=".$p_periode[0];
      +00377   }
      +00378 
      +00379   $cond_periode=" $p_field in (";
      +00380   // condition periode
      +00381   $old=0;
      +00382   $follow=0;
      +00383   foreach ( $p_periode as $per) {
      +00384     if ( $old == 0) { 
      +00385       $old=$per;
      +00386       $follow=1;
      +00387       continue;
      +00388     }
      +00389     if ( $per == $old+1 ) { 
      +00390       $old=$per;
      +00391       $follow++;
      +00392     }
      +00393     
      +00394   }// foreach
      +00395   if ( count($p_periode) == $follow) {
      +00396     $cond=$p_field." >= ".$p_periode[0].' and '.$p_field.' <= '.$p_periode[count($p_periode)-1];
      +00397     return $cond;
      +00398   }
      +00399 
      +00400   // condition periode
      +00401   foreach ( $p_periode as $per) {
      +00402     $cond_periode.=$per.",";
      +00403   }
      +00404   $cond_periode=substr($cond_periode,0,strlen($cond_periode)-1);
      +00405   $cond_periode.=")";
      +00406   return $cond_periode;
      +00407 }
      +
      +

      +

      @@ -163,7 +226,25 @@ parm :

        Definition at line 582 of file impress_inc.php.

        -References $array, $cond, $Max, $Res, CreatePeriodeCond(), and ExecSql(). +References $array, $cond, $Max, $Res, CreatePeriodeCond(), and ExecSql().

        00583 {
        +00584   if ( !isset ($p_array['periode']) ) return NO_PERIOD_SELECTED;
        +00585   $cond=CreatePeriodeCond($p_array['periode']);
        +00586   $Res=ExecSql($p_cn,"select distinct ".
        +00587                " j_grpt as grp".
        +00588                " from jrnx ".
        +00589                " where j_jrn_def=".$p_array['p_id'].
        +00590                " and ".$cond." order by j_grpt");
        +00591   $array=array();
        +00592   $Max=pg_NumRows($Res);
        +00593   $case="";
        +00594   for ($i=0;$i<$Max;$i++) {
        +00595     $array[]=pg_fetch_array($Res,$i);
        +00596   }
        +00597   return $array;
        +00598 }
        +
        +

        +

        @@ -220,7 +301,62 @@ Definition at line 308

        References $array, $cond, $Max, $Res, CreatePeriodeCond(), and ExecSql().

        -Referenced by ImpHtml(). +Referenced by ImpHtml().

        00309 {
        +00310   if ( !isset ($p_array['periode']) ) return NO_PERIOD_SELECTED;
        +00311 
        +00312   if ( $filter==YES) {
        +00313     if ( ! isset ( $p_array['central'])){
        +00314       $cond=CreatePeriodeCond($p_array['periode']);
        +00315       $Res=ExecSql($p_cn,"select to_char(j_date,'DD.MM.YYYY') as j_date,
        +00316                 j_montant as montant,j_debit as debit,j_poste as poste,".
        +00317                "j_text as description,j_grpt as grp,jr_comment as comment,
        +00318                 j_rapt as oc,jr_internal from jrnx left join jrn on ".
        +00319                "jr_grpt_id=j_grpt where j_jrn_def=".$p_array['p_id'].
        +00320                " and ".$cond." order by j_date::date,j_grpt,j_debit desc");
        +00321     } else {
        +00322       // create 
        +00323       $cond=CreatePeriodeCond($p_array['periode'],"c_periode");
        +00324 
        +00325       $Res=ExecSql($p_cn,"select to_char(c_date,'DD.MM.YYYY') as j_date,
        +00326                 c_montant as montant,c_debit as debit,c_poste as poste,".
        +00327                    "c_description as description,c_grp as grp,c_comment as comment,
        +00328                 c_rapt as oc,c_internal as jr_internal from centralized left join jrn on ".
        +00329                    "jr_grpt_id=c_grp where c_jrn_def=".$p_array['p_id']." and ".
        +00330                    $cond." order by c_id,c_date,c_grp,c_debit desc");
        +00331     }
        +00332     
        +00333   } // if filter == YES
        +00334   if ( $filter == NO) {
        +00335     if ( ! isset ($p_array['central']) ) {
        +00336       $cond=CreatePeriodeCond($p_array['periode']);
        +00337       $Res=ExecSql($p_cn,"select to_char(j_date,'DD.MM.YYYY') as j_date,
        +00338                 j_montant as montant,j_debit as debit,j_poste as poste,".
        +00339                    "j_text as description,j_grpt as grp,jr_comment as comment,
        +00340                 j_rapt as oc,jr_internal from jrnx left join jrn on ".
        +00341                    "jr_grpt_id=j_grpt where ".
        +00342                    $cond." order by j_date::date,j_grpt,j_debit desc");
        +00343     } else {
        +00344       $cond=CreatePeriodeCond($p_array['periode'],"c_periode");
        +00345 
        +00346       $Res=ExecSql($p_cn,"select to_char(c_date,'DD.MM.YYYY') as j_date,
        +00347                 c_montant as montant,c_debit as debit,c_poste as poste,".
        +00348                    "c_description as description,c_grp as grp,c_comment as comment,
        +00349                 c_rapt as oc,c_internal as jr_internal from centralized left join jrn on ".
        +00350                    "jr_grpt_id=c_grp where ".
        +00351                    $cond." order by c_id,c_date,c_grp,c_debit desc");
        +00352     
        +00353     } 
        +00354   }// filter == no
        +00355   $array=array();
        +00356   $Max=pg_NumRows($Res);
        +00357   for ($i=0;$i<$Max;$i++) {
        +00358     $array[]=pg_fetch_array($Res,$i);
        +00359   }
        +00360   return $array;
        +00361 }
        +
        +

        +

        @@ -282,7 +418,156 @@ gen :

          Definition at line 423 of file impress_inc.php.

          -References $a, $array, $cond, $Max, $Res, $Sql, CreatePeriodeCond(), echo_debug(), and ExecSql(). +References $a, $array, $cond, $Max, $Res, $Sql, CreatePeriodeCond(), echo_debug(), and ExecSql().

          00424 {
          +00425   echo_debug('impress_inc.php',__LINE__,"GetDataJrnPdf");
          +00426 
          +00427   if ( !isset ($p_array['periode']) ) return NO_PERIOD_SELECTED;
          +00428 
          +00429   if ( $p_array['filter']==YES) {
          +00430     $cond=CreatePeriodeCond($p_array['periode']);
          +00431     if ( ! isset ($p_array['central']) ) {
          +00432       // Journaux non centralisés
          +00433     $Res=ExecSql($p_cn,"select j_id,to_char(j_date,'DD.MM.YYYY') as j_date,
          +00434                       jr_internal,
          +00435                 case j_debit when 't' then j_montant::text else '   ' end as deb_montant,
          +00436                 case j_debit when 'f' then j_montant::text else '   ' end as cred_montant,
          +00437                 j_debit as debit,j_poste as poste,jr_montant , ".
          +00438                "pcm_lib as description,j_grpt as grp,jr_comment ,
          +00439                 jr_rapt as oc, j_tech_per as periode from jrnx left join jrn on ".
          +00440                  "jr_grpt_id=j_grpt ".
          +00441                  " left join tmp_pcmn on pcm_val=j_poste ".
          +00442                 " where j_jrn_def=".$p_array['p_id'].
          +00443                " and ".$cond." order by j_date::date asc,jr_internal,j_debit desc".
          +00444                " limit ".$p_limit." offset ".$p_offset);
          +00445     }else {
          +00446       // Journaux centralisés
          +00447       $cond=CreatePeriodeCond($p_array['periode'],"c_periode");
          +00448       $Sql="select c_id as j_id,
          +00449             c_j_id,
          +00450             to_char (c_date,'DD.MM.YYYY') as j_date ,
          +00451             c_internal as jr_internal,
          +00452             case c_debit when 't' then c_montant::text else '   ' end as deb_montant,
          +00453             case c_debit when 'f' then c_montant::text else '   ' end as cred_montant,
          +00454             c_debit as j_debit,
          +00455             c_poste as poste,
          +00456             pcm_lib as description,
          +00457             jr_comment,
          +00458             jr_montant,
          +00459             c_grp as grp,
          +00460             c_comment as comment,
          +00461             c_rapt as oc,
          +00462             c_periode as periode 
          +00463             from centralized left join jrn on ".
          +00464                 "jr_grpt_id=c_grp left join tmp_pcmn on pcm_val=c_poste where ".
          +00465                 " c_jrn_def=".$p_array['p_id']." and ".
          +00466                 $cond." order by c_id ";
          +00467     $Res=ExecSql($p_cn,$Sql." limit ".$p_limit." offset ".$p_offset);
          +00468 
          +00469     }
          +00470   } else {
          +00471     // Grand Livre
          +00472     if (! isset($p_array['central'])) {
          +00473       // Non centralisé
          +00474       $cond=CreatePeriodeCond($p_array['periode']);
          +00475       $Res=ExecSql($p_cn,"select j_id,to_char(j_date,'DD.MM.YYYY') as j_date,
          +00476                       jr_internal,
          +00477                 case j_debit when 't' then j_montant::text else '   ' end as deb_montant,
          +00478                 case j_debit when 'f' then j_montant::text else '   ' end as cred_montant,
          +00479                 j_debit as debit,j_poste as poste,".
          +00480                "pcm_lib as description,j_grpt as grp,jr_comment as jr_comment,
          +00481                 jr_montant,
          +00482                 jr_rapt as oc, j_tech_per as periode from jrnx left join jrn on ".
          +00483                  "jr_grpt_id=j_grpt left join tmp_pcmn on pcm_val=j_poste where ".
          +00484                "  ".$cond." order by j_date::date,j_grpt,j_debit desc".
          +00485                " limit ".$p_limit." offset ".$p_offset);
          +00486 
          +00487     } else {
          +00488       // Centralisé
          +00489       $cond=CreatePeriodeCond($p_array['periode'],"c_periode");
          +00490       $Sql="select c_id as j_id,
          +00491             c_j_id,
          +00492             to_char (c_date,'DD.MM.YYYY') as j_date ,
          +00493             c_internal as jr_internal,
          +00494             case c_debit when 't' then c_montant::text else '   ' end as deb_montant,
          +00495             case c_debit when 'f' then c_montant::text else '   ' end as cred_montant,
          +00496             c_debit as j_debit,
          +00497             c_poste as poste,
          +00498             pcm_lib as description,
          +00499             jr_comment,
          +00500             jr_montant,
          +00501             c_grp as grp,
          +00502             c_comment as comment,
          +00503             c_rapt as oc,
          +00504             c_periode as periode 
          +00505             from centralized left join jrn on ".
          +00506                 "jr_grpt_id=c_grp left join tmp_pcmn on pcm_val=c_poste where ".
          +00507                 $cond." order by c_id ";
          +00508     $Res=ExecSql($p_cn,$Sql." limit ".$p_limit." offset ".$p_offset);
          +00509     } // Grand Livre
          +00510   }
          +00511 
          +00512 
          +00513   $array=array();
          +00514   $Max=pg_NumRows($Res);
          +00515   if ($Max==0) return null;
          +00516   $case="";
          +00517   $tot_deb=0;
          +00518   $tot_cred=0;
          +00519   for ($i=0;$i<$Max;$i++) {
          +00520     $line=pg_fetch_array($Res,$i);
          +00521     $mont_deb=($line['deb_montant']!=0)?sprintf("% 8.2f",$line['deb_montant']):"";
          +00522     $mont_cred=($line['cred_montant']!=0)?sprintf("% 8.2f",$line['cred_montant']):"";
          +00523     $jr_montant=($line['jr_montant']!=0)?sprintf("% 8.2f",$line['jr_montant']):"";
          +00524     $tot_deb+=$line['deb_montant'];
          +00525     $tot_cred+=$line['cred_montant'];
          +00526     echo_debug('impress_inc.php',__LINE__," GetJrnDataPdf : mont_Deb ".$mont_deb);
          +00527     echo_debug('impress_inc.php',__LINE__," GetJrnDataPdf : mont_cred ".$mont_cred);
          +00528 
          +00529     if ( $case != $line['grp'] ) {
          +00530       $case=$line['grp'];
          +00531       $array[]=array (
          +00532                       'j_id'=>$line['j_id'],
          +00533                       'j_date' => $line['j_date'],
          +00534                       'internal'=>$line['jr_internal'],
          +00535                       'deb_montant'=>'',
          +00536                       'cred_montant'=>'<b><i>'.$jr_montant.'</i></b>',
          +00537                       'description'=>'<b><i>'.$line['jr_comment'].'</i></b>',
          +00538                       'poste' => $line['oc'],
          +00539                       'periode' =>$line['periode'] );
          +00540 
          +00541       $array[]=array (
          +00542                       'j_id'=>$line['j_id'], 
          +00543                       'j_date' => '',
          +00544                       'internal'=>'',
          +00545                       'deb_montant'=>$mont_deb,
          +00546                       'cred_montant'=>$mont_cred,
          +00547                       'description'=>$line['description'],
          +00548                       'poste' => $line['poste'],
          +00549                       'periode' => $line['periode']
          +00550                       );
          +00551     
          +00552     }else {
          +00553       $array[]=array (
          +00554                       'j_id'=>$line['j_id'],
          +00555                       'j_date' => '',
          +00556                       'internal'=>'',
          +00557                       'deb_montant'=>$mont_deb,
          +00558                       'cred_montant'=>$mont_cred,
          +00559                       'description'=>$line['description'],
          +00560                       'poste' => $line['poste'],
          +00561                       'periode' => $line['periode']);
          +00562 
          +00563     }
          +00564       
          +00565 
          +00566   }
          +00567   echo_debug('impress_inc.php',__LINE__,"Total debit $tot_deb,credit $tot_cred");
          +00568   $a=array($array,$tot_deb,$tot_cred);
          +00569  return $a;
          +00570 }
          +
          +

          +

          @@ -336,7 +621,35 @@ Definition at line 267

          References $array, $i, $Max, $Res, and ExecSql().

          -Referenced by ImpHtml(). +Referenced by ImpHtml().

          00268 {
          +00269   $Res=ExecSql($p_cn,"select to_char(j_date,'DD.MM.YYYY') as j_date,".
          +00270                "case when j_debit='t' then to_char(j_montant,'999999999.99') else ' ' end as deb_montant,".
          +00271                "case when j_debit='f' then to_char(j_montant,'999999999.99') else ' ' end as cred_montant,".
          +00272                " jr_comment as description,jrn_def_name as jrn_name,".
          +00273                "j_debit, jr_internal ".
          +00274 //             " case when j_debit='t' then 'debit' else 'credit' end as debit".
          +00275                " from jrnx left join jrn_def on jrn_def_id=j_jrn_def ".
          +00276                " left join jrn on jr_grpt_id=j_grpt".
          +00277                " where j_poste=".$p_poste." and ".$p_condition.
          +00278                " order by j_date::date");
          +00279   $array=array();
          +00280   $tot_cred=0;
          +00281   $tot_deb=0;
          +00282   $Max=pg_NumRows($Res);
          +00283   if ( $Max == 0 ) return null;
          +00284   for ($i=0;$i<$Max;$i++) {
          +00285     $array[]=pg_fetch_array($Res,$i);
          +00286     if ($array[$i]['j_debit']=='t') {
          +00287       $tot_deb+=$array[$i]['deb_montant'] ;
          +00288     } else {
          +00289       $tot_cred+=$array[$i]['cred_montant'] ;
          +00290     }
          +00291   }
          +00292   return array($array,$tot_deb,$tot_cred);
          +00293 }
          +
          +

          +

          @@ -399,7 +712,52 @@ Definition at line 814

          References $l, $Res, and ExecSql().

          -Referenced by ImpHtml(). +Referenced by ImpHtml().

          00815 {
          +00816   $aret=array();
          +00817   $l_debit=0;
          +00818   $l_credit=0;
          +00819     // somme debit
          +00820   $Res=ExecSql($p_cn,"select sum (j_montant) as montant from
          +00821                       jrnx where $p_cond and j_debit='t' and j_poste like '$p_formula'");
          +00822   if (pg_NumRows($Res)==0){
          +00823     $l_debit=0;                   
          +00824   } else {
          +00825     $l=pg_fetch_array($Res,0);
          +00826     $l_debit=$l['montant'];
          +00827       }
          +00828   // somme credit
          +00829   $Res=ExecSql($p_cn,"select sum (j_montant) as montant from
          +00830                       jrnx where $p_cond and j_debit='f' and j_poste like '$p_formula'");
          +00831   if (pg_NumRows($Res)==0) {
          +00832     $l_credit=0;                   
          +00833   } else {
          +00834     $l=pg_fetch_array($Res,0);
          +00835     $l_credit=$l['montant'];
          +00836   }
          +00837 
          +00838   if ( $l_credit==$l_debit) {
          +00839     $aret=array('desc' => $p_label,
          +00840                 'montant' => '0',
          +00841                 'cmontant'=>0);
          +00842   }
          +00843   if ( $l_credit < $l_debit) {
          +00844     $l2=sprintf("% .2f",$l_debit-$l_credit);
          +00845     $aret=array('desc' => $p_label,
          +00846                 'montant' => $l2,
          +00847                 'cmontant'=>$l2);
          +00848   }
          +00849   if ( $l_credit>$l_debit) {
          +00850     $l2=sprintf("(% .2f)",$l_credit-$l_debit);
          +00851     $aret=array('desc' => $p_label,
          +00852                 'montant' => $l2,
          +00853                 'cmontant'=> $l_debit-$l_credit);
          +00854 
          +00855   }
          +00856   return $aret;
          +00857 }
          +
          +

          +

          @@ -478,7 +836,101 @@ $p_jrnx_id jrnx.j_id

            Definition at line 616 of file impress_inc.php.

            -References $a, $Res, $sql, CountSql(), echo_debug(), and ExecSql(). +References $a, $Res, $sql, CountSql(), echo_debug(), and ExecSql().

            00617 {
            +00618   include_once("preference.php");
            +00619 
            +00620   if ( $which == LAST) 
            +00621     $cmp="<="; 
            +00622   else
            +00623     $cmp="<";
            +00624 
            +00625   if ( $p_type == 1 ) {
            +00626     // Vue filtree => Journaux
            +00627     if ( $p_central == 0 ) { // Vue non centralisée
            +00628           return array(0,0);
            +00629     } // p_central == 0
            +00630 
            +00631     //     Vue filtree => Journaux & Jrn centralisé 
            +00632     if ( $p_central == 1 ) {
            +00633       $c_line=CountSql($p_cn,"select * from centralized left join parm_periode on c_periode=p_id ".
            +00634                        " where c_jrn_def=$p_jrn_id and  p_exercice='".$p_exercice."'".
            +00635                        " and c_order $cmp $p_jrnx_id ");
            +00636       
            +00637       if ($c_line == 0 ) { return array (0,0); }
            +00638       $sql="select sum(c_montant) as tot_amount ".
            +00639         " from centralized ".
            +00640         " left join parm_periode on c_periode=p_id ".
            +00641         " inner join jrn on jr_grpt_id=c_grp ".
            +00642         " where c_jrn_def=$p_jrn_id and ".
            +00643         " p_exercice='".$p_exercice."'".
            +00644         " and c_order $cmp $p_jrnx_id " ;
            +00645       $Res=ExecSql($p_cn,$sql." and c_debit='t' ");
            +00646       if ( pg_NumRows($Res) == 0 ) 
            +00647         $deb=0;
            +00648       else {
            +00649         $line=pg_fetch_array($Res,0);
            +00650         $deb=$line['tot_amount'];
            +00651       }
            +00652       
            +00653       $Res=ExecSql($p_cn,$sql." and c_debit='f' ");
            +00654       if ( pg_NumRows($Res) == 0 ) 
            +00655         $cred=0;
            +00656       else {
            +00657         
            +00658         $line=pg_fetch_array($Res,0);
            +00659         $cred=$line['tot_amount'];
            +00660       }
            +00661       echo_debug('impress_inc.php',__LINE__,"MONTANT $deb,$cred");
            +00662       $a=array($deb,$cred);
            +00663       return $a;
            +00664 
            +00665     }
            +00666   } // Type = jrn
            +00667   if ($p_type==0 ) { // Si Grand Livre, prendre donnée centralisée{
            +00668     if ( $p_central == 1) {
            +00669       $c_line=CountSql($p_cn,"select * from centralized left join parm_periode on c_periode=p_id ".
            +00670                        "where p_exercice='".$p_exercice."'".
            +00671                        " and c_id $cmp $p_jrnx_id ");
            +00672       
            +00673       if ($c_line == 0 ) { return array (0,0); }
            +00674       $sql="select sum(c_montant) as tot_amount ".
            +00675         " from centralized ".
            +00676         " left join parm_periode on c_periode=p_id ".
            +00677         " where ".
            +00678         " p_exercice='".$p_exercice."'".
            +00679         " and c_order $cmp $p_jrnx_id " ;
            +00680       $Res=ExecSql($p_cn,$sql." and c_debit='t' ");
            +00681       if ( pg_NumRows($Res) == 0 ) 
            +00682         $deb=0;
            +00683       else {
            +00684         $line=pg_fetch_array($Res,0);
            +00685         $deb=$line['tot_amount'];
            +00686       }
            +00687       
            +00688       $Res=ExecSql($p_cn,$sql." and c_debit='f' ");
            +00689       if ( pg_NumRows($Res) == 0 ) 
            +00690         $cred=0;
            +00691       else {
            +00692         
            +00693         $line=pg_fetch_array($Res,0);
            +00694         $cred=$line['tot_amount'];
            +00695       }
            +00696       echo_debug('impress_inc.php',__LINE__,"MONTANT $deb,$cred");
            +00697       $a=array($deb,$cred);
            +00698       return $a;
            +00699     } // central == 1
            +00700     else // Donnée non centralisée => pas de rappel
            +00701       {
            +00702         if ($p_central== 0) { // Si Grand Livre, prendre donnée non centralisée{
            +00703           return array(0,0);
            +00704         }
            +00705       }//else
            +00706   } // if type==0
            +00707   
            +00708 }
            +
            +

            +

            @@ -525,7 +977,18 @@ db connection gen :

              Definition at line 97 of file impress_inc.php.

              -References echo_error(), and ImpHtml(). +References echo_error(), and ImpHtml().

              00097                              {
              +00098   if ( ! isset($p_array['action'])) {
              +00099     echo_error ("IMP no action specified"); return;
              +00100   }
              +00101   if ( $p_array['action']=="viewhtml") {
              +00102     return ImpHtml($p_array,$p_cn);
              +00103   }
              +00104   echo_error ("IMP no action specified"); return;
              +00105 }
              +
              +

              +

              @@ -574,7 +1037,143 @@ Definition at line 119

              References $array, $c, $col, $cond, $i, $l_line, $Max, $nPoste, $poste, $Res, $ret, $solde, CreatePeriodeCond(), echo_debug(), ExecSql(), GetDataJrn(), GetDataPoste(), GetFormulaValue(), and GetPosteLibelle().

              -Referenced by Imp(). +Referenced by Imp().

              00120 {
              +00121   foreach($p_array as $key=>$element) {
              +00122     ${"$key"}=$element;
              +00123     echo_debug('impress_inc.php',__LINE__,"ImpHtml $key => $element");
              +00124   }
              +00125 
              +00126 
              +00127   $colvide="<TD></TD>";
              +00128   // formulaire
              +00129   if ( $type == "form" ) {
              +00130     if ( !isset ($periode)) return NO_PERIOD_SELECTED;
              +00131     $cond=CreatePeriodeCond($periode);
              +00132     $Res=ExecSql($p_cn,"select fo_id , 
              +00133                      fo_fr_id, 
              +00134                      fo_pos, 
              +00135                      fo_label, 
              +00136                      fo_formula,
              +00137                      fr_label from form 
              +00138                       inner join formdef on fr_id=fo_fr_id
              +00139                      where fo_fr_id=$p_id
              +00140                      order by fo_pos");
              +00141     $Max=pg_NumRows($Res);
              +00142     if ($Max==0) return $ret="";
              +00143     for ($i=0;$i<$Max;$i++) {
              +00144       $l_line=pg_fetch_array($Res,$i);
              +00145       $col=GetFormulaValue($p_cn,
              +00146                    $l_line['fo_label'],
              +00147                    $l_line['fo_formula'],$cond);
              +00148       echo "<div>";
              +00149       foreach ($col as $key=> $element) {
              +00150         echo "$element ";
              +00151       }
              +00152       echo "</div>";
              +00153     } //for ($i
              +00154 
              +00155   }//form
              +00156   if ($type=="poste") { 
              +00157     if ( ! isset ( $all_poste) && ! isset ( $poste )) return NO_POST_SELECTED;
              +00158     if ( !isset ($periode)) return NO_PERIOD_SELECTED;
              +00159     include_once("poste.php");
              +00160     $cond=CreatePeriodeCond($periode);
              +00161     $ret="" ;
              +00162     if ( isset ( $all_poste) ){ //choisit de voir tous les postes
              +00163       $r_poste=ExecSql($p_cn,"select pcm_val from tmp_pcmn");
              +00164       $nPoste=pg_numRows($r_poste);
              +00165       for ( $i=0;$i<$nPoste;$i++) {
              +00166         $t_poste=pg_fetch_array($r_poste,$i);
              +00167         $poste[]=$t_poste['pcm_val'];
              +00168       } 
              +00169     }      
              +00170     for ( $i =0;$i<count($poste);$i++) {
              +00171       list ($array,$tot_deb,$tot_cred)=GetDataPoste($p_cn,$poste[$i],$cond);
              +00172       if ( count($array) == 0) continue;
              +00173       $ret.=sprintf("<H2 class=\"info\">%d %s</H2>",
              +00174                     $poste[$i],GetPosteLibelle($p_cn,$poste[$i],1));
              +00175       $ret.="<TABLE style=\"border-bottom-style:solid; border-width:2px\" >";
              +00176       $i=0;
              +00177       foreach ($array as $col=>$element) {
              +00178         $i++;
              +00179         if ( $i %2 == 0) 
              +00180           $ret.="<tr class=\"even\">";
              +00181         else
              +00182           $ret.="<TR class=\"odd\">";
              +00183         $ret.=sprintf("<TD>%s</TD>",$element['j_date']);
              +00184         $ret.=sprintf("<TD>%s</TD>",$element['jr_internal']);
              +00185         //      $ret.=sprintf("<TD>jrn:%s</TD>",$element['jrn_name']);
              +00186         $ret.=sprintf("<TD>%s</TD>",$element['description']);
              +00187         if ( $element['j_debit']=='t') {
              +00188           $ret.=sprintf("<TD> debit</TD><TD ALIGN=\"right\">   % 8.2f</TD> $colvide",
              +00189                         $element['deb_montant']);
              +00190         } else {
              +00191           $ret.=sprintf("<TD>credit</TD> $colvide <TD ALIGN=\"right\">  % 8.2f</TD>",
              +00192                         $element['cred_montant']);
              +00193           
              +00194         }
              +00195         $ret.="</TR>";
              +00196       }//foreach
              +00197       
              +00198       $ret.=sprintf("$colvide $colvide $colvide $colvide ".
              +00199                     "<TD ALIGN=\"right\">% 8.2f</TD>".
              +00200                     "<TD ALIGN=\"right\">% 8.2f</TD>",
              +00201                     $tot_deb,
              +00202                     $tot_cred);
              +00203       $ret.="</TABLE>";
              +00204       $ret.="<p>Total débit :".$tot_deb."   Total Crédit:".$tot_cred."</p>";     
              +00205       if ( $tot_deb > $tot_cred ) {
              +00206         $solde_t="D"; 
              +00207         $solde=$tot_deb-$tot_cred;
              +00208         }else {
              +00209         $solde_t="C";
              +00210         $solde=$tot_cred-$tot_deb;
              +00211         }
              +00212       $ret.=" <p><B> Solde  $solde_t = ".$solde."</B></p>";
              +00213     }// for i
              +00214     return $ret;
              +00215   }//poste
              +00216   if ($type=="jrn") {
              +00217     if ( !isset ($periode)) return NO_PERIOD_SELECTED;
              +00218 
              +00219     echo_debug('impress_inc.php',__LINE__,"imp html journaux");
              +00220     $ret="";
              +00221     if (isset($filter)) {
              +00222       $array=GetDataJrn($p_cn,$p_array,$filter);
              +00223     }
              +00224     $cass="";
              +00225     $c=0;
              +00226 
              +00227     foreach ($array as $a=>$e2) {
              +00228       //      echo_debug($ret);
              +00229       
              +00230       //cassure entre op
              +00231       if ( $cass!=$e2['grp'] ) {
              +00232         $cass=$e2['grp'];
              +00233         $ret.='<TR style="background-color:#89BEFF"><TD>'.$e2['j_date']."</TD>";
              +00234         $ret.="<TD>".$e2['jr_internal']."</TD><TD COLSPAN=4> ".$e2['comment']."</TD></TR>";     
              +00235       }
              +00236       $ret.="<TR>";
              +00237       $ret.=$colvide;
              +00238       
              +00239       if ($e2['debit']=='f') $ret.=$colvide;
              +00240       $ret.="<TD>".$e2['poste']."</TD>";
              +00241       if ($e2['debit']=='t') $ret.=$colvide;
              +00242       $ret.="<TD>".$e2['description']."</TD>";
              +00243       if ($e2['debit']=='f') $ret.=$colvide;
              +00244       $ret.="<TD>".$e2['montant']."</TD>";
              +00245       if ($e2['debit']=='t') $ret.=$colvide;
              +00246       $ret.="</TR>";
              +00247     }
              +00248     echo_debug($ret);
              +00249 
              +00250     return $ret ;
              +00251   }//jrn
              +00252 
              +00253 }
              +
              +

              +

              @@ -651,7 +1250,80 @@ Definition at line 726

              References $cond, $e, $i, $ret, $User, $x, CheckFormula(), DbConnect(), echo_debug(), ExecSql(), getPeriodeFromMonth(), and poste.

              -Referenced by rapport::GetRow(). +Referenced by rapport::GetRow().

              00726                                                                               {
              +00727   if ( CheckFormula($p_formula) == false) {
              +00728     if ( $p_eval == true)
              +00729       return array('desc'=>$p_label.'  Erreur Formule!',
              +00730                 'montant'=>0);
              +00731     else
              +00732       return $p_formula;
              +00733     
              +00734   }
              +00735 
              +00736   if ( $p_start == $p_end ) 
              +00737     $cond=" j_tech_per = $p_start ";
              +00738   else
              +00739     $cond = "(j_tech_per >= $p_start and j_tech_per <= $p_end) ";
              +00740   
              +00741   while (ereg("(\[[0-9]*%*\])",$p_formula,$e) == true) {
              +00742     include_once("class_poste.php");
              +00743     // remove the [ ] 
              +00744     $x=$e;
              +00745     $e[0]=str_replace ("[","",$e[0]);
              +00746     $e[0]=str_replace ("]","",$e[0]);
              +00747 
              +00748     // If there is a FROM clause we must recompute 
              +00749     // the time cond
              +00750     if ( ereg ("FROM=[0-9]+\.[0-9]+", $p_formula,$afrom) == true ){
              +00751       // There is a FROM clause 
              +00752       // then we must modify the cond for the periode
              +00753       $from=str_replace("FROM=","",$afrom[0]);
              +00754       // Get the periode 
              +00757       $from=getPeriodeFromMonth($p_cn,$from);
              +00758       if ( $from == '0000.00' ) {
              +00759         $User=new cl_user(DbConnect());
              +00760         $user_periode=$User-getPeriode();
              +00761         $sql_per="select min(p_id) from parm_periode where ".
              +00762           " p_exercice='".$user_periode."'";
              +00763         $ret=ExecSql($p_cn);
              +00764         $per="01".$user_periode;
              +00765         $cond="";
              +00766       } 
              +00767       else 
              +00768         {
              +00769           // the clause from is something else
              +00770           //  Compute the cond
              +00771           if ( $from == $p_end ) 
              +00772             $cond=" j_tech_per = $from ";
              +00773           else
              +00774             $cond = "(j_tech_per >= $from and j_tech_per <= $p_end) ";
              +00775         }
              +00776       // We remove FROM out of the p_formula
              +00777       $p_formula=substr_replace($p_formula,"",strpos($p_formula,"FROM"));
              +00778     }
              +00779       // Get sum of account
              +00780     $P=new poste($p_cn,$e[0]);
              +00781     $i=$P->GetSolde($cond);
              +00782     $p_formula=str_replace($x,$i,$p_formula);
              +00783   }
              +00784 
              +00785   // $p_eval is true then we eval and returns result
              +00786   if ( $p_eval == true) {
              +00787     $p_formula="\$result=".$p_formula.";";
              +00788     echo_debug('impress_inc.php',__LINE__, $p_formula);
              +00789     
              +00790     eval("$p_formula");
              +00791     $aret=array('desc'=>$p_label,
              +00792                 'montant'=>$result);
              +00793     return $aret;
              +00794   } else {
              +00795     // $p_eval is false we returns only the string
              +00796     return $p_formula;
              +00797   }
              +00798 }
              +
              +

              +

              @@ -698,10 +1370,60 @@ connection gen :

              -
              Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:21 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/index_8php-source.html b/doc/developper/html/index_8php-source.html index 1c3d9b1c9..90667869f 100644 --- a/doc/developper/html/index_8php-source.html +++ b/doc/developper/html/index_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/index.php Source File +phpcompta: index.php Source File +html

              index.php

              Go to the documentation of this file.
              00001 
               00002 <?
               00049 echo '<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 3.2 FINAL//EN">
              @@ -56,19 +56,19 @@
               00093         <IMG SRC="image/logo7.jpg" alt="Logo">
               00094 <BR>
               00095 
              -00096 <form action="login.php" method="post" name="loginform">
              +00096 <form action="login.php" method="post" name="loginform">
               00097 <TABLE><TR><TD>
               00098 <TABLE  BORDER=0 CELLSPACING=0>
               00099 <TR>
               00100 <TD class="cell">Login</TD>
              -00101 <TD><input type="text" name="p_user" tabindex="1"></TD>
              +00101 <TD><input type="text" name="p_user" tabindex="1"></TD>
               00102 </TR>
               00103 <TR>
               00104 <TD> Password</TD>
               00105 <TD><INPUT TYPE="PASSWORD" NAME="p_pass" tabindex="2"></TD>
               00106 </TR>
               00107 <TR>
              -00108 <TD COLSPAN=2 ALIGN=CENTER><INPUT TYPE=SUBMIT  NAME="login" value="Log in"></TD>
              +00108 <TD COLSPAN=2 ALIGN=CENTER><INPUT TYPE=SUBMIT  NAME="login" value="Log in"></TD>
               00109 </TR>
               00110 </table>
               00111 </TD></TR></TABLE>
              @@ -78,7 +78,7 @@
               00115 </html>';
               00116 
               00117 ?>
              -

              Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/index_8php.html b/doc/developper/html/index_8php.html index 5d08eb077..f85b092f6 100644 --- a/doc/developper/html/index_8php.html +++ b/doc/developper/html/index_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/index.php File Reference +phpcompta: index.php File Reference +html

              index.php File Reference

              default page where user access More...

              @@ -19,7 +19,7 @@ default page where user access

              -Definition in file index.php.


              Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file index.php.
              Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/info_8php-source.html b/doc/developper/html/info_8php-source.html index 73273214d..9db5b96ee 100644 --- a/doc/developper/html/info_8php-source.html +++ b/doc/developper/html/info_8php-source.html @@ -1,16 +1,16 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/info.php Source File +phpcompta: info.php Source File +html

              info.php

              Go to the documentation of this file.
              00001 <?
               00002 phpinfo();
               00003 ?>
              -

              Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/info_8php.html b/doc/developper/html/info_8php.html index cbbe91d3a..dc67403bc 100644 --- a/doc/developper/html/info_8php.html +++ b/doc/developper/html/info_8php.html @@ -1,18 +1,18 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/info.php File Reference +phpcompta: info.php File Reference +html

              info.php File Reference

              Go to the source code of this file.
              -


              Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/ing__be_8inc_8php-source.html b/doc/developper/html/ing__be_8inc_8php-source.html index f431fb127..f005d5312 100644 --- a/doc/developper/html/ing__be_8inc_8php-source.html +++ b/doc/developper/html/ing__be_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/ing_be.inc.php Source File +phpcompta: ing_be.inc.php Source File +include

              ing_be.inc.php

              Go to the documentation of this file.
              00001 <?
               00002 /*
               00003  *   This file is part of PhpCompta.
              @@ -124,7 +124,7 @@
               00119 } // file is read
               00120 fclose($handle);
               00121 ?>
              -

              Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/ing__be_8inc_8php.html b/doc/developper/html/ing__be_8inc_8php.html index bf0d6979b..e76ec540f 100644 --- a/doc/developper/html/ing__be_8inc_8php.html +++ b/doc/developper/html/ing__be_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/ing_be.inc.php File Reference +phpcompta: ing_be.inc.php File Reference +include

              ing_be.inc.php File Reference

              File to be included to parse CSV from ING Belgium. More...

              @@ -318,7 +318,7 @@ Definition at line 29< Definition at line 83 of file ing_be.inc.php. -


              Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/jrn_8php-source.html b/doc/developper/html/jrn_8php-source.html index 959fde294..76476c271 100644 --- a/doc/developper/html/jrn_8php-source.html +++ b/doc/developper/html/jrn_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/jrn.php Source File +phpcompta: jrn.php Source File +include

              jrn.php

              Go to the documentation of this file.
              00001 <?
               00002 /*
               00003  *   This file is part of PhpCompta.
              @@ -115,14 +115,14 @@
               00123     echo "<tr>";
               00124     echo "<TD>";
               00125     printf ('<SELECT NAME="class_deb%d">',$i);
              -00126     foreach ( $poste as $key => $value){ 
              +00126     foreach ( $poste as $key => $value){ 
               00127       $selected="";
               00128       if ( ${"e_class_deb$i"} == $key ) $selected="SELECTED";
               00129       $a=sprintf('<OPTION VALUE="%s" %s >%s - % .40s',
               00130              $key,
               00131              $selected,
               00132              $key,
              -00133              $value);
              +00133              $value);
               00134       echo $a;
               00135     }
               00136     echo "</SELECT>";
              @@ -182,14 +182,14 @@
               00190     echo "<tr>";
               00191     echo "<TD>";
               00192     printf ('<SELECT NAME="class_cred%d">',$i);
              -00193     foreach ( $poste_c as $key => $value){ 
              +00193     foreach ( $poste_c as $key => $value){ 
               00194       $selected="";
               00195       if ( ${"e_class_cred$i"} == $key ) $selected="SELECTED";
               00196       $a=sprintf('<OPTION VALUE="%s" %s >%s - % .40s',
               00197              $key,
               00198              $selected,
               00199              $key,
              -00200              $value);
              +00200              $value);
               00201       echo $a;
               00202     }
               00203         
              @@ -223,7 +223,7 @@
               00231   }
               00232 
               00233   echo '<TR><TD colspan="2">
              -00234          rapprochement : <INPUT TYPE="TEXT" name="rapt" value="'.$e_rapt.'">'.$search.'</TD></TR>';
              +00234          rapprochement : <INPUT TYPE="TEXT" name="rapt" value="'.$e_rapt.'">'.$search.'</TD></TR>';
               00235   echo "</TABLE>";
               00236 
               00237   // To avoid problem with unknown variable
              @@ -282,11 +282,11 @@
               00305         $r.=$content['jr_date'];
               00306         $r.="</TD>";
               00307         // for upload document we need the grpt_id   
              -00308         $r.='<Input type="hidden" name="jr_grpt_id" value="'.$content['jr_grpt_id'].'">';
              +00308         $r.='<Input type="hidden" name="jr_grpt_id" value="'.$content['jr_grpt_id'].'">';
               00309 
               00310         // comment can be changed
               00311         $r.="<TD>";
              -00312         $r.='<INPUT TYPE="TEXT" name="comment" value="';
              +00312         $r.='<INPUT TYPE="TEXT" name="comment" value="';
               00313         $r.=$content['jr_comment'];
               00314         $r.='" SIZE="25">';
               00315         $r.="</TD>";
              @@ -302,7 +302,7 @@
               00325             // Is Paid
               00326             $r.="<TD>";
               00327             $check=( $content['jr_rapt'] != null )?"CHECKED":"UNCHECKED";
              -00328             $r.='<TD>Payé <INPUT TYPE="CHECKBOX" name="is_paid" '.$check.'></TD>';
              +00328             $r.='<TD>Payé <INPUT TYPE="CHECKBOX" name="is_paid" '.$check.'></TD>';
               00329           }
               00330         $r.="</TR>";
               00331         $r.="</TABLE>";
              @@ -324,7 +324,7 @@
               00347     $file=new widget("file");
               00348     $file->table=1;
               00349         //document
              -00350     $r.='<TD>A effacer <INPUT TYPE="CHECKBOX" name="to_remove" ></TD>';
              +00350     $r.='<TD>A effacer <INPUT TYPE="CHECKBOX" name="to_remove" ></TD>';
               00351     $r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s">%s</A>',
               00352                 $content['jr_id'],
               00353                 $content['jr_grpt_id'],
              @@ -354,7 +354,7 @@
               00377     foreach ($a as $key => $element) {
               00378       $r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="viewDetail(\'%s\',\'%s\')">', 
               00379                    GetInternal($p_cn,$element),GetGrpt($p_cn,$element),$sessid);
              -00380       $r.=sprintf('<INPUT TYPE="button" value="Efface" onClick="dropLink(\'%s\',\'%s\',\'%s\')"><BR>',
              +00380       $r.=sprintf('<INPUT TYPE="button" value="Efface" onClick="dropLink(\'%s\',\'%s\',\'%s\')"><BR>',
               00381                   $content['jr_id'],$element,$sessid);
               00382     }//for
               00383     $r.= "</div>";
              @@ -370,8 +370,8 @@
               00393   $search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."','rapt')\">";
               00394 
               00395   $r.= '<H2 class="info">rapprochement </H2> 
              -00396        <INPUT TYPE="TEXT" name="rapt" value="">'.$search;
              -00397   $r.='<input type="hidden" name="jr_id" value="'.$content['jr_id'].'">';
              +00396        <INPUT TYPE="TEXT" name="rapt" value="">'.$search;
              +00397   $r.='<input type="hidden" name="jr_id" value="'.$content['jr_id'].'">';
               00398 
               00399   //  echo $r;
               00400   return $r;
              @@ -679,7 +679,7 @@
               00842   }
               00843   // Montre ce qu'on a encodé et demande vérif
               00844   $next="";
              -00845   foreach ( $p_array as $name=>$element ) {
              +00845   foreach ( $p_array as $name=>$element ) {
               00846       echo_debug('jrn.php',__LINE__,"element $name -> $element ");
               00847       // Sauve les données dans des variables
               00848       ${"p_$name"}=$element;
              @@ -805,7 +805,7 @@
               01020   return $ret_array;
               01021 }
               01022 ?>
              -

              Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
              Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
              diff --git a/doc/developper/html/jrn_8php.html b/doc/developper/html/jrn_8php.html index 7e7b64d09..9b126a612 100644 --- a/doc/developper/html/jrn_8php.html +++ b/doc/developper/html/jrn_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/jrn.php File Reference +phpcompta: jrn.php File Reference +include

              jrn.php File Reference

              work with the ledger More...

              @@ -144,7 +144,13 @@ parm :

                Definition at line 436 of file jrn.php.

                -References RecordJrn(). +References RecordJrn().

                00437 {
                +00438 
                +00439    RecordJrn($p_dossier,$p_user,$p_jrn,$p_MaxDeb,$p_MaxCred,$p_array);
                +00440 }
                +
                +

                +

                @@ -192,7 +198,15 @@ p_id = jrn.jr_internal gen :

                  Definition at line 814 of file jrn.php.

                  -References $l_line, $Res, and ExecSql(). +References $l_line, $Res, and ExecSql().

                  00814                                 {
                  +00815   $Res=ExecSql($p_cn,"select jr_montant from jrn where jr_internal='$p_id'");
                  +00816   if (pg_NumRows($Res)==0) return -1;
                  +00817   $l_line=pg_fetch_array($Res,0);
                  +00818   return $l_line['jr_montant'];
                  +00819 }
                  +
                  +

                  +

                  @@ -240,7 +254,61 @@ p_grpt gen :

                    Definition at line 711 of file jrn.php.

                    -References $l_id, $l_line, $MaxLine, $Res, echo_debug(), and ExecSql(). +References $l_id, $l_line, $MaxLine, $Res, echo_debug(), and ExecSql().

                    00711                                  {
                    +00712   echo_debug('jrn.php',__LINE__,"GetData $p_cn $p_grpt");
                    +00713   $Res=ExecSql($p_cn,"select 
                    +00714                         to_char(j_date,'DD.MM.YYYY') as j_date,
                    +00715                         j_text,
                    +00716                         j_debit,
                    +00717                         j_poste,
                    +00718                         j_montant,
                    +00719                         j_id,
                    +00720                         jr_comment,
                    +00721                         to_char(jr_ech,'DD.MM.YYYY') as jr_ech,
                    +00722                         to_char(jr_date,'DD.MM.YYYY') as jr_date,
                    +00723                         jr_id,jr_internal,jr_def_id
                    +00724                      from jrnx inner join jrn on j_grpt=jr_grpt_id where j_grpt=$p_grpt");
                    +00725   $MaxLine=pg_NumRows($Res);
                    +00726   if ( $MaxLine == 0 ) return null;
                    +00727   $deb=0;$cred=0;
                    +00728   for ( $i=0; $i < $MaxLine; $i++) {
                    +00729     
                    +00730     $l_line=pg_fetch_array($Res,$i);
                    +00731     $l_array['op_date']=$l_line['j_date'];
                    +00732     if ( $l_line['j_debit'] == 't' ) {
                    +00733       $l_class=sprintf("class_deb%d",$deb);
                    +00734       $l_montant=sprintf("mont_deb%d",$deb);
                    +00735       $l_text=sprintf("text_deb%d",$deb);
                    +00736       $l_array[$l_class]=$l_line['j_poste'];
                    +00737       $l_array[$l_montant]=$l_line['j_montant'];
                    +00738       $l_array[$l_text]=$l_line['j_text'];
                    +00739       $l_id=sprintf("op_deb%d",$deb);
                    +00740       $l_array[$l_id]=$l_line['j_id'];
                    +00741       $deb++;
                    +00742     }
                    +00743     if ( $l_line['j_debit'] == 'f' ) {
                    +00744       $l_class=sprintf("class_cred%d",$cred);
                    +00745       $l_montant=sprintf("mont_cred%d",$cred);
                    +00746       $l_array[$l_class]=$l_line['j_poste'];
                    +00747       $l_array[$l_montant]=$l_line['j_montant'];
                    +00748       $l_id=sprintf("op_cred%d",$cred);
                    +00749       $l_array[$l_id]=$l_line['j_id'];
                    +00750       $l_text=sprintf("text_cred%d",$deb);
                    +00751       $l_array[$l_text]=$l_line['j_text'];
                    +00752 
                    +00753       $cred++;
                    +00754     }
                    +00755     $l_array['jr_internal']=$l_line['jr_internal'];
                    +00756     $l_array['comment']=$l_line['jr_comment'];
                    +00757     $l_array['ech']=$l_line['jr_ech'];
                    +00758     $l_array['jr_id']=$l_line['jr_id'];
                    +00759     $l_array['jr_def_id']=$l_line['jr_def_id'];
                    +00760    }
                    +00761   return array($l_array,$deb,$cred);
                    +00762 }
                    +
                    +

                    +

                    @@ -290,7 +358,58 @@ Definition at line 973 of f

                    References $array, $i, $MaxLine, $Res, echo_debug(), and ExecSql().

                    -Referenced by UpdateJrn(). +Referenced by UpdateJrn().

                    00973                                          {
                    +00974   echo_debug('jrn.php',__LINE__,"GetDataJrn $p_cn $p_jr_id");
                    +00975   $Res=ExecSql($p_cn,"select 
                    +00976                         j_text,
                    +00977                         j_debit,
                    +00978                         j_poste,
                    +00979                        pcm_lib as vw_name,
                    +00980                         j_montant,
                    +00981                         jr_montant,
                    +00982                         j_id,
                    +00983                         jr_pj_name,
                    +00984                         jr_grpt_id,
                    +00985                         jr_comment,
                    +00986                         to_char(jr_ech,'DD.MM.YYYY') as jr_ech,
                    +00987                         to_char(jr_date,'DD.MM.YYYY') as jr_date,
                    +00988                         jr_id,jr_internal, jr_rapt,jrn_def_type
                    +00989                      from 
                    +00990                           jrnx 
                    +00991                         inner join jrn on j_grpt=jr_grpt_id 
                    +00992                         inner join jrn_def on jrn_def.jrn_def_id=jrn.jr_def_id
                    +00993                         left outer join tmp_pcmn on  j_poste=pcm_val
                    +00994                       where 
                    +00995                          jr_id=$p_jr_id 
                    +00996                       order by j_debit desc");
                    +00997   $MaxLine=pg_NumRows($Res);
                    +00998   echo_debug('jrn.php',__LINE__,"Found $MaxLine lines");
                    +00999   if ( $MaxLine == 0 ) return null;
                    +01000 
                    +01001   for ( $i=0; $i < $MaxLine; $i++) {
                    +01002     $line=pg_fetch_array($Res,$i);
                    +01003     $array['j_debit']=$line['j_debit'];
                    +01004     $array['vw_name']=$line['vw_name'];
                    +01005     $array['jr_comment']=$line['jr_comment'];
                    +01006     $array['j_montant']=$line['j_montant'];
                    +01007     $array['jr_id']=$line['jr_id'];
                    +01008     $array['jr_date']=$line['jr_date'];
                    +01009     $array['jr_internal']=$line['jr_internal'];
                    +01010     $array['j_poste']=$line['j_poste'];
                    +01011     $array['jr_montant']=$line['jr_montant'];
                    +01012     $array['jr_rapt']=$line['jr_rapt'];
                    +01013     $array['jrn_def_type']=$line['jrn_def_type'];
                    +01014     $array['jr_grpt_id']=$line['jr_grpt_id'];
                    +01015     $array['jr_pj_name']=$line['jr_pj_name'];
                    +01016     //    $array['']=$line[''];
                    +01017 
                    +01018     $ret_array[$i]=$array;
                    +01019     }
                    +01020   return $ret_array;
                    +01021 }
                    +
                    +

                    +

                    @@ -342,7 +461,16 @@ Definition at line 793 of f

                    References $l_line, $Res, and ExecSql().

                    -Referenced by ListJrn(), and UpdateJrn(). +Referenced by ListJrn(), and UpdateJrn().

                    00793                                   {
                    +00794 
                    +00795   $Res=ExecSql($p_cn,"select jr_internal from jrn where jr_id=$p_id");
                    +00796   if ( pg_NumRows($Res) == 0 ) return null;
                    +00797   $l_line=pg_fetch_array($Res);
                    +00798   return $l_line['jr_internal'];
                    +00799 }
                    +
                    +

                    +

                    @@ -390,7 +518,18 @@ jrn id gen :

                      Definition at line 907 of file jrn.php.

                      -References $Max, $Res, $ret, and ExecSql(). +References $Max, $Res, $ret, and ExecSql().

                      00907                                  {
                      +00908   $Res=ExecSql($p_cn,"select jrn_def_name from ".
                      +00909                " jrn_def where jrn_def_id=".
                      +00910                $p_id);
                      +00911   $Max=pg_NumRows($Res);
                      +00912   if ($Max==0) return null;
                      +00913   $ret=pg_fetch_array($Res,0);
                      +00914   return $ret['jrn_def_name'];
                      +00915 }
                      +
                      +

                      +

                      @@ -446,7 +585,27 @@ Definition at line 549 of f

                      References $cn, $Res, DbConnect(), and ExecSql().

                      -Referenced by ListJrn(), ViewJrn(), and ViewRecord(). +Referenced by ListJrn(), ViewJrn(), and ViewRecord().

                      00550 {
                      +00551   if ( $is_connected == 0 ) 
                      +00552     $cn=DbConnect($p_dossier);
                      +00553   else
                      +00554     $cn=$p_dossier;
                      +00555 
                      +00556   $Res=ExecSql($cn,"select jrn_Def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_def_type, 
                      +00557                    jrn_deb_max_line,jrn_cred_max_line,jrn_def_ech,jrn_def_ech_lib,jrn_def_code,
                      +00558                    jrn_def_fiche_deb,jrn_def_fiche_deb
                      +00559                    from jrn_Def 
                      +00560                       where jrn_def_id=$p_jrn");
                      +00561   $Count=pg_NumRows($Res);
                      +00562   if ( $Count == 0 ) {
                      +00563     echo '<DIV="redcontent"><H2 class="error"> Paramètres journaux non trouvés</H2> </DIV>';
                      +00564     return null;
                      +00565   }
                      +00566   return pg_fetch_array($Res,0);
                      +00567 }
                      +
                      +

                      +

                      @@ -496,7 +655,22 @@ Definition at line 523 of f

                      References $Res, and ExecSql().

                      -Referenced by FormODS(), RecordJrn(), and SetInternalCode(). +Referenced by FormODS(), RecordJrn(), and SetInternalCode().

                      00524 {
                      +00525   $Res=ExecSql($p_cn,"select jrn_Def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_def_type, 
                      +00526                    jrn_deb_max_line,jrn_cred_max_line,jrn_def_ech,jrn_def_ech_lib,jrn_def_code,
                      +00527                    jrn_def_fiche_deb,jrn_def_fiche_deb
                      +00528                    from jrn_Def 
                      +00529                       where jrn_def_id=$p_jrn");
                      +00530   $Count=pg_NumRows($Res);
                      +00531   if ( $Count == 0 ) {
                      +00532     echo '<DIV="redcontent"><H2 class="error"> Paramètres journaux non trouvés</H2> </DIV>';
                      +00533     return null;
                      +00534   }
                      +00535   return pg_fetch_array($Res,0);
                      +00536 }
                      +
                      +

                      +

                      @@ -544,7 +718,13 @@ $p_type jrn type gen :

                        Definition at line 930 of file jrn.php.

                        -References $Ret, and CountSql(). +References $Ret, and CountSql().

                        00931 {
                        +00932   $Ret=CountSql($p_cn,"select * from jrn_def where jrn_def_type='".$p_type."'");
                        +00933   return $Ret+1; 
                        +00934 }
                        +
                        +

                        +

                        @@ -624,9 +804,239 @@ p_user user id

                          Definition at line 38 of file jrn.php.

                          -References $a, $cn, $e, $l2_line, $l_line, $poste, $Res, $search, $sessid, $Sql, DbConnect(), echo_debug(), ExecSql(), GetJrnProperty(), GetPeriode(), METHOD, name, selected, and value. +References $a, $cn, $e, $l2_line, $l_line, $poste, $Res, $search, $sessid, $Sql, DbConnect(), echo_debug(), ExecSql(), GetJrnProperty(), GetPeriode(), METHOD, name, selected, and value.

                          -Referenced by CorrectRecord(). +Referenced by CorrectRecord().

                          00039 {
                          +00040   include_once("postgres.php");
                          +00041   include_once("preference.php");
                          +00042 
                          +00043   echo_debug('jrn.php',__LINE__,"RecordJrn($p_dossier,$p_user,$p_jrn,$p_MaxDeb,$p_MaxCred,$p_array,$p_update)");
                          +00044   for ( $i = 0; $i < $p_MaxDeb; $i++) {
                          +00045       ${"e_class_deb$i"}=0;
                          +00046       ${"e_mont_deb$i"}=0;
                          +00047   }
                          +00048   for ( $i = 0; $i < $p_MaxCred; $i++) {
                          +00049       ${"e_class_cred$i"}=0;
                          +00050       ${"e_mont_cred$i"}=0;
                          +00051   }
                          +00052   $cn=DbConnect($p_dossier);
                          +00053     // userPref contient la periode par default
                          +00054     $userPref=GetUserPeriode($cn,$p_user);
                          +00055     list ($l_date_start,$l_date_end)=GetPeriode($cn,$userPref);
                          +00056     $e_op_rem=substr($l_date_start,2,8);
                          +00057 
                          +00058   if ( $p_array == null ) {
                          +00059     $e_op_date="01";
                          +00060     $e_comment="";
                          +00061     $e_rapt="";
                          +00062     $e_ech="";
                          +00063     $e_sum_deb=0;
                          +00064     $e_sum_cred=0;
                          +00065   } else {
                          +00066     foreach ( $p_array as $n=>$e) {
                          +00067       ${"e_$n"}= $e;
                          +00068   }
                          +00069   }
                          +00070   /* Get Jrn's properties */
                          +00071   $l_line=GetJrnProperty($cn,$p_jrn);
                          +00072   if ( $l_line == null ) return;
                          +00073   echo '<DIV class="redcontent">';
                          +00074   echo '<FORM NAME="encoding" ACTION="enc_jrn.php" METHOD="POST">';
                          +00075 
                          +00076   printf ('<H2 class="info"> %s %s </H2>',$l_line['jrn_def_name'],$l_line['jrn_def_code']);
                          +00077 
                          +00078   echo "<INPUT TYPE=HIDDEN NAME=\"MaxDeb\" VALUE=\"$p_MaxDeb\">";
                          +00079   echo "<INPUT TYPE=HIDDEN NAME=\"MaxCred\" VALUE=\"$p_MaxCred\">";
                          +00080   echo 'Date : <INPUT TYPE="TEXT" NAME="op_date" VALUE="'.
                          +00081     $e_op_date.'" SIZE="4">'.
                          +00082     $e_op_rem;
                          +00083 
                          +00084   // Comment
                          +00085   echo '<br><SPAN>Comment  = <INPUT TYPE="TEXT" SIZE="70" NAME="comment" VALUE="'.$e_comment.'"></span>';
                          +00086 
                          +00087   // Chargement comptes disponibles
                          +00088   if ( strlen(trim ($l_line['jrn_def_class_deb']) ) > 0 ) {
                          +00089     $valid_deb=split(" ",$l_line['jrn_def_class_deb']);
                          +00090 
                          +00091     // Creation query
                          +00092     $SqlDeb="select pcm_val,pcm_lib from tmp_pcmn where ";
                          +00093     foreach ( $valid_deb as $item_deb) {
                          +00094       if ( strlen (trim($item_deb))) {
                          +00095         echo_debug('jrn.php',__LINE__,"l_line[jrn_def_class_deb] $l_line[jrn_def_class_deb] item_deb $item_deb");
                          +00096         if ( strstr($item_deb,"*") == true ) {
                          +00097           $item_deb=strtr($item_deb,"*","%");
                          +00098           $Sql=" pcm_val like '$item_deb' or";
                          +00099         } else {
                          +00100           $Sql=" pcm_val = '$item_deb' or";
                          +00101         }
                          +00102         $SqlDeb=$SqlDeb.$Sql;
                          +00103       }
                          +00104     }
                          +00105     $SqlDeb = substr($SqlDeb,0,strlen($SqlDeb)-2)." order by pcm_val::text";
                          +00106   } else
                          +00107     {
                          +00108       $SqlDeb="select pcm_val,pcm_lib from tmp_pcmn  order by pcm_val::text";
                          +00109     }
                          +00110   echo_debug('jrn.php',__LINE__,"SqlDeb $SqlDeb");
                          +00111   $Res=ExecSql($cn,$SqlDeb);
                          +00112   $Count=pg_NumRows($Res);
                          +00113 
                          +00114   for ( $i=0;$i<$Count;$i++) {
                          +00115     $l2_line=pg_fetch_array($Res,$i);
                          +00116     $lib=substr($l2_line['pcm_lib'],0,35);
                          +00117     $poste [$l2_line['pcm_val']]= $lib;
                          +00118   }
                          +00119 
                          +00120   echo "<TABLE>";
                          +00121   echo '<TR><TD><H2 class="info"> débit </H2></TD></TR>';
                          +00122   for ( $i=0;$i < $p_MaxDeb;$i++) {
                          +00123     echo "<tr>";
                          +00124     echo "<TD>";
                          +00125     printf ('<SELECT NAME="class_deb%d">',$i);
                          +00126     foreach ( $poste as $key => $value){ 
                          +00127       $selected="";
                          +00128       if ( ${"e_class_deb$i"} == $key ) $selected="SELECTED";
                          +00129       $a=sprintf('<OPTION VALUE="%s" %s >%s - % .40s',
                          +00130              $key,
                          +00131              $selected,
                          +00132              $key,
                          +00133              $value);
                          +00134       echo $a;
                          +00135     }
                          +00136     echo "</SELECT>";
                          +00137     printf ('</TD>');
                          +00138 
                          +00139     printf('<TD> Montant :<INPUT TYPE="TEXT" id="mont_deb%d" NAME="mont_deb%d" VALUE="%s" onChange="CheckTotal()"></TD>',
                          +00140             $i,$i,${"e_mont_deb$i"},$i);
                          +00141     echo "</tr>";
                          +00142 
                          +00143   }
                          +00144   // Total debit
                          +00145    echo '<TR><TD>';
                          +00146    echo 'Total ';
                          +00147    echo '</TD><TD>';
                          +00148    echo '<input type="TEXT" NAME="sum_deb" VALUE="'.$e_sum_deb.'" onChange="CheckTotal()">';
                          +00149    echo '</TD></TR>';
                          +00150 if ( $p_update == 0 )  echo "<TR><TD> <INPUT TYPE=\"SUBMIT\" VALUE=\"+ de line\" NAME=\"add_line_deb\"></TD></TR>";
                          +00151 
                          +00152 
                          +00153 
                          +00154 
                          +00155   echo '<TR><TD><H2 class="info"> crédit </H2> </TD></TR>';
                          +00156   // Chargement comptes disponibles
                          +00157   if ( strlen(trim ($l_line['jrn_def_class_cred']) ) > 0 ) {
                          +00158     $valid_cred=split(" ",$l_line['jrn_def_class_cred']);
                          +00159 
                          +00160     // Creation query
                          +00161     $SqlCred="select pcm_val,pcm_lib from tmp_pcmn where ";
                          +00162     foreach ( $valid_cred as $item_cred) {
                          +00163       if ( strlen (trim($item_cred))) {
                          +00164         echo_debug('jrn.php',__LINE__,"l_line[jrn_def_class_cred] $l_line[jrn_def_class_cred] item_cred $item_cred");
                          +00165         if ( strstr($item_cred,"*") == true ) {
                          +00166           $item_cred=strtr($item_cred,"*","%");
                          +00167           $Sql=" pcm_val like '$item_cred' or";
                          +00168         } else {
                          +00169           $Sql=" pcm_val = '$item_cred' or";
                          +00170         }
                          +00171         $SqlCred=$SqlCred.$Sql;
                          +00172       }
                          +00173     }
                          +00174     $SqlCred = substr($SqlCred,0,strlen($SqlCred)-2)." order by pcm_val::text" ;
                          +00175   } else
                          +00176     {
                          +00177       $SqlCred="select pcm_val,pcm_lib from tmp_pcmn  order by pcm_val::text";
                          +00178     }
                          +00179   echo_debug('jrn.php',__LINE__,"SqlCred $SqlCred");
                          +00180   $Res=ExecSql($cn,$SqlCred);
                          +00181   $Count=pg_NumRows($Res);
                          +00182 
                          +00183 
                          +00184   for ( $i=0;$i<$Count;$i++) {
                          +00185     $l2_line=pg_fetch_array($Res,$i);
                          +00186     $lib=substr($l2_line['pcm_lib'],0,35);
                          +00187     $poste_c[$l2_line['pcm_val']]=$lib;
                          +00188   }
                          +00189   for ( $i=0;$i < $p_MaxCred;$i++) {
                          +00190     echo "<tr>";
                          +00191     echo "<TD>";
                          +00192     printf ('<SELECT NAME="class_cred%d">',$i);
                          +00193     foreach ( $poste_c as $key => $value){ 
                          +00194       $selected="";
                          +00195       if ( ${"e_class_cred$i"} == $key ) $selected="SELECTED";
                          +00196       $a=sprintf('<OPTION VALUE="%s" %s >%s - % .40s',
                          +00197              $key,
                          +00198              $selected,
                          +00199              $key,
                          +00200              $value);
                          +00201       echo $a;
                          +00202     }
                          +00203         
                          +00204     echo "</SELECT>";
                          +00205     echo "</TD>";
                          +00206 
                          +00207     printf ('<TD> Montant :<INPUT TYPE="TEXT" id="mont_cred%d" NAME="mont_cred%d" VALUE="%s" onChange="CheckTotal()"></TD>',
                          +00208             $i,$i,${"e_mont_cred$i"});
                          +00209     echo "</tr>";
                          +00210 
                          +00211   }
                          +00212   // Total Credit
                          +00213   echo '<TR><TD>';
                          +00214   echo 'Total';
                          +00215   echo '</TD><TD>';
                          +00216   echo '<input type="TEXT" NAME="sum_cred" VALUE="'.$e_sum_cred.'" onChange="CheckTotal()">';
                          +00217   echo '</TD></TR>';
                          +00218   echo "<TR><TD> <INPUT TYPE=\"SUBMIT\" VALUE=\"+ de line\" NAME=\"add_line_cred\"></TD></TR>";
                          +00219   if ( isset ($_GET["PHPSESSID"]) ) {
                          +00220     $sessid=$_GET["PHPSESSID"];
                          +00221   }
                          +00222   else {
                          +00223     $sessid=$_POST["PHPSESSID"];
                          +00224   }
                          +00225 
                          +00226   $search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."','rapt')\">";
                          +00227   echo_debug('jrn.php',__LINE__,"search $search");
                          +00228   // To avoid problem with unknown variable
                          +00229   if ( ! isset ($e_rapt) ) {
                          +00230         $e_rapt="";
                          +00231   }
                          +00232 
                          +00233   echo '<TR><TD colspan="2">
                          +00234          rapprochement : <INPUT TYPE="TEXT" name="rapt" value="'.$e_rapt.'">'.$search.'</TD></TR>';
                          +00235   echo "</TABLE>";
                          +00236 
                          +00237   // To avoid problem with unknown variable
                          +00238   if ( ! isset ($e_comment) ) {
                          +00239         $e_comment="";
                          +00240   }
                          +00241  
                          +00242 
                          +00243 
                          +00244   if ( $p_update==0) {
                          +00245     echo '<input type="submit" Name="add_record" Value="Enregistre">';
                          +00246   } else {
                          +00247     echo '<input type="submit" Name="update_record" Value="Enregistre">';
                          +00248   }
                          +00249    echo '<input type="reset" Value="Efface">';
                          +00250 
                          +00251    // To avoid problem with unknown variable
                          +00252     if ( ! isset ($e_sum_deb) ) {
                          +00253                  $e_sum_deb=0;
                          +00254     }
                          +00255 
                          +00256    // To avoid problem with unknown variable
                          +00257      if ( ! isset ($e_sum_cred) ) {
                          +00258                  $e_sum_cred=0;
                          +00259       }
                          +00260 
                          +00261 
                          +00262    echo '<SPAN ID="diff"></SPAN>';
                          +00263   echo "</FORM>";
                          +00264   echo '</DIV>';
                          +00265   
                          +00266 }
                          +
                          +

                          +

                          @@ -684,7 +1094,20 @@ Definition at line 949 of f

                          References $num, $Res, ExecSql(), GetJrnProperty(), and NextSequence().

                          -Referenced by RecordFin(), RecordInvoice(), RecordSell(), and TransferCSV(). +Referenced by RecordFin(), RecordInvoice(), RecordSell(), and TransferCSV().

                          00950 {
                          +00951   //$num=CountSql($p_cn,"select * from jrn where jr_def_id=$p_jrn and jr_internal != 'ANNULE'")+1;
                          +00952   $num = NextSequence($p_cn,'s_internal');
                          +00953   $num=strtoupper(hexdec($num));
                          +00954   $atype=GetJrnProperty($p_cn,$p_jrn);
                          +00955   $type=$atype['jrn_def_code'];
                          +00956   $internal_code=sprintf("%d%s-%s",$_SESSION['g_dossier'],$type,$num);
                          +00957   $Res=ExecSql($p_cn,"update jrn set jr_internal='".$internal_code."' where ".
                          +00958                " jr_grpt_id = ".$p_grpt);
                          +00959   return $internal_code;
                          +00960 }
                          +
                          +

                          +

                          @@ -734,7 +1157,128 @@ p_jrn

                            Definition at line 282 of file jrn.php.

                            -References $a, $check, $col_vide, $file, $i, $r, $search, $sessid, echo_debug(), echo_error(), GetConcerned(), GetDataJrnJrId(), GetGrpt(), GetInternal(), name, return, and value. +References $a, $check, $col_vide, $file, $i, $r, $search, $sessid, echo_debug(), echo_error(), GetConcerned(), GetDataJrnJrId(), GetGrpt(), GetInternal(), name, return, and value.

                            00283 {
                            +00284   echo_debug('jrn.php',__LINE__,"function UpdateJrn");
                            +00285 
                            +00286   $l_array=GetDataJrnJrId($p_cn,$p_jr_id);
                            +00287   if ( $l_array == null ) {
                            +00288     echo_error ("Not data found for UpdateJrn p_jr_id = $p_jr_id");
                            +00289     return ;
                            +00290   }
                            +00291   // Javascript
                            +00292   $r=JS_VIEW_JRN_MODIFY;
                            +00293 
                            +00294   // Build the form
                            +00295   $col_vide="<TD></TD>";
                            +00296   for ( $i =0 ; $i < sizeof($l_array); $i++) {
                            +00297     $content=$l_array[$i] ;
                            +00298 
                            +00299       // for the first line
                            +00300       if ( $i == 0 ) {
                            +00301         $r.="<TABLE>";
                            +00302         $r.="<TR>";
                            +00303         // Date
                            +00304         $r.="<TD>";
                            +00305         $r.=$content['jr_date'];
                            +00306         $r.="</TD>";
                            +00307         // for upload document we need the grpt_id   
                            +00308         $r.='<Input type="hidden" name="jr_grpt_id" value="'.$content['jr_grpt_id'].'">';
                            +00309 
                            +00310         // comment can be changed
                            +00311         $r.="<TD>";
                            +00312         $r.='<INPUT TYPE="TEXT" name="comment" value="';
                            +00313         $r.=$content['jr_comment'];
                            +00314         $r.='" SIZE="25">';
                            +00315         $r.="</TD>";
                            +00316 
                            +00317         // Internal
                            +00318         $r.="<TD>";
                            +00319         $r.=$content['jr_internal'];
                            +00320         $r.="</TD>";
                            +00321 
                            +00322         if ( $content['jrn_def_type'] == 'ACH' or 
                            +00323              $content['jrn_def_type'] == 'VEN' )
                            +00324           {
                            +00325             // Is Paid
                            +00326             $r.="<TD>";
                            +00327             $check=( $content['jr_rapt'] != null )?"CHECKED":"UNCHECKED";
                            +00328             $r.='<TD>Payé <INPUT TYPE="CHECKBOX" name="is_paid" '.$check.'></TD>';
                            +00329           }
                            +00330         $r.="</TR>";
                            +00331         $r.="</TABLE>";
                            +00332         $r.="<TABLE>";
                            +00333       }
                            +00334       $r.="<TR>";
                            +00335       if ( $content['j_debit'] == 'f' ) $r.=$col_vide;
                            +00336       //      $r.="<TD>".$content['j_debit']."</td>";
                            +00337       
                            +00338       $r.="<TD>".$content['j_poste']."</td>";
                            +00339       if ( $content['j_debit'] == 't' ) $r.=$col_vide;
                            +00340       $r.="<TD>".$content['vw_name']."</td>";
                            +00341       if ( $content['j_debit'] == 'f' ) $r.=$col_vide;
                            +00342       $r.="<TD>".$content['j_montant']."</td>";
                            +00343       $r.="</TR>";
                            +00344 
                            +00345       //    }//     foreach ($l_array[$i]  as $value=>$content) 
                            +00346   }// for ( $i =0 ; $i < sizeof($l_array); $i++) 
                            +00347     $file=new widget("file");
                            +00348     $file->table=1;
                            +00349         //document
                            +00350     $r.='<TD>A effacer <INPUT TYPE="CHECKBOX" name="to_remove" ></TD>';
                            +00351     $r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s">%s</A>',
                            +00352                 $content['jr_id'],
                            +00353                 $content['jr_grpt_id'],
                            +00354                 $content['jr_pj_name'])."</TD>";
                            +00355     $r.="</TR></TABLE>";
                            +00356     $r.="<hr>";
                            +00357     $r.= "<table>"; 
                            +00358     $r.="<TR>".$file->IOValue("pj","","Pièce justificative")."</TR>";
                            +00359     $r.="</table>";
                            +00360     $r.="<hr>";
                            +00361 
                            +00362   $r.="</table>";
                            +00363   $r.="Total ".$content['jr_montant']."<br>";
                            +00364   // show all the related operation
                            +00365   $a=GetConcerned($p_cn,$content['jr_id']);
                            +00366   
                            +00367   if ( $a != null ) {
                            +00368       $r.="<b>Operation concernée</b> <br>";
                            +00369       if ( isset ($_GET["PHPSESSID"]) ) {
                            +00370         $sessid=$_GET["PHPSESSID"];
                            +00371       }
                            +00372       else {
                            +00373         $sessid=$_POST["PHPSESSID"];
                            +00374       }
                            +00375 
                            +00376     $r.= '<div style="margin-left:30px;">';
                            +00377     foreach ($a as $key => $element) {
                            +00378       $r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="viewDetail(\'%s\',\'%s\')">', 
                            +00379                    GetInternal($p_cn,$element),GetGrpt($p_cn,$element),$sessid);
                            +00380       $r.=sprintf('<INPUT TYPE="button" value="Efface" onClick="dropLink(\'%s\',\'%s\',\'%s\')"><BR>',
                            +00381                   $content['jr_id'],$element,$sessid);
                            +00382     }//for
                            +00383     $r.= "</div>";
                            +00384   }// if ( $a != null ) {
                            +00385 
                            +00386   if ( isset ($_GET["PHPSESSID"]) ) {
                            +00387     $sessid=$_GET["PHPSESSID"];
                            +00388   }
                            +00389   else {
                            +00390     $sessid=$_POST["PHPSESSID"];
                            +00391   }
                            +00392   
                            +00393   $search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."','rapt')\">";
                            +00394 
                            +00395   $r.= '<H2 class="info">rapprochement </H2> 
                            +00396        <INPUT TYPE="TEXT" name="rapt" value="">'.$search;
                            +00397   $r.='<input type="hidden" name="jr_id" value="'.$content['jr_id'].'">';
                            +00398 
                            +00399   //  echo $r;
                            +00400   return $r;
                            +00401 }
                            +
                            +

                            +

                            @@ -790,7 +1334,69 @@ p_array array with all the values

                              Definition at line 834 of file jrn.php.

                              -References cmpDate(), echo_debug(), echo_error(), GetPeriode(), isDate(), name, and PeriodeClosed(). +References cmpDate(), echo_debug(), echo_error(), GetPeriode(), isDate(), name, and PeriodeClosed().

                              00835 {
                              +00836   if ( ! isset ($p_cn) ||
                              +00837        ! isset ($p_array)||
                              +00838        ! isset ($p_user)||
                              +00839        $p_array == null ){
                              +00840     echo_error("JRN.PHP VerifData missing parameter");
                              +00841     return BADPARM;
                              +00842   }
                              +00843   // Montre ce qu'on a encodé et demande vérif
                              +00844   $next="";
                              +00845   foreach ( $p_array as $name=>$element ) {
                              +00846       echo_debug('jrn.php',__LINE__,"element $name -> $element ");
                              +00847       // Sauve les données dans des variables
                              +00848       ${"p_$name"}=$element;
                              +00849     }
                              +00850     // Verif Date
                              +00851     if ( isDate($p_op_date) == null) {
                              +00852       return BADDATE;
                              +00853     }
                              +00854     // userPref contient la periode par default
                              +00855     $userPref=$p_user->GetPeriode();
                              +00856     list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$userPref);
                              +00857 
                              +00858     // Date dans la periode active
                              +00859     echo_debug ("date start periode $l_date_start date fin periode $l_date_end date demandée $p_op_date");
                              +00860     if ( cmpDate($p_op_date,$l_date_start)<0 || 
                              +00861          cmpDate($p_op_date,$l_date_end)>0 )
                              +00862       {
                              +00863         return NOTPERIODE;
                              +00864       }
                              +00865     // Periode fermée 
                              +00866     if ( PeriodeClosed ($p_cn,$userPref)=='t' )
                              +00867       {
                              +00868         return PERIODCLOSED;
                              +00869       }
                              +00870     $l_mont=0;
                              +00871     if ( ! isset ($p_ech) ) $p_ech="";
                              +00872 
                              +00873     if ($p_ech!='' && isDate ( $p_ech) == null ){
                              +00874       return INVALID_ECH;
                              +00875     }
                              +00876 
                              +00877     $tot_deb= 0;
                              +00878     $tot_cred= 0;
                              +00879     for ( $i = 0; $i < $p_MaxCred; $i++) {
                              +00880       if ( isset ( ${"p_mont_cred$i"} ))
                              +00881         $tot_cred+=${"p_mont_cred$i"};
                              +00882     }
                              +00883     for ( $i = 0; $i < $p_MaxDeb; $i++) {
                              +00884       if ( isset ( ${"p_mont_deb$i"} ))
                              +00885         $tot_deb+=${"p_mont_deb$i"};
                              +00886     }
                              +00887     echo_debug('jrn.php',__LINE__,"Amont =      $tot_deb $tot_cred");
                              +00888     if ( round($tot_deb,2) != round($tot_cred,2) ) { 
                              +00889       return DIFF_AMOUNT;
                              +00890     }
                              +00891 
                              +00892     return NOERROR;
                              +00893 
                              +00894 }
                              +
                              +

                              +

                              @@ -858,7 +1464,125 @@ p_user,

                                Definition at line 583 of file jrn.php.

                                -References $cn, $col_vide, $db, $l_id, $l_line, $MaxLine, $Res, $sessid, $sql, DbConnect(), echo_debug(), ExecSql(), FormatString(), GetJrnProp(), and isDate(). +References $cn, $col_vide, $db, $l_id, $l_line, $MaxLine, $Res, $sessid, $sql, DbConnect(), echo_debug(), ExecSql(), FormatString(), GetJrnProp(), and isDate().

                                00583                                                                  {
                                +00584   echo_debug('jrn.php',__LINE__,"function ViewJrn($p_dossier,$p_user,$p_jrn,$p_array=null) ");
                                +00585   echo JS_VIEW_JRN_DETAIL;
                                +00586   $db=sprintf("dossier%d",$p_dossier);
                                +00587   $l_prop=GetJrnProp($p_dossier,$p_jrn);
                                +00588   echo "<H2 class=\"info\">".$l_prop['jrn_def_name']."( ".$l_prop['jrn_def_code'].")"."</H2>";
                                +00589   $cn=DbConnect($p_dossier);
                                +00590   if ( $p_array == null) {
                                +00591     include_once("preference.php");
                                +00592     $l_periode=GetUserPeriode($cn,$p_user);
                                +00593     $Res=ExecSql($cn,"select jr_id,j_id,jr_internal,to_char(j_date,'DD.MM.YYYY') as j_date,
                                +00594                        j_montant,j_poste,pcm_lib,j_grpt,j_debit,j_centralized,j_tech_per,
                                +00595                        pcm_lib
                                +00596                    from jrnx inner join tmp_pcmn on j_poste=pcm_val
                                +00597                              inner join jrn on jr_grpt_id=j_grpt
                                +00598                    where 
                                +00599                    j_jrn_def=$p_jrn and j_tech_per=$l_periode
                                +00600                    order by j_id,j_grpt,j_debit desc");
                                +00601   } else {
                                +00602     // Construction Query 
                                +00603     foreach ( $p_array as $key=>$element) {
                                +00604       ${"l_$key"}=$element;
                                +00605       echo_debug ("l_$key $element");
                                +00606     }
                                +00607     $sql="select j_id,to_char(j_date,'DD.MM.YYYY') as j_date,j_montant,j_poste,
                                +00608                  pcm_lib,j_grpt,jr_id,j_debit,j_centralized,j_tech_per,jr_internal
                                +00609                    from jrnx inner join tmp_pcmn on j_poste=pcm_val
                                +00610                         inner join jrn on jr_grpt_id=j_grpt
                                +00611                    where 
                                +00612                    j_jrn_def=$p_jrn";
                                +00613     $l_and="and ";
                                +00614     if ( ereg("^[0-9]+$", $l_s_montant) || ereg ("^[0-9]+\.[0-9]+$", $l_s_montant) ) {
                                +00615     $sql.=" and jr_montant $l_mont_sel $l_s_montant";
                                +00616     }
                                +00617     if ( isDate($l_date_start) != null ) {
                                +00618       $sql.=$l_and." j_date >= to_date('".$l_date_start."','DD.MM.YYYY')";
                                +00619     }
                                +00620     if ( isDate($l_date_end) != null ) {
                                +00621       $sql.=$l_and." j_date <= to_date('".$l_date_end."','DD.MM.YYYY')";
                                +00622     }
                                +00623     $l_s_comment=FormatString($l_s_comment);
                                +00624     if ( $l_s_comment != null ) {
                                +00625       $sql.=$l_and." upper(jr_comment) like upper('%".$l_s_comment."%') ";
                                +00626     }
                                +00627 
                                +00628     $sql.=" order by j_id,j_grpt,j_debit desc";
                                +00629     echo_debug ("search query is $sql");
                                +00630     $Res=ExecSql($cn,$sql);
                                +00631   }
                                +00632   $MaxLine=pg_NumRows($Res);
                                +00633   if ( $MaxLine == 0 ) return;
                                +00634   $col_vide="<TD></TD>";
                                +00635   echo '<TABLE ALIGN="center">';
                                +00636   $l_id=0;
                                +00637   for ( $i=0; $i < $MaxLine; $i++) {
                                +00638     $l_line=pg_fetch_array($Res,$i);
                                +00639     if ( $l_line['j_debit'] == 't' ) {
                                +00640       echo '<TR style="background-color:lightblue;">';
                                +00641     }
                                +00642     else {
                                +00643       echo '<TR>';
                                +00644     }
                                +00645     if ( $l_id == $l_line['j_grpt'] ) {
                                +00646       echo $col_vide.$col_vide.$col_vide;
                                +00647     } else {
                                +00648       echo "<TD>";
                                +00649       echo $l_line['j_date'];
                                +00650       echo "</TD>";
                                +00651       
                                +00652       
                                +00653           echo "<TD>";
                                +00654           if ( isset ($_GET["PHPSESSID"])  ) {
                                +00655             $sessid=$_GET["PHPSESSID"];
                                +00656           } else {
                                +00657             $sessid=$_POST["PHPSESSID"];
                                +00658           }
                                +00659 
                                +00660           list($z_type,$z_num,$num_op)=split("-",$l_line['jr_internal']);
                                +00661           printf ('<INPUT TYPE="BUTTON" VALUE="%s" onClick="viewDetail(\'%s\',\'%s\')">', 
                                +00662                   $num_op,$l_line['j_grpt'],$sessid);
                                +00663           //      echo $num_op;
                                +00664           echo "</TD>";
                                +00665 
                                +00666 
                                +00667           // no modification only cancel of wrong op.
                                +00668           echo '<TD class="mlltitle">';
                                +00669           echo "<A class=\"mtitle\" HREF=$p_url?action=update&line=".$l_line['jr_id'].">";
                                +00670           echo "M";
                                +00671           echo "</A></TD>";
                                +00672       $l_id=$l_line['j_grpt'];
                                +00673     }
                                +00674     if ($l_line['j_debit']=='f')
                                +00675       echo $col_vide;
                                +00676     
                                +00677     echo '<TD>';
                                +00678     echo $l_line['j_poste'];
                                +00679     echo '</TD>';
                                +00680 
                                +00681     echo '<TD>';
                                +00682     echo $l_line['pcm_lib'];
                                +00683     echo '</TD>';
                                +00684     echo $col_vide;
                                +00685 
                                +00686     echo '<TD>';
                                +00687     echo $l_line['j_montant'];
                                +00688     echo '</TD>';
                                +00689 
                                +00690     if ( $l_line['j_debit']=='t')
                                +00691       echo $col_vide;
                                +00692 
                                +00693     echo "</TR>";
                                +00694 
                                +00695 
                                +00696   }
                                +00697   echo '</TABLE>';
                                +00698 }
                                +
                                +

                                +

                                @@ -894,7 +1618,19 @@ parm :

                                  Definition at line 415 of file jrn.php.

                                  -References echo_debug(). +References echo_debug().

                                  00415                                   {
                                  +00416   if ($p_array == null) { 
                                  +00417     echo_debug('jrn.php',__LINE__,"p_array is null");
                                  +00418   }else {
                                  +00419     foreach ( $p_array as $n=>$e) {
                                  +00420       echo_debug('jrn.php',__LINE__,"a[$n]= $e");
                                  +00421     }
                                  +00422  
                                  +00423   }
                                  +00424 }
                                  +
                                  +

                                  +

                                  @@ -968,10 +1704,65 @@ p_jrn

                                    Definition at line 457 of file jrn.php.

                                    -References $col_vide, echo_debug(), GetJrnProp(), GetPosteLibelle(), and table. +References $col_vide, echo_debug(), GetJrnProp(), GetPosteLibelle(), and table.

                                    00458 {
                                    +00459   echo_debug ("ViewRecord : $p_dossier");
                                    +00460   echo_debug('jrn.php',__LINE__,"function ViewRecord ($p_dossier,$p_jrn,$p_id,$p_MaxCred,$p_MaxDeb,$p_array)");
                                    +00461   foreach ( $p_array as $key=>$element) {
                                    +00462     ${"e_$key"}=$element;
                                    +00463     echo_debug('jrn.php',__LINE__," e_$key=$element;");
                                    +00464 
                                    +00465   }
                                    +00466   // Get Jrn's Prop
                                    +00467   $l_prop=GetJrnProp($p_dossier,$p_jrn);
                                    +00468 
                                    +00469   include_once("poste.php");
                                    +00470   if ( $l_prop == null ) return;
                                    +00471   $col_vide="<TD></TD>";
                                    +00472   echo '<TABLE ALIGN=CENTER BORDER=1 style="border-style:groove">';
                                    +00473   echo '<TR>';
                                    +00474   echo "<TD>". $l_prop['jrn_def_name']."(".$l_prop['jrn_def_code'].") </TD>";
                                    +00475   echo "<TD> Date : $e_op_date</TD>";
                                    +00476   echo "</TR>";
                                    +00477   echo "</TABLE>";
                                    +00478 
                                    +00479 
                                    +00480   echo "<table width=600 border=0>";
                                    +00481   echo "<TR><TD>operation $p_id</TD></TR>";
                                    +00482   for ($i = 0; $i < $p_MaxDeb;$i++) {
                                    +00483     //Deb
                                    +00484     if ( strlen(trim(${"e_mont_deb$i"})) > 0 && ${"e_mont_deb$i"} > 0 ) {
                                    +00485       $class=GetPosteLibelle($p_dossier,${"e_class_deb$i"});
                                    +00486 
                                    +00487       echo '<TR style="background-color:lightblue"><TD>'.${"e_class_deb$i"}."</TD>$col_vide<TD> $class </TD> <TD>".${"e_mont_deb$i"}."</TD>$col_vide</TR>";
                                    +00488     }
                                    +00489   }
                                    +00490 
                                    +00491   // Cred
                                    +00492   for ($i = 0; $i < $p_MaxCred;$i++) {
                                    +00493     if ( strlen(trim(${"e_mont_cred$i"})) > 0 && ${"e_mont_cred$i"} > 0 ) {
                                    +00494       $class=GetPosteLibelle($p_dossier,${"e_class_cred$i"});
                                    +00495       
                                    +00496       echo '<TR style="background-color:lightgreen;">'.$col_vide.'<TD>'.${"e_class_cred$i"}."</TD><TD> $class </TD>$col_vide <TD>".${"e_mont_cred$i"}."</TD></TR>";
                                    +00497     }
                                    +00498   }
                                    +00499   echo "<TR style=\"background-color:lightgray\">";
                                    +00500   echo $col_vide;
                                    +00501   echo $col_vide;
                                    +00502   echo "<TD align=\"center\"> Total</TD>";
                                    +00503   echo "<TD> $e_sum_deb</TD><TD> $e_sum_cred</TD>";
                                    +00504   echo "</TABLE>";
                                    +00505   // Bouton again
                                    +00506   echo '<table align="center">';
                                    +00507   echo '<TR><TD class="mtitle">';
                                    +00508   echo ' <A class="mtitle" HREF="enc_jrn.php?action=record&max_deb='.$l_prop['jrn_deb_max_line'].'&max_cred='.$l_prop['jrn_cred_max_line'].'&p_jrn='.$p_jrn.'"> Ajouter</A>';
                                    +00509   echo '</TD></TR></TABLE>';
                                    +00510 }
                                    +
                                    +

                                    + -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__add_8php-source.html b/doc/developper/html/jrn__add_8php-source.html index 04f9a7c40..1ba461543 100644 --- a/doc/developper/html/jrn__add_8php-source.html +++ b/doc/developper/html/jrn__add_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_add.php Source File +phpcompta: jrn_add.php Source File +html

                                    jrn_add.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -208,7 +208,7 @@
                                     00203 echo "</DIV>";
                                     00204 html_page_stop();
                                     00205 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__add_8php.html b/doc/developper/html/jrn__add_8php.html index fbd6b3df2..d3e6c36fd 100644 --- a/doc/developper/html/jrn__add_8php.html +++ b/doc/developper/html/jrn__add_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_add.php File Reference +phpcompta: jrn_add.php File Reference +html

                                    jrn_add.php File Reference

                                    To add a ledger. More...

                                    @@ -517,7 +517,7 @@ Definition at line 37 Definition at line 52 of file jrn_add.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__csv_8php-source.html b/doc/developper/html/jrn__csv_8php-source.html index 3166f13ac..c7fd4d665 100644 --- a/doc/developper/html/jrn__csv_8php-source.html +++ b/doc/developper/html/jrn__csv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_csv.php Source File +phpcompta: jrn_csv.php Source File +html

                                    jrn_csv.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -126,7 +126,7 @@
                                     00121 //-----------------------------------------------------
                                     00122    }
                                     00123 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__csv_8php.html b/doc/developper/html/jrn__csv_8php.html index a063c1830..235559ff2 100644 --- a/doc/developper/html/jrn__csv_8php.html +++ b/doc/developper/html/jrn__csv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_csv.php File Reference +phpcompta: jrn_csv.php File Reference +html

                                    jrn_csv.php File Reference

                                    Send a ledger in CSV format. More...

                                    @@ -210,7 +210,7 @@ Definition at line 36 Definition at line 80 of file jrn_csv.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__detail_8php-source.html b/doc/developper/html/jrn__detail_8php-source.html index c4ea2bfd8..fc1674c5d 100644 --- a/doc/developper/html/jrn__detail_8php-source.html +++ b/doc/developper/html/jrn__detail_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_detail.php Source File +phpcompta: jrn_detail.php Source File +html

                                    jrn_detail.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -253,7 +253,7 @@
                                     00248 echo "</DIV>";
                                     00249 html_page_stop();
                                     00250 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__detail_8php.html b/doc/developper/html/jrn__detail_8php.html index 7760e0f2b..5576f6355 100644 --- a/doc/developper/html/jrn__detail_8php.html +++ b/doc/developper/html/jrn__detail_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_detail.php File Reference +phpcompta: jrn_detail.php File Reference +html

                                    jrn_detail.php File Reference

                                    Show and let modify ledger parameter. More...

                                    @@ -546,7 +546,7 @@ Definition at line 3552 of file jrn_detail.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__op__detail_8php-source.html b/doc/developper/html/jrn__op__detail_8php-source.html index ec6799c49..1309a301e 100644 --- a/doc/developper/html/jrn__op__detail_8php-source.html +++ b/doc/developper/html/jrn__op__detail_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_op_detail.php Source File +phpcompta: jrn_op_detail.php Source File +html

                                    jrn_op_detail.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -94,11 +94,11 @@
                                     00089   echo "</div>";
                                     00090 }// if ( $a != null ) {
                                     00091 ?>
                                    -00092 <input type="button" onClick="window.close()" value="Fermer">
                                    +00092 <input type="button" onClick="window.close()" value="Fermer">
                                     00093 <?
                                     00094 html_page_stop();
                                     00095 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__op__detail_8php.html b/doc/developper/html/jrn__op__detail_8php.html index 2672ce8b4..299588c92 100644 --- a/doc/developper/html/jrn__op__detail_8php.html +++ b/doc/developper/html/jrn__op__detail_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_op_detail.php File Reference +phpcompta: jrn_op_detail.php File Reference +html

                                    jrn_op_detail.php File Reference

                                    Show the detail of a operation in a popup windows. More...

                                    @@ -129,7 +129,7 @@ Definition at line Definition at line 38 of file jrn_op_detail.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__pdf_8php-source.html b/doc/developper/html/jrn__pdf_8php-source.html index e18f918b3..d71591186 100644 --- a/doc/developper/html/jrn__pdf_8php-source.html +++ b/doc/developper/html/jrn__pdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_pdf.php Source File +phpcompta: jrn_pdf.php Source File +html

                                    jrn_pdf.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 
                                     00003 /*
                                    @@ -165,7 +165,7 @@
                                     00160 $pdf->ezStream();
                                     00161 
                                     00162 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__pdf_8php.html b/doc/developper/html/jrn__pdf_8php.html index 780a3788d..6d3b99d85 100644 --- a/doc/developper/html/jrn__pdf_8php.html +++ b/doc/developper/html/jrn__pdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_pdf.php File Reference +phpcompta: jrn_pdf.php File Reference +html

                                    jrn_pdf.php File Reference

                                    Send a ledger in a pdf format. More...

                                    @@ -366,7 +366,7 @@ Definition at line 127

                                    Definition at line 71 of file jrn_pdf.php.

                                    -Referenced by fiche::GetByDef(), ListJrn(), and action::myList(). +Referenced by fiche::GetByDef(), ListJrn(), and action::myList().

                                    @@ -594,7 +594,7 @@ Definition at line 132 Definition at line 54 of file jrn_pdf.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__search_8php-source.html b/doc/developper/html/jrn__search_8php-source.html index cbde6400d..7254f1618 100644 --- a/doc/developper/html/jrn__search_8php-source.html +++ b/doc/developper/html/jrn__search_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_search.php Source File +phpcompta: jrn_search.php Source File +html

                                    jrn_search.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -117,27 +117,27 @@
                                     00112 if ( ! isset ($p_montant)) $p_montant="";
                                     00113 if ( ! isset ($p_comment)) $p_comment="";
                                     00114 if ( ! isset ($p_internal)) $p_internal="";
                                    -00115 echo '<input type="hidden" name="p_ctl" value="'.$p_ctl.'">';
                                    +00115 echo '<input type="hidden" name="p_ctl" value="'.$p_ctl.'">';
                                     00116 echo '<TD> Date </TD>';
                                     00117 echo '<TD> <SELECT NAME="p_date_sel">'.$opt_date.' </TD>';
                                    -00118 echo '<TD> <INPUT TYPE="text" name="p_date" VALUE="'.$p_date.'"></TD>';
                                    +00118 echo '<TD> <INPUT TYPE="text" name="p_date" VALUE="'.$p_date.'"></TD>';
                                     00119 
                                     00120 echo '<TD> Montant </TD>';
                                     00121 echo '<TD> <SELECT NAME="p_montant_sel">'.$opt_montant.' </TD>';
                                    -00122 echo '<TD> <INPUT TYPE="text" name="p_montant" VALUE="'.$p_montant.'"></TD>';
                                    +00122 echo '<TD> <INPUT TYPE="text" name="p_montant" VALUE="'.$p_montant.'"></TD>';
                                     00123 echo '</TR><TR>';
                                     00124 echo '<TD> Commentaire </TD>';
                                     00125 echo '<TD> contient </TD>';
                                    -00126 echo '<TD> <INPUT TYPE="text" name="p_comment" VALUE="'.$p_comment.'"></TD>';
                                    +00126 echo '<TD> <INPUT TYPE="text" name="p_comment" VALUE="'.$p_comment.'"></TD>';
                                     00127 ?>
                                     00128 </TR><TR>
                                     00129 <TD> Code interne </TD><TD>comme </TD>
                                     00130 <?
                                    -00131 echo '<TD> <INPUT TYPE="text" name="p_internal" VALUE="'.$p_internal.'"></TD>';
                                    +00131 echo '<TD> <INPUT TYPE="text" name="p_internal" VALUE="'.$p_internal.'"></TD>';
                                     00132 echo "</TR>";
                                     00133 
                                     00134 echo '</TABLE>';
                                    -00135 echo '<INPUT TYPE="submit" name="search" value="cherche">';
                                    +00135 echo '<INPUT TYPE="submit" name="search" value="cherche">';
                                     00136 echo '</FORM>';
                                     00137 
                                     00138 // if a search is asked otherwise don't show all the rows
                                    @@ -238,7 +238,7 @@
                                     00233 <?
                                     00234 html_page_stop();
                                     00235 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__search_8php.html b/doc/developper/html/jrn__search_8php.html index 028d99a4f..8b5afc476 100644 --- a/doc/developper/html/jrn__search_8php.html +++ b/doc/developper/html/jrn__search_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_search.php File Reference +phpcompta: jrn_search.php File Reference +html

                                    jrn_search.php File Reference

                                    Search a operation from a ledger into a popup window, used for the "rapprochement". More...

                                    @@ -679,7 +679,7 @@ Definition at line 39163 of file jrn_search.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__update_8php-source.html b/doc/developper/html/jrn__update_8php-source.html index dc7b0a292..f87eb92c7 100644 --- a/doc/developper/html/jrn__update_8php-source.html +++ b/doc/developper/html/jrn__update_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_update.php Source File +phpcompta: jrn_update.php Source File +html

                                    jrn_update.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -64,7 +64,7 @@
                                     00058 echo '</div>';
                                     00059 html_page_stop();
                                     00060 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/jrn__update_8php.html b/doc/developper/html/jrn__update_8php.html index 7b15ed7a3..29d374d69 100644 --- a/doc/developper/html/jrn__update_8php.html +++ b/doc/developper/html/jrn__update_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/jrn_update.php File Reference +phpcompta: jrn_update.php File Reference +html

                                    jrn_update.php File Reference

                                    create, modify parameter ledger More...

                                    @@ -129,7 +129,7 @@ Definition at line 3450 of file jrn_update.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/line__update_8php-source.html b/doc/developper/html/line__update_8php-source.html index 1bc0386a0..1a558325c 100644 --- a/doc/developper/html/line__update_8php-source.html +++ b/doc/developper/html/line__update_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/line_update.php Source File +phpcompta: line_update.php Source File +html

                                    line_update.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -53,7 +53,7 @@
                                     00047 
                                     00048 /* Modif d'une ligne */
                                     00049 if ( isset ($_POST["update"] ) ) {
                                    -00050   foreach ($HTTP_POST_VARS as $name => $element) {
                                    +00050   foreach ($HTTP_POST_VARS as $name => $element) {
                                     00051     echo_debug('line_update.php',__LINE__,"name $name $element");
                                     00052   }
                                     00053   echo JS_UPDATE_PCMN;
                                    @@ -101,19 +101,19 @@
                                     00095 $p=$_GET['p'];
                                     00096 $n=$_GET['n'];
                                     00097 
                                    -00098 printf ('<TD>Numéro de classe </TD><TD><INPUT TYPE="TEXT" name="p_val" value="%s"></TD>',$l);
                                    +00098 printf ('<TD>Numéro de classe </TD><TD><INPUT TYPE="TEXT" name="p_val" value="%s"></TD>',$l);
                                     00099 echo "</TR><TR>";
                                    -00100 printf('<TD>Libellé </TD><TD><INPUT TYPE="TEXT" size="70" NAME="p_name" value="%s"></TD>',urldecode($n));
                                    +00100 printf('<TD>Libellé </TD><TD><INPUT TYPE="TEXT" size="70" NAME="p_name" value="%s"></TD>',urldecode($n));
                                     00101 echo "</TR><TR>";
                                    -00102 printf ('<TD>Classe Parent</TD><TD><INPUT TYPE="TEXT" name="p_val_parent" value="%s"></TD>',$p);
                                    +00102 printf ('<TD>Classe Parent</TD><TD><INPUT TYPE="TEXT" name="p_val_parent" value="%s"></TD>',$p);
                                     00103 ?>
                                     00104 </TR>
                                     00105 </TABLE>
                                     00106 <TABLE>
                                     00107 <TR>
                                     00108 <TD><INPUT TYPE="Submit" VALUE="Sauve">
                                    -00109 <INPUT TYPE="HIDDEN" name="update">
                                    -00110 <? printf ('<INPUT TYPE="HIDDEN" name="p_old" value="%s">',$l); ?>
                                    +00109 <INPUT TYPE="HIDDEN" name="update">
                                    +00110 <? printf ('<INPUT TYPE="HIDDEN" name="p_old" value="%s">',$l); ?>
                                     00111 </TD><TD><input type="button"  Value="Retour sans sauver" onClick='window.close();'></TD></TR>
                                     00112 </TABLE>
                                     00113 </FORM>
                                    @@ -122,7 +122,7 @@
                                     00116 <?
                                     00117 html_page_stop();
                                     00118 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/line__update_8php.html b/doc/developper/html/line__update_8php.html index 80fef5bdd..61d14b314 100644 --- a/doc/developper/html/line__update_8php.html +++ b/doc/developper/html/line__update_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/line_update.php File Reference +phpcompta: line_update.php File Reference +html

                                    line_update.php File Reference

                                    Modify the "Plan Comptable". More...

                                    @@ -351,7 +351,7 @@ Definition at line 36< Definition at line 43 of file line_update.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/listing__client_8php-source.html b/doc/developper/html/listing__client_8php-source.html index abdc88729..608316361 100644 --- a/doc/developper/html/listing__client_8php-source.html +++ b/doc/developper/html/listing__client_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/listing_client.php Source File +phpcompta: listing_client.php Source File +html

                                    listing_client.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -63,7 +63,7 @@
                                     00057   return;
                                     00058  }
                                     00059 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/listing__client_8php.html b/doc/developper/html/listing__client_8php.html index 7f4beb9a9..8ec407e02 100644 --- a/doc/developper/html/listing__client_8php.html +++ b/doc/developper/html/listing__client_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/listing_client.php File Reference +phpcompta: listing_client.php File Reference +html

                                    listing_client.php File Reference

                                    Electronic declaration for VAT BELGIUM --> experimental. More...

                                    @@ -183,7 +183,7 @@ Definition at line Definition at line 56 of file listing_client.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/login_8php-source.html b/doc/developper/html/login_8php-source.html index 6790f219e..10ae82b24 100644 --- a/doc/developper/html/login_8php-source.html +++ b/doc/developper/html/login_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/login.php Source File +phpcompta: login.php Source File +html

                                    login.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -61,7 +61,7 @@
                                     00055 }
                                     00056 html_page_stop();
                                     00057 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/login_8php.html b/doc/developper/html/login_8php.html index 1ee0ea172..29179e624 100644 --- a/doc/developper/html/login_8php.html +++ b/doc/developper/html/login_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/login.php File Reference +phpcompta: login.php File Reference +html

                                    login.php File Reference

                                    Login page. More...

                                    @@ -156,7 +156,7 @@ Definition at line 39 of Definition at line 41 of file login.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/logout_8php-source.html b/doc/developper/html/logout_8php-source.html index 242f413af..fba4150d7 100644 --- a/doc/developper/html/logout_8php-source.html +++ b/doc/developper/html/logout_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/logout.php Source File +phpcompta: logout.php Source File +html

                                    logout.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -36,7 +36,7 @@
                                     00030 
                                     00031 html_page_stop();
                                     00032 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/logout_8php.html b/doc/developper/html/logout_8php.html index 7485ac544..4813d1899 100644 --- a/doc/developper/html/logout_8php.html +++ b/doc/developper/html/logout_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/logout.php File Reference +phpcompta: logout.php File Reference +html

                                    logout.php File Reference

                                    Logout. More...

                                    @@ -19,7 +19,7 @@ Logout.

                                    -Definition in file logout.php.


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +Definition in file logout.php.
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/modify__op_8php-source.html b/doc/developper/html/modify__op_8php-source.html index 3cbddc3d5..6bc046952 100644 --- a/doc/developper/html/modify__op_8php-source.html +++ b/doc/developper/html/modify__op_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/modify_op.php Source File +phpcompta: modify_op.php Source File +html

                                    modify_op.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -90,13 +90,13 @@
                                     00084     $r ='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="modify_op.php">';
                                     00085     $r.=UpdateJrn($cn,$p_id);
                                     00086 
                                    -00087     $r.='<INPUT TYPE="Hidden" name="action" value="update_record">';
                                    +00087     $r.='<INPUT TYPE="Hidden" name="action" value="update_record">';
                                     00088     $r.="<br>";
                                     00089     $r.="<br>";
                                     00090     $r.="<br>";
                                    -00091     $r.='<input type="SUBMIT" name="update_record" value="Enregistre">';
                                    +00091     $r.='<input type="SUBMIT" name="update_record" value="Enregistre">';
                                     00092     $r.="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                    -00093     $r.='<input type="button" value="Fermer" onClick="window.close();">';
                                    +00093     $r.='<input type="button" value="Fermer" onClick="window.close();">';
                                     00094     $r.='</FORM>';
                                     00095 
                                     00096 //    echo '<div class="redcontent">';
                                    @@ -157,7 +157,7 @@
                                     00154 }
                                     00155 html_page_stop();
                                     00156 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/modify__op_8php.html b/doc/developper/html/modify__op_8php.html index f92bdc652..fd143fdab 100644 --- a/doc/developper/html/modify__op_8php.html +++ b/doc/developper/html/modify__op_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/modify_op.php File Reference +phpcompta: modify_op.php File Reference +html

                                    modify_op.php File Reference

                                    Update a operation in a popup window : add a document. More...

                                    @@ -214,7 +214,7 @@ Definition at line 3776 of file modify_op.php. -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/namespaceCpdf.html b/doc/developper/html/namespaceCpdf.html index 7d9b0c6d9..9a33c4a62 100644 --- a/doc/developper/html/namespaceCpdf.html +++ b/doc/developper/html/namespaceCpdf.html @@ -21,7 +21,7 @@ LICENCE This code has been placed in the Public Domain for all to enjoy.

                                    Version:
                                    009

                                    -


                                    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/namespaces.html b/doc/developper/html/namespaces.html index 83bc68ac1..bdd701554 100644 --- a/doc/developper/html/namespaces.html +++ b/doc/developper/html/namespaces.html @@ -8,7 +8,7 @@

                                    phpcompta Namespace List

                                    Here is a list of all namespaces with brief descriptions:
                                    Cpdf
                                    -
                                    Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/not__implemented_8php-source.html b/doc/developper/html/not__implemented_8php-source.html index dda12f367..55159e11d 100644 --- a/doc/developper/html/not__implemented_8php-source.html +++ b/doc/developper/html/not__implemented_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/not_implemented.php Source File +phpcompta: not_implemented.php Source File +html

                                    not_implemented.php

                                    Go to the documentation of this file.
                                    00001 <?
                                     00002 /*
                                     00003  *   This file is part of PhpCompta.
                                    @@ -32,7 +32,7 @@
                                     00023 echo '<H1 class="info"> Not Implemented</H1>';
                                     00024 html_page_stop();
                                     00025 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/not__implemented_8php.html b/doc/developper/html/not__implemented_8php.html index c2f69bdfe..ef2d51c28 100644 --- a/doc/developper/html/not__implemented_8php.html +++ b/doc/developper/html/not__implemented_8php.html @@ -1,18 +1,18 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/not_implemented.php File Reference +phpcompta: not_implemented.php File Reference +html

                                    not_implemented.php File Reference

                                    Go to the source code of this file.
                                    -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/pages.html b/doc/developper/html/pages.html index ed06b7331..c35a40e44 100644 --- a/doc/developper/html/pages.html +++ b/doc/developper/html/pages.html @@ -9,7 +9,7 @@
                                  • Todo List
                                  -
                                  Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:26 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/parametre_8php-source.html b/doc/developper/html/parametre_8php-source.html index 8dea2696e..a7f5bf479 100644 --- a/doc/developper/html/parametre_8php-source.html +++ b/doc/developper/html/parametre_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/parametre.php Source File +phpcompta: parametre.php Source File +html

                                  parametre.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -202,7 +202,7 @@
                                   00197 
                                   00198 html_page_stop();
                                   00199 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/parametre_8php.html b/doc/developper/html/parametre_8php.html index e845e93bc..0fe3a802c 100644 --- a/doc/developper/html/parametre_8php.html +++ b/doc/developper/html/parametre_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/parametre.php File Reference +phpcompta: parametre.php File Reference +html

                                  parametre.php File Reference

                                  Parametre module. More...

                                  @@ -608,7 +608,7 @@ Definition at line 101169 of file parametre.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/pcmn__update_8php-source.html b/doc/developper/html/pcmn__update_8php-source.html index 3a8b76f4f..b8da81650 100644 --- a/doc/developper/html/pcmn__update_8php-source.html +++ b/doc/developper/html/pcmn__update_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/pcmn_update.php Source File +phpcompta: pcmn_update.php Source File +html

                                  pcmn_update.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -203,7 +203,7 @@
                                   00197 echo "</DIV>";
                                   00198 html_page_stop();
                                   00199 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/pcmn__update_8php.html b/doc/developper/html/pcmn__update_8php.html index 4022f766d..68c8a772d 100644 --- a/doc/developper/html/pcmn__update_8php.html +++ b/doc/developper/html/pcmn__update_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/pcmn_update.php File Reference +phpcompta: pcmn_update.php File Reference +html

                                  pcmn_update.php File Reference

                                  concerns the management of the "Plan Comptable" More...

                                  @@ -156,7 +156,7 @@ Definition at line 36< Definition at line 49 of file pcmn_update.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/periode_8inc_8php-source.html b/doc/developper/html/periode_8inc_8php-source.html index dce2217e3..86d6b5ad2 100644 --- a/doc/developper/html/periode_8inc_8php-source.html +++ b/doc/developper/html/periode_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/periode.inc.php Source File +phpcompta: periode.inc.php Source File +include

                                  periode.inc.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -114,7 +114,7 @@
                                   00110 ShowPeriode($cn);
                                   00111 
                                   00112 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/periode_8inc_8php.html b/doc/developper/html/periode_8inc_8php.html index 9de84d441..744782247 100644 --- a/doc/developper/html/periode_8inc_8php.html +++ b/doc/developper/html/periode_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/periode.inc.php File Reference +phpcompta: periode.inc.php File Reference +include

                                  periode.inc.php File Reference

                                  Still used ? More...

                                  @@ -137,7 +137,7 @@ Definition at line 61< Definition at line 59 of file periode.inc.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste_8inc_8php-source.html b/doc/developper/html/poste_8inc_8php-source.html index 9d4b18928..105c931c7 100644 --- a/doc/developper/html/poste_8inc_8php-source.html +++ b/doc/developper/html/poste_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/poste.inc.php Source File +phpcompta: poste.inc.php Source File +include

                                  poste.inc.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -81,7 +81,7 @@
                                   00076   echo "</div>";
                                   00077 
                                   00078 } 
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste_8inc_8php.html b/doc/developper/html/poste_8inc_8php.html index 94700a0a7..2bd6e34f4 100644 --- a/doc/developper/html/poste_8inc_8php.html +++ b/doc/developper/html/poste_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/poste.inc.php File Reference +phpcompta: poste.inc.php File Reference +include

                                  poste.inc.php File Reference

                                  p_action contains the main action (always poste here) action contains the sub action More...

                                  @@ -270,7 +270,7 @@ Referenced by par Definition at line 48 of file poste.inc.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste_8php-source.html b/doc/developper/html/poste_8php-source.html index 1d2fcf41c..2923e0bb7 100644 --- a/doc/developper/html/poste_8php-source.html +++ b/doc/developper/html/poste_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/poste.php Source File +phpcompta: poste.php Source File +include

                                  poste.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 
                                   00003 /*
                                  @@ -91,7 +91,7 @@
                                   00128 }
                                   00129 
                                   00130 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste_8php.html b/doc/developper/html/poste_8php.html index f1ec324be..d2dc859a7 100644 --- a/doc/developper/html/poste_8php.html +++ b/doc/developper/html/poste_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/poste.php File Reference +phpcompta: poste.php File Reference +include

                                  poste.php File Reference

                                  Go to the source code of this file. @@ -75,7 +75,22 @@ Max of ligne definie dans le journal.

                                  Definition at line 62 of file poste.php.

                                  -References $cn, $l_line, $Res, DbConnect(), and ExecSql(). +References $cn, $l_line, $Res, DbConnect(), and ExecSql().

                                  00063 {
                                  +00064   $cn=DbConnect($p_dossier);
                                  +00065   $Res=ExecSql($cn,"select jrn_deb_max_line,jrn_cred_max_line from jrn_def where jrn_def_id=$p_jrn");
                                  +00066   if ( pg_NumRows($Res) == 0 ) {
                                  +00067     echo "<H2 class=\"warning\"> Journal non trouvé </H2>";
                                  +00068     //    return (3,3);
                                  +00069   }
                                  +00070   $l_line=pg_fetch_array($Res,0);
                                  +00071   $l_deb=$l_line['jrn_deb_max_line'];
                                  +00072   $l_cred=$l_line['jrn_cred_max_line'];
                                  +00073   return array ($l_deb,$l_cred);
                                  +00074 
                                  +00075 }
                                  +
                                  +

                                  +

                                  @@ -134,7 +149,22 @@ Definition at line 36 of

                                  References $cn, $Res, DbConnect(), and ExecSql().

                                  -Referenced by FormODS(), Balance::GetRow(), ImpHtml(), and ViewRecord(). +Referenced by FormODS(), Balance::GetRow(), ImpHtml(), and ViewRecord().

                                  00037 {
                                  +00038   include_once("postgres.php");
                                  +00039   if ( ! isset($is_cn) ) $is_cn=0;
                                  +00040   if ( $is_cn == 0) {
                                  +00041     $cn=DbConnect($p_dossier);
                                  +00042   } else {
                                  +00043     $cn=$p_dossier;
                                  +00044   }
                                  +00045   $Res=ExecSql($cn,"select pcm_lib from tmp_pcmn where pcm_val=$p_id");
                                  +00046   if ( pg_NumRows($Res) == 0) { return "non existing poste";}
                                  +00047   $l_poste=pg_fetch_row($Res,0);
                                  +00048   return $l_poste[0];
                                  +00049 }
                                  +
                                  +

                                  +

                                  @@ -193,7 +223,24 @@ Definition at line 114 of

                                  References $Max, $r, $Res, and ExecSql().

                                  -Referenced by FormFin(). +Referenced by FormFin().

                                  00114                                                {
                                  +00115   $Res=ExecSql($p_cn,"select j_poste,sum(deb) as sum_deb, sum(cred) as sum_cred from 
                                  +00116           ( select j_poste, 
                                  +00117              case when j_debit='t' then j_montant else 0 end as deb, 
                                  +00118              case when j_debit='f' then j_montant else 0 end as cred 
                                  +00119           from jrnx join tmp_pcmn on j_poste=pcm_val 
                                  +00120               where  
                                  +00121             j_poste=$p_account
                                  +00122           ) as m group by j_poste ");
                                  +00123   $Max=pg_NumRows($Res);
                                  +00124   if ($Max==0) return 0;
                                  +00125   $r=pg_fetch_array($Res,0);
                                  +00126 
                                  +00127   return $r['sum_deb']-$r['sum_cred'];
                                  +00128 }
                                  +
                                  +

                                  +

                                  @@ -235,10 +282,28 @@ Definition at line 87 of

                                  References $Max, $Res, $ret, and ExecSql().

                                  -Referenced by ViewImp(). +Referenced by ViewImp().

                                  00087                           {
                                  +00088   $Res=ExecSql($p_cn,"select pcm_val,pcm_lib from tmp_pcmn 
                                  +00089          where pcm_val = any (select j_poste from jrnx) order by pcm_val::text");
                                  +00090   $Max=pg_NumRows($Res);
                                  +00091   if ($Max==0) return null;
                                  +00092   $ret='<SELECT NAME="poste[]" SIZE="15" MULTIPLE>';
                                  +00093   for ( $i = 0;$i< $Max;$i++) {
                                  +00094     $line=pg_fetch_array($Res,$i);
                                  +00095     $ret.=sprintf('<OPTION VALUE="%s" > %s - %s',
                                  +00096                   $line['pcm_val'],
                                  +00097                   $line['pcm_val'],
                                  +00098                   $line['pcm_lib']);
                                  +00099   }//for
                                  +00100   $ret.="</SELECT>";
                                  +00101   return $ret;
                                  +00102 }
                                  +
                                  +

                                  + -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste__csv_8php-source.html b/doc/developper/html/poste__csv_8php-source.html index dda4bfd02..803b33515 100644 --- a/doc/developper/html/poste__csv_8php-source.html +++ b/doc/developper/html/poste__csv_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_csv.php Source File +phpcompta: poste_csv.php Source File +html

                                  poste_csv.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -78,7 +78,7 @@
                                   00072 
                                   00073   exit;
                                   00074 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste__csv_8php.html b/doc/developper/html/poste__csv_8php.html index 9c9385dcb..450d66d21 100644 --- a/doc/developper/html/poste__csv_8php.html +++ b/doc/developper/html/poste__csv_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_csv.php File Reference +phpcompta: poste_csv.php File Reference +html

                                  poste_csv.php File Reference

                                  Send the poste list in csv. More...

                                  @@ -185,7 +185,7 @@ Definition at line 3573 of file poste_csv.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste__pdf_8php-source.html b/doc/developper/html/poste__pdf_8php-source.html index f3d2e1c7f..30f537214 100644 --- a/doc/developper/html/poste__pdf_8php-source.html +++ b/doc/developper/html/poste__pdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_pdf.php Source File +phpcompta: poste_pdf.php Source File +html

                                  poste_pdf.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 
                                   00003 /*
                                  @@ -100,7 +100,7 @@
                                   00094 $pdf->ezStream();
                                   00095 
                                   00096 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste__pdf_8php.html b/doc/developper/html/poste__pdf_8php.html index 89f4aac5c..b1c77e1d5 100644 --- a/doc/developper/html/poste__pdf_8php.html +++ b/doc/developper/html/poste__pdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_pdf.php File Reference +phpcompta: poste_pdf.php File Reference +html

                                  poste_pdf.php File Reference

                                  send the account list in PDF More...

                                  @@ -183,7 +183,7 @@ Definition at line 7574 of file poste_pdf.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste__search_8php-source.html b/doc/developper/html/poste__search_8php-source.html index 8e60efdd6..7bf57c84e 100644 --- a/doc/developper/html/poste__search_8php-source.html +++ b/doc/developper/html/poste__search_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_search.php Source File +phpcompta: poste_search.php Source File +html

                                  poste_search.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -133,7 +133,7 @@
                                   00127 
                                   00128 echo '<FORM ACTION="poste_search.php'.$url.'" METHOD="POST">';
                                   00129 if ( isset($p_ctl) ) {
                                  -00130   if ($p_ctl != 'not')   echo '<INPUT TYPE="hidden" name="p_ctl" value="'.$p_ctl.'">';
                                  +00130   if ($p_ctl != 'not')   echo '<INPUT TYPE="hidden" name="p_ctl" value="'.$p_ctl.'">';
                                   00131 }
                                   00132 echo '<TABLE>';
                                   00133 echo '<TR>';
                                  @@ -142,14 +142,14 @@
                                   00136 
                                   00137 if ( ! isset ($p_class) ) $p_class="";
                                   00138 $opt=" <INPUT TYPE=\"text\" value=\"$p_class\" name=\"st_with\">";
                                  -00139 echo '<TD> <INPUT TYPE="text" name="p_class" VALUE="'.$p_class.'"></TD>';
                                  +00139 echo '<TD> <INPUT TYPE="text" name="p_class" VALUE="'.$p_class.'"></TD>';
                                   00140 
                                   00141 echo '<TD> Libellé </TD>';
                                   00142 echo '<TD> contient </TD>';
                                   00143 if ( ! isset ($p_comment) ) $p_comment="";
                                  -00144 echo '<TD> <INPUT TYPE="text" name="p_comment" VALUE="'.$p_comment.'"></TD></TR>';
                                  +00144 echo '<TD> <INPUT TYPE="text" name="p_comment" VALUE="'.$p_comment.'"></TD></TR>';
                                   00145 echo '</TABLE>';
                                  -00146 echo '<INPUT TYPE="submit" name="search" value="cherche">';
                                  +00146 echo '<INPUT TYPE="submit" name="search" value="cherche">';
                                   00147 echo '</FORM>';
                                   00148 
                                   00149 // if request search
                                  @@ -189,7 +189,7 @@
                                   00183 echo '<INPUT TYPE="BUTTON" Value="Close" onClick=\'GetIt()\'>';
                                   00184 html_page_stop();
                                   00185 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/poste__search_8php.html b/doc/developper/html/poste__search_8php.html index 8adb63f67..98573b3da 100644 --- a/doc/developper/html/poste__search_8php.html +++ b/doc/developper/html/poste__search_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/poste_search.php File Reference +phpcompta: poste_search.php File Reference +html

                                  poste_search.php File Reference

                                  Search a account in a popup window. More...

                                  @@ -239,7 +239,7 @@ Definition at line 68 Definition at line 31 of file poste_search.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/postgres_8php-source.html b/doc/developper/html/postgres_8php-source.html index 45a227430..73fe36587 100644 --- a/doc/developper/html/postgres_8php-source.html +++ b/doc/developper/html/postgres_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/postgres.php Source File +phpcompta: postgres.php Source File +include

                                  postgres.php

                                  Go to the documentation of this file.
                                  00001 <? //$Revision$
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -194,7 +194,7 @@
                                   00222 function CountSql($p_conn,$p_sql)
                                   00223 {
                                   00224   $r_sql=ExecSql($p_conn,$p_sql);
                                  -00225   return pg_NumRows($r_sql);
                                  +00225   return pg_NumRows($r_sql." limit 3");
                                   00226 
                                   00227 }
                                   00232 function GetDossierName($p_dossier)
                                  @@ -312,7 +312,7 @@
                                   00393             pg_lo_unlink($cn,$old_oid);
                                   00394         }
                                   00395         // Load new document
                                  -00396         ExecSql($cn,"update jrn set jr_pj=".$oid.", jr_pj_name='".$_FILES['pj']['name']."', ".
                                  +00396         ExecSql($cn,"update jrn set jr_pj=".$oid.", jr_pj_name='".$_FILES['pj']['name']."', ".
                                   00397                 "jr_pj_type='".$_FILES['pj']['type']."'  where jr_grpt_id=$seq");
                                   00398         return $oid;
                                   00399 
                                  @@ -333,7 +333,7 @@
                                   00420 }
                                   00421 
                                   00422 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/postgres_8php.html b/doc/developper/html/postgres_8php.html index 599e62252..3151f78fc 100644 --- a/doc/developper/html/postgres_8php.html +++ b/doc/developper/html/postgres_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/postgres.php File Reference +phpcompta: postgres.php File Reference +include

                                  postgres.php File Reference

                                  Contains the procedure for connecting to postgresql. More...

                                  @@ -131,7 +131,13 @@ Definition in file postgres.php Definition at line 269 of file postgres.php.

                                  -References $Res, and ExecSql(). +References $Res, and ExecSql().

                                  00269                                                {
                                  +00270   
                                  +00271   $Res=ExecSql($p_cn,"alter sequence $p_name restart $p_value");
                                  +00272 }
                                  +
                                  +

                                  +

                                  @@ -165,7 +171,12 @@ Definition at line 263

                                  References $Res, and ExecSql().

                                  -Referenced by Centralise(), Document_modele::Delete(), Document::Generate(), Document_modele::Get(), ImportCSV(), fiche::insert(), RecordInvoice(), RecordSell(), Document_modele::Save(), Document::SaveGenerated(), Document::Send(), TransferCSV(), and Document::Upload(). +Referenced by Centralise(), Document_modele::Delete(), Document::Generate(), Document_modele::Get(), ImportCSV(), fiche::insert(), RecordInvoice(), RecordSell(), Document_modele::Save(), Document::SaveGenerated(), Document::Send(), TransferCSV(), and Document::Upload().

                                  00263                        {
                                  +00264   $Res=ExecSql($p_cn,"commit");
                                  +00265 }
                                  +
                                  +

                                  +

                                  @@ -208,7 +219,14 @@ Definition at line 222

                                  References ExecSql().

                                  -Referenced by cl_user::AccessJrn(), AddFiche(), cl_user::Admin(), CheckDossier(), CheckIsAdmin(), CheckJrn(), DeleteRapt(), action::Display(), form_verify_input(), FormODS(), FormVenteView(), GetParent(), GetRappel(), fiche_def::HasAttribute(), fiche::insert(), InsertRapt(), ListJrn(), action::myList(), NextJrn(), Remove(), ShowDossier(), fiche::update(), UpdateFiche(), and ViewFiche(). +Referenced by cl_user::AccessJrn(), AddFiche(), cl_user::Admin(), CheckDossier(), CheckIsAdmin(), CheckJrn(), DeleteRapt(), action::Display(), form_verify_input(), FormODS(), FormVenteView(), GetParent(), GetRappel(), fiche_def::HasAttribute(), fiche::insert(), InsertRapt(), ListJrn(), action::myList(), NextJrn(), Remove(), ShowDossier(), fiche::update(), UpdateFiche(), and ViewFiche().

                                  00223 {
                                  +00224   $r_sql=ExecSql($p_conn,$p_sql);
                                  +00225   return pg_NumRows($r_sql." limit 3");
                                  +00226 
                                  +00227 }
                                  +
                                  +

                                  +

                                  @@ -259,7 +277,30 @@ Definition at line 72

                                  References $a, and echo_debug().

                                  -Referenced by cl_user::Admin(), cl_user::Check(), CheckAction(), CheckDossier(), CheckIsAdmin(), CheckJrn(), cl_user::cl_user(), ExisteJnt(), ExistePriv(), GetAllUser(), GetAvailableFolder(), GetDbId(), GetDossierName(), GetFirstJrnIdForJrnType(), GetJnt(), GetJrnProp(), GetLogin(), GetNumberLine(), GetPosteLibelle(), GetPriv(), GetUid(), html_page_start(), ListJrn(), MenuJrn(), ParseFormula(), RecordJrn(), ShowDossier(), ShowMenuComptaForm(), ShowMenuFiche(), ShowMenuJrnUser(), SyncRight(), and ViewJrn(). +Referenced by cl_user::Admin(), cl_user::Check(), CheckAction(), CheckDossier(), CheckIsAdmin(), CheckJrn(), cl_user::cl_user(), ExisteJnt(), ExistePriv(), GetAllUser(), GetAvailableFolder(), GetDbId(), GetDossierName(), GetFirstJrnIdForJrnType(), GetJnt(), GetJrnProp(), GetLogin(), GetNumberLine(), GetPosteLibelle(), GetPriv(), GetUid(), html_page_start(), ListJrn(), MenuJrn(), ParseFormula(), RecordJrn(), ShowDossier(), ShowMenuComptaForm(), ShowMenuFiche(), ShowMenuJrnUser(), SyncRight(), and ViewJrn().

                                  00072                                                {
                                  +00073   if ( $p_db==-1) 
                                  +00074     $l_dossier=sprintf("%saccount_repository",domaine);
                                  +00075   else {
                                  +00076     if ( $p_db == -2 )
                                  +00077       $l_dossier=$p_type;
                                  +00078     else 
                                  +00079       switch ($p_type) {
                                  +00080       case 'dossier':
                                  +00081         $l_dossier=sprintf("%sdossier%d",domaine,$p_db);
                                  +00082         break;
                                  +00083       case 'mod':
                                  +00084         $l_dossier=sprintf("%smod%d",domaine,$p_db);
                                  +00085         break;
                                  +00086       }
                                  +00087   }
                                  +00088   $password=phpcompta_password;
                                  +00089   $a=pg_connect("dbname=$l_dossier host=127.0.0.1 user='phpcompta' password='$password'");
                                  +00090   echo_debug ('postgres.php',__LINE__,"connect to $p_db dbname $l_dossier");
                                  +00091   return $a;
                                  +00092 }
                                  +
                                  +

                                  +

                                  @@ -293,7 +334,12 @@ Definition at line 260

                                  References $Res, and ExecSql().

                                  -Referenced by Centralise(). +Referenced by Centralise().

                                  00260                        {
                                  +00261   $Res=ExecSql($p_cn,"end transaction");
                                  +00262 }
                                  +
                                  +

                                  +

                                  @@ -345,7 +391,22 @@ Definition at line 99

                                  References $ret, echo_debug(), echo_error(), and exit.

                                  -Referenced by AddFiche(), AddForm(), AddModele(), AlterSequence(), fiche::blank(), Document::blank(), Centralise(), cl_user::CheckAction(), CheckAction(), CheckJrn(), Commit(), action::Confirm(), fiche::CountByDef(), CountSql(), Document_modele::Delete(), DeleteForm(), DeleteRapt(), fiche::Display(), DisplayDetailModele(), EncodeFiche(), EndSql(), ExecuteScript(), ExisteJnt(), ExistePriv(), FormPeriode(), FormPeriodeMult(), Document::Generate(), poste::get(), parm_code::Get(), fiche_def_ref::Get(), fiche_def::Get(), Document_type::get(), Document_modele::Get(), action::get(), Get_attr_def(), Get_attr_min(), Get_fiche_def_ref(), fiche_def::GetAll(), GetAllUser(), GetAmount(), GetArray(), fiche::getAttribut(), fiche_def::GetAttribut(), GetAvailableFolder(), GetBaseFiche(), GetBaseFicheDefault(), fiche::GetByDef(), fiche::GetByQCode(), fiche::GetByType(), GetClass(), GetConcerned(), GetCreateAccount(), GetData(), GetDataForm(), GetDataGrpt(), GetDataJrn(), GetDataJrnJrId(), GetDataJrnPdf(), GetDataModele(), GetDataPoste(), GetDbId(), getDbValue(), jrn::GetDefLine(), GetDossierName(), GetExercice(), cl_user::getExercice(), getFicheAttribut(), GetFicheDef(), getFicheDefName(), GetFicheDefRef(), GetFicheJrn(), getFicheName(), getFicheNameById(), getFicheNameCode(), GetFirstJrnIdForJrnType(), GetFormName(), GetFormulaValue(), Supplier::GetFromPoste(), Customer::GetFromPoste(), cl_user::GetGlobalPref(), GetGrpt(), GetInternal(), GetJnt(), GetJrnName(), GetJrnProp(), GetJrnProperty(), GetLogin(), GetModeleId(), jrn::GetName(), fiche::getName(), GetNextFiche(), GetNumberLine(), GetPeriode(), getPeriodeFromDate(), getPeriodeFromMonth(), GetPosteLibelle(), cl_user::GetPreferences(), GetPriv(), GetQuantity(), GetRappel(), rapport::GetRow(), poste::GetRow(), jrn::GetRow(), Balance::GetRow(), jrn::GetRowSimple(), GetSequence(), GetSolde(), poste::GetSolde(), poste::GetSoldeDetail(), GetTvaPoste(), GetTvaRate(), GetUid(), GetUserProperty(), GetVersion(), html_page_start(), ImpHtml(), fiche::insert(), cl_user::insert_default_global_pref(), InsertJrn(), InsertJrnx(), InsertModeleLine(), InsertRapt(), InsertStockGoods(), isCentralize(), IsFicheOfJrn(), isValid(), ListJrn(), parm_code::LoadAll(), fiche_def_ref::LoadAll(), MenuJrn(), Document::MoveDocumentPj(), Document_modele::myList(), action::myList(), new_fiche(), NextSequence(), Own::Own(), ParseFormula(), PeriodeClosed(), PosteForm(), RecordFin(), RecordInvoice(), RecordJrn(), RecordSell(), Remove(), fiche::remove(), Document::remove(), Rollback(), parm_code::Save(), fiche_def_ref::Save(), Document_modele::Save(), save_upload_document(), Document::SaveGenerated(), SaveModeleName(), action::SaveStage2(), Document::Send(), SetInternalCode(), cl_user::SetPeriode(), ShowDevise(), ShowDossier(), ShowMenuComptaForm(), ShowMenuFiche(), ShowMenuJrn(), ShowMenuJrnUser(), ShowPeriode(), StartSql(), fiche::strAttribut(), SyncRight(), TransferCSV(), fiche::update(), action::Update(), cl_user::update_global_pref(), UpdateComment(), UpdateCSV(), UpdateFiche(), UpdateForm(), Document::Upload(), Customer::VatListing(), VerifImport(), ViewDetailStock(), ViewFiche(), ViewFicheDetail(), ViewJrn(), and ViewStock(). +Referenced by AddFiche(), AddForm(), AddModele(), AlterSequence(), fiche::blank(), Document::blank(), Centralise(), cl_user::CheckAction(), CheckAction(), CheckJrn(), Commit(), action::Confirm(), fiche::CountByDef(), CountSql(), Document_modele::Delete(), DeleteForm(), DeleteRapt(), fiche::Display(), DisplayDetailModele(), EncodeFiche(), EndSql(), ExecuteScript(), ExisteJnt(), ExistePriv(), FormPeriode(), FormPeriodeMult(), Document::Generate(), poste::get(), parm_code::Get(), fiche_def_ref::Get(), fiche_def::Get(), Document_type::get(), Document_modele::Get(), action::get(), Get_attr_def(), Get_attr_min(), Get_fiche_def_ref(), fiche_def::GetAll(), GetAllUser(), GetAmount(), GetArray(), fiche::getAttribut(), fiche_def::GetAttribut(), GetAvailableFolder(), GetBaseFiche(), GetBaseFicheDefault(), fiche::GetByDef(), fiche::GetByQCode(), fiche::GetByType(), GetClass(), GetConcerned(), GetCreateAccount(), GetData(), GetDataForm(), GetDataGrpt(), GetDataJrn(), GetDataJrnJrId(), GetDataJrnPdf(), GetDataModele(), GetDataPoste(), GetDbId(), getDbValue(), jrn::GetDefLine(), GetDossierName(), GetExercice(), cl_user::getExercice(), getFicheAttribut(), GetFicheDef(), getFicheDefName(), GetFicheDefRef(), GetFicheJrn(), getFicheName(), getFicheNameById(), getFicheNameCode(), GetFirstJrnIdForJrnType(), GetFormName(), GetFormulaValue(), Supplier::GetFromPoste(), Customer::GetFromPoste(), cl_user::GetGlobalPref(), GetGrpt(), GetInternal(), GetJnt(), GetJrnName(), GetJrnProp(), GetJrnProperty(), GetLogin(), GetModeleId(), jrn::GetName(), fiche::getName(), GetNextFiche(), GetNumberLine(), GetPeriode(), getPeriodeFromDate(), getPeriodeFromMonth(), GetPosteLibelle(), cl_user::GetPreferences(), GetPriv(), GetQuantity(), GetRappel(), rapport::GetRow(), poste::GetRow(), jrn::GetRow(), Balance::GetRow(), jrn::GetRowSimple(), GetSequence(), GetSolde(), poste::GetSolde(), poste::GetSoldeDetail(), GetTvaPoste(), GetTvaRate(), GetUid(), GetUserProperty(), GetVersion(), html_page_start(), ImpHtml(), fiche::insert(), cl_user::insert_default_global_pref(), InsertJrn(), InsertJrnx(), InsertModeleLine(), InsertRapt(), InsertStockGoods(), isCentralize(), IsFicheOfJrn(), isValid(), ListJrn(), parm_code::LoadAll(), fiche_def_ref::LoadAll(), MenuJrn(), Document::MoveDocumentPj(), Document_modele::myList(), action::myList(), new_fiche(), NextSequence(), Own::Own(), ParseFormula(), PeriodeClosed(), PosteForm(), RecordFin(), RecordInvoice(), RecordJrn(), RecordSell(), Remove(), fiche::remove(), Document::remove(), Rollback(), parm_code::Save(), fiche_def_ref::Save(), Document_modele::Save(), save_upload_document(), Document::SaveGenerated(), SaveModeleName(), action::SaveStage2(), Document::Send(), SetInternalCode(), cl_user::SetPeriode(), ShowDevise(), ShowDossier(), ShowMenuComptaForm(), ShowMenuFiche(), ShowMenuJrn(), ShowMenuJrnUser(), ShowPeriode(), StartSql(), fiche::strAttribut(), SyncRight(), TransferCSV(), fiche::update(), action::Update(), cl_user::update_global_pref(), UpdateComment(), UpdateCSV(), UpdateFiche(), UpdateForm(), Document::Upload(), Customer::VatListing(), VerifImport(), ViewDetailStock(), ViewFiche(), ViewFicheDetail(), ViewJrn(), and ViewStock().

                                  00099                                            {
                                  +00100   echo_debug('postgres.php',__LINE__,"SQL = $p_string");
                                  +00101   // probl. with Ubuntu & UTF8
                                  +00102   //----
                                  +00103   pg_set_client_encoding($p_connection,'latin1');
                                  +00104   $ret=pg_query($p_connection,$p_string);
                                  +00105   if ( $ret == false ) { 
                                  +00106     echo_error ("SQL ERROR ::: $p_string");
                                  +00107     exit(" Operation cancelled due to error : $p_string");
                                  +00108   }
                                  +00109 
                                  +00110   return $ret;
                                  +00111 }
                                  +
                                  +

                                  +

                                  @@ -388,7 +449,14 @@ Get the number of rows from table jnt_use_dos where $p_dossier = dos_id and use_

                                  Definition at line 168 of file postgres.php.

                                  -References $cn, $Res, DbConnect(), and ExecSql(). +References $cn, $Res, DbConnect(), and ExecSql().

                                  00169 {
                                  +00170   $cn=DbConnect();
                                  +00171   $Res=ExecSql($cn,"select * from jnt_use_dos where dos_id=".$p_dossier." and use_id=".$p_user);
                                  +00172   return pg_NumRows($Res);
                                  +00173 }
                                  +
                                  +

                                  +

                                  @@ -420,7 +488,14 @@ References $cn,

                                  Definition at line 179 of file postgres.php.

                                  -References $cn, $Res, DbConnect(), and ExecSql(). +References $cn, $Res, DbConnect(), and ExecSql().

                                  00180 {
                                  +00181   $cn=DbConnect();
                                  +00182   $Res=ExecSql($cn,"select * from priv_user where priv_jnt=".$p_jntid);
                                  +00183   return pg_NumRows($Res);
                                  +00184 }
                                  +
                                  +

                                  +

                                  @@ -453,7 +528,22 @@ Return all the users as an array.

                                  Definition at line 117 of file postgres.php.

                                  -References $cn, $Num, $Res, $sql, $User, DbConnect(), echo_debug(), and ExecSql(). +References $cn, $Num, $Res, $sql, $User, DbConnect(), echo_debug(), and ExecSql().

                                  00117                       {
                                  +00118   echo_debug('postgres.php',__LINE__,"GetUser");
                                  +00119   $cn=DbConnect();
                                  +00120   $sql="select * from ac_users where use_login!='phpcompta'";
                                  +00121   echo_debug('postgres.php',__LINE__,"ExecSql");
                                  +00122   $Res=ExecSql($cn,$sql);
                                  +00123   $Num=pg_NumRows($Res);
                                  +00124   if ( $Num == 0 ) return null;
                                  +00125   for ($i=0;$i < $Num; $i++) {
                                  +00126     $User[]=pg_fetch_array($Res,$i);
                                  +00127   }
                                  +00128   return $User;
                                  +00129 }
                                  +
                                  +

                                  +

                                  @@ -504,7 +594,17 @@ Definition at line 353

                                  References $array, $r, echo_debug(), and ExecSql().

                                  -Referenced by FormAchInput(), and FormVenInput(). +Referenced by FormAchInput(), and FormVenInput().

                                  00353                                 {
                                  +00354   echo_debug('postgres.php',__LINE__,"GetArray");
                                  +00355   $r=ExecSql($p_cn,$p_sql);
                                  +00356   if ( ($Max=  pg_NumRows($r)) == 0 ) return null;
                                  +00357   $array=pg_fetch_all($r);
                                  +00358   echo_debug('postgres.php',__LINE__,var_export($array,true));
                                  +00359   return $array;
                                  +00360 }
                                  +
                                  +

                                  +

                                  @@ -536,7 +636,22 @@ Referenced by FormA

                                  Definition at line 201 of file postgres.php.

                                  -References $cn, $num, DbConnect(), and ExecSql(). +References $cn, $num, DbConnect(), and ExecSql().

                                  00202 {
                                  +00203   $cn=DbConnect();
                                  +00204   $r_sql=ExecSql($cn,"select dos_id from ac_dossier
                                  +00205                  where dos_name='".$p_name."'");
                                  +00206   $num=pg_NumRows($r_sql);
                                  +00207   if ( $num == 0 ) {
                                  +00208     return 0;
                                  +00209   } else {
                                  +00210     $l_db=pg_fetch_array($r_sql,0);
                                  +00211     return $l_db['dos_id'];
                                  +00212   }
                                  +00213      
                                  +00214 }
                                  +
                                  +

                                  +

                                  @@ -588,7 +703,15 @@ Definition at line 414

                                  References $r, $ret, and ExecSql().

                                  -Referenced by action::Display(). +Referenced by action::Display().

                                  00415 {
                                  +00416   $ret=ExecSql($p_cn,$sql);
                                  +00417   if ( pg_NumRows($ret) == 0 ) return "";
                                  +00418   $r=pg_fetch_row($ret,0);
                                  +00419   return $r[0];
                                  +00420 }
                                  +
                                  +

                                  +

                                  @@ -626,7 +749,15 @@ Referenced by action:

                                  Definition at line 232 of file postgres.php.

                                  -References $cn, $r, $Ret, DbConnect(), and ExecSql(). +References $cn, $r, $Ret, DbConnect(), and ExecSql().

                                  00233 {
                                  +00234   $cn=DbConnect();
                                  +00235   $Ret=ExecSql($cn,"select dos_name from ac_dossier where dos_id=".$p_dossier);
                                  +00236   $r= pg_fetch_array($Ret,0);
                                  +00237   return $r['dos_name'];
                                  +00238 }
                                  +
                                  +

                                  +

                                  @@ -667,7 +798,15 @@ References $cn,

                                  Definition at line 190 of file postgres.php.

                                  -References $cn, $Res, DbConnect(), and ExecSql(). +References $cn, $Res, DbConnect(), and ExecSql().

                                  00191 {
                                  +00192   $cn=DbConnect();
                                  +00193   $Res=ExecSql($cn,"select jnt_id from jnt_use_dos where dos_id=".$p_dossier." and use_id=".$p_user);
                                  +00194   $R=pg_fetch_array($Res,0);
                                  +00195   return $R['jnt_id'];
                                  +00196 }
                                  +
                                  +

                                  +

                                  @@ -699,7 +838,16 @@ References $cn,

                                  Definition at line 273 of file postgres.php.

                                  -References $cn, $Res, DbConnect(), and ExecSql(). +References $cn, $Res, DbConnect(), and ExecSql().

                                  00274 {
                                  +00275   $cn=DbConnect();
                                  +00276   $Res=ExecSql($cn,"select use_login from ac_users where use_id=$p_uid");
                                  +00277   if ( pg_NumRows($Res) == 0 ) return null;
                                  +00278   $a_login=pg_fetch_array($Res,0);
                                  +00279   return $a_login['use_login'];
                                  +00280 }
                                  +
                                  +

                                  +

                                  @@ -749,7 +897,15 @@ Give the mod_id from modeledef.

                                  Definition at line 340 of file postgres.php.

                                  -References $Res, and ExecSql(). +References $Res, and ExecSql().

                                  00340                                        {
                                  +00341   $Res=ExecSql($p_cn,"select mod_id from modeledef where mod_name='$p_modname'");
                                  +00342   if (pg_NumRows($Res) == 0) return 0;
                                  +00343   $name=pg_fetch_array($Res,0);
                                  +00344   return $name['mod_id'];
                                  +00345 }
                                  +
                                  +

                                  +

                                  @@ -794,7 +950,24 @@ Definition at line 147

                                  References $cn, $i, $Num, $Res, DbConnect(), echo_debug(), and ExecSql().

                                  -Referenced by SyncRight(). +Referenced by SyncRight().

                                  00148 {
                                  +00149   $cn=DbConnect();
                                  +00150   $Res=ExecSql($cn,"select priv_priv 
                                  +00151                     from priv_user  left join jnt_use_dos on jnt_id=priv_jnt
                                  +00152                         inner join ac_users on ac_users.use_id=jnt_use_dos.use_id
                                  +00153                     where use_login='$p_login' and dos_id=$p_dossier");
                                  +00154   $Num=pg_NumRows($Res);
                                  +00155   echo_debug('postgres.php',__LINE__,"Found ".$Num." rows in GetPriv");
                                  +00156   if ( $Num==0) { return 0;}
                                  +00157   for($i=0;$i < $Num;$i++) {
                                  +00158     $Right=pg_fetch_array($Res,$i); 
                                  +00159     $Priv[]=$Right['priv_priv'];
                                  +00160   }
                                  +00161   return $Priv;
                                  +00162 }
                                  +
                                  +

                                  +

                                  @@ -839,7 +1012,14 @@ Definition at line 242

                                  References $Res, $seq, and ExecSql().

                                  -Referenced by AddFiche(), AddForm(), AddModele(), InsertJrn(), InsertJrnx(), and Document::SaveGenerated(). +Referenced by AddFiche(), AddForm(), AddModele(), InsertJrn(), InsertJrnx(), and Document::SaveGenerated().

                                  00243 {
                                  +00244   $Res=ExecSql($p_cn,"select currval('$p_seq') as seq");
                                  +00245   $seq=pg_fetch_array($Res,0);
                                  +00246   return $seq['seq'];
                                  +00247 }
                                  +
                                  +

                                  +

                                  @@ -873,7 +1053,19 @@ Check if the User is valid and return an array with his property.

                                  Definition at line 134 of file postgres.php.

                                  -References $cn, $Num, $Res, DbConnect(), and ExecSql(). +References $cn, $Num, $Res, DbConnect(), and ExecSql().

                                  00134                         {
                                  +00135   $cn=DbConnect();
                                  +00136   $Res=ExecSql($cn,"select * from ac_users where use_id=".$p_uid);
                                  +00137   $Num=pg_NumRows($Res);
                                  +00138   if ( $Num == 0 ) { return false; }
                                  +00139   for ($i=0;$i < $Num; $i++) {
                                  +00140     $Prop[]=pg_fetch_array($Res,$i);
                                  +00141   }
                                  +00142   return $Prop;
                                  +00143 }
                                  +
                                  +

                                  +

                                  @@ -925,7 +1117,24 @@ Get the properties of an user it means theme, profile, admin...

                                  Definition at line 315 of file postgres.php.

                                  -References $a, $Ret, $sql, and ExecSql(). +References $a, $Ret, $sql, and ExecSql().

                                  00316 {
                                  +00317  $sql="select use_login,use_first_name,use_name,use_admin,use_usertype,g_theme
                                  +00318      from ac_users where use_login='$p_user'";
                                  +00319  $Ret=ExecSql($p_cn,$sql);
                                  +00320  if ( pg_NumRows($Ret) == 0) 
                                  +00321    return array('use_first_name'=>'?',
                                  +00322                 'use_name'=>'Unknown',
                                  +00323                 'use_admin'=>0,
                                  +00324                 'use_usertype'=>'user',
                                  +00325                 'g_theme'=>'classic',
                                  +00326                 'use_login'=>$p_user);
                                  +00327 
                                  +00328  $a=pg_fetch_array($Ret,0);
                                  +00329  return $a;
                                  +00330 }
                                  +
                                  +

                                  +

                                  @@ -970,7 +1179,14 @@ Definition at line 251

                                  References $Res, $seq, and ExecSql().

                                  -Referenced by Document::blank(), Document::Generate(), fiche::insert(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Document_modele::Save(), action::SaveStage2(), SetInternalCode(), and TransferCSV(). +Referenced by Document::blank(), Document::Generate(), fiche::insert(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Document_modele::Save(), action::SaveStage2(), SetInternalCode(), and TransferCSV().

                                  00252 {
                                  +00253   $Res=ExecSql($p_cn,"select nextval('$p_seq') as seq");
                                  +00254   $seq=pg_fetch_array($Res,0);
                                  +00255   return $seq['seq'];
                                  +00256 }
                                  +
                                  +

                                  +

                                  @@ -1004,7 +1220,12 @@ Definition at line 266

                                  References $Res, and ExecSql().

                                  -Referenced by ExecuteScript(), RecordFin(), RecordInvoice(), RecordSell(), Document_modele::Save(), save_upload_document(), Document::SaveGenerated(), TransferCSV(), and Document::Upload(). +Referenced by ExecuteScript(), RecordFin(), RecordInvoice(), RecordSell(), Document_modele::Save(), save_upload_document(), Document::SaveGenerated(), TransferCSV(), and Document::Upload().

                                  00266                          {
                                  +00267   $Res=ExecSql($p_cn,"rollback");
                                  +00268 }
                                  +
                                  +

                                  +

                                  @@ -1055,9 +1276,48 @@ save_upload_document

                                  Definition at line 371 of file postgres.php.

                                  -References $old_oid, $r, $ret, echo_debug(), echo_error(), ExecSql(), name, and Rollback(). +References $old_oid, $r, $ret, echo_debug(), echo_error(), ExecSql(), name, and Rollback().

                                  -Referenced by RecordInvoice(), and RecordSell(). +Referenced by RecordInvoice(), and RecordSell().

                                  00371                                          {
                                  +00372 
                                  +00373   $new_name=tempnam('/tmp','pj');
                                  +00374   echo_debug('postgres.php',__LINE__,"new name=".$new_name);
                                  +00375   if ( strlen ($_FILES['pj']['tmp_name']) != 0 ) {
                                  +00376       if (move_uploaded_file($_FILES['pj']['tmp_name'],
                                  +00377                              $new_name)) {
                                  +00378         // echo "Image saved";
                                  +00379 
                                  +00380         $oid= pg_lo_import($cn,$new_name);
                                  +00381         if ( $oid == false ) {
                                  +00382           echo_error('postgres.php',__LINE__,"cannot upload document");
                                  +00383           Rollback($cn);
                                  +00384           return;
                                  +00385         }
                                  +00386         echo_debug('postgres.php',__LINE__,"Loading document");
                                  +00387         // Remove old document
                                  +00388         $ret=ExecSql($cn,"select jr_pj from jrn where jr_grpt_id=$seq");
                                  +00389         if (pg_num_rows($ret) != 0) {
                                  +00390           $r=pg_fetch_array($ret,0);
                                  +00391           $old_oid=$r['jr_pj'];
                                  +00392           if (strlen($old_oid) != 0) 
                                  +00393             pg_lo_unlink($cn,$old_oid);
                                  +00394         }
                                  +00395         // Load new document
                                  +00396         ExecSql($cn,"update jrn set jr_pj=".$oid.", jr_pj_name='".$_FILES['pj']['name']."', ".
                                  +00397                 "jr_pj_type='".$_FILES['pj']['type']."'  where jr_grpt_id=$seq");
                                  +00398         return $oid;
                                  +00399 
                                  +00400       }      else {
                                  +00401         echo "<H1>Error</H1>";
                                  +00402         Rollback($cn);
                                  +00403         return null;
                                  +00404       }
                                  +00405     }
                                  +00406 
                                  +00407  }
                                  +
                                  +

                                  +

                                  @@ -1115,7 +1375,43 @@ Show the folder where user have access. Return : nothing ++

                                  Definition at line 32 of file postgres.php.

                                  -References $_SESSION, $cn, $Max, $row, CountSql(), DbConnect(), echo_debug(), and ExecSql(). +References $_SESSION, $cn, $Max, $row, CountSql(), DbConnect(), echo_debug(), and ExecSql().

                                  00032                                                             {
                                  +00033   $l_user=$_SESSION['g_user'];
                                  +00034   if ( $p_max == 0 ) {
                                  +00035     $l_step="";
                                  +00036   } else {
                                  +00037     $l_step="LIMIT $p_max OFFSET $p_first";
                                  +00038   }
                                  +00039   $cn=DbConnect();
                                  +00040   if ( $p_type == "all") {
                                  +00041     $l_sql="select *, 'W' as priv_priv from ac_dossier ORDER BY dos_name  ";
                                  +00042     $p_Num=CountSql($cn,$l_sql);
                                  +00043   } else {
                                  +00044     $l_sql="select * from jnt_use_dos 
                                  +00045                                natural join ac_dossier 
                                  +00046                                natural join ac_users 
                                  +00047                                inner join priv_user on priv_jnt=jnt_id where 
                                  +00048                                use_login='".$l_user."' and priv_priv !='NO'
                                  +00049                                order by dos_name ";
                                  +00050     $p_Num=CountSql($cn,$l_sql);
                                  +00051   }
                                  +00052   $l_sql=$l_sql.$l_step;
                                  +00053   $p_res=ExecSql($cn,$l_sql);
                                  +00054 
                                  +00055   echo_debug('postgres.php',__LINE__,"ShowDossier:".$p_res." Line = $p_Num");
                                  +00056 
                                  +00057   $Max=pg_NumRows($p_res);
                                  +00058   if ( $Max == 0 ) return null;
                                  +00059   for ( $i=0;$i<$Max; $i++) {   
                                  +00060     //    echo_debug ("i = $i");
                                  +00061     $row[]=pg_fetch_array($p_res,$i);
                                  +00062     //echo $row[dossier];
                                  +00063   }
                                  +00064   return $row;
                                  +00065 }
                                  +
                                  +

                                  +

                                  @@ -1149,7 +1445,12 @@ Definition at line 257

                                  References $Res, and ExecSql().

                                  -Referenced by Centralise(), Document_modele::Delete(), Document::Generate(), Document_modele::Get(), ImportCSV(), fiche::insert(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Document_modele::Save(), Document::SaveGenerated(), Document::Send(), TransferCSV(), and Document::Upload(). +Referenced by Centralise(), Document_modele::Delete(), Document::Generate(), Document_modele::Get(), ImportCSV(), fiche::insert(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Document_modele::Save(), Document::SaveGenerated(), Document::Send(), TransferCSV(), and Document::Upload().

                                  00257                          {
                                  +00258   $Res=ExecSql($p_cn,"start transaction");
                                  +00259 }
                                  +
                                  +

                                  +

                                  @@ -1198,10 +1499,24 @@ SyncRight

                                  Parameters:

                                  Definition at line 289 of file postgres.php.

                                  -References $cn, $priv, $Res, $right, $sql, DbConnect(), ExecSql(), and GetPriv(). +References $cn, $priv, $Res, $right, $sql, DbConnect(), ExecSql(), and GetPriv().

                                  00289                                        {
                                  +00290   $priv=GetPriv($p_dossier,$p_user);
                                  +00291   $right=$priv[0];
                                  +00292 
                                  +00293   $cn=DbConnect($p_dossier);
                                  +00294 
                                  +00295  $sql="insert into user_sec_jrn(uj_login,uj_jrn_id,uj_priv) ".
                                  +00296    "select '".$p_user."',jrn_def_id,'".$right."' from jrn_def ".
                                  +00297    "where jrn_def_id not in ".
                                  +00298    "(select uj_jrn_id from user_sec_jrn where uj_login='".$p_user."')";
                                  +00299  $Res=ExecSql($cn,$sql);
                                  +00300 }
                                  +
                                  +

                                  + -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/pref_8inc_8php-source.html b/doc/developper/html/pref_8inc_8php-source.html index 30c01761d..adb8e48ef 100644 --- a/doc/developper/html/pref_8inc_8php-source.html +++ b/doc/developper/html/pref_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/pref.inc.php Source File +phpcompta: pref.inc.php Source File +include

                                  pref.inc.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -52,9 +52,9 @@
                                   00047 
                                   00048 <FORM ACTION="<?echo $url;?>" METHOD="POST">
                                   00049 <TABLE ALIGN="CENTER">
                                  -00050 <TR><TD><input type="password" name="pass_1"></TD></TR>
                                  -00051 <TR><TD><input type="password" name="pass_2"></TD></TR>
                                  -00052 <TR><TD><input type="submit" name="spass" value="Change mot de passe"></TD></TR>
                                  +00050 <TR><TD><input type="password" name="pass_1"></TD></TR>
                                  +00051 <TR><TD><input type="password" name="pass_2"></TD></TR>
                                  +00052 <TR><TD><input type="submit" name="spass" value="Change mot de passe"></TD></TR>
                                   00053 </TABLE>
                                   00054 </FORM>
                                   00055 <?
                                  @@ -123,7 +123,7 @@
                                   00118 <TABLE ALIGN="CENTER">
                                   00119 <TR><TD>PERIODE</TD>
                                   00120 <?    printf('<TD> %s </TD></TR>',$l_form_per); ?>
                                  -00121 <TR><TD><input type="submit" name="sub_periode" value="Sauve"></TD></TR>
                                  +00121 <TR><TD><input type="submit" name="sub_periode" value="Sauve"></TD></TR>
                                   00122 </TABLE>
                                   00123 </FORM>
                                   00124 
                                  @@ -133,7 +133,7 @@
                                   00128 <TR><TD>Taille des pages</TD>
                                   00129 <TD>
                                   00130 <SELECT NAME="p_size">
                                  -00131 <option value="15">15
                                  +00131 <option value="15">15
                                   00132 <option value="25">25
                                   00133 <option value="50">50
                                   00134 <option value="100">100
                                  @@ -146,7 +146,7 @@
                                   00141 ?>
                                   00142 </SELECT>
                                   00143 </TD></TR>
                                  -00144 <TR><TD><input type="submit" name="sub_taille" value="Sauve"></TD></TR>
                                  +00144 <TR><TD><input type="submit" name="sub_taille" value="Sauve"></TD></TR>
                                   00145 </TABLE>
                                   00146 </FORM>
                                   00147 
                                  @@ -156,7 +156,7 @@
                                   00151      
                                   00152 echo "</DIV>";
                                   00153 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/pref_8inc_8php.html b/doc/developper/html/pref_8inc_8php.html index 8bfc6d906..8b072c6f9 100644 --- a/doc/developper/html/pref_8inc_8php.html +++ b/doc/developper/html/pref_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/pref.inc.php File Reference +phpcompta: pref.inc.php File Reference +include

                                  pref.inc.php File Reference

                                  Go to the source code of this file. @@ -210,9 +210,9 @@ Referenced by html_page_

                                  Initial value:

                                  "POST">
                                   <TABLE ALIGN="CENTER">
                                  -<TR><TD><input type="password" name="pass_1"></TD></TR>
                                  -<TR><TD><input type="password" name="pass_2"></TD></TR>
                                  -<TR><TD><input type="submit" name="spass" value="Change mot de passe"></TD></TR>
                                  +<TR><TD><input type="password" name="pass_1"></TD></TR>
                                  +<TR><TD><input type="password" name="pass_2"></TD></TR>
                                  +<TR><TD><input type="submit" name="spass" value="Change mot de passe"></TD></TR>
                                   </TABLE>
                                   </FORM>
                                   <?
                                  @@ -224,7 +224,7 @@ Definition at line 48
                                   Referenced by DefModele(), EncodeModele(), FormAchView(), FormVenteView(), RecordJrn(), ShowDevise(), ShowFormTransfert(), ShowPeriode(), u_ShowMenuRecherche(), VerifImport(), ViewFiche(), and ViewImp().    
                                     
                                   
                                  -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/preference_8php-source.html b/doc/developper/html/preference_8php-source.html index 3342db918..149fef0bd 100644 --- a/doc/developper/html/preference_8php-source.html +++ b/doc/developper/html/preference_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/preference.php Source File +phpcompta: preference.php Source File +include

                                  preference.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 
                                   00003 /*
                                  @@ -211,7 +211,7 @@
                                   00279 }
                                   00280 
                                   00281 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/preference_8php.html b/doc/developper/html/preference_8php.html index 378f186d5..bde43af10 100644 --- a/doc/developper/html/preference_8php.html +++ b/doc/developper/html/preference_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/preference.php File Reference +phpcompta: preference.php File Reference +include

                                  preference.php File Reference

                                  include file for the periode form, currency,... More...

                                  @@ -103,7 +103,52 @@ Generate the form for the periode.

                                  Definition at line 71 of file preference.php.

                                  -References $l_line, $Max, $Res, $ret, $sql, and ExecSql(). +References $l_line, $Max, $Res, $ret, $sql, and ExecSql().

                                  00072 {
                                  +00073   switch ($p_type) {
                                  +00074   case CLOSED:
                                  +00075     $sql_closed="where p_closed=true and p_central = false ";
                                  +00076     break;
                                  +00077   case OPEN:
                                  +00078     $sql_closed="where p_closed=false";
                                  +00079     break;
                                  +00080   case NOTCENTRALIZED:
                                  +00081     $sql_closed="where p_closed=true and p_central = false ";
                                  +00082     break;
                                  +00083   case ALL:
                                  +00084     $sql_closed="";
                                  +00085     break;
                                  +00086   default:
                                  +00087     error("invalide p_type in 'preference.php'#__LINE__");
                                  +00088   }
                                  +00089   $sql="select p_id,to_char(p_start,'DD.MM.YYYY') as p_start_string,
                                  +00090                     to_char(p_end,'DD.MM.YYYY') as p_end_string 
                                  +00091         from parm_periode  
                                  +00092          $sql_closed 
                                  +00093           order by p_start";
                                  +00094           
                                  +00095   $Res=ExecSql($p_cn,$sql);
                                  +00096   $Max=pg_NumRows($Res);
                                  +00097   if ( $Max == 0 ) return null;
                                  +00098   $ret='<SELECT NAME="periode'.$p_suff.'">';
                                  +00099   for ( $i = 0; $i < $Max;$i++) {
                                  +00100     $l_line=pg_fetch_array($Res,$i);
                                  +00101     if ( $l_default == $l_line['p_id'] )
                                  +00102       $sel="SELECTED";
                                  +00103     else
                                  +00104       $sel="";
                                  +00105 
                                  +00106     $ret.=sprintf('<OPTION VALUE="%s" %s>%s - %s',$l_line['p_id']
                                  +00107                   ,$sel
                                  +00108                   ,$l_line['p_start_string']
                                  +00109                   ,$l_line['p_end_string']);
                                  +00110 
                                  +00111   }
                                  +00112   $ret.="</SELECT>";
                                  +00113   return $ret;
                                  +00114 }
                                  +
                                  +

                                  +

                                  @@ -146,7 +191,27 @@ Definition at line 37 References $l_line, $Max, $Res, $ret, $sql, and ExecSql().

                                  -Referenced by ViewImp(). +Referenced by ViewImp().

                                  00038 {
                                  +00039   $sql="select p_id,to_char(p_start,'DD.MM.YYYY') as p_start,
                                  +00040                     to_char(p_end,'DD.MM.YYYY') as p_end 
                                  +00041         from parm_periode  
                                  +00042             order by p_exercice,p_start";
                                  +00043   $Res=ExecSql($p_cn,$sql);
                                  +00044   $Max=pg_NumRows($Res);
                                  +00045   $ret='<SELECT NAME="periode[]" SIZE="12" multiple>';
                                  +00046   for ( $i = 0; $i < $Max;$i++) {
                                  +00047     $l_line=pg_fetch_array($Res,$i);
                                  +00048     $ret.=sprintf('<OPTION VALUE="%s">%s - %s',$l_line['p_id']
                                  +00049                   ,$l_line['p_start']
                                  +00050                   ,$l_line['p_end']);
                                  +00051 
                                  +00052   }
                                  +00053   $ret.="</SELECT>";
                                  +00054   return $ret;
                                  +00055 }
                                  +
                                  +

                                  +

                                  @@ -196,7 +261,16 @@ get the exercice of a periode

                                  Definition at line 168 of file preference.php.

                                  -References $Res, and ExecSql(). +References $Res, and ExecSql().

                                  00169 {
                                  +00170   $Res=ExecSql($p_cn,"select p_exercice from parm_periode".
                                  +00171                " where p_id=$p_periode");
                                  +00172   if ( pg_NumRows($Res) == 0 ) return "";
                                  +00173   $line=pg_fetch_array($Res,0);
                                  +00174   return $line['p_exercice'];
                                  +00175 }
                                  +
                                  +

                                  +

                                  @@ -249,7 +323,19 @@ Definition at line 125 References $Res, $sql, and ExecSql().

                                  -Referenced by FormAchInput(), FormFin(), FormODS(), FormVenInput(), RecordJrn(), VerifData(), and VerifyOperationDate(). +Referenced by FormAchInput(), FormFin(), FormODS(), FormVenInput(), RecordJrn(), VerifData(), and VerifyOperationDate().

                                  00126 {
                                  +00127  $sql="select to_char(p_start,'DD.MM.YYYY') as p_start,
                                  +00128               to_char(p_end,'DD.MM.YYYY')   as p_end
                                  +00129        from parm_periode
                                  +00130          where p_id=".$p_periode;
                                  +00131  $Res=ExecSql($p_cn,$sql);
                                  +00132  if ( pg_NumRows($Res) == 0) return null;
                                  +00133  return pg_fetch_array($Res,0);
                                  +00134 
                                  +00135 }
                                  +
                                  +

                                  +

                                  @@ -301,7 +387,19 @@ Definition at line 146 References $l_line, $Res, $sql, and ExecSql().

                                  -Referenced by VerifData(), and VerifyOperationDate(). +Referenced by VerifData(), and VerifyOperationDate().

                                  00147 {
                                  +00148  $sql="select p_closed
                                  +00149        from parm_periode
                                  +00150          where p_id=".$p_periode;
                                  +00151  $Res=ExecSql($p_cn,$sql);
                                  +00152  if ( pg_NumRows($Res) == 0) return null;
                                  +00153  $l_line=pg_fetch_array($Res,0);
                                  +00154  return $l_line['p_closed'];
                                  +00155 
                                  +00156 }
                                  +
                                  +

                                  +

                                  @@ -341,7 +439,38 @@ Show all the currency encoded.

                                  Definition at line 185 of file preference.php.

                                  -References $l_line, $Max, $Res, ExecSql(), and METHOD. +References $l_line, $Max, $Res, ExecSql(), and METHOD.

                                  00186 {
                                  +00187  echo "<h2 class=\"info\"> Devises </H2>";
                                  +00188   echo '<TABLE ALIGN="CENTER">';
                                  +00189   echo "<TR>";
                                  +00190   echo '<TH> CODE </TH>';
                                  +00191   echo '<TH> Valeur <BR>(par rapport à l\'euro) </TH>';
                                  +00192   echo "</TR>";
                                  +00193 
                                  +00194   $Res=ExecSql($p_cn,"select pm_id,pm_code,pm_rate  from parm_money order by pm_code");
                                  +00195   $Max=pg_NumRows($Res);
                                  +00196   
                                  +00197   for ($i=0;$i<$Max;$i++) {
                                  +00198     $l_line=pg_fetch_array($Res,$i);
                                  +00199     echo '<TR>'; 
                                  +00200     echo '<TD>'.$l_line['pm_code'].'</TD>';
                                  +00201     $l_rate=sprintf("% 10.6f",$l_line['pm_rate']);
                                  +00202     echo '<TD ALIGN="RIGHT">'.$l_rate.'</TD>';
                                  +00203     echo "<TD class=\"mtitle\"> <A class=\"mtitle\" HREF=\"parametre.php?p_mid=$l_line[pm_id]&p_action=change&p_code=$l_line[pm_code]&p_rate=$l_line[pm_rate]\">Change</A></TD>";
                                  +00204     echo "<TD class=\"mtitle\"> <A class=\"mtitle\" HREF=\"parametre.php?p_mid=$l_line[pm_id]&p_action=delete&p_code=$l_line[pm_code]\">Efface</A></TD>";
                                  +00205     echo '</TR>';
                                  +00206     
                                  +00207   }
                                  +00208   echo '<TR> <FORM ACTION="parametre.php" METHOD="POST">';
                                  +00209 echo '<TD> <INPUT TYPE="text" NAME="p_devise"></TD>';
                                  +00210  echo '<TD> <INPUT TYPE="text" NAME="p_rate"></TD>';
                                  +00211  echo '<TD> <INPUT TYPE="SUBMIT" NAME="action" Value="Ajout"</TD>';
                                  +00212  echo '</FORM></TR>';
                                  +00213  echo '</TABLE>';
                                  +00214 }
                                  +
                                  +

                                  +

                                  @@ -381,10 +510,67 @@ Show all the periode and their status.

                                  Definition at line 224 of file preference.php.

                                  -References $l_line, $Max, $Res, echo_debug(), ExecSql(), and METHOD. +References $l_line, $Max, $Res, echo_debug(), ExecSql(), and METHOD.

                                  00225 {
                                  +00226   //  echo "<h2 class=\"info\"> Période </H2>";
                                  +00227   $Res=ExecSql($p_cn,"select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,p_central,p_closed,p_exercice
                                  +00228   from parm_periode order by p_start");
                                  +00229   $Max=pg_NumRows($Res);
                                  +00230   echo '<TABLE ALIGN="CENTER">';
                                  +00231   echo "</TR>";
                                  +00232   echo '<TH> Date début </TH>';
                                  +00233   echo '<TH> Date fin </TH>';
                                  +00234   echo '<TH> Exercice </TH>';
                                  +00235   echo "</TR>";
                                  +00236   
                                  +00237   for ($i=0;$i<$Max;$i++) {
                                  +00238     $l_line=pg_fetch_array($Res,$i);
                                  +00239     echo '<TR>'; 
                                  +00240     echo '<TD ALIGN="CENTER"> '.$l_line['date_start'].'</TD>';
                                  +00241     echo '<TD  ALIGN="CENTER"> '.$l_line['date_end'].'</TD>';
                                  +00242     echo '<TD  ALIGN="CENTER"> '.$l_line['p_exercice'].'</TD>';
                                  +00243     echo_debug('preference.php',__LINE__," closed : $l_line[p_closed]");
                                  +00244     if ( $l_line['p_closed'] == 't' )     { 
                                  +00245       $closed=($l_line['p_central']=='t')?'<TD>Centralisée</TD>':'<TD>Fermée</TD>';
                                  +00246       $change='<TD></TD>';
                                  +00247       $remove='<TD></TD>';
                                  +00248     } else {
                                  +00249       $closed='<TD class="mtitle">'; 
                                  +00250       $closed.='<A class="mtitle" HREF="user_advanced.php?p_action=periode&action=closed&p_per='.$l_line['p_id'].'"> Cloturer</A>';
                                  +00251     $change='<TD class="mtitle">';
                                  +00252     $change.='<A class="mtitle" HREF="user_advanced.php?p_action=periode&action=change_per&p_per='.
                                  +00253       $l_line['p_id']."&p_date_start=".$l_line['date_start'].
                                  +00254       "&p_date_end=".$l_line['date_end']."&p_exercice=".
                                  +00255       $l_line['p_exercice']."\"> Changer</A>";
                                  +00256     $remove='<TD class="mtitle">';
                                  +00257     $remove.='<A class="mtitle" HREF="user_advanced.php?p_action=periode&action=delete_per&p_per='.
                                  +00258       $l_line['p_id']."\"> Efface</A>";
                                  +00259 
                                  +00260     }
                                  +00261     echo "$closed";
                                  +00262     echo $change;
                                  +00263 
                                  +00264     echo $remove;
                                  +00265 
                                  +00266     echo '</TR>';
                                  +00267     
                                  +00268   }
                                  +00269   echo '<TR> <FORM ACTION="user_advanced.php?p_action=periode" METHOD="POST">';
                                  +00270   echo '<TD> <INPUT TYPE="text" NAME="p_date_start" SIZE="10"></TD>';
                                  +00271   echo '<TD> <INPUT TYPE="text" NAME="p_date_end" SIZE="10"></TD>';
                                  +00272   echo '<TD> <INPUT TYPE="text" NAME="p_exercice" SIZE="10"></TD>';
                                  +00273   echo '<TD> <INPUT TYPE="SUBMIT" NAME="add_per" Value="Ajout"</TD>';
                                  +00274   echo '<TD></TD>';
                                  +00275   echo '<TD></TD>';
                                  +00276   echo '</FORM></TR>';
                                  +00277 
                                  +00278   echo '</TABLE>';
                                  +00279 }
                                  +
                                  +

                                  + -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/print__balance_8php-source.html b/doc/developper/html/print__balance_8php-source.html index 6ae0ac5c8..78b1c5802 100644 --- a/doc/developper/html/print__balance_8php-source.html +++ b/doc/developper/html/print__balance_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/print_balance.php Source File +phpcompta: print_balance.php Source File +html

                                  print_balance.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 
                                   00003 /*
                                  @@ -87,7 +87,7 @@
                                   00090 
                                   00091 
                                   00092 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/print__balance_8php.html b/doc/developper/html/print__balance_8php.html index 8fb2e8c39..466d5dcab 100644 --- a/doc/developper/html/print__balance_8php.html +++ b/doc/developper/html/print__balance_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/print_balance.php File Reference +phpcompta: print_balance.php File Reference +html

                                  print_balance.php File Reference

                                  Print the balance in pdf format. More...

                                  @@ -304,7 +304,7 @@ Definition at line 4 Definition at line 52 of file print_balance.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/priv__user_8php-source.html b/doc/developper/html/priv__user_8php-source.html index d358584ef..b48ae1254 100644 --- a/doc/developper/html/priv__user_8php-source.html +++ b/doc/developper/html/priv__user_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/priv_user.php Source File +phpcompta: priv_user.php Source File +html

                                  priv_user.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -94,13 +94,13 @@
                                   00088          use_id=".$uid;
                                   00089   $Res=ExecSql($cn,$Sql);
                                   00090   // Update Priv on Folder
                                  -00091   foreach ($HTTP_POST_VARS as $name=>$elem)
                                  +00091   foreach ($HTTP_POST_VARS as $name=>$elem)
                                   00092     { 
                                   00093       echo_debug('priv_user.php',__LINE__,"HTTP_POST_VARS $name $elem");
                                  -00094       if ( substr_count($name,'PRIV')!=0 )
                                  +00094       if ( substr_count($name,'PRIV')!=0 )
                                   00095       {
                                   00096         echo_debug('priv_user.php',__LINE__,"Found a priv");
                                  -00097         $db_id=substr($name,4);
                                  +00097         $db_id=substr($name,4);
                                   00098         $cn=DbConnect();
                                   00099         if ( ExisteJnt($db_id,$uid) != 1 ) 
                                   00100           {
                                  @@ -248,7 +248,7 @@
                                   00242 ?>
                                   00243 
                                   00244 
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/priv__user_8php.html b/doc/developper/html/priv__user_8php.html index b8fbbc6ab..e1fa2aa19 100644 --- a/doc/developper/html/priv__user_8php.html +++ b/doc/developper/html/priv__user_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/priv_user.php File Reference +phpcompta: priv_user.php File Reference +html

                                  priv_user.php File Reference

                                  Users Security. More...

                                  @@ -404,7 +404,7 @@ Definition at line 3338 of file priv_user.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/readme_8php-source.html b/doc/developper/html/readme_8php-source.html index 6c3d20816..da204ec49 100644 --- a/doc/developper/html/readme_8php-source.html +++ b/doc/developper/html/readme_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/readme.php Source File +phpcompta: readme.php Source File +html » addon

                                  readme.php

                                  Go to the documentation of this file.
                                  00001 <?php
                                   00002 //===================================================================================================
                                   00003 // this is the php file which creates the readme.pdf file, this is not seriously 
                                  @@ -303,7 +303,7 @@
                                   00294   $pdf->ezStream();
                                   00295 }
                                   00296 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/readme_8php.html b/doc/developper/html/readme_8php.html index 915622047..77dd1cdaf 100644 --- a/doc/developper/html/readme_8php.html +++ b/doc/developper/html/readme_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/addon/readme.php File Reference +phpcompta: readme.php File Reference +html » addon

                                  readme.php File Reference

                                  Go to the source code of this file. @@ -132,7 +132,29 @@

                                  Definition at line 112 of file readme.php.

                                  -References $h, $height, and $pdf. +References $h, $height, and $pdf.

                                  00112                                                   {
                                  +00113   $pdf->saveState();
                                  +00114   $h=100;
                                  +00115   $factor = $height/$h;
                                  +00116   $pdf->selectFont('./fonts/Helvetica-Bold.afm');
                                  +00117   $text = 'R&OS';
                                  +00118   $ts=100*$factor;
                                  +00119   $th = $pdf->getFontHeight($ts);
                                  +00120   $td = $pdf->getFontDecender($ts);
                                  +00121   $tw = $pdf->getTextWidth($ts,$text);
                                  +00122   $pdf->setColor(0.6,0,0);
                                  +00123   $z = 0.86;
                                  +00124   $pdf->filledRectangle($x-$wl,$y-$z*$h*$factor,$tw*1.2+$wr+$wl,$h*$factor*$z);
                                  +00125   $pdf->setColor(1,1,1);
                                  +00126   $pdf->addText($x,$y-$th-$td,$ts,$text);
                                  +00127   $pdf->setColor(0.6,0,0);
                                  +00128   $pdf->addText($x,$y-$th-$td,$ts*0.1,'http://www.ros.co.nz');
                                  +00129   $pdf->restoreState();
                                  +00130   return $height;
                                  +00131 }
                                  +
                                  +

                                  +


                                  Variable Documentation

                                  @@ -777,7 +799,7 @@ Definition at line 200 o Referenced by Document::Replace(). -
                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/recherche_8php-source.html b/doc/developper/html/recherche_8php-source.html index 33ed9d416..87c469066 100644 --- a/doc/developper/html/recherche_8php-source.html +++ b/doc/developper/html/recherche_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/recherche.php Source File +phpcompta: recherche.php Source File +html

                                  recherche.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -82,7 +82,7 @@
                                   00077 echo '</DIV>'; 
                                   00078  
                                   00079 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/recherche_8php.html b/doc/developper/html/recherche_8php.html index 7844f6818..abeb7bfbf 100644 --- a/doc/developper/html/recherche_8php.html +++ b/doc/developper/html/recherche_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/recherche.php File Reference +phpcompta: recherche.php File Reference +html

                                  recherche.php File Reference

                                  Search module. More...

                                  @@ -185,7 +185,7 @@ Definition at line 48 Definition at line 42 of file recherche.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/sec__pdf_8php-source.html b/doc/developper/html/sec__pdf_8php-source.html index 7ca7faf64..1d4fd128b 100644 --- a/doc/developper/html/sec__pdf_8php-source.html +++ b/doc/developper/html/sec__pdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/sec_pdf.php Source File +phpcompta: sec_pdf.php Source File +html

                                  sec_pdf.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 
                                   00003 /*
                                  @@ -136,7 +136,7 @@
                                   00131 $pdf->ezStream();
                                   00132 
                                   00133 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/sec__pdf_8php.html b/doc/developper/html/sec__pdf_8php.html index d7071e8c5..f19e1211d 100644 --- a/doc/developper/html/sec__pdf_8php.html +++ b/doc/developper/html/sec__pdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/sec_pdf.php File Reference +phpcompta: sec_pdf.php File Reference +html

                                  sec_pdf.php File Reference

                                  Print the user security in pdf. More...

                                  @@ -296,7 +296,7 @@ Definition at line 43 Definition at line 49 of file sec_pdf.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/send__jrn__pdf_8php-source.html b/doc/developper/html/send__jrn__pdf_8php-source.html index 9d1d6579b..9af1d00b6 100644 --- a/doc/developper/html/send__jrn__pdf_8php-source.html +++ b/doc/developper/html/send__jrn__pdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/send_jrn_pdf.php Source File +phpcompta: send_jrn_pdf.php Source File +html

                                  send_jrn_pdf.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 
                                   00003 /*
                                  @@ -155,7 +155,7 @@
                                   00150 $pdf->ezStream();
                                   00151 
                                   00152 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/send__jrn__pdf_8php.html b/doc/developper/html/send__jrn__pdf_8php.html index 7f0c90844..a8e5bbf9a 100644 --- a/doc/developper/html/send__jrn__pdf_8php.html +++ b/doc/developper/html/send__jrn__pdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/send_jrn_pdf.php File Reference +phpcompta: send_jrn_pdf.php File Reference +html

                                  send_jrn_pdf.php File Reference

                                  Print the ledger in pdf. More...

                                  @@ -507,7 +507,7 @@ Definition at line 8 Definition at line 122 of file send_jrn_pdf.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/send__poste__pdf_8php-source.html b/doc/developper/html/send__poste__pdf_8php-source.html index 72105de1e..7ae041f67 100644 --- a/doc/developper/html/send__poste__pdf_8php-source.html +++ b/doc/developper/html/send__poste__pdf_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/send_poste_pdf.php Source File +phpcompta: send_poste_pdf.php Source File +html

                                  send_poste_pdf.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 
                                   00003 /*
                                  @@ -100,7 +100,7 @@
                                   00095 $pdf->ezStream();
                                   00096 
                                   00097 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/send__poste__pdf_8php.html b/doc/developper/html/send__poste__pdf_8php.html index 35f26af8e..ffc60b7a7 100644 --- a/doc/developper/html/send__poste__pdf_8php.html +++ b/doc/developper/html/send__poste__pdf_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/send_poste_pdf.php File Reference +phpcompta: send_poste_pdf.php File Reference +html

                                  send_poste_pdf.php File Reference

                                  Print the account in pdf. More...

                                  @@ -270,7 +270,7 @@ Definition at line 75 of file send_poste_pdf.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/setup_8php-source.html b/doc/developper/html/setup_8php-source.html index 0a926e666..fda37a475 100644 --- a/doc/developper/html/setup_8php-source.html +++ b/doc/developper/html/setup_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/admin/setup.php Source File +phpcompta: setup.php Source File +html » admin

                                  setup.php

                                  Go to the documentation of this file.
                                  00001 
                                   00002 <style type="text/css">
                                   00003 <!--
                                  @@ -269,7 +269,7 @@
                                   00260 $flag=0;
                                   00261 for ($e=0;$e<pg_NumRows($Res);$e++) {
                                   00262   $a=pg_fetch_array($Res,$e);
                                  -00263   switch ($a['name']){
                                  +00263   switch ($a['name']){
                                   00264   case 'effective_cache_size':
                                   00265     if ( $a['setting'] < 1000 ){
                                   00266       print '<p class="warning">Attention le paramètre effective_cache_size est de '.
                                  @@ -302,7 +302,7 @@
                                   00293 if ( ! isset($_POST['go']) ) {
                                   00294 ?>
                                   00295 <FORM action="setup.php" METHOD="post">
                                  -00296 <input type="submit" name="go" value="Prêt à commencer la mise à jour ou l'installation?">
                                  +00296 <input type="submit" name="go" value="Prêt à commencer la mise à jour ou l'installation?">
                                   00297 </form>
                                   00298 <?
                                   00299 }
                                  @@ -540,7 +540,7 @@
                                   00531 
                                   00532 if (DEBUG=='false') ob_end_clean();
                                   00533 echo "<h2 class=\"info\">Voilà tout est installé ;-)</h2>";
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/setup_8php.html b/doc/developper/html/setup_8php.html index 08c135507..81bca9412 100644 --- a/doc/developper/html/setup_8php.html +++ b/doc/developper/html/setup_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/admin/setup.php File Reference +phpcompta: setup.php File Reference +html » admin

                                  setup.php File Reference

                                  Go to the source code of this file. @@ -87,7 +87,71 @@

                                  Definition at line 97 of file setup.php.

                                  -References $sql, ExecSql(), exit, print, and Rollback(). +References $sql, ExecSql(), exit, print, and Rollback().

                                  00097                                       {
                                  +00098   $hf=fopen($script,'r');
                                  +00099   if ( $hf == false ) {
                                  +00100           echo 'Ne peut ouvrir '.$script;
                                  +00101           exit();
                                  +00102           }
                                  +00103   $sql="";
                                  +00104   $flag_function=false;
                                  +00105   while (!feof($hf)) {
                                  +00106     $buffer=fgets($hf);
                                  +00107     $buffer=str_replace ("$","\$",$buffer);
                                  +00108     print $buffer."<br>";
                                  +00109     // comment are not execute
                                  +00110     if ( substr($buffer,0,2) == "--" ) {
                                  +00111       //echo "comment $buffer";
                                  +00112       continue;
                                  +00113     }
                                  +00114     // Blank Lines Are Skipped
                                  +00115     If ( Strlen($buffer)==0) {
                                  +00116             //echo "Blank $buffer";
                                  +00117       Continue;
                                  +00118     }
                                  +00119     if ( strpos(strtolower($buffer),"create function")===0 ) {
                                  +00120             echo "found a function";
                                  +00121             $flag_function=true;
                                  +00122             $sql=$buffer;
                                  +00123             continue;
                                  +00124     }
                                  +00125  if ( strpos(strtolower($buffer),"create or replace function")===0 ) {
                                  +00126             echo "found a function";
                                  +00127             $flag_function=true;
                                  +00128             $sql=$buffer;
                                  +00129             continue;
                                  +00130     }
                                  +00131     // No semi colon -> multiline command
                                  +00132     if ( $flag_function== false && strpos($buffer,';') == false ) {
                                  +00133       $sql.=$buffer;
                                  +00134       continue;
                                  +00135     } 
                                  +00136     if ( $flag_function ) {
                                  +00137       if ( strpos(strtolower($buffer), "language plpgsql") === false && 
                                  +00138            strpos(strtolower($buffer), "language 'plpgsql'") === false ) {
                                  +00139                 $sql.=$buffer;
                                  +00140                 continue;
                                  +00141             }
                                  +00142     } else  {
                                  +00143             // cut the semi colon
                                  +00144             $buffer=str_replace (';','',$buffer);
                                  +00145             }
                                  +00146     $sql.=$buffer;
                                  +00147     if ( ExecSql($p_cn,$sql) == false ) {
                                  +00148             Rollback($p_cn);
                                  +00149             if ( DEBUG=='false' ) ob_end_flush();
                                  +00150             print "ERROR : $sql";
                                  +00151             exit();
                                  +00152             }
                                  +00153     $sql="";
                                  +00154     $flag_function=false;
                                  +00155     print "<hr>";
                                  +00156   } // while (feof)
                                  +00157   fclose($hf);
                                  +00158 }
                                  +
                                  +

                                  +

                                  @@ -119,7 +183,14 @@ References $sql, Definition at line 80 of file setup.php.

                                  -References $a, $Res, and ExecSql(). +References $a, $Res, and ExecSql().

                                  00080                            {
                                  +00081         $Res=ExecSql($p_cn,"select val from version");
                                  +00082         $a=pg_fetch_array($Res,0);
                                  +00083         return $a['val'];
                                  +00084 }
                                  +
                                  +

                                  +


                                  Variable Documentation

                                  @@ -508,7 +579,7 @@ Definition at line 243 of Definition at line 360 of file setup.php. -
                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__document_8php-source.html b/doc/developper/html/show__document_8php-source.html index d75448ff8..a452acf92 100644 --- a/doc/developper/html/show__document_8php-source.html +++ b/doc/developper/html/show__document_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_document.php Source File +phpcompta: show_document.php Source File +html

                                  show_document.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -39,9 +39,9 @@
                                   00034 $User=new cl_user(DbConnect());
                                   00037 $User->Check();
                                   00038 // retrieve the document
                                  -00039 $doc=new Document($cn,$_REQUEST['d_id']);
                                  +00039 $doc=new Document($cn,$_REQUEST['d_id']);
                                   00040 $doc->Send();
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__document_8php.html b/doc/developper/html/show__document_8php.html index 6b006ced1..e0761f534 100644 --- a/doc/developper/html/show__document_8php.html +++ b/doc/developper/html/show__document_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_document.php File Reference +phpcompta: show_document.php File Reference +html

                                  show_document.php File Reference

                                  retrieve a document More...

                                  @@ -18,7 +18,7 @@  $User = new cl_user(DbConnect()) - $doc = new Document($cn,$_REQUEST['d_id']) + $doc = new Document($cn,$_REQUEST['d_id'])


                                  Detailed Description

                                  @@ -58,7 +58,7 @@ Definition at line 3 - +
                                  $doc = new Document($cn,$_REQUEST['d_id']) $doc = new Document($cn,$_REQUEST['d_id'])
                                  @@ -102,7 +102,7 @@ Definition at line
                                  3 Definition at line 34 of file show_document.php. -
                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__document__modele_8php-source.html b/doc/developper/html/show__document__modele_8php-source.html index bbe4ce992..b322051b8 100644 --- a/doc/developper/html/show__document__modele_8php-source.html +++ b/doc/developper/html/show__document__modele_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_document_modele.php Source File +phpcompta: show_document_modele.php Source File +html

                                  show_document_modele.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -40,7 +40,7 @@
                                   00037 $User->Check();
                                   00038 // retrieve the document
                                   00039 $r=ExecSql($cn,"select md_id,md_lob,md_filename,md_mimetype 
                                  -00040                  from document_modele where md_id=".$_REQUEST['md_id']);
                                  +00040                  from document_modele where md_id=".$_REQUEST['md_id']);
                                   00041 if ( pg_num_rows($r) == 0 ) {
                                   00042   echo_error("Invalid Document");
                                   00043   exit;
                                  @@ -69,7 +69,7 @@
                                   00066 unlink ($tmp);
                                   00067 
                                   00068 Commit($cn);
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__document__modele_8php.html b/doc/developper/html/show__document__modele_8php.html index 4363066b0..145642e4b 100644 --- a/doc/developper/html/show__document__modele_8php.html +++ b/doc/developper/html/show__document__modele_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_document_modele.php File Reference +phpcompta: show_document_modele.php File Reference +html

                                  show_document_modele.php File Reference

                                  send the document template More...

                                  @@ -108,7 +108,7 @@ Referenced by FormA

                                  Initial value:

                                  ExecSql($cn,"select md_id,md_lob,md_filename,md_mimetype 
                                  -                 from document_modele where md_id=".$_REQUEST['md_id'])
                                  +                 from document_modele where md_id=".$_REQUEST['md_id'])
                                   

                                  Definition at line 39 of file show_document_modele.php. @@ -216,7 +216,7 @@ Definition at line 43 of file show_document_modele.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__fiche_8php-source.html b/doc/developper/html/show__fiche_8php-source.html index be1482f47..4f3f0c2a5 100644 --- a/doc/developper/html/show__fiche_8php-source.html +++ b/doc/developper/html/show__fiche_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_fiche.php Source File +phpcompta: show_fiche.php Source File +html

                                  show_fiche.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -59,7 +59,7 @@
                                   00058 $f->GetByQCode($_REQUEST['q'],false);
                                   00059 echo $f->Display(true);
                                   00060 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__fiche_8php.html b/doc/developper/html/show__fiche_8php.html index 846754b38..7be11e4aa 100644 --- a/doc/developper/html/show__fiche_8php.html +++ b/doc/developper/html/show__fiche_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_fiche.php File Reference +phpcompta: show_fiche.php File Reference +html

                                  show_fiche.php File Reference

                                  This file show in a popup window the detail a of card in read only mode the parameter are q (for qcode) & PHPSESSID. More...

                                  @@ -75,7 +75,7 @@ Definition at line 4838 of file show_fiche.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__pj_8php-source.html b/doc/developper/html/show__pj_8php-source.html index 73e7b5364..c4fcccf89 100644 --- a/doc/developper/html/show__pj_8php-source.html +++ b/doc/developper/html/show__pj_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_pj.php Source File +phpcompta: show_pj.php Source File +html

                                  show_pj.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -84,7 +84,7 @@
                                   00075 unlink ($tmp);
                                   00076 
                                   00077 Commit($cn);
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__pj_8php.html b/doc/developper/html/show__pj_8php.html index 393f4de4c..f8b49f45e 100644 --- a/doc/developper/html/show__pj_8php.html +++ b/doc/developper/html/show__pj_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_pj.php File Reference +phpcompta: show_pj.php File Reference +html

                                  show_pj.php File Reference

                                  Go to the source code of this file. @@ -313,7 +313,7 @@ Definition at line 37 Definition at line 43 of file show_pj.php.
                                  -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__tva_8php-source.html b/doc/developper/html/show__tva_8php-source.html index d10fa9069..864372fc7 100644 --- a/doc/developper/html/show__tva_8php-source.html +++ b/doc/developper/html/show__tva_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_tva.php Source File +phpcompta: show_tva.php Source File +html

                                  show_tva.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -72,7 +72,7 @@
                                   00067 <?
                                   00068 html_page_stop();
                                   00069 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/show__tva_8php.html b/doc/developper/html/show__tva_8php.html index 68a60b4f3..68c79b64f 100644 --- a/doc/developper/html/show__tva_8php.html +++ b/doc/developper/html/show__tva_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/show_tva.php File Reference +phpcompta: show_tva.php File Reference +html

                                  show_tva.php File Reference

                                  Popup window to let the user choose the vat. More...

                                  @@ -239,7 +239,7 @@ Definition at line 30 Definition at line 38 of file show_tva.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/stock_8php-source.html b/doc/developper/html/stock_8php-source.html index 419d9bad5..ebbb6f610 100644 --- a/doc/developper/html/stock_8php-source.html +++ b/doc/developper/html/stock_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/stock.php Source File +phpcompta: stock.php Source File +html

                                  stock.php

                                  Go to the documentation of this file.
                                  00001 
                                   00002 <?
                                   00003 /*
                                  @@ -147,7 +147,7 @@
                                   00142     echo 'Entrer la valeur qui doit augmenter ou diminuer le stock';
                                   00143     echo '<form action="stock.php" method="POST">';
                                   00144     echo $b;
                                  -00145     echo '<input type="submit" name="sub_change" value="Ok">';
                                  +00145     echo '<input type="submit" name="sub_change" value="Ok">';
                                   00146     echo '</form>';
                                   00147     echo '</div>';
                                   00148     exit();
                                  @@ -180,7 +180,7 @@
                                   00175 echo '</div>';
                                   00176 html_page_stop();
                                   00177 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/stock_8php.html b/doc/developper/html/stock_8php.html index b5958caea..94bfa8682 100644 --- a/doc/developper/html/stock_8php.html +++ b/doc/developper/html/stock_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/stock.php File Reference +phpcompta: stock.php File Reference +html

                                  stock.php File Reference

                                  Manage the stock by year. More...

                                  @@ -212,7 +212,7 @@ Definition at line 153 of Definition at line 43 of file stock.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/stock__inc_8php-source.html b/doc/developper/html/stock__inc_8php-source.html index 9cac1e4b2..c442e6453 100644 --- a/doc/developper/html/stock__inc_8php-source.html +++ b/doc/developper/html/stock__inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/stock_inc.php Source File +phpcompta: stock_inc.php Source File +include

                                  stock_inc.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -224,10 +224,10 @@
                                   00259 function ChangeStock($p_sg_code,$p_year){
                                   00260 $sg_date=date("d.m.Y");
                                   00261 $r='
                                  -00262 <input type="text" name="stock_change" value="0">
                                  -00263 <input type="hidden" name="sg_code" value="'.$p_sg_code.'">
                                  -00264 <input type="text" name="sg_date" value="'.$sg_date.'">
                                  -00265 <input type="hidden" name="year" value="'.$p_year.'">
                                  +00262 <input type="text" name="stock_change" value="0">
                                  +00263 <input type="hidden" name="sg_code" value="'.$p_sg_code.'">
                                  +00264 <input type="text" name="sg_date" value="'.$sg_date.'">
                                  +00265 <input type="hidden" name="year" value="'.$p_year.'">
                                   00266 <br>
                                   00267  ';
                                   00268  return $r;
                                  @@ -248,7 +248,7 @@
                                   00288   return $value['result'];
                                   00289     
                                   00290 }
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/stock__inc_8php.html b/doc/developper/html/stock__inc_8php.html index 2362bfabb..4656efb50 100644 --- a/doc/developper/html/stock__inc_8php.html +++ b/doc/developper/html/stock__inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/stock_inc.php File Reference +phpcompta: stock_inc.php File Reference +include

                                  stock_inc.php File Reference

                                  Function for managing the stock. More...

                                  @@ -80,7 +80,21 @@ parm :

                                    Definition at line 259 of file stock_inc.php.

                                    -References $r, name, and value. +References $r, name, and value.

                                    00259                                         {
                                    +00260 $sg_date=date("d.m.Y");
                                    +00261 $r='
                                    +00262 <input type="text" name="stock_change" value="0">
                                    +00263 <input type="hidden" name="sg_code" value="'.$p_sg_code.'">
                                    +00264 <input type="text" name="sg_date" value="'.$sg_date.'">
                                    +00265 <input type="hidden" name="year" value="'.$p_year.'">
                                    +00266 <br>
                                    +00267  ';
                                    +00268  return $r;
                                    +00269 
                                    +00270 }
                                    +
                                    +

                                    +

                                    @@ -134,7 +148,35 @@ Definition at line 111 References $a, $i, $r, $Res, $result, $sql, ExecSql(), and f_id.

                                    -Referenced by ViewDetailStock(), and ViewStock(). +Referenced by ViewDetailStock(), and ViewStock().

                                    00111                                              {
                                    +00112   // Sql stmt
                                    +00113 $sql="select distinct f_id,av_text
                                    +00114          from stock_goods
                                    +00115          join jnt_fic_att_value using (f_id )
                                    +00116          join attr_value using (jft_id)
                                    +00117          where 
                                    +00118           ad_id=".ATTR_DEF_NAME." 
                                    +00119           and sg_code='$p_sg_code'
                                    +00120            ";
                                    +00121 // Execute
                                    +00122  $Res=ExecSql($p_cn,$sql);
                                    +00123  if ( ( $M=pg_NumRows($Res)) == 0 ) return null;
                                    +00124  
                                    +00125  // Store in an array
                                    +00126  for ( $i=0; $i<$M;$i++) {
                                    +00127    $r=pg_fetch_array($Res,$i);
                                    +00128    $a['f_id']=$r['f_id'];
                                    +00129    $a['av_text']=$r['av_text'];
                                    +00130    $result[$i]=$a;
                                    +00131 
                                    +00132  }
                                    +00133 
                                    +00134  return $result;
                                    +00135   
                                    +00136 }
                                    +
                                    +

                                    +

                                    @@ -192,7 +234,24 @@ Definition at line 276 References $Res, $sql, and ExecSql().

                                    -Referenced by ViewStock(). +Referenced by ViewStock().

                                    00276                                                        {
                                    +00277   $sql="select sum(sg_quantity) as result
                                    +00278         from stock_goods
                                    +00279       join jrnx on (stock_goods.j_id=jrnx.j_id)
                                    +00280       join parm_periode on (parm_periode.p_id=jrnx.j_tech_per)
                                    +00281         where
                                    +00282         sg_code='$p_sg_code' and 
                                    +00283          p_exercice = '$p_year' and 
                                    +00284          sg_type='$p_type'";
                                    +00285   $Res=ExecSql($p_cn,$sql);
                                    +00286   if ( pg_NumRows($Res)== 0) return null;
                                    +00287   $value=pg_fetch_array($Res,0);
                                    +00288   return $value['result'];
                                    +00289     
                                    +00290 }
                                    +
                                    +

                                    +

                                    @@ -249,7 +308,111 @@ View the details of a stock.

                                    Definition at line 147 of file stock_inc.php.

                                    -References $l, $r, $Res, $sql, ExecSql(), and getFicheNameCode(). +References $l, $r, $Res, $sql, ExecSql(), and getFicheNameCode().

                                    00147                                                    {
                                    +00148 $sql="select sg_code,
                                    +00149              j_montant,
                                    +00150              j_date,
                                    +00151              sg_quantity,
                                    +00152              sg_type,
                                    +00153              jr_comment,
                                    +00154              jr_internal,
                                    +00155              jr_id,
                                    +00156         case when sg_date is not null then sg_date else j_date end as stock_date
                                    +00157       from stock_goods
                                    +00158       left outer join jrnx using (j_id)
                                    +00159       left outer join jrn on jr_grpt_id=j_grpt
                                    +00160            where 
                                    +00161       sg_code='$p_sg_code' and (
                                    +00162           to_char(sg_date,'YYYY') = '$p_year'
                                    +00163        or to_char(j_date,'YYYY') = '$p_year'
                                    +00164        )
                                    +00165       order by stock_date
                                    +00166  " ;
                                    +00167 // $r.=sprintf('<input TYPE="button" onClick="modifyOperation(\'%s\',\'%s\')" value="%s">',
                                    +00168 //                  $row['jr_id'],$l_sessid,$row['jr_internal']);
                                    +00169     // name
                                    +00170 
                                    +00171 
                                    +00172   $r="";
                                    +00173   $a_name=getFicheNameCode($p_cn,$p_sg_code);
                                    +00174   $name="";
                                    +00175   if ( $a_name != null ) {
                                    +00176     foreach ($a_name as $key=>$element) {
                                    +00177       $name.=$element['av_text'].",";
                                    +00178     }
                                    +00179   }// if ( $a_name
                                    +00180   // Add java script for detail
                                    +00181   $r.=JS_VIEW_JRN_DETAIL;
                                    +00182 
                                    +00183  $r.='<H2 class="info">'.$p_sg_code."  Noms : ".$name.'</H2>';
                                    +00184   
                                    +00185   $Res=ExecSql($p_cn,$sql);
                                    +00186   if ( ($M=pg_NumRows($Res)) == 0 ) return "no rows";
                                    +00187   $r.="<table>";
                                    +00188   $r.="<TR>";
                                    +00189   $r.="<th>Date </th>";
                                    +00190   $r.="<th>Entrée / Sortie </th>";
                                    +00191   $r.="<th></th>";
                                    +00192   $r.="<th>Description</th>";
                                    +00193   $r.="<th>Montant</th>";
                                    +00194   $r.="<th>Quantité</th>";
                                    +00195   $r.="<th>Prix/Cout Unitaire</th>";
                                    +00196   $r.="</TR>";
                                    +00197   // compute sessid
                                    +00198   $l_sessid=$_REQUEST['PHPSESSID'];
                                    +00199 
                                    +00200   for ( $i=0; $i < $M;$i++) {
                                    +00201     $l=pg_fetch_array($Res,$i);
                                    +00202     $r.="<tR>";
                                    +00203 
                                    +00204     // date
                                    +00205     $r.="<TD>";
                                    +00206     $r.=$l['j_date'];
                                    +00207     $r.="</TD>";
                                    +00208 
                                    +00209     //type (deb = out cred=in)
                                    +00210     $r.="<TD>";
                                    +00211     $r.=($l['sg_type']=='c')?'OUT':'IN';
                                    +00212     $r.="</TD>";
                                    +00213 
                                    +00214     // jr_internal
                                    +00215     $r.="<TD>";
                                    +00216     $r.="</TD>";
                                    +00217 
                                    +00218 
                                    +00219     // comment
                                    +00220     $r.="<TD>";
                                    +00221     $r.=$l['jr_comment'];
                                    +00222     $r.="</TD>";
                                    +00223 
                                    +00224     //amount
                                    +00225     $r.="<TD>";
                                    +00226     $r.=$l['j_montant'];
                                    +00227     $r.="</TD>";
                                    +00228 
                                    +00229     //quantity
                                    +00230     $r.="<TD>";
                                    +00231     $r.=$l['sg_quantity'];
                                    +00232     $r.="</TD>";
                                    +00233 
                                    +00234     // Unit Price
                                    +00235     $r.="<TD>";
                                    +00236     $up=$l['j_montant']/$l['sg_quantity'];
                                    +00237     $r.=$up;
                                    +00238     $r.="</TD>";
                                    +00239 
                                    +00240     $r.="</TR>";
                                    +00241   }// for ($i
                                    +00242   $r.="</table>";
                                    +00243 
                                    +00244 
                                    +00245 
                                    +00246   return $r;
                                    +00247          
                                    +00248 }
                                    +
                                    +

                                    +

                                    @@ -300,10 +463,78 @@ show the listing of all goods

                                    Definition at line 35 of file stock_inc.php.

                                    -References $diff, $r, $Res, $result, $sql, ExecSql(), getFicheNameCode(), and GetQuantity(). +References $diff, $r, $Res, $result, $sql, ExecSql(), getFicheNameCode(), and GetQuantity().

                                    00035                                   {
                                    +00036  // build sql -- get the different merchandise sold or bought
                                    +00037   // during the p_year
                                    +00038 $sql=" select distinct sg_code
                                    +00039       from stock_goods 
                                    +00040       join jrnx on (stock_goods.j_id=jrnx.j_id)
                                    +00041       join parm_periode on (parm_periode.p_id=jrnx.j_tech_per)
                                    +00042     where
                                    +00043       p_exercice= '$p_year'
                                    +00044       and sg_code is not null and sg_code != '' and sg_code!='null'";
                                    +00045 
                                    +00046 
                                    +00047   // send the sql
                                    +00048   $Res=ExecSql($p_cn,$sql);
                                    +00049 
                                    +00050   
                                    +00051   if ( ( $M = pg_NumRows($Res)) == 0 ) return null;
                                    +00052   // store it in a HTLM table
                                    +00053   $result="<table>";
                                    +00054   $result.="<tr>";
                                    +00055   $result.='<th>Code</th>';
                                    +00056   $result.='<th>Noms</th>';
                                    +00057   $result.='<th>Entrée</th>';
                                    +00058   $result.='<th>Sortie</th>';
                                    +00059   $result.='<th>Solde</th>';
                                    +00060   $result.="</tr>";
                                    +00061 
                                    +00062   // Sql result => table
                                    +00063   for ($i = 0; $i < $M ; $i++ ) {
                                    +00064     $r=pg_fetch_array($Res,$i);
                                    +00065     $result.="<TR>";
                                    +00066 
                                    +00067     // sg_code  and link to details
                                    +00068     $result.="<td>".'<a class="one" 
                                    +00069               HREF="stock.php?action=detail&sg_code='.$r['sg_code'].'&year='.$p_year.'">'. 
                                    +00070               $r['sg_code']."</A></td>";
                                    +00071 
                                    +00072     // name
                                    +00073     $a_name=getFicheNameCode($p_cn,$r['sg_code']);
                                    +00074     $name="";
                                    +00075     if ( $a_name != null ) {
                                    +00076       foreach ($a_name as $key=>$element) {
                                    +00077         $name.=$element['av_text'].",";
                                    +00078       }
                                    +00079     }// if ( $a_name
                                    +00080     $result.="<td> $name </td>";
                                    +00081 
                                    +00082     // Debit (in)
                                    +00083     $deb=GetQuantity($p_cn,$r['sg_code'],$p_year,'d');
                                    +00084     $result.="<td>".$deb."</td>";
                                    +00085 
                                    +00086     // Credit (out)
                                    +00087     $cred=GetQuantity($p_cn,$r['sg_code'],$p_year,'c');
                                    +00088     $result.="<td>".$cred."</td>";
                                    +00089 
                                    +00090 
                                    +00091     // diff
                                    +00092     $diff=$deb-$cred;
                                    +00093     $result.="<td>".$diff."</td>";
                                    +00094     $result.="</tr>";
                                    +00095 
                                    +00096   }
                                    +00097       $result.="</table>";
                                    +00098 
                                    +00099   return $result;
                                    +00100 }
                                    +
                                    +

                                    + -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/test_8php-source.html b/doc/developper/html/test_8php-source.html index 68f9558e7..4f5e61acb 100644 --- a/doc/developper/html/test_8php-source.html +++ b/doc/developper/html/test_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/test.php Source File +phpcompta: test.php Source File +html

                                    test.php

                                    Go to the documentation of this file.
                                    00001 
                                     00002 <style type="text/css">
                                     00003 <!--
                                    @@ -75,7 +75,7 @@
                                     00066 echo "<h2 class=\"info\"> Congratulation : Test successfull</h2>";
                                     00067 
                                     00068 ?>
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 18:58:47 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/test_8php.html b/doc/developper/html/test_8php.html index 672bc2c86..41a0001f9 100644 --- a/doc/developper/html/test_8php.html +++ b/doc/developper/html/test_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/test.php File Reference +phpcompta: test.php File Reference +html

                                    test.php File Reference

                                    Go to the source code of this file. @@ -68,7 +68,7 @@ Definition at line 37 of f Definition at line 45 of file test.php.
                                    -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 18:58:47 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/test__smarty_8php-source.html b/doc/developper/html/test__smarty_8php-source.html index a55302e97..cfb2706cc 100644 --- a/doc/developper/html/test__smarty_8php-source.html +++ b/doc/developper/html/test__smarty_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/test_smarty.php Source File +phpcompta: test_smarty.php Source File +html

                                    test_smarty.php

                                    Go to the documentation of this file.
                                    00001 <?php
                                     00002 
                                     00003 require('Smarty.class.php');
                                    @@ -22,7 +22,7 @@
                                     00013 
                                     00014 ?>
                                     00015 
                                    -

                                    Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 18:58:47 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/test__smarty_8php.html b/doc/developper/html/test__smarty_8php.html index 2345d2b0a..63bed39d9 100644 --- a/doc/developper/html/test__smarty_8php.html +++ b/doc/developper/html/test__smarty_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/test_smarty.php File Reference +phpcompta: test_smarty.php File Reference +html

                                    test_smarty.php File Reference

                                    Go to the source code of this file. @@ -149,7 +149,7 @@ Definition at line 96 of file test_smarty.php.
                                    -


                                    Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                    Generated on Thu Jun 29 18:58:47 2006 for phpcompta by  doxygen 1.4.4
                                    diff --git a/doc/developper/html/todo.html b/doc/developper/html/todo.html index 847942813..33e34be7e 100644 --- a/doc/developper/html/todo.html +++ b/doc/developper/html/todo.html @@ -52,11 +52,6 @@
                                    add a check to return an error and rollback operation

                                  -

                                  -
                                  File user_advanced.php
                                  -
                                  Obsolete ?
                                  -
                                  -

                                  File check_priv.php
                                  some of those tools are redundant with the class user and should be cleaned
                                  @@ -77,6 +72,11 @@
                                  obsolete ?

                                  +

                                  +
                                  File user_advanced.php
                                  +
                                  Obsolete ?
                                  +
                                  +

                                  Global ShowMenuCompta
                                  clean param p_dossier

                                  @@ -87,7 +87,7 @@

                                  Global ShowMenuFiche
                                  Only for developper A test must be added
                                  -
                                  Generated on Thu Jun 29 00:04:10 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:25 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/tva_8inc_8php-source.html b/doc/developper/html/tva_8inc_8php-source.html index 7858a9f2d..9f5a5bc7f 100644 --- a/doc/developper/html/tva_8inc_8php-source.html +++ b/doc/developper/html/tva_8inc_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/tva.inc.php Source File +phpcompta: tva.inc.php Source File +include

                                  tva.inc.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -132,8 +132,8 @@
                                   00127       echo "</TD>";
                                   00128 
                                   00129       echo "<TD>";
                                  -00130       echo '<input type="submit" name="rm" value="Efface">';
                                  -00131       echo '<input type="submit" name="mod" value="Modifie">';
                                  +00130       echo '<input type="submit" name="rm" value="Efface">';
                                  +00131       echo '<input type="submit" name="mod" value="Modifie">';
                                   00132       $w=new widget("hidden");
                                   00133       $w->name="tva_id";
                                   00134       $w->value=$row['tva_id'];
                                  @@ -157,8 +157,8 @@
                                   00152 
                                   00153 ) { ?>
                                   00154     <form method="post">
                                  -00155     <input type="submit" name="add" value="Ajouter un taux de tva">
                                  -00156     <input type="hidden" name="p_action" value="tva">
                                  +00155     <input type="submit" name="add" value="Ajouter un taux de tva">
                                  +00156     <input type="hidden" name="p_action" value="tva">
                                   00157      </form>
                                   00158 <?
                                   00159        } 
                                  @@ -189,9 +189,9 @@
                                   00184 </table>
                                   00185 <?
                                   00186     echo '<FORM method="post">';
                                  -00187     echo '<input type="hidden" name="tva_id" value="'.$index.'">';
                                  -00188     echo '<input type="submit" name="confirm_rm" value="Confirme">';
                                  -00189     echo '<input type="submit" value="Cancel" name="no">';
                                  +00187     echo '<input type="hidden" name="tva_id" value="'.$index.'">';
                                  +00188     echo '<input type="submit" name="confirm_rm" value="Confirme">';
                                  +00189     echo '<input type="submit" value="Cancel" name="no">';
                                   00190     echo "</form>"; 
                                   00191 
                                   00192   }
                                  @@ -221,8 +221,8 @@
                                   00216    <td> <? $w=new widget("text"); $w->size=10;echo $w->IOValue('tva_poste','') ?></td>
                                   00217 </Tr>
                                   00218 </table>
                                  -00219 <input type="submit" value="Confirme" name="confirm_add">
                                  -00220 <input type="submit" value="Cancel" name="no">
                                  +00219 <input type="submit" value="Confirme" name="confirm_add">
                                  +00220 <input type="submit" value="Cancel" name="no">
                                   00221 
                                   00222  </FORM>
                                   00223 <?  }
                                  @@ -237,7 +237,7 @@
                                   00232       $index=$_POST['tva_id'];
                                   00233 
                                   00234       echo '<FORM method="post">';
                                  -00235       echo '<input type="hidden" name="tva_id" value="'.$index.'">';
                                  +00235       echo '<input type="hidden" name="tva_id" value="'.$index.'">';
                                   00236 ?>
                                   00237 <table>
                                   00238    <TR>
                                  @@ -254,14 +254,14 @@
                                   00249    <td> <? $w=new widget("text");$w->size=5; echo $w->IOValue('tva_poste',$a[$index]['tva_poste']) ?></td>
                                   00250 </Tr>
                                   00251 </table>
                                  -00252 <input type="submit" value="Confirme" name="confirm_mod">
                                  -00253 <input type="submit" value="Cancel" name="no">
                                  +00252 <input type="submit" value="Confirme" name="confirm_mod">
                                  +00253 <input type="submit" value="Cancel" name="no">
                                   00254  </FORM>
                                   00255 <? 
                                   00256     }
                                   00257 
                                   00258 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/tva_8inc_8php.html b/doc/developper/html/tva_8inc_8php.html index 024c54c7b..74c71ee3e 100644 --- a/doc/developper/html/tva_8inc_8php.html +++ b/doc/developper/html/tva_8inc_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/tva.inc.php File Reference +phpcompta: tva.inc.php File Reference +include

                                  tva.inc.php File Reference

                                  included file for customizing with the vat (account,rate...) More...

                                  @@ -519,7 +519,7 @@ Definition at line 215 Referenced by Cezpdf::ezColumnsStart(), Cezpdf::ezImage(), Cezpdf::ezNewPage(), Cezpdf::ezTable(), Cpdf::filledRectangle(), Cpdf::rectangle(), Cpdf::selectFont(), Cpdf::setLineStyle(), ShowMenuCompta(), ShowMenuParam(), VerifImport(), and widget::widget(). -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__ach_8php-source.html b/doc/developper/html/user__action__ach_8php-source.html index cf4ccf6b7..30772a219 100644 --- a/doc/developper/html/user__action__ach_8php-source.html +++ b/doc/developper/html/user__action__ach_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ach.php Source File +phpcompta: user_action_ach.php Source File +include

                                  user_action_ach.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -103,8 +103,8 @@
                                   00097         if ( isset ($_POST['view_invoice']) and 
                                   00098              ! isset ($_POST['save'])) {
                                   00099         $nb_number=$_POST["nb_item"];
                                  -00100         $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
                                  -00101         $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
                                  +00100         $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
                                  +00101         $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
                                   00102         if ( form_verify_input ($cn,$_GET['p_jrn'],$User->GetPeriode(),$HTTP_POST_VARS,$nb_number) == true ) {
                                   00103           // Should use a read only view instead of FormAch
                                   00104           // where we can check
                                  @@ -180,18 +180,18 @@
                                   00174       {
                                   00175         // reset all the paid flag because the checkbox is post only
                                   00176         // when checked
                                  -00177         foreach ($_POST as $name=>$paid) 
                                  +00177         foreach ($_POST as $name=>$paid) 
                                   00178           {
                                  -00179             list($ad) = sscanf($name,"set_jr_id%d");
                                  +00179             list($ad) = sscanf($name,"set_jr_id%d");
                                   00180             if ( $ad == null ) continue;
                                   00181             $sql="update jrn set jr_rapt='' where jr_id=$ad";
                                   00182             $Res=ExecSql($cn,$sql);
                                   00183 
                                   00184           }
                                   00185         // set a paid flag for the checked box
                                  -00186         foreach ($_POST as $name=>$paid) 
                                  +00186         foreach ($_POST as $name=>$paid) 
                                   00187           {
                                  -00188             list ($id) = sscanf ($name,"rd_paid%d");
                                  +00188             list ($id) = sscanf ($name,"rd_paid%d");
                                   00189 
                                   00190             if ( $id == null ) continue;
                                   00191 
                                  @@ -235,18 +235,18 @@
                                   00229     {
                                   00230       // reset all the paid flag because the checkbox is post only
                                   00231       // when checked
                                  -00232       foreach ($_POST as $name=>$paid) 
                                  +00232       foreach ($_POST as $name=>$paid) 
                                   00233         {
                                  -00234           list($ad) = sscanf($name,"set_jr_id%d");
                                  +00234           list($ad) = sscanf($name,"set_jr_id%d");
                                   00235           if ( $ad == null ) continue;
                                   00236           $sql="update jrn set jr_rapt='' where jr_id=$ad";
                                   00237           $Res=ExecSql($cn,$sql);
                                   00238           
                                   00239         }
                                   00240       // set a paid flag for the checked box
                                  -00241       foreach ($_POST as $name=>$paid) 
                                  +00241       foreach ($_POST as $name=>$paid) 
                                   00242           {
                                  -00243             list ($id) = sscanf ($name,"rd_paid%d");
                                  +00243             list ($id) = sscanf ($name,"rd_paid%d");
                                   00244             
                                   00245             if ( $id == null ) continue;
                                   00246             echo "Mise à jour $id";
                                  @@ -321,7 +321,7 @@
                                   00315 }
                                   00316 include("user_update.php");
                                   00317 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__ach_8php.html b/doc/developper/html/user__action__ach_8php.html index 45946bcf7..844526ac1 100644 --- a/doc/developper/html/user__action__ach_8php.html +++ b/doc/developper/html/user__action__ach_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ach.php File Reference +phpcompta: user_action_ach.php File Reference +include

                                  user_action_ach.php File Reference

                                  included file for the ledger of expenses More...

                                  @@ -341,7 +341,7 @@ Definition at line 52 of file user_action_ach.php.

                                  -Referenced by Document::a_ref(), fiche::blank(), ChangeStock(), cl_user::Check(), ComputeTotalVat(), action::Confirm(), Document_modele::Delete(), parm_code::Display(), fiche_def_ref::Display(), fiche::Display(), fiche_def::Display(), action::Display(), Document_modele::form(), FormAchInput(), FormAchView(), FormFin(), FormODS(), FormVenInput(), FormVenteView(), poste::get(), fiche_def_ref::Get(), Document_type::get(), action::get(), GetArray(), fiche::GetByQCode(), GetConcerned(), getDbValue(), jrn::GetDefLine(), GetDossierName(), cl_user::getExercice(), getFicheNameCode(), GetGrpt(), poste::GetName(), fiche::getName(), Balance::GetRow(), GetSolde(), poste::GetSolde(), poste::GetSoldeDetail(), GetTvaRate(), parm_code::Input(), fiche_def_ref::Input(), InsertStockGoods(), widget::IOValue(), jrn_navigation_bar(), ListJrn(), parm_code::LoadAll(), make_array(), Document_modele::myList(), action::myList(), new_fiche(), RecordInvoice(), RecordSell(), Document::Replace(), Document_modele::Save(), save_upload_document(), action::SaveStage2(), ShowActionList(), ShowMenuAdvanced(), ShowMenuCompta(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), TransferCSV(), u_ShowMenuRecherche(), UpdateJrn(), Document::Upload(), ViewDetailStock(), and ViewStock(). +Referenced by Document::a_ref(), fiche::blank(), ChangeStock(), cl_user::Check(), ComputeTotalVat(), action::Confirm(), Document_modele::Delete(), parm_code::Display(), fiche_def_ref::Display(), fiche::Display(), fiche_def::Display(), action::Display(), Document_modele::form(), FormAchInput(), FormAchView(), FormFin(), FormODS(), FormVenInput(), FormVenteView(), poste::get(), fiche_def_ref::Get(), Document_type::get(), action::get(), GetArray(), fiche::GetByQCode(), GetConcerned(), getDbValue(), jrn::GetDefLine(), GetDossierName(), cl_user::getExercice(), getFicheNameCode(), GetGrpt(), poste::GetName(), fiche::getName(), Balance::GetRow(), GetSolde(), poste::GetSolde(), poste::GetSoldeDetail(), GetTvaRate(), parm_code::Input(), fiche_def_ref::Input(), InsertStockGoods(), widget::IOValue(), jrn_navigation_bar(), ListJrn(), parm_code::LoadAll(), make_array(), Document_modele::myList(), action::myList(), new_fiche(), RecordInvoice(), RecordSell(), Document::Replace(), Document_modele::Save(), save_upload_document(), action::SaveStage2(), ShowActionList(), ShowMenuAdvanced(), ShowMenuCompta(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), TransferCSV(), u_ShowMenuRecherche(), UpdateJrn(), Document::Upload(), ViewDetailStock(), and ViewStock().

                                  @@ -648,7 +648,7 @@ Definition at line 149 of file user_action_ach.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__fin_8php-source.html b/doc/developper/html/user__action__fin_8php-source.html index a46318c17..843338330 100644 --- a/doc/developper/html/user__action__fin_8php-source.html +++ b/doc/developper/html/user__action__fin_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_fin.php Source File +phpcompta: user_action_fin.php Source File +include

                                  user_action_fin.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -109,8 +109,8 @@
                                   00104         // View the charge and show a submit button to save it 
                                   00105         if ( isset ($_POST['view_invoice']) ) {
                                   00106         $nb_number=$_POST["nb_item"];
                                  -00107         $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
                                  -00108         $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
                                  +00107         $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
                                  +00108         $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
                                   00109         $r=form_verify_input($cn,$_GET['p_jrn'],$User->GetPeriode(),$HTTP_POST_VARS,$nb_number);
                                   00110         // if something goes wrong correct it
                                   00111         if ( $r == null ) 
                                  @@ -256,7 +256,7 @@
                                   00251 
                                   00252 
                                   00253 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__fin_8php.html b/doc/developper/html/user__action__fin_8php.html index 3bc175f6d..9b8f6ee37 100644 --- a/doc/developper/html/user__action__fin_8php.html +++ b/doc/developper/html/user__action__fin_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_fin.php File Reference +phpcompta: user_action_fin.php File Reference +include

                                  user_action_fin.php File Reference

                                  included file for the financial ledger More...

                                  @@ -701,7 +701,7 @@ Definition at line 165 of file user_action_fin.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__gl_8php-source.html b/doc/developper/html/user__action__gl_8php-source.html index 512a8f7a3..88a8fef6e 100644 --- a/doc/developper/html/user__action__gl_8php-source.html +++ b/doc/developper/html/user__action__gl_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_gl.php Source File +phpcompta: user_action_gl.php Source File +include

                                  user_action_gl.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -80,7 +80,7 @@
                                   00075 
                                   00076 ?>
                                   00077 </div>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__gl_8php.html b/doc/developper/html/user__action__gl_8php.html index 2625d4b6d..b4549186c 100644 --- a/doc/developper/html/user__action__gl_8php.html +++ b/doc/developper/html/user__action__gl_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_gl.php File Reference +phpcompta: user_action_gl.php File Reference +include

                                  user_action_gl.php File Reference

                                  included file for the great ledger More...

                                  @@ -426,7 +426,7 @@ Definition at line 44 of file user_action_gl.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__ods_8php-source.html b/doc/developper/html/user__action__ods_8php-source.html index e9b0e4156..a52cd1138 100644 --- a/doc/developper/html/user__action__ods_8php-source.html +++ b/doc/developper/html/user__action__ods_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ods.php Source File +phpcompta: user_action_ods.php Source File +include

                                  user_action_ods.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -107,8 +107,8 @@
                                   00102   // 'submit_od', no? 
                                   00103         if ( isset ($_POST['view_invoice']) ) {
                                   00104           $nb_number=$_POST["nb_item"];
                                  -00105           $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
                                  -00106           $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
                                  +00105           $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
                                  +00106           $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
                                   00107 
                                   00108           $r=FormODS($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$HTTP_POST_VARS,true,$nb_number);
                                   00109 
                                  @@ -223,7 +223,7 @@
                                   00218 }
                                   00219 include("user_update.php");
                                   00220 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__ods_8php.html b/doc/developper/html/user__action__ods_8php.html index 37a700607..b258770e5 100644 --- a/doc/developper/html/user__action__ods_8php.html +++ b/doc/developper/html/user__action__ods_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ods.php File Reference +phpcompta: user_action_ods.php File Reference +include

                                  user_action_ods.php File Reference

                                  included file for the miscellaneous operation ledger More...

                                  @@ -588,7 +588,7 @@ Definition at line 160 of file user_action_ods.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__ven_8php-source.html b/doc/developper/html/user__action__ven_8php-source.html index 508c5ec20..8e3974846 100644 --- a/doc/developper/html/user__action__ven_8php-source.html +++ b/doc/developper/html/user__action__ven_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ven.php Source File +phpcompta: user_action_ven.php Source File +include

                                  user_action_ven.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -186,18 +186,18 @@
                                   00180       {
                                   00181         // reset all the paid flag because the checkbox is post only
                                   00182         // when checked
                                  -00183         foreach ($_POST as $name=>$paid) 
                                  +00183         foreach ($_POST as $name=>$paid) 
                                   00184           {
                                  -00185             list($ad) = sscanf($name,"set_jr_id%d");
                                  +00185             list($ad) = sscanf($name,"set_jr_id%d");
                                   00186             if ( $ad == null ) continue;
                                   00187             $sql="update jrn set jr_rapt='' where jr_id=$ad";
                                   00188             $Res=ExecSql($cn,$sql);
                                   00189 
                                   00190           }
                                   00191         // set a paid flag for the checked box
                                  -00192         foreach ($_POST as $name=>$paid) 
                                  +00192         foreach ($_POST as $name=>$paid) 
                                   00193           {
                                  -00194             list ($id) = sscanf ($name,"rd_paid%d");
                                  +00194             list ($id) = sscanf ($name,"rd_paid%d");
                                   00195 
                                   00196             if ( $id == null ) continue;
                                   00197 
                                  @@ -254,18 +254,18 @@
                                   00248       {
                                   00249         // reset all the paid flag because the checkbox is post only
                                   00250         // when checked
                                  -00251         foreach ($_POST as $name=>$paid) 
                                  +00251         foreach ($_POST as $name=>$paid) 
                                   00252           {
                                  -00253             list($ad) = sscanf($name,"set_jr_id%d");
                                  +00253             list($ad) = sscanf($name,"set_jr_id%d");
                                   00254             if ( $ad == null ) continue;
                                   00255             $sql="update jrn set jr_rapt='' where jr_id=$ad";
                                   00256             $Res=ExecSql($cn,$sql);
                                   00257 
                                   00258           }
                                   00259         // set a paid flag for the checked box
                                  -00260         foreach ($_POST as $name=>$paid) 
                                  +00260         foreach ($_POST as $name=>$paid) 
                                   00261           {
                                  -00262             list ($id) = sscanf ($name,"rd_paid%d");
                                  +00262             list ($id) = sscanf ($name,"rd_paid%d");
                                   00263 
                                   00264             if ( $id == null ) continue;
                                   00265             echo "Mise à jour $id";
                                  @@ -327,7 +327,7 @@
                                   00321 
                                   00322 include("user_update.php");
                                   00323 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__action__ven_8php.html b/doc/developper/html/user__action__ven_8php.html index 3c6dc6512..7de80c525 100644 --- a/doc/developper/html/user__action__ven_8php.html +++ b/doc/developper/html/user__action__ven_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_action_ven.php File Reference +phpcompta: user_action_ven.php File Reference +include

                                  user_action_ven.php File Reference

                                  Manage the ledger of type VEN. More...

                                  @@ -644,7 +644,7 @@ Definition at line 153 of file user_action_ven.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__advanced_8php-source.html b/doc/developper/html/user__advanced_8php-source.html index 8cefe510e..6315f28cc 100644 --- a/doc/developper/html/user__advanced_8php-source.html +++ b/doc/developper/html/user__advanced_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_advanced.php Source File +phpcompta: user_advanced.php Source File +html

                                  user_advanced.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PHPCOMPTA
                                  @@ -71,7 +71,7 @@
                                   00067 
                                   00068 html_page_stop();
                                   00069 ?>
                                  -

                                  Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__advanced_8php.html b/doc/developper/html/user__advanced_8php.html index a9e54dc44..f38c06b06 100644 --- a/doc/developper/html/user__advanced_8php.html +++ b/doc/developper/html/user__advanced_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_advanced.php File Reference +phpcompta: user_advanced.php File Reference +html

                                  user_advanced.php File Reference

                                  Obsolete. More...

                                  @@ -76,7 +76,7 @@ Definition at line 3 Definition at line 36 of file user_advanced.php. -


                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__common_8php-source.html b/doc/developper/html/user__common_8php-source.html index 758b62ccd..3d78a1fcf 100644 --- a/doc/developper/html/user__common_8php-source.html +++ b/doc/developper/html/user__common_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_common.php Source File +phpcompta: user_common.php Source File +include

                                  user_common.php

                                  Go to the documentation of this file.
                                  00001 <?
                                   00002 /*
                                   00003  *   This file is part of PhpCompta.
                                  @@ -637,9 +637,9 @@
                                   00871   $and="";
                                   00872   $get=$_GET;
                                   00873   if ( isset ($get) ) {
                                  -00874     foreach ($get as $name=>$value ) {
                                  +00874     foreach ($get as $name=>$value ) {
                                   00875       // we clean the parameter offset, step, page and size
                                  -00876       if (  ! in_array($name,array('offset','step','page','size'))) {
                                  +00876       if (  ! in_array($name,array('offset','step','page','size'))) {
                                   00877         $url.=$and.$name."=".$value;
                                   00878         $and="&";
                                   00879       }// if
                                  @@ -697,7 +697,7 @@
                                   00931   return $r;
                                   00932 }
                                   00933 
                                  -

                                  Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                  Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                  diff --git a/doc/developper/html/user__common_8php.html b/doc/developper/html/user__common_8php.html index 611fc87fb..06c3d8d77 100644 --- a/doc/developper/html/user__common_8php.html +++ b/doc/developper/html/user__common_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_common.php File Reference +phpcompta: user_common.php File Reference +include

                                  user_common.php File Reference

                                  Common functions. More...

                                  @@ -149,7 +149,95 @@ Definition at line 69<

                                  References $a, $flag, $idx, $r, $tva_id, echo_debug(), GetTvaRate(), and isNumber().

                                  -Referenced by RecordInvoice(), and RecordSell(). +Referenced by RecordInvoice(), and RecordSell().

                                  00069                                                                                 {
                                  +00070 echo_debug('user_common.php',__LINE__,"ComputeTotalVat $a_fiche $a_quant $a_price");
                                  +00071  foreach ( $a_fiche as $t=>$el) {
                                  +00072    echo_debug('user_common.php',__LINE__,"t $t e $el");
                                  +00073  }
                                  +00074  $r=null;
                                  +00075 // foreach goods 
                                  +00076 //--
                                  +00077  foreach ( $a_fiche as $idx=>$element) {
                                  +00078    echo_debug ('user_common.php',__LINE__,"idx $idx element $element");
                                  +00079   // if the card id is null or empty 
                                  +00080     if (  strlen(trim($element))==0) continue;
                                  +00081    
                                  +00082     // Get the tva_id
                                  +00083     if ( $ap_vat != null and
                                  +00084          isNumber($ap_vat[$idx])== 1 and $ap_vat[$idx] != -1 ) 
                                  +00085       {
                                  +00086         $tva_id=$ap_vat[$idx];
                                  +00087         echo_debug('user_common',__LINE__,' tva_id is given');
                                  +00088         echo_debug('user_common',__LINE__,$ap_vat);
                                  +00089       }
                                  +00090     else
                                  +00091       {
                                  +00092         $tva_id=GetFicheAttribut($p_cn,$element,ATTR_DEF_TVA);
                                  +00093         echo_debug('user_common',__LINE__,'retrieve tva_id');
                                  +00094       }
                                  +00095     echo_debug('user_common',__LINE__,"tva id $tva_id");
                                  +00096     if ( $tva_id == null ) continue;
                                  +00097     // for each fiche find the tva_rate and tva_id
                                  +00098     $a_vat=GetTvaRate($p_cn,$tva_id);
                                  +00099    
                                  +00100         // Get the attribut price of the card(fiche)
                                  +00101         if ( $a_vat != null  and  $a_vat['tva_id'] != "" ) 
                                  +00102         {  
                                  +00103                 $flag=true;
                                  +00104                 $a=$a_vat['tva_id'];
                                  +00105                 // Compute vat for this item
                                  +00106                 $vat_amount=round($a_price[$idx]*$a_vat['tva_rate']*$a_quant[$idx],2);
                                  +00107         
                                  +00108                 // only the deductible vat
                                  +00109                  if ( $all == false ) 
                                  +00110                    {
                                  +00111                      //variable containing the nd part 
                                  +00112                      // used when a card has both special rule for vat 
                                  +00113                      $nd1=0;
                                  +00114                      // if a part is not deductible then reduce vat_amount
                                  +00115                      $nd=GetFicheAttribut($p_cn,$a_fiche[$idx],ATTR_DEF_TVA_NON_DEDUCTIBLE);
                                  +00116                      if ( $nd != null && strlen(trim($nd)) != 0 && $nd != 0 )
                                  +00117                        {
                                  +00118                          $nd_amount=round($a_price[$idx]*$a_vat['tva_rate']*$a_quant[$idx]*$nd,2);
                                  +00119                          // problem with round
                                  +00120                          $vat_amount=$vat_amount-$nd_amount;
                                  +00121                          echo_debug('user_common.php',__LINE__,
                                  +00122                                     "A - TVA Attr fiche [$nd] nd amount [ $nd_amount ]".
                                  +00123                                     "vat amount [ $vat_amount]");
                                  +00124                          $flag=false;
                                  +00125                          // save nd into nd1
                                  +00126                          $nd1=$nd;
                                  +00127                         }       
                                  +00128                         // if a part is not deductible then reduce vat_amount
                                  +00129                         $nd=GetFicheAttribut($p_cn,$a_fiche[$idx],ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP);
                                  +00130                         if ( $nd != null && strlen(trim($nd)) != 0 && $nd != 0 )
                                  +00131                         {
                                  +00132                           $nd_amount2=round($a_price[$idx]*$a_vat['tva_rate']*$a_quant[$idx]*$nd,2);
                                  +00133                          
                                  +00134                           $vat_amount=$vat_amount-$nd_amount2;
                                  +00135                           // when using both vat, their sum cannot exceed 1, if = 1 then vat = 0
                                  +00136                           if ( ($nd+$nd1) == 1)
                                  +00137                             $vat_amount=0;
                                  +00138                           echo_debug('user_common.php',__LINE__,
                                  +00139                                      "B - TVA Attr fiche [$nd] nd amount [ $nd_amount2 ]".
                                  +00140                                      "vat amount [ $vat_amount]");
                                  +00141                           
                                  +00142                           $flag=false;
                                  +00143                         }       
                                  +00144                 }
                                  +00145                  
                                  +00146                 $r[$a]=isset ( $r[$a] )?$r[$a]+$vat_amount:$vat_amount; 
                                  +00147         }
                                  +00148     
                                  +00149  }
                                  +00150  echo_debug('user_common.php',__LINE__," return ".var_export($r,true));
                                  +00151  return $r;
                                  +00152  
                                  +00153  
                                  +00154 }
                                  +
                                  +

                                  +

                                  @@ -224,7 +312,33 @@ Definition at line 172

                                  References $a, $tva_id, echo_debug(), GetTvaRate(), and isNumber().

                                  -Referenced by RecordInvoice(), and RecordSell(). +Referenced by RecordInvoice(), and RecordSell().

                                  00173 {
                                  +00174   echo_debug('user_common.php',__LINE__,"function ComputeVat($p_cn,$p_fiche,$p_quant,$p_price,$p_vat )");
                                  +00175   // Get the tva_id
                                  +00176   if ( $p_vat != null and  isNumber($p_vat)== 1 and $p_vat != -1)
                                  +00177     $tva_id=$p_vat;
                                  +00178   else
                                  +00179     $tva_id=GetFicheAttribut($p_cn,$p_fiche,ATTR_DEF_TVA);
                                  +00180  
                                  +00181   echo_debug('user_common',__LINE__,"ComputeVat tva id = $tva_id"); 
                                  +00182   if ( $tva_id == null  ) return -1;
                                  +00183   // find the tva_rate and tva_id
                                  +00184   $a_vat=GetTvaRate($p_cn,$tva_id);
                                  +00185   $vat_amount=null;
                                  +00186   // Get the attribut price of the card(fiche)
                                  +00187   if ( $a_vat != null  and  $a_vat['tva_id'] != "" ) 
                                  +00188     {
                                  +00189       $a=$a_vat['tva_id'];
                                  +00190       $vat_amount=$p_price*$a_vat['tva_rate']*$p_quant;
                                  +00191     } 
                                  +00192   echo_debug('user_common',__LINE__,'return '.round($vat_amount,2));
                                  +00193   return round($vat_amount,2);
                                  +00194   
                                  +00195   
                                  +00196 }
                                  +
                                  +

                                  +

                                  @@ -282,7 +396,27 @@ parm :

                                  Parameters:

                                  Definition at line 727 of file user_common.php.

                                  -References $Res, CountSql(), echo_debug(), echo_error(), ExecSql(), and isNumber(). +References $Res, CountSql(), echo_debug(), echo_error(), ExecSql(), and isNumber().

                                  00727                                           {
                                  +00728   echo_debug('user_common.php',__LINE__,"DeleteRapt($p_cn,$jr_id,$jr_id2) ");
                                  +00729   if ( isNumber($jr_id)  == 0 or 
                                  +00730        isNumber($jr_id2) == 0 )
                                  +00731     {
                                  +00732       echo_error(" InsertRapt : invalid jr_id jr_id = $jr_id jr_id2 = $jr_id2");
                                  +00733       return;
                                  +00734     }
                                  +00735   // verify if exists
                                  +00736   if ( CountSql($p_cn,"select jra_id from jrn_rapt where jra_concerned=$jr_id and jr_id=$jr_id2
                                  +00737                    union
                                  +00738                  select jra_id from jrn_rapt where jra_concerned=$jr_id2 and jr_id=$jr_id ") !=0) 
                                  +00739     {
                                  +00740       // Ok we can insert 
                                  +00741       $Res=ExecSql($p_cn,"delete from jrn_rapt where (jra_concerned=$jr_id2 and jr_id=$jr_id) or 
                                  +00742                                (jra_concerned=$jr_id and jr_id=$jr_id2) ");
                                  +00743     }
                                  +00744 }
                                  +
                                  +

                                  +

                                  @@ -334,7 +468,27 @@ Definition at line 758

                                  References $i, $l, $n, $r, $Res, $sql, and ExecSql().

                                  -Referenced by ListJrn(), and UpdateJrn(). +Referenced by ListJrn(), and UpdateJrn().

                                  00758                                       {
                                  +00759 $sql=" select jr_id as cn from jrn_rapt where jra_concerned=$jr_id
                                  +00760       union
                                  +00761        select jra_concerned as cn from jrn_rapt where jr_id=$jr_id";
                                  +00762  $Res=ExecSql($p_cn,$sql);
                                  +00763 
                                  +00764  // If nothing is found return null
                                  +00765  $n=pg_NumRows($Res);
                                  +00766 
                                  +00767  if ($n ==0 ) return null;
                                  +00768 
                                  +00769  // put everything in an array
                                  +00770  for ($i=0;$i<$n;$i++) {
                                  +00771    $l=pg_fetch_array($Res,$i);
                                  +00772    $r[$i]=$l['cn'];
                                  +00773  }
                                  +00774  return $r;
                                  +00775 }
                                  +
                                  +

                                  +

                                  @@ -386,7 +540,17 @@ Definition at line 789

                                  References $r, $Res, and ExecSql().

                                  -Referenced by UpdateJrn(). +Referenced by UpdateJrn().

                                  00790 {
                                  +00791   $Res=ExecSql($p_cn,"select jr_grpt_id from jrn where jr_id=".$p_jr_id);
                                  +00792   if ( pg_NumRows($Res) == 0 ) {
                                  +00793     return null;
                                  +00794   }
                                  +00795   $r=pg_fetch_array($Res,0);
                                  +00796   return $r['jr_grpt_id'];
                                  +00797 }
                                  +
                                  +

                                  +

                                  @@ -445,7 +609,19 @@ Definition at line 211

                                  References $a, $Res, echo_error(), and ExecSql().

                                  -Referenced by RecordInvoice(), and RecordSell(). +Referenced by RecordInvoice(), and RecordSell().

                                  00211                                               {
                                  +00212         $Res=ExecSql($p_cn,"select tva_poste from tva_rate where tva_id=$p_tva_id");
                                  +00213         if ( pg_NumRows($Res) == 0 ) return null;
                                  +00214         $a=pg_fetch_array($Res,0);
                                  +00215         list ($deb,$cred)=split(",",$a['tva_poste']);
                                  +00216         if ( $p_cred=='c' ) return $cred;
                                  +00217         if ($p_cred=='d') return $deb;
                                  +00218         echo_error ("Invalid $p_cred in GetTvaRate");
                                  +00219         return null;
                                  +00220 }
                                  +
                                  +

                                  +

                                  @@ -497,7 +673,21 @@ Definition at line 40<

                                  References $r, $Res, and ExecSql().

                                  -Referenced by ComputeTotalVat(), ComputeVat(), FormAchView(), FormVenteView(), and Document::Replace(). +Referenced by ComputeTotalVat(), ComputeVat(), FormAchView(), FormVenteView(), and Document::Replace().

                                  00040                                      {
                                  +00041   // $p_tva_id is an empty string, returns 0
                                  +00042   if (strlen(trim($p_tva_id))==0) return 0;
                                  +00043 
                                  +00044   // Get vat info from the database
                                  +00045   $Res=ExecSql($p_cn,"select tva_id,tva_rate,tva_label from tva_rate where tva_id=".$p_tva_id);
                                  +00046   if (pg_NumRows($Res) == 0 ) return null;
                                  +00047 
                                  +00048   $r=pg_fetch_array($Res,0);
                                  +00049   return $r;
                                  +00050 
                                  +00051 }
                                  +
                                  +

                                  +

                                  @@ -587,7 +777,28 @@ Definition at line 288

                                  References $Res, $sql, echo_debug(), ExecSql(), FormatString(), GetSequence(), and p_comment.

                                  -Referenced by RecordFin(), RecordInvoice(), RecordSell(), and TransferCSV(). +Referenced by RecordFin(), RecordInvoice(), RecordSell(), and TransferCSV().

                                  00289 {
                                  +00290         echo_debug ('user_common.php',__LINE__,"InsertJrn param 
                                  +00291             p_date $p_date p_poste $p_comment p_amount $p_amount p_grpt = $p_grpt p_periode = $p_periode p_echeance = $p_echeance
                                  +00292 comment = $p_comment");
                                  +00293         $p_comment=FormatString($p_comment);
                                  +00294 
                                  +00295         if ( $p_echeance == "" or $p_echeance==null) {
                                  +00296                 $p_echeance='null';
                                  +00297         } else {
                                  +00298                 $p_echeance=sprintf("to_date('%s','DD.MM.YYYY')",$p_echeance);
                                  +00299         }
                                  +00300         $sql=sprintf("insert into jrn (jr_def_id,jr_montant,jr_comment,jr_date,jr_ech,jr_grpt_id,jr_tech_per)
                                  +00301                  values ( %d,abs(%.2f),'%s',to_date('%s','DD.MM.YYYY'),%s,%d,%d)",
                                  +00302                      $p_jrn, round($p_amount,2),$p_comment,$p_date,$p_echeance,$p_grpt,$p_periode);
                                  +00303         echo_debug('user_common.php',__LINE__,"InsertJrn $sql");
                                  +00304         $Res=ExecSql($p_cn,$sql);                                
                                  +00305         if ( $Res == false)  return false;
                                  +00306         return GetSequence($p_cn,'s_jrn');
                                  +00307 }
                                  +
                                  +

                                  +

                                  @@ -689,7 +900,34 @@ Definition at line 244

                                  References $Res, $sql, echo_debug(), ExecSql(), and GetSequence().

                                  -Referenced by RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), and TransferCSV(). +Referenced by RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), and TransferCSV().

                                  00245 {
                                  +00246   echo_debug ('user_common.php',__LINE__,"InsertJrnx param 
                                  +00247             type = $p_type p_user $p_user 
                                  +00248             p_date $p_date p_poste $p_poste 
                                  +00249             p_amount $p_amount p_grpt = $p_grpt p_periode = $p_periode");
                                  +00250 
                                  +00251   if ( $p_amount == 0) return true;
                                  +00252 
                                  +00253   $debit=($p_type=='c')?'false':'true';
                                  +00254 
                                  +00255   // if negative value the operation is inversed
                                  +00256   if ( $p_amount < 0 ) {
                                  +00257     $debit=($debit=='false')?'true':'false';
                                  +00258   }
                                  +00259 
                                  +00260   $sql=sprintf("select insert_jrnx
                                  +00261                  ('%s',abs(%.2f),%d,%d,%d,%s,'%s',%d,'%s')",
                                  +00262                   $p_date,round($p_amount,2),$p_poste,$p_grpt,$p_jrn,$debit,$p_user,$p_periode,$p_qcode);
                                  +00263 
                                  +00264   echo_debug('user_common.php',__LINE__,"InsertJrnx $sql");
                                  +00265   $Res=ExecSql($p_cn,$sql);
                                  +00266   if ( $Res==false) return $Res;
                                  +00267   return GetSequence($p_cn,'s_jrn_op');
                                  +00268 
                                  +00269 }
                                  +
                                  +

                                  +

                                  @@ -748,7 +986,26 @@ Definition at line 699

                                  References $Res, CountSql(), echo_debug(), echo_error(), ExecSql(), and isNumber().

                                  -Referenced by RecordFin(). +Referenced by RecordFin().

                                  00699                                           {
                                  +00700   if ( isNumber($jr_id)  == 0 ||  isNumber($jr_id2) == 0 )
                                  +00701     {
                                  +00702       echo_error(" InsertRapt : invalid jr_id $jr_id, jr_id2 $jr_id2");
                                  +00703       echo_debug('user_common.php',__LINE__," InsertRapt : invalid jr_id $jr_id, jr_id2 $jr_id2");
                                  +00704       return false;
                                  +00705     }
                                  +00706   // verify if exists
                                  +00707   if ( CountSql($p_cn,"select jra_id from jrn_rapt where jra_concerned=$jr_id and jr_id=$jr_id2
                                  +00708                    union
                                  +00709                  select jra_id from jrn_rapt where jra_concerned=$jr_id2 and jr_id=$jr_id ") ==0) 
                                  +00710     {
                                  +00711       // Ok we can insert 
                                  +00712       $Res=ExecSql($p_cn,"insert into jrn_rapt(jr_id,jra_concerned) values ($jr_id,$jr_id2)");
                                  +00713     }
                                  +00714   return true;
                                  +00715 }
                                  +
                                  +

                                  +

                                  @@ -819,7 +1076,30 @@ Definition at line 596

                                  References $r, $Res, $sql, echo_debug(), ExecSql(), and f_id.

                                  -Referenced by RecordInvoice(), and RecordSell(). +Referenced by RecordInvoice(), and RecordSell().

                                  00597 {
                                  +00598   echo_debug('user_common.php',__LINE__,"function InsertStockGoods($p_cn,$p_j_id,$p_good,$p_quant,$p_type)");
                                  +00599   // Retrieve the good account for stock
                                  +00600   $code_marchandise=GetFicheAttribut($p_cn,$p_good,ATTR_DEF_STOCK);
                                  +00601   $sql="select f_id from vw_poste_qcode where j_qcode='$p_good'";
                                  +00602   $Res=ExecSql($p_cn,$sql);
                                  +00603   $r=pg_fetch_array($Res,0);
                                  +00604   $f_id=$r['f_id'];
                                  +00605   $Res=ExecSql($p_cn,"insert into stock_goods (
                                  +00606                             j_id,
                                  +00607                             f_id,
                                  +00608                             sg_code, 
                                  +00609                             sg_quantity,
                                  +00610                              sg_type ) values (
                                  +00611                             $p_j_id,
                                  +00612                             $f_id,
                                  +00613                             '$code_marchandise',
                                  +00614                             $p_quant, '$p_type') 
                                  +00615                      ");
                                  +00616  return $Res;
                                  +00617 }
                                  +
                                  +

                                  +

                                  @@ -870,7 +1150,23 @@ Definition at line 831

                                  References $a, $Res, echo_error(), and ExecSql().

                                  -Referenced by cl_user::cl_user(). +Referenced by cl_user::cl_user().

                                  00831                                     {
                                  +00832   $Res=ExecSql($p_cn,"select jr_valid from jrn where jr_grpt_id=$p_grpt_id");
                                  +00833 
                                  +00834   if ( ( $M = pg_NumRows($Res)) == 0 ) return 0;
                                  +00835 
                                  +00836   $a=pg_fetch_array($Res,0);
                                  +00837 
                                  +00838   if ( $a['jr_valid'] == 't') return 1;
                                  +00839   if ( $a['jr_valid'] == 'f') return 0;
                                  +00840 
                                  +00841   echo_error ("Invalid result = ".$a['result']);
                                  +00842 
                                  +00843 
                                  +00844 }
                                  +
                                  +

                                  +

                                  @@ -934,9 +1230,85 @@ jrn_navigation_bar

                                  Definition at line 858 of file user_common.php.

                                  -References $_SESSION, $e, $offset, $r, $step, $url, name, size, and value. +References $_SESSION, $e, $offset, $r, $step, $url, name, size, and value.

                                  -Referenced by action::myList(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), and ViewFiche(). +Referenced by action::myList(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), and ViewFiche().

                                  00859 {
                                  +00860   // if the pagesize is unlimited return ""
                                  +00861   // in that case there is no nav. bar
                                  +00862   if ( $_SESSION['g_pagesize'] == -1  ) return "";
                                  +00863   if ( $p_size==0) {
                                  +00864     $p_size= $_SESSION['g_pagesize'];
                                  +00865   }
                                  +00866   // if there is no row return an empty string
                                  +00867   if ( $p_line == 0 ) return "";
                                  +00868 
                                  +00869   // Compute the url
                                  +00870   $url="";
                                  +00871   $and="";
                                  +00872   $get=$_GET;
                                  +00873   if ( isset ($get) ) {
                                  +00874     foreach ($get as $name=>$value ) {
                                  +00875       // we clean the parameter offset, step, page and size
                                  +00876       if (  ! in_array($name,array('offset','step','page','size'))) {
                                  +00877         $url.=$and.$name."=".$value;
                                  +00878         $and="&";
                                  +00879       }// if
                                  +00880     }//foreach
                                  +00881   }// if
                                  +00882   // compute max of page
                                  +00883   $nb_page=($p_line-($p_line%$p_size))/$p_size;
                                  +00884 
                                  +00885   // if something remains
                                  +00886   if ( $p_line % $p_size != 0 ) $nb_page+=1;
                                  +00887 
                                  +00888   // if max page == 1 then return a empty string
                                  +00889   if ( $nb_page == 1) return "";
                                  +00890 
                                  +00891   $r="";
                                  +00892   // previous
                                  +00893   if ($p_page !=1) {
                                  +00894     $e=$p_page-1;
                                  +00895     $step=$_SESSION['g_pagesize'];
                                  +00896     $offset=($e-1)*$step;
                                  +00897 
                                  +00898     $r='<A class="mtitle" href="'.$_SERVER['PHP_SELF']."?".$url."&offset=$offset&step=$step&page=$e&size=$step".'">';
                                  +00899     $r.="Pr&eacute;c&eacute;dent";
                                  +00900     $r.="</A>&nbsp;&nbsp;";
                                  +00901   }
                                  +00902 
                                  +00903   // Create the bar
                                  +00904   for ($e=1;$e<=$nb_page;$e++) {
                                  +00905     // do not included current page
                                  +00906     if ( $e != $p_page ) {
                                  +00907     $step=$_SESSION['g_pagesize'];
                                  +00908     $offset=($e-1)*$step;
                                  +00909     $go=sprintf($_SERVER['PHP_SELF']."?".$url."&offset=$offset&step=$step&page=$e&size=$step");
                                  +00910     $r.=sprintf('<A class="mtitle" HREF="%s" CLASS="one">%d</A>&nbsp;',$go,$e);
                                  +00911     } else {
                                  +00912       $r.="<b> $e </b>";
                                  +00913     } //else
                                  +00914     // add a break if e > 80
                                  +00915     if ( $e % 57 == 0 ) {
                                  +00916       $r.="<br>";
                                  +00917     }
                                  +00918   } //for
                                  +00919   // next
                                  +00920   if ($p_page !=$nb_page) {
                                  +00921     $e=$p_page+1;
                                  +00922     $step=$_SESSION['g_pagesize'];
                                  +00923     $offset=($e-1)*$step;
                                  +00924 
                                  +00925     $r.='&nbsp;<A class="mtitle" href="'.$_SERVER['PHP_SELF']."?".$url."&offset=$offset&step=$step&page=$e&size=$step".'">';
                                  +00926     $r.="Suivant";
                                  +00927     $r.="</A>";
                                  +00928   }
                                  +00929 
                                  +00930 
                                  +00931   return $r;
                                  +00932 }
                                  +
                                  +

                                  +

                                  @@ -1015,7 +1387,263 @@ ListJrn($p_cn,$p_jrn,$p_wherel)

                                  Definition at line 322 of file user_common.php.

                                  -References $_SESSION, $a, $count, $h, $limit, $Max, $offset, $p_jrn, $r, $Res, $row, $sql, $tr, $User, $w, CountSql(), DbConnect(), ExecSql(), FormatString(), GetConcerned(), GetInternal(), GetJrnProp(), isDate(), and table. +References $_SESSION, $a, $count, $h, $limit, $Max, $offset, $p_jrn, $r, $Res, $row, $sql, $tr, $User, $w, CountSql(), DbConnect(), ExecSql(), FormatString(), GetConcerned(), GetInternal(), GetJrnProp(), isDate(), and table.

                                  00323 {
                                  +00324 
                                  +00325   include_once("central_inc.php");
                                  +00326   $limit=($_SESSION['g_pagesize']!=-1)?" LIMIT ".$_SESSION['g_pagesize']:"";
                                  +00327   $offset=($_SESSION['g_pagesize']!=-1)?" OFFSET ".$p_value:"";
                                  +00328   if ( $p_array == null ) {
                                  +00329 
                                  +00330   //que fait cette requête??? 
                                  +00331     
                                  +00332    $sql="select jr_id   ,
                                  +00333                         jr_montant,
                                  +00334                         jr_comment,
                                  +00335                         jr_ech,
                                  +00336                         to_char(jr_date,'DD.MM.YYYY') as jr_date,
                                  +00337                         jr_date as jr_date_order,
                                  +00338                         jr_grpt_id,
                                  +00339                         jr_rapt,
                                  +00340                         jr_internal,
                                  +00341                         jrn_def_id,
                                  +00342                         jrn_def_name,
                                  +00343                         jrn_def_ech,
                                  +00344                         jrn_def_type,
                                  +00345                         jr_valid,
                                  +00346                         jr_tech_per,
                                  +00347                         jr_pj_name,
                                  +00348                         p_closed
                                  +00349                        from 
                                  +00350                         jrn 
                                  +00351                             join jrn_def on jrn_def_id=jr_def_id 
                                  +00352                             join parm_periode on p_id=jr_tech_per
                                  +00353                        $p_where 
                                  +00354                          order by jr_date_order asc,jr_internal asc";
                                  +00355   }
                                  +00356   if ( $p_array != null ) {
                                  +00357     // Construction Query 
                                  +00358     foreach ( $p_array as $key=>$element) {
                                  +00359       ${"l_$key"}=$element;
                                  +00360     }
                                  +00361     $sql="select jr_id  ,
                                  +00362                 jr_montant,
                                  +00363                 jr_comment,
                                  +00364                 jr_ech,
                                  +00365                 to_char(jr_date,'DD.MM.YYYY') as jr_date,
                                  +00366                 jr_date as jr_date_order,
                                  +00367                 jr_grpt_id,
                                  +00368                 jr_rapt,
                                  +00369                 jr_internal,
                                  +00370                 jrn_def_id,
                                  +00371                 jrn_def_name,
                                  +00372                 jrn_def_ech,
                                  +00373                 jrn_def_type,
                                  +00374                 jr_valid,
                                  +00375                 jr_tech_per,
                                  +00376                 jr_pj_name,
                                  +00377                 p_closed
                                  +00378                       from 
                                  +00379                 jrn join jrn_def on jrn_def_id=jr_def_id 
                                  +00380                     join parm_periode on p_id=jr_tech_per
                                  +00381                 ";
                                  +00382     $jrn_sql=($p_jrn =0)?"1=1":"jrn_def_id=$p_jrn ";
                                  +00383     $l_and=" where ";
                                  +00384     // amount
                                  +00385     if ( ereg("^[0-9]+$", $l_s_montant) || ereg ("^[0-9]+\.[0-9]+$", $l_s_montant) ) 
                                  +00386     {
                                  +00387       $sql.=$l_and."  jr_montant $l_mont_sel $l_s_montant";
                                  +00388       $l_and=" and ";
                                  +00389     }
                                  +00390     // date
                                  +00391     if ( isDate($l_date_start) != null ) 
                                  +00392     {
                                  +00393       $sql.=$l_and." jr_date >= to_date('".$l_date_start."','DD.MM.YYYY')";
                                  +00394       $l_and=" and ";
                                  +00395     }
                                  +00396     if ( isDate($l_date_end) != null ) {
                                  +00397       $sql.=$l_and." jr_date <= to_date('".$l_date_end."','DD.MM.YYYY')";
                                  +00398       $l_and=" and ";
                                  +00399     }
                                  +00400     // comment
                                  +00401     $l_s_comment=FormatString($l_s_comment);
                                  +00402     if ( $l_s_comment != null ) 
                                  +00403     {
                                  +00404       $sql.=$l_and." upper(jr_comment) like upper('%".$l_s_comment."%') ";
                                  +00405       $l_and=" and ";
                                  +00406     }
                                  +00407     // internal
                                  +00408     $l_s_internal=FormatString($l_s_internal);
                                  +00409     if ( $l_s_internal != null ) {
                                  +00410       $sql.=$l_and."  jr_internal like ('%$l_s_internal%')  ";
                                  +00411       $l_and=" and ";
                                  +00412     }
                                  +00413     // Poste
                                  +00414     $l_poste=FormatString($l_poste);
                                  +00415     if ( $l_poste != null ) {
                                  +00416       $sql.=$l_and."  jr_grpt_id in (select j_grpt 
                                  +00417              from jrnx where j_poste = $l_poste)  ";
                                  +00418       $l_and=" and ";
                                  +00419     }
                                  +00420     // Quick Code
                                  +00421     if ( $l_qcode != null ) 
                                  +00422       {
                                  +00423         $sql.=$l_and."  jr_grpt_id in ( select j_grpt from 
                                  +00424              jrnx where j_qcode = '$l_qcode')";
                                  +00425         $l_and=" and ";
                                  +00426       }
                                  +00427     // if not admin check filter 
                                  +00428     $User=new cl_user(DbConnect());
                                  +00429     $User->Check();
                                  +00430     if ( $User->admin == 0 ) 
                                  +00431     {
                                  +00432       $sql.=$l_and." jr_def_id in ( select uj_jrn_id ".
                                  +00433         " from user_sec_jrn where ".
                                  +00434         " uj_login='".$_SESSION['g_user']."'".
                                  +00435         " and uj_priv in ('R','W'))";
                                  +00436     }
                                  +00437     $sql.=" order by jr_date_order asc";
                                  +00438   }// p_array != null
                                  +00439   // Count 
                                  +00440   $count=CountSql($p_cn,$sql);
                                  +00441   // Add the limit 
                                  +00442   $sql.=$limit.$offset;
                                  +00443 
                                  +00444   // Execute SQL stmt
                                  +00445   $Res=ExecSql($p_cn,$sql);
                                  +00446 
                                  +00447   //starting from here we can refactor, so that instead of returning the generated HTML, 
                                  +00448   //this function returns a tree structure.
                                  +00449   
                                  +00450   $r="";
                                  +00451   $r.=JS_VIEW_JRN_DETAIL;
                                  +00452   $r.=JS_VIEW_JRN_CANCEL;
                                  +00453   $r.=JS_VIEW_JRN_MODIFY;
                                  +00454 
                                  +00455   $Max=pg_NumRows($Res);
                                  +00456 
                                  +00457   //TODO: correct this message. 
                                  +00458   if ($Max==0) return array(0,"Aucun enregistrement trouvé");
                                  +00459 
                                  +00460   $r.='<table style="width:100%;border:solid blue 2px ;border-style:outset;">';
                                  +00461   $l_sessid=$_REQUEST['PHPSESSID'];
                                  +00462   $r.="<tr class=\"even\">";
                                  +00463  $r.="<th> Internal </th>";
                                  +00464   $r.="<th> Date </th>";
                                  +00465   $r.="<th> Echéance </th>";
                                  +00466   $r.="<th> Description</th>";
                                  +00467   $r.="<th> Montant </th>";
                                  +00468   // if $p_paid is not equal to 0 then we have a paid column
                                  +00469   if ( $p_paid != 0 ) 
                                  +00470     {
                                  +00471       $r.="<th> Pay&eacute;</th>";
                                  +00472     }
                                  +00473   $r.="<th>Op. Concernée</th>";
                                  +00474   $r.="<th>Document</th>";
                                  +00475   $r.="</tr>";
                                  +00476 
                                  +00477   for ($i=0; $i < $Max;$i++) {
                                  +00478 
                                  +00479     //STAN the rows here must be stored in an array
                                  +00480     
                                  +00481     $row=pg_fetch_array($Res,$i);
                                  +00482     
                                  +00483     if ( $i % 2 == 0 ) $tr='<TR class="odd">'; 
                                  +00484                 else $tr='<TR class="even">';
                                  +00485     $r.=$tr;
                                  +00486     //internal code
                                  +00487         // button  modify
                                  +00488     $r.="<TD>";
                                  +00489     $r.=sprintf('<A class="detail" HREF="javascript:modifyOperation(\'%s\',\'%s\',\'%s\')" >%s</A>',
                                  +00490                 $row['jr_id'], $l_sessid, $p_jrn, $row['jr_internal']);
                                  +00491     $r.="</TD>";
                                  +00492     // date
                                  +00493     $r.="<TD>";
                                  +00494     $r.=$row['jr_date'];
                                  +00495     $r.="</TD>";
                                  +00496     // echeance
                                  +00497     $r.="<TD>";
                                  +00498     $r.=$row['jr_ech'];
                                  +00499     $r.="</TD>";
                                  +00500     
                                  +00501     // comment
                                  +00502     $r.="<TD>";
                                  +00503     $r.=$row['jr_comment'];
                                  +00504     $r.="</TD>";
                                  +00505     
                                  +00506     // Amount
                                  +00507     // If the ledger is financial :
                                  +00508     // the credit must be negative and written in red
                                  +00509     // Get the jrn type
                                  +00510     $jrn_prop=GetJrnProp($p_cn,$row['jrn_def_id'],1);  
                                  +00511     $positive=0;
                                  +00512 
                                  +00513     // Check ledger type
                                  +00514      if (  $jrn_prop['jrn_def_type'] == 'FIN' ) 
                                  +00515      {
                                  +00516        $positive = CountSql($p_cn,"select * from jrn inner join jrnx on jr_grpt_id=j_grpt ".
                                  +00517                            " where jr_id=".$row['jr_id']." and (j_poste like '55%' or j_poste like '57%' )".
                                  +00518                            " and j_debit='f'");
                                  +00519      }
                                  +00520     $r.="<TD align=\"right\">";
                                  +00521     //STAN $positive always == 0
                                  +00522      $r.=( $positive != 0 )?"<font color=\"red\">  - ".sprintf("%8.2f",$row['jr_montant'])."</font>":sprintf("%8.2f",$row['jr_montant']);
                                  +00523     $r.="</TD>";
                                  +00524 
                                  +00525 
                                  +00526     // Show the paid column if p_paid is not null
                                  +00527     if ( $p_paid !=0 )
                                  +00528       {
                                  +00529         $w=new widget("checkbox");
                                  +00530         $w->name="rd_paid".$row['jr_id'];
                                  +00531         $w->selected=($row['jr_rapt']=='paid')?true:false;
                                  +00532         // if p_paid == 2 then readonly
                                  +00533         $w->readonly=( $p_paid == 2)?true:false;
                                  +00534         $h=new widget("hidden");
                                  +00535         $h->name="set_jr_id".$row['jr_id'];
                                  +00536         $r.='<TD>'.$w->IOValue().$h->IOValue().'</TD>';
                                  +00537       }
                                  +00538     
                                  +00539     // Rapprochement
                                  +00540     $a=GetConcerned($p_cn,$row['jr_id']);
                                  +00541     $r.="<TD>";
                                  +00542     if ( $a != null ) {
                                  +00543       // $r.="operation concernée ";
                                  +00544       
                                  +00545       foreach ($a as $key => $element) 
                                  +00546       {      
                                  +00547               $r.= "<A class=\"detail\" HREF=\"javascript:viewDetail('".GetGrpt($p_cn,$element)."','$l_sessid')\" > ".GetInternal($p_cn,$element)."</A>";
                                  +00548       }//for
                                  +00549     }// if ( $a != null ) {
                                  +00550     $r.="</TD>";
                                  +00551 
                                  +00552     if ( $row['jr_valid'] == 'f'  ) {
                                  +00553       $r.="<TD> Opération annulée</TD>";
                                  +00554     }    else {
                                  +00555       // all operations can be removed either by setting to 0 the amount
                                  +00556       // or by writing the opposite operation if the period is closed
                                  +00557       $r.="<TD>";
                                  +00558       // cancel operation
                                  +00559       $r.=sprintf('<input TYPE="BUTTON" VALUE="%s" onClick="cancelOperation(\'%s\',\'%s\',\'%s\')">',
                                  +00560                   "Annuler",$row['jr_grpt_id'],$l_sessid,$p_jrn);
                                  +00561       $r.="</TD>";
                                  +00562     } // else
                                  +00563     //document
                                  +00564     $r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s">%s</A>',
                                  +00565                        $p_jrn,
                                  +00566                        $row['jr_grpt_id'],
                                  +00567                        $row['jr_pj_name'])."</TD>";
                                  +00568     
                                  +00569     // end row
                                  +00570     $r.="</tr>";
                                  +00571     
                                  +00572   }
                                  +00573   $r.="</table>";
                                  +00574   
                                  +00575 return array ($count,$r);
                                  +00576 }
                                  +
                                  +

                                  +

                                  @@ -1071,7 +1699,15 @@ parm :

                                    Definition at line 811 of file user_common.php.

                                    -References $Res, ExecSql(), FormatString(), and p_comment. +References $Res, ExecSql(), FormatString(), and p_comment.

                                    00811                                                    {
                                    +00812   $p_comment=FormatString($p_comment);
                                    +00813   $Res=ExecSql($p_cn,"update jrn set jr_comment='".$p_comment."'
                                    +00814                                where jr_id = $p_jr_id"); 
                                    +00815 
                                    +00816 }
                                    +
                                    +

                                    +

                                    @@ -1131,7 +1767,41 @@ Definition at line 654

                                    References $msg, cmpDate(), echo_debug(), echo_error(), GetPeriode(), isDate(), and PeriodeClosed().

                                    -Referenced by FormODS(). +Referenced by FormODS().

                                    00654                                                        {
                                    +00655 
                                    +00656   // Verify the date
                                    +00657   if ( isDate($p_date) == null ) { 
                                    +00658           echo_error("Invalid date $p_date");
                                    +00659           echo_debug('user_common.php',__LINE__,"Invalid date $p_date");
                                    +00660           echo "<SCRIPT> alert('INVALID DATE $p_date !!!!');</SCRIPT>";
                                    +00661           return null;
                                    +00662                 }
                                    +00663 // userPref contient la periode par default
                                    +00664     list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                    +00665 
                                    +00666     // Date dans la periode active
                                    +00667     echo_debug ("date start periode $l_date_start date fin periode $l_date_end date demandée $p_date");
                                    +00668     if ( cmpDate($p_date,$l_date_start)<0 || 
                                    +00669          cmpDate($p_date,$l_date_end)>0 )
                                    +00670       {
                                    +00671                   $msg="Not in the active periode please change your preference";
                                    +00672                         echo_error($msg); echo_error($msg);     
                                    +00673                         echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                    +00674                         return null;
                                    +00675       }
                                    +00676     // Periode fermée 
                                    +00677     if ( PeriodeClosed ($p_cn,$p_periode)=='t' )
                                    +00678       {
                                    +00679                 $msg="This periode is closed please change your preference";
                                    +00680                 echo_error($msg); echo_error($msg);     
                                    +00681                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                    +00682                 return null;
                                    +00683       }
                                    +00684     return $p_date;
                                    +00685 }
                                    +
                                    +

                                    +

                                    @@ -1180,10 +1850,18 @@ $p_f_id fiche.f_id gen :

                                      Definition at line 631 of file user_common.php.

                                      -References $a, and getFicheAttribut(). +References $a, and getFicheAttribut().

                                      00632 {
                                      +00633   $a=getFicheAttribut($p_cn,$p_f_id, ATTR_DEF_STOCK);
                                      +00634   if ( $a == "1" ) return true;
                                      +00635   return false;
                                      +00636 
                                      +00637 }
                                      +
                                      +

                                      + -


                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__compta_8php-source.html b/doc/developper/html/user__compta_8php-source.html index d46486acc..7b37f9866 100644 --- a/doc/developper/html/user__compta_8php-source.html +++ b/doc/developper/html/user__compta_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_compta.php Source File +phpcompta: user_compta.php Source File +html

                                      user_compta.php

                                      Go to the documentation of this file.
                                      00001 <?
                                       00002 /*
                                       00003  *   This file is part of PHPCOMPTA
                                      @@ -74,7 +74,7 @@
                                       00069 html_page_stop();
                                       00070 
                                       00071 ?>
                                      -

                                      Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__compta_8php.html b/doc/developper/html/user__compta_8php.html index 55cebc3f7..506cd479d 100644 --- a/doc/developper/html/user__compta_8php.html +++ b/doc/developper/html/user__compta_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_compta.php File Reference +phpcompta: user_compta.php File Reference +html

                                      user_compta.php File Reference

                                      main page of the accountancy module More...

                                      @@ -129,7 +129,7 @@ Definition at line 28< Definition at line 30 of file user_compta.php. -


                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__ach_8php-source.html b/doc/developper/html/user__form__ach_8php-source.html index ca5a3ef9b..41411dabc 100644 --- a/doc/developper/html/user__form__ach_8php-source.html +++ b/doc/developper/html/user__form__ach_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ach.php Source File +phpcompta: user_form_ach.php Source File +include

                                      user_form_ach.php

                                      Go to the documentation of this file.
                                      00001 <?
                                       00002 /*
                                       00003  *   This file is part of PhpCompta.
                                      @@ -249,7 +249,7 @@
                                       00269 function form_verify_input($p_cn,$p_jrn,$p_periode,$p_array,$p_number)
                                       00270 {
                                       00271   echo_debug('user_form_ach.php',__LINE__,"Enter form_verify_input $p_cn,$p_jrn,$p_periode,".var_export($p_array,true).",$p_number");
                                      -00272   foreach ($p_array as $name=>$content) {
                                      +00272   foreach ($p_array as $name=>$content) {
                                       00273     ${"$name"}=$content;
                                       00274   }
                                       00275   // Verify the date
                                      @@ -441,8 +441,8 @@
                                       00475   // Keep all the data if hidden
                                       00476   // and store the array in variables
                                       00477   $hidden=new widget("hidden");
                                      -00478   foreach ($p_array as $name=>$content) {
                                      -00479     $data.=$hidden->IOValue($name,$content);
                                      +00478   foreach ($p_array as $name=>$content) {
                                      +00479     $data.=$hidden->IOValue($name,$content);
                                       00480     ${"$name"}=$content;
                                       00481   }
                                       00482   
                                      @@ -773,7 +773,7 @@
                                       00836 }
                                       00837 
                                       00838 ?>
                                      -

                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__ach_8php.html b/doc/developper/html/user__form__ach_8php.html index 304d5b5bd..2794bc1ae 100644 --- a/doc/developper/html/user__form__ach_8php.html +++ b/doc/developper/html/user__form__ach_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ach.php File Reference +phpcompta: user_form_ach.php File Reference +include

                                      user_form_ach.php File Reference

                                      Functions for the ledger of expenses. More...

                                      @@ -101,7 +101,196 @@ verify if the data to insert are valid

                                      Definition at line 269 of file user_form_ach.php.

                                      -References $msg, CountSql(), echo_debug(), echo_error(), isDate(), isNumber(), and name. +References $msg, CountSql(), echo_debug(), echo_error(), isDate(), isNumber(), and name.

                                      00270 {
                                      +00271   echo_debug('user_form_ach.php',__LINE__,"Enter form_verify_input $p_cn,$p_jrn,$p_periode,".var_export($p_array,true).",$p_number");
                                      +00272   foreach ($p_array as $name=>$content) {
                                      +00273     ${"$name"}=$content;
                                      +00274   }
                                      +00275   // Verify the date
                                      +00276   if ( isDate($e_date) == null ) 
                                      +00277     { 
                                      +00278       echo_error("Invalid date $e_date");
                                      +00279       echo_debug('user_form_ach.php',__LINE__,"Invalid date $e_date");
                                      +00280       echo "<SCRIPT> alert('INVALID DATE $e_date !!!!');</SCRIPT>";
                                      +00281       return null;
                                      +00282     }
                                      +00283 // Verify the quantity
                                      +00284   for ($o = 0;$o < $p_number; $o++) 
                                      +00285     {
                                      +00286       if ( isNumber(${"e_quant$o"}) == 0 ) 
                                      +00287         {
                                      +00288           echo_debug('user_form_ach.php',__LINE__,"invalid quantity ".${"e_quant$o"});
                                      +00289           echo_error("invalid quantity ".${"e_quant$o"});
                                      +00290           echo "<SCRIPT> alert('INVALID QUANTITY !!!');</SCRIPT>";
                                      +00291           return null;
                                      +00292         }       
                                      +00293     // check if vat is correct
                                      +00294     if ( strlen(trim(${"e_march$o"."_tva_id"})) !=0 
                                      +00295          and 
                                      +00296          ${"e_march$o"."_tva_id"} != "-1")
                                      +00297       {
                                      +00298       // vat is given we check it now check if valid
                                      +00299       if (isNumber(${"e_march$o"."_tva_id"}) == 0
                                      +00300                or CountSql($p_cn,"select tva_id from tva_rate where tva_id=".${"e_march$o"."_tva_id"}) ==0)
                                      +00301         {
                                      +00302           $msg="Invalid TVA !!! e_march".$o."_tva_id = ".${"e_march".$o."_tva_id"};
                                      +00303           echo_error($msg); echo_error($msg);   
                                      +00304           echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00305           return null;
                                      +00306         
                                      +00307         }
                                      +00308       }
                                      +00309     
                                      +00310     }
                                      +00311 
                                      +00312   // Verify the ech
                                      +00313  if (strlen($e_ech) != 0 and isNumber($e_ech)  == 0 and  isDate ($e_ech) == null ) 
                                      +00314    {
                                      +00315      $msg="Echeance invalide";
                                      +00316      echo_error($msg); echo_error($msg);        
                                      +00317      echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00318      return null;
                                      +00319    } 
                                      +00320  // Verify is a client is set
                                      +00321 //  if ( isNumber($e_client)    == 0) 
                                      +00322 //    {
                                      +00323 //      $msg="Client inexistant";
                                      +00324 //      echo_error($msg); echo_error($msg);     
                                      +00325 //      echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00326 //      return null;
                                      +00327 //    }
                                      +00328 
                                      +00329  // if ech is a number of days then compute date limit
                                      +00330  if ( strlen($e_ech) != 0 and isNumber($e_ech) == 1) 
                                      +00331    {
                                      +00332      list($day,$month,$year)=explode(".",$e_date);
                                      +00333      echo_debug('user_form_ach.php',__LINE__," date $e_date = $day.$month.$year");
                                      +00334      $p_ech=date('d.m.Y',mktime(0,0,0,$month,$day+$e_ech,$year));
                                      +00335      echo_debug('user_form_ach.php',__LINE__,"p_ech = $e_ech $p_ech");
                                      +00336      $e_ech=$p_ech;
                                      +00337      $wHidden=new widget("hidden");
                                      +00338      $data.=$wHidden->IOValue("e_ech",$e_ech);
                                      +00339 # $data.=InputType("","HIDDEN","e_ech",$e_ech);
                                      +00340    }
                                      +00341 
                                      +00342  // Check if the fiche is in the jrn
                                      +00343  if (IsFicheOfJrn($p_cn , $p_jrn, $e_client,'cred') == 0 ) 
                                      +00344    {
                                      +00345      $msg="Client invalid please recheck";
                                      +00346      echo_error($msg);
                                      +00347      echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00348      return null;
                                      +00349    }
                                      +00350 
                                      +00351  // check if all e_march are in fiche
                                      +00352   for ($i=0;$i<$p_number;$i++) 
                                      +00353     {
                                      +00354       if ( trim(${"e_march$i"})  == "" ) {
                                      +00355         // no goods to sell 
                                      +00356         continue;
                                      +00357     }
                                      +00358   
                                      +00359 //     // Check wether the f_id is a number
                                      +00360 //     if ( isNumber(${"e_march$i"}) == 0 ) {
                                      +00361 //       $msg="Fiche inexistante !!! ";
                                      +00362 //       echo_error($msg); echo_error($msg);    
                                      +00363 //       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00364 //       return null;
                                      +00365 //     }
                                      +00366     // Check 
                                      +00367     if ( isFicheOfJrn($p_cn,$p_jrn,${"e_march$i"},'deb') == 0 ) {
                                      +00368       $msg="Fiche inexistante !!! ";
                                      +00369       echo_error($msg); echo_error($msg);       
                                      +00370       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00371       return null;
                                      +00372     }
                                      +00373     // check if the  ATTR_DEF_ACCOUNT is set
                                      +00374     $poste=GetFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_ACCOUNT);
                                      +00375     echo_debug('user_form_ach.php',__LINE__,"poste value = ".$poste."size = ".strlen(trim($poste)));
                                      +00376     if ( $poste == null ) 
                                      +00377       { 
                                      +00378         $msg="La fiche ".${"e_march$i"}." n\'a pas de poste comptable";
                                      +00379         echo_error($msg); echo_debug('user_form_ach.php',__LINE__,$msg);        
                                      +00380         echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00381         return null;
                                      +00382         
                                      +00383       }
                                      +00384     if ( strlen(trim($poste))==0 )
                                      +00385       {
                                      +00386         $msg="La fiche ".${"e_march$i"}." n\'a pas de poste comptable";
                                      +00387         echo_error($msg); echo_debug('user_form_ach.php',__LINE__,$msg);                
                                      +00388         echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00389         return null;
                                      +00390       }
                                      +00391     
                                      +00392     // Check if the percentage indicated in this field is valid
                                      +00393     $non_dedu=GetFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_DEPENSE_NON_DEDUCTIBLE);
                                      +00394     if ( $non_dedu != null && strlen(trim($non_dedu)) != 0 )
                                      +00395       {
                                      +00396         if ( isNumber($non_dedu) == 0 || $non_dedu > 1.00 ) 
                                      +00397           {
                                      +00398             $msg="La fiche ".${"e_march$i"}." a un pourcentage invalide,il doit être compris entre 0 et 1";
                                      +00399                         echo_error($msg); echo_debug('user_form_ach.php',__LINE__,$msg);        
                                      +00400                         echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00401                         return null;
                                      +00402                 
                                      +00403                 }
                                      +00404         }
                                      +00405     // Check if the percentage indicated in this field is valid
                                      +00406     $non_dedu=GetFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_TVA_NON_DEDUCTIBLE);
                                      +00407     if ( $non_dedu != null && strlen(trim($non_dedu)) != 0 )
                                      +00408       {
                                      +00409         if ( isNumber($non_dedu) == 0 || $non_dedu > 1.00 ) 
                                      +00410           {
                                      +00411             $msg="La fiche ".${"e_march$i"}." a un pourcentage invalide, il doit être compris entre 0 et 1";
                                      +00412             echo_error($msg); echo_debug('user_form_ach.php',__LINE__,$msg);    
                                      +00413             echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00414             return null;
                                      +00415             
                                      +00416           }
                                      +00417       } // Check if the percentage indicated in this field is valid
                                      +00418     $non_dedu=GetFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP);
                                      +00419     if ( $non_dedu != null && strlen(trim($non_dedu)) != 0 )
                                      +00420         {
                                      +00421           if ( isNumber($non_dedu) == 0 || $non_dedu > 1.00 ) 
                                      +00422             {
                                      +00423               $msg="La fiche ".${"e_march$i"}." a un pourcentage invalide, il doit être compris entre 0 et 1";
                                      +00424               echo_error($msg); echo_debug('user_form_ach.php',__LINE__,$msg);  
                                      +00425               echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00426               return null;
                                      +00427               
                                      +00428             }
                                      +00429         }
                                      +00430     
                                      +00431     }
                                      +00432 // Verify the userperiode
                                      +00433 
                                      +00434 // p_periode contient la periode par default
                                      +00435   list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                      +00436   
                                      +00437   // Date dans la periode active
                                      +00438   echo_debug ('user_form_ach',__LINE__,"date start periode $l_date_start date fin periode $l_date_end date demande $e_date");
                                      +00439   if ( cmpDate($e_date,$l_date_start)<0 || 
                                      +00440        cmpDate($e_date,$l_date_end)>0 )
                                      +00441     {
                                      +00442       $msg="Not in the active periode please change your preference";
                                      +00443       echo_error($msg); echo_error($msg);       
                                      +00444       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00445       return null;
                                      +00446     }
                                      +00447     // Periode fermé
                                      +00448     if ( PeriodeClosed ($p_cn,$p_periode)=='t' )
                                      +00449       {
                                      +00450                 $msg="This periode is closed please change your preference";
                                      +00451                 echo_error($msg); echo_error($msg);     
                                      +00452                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00453                 return null;
                                      +00454       }
                                      +00455     return true;
                                      +00456 }
                                      +
                                      +

                                      +

                                      @@ -184,7 +373,221 @@ Display the form for a sell Used to show detail, encode a new invoice or update

                                      Definition at line 44 of file user_form_ach.php.

                                      -References $fiche, $h, $list, $msg, $p_jrn, $r, $sql, echo_debug(), echo_error(), exit, GetArray(), GetPeriode(), isNumber(), and make_array(). +References $fiche, $h, $list, $msg, $p_jrn, $r, $sql, echo_debug(), echo_error(), exit, GetArray(), GetPeriode(), isNumber(), and make_array().

                                      00045 { 
                                      +00046 echo_debug('user_form_ach.php',__LINE__,"Enter FormAchInput($p_cn,$p_jrn,$p_periode,$p_array,$p_submit,$pview_only,$p_article");
                                      +00047   if ( $p_array != null) {
                                      +00048     // array contains old value
                                      +00049     extract($p_array);
                                      +00050   }
                                      +00051   // The date
                                      +00052   list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                      +00053   $op_date=( ! isset($e_date) ) ?substr($l_date_start,2,8):$e_date;
                                      +00054   $e_ech=(isset($e_ech))?$e_ech:"";
                                      +00055   $e_comm=(isset($e_comm))?$e_comm:"";
                                      +00056 
                                      +00057   // Save old value and set a new one
                                      +00058   echo_debug('user_form_ach.php',__LINE__,"form_input.php.FormSell_op_date is $op_date");
                                      +00059   $r="";
                                      +00060   if ( $pview_only == false) {
                                      +00061     $r.=JS_SEARCH_CARD;
                                      +00062     $r.=JS_SHOW_TVA;    
                                      +00063     $r.=JS_TVA;
                                      +00064     // Compute href
                                      +00065     $href=$_SERVER['SCRIPT_NAME'];
                                      +00066     switch ($href)
                                      +00067       {
                                      +00068         // user_jrn.php
                                      +00069       case '/user_jrn.php':
                                      +00070         $href="user_jrn.php?action=new&p_jrn=$p_jrn";
                                      +00071         break;
                                      +00072       case '/commercial.php':
                                      +00073         $href="commercial.php?p_action=depense&p_jrn=$p_jrn";
                                      +00074         break;
                                      +00075       default:
                                      +00076         echo_error('user_form_ach.php',__LINE__,'Erreur invalid request uri');
                                      +00077         exit (-1);
                                      +00078       }
                                      +00079       
                                      +00080 
                                      +00081     //    $r.="<FORM NAME=\"form_detail\"  enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new&p_jrn=$p_jrn\" METHOD=\"POST\">";
                                      +00082     $r.="<FORM NAME=\"form_detail\"  enctype=\"multipart/form-data\" ACTION=\"$href\" METHOD=\"POST\">";
                                      +00083   }
                                      +00084 
                                      +00085   $sql="select jrn_def_id as value,jrn_def_name as label from jrn_def where jrn_def_type='VEN'";
                                      +00086   $list=GetArray($p_cn,$sql);
                                      +00087   $r.='<TABLE>';
                                      +00088   // Date widget
                                      +00089   //--
                                      +00090   $Date=new widget("text");
                                      +00091   $Date->SetReadOnly($pview_only);
                                      +00092   $Date->table=1;
                                      +00093   $r.="<tr>";
                                      +00094   $r.=$Date->IOValue("e_date",$op_date,"Date");
                                      +00095   $r.="</tr>";
                                      +00096   // Payment limit widget
                                      +00097   //--
                                      +00098   $Echeance=new widget("text");
                                      +00099   $Echeance->SetReadOnly($pview_only);
                                      +00100   $Echeance->table=1;
                                      +00101   $r.="<tr>";
                                      +00102   $r.=$Echeance->IOValue("e_ech",$e_ech,"Echeance");
                                      +00103   $r.="</tr>";
                                      +00104   // Comment
                                      +00105   //--
                                      +00106   $Commentaire=new widget("text");
                                      +00107   $Commentaire->table=1;
                                      +00108   $Commentaire->SetReadOnly($pview_only);
                                      +00109   $Commentaire->size=80;
                                      +00110   $r.="<tr>";
                                      +00111   $r.=$Commentaire->IOValue("e_comm",$e_comm,"Description");
                                      +00112   $r.="</tr>";
                                      +00113   include_once("fiche_inc.php");
                                      +00114   // Display the supplier
                                      +00115   //--
                                      +00116   $fiche='cred';
                                      +00117   echo_debug('user_form_ach.php',__LINE__,"Fournisseurs Nombre d'enregistrement ".sizeof($fiche));
                                      +00118   // Save old value and set a new one
                                      +00119   $e_client=( isset ($e_client) )?$e_client:"";
                                      +00120 
                                      +00121   $e_client_label="";  
                                      +00122 
                                      +00123   // retrieve e_client_label
                                      +00124   if ( isNumber($e_client) == 1 ) {
                                      +00125     if ( isFicheOfJrn($p_cn,$p_jrn,$e_client,'cred') == 0 ) {
                                      +00126       $msg="Fiche inexistante !!! ";
                                      +00127       echo_error($msg); echo_error($msg);       
                                      +00128       //      echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00129       $e_client="";
                                      +00130     } else {
                                      +00131       $a_client=GetFicheAttribut($p_cn,$e_client);
                                      +00132       if ( $a_client != null)   
                                      +00133           $e_client_label=$a_client['vw_name']."  adresse ".$a_client['vw_addr']."  ".$a_client['vw_cp'];
                                      +00134     }
                                      +00135   }
                                      +00136   // widget search
                                      +00137   $W1=new widget("js_search");
                                      +00138   $W1->label="Fournisseur";
                                      +00139   $W1->name="e_client";
                                      +00140   $W1->value=$e_client;
                                      +00141   $W1->extra=$fiche;  // list of card
                                      +00142   $W1->extra2=$p_jrn;
                                      +00143   $r.="<TR>".$W1->IOValue();
                                      +00144   $client_label=new widget("span");
                                      +00145   $r.= $client_label->IOValue("e_client_label",$e_client_label)."</TD></TR>";
                                      +00146   $r.="</TABLE>";
                                      +00147   // Set correctly the REQUEST param for jrn_type 
                                      +00148   $h=new widget('hidden');
                                      +00149   $h->name='jrn_type';
                                      +00150   $h->value='ACH';
                                      +00151   $r.=$h->IOValue();
                                      +00152 
                                      +00153   // Record the current number of article
                                      +00154   $Hid=new widget('hidden');
                                      +00155   $r.=$Hid->IOValue("nb_item",$p_article);
                                      +00156   $e_comment=(isset($e_comment))?$e_comment:"";
                                      +00157 
                                      +00158 
                                      +00159   // Start the div for item to sell
                                      +00160   $r.="<DIV>";
                                      +00161   $r.='<H2 class="info">Articles</H2>';
                                      +00162   $r.='<TABLE>';
                                      +00163   $r.='<TR>';
                                      +00164   $r.="<th></th>";
                                      +00165   $r.="<th>Code</th>";
                                      +00166   $r.="<th>Dénomination</th>";
                                      +00167   $r.="<th>prix</th>";
                                      +00168   $r.="<th>tva</th>";
                                      +00169   $r.="<th>quantité</th>";
                                      +00170   $r.='</TR>';
                                      +00171   // For each article
                                      +00172   // compute amount
                                      +00173   // verify if card exists
                                      +00174   // retrieve vat label
                                      +00175   //--
                                      +00176   for ($i=0;$i< $p_article;$i++) {
                                      +00177     // Code id
                                      +00178     $march=(isset(${"e_march$i"}))?${"e_march$i"}:"";
                                      +00179     $march_sell=(isset(${"e_march".$i."_sell"}))?${"e_march".$i."_sell"}:"";
                                      +00180     $march_tva_id=(isset(${"e_march$i"."_tva_id"}))?${"e_march$i"."_tva_id"}:"";
                                      +00181 
                                      +00182     $march_tva_label="";
                                      +00183     $march_label="";
                                      +00184 
                                      +00185     // If $march has a value
                                      +00186     if ( isFicheOfJrn($p_cn,$p_jrn,$march,'deb') == 0 ) {
                                      +00187         $msg="Fiche inexistante !!! ";
                                      +00188         echo_error($msg); echo_error($msg);     
                                      +00189         $march="";
                                      +00190     } else {
                                      +00191         // retrieve the tva label and name
                                      +00192       $a_fiche=GetFicheAttribut($p_cn, $march);
                                      +00193       if ( $a_fiche != null ) {
                                      +00194         if ( $march_tva_id == "" ) {
                                      +00195           $march_tva_id=$a_fiche['tva_id'];
                                      +00196           $march_tva_label=$a_fiche['tva_label'];
                                      +00197         }
                                      +00198         $march_label=$a_fiche['vw_name'];
                                      +00199       }
                                      +00200     }
                                      +00201   
                                      +00202     // Show input
                                      +00203 
                                      +00204     $W1=new widget("js_search");
                                      +00205     $W1->label="";
                                      +00206     $W1->name="e_march".$i;
                                      +00207     $W1->value=$march;
                                      +00208     $W1->extra='deb';  // credits
                                      +00209     $W1->extra2=$p_jrn;
                                      +00210     $W1->readonly=$pview_only;
                                      +00211     $r.="<TR>".$W1->IOValue()."</TD>";
                                      +00212     $Span=new widget ("span");
                                      +00213     $Span->SetReadOnly($pview_only);
                                      +00214     // card's name
                                      +00215     $r.="<TD>".$Span->IOValue("e_march".$i."_label",$march_label)."</TD>";
                                      +00216    // price
                                      +00217     $Price=new widget("text");
                                      +00218     $Price->SetReadOnly($pview_only);
                                      +00219     $Price->table=1;
                                      +00220     $r.=$Price->IOValue("e_march".$i."_sell",$march_sell);
                                      +00221     // vat label
                                      +00222     $select_tva=make_array($p_cn,"select tva_id,tva_label from tva_rate order by tva_id",1);
                                      +00223     $Tva=new widget("select");
                                      +00224     $Tva->table=1;
                                      +00225     $Tva->selected=$march_tva_id;
                                      +00226     $r.=$Tva->IOValue("e_march$i"."_tva_id",$select_tva);
                                      +00227 
                                      +00228     // quantity
                                      +00229     $quant=(isset(${"e_quant$i"}))?${"e_quant$i"}:"1";
                                      +00230     $Quantity=new widget("text");
                                      +00231     $Quantity->SetReadOnly($pview_only);
                                      +00232     $Quantity->table=1;
                                      +00233     $r.=$Quantity->IOValue("e_quant".$i,$quant);
                                      +00234     $r.='</TR>';
                                      +00235   }
                                      +00236 
                                      +00237 
                                      +00238 
                                      +00239   $r.="</TABLE>";
                                      +00240   $r.="<hr>";
                                      +00241 
                                      +00242   if ($pview_only == false ) {
                                      +00243     $r.=$p_submit;
                                      +00244     $r.="</DIV>";
                                      +00245     $r.="</FORM>";
                                      +00246   } else {
                                      +00247      $r.="</div>";
                                      +00248 
                                      +00249   }
                                      +00250 
                                      +00251 
                                      +00252 
                                      +00253   return $r;
                                      +00254 
                                      +00255 
                                      +00256 }
                                      +
                                      +

                                      +

                                      @@ -267,7 +670,168 @@ Show the invoice before inserting it the database.

                                      Definition at line 471 of file user_form_ach.php.

                                      -References $data, $file, $h, $r, echo_error(), exit, getFicheAttribut(), getFicheName(), GetTvaRate(), isNumber(), METHOD, and name. +References $data, $file, $h, $r, echo_error(), exit, getFicheAttribut(), getFicheName(), GetTvaRate(), isNumber(), METHOD, and name.

                                      00472 {
                                      +00473   $r="";
                                      +00474   $data="";
                                      +00475   // Keep all the data if hidden
                                      +00476   // and store the array in variables
                                      +00477   $hidden=new widget("hidden");
                                      +00478   foreach ($p_array as $name=>$content) {
                                      +00479     $data.=$hidden->IOValue($name,$content);
                                      +00480     ${"$name"}=$content;
                                      +00481   }
                                      +00482   
                                      +00483   // start table
                                      +00484   $r.='<TABLE>';
                                      +00485   // Show the Date
                                      +00486   $r.="<tr>";
                                      +00487   $r.="<TD>Date : $e_date</TD>";
                                      +00488   $r.="</tr>";
                                      +00489   // Show the customer Name
                                      +00490   $r.="<tr>";
                                      +00491   $r.="<TD>Client : ".getFicheName($p_cn,$e_client)."</TD>";
                                      +00492   $r.="</tr>";
                                      +00493   
                                      +00494   // show date limit
                                      +00495   $r.="<tr>";
                                      +00496   $r.="<TD> Echeance : $e_ech </TD>";
                                      +00497   $r.="</tr>";
                                      +00498   // Show desc
                                      +00499   $r.="<tr>";
                                      +00500   $r.="<TD> Description : $e_comm</TD>";
                                      +00501   $r.="</tr>";
                                      +00502   
                                      +00503   $sum_with_vat=0.0;
                                      +00504   $sum_march=0.0;
                                      +00505   // show all article, price vat and sum
                                      +00506   $r.="<TR>";
                                      +00507   $r.="<TH>Article</TH>";
                                      +00508   $r.="<TH>quantité</TH>";
                                      +00509   $r.="<TH>prix unit.</TH>";
                                      +00510   $r.="<TH>taux tva</TH>";
                                      +00511   $r.="<TH>Montant HTVA</TH>";
                                      +00512   $r.="<TH>Montant TVA</TH>";
                                      +00513   $r.="<TH>Total</TH>";
                                      +00514   $r.="</TR>";
                                      +00515   for ($i=0;$i<$p_number;$i++) 
                                      +00516     {
                                      +00517       if ( trim(${"e_march$i"})  == "" ) 
                                      +00518         {
                                      +00519           // no goods to sell 
                                      +00520           continue;
                                      +00521         }
                                      +00522       
                                      +00523       // Get the name
                                      +00524       $fiche_name=getFicheName($p_cn,${"e_march$i"});
                                      +00525       
                                      +00526       // Quantity
                                      +00527       $fiche_quant=${"e_quant$i"};
                                      +00528       
                                      +00529       // No  row if there is quantity
                                      +00530       if ( $fiche_quant == 0.0 ) continue;
                                      +00531       
                                      +00532 
                                      +00533       // If the price is not a number, retrieve the price from the database
                                      +00534       if ( isNumber(${"e_march$i"."_sell"}) == 0 ) {
                                      +00535         $fiche_price=getFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_PRIX_VENTE);
                                      +00536       } else {
                                      +00537         $fiche_price=${"e_march$i"."_sell"};
                                      +00538       }
                                      +00539       
                                      +00540     
                                      +00541       // VAT 
                                      +00542       $vat=(isNumber(${"e_march$i"."_tva_id"})==0 || ${"e_march$i"."_tva_id"}==-1 )?getFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_TVA):${"e_march$i"."_tva_id"};
                                      +00543       
                                      +00544     // vat label
                                      +00545     // vat rate
                                      +00546       $a_vat=GetTvaRate($p_cn,$vat);
                                      +00547       if ( $a_vat == null ) 
                                      +00548         {
                                      +00549           $vat_label="";
                                      +00550           $vat_rate=0.0;
                                      +00551         } 
                                      +00552       else 
                                      +00553         { 
                                      +00554           $vat_label=$a_vat['tva_label'];
                                      +00555           $vat_rate=$a_vat['tva_rate'];
                                      +00556         }               
                                      +00557       
                                      +00558       // Total card without vat
                                      +00559       $fiche_sum=$fiche_price*$fiche_quant;
                                      +00560       // Sum of invoice
                                      +00561       $sum_march+=$fiche_sum;
                                      +00562       // vat of the card
                                      +00563       $fiche_amount_vat=$fiche_price*$fiche_quant*$vat_rate;
                                      +00564       // value card + vat
                                      +00565       $fiche_with_vat=$fiche_price*$fiche_quant*(1+$vat_rate);
                                      +00566       // Sum of invoice vat 
                                      +00567       $sum_with_vat+=$fiche_with_vat;
                                      +00568       // Show the data
                                      +00569       $r.='<TR>';
                                      +00570       $r.='<TD>'.$fiche_name.'</TD>';
                                      +00571       $r.='<TD ALIGN="CENTER">'.$fiche_quant.'</TD>';
                                      +00572       $r.='<TD ALIGN="right">'.$fiche_price.'</TD>';
                                      +00573       $r.="<TD  ALIGN=\"RIGHT\"> $vat_label </TD>";
                                      +00574       $r.='<TD  ALIGN="RIGHT">'.round($fiche_sum,2).'</TD>';
                                      +00575       $r.='<TD ALIGN="RIGHT">'.round($fiche_amount_vat,2).'</TD>';
                                      +00576       
                                      +00577       $r.='<TD>'.round($fiche_with_vat,2).'</TD>';
                                      +00578 
                                      +00579       $r.="</TR>";
                                      +00580     }
                                      +00581   
                                      +00582   // end table
                                      +00583   $r.='</TABLE> ';
                                      +00584   $r.='<DIV style="padding:30px;font-size:14px">';
                                      +00585   $r.="Total HTVA =".round( $sum_march,2)." <br>";
                                      +00586   $r.="Total = ".round($sum_with_vat,2);
                                      +00587 
                                      +00588  
                                      +00589   $r.="</DIV>";
                                      +00590   // Compute href
                                      +00591   $href=$_SERVER['SCRIPT_NAME'];
                                      +00592   switch ($href)
                                      +00593     {
                                      +00594       // user_jrn.php
                                      +00595     case '/user_jrn.php':
                                      +00596       $href="user_jrn.php?action=new&p_jrn=$p_jrn";
                                      +00597       break;
                                      +00598     case '/commercial.php':
                                      +00599       $href="commercial.php?p_action=depense&p_jrn=$p_jrn";
                                      +00600       break;
                                      +00601     default:
                                      +00602       echo_error('user_form_ach.php',__LINE__,'Erreur invalid request uri');
                                      +00603       exit (-1);
                                      +00604     }
                                      +00605 
                                      +00606   //  $r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="user_jrn.php?action=new&p_jrn='.$p_jrn.'">';
                                      +00607   $r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="'.$href.'">';
                                      +00608   // check for upload piece
                                      +00609   // Set correctly the REQUEST param for jrn_type 
                                      +00610   $h=new widget('hidden');
                                      +00611   $h->name='jrn_type';
                                      +00612   $h->value=$_REQUEST['jrn_type'];
                                      +00613   $r.=$h->IOValue();
                                      +00614 
                                      +00615   $file=new widget("file");
                                      +00616   $file->table=1;
                                      +00617   $r.="<hr>";
                                      +00618   $r.= "<table>"; 
                                      +00619   if ( $p_piece) $r.="<TR>".$file->IOValue("pj","","Pièce justificative")."</TR>";
                                      +00620   $r.="</table>";
                                      +00621   $r.="<hr>";
                                      +00622   
                                      +00623   $r.=$data;
                                      +00624   $r.=$p_submit;
                                      +00625   
                                      +00626   $r.='</FORM>';
                                      +00627   
                                      +00628   return $r;
                                      +00629   
                                      +00630 }
                                      +
                                      +

                                      +

                                      @@ -329,10 +893,187 @@ $p_array contains all the invoice data e_date => e : 01.01.2003 e_client =>

                                      Definition at line 661 of file user_form_ach.php.

                                      -References $comment, $e, $i, $poste, $r, $Res, $seq, Commit(), ComputeTotalVat(), ComputeVat(), echo_debug(), ExecSql(), exit, FormatString(), GetTvaPoste(), InsertJrn(), InsertJrnx(), InsertStockGoods(), isNumber(), NextSequence(), Rollback(), save_upload_document(), SetInternalCode(), and StartSql(). +References $comment, $e, $i, $poste, $r, $Res, $seq, Commit(), ComputeTotalVat(), ComputeVat(), echo_debug(), ExecSql(), exit, FormatString(), GetTvaPoste(), InsertJrn(), InsertJrnx(), InsertStockGoods(), isNumber(), NextSequence(), Rollback(), save_upload_document(), SetInternalCode(), and StartSql().

                                      00662 {
                                      +00663   echo_debug('user_form_ach',__LINE__,"function RecordSell($p_cn,$p_array,$p_user,$p_jrn)");
                                      +00664   foreach ( $p_array as $v => $e)
                                      +00665   {
                                      +00666     ${"$v"}=$e;
                                      +00667   }
                                      +00668 
                                      +00669   // Get the default period
                                      +00670   $periode=$p_user->GetPeriode();
                                      +00671   $amount=0.0;
                                      +00672   $amount_jrn=0.0;
                                      +00673   $sum_tva_nd=0.0;
                                      +00674   // Computing total customer
                                      +00675   for ($i=0;$i<$nb_item;$i++) {
                                      +00676     // store quantity & goods in array
                                      +00677     $a_good[$i]=${"e_march$i"};
                                      +00678     $a_quant[$i]=${"e_quant$i"};
                                      +00679     $a_price[$i]=0;
                                      +00680     $a_vat_good[$i]=${"e_march$i"."_tva_id"};
                                      +00681     // check wether the price is set or no
                                      +00682     if ( isNumber(${"e_march$i"."_sell"}) == 0 ) {
                                      +00683       if ( $a_good[$i] !="" ) {
                                      +00684              // If the price is not set we have to find it from the database
                                      +00685              $a_price[$i]=GetFicheAttribut($p_cn,$a_good[$i],ATTR_DEF_PRIX_VENTE);
                                      +00686            } 
                                      +00687     } else {
                                      +00688       // The price is valid
                                      +00689       $a_price[$i]=${"e_march$i"."_sell"};
                                      +00690     }
                                      +00691     $cost=$a_price[$i]*$a_quant[$i];
                                      +00692     $amount+=$cost;
                                      +00693     $amount_jrn+=$cost;
                                      +00694     echo_debug('user_form_ach.php',__LINE__,'Total customer:'.$amount_jrn);
                                      +00695   }
                                      +00696   //  $amount_jrn=round(
                                      +00697   $comm=FormatString($e_comm);
                                      +00698 
                                      +00699   // Compute vat with ded
                                      +00700   echo_debug('user_form_achat.php',__LINE__,"Call ComputeTotalVat");
                                      +00701   $a_vat=ComputeTotalVat($p_cn,$a_good,$a_quant,$a_price,$a_vat_good,false);
                                      +00702         
                                      +00703   StartSql($p_cn);      
                                      +00704 
                                      +00705   // Compute the j_grpt
                                      +00706   $seq=NextSequence($p_cn,'s_grpt');
                                      +00707 
                                      +00708 
                                      +00709 
                                      +00710   // Credit = goods 
                                      +00711   for ( $i = 0; $i < $nb_item;$i++) {
                                      +00712 
                                      +00713     $poste=GetFicheAttribut($p_cn,$a_good[$i],ATTR_DEF_ACCOUNT);
                                      +00714           
                                      +00715     // don't record operation of 0
                                      +00716     if ( $a_price[$i]*$a_quant[$i] == 0 ) continue;
                                      +00717 
                                      +00718     $amount=$a_price[$i]*$a_quant[$i];
                                      +00719     // Put the non deductible part into a special account
                                      +00720     $non_dedu=GetFicheAttribut($p_cn,$a_good[$i],ATTR_DEF_DEPENSE_NON_DEDUCTIBLE);
                                      +00721     echo_debug('user_form_ach.php',__LINE__,"value non ded : $non_dedu");
                                      +00722     if ( $non_dedu != null && strlen(trim($non_dedu)) != 0)
                                      +00723       {
                                      +00724         $nd_amount=round($a_quant[$i]*$a_price[$i]*$non_dedu,2);
                                      +00725 
                                      +00726         // save it
                                      +00727           echo_debug('user_form_ach.php',__LINE__,"InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,'6740',$e_date,round($nd_amount,2),$seq,$periode);");
                                      +00728           $dna=new parm_code($p_cn,'DNA');
                                      +00729         $j_id=InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$dna->p_value,$e_date,round($nd_amount,2),$seq,$periode);
                                      +00730         if ( $j_id == false) { Rollback($p_cn);exit("error 'user_form_ach.php' __LINE__");}
                                      +00731         $amount=$amount-$nd_amount;
                                      +00732       }
                                      +00733     // Put the non deductible part into a special account
                                      +00734     $non_dedu=GetFicheAttribut($p_cn,$a_good[$i],ATTR_DEF_TVA_NON_DEDUCTIBLE);
                                      +00735     echo_debug('user_form_ach.php',__LINE__,"TVA value non ded : $non_dedu");
                                      +00736     if ( $non_dedu != null && strlen(trim($non_dedu)) != 0)
                                      +00737       {
                                      +00738         $lvat=ComputeVat($p_cn, $a_good[$i],$a_quant[$i],$a_price[$i],
                                      +00739                             $a_vat_good[$i] );
                                      +00740         $ded_vat=($lvat != null )?$lvat*$non_dedu:0;
                                      +00741         $ded_vat=round($ded_vat,2);
                                      +00742         $sum_tva_nd+=$ded_vat;
                                      +00743 
                                      +00744         // compute the NDA TVA
                                      +00745         $tva_dna=new parm_code($p_cn,'TVA_DNA');
                                      +00746         echo_debug('user_form_ach.php',__LINE__,
                                      +00747                    "InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,".$tva_dna->p_value.",$e_date,round($ded_vat,2),$seq,$periode);");
                                      +00748 
                                      +00749         $j_id=InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$tva_dna->p_value,$e_date,round($ded_vat,2),$seq,$periode);
                                      +00750         if ( $j_id == false) { Rollback($p_cn);exit("error 'user_form_ach.php' __LINE__");}
                                      +00751       }
                                      +00752     
                                      +00753     // Put the non deductible part into a special account
                                      +00754     $non_dedu=GetFicheAttribut($p_cn,$a_good[$i],ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP);
                                      +00755     echo_debug('user_form_ach.php',__LINE__,"TVA value non ded : $non_dedu");
                                      +00756     if ( $non_dedu != null && strlen(trim($non_dedu)) != 0 )
                                      +00757         {
                                      +00758           $lvat=ComputeVat($p_cn,       $a_good[$i],$a_quant[$i],$a_price[$i],
                                      +00759                            $a_vat_good[$i] );
                                      +00760           $ded_vat=($lvat != null )?$lvat*$non_dedu:0;
                                      +00761           
                                      +00762           $sum_tva_nd+=round($ded_vat,2);
                                      +00763 
                                      +00764           // Save it 
                                      +00765           $tva_ded_impot=new parm_code($p_cn,'TVA_DED_IMPOT');
                                      +00766           echo_debug('user_form_ach.php',__LINE__,
                                      +00767                      "InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,".$tva_ded_impot->p_value.",$e_date,round($ded_vat,2),$seq,$periode);");
                                      +00768 
                                      +00769           $j_id=InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$tva_ded_impot->p_value,$e_date,round($ded_vat,2),$seq,$periode);
                                      +00770           if ( $j_id == false) { Rollback($p_cn);exit("error 'user_form_ach.php' __LINE__");}
                                      +00771         }
                                      +00772 
                                      +00773 
                                      +00774 
                                      +00775 
                                      +00776     // record into jrnx
                                      +00777     echo_debug('user_form_ach.php',__LINE__,"InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$poste,$e_date,round($amount,2),$seq,$periode);");
                                      +00778     $j_id=InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$poste,$e_date,round($amount,2),$seq,$periode);
                                      +00779     if ( $j_id == false) { Rollback($p_cn);exit("error 'user_form_ach.php' __LINE__");}
                                      +00780     // always save quantity but in withStock we can find what card need a stock management
                                      +00781     if (  InsertStockGoods($p_cn,$j_id,$a_good[$i],$a_quant[$i],'c') == false ) {
                                      +00782       $Rollback($p_cn);exit("error 'user_form_ach.php' __LINE__");}
                                      +00783         echo_debug('user_form_ach.php',__LINE__,"value non ded : ".$a_good[$i]."is");           
                                      +00784 
                                      +00785   }
                                      +00786 
                                      +00787   
                                      +00788   // Insert Vat
                                      +00789   $sum_tva=0.0;
                                      +00790   if ( $a_vat  !=  null  ) // no vat
                                      +00791 
                                      +00792     {
                                      +00793 
                                      +00794       echo_debug('user_form_ach',__LINE__,'a_vat = '.var_export($a_vat,true));
                                      +00795       foreach ($a_vat as $tva_id => $tva_amount ) 
                                      +00796         {
                                      +00797           echo_debug('user_form_ach',__LINE__," tva_amount = $tva_amount tva_id=$tva_id");
                                      +00798           $poste=GetTvaPoste($p_cn,$tva_id,'d');
                                      +00799           if ($tva_amount == 0 ) continue;
                                      +00800           echo_debug('user_form_ach',__LINE__,"InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$poste,$e_date,round($tva_amount,2),$seq,$periode);");
                                      +00801           $r=InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$poste,$e_date,round($tva_amount,2),$seq,$periode);
                                      +00802           if ( $r == false ) { Rollback($p_cn); exit(" Error 'user_form_ach.php' __LINE__");}
                                      +00803           $sum_tva+=round($tva_amount,2);
                                      +00804         }
                                      +00805     }
                                      +00806   echo_debug('user_form_ach.php',__LINE__,"echeance = $e_ech");
                                      +00807   echo_debug('user_form_ach.php',__LINE__,"sum_tva = $sum_tva");
                                      +00808   echo_debug('user_form_ach.php',__LINE__,"amount_jrn = $amount_jrn");
                                      +00809   echo_debug('user_form_ach.php',__LINE__,"sum_tva_nd = $sum_tva_nd");
                                      +00810 
                                      +00811   // Debit = client
                                      +00812   $poste=GetFicheAttribut($p_cn,$e_client,ATTR_DEF_ACCOUNT);
                                      +00813   echo_debug('user_form_achat.php',__LINE__,"get e_client $e_client poste $poste");
                                      +00814   echo_debug('user_form_achat.php',__LINE__,"insert client");
                                      +00815 
                                      +00816   $r=InsertJrnx($p_cn,'c',$p_user->id,$p_jrn,$poste,$e_date,round($amount_jrn+$sum_tva+$sum_tva_nd,2),$seq,$periode);
                                      +00817   if ( $r == false) { $Rollback($p_cn);exit("error 'user_form_ach.php' __LINE__");}
                                      +00818 
                                      +00819   $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"--",round($amount_jrn+$sum_tva+$sum_tva_nd,2),$seq,$periode);
                                      +00820   if ( $r == false ) { Rollback($p_cn); exit(" Error 'user_form_ach.php' __LINE__");}
                                      +00821   // Set Internal code and Comment
                                      +00822   $internal=SetInternalCode($p_cn,$seq,$p_jrn);
                                      +00823   $comment=(FormatString($e_comm) == null )?$internal." Fournisseur : ".GetFicheName($p_cn,$e_client):FormatString($e_comm);
                                      +00824 
                                      +00825   // Update and set the invoice's comment 
                                      +00826   $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
                                      +00827   if ( $Res == false ) { Rollback($p_cn); exit(" Error 'user_form_ach.php' __LINE__"); };
                                      +00828 
                                      +00829   if ( isset ($_FILES))
                                      +00830     save_upload_document($p_cn,$seq);
                                      +00831 
                                      +00832 
                                      +00833   Commit($p_cn);
                                      +00834 
                                      +00835   return array($internal,$comment);
                                      +00836 }
                                      +
                                      +

                                      + -


                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__fin_8php-source.html b/doc/developper/html/user__form__fin_8php-source.html index 9408cff43..7d3fdafe5 100644 --- a/doc/developper/html/user__form__fin_8php-source.html +++ b/doc/developper/html/user__form__fin_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_fin.php Source File +phpcompta: user_form_fin.php Source File +include

                                      user_form_fin.php

                                      Go to the documentation of this file.
                                      00001 <?
                                       00002 /*
                                       00003  *   This file is part of PhpCompta.
                                      @@ -34,7 +34,7 @@
                                       00025 require_once("user_common.php");
                                       00042 function form_verify_input($p_cn,$p_jrn,$p_periode,$p_array,$p_number)
                                       00043 {
                                      -00044   foreach ($p_array as $name=>$content) {
                                      +00044   foreach ($p_array as $name=>$content) {
                                       00045     ${"$name"}=$content;
                                       00046   }
                                       00047   // Verify the date
                                      @@ -170,7 +170,7 @@
                                       00193 
                                       00194 
                                       00195   include_once("fiche_inc.php");
                                      -00196   $r.='<INPUT TYPE="HIDDEN" name="nb_item" value="'.$p_item.'">';
                                      +00196   $r.='<INPUT TYPE="HIDDEN" name="nb_item" value="'.$p_item.'">';
                                       00197 
                                       00198   // bank_account operation
                                       00199   // Save old value and set a new one
                                      @@ -378,7 +378,7 @@
                                       00418       } else {
                                       00419         if ( sizeof($_FILES) != 0 ) 
                                       00420           {
                                      -00421             ExecSql($p_cn,"update jrn set jr_pj=".$oid.", jr_pj_name='".$_FILES['pj']['name']."', ".
                                      +00421             ExecSql($p_cn,"update jrn set jr_pj=".$oid.", jr_pj_name='".$_FILES['pj']['name']."', ".
                                       00422                 "jr_pj_type='".$_FILES['pj']['type']."'  where jr_grpt_id=$seq");
                                       00423           }
                                       00424       }
                                      @@ -389,7 +389,7 @@
                                       00429   return $internal_code;
                                       00430 }
                                       00431 ?>
                                      -

                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__fin_8php.html b/doc/developper/html/user__form__fin_8php.html index e5def23d5..1ad515262 100644 --- a/doc/developper/html/user__form__fin_8php.html +++ b/doc/developper/html/user__form__fin_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_fin.php File Reference +phpcompta: user_form_fin.php File Reference +include

                                      user_form_fin.php File Reference

                                      Functions for the financial ledger. More...

                                      @@ -98,7 +98,94 @@ verify if the data to insert are valid

                                      Definition at line 42 of file user_form_fin.php.

                                      -References $msg, $poste, echo_debug(), echo_error(), isDate(), IsFicheOfJrn(), isNumber(), and name. +References $msg, $poste, echo_debug(), echo_error(), isDate(), IsFicheOfJrn(), isNumber(), and name.

                                      00043 {
                                      +00044   foreach ($p_array as $name=>$content) {
                                      +00045     ${"$name"}=$content;
                                      +00046   }
                                      +00047   // Verify the date
                                      +00048   if ( isDate($e_date) == null ) { 
                                      +00049           echo_error("Invalid date $e_date");
                                      +00050           echo_debug('user_form_fin.php',__LINE__,"Invalid date $e_date");
                                      +00051           echo "<SCRIPT> alert('INVALID DATE $e_date !!!!');</SCRIPT>";
                                      +00052           return null;
                                      +00053                 }
                                      +00054 
                                      +00055 
                                      +00056  // Check if the fiche is in the jrn
                                      +00057  if (IsFicheOfJrn($p_cn , $p_jrn, $e_bank_account,'deb') == 0 ) 
                                      +00058    {
                                      +00059      $msg="Mauvais compte en banque";
                                      +00060      echo_error($msg);echo_debug('user_form_fin.php',__LINE__,$msg);    
                                      +00061      echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00062      return null;
                                      +00063    }
                                      +00064 
                                      +00065  // check if all e_march are in fiche
                                      +00066   for ($i=0;$i<$p_number;$i++) {
                                      +00067     if ( trim(${"e_other$i"})  == "" ) {
                                      +00068       // nothing to do
                                      +00069       continue;
                                      +00070     }
                                      +00071         // Check amount
                                      +00072     if ( isNumber(${"e_other".$i."_amount"}) == 0) {
                                      +00073                 $msg="Montant invalide !!! ";
                                      +00074                 echo_error($msg); echo_debug('user_form_fin.php',__LINE__,$msg);        
                                      +00075                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00076                 return null;
                                      +00077         }
                                      +00078     // Check 
                                      +00079     if ( isFicheOfJrn($p_cn,$p_jrn,${"e_other$i"},'cred') == 0 ) {
                                      +00080       $msg="Fiche inexistante !!! ";
                                      +00081       echo_error($msg);echo_debug('user_form_fin.php',__LINE__,$msg);   
                                      +00082       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00083       return null;
                                      +00084     }
                                      +00085         // check if the  ATTR_DEF_ACCOUNT is set
                                      +00086         $poste=GetFicheAttribut($p_cn,${"e_other$i"},ATTR_DEF_ACCOUNT);
                                      +00087         if ( $poste == null ) 
                                      +00088         {       
                                      +00089                 $msg="La fiche ".${"e_other$i"}." n\'a pas de poste comptable";
                                      +00090                 echo_error($msg); echo_debug('user_form_fin.php',__LINE__,$msg);        
                                      +00091                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00092                 return null;
                                      +00093         
                                      +00094         }
                                      +00095         if ( strlen(trim($poste))==0 )
                                      +00096         {
                                      +00097                 $msg="La fiche ".${"e_other$i"}." n\'a pas de poste comptable";
                                      +00098                 echo_error($msg); echo_debug('user_form_fin.php',__LINE__,$msg);        
                                      +00099                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00100         }
                                      +00101 
                                      +00102   }
                                      +00103 // Verify the userperiode
                                      +00104 
                                      +00105 // p_periode contient la periode par default
                                      +00106   list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                      +00107   
                                      +00108   // Date dans la periode active
                                      +00109   echo_debug ('user_form_fin',__LINE__,"date start periode $l_date_start date fin periode $l_date_end date demande $e_date");
                                      +00110   if ( cmpDate($e_date,$l_date_start)<0 || 
                                      +00111        cmpDate($e_date,$l_date_end)>0 )
                                      +00112     {
                                      +00113       $msg="Not in the active periode please change your preference";
                                      +00114       echo_error($msg); echo_error($msg);       
                                      +00115       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00116       return null;
                                      +00117     }
                                      +00118     // Periode ferm� 
                                      +00119     if ( PeriodeClosed ($p_cn,$p_periode)=='t' )
                                      +00120       {
                                      +00121                 $msg="This periode is closed please change your preference";
                                      +00122                 echo_error($msg); echo_error($msg);     
                                      +00123                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00124                 return null;
                                      +00125       }
                                      +00126     return true;
                                      +00127 }
                                      +
                                      +

                                      +

                                      @@ -189,7 +276,202 @@ Display the form for financial Used to show detail, encode a new fin op or updat

                                      Definition at line 146 of file user_form_fin.php.

                                      -References $file, $flag, $h, $p_jrn, $r, $solde, echo_error(), exit, GetPeriode(), GetSolde(), name, and value. +References $file, $flag, $h, $p_jrn, $r, $solde, echo_error(), exit, GetPeriode(), GetSolde(), name, and value.

                                      00147 { 
                                      +00148   include_once("poste.php");
                                      +00149   if ( $p_array != null ) {
                                      +00150     // array contains old value
                                      +00151     foreach ( $p_array as $a=>$v) {
                                      +00152       ${"$a"}=$v;
                                      +00153     }
                                      +00154   }
                                      +00155   // The date
                                      +00156   list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                      +00157   $flag=(isset($e_date))?1:0;
                                      +00158   $e_date=( ! isset($e_date) ) ? substr($l_date_start,2,8):$e_date;
                                      +00159 
                                      +00160   // Comment
                                      +00161   $e_comment=(isset($e_comment))?$e_comment:"";
                                      +00162 
                                      +00163   $r="";
                                      +00164   if ( $pview_only == false) {
                                      +00165     $r.=JS_SEARCH_CARD;
                                      +00166     $r.=JS_CONCERNED_OP;
                                      +00167   }
                                      +00168   // Compute href
                                      +00169   $href=$_SERVER['SCRIPT_NAME'];
                                      +00170   switch ($href)
                                      +00171     {
                                      +00172       // user_jrn.php module "Comptable"
                                      +00173     case '/user_jrn.php':
                                      +00174       $href="user_jrn.php?action=new&p_jrn=$p_jrn";
                                      +00175       break;
                                      +00176       // commercial.php  module "Gestion"
                                      +00177     case '/commercial.php':
                                      +00178       $href="commercial.php?p_action=bank&p_jrn=$p_jrn";
                                      +00179       break;
                                      +00180     default:
                                      +00181       echo_error('user_form_fin.php',__LINE__,'Erreur invalid request uri');
                                      +00182       exit (-1);
                                      +00183     }
                                      +00184 
                                      +00185   $r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"$href\" METHOD=\"POST\">";
                                      +00186   $r.='<TABLE>';
                                      +00187   $Date=new widget("text");
                                      +00188   $Date->SetReadOnly($pview_only);
                                      +00189   $Date->table=1;
                                      +00190   $r.="<tr>";
                                      +00191   $r.=$Date->IOValue("e_date",$e_date,"Date");
                                      +00192   $r.="</tr>";
                                      +00193 
                                      +00194 
                                      +00195   include_once("fiche_inc.php");
                                      +00196   $r.='<INPUT TYPE="HIDDEN" name="nb_item" value="'.$p_item.'">';
                                      +00197 
                                      +00198   // bank_account operation
                                      +00199   // Save old value and set a new one
                                      +00200   $e_bank_account=( isset ($e_bank_account) )?$e_bank_account:"";
                                      +00201   $e_bank_account_label="";  
                                      +00202 
                                      +00203     // retrieve e_bank_account_label
                                      +00204   if ( $e_bank_account != ""  ) {
                                      +00205       $a_client=GetFicheAttribut($p_cn,$e_bank_account);
                                      +00206       if ( $a_client != null)   
                                      +00207         $e_bank_account_label=$a_client['vw_name']."  adresse ".$a_client['vw_addr']."  ".$a_client['vw_cp'];
                                      +00208           }  
                                      +00209   //  search widget
                                      +00210     $W1=new widget("js_search");
                                      +00211     $W1->readonly=$pview_only;
                                      +00212     $W1->label="Banque";
                                      +00213     $W1->name="e_bank_account";
                                      +00214     $W1->value=$e_bank_account;
                                      +00215     $W1->extra=FICHE_TYPE_FIN;  // credits
                                      +00216     $W1->extra2=$p_jrn;
                                      +00217     $r.="<TR>".$W1->IOValue()."</TD>";
                                      +00218 
                                      +00219     $r.="</TABLE>";
                                      +00220   
                                      +00221     $Span=new widget ("span");
                                      +00222     $Span->SetReadOnly($pview_only);
                                      +00223     $r.="<TD>".$Span->IOValue("e_bank_account_label",$e_bank_account_label)."</TD>";
                                      +00224 
                                      +00225   
                                      +00226   // ComputeBanqueSaldo
                                      +00227   // 
                                      +00228   if ( $pview_only == true ) {
                                      +00229     $solde=GetSolde($p_cn,GetFicheAttribut($p_cn,$e_bank_account,ATTR_DEF_ACCOUNT));
                                      +00230     $r.=" <b> Solde = ".$solde." </b>";
                                      +00231     $new_solde=$solde;
                                      +00232   }
                                      +00233 
                                      +00234   // Start the div for item to move money
                                      +00235   $r.="<DIV>";
                                      +00236   $r.='<H2 class="info">Actions</H2>';
                                      +00237   $r.='<TABLE>';
                                      +00238   $r.="<TR>";
                                      +00239   $r.="<th></TH>";
                                      +00240   $r.="<th>code</TH>";
                                      +00241   $r.="<th>D&eacute;nomination</TH>";
                                      +00242   $r.="<th>Description</TH>";
                                      +00243   $r.="<th>Montant</TH>";
                                      +00244   $r.='<th colspan="2"> Op. Concern&eacute;</th>';
                                      +00245   $r.="</TR>";
                                      +00246   // Parse each " tiers" 
                                      +00247     for ($i=0; $i < $p_item; $i++) {
                                      +00248       $tiers=(isset(${"e_other".$i}))?${"e_other".$i}:"";
                                      +00249       $tiers_label="";
                                      +00250       $tiers_amount=(isset(${"e_other$i"."_amount"}))?${"e_other$i"."_amount"}:0;
                                      +00251   
                                      +00252       $tiers_comment=(isset (${"e_other$i"."_comment"}))?${"e_other$i"."_comment"}:"";
                                      +00253     // If $tiers has a value
                                      +00254     if ( $tiers != ""  ) 
                                      +00255         {
                                      +00256                 // retrieve the tva label and name
                                      +00257                 $a_fiche=GetFicheAttribut($p_cn, $tiers);
                                      +00258                 if ( $a_fiche != null ) {
                                      +00259                 $tiers_label=$a_fiche['vw_name'];
                                      +00260                 }
                                      +00261         }
                                      +00262     ${"e_other$i"."_amount"}=(isset (${"e_other$i"."_amount"}))?${"e_other$i"."_amount"}:0;
                                      +00263 
                                      +00264     $W1=new widget("js_search");
                                      +00265     $W1->label="";
                                      +00266     $W1->name="e_other".$i;
                                      +00267     $W1->value=$tiers;
                                      +00268     $W1->extra='cred';  // credits
                                      +00269     $W1->extra2=$p_jrn;
                                      +00270     $W1->readonly=$pview_only;
                                      +00271     $r.="<TR>".$W1->IOValue()."</TD>";
                                      +00272     // label
                                      +00273     $other=new widget("span");
                                      +00274     $r.="<TD>";
                                      +00275     $r.=$other->IOValue("e_other$i"."_label", $tiers_label);
                                      +00276     // Comment
                                      +00277     $wComment=new widget("text");
                                      +00278     $wComment->table=1;
                                      +00279     $wComment->SetReadOnly($pview_only);
                                      +00280     $r.=$wComment->IOValue("e_other$i"."_comment",$tiers_comment);
                                      +00281     // amount
                                      +00282     $wAmount=new widget("text");
                                      +00283     $wAmount->table=1;
                                      +00284     $wAmount->size=7;
                                      +00285     $wAmount->SetReadOnly($pview_only);
                                      +00286     $r.=$wAmount->IOValue("e_other$i"."_amount",$tiers_amount);
                                      +00287     // concerned
                                      +00288     ${"e_concerned".$i}=(isset(${"e_concerned".$i}))?${"e_concerned".$i}:"";
                                      +00289     $wConcerned=new widget("js_concerned");
                                      +00290     $wConcerned->SetReadOnly($pview_only);
                                      +00291     $r.=$wConcerned->IOValue("e_concerned".$i,${"e_concerned".$i});
                                      +00292     $r.='</TR>';
                                      +00293    // if not recorded the new amount must be recalculate
                                      +00294    // if recorded the old amount is recalculated
                                      +00295     if ( $pview_only == true)      
                                      +00296       $new_solde=($p_save==false)?$new_solde+$tiers_amount:$new_solde-$tiers_amount;
                                      +00297  }
                                      +00298 
                                      +00299 $r.="</TABLE>";
                                      +00300 
                                      +00301  if ( $pview_only==true && $p_save==false) {
                                      +00302    // check for upload piece
                                      +00303    $file=new widget("file");
                                      +00304    $file->table=1;
                                      +00305    $r.="<hr>";
                                      +00306    $r.= "<table>"; 
                                      +00307    $r.="<TR>".$file->IOValue("pj","","Pi&egrave;ce justificative")."</TR>";
                                      +00308    $r.="</table>";
                                      +00309    $r.="<hr>";
                                      +00310  }
                                      +00311  // Set correctly the REQUEST param for jrn_type 
                                      +00312  $h=new widget('hidden');
                                      +00313  $h->name='jrn_type';
                                      +00314  $h->value='FIN';
                                      +00315  $r.=$h->IOValue();
                                      +00316 
                                      +00317 $r.=$p_submit;
                                      +00318 $r.="</DIV>";
                                      +00319 $r.="</FORM>";
                                      +00320 
                                      +00321 // if view_only is true
                                      +00322 //Put the new saldo here (old saldo - operation)
                                      +00323  if ( $pview_only==true)  {
                                      +00324    // if not recorded the new amount must be recalculate
                                      +00325    if ( $p_save == false) {
                                      +00326      $r.=" <b> Ancien Solde = ".$solde." </b><br>";
                                      +00327      $r.=" <b> Nouveau Solde = ".$new_solde." </b><br>";
                                      +00328    }
                                      +00329    // if recorded the old amount is recalculated
                                      +00330    if ($p_save == true ) {
                                      +00331      $r.=" <b> Ancien Solde = ".$new_solde." </b><br>";
                                      +00332      $r.=" <b> Nouveau Solde = ".$solde." </b><br>";
                                      +00333    }
                                      +00334  }
                                      +00335  
                                      +00336 return $r;
                                      +00337 
                                      +00338 
                                      +00339 }
                                      +
                                      +

                                      +

                                      @@ -254,10 +536,85 @@ Record an invoice in the table jrn & jrnx.

                                      Definition at line 358 of file user_form_fin.php.

                                      -References $e, $poste, $seq, echo_debug(), ExecSql(), exit, FormatString(), InsertJrn(), InsertJrnx(), InsertRapt(), isNumber(), NextSequence(), Rollback(), SetInternalCode(), and StartSql(). +References $e, $poste, $seq, echo_debug(), ExecSql(), exit, FormatString(), InsertJrn(), InsertJrnx(), InsertRapt(), isNumber(), NextSequence(), Rollback(), SetInternalCode(), and StartSql().

                                      00358                                                   {
                                      +00359   echo_debug('user_form_fin.php',__LINE__,"RecordFin");
                                      +00360   foreach ( $p_array as $v => $e)
                                      +00361   {
                                      +00362     ${"$v"}=$e;
                                      +00363   }
                                      +00364   // Get the default period
                                      +00365   $periode=$p_user->GetPeriode();
                                      +00366   
                                      +00367   // Debit = banque
                                      +00368   $poste_bq=GetFicheAttribut($p_cn,$e_bank_account,ATTR_DEF_ACCOUNT);
                                      +00369   StartSql($p_cn);
                                      +00370   $amount=0.0;  
                                      +00371   // Credit = goods 
                                      +00372   for ( $i = 0; $i < $nb_item;$i++) {
                                      +00373     // if tiers is set and amount != 0 insert it into the database 
                                      +00374     // and quit the loop ?
                                      +00375     if ( ${"e_other$i"."_amount"} == 0 ) continue;
                                      +00376     $poste=GetFicheAttribut($p_cn,${"e_other$i"},ATTR_DEF_ACCOUNT);
                                      +00377 
                                      +00378     $amount+=${"e_other$i"."_amount"};
                                      +00379     // Record a line for the bank
                                      +00380     // Compute the j_grpt
                                      +00381     $seq=NextSequence($p_cn,'s_grpt');
                                      +00382 
                                      +00383     if ( InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$poste_bq,$e_date,round(${"e_other$i"."_amount"},2),$seq,$periode) == false ) {
                                      +00384       $Rollback($p_cn);exit("error 'user_form_fin.php' __LINE__");
                                      +00385     }
                                      +00386 
                                      +00387 
                                      +00388     // Record a line for the other account
                                      +00389     if ( ($j_id=InsertJrnx($p_cn,'c',$p_user->id,$p_jrn,$poste,$e_date,round(${"e_other$i"."_amount"},2),$seq,$periode)) == false )
                                      +00390       { $Rollback($p_cn);exit("error 'user_form_fin.php' __LINE__");}
                                      +00391 
                                      +00392     echo_debug('user_form_fin.php',__LINE__,"   $j_id=InsertJrnx($p_cn,'d',$p_user,$p_jrn,$poste,$e_date,".${"e_other$i"}."_amount".",$seq,$periode);");
                                      +00393 
                                      +00394     if ( ($jr_id=InsertJrn($p_cn,$e_date,'',$p_jrn,FormatString(${"e_other$i"."_comment"}),
                                      +00395                            round(${"e_other$i"."_amount"},2),$seq,$periode))==false) {
                                      +00396       $Rollback($p_cn);exit("error 'user_form_fin.php' __LINE__");}
                                      +00397   
                                      +00398     if ( isNumber(${"e_concerned".$i}) == 1 ) {
                                      +00399 
                                      +00400       InsertRapt($p_cn,$jr_id,${"e_concerned$i"});
                                      +00401     }
                                      +00402 
                                      +00403 
                                      +00404   // Set Internal code and Comment
                                      +00405     $internal_code=SetInternalCode($p_cn,$seq,$p_jrn);
                                      +00406     $comment=$internal_code."  compte : ".GetFicheName($p_cn,$e_bank_account);
                                      +00407     if ( FormatString(${"e_other$i"."_comment"}) == null ) {
                                      +00408       // Update comment if comment is blank
                                      +00409       $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
                                      +00410     }
                                      +00411     if ( $i == 0 )
                                      +00412       {
                                      +00413         // first record we upload the files and
                                      +00414         // keep variable to update other row of jrn
                                      +00415         if ( isset ($_FILES))
                                      +00416           $oid=save_upload_document($p_cn,$seq);
                                      +00417 
                                      +00418       } else {
                                      +00419         if ( sizeof($_FILES) != 0 ) 
                                      +00420           {
                                      +00421             ExecSql($p_cn,"update jrn set jr_pj=".$oid.", jr_pj_name='".$_FILES['pj']['name']."', ".
                                      +00422                 "jr_pj_type='".$_FILES['pj']['type']."'  where jr_grpt_id=$seq");
                                      +00423           }
                                      +00424       }
                                      +00425     
                                      +00426   } // for nbitem
                                      +00427 
                                      +00428   Commit($p_cn);
                                      +00429   return $internal_code;
                                      +00430 }
                                      +
                                      +

                                      + -


                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__ods_8php-source.html b/doc/developper/html/user__form__ods_8php-source.html index 69d2ed4eb..a1b975df5 100644 --- a/doc/developper/html/user__form__ods_8php-source.html +++ b/doc/developper/html/user__form__ods_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ods.php Source File +phpcompta: user_form_ods.php Source File +include

                                      user_form_ods.php

                                      Go to the documentation of this file.
                                      00001 <?
                                       00002 /*
                                       00003  *   This file is part of PhpCompta.
                                      @@ -81,7 +81,7 @@
                                       00091   include_once("fiche_inc.php");
                                       00092 
                                       00093   // Record the current number of article
                                      -00094   $r.='<INPUT TYPE="HIDDEN" name="nb_item" value="'.$p_article.'">';
                                      +00094   $r.='<INPUT TYPE="HIDDEN" name="nb_item" value="'.$p_article.'">';
                                       00095   $e_comment=(isset($e_comment))?$e_comment:"";
                                       00096 
                                       00097 
                                      @@ -160,11 +160,11 @@
                                       00170     $d_check=( ${"e_account$i"."_type"} == 'd' )?"CHECKED":"";
                                       00171     $r.='<td>';
                                       00172     if ( $pview_only == false ) {
                                      -00173       $r.='  <input type="radio" name="'."e_account"."$i"."_type".'" value="d" '.$d_check.'> D&eacute;bit ou ';
                                      -00174       $r.='  <input type="radio" name="'."e_account"."$i"."_type".'" value="c" '.$c_check.'> Cr&eacute;dit ';
                                      +00173       $r.='  <input type="radio" name="'."e_account"."$i"."_type".'" value="d" '.$d_check.'> D&eacute;bit ou ';
                                      +00174       $r.='  <input type="radio" name="'."e_account"."$i"."_type".'" value="c" '.$c_check.'> Cr&eacute;dit ';
                                       00175     }else {
                                       00176       $r.=(${"e_account$i"."_type"} == 'c' )?"Cr&eacute;dit":"D&eacute;dit";
                                      -00177       $r.='<input type="hidden" name="e_account'.$i.'_type" value="'.${"e_account$i"."_type"}.'">';
                                      +00177       $r.='<input type="hidden" name="e_account'.$i.'_type" value="'.${"e_account$i"."_type"}.'">';
                                       00178     }
                                       00179     $r.='</td>';
                                       00180     $r.='</TR>';
                                      @@ -263,7 +263,7 @@
                                       00291 
                                       00292 
                                       00293 ?>
                                      -

                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__ods_8php.html b/doc/developper/html/user__form__ods_8php.html index d85201b63..5cee2d7b7 100644 --- a/doc/developper/html/user__form__ods_8php.html +++ b/doc/developper/html/user__form__ods_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ods.php File Reference +phpcompta: user_form_ods.php File Reference +include

                                      user_form_ods.php File Reference

                                      Functions for the ledger of misc. operation. More...

                                      @@ -117,7 +117,191 @@ Display the miscellaneous operation Used to show detail, encode a new oper or up

                                      Definition at line 45 of file user_form_ods.php.

                                      -References $filter, $flag, $i, $l_line, $msg, $p_jrn, $r, CountSql(), echo_error(), GetJrnProperty(), GetPeriode(), GetPosteLibelle(), isNumber(), name, value, and VerifyOperationDate(). +References $filter, $flag, $i, $l_line, $msg, $p_jrn, $r, CountSql(), echo_error(), GetJrnProperty(), GetPeriode(), GetPosteLibelle(), isNumber(), name, value, and VerifyOperationDate().

                                      00046 { 
                                      +00047    include_once("poste.php");
                                      +00048   if ( $p_array != null ) {
                                      +00049     // array contains old value
                                      +00050     foreach ( $p_array as $a=>$v) {
                                      +00051       ${"$a"}=$v;
                                      +00052     }
                                      +00053   }
                                      +00054   // The date
                                      +00055    list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                      +00056    $flag=(isset($e_date))?1:0;
                                      +00057    $e_date=( ! isset($e_date) ) ? substr($l_date_start,2,8):$e_date;
                                      +00058 
                                      +00059   // Verify if valid date
                                      +00060   if (  $flag==1 and VerifyOperationDate($p_cn,$p_periode,$e_date)   == null) {
                                      +00061     if ( $pview_only == true) 
                                      +00062       return null;
                                      +00063     else 
                                      +00064       $e_date=substr($l_date_start,2,8);
                                      +00065   }    
                                      +00066   
                                      +00067   $e_comm=(isset($e_comm))?$e_comm:"";
                                      +00068   // Save old value and set a new one
                                      +00069 
                                      +00070   $r="";
                                      +00071   if ( $pview_only == false) {
                                      +00072     $r.=JS_SEARCH_POSTE;
                                      +00073   }
                                      +00074   $r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new&p_jrn=$p_jrn\" METHOD=\"POST\">";
                                      +00075   $r.='<TABLE>';
                                      +00076   // Date
                                      +00077   $wDate=new widget('text');
                                      +00078   $wDate->SetReadOnly($pview_only);
                                      +00079   $wDate->table=1;
                                      +00080   $r.="<TR>".$wDate->IOValue("e_date",$e_date,'Date')."</TR>";
                                      +00081 
                                      +00082   // Description
                                      +00083   $Commentaire=new widget("text");
                                      +00084   $Commentaire->table=1;
                                      +00085   $Commentaire->SetReadOnly($pview_only);
                                      +00086   $Commentaire->size=80;
                                      +00087   $r.="<tr>";
                                      +00088   $r.=$Commentaire->IOValue("e_comm",$e_comm,"Description");
                                      +00089   $r.="</tr>";
                                      +00090 
                                      +00091   include_once("fiche_inc.php");
                                      +00092 
                                      +00093   // Record the current number of article
                                      +00094   $r.='<INPUT TYPE="HIDDEN" name="nb_item" value="'.$p_article.'">';
                                      +00095   $e_comment=(isset($e_comment))?$e_comment:"";
                                      +00096 
                                      +00097 
                                      +00098   // Start the div for item to encode
                                      +00099   $r.="<DIV>";
                                      +00100   $r.='<H2 class="info">Op&eacute;rations Diverses</H2>';
                                      +00101   $r.='<TABLE border="0">';
                                      +00102   $r.="<tr>";
                                      +00103   $r.="<th></th>";
                                      +00104   $r.="<th>Compte</th>";
                                      +00105   $r.="<th>Poste</th>";
                                      +00106   $r.="<th>Montant</th>";
                                      +00107   $r.="<th>Cr&eacute;dit ou d&eacute;dit</th>";
                                      +00108   $r.="</tr>";
                                      +00109   $sum_deb=0.0;
                                      +00110   $sum_cred=0.0;
                                      +00111 
                                      +00112   // for each good
                                      +00113   for ($i=0;$i< $p_article;$i++) {
                                      +00114 
                                      +00115     $account=(isset(${"e_account$i"}))?${"e_account$i"}:"";
                                      +00116 
                                      +00117     $lib="";
                                      +00118     // If $account has a value
                                      +00119     if ( isNumber($account) == 1 ) {
                                      +00120       if ( CountSql($p_cn,"select * from tmp_pcmn where pcm_val=$account") == 0 ) {
                                      +00121         $msg="Poste comptable inexistant !!! ";
                                      +00122         echo_error($msg); echo_error($msg);
                                      +00123         echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00124         $account="";
                                      +00125         if ( $pview_only == true ) return null;
                                      +00126       } else {
                                      +00127         // retrieve the tva label and name
                                      +00128         $lib=GetPosteLibelle($p_cn, $account,1);
                                      +00129       }
                                      +00130     }
                                      +00131 
                                      +00132     ${"e_account$i"."_amount"}=(isset(${"e_account$i"."_amount"}))?${"e_account$i"."_amount"}:0;
                                      +00133     if ( isNumber(${"e_account$i"."_amount"}) == 0 ) {
                                      +00134       if ( $pview_only==true) {
                                      +00135         $msg="Montant invalide !!! ";
                                      +00136         echo_error($msg); echo_error($msg);
                                      +00137         echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                      +00138         return null;
                                      +00139       }
                                      +00140         ${"e_account$i"."_amount"}=0;
                                      +00141     }
                                      +00142     // code
                                      +00143     // Do we need a filter ?
                                      +00144     $l_line=GetJrnProperty($p_cn,$p_jrn);
                                      +00145     if(  strlen(trim ($l_line['jrn_def_class_cred']) ) > 0 or
                                      +00146          strlen(trim ($l_line['jrn_def_class_deb']) ) > 0 ) {
                                      +00147       $filter=1;
                                      +00148     }
                                      +00149     else
                                      +00150       $filter=null;
                                      +00151     $W = new widget('js_search_poste');
                                      +00152     $W->readonly=$pview_only;
                                      +00153     $W->label="";
                                      +00154     $W->extra=$p_jrn;
                                      +00155     $W->extra2=$filter;
                                      +00156     //    $r.='<TR>'.InputType("","js_search_poste","e_account".$i,$account,$pview_only,$filter);
                                      +00157     $r.="<TR>".$W->IOValue("e_account".$i, $account); 
                                      +00158     //libelle
                                      +00159     $r.="<td> $lib </td>";
                                      +00160     //amount
                                      +00161     $wAmount=new widget("text");
                                      +00162     $wAmount->table=1;
                                      +00163     $wAmount->SetReadOnly($pview_only);
                                      +00164     $r.=$wAmount->IOValue("e_account".$i."_amount",${"e_account$i"."_amount"});
                                      +00165 
                                      +00166 
                                      +00167     // Type is debit or credit, retrieve the old values
                                      +00168     ${"e_account$i"."_type"}=(isset (${"e_account$i"."_type"}))?${"e_account$i"."_type"}:'d';
                                      +00169     $c_check=( ${"e_account$i"."_type"} == 'c')?"CHECKED":"";
                                      +00170     $d_check=( ${"e_account$i"."_type"} == 'd' )?"CHECKED":"";
                                      +00171     $r.='<td>';
                                      +00172     if ( $pview_only == false ) {
                                      +00173       $r.='  <input type="radio" name="'."e_account"."$i"."_type".'" value="d" '.$d_check.'> D&eacute;bit ou ';
                                      +00174       $r.='  <input type="radio" name="'."e_account"."$i"."_type".'" value="c" '.$c_check.'> Cr&eacute;dit ';
                                      +00175     }else {
                                      +00176       $r.=(${"e_account$i"."_type"} == 'c' )?"Cr&eacute;dit":"D&eacute;dit";
                                      +00177       $r.='<input type="hidden" name="e_account'.$i.'_type" value="'.${"e_account$i"."_type"}.'">';
                                      +00178     }
                                      +00179     $r.='</td>';
                                      +00180     $r.='</TR>';
                                      +00181     $sum_deb+=(${"e_account$i"."_type"}=='d')?${"e_account$i"."_amount"}:0;
                                      +00182     $sum_cred+=(${"e_account$i"."_type"}=='c')?${"e_account$i"."_amount"}:0;
                                      +00183   } // End for 
                                      +00184 
                                      +00185   $r.="</TABLE>";
                                      +00186 
                                      +00187  if ( $pview_only==true && $p_saved==false) {
                                      +00188 // check for upload piece
                                      +00189    $file=new widget("file");
                                      +00190    $file->table=1;
                                      +00191    $r.="<hr>";
                                      +00192    $r.= "<table>"; 
                                      +00193    $r.="<TR>".$file->IOValue("pj","","Pi&egrave;ce justificative")."</TR>";
                                      +00194    $r.="</table>";
                                      +00195    $r.="<hr>";
                                      +00196  }
                                      +00197   // Set correctly the REQUEST param for jrn_type 
                                      +00198   $h=new widget('hidden');
                                      +00199   $h->name='jrn_type';
                                      +00200   $h->value='OD';
                                      +00201   $r.=$h->IOValue();
                                      +00202 
                                      +00203   $r.=$p_submit;
                                      +00204   //  $r.="</DIV>";
                                      +00205   $r.="</FORM>";
                                      +00206   //TODO if view only show total
                                      +00207   $tmp= abs($sum_deb-$sum_cred);
                                      +00208   echo_debug('user_form_ods.php',__LINE__,"Diff = ".$tmp);
                                      +00209   if ( abs($sum_deb-$sum_cred) > 0.0001  and $pview_only==true) {
                                      +00210     $msg=sprintf("Montant non correspondant credit = %.5f debit = %.5f diff = %.5f",
                                      +00211                  $sum_cred,$sum_deb,$sum_cred-$sum_deb);
                                      +00212     echo "<script> alert('$msg'); </script>";
                                      +00213     return null;
                                      +00214   }
                                      +00215 
                                      +00216   // Verify that we have a non-null operation
                                      +00217   if ($pview_only==true and $sum_cred == 0)
                                      +00218   {
                                      +00219     $msg=sprintf("Montant null");
                                      +00220     echo "<script> alert('$msg'); </script>";
                                      +00221     return null;
                                      +00222   }
                                      +00223   
                                      +00224   return $r;
                                      +00225 
                                      +00226 
                                      +00227 }
                                      +
                                      +

                                      +

                                      @@ -181,10 +365,55 @@ Record an buy in the table jrn & jrnx.

                                      Definition at line 247 of file user_form_ods.php.

                                      -References $e, $seq, exit, InsertJrnx(), isNumber(), NextSequence(), and StartSql(). +References $e, $seq, exit, InsertJrnx(), isNumber(), NextSequence(), and StartSql().

                                      00248 {
                                      +00249   foreach ( $p_array as $v => $e)
                                      +00250   {
                                      +00251     ${"$v"}=$e;
                                      +00252   }
                                      +00253   // Get the default period
                                      +00254   $periode=$p_user->GetPeriode();
                                      +00255   $amount=0.0;
                                      +00256   // Computing total customer
                                      +00257 
                                      +00258   $sum_deb=0.0;
                                      +00259   $sum_cred=0.0;
                                      +00260 
                                      +00261         // Compute the j_grpt
                                      +00262   $seq=NextSequence($p_cn,'s_grpt');
                                      +00263 
                                      +00264   StartSql($p_cn);
                                      +00265   // store into the database
                                      +00266   for ( $i = 0; $i < $nb_item;$i++) {
                                      +00267     if ( isNumber(${"e_account$i"}) == 0 ) continue;
                                      +00268     $sum_deb+=(${"e_account$i"."_type"}=='d')?round(${"e_account$i"."_amount"},2):0;
                                      +00269     $sum_cred+=(${"e_account$i"."_type"}=='c')?round(${"e_account$i"."_amount"},2):0;
                                      +00270 
                                      +00271     if ( ${"e_account$i"."_amount"} == 0 ) continue;
                                      +00272     if ( ($j_id=InsertJrnx($p_cn,${"e_account$i"."_type"},$p_user->id,$p_jrn,${"e_account$i"},$e_date,${"e_account$i"."_amount"},$seq,$periode)) == false ) {
                                      +00273       $Rollback($p_cn);exit("error 'user_form_ods.php' __LINE__");}
                                      +00274   }
                                      +00275 
                                      +00276   if ( InsertJrn($p_cn,$e_date,"",$p_jrn,$e_comm,$sum_deb,$seq,$periode) == false ) {
                                      +00277     $Rollback($p_cn);exit("error 'user_form_ods.php' __LINE__");}
                                      +00278 
                                      +00279   // Set Internal code and Comment
                                      +00280   $internal_code=SetInternalCode($p_cn,$seq,$p_jrn);
                                      +00281   if ( $e_comm=="" ) {
                                      +00282     // Update comment if comment is blank
                                      +00283     $Res=ExecSql($p_cn,"update jrn set jr_comment='".$internal_code."' where jr_grpt_id=".$seq);
                                      +00284   }
                                      +00285   if ( isset ($_FILES))
                                      +00286     save_upload_document($p_cn,$seq);
                                      +00287 
                                      +00288   Commit($p_cn);
                                      +00289   return $internal_code;
                                      +00290 }
                                      +
                                      +

                                      + -


                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__ven_8php-source.html b/doc/developper/html/user__form__ven_8php-source.html index 51f662113..4f52a9db2 100644 --- a/doc/developper/html/user__form__ven_8php-source.html +++ b/doc/developper/html/user__form__ven_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ven.php Source File +phpcompta: user_form_ven.php Source File +include

                                      user_form_ven.php

                                      Go to the documentation of this file.
                                      00001 <?
                                       00002 /*
                                       00003  *   This file is part of PhpCompta.
                                      @@ -261,7 +261,7 @@
                                       00269 }
                                       00284 function form_verify_input($p_cn,$p_jrn,$p_periode,$p_array,$p_number)
                                       00285 {
                                      -00286   foreach ($p_array as $name=>$content) {
                                      +00286   foreach ($p_array as $name=>$content) {
                                       00287     ${"$name"}=$content;
                                       00288   }
                                       00289   // Verify the date
                                      @@ -391,8 +391,8 @@
                                       00429   // Keep all the data if hidden
                                       00430   // and store the array in variables
                                       00431   $hidden=new widget("hidden");
                                      -00432   foreach ($p_array as $name=>$content) {
                                      -00433     $data.=$hidden->IOValue($name,$content);
                                      +00432   foreach ($p_array as $name=>$content) {
                                      +00433     $data.=$hidden->IOValue($name,$content);
                                       00434     ${"$name"}=$content;
                                       00435   }
                                       00436   
                                      @@ -535,7 +535,7 @@
                                       00573         if ( CountSql($p_cn,
                                       00574                       "select md_id,md_name from document_modele where md_type=4") > 0 )
                                       00575           {
                                      -00576             $r.='G&eacute;n&eacute;rer une facture <input type="checkbox" name="gen_invoice" CHECKED>';
                                      +00576             $r.='G&eacute;n&eacute;rer une facture <input type="checkbox" name="gen_invoice" CHECKED>';
                                       00577             // We propose to generate  the invoice and some template
                                       00578             $doc_gen=new widget("select");
                                       00579             $doc_gen->name="gen_doc";
                                      @@ -550,9 +550,9 @@
                                       00588     
                                       00589     $r.=$data;
                                       00590     if ( $sum_with_vat != 0 ) {
                                      -00591       $r.='<INPUT TYPE="SUBMIT" name="record_and_print_invoice" value="Sauver" >';
                                      +00591       $r.='<INPUT TYPE="SUBMIT" name="record_and_print_invoice" value="Sauver" >';
                                       00592     }
                                      -00593     $r.='<INPUT TYPE="SUBMIT" name="correct_new_invoice" value="Corriger">';
                                      +00593     $r.='<INPUT TYPE="SUBMIT" name="correct_new_invoice" value="Corriger">';
                                       00594     
                                       00595     $r.='</FORM>';
                                       00596   } 
                                      @@ -689,7 +689,7 @@
                                       00753 }
                                       00754 
                                       00755 ?>
                                      -

                                      Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                      Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                      diff --git a/doc/developper/html/user__form__ven_8php.html b/doc/developper/html/user__form__ven_8php.html index 7a1e9545c..ee6affa90 100644 --- a/doc/developper/html/user__form__ven_8php.html +++ b/doc/developper/html/user__form__ven_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_form_ven.php File Reference +phpcompta: user_form_ven.php File Reference +include

                                      user_form_ven.php File Reference

                                      Functions for the ledger of sold. More...

                                      @@ -99,7 +99,133 @@ p_jrn concerned ledger

                                        Definition at line 284 of file user_form_ven.php.

                                        -References $msg, CountSql(), echo_debug(), echo_error(), isDate(), isNumber(), and name. +References $msg, CountSql(), echo_debug(), echo_error(), isDate(), isNumber(), and name.

                                        00285 {
                                        +00286   foreach ($p_array as $name=>$content) {
                                        +00287     ${"$name"}=$content;
                                        +00288   }
                                        +00289   // Verify the date
                                        +00290   if ( isDate($e_date) == null ) { 
                                        +00291           echo_error("Invalid date $e_date");
                                        +00292           echo_debug('user_form_ven.php',__LINE__,"Invalid date $e_date");
                                        +00293           echo "<SCRIPT> alert('INVALID DATE $e_date !!!!');</SCRIPT>";
                                        +00294           return null;
                                        +00295                 }
                                        +00296 // Verify the quantity
                                        +00297 for ($o = 0;$o < $p_number; $o++) {
                                        +00298         if ( isNumber(${"e_quant$o"}) == 0 ) {
                                        +00299                 echo_debug('user_form_ven.php',__LINE__,"invalid quantity ".${"e_quant$o"});
                                        +00300                 echo_error("invalid quantity ".${"e_quant$o"});
                                        +00301                 echo "<SCRIPT> alert('INVALID QUANTITY !!!');</SCRIPT>";
                                        +00302                 return null;
                                        +00303         }       
                                        +00304     // check if vat is correct
                                        +00305     if ( strlen(trim(${"e_march$o"."_tva_id"})) !=0 
                                        +00306          and 
                                        +00307          ${"e_march$o"."_tva_id"} != "-1")
                                        +00308       {
                                        +00309       // vat is given we check it now check if valid
                                        +00310       if (isNumber(${"e_march$o"."_tva_id"}) == 0
                                        +00311                or CountSql($p_cn,"select tva_id from tva_rate where tva_id=".${"e_march$o"."_tva_id"}) ==0)
                                        +00312         {
                                        +00313           $msg="Invalid TVA !!! e_march".$o."_tva_id = ".${"e_march".$o."_tva_id"};
                                        +00314           echo_error($msg); echo_error($msg);   
                                        +00315           echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00316           return null;
                                        +00317         
                                        +00318       }
                                        +00319     }
                                        +00320     
                                        +00321  }
                                        +00322 
                                        +00323 // Verify the ech
                                        +00324  if (strlen($e_ech) != 0 and isNumber($e_ech)  == 0 and  isDate ($e_ech) == null ) {
                                        +00325         $msg="Echeance invalide";
                                        +00326                 echo_error($msg); echo_error($msg);     
                                        +00327                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00328                 return null;
                                        +00329  } 
                                        +00330 
                                        +00331  // if ech is a number of days then compute date limit
                                        +00332  if ( strlen($e_ech) != 0 and isNumber($e_ech) == 1) {
                                        +00333  list($day,$month,$year)=explode(".",$e_date);
                                        +00334   echo_debug('user_form_ven.php',__LINE__," date $e_date = $day.$month.$year");
                                        +00335   $p_ech=date('d.m.Y',mktime(0,0,0,$month,$day+$e_ech,$year));
                                        +00336   echo_debug('user_form_ven.php',__LINE__,"p_ech = $e_ech $p_ech");
                                        +00337   $e_ech=$p_ech;
                                        +00338   $wHidden=new widget("hidden");
                                        +00339   $data.=$wHidden->IOValue("e_ech",$e_ech);
                                        +00340  }
                                        +00341 
                                        +00342  // Check if the fiche is in the jrn
                                        +00343  if (IsFicheOfJrn($p_cn , $p_jrn, $e_client,'deb') == 0 ) 
                                        +00344    {
                                        +00345      $msg="Client invalid please recheck";
                                        +00346      echo_error($msg);
                                        +00347      echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00348      return null;
                                        +00349    }
                                        +00350 
                                        +00351  // check if all e_march are in fiche
                                        +00352   for ($i=0;$i<$p_number;$i++) {
                                        +00353     if ( trim(${"e_march$i"})  == "" ) {
                                        +00354       // no goods to sell 
                                        +00355       continue;
                                        +00356     }
                                        +00357   
                                        +00358 
                                        +00359     // Check 
                                        +00360     if ( isFicheOfJrn($p_cn,$p_jrn,${"e_march$i"},'cred') == 0 ) {
                                        +00361       $msg="Fiche inexistante !!! ";
                                        +00362       echo_error($msg); echo_error($msg);       
                                        +00363       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00364       return null;
                                        +00365     }
                                        +00366         // check if the  ATTR_DEF_ACCOUNT is set
                                        +00367         $poste=GetFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_ACCOUNT);
                                        +00368         if ( $poste == null ) 
                                        +00369         {       
                                        +00370                 $msg="La fiche ".${"e_march$i"}." n\'a pas de poste comptable";
                                        +00371       echo_error($msg); echo_debug('user_form_ven.php',__LINE__,$msg);  
                                        +00372       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00373       return null;
                                        +00374         
                                        +00375         }
                                        +00376         if ( strlen(trim($poste))==0 )
                                        +00377         {
                                        +00378                 $msg="La fiche ".$tiers." n\'a pas de poste comptable";
                                        +00379                 echo_error($msg); echo_debug('user_form_ven.php',__LINE__,$msg);        
                                        +00380                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00381         }
                                        +00382 
                                        +00383   }
                                        +00384 // Verify the userperiode
                                        +00385 
                                        +00386 // p_periode contient la periode par default
                                        +00387   list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                        +00388   
                                        +00389   // Date dans la periode active
                                        +00390   echo_debug ('user_form_ven',__LINE__,"date start periode $l_date_start date fin periode $l_date_end date demande $e_date");
                                        +00391   if ( cmpDate($e_date,$l_date_start)<0 || 
                                        +00392        cmpDate($e_date,$l_date_end)>0 )
                                        +00393     {
                                        +00394       $msg="Not in the active periode please change your preference";
                                        +00395       echo_error($msg); echo_error($msg);       
                                        +00396       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00397       return null;
                                        +00398     }
                                        +00399     // Periode ferme
                                        +00400     if ( PeriodeClosed ($p_cn,$p_periode)=='t' )
                                        +00401       {
                                        +00402                 $msg="This periode is closed please change your preference";
                                        +00403                 echo_error($msg); echo_error($msg);     
                                        +00404                 echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00405                 return null;
                                        +00406       }
                                        +00407     return true;
                                        +00408 }
                                        +
                                        +

                                        +

                                        @@ -175,7 +301,235 @@ FormVenInput

                                        Definition at line 43 of file user_form_ven.php.

                                        -References $fiche, $list, $msg, $p_jrn, $r, $sql, echo_debug(), echo_error(), exit, GetArray(), GetPeriode(), isNumber(), and make_array(). +References $fiche, $list, $msg, $p_jrn, $r, $sql, echo_debug(), echo_error(), exit, GetArray(), GetPeriode(), isNumber(), and make_array().

                                        00044 { 
                                        +00045 
                                        +00046   if ( $p_array != null ) {
                                        +00047     // array contains old value
                                        +00048     foreach ( $p_array as $a=>$v) {
                                        +00049       ${"$a"}=$v;
                                        +00050     }
                                        +00051   }
                                        +00052   // The date
                                        +00053   list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
                                        +00054   $op_date=( ! isset($e_date) ) ?substr($l_date_start,2,8):$e_date;
                                        +00055   $e_ech=(isset($e_ech))?$e_ech:"";
                                        +00056   $e_comm=(isset($e_comm))?$e_comm:"";
                                        +00057   //  $e_jrn=(isset($e_jrn))?$e_jrn:"";
                                        +00058   // Save old value and set a new one
                                        +00059   echo_debug('user_form_ven.php',__LINE__,"form_input.php.FormVentep_op_date is $op_date");
                                        +00060   $r="";
                                        +00061   if ( $pview_only == false) {
                                        +00062     $r.=JS_SEARCH_CARD;
                                        +00063     $r.=JS_SHOW_TVA;    
                                        +00064     $r.=JS_TVA;
                                        +00065     // Compute href
                                        +00066     $href=$_SERVER['SCRIPT_NAME'];
                                        +00067     switch ($href)
                                        +00068       {
                                        +00069         // user_jrn.php
                                        +00070       case '/user_jrn.php':
                                        +00071         $href="user_jrn.php?action=insert_vente&p_jrn=$p_jrn";
                                        +00072         break;
                                        +00073       case '/commercial.php':
                                        +00074         $href="commercial.php?p_action=facture&p_jrn=$p_jrn";
                                        +00075         break;
                                        +00076       default:
                                        +00077         echo_error('user_form_ven.php',__LINE__,'Erreur invalid request uri');
                                        +00078         exit (-1);
                                        +00079       }
                                        +00080       
                                        +00081     $r.="<FORM NAME=\"form_detail\" ACTION=\"$href\" METHOD=\"POST\">";
                                        +00082 
                                        +00083     
                                        +00084   }
                                        +00085   $sql="select jrn_def_id as value,jrn_def_name as label from jrn_def where jrn_def_type='VEN'";
                                        +00086   $list=GetArray($p_cn,$sql);
                                        +00087   $r.='<TABLE>';
                                        +00088   //  Date
                                        +00089   //--
                                        +00090   $Date=new widget("text");
                                        +00091   $Date->SetReadOnly($pview_only);
                                        +00092   $Date->table=1;
                                        +00093   $Date->tabindex=1;
                                        +00094   $r.="<tr>";
                                        +00095   $r.=$Date->IOValue("e_date",$op_date,"Date");
                                        +00096   $r.="</tr>";
                                        +00097   // Payment limit
                                        +00098   //--
                                        +00099   $Echeance=new widget("text");
                                        +00100   $Echeance->SetReadOnly($pview_only);
                                        +00101   $Echeance->table=1;
                                        +00102   $Echeance->tabindex=2;
                                        +00103   $r.="<tr>";
                                        +00104   $r.=$Echeance->IOValue("e_ech",$e_ech,"Echeance");
                                        +00105   $r.="</tr>";
                                        +00106   // Comment
                                        +00107   //--
                                        +00108   $Commentaire=new widget("text");
                                        +00109   $Commentaire->table=1;
                                        +00110   $Commentaire->SetReadOnly($pview_only);
                                        +00111   $Commentaire->size=80;
                                        +00112   $Commentaire->tabindex=3;
                                        +00113   $r.="<tr>";
                                        +00114   $r.=$Commentaire->IOValue("e_comm",$e_comm,"Description");
                                        +00115   $r.="</tr>";
                                        +00116   include_once("fiche_inc.php");
                                        +00117   // Display the customer
                                        +00118   //--
                                        +00119   $fiche='deb';
                                        +00120   echo_debug('user_form_ven.php',__LINE__,"Client Nombre d'enregistrement ".sizeof($fiche));
                                        +00121   // Save old value and set a new one
                                        +00122   //--
                                        +00123   $e_client=( isset ($e_client) )?$e_client:"";
                                        +00124   $e_client_label="";  
                                        +00125 
                                        +00126   // retrieve e_client_label
                                        +00127   //--
                                        +00128   if ( isNumber($e_client) == 1 ) {
                                        +00129     if ( isFicheOfJrn($p_cn,$p_jrn,$e_client,'deb') == 0 ) {
                                        +00130       $msg="Fiche inexistante !!! ";
                                        +00131       echo_error($msg); echo_error($msg);       
                                        +00132       echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00133       $e_client="";
                                        +00134     } else {
                                        +00135       $a_client=GetFicheAttribut($p_cn,$e_client);
                                        +00136       if ( $a_client != null)   
                                        +00137           $e_client_label=$a_client['vw_name']."  adresse ".$a_client['vw_addr']."  ".$a_client['vw_cp'];
                                        +00138     }
                                        +00139   }
                                        +00140 
                                        +00141   $W1=new widget("js_search");
                                        +00142   $W1->label="Client";
                                        +00143   $W1->name="e_client";
                                        +00144   $W1->tabindex=3;
                                        +00145   $W1->value=$e_client;
                                        +00146   $W1->extra=$fiche;  // list of card
                                        +00147   $W1->extra2=$p_jrn;
                                        +00148   $r.="<TR>".$W1->IOValue();
                                        +00149   $client_label=new widget("span");
                                        +00150   $r.= $client_label->IOValue("e_client_label",$e_client_label)."</TD></TR>";
                                        +00151   $r.="</TABLE>";
                                        +00152 
                                        +00153   // Record the current number of article
                                        +00154   $Hid=new widget('hidden');
                                        +00155   $r.=$Hid->IOValue("nb_item",$p_article);
                                        +00156   $e_comment=(isset($e_comment))?$e_comment:"";
                                        +00157 
                                        +00158 
                                        +00159   // Start the div for item to sell
                                        +00160   $r.="<DIV>";
                                        +00161   $r.='<H2 class="info">Articles</H2>';
                                        +00162   $r.='<TABLE>';
                                        +00163   $r.='<TR>';
                                        +00164   $r.="<th></th>";
                                        +00165   $r.="<th>Code</th>";
                                        +00166   $r.="<th>Dénomination</th>";
                                        +00167   $r.="<th>prix</th>";
                                        +00168   $r.="<th>tva</th>";
                                        +00169   $r.="<th>quantité</th>";
                                        +00170   $r.='</TR>';
                                        +00171   // For each article
                                        +00172   //--
                                        +00173   for ($i=0;$i< $p_article;$i++) {
                                        +00174     // Code id, price & vat code
                                        +00175     //--
                                        +00176     $march=(isset(${"e_march$i"}))?${"e_march$i"}:"";
                                        +00177     $march_sell=(isset(${"e_march".$i."_sell"}))?${"e_march".$i."_sell"}:"";
                                        +00178     $march_tva_id=(isset(${"e_march$i"."_tva_id"}))?${"e_march$i"."_tva_id"}:"";
                                        +00179 
                                        +00180     $march_tva_label="";
                                        +00181     $march_label="";
                                        +00182 
                                        +00183     // If $march has a value
                                        +00184     //--
                                        +00185     if ( isNumber($march) == 1 ) {
                                        +00186       if ( isFicheOfJrn($p_cn,$p_jrn,$march,'cred') == 0 ) {
                                        +00187         $msg="Fiche inexistante !!! ";
                                        +00188         echo_error($msg); echo_error($msg);     
                                        +00189         echo "<SCRIPT>alert('$msg');</SCRIPT>";
                                        +00190         $march="";
                                        +00191       } else {
                                        +00192         // retrieve the tva label and name
                                        +00193         //--
                                        +00194         $a_fiche=GetFicheAttribut($p_cn, $march);
                                        +00195         if ( $a_fiche != null ) {
                                        +00196           if ( $march_tva_id == "" ) {
                                        +00197             $march_tva_id=$a_fiche['tva_id'];
                                        +00198             $march_tva_label=$a_fiche['tva_label'];
                                        +00199           }
                                        +00200           $march_label=$a_fiche['vw_name'];
                                        +00201         }
                                        +00202       }
                                        +00203     }
                                        +00204     // Show input
                                        +00205     //--
                                        +00206     $W1=new widget("js_search");
                                        +00207     $W1->label="";
                                        +00208     $W1->name="e_march".$i;
                                        +00209     $W1->value=$march;
                                        +00210     $W1->extra='cred';  // credits
                                        +00211     $W1->extra2=$p_jrn;
                                        +00212     $W1->readonly=$pview_only;
                                        +00213     $r.="<TR>".$W1->IOValue()."</TD>";
                                        +00214     $Span=new widget ("span");
                                        +00215     $Span->SetReadOnly($pview_only);
                                        +00216     // card's name, price
                                        +00217     //--
                                        +00218     $r.="<TD>".$Span->IOValue("e_march".$i."_label",$march_label)."</TD>";
                                        +00219    // price
                                        +00220     $Price=new widget("text");
                                        +00221     $Price->SetReadOnly($pview_only);
                                        +00222     $Price->table=1;
                                        +00223     $r.=$Price->IOValue("e_march".$i."_sell",$march_sell);
                                        +00224     // vat label
                                        +00225     //--
                                        +00226     $select_tva=make_array($p_cn,"select tva_id,tva_label from tva_rate order by tva_id",1);
                                        +00227     $Tva=new widget("select");
                                        +00228     $Tva->table=1;
                                        +00229     $Tva->selected=$march_tva_id;
                                        +00230     $r.=$Tva->IOValue("e_march$i"."_tva_id",$select_tva);
                                        +00231 
                                        +00232     // quantity
                                        +00233     //--
                                        +00234     $quant=(isset(${"e_quant$i"}))?${"e_quant$i"}:"1";
                                        +00235     $Quantity=new widget("text");
                                        +00236     $Quantity->SetReadOnly($pview_only);
                                        +00237     $Quantity->table=1;
                                        +00238     //$r.=InputType("","TEXT","e_quant".$i,$quant,$pview_only);
                                        +00239     $r.=$Quantity->IOValue("e_quant".$i,$quant);
                                        +00240     $r.='</TR>';
                                        +00241   }
                                        +00242 
                                        +00243 
                                        +00244 
                                        +00245   $r.="</TABLE>";
                                        +00246   $r.="<hr>";
                                        +00247   // Set correctly the REQUEST param for jrn_type 
                                        +00248   $h=new widget('hidden');
                                        +00249   $h->name='jrn_type';
                                        +00250   $h->value='VEN';
                                        +00251   $r.=$h->IOValue();
                                        +00252 
                                        +00253   if ($pview_only == false ) {
                                        +00254     $r.='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article" TABINDEX="32767">';
                                        +00255     $r.='<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer" TABINDEX="32767" ID="SubmitButton">';
                                        +00256     $r.="</DIV>";
                                        +00257     $r.="</FORM>";
                                        +00258     $r.=JS_CALC_LINE;
                                        +00259   } else {
                                        +00260      $r.="</div>";
                                        +00261 
                                        +00262   }
                                        +00263 
                                        +00264 
                                        +00265 
                                        +00266   return $r;
                                        +00267 
                                        +00268 
                                        +00269 }
                                        +
                                        +

                                        +

                                        @@ -260,7 +614,183 @@ FormVenteView ($p_cn,$p_jrn,$p_periode,$p_array,$p_number,$p_doc='html',$p_comme

                                        Definition at line 425 of file user_form_ven.php.

                                        -References $data, $file, $r, CountSql(), echo_error(), exit, getFicheAttribut(), getFicheName(), GetTvaRate(), isNumber(), make_array(), METHOD, name, and value. +References $data, $file, $r, CountSql(), echo_error(), exit, getFicheAttribut(), getFicheName(), GetTvaRate(), isNumber(), make_array(), METHOD, name, and value.

                                        00426 {
                                        +00427   $r="";
                                        +00428   $data="";
                                        +00429   // Keep all the data if hidden
                                        +00430   // and store the array in variables
                                        +00431   $hidden=new widget("hidden");
                                        +00432   foreach ($p_array as $name=>$content) {
                                        +00433     $data.=$hidden->IOValue($name,$content);
                                        +00434     ${"$name"}=$content;
                                        +00435   }
                                        +00436   
                                        +00437   // start table
                                        +00438   $r.='<TABLE>';
                                        +00439   // Show the Date
                                        +00440   $r.="<tr>";
                                        +00441   $r.="<TD>Date : $e_date</TD>";
                                        +00442   $r.="</tr>";
                                        +00443   // Show the customer Name
                                        +00444   $r.="<tr>";
                                        +00445   $r.="<TD>Client : ".getFicheName($p_cn,$e_client)."</TD>";
                                        +00446   $r.="</tr>";
                                        +00447   
                                        +00448   // show date limit
                                        +00449   $r.="<tr>";
                                        +00450   $r.="<TD> Echeance : $e_ech </TD>";
                                        +00451   $r.="</tr>";
                                        +00452   // Show desc
                                        +00453   $r.="<tr>";
                                        +00454   $r.="<TD> Description : $e_comm</TD>";
                                        +00455   $r.="</tr>";
                                        +00456   
                                        +00457   $sum_with_vat=0.0;
                                        +00458     $sum_march=0.0;
                                        +00459   // show all article, price vat and sum
                                        +00460     $r.="<TR>";
                                        +00461     $r.="<TH>Article</TH>";
                                        +00462     $r.="<TH>quantité</TH>";
                                        +00463     $r.="<TH>prix unit.</TH>";
                                        +00464     $r.="<TH>taux tva</TH>";
                                        +00465     $r.="<TH>Montant HTVA</TH>";
                                        +00466     $r.="<TH>Montant TVA</TH>";
                                        +00467     $r.="<TH>Total</TH>";
                                        +00468     $r.="</TR>";
                                        +00469   for ($i=0;$i<$p_number;$i++) {
                                        +00470     if ( trim(${"e_march$i"})  == "" ) {
                                        +00471       // no goods to sell 
                                        +00472       continue;
                                        +00473     }
                                        +00474   
                                        +00475     // Get the name
                                        +00476     $fiche_name=getFicheName($p_cn,${"e_march$i"});
                                        +00477 
                                        +00478     // Quantity
                                        +00479     $fiche_quant=${"e_quant$i"};
                                        +00480 
                                        +00481     // No  row if there is quantity
                                        +00482     if ( $fiche_quant == 0.0 ) continue;
                                        +00483 
                                        +00484 
                                        +00485     // If the price is not a number, retrieve the price from the database
                                        +00486     if ( isNumber(${"e_march$i"."_sell"}) == 0 ) {
                                        +00487            $fiche_price=getFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_PRIX_VENTE);
                                        +00488          } else {
                                        +00489       $fiche_price=${"e_march$i"."_sell"};
                                        +00490     }
                                        +00491     
                                        +00492     
                                        +00493     // VAT 
                                        +00494     $vat=(isNumber(${"e_march$i"."_tva_id"})==0)?getFicheAttribut($p_cn,${"e_march$i"},ATTR_DEF_TVA):${"e_march$i"."_tva_id"};
                                        +00495         
                                        +00496     // vat label
                                        +00497     // vat rate
                                        +00498     $a_vat=GetTvaRate($p_cn,$vat);
                                        +00499     if ( $a_vat == null ) {
                                        +00500       $vat_label="";
                                        +00501       $vat_rate=0.0;
                                        +00502     } else { 
                                        +00503       $vat_label=$a_vat['tva_label'];
                                        +00504       $vat_rate=$a_vat['tva_rate'];
                                        +00505     }           
                                        +00506         
                                        +00507     // Total card without vat
                                        +00508     $fiche_sum=$fiche_price*$fiche_quant;
                                        +00509     // Sum of invoice
                                        +00510     $sum_march+=$fiche_sum;
                                        +00511     // vat of the card
                                        +00512     $fiche_amount_vat=$fiche_price*$fiche_quant*$vat_rate;
                                        +00513     // value card + vat
                                        +00514     $fiche_with_vat=$fiche_price*$fiche_quant*(1+$vat_rate);
                                        +00515     // Sum of invoice vat 
                                        +00516     $sum_with_vat+=$fiche_with_vat;
                                        +00517     // Show the data
                                        +00518     $r.='<TR>';
                                        +00519     $r.='<TD>'.$fiche_name.'</TD>';
                                        +00520     $r.='<TD ALIGN="CENTER">'.$fiche_quant.'</TD>';
                                        +00521     $r.='<TD ALIGN="right">'.$fiche_price.'</TD>';
                                        +00522     $r.="<TD  ALIGN=\"RIGHT\"> $vat_label </TD>";
                                        +00523     $r.='<TD  ALIGN="RIGHT">'.round($fiche_sum,2).'</TD>';
                                        +00524     $r.='<TD ALIGN="RIGHT">'.round($fiche_amount_vat,2).'</TD>';
                                        +00525 
                                        +00526     $r.='<TD>'.round($fiche_with_vat,2).'</TD>';
                                        +00527 
                                        +00528     $r.="</TR>";
                                        +00529   }
                                        +00530   
                                        +00531   // end table
                                        +00532   $r.='</TABLE> ';
                                        +00533   $r.='<DIV style="padding:30px;font-size:14px">';
                                        +00534   $r.="Total HTVA =".round( $sum_march,2)." <br>";
                                        +00535   $r.="Total = ".round($sum_with_vat,2);
                                        +00536 
                                        +00537  
                                        +00538   $r.="</DIV>";
                                        +00539   if ( $p_doc == 'form' ) {
                                        +00540     // Compute href
                                        +00541     $href=$_SERVER['SCRIPT_NAME'];
                                        +00542     switch ($href)
                                        +00543       {
                                        +00544         // user_jrn.php
                                        +00545       case '/user_jrn.php':
                                        +00546         $href="user_jrn.php?action=record&p_jrn=$p_jrn";
                                        +00547         break;
                                        +00548       case '/commercial.php':
                                        +00549         $href="commercial.php?p_action=facture&sa=record&p_jrn=$p_jrn";
                                        +00550         break;
                                        +00551       default:
                                        +00552         echo_error('user_form_ven.php',__LINE__,'Erreur invalid request uri');
                                        +00553         exit (-1);
                                        +00554       }
                                        +00555       
                                        +00556 
                                        +00557     $r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="'.$href.'">';
                                        +00558 
                                        +00559     // check for upload piece
                                        +00560     $file=new widget("file");
                                        +00561     $file->table=1;
                                        +00562     $r.="<hr>";
                                        +00563     $r.= "<table>"; 
                                        +00564     $r.="<TR>".$file->IOValue("pj","","Pièce justificative")."</TR>";
                                        +00565     $r.="</table>";
                                        +00566     $r.="<hr>";
                                        +00567 
                                        +00568 
                                        +00569     // if we were in the management module, appl. propose to generate an invoice
                                        +00570     if ( $_SERVER['SCRIPT_NAME'] == '/commercial.php')
                                        +00571       {
                                        +00572         // if a template exists propose to choose an invoice template
                                        +00573         if ( CountSql($p_cn,
                                        +00574                       "select md_id,md_name from document_modele where md_type=4") > 0 )
                                        +00575           {
                                        +00576             $r.='G&eacute;n&eacute;rer une facture <input type="checkbox" name="gen_invoice" CHECKED>';
                                        +00577             // We propose to generate  the invoice and some template
                                        +00578             $doc_gen=new widget("select");
                                        +00579             $doc_gen->name="gen_doc";
                                        +00580             $doc_gen->value=make_array($p_cn,
                                        +00581                                        "select md_id,md_name from document_modele where md_type=4");
                                        +00582             $r.=$doc_gen->IOValue();  
                                        +00583 
                                        +00584             $r.="<hr>";
                                        +00585           }
                                        +00586       }
                                        +00587 
                                        +00588     
                                        +00589     $r.=$data;
                                        +00590     if ( $sum_with_vat != 0 ) {
                                        +00591       $r.='<INPUT TYPE="SUBMIT" name="record_and_print_invoice" value="Sauver" >';
                                        +00592     }
                                        +00593     $r.='<INPUT TYPE="SUBMIT" name="correct_new_invoice" value="Corriger">';
                                        +00594     
                                        +00595     $r.='</FORM>';
                                        +00596   } 
                                        +00597   return $r;
                                        +00598   
                                        +00599 }
                                        +
                                        +

                                        +

                                        @@ -327,10 +857,138 @@ RecordInvoice($p_cn,$p_array,$p_user,$p_jrn)

                                        Definition at line 627 of file user_form_ven.php.

                                        -References $comment, $e, $i, $poste, $r, $Res, $seq, $t, Commit(), ComputeTotalVat(), ComputeVat(), echo_debug(), ExecSql(), exit, FormatString(), GetTvaPoste(), InsertJrn(), InsertJrnx(), InsertStockGoods(), isNumber(), NextSequence(), Rollback(), save_upload_document(), SetInternalCode(), and StartSql(). +References $comment, $e, $i, $poste, $r, $Res, $seq, $t, Commit(), ComputeTotalVat(), ComputeVat(), echo_debug(), ExecSql(), exit, FormatString(), GetTvaPoste(), InsertJrn(), InsertJrnx(), InsertStockGoods(), isNumber(), NextSequence(), Rollback(), save_upload_document(), SetInternalCode(), and StartSql().

                                        00628 {
                                        +00629   foreach ( $p_array as $v => $e)
                                        +00630   {
                                        +00631     ${"$v"}=$e;
                                        +00632   }
                                        +00633 
                                        +00634   // Get the default period
                                        +00635   $periode=$p_user->GetPeriode();
                                        +00636   $amount=0.0;
                                        +00637   $amount_jrn=0.0;
                                        +00638   // Computing total customer
                                        +00639   //--
                                        +00640   for ($i=0;$i<$nb_item;$i++) {
                                        +00641     // store quantity & goods in array
                                        +00642     $a_good[$i]=${"e_march$i"};
                                        +00643     $a_quant[$i]=${"e_quant$i"};
                                        +00644     $a_price[$i]=0;
                                        +00645     $a_vat[$i]=${"e_march$i"."_tva_id"};
                                        +00646     // check whether the price is set or no
                                        +00647     if ( isNumber(${"e_march$i"."_sell"}) == 0 ) {
                                        +00648       if ( $a_good[$i] != "" ) {
                                        +00649              // If the price is not set we have to find it from the database
                                        +00650              $a_price[$i]=GetFicheAttribut($p_cn,$a_good[$i],ATTR_DEF_PRIX_VENTE);
                                        +00651            } 
                                        +00652     } else {
                                        +00653       // The price is valid
                                        +00654       $a_price[$i]=${"e_march$i"."_sell"};
                                        +00655     }
                                        +00656     $cost=$a_price[$i]*$a_quant[$i];
                                        +00657     $amount+=$cost;
                                        +00658     $amount_jrn+=$cost;
                                        +00659   }// for
                                        +00660 
                                        +00661   $comm=FormatString($e_comm);
                                        +00662   // Compute VAT
                                        +00663   //--
                                        +00664   $a_vat_new=ComputeTotalVat($p_cn,$a_good,$a_quant,$a_price,$a_vat);
                                        +00665   $sum_vat=0.0;
                                        +00666   if ( $a_vat_new != null ){
                                        +00667     foreach ( $a_vat_new as $element => $t) {
                                        +00668       echo_debug('user_form_ven.php',__LINE__," a_vat element $element t $t");
                                        +00669       $sum_vat+=$t;
                                        +00670       echo_debug('user_form_ven.php',__LINE__,"sum_vat = $sum_vat");
                                        +00671     }
                                        +00672   }
                                        +00673   // First we add in jrnx
                                        +00674         
                                        +00675   // Compute the j_grpt
                                        +00676   $seq=NextSequence($p_cn,'s_grpt');
                                        +00677 
                                        +00678 
                                        +00679   // Debit = client
                                        +00680   $poste=GetFicheAttribut($p_cn,$e_client,ATTR_DEF_ACCOUNT);
                                        +00681   StartSql($p_cn);      
                                        +00682   $r=InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$poste,$e_date,round($amount,2)+round($sum_vat,2),$seq,$periode);
                                        +00683   if ( $r == false) { $Rollback($p_cn);exit("error 'user_form_ven.php' __LINE__");}
                                        +00684 
                                        +00685   // Credit = goods 
                                        +00686   for ( $i = 0; $i < $nb_item;$i++) {
                                        +00687     if ( $a_good[$i] == ""  ) continue;
                                        +00688     $poste=GetFicheAttribut($p_cn,$a_good[$i],ATTR_DEF_ACCOUNT);
                                        +00689           
                                        +00690     // don't record operation of 0
                                        +00691     if ( $a_price[$i]*$a_quant[$i] == 0 ) continue;
                                        +00692           
                                        +00693     // record into jrnx
                                        +00694     $j_id=InsertJrnx($p_cn,'c',$p_user->id,$p_jrn,$poste,$e_date,round($a_price[$i]*$a_quant[$i],2),$seq,$periode);
                                        +00695     if ( $j_id == false) { $Rollback($p_cn);exit("error 'user_form_ven.php' __LINE__");}
                                        +00696     // always save quantity but in withStock we can find what card need a stock management
                                        +00697     if (  InsertStockGoods($p_cn,$j_id,$a_good[$i],$a_quant[$i],'c') == false ) {
                                        +00698       $Rollback($p_cn);exit("error 'user_form_ven.php' __LINE__");}
                                        +00699     } // end loop
                                        +00700   
                                        +00701   // Insert Vat
                                        +00702 
                                        +00703   if ( $a_vat_new  !=  null  ) // no vat
                                        +00704 
                                        +00705     {
                                        +00706       foreach ($a_vat_new as $tva_id => $tva_amount ) {
                                        +00707         $poste=GetTvaPoste($p_cn,$tva_id,'c');
                                        +00708         if ($tva_amount == 0 ) continue;
                                        +00709         $r=InsertJrnx($p_cn,'c',$p_user->id,$p_jrn,$poste,$e_date,round($tva_amount,2),$seq,$periode);
                                        +00710         if ( $r == false ) { Rollback($p_cn); exit(" Error 'user_form_ven.php' __LINE__");}
                                        +00711       
                                        +00712       }
                                        +00713     }
                                        +00714   echo_debug('user_form_ven.php',__LINE__,"echeance = $e_ech");
                                        +00715   $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"Invoice",round($amount_jrn,2)+round($sum_vat,2),$seq,$periode);
                                        +00716   if ( $r == false ) { Rollback($p_cn); exit(" Error 'user_form_ven.php' __LINE__");}
                                        +00717   // Set Internal code and Comment
                                        +00718   $internal=SetInternalCode($p_cn,$seq,$p_jrn);
                                        +00719   $comment=(FormatString($e_comm) == null )?$internal."  client : ".GetFicheName($p_cn,$e_client):FormatString($e_comm);
                                        +00720 
                                        +00721   // Update and set the invoice's comment 
                                        +00722   $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
                                        +00723   if ( $Res == false ) { Rollback($p_cn); exit(" Error 'user_form_ven.php' __LINE__"); };
                                        +00724 
                                        +00725   if ( isset ($_FILES)) {
                                        +00726     if ( sizeof($_FILES) != 0 )
                                        +00727     save_upload_document($p_cn,$seq);
                                        +00728   }
                                        +00729 
                                        +00730 // save the quantity, then we can make an invoice
                                        +00731   for ( $i=0;$i < $nb_item;$i++) 
                                        +00732         {
                                        +00733         // don't record operation of 0
                                        +00734         if ( $a_price[$i]*$a_quant[$i] == 0 ) continue;
                                        +00735         
                                        +00736         // insert into the table quant_sold
                                        +00737         // Note that negative value are also saved but not the vat !
                                        +00738         if (  $a_vat[$i] == -1) {
                                        +00739                 $computed_vat=0;
                                        +00740                 $vat_code="null";
                                        +00741         } else {
                                        +00742                 $computed_vat=ComputeVat($p_cn,$a_good[$i],$a_quant[$i],$a_price[$i],$a_vat[$i]);
                                        +00743                 $vat_code=$a_vat[$i];
                                        +00744         }
                                        +00745          $r=ExecSql($p_cn,"select insert_quant_sold ".
                                        +00746                     "('".$internal."','".$a_good[$i]."',".$a_quant[$i].",".$a_price[$i]*$a_quant[$i].
                                        +00747                     ",".$computed_vat.
                                        +00748                     ",".$vat_code.",'".$e_client."')");
                                        +00749          if ( $r == false ) { Rollback($p_cn); exit(" Error 'user_form_ven.php' __LINE__"); };
                                        +00750         }
                                        +00751   Commit($p_cn);
                                        +00752   return array($internal,$comment);
                                        +00753 }
                                        +
                                        +

                                        + -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__impress_8php-source.html b/doc/developper/html/user__impress_8php-source.html index d63e79ab4..7fb96b021 100644 --- a/doc/developper/html/user__impress_8php-source.html +++ b/doc/developper/html/user__impress_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_impress.php Source File +phpcompta: user_impress.php Source File +html

                                        user_impress.php

                                        Go to the documentation of this file.
                                        00001 <?
                                         00002 /*
                                         00003  *   This file is part of PhpCompta.
                                        @@ -107,7 +107,7 @@
                                         00102 
                                         00103 html_page_stop();
                                         00104 ?>
                                        -

                                        Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__impress_8php.html b/doc/developper/html/user__impress_8php.html index 2ff988395..313ace99a 100644 --- a/doc/developper/html/user__impress_8php.html +++ b/doc/developper/html/user__impress_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_impress.php File Reference +phpcompta: user_impress.php File Reference +html

                                        user_impress.php File Reference

                                        Main page for the printing. More...

                                        @@ -281,7 +281,7 @@ Definition at line 80

                                        Definition at line 95 of file user_impress.php.

                                        -Referenced by action::Confirm(), action::Display(), action::get(), action::myList(), Document::Replace(), action::SaveStage2(), and action::Update(). +Referenced by action::Confirm(), action::Display(), action::get(), action::myList(), Document::Replace(), action::SaveStage2(), and action::Update().

                                        @@ -361,7 +361,7 @@ Referenced by ParseFor Definition at line 85 of file user_impress.php. -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__jrn_8php-source.html b/doc/developper/html/user__jrn_8php-source.html index 61d3909ba..530cdebab 100644 --- a/doc/developper/html/user__jrn_8php-source.html +++ b/doc/developper/html/user__jrn_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_jrn.php Source File +phpcompta: user_jrn.php Source File +html

                                        user_jrn.php

                                        Go to the documentation of this file.
                                        00001 <?
                                         00002 /*
                                         00003  *   This file is part of PhpCompta.
                                        @@ -136,7 +136,7 @@
                                         00131 html_page_stop();
                                         00132 
                                         00133 ?>
                                        -

                                        Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__jrn_8php.html b/doc/developper/html/user__jrn_8php.html index 523f8326f..2c4045f3d 100644 --- a/doc/developper/html/user__jrn_8php.html +++ b/doc/developper/html/user__jrn_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_jrn.php File Reference +phpcompta: user_jrn.php File Reference +html

                                        user_jrn.php File Reference

                                        Main page for encoding in the ledger. More...

                                        @@ -210,7 +210,7 @@ Definition at line 35 Definition at line 66 of file user_jrn.php. -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__login_8php-source.html b/doc/developper/html/user__login_8php-source.html index e7108e4d6..88650e741 100644 --- a/doc/developper/html/user__login_8php-source.html +++ b/doc/developper/html/user__login_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_login.php Source File +phpcompta: user_login.php Source File +html

                                        user_login.php

                                        Go to the documentation of this file.
                                        00001 
                                         00002 
                                         00003 <?
                                        @@ -55,7 +55,7 @@
                                         00050 <?
                                         00051 html_page_stop();
                                         00052 ?>
                                        -

                                        Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__login_8php.html b/doc/developper/html/user__login_8php.html index f54e87362..d641892b2 100644 --- a/doc/developper/html/user__login_8php.html +++ b/doc/developper/html/user__login_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_login.php File Reference +phpcompta: user_login.php File Reference +html

                                        user_login.php File Reference

                                        Welcome page where the folder and module are choosen. More...

                                        @@ -129,7 +129,7 @@ Definition at line 4431 of file user_login.php. -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__menu_8php-source.html b/doc/developper/html/user__menu_8php-source.html index 937911b94..10dfac37f 100644 --- a/doc/developper/html/user__menu_8php-source.html +++ b/doc/developper/html/user__menu_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_menu.php Source File +phpcompta: user_menu.php Source File +include

                                        user_menu.php

                                        Go to the documentation of this file.
                                        00001 <?
                                         00002 
                                         00003 /*
                                        @@ -308,7 +308,7 @@
                                         00396   if ( ! isset ($p_qcode)) $p_qcode="";
                                         00397 
                                         00398 
                                        -00399   if ( $p_mont_sel != "" )  $opt.='<OPTION value="'.$p_mont_sel.'" SELECTED> '.$p_mont_sel;
                                        +00399   if ( $p_mont_sel != "" )  $opt.='<OPTION value="'.$p_mont_sel.'" SELECTED> '.$p_mont_sel;
                                         00400   $r="";
                                         00401  
                                         00402   //  $r.= '<div style="border-style:outset;border-width:1pt;">';
                                        @@ -331,7 +331,7 @@
                                         00419   $r.= ' <INPUT TYPE="TEXT" NAME="s_montant" SIZE="10" VALUE="'.$p_s_montant.'"></TD>';
                                         00420   $r.= "</TR><TR>";
                                         00421   $r.="<TD> Internal code</td>";
                                        -00422   $r.='<TD><input type="text" name="s_internal" value="'.$p_s_internal.'"></td>';
                                        +00422   $r.='<TD><input type="text" name="s_internal" value="'.$p_s_internal.'"></td>';
                                         00423 
                                         00424   $r.="</TD></TR></TABLE></td><TD><table>";
                                         00425 
                                        @@ -346,7 +346,7 @@
                                         00434   $r.= "<TR>";
                                         00435  
                                         00436  $A=new widget('js_search_only');
                                        -00437  $A->name='qcode';
                                        +00437  $A->name='qcode';
                                         00438  $A->value=$p_qcode;
                                         00439  $A->extra="";
                                         00440  $A->table=1;
                                        @@ -536,7 +536,7 @@
                                         00712 }
                                         00713 
                                         00714 ?>
                                        -

                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__menu_8php.html b/doc/developper/html/user__menu_8php.html index 2baec4493..1203d0269 100644 --- a/doc/developper/html/user__menu_8php.html +++ b/doc/developper/html/user__menu_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_menu.php File Reference +phpcompta: user_menu.php File Reference +include

                                        user_menu.php File Reference

                                        Nearly all the menu are here, some of them returns a HTML string, others echo directly the result. More...

                                        @@ -126,7 +126,23 @@ Definition at line 341 References echo_debug().

                                        -Referenced by ShowMenuJrn(). +Referenced by ShowMenuJrn().

                                        00342 {
                                        +00343         $quick = $title[0];
                                        +00344         if(array_key_exists($quick, $access_key_list))
                                        +00345         {
                                        +00346                 echo_debug(" key exists: " . $quick);
                                        +00347                 return get_quick_key(substr($title, 1), $access_key_list);
                                        +00348         } else
                                        +00349         {
                                        +00350                 echo_debug(" new key: " . $quick);
                                        +00351         }
                                        +00352         $access_key_list[$quick] = $quick;
                                        +00353         
                                        +00354         return $quick;
                                        +00355 }
                                        +
                                        +

                                        +

                                        @@ -180,7 +196,39 @@ Definition at line 90 References $array, $cn, $filter, $Res, $sql, DbConnect(), and ExecSql().

                                        -Referenced by u_ShowDossier(). +Referenced by u_ShowDossier().

                                        00091 {
                                        +00092   $filter="";
                                        +00093   if ($p_admin==0) {
                                        +00094     // show only available folders
                                        +00095     // if user is not an admin
                                        +00096     $sql="select distinct dos_id,dos_name,dos_description from ac_users 
                                        +00097                   natural join jnt_use_dos 
                                        +00098                   natural join  ac_dossier 
                                        +00099                   join  priv_user on ( priv_jnt=jnt_id)
                                        +00100           where use_active=1 
                                        +00101          and use_login='$p_user' 
                                        +00102          and priv_priv != 'NO' ";
                                        +00103 
                                        +00104   } else {
                                        +00105     $sql="select distinct dos_id,dos_name,dos_description from ac_users 
                                        +00106                   natural join jnt_use_dos 
                                        +00107                   natural join  ac_dossier 
                                        +00108       where  use_active=1 ";
                                        +00109   }
                                        +00110   include_once("postgres.php");
                                        +00111   $cn=DbConnect();
                                        +00112   $Res=ExecSql($cn,$sql);
                                        +00113   $max=pg_numRows($Res);
                                        +00114   if ( $max == 0 ) return 0;
                                        +00115 
                                        +00116   for ($i=0;$i<$max;$i++) {
                                        +00117     $array[]=pg_fetch_array($Res,$i);
                                        +00118   }
                                        +00119   return $array;
                                        +00120 }
                                        +
                                        +

                                        +

                                        @@ -230,7 +278,20 @@ Open the first legder automaticaly.

                                        Definition at line 186 of file user_menu.php.

                                        -References $l_line, $Ret, DbConnect(), and ExecSql(). +References $l_line, $Ret, DbConnect(), and ExecSql().

                                        00187 {
                                        +00188   include_once("postgres.php");
                                        +00189   
                                        +00190   //get db connection
                                        +00191   $Cn=DbConnect($p_dossier);  
                                        +00192   //execute query
                                        +00193   $Ret=ExecSql($Cn,"select min(jrn_def_id) from jrn_def where jrn_def_type='".$p_type."';");
                                        +00194   $l_line=pg_fetch_array($Ret,0);
                                        +00195   return $l_line[0];
                                        +00196   //return 0;
                                        +00197 }
                                        +
                                        +

                                        +

                                        @@ -261,7 +322,20 @@ MenuAdmin

                                        Definition at line 556 of file user_menu.php.

                                        -References ShowItem(). +References ShowItem().

                                        00557 {
                                        +00558   $item=array (array("admin_repo.php?action=user_mgt","Utilisateurs"),
                                        +00559                array("admin_repo.php?action=dossier_mgt","Dossiers"),
                                        +00560                array("admin_repo.php?action=modele_mgt","Modèles"),
                                        +00561                array("login.php","Accueil"),
                                        +00562                array("logout.php","Logout")
                                        +00563                );
                                        +00564 
                                        +00565   $menu=ShowItem($item,'H');
                                        +00566   return $menu;
                                        +00567 }
                                        +
                                        +

                                        +

                                        @@ -301,7 +375,26 @@ Show the menu in the jrn page.

                                        Definition at line 629 of file user_menu.php.

                                        -References $l_line, $Max, $Ret, DbConnect(), and ExecSql(). +References $l_line, $Max, $Ret, DbConnect(), and ExecSql().

                                        00630 {
                                        +00631     echo '<TABLE>';
                                        +00632     echo '<TR><TD class="mtitle"><A class="mtitle" HREF="jrn_add.php">Création </A></TD></TR>';
                                        +00633     include_once("postgres.php");
                                        +00634     $Cn=DbConnect($p_dossier);
                                        +00635     $Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_name,
                                        +00636                              jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc 
                                        +00637                              from jrn_def join jrn_type on jrn_def_type=jrn_type_id");
                                        +00638     $Max=pg_NumRows($Ret);
                                        +00639     for ($i=0;$i<$Max;$i++) {
                                        +00640       $l_line=pg_fetch_array($Ret,$i);
                                        +00641       printf ('<TR><TD class="mtitle"><A class="mtitle" HREF="jrn_detail.php?p_jrn=%s">%s</A></TD></TR>',
                                        +00642               $l_line['jrn_def_id'],$l_line['jrn_def_name']);
                                        +00643 
                                        +00644     }
                                        +00645     echo "</TABLE>";
                                        +00646 }
                                        +
                                        +

                                        +

                                        @@ -341,7 +434,21 @@ Return a string containing the menu main menu when you click on Journaux.

                                        Definition at line 502 of file user_menu.php.

                                        -References $p_array, $result, and ShowItem(). +References $p_array, $result, and ShowItem().

                                        00503 {
                                        +00504 
                                        +00505  $p_array=array(
                                        +00506                 array("user_jrn.php?jrn_type=NONE" ,"Grand Livre"),
                                        +00507                 array("user_jrn.php?jrn_type=VEN" ,"Entrée"),
                                        +00508                 array("user_jrn.php?jrn_type=ACH","Dépense"),
                                        +00509                 array("user_jrn.php?jrn_type=FIN","Financier"),
                                        +00510                 array("user_jrn.php?jrn_type=OD","Op. Diverses")
                                        +00511                  );
                                        +00512  $result=ShowItem($p_array,'H',"cell","mtitle",$p_menu);
                                        +00513  return $result;
                                        +00514 }
                                        +
                                        +

                                        +

                                        @@ -381,7 +488,27 @@ build the menu of user_advanced.ph

                                        Definition at line 476 of file user_menu.php.

                                        -References $left_menu, $r, Centralise(), and ShowItem(). +References $left_menu, $r, Centralise(), and ShowItem().

                                        00476                                        {
                                        +00477 // Show the left menu
                                        +00478 $left_menu=ShowItem(array(
                                        +00479                           //('rapprt.php','Rapprochement'),
                                        +00480                           array('jrn_update.php','Journaux'),
                                        +00481                           array('user_advanced.php?p_action=periode','Periode'),
                                        +00482                           array('central.php','Centralise'),
                                        +00483                           array('pcmn_update.php?p_start=1','Plan Comptable'),
                                        +00484                           array('stock.php','Stock'),
                                        +00485                           array('form.php','Rapport'),
                                        +00486                           array('import.php','Import Banque'),
                                        +00487                           array('ecrit_ouv.php','Ecriture ouverture')
                                        +00488                         
                                        +00489                           ),
                                        +00490                     'H',"cell","mtitle",$default);
                                        +00491  $r='<div class="u_subtmenu">'.$left_menu."</div>";
                                        +00492 return $r;
                                        +00493 }
                                        +
                                        +

                                        +

                                        @@ -432,7 +559,52 @@ show the top menu for the user profile and highight the selected one

                                        Definition at line 132 of file user_menu.php.

                                        -References $default, $p_array, $r, $result, echo_debug(), ShowItem(), and width. +References $default, $p_array, $r, $result, echo_debug(), ShowItem(), and width.

                                        00133 {
                                        +00134   include_once("postgres.php");
                                        +00135 
                                        +00136   // find our current menu
                                        +00137   $default=basename($_SERVER['SCRIPT_NAME']);
                                        +00138   switch ($default) {
                                        +00139   case "user_jrn.php":
                                        +00140     $default.="?show";
                                        +00141     break;
                                        +00142   case "recherche.php":
                                        +00143     $default.="?p_dossier=$p_dossier";
                                        +00144     break;
                                        +00145   case "fiche.php":
                                        +00146     $default.="?p_dossier=$p_dossier";
                                        +00147     break;
                                        +00148   }
                                        +00149   if ( $p_high !== "" ) $default=$p_high;
                                        +00150 
                                        +00151   echo_debug('user_menu.php',__LINE__,'defaut is '.$default);
                                        +00152 
                                        +00153   $p_array=array(array("user_jrn.php?show","Journaux","Les journaux permettent d'encoder toutes les opérations"),
                                        +00154                  array("recherche.php?p_dossier=$p_dossier","Recherche","Pour retrouver une opération"),
                                        +00155                  array("fiche.php?p_dossier=$p_dossier","Fiche","Ajouter, modifier ou effacer des fiches"),
                                        +00156                  array("user_impress.php","Impression","Impression"),
                                        +00157                  array("user_advanced.php","Avancé","Opérations délicates"),
                                        +00158 
                                        +00159                  array('user_pref.php','Preference',"Préférence de l'utilisateur"),
                                        +00160                  array('parametre.php?dos='.$_SESSION['g_dossier'],"Paramètre"),
                                        +00161                  array('commercial.php?dos='.$_SESSION['g_dossier'],"Gestion"),
                                        +00162                  array('login.php','Accueil',"Accueil"),
                                        +00163                  array('logout.php','logout',"Sortie")
                                        +00164                  );
                                        +00165 
                                        +00166   $result=ShowItem($p_array,'H',"mtitle","mtitle",$default,' width="100%"');
                                        +00167 
                                        +00168   $r="<H2 class=\"info\">Comptabilit&eacute;  ".$_SESSION['g_name']." </H2>";
                                        +00169   $r.=$result;
                                        +00170   return $r;
                                        +00171 
                                        +00172 
                                        +00173 
                                        +00174 
                                        +00175 }
                                        +
                                        +

                                        +

                                        @@ -472,7 +644,26 @@ Show the left menu for the report (add a report, view it).

                                        Definition at line 682 of file user_menu.php.

                                        -References $cn, $l_line, $Max, $Ret, DbConnect(), and ExecSql(). +References $cn, $l_line, $Max, $Ret, DbConnect(), and ExecSql().

                                        00682                                         {
                                        +00683      $cn=DbConnect($p_dossier);
                                        +00684     echo '<div class="lmenu">';
                                        +00685     echo '<TABLE>';
                                        +00686     echo '<TR><TD class="mtitle"><A class="mtitle" HREF="form.php?action=add">Ajout</A></TD></TR>';
                                        +00687     $Ret=ExecSql($cn,"select fr_id, fr_label 
                                        +00688                              from formdef order by fr_label");
                                        +00689     $Max=pg_NumRows($Ret);
                                        +00690     for ($i=0;$i<$Max;$i++) {
                                        +00691       $l_line=pg_fetch_array($Ret,$i);
                                        +00692       printf ('<TR><TD class="mtitle"><A class="mtitle" HREF="form.php?action=view&fr_id=%s">%s</A></TD></TR>',
                                        +00693               $l_line['fr_id'],$l_line['fr_label']);
                                        +00694 
                                        +00695     }
                                        +00696     echo "</TABLE>";
                                        +00697     echo '</div>';
                                        +00698 }
                                        +
                                        +

                                        +

                                        @@ -511,7 +702,17 @@ References $cn,

                                        Definition at line 576 of file user_menu.php.

                                        -References ShowItem(). +References ShowItem().

                                        00577 {
                                        +00578   $base="parametre.php?p_action=document&sa=";
                                        +00579   $sub_menu=ShowItem(
                                        +00580                      array(array($base."add_document","Ajout"))
                                        +00581                      ,'V',"cell","mtitle");
                                        +00582   return $sub_menu;
                                        +00583 
                                        +00584 }
                                        +
                                        +

                                        +

                                        @@ -552,7 +753,30 @@ Show the menu for the card management.

                                        Definition at line 526 of file user_menu.php.

                                        -References $cn, $l_line, $Max, $Res, DbConnect(), and ExecSql(). +References $cn, $l_line, $Max, $Res, DbConnect(), and ExecSql().

                                        00527 {
                                        +00528      $cn=DbConnect($p_dossier);
                                        +00529      echo '<div class="lmenu">';
                                        +00530      echo '<TABLE>';
                                        +00533       echo '<TR><TD colspan="3" class="mtitle">
                                        +00534           <A class="mtitle" HREF="fiche.php?action=add_modele&fiche=modele">Creation</A></TD></TR>';
                                        +00535      $Res=ExecSql($cn,"select fd_id,fd_label from fiche_def order by fd_label");
                                        +00536      $Max=pg_NumRows($Res);
                                        +00537      for ( $i=0; $i < $Max;$i++) {
                                        +00538        $l_line=pg_fetch_array($Res,$i);
                                        +00539        printf('<TR><TD class="cell">%s</TD><TD class="mshort"><A class="mtitle" HREF="fiche.php?action=vue&fiche=%d">Voir</A>
                                        +00540                </TD>
                                        +00541                <TD class="mshort"><A class="mtitle" HREF="fiche.php?action=modifier&fiche=%d">Modifier</A></TD>
                                        +00542                </TR>',
                                        +00543             $l_line['fd_label'],
                                        +00544             $l_line['fd_id'],
                                        +00545             $l_line['fd_id']);
                                        +00546      }
                                        +00547      echo "</TABLE>";
                                        +00548      echo '</div>';
                                        +00549 }
                                        +
                                        +

                                        +

                                        @@ -584,7 +808,17 @@ Show the menu for importing, verify and transfert Bank CSV.

                                        Returns:
                                        nothing

                                        -Definition at line 705 of file user_menu.php. +Definition at line 705 of file user_menu.php.

                                        00705                          {
                                        +00706     echo '<TABLE>';
                                        +00707     echo '<TR><TD class="mtitle"><A class="mtitle" HREF="import.php?action=import">Importer CSV</A></TD></TR>';
                                        +00708     echo '<TR><TD class="mtitle"><A class="mtitle" HREF="import.php?action=verif">Verif CSV</A></TD></TR>';
                                        +00709     echo '<TR><TD class="mtitle"><A class="mtitle" HREF="import.php?action=transfer">Transfert CSV</A></TD></TR>';
                                        +00710     
                                        +00711     echo "</TABLE>";
                                        +00712 }
                                        +
                                        +

                                        +

                                        @@ -641,7 +875,38 @@ Show the menu of the jrn depending of its type, check with the security.

                                        Definition at line 299 of file user_menu.php.

                                        -References $action, $num, $Res, $ret, ExecSql(), and get_quick_key(). +References $action, $num, $Res, $ret, ExecSql(), and get_quick_key().

                                        00300 {
                                        +00301 
                                        +00302   $Res=ExecSql($p_cn,"select ja_name,ja_url,ja_action,ja_desc from jrn_action  where ja_jrn_type='$p_jrn_type'
                                        +00303                       order by ja_id");
                                        +00304   $num=pg_NumRows($Res);
                                        +00305   if ($num==0)    return "";
                                        +00306   // Retrieve in the database the menu
                                        +00307   $ret="<TABLE>";
                                        +00308   $access_key_list = array();
                                        +00309   for ($i=0;$i<$num;$i++) {
                                        +00310     $action=pg_fetch_array($Res,$i);
                                        +00311     $access_key=get_quick_key($action['ja_name'],$access_key_list);
                                        +00312     $lib=str_replace($access_key,'<u>'.$access_key.'</u>',$action['ja_name']);
                                        +00313 
                                        +00314     $ret.=sprintf('<TR><TD class="cell"><A class="mtitle" accesskey="%s" title="%s" '.
                                        +00315                   'HREF="%s?%s&p_jrn=%s&jrn_type=%s">%s</A></td></tR>',
                                        +00316                   $access_key, 
                                        +00317                   $action['ja_desc'], 
                                        +00318                   $action['ja_url'],
                                        +00319                   $action['ja_action'], 
                                        +00320                   $p_jrn, 
                                        +00321                   $_REQUEST['jrn_type'],
                                        +00322                   $lib);
                                        +00323 
                                        +00324   }
                                        +00325   $ret.='</TABLE>';
                                        +00326   return $ret;
                                        +00327 
                                        +00328 }
                                        +
                                        +

                                        +

                                        @@ -707,7 +972,84 @@ ShowMenuJrnUser($p_dossier,$p_type,$p_jrn)

                                        Definition at line 212 of file user_menu.php.

                                        -References $l_line, $Max, $Ret, $right, $User, CheckJrn(), DbConnect(), echo_debug(), and ExecSql(). +References $l_line, $Max, $Ret, $right, $User, CheckJrn(), DbConnect(), echo_debug(), and ExecSql().

                                        00213 {
                                        +00214   include_once ("debug.php");
                                        +00215   include_once("constant.php");
                                        +00216   include_once("class_user.php");
                                        +00217   echo_debug('user_menu.php',__LINE__,"U_SHOWMENUJRNUSER PTYPE=$p_type");
                                        +00218 
                                        +00219   echo '<TABLE><TR>';
                                        +00220   include_once("postgres.php");
                                        +00221   
                                        +00222   
                                        +00223   $Cn=DbConnect($p_dossier);
                                        +00224   
                                        +00225   $User=new cl_user($Cn);
                                        +00226   $User->Check();
                                        +00227   if ( $User->Admin() ==0) {
                                        +00228     $Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_type,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
                                        +00229                                jrn_deb_max_line,jrn_cred_max_line
                                        +00230                              from jrn_def join jrn_type on jrn_def_type=jrn_type_id
                                        +00231                              join user_sec_jrn on uj_jrn_id=jrn_def_id 
                                        +00232                              where
                                        +00233                              uj_login='".$User->id."'
                                        +00234                              and uj_priv !='X'
                                        +00235                              and jrn_def_type='$p_type' order by jrn_Def_id
                                        +00236                              ");
                                        +00237     } else {
                                        +00238       $Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_type,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_deb_max_line,jrn_cred_max_line,
                                        +00239                             jrn_type_id,jrn_desc,'W' as uj_priv
                                        +00240                              from jrn_def join jrn_type on jrn_def_type=jrn_type_id where
                                        +00241                               jrn_def_type='$p_type' order by jrn_Def_id");
                                        +00242 
                                        +00243     } 
                                        +00244     $Max=pg_NumRows($Ret);
                                        +00245     include_once("check_priv.php");
                                        +00246 
                                        +00247     for ($i=0;$i<$Max;$i++) {
                                        +00248       $l_line=pg_fetch_array($Ret,$i);
                                        +00249       // Admin have always rights
                                        +00250       if ( $User->Admin() == 0 ){
                                        +00251         $right=CheckJrn($p_dossier,$_SESSION['g_user'],$l_line['jrn_def_id']);
                                        +00252       }else {
                                        +00253         $right=3;
                                        +00254       }
                                        +00255 
                                        +00256       if ( $right > 0 ) {
                                        +00257         // Minimum Lecture 
                                        +00258         echo_debug('user_menu.php',__LINE__,"p_jrn = $p_jrn ");
                                        +00259         if ( $l_line['jrn_def_id'] != $p_jrn ) {
                                        +00260           $href=$_SERVER["SCRIPT_NAME"];
                                        +00261           $add="";
                                        +00262           // if the SCRIPT_NAME == commercial.php, we need to add the parameter
                                        +00263           // p_action=facture
                                        +00264           if ( $href=="/commercial.php" ) 
                                        +00265             {
                                        +00266               $add='&p_action='.$_REQUEST['p_action'];
                                        +00267             }
                                        +00268           echo '<TD class="cell">';
                                        +00269           printf ('<A class="mtitle" HREF="%s?jrn_type=%s&p_jrn=%s%s">%s</A></TD>',
                                        +00270                   $href,
                                        +00271                   $l_line['jrn_def_type'],
                                        +00272                   $l_line['jrn_def_id'],
                                        +00273                   $add,
                                        +00274                   $l_line['jrn_def_name']
                                        +00275                   );
                                        +00276         } else
                                        +00277           {
                                        +00278             echo '<TD class="selectedcell">'. $l_line['jrn_def_name'].'</TD>';
                                        +00279           }
                                        +00280       }// if right
                                        +00281     }// for
                                        +00282     if ( $p_extra !="" ) echo $p_extra;
                                        +00283     echo '</TR>';
                                        +00284     echo "</TABLE>";
                                        +00285     //echo '</div>';
                                        +00286 
                                        +00287 }
                                        +
                                        +

                                        +

                                        @@ -747,7 +1089,29 @@ Show the parameter menu.

                                        Definition at line 596 of file user_menu.php.

                                        -References ShowItem(), and width. +References ShowItem(), and width.

                                        00597 {
                                        +00598     $sub_menu=ShowItem(array(
                                        +00599                           
                                        +00600                           array('parametre.php?p_action=company','Sociétés'),
                                        +00601                           array('parametre.php?p_action=devise','Devises'),
                                        +00602                           array('parametre.php?p_action=tva','Tva'),
                                        +00603                           array('parametre.php?p_action=poste','Poste Comptable'),
                                        +00604                           array('parametre.php?p_action=fiche','Fiche'),
                                        +00605                           array('user_sec.php','Sécurité'),
                                        +00606                           array('parametre.php?p_action=document','Document'),
                                        +00607                           array('commercial.php?dos='.$_SESSION['g_dossier'],"Gestion"),
                                        +00608                           array('user_compta.php?dos='.$_SESSION['g_dossier'],"Comptabilité"),
                                        +00609 
                                        +00610                           array('login.php','Accueil',"Accueil"),
                                        +00611                           array('logout.php','logout',"Sortie")
                                        +00612                           ),
                                        +00613                     'H',"mtitle","mtitle",$p_action,' width="100%"');
                                        +00614     return $sub_menu;
                                        +00615 
                                        +00616 }
                                        +
                                        +

                                        +

                                        @@ -785,7 +1149,20 @@ Show the menu from the pcmn page.

                                        Returns:
                                        nothing

                                        -Definition at line 659 of file user_menu.php. +Definition at line 659 of file user_menu.php.

                                        00660 {
                                        +00661     echo '<TABLE>';
                                        +00662     echo '<TR><TD class="mtitle"><A class="mtitle"  HREF="pcmn_update.php?p_start=1">1 Immobilisé </A></TD></TR>';
                                        +00663     echo '<TR><TD class="mtitle"><A class="mtitle"  HREF="pcmn_update.php?p_start=2">2 Actif a un an au plus</A></TD></TR>';
                                        +00664     echo '<TR><TD class="mtitle"><A class="mtitle"  HREF="pcmn_update.php?p_start=3">3 Stock et commande</A></TD></TR>';
                                        +00665     echo '<TR><TD class="mtitle"><A class="mtitle"  HREF="pcmn_update.php?p_start=4">4 Compte tiers</A></TD></TR>';
                                        +00666     echo '<TR><TD class="mtitle"><A class="mtitle" HREF="pcmn_update.php?p_start=5">5 Actif</A></TD></TR>';
                                        +00667     echo '<TR><TD class="mtitle"><A class="mtitle"  HREF="pcmn_update.php?p_start=6">6 Charges</A></TD></TR>';
                                        +00668     echo '<TR><TD class="mtitle"><A class="mtitle" HREF="pcmn_update.php?p_start=7">7 Produits</A></TD></TR>';
                                        +00669     echo "</TABLE>";
                                        +00670 }
                                        +
                                        +

                                        +

                                        @@ -835,7 +1212,49 @@ Show all the available folder for the users at the login page.

                                        Definition at line 37 of file user_menu.php.

                                        -References $desc, $i, $p_array, $result, $tr, and GetAvailableFolder(). +References $desc, $i, $p_array, $result, $tr, and GetAvailableFolder().

                                        00038 {
                                        +00039   $p_array=GetAvailableFolder($p_user,$p_admin);   
                                        +00040   if ( $p_array == 0 ) return " * Aucun dossier *";
                                        +00041   $result="";
                                        +00042   $result.="<table border=\"0\">";
                                        +00043   $result.='<TR>';
                                        +00044     if ( $p_admin == 1 ) {
                                        +00045       $result.="<TD  class=\"mtitle\" ><A class=\"mtitle\" HREF=\"admin_repo.php\"> Administration  </A></TD>";
                                        +00046     }
                                        +00047     $result.='<TD  class="mtitle" ><A class="mtitle" HREF="logout.php" > Sortir</a></TD>';
                                        +00048     $result.="</TR>";
                                        +00049   $result.="</table>";
                                        +00050   $result.="<TABLE>";
                                        +00051   for ($i=0;$i<sizeof($p_array);$i++) {
                                        +00052     $id=$p_array[$i]['dos_id'];
                                        +00053     $name= $p_array[$i]['dos_name'];
                                        +00054     $desc=$p_array[$i]['dos_description'];
                                        +00055     if ( $i%2 == 0) 
                                        +00056       $tr="odd";
                                        +00057     else $tr="even";
                                        +00058 
                                        +00059     $result.="<TR class=\"$tr\"><TD class=\"$tr\">";
                                        +00060     $result.=$id."  <B>$name</B>";
                                        +00061     $result.="</TD><TD class=\"$tr\">";
                                        +00062     $result.=$desc;
                                        +00063     $result.="</TD><TD class=\"mtitle\">";
                                        +00064     $result.="<A class=\"mtitle\" HREF=\"user_compta.php?dos=$id\">Comptabilité</A>";
                                        +00065     $result.="</TD>";
                                        +00066     $result.="<TD class=\"mtitle\">";
                                        +00067     $result.="<A class=\"mtitle\" HREF=\"commercial.php?dos=$id\">Gestion</A>";
                                        +00068     $result.="</TD>";
                                        +00069     $result.="<TD class=\"mtitle\">";
                                        +00070     $result.="<A class=\"mtitle\" HREF=\"parametre.php?dos=$id\">Paramètres</A>";
                                        +00071     $result.="</TD>";
                                        +00072 
                                        +00073     $result.="</TR>";
                                        +00074   }
                                        +00075   $result.="</TABLE>";
                                        +00076   return $result;
                                        +00077 }
                                        +
                                        +

                                        +

                                        @@ -899,10 +1318,108 @@ Returns the form for the search (module accountancy).

                                        Definition at line 371 of file user_menu.php.

                                        -References $opt, $r, $sp, echo_debug(), METHOD, name, qcode, size, and value. +References $opt, $r, $sp, echo_debug(), METHOD, name, size, and value.

                                        00372 {
                                        +00373   echo_debug('user_menu.php',__LINE__,"u_ShowMenuRecherche($p_cn,$p_array)");
                                        +00374   if ( $p_array != null ) {
                                        +00375     foreach ( $p_array as $key=> $element) {
                                        +00376       ${"p_$key"}=$element;
                                        +00377       echo_debug('user_menu.php',__LINE__,"p_$key =$element;");
                                        +00378     }
                                        +00379   }
                                        +00380 
                                        +00381   // Find the journal property
                                        +00382   //  $JrnProperty=GetJrnProperty($p_cn,$p_jrn);
                                        +00383 
                                        +00384   $opt='<OPTION VALUE="="> =';
                                        +00385   $opt.='<OPTION VALUE="<="> <=';
                                        +00386   $opt.='<OPTION VALUE="<"> <';
                                        +00387   $opt.='<OPTION VALUE=">"> >';
                                        +00388   $opt.='<OPTION VALUE=">="> >=';
                                        +00389   if ( ! isset ($p_date_start)) $p_date_start="";
                                        +00390   if ( ! isset ($p_date_end))   $p_date_end="";
                                        +00391   if ( ! isset ($p_mont_sel))$p_mont_sel="";
                                        +00392   if ( ! isset ($p_s_comment))$p_s_comment="";
                                        +00393   if ( ! isset ($p_s_montant)) $p_s_montant="";
                                        +00394   if ( ! isset ($p_s_internal)) $p_s_internal="";
                                        +00395   if ( ! isset ($p_poste)) $p_poste="";
                                        +00396   if ( ! isset ($p_qcode)) $p_qcode="";
                                        +00397 
                                        +00398 
                                        +00399   if ( $p_mont_sel != "" )  $opt.='<OPTION value="'.$p_mont_sel.'" SELECTED> '.$p_mont_sel;
                                        +00400   $r="";
                                        +00401  
                                        +00402   //  $r.= '<div style="border-style:outset;border-width:1pt;">';
                                        +00403 
                                        +00404   $r.=JS_SEARCH_POSTE;
                                        +00405   $r.=JS_SEARCH_CARD;
                                        +00406   $r.= "<B>Recherche</B>";
                                        +00407   $r.= '<FORM ACTION="recherche.php" METHOD="GET">';
                                        +00408   $r.="<table><tr><TD>";  
                                        +00409   $r.= '<TABLE>';
                                        +00410   $r.= "<TR>";
                                        +00411   $r.= '<TD COLSPAN="3">  Date compris entre</TD> ';
                                        +00412   $r.= "</TR> <TR>";
                                        +00413   $r.= '<TD> <INPUT TYPE="TEXT" NAME="date_start" SIZE="10" VALUE="'.$p_date_start.'"></TD>';
                                        +00414   $r.= '<TD> <INPUT TYPE="TEXT" NAME="date_end" size="10" Value="'.$p_date_end.'"></TD>';
                                        +00415   $r.= '</TD><TD>';
                                        +00416   $r.= "</TR> <TR>";
                                        +00417   $r.= "<TD> Montant ";
                                        +00418   $r.= ' <SELECT NAME="mont_sel">'.$opt.' </SELECT></TD><TD>';
                                        +00419   $r.= ' <INPUT TYPE="TEXT" NAME="s_montant" SIZE="10" VALUE="'.$p_s_montant.'"></TD>';
                                        +00420   $r.= "</TR><TR>";
                                        +00421   $r.="<TD> Internal code</td>";
                                        +00422   $r.='<TD><input type="text" name="s_internal" value="'.$p_s_internal.'"></td>';
                                        +00423 
                                        +00424   $r.="</TD></TR></TABLE></td><TD><table>";
                                        +00425 
                                        +00426   $r.= "</TR>";
                                        +00427   $r.= "<TR>";
                                        +00428   $W=new widget("js_search_poste");
                                        +00429   $W->label="Numéro de poste";
                                        +00430   $W->name="poste";
                                        +00431   $W->value=$p_poste;
                                        +00432   $r.="<TR>".$W->IOValue();
                                        +00433   $r.= "</TR>";
                                        +00434   $r.= "<TR>";
                                        +00435  
                                        +00436  $A=new widget('js_search_only');
                                        +00437  $A->name='qcode';
                                        +00438  $A->value=$p_qcode;
                                        +00439  $A->extra="";
                                        +00440  $A->table=1;
                                        +00441  // $r.=$sp->IOValue("p_qcode_label")."</TD></TR>";
                                        +00442 
                                        +00443  //  $A=new widget("TEXT");
                                        +00444   $A->label="Quick Code";
                                        +00445   $A->extra='all';
                                        +00446   //$A->name="qcode";
                                        +00447   //  $A->value=$p_qcode;
                                        +00448   $sp= new widget("span");
                                        +00449   $sp->table=0;
                                        +00450   $r.=$A->IOValue().'</TD>'.$sp->IOValue("qcode_label");
                                        +00451   $r.= "</TR>";
                                        +00452   echo_debug('user_menu.php',__LINE__,"<TD>".$A->IOValue().'</TD><TD>'.$sp->IOValue("p_qcode_label")."</TD>");
                                        +00453 
                                        +00454   $r.= '<TD colspan="3"> Le commentaire contient </TD>';
                                        +00455   $r.= "</TR><TR>";
                                        +00456   $r.= '<TD COLSPAN="3"> <INPUT TYPE="TEXT" NAME="s_comment" VALUE="'.$p_s_comment.'"></TD>';
                                        +00457   $r.= "</TR><TR>";
                                        +00458   $r.= '<TD COLSPAN="3"><INPUT TYPE="SUBMIT" VALUE="Recherche" NAME="viewsearch"></TD>';
                                        +00459   $r.= "</TR>";
                                        +00460   $r.= "</TABLE>";
                                        +00461   $r.="</TR></TABLE>";
                                        +00462   $r.= "</FORM>";
                                        +00463 
                                        +00464 
                                        +00465   return $r;
                                        +00466 
                                        +00467 }
                                        +
                                        +

                                        + -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__pref_8php-source.html b/doc/developper/html/user__pref_8php-source.html index d0add41fc..c199c2545 100644 --- a/doc/developper/html/user__pref_8php-source.html +++ b/doc/developper/html/user__pref_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_pref.php Source File +phpcompta: user_pref.php Source File +html

                                        user_pref.php

                                        Go to the documentation of this file.
                                        00001 <?
                                         00002 /*
                                         00003  *   This file is part of PhpCompta.
                                        @@ -66,7 +66,7 @@
                                         00061 require_once("pref.inc.php");
                                         00062 html_page_stop();
                                         00063 ?>
                                        -

                                        Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__pref_8php.html b/doc/developper/html/user__pref_8php.html index ea6ec8b1d..e3d6076cc 100644 --- a/doc/developper/html/user__pref_8php.html +++ b/doc/developper/html/user__pref_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_pref.php File Reference +phpcompta: user_pref.php File Reference +html

                                        user_pref.php File Reference

                                        Page for the personal preference (theme, password,...). More...

                                        @@ -129,7 +129,7 @@ Definition at line 2932 of file user_pref.php. -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__sec_8php-source.html b/doc/developper/html/user__sec_8php-source.html index 591cafd2f..bf9aa173b 100644 --- a/doc/developper/html/user__sec_8php-source.html +++ b/doc/developper/html/user__sec_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_sec.php Source File +phpcompta: user_sec.php Source File +html

                                        user_sec.php

                                        Go to the documentation of this file.
                                        00001 <?
                                         00002 /*
                                         00003  *   This file is part of PhpCompta.
                                        @@ -86,7 +86,7 @@
                                         00081 }
                                         00082 
                                         00083 // session_register set to off, so variable are undefined
                                        -00084 foreach ($HTTP_GET_VARS as $name=>$value) 
                                        +00084 foreach ($HTTP_GET_VARS as $name=>$value) 
                                         00085   ${"$name"}=$value;
                                         00086 
                                         00087 if ( $action == "change_jrn" ) {
                                        @@ -269,7 +269,7 @@
                                         00264 echo "</DIV>";
                                         00265 html_page_stop();
                                         00266 ?>
                                        -

                                        Generated on Thu Jun 29 00:04:07 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__sec_8php.html b/doc/developper/html/user__sec_8php.html index f6d30dffc..9bffb4bbe 100644 --- a/doc/developper/html/user__sec_8php.html +++ b/doc/developper/html/user__sec_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/html/user_sec.php File Reference +phpcompta: user_sec.php File Reference +html

                                        user_sec.php File Reference

                                        Set the security for an user. More...

                                        @@ -463,7 +463,7 @@ Definition at line 16746 of file user_sec.php. -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__update_8php-source.html b/doc/developper/html/user__update_8php-source.html index 02a07eaa9..ddf98f41f 100644 --- a/doc/developper/html/user__update_8php-source.html +++ b/doc/developper/html/user__update_8php-source.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_update.php Source File +phpcompta: user_update.php Source File +include

                                        user_update.php

                                        Go to the documentation of this file.
                                        00001 <?
                                         00002 /*
                                         00003  *   This file is part of PhpCompta.
                                        @@ -40,8 +40,8 @@
                                         00035     echo JS_CONCERNED_OP;
                                         00036     $r ='<FORM METHOD="POST" ACTION="user_jrn.php">';
                                         00037     $r.=UpdateJrn($cn,$p_id);
                                        -00038     $r.='<INPUT TYPE="Hidden" name="action" value="update_record">';
                                        -00039     $r.='<input type="SUBMIT" name="update_record" value="Enregistre">';
                                        +00038     $r.='<INPUT TYPE="Hidden" name="action" value="update_record">';
                                        +00039     $r.='<input type="SUBMIT" name="update_record" value="Enregistre">';
                                         00040     $r.='</FORM>';
                                         00041     echo '<div class="redcontent">';
                                         00042     echo $r;
                                        @@ -57,7 +57,7 @@
                                         00052 
                                         00053 } // if update_record
                                         00054 ?>
                                        -

                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:22 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/doc/developper/html/user__update_8php.html b/doc/developper/html/user__update_8php.html index e2cb269e8..50da05f12 100644 --- a/doc/developper/html/user__update_8php.html +++ b/doc/developper/html/user__update_8php.html @@ -1,12 +1,12 @@ -phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/user_update.php File Reference +phpcompta: user_update.php File Reference +include

                                        user_update.php File Reference

                                        Check if still used. More...

                                        @@ -104,7 +104,7 @@ Definition at line 36< Definition at line 28 of file user_update.php. -


                                        Generated on Thu Jun 29 00:04:08 2006 for phpcompta by  +
                                        Generated on Thu Jun 29 21:21:23 2006 for phpcompta by  doxygen 1.4.4
                                        diff --git a/html/admin/sql/patch/upgrade13.sql b/html/admin/sql/patch/upgrade13.sql index 3b23fa9c4..ecac05941 100644 --- a/html/admin/sql/patch/upgrade13.sql +++ b/html/admin/sql/patch/upgrade13.sql @@ -416,6 +416,7 @@ SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('document_state', 's_ INSERT INTO document_state VALUES (1, 'Envoyé'); INSERT INTO document_state VALUES (2, 'Brouillon'); INSERT INTO document_state VALUES (3, 'A envoyer'); +INSERT INTO document_state VALUES (3, 'Reçu'); ALTER TABLE ONLY document_state ADD CONSTRAINT document_state_pkey PRIMARY KEY (s_id); alter sequence s_attr_def restart with 24; diff --git a/html/style-light.css b/html/style-light.css index da2da7d53..2d341bf38 100644 --- a/html/style-light.css +++ b/html/style-light.css @@ -137,6 +137,7 @@ div.u_redcontent{ div.u_content{ position: float; float:left; + width:100%; padding-top:7px; width:100%; font-size:9px; @@ -153,7 +154,8 @@ div.no span{ } div.u_content table { - border:solid blue 2px ; + border:solid blue 3px ; + width:100%; border-style:outset; } div.u_content table th { diff --git a/include/action.inc.php b/include/action.inc.php index 0181aa6ca..059efb14e 100644 --- a/include/action.inc.php +++ b/include/action.inc.php @@ -39,8 +39,8 @@ function ShowActionList($cn,$retour,$h_url) { // show the search menu ?> -
                                        - +
                                        +
                                        - + @@ -76,7 +76,8 @@ function ShowActionList($cn,$retour,$h_url) echo $h_url; echo $retour; ?>
                                        - +
                                        +
                                        '; +//$retour=''; +$retour=""; $h_url=""; if ( isset ($_REQUEST['url'])) { - $retour=sprintf('',urldecode($_REQUEST['url'])); + $retour=sprintf('',urldecode($_REQUEST['url'])); $h_url=sprintf('',urldecode($_REQUEST['url'])); } //---------------------------------------------------------------------- @@ -223,6 +225,7 @@ if ( isset ($_POST['add_action_here']) ) if ( $sub_action=='detail' ) { echo '
                                        '; + echo ''; $act=new action($cn); $act->ag_id=$_REQUEST['ag_id']; echo $act->get(); @@ -239,8 +242,9 @@ if ( $sub_action=='detail' ) echo $upload->Submit("save","Sauve"); echo $upload->Submit("add_action_here","Ajoute une action à celle-ci"); echo ''; - /*! \todo show list of related action */ + echo $retour; + echo '
                                        '; } //-------------------------------------------------------------------------------- @@ -252,6 +256,7 @@ if ( $sub_action == "list" ) // Add an action if ( $sub_action == "add_action" ) { + echo ''; echo_debug('action',__LINE__,var_export($_POST,true)); echo $retour; $act=new action($cn); @@ -358,9 +363,9 @@ if ( $sub_action == "save_action_st3" ) $d_id=(isset($_POST['d_id']))?$_POST['d_id']:0; $act->ag_ref_ag_id=(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_ag_id']:0; echo $act->SaveStage3($d_id); - ShowActionList($cn,$retour,$h_url); } //--------------------------------------------------------------------- +echo "
                                        "; diff --git a/include/class_action.php b/include/class_action.php index 003d4bf6f..3cad0b11c 100644 --- a/include/class_action.php +++ b/include/class_action.php @@ -200,6 +200,7 @@ class action $title->readonly=$readonly; $title->name="ag_title"; $title->value=FormatString($this->ag_title); + $title->size=80; // ag_ref // Always false for update @@ -232,7 +233,7 @@ class action $h_ag_id=new widget("hidden"); // if concerns another action : show the link otherwise nothing - $lag_ref_ag_id=""; + $lag_ref_ag_id=" X / XX "; if ( $this->ag_ref_ag_id != 0 ) { @@ -261,34 +262,34 @@ class action $wdest->extra='4,8,9,14,16'; $spdest= new widget("span"); $h_agrefid=new widget('hidden'); - + $str_ag_ref="".(($this->ag_ref != "")?$this->ag_ref:" Nouveau ").""; // Preparing the return string $r=""; $r.=JS_SEARCH_CARD; - $r.= "

                                        Date : ".$date->IOValue()." Reference ". $this->ag_ref."

                                        "; - $r.="

                                        Concerne :".$lag_ref_ag_id."

                                        "; - $r.= '

                                        Type d\' action'; + $r.= '

                                        Date :'.$date->IOValue()." Reference ".$str_ag_ref; + $r.="  Concerne :".$lag_ref_ag_id. + ' Type d\' action'; echo_debug('class_action',__LINE__,"str_doc_type $str_doc_type"); - $r.= $str_doc_type."

                                        "; + $r.= $str_doc_type; // state - $r.="

                                        Etat :".$str_state; + $r.=" Etat :".$str_state."

                                        "; - $r.= "

                                        "; - $r.=$w->IOValue(); + $r.= "

                                        "; + $r.="Expéditeur : ".$w->IOValue(); $r.=$sp->IOValue('qcode_exp_label',$qcode_exp_label).""; - $r.=$wdest->IOValue(); + $r.="Destinataire :".$wdest->IOValue(); $r.=$spdest->IOValue('qcode_dest_label',$qcode_dest_label).""; - + // $r.=' Ref :'.$ag_ref->IOValue(); $r.="

                                        "; echo_debug('class_action',__LINE__,' ag_id is '.$this->ag_id); - $r.= "

                                        Titre : ".$title->IOValue().' Ref :'.$ag_ref->IOValue(); + $r.= "

                                        Titre : ".$title->IOValue(); $r.= $doc_ref; - $r.= "

                                        Description :".$desc->IOValue()."

                                        "; + $r.= "

                                        ".$desc->IOValue()."

                                        "; //hidden $r.="

                                        "; @@ -761,20 +762,35 @@ class action // retrieve customer // f_id - if ( trim($this->qcode) =="" ) + if ( trim($this->qcode_exp) =="" ) { // internal document - $this->f_id=0; // internal document + $this->f_id_exp=0; // internal document } else { $tiers=new fiche($this->db); - if ( $tiers->GetByQCode($this->qcode) ==1 ) // Error we cannot retrieve this qcode + if ( $tiers->GetByQCode($this->qcode_exp) == -1 ) // Error we cannot retrieve this qcode return false; else - $this->f_id=$tiers->id; + $this->f_id_exp=$tiers->id; } + if ( trim($this->qcode_dest) =="" ) + { + // internal document + $this->f_id_dest=0; // internal document + } + else + { + $tiers=new fiche($this->db); + if ( $tiers->GetByQCode($this->qcode_dest) == -1 ) // Error we cannot retrieve this qcode + return false; + else + $this->f_id_dest=$tiers->id; + + } + //remove newline from ag_comment $this->ag_comment=str_replace("\n","",$this->ag_comment); @@ -824,22 +840,14 @@ class action $doc->Upload($this->ag_id); } - + if ( $this->d_id != 0 ) + { + $doc=new Document($this->db); + $doc->d_id=$this->d_id ; + $doc->d_state=$this->d_state; + $doc->save(); + } return true; } - /*!\brief GetAgRef returns the ag_ref value of the ag_id or ag_ref_ag_id passed - * as parameter. This function doesn't change the current object. - * \param $p_method : can be ag_ref_ag_id or ag_id - * \return string with the ag_ref - */ -// function GetAgRef($p_method) -// { -// if ($p_method=="ag_ref_ag_id") -// $sql="select ag_ref from action_gestion where ag_id=".$this->ag_ref_ag_id; -// elseif ($p_method=="ag_id") -// $sql="select ag_ref from action_gestion where ag_id=".$this->ag_id; -// return Getdbvalue($this->db,$sql); -// } - -} \ No newline at end of file +} diff --git a/include/class_document.php b/include/class_document.php index 7392a4210..72368aab5 100644 --- a/include/class_document.php +++ b/include/class_document.php @@ -58,6 +58,14 @@ class Document ExecSql($this->db,$sql); } + /*!\brief Save save the state of the document + */ + function save() + { + $sql="update document set d_state=".$this->d_state. + " where d_id=".$this->d_id; + ExecSql($this->db,$sql); + } /*! * \brief Generate the document, Call $this-\>Replace to replace * tag by value @@ -328,7 +336,7 @@ class Document if ( $this->d_id == 0 ) return ''; $r=""; - $r='Document'; + $r='Document'; return $r; } /* ! Get