noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
param_pcmn.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 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00020 /*! \file
00021  * \brief concerns the management of the "Plan Comptable"
00022  */
00023 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00024 require_once ('class_acc_account.php');
00025 include_once ("ac_common.php");
00026 require_once("constant.php");
00027 require_once('class_dossier.php');
00028 require_once('function_javascript.php');
00029 
00030 $gDossier=dossier::id();
00031 
00032 require_once('class_database.php');
00033 
00034 /* Admin. Dossier */
00035 $cn=new Database($gDossier);
00036 
00037 include_once ("class_user.php");
00038 
00039 include_once ("user_menu.php");
00040 
00041 echo '<div id="acc_update" class="inner_box" style="display:none;position:absolute;text-align:left;z-index:1">';
00042 echo HtmlInput::title_box("Poste comptable", "acc_update", "hide");
00043 echo '<span id="acc_update_info" class="notice"></span>';
00044 echo '<form method="post" id="acc_update_frm_id" onsubmit="account_update(\'acc_update_frm_id\');return false;">';
00045 $val=new IText('p_valu');
00046 $parent=new IText('p_parentu');
00047 $lib=new IText('p_libu');
00048 $lib->css_size="100%";
00049 $type=new ISelect('p_typeu');
00050 $type->value=Acc_Account::$type;
00051 echo '<table>';
00052 $r= td(_('Poste comptable')).td($val->input());
00053 echo tr($r);
00054 $r= td(_('Description')).td($lib->input());
00055 echo tr($r);
00056 $r= td(_('Parent')).td($parent->input());
00057 echo tr($r);
00058 $r= td(_('Type ')).td($type->input());
00059 echo tr($r);
00060 echo '</table>';
00061 echo HtmlInput::hidden('p_oldu','');
00062 echo HtmlInput::hidden('p_action','');
00063 echo dossier::hidden();
00064 $checkbox=new ICheckBox("delete_acc");
00065 echo _('Cocher pour effacer')." ".$checkbox->input();
00066 echo '<hr>';
00067 echo HtmlInput::submit('update',_('Sauve'));
00068 echo HtmlInput::button('hide',_('Annuler'),'onClick="$(\'acc_update\').hide();return true;"');
00069 echo '</form>';
00070 echo '</div>';
00071 
00072 
00073 
00074 /* Store the p_start parameter */
00075 
00076 $g_start=HtmlInput::default_value_get('p_start',-1);
00077 echo '<div class="u_subtmenu">';
00078 
00079 echo '</div>';
00080 
00081 
00082 echo '<div class="content">';
00083 menu_acc_plan($g_start);
00084 echo '</div>';
00085 if ($g_start == -1) return;
00086 echo '<DIV CLASS="myfieldset" style="width:auto">';
00087 
00088 $Ret=$cn->exec_sql("select pcm_val,pcm_lib,pcm_val_parent,pcm_type,array_to_string(array_agg(j_qcode) , ',') as acode
00089         from tmp_pcmn left join vw_poste_qcode on (j_poste=pcm_val) where substr(pcm_val::text,1,1)='".$g_start."'".
00090                 "  group by pcm_val,pcm_lib,pcm_val_parent, pcm_type  order by pcm_val::text");
00091 $MaxRow=Database::num_row($Ret);
00092 
00093 ?>
00094 <span style="display:inline;margin: 15px 15px 15px 15px">
00095 <input type="button" class="smallbutton" onclick="PcmnUpdate('','','','',0,0,'new')" value="<?php echo _('Ajout poste comptable'); ?>">
00096 </span>
00097 <?php echo _('Filtre')." ".HtmlInput::filter_table("account_tbl_id", "0,1,2,3,4", 1);?>
00098 <FORM METHOD="POST">
00099              <?php
00100              echo HtmlInput::hidden('p_action','pcmn');
00101 //echo HtmlInput::hidden('sa','detail');
00102 echo dossier::hidden();
00103 $limite=MAX_QCODE;
00104 ?>
00105 <TABLE  id="account_tbl_id" class="result">
00106                              <TR>
00107                              <TH> Poste comptable </TH>
00108                              <TH> Libellé </TH>
00109                              <TH> Poste comptable Parent </TH>
00110                              <TH> Type </TH>
00111                              <TH> Fiche</TH>
00112                              </TR>
00113 
00114                                        <?php
00115                                        $str_dossier=dossier::get();
00116 for ($i=0; $i <$MaxRow; $i++)
00117 {
00118     $A=Database::fetch_array($Ret,$i);
00119 
00120     if ( $i%2 == 0 )
00121     {
00122         $td ='<TD class="odd">';
00123         $tr ='<TR class="odd">';
00124     }
00125     else
00126     {
00127         $td='<TD class="even">';
00128         $tr='<TR class="even">';
00129     }
00130     echo $tr;
00131     echo "$td";
00132     echo HtmlInput::history_account($A['pcm_val'], $A['pcm_val']);
00133     echo '</td>';
00134     echo "$td";
00135     printf ("<A style=\"text-decoration:underline\" HREF=\"javascript:void(0)\" onclick=\"PcmnUpdate('%s','%s','%s','%s',%d,0,'update')\">",
00136             str_replace("'","\'",$A['pcm_val']),
00137             str_replace("'","\'",$A['pcm_lib']),
00138             str_replace("'","\'",$A['pcm_val_parent']),
00139             str_replace("'","\'",$A['pcm_type']),
00140             dossier::id());
00141     echo h($A['pcm_lib']);
00142 
00143     echo $td;
00144     echo $A['pcm_val_parent'];
00145     echo '</TD>';
00146     echo "</td>$td";
00147     echo $A['pcm_type'];
00148     echo "</TD>";
00149 
00150         echo $td;
00151         if ( strlen($A['acode']) >0 ) {
00152                 if (strpos($A['acode'], ",") >0 ) {
00153                         $det_qcode=  explode(",", $A['acode']);
00154                         echo '<ul style="display:inline;paddding:0;margin:0px;padding-left:0px;list-style-type:none;padding-start-value:0px">';
00155                         $max=(count($det_qcode)>MAX_QCODE)?MAX_QCODE:count($det_qcode);
00156                         for ($e=0;$e<$max;$e++) {
00157                                 echo '<li style="padding-start-value:0;display:inline">'.HtmlInput::card_detail($det_qcode[$e],'',' style="display:inline"').'</li>';
00158                         }
00159                         echo '</ol>';
00160                         if ($max < count($det_qcode)) {
00161                                 echo "...";
00162                         }
00163                 } else {
00164                         echo HtmlInput::card_detail($A['acode']);
00165                 }
00166         }
00167         echo '</td>';
00168 
00169     echo "</TR>";
00170 }
00171 echo "</TABLE>";
00172 echo "</FORM>";
00173 ?>
00174                              <input type="button" class="smallbutton" onclick="PcmnUpdate('','','','',0,-230,'new')" value="<?php echo _('Ajout poste comptable'); ?>">
00175 <?php
00176 echo "</DIV>";
00177 html_page_stop();
00178 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations