diff --git a/html/compute.js b/html/compute.js deleted file mode 100644 index 9ecec77b0..000000000 --- a/html/compute.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of PhpCompta. - * - * PhpCompta is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PhpCompta is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with PhpCompta; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -function CheckTotal() { -var ie4=false; -if ( document.all ) { - ie4=true; -}// Ajouter getElementById par document.all[str] -var deb=0; - for (var i=0;1;i++) { - a=document.getElementById("mont_deb"+i); - if ( a == null ) { - document.forms[0].sum_deb.value=deb; - break; - } else { - if ( isNaN(a.value) == true) { - a.value=0; - alert ("Not a Number !!! "); - } - deb+=eval(a.value); - } - } -var cred=0; - for (var i=0;1;i++) { - a=document.getElementById("mont_cred"+i); - if ( a == null ) { - document.forms[0].sum_cred.value=cred; - break; - } else { - if ( isNaN(a.value) == true) { - a.value=0; - alert ("Not a Number !!! "); - } - cred+=eval(a.value); - } - } -if ( deb != cred ) { - document.getElementById("diff").style.color="red"; - document.getElementById("diff").style.fontWeight="bold"; - document.getElementById("diff").innerHTML="Différence"; - -} else { - document.getElementById("diff").innerHTML=""; -} -} - diff --git a/html/jrn_add.php b/html/jrn_add.php deleted file mode 100644 index 8eb17ab41..000000000 --- a/html/jrn_add.php +++ /dev/null @@ -1,194 +0,0 @@ -Check(); -include_once("check_priv.php"); -include_once ("user_menu.php"); - -echo '
'; -echo ShowMenuCompta(); -echo '
'; - - - -$cn=DbConnect($gDossier); -$User->can_request($cn,GJRN); - - -echo JS_SEARCH_POSTE; - -If ( isset ($_POST["JRN_ADD"]) ) { - if ( !isset($_POST["p_jrn_name"]) || ! isset($_POST["p_jrn_type"] )) { - echo '

Un paramètre manque

'; - } - else { - if ( $_POST['p_ech'] == 'no' ) { - $p_ech='false'; - $p_ech_lib='null'; - } else { - $p_ech='true'; - $p_ech_lib="'".$_POST['p_ech_lib']."'"; - } - if (strlen(trim($_POST['p_jrn_deb_max_line'])) == 0 || - (string) (int)$_POST['p_jrn_deb_max_line'] != (string)$_POST['p_jrn_deb_max_line'] ) - $l_deb_max_line=1; - else - $l_deb_max_line=$_POST['p_jrn_deb_max_line']; - - - $p_jrn_name=$_POST["p_jrn_name"]; -echo_debug('jrn_add.php',__LINE__,"nom journal $p_jrn_name"); - $p_jrn_class_deb=FormatString($_POST["p_jrn_class_deb"]); - if (strlen(trim($p_jrn_name))==0) return; - $p_jrn_name=FormatString($p_jrn_name); - $p_jrn_class_cred=FormatString($_POST["p_jrn_class_deb"]); - // compute the jrn_def.jrn_def_code - $p_code=sprintf("%s-%02d",trim($_POST['p_jrn_type']),Acc_Ledger::next_number($cn,$_POST['p_jrn_type'])); - $p_jrn_fiche_deb=""; - $p_jrn_fiche_cred=""; - - if ( isset ($_POST["FICHEDEB"])) { - $p_jrn_fiche_deb=join(",",$_POST["FICHEDEB"]); - } - if ( isset ($_POST["FICHEDEB"])) { - $p_jrn_fiche_cred=join(",",$_POST["FICHEDEB"]); - } - $l_cred_max_line=$l_deb_max_line; - $Sql=sprintf("insert into jrn_def(jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_deb_max_line,jrn_cred_max_line, - jrn_def_type,jrn_def_fiche_deb,jrn_def_fiche_cred,jrn_def_code) - values ('%s','%s','%s',%s,%s,'%s','%s','%s','%s')", - $p_jrn_name,$p_jrn_class_deb,$p_jrn_class_cred, - $l_deb_max_line,$l_cred_max_line,$_POST['p_jrn_type'], - $p_jrn_fiche_deb,$p_jrn_fiche_cred, - $p_code - ); - echo_debug($Sql); - $Res=ExecSql($cn,$Sql); - } -} -echo ShowMenuAdvanced(); -echo ''; - -$sessid=$_REQUEST['PHPSESSID']; -$search='"; - -echo '
'; -echo '
'; -echo dossier::hidden(); -echo ''; -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; -/* -echo ''; -echo ''; -echo ''; -echo ''; -*/ - -echo ''; -echo ''; -echo ''; - -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; - - -echo ''; -echo ''; -echo ''; -echo ''; -?> -'; -$Res=ExecSql($cn,"select fd_id,fd_label from fiche_def order by fd_label"); -$num=pg_NumRows($Res); - - -echo ''; -echo ''; -echo ''; -echo ''; -// Show the fiche in deb section -for ($i=0;$i<$num;$i++) { - $res=pg_fetch_array($Res,$i); - echo ''; - printf ('', - $res['fd_id'],$res['fd_label']); - printf ('', - $res['fd_id'],$res['fd_label']); - echo ''; -} -?> - -'; -echo ''; -echo ""; -html_page_stop(); -?> diff --git a/html/jrn_detail.php b/html/jrn_detail.php deleted file mode 100644 index f9589ee49..000000000 --- a/html/jrn_detail.php +++ /dev/null @@ -1,269 +0,0 @@ -Check(); - -//include_once ("top_menu_compta.php"); -include_once ("user_menu.php"); - - -echo '
'; -echo ShowMenuCompta(7); -echo '
'; - -include_once("check_priv.php"); - -$cn=DbConnect($gDossier); -$User->can_request($cn,GJRN); - -// Javascript -echo JS_SEARCH_POSTE; -if ( isset( $_REQUEST['p_jrn'] )) { - $p_jrn=$_REQUEST['p_jrn']; - } else { - echo '

Journal inexistant

'; - exit(); - } -//-------------------------------------------------- -// remove ledger -//-------------------------------------------------- -if ( isset($_POST["efface"])) { - if ( CountSql($cn,"select * from jrn where jr_def_id=".$_POST['p_jrn']." limit 3") == 0 ) - { - ExecSql($cn,"delete from jrn_def where jrn_def_id=".$_POST['p_jrn']); - } else { -?> - - Un paramètre manque'; - } - else { - if ( $_POST['p_ech'] == 'no' ) { - $p_ech='false'; - $p_ech_lib='null'; - } else { - $p_ech='true'; - $p_ech_lib="'".$_POST['p_ech_lib']."'"; - } - - if ( strlen(trim($_POST['p_jrn_deb_max_line'])) == 0 || - (string) (int)$_POST['p_jrn_deb_max_line'] != (string)$_POST['p_jrn_deb_max_line'] || - $_POST['p_jrn_deb_max_line'] <= 0 - ) - $l_deb_max_line=1; - else - $l_deb_max_line=$_POST['p_jrn_deb_max_line']; - - $l_cred_max_line=$l_deb_max_line; - - $p_jrn_name=$_POST['p_jrn_name']; - if (strlen(trim($p_jrn_name))==0) return; - $p_jrn_name=FormatString($p_jrn_name); - $p_jrn_fiche_deb=""; - $p_jrn_fiche_cred=""; - - if ( isset ($_POST["FICHEDEB"])) { - $p_jrn_fiche_deb=join(",",$_POST["FICHEDEB"]); - } - if ( isset ($_POST["FICHECRED"])) { - $p_jrn_fiche_cred=join(",",$_POST["FICHECRED"]); - } - $Sql=sprintf("update jrn_def set jrn_def_name='%s',jrn_def_class_deb='%s',jrn_def_class_cred='%s', - jrn_deb_max_line=%s,jrn_cred_max_line=%s,jrn_def_ech=%s,jrn_def_ech_lib=%s,jrn_def_fiche_deb='%s', - jrn_def_fiche_cred='%s' - where jrn_def_id=%s", - $p_jrn_name,$_POST['p_jrn_class_deb'],$_POST['p_jrn_class_deb'], - $l_deb_max_line,$l_cred_max_line, - $p_ech,$p_ech_lib, - $p_jrn_fiche_deb,$p_jrn_fiche_cred, - $_GET['p_jrn'] - ); - echo_debug($Sql); - $Res=ExecSql($cn,$Sql); - } -} -echo ShowMenuAdvanced(1); -echo ''; -?> - - -"; -echo '
'; -echo '

