parent
fa2bc964ea
commit
72e71fa5a8
16 changed files with 113 additions and 56 deletions
|
|
@ -30,7 +30,7 @@ $User->Check();
|
|||
|
||||
|
||||
html_page_start($User->theme);
|
||||
echo_debug(__FILE__,__LINE__,"entering admin_repo");
|
||||
echo_debug('admin_repo.php',__LINE__,"entering admin_repo");
|
||||
|
||||
if ($User->admin != 1) {
|
||||
html_page_stop();
|
||||
|
|
@ -58,7 +58,7 @@ if ( isset ($_GET["action"]) ) {
|
|||
|
||||
// Show all the existing user on 7 columns
|
||||
$cn=GetAllUser();
|
||||
echo_debug(__FILE__,__LINE__,"Array = $cn");
|
||||
echo_debug('admin_repo.php',__LINE__,"Array = $cn");
|
||||
$compteur=0;
|
||||
?>
|
||||
<h2>Gestion Utilisateurs</h2>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ if ( isset( $_GET['p_jrn'] )) {
|
|||
list ($l_array,$max_deb,$max_cred)=GetData($cn,$_GET['jrn_op']);
|
||||
foreach ($l_array as $key=>$element) {
|
||||
${"e_$key"}=$element;
|
||||
echo_debug(__FILE__,__LINE__,"e_$key =$element");
|
||||
echo_debug('annulation.php',__LINE__,"e_$key =$element");
|
||||
}
|
||||
|
||||
// cancel an operation
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ if ( $User->CheckAction($cn,PARM) == 0 ) {
|
|||
|
||||
echo ShowMenuParam();
|
||||
$p_action="";
|
||||
if ( isset($_GET["p_action"]) ) {
|
||||
$p_action=$_GET["p_action"];
|
||||
if ( isset($_REQUEST["p_action"]) ) {
|
||||
$p_action=$_REQUEST["p_action"];
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ if ( isset ($_POST["add_per"] )) {
|
|||
|
||||
}
|
||||
|
||||
echo_debug(__FILE__,__LINE__,"Action $action");
|
||||
echo_debug('dossier_prefs.php',__LINE__,"Action $action");
|
||||
if ( $p_action=="closed") {
|
||||
$p_per=$_GET['p_per'];
|
||||
$Res=ExecSql($cn,"update parm_periode set p_closed=true where p_id=$p_per");
|
||||
|
|
@ -223,7 +223,37 @@ if ( $p_action=='company') {
|
|||
echo $submit->Submit("record_company","Enregistre");
|
||||
echo "</form>";
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Invoice
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
if ( $p_action == 'invoice' ) {
|
||||
require_once("class_invoice.php");
|
||||
echo ShowMenuInvoice();
|
||||
$inv=new Invoice($cn);
|
||||
$inv->myList();
|
||||
$inv->FormAdd();
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Invoice add a template
|
||||
//////////////////////////////////////////////////////////////////
|
||||
if ( $p_action=='add_template') {
|
||||
require_once("class_invoice.php");
|
||||
$inv=new Invoice($cn);
|
||||
//$inv->List();
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Invoice remove a template
|
||||
//////////////////////////////////////////////////////////////////
|
||||
if ( $p_action=='rm_template') {
|
||||
require_once("class_invoice.php");
|
||||
$inv=new Invoice($cn);
|
||||
$inv->Delete();
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "</DIV>";
|
||||
html_page_stop();
|
||||
|
|
|
|||
|
|
@ -17,41 +17,67 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
/* $Revision$ */
|
||||
include ("ac_common.php");
|
||||
include ("check_priv.php");
|
||||
/* $Revision$ */
|
||||
html_page_start($g_UserProperty['g_theme']);
|
||||
if ( ! isset ( $g_dossier ) ) {
|
||||
include_once ("class_user.php");
|
||||
include_once ("postgres.php");
|
||||
include ("user_menu.php");
|
||||
include_once("class_invoice.php");
|
||||
// Check user
|
||||
$rep=DbConnect();
|
||||
$User=new cl_user($rep);
|
||||
$User->Check();
|
||||
$g_dossier=(isset ($_REQUEST['dos']))?$_REQUEST['dos']:-1;
|
||||
$_SESSION[ "g_dossier"]=$g_dossier;
|
||||
// List of customer select * from fiche_def where frd_id=9;
|
||||
if ( $g_dossier==-1 ) {
|
||||
echo "You must choose a Dossier ";
|
||||
exit -2;
|
||||
}
|
||||
include_once ("postgres.php");
|
||||
$rep=DbConnect();
|
||||
include_once ("class_user.php");
|
||||
$User=new cl_user($rep);
|
||||
$User->Check();
|
||||
include ("user_menu.php");
|
||||
ShowMenuCompta($g_dossier,$g_UserProperty);
|
||||
|
||||
if ( $g_UserProperty['use_admin']==0 ) {
|
||||
$r=CheckAction($g_dossier,$g_user,FACT);
|
||||
if ($r == 0 ){
|
||||
// Save Folder's name
|
||||
$g_name=GetDossierName($g_dossier);
|
||||
$_SESSION["g_name"]=$g_name;
|
||||
|
||||
|
||||
if ( $User->CheckAction($g_dossier,FACT) == 0 ){
|
||||
/* Cannot Access */
|
||||
NoAccess();
|
||||
}
|
||||
NoAccess();
|
||||
exit -1;
|
||||
}
|
||||
include_once("facture_inc.php");
|
||||
html_page_start($User->theme);
|
||||
|
||||
$cn=DbConnect($g_dossier);
|
||||
ShowMenuComptaLeft($g_dossier,MENU_FACT);
|
||||
ShowMenuComptaRight($g_dossier,$g_UserProperty);
|
||||
if ( $_GET["action"] ) {
|
||||
if ($_GET["fact"] == "all" ) {
|
||||
ViewFactAll($cn);
|
||||
|
||||
echo "<H2 class=\"info\"> Facturation ".$_SESSION['g_name']." </H2>";
|
||||
|
||||
// Show Menu
|
||||
echo ShowItem(array(
|
||||
array('?p_action=create_invoice&dos='.$g_dossier,'Nouvelle'),
|
||||
array('?p_action=view_invoice&dos='.$g_dossier,'Voir'),
|
||||
array('parametre.php?p_action=invoice&dos='.$g_dossier,'Paramètre'),
|
||||
array('login.php','Accueil',"Accueil"),
|
||||
array('logout.php','logout',"Sortie")
|
||||
),
|
||||
'H',"mtitle","mtitle");
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Action requested
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
if ( isset ($_GET["p_action"] )) {
|
||||
$action=$_GET["p_action"];
|
||||
////////////////////////////////////////////////////
|
||||
// See All invoices
|
||||
if ($action == "create_invoice" ) {
|
||||
}
|
||||
if ($_GET["fact"]=="impaye") {
|
||||
ViewFactImpaye($cn);
|
||||
//////////////////////////////////////////////////
|
||||
// See only unpaid invoices
|
||||
if ($action=="view_invoice") {
|
||||
}
|
||||
//////////////////////////////////////////////////
|
||||
// Create an invoice
|
||||
|
||||
}//get action
|
||||
|
||||
html_page_stop();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ include_once("fiche_inc.php");
|
|||
foreach ($HTTP_GET_VARS as $key=>$element) {
|
||||
// The value are e_name e_type e_PHPSESSID
|
||||
${"e_$key"}=$element;
|
||||
echo_debug(__FILE__,__LINE__,"e_$key =$element<br>");
|
||||
echo_debug('fiche_new.php',__LINE__,"e_$key =$element<br>");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ function new_fiche($p_cn,$p_type) {
|
|||
$r.="<TABLE>";
|
||||
echo '<H2 class="info">New </H2>';
|
||||
$p_f_id="";
|
||||
echo_debug(__FILE__,__LINE__,"Array is null");
|
||||
echo_debug('fiche_new.php',__LINE__,"Array is null");
|
||||
// Find all the attribute of the existing cards
|
||||
// --> Get_attr_def
|
||||
$sql="select frd_id,ad_id,ad_text from fiche_def join jnt_fic_attr using (fd_id)
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ $r="";
|
|||
foreach ($HTTP_GET_VARS as $key=>$element) {
|
||||
// The value are e_name e_type e_PHPSESSID
|
||||
${"e_$key"}=$element;
|
||||
echo_debug(__FILE__,__LINE__,"e_$key =$element<br>");
|
||||
echo_debug('fiche_search.php',__LINE__,"e_$key =$element<br>");
|
||||
|
||||
}
|
||||
$e_fic_search=(isset ($_POST['fic_search']))?$_POST['fic_search']:"";
|
||||
|
|
@ -121,6 +121,7 @@ if ( isset ( $_POST['search']) ) {
|
|||
if ( $e_type != 'cred' and $e_type != 'deb') {
|
||||
$list_fiche=$e_type;
|
||||
$sql="select * from vw_fiche_attr where frd_id in ( $list_fiche )";
|
||||
// $sql="select * from vw_fiche_attr ";
|
||||
}
|
||||
// e_fic_search contains the pattern
|
||||
|
||||
|
|
@ -147,15 +148,16 @@ if ( isset ( $_POST['search']) ) {
|
|||
$class="odd";
|
||||
$text=FormatString($row['vw_name']);
|
||||
$r.="<span class=\"$class\">";
|
||||
$r.=sprintf ('<input name="%s" type="button" onClick="'."SetData('%s','%s','%s','%s','%s','%s','%s')".'" value="select">',
|
||||
$r.=sprintf ('<input name="%s" type="button" onClick="'."SetData('%s','%s','%s','%s','%s','%s','%s')".'" value="%s">',
|
||||
"select" . $i,
|
||||
$e_name,
|
||||
$row['f_id'] ,
|
||||
$row['quick_code'] ,
|
||||
$text,
|
||||
$row['vw_sell'],
|
||||
$row['vw_buy'],
|
||||
$row['tva_id'],
|
||||
$row['tva_label']
|
||||
$row['tva_label'] ,
|
||||
$row['quick_code']
|
||||
);
|
||||
$r.=" ".$row['vw_name'];
|
||||
if ( $row['vw_addr'] !="")
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ If ( isset ($_POST["JRN_ADD"]) ) {
|
|||
else
|
||||
$l_cred_max_line=$_POST['p_jrn_cred_max_line'];
|
||||
$p_jrn_name=$_POST["p_jrn_name"];
|
||||
echo_debug(__FILE__,__LINE__,"nom journal $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);
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ $Max=pg_NumRows($Res);
|
|||
for ($i=0;$i<$Max;$i++) {
|
||||
$Line=pg_fetch_array($Res,$i);
|
||||
|
||||
echo_debug(__FILE__,__LINE__,"jrn type !".$Line['jrn_type_id']."!,!".$l_line['jrn_def_type']."!");
|
||||
echo_debug('jrn_detail.php',__LINE__,"jrn type !".$Line['jrn_type_id']."!,!".$l_line['jrn_def_type']."!");
|
||||
printf (' %s',$Line['jrn_desc']);
|
||||
}
|
||||
echo '</TD>';
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ $jrn_op=$_GET['jrn_op'];
|
|||
list ($l_array,$max_deb,$max_cred)=GetData($cn,$jrn_op);
|
||||
foreach ($l_array as $key=>$element) {
|
||||
${"e_$key"}=$element;
|
||||
echo_debug(__FILE__,__LINE__,"jrn_op_detail.php e_$key =$element");
|
||||
echo_debug('jrn_op_detail.php',__LINE__,"jrn_op_detail.php e_$key =$element");
|
||||
}
|
||||
|
||||
echo '<div align="center"> Opération </div>';
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ include_once("preference.php");
|
|||
include_once("class_jrn.php");
|
||||
include_once("check_priv.php");
|
||||
|
||||
echo_debug(__FILE__,__LINE__,"imp pdf journaux");
|
||||
echo_debug('jrn_pdf.php',__LINE__,"imp pdf journaux");
|
||||
$cn=DbConnect($_SESSION['g_dossier']);
|
||||
$l_type="JRN";
|
||||
$centr=" Non centralisé";
|
||||
|
|
@ -73,7 +73,7 @@ while (1) {
|
|||
$_GET['to_periode'],
|
||||
$_GET['central'],
|
||||
$limit,$offset);
|
||||
echo_debug(__FILE__,__LINE__,"Total debit $tot_deb,credit $tot_cred");
|
||||
echo_debug('jrn_pdf.php',__LINE__,"Total debit $tot_deb,credit $tot_cred");
|
||||
|
||||
if ( $a_jrn==null) break;
|
||||
$offset+=$step;
|
||||
|
|
@ -85,8 +85,8 @@ while (1) {
|
|||
$filter,
|
||||
$l_centr
|
||||
);
|
||||
echo_debug(__FILE__,__LINE__,"MONTANT $rap_deb,$rap_cred");
|
||||
echo_debug(__FILE__,__LINE__," list($rap_deb,$rap_cred)=GetRappel($cn,$first_id,".$Jrn->id.",$Exercice,FIRST)");
|
||||
echo_debug('jrn_pdf.php',__LINE__,"MONTANT $rap_deb,$rap_cred");
|
||||
echo_debug('jrn_pdf.php',__LINE__," list($rap_deb,$rap_cred)=GetRappel($cn,$first_id,".$Jrn->id.",$Exercice,FIRST)");
|
||||
$pdf->ezText($Jrn->name,30);
|
||||
|
||||
if ( $l_centr == 1 ) {
|
||||
|
|
@ -110,7 +110,7 @@ while (1) {
|
|||
$a=1;
|
||||
// Total Page
|
||||
$apage=array(array('deb'=>sprintf("%8.2f",$tot_deb),'cred'=>$tot_cred));
|
||||
foreach ($apage as $key=>$element) echo_debug(__FILE__,__LINE__,"apage $key => $element");
|
||||
foreach ($apage as $key=>$element) echo_debug('jrn_pdf.php',__LINE__,"apage $key => $element");
|
||||
$pdf->ezTable($apage,
|
||||
array (
|
||||
'deb'=> 'Total Débit',
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ $cn=DbConnect($_SESSION['g_dossier']);
|
|||
if ( isset ($_GET["search"]) ) {
|
||||
$c1=0;
|
||||
foreach( $_GET as $key=>$element){
|
||||
echo_debug(__FILE__,__LINE__,"$key = $element");
|
||||
echo_debug('jrn_search.php',__LINE__,"$key = $element");
|
||||
${"$key"}=$element;
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ if ( isset ($_GET["search"]) ) {
|
|||
}
|
||||
|
||||
$condition=$c_comment.$c_montant.$c_date.$c_internal;
|
||||
echo_debug(__FILE__,__LINE__,"condition = $condition");
|
||||
echo_debug('jrn_search.php',__LINE__,"condition = $condition");
|
||||
}
|
||||
$condition=$condition." ".$part;
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ include ("user_menu.php");
|
|||
/* Modif d'une ligne */
|
||||
if ( isset ($_POST["update"] ) ) {
|
||||
foreach ($HTTP_POST_VARS as $name => $element) {
|
||||
echo_debug(__FILE__,__LINE__,"name $name $element");
|
||||
echo_debug('line_update.php',__LINE__,"name $name $element");
|
||||
}
|
||||
echo JS_UPDATE_PCMN;
|
||||
$cn=DbConnect($_SESSION['g_dossier']);
|
||||
|
|
@ -53,14 +53,14 @@ if ( isset ($_POST["update"] ) ) {
|
|||
$p_lib=FormatString($_POST["p_name"]);
|
||||
$p_parent=trim($_POST["p_val_parent"]);
|
||||
$old_line=trim($_POST["p_old"]);
|
||||
echo_debug(__FILE__,__LINE__,"Update old : $old_line News = $p_val $p_lib");
|
||||
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(__FILE__,__LINE__,"Modif valeur = $p_val parent = $p_parent");
|
||||
echo_debug('line_update.php',__LINE__,"Modif valeur = $p_val parent = $p_parent");
|
||||
}
|
||||
}
|
||||
/* Parent existe */
|
||||
|
|
|
|||
|
|
@ -26,12 +26,11 @@ include_once("debug.php");
|
|||
|
||||
|
||||
if ( isset ($_POST["p_user"] ) ) {
|
||||
echo_debug(__FILE__,__LINE__,"user is set");
|
||||
echo_debug('login.php',__LINE__,"user is set");
|
||||
$g_user=$_POST["p_user"];
|
||||
$g_pass=$_POST["p_pass"];
|
||||
$_SESSION['g_user']=$g_user;
|
||||
$_SESSION['g_pass']=$g_pass;
|
||||
//$cn=pg_connect("dbname=account_repository user='phpcompta' ");
|
||||
|
||||
// Verif if User and Pass match DB
|
||||
// if no, then redirect to the login page
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ if ( $action == 'update' ) {
|
|||
}
|
||||
// p_id is jrn.jr_id
|
||||
$p_id=$_GET["line"];
|
||||
echo_debug(__FILE__,__LINE__," action = update p_id = $p_id");
|
||||
echo_debug('modify_op.php',__LINE__," action = update p_id = $p_id");
|
||||
echo JS_VIEW_JRN_DETAIL;
|
||||
echo JS_CONCERNED_OP;
|
||||
$r ='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="modify_op.php">';
|
||||
|
|
@ -135,7 +135,7 @@ if ( isset($_POST['update_record']) ) {
|
|||
} // if update_record
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
if ( $action == 'delete' ) {
|
||||
echo_debug(__FILE__,__LINE__," Call DeleteRapt($cn,".$_GET['line'].",".$_GET['line2'].")");
|
||||
echo_debug('modify_op.php',__LINE__," Call DeleteRapt($cn,".$_GET['line'].",".$_GET['line2'].")");
|
||||
DeleteRapt($cn,$_GET['line'],$_GET['line2']);
|
||||
echo ' <script>
|
||||
window.close();
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ if ( isset ( $_POST["Add"] ) ) {
|
|||
(string) $p_parent != (string)(int) $p_parent) {
|
||||
$p_parent=substr($p_val,0,strlen($p_val)-1);
|
||||
}
|
||||
echo_debug(__FILE__,__LINE__,"Ajout valeur = $p_val parent = $p_parent");
|
||||
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");
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ if ( isset($_GET['filter'])) {
|
|||
// Creation query
|
||||
foreach ( $valid_cred as $item_cred) {
|
||||
if ( strlen (trim($item_cred))) {
|
||||
echo_debug(__FILE__,__LINE__,"l_line[jrn_def_class_cred] $l_line[jrn_def_class_cred] item_cred $item_cred");
|
||||
echo_debug('poste_search.php',__LINE__,"l_line[jrn_def_class_cred] $l_line[jrn_def_class_cred] item_cred $item_cred");
|
||||
if ( strstr($item_cred,"*") == true ) {
|
||||
$item_cred=strtr($item_cred,"*","%");
|
||||
$Sql=" pcm_val like '$item_cred' or";
|
||||
|
|
@ -96,7 +96,7 @@ if ( isset($_GET['filter'])) {
|
|||
// Creation query
|
||||
foreach ( $valid_deb as $item_deb) {
|
||||
if ( strlen (trim($item_deb))) {
|
||||
echo_debug(__FILE__,__LINE__,"l_line[jrn_def_class_deb] $l_line[jrn_def_class_deb] item_deb $item_deb");
|
||||
echo_debug('poste_search.php',__LINE__,"l_line[jrn_def_class_deb] $l_line[jrn_def_class_deb] item_deb $item_deb");
|
||||
if ( strstr($item_deb,"*") == true ) {
|
||||
$item_cred=strtr($item_deb,"*","%");
|
||||
$Sql=" pcm_val like '$item_deb' or";
|
||||
|
|
@ -121,7 +121,7 @@ if ( isset($_POST['p_ctl'])) {
|
|||
$p_ctl=$_POST['p_ctl'];
|
||||
}
|
||||
|
||||
echo_debug(__FILE__,__LINE__,"condition = $condition");
|
||||
echo_debug('poste_search.php',__LINE__,"condition = $condition");
|
||||
|
||||
echo '<FORM ACTION="poste_search.php'.$url.'" METHOD="POST">';
|
||||
if ( isset($p_ctl) ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue