diff --git a/html/admin_repo.php b/html/admin_repo.php
index 4e2cc7bc9..da7f8d65f 100644
--- a/html/admin_repo.php
+++ b/html/admin_repo.php
@@ -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;
?>
Gestion Utilisateurs
diff --git a/html/annulation.php b/html/annulation.php
index 2336769ac..0d1ba5d97 100644
--- a/html/annulation.php
+++ b/html/annulation.php
@@ -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
diff --git a/html/dossier_prefs.php b/html/dossier_prefs.php
index 1540af0c2..9b714094f 100644
--- a/html/dossier_prefs.php
+++ b/html/dossier_prefs.php
@@ -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 "";
}
+///////////////////////////////////////////////////////////////////
+// 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 "";
html_page_stop();
diff --git a/html/facturation.php b/html/facturation.php
index 4584f76a3..dc58e3775 100644
--- a/html/facturation.php
+++ b/html/facturation.php
@@ -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 " Facturation ".$_SESSION['g_name']."
";
+
+// 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();
diff --git a/html/fiche_new.php b/html/fiche_new.php
index e46d02521..c9375e5c6 100644
--- a/html/fiche_new.php
+++ b/html/fiche_new.php
@@ -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
");
+ echo_debug('fiche_new.php',__LINE__,"e_$key =$element
");
}
@@ -64,7 +64,7 @@ function new_fiche($p_cn,$p_type) {
$r.="";
echo 'New
';
$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)
diff --git a/html/fiche_search.php b/html/fiche_search.php
index c24b1fe06..662e791b3 100644
--- a/html/fiche_search.php
+++ b/html/fiche_search.php
@@ -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
");
+ echo_debug('fiche_search.php',__LINE__,"e_$key =$element
");
}
$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.="";
- $r.=sprintf ('',
+ $r.=sprintf ('',
"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'] !="")
diff --git a/html/jrn_add.php b/html/jrn_add.php
index 9bcc90b4e..ee90225cf 100644
--- a/html/jrn_add.php
+++ b/html/jrn_add.php
@@ -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);
diff --git a/html/jrn_detail.php b/html/jrn_detail.php
index 1455efbdd..3f81aa7f8 100644
--- a/html/jrn_detail.php
+++ b/html/jrn_detail.php
@@ -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 '';
diff --git a/html/jrn_op_detail.php b/html/jrn_op_detail.php
index 27db99be9..e9ac738c7 100644
--- a/html/jrn_op_detail.php
+++ b/html/jrn_op_detail.php
@@ -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 ' Opération
';
diff --git a/html/jrn_pdf.php b/html/jrn_pdf.php
index edd86ca71..5ebda27eb 100644
--- a/html/jrn_pdf.php
+++ b/html/jrn_pdf.php
@@ -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',
diff --git a/html/jrn_search.php b/html/jrn_search.php
index e2e0584d8..cfa6eff16 100644
--- a/html/jrn_search.php
+++ b/html/jrn_search.php
@@ -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;
diff --git a/html/line_update.php b/html/line_update.php
index ba2c86ee9..224fe1c28 100644
--- a/html/line_update.php
+++ b/html/line_update.php
@@ -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 */
diff --git a/html/login.php b/html/login.php
index cacabe1ac..d7acb3437 100644
--- a/html/login.php
+++ b/html/login.php
@@ -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
diff --git a/html/modify_op.php b/html/modify_op.php
index 78d957cd9..99506c1c8 100644
--- a/html/modify_op.php
+++ b/html/modify_op.php
@@ -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 ='