'.$l_line['jrn_def_name'].'

'; -echo '
'; -echo dossier::hidden(); -echo ''; -echo '
Nom journal
Postes utilisables journal (débit/crédit) '.$search.'
Nombre de lignes par défaut
Postes utilisables journal (crédit) '.$search.'
Date d\'échéance Oui'; -echo 'Non
Libellé echéance
Type de journal '; -$Res=ExecSql($cn,"select jrn_type_id,jrn_desc from jrn_type"); -$Max=pg_NumRows($Res); -echo ''; -echo '

Fiches

Fiches Dédit Fiches Crébit
%s %s
'; - -echo ''; -echo ''; -echo ''; -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; - -/*echo ''; -echo ''; -echo ''; -echo ''; -*/ - -echo ''; -echo ''; -if ( $l_line['jrn_def_ech'] == 't' ) { - echo ''; -} -if ( $l_line['jrn_def_ech'] == 'f' ) { - echo ''; -} -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; - -echo ''; -echo ''; -echo ''; -echo ''; -echo ""; - - -?> - -'; -// Get all the fiches -echo '

Fiches

'; -$Res=ExecSql($cn,"select fd_id,fd_label from fiche_def order by fd_label"); -$num=pg_NumRows($Res); - -$rdeb=split(',',$l_line['jrn_def_fiche_deb']); - -$rcred=split(',',$l_line['jrn_def_fiche_cred']); -echo '
Nom journal
Postes utilisables journal (débit/crédit) '.$search.'
Nombre de lignes par défaut
Postes utilisables journal (crédit) '.$search.'
Date d\'échéance Oui'; - echo 'Non Oui'; - echo 'Non
Libellé echéance
Type de journal '; -$Res=ExecSql($cn,"select jrn_type_id,jrn_desc from jrn_type where ". - "trim(jrn_type_id)=trim('".$l_line['jrn_def_type']."')"); -$Max=pg_NumRows($Res); - -for ($i=0;$i<$Max;$i++) { - $Line=pg_fetch_array($Res,$i); - - echo_debug('jrn_detail.php',__LINE__,"jrn type !".$Line['jrn_type_id']."!,!".$l_line['jrn_def_type']."!"); - printf (' %s',$Line['jrn_desc']); -} -echo '
Code ".$l_line['jrn_def_code']."
'; -echo ''; -echo ''; -echo ''; -echo ''; -// Show the fiche in deb section -for ($i=0;$i<$num;$i++) { - $res=pg_fetch_array($Res,$i); - $CHECKED=" unchecked"; - foreach ( $rdeb as $element) { - if ( $element == $res['fd_id'] ) { - $CHECKED="CHECKED"; - break; - } - } - echo ''; - printf ('', - $res['fd_id'],$CHECKED,$res['fd_label']); - $CHECKED=" unchecked"; - foreach ( $rcred as $element) { - if ( $element == $res['fd_id'] ) { - $CHECKED="CHECKED"; - break; - } - } - - printf ('', - $res['fd_id'],$CHECKED,$res['fd_label']); - echo ''; -} - - -?> -
-
Fiches Débit Fiches Crédit
%s %s
- - -
- - - - -
-'; -echo "
"; -html_page_stop(); -?> diff --git a/html/jrn_update.php b/html/jrn_update.php deleted file mode 100644 index 2b5e96b79..000000000 --- a/html/jrn_update.php +++ /dev/null @@ -1,60 +0,0 @@ -Check(); - -include_once ("check_priv.php"); - -include_once ("user_menu.php"); - -echo '
'; -echo ShowMenuCompta("user_advanced.php?".dossier::get()); -echo '
'; - - -$cn=DbConnect($gDossier); - - - -echo '
'; -echo ShowMenuAdvanced("jrn_update.php?".dossier::get()); -echo '
'; -$User->can_request($cn,GJRN); - - -echo ''; -html_page_stop(); -?> diff --git a/html/line_update.php b/html/line_update.php deleted file mode 100644 index a413f1136..000000000 --- a/html/line_update.php +++ /dev/null @@ -1,127 +0,0 @@ -Check(); -html_page_start($User->theme,"onLoad='window.focus();'"); - -$User->can_request(DbConnect($gDossier),MPCMN); - - -include ("user_menu.php"); - -/* Modif d'une ligne */ -if ( isset ($_POST["update"] ) ) { - foreach ($_POST as $name => $element) { - echo_debug('line_update.php',__LINE__,"name $name $element"); - } - echo JS_UPDATE_PCMN; - $cn=DbConnect($gDossier); - $p_val=trim($_POST["p_val"]); - $p_lib=FormatString($_POST["p_name"]); - $p_parent=trim($_POST["p_val_parent"]); - $old_line=trim($_POST["p_old"]); - // Check if p_parent and p_val are number - if ( ! is_numeric($p_val) || ! is_numeric($p_parent) ) { - // not number no update - echo ''; - echo ""; - exit(); - - } - echo_debug('line_update.php',__LINE__,"Update old : $old_line News = $p_val $p_lib"); - if ( strlen ($p_val) != 0 && strlen ($p_lib) != 0 && strlen($old_line)!=0 ) { - if (strlen ($p_val) == 1 ) { - $p_parent=0; - } else { - if ( strlen($p_parent)==0 ) { - $p_parent=substr($p_val,0,strlen($p_val)-1); - echo_debug('line_update.php',__LINE__,"Modif valeur = $p_val parent = $p_parent"); - } - } - /* Parent existe */ - $Ret=ExecSql($cn,"select pcm_val from tmp_pcmn where pcm_val=$p_parent"); - if ( pg_NumRows($Ret) == 0 || $p_parent==$old_line ) { - echo ''; - } else { - - $Ret=ExecSql($cn,"update tmp_pcmn set pcm_val=$p_val, pcm_lib='$p_lib',pcm_val_parent=$p_parent where pcm_val=$old_line"); - } - } else { - echo ''; - } - - echo ""; - -} - -?> -
- - -Numéro de classe ',$l); -echo ""; -printf('',urldecode($n)); -echo ""; -printf ('',$p); -echo dossier::hidden(); -?> - -
Libellé
Classe Parent
- - - -
- -',$l); ?> -
-
- - - diff --git a/html/pcmn_update.php b/html/pcmn_update.php deleted file mode 100644 index 0eb1731e1..000000000 --- a/html/pcmn_update.php +++ /dev/null @@ -1,206 +0,0 @@ -Check(); - - -include_once ("user_menu.php"); -include_once ("check_priv.php"); - -//echo ShowMenuCompta("user_advanced.php"); -echo ShowMenuCompta(7); - -$cn=DbConnect($gDossier); - - -echo JS_UPDATE_PCMN; -/* Store the p_start parameter */ -if ( ! isset ( $_SESSION['g_start']) ) { - $_SESSION['g_start']=""; - -} -if ( isset ($_GET['p_start'])) { - $g_start=$_GET['p_start']; - $_SESSION["g_start"]=$g_start; - -} - -echo '
'; - -echo ShowMenuAdvanced(4); -echo '
'; -$User->can_request($cn,MPCMN); - - -echo ''; -echo '
'; -/* Analyse ce qui est demandé */ -/* Effacement d'une ligne */ -if (isset ($_GET['action'])) { -//----------------------------------------------------- -// Action == remove a line - if ( $_GET['action']=="del" ) { - if ( isset ($_GET['l']) ) { - /* Ligne a enfant*/ - $R=ExecSql($cn,"select pcm_val from tmp_pcmn where pcm_val_parent=".$_GET['l']); - if ( pg_NumRows($R) != 0 ) { - echo ""; - } else { - /* Vérifier que le poste n'est pas utilisé qq part dans les journaux */ - $Res=ExecSql($cn,"select * from jrnx where j_poste=".$_GET['l']); - if ( pg_NumRows($R) != 0 ) { - echo ""; - } - else { - $Del=ExecSql($cn,"delete from tmp_pcmn where pcm_val=".$_GET['l']); - } // if pg_NumRows - } // if pg_NumRows - } // isset ($l) - } //$action == del -} // isset action -//----------------------------------------------------- -/* Ajout d'une ligne */ -if ( isset ( $_POST["Add"] ) ) { - extract ($_POST); - $p_val=trim($p_val); - $p_parent=trim($p_parent); - if ( isset ( $p_val) && isset ( $p_lib ) && isNumber($p_val) && isNumber($p_parent) ) { - $p_val=trim($p_val); - $p_lib=FormatString(trim($p_lib)); - $p_parent=$_POST["p_parent"]; - if ( strlen ($p_val) != 0 && strlen ($p_lib) != 0 ) { - if (strlen ($p_val) == 1 ) { - $p_parent=0; - } else { - if ( strlen(trim($p_parent))==0 && - (string) $p_parent != (string)(int) $p_parent) { - $p_parent=substr($p_val,0,strlen($p_val)-1); - } - echo_debug('pcmn_update.php',__LINE__,"Ajout valeur = $p_val parent = $p_parent"); - } - /* Parent existe */ - $Ret=ExecSql($cn,"select pcm_val from tmp_pcmn where pcm_val=$p_parent"); - if ( pg_NumRows($Ret) == 0 ) { - echo ''; - } else { - // Check if the account already exists - - $Count=CountSql($cn,"select * from tmp_pcmn where pcm_val='".$p_val."'"); - if ( $Count != 0 ) - { - // Alert message account already exists - echo ''; - - } else - { - $Ret=ExecSql($cn,"insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) values ('$p_val','$p_lib',$p_parent)"); - } - } - } else { - echo '

Valeurs invalides

'; - } - } -} - -$Ret=ExecSql($cn,"select pcm_val,pcm_lib,pcm_val_parent from tmp_pcmn where substr(pcm_val::text,1,1)='".$_SESSION['g_start']."' order by pcm_val::text"); -$MaxRow=pg_NumRows($Ret); - -?> - -
- - - - - - - - - - - - - -'; - } else { - $td=' $td"; - echo $A['pcm_val']; - - echo " $td"; - // printf ("",$A['pcm_val'],urlencode($A['pcm_lib']),$A['pcm_val_parent']); - printf ("", - $A['pcm_val'], - FormatString($A['pcm_lib']), - $A['pcm_val_parent'], - $_REQUEST['PHPSESSID'], - dossier::id()); - echo $A['pcm_lib']; - echo ''; - echo ""; - - echo $td; - echo $A['pcm_val_parent']; - echo ''; - - echo $td; - printf ('Delete',$A['pcm_val'],$str_dossier); - echo ""; - - echo ""; -} -echo "
Classe Libellé Parent
- - - - - - - -
'; - } - echo "
"; -echo "
"; -echo "
"; -html_page_stop(); -?>