';
diff --git a/include/bud_synthese.inc.php b/include/bud_synthese.inc.php
index 238b4423f..140c683d5 100644
--- a/include/bud_synthese.inc.php
+++ b/include/bud_synthese.inc.php
@@ -15,7 +15,7 @@
* 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
-*/
+ */
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
@@ -45,7 +45,7 @@ switch($do) {
echo ShowItem(array(
array('?p_action=synthese&do=po&'.$str_dossier,'Détail Poste Analytique',"Donne le detail par poste analytique ",1),
- array('?p_action=synthese&do=ga&'.$str_dossier,' Groupe Analytique',"Synthese de l'utilisation des groupes analytiques dans une hypothese",2),
+ array('?p_action=synthese&do=ga&'.$str_dossier,' Groupes & Totaux ',"Totaux dans une hypothese par groupe analytique s'il y en a ",2),
array('?p_action=synthese&do=vglobal&'.$str_dossier,'Vue Globale',"Detail d'une hypothese",3),
array('?p_action=synthese&do=acc&'.$str_dossier,'Detail CE',"Donne le détail par poste comptable",4)
),
@@ -65,11 +65,11 @@ if ( $do=='po') {
}
if ( $do=='ga') {
- if ($obj->size_analytic() == 0 ) {
+ /* if ($obj->size_analytic() == 0 ) {
echo '
Desole pas d\'hypothese definie avec un plan analytique
';
exit();
- }
+ }*/
require_once ('bud_sga.inc.php');
}
diff --git a/include/central_inc.php b/include/central_inc.php
index 73e3b9fae..e1e084beb 100644
--- a/include/central_inc.php
+++ b/include/central_inc.php
@@ -27,8 +27,8 @@
* Met les donnees centralisees dans la table
* centralize
*
- * \param p_cn connection
- * \param periode a centraliser
+ * \param $p_cn connection
+ * \param $p_periode a centraliser
*
* \return code error
*
@@ -159,13 +159,9 @@ $sql="insert into centralized( c_j_id,
/*!
**************************************************
* \brief test if e jrn_jr.id is centralize or not
- *
- * parm :
- * - p_cn
- * - p_jnr_id jrn.jr_id
- * gen :
- * - none
- * return: 0 if not centralized otherwise > 0
+ * \param $p_cn database connx
+ * \param $p_jrn_id jrn.jr_id
+ * \return: 0 if not centralized otherwise > 0
*/
function isCentralize($p_cn,$p_jrn_id) {
$Res=ExecSql($p_cn,"select c_id from centralized where c_j_id=$p_jrn_id");
diff --git a/include/check_priv.php b/include/check_priv.php
index c201b50af..48e3a4aed 100644
--- a/include/check_priv.php
+++ b/include/check_priv.php
@@ -30,13 +30,11 @@ include_once("postgres.php");
* \brief Vérifie les acces d'un utilisateur
* sur un journal
*
- * parm :
- * - $p_dossier le dossier
- * - $p_user le login user
- * - $p_jrn le journal
- * gen :
- * - rien
- * return:
+ * \param $p_dossier le dossier
+ * \param $p_user le login user
+ * \param $p_jrn le journal
+
+ * \return
* - 0 pas d'acces
* - 1 Lecture
* - 2 écriture
@@ -186,7 +184,7 @@ function CheckIsAdmin($p_user)
* \brief Check if an user has acces to a folder
*
*
- * \param user
+ * \param p_user
* \param p_dossier concerned folder
*
* \return
diff --git a/include/class_acc_account.php b/include/class_acc_account.php
index 2dc56cf92..f5c50b8ca 100644
--- a/include/class_acc_account.php
+++ b/include/class_acc_account.php
@@ -29,7 +29,7 @@ require_once ('class_dossier.php');
require_once ('class_widget.php');
class Acc_Account {
- var $db; /*! \enum $db database connection */
+ var $db; /*!< $db database connection */
var $pcm_val;
var $pcm_type;
var $pcm_parent;
diff --git a/include/class_acc_account_ledger.php b/include/class_acc_account_ledger.php
index 412950151..a7d43c2a4 100644
--- a/include/class_acc_account_ledger.php
+++ b/include/class_acc_account_ledger.php
@@ -28,11 +28,13 @@ require_once ('postgres.php');
require_once ('class_dossier.php');
class Acc_Account_Ledger {
- var $db; /*! \enum $db database connection */
- var $id; /*! \enum $id poste_id (pcm_val)*/
- var $label; /*! \enum $label label of the poste */
- var $parent; /*! \enum $parent parent account */
- var $row; /*! \enum $row double array see get_row */
+ var $db; /*!< $db database connection */
+ var $id; /*!< $id poste_id (pcm_val)*/
+ var $label; /*!< $label label of the poste */
+ var $parent; /*!< $parent parent account */
+ var $row; /*!< $row double array see get_row */
+ var $tot_deb; /*!< value set by get_row */
+ var $tot_cred; /*!< value by get_row */
function __construct ($p_cn,$p_id) {
$this->db=$p_cn;
$this->id=$p_id;
@@ -52,7 +54,7 @@ class Acc_Account_Ledger {
$periode=sql_filter_per($this->db,$p_from,$p_to,'p_id','jr_tech_per');
- $Res=ExecSql($this->db,"select to_char(j_date,'DD.MM.YYYY') as j_date,".
+ $Res=ExecSql($this->db,"select jr_id,to_char(j_date,'DD.MM.YYYY') as j_date,".
"case when j_debit='t' then j_montant else 0 end as deb_montant,".
"case when j_debit='f' then j_montant else 0 end as cred_montant,".
" jr_comment as description,jrn_def_name as jrn_name,".
@@ -75,6 +77,8 @@ class Acc_Account_Ledger {
}
}
$this->row=$array;
+ $this->tot_deb=$tot_deb;
+ $this->tot_cred=$tot_cred;
return array($array,$tot_deb,$tot_cred);
}
/*!\brief Return the name of a account
@@ -126,7 +130,7 @@ class Acc_Account_Ledger {
* balance of the account
*
*/
-function get_solde($p_cond=" true ") {
+ function get_solde($p_cond=" true ") {
$Res=ExecSql($this->db,"select sum(deb) as sum_deb, sum(cred) as sum_cred from
( select j_poste,
case when j_debit='t' then j_montant else 0 end as deb,
@@ -151,7 +155,7 @@ function get_solde($p_cond=" true ") {
function get_solde_detail($p_cond="") {
if ( $p_cond != "") $p_cond=" and ".$p_cond;
- $sql="select sum(deb) as sum_deb, sum(cred) as sum_cred from
+ $sql="select sum(deb) as sum_deb, sum(cred) as sum_cred from
( select j_poste,
case when j_debit='t' then j_montant else 0 end as deb,
case when j_debit='f' then j_montant else 0 end as cred
@@ -233,8 +237,8 @@ function get_solde_detail($p_cond="") {
"
Code interne | ".
"
Date | ".
"
Description | ".
- "
Débit | ".
- "
Crédit | ".
+ "
Débit | ".
+ "
Crédit | ".
"";
foreach ( $this->row as $op ) {
@@ -267,7 +271,7 @@ function get_solde_detail($p_cond="") {
*
* \return none
*/
- function HtmlTableHeader()
+ static function HtmlTableHeader()
{
$submit=new widget();
$hid=new widget("hidden");
@@ -290,6 +294,9 @@ function get_solde_detail($p_cond="") {
$hid->IOValue("to_periode",$_POST['to_periode']);
if (isset($_POST['poste_fille']))
echo $hid->IOValue('poste_fille','on');
+ if (isset($_POST['oper_detail']))
+ echo $hid->IOValue('oper_detail','on');
+
echo "";
echo '
| ";
echo "";
diff --git a/include/class_acc_bilan.php b/include/class_acc_bilan.php
index d5db1d4ad..cfe30fd4c 100644
--- a/include/class_acc_bilan.php
+++ b/include/class_acc_bilan.php
@@ -21,9 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
- */
-
-/*! \brief this class handle the different bilan, from the table bilan
+ * \brief this class handle the different bilan, from the table bilan
*
*/
require_once ('postgres.php');
@@ -33,6 +31,10 @@ require_once ('impress_inc.php');
require_once ('header_print.php');
require_once ('class_acc_account_ledger.php');
+/*!
+ * \brief this class handle the different bilan, from the table bilan, parse the form and replace
+ * in the template
+ */
class Acc_Bilan {
var $db; /*!< database connection */
var $b_id; /*!< id of the bilan (bilan.b_id) */
@@ -122,7 +124,7 @@ class Acc_Bilan {
echo '
';
if ( $count <> 0 ) {
echo '
'.$ret.'
';
- echo '
Nbre erreur : '.$count.'';
+ echo '
Nbres anomalies : '.$count.'';
} else
echo " Pas d'anomalie détectée";
echo '';
@@ -300,7 +302,8 @@ class Acc_Bilan {
$b=str_replace("$","\$this->",$a);
echo_debug(__FILE__.":".__LINE__." evaluate \$b",$b);
- eval("$b;");
+ if ( eval("$b;") === false )
+ echo_debug(__FILE__,__LINE__,"Code failed with $b");
}// end read form line per line
echo_debug(__FILE__.':'.__LINE__," End of reading form");
@@ -377,6 +380,9 @@ class Acc_Bilan {
//echo "f2_value=$f2_value";
// $a=${"$f2_value"};
$a=$this->$f2_value;
+ if ( $a=='-0' ) $a=0;
+
+ echo_debug(__FILE__.':'.__LINE__.'- $a =',$a);
// DEBUG echo " a = $a";
$line_rtf=str_replace($f2_str,$a,$line_rtf);
@@ -435,6 +441,8 @@ class Acc_Bilan {
// $a=${"$f2_value"};
$a=$this->$f2_value;
// DEBUG echo " a = $a";
+ echo_debug(__FILE__.':'.__LINE__.'- $a =',$a);
+ if ( $a=='-0' ) $a=0;
$line_rtf=str_replace($f2_str,$a,$line_rtf);
}// foreach end
diff --git a/include/class_acc_jrn_info.php b/include/class_acc_jrn_info.php
index acf89d7ef..94e11c1f6 100644
--- a/include/class_acc_jrn_info.php
+++ b/include/class_acc_jrn_info.php
@@ -23,7 +23,13 @@ require_once ('class_dossier.php');
require_once ('postgres.php');
/*!\file
- * \brief Manage the additionnal info for operation (from jrn)
+ * \brief Manage additional info for Accountancy
+ */
+
+/*!
+ * \brief Manage the additionnal info for operation (from jrn), when an invoice is generated,
+ * the order or other info are going to be stored and used in the detail.
+ * this class maps the table jrn_info
*/
class Acc_Jrn_Info {
var $cn; /*!< connection */
diff --git a/include/class_acc_operation.php b/include/class_acc_operation.php
index 8a35ce6e4..878e13770 100644
--- a/include/class_acc_operation.php
+++ b/include/class_acc_operation.php
@@ -52,6 +52,7 @@ var $jr_id; /*!< pk of jrn */
$this->user=$_SESSION['g_user'];
$user=new User($this->db);
$this->periode=$user->get_periode();
+ $this->jr_id=0;
}
/* **************************************************
*\brief Insert into the table Jrn
@@ -133,5 +134,99 @@ function get_internal() {
$this->jr_internal= $l_line['jr_internal'];
return $this->jr_internal;
}
+/*!\brief search an operation thankx it internal code
+ * \param internal code
+ * \return 0 ok -1 nok
+ */
+ function seek_internal($p_internal) {
+ $res=ExecSqlParam($this->db,'select j_id from jrn where jr_internal=$1',
+ array($p_internal));
+ if ( pg_NumRows($Res) == 0 ) return -1;
+ $this->jr_id=pg_fetch_result($Res,0,0);
+ return 0;
+ }
+ /*!\brief retrieve data from jrnx
+ * \return an array
+ */
+ function get_jrnx_detail() {
+ if ( $this->jr_id==0 ) return;
+ $sql=" select j_date,j_qcode,j_poste,j_montant,jr_internal,case when j_debit = 'f' then 'C' else 'D' end as debit,
+ vw_name,pcm_lib from jrnx join jrn on (jr_grpt_id=j_grpt)
+ join tmp_pcmn on (j_poste=pcm_val)
+ left join vw_fiche_attr on (j_qcode=quick_code)
+ where
+ jr_id=$1";
+ $res=ExecSqlParam($this->db,$sql,array($this->jr_id));
+ if ( pg_NumRows ($res) == 0 ) return array();
+ $all=pg_fetch_all($res);
+ return $all;
+ }
+ /*!\brief display_jrnx_detail : get the data from get_jrnx_data and
+ return a string with HTML code
+ * \param table(=0 no code for table,1 code for table,2 code for CSV)
+ */
+ function display_jrnx_detail($p_table) {
+ $show=$this->get_jrnx_detail();
+
+ $r='';
+ $r_notable='';
+ $csv="";
+ foreach ($show as $l) {
+ if ( $l['j_poste'] == $this->poste)
+ $r.='
';
+ else
+ $r.='
';
+
+ $r.='| ';
+ $a=$l['j_qcode'];;
+ $r_notable.=$a;
+ $r.=$a;
+ $csv.='"'.$a.'";';
+ $r.=' | ';
+
+ $r.='';
+ $a=$l['j_poste'];
+ $r_notable.=$a;
+ $r.=$a;
+ $csv.='"'.$a.'";';
+ $r.=' | ';
+
+ $r.='';
+ $a=($l['vw_name']=="")?$l['j_qcode']:$l['pcm_lib'];
+ $r_notable.=$a;
+ $r.=$a;
+ $csv.='"'.$a.'";';
+ $r.=' | ';
+
+ $r.='';
+ $a=$l['j_montant'];
+ $r_notable.=$a;
+ $r.=$a;
+ $csv.=$a.';';
+ $r.=' | ';
+
+ $r.='';
+ $a=$l['debit'];
+ $r_notable.=$a;
+ $r.=$a;
+ $csv.='"'.$a.'"';
+
+ $csv.="\n\r";
+ $r.=' | ';
+
+ $r.='
';
+ }
+ switch ($p_table) {
+ case 1:
+ return $r;
+ break;
+ case 0:
+ return $r_notable;
+ break;
+ case 2:
+ return $csv;
+ }
+ return "ERROR PARAMETRE";
+ }
}
diff --git a/include/class_acexception.php b/include/class_acexception.php
index f91a53afc..6da5dcb01 100644
--- a/include/class_acexception.php
+++ b/include/class_acexception.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief acException extends Exception
*/
/*! \brief acException extends Exception
diff --git a/include/class_action.php b/include/class_action.php
index 8c80674a4..20271f4a8 100644
--- a/include/class_action.php
+++ b/include/class_action.php
@@ -47,19 +47,19 @@ require_once("user_common.php");
class action
{
- /*! \enum $db database connexion
- * \enum $ag_comment description (ag_gestion.ag_comment)
- * \enum $ag_timestamp document date (ag_gestion.ag_timestamp)
- * \enum $dt_id type of the document (document_type.dt_id)
- * \enum $d_state stage of the document (printed, send to client...)
- * \enum $d_number number of the document
- * \enum $d_filename filename's document
- * \enum $d_mimetype document's filename
- * \enum $ag_title title document
- * \enum $f_id_dest fiche id (From field )
- * \enum $f_id_exp fiche id (to field)
- * \enum $ag_ref_ag_id concern previous action
- * \enum $ag_id pk of the table action_gestion
+ /*!< $db database connexion
+ * $ag_comment description (ag_gestion.ag_comment)
+ * $ag_timestamp document date (ag_gestion.ag_timestamp)
+ * $dt_id type of the document (document_type.dt_id)
+ * $d_state stage of the document (printed, send to client...)
+ * $d_number number of the document
+ * $d_filename filename's document
+ * $d_mimetype document's filename
+ * $ag_title title document
+ * $f_id_dest fiche id (From field )
+ * $f_id_exp fiche id (to field)
+ * $ag_ref_ag_id concern previous action
+ * $ag_id pk of the table action_gestion
* \todo replace attribut from class document document by an object document
*/
diff --git a/include/class_admin.php b/include/class_admin.php
index c704d8cb1..c0ba7014d 100644
--- a/include/class_admin.php
+++ b/include/class_admin.php
@@ -38,11 +38,11 @@ require_once('user_common.php');
//
class Admin extends fiche{
- var $name; /*! \enum $name name of the company */
- var $street; /*! \enum $street Street */
- var $country; /*! \enum $country Country */
- var $cp; /*! \enum $cp Zip code */
- var $vat_number; /*! \enum $vat_number vat number */
+ var $name; /*!< $name name of the company */
+ var $street; /*!< $street Street */
+ var $country; /*!< $country Country */
+ var $cp; /*!< $cp Zip code */
+ var $vat_number; /*!< $vat_number vat number */
/*! \brief Constructor
/* only a db connection is needed */
diff --git a/include/class_anc_account.php b/include/class_anc_account.php
index c8ee246df..98cdfe16a 100644
--- a/include/class_anc_account.php
+++ b/include/class_anc_account.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+*\brief contains the object for the poste_analytique (table poste_analytique)
*/
/*!\brief contains the object for the poste_analytique (table poste_analytique)
diff --git a/include/class_anc_group_operation.php b/include/class_anc_group_operation.php
index f743b7412..9c8f1766f 100644
--- a/include/class_anc_group_operation.php
+++ b/include/class_anc_group_operation.php
@@ -20,7 +20,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
+/*!\file
+ * \brief group of object operations, used for misc operation
*/
/*! \brief group of object operations, used for misc operation
diff --git a/include/class_anc_listing.php b/include/class_anc_listing.php
index a7befe63e..34d87ad55 100644
--- a/include/class_anc_listing.php
+++ b/include/class_anc_listing.php
@@ -21,11 +21,9 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief definition of Anc_Listing
*/
-/*! \brief
- *
- */
require_once ('class_anc_plan.php');
require_once ('class_anc_print.php');
require_once ('class_anc_operation.php');
diff --git a/include/class_anc_operation.php b/include/class_anc_operation.php
index bde72ec7d..f0f907625 100644
--- a/include/class_anc_operation.php
+++ b/include/class_anc_operation.php
@@ -20,7 +20,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
+/*!\file
+ *\brief definition of Anc_Operation
*/
require_once("class_anc_plan.php");
require_once("class_widget.php");
diff --git a/include/class_anc_plan.php b/include/class_anc_plan.php
index 273bcdd12..4a5fa35ca 100644
--- a/include/class_anc_plan.php
+++ b/include/class_anc_plan.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief Concerns the Analytic plan (table plan_analytique)
*/
/*! \brief
diff --git a/include/class_anc_print.php b/include/class_anc_print.php
index b65c85948..94fa79e8f 100644
--- a/include/class_anc_print.php
+++ b/include/class_anc_print.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief this class is the mother class for the CA printing
*/
/*! \brief this class is the mother class for the CA printing
diff --git a/include/class_attribut.php b/include/class_attribut.php
index 9709243ed..15b6c72d1 100644
--- a/include/class_attribut.php
+++ b/include/class_attribut.php
@@ -26,10 +26,10 @@
*/
class Attribut {
- var $ad_id; /*! \enum pk for attribut */
- var $ad_text; /*! \enum type of content */
- var $av_text; /*! \enum Description (content) */
- var $cn; /*! \enum database connection */
+ var $ad_id; /*!< pk for attribut */
+ var $ad_text; /*!< type of content */
+ var $av_text; /*!< Description (content) */
+ var $cn; /*!< database connection */
function Attribut($p_ad_id) {
$this->ad_id=$p_ad_id;
$this->cn=-1;
@@ -42,7 +42,7 @@ class Attribut {
* \brief Sort an array of object attribut thx the
* ad_id
*
- *\param array of Attribut objects
+ *\param p_attribut array of Attribut objects
*
*
* \return the ordered array
diff --git a/include/class_bud_card.php b/include/class_bud_card.php
index 3cd3e5bad..0f2d58124 100644
--- a/include/class_bud_card.php
+++ b/include/class_bud_card.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*! \file
+ * \brief class to manage the table bud_detail
*/
/*!
* \brief class to manage the table bud_detail
diff --git a/include/class_bud_data.php b/include/class_bud_data.php
index 6a7a1817d..5e9dcd2c1 100644
--- a/include/class_bud_data.php
+++ b/include/class_bud_data.php
@@ -21,6 +21,9 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief it is a object including the class bud_detail bud_card,and
+ * bud_detail_periode,
+ * the purpose is to insert or save into bud_detail_periode
*/
/*! \brief it is a object including the class bud_detail bud_card,and
diff --git a/include/class_bud_detail_periode.php b/include/class_bud_detail_periode.php
index e18d439c1..ed2f1e06d 100644
--- a/include/class_bud_detail_periode.php
+++ b/include/class_bud_detail_periode.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+* \brief definition of class Bud_Detail_Periode
*/
/*! \brief manage the table bud_detail_periode
diff --git a/include/class_bud_hypo.php b/include/class_bud_hypo.php
index 5963dd9d5..e0c1a230d 100644
--- a/include/class_bud_hypo.php
+++ b/include/class_bud_hypo.php
@@ -21,6 +21,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief manage the database bud_hypo concerning the hypothese for
+ * different hyp.
*/
/*!
diff --git a/include/class_bud_synthese.php b/include/class_bud_synthese.php
index e31316289..279620e7a 100644
--- a/include/class_bud_synthese.php
+++ b/include/class_bud_synthese.php
@@ -21,6 +21,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief Manage the synthese for the budget module
+ * Mother class
*/
/*!
* \brief Manage the synthese for the budget module
diff --git a/include/class_bud_synthese_acc.php b/include/class_bud_synthese_acc.php
index d0348bd1e..30c5bd99b 100644
--- a/include/class_bud_synthese_acc.php
+++ b/include/class_bud_synthese_acc.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+\brief Manage the hypothese for the budget module
*
*/
/*!
@@ -186,9 +187,11 @@ class Bud_Synthese_Acc extends Bud_Synthese {
$sub['bc_description']=$col['bc_description'];
$sub['bc_price_unit']=$col['bc_price_unit'];
$periode=array();
+ $sub['unit']=0;
+
$res2=pg_execute("sql_detail_periode",array($bc_id,$rBudCard['pcm_val']));
$col_per=pg_fetch_all($res2);
- $sub['unit']=0;
+ if ( empty ($col_per) ) continue;
// fill the periode array
foreach ($col_per as $cPer) {
$p_id=$cPer['p_id'];
diff --git a/include/class_bud_synthese_anc.php b/include/class_bud_synthese_anc.php
index 7026ba96b..dcc1c0f31 100644
--- a/include/class_bud_synthese_anc.php
+++ b/include/class_bud_synthese_anc.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+\brief Manage the hypothese for the budget module
*
*/
/*!
@@ -177,6 +178,7 @@ class Bud_Synthese_Anc extends Bud_Synthese {
$periode=array();
$res2=pg_execute("sql_detail_periode",array($rBudCard['bc_id'],$pcm_val));
$col_per=pg_fetch_all($res2);
+ if ( empty ($col_per) ) continue;
$sub['unit']=0;
foreach ($col_per as $cPer) {
$p_id=$cPer['p_id'];
diff --git a/include/class_bud_synthese_group.php b/include/class_bud_synthese_group.php
index 63a61f2cf..e7a2f8c66 100644
--- a/include/class_bud_synthese_group.php
+++ b/include/class_bud_synthese_group.php
@@ -21,6 +21,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief Manage the hypothese for the budget module
+ * synthese
*/
/*!
* \brief Manage the hypothese for the budget module
@@ -59,18 +61,21 @@ class Bud_Synthese_Group extends Bud_Synthese {
$hypo=new Bud_Hypo($this->cn);
$hypo->bh_id=$this->bh_id;
$hypo->load();
+ $fga_id=0;
if ($hypo->has_plan() == 1 ) {
$anc_value=make_array($this->cn,"select distinct ga_id, ".
" ga_id||'-'||substr(ga_description,10) as ga_description ".
"from groupe_analytique ".
" join poste_analytique using (ga_id) ".
" join bud_detail using (po_id) ".
- " where bh_id=".$this->bh_id);
-
- $wGa_id=new widget("select");
- $wGa_id->name="ga_id";
- $wGa_id->value=$anc_value;
- $wGa_id->selected=$this->ga_id;
+ " where bh_id=".$this->bh_id,1);
+ if ( count($anc_value) > 0 ) {
+ $wGa_id=new widget("select");
+ $wGa_id->name="ga_id";
+ $wGa_id->value=$anc_value;
+ $wGa_id->selected=$this->ga_id;
+ $fga_id=1;
+ }
}
$per=make_array($this->cn,"select p_id,to_char(p_start,'MM.YYYY') ".
" from parm_periode order by p_start,p_end");
@@ -87,7 +92,8 @@ class Bud_Synthese_Group extends Bud_Synthese {
$r="";
$r.="Periode de ".$wFrom->IOValue()." à ".$wto->IOValue();
- if ( $hypo->has_plan()==1)
+ /* if there a group analytic */
+ if ( $fga_id==1)
$r.="Groupe ".$wGa_id->IOValue();
$r.=dossier::hidden();
return $r;
@@ -167,7 +173,7 @@ class Bud_Synthese_Group extends Bud_Synthese {
$hypo=new Bud_Hypo($this->cn);
$hypo->bh_id=$this->bh_id;
$hypo->load();
- if ($hypo->has_plan() == 1)
+ if ($hypo->has_plan() == 1 && $this->ga_id != "" )
$sql="select bc_price_unit,pcm_val,sum(bdp_amount) as amount,p_id ".
" from bud_detail join bud_detail_periode using (bd_id) ".
" join poste_analytique using (po_id) ".
diff --git a/include/class_bud_synthese_hypo.php b/include/class_bud_synthese_hypo.php
index f6b6c038e..7b8fb42aa 100644
--- a/include/class_bud_synthese_hypo.php
+++ b/include/class_bud_synthese_hypo.php
@@ -1,4 +1,3 @@
-
cn,$this->from,$this->to,'p_id','j_tech_per');
$sql_poste="select distinct pcm_val from bud_detail where bh_id=".$this->bh_id;
$aPoste=get_array($this->cn,$sql_poste);
-
+ $hypo=new Bud_Hypo($this->cn,$this->bh_id);
$local_con=DbConnect(dossier::id());
- $sql_prepare=pg_prepare($local_con,"get_group","select sum(bdp_amount) as amount,ga_id,".
- "bc_price_unit".
- " from ".
- " bud_detail join bud_detail_periode using (bd_id) ".
- " join bud_card using (bc_id) ".
- " join poste_analytique using (po_id) ".
- " where $per ".
- " and pcm_val=$1 and ".
- " bud_detail.bh_id=$2 ".
- " group by ga_id,bc_price_unit ".
- " order by ga_id ");
+ if ( $hypo->has_plan() == 1 ) {
+ $sql_prepare=pg_prepare($local_con,"get_group","select sum(bdp_amount) as amount,ga_id,".
+ "bc_price_unit".
+ " from ".
+ " bud_detail join bud_detail_periode using (bd_id) ".
+ " join bud_card using (bc_id) ".
+ " join poste_analytique using (po_id) ".
+ " where $per ".
+ " and pcm_val=$1 and ".
+ " bud_detail.bh_id=$2 ".
+ " group by ga_id,bc_price_unit ".
+ " order by ga_id ");
+ } else {
+ $sql_prepare=pg_prepare($local_con,"get_group","select sum(bdp_amount) as amount,'Aucun groupe' as ga_id,".
+ "bc_price_unit".
+ " from ".
+ " bud_detail join bud_detail_periode using (bd_id) ".
+ " join bud_card using (bc_id) ".
+ " where $per ".
+ " and pcm_val=$1 and ".
+ " bud_detail.bh_id=$2 ".
+ " group by ga_id,bc_price_unit ".
+ " order by ga_id ");
+
+ }
$array=array();
// Now we put 0 if there is nothing for a group
$aGroup=get_array($this->cn,"select distinct ga_id from bud_detail join poste_analytique ".
" using (po_id) where bh_id=".$this->bh_id." order by ga_id ");
-
+ if ( empty ($aPoste)) return array();
// foreach poste get all the value of the group
foreach ($aPoste as $rPoste) {
$pcm_val=$rPoste['pcm_val'];
@@ -134,9 +150,11 @@ Array
$row=pg_fetch_all($res);
if ( empty ($row) ) continue;
// initialize all groupe to 0
- foreach ($aGroup as $rGroup) {
- $sGroup=$rGroup['ga_id'];
- $line[$sGroup]=0;
+ if ( ! empty($aGroup) ) {
+ foreach ($aGroup as $rGroup) {
+ $sGroup=$rGroup['ga_id'];
+ $line[$sGroup]=0;
+ }
}
$line['total_row']=0;
foreach ($row as $col ) {
@@ -191,14 +209,16 @@ Array
foreach ($p_array as $key=>$row) {
$pcm_val=substr($key,0,2);
$sub=array();
- foreach ($aGroup as $rGroup ) {
- $group_id=$rGroup['ga_id'];
- $sub[$group_id]=(isset($sub[$group_id]))?$sub[$group_id]:0;
- $sub[$group_id]+=$row[$group_id];
- // print_r("$key pcm_val :".$pcm_val."gr.".$group_id." ".$row[$group_id]."sub ".$sub[$group_id]);
- $sub['total']=(isset($sub['total']))?$sub['total']:0;
- $sub['total']+=$row[$group_id];
- //print_r('sub_total = '.$sub['total'].'
');
+ if ( ! empty ($aGroup ) ) {
+ foreach ($aGroup as $rGroup ) {
+ $group_id=$rGroup['ga_id'];
+ $sub[$group_id]=(isset($sub[$group_id]))?$sub[$group_id]:0;
+ $sub[$group_id]+=$row[$group_id];
+ // print_r("$key pcm_val :".$pcm_val."gr.".$group_id." ".$row[$group_id]."sub ".$sub[$group_id]);
+ $sub['total']=(isset($sub['total']))?$sub['total']:0;
+ $sub['total']+=$row[$group_id];
+ //print_r('sub_total = '.$sub['total'].'
');
+ }
}
if (isset( $array[$pcm_val])) {
$new_array=array();
@@ -226,10 +246,12 @@ Array
foreach ($p_array as $col) {
- foreach ($aGroup as $rGroup) {
- $ga_id=$rGroup['ga_id'];
- $array[$ga_id]=(isset($array[$ga_id]))?$array[$ga_id]:0;
- $array[$ga_id]+=$col[$ga_id];
+ if ( ! empty ($aGroup ) ) {
+ foreach ($aGroup as $rGroup) {
+ $ga_id=$rGroup['ga_id'];
+ $array[$ga_id]=(isset($array[$ga_id]))?$array[$ga_id]:0;
+ $array[$ga_id]+=$col[$ga_id];
+ }
}
}
@@ -252,8 +274,10 @@ Array
" using (po_id) where bh_id=".$this->bh_id." order by ga_id ");
$heading.='
';
$heading.='| CE | ';
+ if ( ! empty ($aGroup ) ) {
foreach ($aGroup as $rGroup )
$heading.=''.$rGroup['ga_id'].'';
+ }
$heading.=' | Total Ligne | Result. CE | ';
$heading.='
';
$r.='
';
@@ -261,9 +285,11 @@ Array
foreach ( $p_array as $key=>$v) {
$r.='';
$r.='| '.$key.' - '.$v['acc_name'].' | ';
- foreach ($aGroup as $rGroup ) {
- $gr=$rGroup['ga_id'];
- $r.=sprintf('% 10.2f | ',$v[$gr]);
+ if ( ! empty ($aGroup ) ) {
+ foreach ($aGroup as $rGroup ) {
+ $gr=$rGroup['ga_id'];
+ $r.=sprintf('% 10.2f | ',$v[$gr]);
+ }
}
$r.=sprintf('% 10.2f | ',$v['total_row']);
$r.=sprintf('% 10.2f | ',$v['acc_amount']);
@@ -273,9 +299,11 @@ Array
// Show total by col
$array=$this->total_column($p_array);
$r.=" Total | ";
- foreach ($aGroup as $rGroup ) {
- $gr=$rGroup['ga_id'];
- $r.=sprintf('% 10.2f | ',$array[$gr]);
+ if ( ! empty ($aGroup ) ) {
+ foreach ($aGroup as $rGroup ) {
+ $gr=$rGroup['ga_id'];
+ $r.=sprintf('% 10.2f | ',$array[$gr]);
+ }
}
$r.=sprintf('% 10.2f | ',$array['total_row']);
$r.=sprintf('% 10.2f | ',$array['acc_amount']);
@@ -340,8 +368,10 @@ Array
$heading='
';
$heading.='| CE | ';
- foreach ($aGroup as $rGroup )
- $heading.=''.$rGroup['ga_id'].'';
+ if ( ! empty ($aGroup ) ) {
+ foreach ($aGroup as $rGroup )
+ $heading.=' | '.$rGroup['ga_id'].'';
+ }
$heading.=' | Total Ligne | Result. CE | ';
$heading.='
';
$r='';
@@ -357,11 +387,12 @@ Array
$acc_account->load();
$r.=$key." - ".$acc_account->label.'';
-
- foreach ($aGroup as $gr) {
- $idx=$gr['ga_id'];
- $r.='| '.$aRow[$idx].' | ';
- $amount_row+=$aRow[$idx];
+ if ( ! empty ($aGroup ) ) {
+ foreach ($aGroup as $gr) {
+ $idx=$gr['ga_id'];
+ $r.=''.$aRow[$idx].' | ';
+ $amount_row+=$aRow[$idx];
+ }
}
$r.="".$amount_row.' | ';
$acc_account->id=$acc_account->id."%";
diff --git a/include/class_contact.php b/include/class_contact.php
index 74a711ae9..00b8aa501 100644
--- a/include/class_contact.php
+++ b/include/class_contact.php
@@ -31,7 +31,7 @@ require_once("user_common.php");
class contact extends fiche
{
- var $company; /*!\enum $company company of the contact (ad_id=ATTR_DEF_COMPANY)*/
+ var $company; /*!< $company company of the contact (ad_id=ATTR_DEF_COMPANY)*/
/*!\brief constructor */
function contact($p_cn,$p_id=0)
{
diff --git a/include/class_document.php b/include/class_document.php
index 06da2fcd8..80d7d358e 100644
--- a/include/class_document.php
+++ b/include/class_document.php
@@ -28,15 +28,15 @@ require_once('class_action.php');
*/
class Document
{
- var $db; /*! \enum $db Database connexion*/
- var $d_id; /*! \enum $d_id Document id */
- var $ag_id; /*! \enum $ag_id action_gestion.ag_id (pk) */
- var $d_mimetype; /*! \enum $d_mimetype */
- var $d_filename; /*! \enum $d_filename */
- var $d_lob; /*! \enum $d_lob the oid of the lob */
- var $d_number; /*! \enum $d_number number of the document */
- var $md_id; /*! \enum $md_id document's template */
- var $d_state; /*! \enum $d_state document.d_state status of the document */
+ var $db; /*!< $db Database connexion*/
+ var $d_id; /*!< $d_id Document id */
+ var $ag_id; /*!< $ag_id action_gestion.ag_id (pk) */
+ var $d_mimetype; /*!< $d_mimetype */
+ var $d_filename; /*!< $d_filename */
+ var $d_lob; /*!< $d_lob the oid of the lob */
+ var $d_number; /*!< $d_number number of the document */
+ var $md_id; /*!< $md_id document's template */
+ var $d_state; /*!< $d_state document.d_state status of the document */
/* Constructor
* \param $p_cn Database connection
*/
@@ -655,6 +655,7 @@ class Document
$r=${$id};
break;
+
case 'TVA_CODE':
extract ($_POST);
$id='e_march'.$counter.'_tva_id';
@@ -679,9 +680,8 @@ class Document
$r=$tva['tva_label'];
break;
-
+ /* total VAT for one sold */
case 'TVA_AMOUNT':
- case 'VEN_TVA':
extract ($_POST);
$qt='e_quant'.$counter;
$price='e_march'.$counter.'_sell' ;
@@ -700,6 +700,47 @@ class Document
$r=round($r,2);
break;
+ case 'VEN_ART_TVA':
+ extract ($_POST);
+ $qt='e_quant'.$counter;
+ $price='e_march'.$counter.'_sell' ;
+ $tva='e_march'.$counter.'_tva_id';
+ if ( !isset (${'e_march'.$counter}) ) return "";
+ // check that something is sold
+ if ( ${$price} == 0 || ${$qt} == 0
+ || strlen(trim( $price )) ==0
+ || strlen(trim($qt)) ==0)
+ return "";
+ $a_tva=GetTvaRate($this->db,${$tva});
+ echo_debug('class_document',__LINE__,'Tva :'.var_export($a_tva,true));
+ // if no vat returns 0
+ if ( sizeof($a_tva) == 0 ) return "";
+ $r=round(${$price},2)*$a_tva['tva_rate'];
+ $r=round($r,2);
+ break;
+
+ case 'VEN_ART_TVAC':
+ extract ($_POST);
+ $qt='e_quant'.$counter;
+ $price='e_march'.$counter.'_sell' ;
+ $tva='e_march'.$counter.'_tva_id';
+ if ( !isset (${'e_march'.$counter}) ) return "";
+ // check that something is sold
+ if ( ${$price} == 0 || ${$qt} == 0
+ || strlen(trim( $price )) ==0
+ || strlen(trim($qt)) ==0)
+ return "";
+ $a_tva=GetTvaRate($this->db,${$tva});
+ echo_debug('class_document',__LINE__,'Tva :'.var_export($a_tva,true));
+ // if no vat returns 0
+ if ( sizeof($a_tva) == 0 ) {
+ $r=round(${$price},2);
+ }else {
+ $r=round(${$price}*$a_tva['tva_rate']+${$price},2);
+ }
+
+ break;
+
case 'VEN_ART_QUANT':
extract ($_POST);
$id='e_quant'.$counter;
diff --git a/include/class_document_modele.php b/include/class_document_modele.php
index d85e2f22e..1d7c5787d 100644
--- a/include/class_document_modele.php
+++ b/include/class_document_modele.php
@@ -26,13 +26,13 @@
*/
class Document_modele {
- var $cn; /*! \enum $cn database connection */
- var $md_id; /*! \enum $md_id pk */
- var $md_name; /*! \enum $md_name template's name */
- var $md_type; /*! \enum $md_type template's type (letter, invoice, order...) */
- var $md_lob; /*! \enum $md_lob Document file */
- var $md_sequence; /*! \enum $md_sequence sequence name (autogenerate) */
- var $sequence; /*! \enum $sequence sequence number used by the create sequence start with */
+ var $cn; /*!< $cn database connection */
+ var $md_id; /*!< $md_id pk */
+ var $md_name; /*!< $md_name template's name */
+ var $md_type; /*!< $md_type template's type (letter, invoice, order...) */
+ var $md_lob; /*!< $md_lob Document file */
+ var $md_sequence; /*!< $md_sequence sequence name (autogenerate) */
+ var $sequence; /*!< $sequence sequence number used by the create sequence start with */
//Constructor parameter = database connexion
function Document_modele($p_cn,$p_id=-1) {
$this->cn=$p_cn;
diff --git a/include/class_document_type.php b/include/class_document_type.php
index 9adc3a9b1..9591aba80 100644
--- a/include/class_document_type.php
+++ b/include/class_document_type.php
@@ -23,8 +23,8 @@
*/
/*! \brief class for the table document_type
- * \enum dt_id pk document_type
- * \enum dt_value value
+ *< dt_id pk document_type
+ *< dt_value value
*/
class Document_type
{
@@ -49,4 +49,4 @@ class Document_type
$this->dt_value=$r['dt_value'];
}
-}
\ No newline at end of file
+}
diff --git a/include/class_fiche_def_ref.php b/include/class_fiche_def_ref.php
index cce5d7677..6c80479bd 100644
--- a/include/class_fiche_def_ref.php
+++ b/include/class_fiche_def_ref.php
@@ -29,10 +29,10 @@
class fiche_def_ref
{
- var $frd_id; /*! \enum $frd_id fiche_def_ref.frd_id */
- var $frd_text; /*! \enum $frd_text fiche_def_ref.frd_tex */
- var $frd_class_base; /*! \enum fiche_def_ref.frd_class_base */
- var $attribut; /*! \enum array which containing list of attr */
+ var $frd_id; /*!< $frd_id fiche_def_ref.frd_id */
+ var $frd_text; /*!< $frd_text fiche_def_ref.frd_tex */
+ var $frd_class_base; /*!< fiche_def_ref.frd_class_base */
+ var $attribut; /*!< array which containing list of attr */
/* it is used with dynamic variables */
function fiche_def_ref($p_cn,$p_frd_id=-1)
@@ -136,4 +136,4 @@ class fiche_def_ref
}
}
-?>
\ No newline at end of file
+?>
diff --git a/include/class_gestion_purchase.php b/include/class_gestion_purchase.php
index 7cdf4a08c..3a7cc953d 100644
--- a/include/class_gestion_purchase.php
+++ b/include/class_gestion_purchase.php
@@ -20,7 +20,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file concern the table quant_sold
+/*!\file
+* \brief Definition of the class gestion_purchase
*/
/*! \brief this object handles the table quant_purchase
diff --git a/include/class_gestion_sold.php b/include/class_gestion_sold.php
index b11e08fc9..e7a109b17 100644
--- a/include/class_gestion_sold.php
+++ b/include/class_gestion_sold.php
@@ -20,7 +20,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file concern the table quant_sold
+/*!\file
+ * \brief definition of the class gestion_sold
*/
/*! \brief this object handles the table quant_sold
diff --git a/include/class_gestion_table.php b/include/class_gestion_table.php
index 02cd3d679..322541c1b 100644
--- a/include/class_gestion_table.php
+++ b/include/class_gestion_table.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief definition of gestion_table
*/
/*! \brief mother class for gestion
diff --git a/include/class_parm_code.php b/include/class_parm_code.php
index bfa73e82f..36f8191d8 100644
--- a/include/class_parm_code.php
+++ b/include/class_parm_code.php
@@ -28,10 +28,10 @@
*/
class parm_code {
- var $db; /*! \enum $db database connection */
- var $p_code; /*! \enum $p_code parm_code.p_code primary key */
- var $p_value; /*! \enum $p_value parm_code.p_value */
- var $p_comment; /*! \enum $p_comment parm_code.p_comment */
+ var $db; /*!< $db database connection */
+ var $p_code; /*!< $p_code parm_code.p_code primary key */
+ var $p_value; /*!< $p_value parm_code.p_value */
+ var $p_comment; /*!< $p_comment parm_code.p_comment */
// constructor
function parm_code($p_cn,$p_id=-1)
{
diff --git a/include/class_periode.php b/include/class_periode.php
index 1b656cf0c..4aa2ae6d6 100644
--- a/include/class_periode.php
+++ b/include/class_periode.php
@@ -21,7 +21,10 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
- * \brief For the periode table parm_periode and jrn_periode
+ * \brief definition of the class periode
+ */
+/*!
+ * \brief For the periode tables parm_periode and jrn_periode
*/
require_once ('ac_common.php');
require_once ('debug.php');
diff --git a/include/class_pre_op_ach.php b/include/class_pre_op_ach.php
index f6dc509d1..6e3906b70 100644
--- a/include/class_pre_op_ach.php
+++ b/include/class_pre_op_ach.php
@@ -20,13 +20,14 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
+/*!\file
+ * \brief definition of the class pre_op_ach
*/
require_once ('class_pre_operation.php');
/*---------------------------------------------------------------------- */
-/*!\brief concerns the operation for ACH ledger
-/*---------------------------------------------------------------------- */
+/*!\brief concerns the predefined operation for ACH ledger
+ */
class Pre_op_ach extends Pre_operation_detail {
var $op;
function __construct($cn) {
diff --git a/include/class_pre_op_advanced.php b/include/class_pre_op_advanced.php
index 1513fd58c..37f903d25 100644
--- a/include/class_pre_op_advanced.php
+++ b/include/class_pre_op_advanced.php
@@ -20,13 +20,14 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
+/*!\file
+ * \brief definition of the class Pre_Op_Advanced
*/
require_once ('class_pre_operation.php');
/*---------------------------------------------------------------------- */
-/*!\brief concerns the operation for VEN ledger
-/*---------------------------------------------------------------------- */
+/*!\brief concerns the predefined operation for the operation from 'Ecriture direct'
+ */
class Pre_Op_Advanced extends Pre_operation_detail {
var $op;
function Pre_Op_Advanced($cn) {
diff --git a/include/class_pre_op_fin.php b/include/class_pre_op_fin.php
index 23f710ee3..6225aaff3 100644
--- a/include/class_pre_op_fin.php
+++ b/include/class_pre_op_fin.php
@@ -20,13 +20,14 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
+/*!\file
+ * \brief definition of the class Pre_op_fin
*/
require_once ('class_pre_operation.php');
/*---------------------------------------------------------------------- */
-/*!\brief concerns the operation for VEN ledger
-/*---------------------------------------------------------------------- */
+/*!\brief concerns the predefined operation for FIN ledger
+ */
class Pre_op_fin extends Pre_operation_detail {
var $op;
function __construct($cn) {
diff --git a/include/class_pre_op_ods.php b/include/class_pre_op_ods.php
index ce7d90f67..fbc79a1d4 100644
--- a/include/class_pre_op_ods.php
+++ b/include/class_pre_op_ods.php
@@ -20,13 +20,14 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
+/*!\file
+ * \brief definition of the class Pre_op_ods
*/
require_once ('class_pre_operation.php');
/*---------------------------------------------------------------------- */
-/*!\brief concerns the operation for ODS ledger
-/*---------------------------------------------------------------------- */
+/*!\brief concerns the predefined operation for ODS ledger
+*/
class Pre_op_ods extends Pre_operation_detail {
var $op;
function __construct($cn) {
diff --git a/include/class_pre_op_ven.php b/include/class_pre_op_ven.php
index a401591a9..41bee4454 100644
--- a/include/class_pre_op_ven.php
+++ b/include/class_pre_op_ven.php
@@ -20,13 +20,14 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
+/*!\file
+ * \brief definition of the class Pre_op_ven
*/
require_once ('class_pre_operation.php');
/*---------------------------------------------------------------------- */
-/*!\brief concerns the operation for VEN ledger
-/*---------------------------------------------------------------------- */
+/*!\brief concerns the predefined operation for VEN ledger
+*/
class Pre_op_ven extends Pre_operation_detail {
var $op;
function __construct($cn) {
diff --git a/include/class_pre_operation.php b/include/class_pre_operation.php
index eaff9ecd8..93d368737 100644
--- a/include/class_pre_operation.php
+++ b/include/class_pre_operation.php
@@ -21,6 +21,7 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
+ * \brief definition of Pre_operation
*/
/*! \brief manage the predefined operation, link to the table op_def
diff --git a/include/class_rapport.php b/include/class_rapport.php
index 9cebb3475..0ff41e820 100644
--- a/include/class_rapport.php
+++ b/include/class_rapport.php
@@ -26,9 +26,9 @@
*/
class rapport {
- var $db; /*! \enum $db database connx */
- var $id; /*! \enum $id formdef.fr_id */
- var $name; /*! \enum $name report's name */
+ var $db; /*!< $db database connx */
+ var $id; /*!< $id formdef.fr_id */
+ var $name; /*!< $name report's name */
/*!\brief Constructor */
function rapport($p_cn,$p_id) {
$this->db=$p_cn;
diff --git a/include/class_supplier.php b/include/class_supplier.php
index bf56b9809..48013e164 100644
--- a/include/class_supplier.php
+++ b/include/class_supplier.php
@@ -37,12 +37,12 @@ require_once('user_common.php');
//
class Supplier extends fiche{
- var $poste; /*! \enum $poste poste comptable */
- var $name; /*! \enum $name name of the company */
- var $street; /*! \enum $street Street */
- var $country; /*! \enum $country Country */
- var $cp; /*! \enum $cp Zip code */
- var $vat_number; /*! \enum $vat_number vat number */
+ var $poste; /*!< $poste poste comptable */
+ var $name; /*!< $name name of the company */
+ var $street; /*!< $street Street */
+ var $country; /*!< $country Country */
+ var $cp; /*!< $cp Zip code */
+ var $vat_number; /*!< $vat_number vat number */
/*! \brief Constructor
/* only a db connection is needed */
diff --git a/include/constant.php b/include/constant.php
index 6e99ff0f6..7c07fed89 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -25,8 +25,14 @@
*/
date_default_timezone_set ('Europe/Brussels');
+$inc_path=get_include_path();
+if ( strpos($inc_path,";") != 0 ) {
+ $_ENV['TMP']="c:\Temp";
+ } else {
+ $_ENV['TMP']="/tmp";
+ }
+
-$_ENV['TMP']="/tmp";
define ("phpcompta_password","dany");
define ("phpcompta_psql_port","5432");
define ("phpcompta_user","phpcompta");
@@ -36,7 +42,7 @@ define ("domaine","");
define ("MAX_COMPTE",4);
define ('MAX_BUD_DETAIL',20);
-define ("DEBUG","true");
+define ("DEBUG","false");
// securite correspond a la table
// action
diff --git a/include/decla.BE.inc.php b/include/decla.BE.inc.php
index 042b20c58..10059b71a 100644
--- a/include/decla.BE.inc.php
+++ b/include/decla.BE.inc.php
@@ -18,8 +18,12 @@
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/*!\file OBSOLETE ?
+/*!\file
+ * \brief EXPERIMENTAL : listing VAT in xml form
*/
+ /*!
+ * \brief OBSOLETE ?
+ */
/*!
**************************************************
diff --git a/include/depense.inc.php b/include/depense.inc.php
index d3981e5e4..09452c89c 100644
--- a/include/depense.inc.php
+++ b/include/depense.inc.php
@@ -17,6 +17,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision$ */
+/*!\file
+ *\brief this file is called by the main page of "gestion"
+ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
require_once('class_acc_ledger.php');
require_once('user_form_ach.php');
diff --git a/include/dossier.inc.php b/include/dossier.inc.php
index f8c481859..c72561270 100644
--- a/include/dossier.inc.php
+++ b/include/dossier.inc.php
@@ -20,10 +20,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
- */
-
-/* \brief Management of the folder
+/*!\file
+* \brief Management of the folder
*
*/
require_once ('class_widget.php');
diff --git a/include/form_inc.php b/include/form_inc.php
index 3fb40726c..a1231db99 100644
--- a/include/form_inc.php
+++ b/include/form_inc.php
@@ -17,7 +17,11 @@
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+/*!\file
+ * \brief common function for report
+ */
+/*!\todo the function of this file form_inc.php should be rewrited in a OO way
+*/
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
//$Revision$
include_once("impress_inc.php");
diff --git a/include/header_print.php b/include/header_print.php
index 77f19f24b..c41abe16b 100644
--- a/include/header_print.php
+++ b/include/header_print.php
@@ -20,10 +20,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* !\file
- */
-
-/* \brief
+/*!\file
+ * \brief contains several function to replace the header in generated document
*
*/
diff --git a/include/import_inc.php b/include/import_inc.php
index 126267d86..f45160a98 100644
--- a/include/import_inc.php
+++ b/include/import_inc.php
@@ -16,7 +16,9 @@
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+/*!\file
+ * \brief import operation into the accountancy
+ */
// Copyright Author Olivier Dzwoniarkiewicz
// Modified Dany De Bontridder ddebontridder@yahoo.fr
// $Revision$
diff --git a/include/impress_fiche.inc.php b/include/impress_fiche.inc.php
index 27f9a1bb5..84a06b373 100644
--- a/include/impress_fiche.inc.php
+++ b/include/impress_fiche.inc.php
@@ -18,7 +18,9 @@
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
+/*!\file
+ * \brief printing of card
+ */
include_once('postgres.php');
include_once('class_fiche.php');
include_once("class_widget.php");
diff --git a/include/impress_inc.php b/include/impress_inc.php
index 3bec06932..2ff8e3016 100644
--- a/include/impress_inc.php
+++ b/include/impress_inc.php
@@ -19,7 +19,10 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
// $Revision$
-
+/*!\file
+ * \brief contains function for the printing
+ * \todo the functions of impress_inc.php should be replaced in a OO way
+*/
/*!
* \brief Get dat for poste
@@ -36,7 +39,6 @@ function get_dataPoste($p_cn,$p_poste,$p_condition)
"case when j_debit='f' then to_char(j_montant,'999999999.99') else ' ' end as cred_montant,".
" jr_comment as description,jrn_def_name as jrn_name,".
"j_debit, jr_internal ".
-// " case when j_debit='t' then 'debit' else 'credit' end as debit".
" from jrnx left join jrn_def on jrn_def_id=j_jrn_def ".
" left join jrn on jr_grpt_id=j_grpt".
" where j_poste=".$p_poste." and ".$p_condition.
@@ -548,9 +550,9 @@ function ParseFormula($p_cn,$p_label,$p_formula,$p_start,$p_end,$p_eval=true,$p_
$cond=sql_filter_per($p_cn,$p_start,$p_end,'p_id','j_tech_per');
else
$cond="( j_date >= to_date('$p_start','DD.MM.YYYY') and j_date <= to_date('$p_end','DD.MM.YYYY'))";
-
+echo_debug(__FILE__,__LINE__,"receiving $p_formula");
include_once("class_acc_account_ledger.php");
- while (ereg("(\[[0-9]*%*D*C*\])",$p_formula,$e) == true) {
+ while (ereg("(\[[0-9]*%*D*C*S*\])",$p_formula,$e) == true) {
// remove the [ ]
$x=$e;
@@ -559,11 +561,15 @@ function ParseFormula($p_cn,$p_label,$p_formula,$p_start,$p_end,$p_eval=true,$p_
$compute='deb';
if ( strpos($e[0],'C') != 0 )
$compute='cred';
+ if ( strpos($e[0],'S') != 0 )
+ $compute='signed';
+ echo_debug(__FILE__,__LINE__,' $e = '.$e[0]);
echo_debug(__FILE__,__LINE__,' $e = '.$e[0]);
$e[0]=str_replace ("[","",$e[0]);
$e[0]=str_replace ("]","",$e[0]);
$e[0]=str_replace ("D","",$e[0]);
$e[0]=str_replace ("C","",$e[0]);
+ $e[0]=str_replace ("S","",$e[0]);
echo_debug('impress_inc',__LINE__,"p_formula is $p_formula");
// If there is a FROM clause we must recompute
// the time cond
@@ -579,7 +585,7 @@ function ParseFormula($p_cn,$p_label,$p_formula,$p_start,$p_end,$p_eval=true,$p_
if ( $from == '00.0000' ) {
// retrieve the first month of this periode
$User=new User($p_cn);
- $user_periode=$User->getPeriode();
+ $user_periode=$User->get_periode();
$periode=getDbValue($p_cn,
"select p_exercice from parm_periode where p_id=$user_periode");
$sql_per="select to_char(p_start,'MM.YYYY') as start from parm_periode where ".
@@ -614,8 +620,11 @@ function ParseFormula($p_cn,$p_label,$p_formula,$p_start,$p_end,$p_eval=true,$p_
$i=$detail['debit'];
if ( $compute=='cred')
$i=$detail['credit'];
-
+ if ( $compute=='signed')
+ $i=$detail['debit']-$detail['credit'];
+echo_debug(__FILE__,__LINE__,"Resultat = $i ");
$p_formula=str_replace($x[0],$i,$p_formula);
+echo_debug(__FILE__,__LINE__,"p_formula = $p_formula ");
}
@@ -711,9 +720,10 @@ function CheckFormula($p_string) {
$p_string=str_replace("<","+",$p_string);
// eat Space
$p_string=str_replace(" ","",$p_string);
- // Remove D/C
+ // Remove D/C/S
$p_string=str_replace("C","",$p_string);
$p_string=str_replace("D","",$p_string);
+ $p_string=str_replace("S","",$p_string);
if ( ereg ("^(\\$[a-zA-Z]*[0-9]*=){0,1}((\[{0,1}[0-9]+\.*[0-9]*%{0,1}\]{0,1})+ *([+-\*/])* *(\[{0,1}[0-9]+\.*[0-9]*%{0,1}\]{0,1})*)*(([+-\*/])*\\$([a-zA-Z])+[0-9]*([+-\*/])*)* *( *FROM=[0-9][0-0].20[0-9][0-9]){0,1}$",$p_string) == false)
{
return false;
diff --git a/include/impress_jrn.inc.php b/include/impress_jrn.inc.php
index b69aceeeb..bf95bf7c7 100644
--- a/include/impress_jrn.inc.php
+++ b/include/impress_jrn.inc.php
@@ -248,7 +248,7 @@ $w->selected=1;
echo $w->IOValue('p_simple',$a,'Style d\'impression');
print "";
echo '
';
-print widget::submit('bt_html','Impression');
+print widget::submit('bt_html','Visualisation');
echo '';
echo ' Attention : en-cas d\'impression de journaux centralisés, dans le PDF, les montants débit et crédit calculés par page sont la somme des montants de la page uniquement. Si une opération est sur 2 pages ces montants diffèreront évidemment. Ces montants doivent être égaux sur la dernière page. Pour vérifier la balance, utilisez la balance des comptes ou Avancé->Vérification';
diff --git a/include/impress_poste.inc.php b/include/impress_poste.inc.php
index ece12386b..573258277 100644
--- a/include/impress_poste.inc.php
+++ b/include/impress_poste.inc.php
@@ -19,6 +19,7 @@
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
include_once("class_widget.php");
+require_once('class_acc_operation.php');
/*! \file
* \brief Print account (html or pdf)
* file included from user_impress
@@ -73,11 +74,20 @@ print "| ";
$all=new widget("checkbox");
$all->label="Tous les postes qui en dépendent";
$all->disabled=false;
+$all->selected=(isset($_REQUEST['poste_fille']))?true:false;
echo $all->IOValue("poste_fille");
+echo ' |
| ';
+$detail=new widget("checkbox");
+$detail->label="Détail des opérations";
+$detail->disabled=false;
+$detail->selected=(isset($_REQUEST['oper_detail']))?true:false;
+echo $detail->IOValue("oper_detail");
+echo ' |
';
echo '
';
-print widget::submit('bt_html','Impression');
+print widget::submit('bt_html','Visualisation');
echo '';
+echo '
';
echo '
';
//-----------------------------------------------------
@@ -119,9 +129,34 @@ if ( isset( $_POST['bt_html'] ) ) {
if ( $go == 1)
{
echo '';
- $Poste=new Acc_Account_Ledger($cn,$_POST['poste_id']);
- $Poste->HtmlTableHeader($_POST['poste_id']);
- $Poste->HtmlTable();
+ if ( ! isset ($_REQUEST['oper_detail'])) {
+ $Poste=new Acc_Account_Ledger($cn,$_POST['poste_id']);
+ echo Acc_Account_Ledger::HtmlTableHeader();
+
+ foreach ($a_poste as $poste_id )
+ {
+ $Poste=new Acc_Account_Ledger ($cn,$poste_id['pcm_val']);
+ $Poste->HtmlTable();
+ }
+ echo Acc_Account_Ledger::HtmlTableHeader();
+ echo "
";
+ } else {
+ //----------------------------------------------------------------------
+ // Detail
+ //----------------------------------------------------------------------
+ echo Acc_Account_Ledger::HtmlTableHeader();
+ echo '