noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
anc_od.inc.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  *
00024  *
00025  * \brief Misc Operation for analytic accountancy
00026  *
00027  */
00028 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00029 require_once("class_ihidden.php");
00030 require_once("class_iselect.php");
00031 require_once("class_anc_account.php");
00032 require_once ("class_anc_operation.php");
00033 require_once ("class_anc_plan.php");
00034 require_once ("class_anc_group_operation.php");
00035 global $g_user;
00036 
00037 $str_dossier=Dossier::get();
00038 $pa=new Anc_Plan($cn);
00039 $m=$pa->get_list();
00040 if ( ! $m )
00041 {
00042 
00043     echo '<div style="float:left;width:60%;margin-left:20%"><h2 class="error">'._('Aucun plan analytique défini').'</h2></div>';
00044     exit();
00045 }
00046 
00047 
00048 
00049 //----------------------------------------------------------------------
00050 // show the left menu
00051 //----------------------------------------------------------------------
00052 echo '
00053 <div class="content" >
00054 <div class="lmenu">
00055 <table>
00056 <tr>
00057 <td  class="mtitle" >
00058 <A class="mtitle" HREF="?ac='.$_REQUEST['ac'].'&new&'.$str_dossier.'"> '._('Nouveau').' </A>
00059 </td>
00060 <td  class="mtitle" >
00061 <A class="mtitle" HREF="?ac='.$_REQUEST['ac'].'&see&'.$str_dossier.'">'._('Liste opérations').' </A
00062 </td>
00063 </tr>
00064 </table>
00065 </div>
00066 </div>
00067 ';
00068 
00069 
00070 //----------------------------------------------------------------------
00071 // the pa_id is set
00072 //
00073 //----------------------------------------------------------------------
00074 if ( isset($_GET['see']))
00075 {
00076 
00077     // Show the list for the period
00078     // and exit
00079     //-----------------------------
00080     $a=new Anc_Operation($cn);
00081 
00082     echo '
00083     <div class="redcontent"  style="margin-left:12%">
00084     <form method= "get">
00085     ';
00086 
00087     echo dossier::hidden();
00088     $hid=new IHidden();
00089 
00090     $hid->name="ac";
00091     $hid->value=$_REQUEST['ac'];
00092     echo $hid->input();
00093 
00094     $hid->name="see";
00095     $hid->value="";
00096     echo $hid->input();
00097 
00098     $w=new ISelect();
00099     $w->name="p_periode";
00100 // filter on the current year
00101     $filter_year=" where p_exercice='".$g_user->get_exercice()."'";
00102 
00103     $periode_start=$cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by  p_start,p_end",1);
00104     $g_user=new User($cn);
00105     $current=(isset($_GET['p_periode']))?$_GET['p_periode']:$g_user->get_periode();
00106     $w->value=$periode_start;
00107     $w->selected=$current;
00108     echo $w->input();
00109     echo 'P&eacute;riode  '.HtmlInput::submit('gl_submit','Valider').'</form>';
00110 
00111     echo '<div class="redcontent"  style="margin-left:12%">';
00112     echo $a->html_table($current);
00113     echo '</div>';
00114     exit();
00115 }
00116 if ( isset($_POST['save']))
00117 {
00118     // record the operation and exit
00119     // and exit
00120     //-----------------------------
00121     echo '<div class="redcontent" style="margin-left:12%">'.
00122     _('Opération sauvée');
00123     $a=new Anc_Group_Operation($cn);
00124 
00125     $a->get_from_array($_POST);
00126 
00127     $a->save();
00128     echo $a->show();
00129     echo '</div>';
00130     exit();
00131 }
00132 
00133 if ( isset($_GET['new']))
00134 {
00135     //show the form for entering a new Anc_Operation
00136     //------------------------------------------
00137     $a=new Anc_Group_Operation($cn);
00138 
00139     $wSubmit=new IHidden("p_action","ca_od");
00140     $wSubmit->table=0;
00141     echo '<div class="redcontent"  style="margin-left:12%">';
00142     echo '<form method="post">';
00143     echo dossier::hidden();
00144     echo $wSubmit->input();
00145     echo $a->form();
00146     echo HtmlInput::submit("save","Sauver");
00147     echo '</form>';
00148     echo '<div class="info">';
00149     echo _('Débit').' = <span id="totalDeb"></span>';
00150     echo _('Crédit').' = <span id="totalCred"></span>';
00151     echo _('Difference').' = <span id="totalDiff"></span>
00152     </div>
00153     ';
00154 
00155     echo '</div>';
00156     exit();
00157 }
00158 
00159 ?>
00160 <div class="redcontent">
 All Data Structures Namespaces Files Functions Variables Enumerations