From MAILER-DAEMON Sat Jun 02 05:50:30 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sakyb-0004KF-Vz
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 05:50:29 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 11:42:32 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150120.1338630629.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4853 - in phpcompta/trunk: include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 09:50:28 -0000

Author: danydb
Date: 2012-06-02 11:42:31 +0200 (Sat, 02 Jun 2012)
New Revision: 4853

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/template/action-reference.php
   phpcompta/trunk/include/template/detail-action.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000599: Table action_gestion_related
0000595: Am?\195?\169lioration apparence listes des actions concern?\195?=
\169es
0000594: Regrouper toutes les actions concern?\195?\169e
0000589: Ajout de liens vers d'autres actions

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-05-31 02:51:49 UTC=
 (rev 4852)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-02 09:42:31 UTC=
 (rev 4853)
@@ -85,14 +85,7 @@
         $act2=3Dnew Follow_Up($cn);
         $act2->fromArray($_POST );
 		 $sub_action=3D"detail";
-		if ( $_POST["new_ref"] !=3D "0")
-		{
-			$act2->add_depend($_POST['new_ref']);
-		}
-		if ( isset ($_POST['sup_dep']))
-		{
-			$act2->suppress_depend($_POST['sup_dep']);
-		}
+
          $act2->Update();
       }
     //------------------------------------------------------------------=
----
@@ -108,14 +101,13 @@
         $act->fromArray($_POST);
         $act->ag_id=3D0;
         $act->d_id=3D0;
-        $act->ag_ref_ag_id=3D$_POST['ag_id'];
+        $act->action=3D$_POST['ag_id'];
=20
         echo '<div class=3D"content">';
=20
         // Add hidden tag
         echo '<form  enctype=3D"multipart/form-data" action=3D"do.php" m=
ethod=3D"post"">';
=20
-        echo dossier::hidden();
         $act->ag_comment=3D"";
         if (isset($_REQUEST['qcode_dest'])) $act->qcode_dest=3D$_REQUEST=
['qcode_dest'];
         echo $act->Display('NEW',false,$base,$retour);
@@ -217,7 +209,6 @@
     $act=3Dnew Follow_Up($cn);
     $act->fromArray($_POST);
     $act->d_id=3D0;
-    $act->ag_ref_ag_id=3D(isset($_POST['ag_ref_ag_id']))?$_POST['ag_ref_=
ag_id']:0;
     $act->md_id=3D(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
=20
     // insert into action_gestion

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-05-31 02:51:49 UTC (rev 4=
852)
+++ phpcompta/trunk/include/action.inc.php	2012-06-02 09:42:31 UTC (rev 4=
853)
@@ -52,7 +52,7 @@
  */
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $ac=3D$_REQUEST['ac'];
-$base=3D'ac=3D'.$ac;
+$base=3DHtmlInput::request_to_string(array('ac','gDossier'),"");
=20
 require_once('action.common.inc.php');
 echo "</div>";

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-05-31 02:51:49=
 UTC (rev 4852)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-02 09:42:31=
 UTC (rev 4853)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::get_to_string(array("qcode","ag_dest","query","tdoc","date_=
start","date_end","see_all","all_action"));
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("qcode","ag_dest","query","tdoc","d=
ate_start","date_end","see_all","all_action","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-05-31 02:51:49 UTC (=
rev 4852)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-02 09:42:31 UTC (=
rev 4853)
@@ -71,7 +71,6 @@
 	var $d_mimetype; /* !<   $d_mimetype document's filename      */
 	var $ag_title;   /* !<   $ag_title title document	      */
 	var $f_id;	/* !<   $f_id_dest fiche id (From field )  */
-	var $ag_ref_ag_id;   /* !<   $ag_ref_ag_id concern previous action */
 	var $ag_ref;  /* !< $ag_ref is the ref  */
 	var $ag_hour;  /* !< $ag_hour is the hour of the meeting, action */
 	var $ag_priority; /* !< $ag_priority is the priority 1 High, 2 medium, =
3 low */
@@ -171,7 +170,7 @@
=20
 		// List related action
 		$action =3D $this->db->get_array("
-			select ag_id,substr(ag_title,1,20) as sub_title,to_char(ag_timestamp,=
'DD.MM.YY') as str_date ,
+			select ag_id,ag_ref,substr(ag_title,1,40) as sub_title,to_char(ag_tim=
estamp,'DD.MM.YY') as str_date ,
 				ag_timestamp
 					from action_gestion
 				where
@@ -180,6 +179,8 @@
 				ag_id in (select aga_least from action_gestion_related where aga_gre=
atest =3D$1)
 				order by ag_timestamp",array($this->ag_id));
 		$iaction=3Dnew IRelated_Action('action');
+		$iaction->value=3D(isset($this->action))?$this->action:"";
+
 		// state
 		// Retrieve the value
 		$a =3D $this->db->make_array("select s_id,s_value from document_state =
");
@@ -298,23 +299,7 @@
=20
 		$h_ag_id =3D new IHidden();
 		// if concerns another action : show the link otherwise nothing
-		$lag_ref_ag_id =3D " 00 / 00 ";
-
-		if ($this->ag_ref_ag_id !=3D 0)
-		{
-			$supl_hidden =3D '';
-			if (isset($_REQUEST['sc']))
-				$supl_hidden.=3D'&sc=3D' . $_REQUEST['sc'];
-			if (isset($_REQUEST['f_id']))
-				$supl_hidden.=3D'&f_id=3D' . $_REQUEST['f_id'];
-			if (isset($_REQUEST['sb']))
-				$supl_hidden.=3D'&sb=3D' . $_REQUEST['sb'];
-
-			$lag_ref_ag_id =3D '<a class=3D"line" href=3D"?ac=3D' . $_REQUEST['ac=
'] . $supl_hidden . '&sa=3Ddetail&ag_id=3D' .
-					$this->ag_ref_ag_id . '&' . dossier::get() . '">' .
-					$this->db->get_value("select ag_ref from action_gestion where ag_id=
=3D$1", array($this->ag_ref_ag_id)) .
-					"</A>";
-		}
+		//
 		// sender
 		$w =3D new ICard();
 		$w->readonly =3D $readonly;
@@ -511,26 +496,11 @@
 		//hidden
 		$r.=3D"<p>";
 		$r.=3D$h2->input();
-		$r.=3D$h_agrefid->input("ag_ref_ag_id", $this->ag_ref_ag_id);
 		$r.=3D$h_ag_id->input('ag_id', $this->ag_id);
 		$hidden2 =3D new IHidden();
 		$r.=3D$hidden2->input('f_id_dest', $this->f_id_dest);
 		$r.=3D"</p>";
=20
-		// show the list of the concern operation
-		if ($this->db->count_sql('select * from action_gestion where ag_ref_ag=
_id!=3D0 and ag_ref_ag_id=3D' . $this->ag_id .
-						" limit 2") > 0)
-		{
-			$sql =3D sprintf(" and ag_id in (select action_get_tree from comptapr=
oc.action_get_tree(%s)) ", $this->ag_id);
-			$r.=3D$this->myList($p_base, "", $sql);
-		}
-		// New referecne
-		ob_start();
-		require_once 'template/action-reference.php';
-		$content =3D ob_get_contents();
-		ob_end_clean();
-
-		$r.=3D$content;
 		return $r;
 	}
=20
@@ -541,7 +511,7 @@
 	{
 		$sql =3D "select ag_id,to_char (ag_timestamp,'DD.MM.YYYY') as ag_times=
tamp," .
 				" f_id_dest,ag_title,ag_ref,d_id,ag_type,ag_state,  " .
-				" ag_ref_ag_id, ag_dest, ag_hour, ag_priority, ag_cal,ag_contact,to_=
char (ag_remind_date,'DD.MM.YYYY') as ag_remind_date " .
+				"  ag_dest, ag_hour, ag_priority, ag_cal,ag_contact,to_char (ag_remi=
nd_date,'DD.MM.YYYY') as ag_remind_date " .
 				" from action_gestion left join document using (ag_id) where ag_id=3D=
" . $this->ag_id;
 		$r =3D $this->db->exec_sql($sql);
 		$row =3D Database::fetch_all($r);
@@ -554,7 +524,6 @@
 		$this->ag_type =3D $row[0]['ag_type'];
 		$this->ag_ref =3D $row[0]['ag_ref'];
 		$this->ag_state =3D $row[0]['ag_state'];
-		$this->ag_ref_ag_id =3D $row[0]['ag_ref_ag_id'];
 		$this->d_id =3D $row[0]['d_id'];
 		$this->ag_dest =3D $row[0]['ag_dest'];
 		$this->ag_hour =3D $row[0]['ag_hour'];
@@ -620,22 +589,21 @@
 			$ag_cal =3D 'C';
 		else
 			$ag_cal =3D 'I';
-		$this->ag_ref_ag_id =3D (strlen(trim($this->ag_ref_ag_id)) =3D=3D 0) ?=
 0 : $this->ag_ref_ag_id;
 		// save into the database
 		if ($this->ag_remind_date !=3D null || $this->ag_remind_date !=3D '')
 		{
 			$sql =3D "insert into action_gestion" .
-					"(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref,ag_ref_ag_id=
, ag_dest, " .
+					"(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, " =
.
 					" ag_hour, ag_priority,ag_cal,ag_owner,ag_contact,ag_state,ag_remin=
d_date) " .
-					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13,$14,to_date($15,'DD.MM.YYYY'))";
+					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13,to_date($14,'DD.MM.YYYY'))";
 		}
 		else
 		{
 			$this->ag_remind_date =3D null;
 			$sql =3D "insert into action_gestion" .
-					"(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref,ag_ref_ag_id=
, ag_dest, " .
+					"(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, " =
.
 					" ag_hour, ag_priority,ag_cal,ag_owner,ag_contact,ag_state,ag_remin=
d_date) " .
-					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13,$14,$15)";
+					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13,$14)";
 		}
 		if ($this->ag_dest =3D=3D 0)
 		{
@@ -646,16 +614,15 @@
 			$this->dt_id, /* 3 */
 			$this->ag_title, /* 4 */
 			$exp->id, /* 5 */
-			$ref, /* 7 */
-			$this->ag_ref_ag_id, /* 8 */
-			$this->ag_dest, /* 9 */
-			$this->ag_hour, /* 10 */
-			$this->ag_priority, /* 11 */
-			$ag_cal, /* 12 */
-			$_SESSION['g_user'], /* 13 */
-			$contact->id, /* 14 */
-			$this->ag_state, /* 15 */
-			$this->ag_remind_date
+			$ref, /* 6 */
+			$this->ag_dest, /* 7 */
+			$this->ag_hour, /* 8 */
+			$this->ag_priority, /* 9 */
+			$ag_cal, /* 10 */
+			$_SESSION['g_user'], /* 11 */
+			$contact->id, /* 12 */
+			$this->ag_state, /* 13 */
+			$this->ag_remind_date /* 14 */
 				)
 		);
=20
@@ -677,6 +644,7 @@
 					, array($this->ag_id, $_SESSION['g_user'], $this->ag_comment));
 		}
 		$this->insert_operation();
+		$this->insert_action();
 	}
=20
 	/* ! myList($p_filter=3D"")
@@ -689,9 +657,8 @@
=20
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
-		$str_dossier =3D dossier::get();
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("qcode", "ag_dest_query", "que=
ry", "tdoc", "date_start", "date_end", "see_all", "all_action")) . $str_d=
ossier . '&' . $p_base;
+		$url =3D HtmlInput::get_to_string(array("qcode", "ag_dest_query", "que=
ry", "tdoc", "date_start", "date_end", "see_all", "all_action")) .  '&' .=
 $p_base;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -700,7 +667,6 @@
 		$table->add('Groupe', $url, "order by coalesce((select p_name from pro=
file where p_id=3Dag_dest),'Aucun groupe')", "order by coalesce((select p=
_name from profile where p_id=3Dag_dest),'Aucun groupe') desc", 'dea', 'd=
ed');
 		$table->add('Dest/Exp', $url, 'order by name asc', 'order by name desc=
', 'ea', 'ed');
 		$table->add('Titre', $url, 'order by ag_title asc', 'order by ag_title=
 desc', 'ta', 'td');
-		$table->add('Concerne', $url, 'order by ag_ref_ag_id asc', 'order by a=
g_ref_ag_id desc', 'ca', 'cd');
=20
 		$ord =3D (!isset($_GET['ord'])) ? "dd" : $_GET['ord'];
 		$sort =3D $table->get_sql_order($ord);
@@ -713,7 +679,6 @@
 		$sql =3D "
              select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
 			 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
-			 ag_ref_ag_id,
 			 f_id_dest,
              ag_title,dt_value,ag_ref, ag_priority,ag_state,
 			coalesce((select p_name from profile where p_id=3Dag_dest),'Aucun gro=
upe') as dest,
@@ -749,11 +714,6 @@
 		$r.=3D'<th>' . _('type') . '</th>';
 		$r.=3Dth('Etat');
 		$r.=3Dth('Priorit=C3=A9');
-		$r.=3D'<th>' . $table->get_header(6) . '</th>';
-		if (isset($this->suppress))
-		{
-			$r.=3D"<th> Suppr. d=C3=A9pendance</th>";
-		}
 		$r.=3D"</tr>";
=20
=20
@@ -806,21 +766,6 @@
=20
 			$ref =3D "";
=20
-			// show reference
-			if ($row['ag_ref_ag_id'] !=3D 0)
-			{
-				$retSqlStmt =3D $this->db->exec_sql(
-						"select ag_ref from action_gestion where ag_id=3D" . $row['ag_ref_=
ag_id']);
-				$retSql =3D Database::fetch_all($retSqlStmt);
-				if ($retSql !=3D null)
-				{
-					foreach ($retSql as $line)
-					{
-						$ref.=3D'<A  href=3D"do.php?' . $p_base . '&query=3D' . $line['ag_=
ref'] . '&' . $str_dossier . '">' .
-								$line['ag_ref'] . "<A>";
-					}
-				}
-			}
=20
 			$r.=3D'<td>' . $href .
 					h($row['ag_title']) . "</A></td>";
@@ -867,12 +812,6 @@
 			$r.=3Dtd($priority);
=20
 			$r.=3D"<td>" . $ref . "</td>";
-			if (isset($this->suppress))
-			{
-				$ck =3D new ICheckBox('sup_dep[]');
-				$ck->value =3D $row['ag_id'];
-				$r.=3D"<td>" . $ck->input() . "</td>";
-			}
 			$r.=3D"</tr>";
 		}
=20
@@ -931,30 +870,28 @@
 					" ag_title=3D$2," .
 					" ag_type=3D$3, " .
 					" f_id_dest=3D$4, " .
-					" ag_ref_ag_id=3D$5 ," .
-					"ag_state=3D$6," .
-					" ag_hour =3D $8 ," .
-					" ag_priority =3D $9 ," .
-					" ag_dest =3D $10 , " .
-					" ag_cal =3D $11 ," .
-					" ag_contact =3D $12, " .
-					" ag_ref =3D $13, " .
-					" ag_remind_date=3Dto_date($14,'DD.MM.YYYY') " .
-					" where ag_id =3D $7", array(
-				$this->ag_timestamp, /* 2 */
-				$this->ag_title, /* 3 */
-				$this->dt_id, /* 4 */
-				$this->f_id_dest, /* 5 */
-				$this->ag_ref_ag_id, /* 6 */
-				$this->ag_state, /* 7 */
-				$this->ag_id, /* 8 */
-				$this->ag_hour, /* 9 */
-				$this->ag_priority, /* 10 */
-				$this->ag_dest, /* 11 */
-				$ag_cal, /* 12 */
-				$contact->id, /* 13 */
-				$this->ag_ref, /* 14 */
-				$this->ag_remind_date /* 15 */
+					"ag_state=3D$5," .
+					" ag_hour =3D $7 ," .
+					" ag_priority =3D $8 ," .
+					" ag_dest =3D $9 , " .
+					" ag_cal =3D $10 ," .
+					" ag_contact =3D $11, " .
+					" ag_ref =3D $12, " .
+					" ag_remind_date=3Dto_date($13,'DD.MM.YYYY') " .
+					" where ag_id =3D $6", array(
+				$this->ag_timestamp, /* 1 */
+				$this->ag_title, /* 2 */
+				$this->dt_id, /* 3 */
+				$this->f_id_dest, /* 4 */
+				$this->ag_state, /* 5 */
+				$this->ag_id, /* 6 */
+				$this->ag_hour, /* 7 */
+				$this->ag_priority, /* 8 */
+				$this->ag_dest, /* 9 */
+				$ag_cal, /* 10 */
+				$contact->id, /* 11 */
+				$this->ag_ref, /* 12 */
+				$this->ag_remind_date /* 13 */
 			));
 		}
 		else
@@ -964,29 +901,27 @@
 					" ag_title=3D$2," .
 					" ag_type=3D$3, " .
 					" f_id_dest=3D$4, " .
-					" ag_ref_ag_id=3D$5 ," .
-					"ag_state=3D$6," .
-					" ag_hour =3D $8 ," .
-					" ag_priority =3D $9 ," .
-					" ag_dest =3D $10 , " .
-					" ag_cal =3D $11 ," .
-					" ag_contact =3D $12, " .
-					" ag_ref =3D $13, " .
+					"ag_state=3D$5," .
+					" ag_hour =3D $7 ," .
+					" ag_priority =3D $8 ," .
+					" ag_dest =3D $9 , " .
+					" ag_cal =3D $10 ," .
+					" ag_contact =3D $11, " .
+					" ag_ref =3D $12, " .
 					" ag_remind_date=3Dnull " .
-					" where ag_id =3D $7", array(
-				$this->ag_timestamp, /* 2 */
-				$this->ag_title, /* 3 */
-				$this->dt_id, /* 4 */
-				$this->f_id_dest, /* 5 */
-				$this->ag_ref_ag_id, /* 6 */
-				$this->ag_state, /* 7 */
-				$this->ag_id, /* 8 */
-				$this->ag_hour, /* 9 */
-				$this->ag_priority, /* 10 */
-				$this->ag_dest, /* 11 */
-				$ag_cal, /* 12 */
-				$contact->id, /* 13 */
-				$this->ag_ref /* 14 */
+					" where ag_id =3D $6", array(
+				$this->ag_timestamp, /* 1 */
+				$this->ag_title, /* 2 */
+				$this->dt_id, /* 3 */
+				$this->f_id_dest, /* 4 */
+				$this->ag_state, /* 5 */
+				$this->ag_id, /* 6 */
+				$this->ag_hour, /* 7*/
+				$this->ag_priority, /* 8 */
+				$this->ag_dest, /* 9 */
+				$ag_cal, /* 10 */
+				$contact->id, /* 11 */
+				$this->ag_ref /* 12 */
 			));
 		}
 		// Upload  documents
@@ -1037,7 +972,6 @@
 		$this->ag_id =3D (isset($p_array['ag_id'])) ? $p_array['ag_id'] : "";
 		$this->qcode_dest =3D (isset($p_array['qcode_dest'])) ? $p_array['qcod=
e_dest'] : "";
 		$this->f_id_dest =3D (isset($p_array['f_id_dest'])) ? $p_array['f_id_d=
est'] : 0;
-		$this->ag_ref_ag_id =3D (isset($p_array['ag_ref_ag_id'])) ? $p_array['=
ag_ref_ag_id'] : 0;
 		$this->ag_timestamp =3D (isset($p_array['ag_timestamp'])) ? $p_array['=
ag_timestamp'] : date('d.m.Y');
 		$this->qcode_dest =3D (isset($p_array['qcode_dest'])) ? $p_array['qcod=
e_dest'] : "";
 		$this->dt_id =3D (isset($p_array['dt_id'])) ? $p_array['dt_id'] : "";
@@ -1068,10 +1002,6 @@
 		$sql =3D "delete from action_gestion where ag_id=3D$1";
 		$this->db->exec_sql($sql, array($this->ag_id));
=20
-		// remove the ref of the depending action
-		$sql =3D "update action_gestion set ag_ref_ag_id=3D0 where ag_ref_ag_i=
d=3D$1";
-		$this->db->exec_sql($sql, array($this->ag_id));
-
 		/*  check the number of attached document */
 		$doc =3D new Document($this->db);
 		$aDoc =3D $doc->get_all($this->ag_id);
@@ -1099,29 +1029,7 @@
 		return $array;
 	}
=20
-	/**
-	 * @brief add an related action to the  current one
-	 */
-	function add_depend($p_ref)
-	{
-		if ($p_ref =3D=3D 0 || $p_ref =3D=3D $this->ag_id)
-			return;
-		// check if action exist and is not already related to the current act=
ion
-		$exist =3D $this->db->get_value("select count(*) from action_gestion w=
here ag_id=3D$1", array($p_ref));
-		if ($exist =3D=3D 0)
-			return;
=20
-		$this->db->exec_sql("update action_gestion set ag_ref_ag_id=3D$1 where=
 ag_id=3D$2", array($this->ag_id, $p_ref));
-	}
-
-	function suppress_depend($p_array)
-	{
-		for ($i =3D 0; $i < count($p_array); $i++)
-		{
-			$this->db->exec_sql("update action_gestion set ag_ref_ag_id=3D0 where=
 ag_id=3D$1", array($p_array[$i]));
-		}
-	}
-
 	function insert_operation()
 	{
 		if (trim($this->operation) =3D=3D '')

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-05-31 02:51:49 UTC =
(rev 4852)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-02 09:42:31 UTC =
(rev 4853)
@@ -511,10 +511,10 @@
      *@param $request name of the superglobal $_POST $_GET $_REQUEST(def=
ault)
      *@return html string with the string data
      */
-    static function array_to_string($array,$global_array )
+    static function array_to_string($array,$global_array,$start=3D"?" )
     {
=20
-      $r=3D"?";
+      $r=3D$start;
=20
       if ( count($global_array )=3D=3D0) return '';
       $and=3D"";
@@ -557,9 +557,9 @@
      *@see HtmlInput::request_to_string
      *@return html string with the string data
      */
-    static function request_to_string($array)
+    static function request_to_string($array,$start=3D"?")
     {
-      $r=3Dself::array_to_string($array,$_REQUEST  );
+      $r=3Dself::array_to_string($array,$_REQUEST,$start  );
       return $r;
     }
=20

Modified: phpcompta/trunk/include/template/action-reference.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action-reference.php	2012-05-31 02:5=
1:49 UTC (rev 4852)
+++ phpcompta/trunk/include/template/action-reference.php	2012-06-02 09:4=
2:31 UTC (rev 4853)
@@ -1,35 +0,0 @@
-<?php
-
-/*
- *   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 b=
y
- *   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-130=
7  USA
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/**
- * @file
- * @brief add a follow up
- *
- */
-$new_action=3Dnew INum('new_ref',0);
-?>
-<p>
-	Ajout d'une action qui d=C3=A9pend de l'action actuelle : <?=3D$new_act=
ion->input()?>
-	<span class=3D"notice"> Ne donner que le num=C3=A9ro de document
-	</span>
-</p>
\ No newline at end of file

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-05-31 02:51:4=
9 UTC (rev 4852)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-02 09:42:3=
1 UTC (rev 4853)
@@ -21,16 +21,6 @@
               ?>
             </TD>
           </TR>
-		    <tr>
-            <td>
-   <?=3D_('Concerne action')?>
-            </td>
-            <td>
-              <?php echo $lag_ref_ag_id;
-              ?>
-            </td>
-          </tr>
-          <TR>
             <TD>
    <?=3D_('Date')?>
             </TD>
@@ -166,13 +156,16 @@
 		<ol>
=20
 		<?
+		$base=3DHtmlInput::request_to_string(array("gDossier","ac","sa","sb","=
sc","f_id"));
 		for ($o=3D0;$o<count($action);$o++)
 		{
 			$rmAction=3Dsprintf("javascript:if ( confirm('"._('Voulez-vous efface=
r cette action ')."')=3D=3Dtrue ) {remove_action('%s','%s','%s');}",
 					dossier::id(),
 					$action[$o]['ag_id'],$_REQUEST['ag_id']);
+			$showAction=3D'<a class=3D"line" href=3D"'.$base."&ag_id=3D".$action[=
$o]['ag_id'].'">';
 			$js=3D '<a class=3D"mtitle" style=3D"color:orange" id=3D"acact'.$acti=
on[$o]['ag_id'].'" href=3D"'.$rmAction.'">Effacer</a>';
-			echo '<li id=3D"act'.$action[$o]['ag_id'].'">'.$action[$o]['str_date'=
]." ".h($action[$o]['sub_title'])." "
+			echo '<li id=3D"act'.$action[$o]['ag_id'].'">'.$showAction.$action[$o=
]['str_date']." ".$action[$o]['ag_ref']." ".
+					h($action[$o]['sub_title']).'</a>'." "
 				.$js.'</li>';
 		}
=20
@@ -329,14 +322,16 @@
 catch(exception) { alert('<?=3Dj(_('Je ne peux pas ajouter de fichier'))=
?>'); alert(exception.message);}
 }
 </script>
-  <p>
-     <strong>Fichiers =C3=A0 ajouter: </strong>
-    <ol id=3D'add_file'>
+  <p >
+     <h3>Fichiers =C3=A0 ajouter: </h3>
+    <ol id=3D'add_file' >
       <li>
         <?php echo $upload->input();
         ?>
       </li>
     </ol>
-  </p>
+  <span >
   <input type=3D"button" class=3D"button" onclick=3D"addFiles();" value=3D=
"Ajouter un fichier">
+  </span>
+  </p>
 </fieldset>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-05-31 02:51:49 UTC (rev 4852)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-02 09:42:31 UTC (rev 4853)
@@ -106,14 +106,20 @@
 COMMENT ON COLUMN action_comment_operation.ag_id IS 'fk to action_gestio=
n';
 COMMENT ON COLUMN action_comment_operation.jr_id IS 'fk to jrn';
=20
+CREATE TABLE link_action_type
+(
+  l_id bigserial NOT NULL, -- PK
+  l_desc character varying,
+  CONSTRAINT link_action_type_pkey PRIMARY KEY (l_id )
+);
=20
=20
-
 CREATE TABLE action_gestion_related
 (
   aga_id bigserial NOT NULL, -- pk
-  aga_least bigint NOT NULL, -- fk to action_gestion
-  aga_greatest bigint NOT NULL,
+  aga_least bigint NOT NULL, -- fk to action_gestion, smallest ag_id
+  aga_greatest bigint NOT NULL, -- fk to action_gestion greatest ag_id
+  aga_type bigint, -- Type de liens
   CONSTRAINT action_gestion_related_pkey PRIMARY KEY (aga_id ),
   CONSTRAINT action_gestion_related_aga_greatest_fkey FOREIGN KEY (aga_g=
reatest)
       REFERENCES action_gestion (ag_id) MATCH SIMPLE
@@ -121,12 +127,22 @@
   CONSTRAINT action_gestion_related_aga_least_fkey FOREIGN KEY (aga_leas=
t)
       REFERENCES action_gestion (ag_id) MATCH SIMPLE
       ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT action_gestion_related_aga_type_fkey FOREIGN KEY (aga_type)
+      REFERENCES link_action_type (l_id) MATCH SIMPLE
+      ON UPDATE NO ACTION ON DELETE NO ACTION,
   CONSTRAINT ux_aga_least_aga_greatest UNIQUE (aga_least , aga_greatest =
)
 );
+
 COMMENT ON COLUMN action_gestion_related.aga_id IS 'pk';
 COMMENT ON COLUMN action_gestion_related.aga_least IS 'fk to action_gest=
ion, smallest ag_id';
 COMMENT ON COLUMN action_gestion_related.aga_greatest IS 'fk to action_g=
estion greatest ag_id';
+COMMENT ON COLUMN action_gestion_related.aga_type IS 'Type de liens';
=20
+CREATE INDEX link_action_type_fki
+  ON action_gestion_related
+  USING btree
+  (aga_type );
+
 -- Trigger: trg_action_gestion_related on action_gestion_related
 CREATE OR REPLACE FUNCTION comptaproc.action_gestion_related_ins_up()
   RETURNS trigger AS
@@ -159,4 +175,8 @@
   EXECUTE PROCEDURE comptaproc.action_gestion_related_ins_up();
=20
=20
+insert into action_gestion_related(aga_least,aga_greatest) select ag_id,=
ag_ref_ag_id from action_gestion where ag_ref_ag_id<>0;
=20
+update menu_ref set me_menu=3D'Action Gestion' where me_code=3D'FOLLOW';
+
+DROP FUNCTION comptaproc.action_get_tree(bigint);
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 02 06:35:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Salfy-0002zE-Lu
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 06:35:18 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 12:27:27 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150164.1338633317.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4854 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 10:35:17 -0000

Author: danydb
Date: 2012-06-02 12:27:26 +0200 (Sat, 02 Jun 2012)
New Revision: 4854

Removed:
   phpcompta/trunk/include/template/action-reference.php
Log:
#594 regroupement actions
fichier Obsolete

Deleted: phpcompta/trunk/include/template/action-reference.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 02 07:03:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sam7S-0004l2-M4
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 07:03:42 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 12:55:50 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150192.1338635021.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4855 - in phpcompta/trunk: html/js include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 11:03:41 -0000

Author: danydb
Date: 2012-06-02 12:55:50 +0200 (Sat, 02 Jun 2012)
New Revision: 4855

Modified:
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/ajax_search_action.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/template/detail-action.php
Log:
Remove debug, fix bug with link of related action

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-02 10:27:26 UTC (rev 4854)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-02 10:55:50 UTC (rev 4855)
@@ -1426,7 +1426,6 @@
      try
     {
         var queryString=3D$(obj).serialize()+"&op=3Dsearch_action";
-		alert (queryString);
         var action =3D new Ajax.Request(
             "ajax_misc.php" ,
             {method:'get',

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-02 10:27:26 UTC=
 (rev 4854)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-02 10:55:50 UTC=
 (rev 4855)
@@ -85,7 +85,7 @@
         $act2=3Dnew Follow_Up($cn);
         $act2->fromArray($_POST );
 		 $sub_action=3D"detail";
-
+		 put_global(array(array('key'=3D>"sa","value"=3D>"detail")));
          $act2->Update();
       }
     //------------------------------------------------------------------=
----

Modified: phpcompta/trunk/include/ajax_search_action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_search_action.php	2012-06-02 10:27:26 UT=
C (rev 4854)
+++ phpcompta/trunk/include/ajax_search_action.php	2012-06-02 10:55:50 UT=
C (rev 4855)
@@ -29,7 +29,5 @@
 echo Follow_Up::display_search($cn,true);
=20
 $sql=3D  "true ".Follow_Up::create_query($cn);
-var_dump($_GET);
-echo $sql;
 echo Follow_Up::short_list($cn, $sql);
 ?>

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-02 10:27:26=
 UTC (rev 4854)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-02 10:55:50=
 UTC (rev 4855)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("qcode","ag_dest","query","tdoc","d=
ate_start","date_end","see_all","all_action","sb","sc"),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("gDossier","qcode","ag_dest","query=
","tdoc","date_start","date_end","see_all","all_action","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-02 10:27:26 UTC (=
rev 4854)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-02 10:55:50 UTC (=
rev 4855)
@@ -171,8 +171,9 @@
 		// List related action
 		$action =3D $this->db->get_array("
 			select ag_id,ag_ref,substr(ag_title,1,40) as sub_title,to_char(ag_tim=
estamp,'DD.MM.YY') as str_date ,
-				ag_timestamp
+				ag_timestamp,dt_value
 					from action_gestion
+					 join document_type on (ag_type=3Ddt_id)
 				where
 				ag_id in (select aga_greatest from action_gestion_related where aga_=
least =3D$1)
 				or
@@ -1212,7 +1213,7 @@
 		$sql =3D "
              select ag_id,to_char(ag_timestamp,'DD.MM.YY') as my_date,
 			 f_id_dest,
-             substr(ag_title,1,30) as sub_ag_title,dt_value,ag_ref, ag_p=
riority,ag_state,
+             substr(ag_title,1,40) as sub_ag_title,dt_value,ag_ref, ag_p=
riority,ag_state,
 			coalesce((select p_name from profile where p_id=3Dag_dest),'Aucun gro=
upe') as dest,
 				(select ad_value from fiche_Detail where f_id=3Daction_gestion.f_id_=
dest and ad_id=3D1) as name
              from action_gestion

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-06-02 10:27:26 UTC =
(rev 4854)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-02 10:55:50 UTC =
(rev 4855)
@@ -425,7 +425,7 @@
     {
 	$r=3D'';
 	$r.=3D'<div style=3D"float:right;right;margin:2;">';
-	$r.=3D '<A id=3D"close_div" HREF=3D"javascript:void(0)" onclick=3D"'.$j=
avascript.'"">'.$action.'</A>';
+	$r.=3D '<A id=3D"close_div" HREF=3D"javascript:void(0)" onclick=3D"'.$j=
avascript.'">'.$action.'</A>';
 	$r.=3D'</div>';
 	return $r;
     }

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-02 10:27:2=
6 UTC (rev 4854)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-02 10:55:5=
0 UTC (rev 4855)
@@ -165,7 +165,7 @@
 			$showAction=3D'<a class=3D"line" href=3D"'.$base."&ag_id=3D".$action[=
$o]['ag_id'].'">';
 			$js=3D '<a class=3D"mtitle" style=3D"color:orange" id=3D"acact'.$acti=
on[$o]['ag_id'].'" href=3D"'.$rmAction.'">Effacer</a>';
 			echo '<li id=3D"act'.$action[$o]['ag_id'].'">'.$showAction.$action[$o=
]['str_date']." ".$action[$o]['ag_ref']." ".
-					h($action[$o]['sub_title']).'</a>'." "
+					h($action[$o]['sub_title']).'('.h($action[$o]['dt_value']).')</a>'.=
" "
 				.$js.'</li>';
 		}
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 02 07:04:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sam8I-0004nw-S7
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 07:04:34 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 12:56:43 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150195.1338635074.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4856 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 11:04:33 -0000

Author: danydb
Date: 2012-06-02 12:56:42 +0200 (Sat, 02 Jun 2012)
New Revision: 4856

Modified:
   phpcompta/trunk/include/template/action_search_result.php
Log:
0000597: Emplacement et libell?\195?\169 bouton valider dans ?\195?\169cr=
an de recherche d'action

Modified: phpcompta/trunk/include/template/action_search_result.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search_result.php	2012-06-02 =
10:55:50 UTC (rev 4855)
+++ phpcompta/trunk/include/template/action_search_result.php	2012-06-02 =
10:56:42 UTC (rev 4856)
@@ -29,6 +29,7 @@
 ?>
 <form onsubmit=3D"set_action_related('fresultaction');return false;" id=3D=
"fresultaction">
 	<?=3DHtmlInput::hidden('ctlc',$_GET['ctlc'])?>
+	<?=3DHtmlInput::submit("save_action", "Mettre =C3=A0 jour")?>
 <table class=3D"result">
=20
 	<tr>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 02 07:29:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SamWY-0006gR-Ac
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 07:29:38 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 13:21:47 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150234.1338636578.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4857 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 11:29:37 -0000

Author: danydb
Date: 2012-06-02 13:21:47 +0200 (Sat, 02 Jun 2012)
New Revision: 4857

Modified:
   phpcompta/trunk/include/class_itva_popup.php
Log:
Fix bug in itva

Modified: phpcompta/trunk/include/class_itva_popup.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_itva_popup.php	2012-06-02 10:56:42 UTC =
(rev 4856)
+++ phpcompta/trunk/include/class_itva_popup.php	2012-06-02 11:21:47 UTC =
(rev 4857)
@@ -37,7 +37,7 @@
     // You must add the attributes gDossier, popup
     $tva->set_attribute('popup','popup_tva');
     $tva->set_attribute('gDossier',dossier::id());
-=20
+
     // We can add a label for the code
     $tva->add_label('code');
     $tva->js=3D'onchange=3D"set_tva_label(this);"';
@@ -73,7 +73,7 @@
     {
         $this->name=3D($p_name=3D=3Dnull)?$this->name:$p_name;
         $this->value=3D($p_value=3D=3Dnull)?$this->value:$p_value;
-        $this->js=3D(isset($this->js))?$this->js:"format_number(this);";
+        $this->js=3D(isset($this->js))?$this->js:'onchange=3D"format_num=
ber(this);"';
         if ( $this->readOnly=3D=3Dtrue) return $this->display();
=20
         $str=3D'<input type=3D"TEXT" class=3D"input_text" name=3D"%s" va=
lue=3D"%s" id=3D"%s" size=3D"3" %s>';
@@ -114,7 +114,7 @@
      *@brief show a button, if it is pushed show a popup to select the n=
eed vat
      *@note
      * - a ipopup must be created before with the name popup_tva
-     * - the javascript scripts.js must be loaded=20
+     * - the javascript scripts.js must be loaded
      *@return string with html code
      */
     function dbutton()



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 02 07:29:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SamWo-0006hE-Eu
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 07:29:54 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 13:22:03 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150235.1338636594.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4858 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 11:29:53 -0000

Author: danydb
Date: 2012-06-02 13:22:03 +0200 (Sat, 02 Jun 2012)
New Revision: 4858

Modified:
   phpcompta/trunk/include/template/detail-action.php
Log:
Add date for related operation

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-02 11:21:4=
7 UTC (rev 4857)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-02 11:22:0=
3 UTC (rev 4858)
@@ -142,7 +142,7 @@
 					dossier::id(),
 					$operation[$o]['ago_id']);
 			$js=3D '<a class=3D"mtitle" style=3D"color:orange" id=3D"acop'.$opera=
tion[$o]['ago_id'].'" href=3D"'.$rmOperation.'">Effacer</a>';
-			echo '<li id=3D"op'.$operation[$o]['ago_id'].'">'.HtmlInput::detail_o=
p($operation[$o]['jr_id'],$operation[$o]['jr_internal'])." ".h($operation=
[$o]['jr_comment'])." "
+			echo '<li id=3D"op'.$operation[$o]['ago_id'].'">'.$operation[$o]['str=
_date']." ".HtmlInput::detail_op($operation[$o]['jr_id'],$operation[$o]['=
jr_internal'])." ".h($operation[$o]['jr_comment'])." "
 				.$js.'</li>';
 		}
=20
@@ -335,3 +335,4 @@
   </span>
   </p>
 </fieldset>
+<script>compute_all_ledger()</script>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 02 07:30:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SamXZ-0006sg-RA
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 07:30:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 13:22:51 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150237.1338636641.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4859 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 11:30:41 -0000

Author: danydb
Date: 2012-06-02 13:22:50 +0200 (Sat, 02 Jun 2012)
New Revision: 4859

Modified:
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_follow_up_detail.php
Log:
Do not record lines without Card

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-02 11:22:03 UTC (=
rev 4858)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-02 11:22:50 UTC (=
rev 4859)
@@ -164,8 +164,9 @@
 		);
=20
 		// List op=C3=A9ration li=C3=A9es
-		$operation =3D $this->db->get_array("select ago_id,j.jr_id,j.jr_intern=
al,j.jr_comment from jrn as j join action_gestion_operation as ago on (j.=
jr_id=3Dago.jr_id)
-			where ag_id=3D$1", array($this->ag_id));
+		$operation =3D $this->db->get_array("select ago_id,j.jr_id,j.jr_intern=
al,j.jr_comment,to_char(j.jr_date,'DD.MM.YY') as str_date
+			from jrn as j join action_gestion_operation as ago on (j.jr_id=3Dago.=
jr_id)
+			where ag_id=3D$1 order by jr_date", array($this->ag_id));
 		$iconcerned =3D new IConcerned('operation');
=20
 		// List related action
@@ -459,14 +460,14 @@
=20
 			$itva->name =3D 'e_march' . $i . '_tva_id';
 			$itva->value =3D ($tmp_ad) ? $tmp_ad->get_parameter('tva_id') : 0;
-			$itva->javascript =3D ' onchange=3D"format_number(this);clean_tva(' .=
 $i . ');compute_ledger(' . $i . ')"';
+			$itva->js =3D ' onchange=3D"format_number(this);clean_tva(' . $i . ')=
;compute_ledger(' . $i . ')"';
 			$itva->set_attribute('compute', $i);
=20
 			$aArticle[$i]['tvaid'] =3D $itva->input();
=20
 			$num->name =3D "e_march" . $i . "_tva_amount";
 			$num->value =3D ($tmp_ad) ? $tmp_ad->get_parameter('tva_amount') : 0;
-			$num->javascript =3D ' onchange=3D"compute_ledger(' . $i . ')"';
+			$num->javascript =3D " onchange=3D\"compute_ledger(' . $i . ')\"";
 			$num->size =3D 8;
 			$aArticle[$i]['tva'] =3D $num->input();
=20
@@ -632,6 +633,7 @@
 		{
 			$act =3D new Follow_Up_Detail($this->db);
 			$act->from_array($_POST, $i);
+			if ($act->f_id =3D=3D 0 )continue;
 			$act->ag_id =3D $this->ag_id;
 			$act->save();
 		}
@@ -934,6 +936,7 @@
 		{
 			$act =3D new Follow_Up_Detail($this->db);
 			$act->from_array($_POST, $i);
+			if ($act->f_id =3D=3D 0 ) continue;
 			$act->save();
 		}
 		if (trim($this->ag_comment) !=3D '')

Modified: phpcompta/trunk/include/class_follow_up_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up_detail.php	2012-06-02 11:22:0=
3 UTC (rev 4858)
+++ phpcompta/trunk/include/class_follow_up_detail.php	2012-06-02 11:22:5=
0 UTC (rev 4859)
@@ -148,7 +148,7 @@
     {
         $sql=3D"SELECT ad_id, f_id, ad_text, ad_pu, ad_quant, ad_tva_id,=
 ad_tva_amount,
              ad_total_amount, ag_id   FROM action_detail ".
-             " where ag_id=3D$1";
+             " where ag_id=3D$1 order by ad_id";
         $res=3D$this->db->get_array(
                  $sql,
                  array($this->ag_id)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 02 07:38:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SamfG-0007Jk-Kq
	for mharc-phpcompta-dev@gnu.org; Sat, 02 Jun 2012 07:38:38 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  2 Jun 2012 13:30:47 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.150240.1338637118.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4860 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 11:38:37 -0000

Author: danydb
Date: 2012-06-02 13:30:47 +0200 (Sat, 02 Jun 2012)
New Revision: 4860

Modified:
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_follow_up_detail.php
Log:
delete empty row in action_detail while update

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-02 11:22:50 UTC (=
rev 4859)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-02 11:30:47 UTC (=
rev 4860)
@@ -936,6 +936,7 @@
 		{
 			$act =3D new Follow_Up_Detail($this->db);
 			$act->from_array($_POST, $i);
+			if ( $act->f_id =3D=3D 0 && $act->ad_id !=3D 0 ) $act->delete();
 			if ($act->f_id =3D=3D 0 ) continue;
 			$act->save();
 		}

Modified: phpcompta/trunk/include/class_follow_up_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up_detail.php	2012-06-02 11:22:5=
0 UTC (rev 4859)
+++ phpcompta/trunk/include/class_follow_up_detail.php	2012-06-02 11:30:4=
7 UTC (rev 4860)
@@ -188,8 +188,9 @@
     }
     public function delete()
     {
-        exit(__FILE__.__LINE__.' : Non impl=C3=A9ment=C3=A9');
-    }
+		$sql=3D"delete from action_detail where ad_id=3D$1";
+		$this->db->exec_sql($sql,array($this->ad_id));
+	}
     /*!\brief Fill an Action_Detail Object with the data contained in an=
 array
     *\param $array
      - [ad_id7] =3D> ad_id



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 05 16:08:22 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sc03C-0006Ed-7w
	for mharc-phpcompta-dev@gnu.org; Tue, 05 Jun 2012 16:08:22 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue,  5 Jun 2012 22:00:11 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.161765.1338926901.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4861 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jun 2012 20:08:20 -0000

Author: danydb
Date: 2012-06-05 22:00:10 +0200 (Tue, 05 Jun 2012)
New Revision: 4861

Modified:
   phpcompta/trunk/include/class_database.php
Log:
Correct query_to_csv

Modified: phpcompta/trunk/include/class_database.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_database.php	2012-06-02 11:30:47 UTC (r=
ev 4860)
+++ phpcompta/trunk/include/class_database.php	2012-06-05 20:00:10 UTC (r=
ev 4861)
@@ -870,29 +870,27 @@
     function query_to_csv($ret,$aheader)
     {
         $seq=3D"";
-        for ($i=3D0;$i<count($i);$i++)
+        for ($i=3D0;$i<count($aheader);$i++)
         {
-            echo '"'.$aheader[$i]['title'].'"';
+            echo $seq.'"'.$aheader[$i]['title'].'"';
             $seq=3D";";
         }
         printf("\n\r");
-
-        $seq=3D"";
         // fetch all the rows
-        for ($i=3D0;$i<count(Database::num_row($ret));$i++)
+        for ($i=3D0;$i<Database::num_row($ret);$i++)
         {
             $row=3DDatabase::fetch_array($ret, $i);
             $sep2=3D"";
             // for each rows, for each value
-            for ($e=3D0;$e<count($row);$e++)
+            for ($e=3D0;$e<count($row)/2;$e++)
             {
-                switch ($aheader[$e]['type'])
+               switch ($aheader[$e]['type'])
                 {
                     case 'num':
-                        echo nb($row[$e]).$sep2;
+                        echo $sep2.nb($row[$e]);
                         break;
                     default:
-                        echo '"'.$row[$e].'"'.$sep2;
+                        echo $sep2.'"'.$row[$e].'"';
                 }
                 $sep2=3D";";
             }



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 05 16:23:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sc0Hy-00015m-Hf
	for mharc-phpcompta-dev@gnu.org; Tue, 05 Jun 2012 16:23:38 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue,  5 Jun 2012 22:15:26 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.161788.1338927817.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4862 - in phpcompta/trunk: html include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jun 2012 20:23:37 -0000

Author: danydb
Date: 2012-06-05 22:15:25 +0200 (Tue, 05 Jun 2012)
New Revision: 4862

Added:
   phpcompta/trunk/include/export_follow_up_csv.php
Modified:
   phpcompta/trunk/html/export.php
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/class_extension.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000602: Export des actions de gestion en CSV

Modified: phpcompta/trunk/html/export.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/export.php	2012-06-05 20:00:10 UTC (rev 4861)
+++ phpcompta/trunk/html/export.php	2012-06-05 20:15:25 UTC (rev 4862)
@@ -161,6 +161,9 @@
   case 'CSV:reportinit':
 	  require_once('export_reportinit_csv.php');
 	  break;
+  case 'CSV:ActionGestion':
+	  require_once 'export_follow_up_csv.php';
+	  break;
    default:
     alert('Action inconnue '.$_GET['act']);
     exit();

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-05 20:00:10 UTC=
 (rev 4861)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-05 20:15:25 UTC=
 (rev 4862)
@@ -172,6 +172,13 @@
 if ( $sub_action =3D=3D "list" )
   {
     Follow_Up::ShowActionList($cn,$base);
+	// Add a button to export to Csv
+	echo '<form method=3D"GET" ACTION=3D"export.php">';
+	echo HtmlInput::request_to_hidden(array("gDossier","qcode","start_date"=
,"end_date","ag_id","ag_dest_query",
+			"tdoc","see_all","all_action","query"));
+	echo HtmlInput::hidden("act", "CSV:ActionGestion");
+	echo HtmlInput::submit("follow_up_csv", "Export CSV");
+	echo "</form>";
   }
 //----------------------------------------------------------------------=
----------
 // Add an action

Modified: phpcompta/trunk/include/class_extension.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_extension.php	2012-06-05 20:00:10 UTC (=
rev 4861)
+++ phpcompta/trunk/include/class_extension.php	2012-06-05 20:15:25 UTC (=
rev 4862)
@@ -149,5 +149,18 @@
 			echo alert($exc->getMessage());
 		}
 	}
+	/**
+	 *remove all the schema from the plugins
+	 * @param Database $p_cn
+	 */
+	static function clean(Database $p_cn)
+	{
+		$a_ext=3Darray("tva_belge","amortissement","impdol","coprop","importba=
nk");
+		for($i=3D0;$i<count($a_ext);$i++){
+			if ($p_cn->exist_schema($a_ext[$i])) {
+				$p_cn->exec_sql("drop schema ".$a_ext[$i]." cascade");
+			}
+		}
+	}
 }
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-05 20:00:10 UTC (=
rev 4861)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-05 20:15:25 UTC (=
rev 4862)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -62,15 +63,15 @@
 class Follow_Up
 {
=20
-	var $db;	/* !<  $db  database connexion    */
+	var $db; /* !<  $db  database connexion    */
 	var $ag_timestamp;  /* !<   $ag_timestamp document date (ag_gestion.ag_=
timestamp) */
 	var $dt_id;   /* !<   $dt_id type of the document (document_type.dt_id)=
 */
-	var $ag_state;	/* !<   $ag_state stage of the document (printed, send t=
o client...) */
+	var $ag_state; /* !<   $ag_state stage of the document (printed, send t=
o client...) */
 	var $d_number;   /* !<   $d_number number of the document */
 	var $d_filename; /* !<   $d_filename filename's document      */
 	var $d_mimetype; /* !<   $d_mimetype document's filename      */
 	var $ag_title;   /* !<   $ag_title title document	      */
-	var $f_id;	/* !<   $f_id_dest fiche id (From field )  */
+	var $f_id; /* !<   $f_id_dest fiche id (From field )  */
 	var $ag_ref;  /* !< $ag_ref is the ref  */
 	var $ag_hour;  /* !< $ag_hour is the hour of the meeting, action */
 	var $ag_priority; /* !< $ag_priority is the priority 1 High, 2 medium, =
3 low */
@@ -179,9 +180,9 @@
 				ag_id in (select aga_greatest from action_gestion_related where aga_=
least =3D$1)
 				or
 				ag_id in (select aga_least from action_gestion_related where aga_gre=
atest =3D$1)
-				order by ag_timestamp",array($this->ag_id));
-		$iaction=3Dnew IRelated_Action('action');
-		$iaction->value=3D(isset($this->action))?$this->action:"";
+				order by ag_timestamp", array($this->ag_id));
+		$iaction =3D new IRelated_Action('action');
+		$iaction->value =3D (isset($this->action)) ? $this->action : "";
=20
 		// state
 		// Retrieve the value
@@ -633,7 +634,8 @@
 		{
 			$act =3D new Follow_Up_Detail($this->db);
 			$act->from_array($_POST, $i);
-			if ($act->f_id =3D=3D 0 )continue;
+			if ($act->f_id =3D=3D 0)
+				continue;
 			$act->ag_id =3D $this->ag_id;
 			$act->save();
 		}
@@ -661,7 +663,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("qcode", "ag_dest_query", "que=
ry", "tdoc", "date_start", "date_end", "see_all", "all_action")) .  '&' .=
 $p_base;
+		$url =3D HtmlInput::get_to_string(array("qcode", "ag_dest_query", "que=
ry", "tdoc", "date_start", "date_end", "see_all", "all_action")) . '&' . =
$p_base;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -919,7 +921,7 @@
 				$this->f_id_dest, /* 4 */
 				$this->ag_state, /* 5 */
 				$this->ag_id, /* 6 */
-				$this->ag_hour, /* 7*/
+				$this->ag_hour, /* 7 */
 				$this->ag_priority, /* 8 */
 				$this->ag_dest, /* 9 */
 				$ag_cal, /* 10 */
@@ -936,8 +938,10 @@
 		{
 			$act =3D new Follow_Up_Detail($this->db);
 			$act->from_array($_POST, $i);
-			if ( $act->f_id =3D=3D 0 && $act->ad_id !=3D 0 ) $act->delete();
-			if ($act->f_id =3D=3D 0 ) continue;
+			if ($act->f_id =3D=3D 0 && $act->ad_id !=3D 0)
+				$act->delete();
+			if ($act->f_id =3D=3D 0)
+				continue;
 			$act->save();
 		}
 		if (trim($this->ag_comment) !=3D '')
@@ -993,7 +997,6 @@
 		$this->operation =3D (isset($p_array['operation'])) ? $p_array['operat=
ion'] : null;
 		$this->op =3D (isset($p_array['op'])) ? $p_array['op'] : null;
 		$this->action =3D (isset($p_array['action'])) ? $p_array['action'] : n=
ull;
-
 	}
=20
 	/* !\brief remove the action
@@ -1034,7 +1037,9 @@
 		return $array;
 	}
=20
-
+	/**
+	 * insert a related operation
+	 */
 	function insert_operation()
 	{
 		if (trim($this->operation) =3D=3D '')
@@ -1050,6 +1055,9 @@
 		}
 	}
=20
+	/**
+	 * remove a related operation
+	 */
 	function remove_operation()
 	{
 		if ($this->op =3D=3D null)
@@ -1060,11 +1068,12 @@
 			$this->db->exec_sql("delete from action_gestion_operation where ago_i=
d=3D$1", array($op[$i]));
 		}
 	}
+
 	/**
-	 *Display only a search box for searching an action
+	 * Display only a search box for searching an action
 	 * @param $cn database connx
 	 */
-	static function display_search($cn,$inner=3Dfalse)
+	static function display_search($cn, $inner =3D false)
 	{
 		$a =3D (isset($_GET['query'])) ? $_GET['query'] : "";
 		$qcode =3D (isset($_GET['qcode'])) ? $_GET['qcode'] : "";
@@ -1085,11 +1094,12 @@
 		/**
 		 * Show the default button (add action, show search...)
 		 */
-		if (!$inner) require_once 'template/action_button.php';
+		if (!$inner)
+			require_once 'template/action_button.php';
=20
 		$w =3D new ICard();
 		$w->name =3D 'qcode';
-		$w->id=3D$w->generate_id($w->name);
+		$w->id =3D $w->generate_id($w->name);
 		$w->value =3D $qcode;
 		$w->extra =3D "all";
 		$w->typecard =3D 'all';
@@ -1128,7 +1138,6 @@
 		$str_ag_dest =3D $ag_dest->input();
 		// show the  action in
 		require_once 'template/action_search.php';
-
 	}
=20
 	static function ShowActionList($cn, $p_base)
@@ -1144,18 +1153,22 @@
=20
=20
=20
-		$r =3D $act->myList($p_base, "", $query );
+		$r =3D $act->myList($p_base, "", $query);
 		echo $r;
 	}
=20
 	/**
-	 *Get date from $_GET and create the sql stmt for the query
+	 * Get date from $_GET and create the sql stmt for the query
 	 * @see Follow_Up::ShowActionList
 	 * @return string SQL condition
 	 */
-	static function create_query($cn)
+	static function create_query($cn, $p_array =3D null)
 	{
-		$query=3D"";
+		if ($p_array =3D=3D null)
+			$p_array =3D $_GET;
+
+		extract($p_array);
+		$query =3D "";
 		if (isset($_REQUEST['query']))
 		{
 			// if a query is request build the sql stmt
@@ -1166,7 +1179,7 @@
 		}
=20
 		$str =3D "";
-		if (isset($_GET['qcode']))
+		if (isset($qcode))
 		{
=20
 			// verify that qcode is not empty
@@ -1182,38 +1195,43 @@
 					$str =3D " and (f_id_dest=3D " . $fiche->id . " ) ";
 			}
 		}
-		if (isset($_GET['tdoc']) && $_GET['tdoc'] !=3D -1)
+		if (isset($tdoc) && $tdoc !=3D -1)
 		{
-			$query .=3D ' and dt_id =3D ' . Formatstring($_GET['tdoc']);
+			$query .=3D ' and dt_id =3D ' . sql_string($tdoc);
 		}
 		if (!isset($_GET['see_all']))
 			$query .=3D ' and ag_state in (2,3) ';
-		if (! isset($_GET['all_action']))
+		if (!isset($all_action))
 		{
 			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ag_dest=
 in (select p_id from profile_user where user_name=3D'" . $_SESSION['g_us=
er'] . "') or ag_dest is null )";
 		}
-		if (isset($_GET['date_start']) && isDate($_GET['date_start']) !=3D nul=
l)
+		if (isset($date_start) && isDate($date_start) !=3D null)
 		{
-			$date_start =3D $_GET['date_start'];
 			$query.=3D" and ag_timestamp >=3D to_date('$date_start','DD.MM.YYYY')=
";
 		}
-		if (isset($_GET['date_end']) && isDate($_GET['date_end']) !=3D null)
+		if (isset($date_end) && isDate($date_end) !=3D null)
 		{
-			$date_end =3D $_GET['date_end'];
 			$query.=3D" and ag_timestamp <=3D to_date('$date_end','DD.MM.YYYY')";
 		}
-		if (isset($_GET['ag_dest_query']))
+		if (isset($ag_dest_query))
 		{
-			if ($_GET['ag_dest_query'] !=3D 0)
-				$query.=3D " and ag_dest =3D " . sql_string($_GET['ag_dest_query']);
+			if ($ag_dest_query !=3D 0)
+				$query.=3D " and ag_dest =3D " . sql_string($ag_dest_query);
 		}
-		if ( isNumber($_GET['ag_id'])=3D=3D1 && $_GET['ag_id'] !=3D 0) {
-			$query=3D" and ag_id=3D ".$_GET['ag_id'];
+		if (isNumber($ag_id) =3D=3D 1 && $ag_id !=3D 0)
+		{
+			$query =3D " and ag_id=3D " . $ag_id;
 		}
-		return $query. $str;
+		return $query . $str;
 	}
=20
-	static function short_list($cn,$p_sql) {
+	/**
+	 * Show the result of a search in an inner windows, the result is limit=
ed to 25
+	 * @param type $cn database connx
+	 * @param type $p_sql the query
+	 */
+	static function short_list($cn, $p_sql)
+	{
 		$sql =3D "
              select ag_id,to_char(ag_timestamp,'DD.MM.YY') as my_date,
 			 f_id_dest,
@@ -1225,13 +1243,15 @@
              where $p_sql";
 		$max_line =3D $cn->count_sql($sql);
=20
-		$limit=3D($max_line > 25)?25:$max_line;
-		$Res =3D $cn->exec_sql($sql . "limit ".$limit);
+		$limit =3D ($max_line > 25) ? 25 : $max_line;
+		$Res =3D $cn->exec_sql($sql . "limit " . $limit);
 		$a_row =3D Database::fetch_all($Res);
 		require_once 'template/action_search_result.php';
-
 	}
=20
+	/**
+	 * Insert a related action into the table action_gestion_related
+	 */
 	function insert_action()
 	{
 		if (trim($this->action) =3D=3D '')
@@ -1240,11 +1260,53 @@
 		for ($i =3D 0; $i < count($array); $i++)
 		{
 			if ($this->db->get_value("select count(*) from action_gestion_related
-				where (aga_least=3D$1 and aga_greatest=3D$2) or (aga_greatest=3D$1 a=
nd aga_least=3D$2)", array($array[$i],$this->ag_id)) =3D=3D 0 && $this->a=
g_id !=3D $array[$i])
+				where (aga_least=3D$1 and aga_greatest=3D$2) or (aga_greatest=3D$1 a=
nd aga_least=3D$2)", array($array[$i], $this->ag_id)) =3D=3D 0 && $this->=
ag_id !=3D $array[$i])
 			{
 				$this->db->exec_sql("insert into action_gestion_related(aga_least,ag=
a_greatest) values ($1,$2)", array($this->ag_id, $array[$i]));
 			}
 		}
 	}
=20
+	/**
+	 * export to CSV the query the p_array has
+	 * @param array $p_array
+	 */
+	function export_csv($p_array)
+	{
+		extract($p_array);
+
+
+		$p_search=3Dself::create_query($this->db, $p_array);
+		$sql =3D "
+             select ag_id,
+			to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
+			 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
+				(select ad_value from fiche_Detail where f_id=3Daction_gestion.f_id_=
dest and ad_id=3D1) as name,
+             ag_title,
+			dt_value,
+			ag_ref,
+			ag_priority,
+			ag_state,
+			coalesce((select p_name from profile where p_id=3Dag_dest),'Aucun gro=
upe') as dest
+             from action_gestion
+             join document_type on (ag_type=3Ddt_id)
+             where  true  $p_search order by ag_timestamp,ag_id";
+		$ret=3D$this->db->exec_sql($sql);
+
+		if ( Database::num_row($ret)=3D=3D0)exit();
+		$this->db->query_to_csv($ret,array(
+				array("title"=3D>"doc id","type"=3D>"string"),
+				array("title"=3D>"date","type"=3D>"date"),
+				array("title"=3D>"rappel","type"=3D>"date"),
+				array("title"=3D>"nom","type"=3D>"string"),
+				array("title"=3D>"titre","type"=3D>"string"),
+				array("title"=3D>"type document","type"=3D>"string"),
+				array("title"=3D>"ref","type"=3D>"string"),
+				array("title"=3D>"priorite","type"=3D>"string"),
+				array("title"=3D>"etat","type"=3D>"string"),
+				array("title"=3D>"profil","type"=3D>"string")
+				)
+			);
+	}
+
 }

Added: phpcompta/trunk/include/export_follow_up_csv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_follow_up_csv.php	                    =
    (rev 0)
+++ phpcompta/trunk/include/export_follow_up_csv.php	2012-06-05 20:15:25 =
UTC (rev 4862)
@@ -0,0 +1,40 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief export Action Gestion to csv, taking in account the search
+ *
+ */
+require_once 'class_follow_up.php';
+header('Pragma: public');
+header('Content-type: application/csv');
+header('Content-Disposition: attachment;filename=3D"action-gestion.csv"'=
,FALSE);
+
+$follow=3Dnew Follow_Up($cn);
+
+echo $follow->export_csv($_GET);
+
+exit();
+
+?>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-05 20:00:10 UTC (rev 4861)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-05 20:15:25 UTC (rev 4862)
@@ -179,4 +179,7 @@
=20
 update menu_ref set me_menu=3D'Action Gestion' where me_code=3D'FOLLOW';
=20
-DROP FUNCTION comptaproc.action_get_tree(bigint);
\ No newline at end of file
+DROP FUNCTION comptaproc.action_get_tree(bigint);
+
+insert into menu_ref(me_code,me_menu,me_type) values ('CSV:ActionGestion=
','Export Action Gestion','PR');
+insert into profile_menu(me_code,p_id,p_type_display,pm_default) values =
('CSV:ActionGestion',1,'P',0);
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 05 16:25:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sc0JO-0001A9-PU
	for mharc-phpcompta-dev@gnu.org; Tue, 05 Jun 2012 16:25:06 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue,  5 Jun 2012 22:16:57 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.161791.1338927906.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4863 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jun 2012 20:25:06 -0000

Author: danydb
Date: 2012-06-05 22:16:57 +0200 (Tue, 05 Jun 2012)
New Revision: 4863

Modified:
   phpcompta/trunk/include/modele.inc.php
Log:
0000582: Modele : destruction des donn?\195?\169es plugins

Modified: phpcompta/trunk/include/modele.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/modele.inc.php	2012-06-05 20:15:25 UTC (rev 4=
862)
+++ phpcompta/trunk/include/modele.inc.php	2012-06-05 20:16:57 UTC (rev 4=
863)
@@ -28,6 +28,8 @@
  */
 require_once("class_itext.php");
 require_once("class_icheckbox.php");
+require_once ('class_extension.php');
+
 $sa =3D (isset($_REQUEST['sa'])) ? $_REQUEST['sa'] : 'list';
 if (isset($_POST['upd']) &&
 		isset($_POST['m']))
@@ -106,7 +108,7 @@
 		for ($i =3D 0; $i < count($a_lob); $i++)
 			$cn_mod->lo_unlink($a_lob[$i]['jr_pj']);
 	}
-
+	Extension::clean($cn_mod);
 	$Res =3D $cn_mod->exec_sql("truncate table centralized");
 	$Res =3D $cn_mod->exec_sql("truncate table jrn cascade");
 	$Res =3D $cn_mod->exec_sql("delete from del_jrn");
@@ -197,6 +199,7 @@
 		$Res =3D $cn_mod->exec_sql('delete from poste_analytique');
 		$Res =3D $cn_mod->exec_sql('delete from plan_analytique');
 	}
+
 }
 // Show all available templates
 require_once('class_sort_table.php');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 06 07:19:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ScEHG-0002nn-Cb
	for mharc-phpcompta-dev@gnu.org; Wed, 06 Jun 2012 07:19:50 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed,  6 Jun 2012 13:11:36 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.167597.1338981589.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4864 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Jun 2012 11:19:48 -0000

Author: danydb
Date: 2012-06-06 13:11:35 +0200 (Wed, 06 Jun 2012)
New Revision: 4864

Modified:
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/export_follow_up_csv.php
Log:
we use $_REQUEST['query'] instead of $_GET['query']. Need to check if it =
is valid

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-05 20:16:57 UTC (=
rev 4863)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-06 11:11:35 UTC (=
rev 4864)
@@ -1159,6 +1159,7 @@
=20
 	/**
 	 * Get date from $_GET and create the sql stmt for the query
+	 * @note the query is taken in $_REQUEST
 	 * @see Follow_Up::ShowActionList
 	 * @return string SQL condition
 	 */
@@ -1169,6 +1170,10 @@
=20
 		extract($p_array);
 		$query =3D "";
+		/**
+		 *@todo check why we need to use $_REQUEST['query']
+		 * instead of $_GET['query']
+		 */
 		if (isset($_REQUEST['query']))
 		{
 			// if a query is request build the sql stmt
@@ -1181,9 +1186,8 @@
 		$str =3D "";
 		if (isset($qcode))
 		{
-
 			// verify that qcode is not empty
-			if (strlen(trim($_REQUEST['qcode'])) !=3D 0)
+			if (strlen(trim($qcode)) !=3D 0)
 			{
=20
 				$fiche =3D new Fiche($cn);

Modified: phpcompta/trunk/include/export_follow_up_csv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_follow_up_csv.php	2012-06-05 20:16:57 =
UTC (rev 4863)
+++ phpcompta/trunk/include/export_follow_up_csv.php	2012-06-06 11:11:35 =
UTC (rev 4864)
@@ -32,6 +32,8 @@
 header('Content-Disposition: attachment;filename=3D"action-gestion.csv"'=
,FALSE);
=20
 $follow=3Dnew Follow_Up($cn);
+$array=3D$_GET;
+if ( isset ($_POST['query']) ) $p_array['query']=3D$_POST['query'];
=20
 echo $follow->export_csv($_GET);
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 06 08:56:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ScFmj-0000yN-44
	for mharc-phpcompta-dev@gnu.org; Wed, 06 Jun 2012 08:56:25 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed,  6 Jun 2012 14:48:07 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.168197.1338987384.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4865 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Jun 2012 12:56:23 -0000

Author: danydb
Date: 2012-06-06 14:48:07 +0200 (Wed, 06 Jun 2012)
New Revision: 4865

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_acc_payment.php
Log:
0000600: Dans moyen de paiement, ajouter acompte

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-06 11:1=
1:35 UTC (rev 4864)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-06 12:4=
8:07 UTC (rev 4865)
@@ -254,6 +254,9 @@
 	      }
 	    $nb++;
         }
+        /**
+         * *@todo check that  acompte is less than total amount
+         */
         if ( $nb =3D=3D 0 )
             throw new Exception(_('Il n\'y a aucune marchandise'),12);
=20
@@ -766,14 +769,16 @@
                 {
                     $poste_val=3D$sposte;
                 }
+               =20
+                $famount=3Dbcsub($cust_amount,$acompte);
                 $acc_pay->poste=3D$poste_val;
                 $acc_pay->qcode=3D$fqcode;
-                $acc_pay->amount=3Dabs(round($cust_amount,2));
+                $acc_pay->amount=3Dabs(round($famount,2));
                 $acc_pay->desc=3D'';
                 $acc_pay->grpt=3D$acseq;
                 $acc_pay->jrn=3D$mp->get_parameter('ledger_target');
                 $acc_pay->periode=3D$tperiode;
-		$acc_pay->type=3D($cust_amount>=3D0)?'c':'d';
+		$acc_pay->type=3D($famount>=3D0)?'c':'d';
                 $acc_pay->insert_jrnx();
=20
                 /* Insert supplier  */
@@ -781,12 +786,12 @@
                 $acc_pay->date=3D$e_date;
                 $acc_pay->poste=3D$poste;
                 $acc_pay->qcode=3D$e_client;
-                $acc_pay->amount=3Dabs(round($cust_amount,2));
+                $acc_pay->amount=3Dabs(round($famount,2));
                 $acc_pay->desc=3D'';
                 $acc_pay->grpt=3D$acseq;
                 $acc_pay->jrn=3D$mp->get_parameter('ledger_target');
                 $acc_pay->periode=3D$tperiode;
-				$acc_pay->type=3D($cust_amount>=3D0)?'d':'c';
+				$acc_pay->type=3D($famount>=3D0)?'d':'c';
                 $let_other=3D$acc_pay->insert_jrnx();
=20
                 /* insert into jrn */
@@ -823,7 +828,7 @@
 		/* if ledger is FIN then insert into quant_fin */
 		if ( $prop['jrn_def_type'] =3D=3D 'FIN' )
 		  {
-		    $ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($=
cust_amount,-1));
+		    $ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($=
famount,-1));
 		  }
=20
=20
@@ -1507,13 +1512,13 @@
 		if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0 )
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
-
+            $r.=3DHtmlInput::hidden('acompte');
             /* needed for generating a invoice */
             $r.=3DHtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_=
mp});
 			$fname =3D new Fiche($this->db);
 			$fname->get_by_qcode(${'e_mp_qcode_' . $e_mp});
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">' . "Pay=C3=A9 pa=
r " . ${'e_mp_qcode_' . $e_mp} .
-					" ".$fname->getName() . '</h2></div>';
+					" ".$fname->getName() ." ". _('D=C3=A9duction de ').h($acompte).'</=
h2></div>';
             $r.=3D'<br>';
         }
         // check for upload piece

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-06 11:11:35=
 UTC (rev 4864)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-06 12:48:07=
 UTC (rev 4865)
@@ -217,6 +217,9 @@
         //------------------------------------------------------
         // The "Paid By"  check
         //------------------------------------------------------
+        /**
+         *@todo check that  acompte is less than total amount=20
+         */
         if ($e_mp !=3D 0 ) $this->check_payment($e_mp,${"e_mp_qcode_".$e=
_mp});
=20
     }
@@ -536,16 +539,16 @@
                 {
                     $poste_val=3D$sposte;
                 }
-
+                $famount=3Dbcsub($cust_amount,$acompte);
                 $acc_pay->poste=3D$poste_val;
                 $acc_pay->qcode=3D$fqcode;
-                $acc_pay->amount=3Dabs(round($cust_amount,2));
+                $acc_pay->amount=3Dabs(round($famount,2));
                 $acc_pay->desc=3Dnull;
=20
                 $acc_pay->grpt=3D$acseq;
                 $acc_pay->jrn=3D$mp->get_parameter('ledger_target');
                 $acc_pay->periode=3D$tperiode;
-                $acc_pay->type=3D($cust_amount>=3D0)?'d':'c';
+                $acc_pay->type=3D($famount>=3D0)?'d':'c';
                 $acc_pay->insert_jrnx();
=20
                 /* Insert supplier  */
@@ -553,12 +556,12 @@
                 $acc_pay->date=3D$e_date;
                 $acc_pay->poste=3D$poste;
                 $acc_pay->qcode=3D$e_client;
-                $acc_pay->amount=3Dabs(round($cust_amount,2));
+                $acc_pay->amount=3Dabs(round($famount,2));
                 $acc_pay->desc=3Dnull;
                 $acc_pay->grpt=3D$acseq;
                 $acc_pay->jrn=3D$mp->get_parameter('ledger_target');
                 $acc_pay->periode=3D$tperiode;
-				$acc_pay->type=3D($cust_amount>=3D0)?'c':'d';
+				$acc_pay->type=3D($famount>=3D0)?'c':'d';
                 $let_other=3D$acc_pay->insert_jrnx();
=20
                 /* insert into jrn */
@@ -597,7 +600,7 @@
 		/* if ledger is FIN then insert into quant_fin */
 		if ( $prop['jrn_def_type'] =3D=3D 'FIN' )
 		  {
-		    $ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($=
cust_amount,1));
+		    $ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($=
famount,1));
 		  }
=20
             }
@@ -887,14 +890,14 @@
         if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0=
 )
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
-
+            $r.=3DHtmlInput::hidden('acompte');
             /* needed for generating a invoice */
             $r.=3DHtmlInput::hidden('qcode_benef',${'e_mp_qcode_'.$e_mp}=
);
=20
 			$fname=3Dnew Fiche($this->db);
 			$fname->get_by_qcode(${'e_mp_qcode_'.$e_mp});
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">'."Pay=C3=A9 par =
".${'e_mp_qcode_'.$e_mp}.
-				   " ".$fname->getName().'</h2></div>';
+				   " ".$fname->getName().' '._('D=C3=A9duction de ').h($acompte).'</=
h2></div>';
             $r.=3D'<br>';
         }
=20

Modified: phpcompta/trunk/include/class_acc_payment.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_payment.php	2012-06-06 11:11:35 UTC=
 (rev 4864)
+++ phpcompta/trunk/include/class_acc_payment.php	2012-06-06 12:48:07 UTC=
 (rev 4865)
@@ -225,6 +225,10 @@
         }
         return $ret;
     }
+    /**
+     *@deprecated
+     * @return string=20
+     */
     public function row_deprecated()
     {
         //--------------------------------------------------------------=
-------------
@@ -325,6 +329,14 @@
         $r=3D'';
         $array=3D$this->get_valide();
         $r.=3DHtmlInput::hidden('gDossier',dossier::id());
+      =20
+        if ( empty($array)=3D=3Dfalse ) {
+            $acompte=3Dnew INum('acompte');
+            $acompte->value=3D0;
+            $r.=3D_(" Montant =C3=A0 d=C3=A9duire");
+            $r.=3D$acompte->input();
+        }
+       =20
         $r.=3D'<ol>';
         $r.=3D'<li ><input type=3D"radio" name=3D"e_mp" value=3D"0" chec=
ked>'._('Paiement encod=C3=A9 plus tard');
         if ( empty($array ) =3D=3D false )



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 06 09:23:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ScGD7-00032b-MW
	for mharc-phpcompta-dev@gnu.org; Wed, 06 Jun 2012 09:23:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed,  6 Jun 2012 15:15:23 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.168297.1338989021.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4866 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Jun 2012 13:23:40 -0000

Author: danydb
Date: 2012-06-06 15:15:23 +0200 (Wed, 06 Jun 2012)
New Revision: 4866

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
Log:
0000600: Dans moyen de paiement, ajouter acompte, complete doc

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-06 12:4=
8:07 UTC (rev 4865)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-06 13:1=
5:23 UTC (rev 4866)
@@ -254,9 +254,7 @@
 	      }
 	    $nb++;
         }
-        /**
-         * *@todo check that  acompte is less than total amount
-         */
+     =20
         if ( $nb =3D=3D 0 )
             throw new Exception(_('Il n\'y a aucune marchandise'),12);
=20

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-06 12:48:07=
 UTC (rev 4865)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-06 13:15:23=
 UTC (rev 4866)
@@ -42,7 +42,7 @@
=20
 /*!\brief Handle the ledger of sold,
  *
- *
+ *@exception throw an exception is something is wrong
  */
 class  Acc_Ledger_Sold extends Acc_Ledger
 {
@@ -160,7 +160,6 @@
                 throw new Exception(_('La fiche ').${'e_march'.$i}._('a =
un montant invalide [').${'e_march'.$i}.']',6);
             if ( isNumber(${'e_quant'.$i}) =3D=3D 0 )
                 throw new Exception(_('La fiche ').${'e_march'.$i}._('a =
une quantit=C3=A9 invalide [').${'e_quant'.$i}.']',7);
-
             /* check if all card has a ATTR_DEF_ACCOUNT*/
             $fiche=3Dnew Fiche($this->db);
             $fiche->get_by_qcode(${'e_march'.$i});
@@ -217,10 +216,10 @@
         //------------------------------------------------------
         // The "Paid By"  check
         //------------------------------------------------------
-        /**
-         *@todo check that  acompte is less than total amount=20
-         */
-        if ($e_mp !=3D 0 ) $this->check_payment($e_mp,${"e_mp_qcode_".$e=
_mp});
+    =20
+        if ($e_mp !=3D 0 ) {
+            $this->check_payment($e_mp,${"e_mp_qcode_".$e_mp});
+        }
=20
     }
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 08 05:00:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Scv3f-0004Hz-3o
	for mharc-phpcompta-dev@gnu.org; Fri, 08 Jun 2012 05:00:39 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri,  8 Jun 2012 10:52:09 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.174641.1339146038.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4867 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jun 2012 09:00:37 -0000

Author: danydb
Date: 2012-06-08 10:52:08 +0200 (Fri, 08 Jun 2012)
New Revision: 4867

Modified:
   phpcompta/trunk/html/style.css
Log:
0000603: Apparence bouton: coin arrondi

Modified: phpcompta/trunk/html/style.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style.css	2012-06-06 13:15:23 UTC (rev 4866)
+++ phpcompta/trunk/html/style.css	2012-06-08 08:52:08 UTC (rev 4867)
@@ -824,7 +824,8 @@
 	margin-top:3px;
 	cursor:pointer;
 	margin:1 2 1 2;
-	-moz-border-radius:4 4;
+        border-radius: 4px;
+	-moz-border-radius:4px;
=20
 }
 a#anchorbutton:hover, .button:hover,a.button:hover,div.content a.button:=
hover  {
@@ -833,6 +834,7 @@
 	border-style:  inset ;
 	color:red;
 	margin:1 2 1 2;
+       =20
 	}
 	td.tool {
 	border: solid 1px gray;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 08 05:27:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ScvTx-0000iR-QN
	for mharc-phpcompta-dev@gnu.org; Fri, 08 Jun 2012 05:27:49 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri,  8 Jun 2012 11:19:31 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.174699.1339147669.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4868 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jun 2012 09:27:48 -0000

Author: danydb
Date: 2012-06-08 11:19:31 +0200 (Fri, 08 Jun 2012)
New Revision: 4868

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
Bug in upgrade.sql

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-08 08:52:08 UTC (rev 4867)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-08 09:19:31 UTC (rev 4868)
@@ -102,9 +102,9 @@
       REFERENCES jrn (jr_id) MATCH SIMPLE
       ON UPDATE CASCADE ON DELETE CASCADE
 );
-COMMENT ON COLUMN action_comment_operation.ago_id IS 'pk';
-COMMENT ON COLUMN action_comment_operation.ag_id IS 'fk to action_gestio=
n';
-COMMENT ON COLUMN action_comment_operation.jr_id IS 'fk to jrn';
+COMMENT ON COLUMN action_gestion_operation.ago_id IS 'pk';
+COMMENT ON COLUMN action_gestion_operation.ag_id IS 'fk to action_gestio=
n';
+COMMENT ON COLUMN action_gestion_operation.jr_id IS 'fk to jrn';
=20
 CREATE TABLE link_action_type
 (



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 08 05:32:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ScvYe-00016R-8k
	for mharc-phpcompta-dev@gnu.org; Fri, 08 Jun 2012 05:32:40 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri,  8 Jun 2012 11:24:08 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.174710.1339147959.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4869 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jun 2012 09:32:39 -0000

Author: danydb
Date: 2012-06-08 11:24:08 +0200 (Fri, 08 Jun 2012)
New Revision: 4869

Modified:
   phpcompta/trunk/html/style-epad.css
Log:
Get font bigger in style-epad.css

Modified: phpcompta/trunk/html/style-epad.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-epad.css	2012-06-08 09:19:31 UTC (rev 4868=
)
+++ phpcompta/trunk/html/style-epad.css	2012-06-08 09:24:08 UTC (rev 4869=
)
@@ -22,7 +22,7 @@
=20
 }
 table.resultfooter tfoot {
-	font-size:14%;
+	font-size:14px;
 	font-weight: bold;
=20
=20
@@ -157,14 +157,14 @@
 div.lmenu {
 	float:left;
 	clear:left;
-	font-size:11px;
+	font-size:12px;
=20
 }
 div.lextmenu {
=20
 	float:left;
 	font-family:verdana,helvetica,sans-serif;
-	font-size:11px;
+	font-size:12px;
=20
 }
 div.searchmenu {
@@ -177,7 +177,7 @@
=20
 div.recherche_form{
 	width:700px;
-	font-size:9px;
+	font-size:14px;
 	font-family:verdana,helvetica,sans-serif;
 	border-style:outset;
 	border-width:1px;
@@ -188,7 +188,7 @@
 	float:left;
 	padding-top:7px;
 	padding-left:8px;
-	font-size:12px;
+	font-size:14px;
 	font-family:verdana,helvetica,sans-serif;
 	width:75%;
=20
@@ -479,7 +479,7 @@
=20
 }
 div.content a.mtitle {
-	font-size:10px;
+	font-size:12px;
 	text-decoration:none;
 	display:inline;
 	color:blue;
@@ -531,7 +531,7 @@
 	border-collapse:collapse;
 }
 a.document{
-	font-size:12px;
+	font-size:14px;
 	text-decoration:none;
 	display:block;
 }
@@ -686,7 +686,7 @@
 	height:96%;
 	overflow: auto;
 	background-color:#DFE7FF;
-	font-size:10px ;
+	font-size:12px ;
 	font-family: verdana,helvetica,sans-serif;
 	font-style: normal;
 	font-weight: normal;
@@ -889,7 +889,7 @@
 }
 div.inner_box  {
 	background-color:#e4e7ed;
-	font-size:10;
+	font-size:12px;
 	font-family:verdana,helvetica,sans-serif;
 	padding:0;
 	margin:0;
@@ -952,12 +952,12 @@
 }
 table.info_op
 {
-	font-size:18;
+	font-size:18px;
 	width:100%;
 }
 table.info_op tr
 {
-	font-size:14;
+	font-size:14px;
 	background:white;
 }
 h2#jrn_name
@@ -967,7 +967,7 @@
=20
 }
 tr.footer{
-	font-size:14;
+	font-size:14px;
 	font-style: italic;
 	font-weight: bold;
=20
@@ -1002,7 +1002,7 @@
 div#wait_box
 {
 	background-color:#F1E6E6;
-	font-size:10;
+	font-size:12px;
 	font-family: verdana,helvetica,arial,sans-serif;
 	padding:0;
 	margin:0;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 08 05:33:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ScvZL-00019j-DT
	for mharc-phpcompta-dev@gnu.org; Fri, 08 Jun 2012 05:33:23 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri,  8 Jun 2012 11:25:01 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.174721.1339148002.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4870 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jun 2012 09:33:22 -0000

Author: danydb
Date: 2012-06-08 11:25:01 +0200 (Fri, 08 Jun 2012)
New Revision: 4870

Modified:
   phpcompta/trunk/html/style-epad.css
Log:
Get font bigger in style-epad.css

Modified: phpcompta/trunk/html/style-epad.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-epad.css	2012-06-08 09:24:08 UTC (rev 4869=
)
+++ phpcompta/trunk/html/style-epad.css	2012-06-08 09:25:01 UTC (rev 4870=
)
@@ -809,7 +809,7 @@
 }
=20
 a#anchorbutton, .button, a.button,div.content a.button {
-	font-size:12px;
+	font-size:16px;
 	color:white;
 	font-weight: bold;
 	background-image: url("image/bg-submit4.png");



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 09:59:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdMCn-0008NZ-B7
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 09:59:53 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  9 Jun 2012 15:51:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.178251.1339250392.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4871 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 13:59:51 -0000

Author: danydb
Date: 2012-06-09 15:51:27 +0200 (Sat, 09 Jun 2012)
New Revision: 4871

Modified:
   phpcompta/trunk/include/class_acc_account_ledger.php
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/export_fiche_balance_csv.php
   phpcompta/trunk/include/export_fiche_balance_pdf.php
   phpcompta/trunk/include/export_gl_csv.php
   phpcompta/trunk/include/export_gl_pdf.php
   phpcompta/trunk/include/impress_fiche.inc.php
   phpcompta/trunk/include/impress_gl_comptes.inc.php
Log:
0000566: Harmoniser les soldes cumul?\195?\169es

Modified: phpcompta/trunk/include/class_acc_account_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-08 09:25=
:01 UTC (rev 4870)
+++ phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-09 13:51=
:27 UTC (rev 4871)
@@ -365,7 +365,7 @@
 		if ( $old_exercice !=3D '')
 		  {
 		    $progress=3Dbcsub($sum_deb,$sum_cred);
-
+			$side=3D"&nbsp;".$this->get_amount_side($progress);
 		    echo "<TR style=3D\"font-weight:bold\">".
 		      "<TD></TD>".
 		      td('').
@@ -373,7 +373,7 @@
 		      "<TD>Totaux</TD>".
 		      "<TD style=3D\"text-align:right\">".nbm($sum_deb)."</TD>".
 		      "<TD style=3D\"text-align:right\">".nbm($sum_cred)."</TD>".
-		      td(nbm(abs($progress)),'style=3D"text-align:right"').
+		      td(nbm(abs($progress)).$side,'style=3D"text-align:right"').
 		      td('').
 		      "</TR>";
 		    $sum_cred=3D0;
@@ -383,6 +383,7 @@
 		  }
 	      }
 	    $progress=3Dbcadd($progress,$tmp_diff);
+		$side=3D"&nbsp;".$this->get_amount_side($progress);
 	    $sum_cred=3Dbcadd($sum_cred,$op['cred_montant']);
 	    $sum_deb=3Dbcadd($sum_deb,$op['deb_montant']);
 		if ($idx%2 =3D=3D 0) $class=3D'class=3D"odd"'; else $class=3D' class=3D=
"even"';
@@ -395,7 +396,7 @@
 	      "<TD>".h($op['description'])."</TD>".
 	      "<TD style=3D\"text-align:right\">".nbm($op['deb_montant'])."</TD=
>".
 	      "<TD style=3D\"text-align:right\">".nbm($op['cred_montant'])."</T=
D>".
-	      td(nbm(abs($progress)),'style=3D"text-align:right"').
+	      td(nbm(abs($progress)).$side,'style=3D"text-align:right"').
=20
 	      td($let,' style=3D"color:red;text-align:right"').
 	      "</TR>";
@@ -403,19 +404,19 @@
         }
         echo '<tfoot>';
         $solde_type=3D($sum_deb>$sum_cred)?"solde d=C3=A9biteur":"solde =
cr=C3=A9diteur";
-        $diff=3Dabs(bcsub($sum_deb,$sum_cred));
-
+        $diff=3Dbcsub($sum_deb,$sum_cred);
+		$side=3D"&nbsp;".$this->get_amount_side($diff);
         echo "<TR style=3D\"font-weight:bold\">".
         "<TD >Totaux</TD><td></td>".
         "<TD ></TD>".
         "<TD></TD>".
 	  "<TD  style=3D\"text-align:right\">".nbm($sum_deb)."</TD>".
 	  "<TD  style=3D\"text-align:right\">".nbm($sum_cred)."</TD>".
-	  "<TD style=3D\"text-align:right\">".nbm($diff)."</TD>".
+	  "<TD style=3D\"text-align:right\">".nbm(abs($diff)).$side."</TD>".
=20
         "</TR>";
 	echo   "<tr><TD>$solde_type</TD><td></td>".
-	  "<TD style=3D\"text-align:right\">".nbm($diff)."</TD>".
+	  "<TD style=3D\"text-align:right\">".nbm(abs($diff))."</TD>".
         "</TR>";
         echo '</tfoot>';
         echo '</tbody>';
@@ -424,7 +425,20 @@
=20
         return;
     }
-
+	/**
+	 * return the letter C if amount is > 0, D if < 0 or =3D
+	 * @param type $p_amount
+	 * @return string
+	 */
+	function get_amount_side($p_amount)
+		{
+			if ($p_amount =3D=3D 0)
+				return "=3D";
+			if ($p_amount < 0)
+				return "C";
+			if ($p_amount > 0)
+				return "D";
+		}
     /*!
      * \brief Display HTML Table Header (button)
      *

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-08 09:25:01 UTC (rev =
4870)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-09 13:51:27 UTC (rev =
4871)
@@ -1347,7 +1347,7 @@
 		if ($old_exercice !=3D '' )
 		  {
 		    $progress=3Dbcsub($sum_deb,$sum_cred);
-
+			$side=3D"&nbsp;".$this->get_amount_side($progress);
 		    echo "<TR  style=3D\"font-weight:bold\">".
 		      "<TD></TD>".
 		      td('').
@@ -1355,7 +1355,7 @@
 		      "<TD>Totaux</TD>".
 		      "<TD style=3D\"text-align:right\">".nbm($sum_deb)."</TD>".
 		      "<TD style=3D\"text-align:right\">".nbm($sum_cred)."</TD>".
-		      td(nbm(abs($progress)),'style=3D"text-align:right"').
+		      td(nbm(abs($progress)).$side,'style=3D"text-align:right"').
 		      td('').
 		      "</TR>";
 		    $sum_cred=3D0;
@@ -1364,6 +1364,7 @@
 		  }
 	      }
             $progress=3Dbcadd($progress,$tmp_diff);
+			$side=3D"&nbsp;".$this->get_amount_side($progress);
 	    $sum_cred=3Dbcadd($sum_cred,$op['cred_montant']);
 	    $sum_deb=3Dbcadd($sum_deb,$op['deb_montant']);
 		if ($idx%2 =3D=3D 0) $class=3D'class=3D"odd"'; else $class=3D' class=3D=
"even"';
@@ -1376,7 +1377,7 @@
             "<TD>".h($op['description'])."</TD>".
             "<TD style=3D\"text-align:right\">".nbm($op['deb_montant']).=
"</TD>".
 	      "<TD style=3D\"text-align:right\">".nbm($op['cred_montant'])."</T=
D>".
-	      td(nbm(abs($progress)),'style=3D"text-align:right"').
+	      td(nbm(abs($progress)).$side,'style=3D"text-align:right"').
             td($let,' style=3D"color:red;text-align:right"').
             "</TR>";
 	    $old_exercice=3D$op['p_exercice'];
@@ -1894,7 +1895,20 @@
         $this->cn->exec_sql("insert into jnt_fic_attr (fd_id,ad_id,jnt_o=
rder) select $1,ad_id,100 from fiche_detail where f_id=3D$2 and ad_id not=
 in (select ad_id from jnt_fic_attr where fd_id=3D$3)",array($p_fdid,$thi=
s->id,$p_fdid));
         $this->cn->commit();
     }
-
+	/**
+	 * return the letter C if amount is > 0, D if < 0 or =3D
+	 * @param type $p_amount
+	 * @return string
+	 */
+	function get_amount_side($p_amount)
+	{
+		if ($p_amount =3D=3D 0)
+			return "=3D";
+		if ($p_amount < 0)
+			return "C";
+		if ($p_amount > 0)
+			return "D";
+	}
     static function test_me()
     {
         $cn=3Dnew Database(dossier::id());

Modified: phpcompta/trunk/include/export_fiche_balance_csv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_balance_csv.php	2012-06-08 09:25=
:01 UTC (rev 4870)
+++ phpcompta/trunk/include/export_fiche_balance_csv.php	2012-06-09 13:51=
:27 UTC (rev 4871)
@@ -98,6 +98,7 @@
 	{
 		$afiche[0] =3D array('fd_id' =3D> $_REQUEST['cat']);
 	}
+	$fic=3Dnew Fiche($cn);
 	for ($e =3D 0; $e < count($afiche); $e++)
 	{
 		$array =3D Fiche::get_fiche_def($cn, $afiche[$e]['fd_id'], 'name_asc')=
;
@@ -142,6 +143,7 @@
 				_('D=C3=A9bit'),
 				_('Cr=C3=A9bit'),
 				_('Prog.'),
+				_('D/C'),
 				_('Let.'),
 					_("Diff Let."));
 			printf("\n");
@@ -159,7 +161,7 @@
 				if ($row['j_debit'] =3D=3D 't')
 				{
 					printf("%s;",nb($row['j_montant']));
-					$amount_deb+=3D$row['j_montant'];
+					$amount_deb=3Dbcadd($amount_deb,$row['j_montant']);
 					$prog =3D bcadd($prog, $row['j_montant']);
 					printf (";");
 				}
@@ -167,10 +169,10 @@
 				{
 					printf(";");
 					printf("%s;",nb($row['j_montant']));
-					$amount_cred+=3D$row['j_montant'];
+					$amount_cred=3Dbcadd($amount_cred,$row['j_montant']);
 					$prog =3D bcsub($prog, $row['j_montant']);
 				}
-				printf ("%s;",nb($prog));
+				printf ("%s;\"%s\";",abs(nb($prog)),$fic->get_amount_side($prog));
 				if ($row['letter'] !=3D -1)
 				{
 					printf('"%s";',$row['letter']);
@@ -187,8 +189,8 @@
 			else
 				$msg=3D"sold=C3=A9";
=20
-			printf(';;;"%s";%s;%s;%s',
-					$msg,nb($amount_deb),nb($amount_cred),nb($prog));
+			printf(';;;"%s";%s;%s;%s;"%s"',
+					$msg,nb($amount_deb),nb($amount_cred),nb(abs($prog)),$fic->get_amou=
nt_side($prog));
 			printf("\n");
 		}
 	}

Modified: phpcompta/trunk/include/export_fiche_balance_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-08 09:25=
:01 UTC (rev 4870)
+++ phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-09 13:51=
:27 UTC (rev 4871)
@@ -143,7 +143,7 @@
 	{
 		$afiche[0] =3D array('fd_id' =3D> $_REQUEST['cat']);
 	}
-
+	$fic=3Dnew Fiche($cn);
 	for ($e =3D 0; $e < count($afiche); $e++)
 	{
 		$array =3D Fiche::get_fiche_def($cn,$afiche[$e]['fd_id'] , 'name_asc')=
;
@@ -154,14 +154,14 @@
 		{
 			continue;
 		}
-		$tab =3D array(13, 25, 55, 20, 20, 12, 20);
-		$align =3D array('L', 'L', 'L', 'R', 'R', 'R', 'R');
+		$tab =3D array(12, 20, 10,78, 20, 20, 10, 20);
+		$align =3D array('L', 'C', 'L', 'L', 'R','R', 'R', 'R');
=20
 		foreach ($array as $row_fiche)
 		{
-			$row =3D new Fiche($cn, $row_fiche['f_id']);
+			$fic =3D new Fiche($cn, $row_fiche['f_id']);
 			$letter =3D new Lettering_Card($cn);
-			$letter->set_parameter('quick_code', $row->strAttribut(ATTR_DEF_QUICK=
CODE));
+			$letter->set_parameter('quick_code', $fic->strAttribut(ATTR_DEF_QUICK=
CODE));
 			$letter->set_parameter('start', $_GET['start']);
 			$letter->set_parameter('end', $_GET['end']);
 			// all
@@ -195,15 +195,17 @@
=20
 			$pdf->Cell($tab[0], 7, 'Date');
 			$pdf->Cell($tab[1], 7, 'ref');
-			$pdf->Cell($tab[1], 7, 'Int.');
-			$pdf->Cell($tab[2], 7, 'Comm');
-			$pdf->Cell(40, 7, 'Montant', 0, 0, 'C');
-			$pdf->Cell($tab[5], 7, 'Let.', 0, 0, 'R');
-			$pdf->Cell($tab[6], 7, 'Diff. Let.', 0, 0, 'R');
+			$pdf->Cell($tab[2], 7, 'Int.');
+			$pdf->Cell($tab[3], 7, 'Comm');
+			$pdf->Cell($tab[4], 7, 'Montant', 0, 0, 'C');
+			$pdf->Cell($tab[5], 7, 'Prog.', 0, 0, 'R');
+			$pdf->Cell($tab[6], 7, 'Let.', 0, 0, 'R');
+			$pdf->Cell($tab[7], 7, 'Diff. Let.', 0, 0, 'R');
 			$pdf->ln();
=20
 			$amount_deb =3D 0;
 			$amount_cred =3D 0;
+			$prog=3D0;
 			for ($i =3D 0; $i < count($letter->content); $i++)
 			{
 				if ($i % 2 =3D=3D 0)
@@ -222,40 +224,44 @@
=20
 				$pdf->Cell($tab[0], 4, $str_date, 0, 0, $align[0], $fill);
 				$pdf->Cell($tab[1], 4, $row['jr_pj_number'], 0, 0, $align[1], $fill)=
;
-				$pdf->Cell($tab[1], 4, $row['jr_internal'], 0, 0, $align[1], $fill);
-				$pdf->Cell($tab[2], 4, $row['jr_comment'], 0, 0, $align[2], $fill);
+				$pdf->LongLine($tab[2], 4, $row['jr_internal'], 0, $align[1], $fill)=
;
+				$pdf->LongLine($tab[3], 4, $row['jr_comment'], 0,  $align[2], $fill)=
;
 				if ($row['j_debit'] =3D=3D 't')
 				{
-					$pdf->Cell($tab[3], 4, sprintf('%10.2f', $row['j_montant']), 0, 0, =
$align[4], $fill);
+					$prog=3Dbcadd($prog,$row['j_montant']);
+					$pdf->Cell($tab[4], 4, sprintf('%s D', nbm($row['j_montant'])), 0, =
0, $align[4], $fill);
 					$amount_deb+=3D$row['j_montant'];
-					$pdf->Cell($tab[4], 4, "", 0, 0, 'C', $fill);
+					$str_prog=3Dsprintf("%s %s",nbm(abs($prog)),$fic->get_amount_side($=
prog));
+					$pdf->Cell($tab[5], 4, $str_prog, 0, 0, $align[5], $fill);
 				}
 				else
 				{
-					$pdf->Cell($tab[3], 4, "", 0, 0, 'C', $fill);
-					$pdf->Cell($tab[4], 4, sprintf('%10.2f', $row['j_montant']), 0, 0, =
$align[4], $fill);
+					$prog=3Dbcsub($prog,$row['j_montant']);
+					$pdf->Cell($tab[4], 4, sprintf('%s C', nbm($row['j_montant'])), 0, =
0, $align[4], $fill);
 					$amount_cred+=3D$row['j_montant'];
+					$str_prog=3Dsprintf("%s %s",nbm(abs($prog)),$fic->get_amount_side($=
prog));
+					$pdf->Cell($tab[5], 4, $str_prog, 0, 0, $align[5], $fill);
 				}
 				if ($row['letter'] !=3D -1)
 				{
-					$pdf->Cell($tab[5], 4, $row['letter'], 0, 0, $align[5], $fill);
+					$pdf->Cell($tab[6], 4, $row['letter'], 0, 0, $align[6], $fill);
 					// get sum for this lettering
=20
-					$pdf->Cell($tab[6], 4, sprintf('%.2f', $row['letter_diff']), '0', '=
0', 'R', $fill);
+					$pdf->Cell($tab[7], 4, sprintf('%s', nbm($row['letter_diff'])), '0'=
, '0', $align[7], $fill);
 				}
 				else
-					$pdf->Cell($tab[5], 4, "", 0, 0, 'R', $fill);
+					$pdf->Cell($tab[6], 4, "", 0, 0, 'R', $fill);
 				$pdf->Ln();
 			}
 			$pdf->SetFillColor(0, 0, 0);
 			$pdf->SetFont('DejaVuCond', 'B', 8);
-			$debit =3D sprintf('Debit  : % 12.2f', $amount_deb);
-			$credit =3D sprintf('Credit : % 12.2f', $amount_cred);
+			$debit =3D sprintf('Debit  : %s', nbm($amount_deb));
+			$credit =3D sprintf('Credit : %s', nbm($amount_cred));
 			if ($amount_deb > $amount_cred)
 				$s =3D 'solde d=C3=A9biteur';
 			else
 				$s =3D 'solde crediteur';
-			$solde =3D sprintf('%s  : % 12.2f', $s, (abs(round($amount_cred - $am=
ount_deb, 2))));
+			$solde =3D sprintf('%s  : %s', $s, nbm(abs(round($amount_cred - $amou=
nt_deb, 2))));
=20
 			$pdf->Cell(0, 6, $debit, 0, 0, 'R');
 			$pdf->ln(4);

Modified: phpcompta/trunk/include/export_gl_csv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_gl_csv.php	2012-06-08 09:25:01 UTC (re=
v 4870)
+++ phpcompta/trunk/include/export_gl_csv.php	2012-06-09 13:51:27 UTC (re=
v 4871)
@@ -61,7 +61,7 @@
 {
   $cond_poste=3D'';
   $sql=3D"select pcm_val from tmp_pcmn ";
-    if ($from_poste !=3D '')=20
+    if ($from_poste !=3D '')
       {
 	$cond_poste =3D '  where ';
 	$cond_poste .=3D' pcm_val >=3D upper (\''.Database::escape_string($from=
_poste).'\')';
@@ -69,7 +69,7 @@
=20
     if ( $to_poste !=3D '')
       {
-	if  ( $cond_poste =3D=3D '')=20
+	if  ( $cond_poste =3D=3D '')
 	  {
 	    $cond_poste =3D  ' where pcm_val <=3D upper (\''.Database::escape_s=
tring($to_poste).'\')';
 	  }
@@ -100,10 +100,10 @@
=20
 foreach ($a_poste as $poste)
 {
-=20
=20
+
   $Poste=3Dnew Acc_Account_Ledger($cn,$poste['pcm_val']);
- =20
+
   $array1=3D$Poste->get_row_date($from_periode,$to_periode,$l,$s);
   // don't print empty account
   if ( count($array1) =3D=3D 0 )
@@ -149,12 +149,12 @@
=20
         if ($detail['cred_montant'] > 0)
         {
-            $solde   +=3D $detail['cred_montant'];
+            $solde   -=3D $detail['cred_montant'];
             $solde_c +=3D $detail['cred_montant'];
         }
         if ($detail['deb_montant'] > 0)
         {
-            $solde   -=3D $detail['deb_montant'];
+            $solde   +=3D $detail['deb_montant'];
             $solde_d +=3D $detail['deb_montant'];
         }
=20
@@ -164,7 +164,8 @@
         echo $detail['jr_pj_number'].";";
         echo ($detail['deb_montant']  > 0 ? nb($detail['deb_montant'])  =
: '').";";
         echo ($detail['cred_montant'] > 0 ? nb($detail['cred_montant']) =
: '').";";
-        echo nb($solde).";";
+        echo nb(abs($solde)).";";
+		echo $Poste->get_amount_side($solde);
         printf("\n");
=20
     }

Modified: phpcompta/trunk/include/export_gl_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_gl_pdf.php	2012-06-08 09:25:01 UTC (re=
v 4870)
+++ phpcompta/trunk/include/export_gl_pdf.php	2012-06-09 13:51:27 UTC (re=
v 4871)
@@ -139,17 +139,17 @@
=20
         if ($detail['cred_montant'] > 0)
         {
-            $solde   +=3D $detail['cred_montant'];
+            $solde   -=3D $detail['cred_montant'];
             $solde_c +=3D $detail['cred_montant'];
         }
         if ($detail['deb_montant'] > 0)
         {
-            $solde   -=3D $detail['deb_montant'];
+            $solde   +=3D $detail['deb_montant'];
             $solde_d +=3D $detail['deb_montant'];
         }
=20
         $i =3D 0;
-
+		$side=3D" ".$Poste->get_amount_side($solde);
         $pdf->Cell($width[$i], 6, shrink_date($detail['j_date_fmt']), 0,=
 0, $lor[$i]);
         $i++;
         $pdf->Cell($width[$i], 6, $detail['jr_internal'], 0, 0, $lor[$i]=
);
@@ -165,7 +165,7 @@
         $i++;
         $pdf->Cell($width[$i], 6, ($detail['cred_montant'] > 0 ? nbm( $d=
etail['cred_montant']) : ''), 0, 0, $lor[$i]);
         $i++;
-        $pdf->Cell($width[$i], 6, nbm( $solde), 0, 0, $lor[$i]);
+        $pdf->Cell($width[$i], 6, nbm(abs( $solde)).$side, 0, 0, $lor[$i=
]);
         $i++;
         $pdf->Ln();
=20

Modified: phpcompta/trunk/include/impress_fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/impress_fiche.inc.php	2012-06-08 09:25:01 UTC=
 (rev 4870)
+++ phpcompta/trunk/include/impress_fiche.inc.php	2012-06-09 13:51:27 UTC=
 (rev 4871)
@@ -244,7 +244,7 @@
 }
 echo $export_csv;
 echo $export_pdf;
-
+$fiche=3Dnew Fiche($cn);
 for ($e =3D 0; $e < count($afiche); $e++)
 {
 	$array =3D Fiche::get_fiche_def($cn, $afiche[$e]['fd_id'], 'name_asc');
@@ -322,7 +322,8 @@
 				$amount_cred+=3D$row['j_montant'];
 				$prog =3D bcsub($prog, $row['j_montant']);
 			}
-			echo td(nbm($prog), 'style=3D"text-align:right"');
+			$side=3D"&nbsp;".$fiche->get_amount_side($prog);
+			echo td(nbm($prog).$side, 'style=3D"text-align:right"');
 			if ($row['letter'] !=3D -1)
 				{
 				$span_error=3D"";
@@ -337,11 +338,11 @@
 		echo '<table>';
 		echo '<tr>';
 		echo td(_('Debit'));
-		echo td($amount_deb, ' style=3D"font-weight:bold;text-align:right"');
+		echo td(nbm($amount_deb), ' style=3D"font-weight:bold;text-align:right=
"');
 		echo '</tr>';
 		echo '<tr>';
 		echo td(_('Credit'));
-		echo td($amount_cred, ' style=3D"font-weight:bold;text-align:right"');
+		echo td(nbm($amount_cred), ' style=3D"font-weight:bold;text-align:righ=
t"');
 		echo '</tr>';
 		echo '<tr>';
 		if ($amount_deb > $amount_cred)
@@ -349,7 +350,7 @@
 		else
 			$s =3D 'solde crediteur';
 		echo td($s);
-		echo td(abs(round($amount_cred - $amount_deb, 2)), ' style=3D"font-wei=
ght:bold;text-align:right"');
+		echo td(nbm(abs(round($amount_cred - $amount_deb, 2))), ' style=3D"fon=
t-weight:bold;text-align:right"');
 		echo '</tr>';
 		echo '</table>';
 	}

Modified: phpcompta/trunk/include/impress_gl_comptes.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/impress_gl_comptes.inc.php	2012-06-08 09:25:0=
1 UTC (rev 4870)
+++ phpcompta/trunk/include/impress_gl_comptes.inc.php	2012-06-09 13:51:2=
7 UTC (rev 4871)
@@ -207,14 +207,15 @@
=20
             if ($detail['cred_montant'] > 0)
             {
-	      $solde=3Dbcadd($solde, $detail['cred_montant']);
+	      $solde=3Dbcsub($solde, $detail['cred_montant']);
 	      $solde_c=3Dbcadd($solde_c,$detail['cred_montant']);
             }
             if ($detail['deb_montant'] > 0)
             {
-	      $solde   =3D bcsub($solde,$detail['deb_montant']);
+	      $solde   =3D bcadd($solde,$detail['deb_montant']);
 	      $solde_d =3D bcadd($solde_d,$detail['deb_montant']);
             }
+			$side=3D"&nbsp;".$Poste->get_amount_side($solde);
 	    $letter=3D($detail['letter']!=3D-1)?hi($detail['letter']):'';
             echo '<tr>
             <td>'.$detail['j_date_fmt'].'</td>
@@ -223,7 +224,7 @@
             <td>'.$detail['jr_pj_number'].'</td>
             <td align=3D"right">'.($detail['deb_montant']  > 0 ? nbm($de=
tail['deb_montant'])  : '').'</td>
             <td align=3D"right">'.($detail['cred_montant'] > 0 ? nbm($de=
tail['cred_montant']) : '').'</td>
-            <td align=3D"right">'.nbm($solde).'</td>
+            <td align=3D"right">'.nbm(abs($solde)).$side.'</td>
             <td  style=3D"text-align:right;color:red">'.$letter.'</td>
             </tr>';
         }



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 10:19:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdMVP-000299-9x
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 10:19:07 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  9 Jun 2012 16:10:45 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.178260.1339251546.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4872 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 14:19:06 -0000

Author: danydb
Date: 2012-06-09 16:10:45 +0200 (Sat, 09 Jun 2012)
New Revision: 4872

Modified:
   phpcompta/trunk/include/class_pdf.php
   phpcompta/trunk/include/class_print_ledger_detail.php
   phpcompta/trunk/include/class_print_ledger_fin.php
   phpcompta/trunk/include/class_print_ledger_misc.php
   phpcompta/trunk/include/class_print_ledger_simple.php
   phpcompta/trunk/include/class_print_ledger_simple_without_vat.php
   phpcompta/trunk/include/export_poste_detail_pdf.php
Log:
0000012: Impression PDF : libell?\195?\169 trop longs

Modified: phpcompta/trunk/include/class_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_pdf.php	2012-06-09 13:51:27 UTC (rev 48=
71)
+++ phpcompta/trunk/include/class_pdf.php	2012-06-09 14:10:45 UTC (rev 48=
72)
@@ -37,7 +37,7 @@
=20
     public function __construct ($p_cn =3D null, $orientation =3D 'P', $=
unit =3D 'mm', $format =3D 'A4')
     {
-
+		$this->bigger=3D0;
         if($p_cn =3D=3D null) die("No database connection. Abort.");
=20
         parent::TFPDF($orientation, $unit, $format);
@@ -85,7 +85,23 @@
     {
         $txt =3D str_replace("\\", "", $txt);
         return parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $=
link);
-    }
+		}
+	function LongLine($w,$h,$txt,$border=3D0,$align=3D'',$fill=3Dfalse)
+	{
+		$x_m=3D$this->GetX();
+		$y_m=3D$this->GetY();
+		$txt =3D str_replace("\\", "", $txt);
+		$this->MultiCell($w,$h,$txt,$border,$align,$fill);
+		$x_m=3D$x_m+$w;
+		$tmp=3D$this->GetY()-$y_m;
+		if ( $tmp > $this->bigger) $this->bigger=3D$tmp;
+		$this->SetXY($x_m,$y_m);
+	}
+	function Ln($p_step=3Dnull){
+		if ( $this->bigger=3D=3D0) parent::Ln($p_step);
+		parent::Ln($this->bigger);
+		$this->bigger=3D0;
+	}
     /**
      *@brief retrieve the client name and quick_code
      *@param $p_jr_id jrn.jr_id

Modified: phpcompta/trunk/include/class_print_ledger_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_print_ledger_detail.php	2012-06-09 13:5=
1:27 UTC (rev 4871)
+++ phpcompta/trunk/include/class_print_ledger_detail.php	2012-06-09 14:1=
0:45 UTC (rev 4872)
@@ -96,10 +96,10 @@
             $this->Cell(20,7,$row['pj']);
             $this->Cell(15,7,$row['date_fmt']);
             $this->Cell(20,7,$row['internal']);
-            $this->Cell(170,7,$row['comment']);
+            $this->LongLine(170,7,$row['comment']);
             $this->Cell(20,7,nbm($row['montant']),0,0,'R');
=20
-            $this->Ln(4);
+            $this->Ln();
             // get the entries
             $aEntry=3D$this->cn->get_array("select j_id,j_poste,j_qcode,=
j_montant,j_debit, j_text,".
 										 " case when j_text=3D'' or j_text is null then pcm_lib else j=
_text end as desc,".

Modified: phpcompta/trunk/include/class_print_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_print_ledger_fin.php	2012-06-09 13:51:2=
7 UTC (rev 4871)
+++ phpcompta/trunk/include/class_print_ledger_fin.php	2012-06-09 14:10:4=
5 UTC (rev 4872)
@@ -88,9 +88,9 @@
             $this->Cell(40,5,$name,0,0);
=20
=20
-            $this->Cell(105,5,$row['comment'],0,0);
+            $this->LongLine(105,5,$row['comment'],0,'L');
             $amount=3D$this->cn->get_value('select qf_amount from quant_=
fin where jr_id=3D$1',array( $row['id']));
-            $this->Cell(15,5,sprintf('%.2f',$amount),0,0,'R');
+            $this->Cell(15,5,sprintf('%s',nbm($amount)),0,0,'R');
             $this->Ln(5);
=20
         }

Modified: phpcompta/trunk/include/class_print_ledger_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_print_ledger_misc.php	2012-06-09 13:51:=
27 UTC (rev 4871)
+++ phpcompta/trunk/include/class_print_ledger_misc.php	2012-06-09 14:10:=
45 UTC (rev 4872)
@@ -83,8 +83,8 @@
             $this->Cell(20,5,$row['internal']);
 	    $type=3D$this->cn->get_value("select jrn_def_type from jrn_def wher=
e jrn_def_id=3D$1",array($a_jrn[$i]['jr_def_id']));
 	    $other=3Dmb_substr($this->ledger->get_tiers($type,$a_jrn[$i]['id'])=
,0,25);
-	    $this->Cell(25,5,$other,0,0);
-            $this->Cell(80,5,$row['comment'],0,0);
+	    $this->LongLine(25,5,$other,0,'L');
+            $this->LongLine(80,5,$row['comment'],0,'L');
             $this->Cell(15,5,nbm($row['montant']),0,0,'R');
             $this->Ln(5);
=20

Modified: phpcompta/trunk/include/class_print_ledger_simple.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_print_ledger_simple.php	2012-06-09 13:5=
1:27 UTC (rev 4871)
+++ phpcompta/trunk/include/class_print_ledger_simple.php	2012-06-09 14:1=
0:45 UTC (rev 4872)
@@ -229,9 +229,9 @@
             $this->Cell(10,5,$row['date_fmt'],0,0);
             $this->Cell(13,5,$row['internal'],0,0);
             list($qc,$name)=3D$this->get_tiers($row['id'],$this->jrn_typ=
e);
-            $this->Cell(40,5,"[".$qc."]".$name,0,0);
+            $this->LongLine(40,5,"[".$qc."]".$name,0,'L');
=20
-            $this->Cell(65,5,mb_substr($row['comment'],0,47),0,0);
+            $this->LongLine(65,5,mb_substr($row['comment'],0,150),0,'L')=
;
=20
             /* get other amount (without vat, total vat included, privat=
e, ND */
             $other=3D$this->ledger->get_other_amount($a_jrn[$i]['jr_grpt=
_id']);

Modified: phpcompta/trunk/include/class_print_ledger_simple_without_vat.p=
hp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_print_ledger_simple_without_vat.php	201=
2-06-09 13:51:27 UTC (rev 4871)
+++ phpcompta/trunk/include/class_print_ledger_simple_without_vat.php	201=
2-06-09 14:10:45 UTC (rev 4872)
@@ -163,9 +163,9 @@
             $this->Cell(20,5,$row['internal'],0,0);
             list($qc,$name)=3D$this->get_tiers($row['id'],$this->jrn_typ=
e);
             $this->Cell(20,5,$qc,0,0);
-            $this->Cell(40,5,$name,0,0);
+            $this->LongLine(40,5,$name,0,'L');
=20
-            $this->Cell(105,5,$row['comment'],0,0);
+            $this->LongLine(105,5,$row['comment'],0,'L');
=20
             /* get other amount (without vat, total vat included, privat=
e, ND */
             $other=3D$this->ledger->get_other_amount($a_jrn[$i]['jr_grpt=
_id']);

Modified: phpcompta/trunk/include/export_poste_detail_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_poste_detail_pdf.php	2012-06-09 13:51:=
27 UTC (rev 4871)
+++ phpcompta/trunk/include/export_poste_detail_pdf.php	2012-06-09 14:10:=
45 UTC (rev 4872)
@@ -86,7 +86,7 @@
     $l++;
     $pdf->Cell($size[$l],6,'Journal',0,0,'C');
     $l++;
-    $pdf->Cell($size[$l],6,'Libell=C3=A9',0,0,'L');
+    $pdf->LongLine($size[$l],6,'Libell=C3=A9',0,'L');
     $l++;
     $pdf->Cell($size[$l],6,'Let',0,0,'R');
     $l++;
@@ -116,7 +116,7 @@
         $l++;
         $pdf->Cell($size[$l],6,mb_substr($row['jrn_name'],0,14),0,0,$ali=
gn[$l]);
         $l++;
-        $pdf->Cell($size[$l],6,  mb_substr($row['description'],0,55),0,0=
,$align[$l]);
+        $pdf->LongLine($size[$l],6,  $row['description'],0,$align[$l]);
         $l++;
         $pdf->Cell($size[$l],6,(($row['letter']!=3D-1)?$row['letter']:''=
),0,0,$align[$l]);
         $l++;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 10:45:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdMvA-0005Z4-TH
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 10:45:44 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  9 Jun 2012 16:37:22 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.178309.1339253143.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4873 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 14:45:43 -0000

Author: danydb
Date: 2012-06-09 16:37:22 +0200 (Sat, 09 Jun 2012)
New Revision: 4873

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/action_search.php
Log:
0000604: Dans le boite de recherche action

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-09 14:10:45 UTC=
 (rev 4872)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-09 14:37:22 UTC=
 (rev 4873)
@@ -174,7 +174,7 @@
     Follow_Up::ShowActionList($cn,$base);
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
-	echo HtmlInput::request_to_hidden(array("gDossier","qcode","start_date"=
,"end_date","ag_id","ag_dest_query",
+	echo HtmlInput::request_to_hidden(array("state","gDossier","qcode","sta=
rt_date","end_date","ag_id","ag_dest_query",
 			"tdoc","see_all","all_action","query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-06-09 14:10:45 UTC (rev 4=
872)
+++ phpcompta/trunk/include/action.inc.php	2012-06-09 14:37:22 UTC (rev 4=
873)
@@ -23,7 +23,7 @@
  */
 require_once('class_ipopup.php');
 global $g_user;
-$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("ac","gDossier","qcode","ag_dest_query","query","tdoc","d=
ate_start","date_end","see_all","all_action")).'&my_action');
+$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("state","ac","gDossier","qcode","ag_dest_query","query","=
tdoc","date_start","date_end","see_all","all_action")).'&my_action');
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-09 14:10:45=
 UTC (rev 4872)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-09 14:37:22=
 UTC (rev 4873)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("gDossier","qcode","ag_dest","query=
","tdoc","date_start","date_end","see_all","all_action","sb","sc"),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("state","gDossier","qcode","ag_dest=
","query","tdoc","date_start","date_end","see_all","all_action","sb","sc"=
),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-09 14:10:45 UTC (=
rev 4872)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-09 14:37:22 UTC (=
rev 4873)
@@ -488,7 +488,7 @@
 		/* add the number of item */
 		$Hid =3D new IHidden();
 		$r.=3D$Hid->input("nb_item", MAX_ARTICLE);
-		$r.=3DHtmlInput::request_to_hidden(array("qcode", "ag_dest_query", "qu=
ery", "tdoc", "date_start", "date_end", "see_all", "all_action"));
+		$r.=3DHtmlInput::request_to_hidden(array("state","qcode", "ag_dest_que=
ry", "query", "tdoc", "date_start", "date_end", "see_all", "all_action"))=
;
 		/* get template */
 		ob_start();
 		require_once 'template/detail-action.php';
@@ -663,7 +663,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("qcode", "ag_dest_query", "que=
ry", "tdoc", "date_start", "date_end", "see_all", "all_action")) . '&' . =
$p_base;
+		$url =3D HtmlInput::get_to_string(array("state","qcode", "ag_dest_quer=
y", "query", "tdoc", "date_start", "date_end", "see_all", "all_action")) =
. '&' . $p_base;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -735,7 +735,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php' . HtmlInput::get_to_=
string(array("gDossier", "qcode", "ag_dest_query", "query", "tdoc", "date=
_start", "date_end", "see_all", "ac", "all_action")) . "&" . $p_base . '&=
sa=3Ddetail&ag_id=3D' . $row['ag_id'] . '">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php' . HtmlInput::get_to_=
string(array("state","gDossier", "qcode", "ag_dest_query", "query", "tdoc=
", "date_start", "date_end", "see_all", "ac", "all_action")) . "&" . $p_b=
ase . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] . '">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1116,6 +1116,14 @@
 		$type_doc->value =3D $aTDoc;
 		$type_doc->selected =3D (isset($_GET['tdoc'])) ? $_GET['tdoc'] : -1;
=20
+		/* State of documents */
+		$type_state=3D new ISelect('state');
+		$aState =3D $cn->make_array('select s_id,s_value from document_state o=
rder by s_value');
+		$aState[] =3D array('value' =3D> '-1', 'label' =3D> _('Tous les Etats'=
));
+		$type_state->value =3D $aState;
+		$type_state->selected =3D (isset($_GET['state'])) ? $_GET['state'] : -=
1;
+
+
 		// date
 		$start =3D new IDate('date_start');
 		$start->value =3D (isset($_GET['date_start'])) ? $_GET['date_start'] :=
 "";
@@ -1203,6 +1211,10 @@
 		{
 			$query .=3D ' and dt_id =3D ' . sql_string($tdoc);
 		}
+		if (isset($state) && $state!=3D -1)
+		{
+			$query .=3D ' and ag_state=3D ' . sql_string($state);
+		}
 		if (!isset($_GET['see_all']))
 			$query .=3D ' and ag_state in (2,3) ';
 		if (!isset($all_action))

Modified: phpcompta/trunk/include/template/action_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search.php	2012-06-09 14:10:4=
5 UTC (rev 4872)
+++ phpcompta/trunk/include/template/action_search.php	2012-06-09 14:37:2=
2 UTC (rev 4873)
@@ -61,6 +61,10 @@
 				<td style=3D"text-align:right" ><?=3D _("Profile")?></td>
 				<td><?=3D $str_ag_dest?></td>
 			</tr>
+			<tr>
+				<td style=3D"text-align:right" ><?=3D _("Etat")?></td>
+				<td><?=3D $type_state->input()?></td>
+			</tr>
 			<td style=3D"text-align:right"><? printf(_('contenant le mot'))?></td=
>
 			<td ><input class=3D"input_text" style=3D"width:100%" type=3D"text" n=
ame=3D"query" value=3D"<?=3D $a?>"></td>
 			</tr>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 11:27:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdNZp-00006z-SS
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 11:27:45 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  9 Jun 2012 17:19:21 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.178627.1339255665.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4874 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 15:27:45 -0000

Author: danydb
Date: 2012-06-09 17:19:20 +0200 (Sat, 09 Jun 2012)
New Revision: 4874

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/action_search.php
Log:
0000608: Dans le boite de recherche action : uniquement interne

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-09 14:37:22 UTC=
 (rev 4873)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-09 15:19:20 UTC=
 (rev 4874)
@@ -174,7 +174,7 @@
     Follow_Up::ShowActionList($cn,$base);
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
-	echo HtmlInput::request_to_hidden(array("state","gDossier","qcode","sta=
rt_date","end_date","ag_id","ag_dest_query",
+	echo HtmlInput::request_to_hidden(array("only_internal","state","gDossi=
er","qcode","start_date","end_date","ag_id","ag_dest_query",
 			"tdoc","see_all","all_action","query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-06-09 14:37:22 UTC (rev 4=
873)
+++ phpcompta/trunk/include/action.inc.php	2012-06-09 15:19:20 UTC (rev 4=
874)
@@ -23,7 +23,7 @@
  */
 require_once('class_ipopup.php');
 global $g_user;
-$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("state","ac","gDossier","qcode","ag_dest_query","query","=
tdoc","date_start","date_end","see_all","all_action")).'&my_action');
+$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("only_internal","state","ac","gDossier","qcode","ag_dest_=
query","query","tdoc","date_start","date_end","see_all","all_action")).'&=
my_action');
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-09 14:37:22=
 UTC (rev 4873)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-09 15:19:20=
 UTC (rev 4874)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("state","gDossier","qcode","ag_dest=
","query","tdoc","date_start","date_end","see_all","all_action","sb","sc"=
),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("only_internal","state","gDossier",=
"qcode","ag_dest","query","tdoc","date_start","date_end","see_all","all_a=
ction","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-09 14:37:22 UTC (=
rev 4873)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-09 15:19:20 UTC (=
rev 4874)
@@ -488,7 +488,7 @@
 		/* add the number of item */
 		$Hid =3D new IHidden();
 		$r.=3D$Hid->input("nb_item", MAX_ARTICLE);
-		$r.=3DHtmlInput::request_to_hidden(array("state","qcode", "ag_dest_que=
ry", "query", "tdoc", "date_start", "date_end", "see_all", "all_action"))=
;
+		$r.=3DHtmlInput::request_to_hidden(array("only_internal","state","qcod=
e", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all"=
, "all_action"));
 		/* get template */
 		ob_start();
 		require_once 'template/detail-action.php';
@@ -663,7 +663,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("state","qcode", "ag_dest_quer=
y", "query", "tdoc", "date_start", "date_end", "see_all", "all_action")) =
. '&' . $p_base;
+		$url =3D HtmlInput::get_to_string(array("only_internal","state","qcode=
", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all",=
 "all_action")) . '&' . $p_base;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -735,7 +735,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php' . HtmlInput::get_to_=
string(array("state","gDossier", "qcode", "ag_dest_query", "query", "tdoc=
", "date_start", "date_end", "see_all", "ac", "all_action")) . "&" . $p_b=
ase . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] . '">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php' . HtmlInput::get_to_=
string(array("only_internal","state","gDossier", "qcode", "ag_dest_query"=
, "query", "tdoc", "date_start", "date_end", "see_all", "ac", "all_action=
")) . "&" . $p_base . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] . '">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1134,6 +1134,8 @@
 		$see_all->selected =3D (isset($_GET['see_all'])) ? true : false;
 		$my_action =3D new ICheckBox('all_action');
 		$my_action->selected =3D (isset($_GET['all_action'])) ? true : false;
+		$only_internal=3D new ICheckBox('only_internal');
+		$only_internal->selected =3D (isset($_GET['only_internal'])) ? true : =
false;
 		// select profile
 		$aAg_dest =3D $cn->make_array("select  p_id as value, " .
 				"p_name as label " .
@@ -1217,6 +1219,8 @@
 		}
 		if (!isset($_GET['see_all']))
 			$query .=3D ' and ag_state in (2,3) ';
+		if (isset($_GET['only_internal']))
+			$query .=3D ' and f_id_dest=3D0 ';
 		if (!isset($all_action))
 		{
 			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ag_dest=
 in (select p_id from profile_user where user_name=3D'" . $_SESSION['g_us=
er'] . "') or ag_dest is null )";

Modified: phpcompta/trunk/include/template/action_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search.php	2012-06-09 14:37:2=
2 UTC (rev 4873)
+++ phpcompta/trunk/include/template/action_search.php	2012-06-09 15:19:2=
0 UTC (rev 4874)
@@ -100,6 +100,11 @@
 				<td><?=3D $my_action->input()?>
 				</td>
 			</tr>
+			<tr>
+				<td style=3D"text-align:right"><?=3D _('Uniquement actions internes'=
)?></td>
+				<td><?=3D $only_internal->input()?>
+				</td>
+			</tr>
 		</table>
 		<input type=3D"submit" class=3D"button" name=3D"submit_query" value=3D=
"<?=3D _('recherche')?>">
 		<input type=3D"hidden" name=3D"sa" value=3D"list">



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 11:52:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdNy1-0006Ao-Fo
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 11:52:45 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  9 Jun 2012 17:44:24 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.178898.1339257165.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4875 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 15:52:45 -0000

Author: danydb
Date: 2012-06-09 17:44:24 +0200 (Sat, 09 Jun 2012)
New Revision: 4875

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/action_search.php
Log:
0000609: recherche num?\195?\169ro de r?\195?\169f?\195?\169rence action_=
gestion

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-09 15:19:20 UTC=
 (rev 4874)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-09 15:44:24 UTC=
 (rev 4875)
@@ -174,7 +174,7 @@
     Follow_Up::ShowActionList($cn,$base);
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
-	echo HtmlInput::request_to_hidden(array("only_internal","state","gDossi=
er","qcode","start_date","end_date","ag_id","ag_dest_query",
+	echo HtmlInput::request_to_hidden(array("sag_ref","only_internal","stat=
e","gDossier","qcode","start_date","end_date","ag_id","ag_dest_query",
 			"tdoc","see_all","all_action","query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-06-09 15:19:20 UTC (rev 4=
874)
+++ phpcompta/trunk/include/action.inc.php	2012-06-09 15:44:24 UTC (rev 4=
875)
@@ -23,7 +23,7 @@
  */
 require_once('class_ipopup.php');
 global $g_user;
-$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("only_internal","state","ac","gDossier","qcode","ag_dest_=
query","query","tdoc","date_start","date_end","see_all","all_action")).'&=
my_action');
+$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("sag_ref","only_internal","state","ac","gDossier","qcode"=
,"ag_dest_query","query","tdoc","date_start","date_end","see_all","all_ac=
tion")).'&my_action');
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-09 15:19:20=
 UTC (rev 4874)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-09 15:44:24=
 UTC (rev 4875)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("only_internal","state","gDossier",=
"qcode","ag_dest","query","tdoc","date_start","date_end","see_all","all_a=
ction","sb","sc"),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("sag_ref","only_internal","state","=
gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","see_a=
ll","all_action","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-09 15:19:20 UTC (=
rev 4874)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-09 15:44:24 UTC (=
rev 4875)
@@ -488,7 +488,7 @@
 		/* add the number of item */
 		$Hid =3D new IHidden();
 		$r.=3D$Hid->input("nb_item", MAX_ARTICLE);
-		$r.=3DHtmlInput::request_to_hidden(array("only_internal","state","qcod=
e", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all"=
, "all_action"));
+		$r.=3DHtmlInput::request_to_hidden(array("sag_ref","only_internal","st=
ate","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end",=
 "see_all", "all_action"));
 		/* get template */
 		ob_start();
 		require_once 'template/detail-action.php';
@@ -663,7 +663,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("only_internal","state","qcode=
", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all",=
 "all_action")) . '&' . $p_base;
+		$url =3D HtmlInput::get_to_string(array("sag_ref","only_internal","sta=
te","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", =
"see_all", "all_action")) . '&' . $p_base;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -735,7 +735,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php' . HtmlInput::get_to_=
string(array("only_internal","state","gDossier", "qcode", "ag_dest_query"=
, "query", "tdoc", "date_start", "date_end", "see_all", "ac", "all_action=
")) . "&" . $p_base . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] . '">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php' . HtmlInput::get_to_=
string(array("sag_ref","only_internal","state","gDossier", "qcode", "ag_d=
est_query", "query", "tdoc", "date_start", "date_end", "see_all", "ac", "=
all_action")) . "&" . $p_base . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] .=
 '">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1146,6 +1146,8 @@
 		$ag_dest->value =3D $aAg_dest;
 		$ag_dest->selected =3D (isset($_GET["ag_dest_query"])) ? $_GET["ag_des=
t_query"] : 0;
 		$str_ag_dest =3D $ag_dest->input();
+		$osag_ref=3Dnew IText("sag_ref");
+		$osag_ref->value=3D(isset($_GET['sag_ref']))?$_GET['sag_ref']:"";
 		// show the  action in
 		require_once 'template/action_search.php';
 	}
@@ -1217,6 +1219,10 @@
 		{
 			$query .=3D ' and ag_state=3D ' . sql_string($state);
 		}
+		if (isset($sag_ref) && trim($sag_ref) !=3D "")
+		{
+			$query .=3D ' and ag_ref=3D \'' . sql_string($sag_ref)."'";
+		}
 		if (!isset($_GET['see_all']))
 			$query .=3D ' and ag_state in (2,3) ';
 		if (isset($_GET['only_internal']))

Modified: phpcompta/trunk/include/template/action_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search.php	2012-06-09 15:19:2=
0 UTC (rev 4874)
+++ phpcompta/trunk/include/template/action_search.php	2012-06-09 15:44:2=
4 UTC (rev 4875)
@@ -46,8 +46,13 @@
 		<?=3DHtmlInput::hidden('ctlc',$_GET['ctlc'])?>
 <? endif; ?>
 		<?=3D dossier::hidden()?>
-		<table style=3D"width:100%">
+		<table style=3D"width:100%"><tr>
+			<td style=3D"width:180px;text-align:right"> R=C3=A9f=C3=A9rence</td>
+				<td>
+					<?=3D$osag_ref->input();?>
+				</td>
 			<tr>
+			<tr>
 				<td style=3D"width:180px;text-align:right"> Num=C3=A9ro document</td=
>
 				<td>
 					<? $num=3Dnew INum('ag_id');echo $num->input();?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 12:23:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdORy-0001xc-CK
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 12:23:42 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  9 Jun 2012 18:15:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.178965.1339259020.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4876 - in phpcompta/trunk: include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 16:23:39 -0000

Author: danydb
Date: 2012-06-09 18:15:18 +0200 (Sat, 09 Jun 2012)
New Revision: 4876

Modified:
   phpcompta/trunk/include/cat_document.inc.php
   phpcompta/trunk/include/class_document_type.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/list_category_document.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000607: Num?\195?\169ro de r?\195?\169f?\195?\169rence action_gestion

Modified: phpcompta/trunk/include/cat_document.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/cat_document.inc.php	2012-06-09 15:44:24 UTC =
(rev 4875)
+++ phpcompta/trunk/include/cat_document.inc.php	2012-06-09 16:15:18 UTC =
(rev 4876)
@@ -31,11 +31,13 @@
 if ( isset($_POST['add']) )
 {
     $catDoc=3Dnew Document_Type($cn);
-    $catDoc->insert($_POST['cat']);
+    $catDoc->insert($_POST['cat'],$_POST['prefix']);
 }
 $aList=3DDocument_Type::get_list($cn);
 $addCat=3Dnew IText('cat');
+$addPrefix=3Dnew IText('prefix');
 $str_addCat=3D$addCat->input();
+$str_addPrefix=3D$addPrefix->input();
 $str_submit=3DHtmlInput::submit('add',_('Ajout'));
 echo '<div class=3D"content">';
 require_once('template/list_category_document.php');

Modified: phpcompta/trunk/include/class_document_type.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_document_type.php	2012-06-09 15:44:24 U=
TC (rev 4875)
+++ phpcompta/trunk/include/class_document_type.php	2012-06-09 16:15:18 U=
TC (rev 4876)
@@ -61,6 +61,7 @@
         for ($i=3D0;$i<count($r);$i++)
         {
             $tmp['dt_value']=3D$r[$i]['dt_value'];
+            $tmp['dt_prefix']=3D$r[$i]['dt_prefix'];
=20
             $bt=3Dnew IButton('X'.$r[$i]['dt_id']);
             $bt->label=3D_('Effacer');
@@ -74,15 +75,15 @@
         }
         return $array;
     }
-    function insert($p_value)
+    function insert($p_value,$p_prefix)
     {
-        $sql=3D"insert into document_type(dt_value) values ($1)";
+        $sql=3D"insert into document_type(dt_value,dt_prefix) values ($1=
,$2)";
         try
         {
             if( $this->db->count_sql('select * from document_type where =
upper(dt_value)=3Dupper(trim($1))',array($p_value))>0)
                 throw new Exception('Nom en double');
             if ( strlen(trim($p_value))>0)
-                $this->db->exec_sql($sql,array($p_value));
+                $this->db->exec_sql($sql,array($p_value,$p_prefix));
         }
         catch (Exception $e)
         {

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-09 15:44:24 UTC (=
rev 4875)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-09 16:15:18 UTC (=
rev 4876)
@@ -271,10 +271,7 @@
=20
 		// ag_ref
 		// Always false for update
-		$ag_ref =3D new IText();
-		$ag_ref->readonly =3D $upd;
-		$ag_ref->name =3D "ag_ref";
-		$ag_ref->value =3D sql_string($this->ag_ref);
+
 		$client_label =3D new ISpan();
=20
 		/* Add button */
@@ -366,7 +363,10 @@
=20
=20
 		$h_agrefid =3D new IHidden();
-		$str_ag_ref =3D "<b>" . (($this->ag_ref !=3D "") ? $this->ag_ref : " N=
ouveau ") . "</b>";
+		$iag_ref=3Dnew IText("ag_ref");
+		$iag_ref->value=3D$this->ag_ref;
+		$iag_ref->readOnly =3D ($p_view =3D=3D "NEW")?true:false;
+		$str_ag_ref =3D$iag_ref->input();
 		// Preparing the return string
 		$r =3D "";
=20
@@ -586,8 +586,9 @@
 		$this->ag_id =3D $this->db->get_next_seq('action_gestion_ag_id_seq');
=20
 		// Create the reference
-		$ref =3D $this->dt_id . '/' . $this->ag_id;
-		$this->ag_ref =3D $ref;
+		$ag_ref=3D$this->db->get_value('select dt_prefix from document_type wh=
ere dt_id=3D$1',array($this->dt_id)).'-'.$this->db->get_next_seq($seq_nam=
e);
+		$this->ag_ref =3D $ag_ref;
+
 		if ($this->ag_cal =3D=3D 'on')
 			$ag_cal =3D 'C';
 		else
@@ -617,7 +618,7 @@
 			$this->dt_id, /* 3 */
 			$this->ag_title, /* 4 */
 			$exp->id, /* 5 */
-			$ref, /* 6 */
+			$ag_ref, /* 6 */
 			$this->ag_dest, /* 7 */
 			$this->ag_hour, /* 8 */
 			$this->ag_priority, /* 9 */
@@ -858,12 +859,10 @@
 			$contact->id =3D 0;
=20
=20
-		$ref =3D $this->dt_id . '/' . $this->ag_id;
 		if ($this->ag_cal =3D=3D 'on')
 			$ag_cal =3D 'C';
 		else
 			$ag_cal =3D 'I';
-		$this->ag_ref =3D $ref;
 		if ($this->ag_dest =3D=3D 0)
 		{
 			$this->ag_dest =3D null;
@@ -979,6 +978,7 @@
 	function fromArray($p_array)
 	{
 		$this->ag_id =3D (isset($p_array['ag_id'])) ? $p_array['ag_id'] : "";
+		$this->ag_ref =3D (isset($p_array['ag_ref'])) ? $p_array['ag_ref'] : "=
";
 		$this->qcode_dest =3D (isset($p_array['qcode_dest'])) ? $p_array['qcod=
e_dest'] : "";
 		$this->f_id_dest =3D (isset($p_array['f_id_dest'])) ? $p_array['f_id_d=
est'] : 0;
 		$this->ag_timestamp =3D (isset($p_array['ag_timestamp'])) ? $p_array['=
ag_timestamp'] : date('d.m.Y');

Modified: phpcompta/trunk/include/template/list_category_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/list_category_document.php	2012-06-0=
9 15:44:24 UTC (rev 4875)
+++ phpcompta/trunk/include/template/list_category_document.php	2012-06-0=
9 16:15:18 UTC (rev 4876)
@@ -9,8 +9,11 @@
=20
 <tr id=3D"row<?=3D$row['dt_id']?>">
 <td colspan=3D"2">
-<?=3D$row['dt_value'];?>
+<?=3Dh($row['dt_value']);?>
 </td>
+<td colspan=3D"2">
+<?=3Dh($row['dt_prefix']);?>
+</td>
 <td>
 <?=3D$row['js_remove'];?>
 </td>
@@ -23,6 +26,9 @@
 <?=3D$str_addCat?>
 </td>
 <td>
+<?=3D$str_addPrefix?>
+</td>
+<td>
    <?=3D$str_submit?>
 </td>
 </tr>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-09 15:44:24 UTC (rev 4875)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-09 16:15:18 UTC (rev 4876)
@@ -182,4 +182,10 @@
 DROP FUNCTION comptaproc.action_get_tree(bigint);
=20
 insert into menu_ref(me_code,me_menu,me_type) values ('CSV:ActionGestion=
','Export Action Gestion','PR');
-insert into profile_menu(me_code,p_id,p_type_display,pm_default) values =
('CSV:ActionGestion',1,'P',0);
\ No newline at end of file
+insert into profile_menu(me_code,p_id,p_type_display,pm_default) values =
('CSV:ActionGestion',1,'P',0);
+
+
+ALTER TABLE document_type ADD COLUMN dt_prefix text;
+COMMENT ON COLUMN document_type.dt_prefix IS 'Prefix for ag_ref';
+
+update document_type set dt_prefix=3D upper(substr(replace(dt_value,' ',=
''),0,7))||dt_id::text=20
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 12:31:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdOZM-0002mx-R9
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 12:31:20 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat,  9 Jun 2012 18:23:00 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.178978.1339259480.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4877 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 16:31:20 -0000

Author: danydb
Date: 2012-06-09 18:22:59 +0200 (Sat, 09 Jun 2012)
New Revision: 4877

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_acc_payment.php
Log:
0000600: Dans moyen de paiement, ajouter acompte

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-09 16:1=
5:18 UTC (rev 4876)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-09 16:2=
2:59 UTC (rev 4877)
@@ -254,7 +254,7 @@
 	      }
 	    $nb++;
         }
-     =20
+
         if ( $nb =3D=3D 0 )
             throw new Exception(_('Il n\'y a aucune marchandise'),12);
=20
@@ -767,7 +767,7 @@
                 {
                     $poste_val=3D$sposte;
                 }
-               =20
+
                 $famount=3Dbcsub($cust_amount,$acompte);
                 $acc_pay->poste=3D$poste_val;
                 $acc_pay->qcode=3D$fqcode;
@@ -1510,13 +1510,13 @@
 		if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0 )
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
-            $r.=3DHtmlInput::hidden('acompte');
+            $r.=3DHtmlInput::hidden('acompte',$acompte);
             /* needed for generating a invoice */
             $r.=3DHtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_=
mp});
 			$fname =3D new Fiche($this->db);
 			$fname->get_by_qcode(${'e_mp_qcode_' . $e_mp});
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">' . "Pay=C3=A9 pa=
r " . ${'e_mp_qcode_' . $e_mp} .
-					" ".$fname->getName() ." ". _('D=C3=A9duction de ').h($acompte).'</=
h2></div>';
+					" ".$fname->getName() ." ". _('D=C3=A9duction acompte ').h($acompte=
).'</h2></div>';
             $r.=3D'<br>';
         }
         // check for upload piece

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-09 16:15:18=
 UTC (rev 4876)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-09 16:22:59=
 UTC (rev 4877)
@@ -216,7 +216,7 @@
         //------------------------------------------------------
         // The "Paid By"  check
         //------------------------------------------------------
-    =20
+
         if ($e_mp !=3D 0 ) {
             $this->check_payment($e_mp,${"e_mp_qcode_".$e_mp});
         }
@@ -889,14 +889,14 @@
         if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0=
 )
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
-            $r.=3DHtmlInput::hidden('acompte');
+            $r.=3DHtmlInput::hidden('acompte',$acompte);
             /* needed for generating a invoice */
             $r.=3DHtmlInput::hidden('qcode_benef',${'e_mp_qcode_'.$e_mp}=
);
=20
 			$fname=3Dnew Fiche($this->db);
 			$fname->get_by_qcode(${'e_mp_qcode_'.$e_mp});
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">'."Pay=C3=A9 par =
".${'e_mp_qcode_'.$e_mp}.
-				   " ".$fname->getName().' '._('D=C3=A9duction de ').h($acompte).'</=
h2></div>';
+				   " ".$fname->getName().' '._('D=C3=A9duction acompte ').h($acompte=
).'</h2></div>';
             $r.=3D'<br>';
         }
=20

Modified: phpcompta/trunk/include/class_acc_payment.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_payment.php	2012-06-09 16:15:18 UTC=
 (rev 4876)
+++ phpcompta/trunk/include/class_acc_payment.php	2012-06-09 16:22:59 UTC=
 (rev 4877)
@@ -227,7 +227,7 @@
     }
     /**
      *@deprecated
-     * @return string=20
+     * @return string
      */
     public function row_deprecated()
     {
@@ -329,14 +329,14 @@
         $r=3D'';
         $array=3D$this->get_valide();
         $r.=3DHtmlInput::hidden('gDossier',dossier::id());
-      =20
+
         if ( empty($array)=3D=3Dfalse ) {
             $acompte=3Dnew INum('acompte');
             $acompte->value=3D0;
-            $r.=3D_(" Montant =C3=A0 d=C3=A9duire");
+            $r.=3D_(" Acompte =C3=A0 d=C3=A9duire");
             $r.=3D$acompte->input();
         }
-       =20
+
         $r.=3D'<ol>';
         $r.=3D'<li ><input type=3D"radio" name=3D"e_mp" value=3D"0" chec=
ked>'._('Paiement encod=C3=A9 plus tard');
         if ( empty($array ) =3D=3D false )



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 09 18:24:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SdU4v-0002vg-LM
	for mharc-phpcompta-dev@gnu.org; Sat, 09 Jun 2012 18:24:17 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 10 Jun 2012 00:12:43 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.179292.1339280657.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4878 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 22:24:17 -0000

Author: danydb
Date: 2012-06-10 00:12:42 +0200 (Sun, 10 Jun 2012)
New Revision: 4878

Modified:
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/detail-action.php
Log:
Cosmetic: add new + document number=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-09 16:22:59 UTC (=
rev 4877)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-09 22:12:42 UTC (=
rev 4878)
@@ -118,6 +118,7 @@
 		{
 			$upd =3D false;
 			$readonly =3D false;
+			$this->ag_ref=3D_("Nouveau");
 		}
 		elseif ($p_view =3D=3D 'READ')
 		{

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-09 16:22:5=
9 UTC (rev 4877)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-09 22:12:4=
2 UTC (rev 4878)
@@ -12,6 +12,14 @@
=20
=20
         <table >
+			<tr>
+            <TD>
+	    <?=3D_('N=C2=B0 document')?>
+            </TD>
+            <TD style=3D"font-weight: bolder;" >
+              <?php echo $this->ag_id;?>
+            </TD>
+          </TR>
 			 <tr>
             <TD>
 	    <?=3D_('Reference')?>
@@ -21,6 +29,7 @@
               ?>
             </TD>
           </TR>
+
             <TD>
    <?=3D_('Date')?>
             </TD>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 11 16:59:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SeBhl-0000p1-EH
	for mharc-phpcompta-dev@gnu.org; Mon, 11 Jun 2012 16:59:17 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 11 Jun 2012 22:50:44 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.183868.1339448356.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4879 - in phpcompta/trunk: html html/js include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Jun 2012 20:59:15 -0000

Author: danydb
Date: 2012-06-11 22:50:43 +0200 (Mon, 11 Jun 2012)
New Revision: 4879

Added:
   phpcompta/trunk/include/template/document_mod_change.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/class_document_type.php
   phpcompta/trunk/include/template/list_category_document.php
Log:
Add #610 Modifier type de document

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-09 22:12:42 UTC (rev 4878)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-11 20:50:43 UTC (rev 4879)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  *   This file is part of PhpCompta.
  *
@@ -128,7 +127,7 @@
 </data>
 EOF;
 		break;
-	/* remove a cat of document */
+	/* rem a cat of document */
 	case 'rem_cat_doc':
 		require_once('class_document_type.php');
 		// if user can not return error message
@@ -171,6 +170,9 @@
 EOF;
 		return;
 		break;
+        case 'mod_cat_doc':
+	  require_once 'template/document_mod_change.php';
+	  break;
 	case 'dsp_tva':
 		$cn =3D new Database($gDossier);
 		$Res =3D $cn->exec_sql("select * from tva_rate order by tva_rate desc"=
);

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-09 22:12:42 UTC (rev 4878)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-11 20:50:43 UTC (rev 4879)
@@ -405,6 +405,33 @@
                  "ajax_misc.php" , {method:'get', parameters:queryString=
,onFailure:ajax_misc_failure,onSuccess:success_cat_doc_remove}
                  );
 }
+/**
+ *@brief change a document_modele
+ */
+function cat_doc_change(p_dt_id,p_dossier)
+{
+    var queryString=3D"gDossier=3D"+p_dossier+"&op=3Dmod_cat_doc"+"&dt_i=
d=3D"+p_dt_id;
+    var nTop=3Dcalcy(posY);
+    var nLeft=3D"200px";
+    var str_style=3D"top:"+nTop+"px;left:"+nLeft+";width:50em;height:aut=
o";
+
+    removeDiv('change_doc_div');
+    waiting_box();
+    var action =3D new Ajax.Request(
+				  "ajax_misc.php" ,=20
+				  {
+				      method:'get', parameters:queryString,
+				      onFailure:ajax_misc_failure,
+				      onSuccess:function(req){
+					  remove_waiting_box();
+					  add_div({id:'change_doc_div',style:str_style,cssclass:'inner_box'=
,drag:"1"});
+					  $('change_doc_div').innerHTML=3Dreq.responseText;
+
+				      }
+				  }
+				  );
+}
+
 function success_cat_doc_remove(req)
 {
     try
@@ -1179,6 +1206,10 @@
 	return str_style;
=20
 }
+/**
+ *@brief compute Y even if the windows has scrolled down or up
+ *@return the correct Y position
+ */
 function calcy(p_sy)
 {
 	var sy=3Dp_sy;

Modified: phpcompta/trunk/include/class_document_type.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_document_type.php	2012-06-09 22:12:42 U=
TC (rev 4878)
+++ phpcompta/trunk/include/class_document_type.php	2012-06-11 20:50:43 U=
TC (rev 4879)
@@ -64,13 +64,21 @@
             $tmp['dt_prefix']=3D$r[$i]['dt_prefix'];
=20
             $bt=3Dnew IButton('X'.$r[$i]['dt_id']);
+            $bt->label=3D_('Modifier');
+            $bt->javascript=3D"cat_doc_change('".$r[$i]['dt_id']."','".D=
ossier::id()."');";
+
+            $tmp['js_mod']=3D$bt->input();
+            $tmp['dt_id']=3D$r[$i]['dt_id'];
+
+            $bt=3Dnew IButton('X'.$r[$i]['dt_id']);
             $bt->label=3D_('Effacer');
             $bt->javascript=3D"if (confirm('"._('Vous confirmez')."')=3D=
=3Dtrue) {";
             $bt->javascript.=3D"cat_doc_remove('".$r[$i]['dt_id']."','".=
Dossier::id()."');";
             $bt->javascript.=3D'}';
+=20
+            $tmp['js_remove']=3D$bt->input();
=20
-            $tmp['js_remove']=3D$bt->input();
-            $tmp['dt_id']=3D$r[$i]['dt_id'];
+
             $array[$i]=3D$tmp;
         }
         return $array;

Added: phpcompta/trunk/include/template/document_mod_change.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/document_mod_change.php	            =
            (rev 0)
+++ phpcompta/trunk/include/template/document_mod_change.php	2012-06-11 2=
0:50:43 UTC (rev 4879)
@@ -0,0 +1,53 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/* !\file
+ * \brief this file respond to an ajax request to modify a type of docum=
ent
+ */
+require_once 'class_document_type.php';
+echo HtmlInput::title_box(_('Type de document'),'change_doc_div');
+?>
+<form method=3D"GET" id=3D"cat_doc_f" onsubmit=3D"cat_doc_change_record(=
'cat_doc_f');">
+<table>
+<tr>
+  <td> <?=3D_('Nom')?>
+  </td>
+  <td>
+  </td>
+</tr>
+
+<tr>
+  <td><?=3D_('Pr=C3=A9fixe')?>
+  </td>
+  <td>
+  </td>
+</tr>
+
+<tr>
+  <td><?=3D_('Prochain num=C3=A9ro')?>
+  </td>
+  <td>
+  </td>
+</tr>
+
+</table>
+
+  <? echo HtmlInput::submit("save",_('Sauver'));?>
+</form>
\ No newline at end of file

Modified: phpcompta/trunk/include/template/list_category_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/list_category_document.php	2012-06-0=
9 22:12:42 UTC (rev 4878)
+++ phpcompta/trunk/include/template/list_category_document.php	2012-06-1=
1 20:50:43 UTC (rev 4879)
@@ -15,8 +15,13 @@
 <?=3Dh($row['dt_prefix']);?>
 </td>
 <td>
+<?=3D$row['js_mod'];?>
+</td>
+<td>
 <?=3D$row['js_remove'];?>
 </td>
+
+
 </tr>
 <?
 endfor;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 12 14:50:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SeWAL-0006Bk-Qz
	for mharc-phpcompta-dev@gnu.org; Tue, 12 Jun 2012 14:50:09 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 12 Jun 2012 20:41:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.188226.1339527008.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4880 - in phpcompta/trunk: html/js include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jun 2012 18:50:08 -0000

Author: danydb
Date: 2012-06-12 20:41:28 +0200 (Tue, 12 Jun 2012)
New Revision: 4880

Modified:
   phpcompta/trunk/html/js/infobulle.js
   phpcompta/trunk/include/cat_document.inc.php
   phpcompta/trunk/include/class_document_type.php
   phpcompta/trunk/include/template/document_mod_change.php
Log:
0000610: Type de document : modification Libell?\195?\169, Pr?\195?\169fi=
xe et s?\195?\169quence

Modified: phpcompta/trunk/html/js/infobulle.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/infobulle.js	2012-06-11 20:50:43 UTC (rev 487=
9)
+++ phpcompta/trunk/html/js/infobulle.js	2012-06-12 18:41:28 UTC (rev 488=
0)
@@ -42,6 +42,7 @@
 content[12]=3D"Document g=C3=A9n=C3=A9r=C3=A9 uniquement si le mode de p=
aiement est utilis=C3=A9";
 content[13]=3D"Vous pouvez utiliser le % pour indiquer le poste parent";
 content[14]=3D"Attention, le poste comptable doit exister, il ne sera pa=
s v=C3=A9rifi=C3=A9";
+content[15]=3D"Laissez =C3=A0 0 pour ne rien changer";
=20
 function showBulle(p_ctl)
 {

Modified: phpcompta/trunk/include/cat_document.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/cat_document.inc.php	2012-06-11 20:50:43 UTC =
(rev 4879)
+++ phpcompta/trunk/include/cat_document.inc.php	2012-06-12 18:41:28 UTC =
(rev 4880)
@@ -33,6 +33,20 @@
     $catDoc=3Dnew Document_Type($cn);
     $catDoc->insert($_POST['cat'],$_POST['prefix']);
 }
+if ( isset($_POST['save'])) {
+	$catDoc=3Dnew Document_Type($cn,$_POST['dt_id']);
+	$catDoc->get();
+	$catDoc->dt_value=3Dtrim($_POST['dt_name']);
+	$catDoc->dt_prefix=3Dtrim($_POST['dt_prefix']);
+	if ( $catDoc->dt_value=3D=3D"") {
+		alert(_("Le nom ne peut pas =C3=AAtre vide"));
+	} else {
+		$catDoc->update();
+	}
+	if ($_POST['seq'] !=3D 0 && isNumber($_POST['seq'])=3D=3D1){
+		$catDoc->set_number($_POST['seq']);
+	}
+}
 $aList=3DDocument_Type::get_list($cn);
 $addCat=3Dnew IText('cat');
 $addPrefix=3Dnew IText('prefix');

Modified: phpcompta/trunk/include/class_document_type.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_document_type.php	2012-06-11 20:50:43 U=
TC (rev 4879)
+++ phpcompta/trunk/include/class_document_type.php	2012-06-12 18:41:28 U=
TC (rev 4880)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -15,87 +16,124 @@
  *   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-130=
7  USA
-*/
+ */
 /* $Revision$ */
+
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/*! \file
+/* ! \file
  * \brief  class for the table document_type
  */
=20
-/*! \brief class for the table document_type
- *< dt_id pk document_type
- *< dt_value value
+/* ! \brief class for the table document_type
+ * < dt_id pk document_type
+ * < dt_value value
  */
 class Document_type
 {
-    /*! document_type
-    * \brief constructor
-    * \param $p_cn database connx
-    */
-    function document_type($p_cn)
-    {
-        $this->db=3D$p_cn;
-        $this->dt_id=3D-1;
-    }
-    /*!
-     * \brief Get all the data for this dt_id
-     */
-    function get()
-    {
-        $sql=3D"select * from document_type where dt_id=3D$1";
-        $R=3D$this->db->exec_sql($sql,array($this->dt_id));
-        $r=3DDatabase::fetch_array($R,0);
-        $this->dt_id=3D$r['dt_id'];
-        $this->dt_value=3D$r['dt_value'];
-    }
-    /**
-     *@brief get a list
-     *@parameter $p_cn database connection
-     *@return array of data from document_type
-     */
-    static function get_list($p_cn)
-    {
-        $sql=3D"select * from document_type order by dt_value";
-        $r=3D$p_cn->get_array($sql);
-        $array=3Darray();
-        for ($i=3D0;$i<count($r);$i++)
-        {
-            $tmp['dt_value']=3D$r[$i]['dt_value'];
-            $tmp['dt_prefix']=3D$r[$i]['dt_prefix'];
+	/* ! document_type
+	 * \brief constructor
+	 * \param $p_cn database connx
+	 */
=20
-            $bt=3Dnew IButton('X'.$r[$i]['dt_id']);
-            $bt->label=3D_('Modifier');
-            $bt->javascript=3D"cat_doc_change('".$r[$i]['dt_id']."','".D=
ossier::id()."');";
+	function document_type($p_cn, $p_id =3D -1)
+	{
+		$this->db =3D $p_cn;
+		$this->dt_id =3D $p_id;
+	}
=20
-            $tmp['js_mod']=3D$bt->input();
-            $tmp['dt_id']=3D$r[$i]['dt_id'];
+	/* !
+	 * \brief Get all the data for this dt_id
+	 */
=20
-            $bt=3Dnew IButton('X'.$r[$i]['dt_id']);
-            $bt->label=3D_('Effacer');
-            $bt->javascript=3D"if (confirm('"._('Vous confirmez')."')=3D=
=3Dtrue) {";
-            $bt->javascript.=3D"cat_doc_remove('".$r[$i]['dt_id']."','".=
Dossier::id()."');";
-            $bt->javascript.=3D'}';
-=20
-            $tmp['js_remove']=3D$bt->input();
+	function get()
+	{
+		$sql =3D "select * from document_type where dt_id=3D$1";
+		$R =3D $this->db->exec_sql($sql, array($this->dt_id));
+		if (count($R) =3D=3D 0) return 1;
+		$r =3D Database::fetch_array($R, 0);
+		$this->dt_id =3D $r['dt_id'];
+		$this->dt_value =3D $r['dt_value'];
+		$this->dt_prefix =3D $r['dt_prefix'];
+		return 0;
+	}
=20
+	/**
+	 * @brief get a list
+	 * @parameter $p_cn database connection
+	 * @return array of data from document_type
+	 */
+	static function get_list($p_cn)
+	{
+		$sql =3D "select * from document_type order by dt_value";
+		$r =3D $p_cn->get_array($sql);
+		$array =3D array();
+		for ($i =3D 0; $i < count($r); $i++)
+		{
+			$tmp['dt_value'] =3D $r[$i]['dt_value'];
+			$tmp['dt_prefix'] =3D $r[$i]['dt_prefix'];
=20
-            $array[$i]=3D$tmp;
-        }
-        return $array;
-    }
-    function insert($p_value,$p_prefix)
-    {
-        $sql=3D"insert into document_type(dt_value,dt_prefix) values ($1=
,$2)";
-        try
-        {
-            if( $this->db->count_sql('select * from document_type where =
upper(dt_value)=3Dupper(trim($1))',array($p_value))>0)
-                throw new Exception('Nom en double');
-            if ( strlen(trim($p_value))>0)
-                $this->db->exec_sql($sql,array($p_value,$p_prefix));
-        }
-        catch (Exception $e)
-        {
-            alert(j(_("Impossible d'ajouter [$p_value] ").$e->getMessage=
()));
-        }
-    }
+			$bt =3D new IButton('X' . $r[$i]['dt_id']);
+			$bt->label =3D _('Modifier');
+			$bt->javascript =3D "cat_doc_change('" . $r[$i]['dt_id'] . "','" . Do=
ssier::id() . "');";
+
+			$tmp['js_mod'] =3D $bt->input();
+			$tmp['dt_id'] =3D $r[$i]['dt_id'];
+
+			$bt =3D new IButton('X' . $r[$i]['dt_id']);
+			$bt->label =3D _('Effacer');
+			$bt->javascript =3D "if (confirm('" . _('Vous confirmez') . "')=3D=3D=
true) {";
+			$bt->javascript.=3D"cat_doc_remove('" . $r[$i]['dt_id'] . "','" . Dos=
sier::id() . "');";
+			$bt->javascript.=3D'}';
+
+			$tmp['js_remove'] =3D $bt->input();
+
+
+			$array[$i] =3D $tmp;
+		}
+		return $array;
+	}
+
+	function insert($p_value, $p_prefix)
+	{
+		$sql =3D "insert into document_type(dt_value,dt_prefix) values ($1,$2)=
";
+		try
+		{
+			if ($this->db->count_sql('select * from document_type where upper(dt_=
value)=3Dupper(trim($1))', array($p_value)) > 0)
+				throw new Exception('Nom en double');
+			if (strlen(trim($p_value)) > 0)
+				$this->db->exec_sql($sql, array($p_value, $p_prefix));
+		}
+		catch (Exception $e)
+		{
+			alert(j(_("Impossible d'ajouter [$p_value] ") . $e->getMessage()));
+		}
+	}
+
+	/**
+	 * Update
+	 */
+	function update()
+	{
+		try
+		{
+			$this->db->exec_sql("update document_type set dt_value=3D$1,dt_prefix=
=3D$2 where dt_id=3D$3", array($this->dt_value,
+				$this->dt_prefix, $this->dt_id));
+		}
+		catch (Exception $e)
+		{
+			alert(" Erreur " . $e->getMessage());
+		}
+	}
+
+	function set_number($p_int)
+	{
+		try
+		{
+			$this->db->exec_sql("alter sequence seq_doc_type_" . $this->dt_id . "=
 restart " . $p_int);
+		}
+		catch (Exception $e)
+		{
+			alert("Erreur " . $e->getMessage());
+		}
+	}
 }

Modified: phpcompta/trunk/include/template/document_mod_change.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/document_mod_change.php	2012-06-11 2=
0:50:43 UTC (rev 4879)
+++ phpcompta/trunk/include/template/document_mod_change.php	2012-06-12 1=
8:41:28 UTC (rev 4880)
@@ -23,13 +23,21 @@
  */
 require_once 'class_document_type.php';
 echo HtmlInput::title_box(_('Type de document'),'change_doc_div');
+
+$doc_type=3Dnew Document_type($cn,$dt_id);
+$doc_type->get();
 ?>
-<form method=3D"GET" id=3D"cat_doc_f" onsubmit=3D"cat_doc_change_record(=
'cat_doc_f');">
+<form method=3D"POST" id=3D"cat_doc_f" onsubmit=3D"cat_doc_change_record=
('cat_doc_f');">
+	<?=3DHtmlInput::request_to_hidden(array("ac","gDossier","dt_id"))?>
 <table>
 <tr>
   <td> <?=3D_('Nom')?>
   </td>
   <td>
+	  <?
+	  $name=3Dnew IText('dt_name',$doc_type->dt_value);
+	  echo $name->input();
+	  ?>
   </td>
 </tr>
=20
@@ -37,14 +45,40 @@
   <td><?=3D_('Pr=C3=A9fixe')?>
   </td>
   <td>
+	  <?
+	  $prefix=3Dnew IText('dt_prefix',$doc_type->dt_prefix);
+	  echo $prefix->input();
+	  ?>
   </td>
 </tr>
=20
 <tr>
-  <td><?=3D_('Prochain num=C3=A9ro')?>
+  <td><?=3D_('num=C3=A9ro actuel')?>
   </td>
   <td>
+	<?
+	$ret=3D $cn->get_array("select last_value,is_called from seq_doc_type_"=
.$doc_type->dt_id) ;
+
+    $last=3D$ret[0]['last_value'];
+             /*!
+                  *\note  With PSQL sequence , the last_value column is =
1 when before   AND after the first call, to make the difference between =
them
+                  * I have to check whether the sequence has been alread=
y called or not */
+    if ($ret[0]['is_called']=3D=3D'f' ) $last--;
+	echo $last;
+	?>
   </td>
+  <tr>
+  <td><?=3D_('Prochain num=C3=A9ro')?>
+	  <?=3D
+		HtmlInput::infobulle(15);
+	?>
+  </td>
+   <td>
+	  <?
+	  $seq=3Dnew INum('seq',0);
+	  echo $seq->input();
+	  ?>
+  </td>
 </tr>
=20
 </table>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 12 14:50:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SeWAj-0006UX-Ui
	for mharc-phpcompta-dev@gnu.org; Tue, 12 Jun 2012 14:50:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 12 Jun 2012 20:41:58 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.188227.1339527033.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4881 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jun 2012 18:50:32 -0000

Author: danydb
Date: 2012-06-12 20:41:57 +0200 (Tue, 12 Jun 2012)
New Revision: 4881

Modified:
   phpcompta/trunk/include/ac_common.php
Log:
Documentation

Modified: phpcompta/trunk/include/ac_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ac_common.php	2012-06-12 18:41:28 UTC (rev 48=
80)
+++ phpcompta/trunk/include/ac_common.php	2012-06-12 18:41:57 UTC (rev 48=
81)
@@ -184,8 +184,8 @@
     return $l_mkdate - $l2_mkdate;
 }
=20
-/* !
- * \brief check if the argument is a number
+/***!
+ * @brief check if the argument is a number
  *
  * \param $p_int number to test
  *
@@ -193,7 +193,6 @@
  *        - 1 it's a number
  *        - 0 it is not
  */
-
 function isNumber(&$p_int)
 {
     if (strlen(trim($p_int)) =3D=3D 0)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 12 17:08:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SeYK0-0003cB-7t
	for mharc-phpcompta-dev@gnu.org; Tue, 12 Jun 2012 17:08:16 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 12 Jun 2012 22:59:36 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.188472.1339535295.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4882 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jun 2012 21:08:15 -0000

Author: danydb
Date: 2012-06-12 22:59:36 +0200 (Tue, 12 Jun 2012)
New Revision: 4882

Modified:
   phpcompta/trunk/include/class_itva_popup.php
Log:
typo

Modified: phpcompta/trunk/include/class_itva_popup.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_itva_popup.php	2012-06-12 18:41:57 UTC =
(rev 4881)
+++ phpcompta/trunk/include/class_itva_popup.php	2012-06-12 20:59:36 UTC =
(rev 4882)
@@ -139,7 +139,8 @@
     public function display()
     {
         $r=3D'<input text name=3D"%s" value=3D"%s" id=3D"%s" disabled>';
-        $res=3Dsprinf($r,$this->name,$this->value,$this->name);
+
+		$res=3Dsprintf($r,$this->name,$this->value,$this->name);
         return $res;
     }
     /**



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 12 18:30:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SeZbM-0003zF-5q
	for mharc-phpcompta-dev@gnu.org; Tue, 12 Jun 2012 18:30:16 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 00:21:33 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.188616.1339540215.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4883 - in phpcompta/trunk: html include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jun 2012 22:30:14 -0000

Author: danydb
Date: 2012-06-13 00:21:33 +0200 (Wed, 13 Jun 2012)
New Revision: 4883

Added:
   phpcompta/trunk/include/template/user_sec_profile.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/show_document.php
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/ajax_get_profile.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/class_profile_menu.php
   phpcompta/trunk/include/class_user.php
   phpcompta/trunk/include/profile.inc.php
   phpcompta/trunk/include/template/detail-action.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000601: Action gestion : s?\195?\169curit?\195?\169

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-12 20:59:36 UTC (rev 4882)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-12 22:21:33 UTC (rev 4883)
@@ -63,6 +63,8 @@
 $user->check(true);
 $user->check_dossier($gDossier, true);
 $html =3D var_export($_REQUEST, true);
+global $g_user;
+$g_user=3D$user;
 switch ($op)
 {
 	case "remove_anc":

Modified: phpcompta/trunk/html/show_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/show_document.php	2012-06-12 20:59:36 UTC (rev 4=
882)
+++ phpcompta/trunk/html/show_document.php	2012-06-12 22:21:33 UTC (rev 4=
883)
@@ -58,10 +58,11 @@
         print $json;
     }
 }
-/* remove the operation */
+/* remove the operation from action_gestion_operation*/
 if ( $action =3D=3D 'rmop' )
 {
-    if ($User->check_action(RMDOC)=3D=3D1)
+	$dt_id=3D$cn->get_value("select ag_id from action_gestion_operation whe=
re ago_id=3D$1",$_REQUEST['id']);
+    if ($User->check_action(RMDOC)=3D=3D1 && $User->can_write_action($dt=
_id)=3D=3Dtrue)
     {
 		$cn->exec_sql("delete from action_gestion_operation where ago_id=3D$1"=
,
 				array($_REQUEST['id']));
@@ -70,10 +71,11 @@
         print $json;
     }
 }
-/* remove the comment*/
+/* remove the comment from action_gestion_operation*/
 if ( $action =3D=3D 'rmcomment' )
 {
-    if ($User->check_action(RMDOC)=3D=3D1)
+	$dt_id=3D$cn->get_value("select ag_id from action_gestion_comment where=
 agc_id=3D$1",$_REQUEST['id']);
+    if ($User->check_action(RMDOC)=3D=3D1 && $User->can_write_action($dt=
_id)=3D=3Dtrue)
     {
 		$cn->exec_sql("delete from action_gestion_comment where agc_id=3D$1",
 				array($_REQUEST['id']));
@@ -82,10 +84,10 @@
         print $json;
     }
 }
-/* remove the action*/
+/* remove the action from action_gestion_operation*/
 if ( $action =3D=3D 'rmaction' )
 {
-    if ($User->check_action(RMDOC)=3D=3D1)
+    if ($User->check_action(RMDOC)=3D=3D1 && $User->can_write_action($_R=
EQUEST['id']) =3D=3D true && $User->can_write_action($_REQUEST['ag_id'])=3D=
=3D true )
     {
 		$cn->exec_sql("delete from action_gestion_related where aga_least=3D$1=
 and aga_greatest=3D$2",
 				array($_REQUEST['id'],$_REQUEST['ag_id']));

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-12 20:59:36 UTC=
 (rev 4882)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-12 22:21:33 UTC=
 (rev 4883)
@@ -1,232 +1,252 @@
 <?php
-  /*
-   *   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-1=
307  USA
-   */
-  /* $Revision$ */
=20
-  // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
=20
-  /*!\file
-   * \brief this file is common to suivi client, suivi fournisseur, suiv=
i
-   * administration.
-   * The needed variables are
-   * - $cn for the database connection
-   * - $sub_action sa from suivi courrier but sc from Suivi client, four=
nisseur...
-   *
-   */
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
=20
-$supl_hidden=3D'';
-if( isset($_REQUEST['sc']))
-  $supl_hidden.=3DHtmlInput::hidden('sc',$_REQUEST['sc']);
-if( isset($_REQUEST['f_id']))
-  $supl_hidden.=3DHtmlInput::hidden('f_id',$_REQUEST['f_id']);
-if( isset($_REQUEST['sb']))
-  $supl_hidden.=3DHtmlInput::hidden('sb',$_REQUEST['sb']);
-  $supl_hidden.=3DHtmlInput::hidden('ac',$_REQUEST['ac']);
+/* !\file
+ * \brief this file is common to suivi client, suivi fournisseur, suivi
+ * administration.
+ * The needed variables are
+ * - $cn for the database connection
+ * - $sub_action sa from suivi courrier but sc from Suivi client, fourni=
sseur...
+ *
+ */
=20
+$supl_hidden =3D '';
+if (isset($_REQUEST['sc']))
+	$supl_hidden.=3DHtmlInput::hidden('sc', $_REQUEST['sc']);
+if (isset($_REQUEST['f_id']))
+	$supl_hidden.=3DHtmlInput::hidden('f_id', $_REQUEST['f_id']);
+if (isset($_REQUEST['sb']))
+	$supl_hidden.=3DHtmlInput::hidden('sb', $_REQUEST['sb']);
+$supl_hidden.=3DHtmlInput::hidden('ac', $_REQUEST['ac']);
=20
-/*----------------------------------------------------------------------=
----- */
+
+/* ---------------------------------------------------------------------=
------ */
 /* We ask to generate the document */
-/*----------------------------------------------------------------------=
----- */
-if ( isset($_POST['generate']))
-  {
-    $act=3Dnew Follow_Up($cn);
-    $act->fromArray($_POST);
-    if ($act->ag_id =3D=3D 0 )
-      {
-        $act->save();
-        $ag_id=3D$act->ag_id;
-
-      }
-    else
-      {
-        $act->Update();
-      }
-    $act->generate_document($_POST['doc_mod'],$_POST);
-    $sub_action=3D'detail';
-  }
+/* ---------------------------------------------------------------------=
------ */
+if (isset($_POST['generate']))
+{
+	$act =3D new Follow_Up($cn);
+	$act->fromArray($_POST);
+	if ($act->ag_id =3D=3D 0)
+	{
+		$act->save();
+		$ag_id =3D $act->ag_id;
+	}
+	else
+	{
+		$act->Update();
+	}
+	$act->generate_document($_POST['doc_mod'], $_POST);
+	$sub_action =3D 'detail';
+}
 /* for delete  */
-if ( isset($_POST['delete'] )) $sub_action=3D'delete';
-if ( $sub_action =3D=3D "" ) $sub_action=3D"list";
+if (isset($_POST['delete']))
+	$sub_action =3D 'delete';
+if ($sub_action =3D=3D "")
+	$sub_action =3D "list";
=20
 // if correction is asked go to directly to add_action
-if (isset($_POST['corr'] ))
-  {
-    $ag_comment=3Durldecode($_POST['ag_comment']);
-    $sub_action=3D"add_action";
-  }
+if (isset($_POST['corr']))
+{
+	$ag_comment =3D urldecode($_POST['ag_comment']);
+	$sub_action =3D "add_action";
+}
 // if this page is called from another menu (customer, supplier,...)
 // a button back is added
-
-
 //----------------------------------------------------------------------
 // Update the detail
 // Add a new action related to this one or update
 //----------------------------------------------------------------------
-if ( $sub_action=3D=3D"update" )
-  {
-    // Update the modification
-    if ( isset($_POST['save']))
-      {
-        $act2=3Dnew Follow_Up($cn);
-        $act2->fromArray($_POST );
-		 $sub_action=3D"detail";
-		 put_global(array(array('key'=3D>"sa","value"=3D>"detail")));
-         $act2->Update();
-      }
-    //------------------------------------------------------------------=
----
-    // Add a related action
-    //------------------------------------------------------------------=
----
-    if ( isset ($_POST['add_action_here']) )
-      {
-        $act=3Dnew Follow_Up($cn);
+if ($sub_action =3D=3D "update")
+{
+	// Update the modification
+	if (isset($_POST['save']))
+	{
+		$act2 =3D new Follow_Up($cn);
+		$act2->fromArray($_POST);
+		$sub_action =3D "detail";
+		put_global(array(array('key' =3D> "sa", "value" =3D> "detail")));
+		if ($g_user->can_write_action($act2->ag_id))
+		{
+			$act2->Update();
+		}
+		else
+		{
+			echo '<div class=3D"redcontent">';
+			echo '<h2 class=3D"error"> Cette action ne vous est pas autoris=C3=A9=
e Contactez votre responsable</h2>';
+			echo '</div>';
+			exit();
+		}
+	}
+	//---------------------------------------------------------------------=
-
+	// Add a related action
+	//---------------------------------------------------------------------=
-
+	if (isset($_POST['add_action_here']))
+	{
+		$act =3D new Follow_Up($cn);
=20
=20
-        //----------------------------------------
-        // puis comme ajout normal (copier / coller )
-        $act->fromArray($_POST);
-        $act->ag_id=3D0;
-        $act->d_id=3D0;
-        $act->action=3D$_POST['ag_id'];
+		//----------------------------------------
+		// puis comme ajout normal (copier / coller )
+		$act->fromArray($_POST);
+		$act->ag_id =3D 0;
+		$act->d_id =3D 0;
+		$act->action =3D $_POST['ag_id'];
=20
-        echo '<div class=3D"content">';
+		echo '<div class=3D"content">';
=20
-        // Add hidden tag
-        echo '<form  enctype=3D"multipart/form-data" action=3D"do.php" m=
ethod=3D"post"">';
+		// Add hidden tag
+		echo '<form  enctype=3D"multipart/form-data" action=3D"do.php" method=3D=
"post"">';
=20
-        $act->ag_comment=3D"";
-        if (isset($_REQUEST['qcode_dest'])) $act->qcode_dest=3D$_REQUEST=
['qcode_dest'];
-        echo $act->Display('NEW',false,$base,$retour);
+		$act->ag_comment =3D "";
+		if (isset($_REQUEST['qcode_dest']))
+			$act->qcode_dest =3D $_REQUEST['qcode_dest'];
+		echo $act->Display('NEW', false, $base, $retour);
=20
-        echo '<input type=3D"hidden" name=3D"ac" value=3D"'.$_REQUEST['a=
c'].'">';
-        echo '<input type=3D"hidden" name=3D"sa" value=3D"save_action_st=
2">';
-        echo '<input type=3D"submit" class=3D"button" name=3D"save_actio=
n_st2" value=3D"'._('Enregistrer').'">';
-        echo '<input type=3D"submit" class=3D"button" name=3D"generate" =
value=3D"'._('G=C3=A9n=C3=A8re le document').'"></p>';
-        echo $supl_hidden;
-        echo '</form>';
-        echo '</div>';
-
-      }
-
-
-  }
+		echo '<input type=3D"hidden" name=3D"ac" value=3D"' . $_REQUEST['ac'] =
. '">';
+		echo '<input type=3D"hidden" name=3D"sa" value=3D"save_action_st2">';
+		echo '<input type=3D"submit" class=3D"button" name=3D"save_action_st2"=
 value=3D"' . _('Enregistrer') . '">';
+		echo '<input type=3D"submit" class=3D"button" name=3D"generate" value=3D=
"' . _('G=C3=A9n=C3=A8re le document') . '"></p>';
+		echo $supl_hidden;
+		echo '</form>';
+		echo '</div>';
+	}
+}
 //----------------------------------------------------------------------=
----------
 // Show the detail of an action
 // permit the update
-if ( $sub_action=3D=3D'detail' )
-  {
-    echo '<div class=3D"content">';
-    $act=3Dnew Follow_Up($cn);
-    $act->ag_id=3D$ag_id;
-	$act->suppress=3D1;
-    echo $act->get();
-//    $act->ag_comment=3DDecode($act->ag_comment);
-    echo '<form  enctype=3D"multipart/form-data"  class=3D"print" action=
=3D"do.php"  method=3D"post"   >';
-    echo $supl_hidden;
-    echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-    echo dossier::hidden();
-    echo $act->Display('UPD',false,$base,$retour);
-    echo '<input type=3D"hidden" name=3D"sa" value=3D"update">';
-    echo HtmlInput::submit("save","Sauve");
-    echo HtmlInput::submit("add_action_here",_("Ajoute une action =C3=A0=
 celle-ci"));
-    echo HtmlInput::submit("delete",_("Efface cette action"),' onclick=3D=
"return confirm(\''._("Vous confirmez l\'effacement").'\')" ');
-	echo $retour;
-    echo '</form>';
-    echo '</div>';
+if ($sub_action =3D=3D 'detail')
+{
+	echo '<div class=3D"content">';
+	$act =3D new Follow_Up($cn);
+	$act->ag_id =3D $ag_id;
=20
-  }
+	echo $act->get();
+	if ($g_user->can_write_action($ag_id) =3D=3D true)
+	{
+		echo '<form  enctype=3D"multipart/form-data"  class=3D"print" action=3D=
"do.php"  method=3D"post"   >';
+		echo $supl_hidden;
+		echo HtmlInput::hidden('ac', $_REQUEST['ac']);
+		echo dossier::hidden();
+		echo $act->Display('UPD', false, $base, $retour);
+		echo '<input type=3D"hidden" name=3D"sa" value=3D"update">';
+		echo HtmlInput::submit("save", "Sauve");
+		echo HtmlInput::submit("add_action_here", _("Ajoute une action =C3=A0 =
celle-ci"));
+		echo HtmlInput::submit("delete", _("Efface cette action"), ' onclick=3D=
"return confirm(\'' . _("Vous confirmez l\'effacement") . '\')" ');
+		echo $retour;
+		echo '</form>';
+	}
+	else if ($g_user->can_read_action($ag_id) =3D=3D true)
+	{
+		echo $act->Display('READ', false, $base, $retour);
+	}
+	else
+	{
+		echo h2info(_("Ce document n'est pas accessible"));
+		exit();
+	}
+
+
+	echo '</div>';
+}
 //----------------------------------------------------------------------=
---------
 // Delete an action
-if ( $sub_action =3D=3D 'delete' )
-  {
-    // confirmed
-    $cn->start();
-    $act=3Dnew Follow_Up($cn);
-    $act->ag_id=3D$_REQUEST['ag_id'];
-    $act->get();
-    $act->remove();
-    $sub_action=3D"list";
-    $cn->commit();
-    Follow_Up::ShowActionList($cn,$base);
-    if ( isset( $act->ag_ref) )
-      echo hb(_('Action ').$act->ag_ref._(' effac=C3=A9e'));
-    exit();
-  }
+if ($sub_action =3D=3D 'delete')
+{
+	// confirmed
+	$cn->start();
+	$act =3D new Follow_Up($cn);
+	$act->ag_id =3D $_REQUEST['ag_id'];
+	$act->get();
+	if ($g_user->can_write_action($_REQUEST['ag_id'])=3D=3Dtrue)	$act->remo=
ve();
+	$sub_action =3D "list";
+	$cn->commit();
+	Follow_Up::ShowActionList($cn, $base);
+	if (isset($act->ag_ref))
+		echo hb(_('Action ') . $act->ag_ref . _(' effac=C3=A9e'));
+	exit();
+}
=20
 //----------------------------------------------------------------------=
----------
 // Show a list of the action
-if ( $sub_action =3D=3D "list" )
-  {
-    Follow_Up::ShowActionList($cn,$base);
+if ($sub_action =3D=3D "list")
+{
+	Follow_Up::ShowActionList($cn, $base);
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
-	echo HtmlInput::request_to_hidden(array("sag_ref","only_internal","stat=
e","gDossier","qcode","start_date","end_date","ag_id","ag_dest_query",
-			"tdoc","see_all","all_action","query"));
+	echo HtmlInput::request_to_hidden(array("sag_ref", "only_internal", "st=
ate", "gDossier", "qcode", "start_date", "end_date", "ag_id", "ag_dest_qu=
ery",
+		"tdoc", "see_all", "all_action", "query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");
 	echo "</form>";
-  }
+}
 //----------------------------------------------------------------------=
----------
 // Add an action
-if ( $sub_action =3D=3D "add_action" )
-  {
-    $act=3Dnew Follow_Up($cn);
-    $act->fromArray($_POST );
-    $act->ag_id=3D0;
-    $act->d_id=3D0;
-    echo '<div class=3D"content">';
-    // Add hidden tag
-    echo '<form method=3D"post" action=3D"do.php" name=3D"form_add" id=3D=
"form_add" enctype=3D"multipart/form-data" >';
-    echo $supl_hidden;
-    echo dossier::hidden();
+if ($sub_action =3D=3D "add_action")
+{
+	$act =3D new Follow_Up($cn);
+	$act->fromArray($_POST);
+	$act->ag_id =3D 0;
+	$act->d_id =3D 0;
+	echo '<div class=3D"content">';
+	// Add hidden tag
+	echo '<form method=3D"post" action=3D"do.php" name=3D"form_add" id=3D"f=
orm_add" enctype=3D"multipart/form-data" >';
+	echo $supl_hidden;
+	echo dossier::hidden();
=20
=20
-    $act->ag_comment=3D(isset($_POST['ag_comment']))?Decode($_POST['ag_c=
omment']):"";
-    if (isset($_REQUEST['qcode'])) $act->qcode_dest=3D$_REQUEST['qcode']=
;
-    echo $act->Display('NEW',false,$base,$retour);
+	$act->ag_comment =3D (isset($_POST['ag_comment'])) ? Decode($_POST['ag_=
comment']) : "";
+	if (isset($_REQUEST['qcode']))
+		$act->qcode_dest =3D $_REQUEST['qcode'];
+	echo $act->Display('NEW', false, $base, $retour);
=20
-    echo '<input type=3D"hidden" name=3D"ac" value=3D"'.$_REQUEST["ac"].=
'">';
-    echo '<input type=3D"hidden" name=3D"sa" value=3D"save_action_st2">'=
;
-    echo '<input type=3D"hidden" name=3D"save_action_st2" value=3D"save_=
action_st2">';
-    echo '<input type=3D"submit" class=3D"button" name=3D"save_action_st=
2" value=3D"'._('Enregistrer').'">';
-    echo '</form>';
+	echo '<input type=3D"hidden" name=3D"ac" value=3D"' . $_REQUEST["ac"] .=
 '">';
+	echo '<input type=3D"hidden" name=3D"sa" value=3D"save_action_st2">';
+	echo '<input type=3D"hidden" name=3D"save_action_st2" value=3D"save_act=
ion_st2">';
+	echo '<input type=3D"submit" class=3D"button" name=3D"save_action_st2" =
value=3D"' . _('Enregistrer') . '">';
+	echo '</form>';
=20
-    echo   '</div>';
-  }
+	echo '</div>';
+}
 //----------------------------------------------------------------------=
----------
 // Save Follow_Up
 // Stage 2 : Save the action + Files and generate eventually a document
 //----------------------------------------------------------------------=
----------
-if  ( $sub_action =3D=3D "save_action_st2" )
-  {
-    $act=3Dnew Follow_Up($cn);
-    $act->fromArray($_POST);
-    $act->d_id=3D0;
-    $act->md_id=3D(isset($_POST['gen_doc']))?$_POST['gen_doc']:0;
+if ($sub_action =3D=3D "save_action_st2")
+{
+	$act =3D new Follow_Up($cn);
+	$act->fromArray($_POST);
+	$act->d_id =3D 0;
+	$act->md_id =3D (isset($_POST['gen_doc'])) ? $_POST['gen_doc'] : 0;
=20
-    // insert into action_gestion
-    echo $act->save();
-    $url=3D"?$base&sa=3Ddetail&ag_id=3D".$act->ag_id.'&'.dossier::get();
-    echo '<p><a class=3D"mtitle" href=3D"'.$url.'">'.hb('Action Sauv=C3=A9=
e  : '.$act->ag_ref).'</a></p>';
+	// insert into action_gestion
+	echo $act->save();
+	$url =3D "?$base&sa=3Ddetail&ag_id=3D" . $act->ag_id . '&' . dossier::g=
et();
+	echo '<p><a class=3D"mtitle" href=3D"' . $url . '">' . hb('Action Sauv=C3=
=A9e  : ' . $act->ag_ref) . '</a></p>';
=20
-
-    Follow_Up::ShowActionList($cn,$base);
-    $url=3D"?$base&sa=3Ddetail&ag_id=3D".$act->ag_id.'&'.dossier::get();
-    echo '<p><a class=3D"mtitle" href=3D"'.$url.'">'.hb('Action Sauv=C3=A9=
e  : '.$act->ag_ref).'</a></p>';
-  }
+	Follow_Up::ShowActionList($cn,$base);
+	$url =3D "?$base&sa=3Ddetail&ag_id=3D" . $act->ag_id . '&' . dossier::g=
et();
+	echo '<p><a class=3D"mtitle" href=3D"' . $url . '">' . hb('Action Sauv=C3=
=A9e  : ' . $act->ag_ref) . '</a></p>';
+}
 ?>
=20

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-12 20:59:36 UTC =
(rev 4882)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-12 22:21:33 UTC =
(rev 4883)
@@ -34,7 +34,7 @@
 $add_one=3DHtmlInput::button("add", "Ajout Menu","onclick=3D\"add_menu({=
dossier:$gDossier,p_id:$p_id})\"")
 ?>
 <hr>
-<h1>Profile <?=3D$profile->p_name?></h1>
+<h1>Profil <?=3D$profile->p_name?></h1>
=20
 <?
 $id=3DHtmlInput::hidden('p_id',$profile->p_id);
@@ -79,8 +79,9 @@
 	$profile_menu->listing_profile($p_id);
 	echo "<h2>Impression</h2>";
 	$profile_menu->printing($p_id);
-
 	echo $add_one;
+	echo "<h2>Action gestion accessible</h2>";
+	$profile_menu->available_profile($p_id);
 }
 ?>
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-12 20:59:36 UTC (=
rev 4882)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-12 22:21:33 UTC (=
rev 4883)
@@ -87,9 +87,24 @@
 	function __construct($p_cn)
 	{
 		$this->db =3D $p_cn;
+		$this->ag_id=3D0;
 		$this->f_id =3D 0;
 	}
-
+	static function sql_security_filter($cn,$p_mode)
+	{
+		global $g_user;
+		$profile=3D$cn->get_value("select p_id from profile_user where user_na=
me=3D$1",array($g_user->login));
+		if ($profile =3D=3D '') die ("Security");
+		if ($p_mode =3D=3D 'R')
+		{
+			$sql=3D" (ag_dest in (select p_granted from user_sec_action_profile w=
here p_id=3D$profile ) ) ";
+		}
+		if ($p_mode =3D=3D 'W')
+		{
+			$sql=3D" ( ag_dest in (select p_granted from user_sec_action_profile =
where p_id=3D$profile and ua_right=3D'W' ) )";
+		}
+		return $sql;
+	}
 	//---------------------------------------------------------------------=
-
 	/* !
 	 * \brief Display the object, the tags for the FORM
@@ -109,6 +124,7 @@
 	 */
 	function Display($p_view, $p_gen, $p_base, $retour =3D "")
 	{
+		global $g_user;
 		if ($p_view =3D=3D 'UPD')
 		{
 			$upd =3D true;
@@ -132,12 +148,12 @@
 		// Compute the widget
 		// Date
 		$date =3D new IDate();
-		$date->readonly =3D $readonly;
+		$date->readOnly =3D $readonly;
 		$date->name =3D "ag_timestamp";
 		$date->value =3D $this->ag_timestamp;
=20
 		$remind_date =3D new IDate();
-		$remind_date->readonly =3D $readonly;
+		$remind_date->readOnly =3D $readonly;
 		$remind_date->name =3D "ag_remind_date";
 		$remind_date->value =3D $this->ag_remind_date;
=20
@@ -147,7 +163,7 @@
 		$doc_type->name =3D "dt_id";
 		$doc_type->value =3D $this->db->make_array("select dt_id,dt_value from=
 document_type order by dt_value");
 		$doc_type->selected =3D $this->dt_id;
-		$doc_type->readonly =3D false;
+		$doc_type->readOnly =3D $readonly;
 		$str_doc_type =3D $doc_type->input();
=20
 		// Description
@@ -155,7 +171,7 @@
 		$desc->width =3D 70;
 		$desc->heigh =3D 5;
 		$desc->name =3D "ag_comment";
-		$desc->readonly =3D $readonly;
+		$desc->readOnly =3D $readonly;
 		if (strlen($desc->value) > 300)
 		{
 			$desc->width =3D 120;
@@ -189,7 +205,7 @@
 		// Retrieve the value
 		$a =3D $this->db->make_array("select s_id,s_value from document_state =
");
 		$state =3D new ISelect();
-		$state->readonly =3D $readonly;
+		$state->readOnly =3D $readonly;
 		$state->name =3D "ag_state";
 		$state->value =3D $a;
 		$state->selected =3D $this->ag_state;
@@ -219,14 +235,14 @@
=20
 		// title
 		$title =3D new IText();
-		$title->readonly =3D $readonly;
+		$title->readOnly =3D $readonly;
 		$title->name =3D "ag_title";
 		$title->value =3D $this->ag_title;
 		$title->size =3D 60;
=20
 		// ag_cal
 		$ag_cal =3D new ICheckBox('ag_cal');
-		$ag_cal->readonly =3D $readonly;
+		$ag_cal->readOnly =3D $readonly;
 		$ag_cal->name =3D "ag_cal";
=20
 		if ($this->ag_cal =3D=3D 'C')
@@ -238,7 +254,7 @@
=20
 		// Priority of the ag_priority
 		$ag_priority =3D new ISelect();
-		$ag_priority->readonly =3D $readonly;
+		$ag_priority->readOnly =3D $readonly;
 		$ag_priority->name =3D "ag_priority";
 		$ag_priority->selected =3D $this->ag_priority;
 		$ag_priority->value =3D array(array('value' =3D> 1, 'label' =3D> 'Haut=
e'),
@@ -249,7 +265,7 @@
=20
 		// hour of the action (meeting) ag_hour
 		$ag_hour =3D new IText();
-		$ag_hour->readonly =3D $readonly;
+		$ag_hour->readOnly =3D $readonly;
 		$ag_hour->name =3D "ag_hour";
 		$ag_hour->value =3D $this->ag_hour;
 		$ag_hour->size =3D 6;
@@ -258,14 +274,13 @@
=20
 		// Profile in charged of the action
 		$ag_dest =3D new ISelect();
-		$ag_dest->readonly =3D $readonly;
+		$ag_dest->readOnly =3D $readonly;
 		$ag_dest->name =3D "ag_dest";
 		// select profile
 		$aAg_dest =3D $this->db->make_array("select  p_id as value, " .
 				"p_name as label " .
-				" from profile order by 2");
+				" from profile  where p_id in (select p_granted from user_sec_action=
_profile where ua_right=3D'W' and p_id=3D".$g_user->get_profile().") orde=
r by 2");
=20
-		$aAg_dest[] =3D array('value' =3D> 0, 'label' =3D> 'Public');
 		$ag_dest->value =3D $aAg_dest;
 		$ag_dest->selected =3D $this->ag_dest;
 		$str_ag_dest =3D $ag_dest->input();
@@ -303,7 +318,7 @@
 		//
 		// sender
 		$w =3D new ICard();
-		$w->readonly =3D $readonly;
+		$w->readOnly =3D $readonly;
 		$w->jrn =3D 0;
 		$w->name =3D 'qcode_dest';
 		$w->value =3D ($this->f_id_dest !=3D 0) ? $this->qcode_dest : "";
@@ -327,7 +342,7 @@
=20
 		// contact
 		$ag_contact =3D new ICard();
-		$ag_contact->readonly =3D $readonly;
+		$ag_contact->readOnly =3D $readonly;
 		$ag_contact->jrn =3D 0;
 		$ag_contact->name =3D 'ag_contact';
 		$ag_contact->value =3D '';
@@ -366,7 +381,7 @@
 		$h_agrefid =3D new IHidden();
 		$iag_ref=3Dnew IText("ag_ref");
 		$iag_ref->value=3D$this->ag_ref;
-		$iag_ref->readOnly =3D ($p_view =3D=3D "NEW")?true:false;
+		$iag_ref->readOnly =3D ($p_view =3D=3D "NEW" ||$p_view =3D=3D 'READ')?=
true:false;
 		$str_ag_ref =3D$iag_ref->input();
 		// Preparing the return string
 		$r =3D "";
@@ -374,6 +389,7 @@
 		/* for new files */
 		$upload =3D new IFile();
 		$upload->name =3D "file_upload[]";
+		$upload->readOnly=3D$readonly;
 		$upload->value =3D "";
 		$aAttachedFile =3D $this->db->get_array('select d_id,d_filename,d_mime=
type,' .
 				'\'show_document.php?' .
@@ -387,7 +403,7 @@
 				' order by md_name');
 		$str_select_doc =3D $aDocMod->input();
 		/* if no document then do not show the generate button */
-		if (empty($aDocMod->value))
+		if (empty($aDocMod->value) )
 			$str_submit_generate =3D "";
 		else
 			$str_submit_generate =3D HtmlInput::submit("generate", _("G=C3=A9n=C3=
=A9re le document"));
@@ -421,6 +437,7 @@
 			$icard->extra =3D 'all';
 			$icard->name =3D "e_march" . $i;
 			$tmp_ad =3D (isset($this->aAction_detail[$i])) ? $this->aAction_detai=
l[$i] : false;
+			$icard->readOnly=3D$readonly;
 			$icard->value =3D '';
 			if ($tmp_ad)
 			{
@@ -447,11 +464,13 @@
 			$text->name =3D "e_march" . $i . "_label";
 			$text->size =3D 40;
 			$text->value =3D ($tmp_ad) ? $tmp_ad->get_parameter('text') : "";
+			$text->readOnly=3D$readonly;
 			$aArticle[$i]['desc'] =3D $text->input();
=20
 			$num->javascript =3D ' onchange=3D"format_number(this);clean_tva(' . =
$i . ');compute_ledger(' . $i . ')"';
 			$num->name =3D "e_march" . $i . "_price";
 			$num->size =3D 8;
+			$num->readOnly=3D$readonly;
 			$num->value =3D ($tmp_ad) ? $tmp_ad->get_parameter('price_unit') : 0;
 			$aArticle[$i]['pu'] =3D $num->input();
=20
@@ -462,6 +481,7 @@
=20
 			$itva->name =3D 'e_march' . $i . '_tva_id';
 			$itva->value =3D ($tmp_ad) ? $tmp_ad->get_parameter('tva_id') : 0;
+			$itva->readOnly=3D$readonly;
 			$itva->js =3D ' onchange=3D"format_number(this);clean_tva(' . $i . ')=
;compute_ledger(' . $i . ')"';
 			$itva->set_attribute('compute', $i);
=20
@@ -514,13 +534,15 @@
 	function get()
 	{
 		$sql =3D "select ag_id,to_char (ag_timestamp,'DD.MM.YYYY') as ag_times=
tamp," .
-				" f_id_dest,ag_title,ag_ref,d_id,ag_type,ag_state,  " .
+				" f_id_dest,ag_title,ag_ref,d_id,ag_type,ag_state, ag_owner, " .
 				"  ag_dest, ag_hour, ag_priority, ag_cal,ag_contact,to_char (ag_remi=
nd_date,'DD.MM.YYYY') as ag_remind_date " .
 				" from action_gestion left join document using (ag_id) where ag_id=3D=
" . $this->ag_id;
 		$r =3D $this->db->exec_sql($sql);
 		$row =3D Database::fetch_all($r);
-		if ($row =3D=3D false)
+		if ($row =3D=3D false){
+			$this->ag_id=3D0;
 			return;
+		}
 		$this->ag_timestamp =3D $row[0]['ag_timestamp'];
 		$this->ag_contact =3D $row[0]['ag_contact'];
 		$this->f_id_dest =3D $row[0]['f_id_dest'];
@@ -534,6 +556,7 @@
 		$this->ag_priority =3D $row[0]['ag_priority'];
 		$this->ag_cal =3D $row[0]['ag_cal'];
 		$this->ag_remind_date =3D $row[0]['ag_remind_date'];
+		$this->ag_owner=3D $row[0]['ag_owner'];
=20
 		$action_detail =3D new Follow_Up_Detail($this->db);
 		$action_detail->set_parameter('ag_id', $this->ag_id);
@@ -737,7 +760,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php' . HtmlInput::get_to_=
string(array("sag_ref","only_internal","state","gDossier", "qcode", "ag_d=
est_query", "query", "tdoc", "date_start", "date_end", "see_all", "ac", "=
all_action")) . "&" . $p_base . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] .=
 '">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("sag_ref","only_internal","state","gDossier", "qc=
ode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_al=
l", "ac", "all_action"),"") . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] . '=
">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1143,7 +1166,6 @@
 				" from profile order by 2");
 		$ag_dest =3D new ISelect();
 		$ag_dest->name =3D "ag_dest_query";
-		$aAg_dest[] =3D array('value' =3D> 0, 'label' =3D> 'Public');
 		$ag_dest->value =3D $aAg_dest;
 		$ag_dest->selected =3D (isset($_GET["ag_dest_query"])) ? $_GET["ag_des=
t_query"] : 0;
 		$str_ag_dest =3D $ag_dest->input();
@@ -1230,7 +1252,9 @@
 			$query .=3D ' and f_id_dest=3D0 ';
 		if (!isset($all_action))
 		{
-			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ag_dest=
 in (select p_id from profile_user where user_name=3D'" . $_SESSION['g_us=
er'] . "') or ag_dest is null )";
+			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ".self:=
:sql_security_filter($cn, "R")." )";
+		} else {
+			$query .=3D "and ".self::sql_security_filter($cn,'R');
 		}
 		if (isset($date_start) && isDate($date_start) !=3D null)
 		{

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-06-12 20:59:36 UTC =
(rev 4882)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-12 22:21:33 UTC =
(rev 4883)
@@ -533,9 +533,9 @@
      *@see HtmlInput::request_to_string
      *@return html string with the string data
      */
-    static function get_to_string($array)
+    static function get_to_string($array,$start=3D"?")
     {
-      $r=3Dself::array_to_string($array,$_GET );
+      $r=3Dself::array_to_string($array,$_GET ,$start);
       return $r;
     }
=20

Modified: phpcompta/trunk/include/class_profile_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_profile_menu.php	2012-06-12 20:59:36 UT=
C (rev 4882)
+++ phpcompta/trunk/include/class_profile_menu.php	2012-06-12 22:21:33 UT=
C (rev 4883)
@@ -208,7 +208,26 @@
 			$gDossier =3D Dossier::id();
 			$this->sub_menu($ret, $p_id);
 		}
-
+		function available_profile($p_id)
+		{
+			$array=3D$this->cn->get_array("
+					select p.p_id,p.p_name,s.p_granted,s.ua_id,s.ua_right
+						from profile as p
+						join user_sec_action_profile as s on (s.p_granted=3Dp.p_id)
+						where s.p_id=3D$1
+					union
+						select p2.p_id, p2.p_name,null,null,'X'
+						from profile as p2
+						where
+						p2.p_id not in (select p_granted from user_sec_action_profile wher=
e p_id =3D $1) order by p_name;
+				",array($p_id));
+			$aright_value=3Darray(
+								array('value'=3D>'R','label'=3D>_('Lecture')),
+								array('value'=3D>'W','label'=3D>_('Ecriture')),
+								array('value'=3D>'X','label'=3D>_('Aucun acc=C3=A8s'))
+					);
+			require_once 'template/user_sec_profile.php';
+		}
 	}
=20
 	//end class

Modified: phpcompta/trunk/include/class_user.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_user.php	2012-06-12 20:59:36 UTC (rev 4=
882)
+++ phpcompta/trunk/include/class_user.php	2012-06-12 22:21:33 UTC (rev 4=
883)
@@ -32,7 +32,6 @@
 require_once("user_common.php");
 require_once('class_dossier.php');
 require_once('ac_common.php');
-
 class User
 {
=20
@@ -964,7 +963,7 @@
              natural join  ac_dossier
              join  priv_user on ( priv_jnt=3Djnt_id)
              where use_active=3D1
-             and use_login=3D $1=20
+             and use_login=3D $1
              and priv_priv !=3D 'X' and ( dos_name ~* $2 or dos_descript=
ion ~* $2 )
              order by dos_name", array($this->login,$p_filter));
 		}
@@ -1007,7 +1006,7 @@
                     $_SERVER['REQUEST_URI'],
                     $action));
             }
-        }  =20
+        }
 	function save_profile($p_id)
 	{
 		$count=3D$this->db->get_value("select count(*) from profile_user where=
 user_name=3D$1",  array($this->login));
@@ -1029,6 +1028,22 @@
 				user_name=3D$1",array($this->login));
 		return $profile;
 	}
+	function can_write_action( $dtoc)
+	{
+		$profile=3D$this->get_profile();
+		$r=3D$this->db->get_value(" select count(*) from action_gestion where =
ag_id=3D$1 and ag_dest in
+				(select p_granted from user_sec_action_profile where ua_right=3D'W' =
and p_id=3D$2) ",array($dtoc,$profile));
+		if ( $r =3D=3D 0 ) return false;
+		return true;
+	}
+	function can_read_action($dtoc)
+	{
+		$profile=3D$this->get_profile();
+		$r=3D$this->db->get_value(" select count(*) from action_gestion where =
ag_id=3D$1 and (ag_dest in
+				(select p_granted from user_sec_action_profile where p_id=3D$2) or a=
g_owner=3D$3)",array($dtoc,$profile,$this->login));
+		if ( $r =3D=3D 0 ) return false;
+		return true;
+	}
=20
 }
=20

Modified: phpcompta/trunk/include/profile.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/profile.inc.php	2012-06-12 20:59:36 UTC (rev =
4882)
+++ phpcompta/trunk/include/profile.inc.php	2012-06-12 22:21:33 UTC (rev =
4883)
@@ -23,89 +23,127 @@
 global $cn;
=20
 //**********************************************
+// Save avail. profiles
+//**********************************************
+if (isset($_POST['change_profile']))
+{
+	extract($_POST);
+	try
+	{
+		for ($e =3D 0; $e < count($right); $e++)
+		{
+			if ($right[$e] =3D=3D 'X' && $ua_id[$e]=3D=3D'')
+				continue;
+			if ($right[$e] =3D=3D 'X' && $ua_id[$e]!=3D'')
+			{
+				$cn->exec_sql("delete from user_sec_action_profile where p_id=3D$1 a=
nd p_granted=3D$2", array($p_id, $ap_id[$e]));
+				continue;
+			}
+			if ($ua_id[$e] =3D=3D "")
+			{
+				$cn->exec_sql("insert into user_sec_action_profile (p_id,p_granted,u=
a_right) values($1,$2,$3)", array($p_id, $ap_id[$e], $right[$e]));
+				continue;
+			}
+			if ($ua_id[$e] !=3D '')
+			{
+				$cn->exec_sql("update user_sec_action_profile set ua_right=3D$3 wher=
e  p_id=3D$1 and p_granted=3D$2 ", array($p_id, $ap_id[$e], $right[$e]));
+				continue;
+			}
+		}
+	}
+	catch (Exception $exc)
+	{
+		echo $exc->getTraceAsString();
+		throw $exc;
+	}
+}
+//**********************************************
 // Save_name
 // *********************************************
=20
-if ( isset($_POST['save_name']))
+if (isset($_POST['save_name']))
 {
=20
-	extract ($_POST);
-	try{
-			if (strlen(trim($p_name))=3D=3D0) throw new Exception("Nom ne peut =C3=
=AAtre vide");
-			if (isNumber($p_id)=3D=3D0) throw new Exception("profile Invalide");
-			$wc=3D(isset($with_calc))?1:0;
-			$wd=3D(isset($with_direct_form))?1:0;
-			$p_desc=3D(strlen(trim($p_desc))=3D=3D0)?null:trim($p_desc);
+	extract($_POST);
+	try
+	{
+		if (strlen(trim($p_name)) =3D=3D 0)
+			throw new Exception("Nom ne peut =C3=AAtre vide");
+		if (isNumber($p_id) =3D=3D 0)
+			throw new Exception("profile Invalide");
+		$wc =3D (isset($with_calc)) ? 1 : 0;
+		$wd =3D (isset($with_direct_form)) ? 1 : 0;
+		$p_desc =3D (strlen(trim($p_desc)) =3D=3D 0) ? null : trim($p_desc);
 		if ($p_id !=3D -1)
 		{
 			$cn->exec_sql("update profile set p_name=3D$1,p_desc=3D$2,
-					with_calc=3D$3, with_direct_form=3D$4 where p_id=3D$5",array($p_nam=
e,
-						$p_desc,$wc,$wd,$p_id));
+					with_calc=3D$3, with_direct_form=3D$4 where p_id=3D$5", array($p_na=
me,
+				$p_desc, $wc, $wd, $p_id));
 		}
 		else
 		{
-			$p_id=3D$cn->get_value ("insert into profile (p_name,
+			$p_id =3D $cn->get_value("insert into profile (p_name,
 				p_desc,with_calc,with_direct_form) values
-				($1,$2,$3,$4) returning p_id",array(
-					$p_name,$p_desc,$wc,$wd
-				));
+				($1,$2,$3,$4) returning p_id", array(
+				$p_name, $p_desc, $wc, $wd
+					));
 		}
 	}
 	catch (Exception $e)
 	{
 		alert($e->getMessage());
 	}
-
 }
 //************************************
 // Clone
 //************************************
-if ( isset($_POST['clone']))
+if (isset($_POST['clone']))
 {
-	extract ($_POST);
+	extract($_POST);
 	try
 	{
 		$cn->start();
-		$new_id=3D$cn->get_value("insert into profile(p_name,p_desc,with_calc,
+		$new_id =3D $cn->get_value("insert into profile(p_name,p_desc,with_cal=
c,
 			with_direct_form)
 			select 'copie de '||p_name,p_desc,with_calc,
-			with_direct_form from profile where p_id=3D$1 returning p_id",array($=
p_id));
+			with_direct_form from profile where p_id=3D$1 returning p_id", array(=
$p_id));
 		$cn->exec_sql("
 				insert into profile_menu (p_id,me_code,me_code_dep,p_order,p_type_di=
splay,pm_default)
 				select $1,me_code,me_code_dep,p_order,p_type_display,pm_default from=
 profile_menu
 				where p_id=3D$2
-			",array($new_id,$p_id));
+			", array($new_id, $p_id));
 		$cn->commit();
-		$p_id=3D$new_id;
-
+		$p_id =3D $new_id;
 	}
 	catch (Exception $exc)
 	{
 		echo alert($exc->getMessage());
 		$cn->rollback();
 	}
-
 }
 //************************************
 // Delete
 //************************************
-if ( isset($_POST['delete_profil']))
+if (isset($_POST['delete_profil']))
 {
-	extract ($_POST);
+	extract($_POST);
 	try
 	{
 		$cn->start();
-		if ( $p_id=3D=3D1 ) { throw new Exception('On ne peut effacer le profi=
l par d=C3=A9faut');}
-		$new_id=3D$cn->get_value("delete from profile
-			where p_id=3D$1 ",array($p_id));
+		if ($p_id =3D=3D 1)
+		{
+			throw new Exception('On ne peut effacer le profil par d=C3=A9faut');
+		}
+		$new_id =3D $cn->get_value("delete from profile
+			where p_id=3D$1 ", array($p_id));
 		$cn->commit();
 	}
 	catch (Exception $exc)
 	{
-		echo alert($exc->getMessage());;
+		echo alert($exc->getMessage());
+		;
 		$cn->rollback();
 	}
-
 }
 //************************************
 // Modify the menu or delete it
@@ -113,18 +151,16 @@
 if (isset($_POST['mod']))
 {
 	extract($_POST);
-	if (isset($delete) || isset ($del_dep))
+	if (isset($delete) || isset($del_dep))
 	{
 		try
 		{
 			$cn->start();
-                        if ( isset ($del_dep))
-                        {
-                            $cn->exec_sql("delete from profile_menu wher=
e pm_id in (select * from get_menu_dependency($1))",
-					array($pm_id));=20
-                        }
-			$cn->exec_sql("delete from profile_menu where pm_id=3D$1",
-					array($pm_id));
+			if (isset($del_dep))
+			{
+				$cn->exec_sql("delete from profile_menu where pm_id in (select * fro=
m get_menu_dependency($1))", array($pm_id));
+			}
+			$cn->exec_sql("delete from profile_menu where pm_id=3D$1", array($pm_=
id));
 			$cn->commit();
 		}
 		catch (Exception $exc)
@@ -132,11 +168,11 @@
 			echo $exc->getMessage();
 			$cn->rollback();
 		}
-		}
+	}
 	else
 		try
 		{
-		/**
+			/**
 			 * Printing cannot be a menu and do not depend of anything
 			 */
 			$menu_type =3D $cn->get_value("select me_type from menu_ref
@@ -173,9 +209,9 @@
 //****************************************************
 // Add a menu, module, submenu,plugin...
 //****************************************************
-if ( isset ($_POST['add_menu']))
+if (isset($_POST['add_menu']))
 {
-	extract ($_POST);
+	extract($_POST);
 	try
 	{
 		$cn->start();
@@ -183,47 +219,44 @@
 		/**
 		 * Printing cannot be a menu and do not depend of anything
 		 */
-		$menu_type=3D$cn->get_value("select me_type from menu_ref
-			where me_code=3D$1",array($me_code));
+		$menu_type =3D $cn->get_value("select me_type from menu_ref
+			where me_code=3D$1", array($me_code));
=20
-		if ($menu_type=3D=3D'PR')
+		if ($menu_type =3D=3D 'PR')
 		{
-			$p_type=3D'P';
-			$me_code_dep=3D-1;
+			$p_type =3D 'P';
+			$me_code_dep =3D -1;
 		}
=20
 		// Module never depends of anything
-		if ($p_type=3D=3D'M')
+		if ($p_type =3D=3D 'M')
 		{
-			$me_code_dep=3D-1;
+			$me_code_dep =3D -1;
 		}
 		/**
 		 * Check for infinite loop
 		 */
-		$inf=3D$cn->get_value("select count(*) from profile_menu
-			where p_id=3D$1 and me_code_dep=3D$2 and me_code=3D$3",
-				array($p_id,$me_code,$me_code_dep));
-		if ( $inf > 0 )			throw new Exception("Boucle infinie");
-			/**
+		$inf =3D $cn->get_value("select count(*) from profile_menu
+			where p_id=3D$1 and me_code_dep=3D$2 and me_code=3D$3", array($p_id, =
$me_code, $me_code_dep));
+		if ($inf > 0)
+			throw new Exception("Boucle infinie");
+		/**
 		 * if me_code_dep =3D=3D -1, it means it is null
 		 */
-		$me_code_dep=3D($me_code_dep=3D=3D-1)?null:$me_code_dep;
+		$me_code_dep =3D ($me_code_dep =3D=3D -1) ? null : $me_code_dep;
=20
-		$pm_default=3D(isset($pm_default))?1:0;
+		$pm_default =3D (isset($pm_default)) ? 1 : 0;
 		$cn->exec_sql("
 				insert into profile_menu (me_code,me_code_dep,p_id,p_order,pm_defaul=
t,p_type_display)
 				values ($1,$2,$3,$4,$5,$6)
-				",array($me_code,$me_code_dep,$p_id,$p_order,$pm_default,$p_type));
+				", array($me_code, $me_code_dep, $p_id, $p_order, $pm_default, $p_ty=
pe));
=20
 		$cn->commit();
-
 	}
 	catch (Exception $exc)
 	{
 		alert($exc->getMessage());
 	}
-
-
 }
=20
 echo '<div id=3D"list_profile" class=3D"content">';
@@ -240,7 +273,7 @@
 $order =3D $table->get_sql_order($ord);
=20
 $menu =3D new Profile_sql($cn);
-$ret =3D $menu->seek($order);
+$ret =3D $menu->seek("where p_id > 0 ".$order);
 echo '<table class=3D"result">';
 echo '<tr>';
 echo '<th>' . $table->get_header(0) . '</th>';
@@ -263,7 +296,7 @@
 }
 $js =3D sprintf('<a href=3D"javascript:void(0)"  class=3D"button" onclic=
k=3D"get_profile_detail(\'%s\',\'%s\')">', $gDossier, -1);
 echo '<tr>';
-echo "<td>".$js."Ajouter un profil </td>";
+echo "<td>" . $js . "Ajouter un profil </td>";
 echo '</tr>';
 echo '</table>';
 echo '</div>';

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-12 20:59:3=
6 UTC (rev 4882)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-12 22:21:3=
3 UTC (rev 4883)
@@ -82,7 +82,7 @@
           </td>
           </Tr>
         </table>
- <?echo $str_add_button;?>
+ <?if ($p_view !=3D 'READ') echo $str_add_button;?>
=20
 </div>
 <div style=3D"float:left;width:45%">
@@ -147,17 +147,25 @@
 		<?
 		for ($o=3D0;$o<count($operation);$o++)
 		{
-			$rmOperation=3Dsprintf("javascript:if ( confirm('"._('Voulez-vous eff=
acer cette op=C3=A9ration ')."')=3D=3Dtrue ) {remove_operation('%s','%s')=
;}",
-					dossier::id(),
-					$operation[$o]['ago_id']);
-			$js=3D '<a class=3D"mtitle" style=3D"color:orange" id=3D"acop'.$opera=
tion[$o]['ago_id'].'" href=3D"'.$rmOperation.'">Effacer</a>';
-			echo '<li id=3D"op'.$operation[$o]['ago_id'].'">'.$operation[$o]['str=
_date']." ".HtmlInput::detail_op($operation[$o]['jr_id'],$operation[$o]['=
jr_internal'])." ".h($operation[$o]['jr_comment'])." "
-				.$js.'</li>';
+			if ( $p_view !=3D 'READ')
+				{
+					$rmOperation=3Dsprintf("javascript:if ( confirm('"._('Voulez-vous e=
ffacer cette op=C3=A9ration ')."')=3D=3Dtrue ) {remove_operation('%s','%s=
');}",
+							dossier::id(),
+							$operation[$o]['ago_id']);
+					$js=3D '<a class=3D"mtitle" style=3D"color:orange" id=3D"acop'.$ope=
ration[$o]['ago_id'].'" href=3D"'.$rmOperation.'">Effacer</a>';
+					echo '<li id=3D"op'.$operation[$o]['ago_id'].'">'.$operation[$o]['s=
tr_date']." ".HtmlInput::detail_op($operation[$o]['jr_id'],$operation[$o]=
['jr_internal'])." ".h($operation[$o]['jr_comment'])." "
+						.$js.'</li>';
+				}
+				else
+				{
+					echo '<li >'.$operation[$o]['str_date']." ".HtmlInput::detail_op($o=
peration[$o]['jr_id'],$operation[$o]['jr_internal'])." ".h($operation[$o]=
['jr_comment'])." "
+						.'</li>';
+				}
 		}
=20
 		?>
 		</ol>
-		<?=3D$iconcerned->input()?>
+		<? if ($p_view !=3D 'READ') echo $iconcerned->input()?>
 	</div>
=20
 	<div style=3D"float:left;width:45%">
@@ -168,6 +176,8 @@
 		$base=3DHtmlInput::request_to_string(array("gDossier","ac","sa","sb","=
sc","f_id"));
 		for ($o=3D0;$o<count($action);$o++)
 		{
+			if ( $p_view !=3D 'READ')
+				{
 			$rmAction=3Dsprintf("javascript:if ( confirm('"._('Voulez-vous efface=
r cette action ')."')=3D=3Dtrue ) {remove_action('%s','%s','%s');}",
 					dossier::id(),
 					$action[$o]['ag_id'],$_REQUEST['ag_id']);
@@ -176,11 +186,17 @@
 			echo '<li id=3D"act'.$action[$o]['ag_id'].'">'.$showAction.$action[$o=
]['str_date']." ".$action[$o]['ag_ref']." ".
 					h($action[$o]['sub_title']).'('.h($action[$o]['dt_value']).')</a>'.=
" "
 				.$js.'</li>';
+			} else {
+				$showAction=3D'<a class=3D"line" href=3D"'.$base."&ag_id=3D".$action=
[$o]['ag_id'].'">';
+				echo '<li>'.$showAction.$action[$o]['str_date']." ".$action[$o]['ag_=
ref']." ".
+					h($action[$o]['sub_title']).'('.h($action[$o]['dt_value']).')</a>'.=
" "
+				.'</li>';
+			}
 		}
=20
 		?>
 		</ol>
-		<?=3D$iaction->input()?>
+		<? if ( $p_view !=3D 'READ') echo $iaction->input()?>
 	</div>
 </fieldset>
 <fieldset>
@@ -201,7 +217,9 @@
=20
    }
 </script>
-
+<? if  ($p_view !=3D 'NEW') : ?>
+Document cr=C3=A9=C3=A9 le <?=3D$this->ag_timestamp ?> par <?=3D$this->a=
g_owner?>
+<? endif; ?>
    <h4 class=3D"info"><?=3D_('Titre')?></h4>
     <p style=3D"margin-left:100">
     <?php echo $title->input();
@@ -213,14 +231,25 @@
    $style_enl=3D'style=3D"display:inline"';$style_small=3D'style=3D"disp=
lay:none"';
=20
 for( $c=3D0;$c<count($acomment);$c++){
-	$rmComment=3Dsprintf("javascript:if ( confirm('"._('Voulez-vous effacer=
 ce commentaire ')."')=3D=3Dtrue ) {remove_comment('%s','%s');}",
-					dossier::id(),
-					$acomment[$c]['agc_id']);
-			$js=3D '<a class=3D"mtitle" style=3D"color:orange" id=3D"accom'.$acom=
ment[$c]['agc_id'].'" href=3D"'.$rmComment.'">Effacer</a>';
-	echo 'n=C2=B0'.$acomment[$c]['agc_id'].'('.h($acomment[$c]['tech_user']=
)." ".smaller_date($acomment[$c]['str_agc_date']).')'.$js.
-			'<pre style=3D"white-space: -moz-pre-wrap;white-space: pre-wrap;borde=
r:1px solid blue;width:70%;" id=3D"com'.$acomment[$c]['agc_id'].'"> '.
-			" ".h($acomment[$c]['agc_comment']).'</pre>'
-			;
+	if ( $p_view !=3D 'READ')
+	{
+		$rmComment=3Dsprintf("javascript:if ( confirm('"._('Voulez-vous efface=
r ce commentaire ')."')=3D=3Dtrue ) {remove_comment('%s','%s');}",
+						dossier::id(),
+						$acomment[$c]['agc_id']);
+				$js=3D '<a class=3D"mtitle" style=3D"color:orange" id=3D"accom'.$aco=
mment[$c]['agc_id'].'" href=3D"'.$rmComment.'">Effacer</a>';
+		echo 'n=C2=B0'.$acomment[$c]['agc_id'].'('.h($acomment[$c]['tech_user'=
])." ".smaller_date($acomment[$c]['str_agc_date']).')'.$js.
+				'<pre style=3D"white-space: -moz-pre-wrap;white-space: pre-wrap;bord=
er:1px solid blue;width:70%;" id=3D"com'.$acomment[$c]['agc_id'].'"> '.
+				" ".h($acomment[$c]['agc_comment']).'</pre>'
+				;
+	}
+	else
+	{
+		echo 'n=C2=B0'.$acomment[$c]['agc_id'].'('.h($acomment[$c]['tech_user'=
])." ".smaller_date($acomment[$c]['str_agc_date']).')'.
+				'<pre style=3D"white-space: -moz-pre-wrap;white-space: pre-wrap;bord=
er:1px solid blue;width:70%;" id=3D"com'.$acomment[$c]['agc_id'].'"> '.
+				" ".h($acomment[$c]['agc_comment']).'</pre>'
+				;
+
+	}
 }
 echo $desc->input();
 ?>
@@ -292,14 +321,19 @@
 </div>
=20
 </fieldset>
+
+<? if ($p_view !=3D 'READ') : ?>
 <fieldset >
   <legend>
      <?=3D_('Document =C3=A0 g=C3=A9n=C3=A9rer')?>
   </legend>
   <?php echo $str_select_doc;
-echo $str_submit_generate;
+ echo $str_submit_generate;
   ?>
 </fieldset>
+<? endif; ?>
+
+
 <fieldset>
   <legend>
      <?=3D_('Pi=C3=A8ces attach=C3=A9es')?>
@@ -315,7 +349,7 @@
 	dossier::id(),
 	$aAttachedFile[$i]['d_id']);
     ?>
-    <a class=3D"mtitle" style=3D"color:orange" id=3D"<?php echo "ac".$aA=
ttachedFile[$i]['d_id'];?>" href=3D"<?php echo $rmDoc;?>">Effacer</a>
+  <? if ($p_view !=3D 'READ') : ?>  <a class=3D"mtitle" style=3D"color:o=
range" id=3D"<?php echo "ac".$aAttachedFile[$i]['d_id'];?>" href=3D"<?php=
 echo $rmDoc;?>">Effacer</a><? endif;?>
   </p>
   <?php
 endfor;
@@ -340,7 +374,7 @@
       </li>
     </ol>
   <span >
-  <input type=3D"button" class=3D"button" onclick=3D"addFiles();" value=3D=
"Ajouter un fichier">
+<? if ($p_view !=3D 'READ') : ?> <input type=3D"button" class=3D"button"=
 onclick=3D"addFiles();" value=3D"Ajouter un fichier"> <? endif;?>
   </span>
   </p>
 </fieldset>

Added: phpcompta/trunk/include/template/user_sec_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_profile.php	               =
         (rev 0)
+++ phpcompta/trunk/include/template/user_sec_profile.php	2012-06-12 22:2=
1:33 UTC (rev 4883)
@@ -0,0 +1,55 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show the available profiles for action-management
+ *
+ */
+?>
+<form method=3D"POST" class=3D"print">
+	<?=3DHtmlInput::hidden("p_id", $p_id);?>
+	<table>
+		<tr>
+			<th><?=3D_("Profile")?></th>
+			<th><?=3D_("Acc=C3=A8s")?></th>
+		</tr>
+		<? for ($i=3D0;$i<count($array);$i++): ?>
+		<tr>
+			<td>
+				<?=3D$array[$i]['p_name']?>
+				<?=3DHtmlInput::hidden('ua_id[]',$array[$i]['ua_id'])?>
+				<?=3DHtmlInput::hidden('ap_id[]',$array[$i]['p_id'])?>
+			</td>
+			<td>
+				<?
+				$isel=3Dnew ISelect("right[]");
+				$isel->value=3D$aright_value;
+				$isel->selected=3D$array[$i]['ua_right'];
+				echo $isel->input();?>
+			</td>
+		</tr>
+		<?endfor;?>
+	</table>
+<?=3DHtmlInput::submit("change_profile", "Sauver")?>
+</form>
\ No newline at end of file

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-12 20:59:36 UTC (rev 4882)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-12 22:21:33 UTC (rev 4883)
@@ -188,4 +188,27 @@
 ALTER TABLE document_type ADD COLUMN dt_prefix text;
 COMMENT ON COLUMN document_type.dt_prefix IS 'Prefix for ag_ref';
=20
-update document_type set dt_prefix=3D upper(substr(replace(dt_value,' ',=
''),0,7))||dt_id::text=20
\ No newline at end of file
+update document_type set dt_prefix=3D upper(substr(replace(dt_value,' ',=
''),0,7))||dt_id::text
+
+CREATE TABLE user_sec_action_profile
+(
+  ua_id bigserial NOT NULL, -- pk
+  p_id bigint, -- fk to profile
+  p_granted bigint, -- fk to profile
+  ua_right character(1), -- Type of right : R for readonly W for write
+  CONSTRAINT user_sec_action_profile_pkey PRIMARY KEY (ua_id ),
+  CONSTRAINT user_sec_action_profile_p_id_fkey FOREIGN KEY (p_id)
+   REFERENCES profile (p_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT user_sec_action_profile_p_granted_fkey FOREIGN KEY (p_grant=
ed)
+      REFERENCES profile (p_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT user_sec_action_profile_ua_right_check CHECK (ua_right =3D =
ANY (ARRAY['R'::bpchar, 'W'::bpchar]))
+);
+COMMENT ON TABLE user_sec_action_profile  IS 'Available profile for user=
';
+COMMENT ON COLUMN user_sec_action_profile.ua_id IS 'pk';
+COMMENT ON COLUMN user_sec_action_profile.p_id IS 'fk to profile';
+COMMENT ON COLUMN user_sec_action_profile.ua_right IS 'Type of right : R=
 for readonly W for write';
+INSERT INTO profile (p_name, p_id, p_desc, with_calc, with_direct_form) =
VALUES ('Public', -1, 'faux groupe', NULL, NULL);
+insert into user_sec_action_profile(p_id,p_granted,ua_right) select 1,p_=
id,'W' from profile;
+insert into user_sec_action_profile(p_id,p_granted ,ua_right) select 2,p=
_id,'W' from profile;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 09:01:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SenCO-0008TS-8z
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 09:01:24 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 14:52:32 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.191088.1339592483.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4884 - in phpcompta/trunk: html include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 13:01:23 -0000

Author: danydb
Date: 2012-06-13 14:52:31 +0200 (Wed, 13 Jun 2012)
New Revision: 4884

Modified:
   phpcompta/trunk/html/ajax.php
   phpcompta/trunk/html/ajax_card.php
   phpcompta/trunk/html/ajax_history.php
   phpcompta/trunk/html/ajax_ledger.php
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/ajax_poste.php
   phpcompta/trunk/html/ajax_todo_list.php
   phpcompta/trunk/html/direct.php
   phpcompta/trunk/html/extension.raw.php
   phpcompta/trunk/html/fid.php
   phpcompta/trunk/html/fid_card.php
   phpcompta/trunk/html/popup.php
   phpcompta/trunk/html/recherche.php
   phpcompta/trunk/html/show_document.php
   phpcompta/trunk/html/show_document_modele.php
   phpcompta/trunk/html/show_pj.php
   phpcompta/trunk/html/user_pref.php
   phpcompta/trunk/include/ajax_auto_anc_card.php
   phpcompta/trunk/include/ajax_bank_saldo.php
   phpcompta/trunk/include/ajax_get_receipt.php
   phpcompta/trunk/include/ajax_mod_periode.php
   phpcompta/trunk/include/class_acc_account_ledger.php
   phpcompta/trunk/include/class_acc_balance.php
   phpcompta/trunk/include/class_acc_ledger.php
   phpcompta/trunk/include/class_acc_ledger_fin.php
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_acc_operation.php
   phpcompta/trunk/include/class_acc_reconciliation.php
   phpcompta/trunk/include/class_anticipation.php
   phpcompta/trunk/include/class_calendar.php
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/class_impress.php
   phpcompta/trunk/include/export_balance_csv.php
   phpcompta/trunk/include/export_balance_pdf.php
   phpcompta/trunk/include/export_fiche_balance_pdf.php
   phpcompta/trunk/include/export_fiche_pdf.php
   phpcompta/trunk/include/export_gl_pdf.php
   phpcompta/trunk/include/export_ledger_csv.php
   phpcompta/trunk/include/export_ledger_pdf.php
   phpcompta/trunk/include/extension_choice.inc.php
   phpcompta/trunk/include/impress_poste.inc.php
   phpcompta/trunk/include/opening.inc.php
   phpcompta/trunk/include/param_pcmn.inc.php
   phpcompta/trunk/include/param_sec.inc.php
   phpcompta/trunk/include/preod.inc.php
   phpcompta/trunk/include/report.inc.php
   phpcompta/trunk/include/search.inc.php
   phpcompta/trunk/include/user_common.php
   phpcompta/trunk/include/verif_bilan.inc.php
Log:
Code quality : use as often as possible global $g_user instead of recreat=
ing a new User object

Modified: phpcompta/trunk/html/ajax.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/ajax.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -15,8 +15,9 @@
 mb_internal_encoding("UTF-8");
=20
 $cn=3Dnew Database(dossier::id());
-$user=3Dnew User($cn);
-$user->check(true);
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check(true);
=20
 /* if a code has been asked */
 if (isset($_REQUEST['plugin_code']) )

Modified: phpcompta/trunk/html/ajax_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_card.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/ajax_card.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -87,9 +87,10 @@
 ajax_disconnected($_REQUEST['ctl']);
=20
 $cn=3Dnew Database($gDossier);
-$user=3Dnew User($cn);
-$user->check(true);
-$user->check_dossier($gDossier,true);
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check(true);
+$g_user->check_dossier($gDossier,true);
 $html=3Dvar_export($_REQUEST,true);
 switch($op)
 {
@@ -97,7 +98,7 @@
     /* Remove a attribut */
     /* ------------------------------------------------------------ */
 case 'rmfa':
-    if ($user->check_action(FICCAT)=3D=3D0)exit();
+    if ($g_user->check_action(FICCAT)=3D=3D0)exit();
         ob_start();
     if( ! isset($_GET['ad_id']) || isNumber($_GET['ad_id']) =3D=3D0)
         throw new Exception ( "Parametre ad_id est invalide",11);
@@ -130,7 +131,7 @@
     if ( $qcode !=3D '')
     {
         $f->get_by_qcode($qcode);
-	$can_modify=3D$user->check_action(FIC);
+	$can_modify=3D$g_user->check_action(FIC);
 	if ( isset($ro) )
 	  {
 	    $can_modify=3D0;
@@ -176,7 +177,7 @@
     /* Blank card */
     /* ------------------------------------------------------------ */
 case 'bc':
-    if ( $user->check_action(FICADD)=3D=3D1 )
+    if ( $g_user->check_action(FICADD)=3D=3D1 )
     {
         $r=3D'';
 	$r=3DHtmlInput::anchor_close($ctl);
@@ -285,7 +286,7 @@
 case 'sc':
   $html=3DHtmlInput::anchor_close($ctl);
   $html.=3Dh2info('Nouvelle fiche');
-    if ( $user->check_action(FICADD)=3D=3D1 )
+    if ( $g_user->check_action(FICADD)=3D=3D1 )
     {
         $f=3Dnew Fiche($cn);
         $f->insert($fd_id,$_POST);
@@ -375,7 +376,7 @@
     $html=3D$r;
     break;
 case 'ac':
-    if ( $user->check_action(FICCAT)=3D=3D1 )
+    if ( $g_user->check_action(FICCAT)=3D=3D1 )
     {
=20
         /*--------------------------------------------------------------=
--------
@@ -433,7 +434,7 @@
      *
      *------------------------------------------------------------------=
----*/
     $html=3D'';
-    if ( $user->check_action(FICCAT) =3D=3D 1 )
+    if ( $g_user->check_action(FICCAT) =3D=3D 1 )
     {
 		$script=3Dcreate_script("removeDiv('$ctl')");
 		$html.=3D$script;
@@ -468,7 +469,7 @@
   $html=3DHtmlInput::anchor_close($ctl);
   $html.=3Dh2info('D=C3=A9tail fiche');
=20
-  if ( $user->check_action(FICADD)=3D=3D0 )
+  if ( $g_user->check_action(FICADD)=3D=3D0 )
     {
       $html.=3Dalert(_('Action interdite'),true);
     }

Modified: phpcompta/trunk/html/ajax_history.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_history.php	2012-06-12 22:21:33 UTC (rev 48=
83)
+++ phpcompta/trunk/html/ajax_history.php	2012-06-13 12:52:31 UTC (rev 48=
84)
@@ -38,12 +38,10 @@
  *if $_SESSION['g_user'] is not set : echo a warning
  */
 ajax_disconnected($div);
-
-//var_dump($_GET);
-$cn=3Dnew Database(dossier::id());
-$user=3Dnew User($cn);
+global $g_user;
+$g_user=3Dnew User($cn);
 /* security */
-if ( $user->check_dossier(dossier::id(),true) =3D=3D 'X' ) exit();
+if ( $g_user->check_dossier(dossier::id(),true) =3D=3D 'X' ) exit();
=20
 $from_div=3D(isset ($_REQUEST['ajax']))?1:0;
=20
@@ -55,7 +53,7 @@
     $exercice=3Dnew Exercice($cn);
     $old=3D'';
     $fiche=3Dnew Fiche($cn,$_GET['f_id']);
-    $year=3D$user->get_exercice();
+    $year=3D$g_user->get_exercice();
     if ( $year =3D=3D 0 )
       {
         $html=3D"erreur aucune p=C3=A9riode par d=C3=A9faut, allez dans =
pr=C3=A9f=C3=A9rence pour en choisir une";
@@ -125,7 +123,7 @@
 if ( isset($_REQUEST['pcm_val']))
   {
     $poste=3Dnew Acc_Account_Ledger($cn,$_REQUEST['pcm_val']);
-    $year=3D$user->get_exercice();
+    $year=3D$g_user->get_exercice();
     if ( $year =3D=3D 0 )
       {
         $html=3D"erreur aucune p=C3=A9riode par d=C3=A9faut, allez dans =
pr=C3=A9f=C3=A9rence pour en choisir une";

Modified: phpcompta/trunk/html/ajax_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_ledger.php	2012-06-12 22:21:33 UTC (rev 488=
3)
+++ phpcompta/trunk/html/ajax_ledger.php	2012-06-13 12:52:31 UTC (rev 488=
4)
@@ -64,9 +64,10 @@
 $g_parameter=3Dnew Own($cn);
=20
 // check if the user is valid and can access this folder
-$User=3Dnew User($cn);
-$User->check();
-if ( $User->check_dossier(dossier::id(),true)=3D=3D'X' )
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check();
+if ( $g_user->check_dossier(dossier::id(),true)=3D=3D'X' )
 {
     ob_start();
     require_once ('template/ledger_detail_forbidden.php');
@@ -90,7 +91,7 @@
 $op=3Dnew Acc_Operation($cn);
 $op->jr_id=3D$_REQUEST['jr_id'];
 $ledger=3D$op->get_ledger();
-$access=3D$User->get_ledger_access($ledger);
+$access=3D$g_user->get_ledger_access($ledger);
 if ( $access =3D=3D 'X' )
 {
     ob_start();

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -57,22 +57,21 @@
 	exit();
 extract($_REQUEST);
 set_language();
-
+global $g_user;
 $cn =3D new Database($gDossier);
-$user =3D new User($cn);
-$user->check(true);
-$user->check_dossier($gDossier, true);
+$g_user =3D new User($cn);
+$g_user->check(true);
+$g_user->check_dossier($gDossier, true);
 $html =3D var_export($_REQUEST, true);
-global $g_user;
-$g_user=3D$user;
+
 switch ($op)
 {
 	case "remove_anc":
-	  if ($user->check_module('ANCODS') =3D=3D 0) exit();
+	  if ($g_user->check_module('ANCODS') =3D=3D 0) exit();
 			$cn->exec_sql("delete from operation_analytique where oa_group=3D$1",=
 array($_GET['oa']));
 		break;
 	case "rm_stock":
-	  if ($user->check_module('STOCK') =3D=3D 0) exit();
+	  if ($g_user->check_module('STOCK') =3D=3D 0) exit();
 		require_once('constant.security.php');
 		$cn->exec_sql('delete from stock_goods where sg_id=3D$1', array($s_id)=
);
 		$html =3D escape_xml($s_id);
@@ -133,7 +132,7 @@
 	case 'rem_cat_doc':
 		require_once('class_document_type.php');
 		// if user can not return error message
-		if ($user->check_action(PARCATDOC) =3D=3D 0)
+		if ($g_user->check_action(PARCATDOC) =3D=3D 0)
 		{
 			$html =3D "nok";
 			header('Content-type: text/xml; charset=3DUTF-8');
@@ -264,8 +263,8 @@
 	 */
 	case 'dl':
 		require_once('class_lettering.php');
-		$exercice =3D $user->get_exercice();
-        if ($user->check_module("LETCARD") =3D=3D 0 && $user->check_modu=
le("LETACC") =3D=3D 0) exit();
+		$exercice =3D $g_user->get_exercice();
+        if ($g_user->check_module("LETCARD") =3D=3D 0 && $g_user->check_=
module("LETACC") =3D=3D 0) exit();
 		$periode =3D new Periode($cn);
 		list($first_per, $last_per) =3D $periode->get_limit($exercice);
=20

Modified: phpcompta/trunk/html/ajax_poste.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_poste.php	2012-06-12 22:21:33 UTC (rev 4883=
)
+++ phpcompta/trunk/html/ajax_poste.php	2012-06-13 12:52:31 UTC (rev 4884=
)
@@ -59,9 +59,10 @@
 if ( $cont !=3D 0 ) exit();
 $cn=3Dnew Database(dossier::id());
 include_once ("class_user.php");
-$User=3Dnew User($cn);
-$User->Check();
-if  ($User->get_folder_access(dossier::id()) =3D=3D 'X') exit();
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->Check();
+if  ($g_user->get_folder_access(dossier::id()) =3D=3D 'X') exit();
 $xml=3D"";
=20
 switch ($op)

Modified: phpcompta/trunk/html/ajax_todo_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_todo_list.php	2012-06-12 22:21:33 UTC (rev =
4883)
+++ phpcompta/trunk/html/ajax_todo_list.php	2012-06-13 12:52:31 UTC (rev =
4884)
@@ -41,9 +41,10 @@
 mb_internal_encoding("UTF-8");
=20
 $cn=3D Dossier::connect();
-$user=3Dnew User($cn);
-$user->check(true);
-$user->check_dossier(Dossier::id(),true);
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check(true);
+$g_user->check_dossier(Dossier::id(),true);
 ajax_disconnected('add_todo_list');
=20
 if (isset($_REQUEST['show']))

Modified: phpcompta/trunk/html/direct.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/direct.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/direct.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -2,10 +2,11 @@
 require_once ("class_database.php");
 require_once 'class_user.php';
 $cn=3Dnew Database($_GET['gDossier']);
-$user=3Dnew User($cn);
-$user->Check();
-$user->check_dossier($_GET['gDossier']);
-$res=3D$cn->exec_sql("select code,description from get_profile_menu($1) =
where code ~* $2 or description ~* $3 limit 8",array($user->login,$_POST[=
'acs'],$_POST['acs']));
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->Check();
+$g_user->check_dossier($_GET['gDossier']);
+$res=3D$cn->exec_sql("select code,description from get_profile_menu($1) =
where code ~* $2 or description ~* $3 limit 8",array($g_user->login,$_POS=
T['acs'],$_POST['acs']));
 $nb=3DDatabase::num_row($res);
 	echo "<ul>";
 for ($i =3D 0;$i< $nb;$i++)

Modified: phpcompta/trunk/html/extension.raw.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/extension.raw.php	2012-06-12 22:21:33 UTC (rev 4=
883)
+++ phpcompta/trunk/html/extension.raw.php	2012-06-13 12:52:31 UTC (rev 4=
884)
@@ -36,9 +36,10 @@
 require_once ('class_user.php');
=20
 $cn=3Dnew Database(dossier::id());
-$user=3Dnew User($cn);
-$user->check();
-$only_plugin=3D$user->check_dossier(dossier::id());
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check();
+$only_plugin=3D$g_user->check_dossier(dossier::id());
=20
 $ext=3Dnew Extension($cn);
=20

Modified: phpcompta/trunk/html/fid.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/fid.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/fid.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -44,9 +44,10 @@
 require_once('class_user.php');
=20
 $cn=3Dnew Database(dossier::id());
-$user=3Dnew User($cn);
-$user->check();
-$user->check_dossier(dossier::id());
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check();
+$g_user->check_dossier(dossier::id());
=20
 $fLabel=3D(isset($_REQUEST['l']))?$_REQUEST['l']:'none';
 $fTva_id=3D(isset($_REQUEST['t']))?$_REQUEST['t']:'none';

Modified: phpcompta/trunk/html/fid_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/fid_card.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/fid_card.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -50,9 +50,10 @@
 $filter_card=3D'';
=20
 require_once('class_user.php');
-$user=3Dnew User($cn);
-$user->check();
-$user->check_dossier(dossier::id());
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check();
+$g_user->check_dossier(dossier::id());
=20
 switch ($d)
 {

Modified: phpcompta/trunk/html/popup.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/popup.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/popup.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -10,14 +10,14 @@
 echo '<div style=3D"float:left;">'.HtmlInput::print_window();
=20
 html_page_start($_SESSION['g_theme']);
-
+global $g_user;
 if ( basename($_GET['ajax']) =3D=3D 'ajax_history.php' )
   {
     $href=3Ddossier::get();
     $cn=3Dnew Database(dossier::id());
     /* current year  */
-    $user=3Dnew User($cn);
-    $exercice=3D$user->get_exercice();
+    $g_user=3Dnew User($cn);
+    $exercice=3D$g_user->get_exercice();
=20
     /* get date limit */
     $periode=3Dnew Periode($cn);

Modified: phpcompta/trunk/html/recherche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/recherche.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/recherche.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -38,9 +38,10 @@
=20
 $cn=3Dnew Database($gDossier);
 include_once ('class_user.php');
-$User=3Dnew User($cn);
-$User->Check();
-$act=3D$User->check_dossier($gDossier);
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->Check();
+$act=3D$g_user->check_dossier($gDossier);
 // AC CODE =3D SEARCH
 if ($act =3D=3D'P')
 {

Modified: phpcompta/trunk/html/show_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/show_document.php	2012-06-12 22:21:33 UTC (rev 4=
883)
+++ phpcompta/trunk/html/show_document.php	2012-06-13 12:52:31 UTC (rev 4=
884)
@@ -32,14 +32,15 @@
 $action=3D(isset($_REQUEST['a']))?$_REQUEST['a']:'sh';
=20
 require_once ('class_user.php');
-$User=3Dnew User(new Database());
-$User->Check();
-$User->check_dossier($gDossier);
+global $g_user;
+$g_user=3Dnew User(new Database());
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
 /* Show the document */
 if ( $action =3D=3D 'sh')
 {
-    if ( $User->check_action(VIEWDOC)=3D=3D1)
+    if ( $g_user->check_action(VIEWDOC)=3D=3D1)
     {
         // retrieve the document
         $doc=3Dnew Document($cn,$_REQUEST['d_id']);
@@ -49,7 +50,7 @@
 /* remove the document */
 if ( $action =3D=3D 'rm' )
 {
-    if ($User->check_action(RMDOC)=3D=3D1)
+    if ($g_user->check_action(RMDOC)=3D=3D1)
     {
         $doc=3Dnew Document($cn,$_REQUEST['d_id']);
         $doc->remove();
@@ -62,7 +63,7 @@
 if ( $action =3D=3D 'rmop' )
 {
 	$dt_id=3D$cn->get_value("select ag_id from action_gestion_operation whe=
re ago_id=3D$1",$_REQUEST['id']);
-    if ($User->check_action(RMDOC)=3D=3D1 && $User->can_write_action($dt=
_id)=3D=3Dtrue)
+    if ($g_user->check_action(RMDOC)=3D=3D1 && $g_user->can_write_action=
($dt_id)=3D=3Dtrue)
     {
 		$cn->exec_sql("delete from action_gestion_operation where ago_id=3D$1"=
,
 				array($_REQUEST['id']));
@@ -75,7 +76,7 @@
 if ( $action =3D=3D 'rmcomment' )
 {
 	$dt_id=3D$cn->get_value("select ag_id from action_gestion_comment where=
 agc_id=3D$1",$_REQUEST['id']);
-    if ($User->check_action(RMDOC)=3D=3D1 && $User->can_write_action($dt=
_id)=3D=3Dtrue)
+    if ($g_user->check_action(RMDOC)=3D=3D1 && $g_user->can_write_action=
($dt_id)=3D=3Dtrue)
     {
 		$cn->exec_sql("delete from action_gestion_comment where agc_id=3D$1",
 				array($_REQUEST['id']));
@@ -87,7 +88,7 @@
 /* remove the action from action_gestion_operation*/
 if ( $action =3D=3D 'rmaction' )
 {
-    if ($User->check_action(RMDOC)=3D=3D1 && $User->can_write_action($_R=
EQUEST['id']) =3D=3D true && $User->can_write_action($_REQUEST['ag_id'])=3D=
=3D true )
+    if ($g_user->check_action(RMDOC)=3D=3D1 && $g_user->can_write_action=
($_REQUEST['id']) =3D=3D true && $g_user->can_write_action($_REQUEST['ag_=
id'])=3D=3D true )
     {
 		$cn->exec_sql("delete from action_gestion_related where aga_least=3D$1=
 and aga_greatest=3D$2",
 				array($_REQUEST['id'],$_REQUEST['ag_id']));

Modified: phpcompta/trunk/html/show_document_modele.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/show_document_modele.php	2012-06-12 22:21:33 UTC=
 (rev 4883)
+++ phpcompta/trunk/html/show_document_modele.php	2012-06-13 12:52:31 UTC=
 (rev 4884)
@@ -32,11 +32,10 @@
=20
=20
 require_once ('class_user.php');
-$User=3Dnew User($cn);
-/*!\todo Add security here
- */
-$User->Check();
-if ( $User->check_module("CFGDOC") =3D=3D 0 ) exit();
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->Check();
+if ( $g_user->check_module("CFGDOC") =3D=3D 0 ) exit();
 // retrieve the document
 $r=3D$cn->exec_sql("select md_id,md_lob,md_filename,md_mimetype
                  from document_modele where md_id=3D$1",array($_REQUEST[=
'md_id']));

Modified: phpcompta/trunk/html/show_pj.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/show_pj.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/show_pj.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -41,9 +41,10 @@
=20
=20
 include_once ('class_user.php');
-$User=3Dnew User($cn);
-$User->Check();
-$User->check_dossier($gDossier);
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
 // retrieve the jrn
 $r=3D$cn->exec_sql("select jr_def_id from jrn where jr_grpt_id=3D$jr_grp=
t_id");
@@ -55,7 +56,7 @@
 $a=3DDatabase::fetch_array($r,0);
 $jrn=3D$a['jr_def_id'];
=20
-if ($User->check_jrn($jrn) =3D=3D 'X' )
+if ($g_user->check_jrn($jrn) =3D=3D 'X' )
 {
     /* Cannot Access */
     NoAccess();

Modified: phpcompta/trunk/html/user_pref.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/user_pref.php	2012-06-12 22:21:33 UTC (rev 4883)
+++ phpcompta/trunk/html/user_pref.php	2012-06-13 12:52:31 UTC (rev 4884)
@@ -43,21 +43,19 @@
     $cn=3Dnew Database();
 }
=20
+global $g_user;
=20
-$User=3Dnew User($cn);
-$User->Check();
-
 // Met a jour le theme utilisateur (style)
 if ( isset ( $_POST['style_user']) )
 {
-    $User->update_global_pref('THEME',$_POST['style_user']);
+    $g_user->update_global_pref('THEME',$_POST['style_user']);
     $_SESSION['g_theme']=3D$_POST['style_user'];
=20
 }
 // Update the language
 if ( isset($_POST ['lang']))
 {
-    $User->update_global_pref('LANG',$_POST['lang']);
+    $g_user->update_global_pref('LANG',$_POST['lang']);
     $_SESSION['g_lang']=3D$_POST['lang'];
 }
=20
@@ -66,7 +64,7 @@
 // Met a jour le pagesize
 if ( isset ( $_POST['p_size']) )
 {
-    $User->update_global_pref('PAGESIZE',$_POST['p_size']);
+    $g_user->update_global_pref('PAGESIZE',$_POST['p_size']);
     $_SESSION['g_pagesize']=3D$_POST['p_size'];
=20
 }
@@ -80,7 +78,7 @@
 if ( isset ($_POST['val']) )
 {
     // Change the mini report
-    if ( isset ($_POST['minirap']))   $User->set_mini_report($_POST['min=
irap']);
+    if ( isset ($_POST['minirap']))   $g_user->set_mini_report($_POST['m=
inirap']);
 }
 // show the top menu depending of the use_style
 // comta style

Modified: phpcompta/trunk/include/ajax_auto_anc_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_auto_anc_card.php	2012-06-12 22:21:33 UT=
C (rev 4883)
+++ phpcompta/trunk/include/ajax_auto_anc_card.php	2012-06-13 12:52:31 UT=
C (rev 4884)
@@ -2,9 +2,8 @@
 require_once ("class_database.php");
 require_once 'class_user.php';
 $cn=3Dnew Database($_GET['gDossier']);
-$user=3Dnew User($cn);
-$user->Check();
-$user->check_dossier($_GET['gDossier']);
+
+
 if ( isset($_REQUEST['pa_id']) )
 {  =20
     $res=3D$cn->exec_sql("select po_name,po_description from  poste_anal=
ytique where pa_id=3D$1 ~* and (po_description ~* $2 or po_name ~* $3 ord=
er by po_id limit 12",

Modified: phpcompta/trunk/include/ajax_bank_saldo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_bank_saldo.php	2012-06-12 22:21:33 UTC (=
rev 4883)
+++ phpcompta/trunk/include/ajax_bank_saldo.php	2012-06-13 12:52:31 UTC (=
rev 4884)
@@ -49,10 +49,7 @@
     }
 }
=20
-$cn=3Dnew Database(dossier::id());
-$user=3Dnew User($cn);
-$user->check();
-if ( $user->check_jrn($_GET['j'])=3D=3D'X' ) return '{"saldo":"0"}';
+if ( $g_user->check_jrn($_GET['j'])=3D=3D'X' ) return '{"saldo":"0"}';
 /*  make a filter on the exercice */
=20
 $filter_year=3D"  j_tech_per in (select p_id from parm_periode ".

Modified: phpcompta/trunk/include/ajax_get_receipt.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_receipt.php	2012-06-12 22:21:33 UTC =
(rev 4883)
+++ phpcompta/trunk/include/ajax_get_receipt.php	2012-06-13 12:52:31 UTC =
(rev 4884)
@@ -50,10 +50,8 @@
 {
     exit();
 }
-$cn=3Dnew Database(dossier::id());
-$User=3Dnew User($cn);
-$User->Check();
=20
+
 $Ledger=3Dnew Acc_Ledger($cn,$l);
 $prop=3D$Ledger->get_propertie();
 $pj_seq=3D$Ledger->guess_pj();

Modified: phpcompta/trunk/include/ajax_mod_periode.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_mod_periode.php	2012-06-12 22:21:33 UTC =
(rev 4883)
+++ phpcompta/trunk/include/ajax_mod_periode.php	2012-06-13 12:52:31 UTC =
(rev 4884)
@@ -24,7 +24,7 @@
=20
 /* !\file
  * \brief display or save a periode
- * variable received $op, $cn $user
+ * variable received $op, $cn $g_user
  */
 $err =3D 0;
 $html =3D '';

Modified: phpcompta/trunk/include/class_acc_account_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-12 22:21=
:33 UTC (rev 4883)
+++ phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-13 12:52=
:31 UTC (rev 4884)
@@ -110,8 +110,8 @@
      */
     function get_row_date($p_from,$p_to,$let=3D0,$solded=3D0)
     {
-        $user=3Dnew User($this->db);
-        $filter_sql=3D$user->get_ledger_sql('ALL',3);
+        global $g_user;
+        $filter_sql=3D$g_user->get_ledger_sql('ALL',3);
         $sql_let=3D'';
         switch ($let)
         {

Modified: phpcompta/trunk/include/class_acc_balance.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_balance.php	2012-06-12 22:21:33 UTC=
 (rev 4883)
+++ phpcompta/trunk/include/class_acc_balance.php	2012-06-13 12:52:31 UTC=
 (rev 4884)
@@ -60,7 +60,7 @@
      */
     function get_row($p_from_periode,$p_to_periode)
     {
-
+        global $g_user;
         // filter on requested periode
         $per_sql=3Dsql_filter_per($this->db,$p_from_periode,$p_to_period=
e,'p_id','j_tech_per');
=20
@@ -72,7 +72,6 @@
         /* if several ledgers are asked then we filter here  */
         if ($this->jrn!=3D=3D null)
         {
-            $user=3Dnew User($this->db);
             /**
              *@file
              *@bug the get_ledger here is not valid and useless we just =
need a list of the=20
@@ -100,8 +99,7 @@
             $to_poste=3D" $and j_poste::text <=3D '".$this->to_poste."'"=
;
             $and=3D" and ";
         }
-        $user=3Dnew User($this->db);
-        $filter_sql=3D$user->get_ledger_sql('ALL',3);
+        $filter_sql=3D$g_user->get_ledger_sql('ALL',3);
=20
         // build query
         $sql=3D"select j_poste,sum(deb) as sum_deb, sum(cred) as sum_cre=
d from

Modified: phpcompta/trunk/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger.php	2012-06-12 22:21:33 UTC =
(rev 4883)
+++ phpcompta/trunk/include/class_acc_ledger.php	2012-06-13 12:52:31 UTC =
(rev 4884)
@@ -170,10 +170,10 @@
      */
     function reverse($p_date)
     {
+        global $g_user;
         if ( ! isset ($this->jr_id) || $this->jr_id=3D=3D'')
             throw new Exception ("this->jr_id is not set ou op=C3=A9rati=
on inconnue");
=20
-        $user=3Dnew User($this->db);
         /* check if the date is valid */
         if ( isDate($p_date) =3D=3D null )
             throw new Exception (_('Date invalide').$p_date);
@@ -250,7 +250,7 @@
                   from
                   jrnx
                   where   j_id=3D$6 returning j_id";
-            $Res=3D$this->db->exec_sql($sql,array($p_date,$grp_new,$p_in=
ternal,$user->id,$per->p_id,$row));
+            $Res=3D$this->db->exec_sql($sql,array($p_date,$grp_new,$p_in=
ternal,$g_user->id,$per->p_id,$row));
             // Check return code
             if ( $Res =3D=3D false)
                 throw (new Exception(__FILE__.__LINE__."sql a echoue [ $=
sql ]"));
@@ -356,7 +356,7 @@
      */
     function get_row($p_from,$p_to,$p_limit=3D-1,$p_offset=3D-1)
     {
-		global $g_user;
+	global $g_user;
         $periode=3Dsql_filter_per($this->db,$p_from,$p_to,'p_id','jr_tec=
h_per');
=20
         $cond_limite=3D($p_limit!=3D-1)?" limit ".$p_limit." offset ".$p=
_offset:"";
@@ -514,7 +514,7 @@
      */
     function get_rowSimple($p_from,$p_to,$trunc=3D0,$p_limit=3D-1,$p_off=
set=3D-1)
     {
-		global $g_user;
+	global $g_user;
         // Grand-livre : id=3D 0
         //---
         $jrn=3D($this->id =3D=3D 0 )?"and ".$g_user->get_ledger_sql():"a=
nd jrn_def_id =3D ".$this->id;
@@ -612,8 +612,7 @@
      */
     public function list_operation_to_reconcile($sql)
     {
-        global $g_parameter;
-        $user=3Dnew User($this->db);
+        global $g_parameter,$g_user;
         $gDossier=3Ddossier::id();
         $limit=3D" LIMIT 25";
         // Sort
@@ -786,9 +785,8 @@
      */
     public function list_operation($sql,$offset,$p_paid=3D0)
     {
-        global $g_parameter;
+        global $g_parameter,$g_user;
 		$table=3Dnew Sort_Table();
-        $user=3Dnew User($this->db);
         $gDossier=3Ddossier::id();
         $amount_paid=3D0.0;
         $amount_unpaid=3D0.0;
@@ -1273,8 +1271,8 @@
      */
     function select_ledger($p_type=3D"ALL",$p_access=3D3)
     {
-        $user=3Dnew User($this->db);
-        $array=3D$user->get_ledger($p_type,$p_access);
+        global $g_user;
+        $array=3D$g_user->get_ledger($p_type,$p_access);
=20
         if ( $array =3D=3D null ) return null;
         $idx=3D0;
@@ -1505,8 +1503,7 @@
      */
     function input($p_array=3Dnull,$p_readonly=3D0)
     {
-        global $g_parameter;
-        $user =3D new User($this->db);
+        global $g_parameter,$g_user;
=20
         if ( $p_readonly =3D=3D 1 )
             return $this->confirm($p_array);
@@ -1521,7 +1518,7 @@
         $add_js.=3D'get_last_date();';
=20
         $ret=3D"";
-		if ( $user->check_action(FICADD) =3D=3D 1)
+		if ( $g_user->check_action(FICADD) =3D=3D 1)
 		{
 			/* Add button */
 			$f_add_button=3Dnew IButton('add_card');
@@ -1555,11 +1552,11 @@
         //--
         if ($this->check_periode() =3D=3D true)
         {
-            $l_user_per=3D$user->get_periode();
+            $l_user_per=3D$g_user->get_periode();
             $def=3D(isset($periode))?$periode:$l_user_per;
=20
             $period=3Dnew IPeriod("period");
-            $period->user=3D$user;
+            $period->user=3D$g_user;
             $period->cn=3D$this->db;
             $period->value=3D$def;
             $period->type=3DOPEN;
@@ -1620,7 +1617,7 @@
         $ret.=3DHtmlInput::hidden('jrn_type',$this->get_type());
         $info=3D HtmlInput::infobulle(0);
         $info_poste=3DHtmlInput::infobulle(9);
-		if  ($user->check_action(FICADD)=3D=3D1)	$ret.=3D$f_add_button->input(=
);
+	if  ($g_user->check_action(FICADD)=3D=3D1)	$ret.=3D$f_add_button->input=
();
         $ret.=3D'<table id=3D"quick_item" style=3D"width:100%">';
         $ret.=3D'<tr>'.
               '<th style=3D"text-align:left">Quickcode'.$info.'</th>'.
@@ -1758,14 +1755,13 @@
     function verify($p_array)
     {
         extract ($p_array);
-        $user=3Dnew User($this->db);
+        global $g_user;
         $tot_cred=3D0;
         $tot_deb=3D0;
 		$msg=3Darray();
=20
         /* check if we can write into this ledger */
-        $user=3Dnew User($this->db);
-        if ( $user->check_jrn($p_jrn) !=3D 'W' )
+        if ( $g_user->check_jrn($p_jrn) !=3D 'W' )
             throw new Exception (_('Acc=C3=A8s interdit'),20);
=20
         /* check for a double reload */
@@ -2094,8 +2090,8 @@
      */
     public function get_first($p_type,$p_access=3D3)
     {
-        $user=3Dnew User($this->db);
-        $all=3D$user->get_ledger($p_type,$p_access);
+        global $g_user;
+        $all=3D$g_user->get_ledger($p_type,$p_access);
         return $all[0];
     }
=20
@@ -2323,10 +2319,10 @@
      */
     function  search_form($p_type,$all_type_ledger=3D1,$div=3D"")
     {
-        $user=3Dnew User($this->db);
+        global $g_user;
         $r=3D'';
         /* security : filter ledger on user */
-        $filter_ledger=3D$user->get_ledger($p_type,3);
+        $filter_ledger=3D$g_user->get_ledger($p_type,3);
=20
         $selected=3D(isset($_REQUEST['r_jrn'.$div]))?$_REQUEST['r_jrn'.$=
div]:null;
         $f_ledger=3DHtmlInput::select_ledger($filter_ledger,$selected,$d=
iv);
@@ -2340,7 +2336,7 @@
         }
         else
         {
-            $period=3D$user->get_periode();
+            $period=3D$g_user->get_periode();
             $per=3Dnew Periode($this->db,$period);
             $exercice=3D$per->get_exercice();
             list($per_start,$per_end)=3D$per->get_limit($exercice);
@@ -2509,8 +2505,8 @@
 			if ( isset($qcodesearch_op)) $qcode=3D$qcodesearch_op;
             $accounting=3D(isset($accounting))?$accounting:"";
 			$periode=3Dnew Periode($this->db);
-			$user=3Dnew User($this->db);
-			$p_id=3D$user->get_periode();
+			$g_user=3Dnew User($this->db);
+			$p_id=3D$g_user->get_periode();
 			if ( $p_id !=3D null )
 			{
 				list($date_start,$date_end)=3D$periode->get_date_limit($p_id);
@@ -2529,7 +2525,7 @@
         $fil_paid=3D'';
=20
         $and=3D'';
-        $user=3Dnew User($this->db);
+        $g_user=3Dnew User($this->db);
 	$p_action=3D$ledger_type;
 	if ( $p_action =3D=3D '') $p_action=3D'ALL';
         if ( $r_jrn =3D=3D -1 )
@@ -2539,7 +2535,7 @@
             if ( $p_action =3D=3D 'quick_writing') $p_action=3D'ODS';
=20
=20
-            $fil_ledger=3D$user->get_ledger_sql($p_action,3);
+            $fil_ledger=3D$g_user->get_ledger_sql($p_action,3);
             $and=3D' and ';
         }
         else
@@ -2547,7 +2543,7 @@
=20
             if ( $p_action =3D=3D 'quick_writing') $p_action=3D'ODS';
=20
-            $aLedger=3D$user->get_ledger($p_action,3);
+            $aLedger=3D$g_user->get_ledger($p_action,3);
             $fil_ledger=3D'';
             $sp=3D'';
             for ($i=3D0;$i < count($aLedger) ;$i ++)
@@ -2638,11 +2634,11 @@
             $and =3D" and ";
         }
=20
-        $User=3Dnew User(new Database());
-        $User->Check();
-        $User->check_dossier(dossier::id());
+        $g_user=3Dnew User(new Database());
+        $g_user->Check();
+        $g_user->check_dossier(dossier::id());
=20
-        if ( $User->admin =3D=3D 0 && $User->is_local_admin()=3D=3D0 )
+        if ( $g_user->admin =3D=3D 0 && $g_user->is_local_admin()=3D=3D0=
 )
         {
             $fil_sec=3D$and." jr_def_id in ( select uj_jrn_id ".
                      " from user_sec_jrn where ".
@@ -2698,8 +2694,8 @@
      */
     function get_last($p_limit)
     {
-        $user=3Dnew User($this->db);
-        $filter_ledger=3D$user->get_ledger_sql('ALL',3);
+        global $g_user;
+        $filter_ledger=3D$g_user->get_ledger_sql('ALL',3);
         $filter_ledger=3Dstr_replace('jrn_def_id','jr_def_id',$filter_le=
dger);
         $sql=3D"select jr_id,jr_pj_number,jr_date,to_char(jr_date,'DD.MM=
.YYYY') as jr_date_fmt,jr_montant, jr_comment,jr_internal from jrn ".
              " where $filter_ledger ".

Modified: phpcompta/trunk/include/class_acc_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-12 22:21:33 =
UTC (rev 4883)
+++ phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-13 12:52:31 =
UTC (rev 4884)
@@ -51,14 +51,14 @@
      */
     public function verify($p_array)
     {
+        global $g_user;
         extract ($p_array);
         /* check for a double reload */
         if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn w=
here jr_mt=3D$1',array($mt)) !=3D 0 )
             throw new Exception (_('Double Encodage'),5);
=20
         /* check if we can write into this ledger */
-        $user=3Dnew User($this->db);
-        if ( $user->check_jrn($p_jrn) !=3D 'W' )
+        if ( $g_user->check_jrn($p_jrn) !=3D 'W' )
             throw new Exception (_('Acc=C3=A8s interdit'),20);
=20
         /* check if there is a bank account linked to the ledger */
@@ -187,23 +187,22 @@
      */
     function input($p_array=3Dnull,$notused=3D0)
     {
-        global $g_parameter;
+        global $g_parameter,$g_user;
         if ( $p_array !=3D null)
             extract ($p_array);
=20
         $pview_only=3Dfalse;
-        $user =3D new User($this->db);
=20
         $f_add_button=3Dnew IButton('add_card');
         $f_add_button->label=3D_('Cr=C3=A9er une nouvelle fiche');
         $f_add_button->set_attribute('ipopup','ipop_newcard');
         $f_add_button->set_attribute('jrn',$this->id);
         $f_add_button->javascript=3D" this.jrn=3D\$('p_jrn').value;selec=
t_card_type(this);";
-        $str_add_button=3D($user->check_action(FICADD)=3D=3D1)?$f_add_bu=
tton->input():"";
+        $str_add_button=3D($g_user->check_action(FICADD)=3D=3D1)?$f_add_=
button->input():"";
=20
         // The first day of the periode
         $pPeriode=3Dnew Periode($this->db);
-        list ($l_date_start,$l_date_end)=3D$pPeriode->get_date_limit($us=
er->get_periode());
+        list ($l_date_start,$l_date_end)=3D$pPeriode->get_date_limit($g_=
user->get_periode());
         if (  $g_parameter->MY_DATE_SUGGEST=3D=3D'Y' )
             $op_date=3D( ! isset($e_date) ) ?$l_date_start:$e_date;
         else
@@ -223,12 +222,12 @@
         {
             // Periode
             //--
-            $l_user_per=3D(isset($periode))?$periode:$user->get_periode(=
);
+            $l_user_per=3D(isset($periode))?$periode:$g_user->get_period=
e();
             $period=3Dnew IPeriod();
             $period->cn=3D$this->db;
             $period->type=3DOPEN;
             $period->value=3D$l_user_per;
-            $period->user=3D$user;
+            $period->user=3D$g_user;
             $period->name=3D'periode';
             try
             {
@@ -874,6 +873,7 @@
      */
     function show_ledger()
     {
+        global $g_user;
         echo dossier::hidden();
         $hid=3Dnew IHidden();
=20
@@ -886,11 +886,10 @@
         $hid->value=3D"l";
         echo $hid->input();
=20
-        $User=3Dnew User($this->db);
=20
         $w=3Dnew ISelect();
         // filter on the current year
-        $filter_year=3D" where p_exercice=3D'".$User->get_exercice()."'"=
;
+        $filter_year=3D" where p_exercice=3D'".$g_user->get_exercice()."=
'";
=20
         $periode_start=3D$this->db->make_array("select p_id,to_char(p_st=
art,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",=
1);
         // User is already set User=3Dnew User($this->db);
@@ -948,13 +947,13 @@
         else
         {
             $filter_per=3D" and jr_tech_per in (select p_id from parm_pe=
riode where p_exercice::integer=3D".
-                        $User->get_exercice().")";
+                        $g_user->get_exercice().")";
         }
         /* security  */
         if( $this->id !=3D -1)
-            $available_ledger=3D" and jr_def_id=3D ".$this->id." and ".$=
User->get_ledger_sql();
+            $available_ledger=3D" and jr_def_id=3D ".$this->id." and ".$=
g_user->get_ledger_sql();
         else
-            $available_ledger=3D" and ".$User->get_ledger_sql();
+            $available_ledger=3D" and ".$g_user->get_ledger_sql();
         // Show list of sell
         // Date - date of payment - Customer - amount
         $sql=3DSQL_LIST_ALL_INVOICE.$filter_per." and jr_def_type=3D'FIN=
'".

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-12 22:2=
1:33 UTC (rev 4883)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-13 12:5=
2:31 UTC (rev 4884)
@@ -60,11 +60,10 @@
      */
     public function verify($p_array)
     {
-        global $g_parameter;
+        global $g_parameter,$g_user;
         extract ($p_array);
         /* check if we can write into this ledger */
-        $user=3Dnew User($this->db);
-        if ( $user->check_jrn($p_jrn) !=3D 'W' )
+        if ( $g_user->check_jrn($p_jrn) !=3D 'W' )
             throw new Exception (_('Acc=C3=A8s interdit'),20);
=20
=20
@@ -880,10 +879,9 @@
      */
     public function input($p_array=3Dnull,$p_readonly=3D0)
     {
-        global $g_parameter;
+        global $g_parameter,$g_user;
         if ( $p_array !=3D null ) extract($p_array);
=20
-        $user =3D new User($this->db);
         $flag_tva=3D$g_parameter->MY_TVA_USE;
         /* Add button */
         $f_add_button=3Dnew IButton('add_card');
@@ -900,14 +898,14 @@
         $f_add_button2->javascript=3D"  this.jrn=3D\$('p_jrn').value;sel=
ect_card_type(this);";
 		$str_add_button=3D"";
 		$str_add_button2=3D"";
-		if ($user->check_action(FICADD)=3D=3D1)
+		if ($g_user->check_action(FICADD)=3D=3D1)
 		{
 			$str_add_button=3D$f_add_button->input();
 			$str_add_button2=3D$f_add_button2->input();
 		}
         // The first day of the periode
         $oPeriode=3Dnew Periode($this->db);
-        list ($l_date_start,$l_date_end)=3D$oPeriode->get_date_limit($us=
er->get_periode());
+        list ($l_date_start,$l_date_end)=3D$oPeriode->get_date_limit($g_=
user->get_periode());
         if (  $g_parameter->MY_DATE_SUGGEST=3D=3D'Y' )
             $op_date=3D( ! isset($e_date) ) ?$l_date_start:$e_date;
         else
@@ -940,11 +938,11 @@
         {
             // Periode
             //--
-            $l_user_per=3D$user->get_periode();
+            $l_user_per=3D$g_user->get_periode();
             $def=3D(isset($periode))?$periode:$l_user_per;
=20
             $period=3Dnew IPeriod("period");
-            $period->user=3D$user;
+            $period->user=3D$g_user;
             $period->cn=3D$this->db;
             $period->value=3D$def;
             $period->type=3DOPEN;

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-12 22:21:33=
 UTC (rev 4883)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-13 12:52:31=
 UTC (rev 4884)
@@ -58,15 +58,14 @@
      */
     public function verify($p_array)
     {
-        global $g_parameter;
+        global $g_parameter,$g_user;
         extract ($p_array);
         /* check for a double reload */
         if (  isset($mt) && $this->db->count_sql('select jr_mt from jrn =
where jr_mt=3D$1',array($mt)) !=3D 0 )
             throw new Exception (_('Double Encodage'),5);
=20
         /* check if we can write into this ledger */
-        $user=3Dnew User($this->db);
-        if ( $user->check_jrn($p_jrn) !=3D 'W' )
+        if ( $g_user->check_jrn($p_jrn) !=3D 'W' )
             throw new Exception (_('Acc=C3=A8s interdit'),20);
=20
         /* check if there is a customer */
@@ -1001,9 +1000,9 @@
     */
     function input($p_array=3Dnull,$p_readonly=3D0)
     {
-        global $g_parameter;
+        global $g_parameter,$g_user;
         if ( $p_array !=3D null ) extract($p_array);
-        $user =3D new User($this->db);
+
         $flag_tva=3D$g_parameter->MY_TVA_USE;
         /* Add button */
         $f_add_button=3Dnew IButton('add_card');
@@ -1021,14 +1020,14 @@
=20
 		$str_add_button=3D"";
 		$str_add_button2=3D"";
-		if ($user->check_action(FICADD)=3D=3D1)
+		if ($g_user->check_action(FICADD)=3D=3D1)
 		{
 			$str_add_button=3D$f_add_button->input();
 			$str_add_button2=3D$f_add_button2->input();
 		}
         // The first day of the periode
         $oPeriode=3Dnew Periode($this->db);
-        list ($l_date_start,$l_date_end)=3D$oPeriode->get_date_limit($us=
er->get_periode());
+        list ($l_date_start,$l_date_end)=3D$oPeriode->get_date_limit($g_=
user->get_periode());
         if (  $g_parameter->MY_DATE_SUGGEST=3D=3D'Y' )
             $op_date=3D( ! isset($e_date) ) ?$l_date_start:$e_date;
         else
@@ -1058,11 +1057,11 @@
         //--
         if ($this->check_periode() =3D=3D true)
         {
-            $l_user_per=3D$user->get_periode();
+            $l_user_per=3D$g_user->get_periode();
             $def=3D(isset($periode))?$periode:$l_user_per;
=20
             $period=3Dnew IPeriod("period");
-            $period->user=3D$user;
+            $period->user=3D$g_user;
             $period->cn=3D$this->db;
             $period->value=3D$def;
             $period->type=3DOPEN;

Modified: phpcompta/trunk/include/class_acc_operation.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_operation.php	2012-06-12 22:21:33 U=
TC (rev 4883)
+++ phpcompta/trunk/include/class_acc_operation.php	2012-06-13 12:52:31 U=
TC (rev 4884)
@@ -50,11 +50,11 @@
      */
     function __construct($p_cn)
     {
+        global $g_user;
         $this->db=3D$p_cn;
         $this->qcode=3D"";
         $this->user=3D$_SESSION['g_user'];
-        $user=3Dnew User($this->db);
-        $this->periode=3D$user->get_periode();
+        $this->periode=3D$g_user->get_periode();
         $this->jr_id=3D0;
     }
     /**
@@ -247,8 +247,8 @@
      */
     function get_jrnx_detail()
     {
-        $user=3Dnew User($this->db);
-        $filter_sql=3D$user->get_ledger_sql('ALL',3);
+        global $g_user;
+        $filter_sql=3D$g_user->get_ledger_sql('ALL',3);
         $filter_sql=3Dstr_replace('jrn_def_id','jr_def_id',$filter_sql);
         if ( $this->jr_id=3D=3D0 ) return;
         $sql=3D" select  jr_date,j_qcode,j_poste,j_montant,jr_internal,c=
ase when j_debit =3D 'f' then 'C' else 'D' end as debit,jr_comment as des=
cription,

Modified: phpcompta/trunk/include/class_acc_reconciliation.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_reconciliation.php	2012-06-12 22:21=
:33 UTC (rev 4883)
+++ phpcompta/trunk/include/class_acc_reconciliation.php	2012-06-13 12:52=
:31 UTC (rev 4884)
@@ -281,9 +281,9 @@
      */
     function ledger_filter ()
     {
+        global $g_user;
         /* get the available ledgers for current user */
-        $user=3Dnew User($this->db);
-        $sql=3D$user->get_ledger_sql('ALL',3);
+        $sql=3D$g_user->get_ledger_sql('ALL',3);
         $sql=3Dstr_replace('jrn_def_id','jr_def_id',$sql);
         $r=3D'';
         /* filter by this->r_jrn */
@@ -373,8 +373,8 @@
    */
     function filter_date()
     {
-      $user=3Dnew User($this->db);
-      list($start,$end)=3D$user->get_limit_current_exercice();
+      global $g_user;
+      list($start,$end)=3D$g_user->get_limit_current_exercice();
=20
       if (isDate($this->start_day) =3D=3Dnull)
 	{

Modified: phpcompta/trunk/include/class_anticipation.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_anticipation.php	2012-06-12 22:21:33 UT=
C (rev 4883)
+++ phpcompta/trunk/include/class_anticipation.php	2012-06-13 12:52:31 UT=
C (rev 4884)
@@ -194,7 +194,6 @@
      */
     private function form_cat_mod()
     {
-      $user=3Dnew User($this->cn);
         $a=3Dnew Forecast($this->cn,$this->f_id);
         $a->load();
         $name=3Dnew IText('an_name');
@@ -207,7 +206,7 @@
 	$start_date->cn=3D$this->cn;
 	$start_date->show_end_date=3Dfalse;
 	$start_date->show_start_date=3Dtrue;
-	$start_date->user=3D$user;
+	$start_date->user=3D$g_user;
 	$start_date->filter_year=3Dfalse;
=20
 	$end_date=3Dnew IPeriod('end_date');
@@ -215,7 +214,7 @@
 	$end_date->cn=3D$this->cn;
 	$end_date->show_end_date=3Dtrue;
 	$end_date->show_start_date=3Dfalse;
-	$end_date->user=3D$user;
+	$end_date->user=3D$g_user;
 	$end_date->filter_year=3Dfalse;
=20
 	$start_date->value=3D$a->f_start_date;
@@ -256,7 +255,7 @@
      */
     private function form_cat_new()
     {
-      $user=3Dnew User($this->cn);
+     global $g_user;
       $r=3D"";
         $str_action=3D_('Nouveau');
=20
@@ -268,7 +267,7 @@
 	$start_date->cn=3D$this->cn;
 	$start_date->show_end_date=3Dfalse;
 	$start_date->show_start_date=3Dtrue;
-	$start_date->user=3D$user;
+	$start_date->user=3D$g_user;
 	$start_date->filter_year=3Dfalse;
=20
 	$end_date=3Dnew IPeriod('end_date');
@@ -276,10 +275,10 @@
 	$end_date->cn=3D$this->cn;
 	$end_date->show_end_date=3Dtrue;
 	$end_date->show_start_date=3Dfalse;
-	$end_date->user=3D$user;
+	$end_date->user=3D$g_user;
 	$end_date->filter_year=3Dfalse;
=20
-	$period=3D$user->get_periode();
+	$period=3D$g_user->get_periode();
 	$per=3Dnew Periode($this->cn,$period);
 	$year=3D$per->get_exercice();
=20

Modified: phpcompta/trunk/include/class_calendar.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_calendar.php	2012-06-12 22:21:33 UTC (r=
ev 4883)
+++ phpcompta/trunk/include/class_calendar.php	2012-06-13 12:52:31 UTC (r=
ev 4884)
@@ -135,6 +135,7 @@
      */
     function get_preference()
     {
+        global $g_user;
         $cn=3Dnew Database(dossier::id());
         $today=3Ddate('d.m.Y');
         $p_id=3D$cn->get_value("
@@ -146,10 +147,9 @@
                 array($today));
         if ( $p_id =3D=3D '')
         {
-            $user=3Dnew User($cn);
-            $p_id=3D$user->get_periode();
+            $p_id=3D$g_user->get_periode();
         }
-		$this->default_periode=3D$p_id;
+	$this->default_periode=3D$p_id;
         return  $p_id;
     }
     /**

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-12 22:21:33 UTC (rev =
4883)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-13 12:52:31 UTC (rev =
4884)
@@ -71,9 +71,8 @@
    */
     function get_bk_account()
     {
-
-      $user=3Dnew User($this->cn);
-      $sql_ledger=3D$user->get_ledger_sql('FIN',3);
+        global $g_user;
+      $sql_ledger=3D$g_user->get_ledger_sql('FIN',3);
       $avail=3D$this->cn->get_array("select jrn_def_id,jrn_def_bank from=
 jrn_def where jrn_def_type=3D'FIN' and $sql_ledger
                             order by jrn_def_name");
=20
@@ -861,6 +860,7 @@
      */
     function update($p_array=3Dnull)
     {
+        global $g_user;
         if ( $p_array =3D=3D null)
             $p_array=3D$_POST;
=20
@@ -917,8 +917,7 @@
                                              " f_id=3D".$this->id);
                     if ( $st =3D=3D 0 )
                     {
-                        $user=3Dnew User($this->cn);
-                        $exercice=3D$user->get_exercice();
+                        $exercice=3D$g_user->get_exercice();
                         if ( $exercice =3D=3D 0 ) throw new Exception ('=
Annee invalide erreur');
=20
                         $str_stock=3Dsprintf('insert into stock_goods(f_=
id,sg_quantity,sg_comment,sg_code,sg_type,sg_exercice) '.
@@ -1146,13 +1145,13 @@
      */
     function get_row_date($p_from,$p_to,$op_let=3D0)
     {
+        global $g_user;
         if ( $this->id =3D=3D 0 )
         {
             echo_error("class_fiche",__LINE__,"id is 0");
             return;
         }
-        $user=3Dnew User($this->cn);
-        $filter_sql=3D$user->get_ledger_sql('ALL',3);
+        $filter_sql=3D$g_user->get_ledger_sql('ALL',3);
         $sql_let=3D'';
         switch ($op_let)
         {
@@ -1551,17 +1550,17 @@
      */
     function Summary($p_search=3D"",$p_action=3D"",$p_sql=3D"",$p_amount=
=3Dfalse)
     {
-
+        global $g_user;
         $str_dossier=3Ddossier::get();
         $p_search=3Dsql_string($p_search);
         $script=3D$_SERVER['PHP_SELF'];
         // Creation of the nav bar
         // Get the max numberRow
         $filter_amount=3D'';
-        $User=3Dnew User($this->cn);
+        global $g_user;
=20
         $filter_year=3D"  j_tech_per in (select p_id from parm_periode "=
.
-                     "where p_exercice=3D'".$User->get_exercice()."')";
+                     "where p_exercice=3D'".$g_user->get_exercice()."')"=
;
=20
         if ( $p_amount) $filter_amount=3D' and f_id in (select f_id from=
 jrnx where  '.$filter_year.')';
=20
@@ -1574,8 +1573,7 @@
         // set a filter ?
         $search=3D$p_sql;
=20
-        $user=3Dnew User($this->cn);
-        $exercice=3D$user->get_exercice();
+        $exercice=3D$g_user->get_exercice();
         $tPeriode=3Dnew Periode($this->cn);
         list($max,$min)=3D$tPeriode->get_limit($exercice);
=20

Modified: phpcompta/trunk/include/class_impress.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_impress.php	2012-06-12 22:21:33 UTC (re=
v 4883)
+++ phpcompta/trunk/include/class_impress.php	2012-06-13 12:52:31 UTC (re=
v 4884)
@@ -43,7 +43,7 @@
      */
     static function parse_formula($p_cn,$p_label,$p_formula,$p_start,$p_=
end,$p_eval=3Dtrue,$p_type_date=3D0)
     {
-
+        global $g_user;
         if ( Impress::check_formula($p_formula) =3D=3D false)
         {
             if ( $p_eval =3D=3D true)
@@ -96,8 +96,7 @@
                       {
=20
                         // retrieve the first month of this periode
-                        $User=3Dnew User($p_cn);
-                        $user_periode=3D$User->get_periode();
+                        $user_periode=3D$g_user->get_periode();
                         $oPeriode=3Dnew Periode($p_cn);
                         $periode=3D$oPeriode->get_exercice($user_periode=
);
                         list($first,$last)=3D$oPeriode->get_limit($perio=
de);
@@ -121,8 +120,7 @@
                             /* if none periode is found
                                then we take the first periode of the yea=
r
                             */
-                            $User=3Dnew User($p_cn);
-                            $user_periode=3D$User->get_periode();
+                            $user_periode=3D$g_user->get_periode();
=20
                             $year=3D$oPeriode->get_exercice($user_period=
e);
                             list($first,$last)=3D$oPeriode->get_limit($y=
ear);

Modified: phpcompta/trunk/include/export_balance_csv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_balance_csv.php	2012-06-12 22:21:33 UT=
C (rev 4883)
+++ phpcompta/trunk/include/export_balance_csv.php	2012-06-13 12:52:31 UT=
C (rev 4884)
@@ -48,7 +48,7 @@
     if (  isset($_GET['r_jrn']))
     {
         $selected=3D$_GET['r_jrn'];
-        $array_ledger=3D$User->get_ledger('ALL',3);
+        $array_ledger=3D$g_user->get_ledger('ALL',3);
         for ($e=3D0;$e<count($array_ledger);$e++)
         {
             if (isset ($selected[$e]))

Modified: phpcompta/trunk/include/export_balance_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_balance_pdf.php	2012-06-12 22:21:33 UT=
C (rev 4883)
+++ phpcompta/trunk/include/export_balance_pdf.php	2012-06-13 12:52:31 UT=
C (rev 4884)
@@ -42,8 +42,7 @@
 $cn=3Dnew Database($gDossier);
 $rep=3Dnew Database();
 require_once ('class_user.php');
-$User=3Dnew User($cn);
-$User->Check();
+$g_user->Check();
=20
 $bal=3Dnew Acc_Balance($cn);
=20
@@ -58,7 +57,7 @@
     if (  isset($_GET['r_jrn']))
     {
         $selected=3D$_GET['r_jrn'];
-        $array_ledger=3D$User->get_ledger('ALL',3);
+        $array_ledger=3D$g_user->get_ledger('ALL',3);
         for ($e=3D0;$e<count($array_ledger);$e++)
         {
             if (isset ($selected[$e]))

Modified: phpcompta/trunk/include/export_fiche_balance_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-12 22:21=
:33 UTC (rev 4883)
+++ phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-13 12:52=
:31 UTC (rev 4884)
@@ -36,9 +36,8 @@
 /* Security */
 $gDossier=3Ddossier::id();
 $cn=3Dnew Database($gDossier);
-$User=3Dnew User($cn);
-$User->Check();
-$User->check_dossier($gDossier);
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
 $pdf=3Dnew PDF($cn);
 $pdf->setDossierInfo("  Periode : ".$_GET['start']." - ".$_GET['end']);

Modified: phpcompta/trunk/include/export_fiche_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_pdf.php	2012-06-12 22:21:33 UTC =
(rev 4883)
+++ phpcompta/trunk/include/export_fiche_pdf.php	2012-06-13 12:52:31 UTC =
(rev 4884)
@@ -36,9 +36,8 @@
 /* Security */
 $gDossier=3Ddossier::id();
 $cn=3Dnew Database($gDossier);
-$User=3Dnew User($cn);
-$User->Check();
-$User->check_dossier($gDossier);
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
 $pdf=3Dnew PDF($cn);
 $pdf->setDossierInfo("  Periode : ".$_GET['start']." - ".$_GET['end']);

Modified: phpcompta/trunk/include/export_gl_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_gl_pdf.php	2012-06-12 22:21:33 UTC (re=
v 4883)
+++ phpcompta/trunk/include/export_gl_pdf.php	2012-06-13 12:52:31 UTC (re=
v 4884)
@@ -38,9 +38,8 @@
=20
 /* Security */
 $cn=3Dnew Database($gDossier);
-$User=3Dnew User($cn);
-$User->Check();
-$User->check_dossier($gDossier);
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
 $sql=3D"select pcm_val from tmp_pcmn ";
=20

Modified: phpcompta/trunk/include/export_ledger_csv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_ledger_csv.php	2012-06-12 22:21:33 UTC=
 (rev 4883)
+++ phpcompta/trunk/include/export_ledger_csv.php	2012-06-13 12:52:31 UTC=
 (rev 4884)
@@ -37,11 +37,10 @@
=20
=20
 require_once ('class_user.php');
-$User=3Dnew User($cn);
-$User->Check();
-$User->check_dossier($gDossier);
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
-if ($_GET['jrn_id']!=3D0 &&  $User->check_jrn($_GET['jrn_id']) =3D=3D'X'=
)
+if ($_GET['jrn_id']!=3D0 &&  $g_user->check_jrn($_GET['jrn_id']) =3D=3D'=
X')
 {
     NoAccess();
     exit();

Modified: phpcompta/trunk/include/export_ledger_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_ledger_pdf.php	2012-06-12 22:21:33 UTC=
 (rev 4883)
+++ phpcompta/trunk/include/export_ledger_pdf.php	2012-06-13 12:52:31 UTC=
 (rev 4884)
@@ -52,9 +52,8 @@
 $Jrn=3Dnew Acc_Ledger($cn,$_GET['jrn_id']);
=20
 $Jrn->get_name();
-$User=3Dnew User($cn);
-$User->Check();
-$User->check_dossier($gDossier);
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
 // Security
 if ( $_GET['jrn_id']!=3D0 &&  $User->check_jrn($_GET['jrn_id']) =3D=3D '=
X' )

Modified: phpcompta/trunk/include/extension_choice.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/extension_choice.inc.php	2012-06-12 22:21:33 =
UTC (rev 4883)
+++ phpcompta/trunk/include/extension_choice.inc.php	2012-06-13 12:52:31 =
UTC (rev 4884)
@@ -13,9 +13,10 @@
 @html_page_start($_SESSION['g_theme']);
=20
 $cn=3Dnew Database(dossier::id());
-$user=3Dnew User($cn);
-$user->check();
-$only_plugin=3D$user->check_dossier(dossier::id());
+global $g_user;
+$g_user=3Dnew User($cn);
+$g_user->check();
+$only_plugin=3D$g_user->check_dossier(dossier::id());
=20
=20
 /* javascript file */

Modified: phpcompta/trunk/include/impress_poste.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/impress_poste.inc.php	2012-06-12 22:21:33 UTC=
 (rev 4883)
+++ phpcompta/trunk/include/impress_poste.inc.php	2012-06-13 12:52:31 UTC=
 (rev 4884)
@@ -27,7 +27,7 @@
  * \brief Print account (html or pdf)
  *        file included from user_impress
  *
- * some variable are already defined $cn, $User ...
+ * some variable are already defined $cn, $g_user ...
  *
  */
 //-----------------------------------------------------
@@ -35,7 +35,7 @@
 //-----------------------------------------------------
 require_once('class_database.php');
 require_once('class_ipopup.php');
-global $User;
+global $g_user;
=20
 echo IPoste::ipopup('ipop_account');
 echo ICard::ipopup('ipopcard');

Modified: phpcompta/trunk/include/opening.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/opening.inc.php	2012-06-12 22:21:33 UTC (rev =
4883)
+++ phpcompta/trunk/include/opening.inc.php	2012-06-13 12:52:31 UTC (rev =
4884)
@@ -33,8 +33,7 @@
 require_once('class_acc_ledger.php');
=20
 $sa =3D (isset($_REQUEST['sa'])) ? $_REQUEST['sa'] : '';
-$User =3D new User(new Database(dossier::id()));
-$User->Check();
+$g_user->Check();
=20
 require_once 'user_menu.php';
=20
@@ -103,7 +102,7 @@
 	echo '<fieldset><legend> Etape 1 </legend>';
=20
 	echo 'Choississez le dossier o=C3=B9 sont les soldes =C3=A0 importer';
-	$avail =3D $User->get_available_folder();
+	$avail =3D $g_user->get_available_folder();
=20
 	if (empty($avail))
 	{
@@ -180,8 +179,8 @@
 	echo HtmlInput::hidden('f', $_REQUEST['f']);
 	echo HtmlInput::hidden('p_periode', $_REQUEST['p_periode']);
 	$wLedger =3D new ISelect();
-	$User =3D new User(new Database(dossier::id()));
-	$avail =3D $User->get_ledger('ODS');
+	$g_user =3D new User(new Database(dossier::id()));
+	$avail =3D $g_user->get_ledger('ODS');
 	/* compute select list */
 	$array =3D array();
 	$i =3D 0;
@@ -233,7 +232,7 @@
 		$idx++;
 	}
 	$cn =3D new Database(dossier::id());
-	$User =3D new User($cn);
+
 	$jrn =3D new Acc_Ledger($cn, $_REQUEST['p_jrn']);
=20
 	echo '<form class=3D"print" method=3D"post">';

Modified: phpcompta/trunk/include/param_pcmn.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/param_pcmn.inc.php	2012-06-12 22:21:33 UTC (r=
ev 4883)
+++ phpcompta/trunk/include/param_pcmn.inc.php	2012-06-13 12:52:31 UTC (r=
ev 4884)
@@ -35,9 +35,6 @@
 $cn=3Dnew Database($gDossier);
=20
 include_once ("class_user.php");
-$User=3Dnew User($cn);
-$User->Check();
-$User->check_dossier($gDossier);
=20
 include_once ("user_menu.php");
=20

Modified: phpcompta/trunk/include/param_sec.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/param_sec.inc.php	2012-06-12 22:21:33 UTC (re=
v 4883)
+++ phpcompta/trunk/include/param_sec.inc.php	2012-06-13 12:52:31 UTC (re=
v 4884)
@@ -36,11 +36,10 @@
=20
 /* Admin. Dossier */
 $cn=3Dnew Database($gDossier);
-$User=3Dnew User($cn);
+global $g_user;
+$g_user->Check();
+$g_user->check_dossier($gDossier);
=20
-$User->Check();
-$User->check_dossier($gDossier);
-
 include_once ("user_menu.php");
=20
 ////////////////////////////////////////////////////////////////////////=
/

Modified: phpcompta/trunk/include/preod.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/preod.inc.php	2012-06-12 22:21:33 UTC (rev 48=
83)
+++ phpcompta/trunk/include/preod.inc.php	2012-06-13 12:52:31 UTC (rev 48=
84)
@@ -29,7 +29,6 @@
 require_once('class_database.php');
 require_once('ac_common.php');
 require_once('class_pre_operation.php');
-$user=3Dnew User(new Database(dossier::id()));
 echo '<div class=3D"content">';
 echo '<form method=3D"GET">';
 $sel=3Dnew ISelect();

Modified: phpcompta/trunk/include/report.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/report.inc.php	2012-06-12 22:21:33 UTC (rev 4=
883)
+++ phpcompta/trunk/include/report.inc.php	2012-06-13 12:52:31 UTC (rev 4=
884)
@@ -39,10 +39,7 @@
 /* Admin. Dossier */
 $rep=3Dnew Database($gDossier);
=20
-$User=3Dnew User($rep);
-$User->Check();
=20
-
 $cn=3Dnew Database($gDossier);
=20
 $rap=3Dnew Acc_Report($cn);

Modified: phpcompta/trunk/include/search.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/search.inc.php	2012-06-12 22:21:33 UTC (rev 4=
883)
+++ phpcompta/trunk/include/search.inc.php	2012-06-13 12:52:31 UTC (rev 4=
884)
@@ -33,9 +33,6 @@
=20
 $cn=3Dnew Database($gDossier);
 include_once ('class_user.php');
-$User=3Dnew User($cn);
-$User->Check();
-$act=3D$User->check_dossier($gDossier);
 // display a search box
=20
=20
@@ -104,7 +101,7 @@
 	if ( ! isset ($array['date_start']) || ! isset ($array['date_end']))
 	{
 		// get first date of current exercice
-		list($array['date_start'],$array['date_end'])=3D$User->get_limit_curre=
nt_exercice();
+		list($array['date_start'],$array['date_end'])=3D$g_user->get_limit_cur=
rent_exercice();
 	}
=20
     list($sql,$where)=3D$ledger->build_search_sql($array);

Modified: phpcompta/trunk/include/user_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/user_common.php	2012-06-12 22:21:33 UTC (rev =
4883)
+++ phpcompta/trunk/include/user_common.php	2012-06-13 12:52:31 UTC (rev =
4884)
@@ -51,7 +51,7 @@
  */
 function InsertStockGoods($p_cn,$p_j_id,$p_good,$p_quant,$p_type)
 {
-
+    global $g_user;
     // Retrieve the good account for stock
     $code=3Dnew Fiche($p_cn);
     $code->get_by_qcode($p_good);
@@ -61,8 +61,7 @@
     $Res=3D$p_cn->exec_sql($sql);
     $r=3DDatabase::fetch_array($Res,0);
     $f_id=3D$r['f_id'];
-    $user=3Dnew User($p_cn);
-    $exercice=3D$user->get_exercice();
+    $exercice=3D$g_user->get_exercice();
     if ( $exercice =3D=3D 0 ) throw new Exception ('Annee invalide erreu=
r');
=20
=20

Modified: phpcompta/trunk/include/verif_bilan.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/verif_bilan.inc.php	2012-06-12 22:21:33 UTC (=
rev 4883)
+++ phpcompta/trunk/include/verif_bilan.inc.php	2012-06-13 12:52:31 UTC (=
rev 4884)
@@ -28,11 +28,10 @@
 require_once('class_acc_bilan.php');
=20
 $cn=3Dnew Database(dossier::id());
-$User=3Dnew User($cn);
-$exercice=3D$User->get_exercice();
+$exercice=3D$g_user->get_exercice();
 echo '<div class=3D"content">';
-$User->db=3D$cn;
-$sql_year=3D" and j_tech_per in (select p_id from parm_periode where p_e=
xercice=3D'".$User->get_exercice()."')";
+
+$sql_year=3D" and j_tech_per in (select p_id from parm_periode where p_e=
xercice=3D'".$g_user->get_exercice()."')";
 echo '<fieldset><legend>V=C3=A9rification des journaux</legend>';
 echo '<ol>';
 $deb=3D$cn->get_value("select sum (j_montant) from jrnx where j_debit=3D=
't' $sql_year ");



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 12:39:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Seqb4-0003J8-Uu
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 12:39:06 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 18:30:22 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.191716.1339605545.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4885 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 16:39:05 -0000

Author: danydb
Date: 2012-06-13 18:30:21 +0200 (Wed, 13 Jun 2012)
New Revision: 4885

Added:
   phpcompta/trunk/include/class_phpcompta_sql.php
Log:
New class to abstract object to table

Added: phpcompta/trunk/include/class_phpcompta_sql.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_phpcompta_sql.php	                     =
   (rev 0)
+++ phpcompta/trunk/include/class_phpcompta_sql.php	2012-06-13 16:30:21 U=
TC (rev 4885)
@@ -0,0 +1,261 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief
+ * this wrapper is used to created easily a wrapper to a table
+ *
+ *@class
+ * Match a table into an object, you need to add the code for each table
+ *@note : the primary key must be an integer
+ *
+ * @code
+class table_name_sql extends phpcompta_sql
+{
+
+	function __construct($p_id=3D-1)
+	{
+		$this->table =3D "schema.table";
+		$this->primary_key =3D "o_id";
+
+		$this->name=3Darray(
+			"id"=3D>"o_id",
+			"dolibarr"=3D>"o_doli",
+			"date"=3D>"o_date",
+			"qcode"=3D>"o_qcode",
+			"fiche"=3D>"f_id",
+
+
+		);
+
+		$this->type =3D array(
+			"o_id"=3D>"numeric",
+			"o_doli"=3D>"numeric",
+			"o_date"=3D>"date",
+			"o_qcode"=3D>"text",
+			"f_id"=3D>"numeric",
+
+			);
+
+		$this->default =3D array(
+			"o_id" =3D> "auto",
+		);
+		$this->date_format =3D "DD.MM.YYYY";
+		global $cn;
+
+		parent::__construct($cn,$p_id);
+	}
+
+}
+ * @endcode
+ *
+ */
+class phpcompta_sql
+{
+
+	function __construct(&$p_cn, $p_id =3D -1)
+	{
+		$this->cn =3D $p_cn;
+		$pk=3D$this->primary_key;
+		$this->$pk=3D $p_id;
+
+		if ($p_id =3D=3D -1)
+		{
+			/* Initialize an empty object */
+			foreach ($this->name as $key )
+			{
+				$this->$key=3D null;
+			}
+			$this->$pk=3D $p_id;
+		}
+		else
+		{
+			/* load it */
+			$this->load();
+		}
+	}
+
+	public function getp($p_string)
+	{
+		if (array_key_exists( $p_string,$this->name))
+		{
+			$idx =3D $this->name[$p_string];
+			return $this->$idx;
+		}
+		else
+			throw new Exception(__FILE__ . ":" . __LINE__ . $p_string . 'Erreur a=
ttribut inexistant '.$p_string);
+	}
+
+	public function setp($p_string, $p_value)
+	{
+		if (array_key_exists( $p_string,$this->name))
+		{
+			$idx =3D $this->name[$p_string];
+			$this->$idx =3D $p_value;
+		}
+		else
+			throw new Exception(__FILE__ . ":" . __LINE__ . $p_string . 'Erreur a=
ttribut inexistant '.$p_string);
+	}
+
+	public function insert()
+	{
+		$this->verify();
+		$sql =3D "insert into " . $this->table . " ( ";
+		$sep =3D "";
+		$par =3D "";
+		$idx =3D 1;
+		$array =3D array();
+		foreach ($this->name as $key=3D>$value)
+		{
+			if (isset($this->default[$value]) && $this->default[$value] =3D=3D "a=
uto" && $this->$value =3D=3Dnull )
+				continue;
+			if ( $value=3D=3D$this->primary_key && $this->$value =3D=3D -1 ) cont=
inue;
+			$sql.=3D$sep.$value;
+			switch ($this->type[$value])
+			{
+				case "date":
+					$par .=3D$sep. 'to_date($' . $idx . ",'" . $this->date_format . "')=
" ;
+					break;
+				default:
+					$par .=3D $sep."$" . $idx ;
+			}
+
+			$array[] =3D $this->$value;
+			$sep =3D ",";
+			$idx++;
+		}
+		$sql.=3D") values (" . $par . ") returning " . $this->primary_key;
+		$pk=3D$this->primary_key;
+		$this->$pk =3D $this->cn->get_value($sql, $array);
+	}
+
+	public function delete()
+	{
+		$pk=3D$this->primary_key;
+		$sql =3D " delete from " . $this->table . " where " . $this->primary_k=
ey . "=3D" . sql_string($this->$pk);
+		$this->cn->exec_sql($sql);
+	}
+
+	public function update()
+	{
+		$this->verify();
+		$pk=3D$this->primary_key;
+		$sql =3D "update " . $this->table . "  ";
+		$sep =3D "";
+		$idx =3D 1;
+		$array =3D array();
+		$set=3D" set ";
+		foreach ($this->name as $key=3D>$value)
+		{
+			if (isset($this->default[$value]) && $this->default[$value] =3D=3D "a=
uto"  )
+				continue;
+			switch ($this->type[$value])
+			{
+				case "date":
+					$par =3D$value. '=3Dto_date($' . $idx . ",'" . $this->date_format .=
 "')" ;
+					break;
+				default:
+					$par =3D $value."=3D $" . $idx ;
+			}
+			$sql.=3D$sep." $set " . $par ;
+			$array[] =3D $this->$value;
+			$sep =3D ",";$set=3D"";$idx++;
+		}
+		$sql.=3D" where " . $this->primary_key . " =3D" . $this->$pk;
+	    $this->cn->exec_sql($sql, $array);
+
+	}
+
+	public function load()
+	{
+		$sql =3D " select ";
+		$sep=3D"";$par=3D"";
+
+		foreach ($this->name as $key)
+		{
+
+			switch ($this->type[$key])
+			{
+				case "date":
+					$sql .=3D $sep.'to_char(' . $key . ",'" . $this->date_format . "') =
as ".$key ;
+					break;
+				default:
+					$sql.=3D$sep.$key ;
+			}
+			$sep =3D ",";
+		}
+		$pk=3D$this->primary_key;
+		$sql.=3D" from ".$this->table;
+		$sql.=3D" where " . $this->primary_key . " =3D " . $this->$pk;
+		$result =3D $this->cn->get_array($sql);
+		if ($this->cn->count() =3D=3D 0 ) {
+			$this->$pk=3D-1;
+			return;
+		}
+
+		foreach ($result[0] as $key=3D>$value) {
+			$this->$key=3D$value;
+		}
+	}
+
+	public function get_info()
+	{
+		return var_export($this, true);
+	}
+
+	public function verify()
+	{
+		foreach($this->name as $key){
+			if ( trim($this->$key)=3D=3D'') $this->$key=3Dnull;
+		}
+		return 0;
+	}
+	public function from_array($p_array)
+	{
+		foreach ($this->name as $key=3D>$value)
+		{
+			if ( isset ($p_array[$value]))
+			{
+				$this->$value=3D$p_array[$value];
+			}
+		}
+		return $this;
+	}
+	 function seek($cond=3D'', $p_array=3Dnull)
+	{
+		$sql =3D "select * from ".$this->table."  $cond";
+		$aobj =3D array();
+		$ret =3D $this->cn->exec_sql($sql, $p_array);
+		return $ret;
+	}
+	public function next($ret,$i) {
+		$array=3D$this->cn->fetch_array($ret,$i);
+		return $this->from_array($array);
+	}
+
+
+}
+
+
+?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 12:45:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SeqhA-0003ri-HN
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 12:45:24 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 18:36:44 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.191731.1339605924.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4886 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 16:45:23 -0000

Author: danydb
Date: 2012-06-13 18:36:44 +0200 (Wed, 13 Jun 2012)
New Revision: 4886

Modified:
   phpcompta/trunk/include/template/action_search_result.php
Log:
show the limit of search

Modified: phpcompta/trunk/include/template/action_search_result.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search_result.php	2012-06-13 =
16:30:21 UTC (rev 4885)
+++ phpcompta/trunk/include/template/action_search_result.php	2012-06-13 =
16:36:44 UTC (rev 4886)
@@ -30,6 +30,10 @@
 <form onsubmit=3D"set_action_related('fresultaction');return false;" id=3D=
"fresultaction">
 	<?=3DHtmlInput::hidden('ctlc',$_GET['ctlc'])?>
 	<?=3DHtmlInput::submit("save_action", "Mettre =C3=A0 jour")?>
+<? if (isset($limit)) : ?>
+	<h2 class=3D"notice">Recherche limit=C3=A9e =C3=A0 <?=3D$limit?> r=C3=A9=
sultats</h2>
+<?endif;?>
+
 <table class=3D"result">
=20
 	<tr>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 13:03:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Seqz1-0006IC-V7
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 13:03:51 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 18:55:05 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.191770.1339607031.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4887 - in phpcompta/trunk: html html/js include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 17:03:51 -0000

Author: danydb
Date: 2012-06-13 18:55:05 +0200 (Wed, 13 Jun 2012)
New Revision: 4887

Modified:
   phpcompta/trunk/html/js/gestion.js
   phpcompta/trunk/html/show_document.php
   phpcompta/trunk/include/class_user.php
Log:
0000601: Action gestion : s?\195?\169curit?\195?\169

Modified: phpcompta/trunk/html/js/gestion.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/gestion.js	2012-06-13 16:36:44 UTC (rev 4886)
+++ phpcompta/trunk/html/js/gestion.js	2012-06-13 16:55:05 UTC (rev 4887)
@@ -70,6 +70,8 @@
 {
 	try{
 		var answer=3Drequest.responseText.evalJSON(true);
+		if ( answer.ago_id =3D=3D -1 ) { alert ('Effacement non autoris=C3=A9'=
);return;}
+
 		var action=3D"acop"+answer.ago_id;
 		$(action).innerHTML=3D"";
 		var doc=3D"op"+answer.ago_id;
@@ -97,6 +99,7 @@
 			onSuccess:function(request,json) {
 				try{
 				var answer=3Drequest.responseText.evalJSON(true);
+				if ( answer.act_id =3D=3D -1 ) { alert ('Effacement non autoris=C3=A9=
');return;}
 				var action=3D"acact"+answer.act_id;
 				$(action).innerHTML=3D"";
 				var doc=3D"act"+answer.act_id;
@@ -133,6 +136,7 @@
 function successRemoveComment(request,json)
 {
 	var answer=3Drequest.responseText.evalJSON(true);
+	if ( answer.agc_id =3D=3D -1 ) { alert ('Effacement non autoris=C3=A9')=
;return;}
 	var action=3D"accom"+answer.agc_id;
 	$(action).innerHTML=3D"";
 	var doc=3D"com"+answer.agc_id;
@@ -154,6 +158,7 @@
 function successRemoveDoc(request,json)
 {
 	var answer=3Drequest.responseText.evalJSON(true);
+	if ( answer.d_id =3D=3D -1 ) { alert ('Effacement non autoris=C3=A9');r=
eturn;}
 	var action=3D"ac"+answer.d_id;
 	$(action).innerHTML=3D"";
 	var doc=3D"doc"+answer.d_id;

Modified: phpcompta/trunk/html/show_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/show_document.php	2012-06-13 16:36:44 UTC (rev 4=
886)
+++ phpcompta/trunk/html/show_document.php	2012-06-13 16:55:05 UTC (rev 4=
887)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -15,11 +16,11 @@
  *   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-130=
7  USA
-*/
+ */
 /* $Revision$ */
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
 // Verify parameters
-/*! \file
+/* ! \file
  * \brief retrieve a document
  */
=20
@@ -27,75 +28,75 @@
 require_once("ac_common.php");
 require_once( "class_document.php");
 require_once('class_dossier.php');
-$gDossier=3Ddossier::id();
-$cn=3Dnew Database($gDossier);
-$action=3D(isset($_REQUEST['a']))?$_REQUEST['a']:'sh';
+$gDossier =3D dossier::id();
+$cn =3D new Database($gDossier);
+$action =3D (isset($_REQUEST['a'])) ? $_REQUEST['a'] : 'sh';
=20
 require_once ('class_user.php');
 global $g_user;
-$g_user=3Dnew User(new Database());
+$g_user =3D new User($cn);
 $g_user->Check();
 $g_user->check_dossier($gDossier);
=20
 /* Show the document */
-if ( $action =3D=3D 'sh')
+if ($action =3D=3D 'sh')
 {
-    if ( $g_user->check_action(VIEWDOC)=3D=3D1)
-    {
-        // retrieve the document
-        $doc=3Dnew Document($cn,$_REQUEST['d_id']);
-        $doc->Send();
-    }
+	if ($g_user->check_action(VIEWDOC) =3D=3D 1)
+	{
+		// retrieve the document
+		$doc =3D new Document($cn, $_REQUEST['d_id']);
+		$doc->Send();
+	}
 }
 /* remove the document */
-if ( $action =3D=3D 'rm' )
+if ($action =3D=3D 'rm')
 {
-    if ($g_user->check_action(RMDOC)=3D=3D1)
-    {
-        $doc=3Dnew Document($cn,$_REQUEST['d_id']);
-        $doc->remove();
-        $json=3Dsprintf('{"d_id":"%s"}',$_REQUEST['d_id']);
-        header("Content-type: text/html; charset: utf8",true);
-        print $json;
-    }
+	$json=3D'{"d_id":"-1"}';
+	if ($g_user->check_action(RMDOC) =3D=3D 1)
+	{
+		$doc =3D new Document($cn, $_REQUEST['d_id']);
+		$doc->remove();
+		$json =3D sprintf('{"d_id":"%s"}', $_REQUEST['d_id']);
+	}
+	header("Content-type: text/html; charset: utf8", true);
+	print $json;
 }
-/* remove the operation from action_gestion_operation*/
-if ( $action =3D=3D 'rmop' )
+/* remove the operation from action_gestion_operation */
+if ($action =3D=3D 'rmop')
 {
-	$dt_id=3D$cn->get_value("select ag_id from action_gestion_operation whe=
re ago_id=3D$1",$_REQUEST['id']);
-    if ($g_user->check_action(RMDOC)=3D=3D1 && $g_user->can_write_action=
($dt_id)=3D=3Dtrue)
-    {
-		$cn->exec_sql("delete from action_gestion_operation where ago_id=3D$1"=
,
-				array($_REQUEST['id']));
-        $json=3Dsprintf('{"ago_id":"%s"}',$_REQUEST['id']);
-        header("Content-type: text/html; charset: utf8",true);
-        print $json;
-    }
+	$json =3D '{"ago_id":"-1"}';
+	$dt_id =3D $cn->get_value("select ag_id from action_gestion_operation w=
here ago_id=3D$1", $_REQUEST['id']);
+	if ($g_user->check_action(RMDOC) =3D=3D 1 && $g_user->can_write_action(=
$dt_id) =3D=3D true)
+	{
+		$cn->exec_sql("delete from action_gestion_operation where ago_id=3D$1"=
, array($_REQUEST['id']));
+		$json =3D sprintf('{"ago_id":"%s"}', $_REQUEST['id']);
+	}
+	header("Content-type: text/html; charset: utf8", true);
+	print $json;
 }
-/* remove the comment from action_gestion_operation*/
-if ( $action =3D=3D 'rmcomment' )
+/* remove the comment from action_gestion_operation */
+if ($action =3D=3D 'rmcomment')
 {
-	$dt_id=3D$cn->get_value("select ag_id from action_gestion_comment where=
 agc_id=3D$1",$_REQUEST['id']);
-    if ($g_user->check_action(RMDOC)=3D=3D1 && $g_user->can_write_action=
($dt_id)=3D=3Dtrue)
-    {
-		$cn->exec_sql("delete from action_gestion_comment where agc_id=3D$1",
-				array($_REQUEST['id']));
-        $json=3Dsprintf('{"agc_id":"%s"}',$_REQUEST['id']);
-        header("Content-type: text/html; charset: utf8",true);
-        print $json;
-    }
+	$json =3D '{"agc_id":"-1"}';
+	$dt_id =3D $cn->get_value("select ag_id from action_gestion_comment whe=
re agc_id=3D$1", $_REQUEST['id']);
+	if ($g_user->check_action(RMDOC) =3D=3D 1 && $g_user->can_write_action(=
$dt_id) =3D=3D true)
+	{
+		$cn->exec_sql("delete from action_gestion_comment where agc_id=3D$1", =
array($_REQUEST['id']));
+		$json =3D sprintf('{"agc_id":"%s"}', $_REQUEST['id']);
+	}
+	header("Content-type: text/html; charset: utf8", true);
+	print $json;
 }
-/* remove the action from action_gestion_operation*/
-if ( $action =3D=3D 'rmaction' )
+/* remove the action from action_gestion_operation */
+if ($action =3D=3D 'rmaction')
 {
-    if ($g_user->check_action(RMDOC)=3D=3D1 && $g_user->can_write_action=
($_REQUEST['id']) =3D=3D true && $g_user->can_write_action($_REQUEST['ag_=
id'])=3D=3D true )
-    {
-		$cn->exec_sql("delete from action_gestion_related where aga_least=3D$1=
 and aga_greatest=3D$2",
-				array($_REQUEST['id'],$_REQUEST['ag_id']));
-		$cn->exec_sql("delete from action_gestion_related where aga_least=3D$2=
 and aga_greatest=3D$1",
-				array($_REQUEST['id'],$_REQUEST['ag_id']));
-        $json=3Dsprintf('{"act_id":"%s"}',$_REQUEST['id']);
-        header("Content-type: text/html; charset: utf8",true);
-        print $json;
-    }
+	$json =3D '{"act_id":"-1"}';
+	if ($g_user->check_action(RMDOC) =3D=3D 1 && $g_user->can_write_action(=
$_REQUEST['id']) =3D=3D true && $g_user->can_write_action($_REQUEST['ag_i=
d']) =3D=3D true)
+	{
+		$cn->exec_sql("delete from action_gestion_related where aga_least=3D$1=
 and aga_greatest=3D$2", array($_REQUEST['id'], $_REQUEST['ag_id']));
+		$cn->exec_sql("delete from action_gestion_related where aga_least=3D$2=
 and aga_greatest=3D$1", array($_REQUEST['id'], $_REQUEST['ag_id']));
+		$json =3D sprintf('{"act_id":"%s"}', $_REQUEST['id']);
+	}
+	header("Content-type: text/html; charset: utf8", true);
+	print $json;
 }

Modified: phpcompta/trunk/include/class_user.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_user.php	2012-06-13 16:36:44 UTC (rev 4=
886)
+++ phpcompta/trunk/include/class_user.php	2012-06-13 16:55:05 UTC (rev 4=
887)
@@ -32,6 +32,7 @@
 require_once("user_common.php");
 require_once('class_dossier.php');
 require_once('ac_common.php');
+
 class User
 {
=20
@@ -41,7 +42,7 @@
 	var $admin;
 	var $valid;
=20
-	function User(&$p_cn, $p_id=3D-1)
+	function User(&$p_cn, $p_id =3D -1)
 	{
 		// if p_id is not set then check the connected user
 		if ($p_id =3D=3D -1)
@@ -126,7 +127,7 @@
 		$Sql =3D "update ac_users set use_first_name=3D$1, use_name=3D$2
              ,use_active=3D$3,use_admin=3D$4,use_pass=3D$5 where use_id=3D=
$6";
 		$cn =3D new Database();
-		$Res =3D $cn->exec_sql($Sql, array($this->first_name, $this->last_name=
, $this->active, $this->admin, $this->pass,$this->id));
+		$Res =3D $cn->exec_sql($Sql, array($this->first_name, $this->last_name=
, $this->active, $this->admin, $this->pass, $this->id));
 	}
=20
 	/* !
@@ -137,7 +138,7 @@
 	 *
 	  ++ */
=20
-	function Check($silent=3Dfalse, $from=3D'')
+	function Check($silent =3D false, $from =3D '')
 	{
=20
 		$res =3D 0;
@@ -280,7 +281,7 @@
 	  @endverbatim
 	 */
=20
-	function get_ledger($p_type=3D'ALL', $p_access=3D3)
+	function get_ledger($p_type =3D 'ALL', $p_access =3D 3)
 	{
 		if ($this->admin !=3D 1 && $this->is_local_admin() !=3D 1)
 		{
@@ -332,7 +333,7 @@
 	 * \return sql condition like =3D jrn_def_id in (...)
 	 */
=20
-	function get_ledger_sql($p_type=3D'ALL', $p_access=3D3)
+	function get_ledger_sql($p_type =3D 'ALL', $p_access =3D 3)
 	{
 		$aLedger =3D $this->get_ledger($p_type, $p_access);
 		if (empty($aLedger))
@@ -504,23 +505,25 @@
=20
 		return $l_array;
 	}
-        /**
-         * Check if an user can access a module, return 1 if yes, otherw=
ise 0
-         * record in audit log
-         * @param string $p_module menu_ref.me_code
-         */
-        function check_module($p_module)
-        {
-            $acc=3D$this->db->get_value("select count(*) from v_all_menu=
 where user_name =3D $1
-                and me_code=3D$2", array($this->login,$p_module));
-            if ($acc =3D=3D 0)
-            {
-                $this->audit("FAIL",$p_module);
-                return 0;
-            }
-            $this->audit("SUCCESS",$p_module);
-            return 1;
-        }
+
+	/**
+	 * Check if an user can access a module, return 1 if yes, otherwise 0
+	 * record in audit log
+	 * @param string $p_module menu_ref.me_code
+	 */
+	function check_module($p_module)
+	{
+		$acc =3D $this->db->get_value("select count(*) from v_all_menu where u=
ser_name =3D $1
+                and me_code=3D$2", array($this->login, $p_module));
+		if ($acc =3D=3D 0)
+		{
+			$this->audit("FAIL", $p_module);
+			return 0;
+		}
+		$this->audit("SUCCESS", $p_module);
+		return 1;
+	}
+
 	/* !
 	 * \brief  Check if an user is allowed to do an action
 	 * \param p_action_id
@@ -611,7 +614,7 @@
 	 *
 	 */
=20
-	function insert_default_global_pref($p_type=3D"", $p_value=3D"")
+	function insert_default_global_pref($p_type =3D "", $p_value =3D "")
 	{
=20
 		$default_parameter =3D array("THEME" =3D> "classic",
@@ -645,7 +648,7 @@
 	 * \param $p_value parameter's value value of the type
 	 */
=20
-	function update_global_pref($p_type, $p_value=3D"")
+	function update_global_pref($p_type, $p_value =3D "")
 	{
 		$default_parameter =3D array("THEME" =3D> "classic",
 			"PAGESIZE" =3D> "50",
@@ -685,11 +688,11 @@
 	 * \return nothing the program exits automatically
 	 */
=20
-	function can_request($p_action, $p_js=3D0)
+	function can_request($p_action, $p_js =3D 0)
 	{
 		if ($this->check_action($p_action) =3D=3D 0)
 		{
-                        $this->audit('FAIL');
+			$this->audit('FAIL');
 			if ($p_js =3D=3D 1)
 			{
 				echo "<script>";
@@ -714,30 +717,29 @@
 	 */
 	function check_print($p_action)
 	{
-		global $audit,$cn;
+		global $audit, $cn;
 		$this->audit('AUDIT', $p_action);
 		if ($this->Admin() =3D=3D 1)
 			return 1;
 		if ($this->is_local_admin(dossier::id()) =3D=3D 1)
 			return 1;
-		$res=3D$cn->get_value("select count(*) from profile_menu
+		$res =3D $cn->get_value("select count(*) from profile_menu
 			join profile_user using (p_id)
-			where user_name=3D$1 and me_code=3D$2 ",
-				array($this->login,$p_action));
+			where user_name=3D$1 and me_code=3D$2 ", array($this->login, $p_actio=
n));
 		return $res;
+	}
=20
-	}
 	/* !\brief Check if the user can print (in menu_ref p_type_display=3Dp)
 	 * otherwise warn and exit
 	 * \param $p_action requested action
 	 * \return nothing the program exits automatically
 	 */
=20
-	function can_print($p_action, $p_js=3D0)
+	function can_print($p_action, $p_js =3D 0)
 	{
 		if ($this->check_print($p_action) =3D=3D 0)
 		{
-                    $this->audit('FAIL');
+			$this->audit('FAIL');
 			if ($p_js =3D=3D 1)
 			{
 				echo "<script>";
@@ -753,6 +755,7 @@
 			exit(-1);
 		}
 	}
+
 	/* !
 	 * \brief  Check if an user is an local administrator
 	 *
@@ -765,7 +768,7 @@
 	 *
 	 */
=20
-	function is_local_admin($p_dossier=3D-1)
+	function is_local_admin($p_dossier =3D -1)
 	{
 		if ($p_dossier =3D=3D -1)
 		{
@@ -845,7 +848,7 @@
 	 *  - R regular user
 	 */
=20
-	function check_dossier($p_dossier_id, $silent=3Dfalse)
+	function check_dossier($p_dossier_id, $silent =3D false)
 	{
 		$this->Admin();
 		if ($this->admin =3D=3D 1 || $this->is_local_admin($p_dossier_id) =3D=3D=
 1)
@@ -856,7 +859,7 @@
 		$dossier =3D ($dossier =3D=3D '') ? 'X' : $dossier;
 		if ($dossier =3D=3D 'X')
 		{
-                    $this->audit('FAIL',"Access folder ");
+			$this->audit('FAIL', "Access folder ");
 			if (!$silent)
 			{
 				alert(_('Dossier non accessible'));
@@ -891,7 +894,7 @@
 	 *
 	 */
=20
-	function show_dossier($p_filtre=3D"")
+	function show_dossier($p_filtre =3D "")
 	{
 		$p_array =3D $this->get_available_folder($p_filtre);
=20
@@ -921,7 +924,7 @@
=20
 			$result.=3D"<TR class=3D\"$tr\">";
=20
-			$result.=3Dtd($id,' class=3D"num" ');
+			$result.=3Dtd($id, ' class=3D"num" ');
 			$result.=3D"<TD class=3D\"$tr\">";
 			$result.=3D"<A class=3D\"dossier\" HREF=3D\"$target\">";
 			$result.=3D "  <B>" . h($name) . "</B>";
@@ -950,32 +953,31 @@
 	 *
 	 */
=20
-	function get_available_folder( $p_filter=3D"")
+	function get_available_folder($p_filter =3D "")
 	{
-            $cn =3D new Database();
+		$cn =3D new Database();
 		$filter =3D "";
 		if ($this->admin =3D=3D 0)
 		{
 			// show only available folders
 			// if user is not an admin
-			$Res=3D$cn->exec_sql( "select distinct dos_id,dos_name,dos_descriptio=
n from ac_users
+			$Res =3D $cn->exec_sql("select distinct dos_id,dos_name,dos_descripti=
on from ac_users
              natural join jnt_use_dos
              natural join  ac_dossier
              join  priv_user on ( priv_jnt=3Djnt_id)
              where use_active=3D1
              and use_login=3D $1
              and priv_priv !=3D 'X' and ( dos_name ~* $2 or dos_descript=
ion ~* $2 )
-             order by dos_name", array($this->login,$p_filter));
+             order by dos_name", array($this->login, $p_filter));
 		}
 		else
 		{
 			$Res =3D $cn->exec_sql("select distinct dos_id,dos_name,dos_descripti=
on from ac_dossier
-             where   dos_name ~* $1 or dos_description ~* $1 order by do=
s_name",
-                        array($p_filter));
+             where   dos_name ~* $1 or dos_description ~* $1 order by do=
s_name", array($p_filter));
 		}
 		require_once('class_database.php');
=20
-                $max =3D Database::num_row($Res);
+		$max =3D Database::num_row($Res);
 		if ($max =3D=3D 0)
 			return 0;
=20
@@ -985,63 +987,68 @@
 		}
 		return $array;
 	}
-	function audit($action=3D'AUDIT', $p_module=3D"")
-        {
-            global $audit;
-            if ($audit)
-            {
-                if ($p_module =3D=3D "" && isset ($_REQUEST['ac']))
-                {
-                    $p_module =3D $_REQUEST['ac'];
-                }
-                $cn =3D new Database();
-                if (isset($_REQUEST['gDossier']))
-                    $p_module.=3D "dossier : " . $_REQUEST['gDossier'];
-                $sql =3D "insert into audit_connect (ac_user,ac_ip,ac_mo=
dule,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
=20
-                $cn->exec_sql($sql, array(
-                    $_SESSION['g_user'],
-                    $_SERVER["REMOTE_ADDR"],
-                    $p_module,
-                    $_SERVER['REQUEST_URI'],
-                    $action));
-            }
-        }
+	function audit($action =3D 'AUDIT', $p_module =3D "")
+	{
+		global $audit;
+		if ($audit)
+		{
+			if ($p_module =3D=3D "" && isset($_REQUEST['ac']))
+			{
+				$p_module =3D $_REQUEST['ac'];
+			}
+			$cn =3D new Database();
+			if (isset($_REQUEST['gDossier']))
+				$p_module.=3D "dossier : " . $_REQUEST['gDossier'];
+			$sql =3D "insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,a=
c_state) values ($1,$2,$3,$4,$5)";
+
+			$cn->exec_sql($sql, array(
+				$_SESSION['g_user'],
+				$_SERVER["REMOTE_ADDR"],
+				$p_module,
+				$_SERVER['REQUEST_URI'],
+				$action));
+		}
+	}
+
 	function save_profile($p_id)
 	{
-		$count=3D$this->db->get_value("select count(*) from profile_user where=
 user_name=3D$1",  array($this->login));
-		if ($count=3D=3D0)
+		$count =3D $this->db->get_value("select count(*) from profile_user whe=
re user_name=3D$1", array($this->login));
+		if ($count =3D=3D 0)
 		{
 			$this->db->exec_sql("insert into profile_user(p_id,user_name)
-								values ($1,$2)",
-								array($p_id,$this->login));
-
-		} else {
-			$this->db->exec_sql("update profile_user set p_id=3D$1 where user_nam=
e=3D$2",
-								array($p_id,$this->login));
-
+								values ($1,$2)", array($p_id, $this->login));
 		}
+		else
+		{
+			$this->db->exec_sql("update profile_user set p_id=3D$1 where user_nam=
e=3D$2", array($p_id, $this->login));
+		}
 	}
+
 	function get_profile()
 	{
-		$profile=3D$this->db->get_value("select p_id from profile_user where
-				user_name=3D$1",array($this->login));
+		$profile =3D $this->db->get_value("select p_id from profile_user where
+				user_name=3D$1", array($this->login));
 		return $profile;
 	}
-	function can_write_action( $dtoc)
+
+	function can_write_action($dtoc)
 	{
-		$profile=3D$this->get_profile();
-		$r=3D$this->db->get_value(" select count(*) from action_gestion where =
ag_id=3D$1 and ag_dest in
-				(select p_granted from user_sec_action_profile where ua_right=3D'W' =
and p_id=3D$2) ",array($dtoc,$profile));
-		if ( $r =3D=3D 0 ) return false;
+		$profile =3D $this->get_profile();
+		$r =3D $this->db->get_value(" select count(*) from action_gestion wher=
e ag_id=3D$1 and ag_dest in
+				(select p_granted from user_sec_action_profile where ua_right=3D'W' =
and p_id=3D$2) ", array($dtoc, $profile));
+		if ($r =3D=3D 0)
+			return false;
 		return true;
 	}
+
 	function can_read_action($dtoc)
 	{
-		$profile=3D$this->get_profile();
-		$r=3D$this->db->get_value(" select count(*) from action_gestion where =
ag_id=3D$1 and (ag_dest in
-				(select p_granted from user_sec_action_profile where p_id=3D$2) or a=
g_owner=3D$3)",array($dtoc,$profile,$this->login));
-		if ( $r =3D=3D 0 ) return false;
+		$profile =3D $this->get_profile();
+		$r =3D $this->db->get_value(" select count(*) from action_gestion wher=
e ag_id=3D$1 and (ag_dest in
+				(select p_granted from user_sec_action_profile where p_id=3D$2) or a=
g_owner=3D$3)", array($dtoc, $profile, $this->login));
+		if ($r =3D=3D 0)
+			return false;
 		return true;
 	}
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 13:20:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SerFB-0007ly-DF
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 13:20:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 19:11:51 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.191822.1339608033.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4888 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 17:20:32 -0000

Author: danydb
Date: 2012-06-13 19:11:51 +0200 (Wed, 13 Jun 2012)
New Revision: 4888

Modified:
   phpcompta/trunk/html/ajax_card.php
   phpcompta/trunk/html/ajax_history.php
Log:
0000617: Avertissement si aucune fiche ou cat?\195?\169gorie n'est dispon=
ible

Modified: phpcompta/trunk/html/ajax_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_card.php	2012-06-13 16:55:05 UTC (rev 4887)
+++ phpcompta/trunk/html/ajax_card.php	2012-06-13 17:11:51 UTC (rev 4888)
@@ -215,19 +215,19 @@
         {
         case -1:
             $l=3Dnew Acc_Ledger($cn,$ledger);
-            $sql.=3D'  where fd_id in ('.$l->get_all_fiche_def().')';
+            $where=3D'  where fd_id in ('.$l->get_all_fiche_def().')';
             break;
         case 'cred':
             $l=3Dnew Acc_Ledger($cn,$ledger);
             $prop=3D$l->get_propertie();
             if ( $prop['jrn_def_fiche_cred']=3D=3D'')$prop=3D-1;
-            $sql.=3D'  where fd_id in ('.$prop['jrn_def_fiche_cred'].')'=
;
+            $where=3D'  where fd_id in ('.$prop['jrn_def_fiche_cred'].')=
';
             break;
         case 'deb':
             $l=3Dnew Acc_Ledger($cn,$ledger);
             $prop=3D$l->get_propertie();
             if ( $prop=3D=3D'')$prop=3D-1;
-            $sql.=3D'  where fd_id in ('.$prop['jrn_def_fiche_deb'].')';
+            $where=3D'  where fd_id in ('.$prop['jrn_def_fiche_deb'].')'=
;
             break;
         }
     }
@@ -236,23 +236,33 @@
         /* we filter thanks a given model of card */
         if ( isset($cat))
         {
-            $sql=3D$sql.sprintf(' where frd_id in ('.sql_string ($cat).'=
)');
+            $where=3Dsprintf(' where frd_id in ('.sql_string ($cat).')')=
;
         }
         else
             /* we filter thanks a given list of category of card
              */
             if ( isset($fil) && strlen(trim($fil)) > 0 )
             {
-                $sql=3D$sql.sprintf(" where fd_id in (%s)",
+                $where=3Dsprintf(" where fd_id in (%s)",
                                   sql_string($fil));
             }
     }
+	if ( strpos($where," in ()") !=3D 0)
+	{
+		 $html=3DHtmlInput::anchor_close('select_card_div');
+		 $html.=3Dh2info('Choix de la cat=C3=A9gorie');
+		 $html.=3D'<h3 class=3D"notice">';
+		 $html.=3D_("Aucune cat=C3=A9gorie de fiche ne correspond =C3=A0".
+                " votre demande, le journal pourrait n'avoir acc=C3=A8s =
=C3=A0 aucune fiche");
+		 $html.=3D'</h3>';
+		 break;
+	}
     $array=3D$cn->make_array($sql);
     $html=3DHtmlInput::anchor_close('select_card_div');
     $html.=3Dh2info('Choix de la cat=C3=A9gorie');
     if ( empty($array))
     {
-        $html.=3D_("Aucune cat=C3=A9gorie de fiche ne correspondant =C3=A0=
".
+        $html.=3D_("Aucune cat=C3=A9gorie de fiche ne correspond  =C3=A0=
".
                 " votre demande");
 		if ( DEBUG )        $html.=3D$sql;
     }
@@ -339,6 +349,16 @@
     /* Build the SQL and show result */
     $sql=3D$fiche->build_sql($sql_array);
=20
+	if ( strpos($sql," in ()") !=3D 0)
+	{
+		$html=3DHtmlInput::anchor_close('search_card');
+		 $html.=3D'<div> '.h2info(_('Recherche de fiche')).'</div>';
+		 $html.=3D'<h3 class=3D"notice">';
+		 $html.=3D_("Aucune cat=C3=A9gorie de fiche ne correspond =C3=A0".
+                " votre demande, le journal pourrait n'avoir acc=C3=A8s =
=C3=A0 aucune fiche");
+		 $html.=3D'</h3>';
+		 break;
+	}
     /* We limit the search to 20 records */
     $sql=3D$sql.' order by vw_name limit 20';
     $a=3D$cn->get_array($sql);

Modified: phpcompta/trunk/html/ajax_history.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_history.php	2012-06-13 16:55:05 UTC (rev 48=
87)
+++ phpcompta/trunk/html/ajax_history.php	2012-06-13 17:11:51 UTC (rev 48=
88)
@@ -39,6 +39,7 @@
  */
 ajax_disconnected($div);
 global $g_user;
+$cn=3Dnew Database(dossier::id());
 $g_user=3Dnew User($cn);
 /* security */
 if ( $g_user->check_dossier(dossier::id(),true) =3D=3D 'X' ) exit();



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 13:23:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SerIA-00088k-6p
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 13:23:38 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 19:14:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.191831.1339608218.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4889 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 17:23:37 -0000

Author: danydb
Date: 2012-06-13 19:14:51 +0200 (Wed, 13 Jun 2012)
New Revision: 4889

Modified:
   phpcompta/trunk/html/ajax_card.php
Log:
0000617: Avertissement si aucune fiche ou cat?\195?\169gorie n'est dispon=
ible

Modified: phpcompta/trunk/html/ajax_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_card.php	2012-06-13 17:11:51 UTC (rev 4888)
+++ phpcompta/trunk/html/ajax_card.php	2012-06-13 17:14:51 UTC (rev 4889)
@@ -257,6 +257,7 @@
 		 $html.=3D'</h3>';
 		 break;
 	}
+	$sql.=3D" ".$where;
     $array=3D$cn->make_array($sql);
     $html=3DHtmlInput::anchor_close('select_card_div');
     $html.=3Dh2info('Choix de la cat=C3=A9gorie');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 13:31:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SerPx-0000b6-2f
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 13:31:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 19:22:54 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.191845.1339608700.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4890 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 17:31:39 -0000

Author: danydb
Date: 2012-06-13 19:22:54 +0200 (Wed, 13 Jun 2012)
New Revision: 4890

Modified:
   phpcompta/trunk/include/class_document.php
Log:
Use $g_parameter instead of creating a new Own object

Modified: phpcompta/trunk/include/class_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_document.php	2012-06-13 17:14:51 UTC (r=
ev 4889)
+++ phpcompta/trunk/include/class_document.php	2012-06-13 17:22:54 UTC (r=
ev 4890)
@@ -503,6 +503,7 @@
      */
     function Replace($p_tag,$p_array)
     {
+		global $g_parameter;
         $p_tag=3Dstrtoupper($p_tag);
         $p_tag=3Dstr_replace('=3D','',$p_tag);
         $r=3D"Tag inconnu";
@@ -529,40 +530,31 @@
             //  the company priv
=20
         case 'MY_NAME':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_NAME;
+            $r=3D$g_parameter->MY_NAME;
             break;
         case 'MY_CP':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_CP;
+            $r=3D$g_parameter->MY_CP;
             break;
         case 'MY_COMMUNE':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_COMMUNE;
+            $r=3D$g_parameter->MY_COMMUNE;
             break;
         case 'MY_TVA':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_TVA;
+            $r=3D$g_parameter->MY_TVA;
             break;
         case 'MY_STREET':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_STREET;
+            $r=3D$g_parameter->MY_STREET;
             break;
         case 'MY_NUMBER':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_NUMBER;
+            $r=3D$g_parameter->MY_NUMBER;
             break;
         case 'MY_TEL':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_TEL;
+            $r=3D$g_parameter->MY_TEL;
             break;
         case 'MY_FAX':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_FAX;
+            $r=3D$g_parameter->MY_FAX;
             break;
         case 'MY_PAYS':
-            $my=3Dnew own($this->db);
-            $r=3D$my->MY_PAYS;
+            $r=3D$g_parameter->MY_PAYS;
             break;
=20
             // customer



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 15:25:26 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SetC2-0004pA-8P
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 15:25:26 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 21:16:44 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.192092.1339615525.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4891 - in phpcompta/trunk: html html/js include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 19:25:25 -0000

Author: danydb
Date: 2012-06-13 21:16:44 +0200 (Wed, 13 Jun 2012)
New Revision: 4891

Added:
   phpcompta/trunk/include/ajax_mod_stock_repo.php
   phpcompta/trunk/include/stock_cfg.inc.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/class_own.php
   phpcompta/trunk/include/company.inc.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000572: Ajout de d?\195?\169p?\195?\180t pour les stocks

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-13 17:22:54 UTC (rev 4890)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-13 19:16:44 UTC (rev 4891)
@@ -57,7 +57,7 @@
 	exit();
 extract($_REQUEST);
 set_language();
-global $g_user;
+global $g_user,$cn;
 $cn =3D new Database($gDossier);
 $g_user =3D new User($cn);
 $g_user->check(true);
@@ -547,6 +547,9 @@
         case 'modify_menu';
             require_once 'ajax_mod_menu.php';
             break;
+		case 'mod_stock_repo':
+		require_once 'ajax_mod_stock_repo.php';
+		break;
         default:
             var_dump($_GET);
 }

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-13 17:22:54 UTC (rev 4890)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-13 19:16:44 UTC (rev 4891)
@@ -418,7 +418,7 @@
     removeDiv('change_doc_div');
     waiting_box();
     var action =3D new Ajax.Request(
-				  "ajax_misc.php" ,=20
+				  "ajax_misc.php" ,
 				  {
 				      method:'get', parameters:queryString,
 				      onFailure:ajax_misc_failure,
@@ -1512,4 +1512,30 @@
 		alert(e.message);
 		return false;
 	}
- }
\ No newline at end of file
+ }
+ /**
+ *@brief change a document_modele
+ */
+function stock_repo_change(p_dossier,r_id)
+{
+    var queryString=3D"gDossier=3D"+p_dossier+"&op=3Dmod_stock_repo"+"&r=
_id=3D"+r_id;
+    var nTop=3Dcalcy(posY);
+    var nLeft=3D"200px";
+    var str_style=3D"top:"+nTop+"px;left:"+nLeft+";width:50em;height:aut=
o";
+
+    removeDiv('change_stock_repo_div');
+    waiting_box();
+    var action =3D new Ajax.Request(
+				  "ajax_misc.php" ,
+				  {
+				      method:'get', parameters:queryString,
+				      onFailure:ajax_misc_failure,
+				      onSuccess:function(req){
+					  remove_waiting_box();
+					  add_div({id:'change_stock_repo_div',style:str_style,cssclass:'inn=
er_box',drag:"1"});
+					  $('change_stock_repo_div').innerHTML=3Dreq.responseText;
+
+				      }
+				  }
+				  );
+}

Added: phpcompta/trunk/include/ajax_mod_stock_repo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_mod_stock_repo.php	                     =
   (rev 0)
+++ phpcompta/trunk/include/ajax_mod_stock_repo.php	2012-06-13 19:16:44 U=
TC (rev 4891)
@@ -0,0 +1,80 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show a depot
+ *
+ */
+require_once 'class_stock_sql.php';
+$st=3Dnew Stock_Sql($_GET['r_id']);
+
+?>
+<?=3DHtmlInput::title_box("Ajouter un d=C3=A9p=C3=B4t","change_stock_rep=
o_div","close")?>
+	<form method=3D"post">
+		<?=3DHtmlInput::hidden("r_id",$_GET['r_id']);?>
+		<table>
+			<tr>
+				<td>
+					Nom
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_name",$st->r_name); echo $name->input();?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					Adresse
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_adress",$st->r_adress); echo $name->input()=
;?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					Ville
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_city",$st->r_city); echo $name->input();?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					Pays
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_country",$st->r_country); echo $name->input=
();?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					T=C3=A9l=C3=A9phone
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_phone",$st->r_phone); echo $name->input();?=
>
+				</td>
+			</tr>
+
+		</table>
+		<?=3DHtmlInput::submit("mod_stock","Sauver")?>
+	</form>
\ No newline at end of file

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-06-13 17:22:54 UTC =
(rev 4890)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-13 19:16:44 UTC =
(rev 4891)
@@ -588,9 +588,10 @@
 	}
       return $array[$ind];
     }
-	static function title_box($name,$div)
+	static function title_box($name,$div,$mod=3D"close")
 	{
-		$r=3DHtmlInput::anchor_close($div);
+		if ($mod=3D=3D'close')		$r=3DHtmlInput::anchor_close($div);
+		if ($mod=3D=3D'hide')		$r=3DHtmlInput::anchor_hide(_('Fermer'),"$('$di=
v').hide()");
 		$r.=3Dh2info($name);
 		return $r;
 	}

Modified: phpcompta/trunk/include/class_own.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_own.php	2012-06-13 17:22:54 UTC (rev 48=
90)
+++ phpcompta/trunk/include/class_own.php	2012-06-13 19:16:44 UTC (rev 48=
91)
@@ -105,6 +105,7 @@
         $this->save('MY_DATE_SUGGEST');
         $this->save('MY_ALPHANUM');
         $this->save('MY_UPDLAB');
+        $this->save('MY_STOCK');
=20
=20
     }

Modified: phpcompta/trunk/include/company.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/company.inc.php	2012-06-13 17:22:54 UTC (rev =
4890)
+++ phpcompta/trunk/include/company.inc.php	2012-06-13 19:16:44 UTC (rev =
4891)
@@ -1,120 +1,130 @@
 <?php
+
 global $g_user;
-    echo '<div class=3D"content">';
-    require_once("class_own.php");
-    if ( isset ($_POST['record_company'] ))
-    {
-        $m=3Dnew Own($cn);
-        extract($_POST);
-        $m->MY_NAME=3D$p_name;
-        $m->MY_TVA=3D$p_tva;
-        $m->MY_STREET=3D$p_street;
-        $m->MY_NUMBER=3D$p_no;
-        $m->MY_CP=3D$p_cp;
-        $m->MY_COMMUNE=3D$p_Commune;
-        $m->MY_TEL=3D$p_tel;
-        $m->MY_FAX=3D$p_fax;
-        $m->MY_PAYS=3D$p_pays;
-        $m->MY_CHECK_PERIODE=3D$p_check_periode;
-        $m->MY_DATE_SUGGEST=3D$p_date_suggest;
-        $m->MY_ANALYTIC=3D$p_compta;
-        $m->MY_STRICT=3D$p_strict;
-        $m->MY_TVA_USE=3D$p_tva_use;
-        $m->MY_PJ_SUGGEST=3D$p_pj;
-	$m->MY_ALPHANUM=3D$p_alphanum;
-	$m->MY_UPDLAB=3D$p_updlab;
+echo '<div class=3D"content">';
+require_once("class_own.php");
+if (isset($_POST['record_company']))
+{
+	$m =3D new Own($cn);
+	extract($_POST);
+	$m->MY_NAME =3D $p_name;
+	$m->MY_TVA =3D $p_tva;
+	$m->MY_STREET =3D $p_street;
+	$m->MY_NUMBER =3D $p_no;
+	$m->MY_CP =3D $p_cp;
+	$m->MY_COMMUNE =3D $p_Commune;
+	$m->MY_TEL =3D $p_tel;
+	$m->MY_FAX =3D $p_fax;
+	$m->MY_PAYS =3D $p_pays;
+	$m->MY_CHECK_PERIODE =3D $p_check_periode;
+	$m->MY_DATE_SUGGEST =3D $p_date_suggest;
+	$m->MY_ANALYTIC =3D $p_compta;
+	$m->MY_STRICT =3D $p_strict;
+	$m->MY_TVA_USE =3D $p_tva_use;
+	$m->MY_PJ_SUGGEST =3D $p_pj;
+	$m->MY_ALPHANUM =3D $p_alphanum;
+	$m->MY_UPDLAB =3D $p_updlab;
+	$m->MY_STOCK =3D $p_stock;
=20
-        $m->Update();
-    }
+	$m->Update();
+}
=20
-    $my=3Dnew Own($cn);
-    ///// Compta analytic
-    $array=3Darray (
-               array("value"=3D>"ob",'label'=3D>_("obligatoire")),
-               array("value"=3D>"op",'label'=3D>_("optionnel")),
-               array("value"=3D>"nu",'label'=3D>_("non utilis=C3=A9"))
-           );
-    $strict_array=3Darray(
-                      array('value'=3D>'N','label'=3D>_('Non')),
-                      array('value'=3D>'Y','label'=3D>_('Oui'))
-                  );
+$my =3D new Own($cn);
+///// Compta analytic
+$array =3D array(
+	array("value" =3D> "ob", 'label' =3D> _("obligatoire")),
+	array("value" =3D> "op", 'label' =3D> _("optionnel")),
+	array("value" =3D> "nu", 'label' =3D> _("non utilis=C3=A9"))
+);
+$strict_array =3D array(
+	array('value' =3D> 'N', 'label' =3D> _('Non')),
+	array('value' =3D> 'Y', 'label' =3D> _('Oui'))
+);
=20
-    $alpha_num_array[0]=3Darray('value'=3D>'N','label'=3D>_('Non'));
-    $alpha_num_array[1]=3Darray('value'=3D>'Y','label'=3D>_('Oui'));
-   =20
-    $updlab_array[0]=3Darray('value'=3D>'N','label'=3D>_('Non'));
-    $updlab_array[1]=3Darray('value'=3D>'Y','label'=3D>_('Oui'));
+$alpha_num_array[0] =3D array('value' =3D> 'N', 'label' =3D> _('Non'));
+$alpha_num_array[1] =3D array('value' =3D> 'Y', 'label' =3D> _('Oui'));
=20
-    $compta=3Dnew ISelect();
-    $compta->table=3D1;
-    $compta->selected=3D$my->MY_ANALYTIC;
+$updlab_array[0] =3D array('value' =3D> 'N', 'label' =3D> _('Non'));
+$updlab_array[1] =3D array('value' =3D> 'Y', 'label' =3D> _('Oui'));
=20
-    $strict=3Dnew ISelect();
-    $strict->table=3D1;
-    $strict->selected=3D$my->MY_STRICT;
+$compta =3D new ISelect();
+$compta->table =3D 1;
+$compta->selected =3D $my->MY_ANALYTIC;
=20
-    $tva_use=3Dnew ISelect();
-    $tva_use->table=3D1;
-    $tva_use->selected=3D$my->MY_TVA_USE;
+$strict =3D new ISelect();
+$strict->table =3D 1;
+$strict->selected =3D $my->MY_STRICT;
=20
-    $pj_suggest=3Dnew ISelect();
-    $pj_suggest->table=3D1;
-    $pj_suggest->selected=3D$my->MY_PJ_SUGGEST;
+$tva_use =3D new ISelect();
+$tva_use->table =3D 1;
+$tva_use->selected =3D $my->MY_TVA_USE;
=20
-    $date_suggest=3Dnew ISelect();
-    $date_suggest->table=3D1;
-    $date_suggest->selected=3D$my->MY_DATE_SUGGEST;
+$pj_suggest =3D new ISelect();
+$pj_suggest->table =3D 1;
+$pj_suggest->selected =3D $my->MY_PJ_SUGGEST;
=20
-    $check_periode=3Dnew ISelect();
-    $check_periode->table=3D1;
-    $check_periode->selected=3D$my->MY_CHECK_PERIODE;
-    $alpha_num=3Dnew ISelect();
-    $alpha_num->table=3D1;
-    $alpha_num->value=3D$alpha_num_array;
-    $alpha_num->selected=3D$my->MY_ALPHANUM;
+$date_suggest =3D new ISelect();
+$date_suggest->table =3D 1;
+$date_suggest->selected =3D $my->MY_DATE_SUGGEST;
=20
-    $updlab=3Dnew ISelect();
-    $updlab->table=3D1;
-    $updlab->value=3D$updlab_array;
-    $updlab->selected=3D$my->MY_UPDLAB;
+$check_periode =3D new ISelect();
+$check_periode->table =3D 1;
+$check_periode->selected =3D $my->MY_CHECK_PERIODE;
+$alpha_num =3D new ISelect();
+$alpha_num->table =3D 1;
+$alpha_num->value =3D $alpha_num_array;
+$alpha_num->selected =3D $my->MY_ALPHANUM;
=20
-    // other parameters
-    $all=3Dnew IText();
-    $all->table=3D1;
-    echo '<form method=3D"post" >';
-    echo dossier::hidden();
-    echo "<table class=3D\"result\" style=3D\"width:auto\">";
-    echo "<tr>".td(_('Nom soci=C3=A9t=C3=A9'),'style=3D"text-align:right=
"').$all->input("p_name",$my->MY_NAME)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("T=C3=A9l=C3=A9phone"),'style=3D"text-align:right"'=
).$all->input("p_tel",$my->MY_TEL)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("Fax"),'style=3D"text-align:right"').$all->input("p=
_fax",$my->MY_FAX)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("Rue "),'style=3D"text-align:right"').$all->input("=
p_street",$my->MY_STREET)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("Num=C3=A9ro"),'style=3D"text-align:right"').$all->=
input("p_no",$my->MY_NUMBER)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("Code Postal"),'style=3D"text-align:right"').$all->=
input("p_cp",$my->MY_CP)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("Commune"),'style=3D"text-align:right"').$all->inpu=
t("p_Commune",$my->MY_COMMUNE)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("Pays"),'style=3D"text-align:right"').$all->input("=
p_pays",$my->MY_PAYS)."</tr>";
-    $all->value=3D'';
-    echo "<tr>".td(_("Num=C3=A9ro de Tva"),'style=3D"text-align:right"')=
.$all->input("p_tva",$my->MY_TVA)."</tr>";
-    echo "<tr>".td(_("Utilisation de la compta. analytique"),'style=3D"t=
ext-align:right"').$compta->input("p_compta",$array)."</tr>";
-   =20
-    echo "<tr>".td(_("Utilisation du mode strict "),'style=3D"text-align=
:right"').$strict->input("p_strict",$strict_array)."</tr>";
-    echo "<tr>".td(_("Assujetti =C3=A0 la tva"),'style=3D"text-align:rig=
ht"').$tva_use->input("p_tva_use",$strict_array)."</tr>";
-    echo "<tr>".td(_("Sugg=C3=A9rer le num=C3=A9ro de pi=C3=A8ce justifi=
cative"),'style=3D"text-align:right"').$pj_suggest->input("p_pj",$strict_=
array)."</tr>";
-    echo "<tr>".td(_("Sugg=C3=A9rer la date"),'style=3D"text-align:right=
"').$date_suggest->input("p_date_suggest",$strict_array)."</tr>";
-    echo '<tr>'.td(_('Afficher la p=C3=A9riode comptable pour =C3=A9vite=
r les erreurs de date'),'style=3D"text-align:right"').$check_periode->inp=
ut('p_check_periode',$strict_array).'</tr>';
-    echo '<tr>'.td(_('Utilisez des postes comptables alphanum=C3=A9rique=
'),'style=3D"text-align:right"').$alpha_num->input('p_alphanum').'</tr>';
-    echo '<tr>'.td(_('Changer le libell=C3=A9 des d=C3=A9tails en VEN ou=
 ACH'),'style=3D"text-align:right"').$updlab->input('p_updlab').'</tr>';
+$updlab =3D new ISelect();
+$updlab->table =3D 1;
+$updlab->value =3D $updlab_array;
+$updlab->selected =3D $my->MY_UPDLAB;
=20
-    echo "</table>";
-    echo HtmlInput::submit("record_company",_("Sauve"));
-    echo "</form>";
-    echo '</div>';
-    exit();
+$stock =3D new ISelect('p_stock');
+$stock->value =3D array(
+	array('value' =3D> 'N', 'label' =3D> _('Non')),
+	array('value' =3D> 'Y', 'label' =3D> _('Oui'))
+);
+$stock->selected =3D $my->MY_STOCK;
+$stock->table =3D 1;
=20
+// other parameters
+$all =3D new IText();
+$all->table =3D 1;
+echo '<form method=3D"post" >';
+echo dossier::hidden();
+echo "<table class=3D\"result\" style=3D\"width:auto\">";
+echo "<tr>" . td(_('Nom soci=C3=A9t=C3=A9'), 'style=3D"text-align:right"=
') . $all->input("p_name", $my->MY_NAME) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("T=C3=A9l=C3=A9phone"), 'style=3D"text-align:right"')=
 . $all->input("p_tel", $my->MY_TEL) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("Fax"), 'style=3D"text-align:right"') . $all->input("=
p_fax", $my->MY_FAX) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("Rue "), 'style=3D"text-align:right"') . $all->input(=
"p_street", $my->MY_STREET) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("Num=C3=A9ro"), 'style=3D"text-align:right"') . $all-=
>input("p_no", $my->MY_NUMBER) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("Code Postal"), 'style=3D"text-align:right"') . $all-=
>input("p_cp", $my->MY_CP) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("Commune"), 'style=3D"text-align:right"') . $all->inp=
ut("p_Commune", $my->MY_COMMUNE) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("Pays"), 'style=3D"text-align:right"') . $all->input(=
"p_pays", $my->MY_PAYS) . "</tr>";
+$all->value =3D '';
+echo "<tr>" . td(_("Num=C3=A9ro de Tva"), 'style=3D"text-align:right"') =
. $all->input("p_tva", $my->MY_TVA) . "</tr>";
+echo "<tr>" . td(_("Utilisation de la compta. analytique"), 'style=3D"te=
xt-align:right"') . $compta->input("p_compta", $array) . "</tr>";
+echo "<tr>" . td(_("Utilisation des stocks"), 'style=3D"text-align:right=
"') . $stock->input() . "</tr>";
+
+echo "<tr>" . td(_("Utilisation du mode strict "), 'style=3D"text-align:=
right"') . $strict->input("p_strict", $strict_array) . "</tr>";
+echo "<tr>" . td(_("Assujetti =C3=A0 la tva"), 'style=3D"text-align:righ=
t"') . $tva_use->input("p_tva_use", $strict_array) . "</tr>";
+echo "<tr>" . td(_("Sugg=C3=A9rer le num=C3=A9ro de pi=C3=A8ce justifica=
tive"), 'style=3D"text-align:right"') . $pj_suggest->input("p_pj", $stric=
t_array) . "</tr>";
+echo "<tr>" . td(_("Sugg=C3=A9rer la date"), 'style=3D"text-align:right"=
') . $date_suggest->input("p_date_suggest", $strict_array) . "</tr>";
+echo '<tr>' . td(_('Afficher la p=C3=A9riode comptable pour =C3=A9viter =
les erreurs de date'), 'style=3D"text-align:right"') . $check_periode->in=
put('p_check_periode', $strict_array) . '</tr>';
+echo '<tr>' . td(_('Utilisez des postes comptables alphanum=C3=A9rique')=
, 'style=3D"text-align:right"') . $alpha_num->input('p_alphanum') . '</tr=
>';
+echo '<tr>' . td(_('Changer le libell=C3=A9 des d=C3=A9tails en VEN ou A=
CH'), 'style=3D"text-align:right"') . $updlab->input('p_updlab') . '</tr>=
';
+
+echo "</table>";
+echo HtmlInput::submit("record_company", _("Sauve"));
+echo "</form>";
+echo '</div>';
+exit();
 ?>

Added: phpcompta/trunk/include/stock_cfg.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_cfg.inc.php	                        (re=
v 0)
+++ phpcompta/trunk/include/stock_cfg.inc.php	2012-06-13 19:16:44 UTC (re=
v 4891)
@@ -0,0 +1,160 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief Manage the repository
+ *
+ */
+require_once 'class_stock_sql.php';
+require_once 'class_sort_table.php';
+
+global $g_user, $cn,$g_parameter;
+
+if ($g_parameter->MY_STOCK =3D=3D 'N')
+{
+	echo '<h2 class=3D"notice">';
+	echo _("Vous n'utilisez pas de gestion de stock");
+	echo '</h2>';
+	exit();
+}
+if ( isset ($_POST['add_stock']))
+{
+	$st=3Dnew Stock_Sql();
+	$st->from_array($_POST);
+	$st->insert();
+
+}
+if ( isset ($_POST['mod_stock']))
+{
+	$st=3Dnew Stock_Sql($_POST['r_id']);
+	$st->from_array($_POST);
+	$st->update();
+
+}
+$tb=3Dnew Sort_Table();
+$p_url=3DHtmlInput::get_to_string(array("ac","gDossier"));
+
+$tb->add(_("Nom"), $p_url, " order by r_name asc", "order by r_name desc=
", "ona", "ond");
+$tb->add(_("Adresse"), $p_url, " order by r_adress asc", "order by r_adr=
ess desc", "oaa", "oad");
+$tb->add(_("Ville"), $p_url, " order by r_city asc", "order by r_city de=
sc", "ova", "ovd");
+$tb->add(_("Pays"), $p_url, " order by r_country asc", "order by r_count=
ry desc", "opa", "opd");
+$tb->add(_("T=C3=A9l=C3=A9phone"), $p_url, " order by r_phone asc", "ord=
er by r_phone desc", "opa", "opd");
+
+$sql=3D"select * from stock_repository ";
+
+$ord=3D(isset($_GET['ord']))?$_GET['ord']:"ona";
+
+$order=3D$tb->get_sql_order($ord);
+
+$array=3D$cn->get_array($sql." ".$order);
+
+?>
+<div class=3D"content">
+
+<table class=3D"result">
+	<tr>
+		<th><?=3D$tb->get_header(0)?></th>
+		<th><?=3D$tb->get_header(1)?></th>
+		<th><?=3D$tb->get_header(2)?></th>
+		<th><?=3D$tb->get_header(3)?></th>
+		<th><?=3D$tb->get_header(4)?></th>
+	</tr>
+<? for ($i=3D0;$i<count($array);$i++): ?>
+	<tr>
+		<td>
+			<?=3Dh($array[$i]['r_name'])?>
+		</td>
+		<td>
+			<?=3Dh($array[$i]['r_adress'])?>
+		</td>
+		<td>
+			<?=3Dh($array[$i]['r_city'])?>
+		</td>
+		<td>
+			<?=3Dh($array[$i]['r_country'])?>
+		</td>
+		<td>
+			<?=3Dh($array[$i]['r_phone'])?>
+		</td>
+		<td>
+			<?
+				$js=3D' onclick=3D"stock_repo_change(\''.dossier::id().'\',\''.$arra=
y[$i]['r_id'].'\')"';
+				echo HtmlInput::button("mod", _("Modifier"), $js);
+			?>
+		</td>
+	</tr>
+
+<?endfor;?>
+</table>
+	<?=3DHtmlInput::button("show_add_depot_d", "Ajout d'un d=C3=A9pot", "on=
click=3D\"$('add_depot_d').show();\"");?>
+	<div id=3D"add_depot_d" class=3D"inner_box" style=3D"display:none">
+	<?=3DHtmlInput::title_box("Ajouter un d=C3=A9p=C3=B4t","add_depot_d","h=
ide")?>
+	<form method=3D"post">
+		<table>
+			<tr>
+				<td>
+					Nom
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_name",""); echo $name->input();?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					Adresse
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_adress",""); echo $name->input();?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					Ville
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_city",""); echo $name->input();?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					Pays
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_country",""); echo $name->input();?>
+				</td>
+			</tr>
+			<tr>
+				<td>
+					T=C3=A9l=C3=A9phone
+				</td>
+				<td>
+					<? $name=3Dnew IText("r_phone",""); echo $name->input();?>
+				</td>
+			</tr>
+
+		</table>
+		<?=3DHtmlInput::submit("add_stock","Sauver")?>
+	</form>
+	</div>
+</div>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-13 17:22:54 UTC (rev 4890)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-13 19:16:44 UTC (rev 4891)
@@ -212,3 +212,32 @@
 INSERT INTO profile (p_name, p_id, p_desc, with_calc, with_direct_form) =
VALUES ('Public', -1, 'faux groupe', NULL, NULL);
 insert into user_sec_action_profile(p_id,p_granted,ua_right) select 1,p_=
id,'W' from profile;
 insert into user_sec_action_profile(p_id,p_granted ,ua_right) select 2,p=
_id,'W' from profile;
+insert into parameter values('MY_STOCK','N');
+
+INSERT INTO menu_ref(me_code, me_menu, me_file, me_url, me_description, =
me_parameter,
+            me_javascript, me_type)
+    VALUES ('CFGSTOCK', 'Configuration des d=C3=A9p=C3=B4ts', 'stock_cfg=
.inc.php', null, 'Configuration d=C3=A9p=C3=B4ts', null,null,'ME');
+
+INSERT INTO profile_menu(me_code, me_code_dep, p_id, p_order, p_type_dis=
play, pm_default)
+    VALUES ('CFGSTOCK', 'PARAM', 1, 40, 'E', 0);
+
+CREATE TABLE stock_repository
+(
+  r_id bigserial NOT NULL, -- pk
+  r_name text, -- name of the stock
+  r_adress text, -- adress of the stock
+  r_country text, -- country of the stock
+  r_city text, -- City of the stock
+  r_phone text, -- City of the stock
+  CONSTRAINT stock_repository_pkey PRIMARY KEY (r_id )
+);
+
+COMMENT ON TABLE stock_repository  IS 'stock repository';
+COMMENT ON COLUMN stock_repository.r_id IS 'pk';
+COMMENT ON COLUMN stock_repository.r_name IS 'name of the stock';
+COMMENT ON COLUMN stock_repository.r_adress IS 'adress of the stock';
+COMMENT ON COLUMN stock_repository.r_country IS 'country of the stock';
+COMMENT ON COLUMN stock_repository.r_city IS 'City of the stock';
+COMMENT ON COLUMN stock_repository.r_phone  IS 'Phone number';
+
+insert into stock_repository(r_name) values ('D=C3=A9p=C3=B4t par d=C3=A9=
faut');
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 13 15:57:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Seth3-0004Ow-C6
	for mharc-phpcompta-dev@gnu.org; Wed, 13 Jun 2012 15:57:29 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 13 Jun 2012 21:48:49 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.192118.1339617448.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4892 - in phpcompta/trunk: include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jun 2012 19:57:27 -0000

Author: danydb
Date: 2012-06-13 21:48:49 +0200 (Wed, 13 Jun 2012)
New Revision: 4892

Added:
   phpcompta/trunk/include/class_stock_sql.php
   phpcompta/trunk/include/template/user_sec_repository.php
Modified:
   phpcompta/trunk/include/ajax_get_profile.php
   phpcompta/trunk/include/class_profile_menu.php
   phpcompta/trunk/include/profile.inc.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000575: S?\195?\169curit?\195?\169: limiter d?\195?\169pot

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-13 19:16:44 UTC =
(rev 4891)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-13 19:48:49 UTC =
(rev 4892)
@@ -82,6 +82,9 @@
 	echo $add_one;
 	echo "<h2>Action gestion accessible</h2>";
 	$profile_menu->available_profile($p_id);
+	echo "<h2>D=C3=A9p=C3=B4t de stock accessible</h2>";
+	$profile_menu->available_repository($p_id);
+
 }
 ?>
=20

Modified: phpcompta/trunk/include/class_profile_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_profile_menu.php	2012-06-13 19:16:44 UT=
C (rev 4891)
+++ phpcompta/trunk/include/class_profile_menu.php	2012-06-13 19:48:49 UT=
C (rev 4892)
@@ -208,6 +208,10 @@
 			$gDossier =3D Dossier::id();
 			$this->sub_menu($ret, $p_id);
 		}
+		/**
+		 * Show the available profile for the profile $p_id, it concerns only =
the action of management (action-gestion)
+		 * @param $p_id is the profile p_id
+		 */
 		function available_profile($p_id)
 		{
 			$array=3D$this->cn->get_array("
@@ -228,7 +232,30 @@
 					);
 			require_once 'template/user_sec_profile.php';
 		}
+		/**
+		 * Show the available repository for the profile $p_id
+		 * @param $p_id is the profile p_id
+		 */
+		function available_repository($p_id)
+		{
+			$array=3D$this->cn->get_array("
+					select p.r_id,p.r_name,s.ur_id,s.ur_right
+						from stock_repository as p
+						join user_sec_repository as s on (s.r_id=3Dp.r_id)
+						where s.p_id=3D$1
+					union
+						select p2.r_id, p2.r_name,null,'X'
+						from stock_repository as p2
+						where
+						p2.r_id not in (select r_id from user_sec_repository where p_id =3D=
 $1) order by r_name;
+				",array($p_id));
+			$aright_value=3Darray(
+								array('value'=3D>'R','label'=3D>_('Lecture')),
+								array('value'=3D>'W','label'=3D>_('Ecriture')),
+								array('value'=3D>'X','label'=3D>_('Aucun acc=C3=A8s'))
+					);
+			require_once 'template/user_sec_repository.php';
+		}
 	}
-
 	//end class
 	?>
\ No newline at end of file

Added: phpcompta/trunk/include/class_stock_sql.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_sql.php	                        (=
rev 0)
+++ phpcompta/trunk/include/class_stock_sql.php	2012-06-13 19:48:49 UTC (=
rev 4892)
@@ -0,0 +1,64 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief
+ *
+ */
+require_once 'class_phpcompta_sql.php';
+
+class Stock_Sql extends PhpCompta_Sql {
+	function __construct($p_id=3D-1)
+	{
+		$this->table =3D "public.stock_repository";
+		$this->primary_key =3D "r_id";
+
+		$this->name=3Darray(
+			"id"=3D>"r_id",
+			"name"=3D>"r_name",
+			"adress"=3D>"r_adress",
+			"city"=3D>"r_city",
+			"country"=3D>"r_country",
+			"phone"=3D>"r_phone"
+		);
+
+		$this->type =3D array(
+			"r_id"=3D>"numeric",
+			"r_name"=3D>"text",
+			"r_adress"=3D>"text",
+			"r_city"=3D>"text",
+			"r_country"=3D>"text",
+			"r_phone"=3D>"text"
+
+			);
+
+		$this->default =3D array(
+			"r_id" =3D> "auto",
+		);
+		global $cn;
+
+		parent::__construct($cn,$p_id);
+	}
+}
+?>

Modified: phpcompta/trunk/include/profile.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/profile.inc.php	2012-06-13 19:16:44 UTC (rev =
4891)
+++ phpcompta/trunk/include/profile.inc.php	2012-06-13 19:48:49 UTC (rev =
4892)
@@ -58,6 +58,41 @@
 	}
 }
 //**********************************************
+// Save avail. profiles
+//**********************************************
+if (isset($_POST['change_stock']))
+{
+	extract($_POST);
+	try
+	{
+		for ($e =3D 0; $e < count($right); $e++)
+		{
+			if ($right[$e] =3D=3D 'X' && $ur_id[$e]=3D=3D'')
+				continue;
+			if ($right[$e] =3D=3D 'X' && $ur_id[$e]!=3D'')
+			{
+				$cn->exec_sql("delete from user_sec_repository where p_id=3D$1 and r=
_id=3D$2", array($p_id, $ar_id[$e]));
+				continue;
+			}
+			if ($ur_id[$e] =3D=3D "")
+			{
+				$cn->exec_sql("insert into user_sec_repository (p_id,r_id,ur_right) =
values($1,$2,$3)", array($p_id, $ar_id[$e], $right[$e]));
+				continue;
+			}
+			if ($ur_id[$e] !=3D '')
+			{
+				$cn->exec_sql("update user_sec_repository set ur_right=3D$3 where  p=
_id=3D$1 and r_id=3D$2 ", array($p_id, $ar_id[$e], $right[$e]));
+				continue;
+			}
+		}
+	}
+	catch (Exception $exc)
+	{
+		echo $exc->getTraceAsString();
+		throw $exc;
+	}
+}
+//**********************************************
 // Save_name
 // *********************************************
=20

Added: phpcompta/trunk/include/template/user_sec_repository.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_repository.php	            =
            (rev 0)
+++ phpcompta/trunk/include/template/user_sec_repository.php	2012-06-13 1=
9:48:49 UTC (rev 4892)
@@ -0,0 +1,53 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+/**
+ * @file
+ * @brief show the available profiles for action-management
+ *
+ */
+?>
+<form method=3D"POST" class=3D"print">
+	<?=3DHtmlInput::hidden("p_id", $p_id);?>
+	<table>
+		<tr>
+			<th><?=3D_("D=C3=A9pot")?></th>
+			<th><?=3D_("Acc=C3=A8s")?></th>
+		</tr>
+		<? for ($i=3D0;$i<count($array);$i++): ?>
+		<tr>
+			<td>
+				<?=3D$array[$i]['r_name']?>
+				<?=3DHtmlInput::hidden('ur_id[]',$array[$i]['ur_id'])?>
+				<?=3DHtmlInput::hidden('ar_id[]',$array[$i]['r_id'])?>
+			</td>
+			<td>
+				<?
+				$isel=3Dnew ISelect("right[]");
+				$isel->value=3D$aright_value;
+				$isel->selected=3D$array[$i]['ur_right'];
+				echo $isel->input();?>
+			</td>
+		</tr>
+		<?endfor;?>
+	</table>
+<?=3DHtmlInput::submit("change_stock", "Sauver")?>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-13 19:16:44 UTC (rev 4891)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-13 19:48:49 UTC (rev 4892)
@@ -240,4 +240,25 @@
 COMMENT ON COLUMN stock_repository.r_city IS 'City of the stock';
 COMMENT ON COLUMN stock_repository.r_phone  IS 'Phone number';
=20
-insert into stock_repository(r_name) values ('D=C3=A9p=C3=B4t par d=C3=A9=
faut');
\ No newline at end of file
+insert into stock_repository(r_name) values ('D=C3=A9p=C3=B4t par d=C3=A9=
faut');
+
+CREATE TABLE user_sec_repository
+(
+  ur_id bigserial NOT NULL, -- pk
+  p_id bigint, -- fk to profile
+  r_id bigint,
+  ur_right character(1), -- Type of right : R for readonly W for write
+  CONSTRAINT user_sec_repository_pkey PRIMARY KEY (ur_id ),
+  CONSTRAINT user_sec_repository_p_id_fkey FOREIGN KEY (p_id)
+      REFERENCES profile (p_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT user_sec_repository_r_id_fkey FOREIGN KEY (r_id)
+      REFERENCES stock_repository (r_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT user_sec_profile_ur_right_check CHECK (ur_right =3D ANY (AR=
RAY['R'::bpchar, 'W'::bpchar]))
+);
+COMMENT ON TABLE user_sec_repository  IS 'Available profile for user';
+COMMENT ON COLUMN user_sec_repository.ur_id IS 'pk';
+COMMENT ON COLUMN user_sec_repository.p_id IS 'fk to profile';
+COMMENT ON COLUMN user_sec_repository.r_id IS 'fk to stock_repository';
+COMMENT ON COLUMN user_sec_repository.ur_right IS 'Type of right : R for=
 readonly W for write';
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 08:33:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sf9EX-0004KF-Jn
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 08:33:05 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 14:24:11 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.194779.1339677185.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4893 - in phpcompta/trunk: include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 12:33:04 -0000

Author: danydb
Date: 2012-06-14 14:24:10 +0200 (Thu, 14 Jun 2012)
New Revision: 4893

Modified:
   phpcompta/trunk/include/class_document.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/sql/upgrade.sql
Log:
#621 G?\195?\169n?\195?\169ration de document: tag g?\195?\169n?\195?\169=
ric
#620 G?\195?\169n?\195?\169ration de document : acompte
replace Document::a_ref by Document::anchor
Add constraint for user_sec_repository user_sec_action_profile=20


Modified: phpcompta/trunk/include/class_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_document.php	2012-06-13 19:48:49 UTC (r=
ev 4892)
+++ phpcompta/trunk/include/class_document.php	2012-06-14 12:24:10 UTC (r=
ev 4893)
@@ -359,7 +359,7 @@
      *
      * \return a string
      */
-    function a_ref()
+    function anchor()
     {
         if ( $this->d_id =3D=3D 0 )
             return '';
@@ -496,6 +496,7 @@
      *  - [BENEF_CO]
      *  - [BENEF_CITY]
      *  - [BENEF_VAT]
+     *  - [ACOMPTE]
      *
      * \param $p_tag TAG
      * \param $p_array data from $_POST
@@ -1074,7 +1075,40 @@
             if ( isset($p_array['e_comm']))
                 return $p_array['e_comm'];
             break;
+        case 'ACOMPTE':
+            if ( isset($p_array['acompte']))
+                return $p_array['acompte'];
+            break;
         }
+        /*
+         * retrieve the value of ATTR for e_march
+         */
+        if (preg_match('/^ATTR/', $p_tag) =3D=3D 1)
+        {
+            // Retrieve f_id=20
+            if ( isset ($p_array['e_march'.$counter]))
+            {
+                $id =3D $p_array['e_march' . $counter];
+                $r=3D$this->replace_special_tag($id,$p_tag);
+            }
+        }
+        /*
+         * retrieve the value of ATTR for e_march
+         */
+        if (preg_match('/^BENEFATTR/', $p_tag) =3D=3D 1)
+        {
+            $qcode=3Disset($p_array['qcode_benef'])?$p_array['qcode_bene=
f']:'';
+            // Retrieve f_id=20
+             $r=3D$this->replace_special_tag($qcode,$p_tag);
+        }
+        if (preg_match('/^CUSTATTR/', $p_tag) =3D=3D 1)
+        {
+            if ( isset($p_array['qcode_dest']) || isset($p_array['e_clie=
nt']) )
+            {
+                $qcode=3D(isset($p_array['qcode_dest']))?$p_array['qcode=
_dest']:$p_array['e_client'];
+                $r=3D$this->replace_special_tag($id,$p_tag);
+            }
+        }
         return $r;
     }
     /*!\brief remove a row from the table document, the lob object is no=
t deleted
@@ -1106,6 +1140,49 @@
=20
=20
     }
+    /**
+     *Replace a special tag *TAGxxxx with the value from fiche_detail, t=
he xxxx
+     * is the ad_value=20
+     * @param $p_qcode qcode of the card
+     * @param $p_tag tag to parse
+     * @return  the ad_value contained in fiche_detail or for the type "=
select" the
+     *          label
+     */
+    function replace_special_tag($p_qcode, $p_tag)
+    {
+        // check if the march exists
+        if ($qcode =3D=3D "")
+            return "";
=20
+        $f =3D new Fiche($this->db);
+        $found =3D $f->get_by_qcode($qcode, false);
+        // if not found exit
+        if ($found =3D=3D 1)
+            return "";
=20
+        // get the ad_id
+        $attr=3Dpreg_replace("/^.*ATTR/","",$p_tag);
+       =20
+        if (isNumber($attr) =3D=3D 0) return "";
+        $ad_type=3D$this->db->get_value("select ad_type from attr_def wh=
ere ad_id=3D$1",$attr);
+       =20
+        // get ad_value
+        $ad_value=3D$this->db->get_value("select ad_value from fiche_det=
ail where f_id=3D$1 and ad_id=3D$2",array($f->id,$attr));
+       =20
+        // if ad_id is type select execute select and get value
+        if ( $ad_type=3D=3D"select")
+        {
+            $sql=3D$this->db->get_value("select ad_extra from attr_def w=
here ad_id=3D$1",$attr);
+            $array=3D $this->db->make_array($sql);
+            for ($a=3D0;$a<count ($array);$a++)
+            {
+                if ($array[$a]['value']=3D=3D$ad_value)=20
+                    return $array[$a]['label'];
+            }
+           =20
+        }
+        // if ad_id is not type select get value
+        return $ad_value;
+    }
+
 }

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-13 19:48:49 UTC (=
rev 4892)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-14 12:24:10 UTC (=
rev 4893)
@@ -227,7 +227,7 @@
 			if (strlen(trim($doc->d_lob)) !=3D 0)
 			{
 				$d_id =3D new IHidden();
-				$doc_ref =3D "<p> Document " . $doc->a_ref() . '</p>';
+				$doc_ref =3D "<p> Document " . $doc->anchor() . '</p>';
 				$doc_ref.=3D$h2->input() . $d_id->input('d_id', $this->d_id);
 			}
 		}

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-13 19:48:49 UTC (rev 4892)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-14 12:24:10 UTC (rev 4893)
@@ -261,4 +261,7 @@
 COMMENT ON COLUMN user_sec_repository.ur_id IS 'pk';
 COMMENT ON COLUMN user_sec_repository.p_id IS 'fk to profile';
 COMMENT ON COLUMN user_sec_repository.r_id IS 'fk to stock_repository';
-COMMENT ON COLUMN user_sec_repository.ur_right IS 'Type of right : R for=
 readonly W for write';
\ No newline at end of file
+COMMENT ON COLUMN user_sec_repository.ur_right IS 'Type of right : R for=
 readonly W for write';
+
+alter table user_sec_repository add constraint user_sec_repository_r_id_=
p_id_u unique (r_id,p_id);
+alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 09:44:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfALG-0007Es-OA
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 09:44:06 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 15:35:15 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195007.1339681446.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4894 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 13:44:05 -0000

Author: danydb
Date: 2012-06-14 15:35:15 +0200 (Thu, 14 Jun 2012)
New Revision: 4894

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/class_user.php
   phpcompta/trunk/include/user_common.php
Log:
Add HtmlInput::select_stock
Add function User::can_write_action and User::can_write_repo
Insert into the stock with repository
Let select the stock in Acc_Ledger_Purchase::confirm

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-14 12:2=
4:10 UTC (rev 4893)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-14 13:3=
5:15 UTC (rev 4894)
@@ -471,9 +471,9 @@
=20
                 // always save quantity but in withStock we can find
                 // what card need a stock management
+                if ( $g_parameter->MY_STOCK=3D'Y')
+                    InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nN=
eg*${'e_quant'.$i},'d') ;
=20
-                InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nNeg*$=
{'e_quant'.$i},'d') ;
-
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
                 {
                     // for each item, insert into operation_analytique *=
/
@@ -1504,8 +1504,10 @@
             $r.=3DHtmlInput::hidden("e_quant".$i,${"e_quant".$i});
=20
         }
-		if ( ! $p_summary ) $r.=3D$this->extra_info();
-		if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0 )
+	if ( ! $p_summary )=20
+            $r.=3D$this->extra_info();
+       =20
+	if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0 )
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
             $r.=3DHtmlInput::hidden('acompte',$acompte);
@@ -1518,8 +1520,12 @@
             $r.=3D'<br>';
         }
         // check for upload piece
-
-
+       =20
+       // Show the available repository
+        if ( $g_parameter->MY_STOCK=3D=3D'Y')
+        {
+           $r.=3DHtmlInput::select_stock('repo','W');
+        }
         return $r;
     }
=20

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-06-14 12:24:10 UTC =
(rev 4893)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-14 13:35:15 UTC =
(rev 4894)
@@ -616,4 +616,34 @@
                   $p_url,$p_js,$p_text);
           return $str;
       }
+      /**
+       *Create an ISelect object containing the available repository for=
 reading
+       * or writing
+       * @global $g_user
+       * @param $p_cn db object
+       * @param $p_name name of the select
+       * @param $p_mode is 'R' for reading, 'W' for writinh
+       * @return ISelect
+       * @throws Exception if p_mode is wrong
+       */
+      static function select_stock( $p_cn, $p_name,$p_mode)
+      {
+          global $g_user;
+          if ( in_array($p_mode,array('R','W') ) )
+          {
+              throw  new Exception  (__FILE__.":".__LINE__." $p_mode inv=
alide");
+          }
+          $profile=3D$g_user->get_profile();
+          $sel=3Dnew ISelect($p_name);
+         =20
+          $write=3D($p_mode=3D=3D'W')?"ur_right=3D'W' and ":"";
+         =20
+          $sel->value=3D$p_cn->make_array("
+                select r_id,r_name from stock_repository
+                where=20
+                $write p_id=3D$1
+                order by 2
+              ",array($profile));
+          return $sel;
+      }
 }
\ No newline at end of file

Modified: phpcompta/trunk/include/class_user.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_user.php	2012-06-14 12:24:10 UTC (rev 4=
893)
+++ phpcompta/trunk/include/class_user.php	2012-06-14 13:35:15 UTC (rev 4=
894)
@@ -1024,14 +1024,21 @@
 			$this->db->exec_sql("update profile_user set p_id=3D$1 where user_nam=
e=3D$2", array($p_id, $this->login));
 		}
 	}
-
+        /**
+         *return the profile (p_id)
+         * @return profile.p_id
+         */
 	function get_profile()
 	{
 		$profile =3D $this->db->get_value("select p_id from profile_user where
 				user_name=3D$1", array($this->login));
 		return $profile;
 	}
-
+        /**
+         *Check if the profile of the user can write for this profile
+         * @param  $dtoc action_gestion.ag_id
+         * @return true if he can write otherwise false
+         */
 	function can_write_action($dtoc)
 	{
 		$profile =3D $this->get_profile();
@@ -1042,6 +1049,11 @@
 		return true;
 	}
=20
+        /**
+         *Check if the profile of the user can write for this profile
+         * @param  $dtoc action_gestion.ag_id
+         * @return true if he can write otherwise false
+         */
 	function can_read_action($dtoc)
 	{
 		$profile =3D $this->get_profile();
@@ -1051,6 +1063,42 @@
 			return false;
 		return true;
 	}
+        /**
+         *Check if the profile of the user can write for this repository
+         * @param  $p_repo stock_repository.r_id
+         * @return true if he can write otherwise false
+         */
+        function can_write_repo($p_repo)
+        {
+            $profile=3D$this->get_profile();
+            $r=3D$this->db->get_value("select count(*)
+                from user_sec_repository=20
+                where=20
+                r_id=3D$1
+                and p_id =3D$2=20
+                and ur_right=3D'W'",array($p_repo,$profile));
+            if ( $r=3D=3D0)
+                return false;
+            return true;
+        }
+       /**
+         *Check if the profile of the user can read for this repository
+         * @param  $p_repo stock_repository.r_id
+         * @return true if he read write otherwise false
+         */
+        function can_read_repo($p_repo)
+        {
+            $profile=3D$this->get_profile();
+            $r=3D$this->db->get_value("select count(*)
+                from user_sec_repository=20
+                where=20
+                r_id=3D$1
+                and p_id =3D$2=20
+               ",array($p_repo,$profile));
+            if ( $r=3D=3D0)
+                return false;
+            return true;
+        }
=20
 }
=20

Modified: phpcompta/trunk/include/user_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/user_common.php	2012-06-14 12:24:10 UTC (rev =
4893)
+++ phpcompta/trunk/include/user_common.php	2012-06-14 13:35:15 UTC (rev =
4894)
@@ -44,38 +44,45 @@
  * \param $p_j_id the j_id
  * \param $p_good the goods
  * \param $p_quant  quantity
- * \param $p_type c for credit or d for debit
+ * \param $p_type c for SALE or d for PURCHASE
  *
- * \return none
+ * \return $res of the insert or false if something gets wrong
  * \note Link to jrn gives the date
  */
-function InsertStockGoods($p_cn,$p_j_id,$p_good,$p_quant,$p_type)
+function InsertStockGoods($p_cn, $p_j_id, $p_good, $p_quant, $p_type,$p_=
depot)
 {
     global $g_user;
+    if ( $g_user->can_write_repo($p_depo) =3D=3D false )=20
+        return false;
+
     // Retrieve the good account for stock
-    $code=3Dnew Fiche($p_cn);
+    $code =3D new Fiche($p_cn);
     $code->get_by_qcode($p_good);
-    $code_marchandise=3D$code->strAttribut(ATTR_DEF_STOCK);
-    $p_good=3Dsql_string($p_good);
-    $sql=3D"select f_id from vw_poste_qcode where j_qcode=3Dupper('$p_go=
od')";
-    $Res=3D$p_cn->exec_sql($sql);
-    $r=3DDatabase::fetch_array($Res,0);
-    $f_id=3D$r['f_id'];
-    $exercice=3D$g_user->get_exercice();
-    if ( $exercice =3D=3D 0 ) throw new Exception ('Annee invalide erreu=
r');
+    $code_marchandise =3D $code->strAttribut(ATTR_DEF_STOCK);
+    if ( $code_marchandise =3D=3D NOTFOUND )=20
+        return false;
+   =20
+    $exercice =3D $g_user->get_exercice();
+   =20
+    if ($exercice =3D=3D 0)
+        throw new Exception('Annee invalide erreur');
=20
-
-    $Res=3D$p_cn->exec_sql("insert into stock_goods (
+    $Res =3D $p_cn->exec_sql("insert into stock_goods (
                          j_id,
                          f_id,
                          sg_code,
                          sg_quantity,
-                         sg_type,sg_exercice ) values (
-                         $p_j_id,
-                         $f_id,
-                         '$code_marchandise',
-                         $p_quant, '$p_type',$exercice)
-                         ");
+                         sg_type,sg_exercice,r_id ) values ($1,$2,$3,$4,=
$5,$6,$7)",=20
+            array(
+                    $p_j_id,
+                    $code->id,
+                    $code_marchandise,
+                    $p_quant,=20
+                    $p_type,
+                    $exercice,
+                    $p_depot
+                )
+            );
     return $Res;
 }
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 14:06:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfERR-0001Vq-2I
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 14:06:45 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 19:57:58 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195667.1339697203.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4895 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 18:06:43 -0000

Author: danydb
Date: 2012-06-14 19:57:57 +0200 (Thu, 14 Jun 2012)
New Revision: 4895

Modified:
   phpcompta/trunk/html/ajax_ledger.php
Log:
Message compr?\195?\169hensible si op?\195?\169ration a ?\195?\169t?\195?=
\169 effac?\195?\169e

Modified: phpcompta/trunk/html/ajax_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_ledger.php	2012-06-14 13:35:15 UTC (rev 489=
4)
+++ phpcompta/trunk/html/ajax_ledger.php	2012-06-14 17:57:57 UTC (rev 489=
5)
@@ -91,6 +91,26 @@
 $op=3Dnew Acc_Operation($cn);
 $op->jr_id=3D$_REQUEST['jr_id'];
 $ledger=3D$op->get_ledger();
+if ($ledger=3D=3D"")
+{
+
+    ob_start();
+    require_once ('template/ledger_detail_forbidden.php');
+    $html=3Dob_get_contents();
+    ob_clean();
+
+    $html=3Descape_xml($html);
+    header('Content-type: text/xml; charset=3DUTF-8');
+    echo <<<EOF
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<data>
+<ctl>$div</ctl>
+<code>$html</code>
+</data>
+EOF;
+    exit();
+
+}
 $access=3D$g_user->get_ledger_access($ledger);
 if ( $access =3D=3D 'X' )
 {



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 14:07:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfESK-0001jU-GR
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 14:07:40 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 19:58:57 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195672.1339697260.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4896 - in phpcompta/trunk: include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 18:07:39 -0000

Author: danydb
Date: 2012-06-14 19:58:57 +0200 (Thu, 14 Jun 2012)
New Revision: 4896

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_document.php
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/user_common.php
   phpcompta/trunk/sql/upgrade.sql
Log:
 0000575: [new feature] S?\195?\169curit?\195?\169: limiter d?\195?\169po=
t (danydb) - r?\195?\169solu.
 0000620: [new feature] G?\195?\169n?\195?\169ration de document : acompt=
e (danydb) - r?\195?\169solu.
 0000621: [new feature] G?\195?\169n?\195?\169ration de document: tag g?\=
195?\169n?\195?\169ric (danydb) - r?\195?\169solu.

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-14 17:5=
7:57 UTC (rev 4895)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-14 17:5=
8:57 UTC (rev 4896)
@@ -472,7 +472,7 @@
                 // always save quantity but in withStock we can find
                 // what card need a stock management
                 if ( $g_parameter->MY_STOCK=3D'Y')
-                    InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nN=
eg*${'e_quant'.$i},'d') ;
+                    InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nN=
eg*${'e_quant'.$i},'d',$repo) ;
=20
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
                 {
@@ -1491,6 +1491,7 @@
         /* Paid by */
         /* if the paymethod is not 0 and if a quick code is given */
=20
+
         for ($i=3D0;$i < $nb_item;$i++)
         {
             $r.=3DHtmlInput::hidden("e_march".$i,${"e_march".$i});
@@ -1504,9 +1505,21 @@
             $r.=3DHtmlInput::hidden("e_quant".$i,${"e_quant".$i});
=20
         }
-	if ( ! $p_summary )=20
+	if ( ! $p_summary )
             $r.=3D$this->extra_info();
-       =20
+	if ($g_parameter->MY_STOCK =3D=3D 'Y')
+		{
+			$sel =3D HtmlInput::select_stock($this->db, 'repo', 'W');
+			$sel->readOnly =3D $p_summary;
+			if ($p_summary =3D=3D true)
+				$sel->selected =3D $repo;
+			$r.=3D"<div style=3D\"clear:both\"></div>";
+			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">D=C3=A9p=C3=B4t</=
h2>';
+			$r.=3D"<p> Dans le d=C3=A9p=C3=B4t : ";
+			$r.=3D$sel->input();
+			$r.=3D'</p>';
+			$r.=3D'</div>';
+		}
 	if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0 )
         {
             $r.=3DHtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.=
$e_mp});
@@ -1515,17 +1528,13 @@
             $r.=3DHtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_=
mp});
 			$fname =3D new Fiche($this->db);
 			$fname->get_by_qcode(${'e_mp_qcode_' . $e_mp});
+			$r.=3D"<div style=3D\"clear:both\"></div>";
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">' . "Pay=C3=A9 pa=
r " . ${'e_mp_qcode_' . $e_mp} .
-					" ".$fname->getName() ." ". _('D=C3=A9duction acompte ').h($acompte=
).'</h2></div>';
+					" ".$fname->getName() ."</h2> ". _('D=C3=A9duction acompte ').h($ac=
ompte).'</div>';
             $r.=3D'<br>';
         }
         // check for upload piece
-       =20
-       // Show the available repository
-        if ( $g_parameter->MY_STOCK=3D=3D'Y')
-        {
-           $r.=3DHtmlInput::select_stock('repo','W');
-        }
+
         return $r;
     }
=20

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-14 17:57:57=
 UTC (rev 4895)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-14 17:58:57=
 UTC (rev 4896)
@@ -353,7 +353,8 @@
=20
                 // always save quantity but in withStock we can find
                 // what card need a stock management
-                InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nNeg*$=
{'e_quant'.$i},'c') ;
+                if ( $g_parameter->MY_STOCK=3D'Y')
+                    InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nN=
eg*${'e_quant'.$i},'c',$repo) ;
=20
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
                 {
@@ -883,6 +884,20 @@
=20
         $e_mp=3D(isset($e_mp))?$e_mp:0;
         $r.=3DHtmlInput::hidden('e_mp',$e_mp);
+		// Show the available repository
+		if ($g_parameter->MY_STOCK =3D=3D 'Y')
+		{
+			$sel =3D HtmlInput::select_stock($this->db, 'repo', 'W');
+			$sel->readOnly =3D $p_summary;
+			if ($p_summary =3D=3D true)
+				$sel->selected =3D $repo;
+			$r.=3D"<div style=3D\"clear:both\"></div>";
+			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">D=C3=A9p=C3=B4t</=
h2>';
+			$r.=3D"<p> Dans le d=C3=A9p=C3=B4t : ";
+			$r.=3D$sel->input();
+			$r.=3D'</p>';
+			$r.=3D'</div>';
+		}
         /* Paid by */
         /* if the paymethod is not 0 and if a quick code is given */
         if ( $e_mp!=3D0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) !=3D 0=
 )
@@ -894,8 +909,9 @@
=20
 			$fname=3Dnew Fiche($this->db);
 			$fname->get_by_qcode(${'e_mp_qcode_'.$e_mp});
+			$r.=3D"<div style=3D\"clear:both\"></div>";
 			$r.=3D'<div style=3D"float:left"><h2 class=3D"info">'."Pay=C3=A9 par =
".${'e_mp_qcode_'.$e_mp}.
-				   " ".$fname->getName().' '._('D=C3=A9duction acompte ').h($acompte=
).'</h2></div>';
+				   " ".$fname->getName().'</H2> '._('D=C3=A9duction acompte ').h($ac=
ompte).'</div>';
             $r.=3D'<br>';
         }
=20

Modified: phpcompta/trunk/include/class_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_document.php	2012-06-14 17:57:57 UTC (r=
ev 4895)
+++ phpcompta/trunk/include/class_document.php	2012-06-14 17:58:57 UTC (r=
ev 4896)
@@ -1078,6 +1078,7 @@
         case 'ACOMPTE':
             if ( isset($p_array['acompte']))
                 return $p_array['acompte'];
+			return "0";
             break;
         }
         /*
@@ -1085,7 +1086,7 @@
          */
         if (preg_match('/^ATTR/', $p_tag) =3D=3D 1)
         {
-            // Retrieve f_id=20
+            // Retrieve f_id
             if ( isset ($p_array['e_march'.$counter]))
             {
                 $id =3D $p_array['e_march' . $counter];
@@ -1098,7 +1099,7 @@
         if (preg_match('/^BENEFATTR/', $p_tag) =3D=3D 1)
         {
             $qcode=3Disset($p_array['qcode_benef'])?$p_array['qcode_bene=
f']:'';
-            // Retrieve f_id=20
+            // Retrieve f_id
              $r=3D$this->replace_special_tag($qcode,$p_tag);
         }
         if (preg_match('/^CUSTATTR/', $p_tag) =3D=3D 1)
@@ -1106,7 +1107,7 @@
             if ( isset($p_array['qcode_dest']) || isset($p_array['e_clie=
nt']) )
             {
                 $qcode=3D(isset($p_array['qcode_dest']))?$p_array['qcode=
_dest']:$p_array['e_client'];
-                $r=3D$this->replace_special_tag($id,$p_tag);
+                $r=3D$this->replace_special_tag($qcode,$p_tag);
             }
         }
         return $r;
@@ -1142,7 +1143,7 @@
     }
     /**
      *Replace a special tag *TAGxxxx with the value from fiche_detail, t=
he xxxx
-     * is the ad_value=20
+     * is the ad_value
      * @param $p_qcode qcode of the card
      * @param $p_tag tag to parse
      * @return  the ad_value contained in fiche_detail or for the type "=
select" the
@@ -1151,35 +1152,35 @@
     function replace_special_tag($p_qcode, $p_tag)
     {
         // check if the march exists
-        if ($qcode =3D=3D "")
+        if ($p_qcode =3D=3D "")
             return "";
=20
         $f =3D new Fiche($this->db);
-        $found =3D $f->get_by_qcode($qcode, false);
+        $found =3D $f->get_by_qcode($p_qcode, false);
         // if not found exit
         if ($found =3D=3D 1)
             return "";
=20
         // get the ad_id
         $attr=3Dpreg_replace("/^.*ATTR/","",$p_tag);
-       =20
+
         if (isNumber($attr) =3D=3D 0) return "";
-        $ad_type=3D$this->db->get_value("select ad_type from attr_def wh=
ere ad_id=3D$1",$attr);
-       =20
+        $ad_type=3D$this->db->get_value("select ad_type from attr_def wh=
ere ad_id=3D$1",array($attr));
+
         // get ad_value
         $ad_value=3D$this->db->get_value("select ad_value from fiche_det=
ail where f_id=3D$1 and ad_id=3D$2",array($f->id,$attr));
-       =20
+
         // if ad_id is type select execute select and get value
         if ( $ad_type=3D=3D"select")
         {
-            $sql=3D$this->db->get_value("select ad_extra from attr_def w=
here ad_id=3D$1",$attr);
+            $sql=3D$this->db->get_value("select ad_extra from attr_def w=
here ad_id=3D$1",array($attr));
             $array=3D $this->db->make_array($sql);
             for ($a=3D0;$a<count ($array);$a++)
             {
-                if ($array[$a]['value']=3D=3D$ad_value)=20
+                if ($array[$a]['value']=3D=3D$ad_value)
                     return $array[$a]['label'];
             }
-           =20
+
         }
         // if ad_id is not type select get value
         return $ad_value;

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-06-14 17:57:57 UTC =
(rev 4895)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-14 17:58:57 UTC =
(rev 4896)
@@ -629,21 +629,22 @@
       static function select_stock( $p_cn, $p_name,$p_mode)
       {
           global $g_user;
-          if ( in_array($p_mode,array('R','W') ) )
+          if ( ! in_array($p_mode,array('R','W') ) )
           {
               throw  new Exception  (__FILE__.":".__LINE__." $p_mode inv=
alide");
           }
           $profile=3D$g_user->get_profile();
           $sel=3Dnew ISelect($p_name);
-         =20
-          $write=3D($p_mode=3D=3D'W')?"ur_right=3D'W' and ":"";
-         =20
-          $sel->value=3D$p_cn->make_array("
-                select r_id,r_name from stock_repository
-                where=20
-                $write p_id=3D$1
-                order by 2
-              ",array($profile));
-          return $sel;
-      }
+
+		  if ($p_mode =3D=3D 'W')
+			{
+			  $sel->value=3D$p_cn->make_array("
+                select r_id,r_name
+				  from stock_repository join user_sec_repository using (r_id)
+                where
+                 ur_right=3D'W' and  p_id=3D".sql_string($profile).
+                " order by 2" );
+		      return $sel;
+			}
+	}
 }
\ No newline at end of file

Modified: phpcompta/trunk/include/user_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/user_common.php	2012-06-14 17:57:57 UTC (rev =
4895)
+++ phpcompta/trunk/include/user_common.php	2012-06-14 17:58:57 UTC (rev =
4896)
@@ -52,18 +52,18 @@
 function InsertStockGoods($p_cn, $p_j_id, $p_good, $p_quant, $p_type,$p_=
depot)
 {
     global $g_user;
-    if ( $g_user->can_write_repo($p_depo) =3D=3D false )=20
+    if ( $g_user->can_write_repo($p_depot) =3D=3D false )
         return false;
=20
     // Retrieve the good account for stock
     $code =3D new Fiche($p_cn);
     $code->get_by_qcode($p_good);
     $code_marchandise =3D $code->strAttribut(ATTR_DEF_STOCK);
-    if ( $code_marchandise =3D=3D NOTFOUND )=20
+    if ( $code_marchandise =3D=3D NOTFOUND )
         return false;
-   =20
+
     $exercice =3D $g_user->get_exercice();
-   =20
+
     if ($exercice =3D=3D 0)
         throw new Exception('Annee invalide erreur');
=20
@@ -72,12 +72,12 @@
                          f_id,
                          sg_code,
                          sg_quantity,
-                         sg_type,sg_exercice,r_id ) values ($1,$2,$3,$4,=
$5,$6,$7)",=20
+                         sg_type,sg_exercice,r_id ) values ($1,$2,$3,$4,=
$5,$6,$7)",
             array(
                     $p_j_id,
                     $code->id,
                     $code_marchandise,
-                    $p_quant,=20
+                    $p_quant,
                     $p_type,
                     $exercice,
                     $p_depot

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-14 17:57:57 UTC (rev 4895)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-14 17:58:57 UTC (rev 4896)
@@ -262,6 +262,11 @@
 COMMENT ON COLUMN user_sec_repository.p_id IS 'fk to profile';
 COMMENT ON COLUMN user_sec_repository.r_id IS 'fk to stock_repository';
 COMMENT ON COLUMN user_sec_repository.ur_right IS 'Type of right : R for=
 readonly W for write';
+alter table stock_good add r_id bigint;
=20
 alter table user_sec_repository add constraint user_sec_repository_r_id_=
p_id_u unique (r_id,p_id);
-alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
\ No newline at end of file
+alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
+ALTER TABLE stock_goods ADD COLUMN r_id bigint;
+update stock_goods set r_id=3D1;
+ALTER TABLE stock_goods   ADD CONSTRAINT stock_goods_sg_type CHECK (sg_t=
ype =3D 'c'::bpchar OR sg_type =3D 'd'::bpchar);
+CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 14:26:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfEkc-0001PY-3U
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 14:26:34 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 20:17:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195711.1339698393.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4897 - in phpcompta/trunk: html include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 18:26:33 -0000

Author: danydb
Date: 2012-06-14 20:17:52 +0200 (Thu, 14 Jun 2012)
New Revision: 4897

Modified:
   phpcompta/trunk/html/user_login.php
   phpcompta/trunk/include/constant.php
Log:
0000622: Indicateur de mise ?\195?\160 jour

Modified: phpcompta/trunk/html/user_login.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/user_login.php	2012-06-14 17:58:57 UTC (rev 4896=
)
+++ phpcompta/trunk/html/user_login.php	2012-06-14 18:17:52 UTC (rev 4897=
)
@@ -25,6 +25,7 @@
 include_once ("ac_common.php");
 require_once('class_database.php');
 require_once('class_itext.php');
+html_page_start($_SESSION['g_theme']);
 $rep=3Dnew Database();
 include_once ("class_user.php");
 $User=3Dnew User($rep);
@@ -76,10 +77,21 @@
     echo '<a hreF=3D"'.$base.'">'.$a.'</a></h2>';
=20
 }
+if ( $User->Admin()  =3D=3D 1)
+{
+	if (SITE_UPDATE !=3D"") {
+	 $update=3D@file_get_contents(SITE_UPDATE);
+	 if ($update > $version_phpcompta ) {
+		 echo '<div class=3D"inner_box" style=3D"margin-left:0px;margin-top:3p=
x;left:3px">';
+		 echo '<p class=3D"notice">';
+		 echo "Mise =C3=A0 jour disponible de PhpCompta version actuelle : $up=
date votre version $version_phpcompta";
+		 echo '</p>';
+		 echo '</div>';
+	 }
+	}
+}
=20
-html_page_start($_SESSION['g_theme']);
 include_once("user_menu.php");
-
 $priv=3D($User->admin=3D=3D1)?"Administrateur":"Utilisateur";
 echo '<div class=3D"welcome"> ';
 /**
@@ -88,6 +100,7 @@
  * so it will be directly redirected to this folder or to the plugins of=
 this
  * folder if he's an "plugin user"
  */
+
 if ( $User->admin =3D=3D 0 )
 {
     // how many folder ?

Modified: phpcompta/trunk/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/constant.php	2012-06-14 17:58:57 UTC (rev 489=
6)
+++ phpcompta/trunk/include/constant.php	2012-06-14 18:17:52 UTC (rev 489=
7)
@@ -38,6 +38,11 @@
 //$version_phpcompta=3DSVNINFO;
 //define ("DEBUG",false);
=20
+// If you don't want to be notified of the update
+// define ("SITE_UPDATE",'');
+define ("SITE_UPDATE",'http://www.phpcompta.eu/last_version.txt');
+
+
 $version_phpcompta=3D4800;
 define ("DEBUG",true);
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 16:09:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfGLo-0007E7-Cj
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 16:09:04 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 22:00:20 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195819.1339704543.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4898 - in phpcompta/trunk: html include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 20:09:03 -0000

Author: danydb
Date: 2012-06-14 22:00:19 +0200 (Thu, 14 Jun 2012)
New Revision: 4898

Modified:
   phpcompta/trunk/html/style-light.css
   phpcompta/trunk/include/class_acc_ledger.php
   phpcompta/trunk/include/class_calendar.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/dashboard.inc.php
   phpcompta/trunk/include/template/dashboard.php
Log:
0000623: Dans l'?\195?\169cran d'accueil : modifier calendrier

Modified: phpcompta/trunk/html/style-light.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-light.css	2012-06-14 18:17:52 UTC (rev 489=
7)
+++ phpcompta/trunk/html/style-light.css	2012-06-14 20:00:19 UTC (rev 489=
8)
@@ -748,7 +748,6 @@
 }
 ul.select_table li span {
 	display:table-cell;
-	width:25em;
 	margin: 0px;
 	padding:  0px;
 }

Modified: phpcompta/trunk/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger.php	2012-06-14 18:17:52 UTC =
(rev 4897)
+++ phpcompta/trunk/include/class_acc_ledger.php	2012-06-14 20:00:19 UTC =
(rev 4898)
@@ -2697,9 +2697,12 @@
         global $g_user;
         $filter_ledger=3D$g_user->get_ledger_sql('ALL',3);
         $filter_ledger=3Dstr_replace('jrn_def_id','jr_def_id',$filter_le=
dger);
-        $sql=3D"select jr_id,jr_pj_number,jr_date,to_char(jr_date,'DD.MM=
.YYYY') as jr_date_fmt,jr_montant, jr_comment,jr_internal from jrn ".
-             " where $filter_ledger ".
-             " order by jr_date desc limit $p_limit";
+        $sql=3D"
+			select jr_id,jr_pj_number,jr_date,to_char(jr_date,'DD.MM.YYYY') as jr=
_date_fmt,jr_montant, jr_comment,jr_internal,jrn_def_code
+			from jrn
+			join jrn_def on (jrn_def_id=3Djr_def_id)
+			 where $filter_ledger
+			order by jr_date desc limit $p_limit";
         $array=3D$this->db->get_array($sql);
         return $array;
     }

Modified: phpcompta/trunk/include/class_calendar.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_calendar.php	2012-06-14 18:17:52 UTC (r=
ev 4897)
+++ phpcompta/trunk/include/class_calendar.php	2012-06-14 20:00:19 UTC (r=
ev 4898)
@@ -44,22 +44,23 @@
      */
     function fill_from_action(&$p_array)
     {
+		global $g_user;
+		$profile=3D$g_user->get_profile();
+
         $cn=3Dnew Database(dossier::id());
-        $sql=3D"select ag_id,substr(ag_title,0,20) as ag_title_fmt,ag_re=
f,
-				to_char(ag_timestamp,'DD')::integer as ag_timestamp_day ".
+        $sql=3D"select count(*) as nb,to_char(ag_remind_date,'DD')::inte=
ger as ag_timestamp_day ".
              " from action_gestion ".
              " where ".
-             " to_char(ag_timestamp,'MM')::integer=3D$1 ".
-             " and to_char(ag_timestamp,'YYYY')::integer=3D$2 ".
-             " and ag_cal=3D'C' and ag_owner=3D$3";
-        $array=3D$cn->get_array($sql,array($this->month,$this->year,$_SE=
SSION['g_user']));
+             " to_char(ag_remind_date,'MM')::integer=3D$1 ".
+             " and to_char(ag_remind_date,'YYYY')::integer=3D$2 ".
+             "  and ag_dest in (select p_granted from user_sec_action_pr=
ofile where p_id =3D$3)
+				 group by to_char(ag_remind_date,'DD')::integer";
+
+		$array=3D$cn->get_array($sql,array($this->month,$this->year,$profile))=
;
         for ($i=3D0;$i<count($array);$i++)
         {
             $ind=3D$array[$i]['ag_timestamp_day'];
-            $p_array[$ind]=3D(isset($p_array[$ind]))?$p_array[$ind]:'';
-            $p_array[$ind].=3D'<A class=3D"line" HREF=3D"do.php?ac=3DFOL=
LOW&'.dossier::get().'&sa=3Ddetail&ag_id=3D'.$array[$i]['ag_id'].'">';
-            $p_array[$ind].=3D"<span class=3D\"calfollow\">".h($array[$i=
]['ag_ref']." ".$array[$i]['ag_title_fmt']).'</span>';
-            $p_array[$ind].=3D"</A>";
+            $p_array[$ind].=3D"<span class=3D\"notice\">".$array[$i]['nb=
'].'</span>';
=20
         }
     }
@@ -107,7 +108,6 @@
         $wMonth->javascript=3D"onchange=3Dchange_month(this)";
         $wMonth->set_attribute('gDossier',dossier::id());
         $month_year=3D$wMonth->input().$wMonth->get_js_attr();
-
         ob_start();
         require_once('template/calendar.php');
         $ret=3Dob_get_contents();

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-14 18:17:52 UTC (=
rev 4897)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-14 20:00:19 UTC (=
rev 4898)
@@ -1061,6 +1061,15 @@
 		return $array;
 	}
=20
+	function get_today()
+	{
+		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
+				" from action_gestion join document_type " .
+				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state in (2,3)
+				and to_char(ag_remind_date,'DDMMYYYY')=3Dto_char(now(),'DDMMYYYY') "=
;
+		$array =3D $this->db->get_array($sql);
+		return $array;
+	}
 	/**
 	 * insert a related operation
 	 */
@@ -1264,9 +1273,8 @@
 		{
 			$query.=3D" and ag_timestamp <=3D to_date('$date_end','DD.MM.YYYY')";
 		}
-		if (isset($ag_dest_query))
+		if (isset($ag_dest_query)&& ! isset($all_action) && $ag_dest_query !=3D=
 -1)
 		{
-			if ($ag_dest_query !=3D 0)
 				$query.=3D " and ag_dest =3D " . sql_string($ag_dest_query);
 		}
 		if (isNumber($ag_id) =3D=3D 1 && $ag_id !=3D 0)

Modified: phpcompta/trunk/include/dashboard.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/dashboard.inc.php	2012-06-14 18:17:52 UTC (re=
v 4897)
+++ phpcompta/trunk/include/dashboard.inc.php	2012-06-14 20:00:19 UTC (re=
v 4898)
@@ -12,11 +12,19 @@
 require_once("class_itextarea.php");
 require_once('class_calendar.php');
 require_once('class_acc_ledger.php');
+require_once 'class_follow_up.php';
+
 echo '<div class=3D"content">';
 global $g_user;
 /* others report */
 $cal=3Dnew Calendar();
 $cal->get_preference();
+$Operation=3Dnew Follow_Up($cn);
+$last_operation=3D$Operation->get_today();
+$Ledger=3Dnew Acc_Ledger($cn,0);
+$last_ledger=3Darray();
+$last_ledger=3D$Ledger->get_last(10);
+
 ob_start();
 require_once('template/dashboard.php');
 $ret=3Dob_get_contents();

Modified: phpcompta/trunk/include/template/dashboard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/dashboard.php	2012-06-14 18:17:52 UT=
C (rev 4897)
+++ phpcompta/trunk/include/template/dashboard.php	2012-06-14 20:00:19 UT=
C (rev 4898)
@@ -57,9 +57,65 @@
 ?>
 </fieldset>
 </div>
-<div style=3D"clear:both">
-	<div style=3D"float:left;width:50%">
+<div style=3D"float:right;width:45%">
+<fieldset>
+<legend><?=3D_('Action pour aujourd\'hui')?>
+</legend>
+<ol>
 <?php
+for($i=3D0;$i<count($last_operation);$i++):
+?>
+<li>
+<span>
+<?=3Dsmaller_date($last_operation[$i]['ag_timestamp_fmt'])?>
+</span>
+	<span  style=3D"font-weight: bolder ">
+		<?=3Dh($last_operation[$i]['vw_name'])?>
+	</span>
+<span>
+   <?=3Dh(mb_substr($last_operation[$i]['ag_title'],0,40,'UTF-8'))?>
+</span>
+<span style=3D"font-style: italic">
+<?=3D$last_operation[$i]['dt_value']?>
+</span>
+</li>
+<? endfor;?>
+</ol>
+</fieldset>
+</div>
+
+<div style=3D"float:right;width:45%">
+<fieldset>
+<legend><?=3D_('Derni=C3=A8res op=C3=A9rations')?>
+</legend>
+<table style=3D"width: 100%">
+<?php
+for($i=3D0;$i<count($last_ledger);$i++):
+?>
+<tr>
+	<td><?=3D  smaller_date($last_ledger[$i]['jr_date_fmt'])?>
+	</td>
+	<td>
+		<?=3D$last_ledger[$i]['jrn_def_code']?>
+	</td>
+<td>
+   <?=3Dh(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
+</td>
+<td>
+<?=3D$last_ledger[$i]['jr_internal']?>
+</td>
+<td class=3D"num">
+<?=3Dnbm($last_ledger[$i]['jr_montant'])?>
+</td>
+
+</tr>
+<? endfor;?>
+</ul></table>
+</fieldset>
+</div>
+
+	<div style=3D"float:left;width:50%;clear:left">
+<?php
 /*
  * Mini Report
  */
@@ -129,4 +185,4 @@
 echo HtmlInput::button('hide',_('Annuler'),'onClick=3D"$(\'add_todo_list=
\').hide();return true;"');
 ?>
 </form>
-</div>
\ No newline at end of file
+</div>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 16:25:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfGbY-0001MQ-BE
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 16:25:20 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 22:16:38 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195830.1339705519.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4899 - in phpcompta/trunk: html include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 20:25:19 -0000

Author: danydb
Date: 2012-06-14 22:16:38 +0200 (Thu, 14 Jun 2012)
New Revision: 4899

Modified:
   phpcompta/trunk/html/user_pref.php
   phpcompta/trunk/include/template/dashboard.php
Log:
Cosmetic dashboard + PREFERENCE

Modified: phpcompta/trunk/html/user_pref.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/user_pref.php	2012-06-14 20:00:19 UTC (rev 4898)
+++ phpcompta/trunk/html/user_pref.php	2012-06-14 20:16:38 UTC (rev 4899)
@@ -44,6 +44,7 @@
 }
=20
 global $g_user;
+$g_user=3Dnew User($cn);
=20
 // Met a jour le theme utilisateur (style)
 if ( isset ( $_POST['style_user']) )

Modified: phpcompta/trunk/include/template/dashboard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/dashboard.php	2012-06-14 20:00:19 UT=
C (rev 4898)
+++ phpcompta/trunk/include/template/dashboard.php	2012-06-14 20:16:38 UT=
C (rev 4899)
@@ -91,8 +91,9 @@
 <table style=3D"width: 100%">
 <?php
 for($i=3D0;$i<count($last_ledger);$i++):
+	$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
 ?>
-<tr>
+<tr <?=3D$class?> >
 	<td><?=3D  smaller_date($last_ledger[$i]['jr_date_fmt'])?>
 	</td>
 	<td>
@@ -102,7 +103,7 @@
    <?=3Dh(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
 </td>
 <td>
-<?=3D$last_ledger[$i]['jr_internal']?>
+<?=3DHtmlInput::detail_op($last_ledger[$i]['jr_id'], $last_ledger[$i]['j=
r_internal'])?>
 </td>
 <td class=3D"num">
 <?=3Dnbm($last_ledger[$i]['jr_montant'])?>
@@ -142,8 +143,8 @@
     echo '<table border=3D"0" width=3D"100%">';
     foreach ($result as $row) {
       $ix++;
-      $bgcolor=3D($ix%2=3D=3D0)?' style=3D"background-color:lightgrey"':=
'';
-      echo '<tr'.$bgcolor.'">';
+	  $class=3D($ix%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
+      echo '<tr'.$class.'">';
=20
       echo '<td> '.$row['desc'].'</td>'.
 	'<td style=3D"text-align:right">'.nbm($row['montant'])." &euro;</td>";
@@ -155,7 +156,7 @@
   echo '</div>';
  } else {
   echo '<fieldset style=3D"width:50%;background-color:white"><legend>'._=
('Aucun rapport d=C3=A9fini').'</legend>';
-  echo '<a href=3D"user_pref.php?'.dossier::get().'">'._('Cliquez ici po=
ur mettre =C3=A0 jour vos pr=C3=A9f=C3=A9rences').'</a>';
+  echo '<a href=3D"do.php?'.dossier::get().'&ac=3DPREFERENCE">'._('Cliqu=
ez ici pour mettre =C3=A0 jour vos pr=C3=A9f=C3=A9rences').'</a>';
   echo '</fieldset>';
  }
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 16:25:37 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfGbp-0001Mx-F6
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 16:25:37 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 22:16:54 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195831.1339705536.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4900 - in phpcompta/trunk: html include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 20:25:36 -0000

Author: danydb
Date: 2012-06-14 22:16:54 +0200 (Thu, 14 Jun 2012)
New Revision: 4900

Modified:
   phpcompta/trunk/html/ajax_ledger.php
   phpcompta/trunk/include/template/ledger_detail_forbidden.php
Log:
Cosmetic warning message when no data found

Modified: phpcompta/trunk/html/ajax_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_ledger.php	2012-06-14 20:16:38 UTC (rev 489=
9)
+++ phpcompta/trunk/html/ajax_ledger.php	2012-06-14 20:16:54 UTC (rev 490=
0)
@@ -95,6 +95,7 @@
 {
=20
     ob_start();
+	echo HtmlInput::title_box(_("Information"), $div);
     require_once ('template/ledger_detail_forbidden.php');
     $html=3Dob_get_contents();
     ob_clean();
@@ -115,6 +116,7 @@
 if ( $access =3D=3D 'X' )
 {
     ob_start();
+	echo HtmlInput::title_box(_("Information"), $div);
     require_once ('template/ledger_detail_forbidden.php');
     $html=3Dob_get_contents();
     ob_clean();

Modified: phpcompta/trunk/include/template/ledger_detail_forbidden.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/ledger_detail_forbidden.php	2012-06-=
14 20:16:38 UTC (rev 4899)
+++ phpcompta/trunk/include/template/ledger_detail_forbidden.php	2012-06-=
14 20:16:54 UTC (rev 4900)
@@ -1,6 +1,3 @@
-<?
-echo HtmlInput::anchor_close($div);
-?>
 <div style=3D"margin:0;padding:0;background-color:red;text-align:center;=
">
 <h2 class=3D"error">Acc=C3=A8s interdit : vous n'avez pas acc=C3=A8s =C3=
=A0 cette information, contactez votre responsable</h2>;
 </div>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 17:33:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfHfk-00050g-9d
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 17:33:44 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 23:24:57 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195945.1339709623.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4901 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 21:33:43 -0000

Author: danydb
Date: 2012-06-14 23:24:56 +0200 (Thu, 14 Jun 2012)
New Revision: 4901

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/ajax_get_profile.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/dashboard.inc.php
Log:
Security : action public are public (readonly) or write if right has been=
 given,
increase last operation to 20
Cosmetic for profile

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-14 20:16:54 UTC=
 (rev 4900)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-14 21:24:56 UTC=
 (rev 4901)
@@ -156,7 +156,7 @@
 		echo $retour;
 		echo '</form>';
 	}
-	else if ($g_user->can_read_action($ag_id) =3D=3D true)
+	else if ($g_user->can_read_action($ag_id) =3D=3D true || $act->ag_dest =
=3D=3D -1)
 	{
 		echo $act->Display('READ', false, $base, $retour);
 	}

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-14 20:16:54 UTC =
(rev 4900)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-14 21:24:56 UTC =
(rev 4901)
@@ -80,9 +80,9 @@
 	echo "<h2>Impression</h2>";
 	$profile_menu->printing($p_id);
 	echo $add_one;
-	echo "<h2>Action gestion accessible</h2>";
+	echo "<h1>Action gestion accessible</h1>";
 	$profile_menu->available_profile($p_id);
-	echo "<h2>D=C3=A9p=C3=B4t de stock accessible</h2>";
+	echo "<h1>D=C3=A9p=C3=B4t de stock accessible</h1>";
 	$profile_menu->available_repository($p_id);
=20
 }

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-14 20:16:54 UTC (=
rev 4900)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-14 21:24:56 UTC (=
rev 4901)
@@ -1259,11 +1259,9 @@
 			$query .=3D ' and ag_state in (2,3) ';
 		if (isset($_GET['only_internal']))
 			$query .=3D ' and f_id_dest=3D0 ';
-		if (!isset($all_action))
+		if ( isset($all_action))
 		{
 			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ".self:=
:sql_security_filter($cn, "R")." )";
-		} else {
-			$query .=3D "and ".self::sql_security_filter($cn,'R');
 		}
 		if (isset($date_start) && isDate($date_start) !=3D null)
 		{
@@ -1273,7 +1271,7 @@
 		{
 			$query.=3D" and ag_timestamp <=3D to_date('$date_end','DD.MM.YYYY')";
 		}
-		if (isset($ag_dest_query)&& ! isset($all_action) && $ag_dest_query !=3D=
 -1)
+		if (isset($ag_dest_query)&& ! isset($all_action) )
 		{
 				$query.=3D " and ag_dest =3D " . sql_string($ag_dest_query);
 		}
@@ -1281,6 +1279,7 @@
 		{
 			$query =3D " and ag_id=3D " . $ag_id;
 		}
+		var_dump( $query.$str);
 		return $query . $str;
 	}
=20

Modified: phpcompta/trunk/include/dashboard.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/dashboard.inc.php	2012-06-14 20:16:54 UTC (re=
v 4900)
+++ phpcompta/trunk/include/dashboard.inc.php	2012-06-14 21:24:56 UTC (re=
v 4901)
@@ -23,7 +23,7 @@
 $last_operation=3D$Operation->get_today();
 $Ledger=3Dnew Acc_Ledger($cn,0);
 $last_ledger=3Darray();
-$last_ledger=3D$Ledger->get_last(10);
+$last_ledger=3D$Ledger->get_last(20);
=20
 ob_start();
 require_once('template/dashboard.php');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 17:42:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfHoP-0006io-P3
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 17:42:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 23:34:00 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195952.1339710161.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4902 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 21:42:41 -0000

Author: danydb
Date: 2012-06-14 23:34:00 +0200 (Thu, 14 Jun 2012)
New Revision: 4902

Modified:
   phpcompta/trunk/include/class_follow_up.php
Log:
remove debug

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-14 21:24:56 UTC (=
rev 4901)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-14 21:34:00 UTC (=
rev 4902)
@@ -1279,7 +1279,6 @@
 		{
 			$query =3D " and ag_id=3D " . $ag_id;
 		}
-		var_dump( $query.$str);
 		return $query . $str;
 	}
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 17:54:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfHzf-0007m8-Gx
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 17:54:19 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 14 Jun 2012 23:45:36 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.195965.1339710858.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4903 - in phpcompta/trunk: include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2012 21:54:18 -0000

Author: danydb
Date: 2012-06-14 23:45:35 +0200 (Thu, 14 Jun 2012)
New Revision: 4903

Modified:
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/detail-action.php
   phpcompta/trunk/sql/upgrade.sql
Log:
prob with action public, remove ag_cal

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-14 21:34:00 UTC (=
rev 4902)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-14 21:45:35 UTC (=
rev 4903)
@@ -240,18 +240,7 @@
 		$title->value =3D $this->ag_title;
 		$title->size =3D 60;
=20
-		// ag_cal
-		$ag_cal =3D new ICheckBox('ag_cal');
-		$ag_cal->readOnly =3D $readonly;
-		$ag_cal->name =3D "ag_cal";
=20
-		if ($this->ag_cal =3D=3D 'C')
-			$ag_cal->selected =3D true;
-		else
-			$ag_cal->selected =3D false;
-
-		$str_ag_cal =3D $ag_cal->input();
-
 		// Priority of the ag_priority
 		$ag_priority =3D new ISelect();
 		$ag_priority->readOnly =3D $readonly;
@@ -535,7 +524,7 @@
 	{
 		$sql =3D "select ag_id,to_char (ag_timestamp,'DD.MM.YYYY') as ag_times=
tamp," .
 				" f_id_dest,ag_title,ag_ref,d_id,ag_type,ag_state, ag_owner, " .
-				"  ag_dest, ag_hour, ag_priority, ag_cal,ag_contact,to_char (ag_remi=
nd_date,'DD.MM.YYYY') as ag_remind_date " .
+				"  ag_dest, ag_hour, ag_priority, ag_contact,to_char (ag_remind_date=
,'DD.MM.YYYY') as ag_remind_date " .
 				" from action_gestion left join document using (ag_id) where ag_id=3D=
" . $this->ag_id;
 		$r =3D $this->db->exec_sql($sql);
 		$row =3D Database::fetch_all($r);
@@ -554,7 +543,6 @@
 		$this->ag_dest =3D $row[0]['ag_dest'];
 		$this->ag_hour =3D $row[0]['ag_hour'];
 		$this->ag_priority =3D $row[0]['ag_priority'];
-		$this->ag_cal =3D $row[0]['ag_cal'];
 		$this->ag_remind_date =3D $row[0]['ag_remind_date'];
 		$this->ag_owner=3D $row[0]['ag_owner'];
=20
@@ -613,25 +601,21 @@
 		$ag_ref=3D$this->db->get_value('select dt_prefix from document_type wh=
ere dt_id=3D$1',array($this->dt_id)).'-'.$this->db->get_next_seq($seq_nam=
e);
 		$this->ag_ref =3D $ag_ref;
=20
-		if ($this->ag_cal =3D=3D 'on')
-			$ag_cal =3D 'C';
-		else
-			$ag_cal =3D 'I';
 		// save into the database
 		if ($this->ag_remind_date !=3D null || $this->ag_remind_date !=3D '')
 		{
 			$sql =3D "insert into action_gestion" .
 					"(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, " =
.
-					" ag_hour, ag_priority,ag_cal,ag_owner,ag_contact,ag_state,ag_remin=
d_date) " .
-					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13,to_date($14,'DD.MM.YYYY'))";
+					" ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date)=
 " .
+					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,to_date($13,'DD.MM.YYYY'))";
 		}
 		else
 		{
 			$this->ag_remind_date =3D null;
 			$sql =3D "insert into action_gestion" .
 					"(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_ref, ag_dest, " =
.
-					" ag_hour, ag_priority,ag_cal,ag_owner,ag_contact,ag_state,ag_remin=
d_date) " .
-					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13,$14)";
+					" ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date)=
 " .
+					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13)";
 		}
 		if ($this->ag_dest =3D=3D 0)
 		{
@@ -646,11 +630,10 @@
 			$this->ag_dest, /* 7 */
 			$this->ag_hour, /* 8 */
 			$this->ag_priority, /* 9 */
-			$ag_cal, /* 10 */
-			$_SESSION['g_user'], /* 11 */
-			$contact->id, /* 12 */
-			$this->ag_state, /* 13 */
-			$this->ag_remind_date /* 14 */
+			$_SESSION['g_user'], /* 10 */
+			$contact->id, /* 11 */
+			$this->ag_state, /* 12 */
+			$this->ag_remind_date /* 13 */
 				)
 		);
=20
@@ -883,10 +866,6 @@
 			$contact->id =3D 0;
=20
=20
-		if ($this->ag_cal =3D=3D 'on')
-			$ag_cal =3D 'C';
-		else
-			$ag_cal =3D 'I';
 		if ($this->ag_dest =3D=3D 0)
 		{
 			$this->ag_dest =3D null;
@@ -902,10 +881,9 @@
 					" ag_hour =3D $7 ," .
 					" ag_priority =3D $8 ," .
 					" ag_dest =3D $9 , " .
-					" ag_cal =3D $10 ," .
-					" ag_contact =3D $11, " .
-					" ag_ref =3D $12, " .
-					" ag_remind_date=3Dto_date($13,'DD.MM.YYYY') " .
+					" ag_contact =3D $10, " .
+					" ag_ref =3D $11, " .
+					" ag_remind_date=3Dto_date($12,'DD.MM.YYYY') " .
 					" where ag_id =3D $6", array(
 				$this->ag_timestamp, /* 1 */
 				$this->ag_title, /* 2 */
@@ -916,10 +894,9 @@
 				$this->ag_hour, /* 7 */
 				$this->ag_priority, /* 8 */
 				$this->ag_dest, /* 9 */
-				$ag_cal, /* 10 */
-				$contact->id, /* 11 */
-				$this->ag_ref, /* 12 */
-				$this->ag_remind_date /* 13 */
+				$contact->id, /* 10*/
+				$this->ag_ref, /* 11 */
+				$this->ag_remind_date /* 12 */
 			));
 		}
 		else
@@ -933,9 +910,8 @@
 					" ag_hour =3D $7 ," .
 					" ag_priority =3D $8 ," .
 					" ag_dest =3D $9 , " .
-					" ag_cal =3D $10 ," .
-					" ag_contact =3D $11, " .
-					" ag_ref =3D $12, " .
+					" ag_contact =3D $10, " .
+					" ag_ref =3D $11, " .
 					" ag_remind_date=3Dnull " .
 					" where ag_id =3D $6", array(
 				$this->ag_timestamp, /* 1 */
@@ -947,9 +923,8 @@
 				$this->ag_hour, /* 7 */
 				$this->ag_priority, /* 8 */
 				$this->ag_dest, /* 9 */
-				$ag_cal, /* 10 */
-				$contact->id, /* 11 */
-				$this->ag_ref /* 12 */
+				$contact->id, /* 10 */
+				$this->ag_ref /* 11 */
 			));
 		}
 		// Upload  documents
@@ -1014,7 +989,6 @@
 		$this->ag_hour =3D (isset($p_array['ag_hour'])) ? $p_array['ag_hour'] =
: "";
 		$this->ag_dest =3D (isset($p_array['ag_dest'])) ? $p_array['ag_dest'] =
: "";
 		$this->ag_priority =3D (isset($p_array['ag_priority'])) ? $p_array['ag=
_priority'] : 2;
-		$this->ag_cal =3D (isset($p_array['ag_cal'])) ? 'on' : "";
 		$this->ag_contact =3D (isset($p_array['ag_contact'])) ? $p_array['ag_c=
ontact'] : "";
 		$this->ag_comment =3D (isset($p_array['ag_comment'])) ? $p_array['ag_c=
omment'] : "";
 		$this->ag_remind_date =3D (isset($p_array['ag_remind_date'])) ? $p_arr=
ay['ag_remind_date'] : null;
@@ -1261,7 +1235,7 @@
 			$query .=3D ' and f_id_dest=3D0 ';
 		if ( isset($all_action))
 		{
-			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ".self:=
:sql_security_filter($cn, "R")." )";
+			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ".self:=
:sql_security_filter($cn, "R")." or ag_dest=3D-1 )";
 		}
 		if (isset($date_start) && isDate($date_start) !=3D null)
 		{

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-14 21:34:0=
0 UTC (rev 4902)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-14 21:45:3=
5 UTC (rev 4903)
@@ -100,15 +100,6 @@
=20
           <tr>
             <TD>
-	    <?=3D_('Calendrier')?>
-            </TD>
-            <TD>
-              <?php echo $str_ag_cal;
-              ?>
-            </TD>
-          </tr>
-          <tr>
-            <TD>
 	    <?=3D_('Etat')?>
             </TD>
             <td>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-14 21:34:00 UTC (rev 4902)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-14 21:45:35 UTC (rev 4903)
@@ -269,4 +269,5 @@
 ALTER TABLE stock_goods ADD COLUMN r_id bigint;
 update stock_goods set r_id=3D1;
 ALTER TABLE stock_goods   ADD CONSTRAINT stock_goods_sg_type CHECK (sg_t=
ype =3D 'c'::bpchar OR sg_type =3D 'd'::bpchar);
-CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
\ No newline at end of file
+CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
+alter table action_gestion drop ag_cal;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 14 21:00:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfKtZ-0000HY-A3
	for mharc-phpcompta-dev@gnu.org; Thu, 14 Jun 2012 21:00:13 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 15 Jun 2012 02:51:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.196172.1339722012.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4904 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jun 2012 01:00:12 -0000

Author: danydb
Date: 2012-06-15 02:51:26 +0200 (Fri, 15 Jun 2012)
New Revision: 4904

Modified:
   phpcompta/trunk/include/ac_common.php
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_calendar.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_icard.php
   phpcompta/trunk/include/template/action_search.php
   phpcompta/trunk/include/template/detail-action.php
Log:
search by remind date=20

Modified: phpcompta/trunk/include/ac_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ac_common.php	2012-06-14 21:45:35 UTC (rev 49=
03)
+++ phpcompta/trunk/include/ac_common.php	2012-06-15 00:51:26 UTC (rev 49=
04)
@@ -203,7 +203,7 @@
 	return 0;
 }
=20
-/* !
+/***
  * \brief Verifie qu'une date est bien format=C3=A9
  *           en d.m.y et est valable
  * \param $p_date

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-14 21:45:35 UTC=
 (rev 4903)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-15 00:51:26 UTC=
 (rev 4904)
@@ -194,7 +194,7 @@
 	Follow_Up::ShowActionList($cn, $base);
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
-	echo HtmlInput::request_to_hidden(array("sag_ref", "only_internal", "st=
ate", "gDossier", "qcode", "start_date", "end_date", "ag_id", "ag_dest_qu=
ery",
+	echo HtmlInput::request_to_hidden(array("remind_date","sag_ref", "remin=
d_date","only_internal", "state", "gDossier", "qcode", "start_date", "end=
_date", "ag_id", "ag_dest_query",
 		"tdoc", "see_all", "all_action", "query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-06-14 21:45:35 UTC (rev 4=
903)
+++ phpcompta/trunk/include/action.inc.php	2012-06-15 00:51:26 UTC (rev 4=
904)
@@ -23,7 +23,7 @@
  */
 require_once('class_ipopup.php');
 global $g_user;
-$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("sag_ref","only_internal","state","ac","gDossier","qcode"=
,"ag_dest_query","query","tdoc","date_start","date_end","see_all","all_ac=
tion")).'&my_action');
+$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("remind_date","sag_ref","only_internal","state","ac","gDo=
ssier","qcode","ag_dest_query","query","tdoc","date_start","date_end","se=
e_all","all_action")).'&my_action');
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-14 21:45:35=
 UTC (rev 4903)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-15 00:51:26=
 UTC (rev 4904)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("sag_ref","only_internal","state","=
gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","see_a=
ll","all_action","sb","sc"),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("remind_date","sag_ref","only_inter=
nal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","da=
te_end","see_all","all_action","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_calendar.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_calendar.php	2012-06-14 21:45:35 UTC (r=
ev 4903)
+++ phpcompta/trunk/include/class_calendar.php	2012-06-15 00:51:26 UTC (r=
ev 4904)
@@ -54,13 +54,14 @@
              " to_char(ag_remind_date,'MM')::integer=3D$1 ".
              " and to_char(ag_remind_date,'YYYY')::integer=3D$2 ".
              "  and ag_dest in (select p_granted from user_sec_action_pr=
ofile where p_id =3D$3)
+				 and ag_state IN (2, 3)
 				 group by to_char(ag_remind_date,'DD')::integer";
=20
 		$array=3D$cn->get_array($sql,array($this->month,$this->year,$profile))=
;
         for ($i=3D0;$i<count($array);$i++)
         {
             $ind=3D$array[$i]['ag_timestamp_day'];
-            $p_array[$ind].=3D"<span class=3D\"notice\">".$array[$i]['nb=
'].'</span>';
+            $p_array[$ind].=3D"<span class=3D\"notice\">".$array[$i]['nb=
']." "._("T=C3=A2ches suivis").'</span>';
=20
         }
     }
@@ -70,17 +71,17 @@
     function fill_from_todo(&$p_array)
     {
         $cn=3Dnew Database(dossier::id());
-        $sql=3D"select tl_id,substr(tl_title,0,20) as tl_title_fmt,to_ch=
ar(tl_date,'DD')::integer as tl_date_day ".
+        $sql=3D"select count(*) as nb,to_char(tl_date,'DD')::integer as =
tl_date_day ".
              " from todo_list ".
              " where ".
              " to_char(tl_date,'MM')::integer=3D$1 ".
              " and to_char(tl_date,'YYYY')::integer=3D$2 ".
-             " and use_login=3D$3";
+             " and use_login=3D$3 group by to_char(tl_date,'DD')::intege=
r ";
         $array=3D$cn->get_array($sql,array($this->month,$this->year,$_SE=
SSION['g_user']));
         for ($i=3D0;$i<count($array);$i++)
         {
             $ind=3D$array[$i]['tl_date_day'];
-            $p_array[$ind].=3D"<span class=3D\"todo\">".h($array[$i]['tl=
_title_fmt']).'</span>';
+            $p_array[$ind].=3D"<span style=3D\"display:block\" class=3D\=
"todo\">".h($array[$i]['nb'])." "._('Notes').'</span>';
         }
     }
     /*!\brief display a calendar after a call to Calendar::fill

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-14 21:45:35 UTC (=
rev 4903)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-15 00:51:26 UTC (=
rev 4904)
@@ -498,7 +498,7 @@
 		/* add the number of item */
 		$Hid =3D new IHidden();
 		$r.=3D$Hid->input("nb_item", MAX_ARTICLE);
-		$r.=3DHtmlInput::request_to_hidden(array("sag_ref","only_internal","st=
ate","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end",=
 "see_all", "all_action"));
+		$r.=3DHtmlInput::request_to_hidden(array("remind_date","sag_ref","only=
_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start=
", "date_end", "see_all", "all_action"));
 		/* get template */
 		ob_start();
 		require_once 'template/detail-action.php';
@@ -671,7 +671,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("sag_ref","only_internal","sta=
te","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", =
"see_all", "all_action")) . '&' . $p_base;
+		$url =3D HtmlInput::get_to_string(array("remind_date","sag_ref","only_=
internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start"=
, "date_end", "see_all", "all_action")) . '&' . $p_base;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -743,7 +743,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("sag_ref","only_internal","state","gDossier", "qc=
ode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_al=
l", "ac", "all_action"),"") . '&sa=3Ddetail&ag_id=3D' . $row['ag_id'] . '=
">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("remind_date","sag_ref","only_internal","state","=
gDossier", "qcode", "ag_dest_query", "query", "tdoc", "date_start", "date=
_end", "see_all", "ac", "all_action"),"&") . '&sa=3Ddetail&ag_id=3D' . $r=
ow['ag_id'] . '">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1154,6 +1154,8 @@
 		$str_ag_dest =3D $ag_dest->input();
 		$osag_ref=3Dnew IText("sag_ref");
 		$osag_ref->value=3D(isset($_GET['sag_ref']))?$_GET['sag_ref']:"";
+		$remind_date=3Dnew IDate('remind_date');
+		$remind_date->value=3D(isset($_GET['remind_date']))?$_GET['remind_date=
']:"";
 		// show the  action in
 		require_once 'template/action_search.php';
 	}
@@ -1251,8 +1253,12 @@
 		}
 		if (isNumber($ag_id) =3D=3D 1 && $ag_id !=3D 0)
 		{
-			$query =3D " and ag_id=3D " . $ag_id;
+			$query =3D " and ag_id=3D " . sql_string($ag_id);
 		}
+		if ( isset($remind_date) && $remind_date !=3D "" && isDate($remind_dat=
e)=3D=3D$remind_date)
+		{
+			$query =3D " and to_char(ag_remind_date,'DD.MM.YYYY')=3D '".sql_strin=
g($remind_date)."'";
+		}
 		return $query . $str;
 	}
=20

Modified: phpcompta/trunk/include/class_icard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_icard.php	2012-06-14 21:45:35 UTC (rev =
4903)
+++ phpcompta/trunk/include/class_icard.php	2012-06-15 00:51:26 UTC (rev =
4904)
@@ -239,8 +239,9 @@
     /*!\brief print in html the readonly value of the widget*/
     public function display()
     {
-        $r=3Dsprintf('         <INPUT TYPE=3D"hidden" NAME=3D"%s" VALUE=3D=
"%s" SIZE=3D"8">',
+        $r=3Dsprintf('         <INPUT TYPE=3D"hidden" NAME=3D"%s" id=3D"=
%s" VALUE=3D"%s" SIZE=3D"8">',
                    $this->name,
+                   $this->name,
                    $this->value
                   );
         $r.=3D'<span>'.$this->value.'</span>';

Modified: phpcompta/trunk/include/template/action_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search.php	2012-06-14 21:45:3=
5 UTC (rev 4903)
+++ phpcompta/trunk/include/template/action_search.php	2012-06-15 00:51:2=
6 UTC (rev 4904)
@@ -46,7 +46,13 @@
 		<?=3DHtmlInput::hidden('ctlc',$_GET['ctlc'])?>
 <? endif; ?>
 		<?=3D dossier::hidden()?>
-		<table style=3D"width:100%"><tr>
+		<table style=3D"width:100%">
+			<tr>
+				<td style=3D"width:180px;text-align:right"> Date de rappel</td>
+				<td>
+					<?=3D$remind_date->input();?>
+				</td>
+			<tr>
 			<td style=3D"width:180px;text-align:right"> R=C3=A9f=C3=A9rence</td>
 				<td>
 					<?=3D$osag_ref->input();?>

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-14 21:45:3=
5 UTC (rev 4903)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-15 00:51:2=
6 UTC (rev 4904)
@@ -285,7 +285,7 @@
 <?php endfor; ?>
 </table>
 <script language=3D"JavaScript">
-if ( $('e_march0').value =3D=3D'') { toggleShowDetail();}
+if ( $('e_march0') && $('e_march0').value =3D=3D'') { toggleShowDetail()=
;}
 function toggleShowDetail() {
 	try {var detail=3Dg('fldDetail');
 	var but=3Dg('toggleButton');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 15 04:55:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfSJw-0005aP-42
	for mharc-phpcompta-dev@gnu.org; Fri, 15 Jun 2012 04:55:56 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 15 Jun 2012 10:47:04 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.196834.1339750555.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4905 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jun 2012 08:55:54 -0000

Author: danydb
Date: 2012-06-15 10:47:03 +0200 (Fri, 15 Jun 2012)
New Revision: 4905

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
correct SQL

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-15 00:51:26 UTC (rev 4904)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-15 08:47:03 UTC (rev 4905)
@@ -262,12 +262,11 @@
 COMMENT ON COLUMN user_sec_repository.p_id IS 'fk to profile';
 COMMENT ON COLUMN user_sec_repository.r_id IS 'fk to stock_repository';
 COMMENT ON COLUMN user_sec_repository.ur_right IS 'Type of right : R for=
 readonly W for write';
-alter table stock_good add r_id bigint;
+alter table stock_goods add r_id bigint;
=20
 alter table user_sec_repository add constraint user_sec_repository_r_id_=
p_id_u unique (r_id,p_id);
 alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
 ALTER TABLE stock_goods ADD COLUMN r_id bigint;
 update stock_goods set r_id=3D1;
-ALTER TABLE stock_goods   ADD CONSTRAINT stock_goods_sg_type CHECK (sg_t=
ype =3D 'c'::bpchar OR sg_type =3D 'd'::bpchar);
 CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
 alter table action_gestion drop ag_cal;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 15 14:46:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfbX5-0002WO-0i
	for mharc-phpcompta-dev@gnu.org; Fri, 15 Jun 2012 14:46:07 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 15 Jun 2012 20:37:19 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.198194.1339785965.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4906 - in phpcompta/trunk: html include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jun 2012 18:46:05 -0000

Author: danydb
Date: 2012-06-15 20:37:18 +0200 (Fri, 15 Jun 2012)
New Revision: 4906

Modified:
   phpcompta/trunk/html/ajax.php
   phpcompta/trunk/html/ajax_history.php
   phpcompta/trunk/html/ajax_ledger.php
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/export.php
   phpcompta/trunk/html/extension.raw.php
   phpcompta/trunk/include/cfgledger.inc.php
Log:
start to use $cn as global database connx

Modified: phpcompta/trunk/html/ajax.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax.php	2012-06-15 08:47:03 UTC (rev 4905)
+++ phpcompta/trunk/html/ajax.php	2012-06-15 18:37:18 UTC (rev 4906)
@@ -15,7 +15,7 @@
 mb_internal_encoding("UTF-8");
=20
 $cn=3Dnew Database(dossier::id());
-global $g_user;
+global $g_user,$cn,$g_parameter;
 $g_user=3Dnew User($cn);
 $g_user->check(true);
=20

Modified: phpcompta/trunk/html/ajax_history.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_history.php	2012-06-15 08:47:03 UTC (rev 49=
05)
+++ phpcompta/trunk/html/ajax_history.php	2012-06-15 18:37:18 UTC (rev 49=
06)
@@ -38,7 +38,7 @@
  *if $_SESSION['g_user'] is not set : echo a warning
  */
 ajax_disconnected($div);
-global $g_user;
+global $g_user,$cn;
 $cn=3Dnew Database(dossier::id());
 $g_user=3Dnew User($cn);
 /* security */

Modified: phpcompta/trunk/html/ajax_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_ledger.php	2012-06-15 08:47:03 UTC (rev 490=
5)
+++ phpcompta/trunk/html/ajax_ledger.php	2012-06-15 18:37:18 UTC (rev 490=
6)
@@ -47,7 +47,7 @@
   {
     exit();
   }
- global $g_parameter;
+ global $g_user,$cn,$g_parameter;
 mb_internal_encoding("UTF-8");
=20
=20

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-15 08:47:03 UTC (rev 4905)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-15 18:37:18 UTC (rev 4906)
@@ -57,7 +57,7 @@
 	exit();
 extract($_REQUEST);
 set_language();
-global $g_user,$cn;
+global $g_user,$cn,$g_parameter;
 $cn =3D new Database($gDossier);
 $g_user =3D new User($cn);
 $g_user->check(true);

Modified: phpcompta/trunk/html/export.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/export.php	2012-06-15 08:47:03 UTC (rev 4905)
+++ phpcompta/trunk/html/export.php	2012-06-15 18:37:18 UTC (rev 4906)
@@ -26,7 +26,7 @@
  *
  */
=20
-global $g_user;
+global $g_user,$cn,$g_parameter;
 require_once('class_database.php');
 require_once('class_user.php');
 $gDossier=3Ddossier::id();

Modified: phpcompta/trunk/html/extension.raw.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/extension.raw.php	2012-06-15 08:47:03 UTC (rev 4=
905)
+++ phpcompta/trunk/html/extension.raw.php	2012-06-15 18:37:18 UTC (rev 4=
906)
@@ -35,8 +35,9 @@
 require_once ('constant.security.php');
 require_once ('class_user.php');
=20
+global $g_user,$cn,$g_parameter;
+
 $cn=3Dnew Database(dossier::id());
-global $g_user;
 $g_user=3Dnew User($cn);
 $g_user->check();
 $only_plugin=3D$g_user->check_dossier(dossier::id());

Modified: phpcompta/trunk/include/cfgledger.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/cfgledger.inc.php	2012-06-15 08:47:03 UTC (re=
v 4905)
+++ phpcompta/trunk/include/cfgledger.inc.php	2012-06-15 18:37:18 UTC (re=
v 4906)
@@ -35,7 +35,7 @@
 require_once 'class_acc_ledger.php';
=20
 $gDossier=3Ddossier::id();
-$cn=3Dnew Database($gDossier);
+global $cn;
=20
 $ledger=3Dnew Acc_Ledger($cn,-1);
 $sa=3DHtmlInput::default_value("sa","",$_REQUEST);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 15 14:53:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfbeU-0003sK-CA
	for mharc-phpcompta-dev@gnu.org; Fri, 15 Jun 2012 14:53:46 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 15 Jun 2012 20:45:01 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.198201.1339786426.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r376 - trunk/skel
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Jun 2012 18:53:45 -0000

Author: danydb
Date: 2012-06-15 20:45:01 +0200 (Fri, 15 Jun 2012)
New Revision: 376

Modified:
   trunk/skel/ajax.php
Log:
small typo=20

Modified: trunk/skel/ajax.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/skel/ajax.php	2012-05-29 13:30:05 UTC (rev 375)
+++ trunk/skel/ajax.php	2012-06-15 18:45:01 UTC (rev 376)
@@ -29,5 +29,5 @@
 echo "<ctl>$ctl</ctl>";
 echo "<html>$html</html>";
 echo "<extra>$extra</extra>";
-eco "</data>";
+echo "</data>";
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 15 20:09:00 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfgZY-0001sc-Uu
	for mharc-phpcompta-dev@gnu.org; Fri, 15 Jun 2012 20:09:00 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 02:00:03 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.198602.1339805340.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4907 - in phpcompta/trunk: html include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 00:08:59 -0000

Author: danydb
Date: 2012-06-16 02:00:01 +0200 (Sat, 16 Jun 2012)
New Revision: 4907

Added:
   phpcompta/trunk/include/stock_histo.inc.php
   phpcompta/trunk/include/template/stock_histo.php
   phpcompta/trunk/include/template/stock_histo_search.php
Modified:
   phpcompta/trunk/html/user_login.php
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/class_periode.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000618: Affichage des stocks

Modified: phpcompta/trunk/html/user_login.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/user_login.php	2012-06-15 18:37:18 UTC (rev 4906=
)
+++ phpcompta/trunk/html/user_login.php	2012-06-16 00:00:01 UTC (rev 4907=
)
@@ -25,7 +25,7 @@
 include_once ("ac_common.php");
 require_once('class_database.php');
 require_once('class_itext.php');
-html_page_start($_SESSION['g_theme']);
+@html_page_start($_SESSION['g_theme']);
 $rep=3Dnew Database();
 include_once ("class_user.php");
 $User=3Dnew User($rep);

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-06-15 18:37:18 UTC =
(rev 4906)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-16 00:00:01 UTC =
(rev 4907)
@@ -646,5 +646,15 @@
                 " order by 2" );
 		      return $sel;
 			}
+			  if ($p_mode =3D=3D 'R')
+			{
+			  $sel->value=3D$p_cn->make_array("
+                select r_id,r_name
+				  from stock_repository join user_sec_repository using (r_id)
+                where
+                  p_id=3D".sql_string($profile).
+                " order by 2" );
+		      return $sel;
+			}
 	}
 }
\ No newline at end of file

Modified: phpcompta/trunk/include/class_periode.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_periode.php	2012-06-15 18:37:18 UTC (re=
v 4906)
+++ phpcompta/trunk/include/class_periode.php	2012-06-16 00:00:01 UTC (re=
v 4907)
@@ -440,18 +440,20 @@
      *the this->p_id must be set
      *\return a string with the date (DD.MM.YYYY)
      */
-    public function first_day()
+    public function first_day($p=3D0)
     {
-        list($p_start,$p_end)=3D$this->get_date_limit($this->p_id);
+		if ($p=3D=3D0) $p=3D$this->p_id;
+        list($p_start,$p_end)=3D$this->get_date_limit($p);
         return $p_start;
     }
     /*!\brief return the last day of periode
      *the this->p_id must be set
      *\return a string with the date (DD.MM.YYYY)
      */
-    public function last_day()
+    public function last_day($p=3D0)
     {
-        list($p_start,$p_end)=3D$this->get_date_limit($this->p_id);
+		if ($p=3D=3D0) $p=3D$this->p_id;
+        list($p_start,$p_end)=3D$this->get_date_limit($p);
         return $p_end;
     }
=20
@@ -500,12 +502,12 @@
 		  throw new Exception('Erreur insertion p=C3=A9riode');
 		}
 	    }
-	  if ( $nb_periode=3D=3D12 && $this->insert('01.12.'.$p_exercice,'31.12=
.'.$p_exercice,$p_exercice) !=3D 0 )=20
-	    {=20
+	  if ( $nb_periode=3D=3D12 && $this->insert('01.12.'.$p_exercice,'31.12=
.'.$p_exercice,$p_exercice) !=3D 0 )
+	    {
 	      throw new Exception('Erreur insertion p=C3=A9riode');
 	    }
-	  if ( $nb_periode=3D=3D13)=20
-	    {=20
+	  if ( $nb_periode=3D=3D13)
+	    {
 	      if ($this->insert('01.12.'.$p_exercice,'30.12.'.$p_exercice,$p_ex=
ercice) !=3D 0 ) 	      throw new Exception('Erreur insertion p=C3=A9riod=
e');
 	      if ($this->insert('31.12.'.$p_exercice,'31.12.'.$p_exercice,$p_ex=
ercice) !=3D 0 ) 	      throw new Exception('Erreur insertion p=C3=A9riod=
e');
 	    }

Added: phpcompta/trunk/include/stock_histo.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_histo.inc.php	                        (=
rev 0)
+++ phpcompta/trunk/include/stock_histo.inc.php	2012-06-16 00:00:01 UTC (=
rev 4907)
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief
+ *
+ */
+global $g_user,$cn,$g_parameter;
+require_once 'class_stock.php';
+require_once 'class_periode.php';
+
+$stock=3Dnew Stock();
+$array=3D$_GET;
+if ( ! isset ($array['wdate_start']) || ! isset ($array['wdate_end']))
+{
+	// Date start / end
+		$exercice =3D $g_user->get_exercice();
+		$periode =3D new Periode($cn);
+		list($periode_start, $periode_end) =3D $periode->get_limit($exercice);
+
+		$array['wdate_start'] =3D $periode_start->first_day();
+		$array['wdate_end'] =3D$periode_end->last_day();
+}
+
+$stock->history($array);
+
+?>

Added: phpcompta/trunk/include/template/stock_histo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_histo.php	                    =
    (rev 0)
+++ phpcompta/trunk/include/template/stock_histo.php	2012-06-16 00:00:01 =
UTC (rev 4907)
@@ -0,0 +1,83 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show the result of stock history
+ *
+ */
+
+?>
+<div class=3D"content">
+	<?=3D$nav_bar?>
+<table class=3D"result">
+	<tr>
+		<th><?=3D$tb->get_header(0);?></th>
+		<th><?=3D$tb->get_header(1);?></th>
+		<th><?=3D$tb->get_header(2);?></th>
+		<th><?=3D$tb->get_header(3);?></th>
+		<th>Op=C3=A9ration</th>
+		<th><?=3D$tb->get_header(4);?></th>
+		<th><?=3D$tb->get_header(5);?></th>
+		<th><?=3D$tb->get_header(6);?></th>
+		<th><?=3D$tb->get_header(7);?></th>
+	</tr>
+	<?
+
+	for ($i=3D0;$i<$max_row;$i++):
+		$row=3DDatabase::fetch_array($res, $i);
+		$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
+	?>
+	<tr <?=3D$class?>>
+		<td>
+			<?=3D$row['cdate']?>
+		</td>
+		<td>
+			<?=3D$row['sg_code']?>
+		</td>
+		<td>
+			<?=3D$row['r_name']?>
+		</td>
+		<td>
+			<?=3DHtmlInput::card_detail($row['qcode'],$row['fname'])?>
+		</td>
+		<td>
+			<?=3DHtmlInput::detail_op($row['jr_id'],$row['jr_internal'])?>
+		</td>
+		<td>
+			<?=3D$row['ccomment']?>
+		</td>
+		<td class=3D"num">
+			<?=3Dnbm($row['j_montant'])?>
+		</td>
+		<td class=3D"num">
+			<?=3Dnbm($row['sg_quantity'])?>
+		</td>
+		<td>
+			<?=3D$row['direction']?>
+		</td>
+	</tr>
+	<? endfor;?>
+</table>
+	<?=3D$nav_bar?>
+</div>
\ No newline at end of file

Added: phpcompta/trunk/include/template/stock_histo_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_histo_search.php	             =
           (rev 0)
+++ phpcompta/trunk/include/template/stock_histo_search.php	2012-06-16 00=
:00:01 UTC (rev 4907)
@@ -0,0 +1,70 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show box for search
+ *
+ */
+?>
+<div id=3D"histo_search_d" class=3D"inner_box" style=3D"width:60%;height=
:280px;display:none">
+	<?=3D HtmlInput::title_box("Recherche", "histo_search_d", "hide")?>
+	<form method=3D"GET">
+		<?=3D HtmlInput::get_to_hidden(array("gDossier", "ac"))?>
+		<table>
+			<tr>
+				<td> Fiche </td>
+				<td> <?=3D $wcard->input()?><?=3D$wcard->search()?> </td>
+			</tr>
+			<tr>
+				<td> A partir de </td>
+				<td> <?=3D $wdate_start->input()?> </td>
+			</tr>
+			<tr>
+				<td> Jusque </td>
+				<td> <?=3D $wdate_end->input()?> </td>
+			</tr>
+			<tr>
+				<td> D=C3=A9p=C3=B4t </td>
+				<td> <?=3D $wrepo->input()?> </td>
+			</tr>
+			<tr>
+				<td> Montant sup=C3=A9rieur ou =C3=A9gal =C3=A0  </td>
+				<td> <?=3D $wamount_start->input()?> </td>
+			</tr>
+			<tr>
+				<td> Montant inf=C3=A9rieur ou =C3=A9gal =C3=A0  </td>
+				<td> <?=3D $wamount_end->input()?> </td>
+			</tr>
+			<tr>
+				<td> Code Stock </td>
+				<td> <?=3D $wcode_stock->input()?> </td>
+			</tr>
+			<tr>
+				<td> Direction </td>
+				<td> <?=3D $wdirection->input()?> </td>
+			</tr>
+		</table>
+		<?=3DHtmlInput::submit("search_histo_b","Recherche")?>
+	</form>
+</div>
+

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-15 18:37:18 UTC (rev 4906)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-16 00:00:01 UTC (rev 4907)
@@ -269,4 +269,21 @@
 ALTER TABLE stock_goods ADD COLUMN r_id bigint;
 update stock_goods set r_id=3D1;
 CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
-alter table action_gestion drop ag_cal;
\ No newline at end of file
+alter table action_gestion drop ag_cal;
+
+
+update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
+
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_HISTO','stock_histo.inc.php','Historique stock','Historique =
des mouvement de stock','ME');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_STATE','stock_state.inc.php','Etat des stock','Etat des stoc=
k','ME');
+
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',1,10,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',1,20,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',2,10,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',2,20,'E');
+
+-- clean stock_goods
+delete from stock_goods where  sg_code is null or sg_code=3D'' or sg_cod=
e not in (select ad_value from fiche_detail as fd where ad_id=3D19 and ad=
_value is not null);
+
+CREATE INDEX fki_jrnx_j_grpt ON jrnx  (j_grpt );
+CREATE INDEX fki_jrn_jr_grpt_id ON jrn  (jr_grpt_id );
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 11:42:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sfv97-0006JR-2l
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 11:42:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 17:33:49 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199674.1339861359.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4908 - in phpcompta/trunk: html html/js include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 15:42:39 -0000

Author: danydb
Date: 2012-06-16 17:33:48 +0200 (Sat, 16 Jun 2012)
New Revision: 4908

Modified:
   phpcompta/trunk/html/ajax_card.php
   phpcompta/trunk/html/fid_card.php
   phpcompta/trunk/html/js/ajax_fiche.js
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/class_fiche_def.php
   phpcompta/trunk/include/fiche.inc.php
Log:
attribut fiche : card, fix bug, can use search button + filter + dble cli=
ck

Modified: phpcompta/trunk/html/ajax_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_card.php	2012-06-16 00:00:01 UTC (rev 4907)
+++ phpcompta/trunk/html/ajax_card.php	2012-06-16 15:33:48 UTC (rev 4908)
@@ -301,6 +301,7 @@
     {
         $f=3Dnew Fiche($cn);
         $f->insert($fd_id,$_POST);
+		$f->Get();
         $html.=3D'<h2 class=3D"notice">Fiche sauv=C3=A9e</h2>';
         $html.=3D$f->Display(true);
         $js=3D"";

Modified: phpcompta/trunk/html/fid_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/fid_card.php	2012-06-16 00:00:01 UTC (rev 4907)
+++ phpcompta/trunk/html/fid_card.php	2012-06-16 15:33:48 UTC (rev 4908)
@@ -55,15 +55,15 @@
 $g_user->check();
 $g_user->check_dossier(dossier::id());
=20
-switch ($d)
+if ( $d =3D=3D 'all')
 {
-case 'all':
     $filter_card=3D'';
-    break;
-
-default:
+}
+else if (strpos($d,'sql]')=3D=3Dtrue)
+{
+	$filter_card=3D  str_replace('[sql]', "", $d);
+} else
     $filter_card=3D"and fd_id in ($d)";
-}
=20
 if ( $jrn !=3D -1 )
 {

Modified: phpcompta/trunk/html/js/ajax_fiche.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/ajax_fiche.js	2012-06-16 00:00:01 UTC (rev 49=
07)
+++ phpcompta/trunk/html/js/ajax_fiche.js	2012-06-16 15:33:48 UTC (rev 49=
08)
@@ -68,7 +68,8 @@
 {
 	try
 	{
-    var gDossier=3D$('gDossier').value;
+		alert('ici');
+	var gDossier=3D$('gDossier').value;
     var jrn=3D$(p_ctl).jrn;
     $(p_ctl).value=3D$(p_ctl).value.toUpperCase();
     if ( jrn =3D=3D undefined )

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-16 00:00:01 UTC (rev =
4907)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-16 15:33:48 UTC (rev =
4908)
@@ -518,16 +518,14 @@
 					case 'card':
 						$w =3D new ICard("av_text" . $attr->ad_id);
 						// filter on frd_id
-						$sql =3D ' select fd_id from fiche_def ';
-						$filter =3D $this->cn->make_list($sql);
-						$w->extra =3D $filter;
+						$w->extra =3D $attr->ad_extra;
 						$w->extra2 =3D 0;
 						$label =3D new ISpan();
-						$label->name =3D "av_text" . $r->ad_id . "_label";
+						$label->name =3D "av_text" . $attr->ad_id . "_label";
 						$w->set_attribute('ipopup', 'ipopcard');
-						$w->set_attribute('typecard', $filter);
-						$w->set_attribute('inp', "av_text" . $r->ad_id);
-						$w->set_attribute('label', "av_text" . $r->ad_id . "_label");
+						$w->set_attribute('typecard', $attr->ad_extra);
+						$w->set_attribute('inp', "av_text" . $attr->ad_id);
+						$w->set_attribute('label', "av_text" . $attr->ad_id . "_label");
 						$msg =3D $w->search();
 						$msg.=3D$label->input();
 						break;
@@ -538,7 +536,7 @@
 			$w->label =3D $attr->ad_text;
 			$w->name =3D "av_text" . $attr->ad_id;
=20
-			$r.=3D"<TR>" . td($w->label, ' class=3D"input_text" ') . td($w->input=
()) . "$msg </TR>";
+			$r.=3D"<TR>" . td($w->label, ' class=3D"input_text" ') . td($w->input=
()) . td("$msg")." </TR>";
 		}
 		$r.=3D '</table>';
         return $r;
@@ -663,9 +661,9 @@
 							break;
 						case 'card':
 							$w =3D new ICard("av_text" . $r->ad_id);
-							// filter on frd_id
-							$sql =3D ' select fd_id from fiche_def ';
-							$filter =3D $this->cn->make_list($sql);
+							// filter on ad_extra
+
+							$filter =3D $r->ad_extra;
 							$w->width =3D $r->ad_size;
 							$w->extra =3D $filter;
 							$w->extra2 =3D 0;
@@ -675,6 +673,7 @@
 							$w->set_attribute('typecard', $filter);
 							$w->set_attribute('inp', "av_text" . $r->ad_id);
 							$w->set_attribute('label', "av_text" . $r->ad_id . "_label");
+							$w->dblclick=3D"fill_ipopcard(this);";
 							$msg =3D $w->search();
 							$msg.=3D$label->input();
 							$w->value =3D $r->av_text;
@@ -1815,50 +1814,57 @@
         $filter_query=3D'';
         if ( isset($typecard))
         {
-            switch($typecard)
-            {
-            case 'cred':
-                if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jr=
n');
-                $filter_jrn=3D$this->cn->make_list("select jrn_def_fiche=
_cred from jrn_Def where jrn_def_id=3D$1",array($jrn));
-                $filter_fd_id=3D" fd_id in (".$filter_jrn.")";
-                $and=3D" and ";
-                break;
-            case 'deb':
-                if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jr=
n');
-                $filter_jrn=3D$this->cn->make_list("select jrn_def_fiche=
_deb from jrn_Def where jrn_def_id=3D$1",array($jrn));
-                $filter_fd_id=3D" fd_id in (".$filter_jrn.")";
-                $and=3D" and ";
-                break;
-            case 'filter':
-                if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jr=
n');
-                $filter_jrn=3D$this->cn->make_list("select jrn_def_fiche=
_deb from jrn_Def where jrn_def_id=3D$1",array($jrn));
+			if (strpos($typecard, "sql")=3D=3Dfalse)
+			{
+				switch($typecard)
+				{
+				case 'cred':
+					if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jrn');
+					$filter_jrn=3D$this->cn->make_list("select jrn_def_fiche_cred from =
jrn_Def where jrn_def_id=3D$1",array($jrn));
+					$filter_fd_id=3D" fd_id in (".$filter_jrn.")";
+					$and=3D" and ";
+					break;
+				case 'deb':
+					if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jrn');
+					$filter_jrn=3D$this->cn->make_list("select jrn_def_fiche_deb from j=
rn_Def where jrn_def_id=3D$1",array($jrn));
+					$filter_fd_id=3D" fd_id in (".$filter_jrn.")";
+					$and=3D" and ";
+					break;
+				case 'filter':
+					if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jrn');
+					$filter_jrn=3D$this->cn->make_list("select jrn_def_fiche_deb from j=
rn_Def where jrn_def_id=3D$1",array($jrn));
=20
-                if ( trim($filter_jrn) !=3D'')
-                    $fp1=3D" fd_id in (".$filter_jrn.")";
-                else
-                    $fp1=3D"fd_id < 0";
+					if ( trim($filter_jrn) !=3D'')
+						$fp1=3D" fd_id in (".$filter_jrn.")";
+					else
+						$fp1=3D"fd_id < 0";
=20
-                $filter_jrn=3D$this->cn->make_list("select jrn_def_fiche=
_cred from jrn_Def where jrn_def_id=3D$1",array($jrn));
+					$filter_jrn=3D$this->cn->make_list("select jrn_def_fiche_cred from =
jrn_Def where jrn_def_id=3D$1",array($jrn));
=20
-                if ( trim($filter_jrn) !=3D'')
-                    $fp2=3D" fd_id in (".$filter_jrn.")";
-                else
-                    $fp2=3D"fd_id < 0";
+					if ( trim($filter_jrn) !=3D'')
+						$fp2=3D" fd_id in (".$filter_jrn.")";
+					else
+						$fp2=3D"fd_id < 0";
=20
-                $filter_fd_id=3D'('.$fp1.' or '.$fp2.')';
+					$filter_fd_id=3D'('.$fp1.' or '.$fp2.')';
=20
-                $and=3D" and ";
-                break;
-            case 'all':
-                $filter_fd_id=3D' true';
-                break;
-            default:
-                if ( trim($typecard) !=3D '')
-                    $filter_fd_id=3D' fd_id in ('.$typecard.')';
-                else
-                    $filter_fd_id=3D' fd_id < 0';
-            }
-        }
+					$and=3D" and ";
+					break;
+				case 'all':
+					$filter_fd_id=3D' true';
+					break;
+				default:
+					if ( trim($typecard) !=3D '')
+						$filter_fd_id=3D' fd_id in ('.$typecard.')';
+					else
+						$filter_fd_id=3D' fd_id < 0';
+				}
+			}
+			else
+			{
+				$filter_fd_id =3D str_replace('[sql]', '', $typecard);
+			}
+		}
=20
         $and=3D" and ";
         if (isset($query))

Modified: phpcompta/trunk/include/class_fiche_def.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche_def.php	2012-06-16 00:00:01 UTC (=
rev 4907)
+++ phpcompta/trunk/include/class_fiche_def.php	2012-06-16 15:33:48 UTC (=
rev 4908)
@@ -344,7 +344,7 @@
     function myList()
     {
         $this->Get();
-        echo '<H2 class=3D"info">'.$this->label.'</H2>';
+        echo '<H2 class=3D"info">'.$this->id." ".$this->label.'</H2>';
=20
         $step=3D$_SESSION['g_pagesize'];
         $sql_limit=3D"";
@@ -452,10 +452,9 @@
     {
         if ( $this->id =3D=3D 0 )
             return ;
-        /*      $this->cn->exec_sql('select fiche_attribut_synchro($1)',
-        array($this->id));
-        */
-        $MaxLine=3Dsizeof($this->attribut);
+           $this->cn->exec_sql('select fiche_attribut_synchro($1)',array=
($this->id));
+
+		   $MaxLine=3Dsizeof($this->attribut);
         $r=3D"<TABLE>";
 	$r.=3D"<tr>".th('Nom attribut').th('').th('Ordre','style=3D"text-align:=
right"').'</tr>';
         // Display each attribute

Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-16 00:00:01 UTC (rev 49=
07)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-16 15:33:48 UTC (rev 49=
08)
@@ -89,7 +89,7 @@
         $p_fiche_def->save_class_base($_REQUEST['class_base']);
     }
     $p_fiche_def->Get();
-    $r.=3D '<H2 class=3D"info">'.h($p_fiche_def->label).'</H2>';
+    $r.=3D '<H2 class=3D"info">'.$p_fiche_def->id." ".h($p_fiche_def->la=
bel).'</H2>';
     $r.=3D'<fieldset><legend>Donn=C3=A9es g=C3=A9n=C3=A9rales</legend>';
=20
     /* show the values label class_base and create account */



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 11:45:37 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfvBx-0006QM-1i
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 11:45:37 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 17:36:48 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199679.1339861536.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4909 - phpcompta/trunk/html/js
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 15:45:36 -0000

Author: danydb
Date: 2012-06-16 17:36:48 +0200 (Sat, 16 Jun 2012)
New Revision: 4909

Modified:
   phpcompta/trunk/html/js/ajax_fiche.js
Log:
remove debug info

Modified: phpcompta/trunk/html/js/ajax_fiche.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/ajax_fiche.js	2012-06-16 15:33:48 UTC (rev 49=
08)
+++ phpcompta/trunk/html/js/ajax_fiche.js	2012-06-16 15:36:48 UTC (rev 49=
09)
@@ -68,7 +68,6 @@
 {
 	try
 	{
-		alert('ici');
 	var gDossier=3D$('gDossier').value;
     var jrn=3D$(p_ctl).jrn;
     $(p_ctl).value=3D$(p_ctl).value.toUpperCase();



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 12:03:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfvTE-0002Kt-D0
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 12:03:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 17:54:35 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199693.1339862607.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4910 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 16:03:26 -0000

Author: danydb
Date: 2012-06-16 17:54:34 +0200 (Sat, 16 Jun 2012)
New Revision: 4910

Modified:
   phpcompta/trunk/include/export_fiche_detail_pdf.php
Log:
Fiche detail : retour automatique si trop longue

Modified: phpcompta/trunk/include/export_fiche_detail_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_detail_pdf.php	2012-06-16 15:36:=
48 UTC (rev 4909)
+++ phpcompta/trunk/include/export_fiche_detail_pdf.php	2012-06-16 15:54:=
34 UTC (rev 4910)
@@ -104,7 +104,7 @@
     $l++;
     $pdf->Cell($size[$l],6,mb_substr($row['jrn_name'],0,14),0,0,$align[$=
l]);
     $l++;
-    $pdf->Cell($size[$l],6,mb_substr($row['description'],0,50).'('.$row[=
'jr_internal'].')',0,0,$align[$l]);
+    $pdf->LongLine($size[$l],6,($row['description'].'('.$row['jr_interna=
l'].")"),0,$align[$l]);
=20
     $l++;
     $pdf->Cell($size[$l],6,(($row['letter']!=3D-1)?$row['letter']:''),0,=
0,$align[$l]);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 13:44:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sfx3K-0005HF-Qj
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 13:44:50 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 19:35:59 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199785.1339868690.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4911 - in phpcompta/trunk: html include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 17:44:49 -0000

Author: danydb
Date: 2012-06-16 19:35:59 +0200 (Sat, 16 Jun 2012)
New Revision: 4911

Modified:
   phpcompta/trunk/html/fid_card.php
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/sql/upgrade.sql
Log:
Code gestion is now of type card, create a fake stock card category and f=
ill it with existing used code gestion

Modified: phpcompta/trunk/html/fid_card.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/fid_card.php	2012-06-16 15:54:34 UTC (rev 4910)
+++ phpcompta/trunk/html/fid_card.php	2012-06-16 17:35:59 UTC (rev 4911)
@@ -61,7 +61,7 @@
 }
 else if (strpos($d,'sql]')=3D=3Dtrue)
 {
-	$filter_card=3D  str_replace('[sql]', "", $d);
+	$filter_card=3D  str_replace('[sql]', " and ", $d);
 } else
     $filter_card=3D"and fd_id in ($d)";
=20

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-16 15:54:34 UTC (rev =
4910)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-16 17:35:59 UTC (rev =
4911)
@@ -337,12 +337,15 @@
      * \see constant.php
      * \return string
      */
-    function strAttribut($p_ad_id)
+    function strAttribut($p_ad_id,$p_return=3D1)
     {
+		$return=3D($p_return=3D=3D1)?NOTFOUND:"";
         if ( sizeof ($this->attribut) =3D=3D 0 )
         {
=20
-            if ($this->id=3D=3D0) return NOTFOUND;
+            if ($this->id=3D=3D0) {
+					return $return;
+			}
             // object is not in memory we need to look into the database
             $sql=3D"select ad_value from fiche_detail
                  where f_id=3D $1  and ad_id=3D $2 ";
@@ -350,7 +353,7 @@
             $row=3DDatabase::fetch_all($Res);
             // if not found return error
             if ( $row =3D=3D false )
-                return NOTFOUND;
+                return $return;
=20
             return $row[0]['ad_value'];
         }
@@ -360,7 +363,7 @@
             if ( $e->ad_id =3D=3D $p_ad_id )
                 return $e->av_text;
         }
-        return NOTFOUND;
+        return $return;
     }
     /*!\brief make an array of attributes of the category of card (FICHE=
_DEF.FD_ID)
      *The array can be used with the function insert, it will return a s=
truct like this :
@@ -660,7 +663,9 @@
 							$w->value =3D $r->av_text;
 							break;
 						case 'card':
+							$uniq=3Drand(0,1000);
 							$w =3D new ICard("av_text" . $r->ad_id);
+							$w->id=3D"card_".$this->id.$uniq;
 							// filter on ad_extra
=20
 							$filter =3D $r->ad_extra;
@@ -668,11 +673,22 @@
 							$w->extra =3D $filter;
 							$w->extra2 =3D 0;
 							$label =3D new ISpan();
-							$label->name =3D "av_text" . $r->ad_id . "_label";
+							$label->name =3D "av_text" .$uniq. $r->ad_id . "_label";
+							$fiche=3Dnew Fiche($this->cn);
+							$fiche->get_by_qcode($r->av_text);
+							if ($fiche->id =3D=3D 0 )
+							{
+								$label->value=3D(trim($r->av_text)=3D=3D'')?"":" Fiche non trouv=
=C3=A9 ";
+								$r->av_text=3D"";
+							} else
+							{
+								$label->value=3D$fiche->strAttribut(ATTR_DEF_NAME)." ".$fiche->s=
trAttribut(ATTR_DEF_FIRST_NAME,0);
+							}
 							$w->set_attribute('ipopup', 'ipopcard');
 							$w->set_attribute('typecard', $filter);
 							$w->set_attribute('inp', "av_text" . $r->ad_id);
-							$w->set_attribute('label', "av_text" . $r->ad_id . "_label");
+							$w->set_attribute('label', $label->name);
+							$w->autocomplete=3D0;
 							$w->dblclick=3D"fill_ipopcard(this);";
 							$msg =3D $w->search();
 							$msg.=3D$label->input();
@@ -711,7 +727,7 @@
 			$w->readOnly =3D $p_readonly;
=20
=20
-			$ret.=3D"<TR>" . td($r->ad_text . $bulle) . td($w->input()) . td($msg=
) . " </TR>";
+			$ret.=3D"<TR>" . td($r->ad_text . $bulle) . td($w->input()." ". $msg)=
 . " </TR>";
 		}
=20
 		$ret.=3D"</table>";

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-16 15:54:34 UTC (rev 4910)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-16 17:35:59 UTC (rev 4911)
@@ -286,4 +286,33 @@
 delete from stock_goods where  sg_code is null or sg_code=3D'' or sg_cod=
e not in (select ad_value from fiche_detail as fd where ad_id=3D19 and ad=
_value is not null);
=20
 CREATE INDEX fki_jrnx_j_grpt ON jrnx  (j_grpt );
-CREATE INDEX fki_jrn_jr_grpt_id ON jrn  (jr_grpt_id );
\ No newline at end of file
+CREATE INDEX fki_jrn_jr_grpt_id ON jrn  (jr_grpt_id );
+
+--
+insert into fiche_def (fd_id,frd_id,fd_label) values (500000,15,'Stock')=
;
+insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,1,10);
+insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,9,20);
+insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,23,30);
+
+create or replace function migrate_stock() returns void
+as
+$body$
+declare
+	rt_row text;
+	n_fid bigint;
+begin
+	for rt_row in select distinct ad_value from fiche_Detail where ad_id=3D=
19 and ad_value is not null and ad_Value <> ''
+	loop
+		insert into fiche (fd_id) values(500000) returning f_id into n_fid;
+		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,1,rt_row)=
;
+		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,9,'Code s=
tock '||rt_row);
+		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,23,'STOCK=
'||n_fid::text);
+		update fiche_detail set ad_value=3D'STOCK'||n_fid::text where ad_id=3D=
19 and ad_value=3Drt_row;
+	end loop;
+
+end;
+$body$ language plpgsql;
+
+select migrate_stock();
+
+drop function migrate_stock();



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 13:45:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sfx3w-0005MR-26
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 13:45:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 19:36:38 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199786.1339868727.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4912 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 17:45:27 -0000

Author: danydb
Date: 2012-06-16 19:36:38 +0200 (Sat, 16 Jun 2012)
New Revision: 4912

Modified:
   phpcompta/trunk/include/class_icard.php
Log:
new autocomplete can be disabled

Modified: phpcompta/trunk/include/class_icard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_icard.php	2012-06-16 17:35:59 UTC (rev =
4911)
+++ phpcompta/trunk/include/class_icard.php	2012-06-16 17:36:38 UTC (rev =
4912)
@@ -127,6 +127,7 @@
         $this->dblclick=3D'';
         $this->callback=3D'null';
         $this->javascript=3D'';
+		$this->autocomplete=3D1;
     }
     /*!\brief set the javascript callback function
      * by default it is update_value called BEFORE the querystring is se=
nd
@@ -167,7 +168,7 @@
     {
         $ip_card=3Dnew IPopup ($p_name);
         $ip_card->drag=3Dtrue;
-	$ip_card->set_width('45%');
+		$ip_card->set_width('45%');
         $ip_card->title=3D'Fiche ';
         $ip_card->value=3D'';
         return $ip_card->input();
@@ -210,27 +211,33 @@
                        $this->dblclick,
                        $this->javascript
                       );
+		if ( $this->autocomplete =3D=3D 1)
+		{
+			$ind=3Dsprintf('<span id=3D"%s_ind" class=3D"autocomplete" style=3D"d=
isplay:none">Un instant... <img src=3D"image/loading.gif" alt=3D"Chargeme=
nt..."/>'.
+						'</span>',
+						$this->id);
=20
-        $ind=3Dsprintf('<span id=3D"%s_ind" class=3D"autocomplete" style=
=3D"display:none">Un instant... <img src=3D"image/loading.gif" alt=3D"Cha=
rgement..."/>'.
-                     '</span>',
-                     $this->id);
+			$div=3Dsprintf('<div id=3D"%s_choices"  class=3D"autocomplete"></div>=
',
+						$this->id);
=20
-        $div=3Dsprintf('<div id=3D"%s_choices"  class=3D"autocomplete"><=
/div>',
-                     $this->id);
+			$query=3Ddossier::get().'&e=3D'.urlencode($this->typecard);
=20
-        $query=3Ddossier::get().'&e=3D'.urlencode($this->typecard);
+			$javascript=3Dsprintf('try { new Ajax.Autocompleter("%s","%s_choices"=
,"fid_card.php?%s",'.
+								'{paramName:"FID",minChars:1,indicator:null, '.
+								'callback:%s, '.
+								' afterUpdateElement:%s});} catch (e){alert(e.message);};',
+								$this->id,$this->id,$query,
+								$this->callback,
+								$this->fct);
=20
-        $javascript=3Dsprintf('try { new Ajax.Autocompleter("%s","%s_cho=
ices","fid_card.php?%s",'.
-                            '{paramName:"FID",minChars:1,indicator:null,=
 '.
-                            'callback:%s, '.
-                            ' afterUpdateElement:%s});} catch (e){alert(=
e.message);};',
-                            $this->id,$this->id,$query,
-                            $this->callback,
-                            $this->fct);
+			$javascript=3Dcreate_script($javascript.$this->dblclick);
=20
-        $javascript=3Dcreate_script($javascript.$this->dblclick);
-
-        $r=3D$label.$input.$attr.$ind.$div.$javascript;
+			$r=3D$label.$input.$attr.$ind.$div.$javascript;
+		}
+		else
+		{
+			$r=3D$label.$input;
+		}
         if ( $this->table =3D=3D 1 )
             $r=3Dtd($r);
         return $r;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 13:45:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sfx4E-0005NE-68
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 13:45:46 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 19:36:55 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199787.1339868745.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4913 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 17:45:44 -0000

Author: danydb
Date: 2012-06-16 19:36:55 +0200 (Sat, 16 Jun 2012)
New Revision: 4913

Modified:
   phpcompta/trunk/include/template/history_top.php
   phpcompta/trunk/include/template/ledger_detail_top.php
Log:
change pop me up by pop me out

Modified: phpcompta/trunk/include/template/history_top.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/history_top.php	2012-06-16 17:36:38 =
UTC (rev 4912)
+++ phpcompta/trunk/include/template/history_top.php	2012-06-16 17:36:55 =
UTC (rev 4913)
@@ -5,7 +5,7 @@
      $callback=3D$_SERVER['PHP_SELF'];
      $str=3D$_SERVER['QUERY_STRING']."&act=3Dde&ajax=3D$callback";
      echo '<A id=3D"close_div" HREF=3D"javascript:void(0)" onclick=3D"va=
r a=3Dwindow.open(\'popup.php?'.$str.'\',\'\',\'toolbar=3D0,width=3D600,h=
eight=3D400,scrollbars=3Dyes,resizable=3Dyes,status=3D0,location=3D0\'); =
a.focus();removeDiv(\''.$div.'\')">
-!pop me up ! </A>';
+!pop me out ! </A>';
 echo '<A id=3D"close_div" HREF=3D"javascript:void(0)" onclick=3D"removeD=
iv(\''.$div.'\');">Fermer</A>';
 }
 ?>

Modified: phpcompta/trunk/include/template/ledger_detail_top.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/ledger_detail_top.php	2012-06-16 17:=
36:38 UTC (rev 4912)
+++ phpcompta/trunk/include/template/ledger_detail_top.php	2012-06-16 17:=
36:55 UTC (rev 4913)
@@ -4,7 +4,7 @@
      $callback=3D$_SERVER['PHP_SELF'];
      $str=3D$_SERVER['QUERY_STRING']."&act=3D$action&ajax=3D$callback";
      echo '<A id=3D"close_div" HREF=3D"javascript:void(0)" onclick=3D"va=
r a=3Dwindow.open(\'popup.php?'.$str.'\',\'\',\'toolbar=3D0,width=3D600,h=
eight=3D400,scrollbars=3Dyes,resizable=3Dyes,status=3D0,location=3D0\'); =
a.focus();removeDiv(\''.$div.'\')">
-!pop me up ! </A>';
+!pop me out ! </A>';
      echo '<A id=3D"close_div" HREF=3D"javascript:void(0)" onclick=3D"re=
moveDiv(\''.$div.'\');">Fermer</A>';
    }
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 14:27:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sfxix-0000eB-C0
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 14:27:51 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 20:19:00 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199824.1339871270.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4914 - in phpcompta/trunk: include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 18:27:50 -0000

Author: danydb
Date: 2012-06-16 20:19:00 +0200 (Sat, 16 Jun 2012)
New Revision: 4914

Modified:
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/class_fiche_def.php
   phpcompta/trunk/include/fiche.inc.php
   phpcompta/trunk/include/template/stock_histo.php
   phpcompta/trunk/include/user_common.php
   phpcompta/trunk/sql/upgrade.sql
Log:
Mise ?\195?\160 jour script migration_stock
Correct erreur dans fiche.inc.php
Enl?\195?\168ve traitement lors sauvegarde pour ATTR_DEF_STOCK
Ajout lien d?\195?\169tail vers fiche stock dans historique

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-16 17:36:55 UTC (rev =
4913)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-16 18:19:00 UTC (rev =
4914)
@@ -539,7 +539,7 @@
 			$w->label =3D $attr->ad_text;
 			$w->name =3D "av_text" . $attr->ad_id;
=20
-			$r.=3D"<TR>" . td($w->label, ' class=3D"input_text" ') . td($w->input=
()) . td("$msg")." </TR>";
+			$r.=3D"<TR>" . td($w->label, ' class=3D"input_text" ') . td($w->input=
()." $msg")." </TR>";
 		}
 		$r.=3D '</table>';
         return $r;
@@ -926,33 +926,6 @@
=20
=20
                 }
-                if ( $id =3D=3D ATTR_DEF_STOCK )
-                {
-                    $st=3D$this->cn->count_sql('select * from stock_good=
s where '.
-                                             " f_id=3D".$this->id);
-                    if ( $st =3D=3D 0 )
-                    {
-                        $exercice=3D$g_user->get_exercice();
-                        if ( $exercice =3D=3D 0 ) throw new Exception ('=
Annee invalide erreur');
-
-                        $str_stock=3Dsprintf('insert into stock_goods(f_=
id,sg_quantity,sg_comment,sg_code,sg_type,sg_exercice) '.
-                                           ' values (%d,0,\'%s\',upper(\=
'%s\'),\'d\',\'%s\')',
-                                           $this->id,
-                                           'initial',
-                                           sql_string($value),
-                                           $exercice);
-
-                        $this->cn->exec_sql($str_stock);
-                    }
-                    else
-                    {
-                        $str_stock=3Dsprintf("update stock_goods set sg_=
code=3Dupper('%s') where f_id=3D%d",
-                                           sql_string($value),
-                                           $this->id);
-                        $this->cn->exec_sql($str_stock);
-                    }
-                }
-
                 // account
                 if ($id =3D=3D ATTR_DEF_ACCOUNT)
 				{

Modified: phpcompta/trunk/include/class_fiche_def.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche_def.php	2012-06-16 17:36:55 UTC (=
rev 4913)
+++ phpcompta/trunk/include/class_fiche_def.php	2012-06-16 18:19:00 UTC (=
rev 4914)
@@ -402,7 +402,7 @@
=20
             $span_mod=3D'<TD><A href=3D"?p_action=3Dfiche&'.$str_dossier=
.
 		    '&action=3Ddetail&fiche_id=3D'.$l_line['f_id'].$str.'&fiche=3D'.
-		    $_GET['fiche'].'&ac=3D'.$_REQUEST['ac'].'">'.$l_line['quick_code']
+		    $_REQUEST['fiche'].'&ac=3D'.$_REQUEST['ac'].'">'.$l_line['quick_co=
de']
 		    .'</A></TD>';
=20
             echo $span_mod.'<TD>'.h($l_line['vw_name'])."</TD>";

Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-16 17:36:55 UTC (rev 49=
13)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-16 18:19:00 UTC (rev 49=
14)
@@ -304,7 +304,7 @@
         if ( $write !=3D 0 )
         {
             $iselect=3Dnew ISelect('move_to');
-            $iselect->value=3D$cn->make_array('select fd_id,fd_label fro=
m fiche_def '); //where frd_id=3D'.$fiche->get_fiche_def_ref_id());
+            $iselect->value=3D$cn->make_array('select fd_id,fd_label fro=
m fiche_def order by fd_label'); //where frd_id=3D'.$fiche->get_fiche_def=
_ref_id());
=20
             echo HtmlInput::submit("update_fiche","Mise &agrave; jour");
             echo HtmlInput::submit("delete" ,"Effacer cette fiche","oncl=
ick=3D\"return confirm('"._('Vous confirmez ?')."');\"");
@@ -401,15 +401,14 @@
         $fiche_def=3Dnew Fiche_Def($cn,$_POST['fiche']);
         $fiche_def->Get();
         echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
-        $url=3D$_SERVER['REQUEST_URI'];
         $fiche=3Dnew Fiche($cn,0);
-
-        echo '<form method=3D"post" action=3D"'.$url.'&fiche=3D'.$_POST[=
'fiche'].'">';
+		var_dump($_SERVER);
+        echo '<form method=3D"post" >';
         echo dossier::hidden();
-	echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+		echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+		echo HtmlInput::hidden('fiche',$_POST['fiche']);
         echo $fiche->blank($_POST['fiche']);
         echo HtmlInput::submit("add_fiche","Ajout");
-        echo HtmlInput::button_anchor(_('Annuler'),$url.'&fiche=3D'.$_PO=
ST['fiche'].'&'.$str_dossier);
=20
=20
         echo '</form>';
@@ -454,7 +453,7 @@
         echo '<DIV class=3D"redcontent" style=3D"width:auto">';
         $fiche=3Dnew Fiche($cn);
         $fiche->Save($_REQUEST['fiche']);
-        $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
+        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fiche']);
         $fiche_def->myList();
=20
=20

Modified: phpcompta/trunk/include/template/stock_histo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_histo.php	2012-06-16 17:36:55 =
UTC (rev 4913)
+++ phpcompta/trunk/include/template/stock_histo.php	2012-06-16 18:19:00 =
UTC (rev 4914)
@@ -53,13 +53,13 @@
 			<?=3D$row['cdate']?>
 		</td>
 		<td>
-			<?=3D$row['sg_code']?>
+			<?=3DHtmlInput::card_detail($row['sg_code'],"",' class=3D"line" ')?>
 		</td>
 		<td>
 			<?=3D$row['r_name']?>
 		</td>
 		<td>
-			<?=3DHtmlInput::card_detail($row['qcode'],$row['fname'])?>
+			<?=3DHtmlInput::card_detail($row['qcode'],$row['fname'],' class=3D"li=
ne" ')?>
 		</td>
 		<td>
 			<?=3DHtmlInput::detail_op($row['jr_id'],$row['jr_internal'])?>

Modified: phpcompta/trunk/include/user_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/user_common.php	2012-06-16 17:36:55 UTC (rev =
4913)
+++ phpcompta/trunk/include/user_common.php	2012-06-16 18:19:00 UTC (rev =
4914)
@@ -51,6 +51,9 @@
  */
 function InsertStockGoods($p_cn, $p_j_id, $p_good, $p_quant, $p_type,$p_=
depot)
 {
+	/**
+	 *@todo function insertStockGoods doit =C3=AAtre d=C3=A9plac=C3=A9e dan=
s class_stock
+	 */
     global $g_user;
     if ( $g_user->can_write_repo($p_depot) =3D=3D false )
         return false;

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-16 17:36:55 UTC (rev 4913)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-16 18:19:00 UTC (rev 4914)
@@ -308,6 +308,7 @@
 		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,9,'Code s=
tock '||rt_row);
 		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,23,'STOCK=
'||n_fid::text);
 		update fiche_detail set ad_value=3D'STOCK'||n_fid::text where ad_id=3D=
19 and ad_value=3Drt_row;
+		update stock_goods set sg_code=3D'STOCK'||n_fid::text where sg_code=3D=
rt_row;
 	end loop;
=20
 end;
@@ -315,4 +316,8 @@
=20
 select migrate_stock();
=20
+select migrate_stock();
+
 drop function migrate_stock();
+
+update attr_def set ad_type=3D'card', ad_extra=3D'[sql] fd_id =3D 500000=
 ' where ad_id=3D19;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 14:36:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sfxrf-0002KE-Sp
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 14:36:51 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 20:28:01 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199829.1339871811.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4915 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 18:36:50 -0000

Author: danydb
Date: 2012-06-16 20:28:01 +0200 (Sat, 16 Jun 2012)
New Revision: 4915

Modified:
   phpcompta/trunk/include/template/stock_histo_search.php
Log:
Fix bug in stock search

Modified: phpcompta/trunk/include/template/stock_histo_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_histo_search.php	2012-06-16 18=
:19:00 UTC (rev 4914)
+++ phpcompta/trunk/include/template/stock_histo_search.php	2012-06-16 18=
:28:01 UTC (rev 4915)
@@ -32,8 +32,12 @@
 		<?=3D HtmlInput::get_to_hidden(array("gDossier", "ac"))?>
 		<table>
 			<tr>
+				<td> Code Stock </td>
+				<td> <?=3D $wcode_stock->input()?><?=3D $wcode_stock->search()?> </t=
d>
+			</tr>
+			<tr>
 				<td> Fiche </td>
-				<td> <?=3D $wcard->input()?><?=3D$wcard->search()?> </td>
+				<td> <?=3D $wcard->input()?><?=3D $wcard->search()?> </td>
 			</tr>
 			<tr>
 				<td> A partir de </td>
@@ -55,16 +59,13 @@
 				<td> Montant inf=C3=A9rieur ou =C3=A9gal =C3=A0  </td>
 				<td> <?=3D $wamount_end->input()?> </td>
 			</tr>
+
 			<tr>
-				<td> Code Stock </td>
-				<td> <?=3D $wcode_stock->input()?> </td>
-			</tr>
-			<tr>
 				<td> Direction </td>
 				<td> <?=3D $wdirection->input()?> </td>
 			</tr>
 		</table>
-		<?=3DHtmlInput::submit("search_histo_b","Recherche")?>
+		<?=3D HtmlInput::submit("search_histo_b", "Recherche")?>
 	</form>
 </div>
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 15:01:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfyFQ-0006ck-0m
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 15:01:24 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 20:52:27 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199839.1339873282.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4916 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 19:01:22 -0000

Author: danydb
Date: 2012-06-16 20:52:27 +0200 (Sat, 16 Jun 2012)
New Revision: 4916

Modified:
   phpcompta/trunk/include/template/ledger_detail_ach.php
   phpcompta/trunk/include/template/ledger_detail_fin.php
   phpcompta/trunk/include/template/ledger_detail_ven.php
Log:
D?\195?\169tail journaux : voir fiche plut?\195?\180t qu'historique

Modified: phpcompta/trunk/include/template/ledger_detail_ach.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/ledger_detail_ach.php	2012-06-16 18:=
28:01 UTC (rev 4915)
+++ phpcompta/trunk/include/template/ledger_detail_ach.php	2012-06-16 18:=
52:27 UTC (rev 4916)
@@ -37,9 +37,8 @@
 							$bk=3Dnew Fiche($cn,$obj->det->array[0]['qp_supplier']);
 							echo td(_('Fournisseur'));
=20
-							$view_history=3D sprintf('<A class=3D"line" HREF=3D"javascript:vi=
ew_history_card(\'%s\',\'%s\')" >%s</A>',
-											$bk->id, $gDossier, $bk->get_quick_code());
-							echo td(h($bk->getName())).td($view_history);;
+							$view_card_detail=3DHtmlInput::card_detail($bk->get_quick_code(),=
h($bk->getName()), ' class=3D"line" ');
+							echo td($view_card_detail);
 							?>
 							</td>
 							</tr>
@@ -137,10 +136,8 @@
     $row=3D'';
     $q=3D$obj->det->array[$e];
     $fiche=3Dnew Fiche($cn,$q['qp_fiche']);
-   $view_history=3D sprintf('<A class=3D"detail" style=3D"text-decoratio=
n:underline" HREF=3D"javascript:view_history_card(\'%s\',\'%s\')" >%s</A>=
',
-				$fiche->id, $gDossier, $fiche->strAttribut(ATTR_DEF_QUICKCODE));
-
-   $row=3Dtd($view_history);
+	$view_card_detail=3DHtmlInput::card_detail($fiche->strAttribut(ATTR_DEF=
_QUICKCODE),"", ' class=3D"line" ');
+   $row=3Dtd($view_card_detail);
    $sym_tva=3D'';
=20
    if ( $owner->MY_TVA_USE=3D=3D'Y' && $q['qp_vat_code'] !=3D '') {

Modified: phpcompta/trunk/include/template/ledger_detail_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/ledger_detail_fin.php	2012-06-16 18:=
28:01 UTC (rev 4915)
+++ phpcompta/trunk/include/template/ledger_detail_fin.php	2012-06-16 18:=
52:27 UTC (rev 4916)
@@ -27,9 +27,8 @@
 <tr>
 <?
 $bk=3Dnew Fiche($cn,$obj->det->array[0]['qf_bank']);
-$view_history=3D sprintf('<A class=3D"line" HREF=3D"javascript:view_hist=
ory_card(\'%s\',\'%s\')" >%s</A>',
-				$bk->id, $gDossier, $bk->get_quick_code());
-echo td('Compte en banque').td(h($bk->getName())).td($view_history);;
+$view_card_detail=3DHtmlInput::card_detail($bk->get_quick_code(),h($bk->=
getName()), ' class=3D"line" ');
+echo td('Compte en banque').td($view_card_detail).td();;
=20
 ?>
 </tr>
@@ -37,10 +36,9 @@
 <?
=20
 $bk=3Dnew Fiche($cn,$obj->det->array[0]['qf_other']);
-$view_history=3D sprintf('<A class=3D"line" HREF=3D"javascript:view_hist=
ory_card(\'%s\',\'%s\')" >%s</A>',
-				$bk->id, $gDossier, $bk->get_quick_code());
-echo td('Tiers').td(h($bk->getName()));
-echo td($view_history);
+$view_card_detail=3DHtmlInput::card_detail($bk->get_quick_code(),h($bk->=
getName()), ' class=3D"line" ');
+
+echo td('Tiers').td($view_card_detail);
 ?>
 </tr>
=20

Modified: phpcompta/trunk/include/template/ledger_detail_ven.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/ledger_detail_ven.php	2012-06-16 18:=
28:01 UTC (rev 4915)
+++ phpcompta/trunk/include/template/ledger_detail_ven.php	2012-06-16 18:=
52:27 UTC (rev 4916)
@@ -37,9 +37,8 @@
 						$bk=3Dnew Fiche($cn,$obj->det->array[0]['qs_client']);
 						echo td(_('Client'));
=20
-						$view_history=3D sprintf('<A class=3D"line" HREF=3D"javascript:vie=
w_history_card(\'%s\',\'%s\')" >%s</A>',
-										$bk->id, $gDossier, $bk->get_quick_code());
-						echo td(h($bk->getName())).td($view_history);;
+						$view_card_detail=3DHtmlInput::card_detail($bk->get_quick_code(),h=
($bk->getName()), ' class=3D"line" ');
+							echo td($view_card_detail);
 						?>
 						</td>
 						</tr>
@@ -135,11 +134,9 @@
     $row=3D'';
     $q=3D$obj->det->array[$e];
     $fiche=3Dnew Fiche($cn,$q['qs_fiche']);
-    $view_history=3D sprintf('<A class=3D"line" HREF=3D"javascript:view_=
history_card(\'%s\',\'%s\')" >%s</A>',
-				$fiche->id, $gDossier, $fiche->strAttribut(ATTR_DEF_QUICKCODE));
-
-    $row =3D td($view_history);
-    if ($owner->MY_UPDLAB =3D=3D 'Y')
+	$view_card_detail=3DHtmlInput::card_detail($fiche->strAttribut(ATTR_DEF=
_QUICKCODE),"", ' class=3D"line" ');
+	$row.=3Dtd($view_card_detail);
+	if ($owner->MY_UPDLAB =3D=3D 'Y')
     {
         $l_lib =3D ($q['j_text'] =3D=3D '') ? $fiche->strAttribut(ATTR_D=
EF_NAME) : $q['j_text'];
         $hidden =3D HtmlInput::hidden("j_id[]", $q['j_id']);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 15:11:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SfyPI-00075j-Pg
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 15:11:36 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 16 Jun 2012 21:02:45 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.199846.1339873896.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4917 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 19:11:36 -0000

Author: danydb
Date: 2012-06-16 21:02:45 +0200 (Sat, 16 Jun 2012)
New Revision: 4917

Added:
   phpcompta/trunk/include/class_stock.php
Log:
Stock missing file

Added: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	                        (rev =
0)
+++ phpcompta/trunk/include/class_stock.php	2012-06-16 19:02:45 UTC (rev =
4917)
@@ -0,0 +1,411 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief
+ *
+ *
+ */
+require 'class_stock_sql.php';
+
+class Stock extends Stock_Sql
+{
+	/*	 * *
+	 * @brief  return an array of f_id and f_name
+	 *
+	 *
+	 * @param _sg_code stock_goods.sg_code
+	 * @return - array (f_id, f_label) or null if nothing is found
+	 */
+
+	function getCardNameCode($p_sg_code)
+	{
+		// Sql stmt
+		$sql =3D "select distinct f_id,ad_value
+         from stock_goods
+         join fiche_detail using(f_id)
+         where
+         ad_id=3D$1
+         and sg_code=3Dupper($2)
+         ";
+// Execute
+		$Res =3D $this->cn->exec_sql($sql, array(ATTR_DEF_STOCK, $p_sg_code));
+		if (( $M =3D Database::num_row($Res)) =3D=3D 0)
+			return null;
+
+// Store in an array
+		for ($i =3D 0; $i < $M; $i++)
+		{
+			$r =3D Database::fetch_array($Res, $i);
+			$a['f_id'] =3D $r['f_id'];
+			$a['av_text'] =3D $this->cn->get_value("select ad_value from fiche_de=
tail where ad_id=3D1 and f_id=3D$2", array($r['f_id']));
+			$result[$i] =3D $a;
+		}
+
+		return $result;
+	}
+
+	function view_detail_stock($p_sg_code, $p_year)
+	{
+		$sql =3D "select sg_id,
+              sg_code,
+         j_montant,
+         coalesce(j_date,sg_date) as j_date,
+         sg_quantity,
+         sg_type,
+         jr_id,
+         coalesce(jr_comment,sg_comment) as comment,
+         coalesce(jr_internal,'Changement manuel') as jr_internal,
+         jr_id,
+         case when sg_date is not null then sg_date else j_date end as s=
tock_date
+         from stock_goods
+         left outer join jrnx using (j_id)
+         left outer join jrn on jr_grpt_id=3Dj_grpt
+         where
+         sg_code=3D$1 and (
+         sg_exercice =3D $2
+         or j_tech_per in (select p_id from parm_periode where p_exercic=
e=3D$2)
+         )
+         order by stock_date
+         ";
+		// name
+
+		$in_quantity =3D 0;
+		$out_quantity =3D 0;
+		$in_amount =3D 0;
+		$out_amount =3D 0;
+		$r =3D "";
+		$a_name =3D getFicheNameCode($p_cn, $p_sg_code);
+		$name =3D "";
+		if ($a_name !=3D null)
+		{
+			foreach ($a_name as $key =3D> $element)
+			{
+				$name.=3D$element['av_text'] . ",";
+			}
+		}// if ( $a_name
+		// Add java script for detail
+
+
+		$r.=3D'<H2 class=3D"info">' . $p_sg_code . "  Noms : " . $name . '</H2=
>';
+
+		$Res =3D $this->cn->exec_sql($sql, array($p_sg_code, $p_year));
+		if (($M =3D Database::num_row($Res)) =3D=3D 0)
+			return "no rows";
+		$r.=3D'<table class=3D"result" >';
+		$r.=3D"<TR >";
+		$r.=3D"<th>Date </th>";
+		$r.=3D"<th>Entr=C3=A9e / Sortie </th>";
+		$r.=3D"<th>Description</th>";
+		$r.=3D"<th>Op&eacute;ration</th>";
+		$r.=3D"<th style=3D\"text-align:right\">Montant</th>";
+		$r.=3D"<th style=3D\"text-align:right\">Quantit=C3=A9</th>";
+		$r.=3D"<th style=3D\"text-align:right\">Prix/Cout Unitaire</th>";
+		$r.=3D"</TR>";
+		$tot_quantity =3D 0;
+		for ($i =3D 0; $i < $M; $i++)
+		{
+			$l =3D Database::fetch_array($Res, $i);
+			$r.=3D"<tR id=3D\"stock" . $l['sg_id'] . "\" >";
+
+			// date
+			$r.=3D"<TD>";
+			$r.=3Dformat_date($l['j_date']);
+			$r.=3D"</TD>";
+
+			//type (deb =3D out cred=3Din)
+			$r.=3D"<TD>";
+			$r.=3D($l['sg_type'] =3D=3D 'c') ? 'OUT' : 'IN';
+			$r.=3D"</TD>";
+
+			if ($l['sg_type'] =3D=3D 'c')
+			{
+				$quantity =3D (-1) * $l['sg_quantity'];
+				$out_quantity+=3D$l['sg_quantity'];
+				$out_amount+=3D$l['j_montant'];
+			}
+			else
+			{
+				$quantity =3D $l['sg_quantity'];
+				$in_quantity+=3D$l['sg_quantity'];
+				$in_amount+=3D$l['j_montant'];
+			}
+			$tot_quantity+=3D$quantity;
+			// comment
+			$r.=3D"<TD>";
+			$r.=3Dh($l['comment']);
+			$r.=3D"</TD>";
+
+			// jr_internal
+			$r.=3D"<TD>";
+			if ($l['jr_id'] !=3D "")
+				$r.=3D "<A class=3D\"detail\" style=3D\"text-decoration:underline\" =
HREF=3D\"javascript:modifyOperation('" . $l['jr_id'] . "'," . dossier::id=
() . ",0,'S')\" > " . $l['jr_internal'] . "</A>";
+			else
+				$r.=3D$l['jr_internal'];
+
+			$r.=3D"</TD>";
+
+
+
+			//amount
+			$r.=3D'<TD align=3D"right">';
+			$r.=3Dnbm($l['j_montant']);
+			$r.=3D"</TD>";
+			//quantity
+			$r.=3D'<TD align=3D"right">';
+			$r.=3Dabs($quantity);
+			$r.=3D"</TD>";
+
+			// Unit Price
+			$r.=3D'<TD align=3D"right">';
+			$up =3D "";
+			if ($l['sg_quantity'] !=3D 0)
+				$up =3D round($l['j_montant'] / $l['sg_quantity'], 4);
+			$r.=3Dnbm($up);
+			$r.=3D"</TD>";
+			$r.=3Dtd(HtmlInput::remove_stock($l['sg_id'], 'Effacer'), 'id=3D"href=
' . $l['sg_id'] . '"');
+			$r.=3D"</TR>";
+		}// for ($i
+		// write the total
+		$msg =3D ($tot_quantity < 0) ? 'Sortie / Vente ' : 'Entr=C3=A9e / Acha=
t ';
+		$row =3D td('Total ' . $msg, ' colspan=3D"4" style=3D"width:auto;text-=
align:right"');
+		$row.=3Dtd(abs($tot_quantity), 'style=3D"text-align:right"');
+		$row.=3Dtd();
+		$r.=3Dtd($row);
+		$r.=3D"</table>";
+		$r.=3D'<div style=3D"float:left">';
+		$r.=3D'<table>';
+		$row =3D td('Quantit=C3=A9 IN/Achet=C3=A9e') . td($in_quantity, 'style=
=3D"text-align:right"');
+		$r.=3Dtr($row);
+		$row =3D td('Quantit=C3=A9 OUT/Vendue') . td($out_quantity, 'style=3D"=
text-align:right"');
+		$r.=3Dtr($row);
+		$row =3D td('Quantit=C3=A9 ') . td(abs($tot_quantity), 'style=3D"text-=
align:right"');
+		$r.=3Dtr($row);
+		$r.=3D'</table>';
+		$r.=3D'</div>';
+
+		$r.=3D'<div style=3D"float:left;clear:right;margin-left:10%">';
+		$r.=3D'<table>';
+		$row =3D td('Montant IN/Achet=C3=A9') . td($in_amount, 'style=3D"text-=
align:right"');
+		$r.=3Dtr($row);
+		$row =3D td('Montant OUT/Vendu') . td($out_amount, 'style=3D"text-alig=
n:right"');
+		$r.=3Dtr($row);
+		$row =3D td('Montant ') . td($out_amount - $in_amount, 'style=3D"text-=
align:right"');
+		$r.=3Dtr($row);
+		$r.=3D'</table>';
+		$r.=3D'</div>';
+
+		return $r;
+	}
+
+	/**
+	 * show history of all the stock movement
+	 * @param $p_array usually contains $_GET
+	 */
+	function history($p_array)
+	{
+
+		$sql =3D $this->create_query_histo($p_array);
+		require_once 'class_sort_table.php';
+		$p_url =3D HtmlInput::get_to_string(array("gDossier", "ac", "wcard", "=
wdate_start", "wdate_end", "wrepo",
+					"wamount_start", "wamount_end", "wcode_stock", "wdirection"));
+
+		$tb =3D new Sort_Table();
+		$tb->add("Date", $p_url, " order by real_date asc", "order by real_dat=
e desc", "da", "dd");
+		$tb->add("Code Stock", $p_url, " order by sg_code asc", "order by sg_c=
ode desc", "sa", "sd");
+		$tb->add("D=C3=A9p=C3=B4t", $p_url, " order by r_name asc", "order by =
r_name desc", "ra", "rd");
+		$tb->add("Fiche", $p_url, " order by 2 asc", "order by 2 desc", "fa", =
"fd");
+		$tb->add("Commentaire", $p_url, " order by coalesce(sg_comment,jr_comm=
ent)  asc", "order by coalesce(sg_comment,jr_comment)  desc", "ca", "cd")=
;
+		$tb->add("Montant", $p_url, " order by j_montant asc", "order by j_mon=
tant desc", "ja", "jd");
+		$tb->add("Quantit=C3=A9", $p_url, " order by sg_quantity asc", "order =
by sg_quantity  desc", "qa", "qd");
+		$tb->add("IN/OUT", $p_url, " order by (case when sg_type=3D'c' then 'O=
UT' when sg_type=3D'c' then 'IN' end ) asc", "order by (case when sg_type=
=3D'c' then 'OUT' when sg_type=3D'c' then 'IN' end ) desc", "ta", "td");
+		$order =3D (isset($p_array['ord'])) ? $p_array['ord'] : 'da';
+
+		$sql.=3D$tb->get_sql_order($order);
+		$step =3D $_SESSION['g_pagesize'];
+		$page =3D (isset($_GET['offset'])) ? $_GET['page'] : 1;
+		$offset =3D (isset($_GET['offset'])) ? $_GET['offset'] : 0;
+
+		$res =3D $this->cn->exec_sql($sql);
+
+		$max_row =3D Database::num_row($res);
+
+		$nav_bar=3D  jrn_navigation_bar($offset,$max_row,0,$page);
+
+		if ( $step !=3D -1 ) $res =3D $this->cn->exec_sql($sql." , sg_id asc l=
imit ".$step." offset ".$offset);
+		$max_row =3D Database::num_row($res);
+
+		$this->search_box_button();
+		$this->search_box($p_array);
+		require_once 'template/stock_histo.php';
+	}
+
+	function search_box_button()
+	{
+		$bt =3D HtmlInput::button("Recherche", "Recherche", ' onclick=3D"$(\'h=
isto_search_d\').show();"');
+		echo $bt;
+	}
+
+	function search_box($p_array)
+	{
+		// Declaration
+		global $g_user;
+		$wrepo =3D HtmlInput::select_stock($this->cn, "wrepo", 'R');
+		$wrepo->value[] =3D array('value' =3D> -1, 'label' =3D> 'Tous les d=C3=
=A9p=C3=B4ts');
+
+		$wdate_start =3D new IDate('wdate_start');
+		$wdate_end =3D new IDate('wdate_end');
+		$wamount_start =3D new INum('wamount_start');
+		$wamount_end =3D new INum('wamount_end');
+		$wcard =3D new ICard('wcard');
+		$wcode_stock =3D new ICard('wcode_stock');
+		$wdirection =3D new ISelect("wdirection");
+
+		// value
+		$wrepo->selected =3D HtmlInput::default_value("wrepo", -1, $p_array);
+
+		// Date start / end
+		$exercice =3D $g_user->get_exercice();
+		$periode =3D new Periode($this->cn);
+		list($periode_start, $periode_end) =3D $periode->get_limit($exercice);
+
+		$wdate_start->value =3D HtmlInput::default_value("wdate_start", $perio=
de_start->first_day(), $p_array);
+		$wdate_end->value =3D HtmlInput::default_value("wdate_end", $periode_e=
nd->last_day(), $p_array);
+		//amounts
+		$wamount_start->value =3D HtmlInput::default_value("wamount_start", 0,=
 $p_array);
+		$wamount_end->value =3D HtmlInput::default_value("wamount_end", 0, $p_=
array);
+
+		//Card
+		$wcard->extra =3D "all";
+		$wcard->set_attribute("typecard", "all");
+		$wcard->value =3D HtmlInput::default_value("wcard", "", $p_array);
+
+		//Card stock
+		$wcode_stock->extra =3D " [sql] fd_id=3D500000 ";
+		$wcode_stock->set_attribute("typecard", "[sql] fd_id=3D500000");
+		$wcode_stock->value =3D HtmlInput::default_value("wcard", "", $p_array=
);
+
+		// Repository
+		$wcode_stock->value =3D HtmlInput::default_value("wcode_stock", "", $p=
_array);
+
+		//Direction
+		$wdirection->value =3D array(
+			array('value' =3D> "-1", 'label' =3D> "Tout"),
+			array('value' =3D> "c", 'label' =3D> "OUT"),
+			array('value' =3D> "d", 'label' =3D> "IN")
+		);
+		$wdirection->selected =3D HtmlInput::default_value("wdirection", "-1",=
 $p_array);
+
+		require_once 'template/stock_histo_search.php';
+	}
+
+	function create_query_histo($p_array)
+	{
+		$sql =3D "
+			select sg_id,
+				sg.f_id,
+				(select ad_value from fiche_Detail as fd1 where ad_id=3D1 and fd1.f_=
id=3Djx.f_id) as fname,
+				(select ad_value from fiche_Detail as fd1 where ad_id=3D23 and fd1.f=
_id=3Djx.f_id) as qcode,
+				sg_code,
+				coalesce(sg_comment,jr_comment) as ccomment,
+				sg_exercice,
+				r_name,
+				sg.r_id,
+				j_montant,
+				jr_date,
+				sg_quantity,
+				case when sg_type=3D'c' then 'OUT' when sg_type=3D'd' then 'IN' end =
as direction,
+				jr_internal,
+				jr_id,
+				coalesce(sg_date,jr_date) as real_date,
+				to_char(coalesce(sg_date,jr_date),'DD.MM.YY') as cdate
+			from stock_goods as sg
+			join stock_repository as sr on (sg.r_id=3Dsr.r_id)
+			left join jrnx as jx on (sg.j_id=3Djx.j_id)
+			left join jrn as j on (j.jr_grpt_id=3Djx.j_grpt)";
+		$where =3D "";
+		$and =3D "";
+		$clause =3D "";
+		if (isset($p_array['wdate_start']) && $p_array['wdate_start'] !=3D '')
+		{
+			$where =3D "where ";
+			$clause =3D " to_date('" . sql_string($p_array['wdate_start']) . "','=
DD.MM.YYYY')<=3Dcoalesce(sg_date,jr_date) ";
+			$and =3D " and ";
+		}
+		if (isset($p_array['wdate_end']) && $p_array['wdate_end'] !=3D '')
+		{
+			$where =3D "where ";
+			$clause.=3D$and . " to_date('" . sql_string($p_array['wdate_end']) . =
"','DD.MM.YYYY')>=3Dcoalesce(sg_date,jr_date) ";
+			$and =3D " and ";
+		}
+		if (isset($p_array['wamount_start']) && $p_array['wamount_start'] !=3D=
 '' && isNumber($p_array['wamount_start']) =3D=3D 1)
+		{
+			$where =3D "where ";
+			$clause.=3D$and . " j_montant >=3D " . sql_string($p_array['wamount_s=
tart']);
+			$and =3D " and ";
+		}
+		if (isset($p_array['wamount_end'])
+				&& $p_array['wamount_end'] !=3D ''
+				&& $p_array['wamount_end'] !=3D 0
+				&& isNumber($p_array['wamount_end']) =3D=3D 1)
+		{
+			$where =3D "where ";
+			$clause.=3D$and . " j_montant <=3D " . sql_string($p_array['wamount_e=
nd']);
+			$and =3D " and ";
+		}
+		if (isset($p_array['wcard']) && $p_array['wcard'] !=3D '')
+		{
+			$f =3D new Fiche($this->cn);
+			$f->get_by_qcode($p_array['wcard'], false);
+			if ($f->id !=3D 0)
+			{
+				$where =3D "where ";
+				$clause.=3D$and . " sg.f_id =3D  " . sql_string($f->id);
+				$and =3D " and ";
+			}
+		}
+		if (isset($p_array['wcode_stock']) && $p_array['wcode_stock'] !=3D "")
+		{
+			$where =3D "where ";
+			$clause.=3D$and . " upper(sg_code) =3D  upper('" . sql_string($p_arra=
y['wcode_stock']) . "')";
+			$and =3D " and ";
+		}
+		if (isset($p_array['wrepo']) && $p_array['wrepo'] !=3D -1)
+		{
+			$where =3D "where ";
+			$clause.=3D$and . " sg.r_id =3D " . sql_string($p_array['wrepo']);
+			$and =3D " and ";
+		}
+		if (isset($p_array['wdirection']) && $p_array['wdirection'] !=3D -1)
+		{
+			$where =3D "where ";
+			$clause.=3D$and . " sg.sg_type =3D '" . sql_string($p_array['wdirecti=
on']) . "'";
+			$and =3D " and ";
+		}
+		return $sql . $where . $clause;
+	}
+
+}
+
+?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 16 19:51:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sg2lw-0001J0-Bi
	for mharc-phpcompta-dev@gnu.org; Sat, 16 Jun 2012 19:51:16 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 17 Jun 2012 01:42:19 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.200141.1339890675.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4918 - in phpcompta/trunk: contrib/document_test
	include include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 16 Jun 2012 23:51:14 -0000

Author: danydb
Date: 2012-06-17 01:42:17 +0200 (Sun, 17 Jun 2012)
New Revision: 4918

Added:
   phpcompta/trunk/contrib/document_test/all_tags.odt
   phpcompta/trunk/include/stock_state.inc.php
   phpcompta/trunk/include/template/stock_summary.php
Modified:
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/include/class_user.php
   phpcompta/trunk/sql/upgrade.sql
Log:
Start Stock_Summary

Added: phpcompta/trunk/contrib/document_test/all_tags.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)


Property changes on: phpcompta/trunk/contrib/document_test/all_tags.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-16 19:02:45 UTC (rev =
4917)
+++ phpcompta/trunk/include/class_stock.php	2012-06-16 23:42:17 UTC (rev =
4918)
@@ -406,6 +406,53 @@
 		return $sql . $where . $clause;
 	}
=20
+	function summary($p_array)
+	{
+		global $cn, $g_user;
+		$tmp_id=3D$cn->get_next_seq("public.tmp_stockgood_s_id_seq");
+		$cn->exec_sql("delete from tmp_stockgood where s_date < now() - interv=
al '2 hours' ");
+		$cn->exec_sql("insert into tmp_stockgood(s_id) values ($1)",array($tmp=
_id));
+
+		// get all readable repository
+		$a_repository=3D$g_user->get_available_repository('R');
+
+		// All the stock card
+		$sql_repo_detail=3D"
+			insert into tmp_stockgood_detail(s_id,sg_code,s_qin,s_qout,r_id)
+
+		with fiche_stock as (select distinct ad_value from fiche_detail where =
ad_id=3D19 and coalesce(ad_value,'') !=3D '') ,
+				stock_in as (select coalesce(sum(sg_quantity),0) as qin,r_id,sg_code=
 from stock_goods where sg_type=3D'c'
+				and (
+					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D '2010-12-31')
+					or sg_tech_date <=3D '2010-12-31')
+				)
+				group by r_id,sg_code) ,
+				stock_out as	(select coalesce(sum(sg_quantity),0) as qout ,r_id,sg_c=
ode from stock_goods
+				where sg_type=3D'd'
+				and (
+					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D '2010-12-31')
+					or sg_tech_date <=3D '2010-12-31')
+				)
+				group by r_id,sg_code)
+				select distinct
+					$tmp_id,
+					coalesce(si.sg_code,so.sg_code),
+					coalesce(qin,0) as qin,
+					coalesce(qout,0) as qout,
+					sg.r_id
+					from
+					stock_goods as sg
+					left join stock_in as si on ( sg.r_id=3Dsi.r_id)
+					full join stock_out as so on (si.sg_code=3Dso.sg_code and sg.r_id=3D=
so.r_id)
+				where
+				si.sg_code is not null or so.sg_code is not null
+				 and sg.r_id  in (select r_id from user_sec_repository where p_id=3D=
$1)
+
+			";
+		$cn->exec_sql($sql_repo_detail,array($g_user->get_profile()));
+		$a_code=3D$cn->get_array("select distinct sg_code from tmp_stockgood_d=
etail where s_id=3D$1",array($tmp_id));
+		require_once 'template/stock_summary.php' ;
+	}
 }
=20
 ?>

Modified: phpcompta/trunk/include/class_user.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_user.php	2012-06-16 19:02:45 UTC (rev 4=
917)
+++ phpcompta/trunk/include/class_user.php	2012-06-16 23:42:17 UTC (rev 4=
918)
@@ -788,7 +788,40 @@
=20
 		return $isAdmin;
 	}
-
+	/**
+	 *@brief return array of available repository
+	 *
+	 * @param $p_access  R for read W for write
+	 * @return an array
+	 */
+	function get_available_repository($p_access=3D'R')
+	{
+		 $profile=3D$this->get_profile();
+		 $r=3Darray();
+		if ($p_access=3D=3D'R')
+		{
+			$r=3D$this->db->get_array("select u.r_id,r_name
+                from
+					user_sec_repository as u
+					join stock_repository as s on(u.r_id=3Ds.r_id)
+                where
+                p_id =3D$1
+                and ur_right=3D'W'
+				order by 2
+				",array($profile));
+		}
+		if ($p_access =3D=3D 'W')
+		{
+			 $r=3D$this->db->get_array("select u.r_id,r_name
+                from
+					user_sec_repository as u
+					join stock_repository as s on(u.r_id=3Ds.r_id)
+                where
+                p_id =3D$1 order by 2
+               ",array($profile));
+		}
+		return $r;
+	}
 	/* !
 	 * \brief return an array with all the users who can access $p_dossier =
including the global admin. The user
 	 * must be activated
@@ -1072,10 +1105,10 @@
         {
             $profile=3D$this->get_profile();
             $r=3D$this->db->get_value("select count(*)
-                from user_sec_repository=20
-                where=20
+                from user_sec_repository
+                where
                 r_id=3D$1
-                and p_id =3D$2=20
+                and p_id =3D$2
                 and ur_right=3D'W'",array($p_repo,$profile));
             if ( $r=3D=3D0)
                 return false;
@@ -1090,10 +1123,10 @@
         {
             $profile=3D$this->get_profile();
             $r=3D$this->db->get_value("select count(*)
-                from user_sec_repository=20
-                where=20
+                from user_sec_repository
+                where
                 r_id=3D$1
-                and p_id =3D$2=20
+                and p_id =3D$2
                ",array($p_repo,$profile));
             if ( $r=3D=3D0)
                 return false;

Added: phpcompta/trunk/include/stock_state.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_state.inc.php	                        (=
rev 0)
+++ phpcompta/trunk/include/stock_state.inc.php	2012-06-16 23:42:17 UTC (=
rev 4918)
@@ -0,0 +1,36 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show the state of the repository
+ *
+ */
+global $cn,$g_parameter,$g_user;
+require_once 'class_stock.php';
+
+$stock=3Dnew Stock();
+
+$stock->summary($_GET);
+
+?>

Added: phpcompta/trunk/include/template/stock_summary.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary.php	                  =
      (rev 0)
+++ phpcompta/trunk/include/template/stock_summary.php	2012-06-16 23:42:1=
7 UTC (rev 4918)
@@ -0,0 +1,133 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show State of the stock
+ *
+ */
+?>
+<div class=3D"content">
+<table class=3D"result">
+	<tr>
+		<th>
+			Code Stock
+		</th>
+		<? for ($i =3D 0; $i < count($a_repository); $i++):?>
+			<th>
+				<?=3Dh( $a_repository[$i]['r_name'])?>
+			</th>
+		<? endfor;?>
+			<th>
+				Total
+			</th>
+	</tr>
+	<?
+	for ($x =3D 0; $x < count($a_code); $x++):
+		$class=3D($x%2=3D=3D0)?' class=3D"odd" ':' class=3D"even" ';
+		?>
+
+		<tr <?=3D$class?> >
+			<td>
+				<?=3D $a_code[$x]['sg_code']?>
+			</td>
+			<?
+			$n_in=3D0;$n_out=3D0;
+			for ($e =3D 0; $e < count($a_repository); $e++):
+
+				$array =3D $cn->get_array("select * from tmp_stockgood_detail where =
r_id=3D$1 and sg_code=3D$2", array($a_repository[$e]['r_id'], $a_code[$x]=
['sg_code']));
+				?>
+			<td>
+				<?
+					if (count($array)=3D=3D0):
+						echo 0;
+					else:
+						$n_in+=3D$array[0]['s_qin'];
+						$n_out+=3D$array[0]['s_qout'];
+						?>
+						<table>
+							<tr>
+								<td>
+									IN  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($array[0]['s_qin'])?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									OUT  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($array[0]['s_qout'])?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									DIFF  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm((bcsub($array[0]['s_qin'],$array[0]['s_qout'])))?>
+								</td>
+							</tr>
+						</table>
+						<?
+					endif;
+				?>
+ 			</td>
+				<?
+			endfor;  // loop e
+			?>
+			<td>
+<table>
+							<tr>
+								<td>
+									IN  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($n_in)?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									OUT  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($n_out)?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									DIFF  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm((bcsub($n_in,$n_out)))?>
+								</td>
+							</tr>
+						</table>
+			</td>
+		</tr>
+		<?
+	endfor; // loop x
+	?>
+</table>
+</div>
\ No newline at end of file

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-16 19:02:45 UTC (rev 4917)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-16 23:42:17 UTC (rev 4918)
@@ -320,4 +320,8 @@
=20
 drop function migrate_stock();
=20
-update attr_def set ad_type=3D'card', ad_extra=3D'[sql] fd_id =3D 500000=
 ' where ad_id=3D19;
\ No newline at end of file
+update attr_def set ad_type=3D'card', ad_extra=3D'[sql] fd_id =3D 500000=
 ' where ad_id=3D19;
+
+create table tmp_stockgood (s_id bigserial primary key,s_date timestamp =
default now());
+create table tmp_stockgood_detail(d_id bigserial primary key,s_id bigint=
 references tmp_stockgood(s_id) on delete cascade,
+sg_code text,s_qin numeric(20,4),s_qout numeric(20,4),r_id bigint);
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 04:05:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgWxT-00072M-V1
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 04:05:11 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 09:56:07 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202531.1340006710.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4919 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 08:05:10 -0000

Author: danydb
Date: 2012-06-18 09:56:06 +0200 (Mon, 18 Jun 2012)
New Revision: 4919

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/action_search.php
Log:
0000630: Action - Gestion : recherche date de rappel : interval

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-16 23:42:17 UTC=
 (rev 4918)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-18 07:56:06 UTC=
 (rev 4919)
@@ -194,7 +194,7 @@
 	Follow_Up::ShowActionList($cn, $base);
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
-	echo HtmlInput::request_to_hidden(array("remind_date","sag_ref", "remin=
d_date","only_internal", "state", "gDossier", "qcode", "start_date", "end=
_date", "ag_id", "ag_dest_query",
+	echo HtmlInput::request_to_hidden(array("remind_date_end","remind_date"=
,"sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", =
"start_date", "end_date", "ag_id", "ag_dest_query",
 		"tdoc", "see_all", "all_action", "query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-06-16 23:42:17 UTC (rev 4=
918)
+++ phpcompta/trunk/include/action.inc.php	2012-06-18 07:56:06 UTC (rev 4=
919)
@@ -23,7 +23,8 @@
  */
 require_once('class_ipopup.php');
 global $g_user;
-$retour=3DHtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_=
to_string(array("remind_date","sag_ref","only_internal","state","ac","gDo=
ssier","qcode","ag_dest_query","query","tdoc","date_start","date_end","se=
e_all","all_action")).'&my_action');
+$retour=3DHtmlInput::button_anchor(_('Retour liste'),
+		HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","q=
uery","tdoc","date_start","date_end","see_all","all_action")).'&my_action=
');
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-16 23:42:17 UTC (=
rev 4918)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-18 07:56:06 UTC (=
rev 4919)
@@ -498,7 +498,7 @@
 		/* add the number of item */
 		$Hid =3D new IHidden();
 		$r.=3D$Hid->input("nb_item", MAX_ARTICLE);
-		$r.=3DHtmlInput::request_to_hidden(array("remind_date","sag_ref","only=
_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start=
", "date_end", "see_all", "all_action"));
+		$r.=3DHtmlInput::request_to_hidden(array("remind_date_end","remind_dat=
e","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "=
tdoc", "date_start", "date_end", "see_all", "all_action"));
 		/* get template */
 		ob_start();
 		require_once 'template/detail-action.php';
@@ -671,7 +671,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("remind_date","sag_ref","only_=
internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start"=
, "date_end", "see_all", "all_action")) . '&' . $p_base;
+		$url =3D HtmlInput::get_to_string(array("remind_date_end","remind_date=
","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "t=
doc", "date_start", "date_end", "see_all", "all_action")) . '&' . $p_base=
;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -743,7 +743,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("remind_date","sag_ref","only_internal","state","=
gDossier", "qcode", "ag_dest_query", "query", "tdoc", "date_start", "date=
_end", "see_all", "ac", "all_action"),"&") . '&sa=3Ddetail&ag_id=3D' . $r=
ow['ag_id'] . '">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("remind_date_end","remind_date","sag_ref","only_i=
nternal","state","gDossier", "qcode", "ag_dest_query", "query", "tdoc", "=
date_start", "date_end", "see_all", "ac", "all_action"),"&") . '&sa=3Ddet=
ail&ag_id=3D' . $row['ag_id'] . '">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1156,6 +1156,8 @@
 		$osag_ref->value=3D(isset($_GET['sag_ref']))?$_GET['sag_ref']:"";
 		$remind_date=3Dnew IDate('remind_date');
 		$remind_date->value=3D(isset($_GET['remind_date']))?$_GET['remind_date=
']:"";
+		$remind_date_end=3Dnew IDate('remind_date_end');
+		$remind_date_end->value=3D(isset($_GET['remind_date_end']))?$_GET['rem=
ind_date_end']:"";
 		// show the  action in
 		require_once 'template/action_search.php';
 	}
@@ -1257,8 +1259,12 @@
 		}
 		if ( isset($remind_date) && $remind_date !=3D "" && isDate($remind_dat=
e)=3D=3D$remind_date)
 		{
-			$query =3D " and to_char(ag_remind_date,'DD.MM.YYYY')=3D '".sql_strin=
g($remind_date)."'";
+			$query .=3D " and to_date('".sql_string($remind_date)."','DD.MM.YYYY'=
)<=3D ag_remind_date";
 		}
+		if ( isset($remind_date_end) && $remind_date_end !=3D "" && isDate($re=
mind_date_end)=3D=3D$remind_date_end)
+		{
+			$query .=3D " and to_date('".sql_string($remind_date_end)."','DD.MM.Y=
YYY')>=3D ag_remind_date";
+		}
 		return $query . $str;
 	}
=20

Modified: phpcompta/trunk/include/template/action_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search.php	2012-06-16 23:42:1=
7 UTC (rev 4918)
+++ phpcompta/trunk/include/template/action_search.php	2012-06-18 07:56:0=
6 UTC (rev 4919)
@@ -48,11 +48,17 @@
 		<?=3D dossier::hidden()?>
 		<table style=3D"width:100%">
 			<tr>
-				<td style=3D"width:180px;text-align:right"> Date de rappel</td>
+				<td style=3D"width:180px;text-align:right"> Date de rappel apr=C3=A8=
s</td>
 				<td>
 					<?=3D$remind_date->input();?>
 				</td>
 			<tr>
+			<tr>
+				<td style=3D"width:180px;text-align:right"> Date de rappel avant</td=
>
+				<td>
+					<?=3D$remind_date_end->input();?>
+				</td>
+			<tr>
 			<td style=3D"width:180px;text-align:right"> R=C3=A9f=C3=A9rence</td>
 				<td>
 					<?=3D$osag_ref->input();?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 05:31:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgYIc-0002jo-7a
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 05:31:06 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 11:21:59 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202656.1340011865.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4920 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 09:31:04 -0000

Author: danydb
Date: 2012-06-18 11:21:59 +0200 (Mon, 18 Jun 2012)
New Revision: 4920

Added:
   phpcompta/trunk/include/template/stock_state_search.php
   phpcompta/trunk/include/template/stock_summary_table.php
Modified:
   phpcompta/trunk/include/template/stock_summary.php
Log:
Template for STOCK_STATE

Added: phpcompta/trunk/include/template/stock_state_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_state_search.php	             =
           (rev 0)
+++ phpcompta/trunk/include/template/stock_state_search.php	2012-06-18 09=
:21:59 UTC (rev 4920)
@@ -0,0 +1,51 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show the form for State of stock
+ *
+ */
+?>
+<form method=3D"GET">
+	<?=3DHtmlInput::get_to_hidden(array("gDossier","ac"));?>
+	<table>
+		<tr>
+			<td>
+				Exercice
+			</td>
+			<td>
+				<?=3D$iexercice->input()?>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				Pr=C3=A9sentation
+			</td>
+			<td>
+				<?=3D$presentation->input()?>
+			</td>
+		</tr>
+	</table>
+	<?=3DHtmlInput::submit('sfilter','Filtrer')?>
+</form>
\ No newline at end of file

Modified: phpcompta/trunk/include/template/stock_summary.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary.php	2012-06-18 07:56:0=
6 UTC (rev 4919)
+++ phpcompta/trunk/include/template/stock_summary.php	2012-06-18 09:21:5=
9 UTC (rev 4920)
@@ -48,7 +48,7 @@
=20
 		<tr <?=3D$class?> >
 			<td>
-				<?=3D $a_code[$x]['sg_code']?>
+				<?=3DHtmlInput::card_detail($a_code[$x]['sg_code'])?>
 			</td>
 			<?
 			$n_in=3D0;$n_out=3D0;

Copied: phpcompta/trunk/include/template/stock_summary_table.php (from re=
v 4919, phpcompta/trunk/include/template/stock_summary.php)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary_table.php	            =
            (rev 0)
+++ phpcompta/trunk/include/template/stock_summary_table.php	2012-06-18 0=
9:21:59 UTC (rev 4920)
@@ -0,0 +1,133 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show State of the stock
+ *
+ */
+?>
+<div class=3D"content">
+<table class=3D"result">
+	<tr>
+		<th>
+			Code Stock
+		</th>
+		<? for ($i =3D 0; $i < count($a_repository); $i++):?>
+			<th>
+				<?=3Dh( $a_repository[$i]['r_name'])?>
+			</th>
+		<? endfor;?>
+			<th>
+				Total
+			</th>
+	</tr>
+	<?
+	for ($x =3D 0; $x < count($a_code); $x++):
+		$class=3D($x%2=3D=3D0)?' class=3D"odd" ':' class=3D"even" ';
+		?>
+
+		<tr <?=3D$class?> >
+			<td>
+				<?=3DHtmlInput::card_detail($a_code[$x]['sg_code'])?>
+			</td>
+			<?
+			$n_in=3D0;$n_out=3D0;
+			for ($e =3D 0; $e < count($a_repository); $e++):
+
+				$array =3D $cn->get_array("select * from tmp_stockgood_detail where =
r_id=3D$1 and sg_code=3D$2", array($a_repository[$e]['r_id'], $a_code[$x]=
['sg_code']));
+				?>
+			<td>
+				<?
+					if (count($array)=3D=3D0):
+						echo 0;
+					else:
+						$n_in+=3D$array[0]['s_qin'];
+						$n_out+=3D$array[0]['s_qout'];
+						?>
+						<table>
+							<tr>
+								<td>
+									IN  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($array[0]['s_qin'])?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									OUT  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($array[0]['s_qout'])?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									DIFF  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm((bcsub($array[0]['s_qin'],$array[0]['s_qout'])))?>
+								</td>
+							</tr>
+						</table>
+						<?
+					endif;
+				?>
+ 			</td>
+				<?
+			endfor;  // loop e
+			?>
+			<td>
+<table>
+							<tr>
+								<td>
+									IN  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($n_in)?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									OUT  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm($n_out)?>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									DIFF  :
+								</td>
+								<td class=3D"num">
+									<?=3Dnbm((bcsub($n_in,$n_out)))?>
+								</td>
+							</tr>
+						</table>
+			</td>
+		</tr>
+		<?
+	endfor; // loop x
+	?>
+</table>
+</div>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 05:31:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgYJO-0002o6-EV
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 05:31:54 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 11:22:48 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202657.1340011913.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4921 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 09:31:53 -0000

Author: danydb
Date: 2012-06-18 11:22:47 +0200 (Mon, 18 Jun 2012)
New Revision: 4921

Removed:
   phpcompta/trunk/include/template/stock_summary.php
Log:
obsolete : file rename to stock_summary_table

Deleted: phpcompta/trunk/include/template/stock_summary.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary.php	2012-06-18 09:21:5=
9 UTC (rev 4920)
+++ phpcompta/trunk/include/template/stock_summary.php	2012-06-18 09:22:4=
7 UTC (rev 4921)
@@ -1,133 +0,0 @@
-<?php
-/*
- *   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 b=
y
- *   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-130=
7  USA
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/**
- * @file
- * @brief show State of the stock
- *
- */
-?>
-<div class=3D"content">
-<table class=3D"result">
-	<tr>
-		<th>
-			Code Stock
-		</th>
-		<? for ($i =3D 0; $i < count($a_repository); $i++):?>
-			<th>
-				<?=3Dh( $a_repository[$i]['r_name'])?>
-			</th>
-		<? endfor;?>
-			<th>
-				Total
-			</th>
-	</tr>
-	<?
-	for ($x =3D 0; $x < count($a_code); $x++):
-		$class=3D($x%2=3D=3D0)?' class=3D"odd" ':' class=3D"even" ';
-		?>
-
-		<tr <?=3D$class?> >
-			<td>
-				<?=3DHtmlInput::card_detail($a_code[$x]['sg_code'])?>
-			</td>
-			<?
-			$n_in=3D0;$n_out=3D0;
-			for ($e =3D 0; $e < count($a_repository); $e++):
-
-				$array =3D $cn->get_array("select * from tmp_stockgood_detail where =
r_id=3D$1 and sg_code=3D$2", array($a_repository[$e]['r_id'], $a_code[$x]=
['sg_code']));
-				?>
-			<td>
-				<?
-					if (count($array)=3D=3D0):
-						echo 0;
-					else:
-						$n_in+=3D$array[0]['s_qin'];
-						$n_out+=3D$array[0]['s_qout'];
-						?>
-						<table>
-							<tr>
-								<td>
-									IN  :
-								</td>
-								<td class=3D"num">
-									<?=3Dnbm($array[0]['s_qin'])?>
-								</td>
-							</tr>
-							<tr>
-								<td>
-									OUT  :
-								</td>
-								<td class=3D"num">
-									<?=3Dnbm($array[0]['s_qout'])?>
-								</td>
-							</tr>
-							<tr>
-								<td>
-									DIFF  :
-								</td>
-								<td class=3D"num">
-									<?=3Dnbm((bcsub($array[0]['s_qin'],$array[0]['s_qout'])))?>
-								</td>
-							</tr>
-						</table>
-						<?
-					endif;
-				?>
- 			</td>
-				<?
-			endfor;  // loop e
-			?>
-			<td>
-<table>
-							<tr>
-								<td>
-									IN  :
-								</td>
-								<td class=3D"num">
-									<?=3Dnbm($n_in)?>
-								</td>
-							</tr>
-							<tr>
-								<td>
-									OUT  :
-								</td>
-								<td class=3D"num">
-									<?=3Dnbm($n_out)?>
-								</td>
-							</tr>
-							<tr>
-								<td>
-									DIFF  :
-								</td>
-								<td class=3D"num">
-									<?=3Dnbm((bcsub($n_in,$n_out)))?>
-								</td>
-							</tr>
-						</table>
-			</td>
-		</tr>
-		<?
-	endfor; // loop x
-	?>
-</table>
-</div>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 06:16:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgZ10-00048m-TI
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 06:16:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 12:07:54 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202813.1340014618.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4922 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 10:16:57 -0000

Author: danydb
Date: 2012-06-18 12:07:54 +0200 (Mon, 18 Jun 2012)
New Revision: 4922

Added:
   phpcompta/trunk/include/template/stock_summary_list.php
Modified:
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/include/stock_state.inc.php
   phpcompta/trunk/include/template/stock_summary_table.php
Log:
0000618: Affichage des stocks

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-18 09:22:47 UTC (rev =
4921)
+++ phpcompta/trunk/include/class_stock.php	2012-06-18 10:07:54 UTC (rev =
4922)
@@ -423,15 +423,15 @@
 		with fiche_stock as (select distinct ad_value from fiche_detail where =
ad_id=3D19 and coalesce(ad_value,'') !=3D '') ,
 				stock_in as (select coalesce(sum(sg_quantity),0) as qin,r_id,sg_code=
 from stock_goods where sg_type=3D'c'
 				and (
-					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D '2010-12-31')
-					or sg_tech_date <=3D '2010-12-31')
+					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D to_date($2,'DD.MM.YYYY'))
+					or sg_tech_date <=3D to_date($2,'DD.MM.YYYY'))
 				)
 				group by r_id,sg_code) ,
 				stock_out as	(select coalesce(sum(sg_quantity),0) as qout ,r_id,sg_c=
ode from stock_goods
 				where sg_type=3D'd'
 				and (
-					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D '2010-12-31')
-					or sg_tech_date <=3D '2010-12-31')
+					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D to_date($2,'DD.MM.YYYY'))
+					or sg_tech_date <=3D to_date($2,'DD.MM.YYYY'))
 				)
 				group by r_id,sg_code)
 				select distinct
@@ -449,9 +449,34 @@
 				 and sg.r_id  in (select r_id from user_sec_repository where p_id=3D=
$1)
=20
 			";
-		$cn->exec_sql($sql_repo_detail,array($g_user->get_profile()));
+
+		// Build condition
+		$end_date=3D$cn->get_value("select to_char(max(p_end),'DD.MM.YYYY') fr=
om parm_periode");
+		if (isset($p_array['state_exercice']))
+		{
+			if ( isDate($p_array['state_exercice'])=3D=3D$p_array['state_exercice=
'])
+			{
+				$end_date=3D$p_array['state_exercice'];
+			}
+		}
+		$cn->exec_sql($sql_repo_detail,array($g_user->get_profile(),$end_date)=
);
 		$a_code=3D$cn->get_array("select distinct sg_code from tmp_stockgood_d=
etail where s_id=3D$1",array($tmp_id));
-		require_once 'template/stock_summary.php' ;
+		if (isset($p_array['present']))
+		{
+			$present=3D$p_array['present'];
+		}
+		else
+		{
+			$present=3D'T';
+		}
+		if ($present =3D=3D 'T')
+		{
+			require_once 'template/stock_summary_table.php' ;
+		}
+		if ($present=3D=3D'L')
+		{
+			require_once 'template/stock_summary_list.php';
+		}
 	}
 }
=20

Modified: phpcompta/trunk/include/stock_state.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_state.inc.php	2012-06-18 09:22:47 UTC (=
rev 4921)
+++ phpcompta/trunk/include/stock_state.inc.php	2012-06-18 10:07:54 UTC (=
rev 4922)
@@ -29,8 +29,24 @@
 global $cn,$g_parameter,$g_user;
 require_once 'class_stock.php';
=20
+// Show the form
+// Get by exercice
+// Get type =3D table or list
+$iexercice=3Dnew ISelect('state_exercice');
+$iexercice->value=3D$cn->make_array("select  max(p_end) as date_end, p_e=
xercice from parm_periode  group by p_exercice order by 2 desc");
+$iexercice->selected=3D(isset($_GET['state_exercice']))?$_GET['state_exe=
rcice']:"";
+
+$presentation=3Dnew ISelect("present");
+$presentation->value=3Darray (
+		array("value"=3D>"T","label"=3D>"Tableau r=C3=A9capitulatif"),
+		array("value"=3D>"L","label"=3D>"Liste")
+);
+$presentation->selected=3D(isset($_GET['present']))?$_GET['present']:"T"=
;
+require_once 'template/stock_state_search.php';
+
 $stock=3Dnew Stock();
=20
+
 $stock->summary($_GET);
=20
 ?>

Added: phpcompta/trunk/include/template/stock_summary_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary_list.php	             =
           (rev 0)
+++ phpcompta/trunk/include/template/stock_summary_list.php	2012-06-18 10=
:07:54 UTC (rev 4922)
@@ -0,0 +1,99 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show the result to stock state in list format (more detailled)
+ *
+ */
+$a_repo=3D$cn->get_array("select distinct t.r_id,r_name,r_adress,r_count=
ry from stock_repository as s join tmp_stockgood_detail as t
+	on (s.r_id=3Dt.r_id)
+	where
+	s_id=3D$1
+	order by 2
+	",array($tmp_id));
+?>
+<? for ($r=3D0;$r<count($a_repo);$r++):?>
+<h1><?=3D$a_repo[$r]['r_name']?></h1>
+<p><?=3D$a_repo[$r]['r_adress']?></p>
+<p><?=3D$a_repo[$r]['r_country']?></p>
+<table class=3D"result">
+	<tr>
+		<th>Code</th>
+		<th>D=C3=A9tail</th>
+		<th style=3D"text-align: right">IN</th>
+		<th style=3D"text-align: right">OUT</th>
+		<th style=3D"text-align: right">En Stock</th>
+	</tr>
+	<?
+		$a_stock=3D$cn->get_array(
+				"
+					select coalesce(sum(s_qin),0) as qin,coalesce(sum(s_qout),0) as qou=
t,sg_code
+						from tmp_stockgood_detail  where r_id=3D$1 and s_id=3D$2
+						group by sg_code
+						order by sg_code
+
+					",array($a_repo[$r]['r_id'],$tmp_id));
+		for ($s=3D0;$s<count($a_stock);$s++):
+			$a_card=3D$cn->get_array(
+					"
+						select f_id,vw_name,quick_code
+						from vw_fiche_attr
+						where
+					 f_id in (
+						select distinct f_id from fiche_detail
+							where
+							ad_id=3D19 and
+							ad_value=3D$1)
+						order by vw_name,quick_code
+					",array($a_stock[$s]['sg_code']));
+	?>
+	<tr>
+		<td>
+			<?=3DHtmlInput::card_detail($a_stock[$s]['sg_code'])?>
+		</td>
+		<td>
+			<?
+				$sep=3D"";
+				for ( $c=3D0;$c<count($a_card);$c++):
+					echo $sep.HtmlInput::card_detail($a_card[$c]['quick_code'], $a_card=
[$c]['vw_name'], ' class=3D"line" ');
+					$sep=3D"  ,";
+				endfor;
+				if ( count($a_card)=3D=3D 0 ) echo '<span class=3D"notice"> Erreur C=
ode non utilis=C3=A9 </span>';
+			?>
+		</td>
+		<td class=3D"num">
+			<?=3Dnbm($a_stock[$s]['qin'])?>
+		</td>
+		<td class=3D"num">
+			<?=3Dnbm($a_stock[$s]['qout'])?>
+
+		</td>
+		<td class=3D"num">
+			<?=3Dnbm(bcsub($a_stock[$s]['qin'],$a_stock[$s]['qout']))?>
+		</td>
+	</tr>
+<? endfor; ?>
+</table>
+<? endfor; ?>
+

Modified: phpcompta/trunk/include/template/stock_summary_table.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary_table.php	2012-06-18 0=
9:22:47 UTC (rev 4921)
+++ phpcompta/trunk/include/template/stock_summary_table.php	2012-06-18 1=
0:07:54 UTC (rev 4922)
@@ -54,7 +54,8 @@
 			$n_in=3D0;$n_out=3D0;
 			for ($e =3D 0; $e < count($a_repository); $e++):
=20
-				$array =3D $cn->get_array("select * from tmp_stockgood_detail where =
r_id=3D$1 and sg_code=3D$2", array($a_repository[$e]['r_id'], $a_code[$x]=
['sg_code']));
+				$array =3D $cn->get_array("select * from tmp_stockgood_detail where =
r_id=3D$1 and sg_code=3D$2 and s_id=3D$3"
+						, array($a_repository[$e]['r_id'], $a_code[$x]['sg_code'],$tmp_id)=
);
 				?>
 			<td>
 				<?



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 06:17:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgZ1h-0004L2-1m
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 06:17:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 12:08:37 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202821.1340014660.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4923 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 10:17:40 -0000

Author: danydb
Date: 2012-06-18 12:08:37 +0200 (Mon, 18 Jun 2012)
New Revision: 4923

Modified:
   phpcompta/trunk/include/category_followup.inc.php
Log:
Interval pour date rappel, bug

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-18 10:07:54=
 UTC (rev 4922)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-18 10:08:37=
 UTC (rev 4923)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("remind_date","sag_ref","only_inter=
nal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","da=
te_end","see_all","all_action","sb","sc"),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc=
","date_start","date_end","see_all","all_action","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 06:26:22 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgZA6-0001S3-0H
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 06:26:22 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 12:17:22 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202842.1340015181.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4924 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 10:26:20 -0000

Author: danydb
Date: 2012-06-18 12:17:22 +0200 (Mon, 18 Jun 2012)
New Revision: 4924

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
0000624: Ajouter menu STOCK dans GESTION

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-18 10:08:37 UTC (rev 4923)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-18 10:17:22 UTC (rev 4924)
@@ -220,6 +220,8 @@
=20
 INSERT INTO profile_menu(me_code, me_code_dep, p_id, p_order, p_type_dis=
play, pm_default)
     VALUES ('CFGSTOCK', 'PARAM', 1, 40, 'E', 0);
+update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
+update profile_menu set me_code_dep=3D'COMPTA' where me_code=3D'STOCK' a=
nd me_code_dep=3D'ADV';
=20
 CREATE TABLE stock_repository
 (



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 07:46:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgaPh-0007BO-0W
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 07:46:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 13:37:26 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202990.1340019992.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4925 - in phpcompta/trunk: html include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 11:46:32 -0000

Author: danydb
Date: 2012-06-18 13:37:26 +0200 (Mon, 18 Jun 2012)
New Revision: 4925

Modified:
   phpcompta/trunk/html/export.php
   phpcompta/trunk/html/style-print.css
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/include/template/stock_summary_list.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000633: export en CSV des mouvement des stocks
0000634: export en CSV de la liste des stocks

Modified: phpcompta/trunk/html/export.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/export.php	2012-06-18 10:17:22 UTC (rev 4924)
+++ phpcompta/trunk/html/export.php	2012-06-18 11:37:26 UTC (rev 4925)
@@ -164,6 +164,12 @@
   case 'CSV:ActionGestion':
 	  require_once 'export_follow_up_csv.php';
 	  break;
+	case 'CSV:StockHisto': // Export Historique mouvement stock
+		require_once 'export_stock_histo.csv';
+		break;
+	case 'CSV:StockResmList' : // 'Export R=C3=A9sum=C3=A9 list stock
+		require_once 'export_stock_resume_list.php';
+		break;
    default:
     alert('Action inconnue '.$_GET['act']);
     exit();

Modified: phpcompta/trunk/html/style-print.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-print.css	2012-06-18 10:17:22 UTC (rev 492=
4)
+++ phpcompta/trunk/html/style-print.css	2012-06-18 11:37:26 UTC (rev 492=
5)
@@ -1,10 +1,10 @@
 body {
 	font-size:7pt
 	}
-select ,.input_text{=20
+select ,.input_text{
 border:1px solid #FFFFFF;
  }
-form {=20
+form {
   display:none;
  }
 .print {
@@ -13,7 +13,7 @@
 .noprint  {
   display:none;
  }
-=20
+
 .button {
 	display:none;
 	}
@@ -23,10 +23,10 @@
 table.result {
 	font-size:7pt;
 	font-family:sans-serif;
-
+	width:100%
   }
=20
-table.result th {=20
+table.result th {
 	font-size:7pt;
 	font-family:sans-serif;
 }
@@ -40,7 +40,7 @@
 	display:none;
 }
=20
-h2.info {
+h1,h2.info {
 	font-size:14pt;
 	font-weight:bold;
 	font-family:sans-serif;
@@ -97,7 +97,7 @@
 	font-family:sans-serif;
=20
 }
-div.redcontent{ 	=20
+div.redcontent{
 	font-size:7pt;
 	font-family:sans-serif;
 }
@@ -112,7 +112,7 @@
 table.mtitle {
 	display:	none;
 }
-td.mshort {=20
+td.mshort {
 	display:none;
 }
 td.mlltitle {
@@ -130,10 +130,10 @@
 span.mtitle {
 	display:none;
 }
-span.odd {=20
+span.odd {
 	display:none;
  }
-span.even {=20
+span.even {
 	display:none;
  }
=20
@@ -230,7 +230,7 @@
 font-family:sans-serif;
 }
=20
-a.detail:hover  =20
+a.detail:hover
 {
 	display:none;
 }

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-18 10:17:22 UTC (rev =
4924)
+++ phpcompta/trunk/include/class_stock.php	2012-06-18 11:37:26 UTC (rev =
4925)
@@ -251,16 +251,37 @@
=20
 		$max_row =3D Database::num_row($res);
=20
-		$nav_bar=3D  jrn_navigation_bar($offset,$max_row,0,$page);
+		$nav_bar =3D jrn_navigation_bar($offset, $max_row, 0, $page);
=20
-		if ( $step !=3D -1 ) $res =3D $this->cn->exec_sql($sql." , sg_id asc l=
imit ".$step." offset ".$offset);
+		if ($step !=3D -1)
+			$res =3D $this->cn->exec_sql($sql . " , sg_id asc limit " . $step . "=
 offset " . $offset);
 		$max_row =3D Database::num_row($res);
=20
 		$this->search_box_button();
 		$this->search_box($p_array);
 		require_once 'template/stock_histo.php';
+		$this->export_stock_histo_form();
+		echo HtmlInput::print_window();
 	}
=20
+	function export_stock_histo_form()
+	{
+		echo '<form style=3D"display:inline" method=3D"GET" action=3D"export.p=
hp">';
+		 echo HtmlInput::get_to_hidden(array("gDossier", "wcard", "wdate_start=
", "wdate_end", "wrepo",
+					"wamount_start", "wamount_end", "wcode_stock", "wdirection"));
+		 echo HtmlInput::hidden('act','CSV:StockHisto');
+		 echo HtmlInput::submit('stockhisto','Export CSV');
+		 echo '</form>';
+	}
+	function export_stock_summary_list_form()
+	{
+		echo '<form style=3D"display:inline"  method=3D"GET" action=3D"export.=
php">';
+		 echo HtmlInput::get_to_hidden(array("gDossier", "state_exercice"));
+		 echo HtmlInput::hidden('act','CSV:StockResmList');
+
+		 echo HtmlInput::submit('stockresm','Export CSV');
+		 echo '</form>';
+	}
 	function search_box_button()
 	{
 		$bt =3D HtmlInput::button("Recherche", "Recherche", ' onclick=3D"$(\'h=
isto_search_d\').show();"');
@@ -409,15 +430,42 @@
 	function summary($p_array)
 	{
 		global $cn, $g_user;
-		$tmp_id=3D$cn->get_next_seq("public.tmp_stockgood_s_id_seq");
-		$cn->exec_sql("delete from tmp_stockgood where s_date < now() - interv=
al '2 hours' ");
-		$cn->exec_sql("insert into tmp_stockgood(s_id) values ($1)",array($tmp=
_id));
+		$tmp_id=3D$this->build_tmp_table($p_array);
+		// Build condition
+		$a_repository =3D $g_user->get_available_repository('R');
+		$a_code =3D $cn->get_array("select distinct sg_code from tmp_stockgood=
_detail where s_id=3D$1", array($tmp_id));
+		if (isset($p_array['present']))
+		{
+			$present =3D $p_array['present'];
+		}
+		else
+		{
+			$present =3D 'T';
+		}
+		if ($present =3D=3D 'T')
+		{
+			require_once 'template/stock_summary_table.php';
+		}
+		if ($present =3D=3D 'L')
+		{
+			require_once 'template/stock_summary_list.php';
+			$this->export_stock_summary_list_form();
=20
+		}
+		echo HtmlInput::print_window();
+	}
+	function build_tmp_table($p_array)
+	{
+		global $cn,$g_user;
+		$tmp_id =3D $cn->get_next_seq("public.tmp_stockgood_s_id_seq");
+		$cn->exec_sql("delete from tmp_stockgood where s_date < now() - interv=
al '2 days' ");
+		$cn->exec_sql("insert into tmp_stockgood(s_id) values ($1)", array($tm=
p_id));
+
 		// get all readable repository
-		$a_repository=3D$g_user->get_available_repository('R');
+		$a_repository =3D $g_user->get_available_repository('R');
=20
 		// All the stock card
-		$sql_repo_detail=3D"
+		$sql_repo_detail =3D "
 			insert into tmp_stockgood_detail(s_id,sg_code,s_qin,s_qout,r_id)
=20
 		with fiche_stock as (select distinct ad_value from fiche_detail where =
ad_id=3D19 and coalesce(ad_value,'') !=3D '') ,
@@ -449,35 +497,19 @@
 				 and sg.r_id  in (select r_id from user_sec_repository where p_id=3D=
$1)
=20
 			";
-
-		// Build condition
-		$end_date=3D$cn->get_value("select to_char(max(p_end),'DD.MM.YYYY') fr=
om parm_periode");
+		$end_date =3D $cn->get_value("select to_char(max(p_end),'DD.MM.YYYY') =
from parm_periode");
 		if (isset($p_array['state_exercice']))
 		{
-			if ( isDate($p_array['state_exercice'])=3D=3D$p_array['state_exercice=
'])
+			if (isDate($p_array['state_exercice']) =3D=3D $p_array['state_exercic=
e'])
 			{
-				$end_date=3D$p_array['state_exercice'];
+				$end_date =3D $p_array['state_exercice'];
 			}
 		}
-		$cn->exec_sql($sql_repo_detail,array($g_user->get_profile(),$end_date)=
);
-		$a_code=3D$cn->get_array("select distinct sg_code from tmp_stockgood_d=
etail where s_id=3D$1",array($tmp_id));
-		if (isset($p_array['present']))
-		{
-			$present=3D$p_array['present'];
-		}
-		else
-		{
-			$present=3D'T';
-		}
-		if ($present =3D=3D 'T')
-		{
-			require_once 'template/stock_summary_table.php' ;
-		}
-		if ($present=3D=3D'L')
-		{
-			require_once 'template/stock_summary_list.php';
-		}
+		$cn->exec_sql($sql_repo_detail, array($g_user->get_profile(), $end_dat=
e));
+
+		return $tmp_id;
 	}
+
 }
=20
 ?>

Modified: phpcompta/trunk/include/template/stock_summary_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary_list.php	2012-06-18 10=
:17:22 UTC (rev 4924)
+++ phpcompta/trunk/include/template/stock_summary_list.php	2012-06-18 11=
:37:26 UTC (rev 4925)
@@ -26,17 +26,20 @@
  * @brief show the result to stock state in list format (more detailled)
  *
  */
-$a_repo=3D$cn->get_array("select distinct t.r_id,r_name,r_adress,r_count=
ry from stock_repository as s join tmp_stockgood_detail as t
+$a_repo=3D$cn->get_array("select distinct t.r_id,r_name,r_adress,r_city,=
r_country,r_phone from stock_repository as s join tmp_stockgood_detail as=
 t
 	on (s.r_id=3Dt.r_id)
 	where
 	s_id=3D$1
 	order by 2
 	",array($tmp_id));
 ?>
+<div class=3D"content">
 <? for ($r=3D0;$r<count($a_repo);$r++):?>
 <h1><?=3D$a_repo[$r]['r_name']?></h1>
-<p><?=3D$a_repo[$r]['r_adress']?></p>
-<p><?=3D$a_repo[$r]['r_country']?></p>
+<p>Adresse <?=3D$a_repo[$r]['r_adress']?></p>
+<p>Ville <?=3D$a_repo[$r]['r_city']?></p>
+<p>Pays <?=3D$a_repo[$r]['r_country']?></p>
+<p>T=C3=A9l=C3=A9phone <?=3D$a_repo[$r]['r_phone']?></p>
 <table class=3D"result">
 	<tr>
 		<th>Code</th>
@@ -97,3 +100,4 @@
 </table>
 <? endfor; ?>
=20
+</div>
\ No newline at end of file

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-18 10:17:22 UTC (rev 4924)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-18 11:37:26 UTC (rev 4925)
@@ -221,7 +221,7 @@
 INSERT INTO profile_menu(me_code, me_code_dep, p_id, p_order, p_type_dis=
play, pm_default)
     VALUES ('CFGSTOCK', 'PARAM', 1, 40, 'E', 0);
 update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
-update profile_menu set me_code_dep=3D'COMPTA' where me_code=3D'STOCK' a=
nd me_code_dep=3D'ADV';
+update profile_menu set me_code_dep=3D'COMPTA',p_order=3D15 where me_cod=
e=3D'STOCK' and me_code_dep=3D'ADV';
=20
 CREATE TABLE stock_repository
 (
@@ -278,11 +278,17 @@
=20
 insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_HISTO','stock_histo.inc.php','Historique stock','Historique =
des mouvement de stock','ME');
 insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_STATE','stock_state.inc.php','Etat des stock','Etat des stoc=
k','ME');
+insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockHisto',=
'Export Historique mouvement stock','PR');
+insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockResmLis=
t','Export R=C3=A9sum=C3=A9 list stock','PR');
=20
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',1,10,'E');
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',1,20,'E');
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',2,10,'E');
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',2,20,'E');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',1,'P');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',1,'P');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',2,'P');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',2,'P');
=20
 -- clean stock_goods
 delete from stock_goods where  sg_code is null or sg_code=3D'' or sg_cod=
e not in (select ad_value from fiche_detail as fd where ad_id=3D19 and ad=
_value is not null);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 07:47:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgaQa-0007GS-6M
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 07:47:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 13:38:24 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.202993.1340020047.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4926 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 11:47:27 -0000

Author: danydb
Date: 2012-06-18 13:38:23 +0200 (Mon, 18 Jun 2012)
New Revision: 4926

Added:
   phpcompta/trunk/include/export_stock_histo.csv
   phpcompta/trunk/include/export_stock_resume_list.php
Log:
0000633: export en CSV des mouvement des stocks
0000634: export en CSV de la liste des stocks

Added: phpcompta/trunk/include/export_stock_histo.csv
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_stock_histo.csv	                      =
  (rev 0)
+++ phpcompta/trunk/include/export_stock_histo.csv	2012-06-18 11:38:23 UT=
C (rev 4926)
@@ -0,0 +1,63 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief export in CSV the export of history
+ *
+ */
+require_once 'class_stock.php';
+
+$stock=3Dnew Stock();
+$sql =3D $stock->create_query_histo($_GET);
+$sql .=3D " order by  real_date asc";
+
+$res=3D$cn->exec_sql($sql);
+$max_row=3DDatabase::num_row($res);
+header('Pragma: public');
+header('Content-type: application/csv');
+header('Content-Disposition: attachment;filename=3D"histo-stock.csv"',FA=
LSE);
+printf('"Date";');
+	printf('"%s";','Code Stock');
+	printf('"%s";','Depot');
+	printf('"%s";','Fiche');
+	printf('"%s";','Commentaire');
+	printf('%s;','Quantit=C3=A9');
+	printf('"%s";','IN/OUT');
+		printf("\n\r");
+for ($i=3D0;$i<$max_row;$i++)
+{
+	$row=3DDatabase::fetch_array($res,$i);
+	printf('"%s";',$row['cdate']);
+	printf('"%s";',$row['sg_code']);
+	printf('"%s";',$row['r_name']);
+	printf('"%s";',$row['qcode']);
+	$row['ccomment']=3Dstr_replace('"','',$row['ccomment']);
+	printf('"%s";',$row['ccomment']);
+	printf('%s;',nbm($row['sg_quantity']));
+	printf('"%s";',$row['direction']);
+	printf("\n\r");
+
+}
+
+?>
\ No newline at end of file

Added: phpcompta/trunk/include/export_stock_resume_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_stock_resume_list.php	                =
        (rev 0)
+++ phpcompta/trunk/include/export_stock_resume_list.php	2012-06-18 11:38=
:23 UTC (rev 4926)
@@ -0,0 +1,90 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief export in CSV the summary of stock in list
+ *
+ */
+require_once 'class_stock.php';
+// var_dump($_GET);
+$stock=3Dnew Stock();
+$tmp_id =3D $stock->build_tmp_table($_GET);
+
+header('Pragma: public');
+header('Content-type: application/csv');
+header('Content-Disposition: attachment;filename=3D"stock-summary-list.c=
sv"',FALSE);
+
+?>
+"Depot";"Adresse";"Ville";"Pays";"Code Stock";"Fiches";"IN";"OUT";"DIFF"
+<?
+$a_repo=3D$cn->get_array("select distinct t.r_id,r_name,r_adress,r_city,=
r_country from stock_repository as s join tmp_stockgood_detail as t
+	on (s.r_id=3Dt.r_id)
+	where
+	s_id=3D$1
+	order by 2
+	",array($tmp_id));
+ for ($r=3D0;$r<count($a_repo);$r++):
+
+		$a_stock=3D$cn->get_array(
+				"
+					select coalesce(sum(s_qin),0) as qin,coalesce(sum(s_qout),0) as qou=
t,sg_code
+						from tmp_stockgood_detail  where r_id=3D$1 and s_id=3D$2
+						group by sg_code
+						order by sg_code
+
+					",array($a_repo[$r]['r_id'],$tmp_id));
+		for ($s=3D0;$s<count($a_stock);$s++):
+
+			$a_card=3D$cn->get_array(
+					"
+						select f_id,vw_name,quick_code
+						from vw_fiche_attr
+						where
+					 f_id in (
+						select distinct f_id from fiche_detail
+							where
+							ad_id=3D19 and
+							ad_value=3D$1)
+						order by vw_name,quick_code
+					",array($a_stock[$s]['sg_code']));
+
+printf ('"%s";',$a_repo[$r]['r_name']);
+printf ('"%s";',$a_repo[$r]['r_adress']);
+printf ('"%s";',$a_repo[$r]['r_city']);
+printf ('"%s";',$a_repo[$r]['r_country']);
+printf('"%s";',$a_stock[$s]['sg_code']);
+	$sep=3D"";
+				for ( $c=3D0;$c<count($a_card);$c++):
+					$a=3Dsprintf('[%s] %s',$a_card[$c]['quick_code'], $a_card[$c]['vw_n=
ame']);
+					$sep=3D"  / ";
+				endfor; // for C
+				if ( count($a_card)=3D=3D 0 ) $a=3D ' Erreur Code non utilis=C3=A9';
+ printf('"%s";',$a);
+ printf('%s;',nbm($a_stock[$s]['qin']));
+ printf('%s;',nbm($a_stock[$s]['qout']));
+ printf ('%s',nbm(bcsub($a_stock[$s]['qin'],$a_stock[$s]['qout'])));
+ printf("\r\n");
+ endfor;
+ endfor;
+



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 08:34:43 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgbAJ-0007I5-Hf
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 08:34:43 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 14:25:39 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203128.1340022883.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4927 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 12:34:42 -0000

Author: danydb
Date: 2012-06-18 14:25:39 +0200 (Mon, 18 Jun 2012)
New Revision: 4927

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
0000632: Si changement d'un quick-code adaptation

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-18 11:38:23 UTC (rev 4926)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-18 12:25:39 UTC (rev 4927)
@@ -332,4 +332,33 @@
=20
 create table tmp_stockgood (s_id bigserial primary key,s_date timestamp =
default now());
 create table tmp_stockgood_detail(d_id bigserial primary key,s_id bigint=
 references tmp_stockgood(s_id) on delete cascade,
-sg_code text,s_qin numeric(20,4),s_qout numeric(20,4),r_id bigint);
\ No newline at end of file
+sg_code text,s_qin numeric(20,4),s_qout numeric(20,4),r_id bigint);
+
+
+
+CREATE OR REPLACE FUNCTION comptaproc.fiche_detail_qcode_upd()
+  RETURNS trigger AS
+$BODY$
+declare
+	i record;
+begin
+	if NEW.ad_id=3D23 and NEW.ad_value !=3D OLD.ad_value then
+		RAISE NOTICE 'new qcode [%] old qcode [%]',NEW.ad_value,OLD.ad_value;
+
+		for i in select ad_id from attr_def where ad_type =3D 'card' loop
+			update fiche_detail set ad_value=3DNEW.ad_value where ad_value=3DOLD.=
ad_value and ad_id=3Di.ad_id;
+			RAISE NOTICE 'change for ad_id [%] ',i.ad_id;
+			if i.ad_id=3D19 then
+				RAISE NOTICE 'Change in stock_goods OLD[%] by NEW[%]',OLD.ad_value,N=
EW.ad_value;
+				update stock_goods set sg_code=3DNEW.ad_value where sg_code=3DOLD.ad=
_value;
+			end if;
+
+		end loop;
+	end if;
+return NEW;
+end;
+$BODY$
+  LANGUAGE plpgsql VOLATILE;
+
+
+CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   =
FOR EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 08:42:03 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgbHP-0000kc-S0
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 08:42:03 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 14:32:54 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203156.1340023323.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4928 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 12:42:03 -0000

Author: danydb
Date: 2012-06-18 14:32:54 +0200 (Mon, 18 Jun 2012)
New Revision: 4928

Modified:
   phpcompta/trunk/include/card_attr.inc.php
Log:
Add column ad_id in CFGATCARD

Modified: phpcompta/trunk/include/card_attr.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/card_attr.inc.php	2012-06-18 12:25:39 UTC (re=
v 4927)
+++ phpcompta/trunk/include/card_attr.inc.php	2012-06-18 12:32:54 UTC (re=
v 4928)
@@ -21,7 +21,7 @@
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
=20
 /*!\file
- * \brief Manage the attributs=20
+ * \brief Manage the attributs
  */
 require_once('class_fiche_attr.php');
=20
@@ -90,17 +90,22 @@
 echo HtmlInput::hidden('sa','fat');
 echo HtmlInput::hidden('p_action','divers');
 echo '<table id=3D"tb_rmfa">';
-
+echo '<tr>';
+echo th("id");
+echo th("Description");
+echo th("Type ");
+echo th("Taille");
+echo th("Param=C3=A8tre");
+echo '</tr>';
 for ($e=3D0;$e<count($array);$e++)
 {
     $row=3D$array[$e];
     $r=3D'';
-    $r.=3Dtd(HtmlInput::hidden('ad_id[]',$row->get_parameter('id')));
+    $r.=3Dtd(HtmlInput::hidden('ad_id[]',$row->get_parameter('id')).$row=
->get_parameter('id'));
     $select_type->selected=3D$row->get_parameter('type');
     $desc->value=3D$row->get_parameter('desc');
     $size->value=3D$row->get_parameter('size');
     $extra->value=3D$row->get_parameter('extra');
-
     if ( $row->get_parameter('id')>=3D 9000)
     {
         $select_type->readOnly=3Dfalse;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 08:46:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgbLZ-00015p-7j
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 08:46:21 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 14:37:13 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203163.1340023580.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4929 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 12:46:20 -0000

Author: danydb
Date: 2012-06-18 14:37:13 +0200 (Mon, 18 Jun 2012)
New Revision: 4929

Modified:
   phpcompta/trunk/include/class_acc_ledger_fin.php
Log:
Indent properly

Modified: phpcompta/trunk/include/class_acc_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-18 12:32:54 =
UTC (rev 4928)
+++ phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-18 12:37:13 =
UTC (rev 4929)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -15,12 +16,12 @@
  *   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-130=
7  USA
-*/
+ */
 /* $Revision$ */
=20
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
=20
-/*!\file
+/* !\file
  * \brief the class Acc_Ledger_Fin inherits from Acc_Ledger, this
  * object permit to manage the financial ledger
  */
@@ -38,991 +39,998 @@
=20
 class Acc_Ledger_Fin extends Acc_Ledger
 {
-    function __construct ($p_cn,$p_init)
-    {
-        parent::__construct($p_cn,$p_init);
-        $this->type=3D'FIN';
-    }
=20
-    /*!\brief verify that the data are correct before inserting or confi=
rming
-     *\param an array (usually $_POST)
-     *\return String
-     *\throw Exception on error occurs
-     */
-    public function verify($p_array)
-    {
-        global $g_user;
-        extract ($p_array);
-        /* check for a double reload */
-        if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn w=
here jr_mt=3D$1',array($mt)) !=3D 0 )
-            throw new Exception (_('Double Encodage'),5);
+	function __construct($p_cn, $p_init)
+	{
+		parent::__construct($p_cn, $p_init);
+		$this->type =3D 'FIN';
+	}
=20
-        /* check if we can write into this ledger */
-        if ( $g_user->check_jrn($p_jrn) !=3D 'W' )
-            throw new Exception (_('Acc=C3=A8s interdit'),20);
+	/* !\brief verify that the data are correct before inserting or confirm=
ing
+	 * \param an array (usually $_POST)
+	 * \return String
+	 * \throw Exception on error occurs
+	 */
=20
-        /* check if there is a bank account linked to the ledger */
-        $bank_id=3D$this->get_bank();
+	public function verify($p_array)
+	{
+		global $g_user;
+		extract($p_array);
+		/* check for a double reload */
+		if (isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr=
_mt=3D$1', array($mt)) !=3D 0)
+			throw new Exception(_('Double Encodage'), 5);
=20
-        if ($this->db->count()=3D=3D0 )
-            throw new Exception("Ce journal n'a pas de compte en banque,=
 allez dans param=C3=A8tre->journal pour r=C3=A9gler cela");
-        /* check if the accounting of the bank is correct */
-        $fBank=3Dnew Fiche($this->db,$bank_id);
-        $bank_accounting=3D$fBank->strAttribut(ATTR_DEF_ACCOUNT);
-        if ( trim($bank_accounting)=3D=3D'' )
-            throw new Exception ('Le poste comptable du compte en banque=
 de ce journal est invalide');
+		/* check if we can write into this ledger */
+		if ($g_user->check_jrn($p_jrn) !=3D 'W')
+			throw new Exception(_('Acc=C3=A8s interdit'), 20);
=20
-        /* check if the account exists */
-        $poste=3Dnew Acc_Account_Ledger($this->db,$bank_accounting);
-        if ( $poste->load() =3D=3D false )
-            throw new Exception ('Le poste comptable du compte en banque=
 de ce journal est invalide');
+		/* check if there is a bank account linked to the ledger */
+		$bank_id =3D $this->get_bank();
=20
-        /*  check if the date is valid */
-        if ( isDate($e_date) =3D=3D null )
-        {
-            throw new Exception('Date invalide', 2);
-        }
-        $oPeriode=3Dnew Periode($this->db);
-        if ($this->check_periode()=3D=3Dfalse)
-        {
-            $periode=3D$oPeriode->find_periode($e_date);
-        }
-        else
-        {
-            $oPeriode->p_id=3D$periode;
-            list ($min,$max)=3D$oPeriode->get_date_limit();
-            if ( cmpDate($e_date,$min) < 0 ||
-                    cmpDate($e_date,$max) > 0)
-                throw new Exception(_('Date et periode ne correspondent =
pas'),6);
-        }
+		if ($this->db->count() =3D=3D 0)
+			throw new Exception("Ce journal n'a pas de compte en banque, allez da=
ns param=C3=A8tre->journal pour r=C3=A9gler cela");
+		/* check if the accounting of the bank is correct */
+		$fBank =3D new Fiche($this->db, $bank_id);
+		$bank_accounting =3D $fBank->strAttribut(ATTR_DEF_ACCOUNT);
+		if (trim($bank_accounting) =3D=3D '')
+			throw new Exception('Le poste comptable du compte en banque de ce jou=
rnal est invalide');
=20
-        /* check if the periode is closed */
-        if ( $this->is_closed($periode)=3D=3D1 )
-        {
-            throw new Exception(_('Periode fermee'),6);
-        }
+		/* check if the account exists */
+		$poste =3D new Acc_Account_Ledger($this->db, $bank_accounting);
+		if ($poste->load() =3D=3D false)
+			throw new Exception('Le poste comptable du compte en banque de ce jou=
rnal est invalide');
=20
-        /* check if we are using the strict mode */
-        if( $this->check_strict() =3D=3D true)
-        {
-            /* if we use the strict mode, we get the date of the last
-            operation */
-            $last_date=3D$this->get_last_date();
-            if ( $last_date !=3D null  && cmpDate($e_date,$last_date) < =
0 )
-                throw new Exception(_('Vous utilisez le mode strict la d=
erni=C3=A8re operation est =C3=A0 la date du ')
-                                    .$last_date._(' vous ne pouvez pas e=
ncoder =C3=A0 une date ant=C3=A9rieure'),15);
+		/*  check if the date is valid */
+		if (isDate($e_date) =3D=3D null)
+		{
+			throw new Exception('Date invalide', 2);
+		}
+		$oPeriode =3D new Periode($this->db);
+		if ($this->check_periode() =3D=3D false)
+		{
+			$periode =3D $oPeriode->find_periode($e_date);
+		}
+		else
+		{
+			$oPeriode->p_id =3D $periode;
+			list ($min, $max) =3D $oPeriode->get_date_limit();
+			if (cmpDate($e_date, $min) < 0 ||
+					cmpDate($e_date, $max) > 0)
+				throw new Exception(_('Date et periode ne correspondent pas'), 6);
+		}
=20
-        }
+		/* check if the periode is closed */
+		if ($this->is_closed($periode) =3D=3D 1)
+		{
+			throw new Exception(_('Periode fermee'), 6);
+		}
=20
-        $acc_pay=3Dnew Acc_Operation($this->db);
+		/* check if we are using the strict mode */
+		if ($this->check_strict() =3D=3D true)
+		{
+			/* if we use the strict mode, we get the date of the last
+			  operation */
+			$last_date =3D $this->get_last_date();
+			if ($last_date !=3D null && cmpDate($e_date, $last_date) < 0)
+				throw new Exception(_('Vous utilisez le mode strict la derni=C3=A8re=
 operation est =C3=A0 la date du ')
+						. $last_date . _(' vous ne pouvez pas encoder =C3=A0 une date ant=C3=
=A9rieure'), 15);
+		}
=20
-        $nb=3D0;
-        $tot_amount=3D0;
-        //----------------------------------------
-        // foreach item
-        //----------------------------------------
-        for ($i=3D0;$i< $nb_item;$i++)
-        {
-            if ( strlen(trim(${'e_other'.$i}))=3D=3D 0) continue;
-            /* check if amount are numeric and */
-            if ( isNumber(${'e_other'.$i.'_amount'}) =3D=3D 0 )
-                throw new Exception('La fiche '.${'e_other'.$i}.'a un mo=
ntant invalide ['.${'e_other'.$i.'_amount'}.']',6);
+		$acc_pay =3D new Acc_Operation($this->db);
=20
-            /* compute the total */
-            $tot_amount+=3Dround(${'e_other'.$i.'_amount'},2);
-            /* check if all card has a ATTR_DEF_ACCOUNT*/
-            $fiche=3Dnew Fiche($this->db);
-            $fiche->get_by_qcode(${'e_other'.$i});
-            if ( $fiche->empty_attribute(ATTR_DEF_ACCOUNT) =3D=3D true)
-                throw new Exception('La fiche '.${'e_other'.$i}.'n\'a pa=
s de poste comptable',8);
+		$nb =3D 0;
+		$tot_amount =3D 0;
+		//----------------------------------------
+		// foreach item
+		//----------------------------------------
+		for ($i =3D 0; $i < $nb_item; $i++)
+		{
+			if (strlen(trim(${'e_other' . $i})) =3D=3D 0)
+				continue;
+			/* check if amount are numeric and */
+			if (isNumber(${'e_other' . $i . '_amount'}) =3D=3D 0)
+				throw new Exception('La fiche ' . ${'e_other' . $i} . 'a un montant =
invalide [' . ${'e_other' . $i . '_amount'} . ']', 6);
=20
-            $sposte=3D$fiche->strAttribut(ATTR_DEF_ACCOUNT);
-            // if 2 accounts, take only the debit one for customer
-            if ( strpos($sposte,',') !=3D 0 )
-            {
-                $array=3Dexplode(',',$sposte);
-                $poste_val=3D$array[1];
-            }
-            else
-            {
-                $poste_val=3D$sposte;
-            }
-            /* The account exists */
-            $poste=3Dnew Acc_Account_Ledger($this->db,$poste_val);
-            if ( $poste->load() =3D=3D false )
-            {
-                throw new Exception('Pour la fiche '.${'e_other'.$i}.' l=
e poste comptable ['.$poste->id.'n\'existe pas',9);
-            }
-            /* Check if the card belong to the ledger */
-            $fiche=3Dnew Fiche ($this->db);
-            $fiche->get_by_qcode(${'e_other'.$i});
-            if ( $fiche->belong_ledger($p_jrn,'deb') !=3D1 )
-                throw new Exception('La fiche '.${'e_other'.$i}.'n\'est =
pas accessible =C3=A0 ce journal',10);
-            $nb++;
-        }
-        if ( $nb =3D=3D 0 )
-            throw new Exception('Il n\'y a aucune op=C3=A9ration',12);
+			/* compute the total */
+			$tot_amount+=3Dround(${'e_other' . $i . '_amount'}, 2);
+			/* check if all card has a ATTR_DEF_ACCOUNT */
+			$fiche =3D new Fiche($this->db);
+			$fiche->get_by_qcode(${'e_other' . $i});
+			if ($fiche->empty_attribute(ATTR_DEF_ACCOUNT) =3D=3D true)
+				throw new Exception('La fiche ' . ${'e_other' . $i} . 'n\'a pas de p=
oste comptable', 8);
=20
-        /* Check if the last_saldo and first_saldo are correct */
-        if ( strlen(trim($last_sold)) !=3D 0 && isNumber($last_sold) &&
-                strlen(trim($first_sold)) !=3D 0 && isNumber($first_sold=
))
-        {
-            $diff=3D$last_sold-$first_sold;
-            $diff=3Dround($diff,2)-round($tot_amount,2);
-            if ( $first_sold !=3D 0 && $last_sold !=3D0)
-            {
-                if ( $diff !=3D 0 )
-                    throw new Exception('Le montant de l\'extrait est in=
correct'.
-                                        $tot_amount.' extrait '.$diff,13=
);
-            }
-        }
+			$sposte =3D $fiche->strAttribut(ATTR_DEF_ACCOUNT);
+			// if 2 accounts, take only the debit one for customer
+			if (strpos($sposte, ',') !=3D 0)
+			{
+				$array =3D explode(',', $sposte);
+				$poste_val =3D $array[1];
+			}
+			else
+			{
+				$poste_val =3D $sposte;
+			}
+			/* The account exists */
+			$poste =3D new Acc_Account_Ledger($this->db, $poste_val);
+			if ($poste->load() =3D=3D false)
+			{
+				throw new Exception('Pour la fiche ' . ${'e_other' . $i} . ' le post=
e comptable [' . $poste->id . 'n\'existe pas', 9);
+			}
+			/* Check if the card belong to the ledger */
+			$fiche =3D new Fiche($this->db);
+			$fiche->get_by_qcode(${'e_other' . $i});
+			if ($fiche->belong_ledger($p_jrn, 'deb') !=3D 1)
+				throw new Exception('La fiche ' . ${'e_other' . $i} . 'n\'est pas ac=
cessible =C3=A0 ce journal', 10);
+			$nb++;
+		}
+		if ($nb =3D=3D 0)
+			throw new Exception('Il n\'y a aucune op=C3=A9ration', 12);
=20
-    }
+		/* Check if the last_saldo and first_saldo are correct */
+		if (strlen(trim($last_sold)) !=3D 0 && isNumber($last_sold) &&
+				strlen(trim($first_sold)) !=3D 0 && isNumber($first_sold))
+		{
+			$diff =3D $last_sold - $first_sold;
+			$diff =3D round($diff, 2) - round($tot_amount, 2);
+			if ($first_sold !=3D 0 && $last_sold !=3D 0)
+			{
+				if ($diff !=3D 0)
+					throw new Exception('Le montant de l\'extrait est incorrect' .
+							$tot_amount . ' extrait ' . $diff, 13);
+			}
+		}
+	}
=20
+	/* !\brief
+	 * \param $p_array contains the value usually it is $_POST
+	 * \return string with html code
+	 * \note the form tag are not  set here
+	 */
=20
-    /*!\brief
-    *\param $p_array contains the value usually it is $_POST
-     *\return string with html code
-     *\note the form tag are not  set here
-     */
-    function input($p_array=3Dnull,$notused=3D0)
-    {
-        global $g_parameter,$g_user;
-        if ( $p_array !=3D null)
-            extract ($p_array);
+	function input($p_array =3D null, $notused =3D 0)
+	{
+		global $g_parameter, $g_user;
+		if ($p_array !=3D null)
+			extract($p_array);
=20
-        $pview_only=3Dfalse;
+		$pview_only =3D false;
=20
-        $f_add_button=3Dnew IButton('add_card');
-        $f_add_button->label=3D_('Cr=C3=A9er une nouvelle fiche');
-        $f_add_button->set_attribute('ipopup','ipop_newcard');
-        $f_add_button->set_attribute('jrn',$this->id);
-        $f_add_button->javascript=3D" this.jrn=3D\$('p_jrn').value;selec=
t_card_type(this);";
-        $str_add_button=3D($g_user->check_action(FICADD)=3D=3D1)?$f_add_=
button->input():"";
+		$f_add_button =3D new IButton('add_card');
+		$f_add_button->label =3D _('Cr=C3=A9er une nouvelle fiche');
+		$f_add_button->set_attribute('ipopup', 'ipop_newcard');
+		$f_add_button->set_attribute('jrn', $this->id);
+		$f_add_button->javascript =3D " this.jrn=3D\$('p_jrn').value;select_ca=
rd_type(this);";
+		$str_add_button =3D ($g_user->check_action(FICADD) =3D=3D 1) ? $f_add_=
button->input() : "";
=20
-        // The first day of the periode
-        $pPeriode=3Dnew Periode($this->db);
-        list ($l_date_start,$l_date_end)=3D$pPeriode->get_date_limit($g_=
user->get_periode());
-        if (  $g_parameter->MY_DATE_SUGGEST=3D=3D'Y' )
-            $op_date=3D( ! isset($e_date) ) ?$l_date_start:$e_date;
-        else
-            $op_date=3D( ! isset($e_date) ) ?'':$e_date;
+		// The first day of the periode
+		$pPeriode =3D new Periode($this->db);
+		list ($l_date_start, $l_date_end) =3D $pPeriode->get_date_limit($g_use=
r->get_periode());
+		if ($g_parameter->MY_DATE_SUGGEST =3D=3D 'Y')
+			$op_date =3D (!isset($e_date) ) ? $l_date_start : $e_date;
+		else
+			$op_date =3D (!isset($e_date) ) ? '' : $e_date;
=20
-        $r=3D"";
+		$r =3D "";
=20
-        $r.=3Ddossier::hidden();
-        $f_legend=3D'Banque, caisse';
-        //  Date
-        //--
-        $Date=3Dnew IDate("e_date",$op_date);
-        $Date->setReadOnly($pview_only);
-        $f_date=3D$Date->input();
-        $f_period=3D'';
-        if ($this->check_periode() =3D=3D true)
-        {
-            // Periode
-            //--
-            $l_user_per=3D(isset($periode))?$periode:$g_user->get_period=
e();
-            $period=3Dnew IPeriod();
-            $period->cn=3D$this->db;
-            $period->type=3DOPEN;
-            $period->value=3D$l_user_per;
-            $period->user=3D$g_user;
-            $period->name=3D'periode';
-            try
-            {
-                $l_form_per=3D$period->input();
-            }
-            catch (Exception $e)
-            {
-                if ($e->getCode() =3D=3D 1 )
-                {
-                    echo "Aucune p=C3=A9riode ouverte";
-                    exit();
-                }
-            }
-            $label=3DHtmlInput::infobulle(3);
-            $f_period=3D"P=C3=A9riode comptable $label".$l_form_per;
-        }
+		$r.=3Ddossier::hidden();
+		$f_legend =3D 'Banque, caisse';
+		//  Date
+		//--
+		$Date =3D new IDate("e_date", $op_date);
+		$Date->setReadOnly($pview_only);
+		$f_date =3D $Date->input();
+		$f_period =3D '';
+		if ($this->check_periode() =3D=3D true)
+		{
+			// Periode
+			//--
+			$l_user_per =3D (isset($periode)) ? $periode : $g_user->get_periode()=
;
+			$period =3D new IPeriod();
+			$period->cn =3D $this->db;
+			$period->type =3D OPEN;
+			$period->value =3D $l_user_per;
+			$period->user =3D $g_user;
+			$period->name =3D 'periode';
+			try
+			{
+				$l_form_per =3D $period->input();
+			}
+			catch (Exception $e)
+			{
+				if ($e->getCode() =3D=3D 1)
+				{
+					echo "Aucune p=C3=A9riode ouverte";
+					exit();
+				}
+			}
+			$label =3D HtmlInput::infobulle(3);
+			$f_period =3D "P=C3=A9riode comptable $label" . $l_form_per;
+		}
=20
-        // Ledger (p_jrn)
-        //--
+		// Ledger (p_jrn)
+		//--
=20
-	$add_js=3D'onchange=3D"update_pj();update_bank();get_last_date();ajax_s=
aldo(\'first_sold\');update_name();"';
+		$add_js =3D 'onchange=3D"update_pj();update_bank();get_last_date();aja=
x_saldo(\'first_sold\');update_name();"';
=20
-	if ( $g_parameter->MY_DATE_SUGGEST =3D=3D 'Y')
-	  $add_js=3D'onchange=3D"update_pj();update_bank();get_last_date();ajax=
_saldo(\'first_sold\')";';
+		if ($g_parameter->MY_DATE_SUGGEST =3D=3D 'Y')
+			$add_js =3D 'onchange=3D"update_pj();update_bank();get_last_date();aj=
ax_saldo(\'first_sold\')";';
=20
-        $wLedger=3D$this->select_ledger('FIN',2);
-        if ($wLedger =3D=3D null ) exit ('Pas de journal disponible');
+		$wLedger =3D $this->select_ledger('FIN', 2);
+		if ($wLedger =3D=3D null)
+			exit('Pas de journal disponible');
=20
-        $wLedger->javascript=3D$add_js;
+		$wLedger->javascript =3D $add_js;
=20
-        $label=3D" Journal ".HtmlInput::infobulle(2) ;
-        $f_jrn=3D$label.$wLedger->input();
+		$label =3D " Journal " . HtmlInput::infobulle(2);
+		$f_jrn =3D $label . $wLedger->input();
=20
=20
-        // retrieve bank name, code and account from the jrn_def.jrn_def=
_bank
+		// retrieve bank name, code and account from the jrn_def.jrn_def_bank
=20
-        $f_bank=3D'<span id=3D"bkname">'.$this->get_bank_name().'</span>=
';
-		if ( $this->bank_id =3D=3D "" )
+		$f_bank =3D '<span id=3D"bkname">' . $this->get_bank_name() . '</span>=
';
+		if ($this->bank_id =3D=3D "")
 		{
-			echo h2("Journal de banque non configur=C3=A9 ".$this->get_name(),' c=
lass=3D"error"');
+			echo h2("Journal de banque non configur=C3=A9 " . $this->get_name(), =
' class=3D"error"');
 			echo '<span class=3D"error"> vous devez donner =C3=A0 ce journal un c=
ompte en banque (fiche), modifiez dans CFGLED</span>';
-			alert ("Journal de banque non configur=C3=A9 ".$this->get_name());
+			alert("Journal de banque non configur=C3=A9 " . $this->get_name());
 		}
=20
-        $f_legend_detail=3D'Op=C3=A9rations financi=C3=A8res';
-        //--------------------------------------------------
-        // Saldo begin end
-        //-------------------------------------------------
-        // Extrait
-        $default_pj=3D'';
-        if ( $g_parameter->MY_PJ_SUGGEST=3D=3D'Y')
-        {
-            $default_pj=3D$this->guess_pj();
-        }
-        $wPJ=3Dnew IText('e_pj');
-        $wPJ->readonly=3Dfalse;
-        $wPJ->size=3D10;
-        $wPJ->value=3D(isset($e_pj))?$e_pj:$default_pj;
+		$f_legend_detail =3D 'Op=C3=A9rations financi=C3=A8res';
+		//--------------------------------------------------
+		// Saldo begin end
+		//-------------------------------------------------
+		// Extrait
+		$default_pj =3D '';
+		if ($g_parameter->MY_PJ_SUGGEST =3D=3D 'Y')
+		{
+			$default_pj =3D $this->guess_pj();
+		}
+		$wPJ =3D new IText('e_pj');
+		$wPJ->readonly =3D false;
+		$wPJ->size =3D 10;
+		$wPJ->value =3D (isset($e_pj)) ? $e_pj : $default_pj;
=20
-        $f_extrait=3D$wPJ->input().HtmlInput::hidden('e_pj_suggest',$def=
ault_pj);
-        $label=3DHtmlInput::infobulle(7);
+		$f_extrait =3D $wPJ->input() . HtmlInput::hidden('e_pj_suggest', $defa=
ult_pj);
+		$label =3D HtmlInput::infobulle(7);
=20
-        $first_sold=3D(isset($first_sold))?$first_sold:"";
-        $wFirst=3Dnew INum('first_sold',$first_sold);
+		$first_sold =3D (isset($first_sold)) ? $first_sold : "";
+		$wFirst =3D new INum('first_sold', $first_sold);
=20
-        $last_sold=3D isset($last_sold)?$last_sold:"";
-        $wLast=3Dnew INum('last_sold',$last_sold);
+		$last_sold =3D isset($last_sold) ? $last_sold : "";
+		$wLast =3D new INum('last_sold', $last_sold);
=20
=20
-        $max=3D(isset($nb_item))?$nb_item:MAX_ARTICLE;
+		$max =3D (isset($nb_item)) ? $nb_item : MAX_ARTICLE;
=20
-        $r.=3D HtmlInput::hidden('nb_item',$max);
-        //--------------------------------------------------
-        // financial operation
-        //-------------------------------------------------
+		$r.=3D HtmlInput::hidden('nb_item', $max);
+		//--------------------------------------------------
+		// financial operation
+		//-------------------------------------------------
=20
-        $array=3Darray();
-        // Parse each " tiers"
-        for ($i=3D0; $i < $max; $i++)
-        {
-            $tiers=3D(isset(${"e_other".$i}))?${"e_other".$i}:""
-                   ;
-            $tiers_amount=3D(isset(${"e_other$i"."_amount"}))?round(${"e=
_other$i"."_amount"},2):0;
+		$array =3D array();
+		// Parse each " tiers"
+		for ($i =3D 0; $i < $max; $i++)
+		{
+			$tiers =3D (isset(${"e_other" . $i})) ? ${"e_other" . $i} : ""
+			;
+			$tiers_amount =3D (isset(${"e_other$i" . "_amount"})) ? round(${"e_ot=
her$i" . "_amount"}, 2) : 0;
=20
-            $tiers_comment=3D(isset (${"e_other$i"."_comment"}))?${"e_ot=
her$i"."_comment"}:""
-                           ;
-            ${"e_other$i"."_amount"}=3D(isset (${"e_other$i"."_amount"})=
)?${"e_other$i"."_amount"}:0;
+			$tiers_comment =3D (isset(${"e_other$i" . "_comment"})) ? ${"e_other$=
i" . "_comment"} : ""
+			;
+			${"e_other$i" . "_amount"} =3D (isset(${"e_other$i" . "_amount"})) ? =
${"e_other$i" . "_amount"} : 0;
=20
-            $W1=3Dnew ICard();
-            $W1->label=3D"";
-            $W1->name=3D"e_other".$i;
-            $W1->value=3D$tiers;
-            $W1->extra=3D'deb';  // credits
-            $W1->typecard=3D'deb';
-            $W1->set_dblclick("fill_ipopcard(this);");
-            $W1->set_attribute('ipopup','ipopcard');
+			$W1 =3D new ICard();
+			$W1->label =3D "";
+			$W1->name =3D "e_other" . $i;
+			$W1->value =3D $tiers;
+			$W1->extra =3D 'deb';  // credits
+			$W1->typecard =3D 'deb';
+			$W1->set_dblclick("fill_ipopcard(this);");
+			$W1->set_attribute('ipopup', 'ipopcard');
=20
-            // name of the field to update with the name of the card
-            $W1->set_attribute('label','e_other_name'.$i);
-            // name of the field to update with the name of the card
-            $W1->set_attribute('typecard','filter');
-            // Add the callback function to filter the card on the jrn
-            $W1->set_callback('filter_card');
-            $W1->set_function('fill_data');
-            $W1->javascript=3Dsprintf(' onchange=3D"fill_data_onchange(\=
'%s\');" ',
-                                    $W1->name);
-            $W1->readonly=3D$pview_only;
-            $array[$i]['qcode']=3D$W1->input();
-            $array[$i]['search']=3D$W1->search();
+			// name of the field to update with the name of the card
+			$W1->set_attribute('label', 'e_other_name' . $i);
+			// name of the field to update with the name of the card
+			$W1->set_attribute('typecard', 'filter');
+			// Add the callback function to filter the card on the jrn
+			$W1->set_callback('filter_card');
+			$W1->set_function('fill_data');
+			$W1->javascript =3D sprintf(' onchange=3D"fill_data_onchange(\'%s\');=
" ', $W1->name);
+			$W1->readonly =3D $pview_only;
+			$array[$i]['qcode'] =3D $W1->input();
+			$array[$i]['search'] =3D $W1->search();
=20
-	    // Card name
-	    //
-	    $card_name=3D"";
-	    if ( $tiers !=3D"" )
-	      {
-		$fiche=3Dnew Fiche($this->db);
-		$fiche->get_by_qcode($tiers);
-		$card_name=3D$this->db->get_value("Select ad_value from fiche_detail w=
here ad_id=3D$1 and f_id=3D$2",
-						array(ATTR_DEF_NAME,$fiche->id));
-	      }
+			// Card name
+			//
+	    $card_name =3D "";
+			if ($tiers !=3D "")
+			{
+				$fiche =3D new Fiche($this->db);
+				$fiche->get_by_qcode($tiers);
+				$card_name =3D $this->db->get_value("Select ad_value from fiche_deta=
il where ad_id=3D$1 and f_id=3D$2", array(ATTR_DEF_NAME, $fiche->id));
+			}
=20
-	    $wcard_name=3Dnew IText("e_other_name".$i,$card_name);
-	    $wcard_name->readOnly=3Dtrue;
-	    $array[$i]['cname']=3D$wcard_name->input();
+			$wcard_name =3D new IText("e_other_name" . $i, $card_name);
+			$wcard_name->readOnly =3D true;
+			$array[$i]['cname'] =3D $wcard_name->input();
=20
-            // Comment
-            $wComment=3Dnew IText("e_other$i"."_comment",$tiers_comment)=
;
+			// Comment
+			$wComment =3D new IText("e_other$i" . "_comment", $tiers_comment);
=20
-            $wComment->size=3D35;
-            $wComment->setReadOnly($pview_only);
-            $array[$i]['comment']=3D$wComment->input();
-            // amount
-            $wAmount=3Dnew INum("e_other$i"."_amount",$tiers_amount);
+			$wComment->size =3D 35;
+			$wComment->setReadOnly($pview_only);
+			$array[$i]['comment'] =3D $wComment->input();
+			// amount
+			$wAmount =3D new INum("e_other$i" . "_amount", $tiers_amount);
=20
-            $wAmount->size=3D7;
-            $wAmount->setReadOnly($pview_only);
-            $array[$i]['amount']=3D$wAmount->input();
-            // concerned
-            ${"e_concerned".$i}=3D(isset(${"e_concerned".$i}))?${"e_conc=
erned".$i}:""
-                                ;
-            $wConcerned=3Dnew IConcerned("e_concerned".$i,${"e_concerned=
".$i});
-            $wConcerned->setReadOnly($pview_only);
-            $wConcerned->amount_id=3D"e_other".$i."_amount";
+			$wAmount->size =3D 7;
+			$wAmount->setReadOnly($pview_only);
+			$array[$i]['amount'] =3D $wAmount->input();
+			// concerned
+			${"e_concerned" . $i} =3D (isset(${"e_concerned" . $i})) ? ${"e_conce=
rned" . $i} : ""
+			;
+			$wConcerned =3D new IConcerned("e_concerned" . $i, ${"e_concerned" . =
$i});
+			$wConcerned->setReadOnly($pview_only);
+			$wConcerned->amount_id =3D "e_other" . $i . "_amount";
=20
-            $wConcerned->paid=3D'paid';
-            $array[$i]['concerned']=3D$wConcerned->input();
-        }
+			$wConcerned->paid =3D 'paid';
+			$array[$i]['concerned'] =3D $wConcerned->input();
+		}
=20
-        ob_start();
-        require_once('template/form_ledger_fin.php');
-        $r.=3Dob_get_contents();
-        ob_clean();
+		ob_start();
+		require_once('template/form_ledger_fin.php');
+		$r.=3Dob_get_contents();
+		ob_clean();
=20
=20
-        return $r;
+		return $r;
+	}
=20
-    }
-    /*!\brief show the summary before inserting into the database, it
-     *calls the function for adding a attachment. The function verify
-     *should be called before
-     *\param $p_array an array usually is $_POST
-     *\return string with code html
-     */
-    public function confirm($p_array,$p_nothing=3D0)
-    {
-        global $g_parameter;
-        $r=3D"";
-        bcscale(2);
-        extract ($p_array);
-        $pPeriode=3Dnew Periode($this->db);
-        if ($this->check_periode() =3D=3D true)
-        {
-            $pPeriode->p_id=3D$periode;
-        }
-        else
-        {
-            $pPeriode->find_periode($e_date);
-        }
+	/* !\brief show the summary before inserting into the database, it
+	 * calls the function for adding a attachment. The function verify
+	 * should be called before
+	 * \param $p_array an array usually is $_POST
+	 * \return string with code html
+	 */
=20
-        list ($l_date_start,$l_date_end)=3D$pPeriode->get_date_limit();
-        $exercice=3D$pPeriode->get_exercice();
-        $r.=3D'';
-        $r.=3D'<fieldset><legend>Banque, caisse </legend>';
+	public function confirm($p_array, $p_nothing =3D 0)
+	{
+		global $g_parameter;
+		$r =3D "";
+		bcscale(2);
+		extract($p_array);
+		$pPeriode =3D new Periode($this->db);
+		if ($this->check_periode() =3D=3D true)
+		{
+			$pPeriode->p_id =3D $periode;
+		}
+		else
+		{
+			$pPeriode->find_periode($e_date);
+		}
+
+		list ($l_date_start, $l_date_end) =3D $pPeriode->get_date_limit();
+		$exercice =3D $pPeriode->get_exercice();
+		$r.=3D'';
+		$r.=3D'<fieldset><legend>Banque, caisse </legend>';
 		$r.=3D '<div id=3D"jrn_name_div">';
 		$r.=3D'<h2 id=3D"jrn_name" style=3D"display:inline">' . $this->get_nam=
e() . '</h2>';
 		$r.=3D '</div>';
-        $r.=3D'<TABLE  width=3D"100%">';
-        //  Date
-        //--
-        $r.=3D"<tr>";
-        $r.=3D'<td> Date : </td><td>'.$e_date;
-        // Periode
-        //--
-        $r.=3D"<td>";
-        $r.=3D"P=C3=A9riode comptable </td><td>";
-        $r.=3D$l_date_start.' - '.$l_date_end;
-        $r.=3D"</td>";
-        $r.=3D"</tr>";
-        // Ledger (p_jrn)
-        //--
-        $r.=3D'<tr>';
-        $r.=3D'<td> Journal </td>';
-        $this->id=3D$p_jrn;
-        $r.=3D'<td>';
-        $r.=3Dh($this->get_name());
-        $r.=3D'</td>';
-        $r.=3D'</tr>';
+		$r.=3D'<TABLE  width=3D"100%">';
+		//  Date
+		//--
+		$r.=3D"<tr>";
+		$r.=3D'<td> Date : </td><td>' . $e_date;
+		// Periode
+		//--
+		$r.=3D"<td>";
+		$r.=3D"P=C3=A9riode comptable </td><td>";
+		$r.=3D$l_date_start . ' - ' . $l_date_end;
+		$r.=3D"</td>";
+		$r.=3D"</tr>";
+		// Ledger (p_jrn)
+		//--
+		$r.=3D'<tr>';
+		$r.=3D'<td> Journal </td>';
+		$this->id =3D $p_jrn;
+		$r.=3D'<td>';
+		$r.=3Dh($this->get_name());
+		$r.=3D'</td>';
+		$r.=3D'</tr>';
=20
-        //retrieve bank name
-        $bk_id=3D$this->get_bank();
+		//retrieve bank name
+		$bk_id =3D $this->get_bank();
=20
-        $fBank=3Dnew Fiche($this->db,$bk_id);
-        $e_bank_account_label=3D$this->get_bank_name();
+		$fBank =3D new Fiche($this->db, $bk_id);
+		$e_bank_account_label =3D $this->get_bank_name();
=20
-        $filter_year=3D"  j_tech_per in (select p_id from parm_periode w=
here  p_exercice=3D'".$exercice."')";
+		$filter_year =3D "  j_tech_per in (select p_id from parm_periode where=
  p_exercice=3D'" . $exercice . "')";
=20
-        $acc_account=3Dnew Acc_Account_Ledger($this->db,$fBank->strAttri=
but(ATTR_DEF_ACCOUNT));
-        $solde=3D$acc_account->get_solde($filter_year);
-        $new_solde=3D$solde;
+		$acc_account =3D new Acc_Account_Ledger($this->db, $fBank->strAttribut=
(ATTR_DEF_ACCOUNT));
+		$solde =3D $acc_account->get_solde($filter_year);
+		$new_solde =3D $solde;
=20
-        $r.=3D"<TR><td colspan=3D\"4\"> Banque ";
-        $r.=3D$e_bank_account_label;
+		$r.=3D"<TR><td colspan=3D\"4\"> Banque ";
+		$r.=3D$e_bank_account_label;
=20
-        $r.=3D"</TABLE>";
+		$r.=3D"</TABLE>";
=20
-        $r.=3D'</fieldset>';
+		$r.=3D'</fieldset>';
=20
-        $r.=3D'<fieldset><legend>Op=C3=A9rations financi=C3=A8res</legen=
d>';
-        //--------------------------------------------------
-        // Saldo begin end
-        //-------------------------------------------------
-        $r.=3D'<fieldset><legend>Extrait de compte</legend>';
-        $r.=3D'<table>';
-        $r.=3D'<tr>';
-        // Extrait
-        //--
-        $r.=3D'<td> Num=C3=A9ro d\'extrait</td>'.h($e_pj);
-        $r.=3D'<td >Solde d=C3=A9but extrait </td>';
-        $r.=3D'<td>'.$first_sold.'</td>';
-        $r.=3D'<td>Solde fin extrait </td>';
-        $r.=3D'<td>'.$last_sold.'</td>';
-        $r.=3D'</table>';
-        $r.=3D'</fieldset>';
+		$r.=3D'<fieldset><legend>Op=C3=A9rations financi=C3=A8res</legend>';
+		//--------------------------------------------------
+		// Saldo begin end
+		//-------------------------------------------------
+		$r.=3D'<fieldset><legend>Extrait de compte</legend>';
+		$r.=3D'<table>';
+		$r.=3D'<tr>';
+		// Extrait
+		//--
+		$r.=3D'<td> Num=C3=A9ro d\'extrait</td>' . h($e_pj);
+		$r.=3D'<td >Solde d=C3=A9but extrait </td>';
+		$r.=3D'<td>' . $first_sold . '</td>';
+		$r.=3D'<td>Solde fin extrait </td>';
+		$r.=3D'<td>' . $last_sold . '</td>';
+		$r.=3D'</table>';
+		$r.=3D'</fieldset>';
=20
-        //--------------------------------------------------
-        // financial operation
-        //-------------------------------------------------
-        $r.=3D'<TABLE style=3D"width:100%" id=3D"fin_item">';
-        $r.=3D"<TR>";
-        $r.=3D"<th style=3D\"width:auto;text-align:left\" colspan=3D\"2\=
">Nom</TH>";
-        $r.=3D"<th style=3D\"text-align:left\" >Commentaire</TH>";
-        $r.=3D"<th style=3D\"text-align:right\">Montant</TH>";
-        $r.=3D'<th colspan=3D"2"> Op. Concern&eacute;e(s)</th>';
+		//--------------------------------------------------
+		// financial operation
+		//-------------------------------------------------
+		$r.=3D'<TABLE style=3D"width:100%" id=3D"fin_item">';
+		$r.=3D"<TR>";
+		$r.=3D"<th style=3D\"width:auto;text-align:left\" colspan=3D\"2\">Nom<=
/TH>";
+		$r.=3D"<th style=3D\"text-align:left\" >Commentaire</TH>";
+		$r.=3D"<th style=3D\"text-align:right\">Montant</TH>";
+		$r.=3D'<th colspan=3D"2"> Op. Concern&eacute;e(s)</th>';
=20
-	/* if we use the AC */
-        if ($g_parameter->MY_ANALYTIC!=3D'nu')
-        {
-            $anc=3Dnew Anc_Plan($this->db);
-            $a_anc=3D$anc->get_list();
-            $x=3Dcount($a_anc);
-            /* set the width of the col */
-            $r.=3D'<th colspan=3D"'.$x.'">'._('Compt. Analytique').'</th=
>';
+		/* if we use the AC */
+		if ($g_parameter->MY_ANALYTIC !=3D 'nu')
+		{
+			$anc =3D new Anc_Plan($this->db);
+			$a_anc =3D $anc->get_list();
+			$x =3D count($a_anc);
+			/* set the width of the col */
+			$r.=3D'<th colspan=3D"' . $x . '">' . _('Compt. Analytique') . '</th>=
';
=20
-            /* add hidden variables pa[] to hold the value of pa_id */
-            $r.=3DAnc_Plan::hidden($a_anc);
-        }
-        $r.=3D"</TR>";
-        // Parse each " tiers"
-        $tot_amount=3D0;
-        //--------------------------------------------------
-        // For each items
-        //--------------------------------------------------
-        for ($i=3D0; $i < $nb_item; $i++)
-        {
+			/* add hidden variables pa[] to hold the value of pa_id */
+			$r.=3DAnc_Plan::hidden($a_anc);
+		}
+		$r.=3D"</TR>";
+		// Parse each " tiers"
+		$tot_amount =3D 0;
+		//--------------------------------------------------
+		// For each items
+		//--------------------------------------------------
+		for ($i =3D 0; $i < $nb_item; $i++)
+		{
=20
-            $tiers=3D(isset(${"e_other".$i}))?${"e_other".$i}:""
-                   ;
+			$tiers =3D (isset(${"e_other" . $i})) ? ${"e_other" . $i} : ""
+			;
=20
-            if ( strlen(trim($tiers))=3D=3D0)continue;
-            $tiers_label=3D"";
-            $tiers_amount=3Dround(${"e_other$i"."_amount"},2);
-            $tot_amount=3Dbcadd($tot_amount,$tiers_amount);
-            $tiers_comment=3Dh(${"e_other$i"."_comment"});
-            // If $tiers has a value
-            $fTiers=3Dnew Fiche($this->db);
-            $fTiers->get_by_qcode($tiers);
+			if (strlen(trim($tiers)) =3D=3D 0)
+				continue;
+			$tiers_label =3D "";
+			$tiers_amount =3D round(${"e_other$i" . "_amount"}, 2);
+			$tot_amount =3D bcadd($tot_amount, $tiers_amount);
+			$tiers_comment =3D h(${"e_other$i" . "_comment"});
+			// If $tiers has a value
+			$fTiers =3D new Fiche($this->db);
+			$fTiers->get_by_qcode($tiers);
=20
-            $tiers_label=3D$fTiers->strAttribut(ATTR_DEF_NAME);
+			$tiers_label =3D $fTiers->strAttribut(ATTR_DEF_NAME);
=20
-            $r.=3D"<TR><td>".${'e_other'.$i}."</TD>";
-            // label
-            $r.=3D'<TD style=3D"width:25%;border-bottom:1px dotted grey;=
">';
-            $r.=3D$fTiers->strAttribut(ATTR_DEF_NAME);
-            $r.=3D'</td>';
-            // Comment
-            $r.=3D'<td style=3D"width:40%">'.$tiers_comment.'</td>';
-            // amount
-            $r.=3D'<td class=3D"num">'.nbm($tiers_amount).'</td>';
-            // concerned
-            $r.=3D'<td style=3D"text-align:center">';
-			if (${"e_concerned".$i} !=3D '')
+			$r.=3D"<TR><td>" . ${'e_other' . $i} . "</TD>";
+			// label
+			$r.=3D'<TD style=3D"width:25%;border-bottom:1px dotted grey;">';
+			$r.=3D$fTiers->strAttribut(ATTR_DEF_NAME);
+			$r.=3D'</td>';
+			// Comment
+			$r.=3D'<td style=3D"width:40%">' . $tiers_comment . '</td>';
+			// amount
+			$r.=3D'<td class=3D"num">' . nbm($tiers_amount) . '</td>';
+			// concerned
+			$r.=3D'<td style=3D"text-align:center">';
+			if (${"e_concerned" . $i} !=3D '')
 			{
-				$jr_internal=3D$this->db->get_array("select jr_internal from jrn whe=
re jr_id in (".${"e_concerned".$i}.")");
-				for ($x=3D0;$x<count($jr_internal);$x++)
+				$jr_internal =3D $this->db->get_array("select jr_internal from jrn w=
here jr_id in (" . ${"e_concerned" . $i} . ")");
+				for ($x =3D 0; $x < count($jr_internal); $x++)
 				{
-					$r.=3DHtmlInput::detail_op(${"e_concerned".$i},$jr_internal[$x]['jr=
_internal']);
+					$r.=3DHtmlInput::detail_op(${"e_concerned" . $i}, $jr_internal[$x][=
'jr_internal']);
 				}
 			}
-            $r.=3D'</td>';
-            // encode the pa
-            if ( $g_parameter->MY_ANALYTIC!=3D'nu' && preg_match("/^[6,7=
]/",$fTiers->strAttribut(ATTR_DEF_ACCOUNT))=3D=3D1 ) // use of AA
-            {
-                // show form
-                $anc_op=3Dnew Anc_Operation($this->db);
-                $null=3D($g_parameter->MY_ANALYTIC=3D=3D'op')?1:0;
-                $r.=3D'<td>';
-                $p_mode=3D1;
-                $p_array['pa_id']=3D$a_anc;
-                /* op is the operation it contains either a sequence or =
a jrnx.j_id */
-                $r.=3DHtmlInput::hidden('op[]=3D',$i);
-                $r.=3D$anc_op->display_form_plan($p_array,$null,$p_mode,=
$i,$tiers_amount);
-                $r.=3D'</td>';
-            }
+			$r.=3D'</td>';
+			// encode the pa
+			if ($g_parameter->MY_ANALYTIC !=3D 'nu' && preg_match("/^[6,7]/", $fT=
iers->strAttribut(ATTR_DEF_ACCOUNT)) =3D=3D 1) // use of AA
+			{
+				// show form
+				$anc_op =3D new Anc_Operation($this->db);
+				$null =3D ($g_parameter->MY_ANALYTIC =3D=3D 'op') ? 1 : 0;
+				$r.=3D'<td>';
+				$p_mode =3D 1;
+				$p_array['pa_id'] =3D $a_anc;
+				/* op is the operation it contains either a sequence or a jrnx.j_id =
*/
+				$r.=3DHtmlInput::hidden('op[]=3D', $i);
+				$r.=3D$anc_op->display_form_plan($p_array, $null, $p_mode, $i, $tier=
s_amount);
+				$r.=3D'</td>';
+			}
=20
-            $r.=3D'</TR>';
-        }
-        $r.=3D"</TABLE>";
+			$r.=3D'</TR>';
+		}
+		$r.=3D"</TABLE>";
=20
-        // saldo
-        $r.=3D'<br>Ancien solde =3D '.$solde;
-        $new_solde+=3D$tot_amount;
-        $r.=3D'<br>Nouveau solde =3D '.$new_solde;
-        $r.=3D'<br>Difference =3D'.$tot_amount;
-        // check for upload piece
-        $file=3Dnew IFile();
+		// saldo
+		$r.=3D'<br>Ancien solde =3D ' . $solde;
+		$new_solde+=3D$tot_amount;
+		$r.=3D'<br>Nouveau solde =3D ' . $new_solde;
+		$r.=3D'<br>Difference =3D' . $tot_amount;
+		// check for upload piece
+		$file =3D new IFile();
=20
-        $r.=3D"<br>Ajoutez une pi&egrave;ce justificative ";
-        $r.=3D$file->input("pj","");
+		$r.=3D"<br>Ajoutez une pi&egrave;ce justificative ";
+		$r.=3D$file->input("pj", "");
=20
-        $r.=3D'</fieldset>';
-        //--------------------------------------------------
-        // Hidden variables
-        //--------------------------------------------------
-        $r.=3Ddossier::hidden();
-        $r.=3DHtmlInput::hidden('p_jrn',$this->id);
-        $r.=3DHtmlInput::hidden('nb_item',$nb_item);
-        $r.=3DHtmlInput::hidden('last_sold',$last_sold);
-        $r.=3DHtmlInput::hidden('first_sold',$first_sold);
-        $r.=3DHtmlInput::hidden('e_pj',$e_pj);
-        $r.=3DHtmlInput::hidden('e_pj_suggest',$e_pj_suggest);
-        $r.=3DHtmlInput::hidden('e_date',$e_date);
-        $mt=3Dmicrotime(true);
-        $r.=3DHtmlInput::hidden('mt',$mt);
+		$r.=3D'</fieldset>';
+		//--------------------------------------------------
+		// Hidden variables
+		//--------------------------------------------------
+		$r.=3Ddossier::hidden();
+		$r.=3DHtmlInput::hidden('p_jrn', $this->id);
+		$r.=3DHtmlInput::hidden('nb_item', $nb_item);
+		$r.=3DHtmlInput::hidden('last_sold', $last_sold);
+		$r.=3DHtmlInput::hidden('first_sold', $first_sold);
+		$r.=3DHtmlInput::hidden('e_pj', $e_pj);
+		$r.=3DHtmlInput::hidden('e_pj_suggest', $e_pj_suggest);
+		$r.=3DHtmlInput::hidden('e_date', $e_date);
+		$mt =3D microtime(true);
+		$r.=3DHtmlInput::hidden('mt', $mt);
=20
-        if (isset($periode))    $r.=3DHtmlInput::hidden('periode',$perio=
de);
-        $r.=3Ddossier::hidden();
-        $r.=3DHtmlInput::hidden('sa','n');
-        for ($i=3D0; $i < $nb_item; $i++)
-        {
-            $tiers=3D(isset(${"e_other".$i}))?${"e_other".$i}:""
-                   ;
-            $r.=3DHtmlInput::hidden('e_other'.$i,$tiers);
-            $r.=3DHtmlInput::hidden('e_other'.$i.'_comment',${'e_other'.=
$i.'_comment'});
-            $r.=3DHtmlInput::hidden('e_other'.$i.'_amount',${'e_other'.$=
i.'_amount'});
-            $r.=3DHtmlInput::hidden('e_concerned'.$i,${'e_concerned'.$i}=
);
-        }
+		if (isset($periode))
+			$r.=3DHtmlInput::hidden('periode', $periode);
+		$r.=3Ddossier::hidden();
+		$r.=3DHtmlInput::hidden('sa', 'n');
+		for ($i =3D 0; $i < $nb_item; $i++)
+		{
+			$tiers =3D (isset(${"e_other" . $i})) ? ${"e_other" . $i} : ""
+			;
+			$r.=3DHtmlInput::hidden('e_other' . $i, $tiers);
+			$r.=3DHtmlInput::hidden('e_other' . $i . '_comment', ${'e_other' . $i=
 . '_comment'});
+			$r.=3DHtmlInput::hidden('e_other' . $i . '_amount', ${'e_other' . $i =
. '_amount'});
+			$r.=3DHtmlInput::hidden('e_concerned' . $i, ${'e_concerned' . $i});
+		}
=20
-        return $r;
-    }
-    /*!\brief save the data into the database, included the attachment,
-     *and the reconciliations
-     *\param $p_array usually $_POST
-     *\return string with HTML code
-     */
-    public function insert($p_array=3Dnull)
-    {
-        global $g_parameter;
+		return $r;
+	}
+
+	/* !\brief save the data into the database, included the attachment,
+	 * and the reconciliations
+	 * \param $p_array usually $_POST
+	 * \return string with HTML code
+	 */
+
+	public function insert($p_array =3D null)
+	{
+		global $g_parameter;
 		bcscale(2);
-        $internal_code=3D"";
-        $oid=3D0;
-        extract ($p_array);
-        $ret=3D'';
-        // Debit =3D banque
-        $bank_id=3D$this->get_bank();
-        $fBank=3Dnew Fiche($this->db,$bank_id);
-        $e_bank_account=3D$fBank->strAttribut(ATTR_DEF_QUICKCODE);
-        // Get the saldo
-        $pPeriode=3Dnew Periode($this->db);
-        if ( $this->check_periode() =3D=3D true )
-        {
-            $pPeriode->p_id=3D$periode;
-        }
-        else
-        {
-            $pPeriode->find_periode($e_date);
-        }
-        $exercice=3D$pPeriode->get_exercice();
+		$internal_code =3D "";
+		$oid =3D 0;
+		extract($p_array);
+		$ret =3D '';
+		// Debit =3D banque
+		$bank_id =3D $this->get_bank();
+		$fBank =3D new Fiche($this->db, $bank_id);
+		$e_bank_account =3D $fBank->strAttribut(ATTR_DEF_QUICKCODE);
+		// Get the saldo
+		$pPeriode =3D new Periode($this->db);
+		if ($this->check_periode() =3D=3D true)
+		{
+			$pPeriode->p_id =3D $periode;
+		}
+		else
+		{
+			$pPeriode->find_periode($e_date);
+		}
+		$exercice =3D $pPeriode->get_exercice();
=20
-        $filter_year=3D"  j_tech_per in (select p_id from parm_periode w=
here  p_exercice=3D'".$exercice."')";
-        $sposte=3D$fBank->strAttribut(ATTR_DEF_ACCOUNT);
-        // if 2 accounts, take only the debit one for customer
-        if ( strpos($sposte,',') !=3D 0 )
-        {
-            $array=3Dexplode(',',$sposte);
-            $poste_val=3D$array[0];
-        }
-        else
-        {
-            $poste_val=3D$sposte;
-        }
+		$filter_year =3D "  j_tech_per in (select p_id from parm_periode where=
  p_exercice=3D'" . $exercice . "')";
+		$sposte =3D $fBank->strAttribut(ATTR_DEF_ACCOUNT);
+		// if 2 accounts, take only the debit one for customer
+		if (strpos($sposte, ',') !=3D 0)
+		{
+			$array =3D explode(',', $sposte);
+			$poste_val =3D $array[0];
+		}
+		else
+		{
+			$poste_val =3D $sposte;
+		}
=20
-        $acc_account=3Dnew Acc_Account_Ledger($this->db,$poste_val);
-        $solde=3D$acc_account->get_solde($filter_year);
-        $new_solde=3D$solde;
+		$acc_account =3D new Acc_Account_Ledger($this->db, $poste_val);
+		$solde =3D $acc_account->get_solde($filter_year);
+		$new_solde =3D $solde;
=20
-        try
-        {
-            $this->db->start();
-            $amount=3D0.0;
-            $idx_operation=3D0;
-            $ret=3D'<table class=3D"result" style=3D"width:75%">';
-            $ret.=3Dtr(th('n=C2=B0 interne').th('Quick Code').th('Nom').=
th('Libell=C3=A9').th('Montant',' style=3D"text-align:right"'));
-            // Credit =3D goods
-            for ( $i =3D 0; $i < $nb_item;$i++)
-            {
-                // if tiers is set and amount !=3D 0 insert it into the =
database
-                // and quit the loop ?
-                if ( strlen(trim(${"e_other$i"}))=3D=3D0 ) continue;
-                $fPoste=3Dnew Fiche($this->db);
-                $fPoste->get_by_qcode(${"e_other$i"});
+		try
+		{
+			$this->db->start();
+			$amount =3D 0.0;
+			$idx_operation =3D 0;
+			$ret =3D '<table class=3D"result" style=3D"width:75%">';
+			$ret.=3Dtr(th('n=C2=B0 interne') . th('Quick Code') . th('Nom') . th(=
'Libell=C3=A9') . th('Montant', ' style=3D"text-align:right"'));
+			// Credit =3D goods
+			for ($i =3D 0; $i < $nb_item; $i++)
+			{
+				// if tiers is set and amount !=3D 0 insert it into the database
+				// and quit the loop ?
+				if (strlen(trim(${"e_other$i"})) =3D=3D 0)
+					continue;
+				$fPoste =3D new Fiche($this->db);
+				$fPoste->get_by_qcode(${"e_other$i"});
=20
-                // round it
-                ${"e_other$i"."_amount"}=3Dround( ${"e_other$i"."_amount=
"},2);
+				// round it
+				${"e_other$i" . "_amount"} =3D round(${"e_other$i" . "_amount"}, 2);
=20
=20
=20
-                $amount+=3D${"e_other$i"."_amount"};
-                // Record a line for the bank
-                // Compute the j_grpt
-                $seq=3D$this->db->get_next_seq('s_grpt');
+				$amount+=3D${"e_other$i" . "_amount"};
+				// Record a line for the bank
+				// Compute the j_grpt
+				$seq =3D $this->db->get_next_seq('s_grpt');
=20
-                $acc_operation=3Dnew Acc_Operation($this->db);
-                $acc_operation->date=3D$e_date;
-                $sposte=3D$fPoste->strAttribut(ATTR_DEF_ACCOUNT);
-                // if 2 accounts
-                if ( strpos($sposte,',') !=3D 0 )
-                {
-                    $array=3Dexplode(',',$sposte);
-                    if ( ${"e_other$i"."_amount"} < 0 )
-                        $poste_val=3D$array[1];
-                    else
-                        $poste_val=3D$array[0];
-                }
-                else
-                {
-                    $poste_val=3D$sposte;
-                }
+				$acc_operation =3D new Acc_Operation($this->db);
+				$acc_operation->date =3D $e_date;
+				$sposte =3D $fPoste->strAttribut(ATTR_DEF_ACCOUNT);
+				// if 2 accounts
+				if (strpos($sposte, ',') !=3D 0)
+				{
+					$array =3D explode(',', $sposte);
+					if (${"e_other$i" . "_amount"} < 0)
+						$poste_val =3D $array[1];
+					else
+						$poste_val =3D $array[0];
+				}
+				else
+				{
+					$poste_val =3D $sposte;
+				}
=20
=20
-                $acc_operation->poste=3D$poste_val;
-                $acc_operation->amount=3D${"e_other$i"."_amount"}*(-1);
-                $acc_operation->grpt=3D$seq;
-                $acc_operation->jrn=3D$p_jrn;
-                $acc_operation->type=3D'd';
+				$acc_operation->poste =3D $poste_val;
+				$acc_operation->amount =3D ${"e_other$i" . "_amount"} * (-1);
+				$acc_operation->grpt =3D $seq;
+				$acc_operation->jrn =3D $p_jrn;
+				$acc_operation->type =3D 'd';
=20
-                if ( isset($periode))
-                    $tperiode=3D$periode;
-                else
-                {
-                    $per=3Dnew Periode($this->db);
-                    $tperiode=3D$per->find_periode($e_date);
+				if (isset($periode))
+					$tperiode =3D $periode;
+				else
+				{
+					$per =3D new Periode($this->db);
+					$tperiode =3D $per->find_periode($e_date);
+				}
+				$acc_operation->periode =3D $tperiode;
+				$acc_operation->qcode =3D ${"e_other" . $i};
+				$j_id =3D $acc_operation->insert_jrnx();
=20
-                }
-                $acc_operation->periode=3D$tperiode;
-                $acc_operation->qcode=3D${"e_other".$i};
-                $j_id=3D$acc_operation->insert_jrnx();
+				$acc_operation =3D new Acc_Operation($this->db);
+				$acc_operation->date =3D $e_date;
+				$sposte =3D $fBank->strAttribut(ATTR_DEF_ACCOUNT);
=20
-                $acc_operation=3Dnew Acc_Operation($this->db);
-                $acc_operation->date=3D$e_date;
-                $sposte=3D$fBank->strAttribut(ATTR_DEF_ACCOUNT);
+				// if 2 accounts
+				if (strpos($sposte, ',') !=3D 0)
+				{
+					$array =3D explode(',', $sposte);
+					if (${"e_other$i" . "_amount"} < 0)
+						$poste_val =3D $array[1];
+					else
+						$poste_val =3D $array[0];
+				}
+				else
+				{
+					$poste_val =3D $sposte;
+				}
=20
-                // if 2 accounts
-                if ( strpos($sposte,',') !=3D 0 )
-                {
-                    $array=3Dexplode(',',$sposte);
-                    if ( ${"e_other$i"."_amount"} < 0 )
-                        $poste_val=3D$array[1];
-                    else
-                        $poste_val=3D$array[0];
-                }
-                else
-                {
-                    $poste_val=3D$sposte;
-                }
+				$acc_operation->poste =3D $poste_val;
+				$acc_operation->amount =3D ${"e_other$i" . "_amount"};
+				$acc_operation->grpt =3D $seq;
+				$acc_operation->jrn =3D $p_jrn;
+				$acc_operation->type =3D 'd';
+				$acc_operation->periode =3D $tperiode;
+				$acc_operation->qcode =3D $e_bank_account;
+				$acc_operation->insert_jrnx();
=20
-                $acc_operation->poste=3D$poste_val;
-                $acc_operation->amount=3D${"e_other$i"."_amount"};
-                $acc_operation->grpt=3D$seq;
-                $acc_operation->jrn=3D$p_jrn;
-                $acc_operation->type=3D'd';
-                $acc_operation->periode=3D$tperiode;
-                $acc_operation->qcode=3D$e_bank_account;
-                $acc_operation->insert_jrnx();
=20
+				if (sql_string(${"e_other$i" . "_comment"}) =3D=3D null)
+				{
+					// if comment is blank set a default one
+					$comment =3D "  compte : " . $fBank->strAttribut(ATTR_DEF_NAME) . '=
 a ' .
+							$fPoste->strAttribut(ATTR_DEF_NAME);
+				}
+				else
+				{
+					$comment =3D ${'e_other' . $i . '_comment'};
+				}
=20
-                if ( sql_string(${"e_other$i"."_comment"}) =3D=3D null )
-                {
-                    // if comment is blank set a default one
-                    $comment=3D"  compte : ".$fBank->strAttribut(ATTR_DE=
F_NAME).' a '.
-                             $fPoste->strAttribut(ATTR_DEF_NAME);
-                }
-                else
-                {
-                    $comment=3D${'e_other'.$i.'_comment'};
-                }
=20
+				$acc_operation =3D new Acc_Operation($this->db);
+				$acc_operation->jrn =3D $p_jrn;
+				$acc_operation->amount =3D abs(${"e_other$i" . "_amount"});
+				$acc_operation->date =3D $e_date;
+				$acc_operation->desc =3D $comment;
+				$acc_operation->grpt =3D $seq;
+				$acc_operation->periode =3D $tperiode;
+				$acc_operation->mt =3D $mt;
+				$idx_operation++;
+				$acc_operation->pj =3D '';
=20
-                $acc_operation=3Dnew Acc_Operation($this->db);
-                $acc_operation->jrn=3D$p_jrn;
-                $acc_operation->amount=3Dabs(${"e_other$i"."_amount"});
-                $acc_operation->date=3D$e_date;
-                $acc_operation->desc=3D$comment;
-                $acc_operation->grpt=3D$seq;
-                $acc_operation->periode=3D$tperiode;
-                $acc_operation->mt=3D$mt;
-                $idx_operation++;
-                $acc_operation->pj=3D'';
+				if (trim($e_pj) !=3D '' && $this->numb_operation() =3D=3D true)
+					$acc_operation->pj =3D $e_pj . str_pad($idx_operation, 3, 0, STR_PA=
D_LEFT);
=20
-                if ( trim($e_pj) !=3D '' && $this->numb_operation()=3D=3D=
true)
-                    $acc_operation->pj=3D$e_pj.str_pad($idx_operation,3,=
0,STR_PAD_LEFT);
+				if (trim($e_pj) !=3D '' && $this->numb_operation() =3D=3D false)
+					$acc_operation->pj =3D $e_pj;
=20
-                if ( trim($e_pj) !=3D '' && $this->numb_operation()=3D=3D=
false)
-                    $acc_operation->pj=3D$e_pj;
+				$jr_id =3D $acc_operation->insert_jrn();
+				// 	  $acc_operation->set_pj();
+				$this->db->exec_sql('update jrn set jr_pj_number=3D$1 where jr_id=3D=
$2', array($acc_operation->pj, $jr_id));
+				$internal =3D $this->compute_internal_code($seq);
=20
-                $jr_id=3D$acc_operation->insert_jrn();
-                // 	  $acc_operation->set_pj();
-                $this->db->exec_sql('update jrn set jr_pj_number=3D$1 wh=
ere jr_id=3D$2',
-                                    array($acc_operation->pj,$jr_id));
-                $internal=3D$this->compute_internal_code($seq);
=20
+				if (trim(${"e_concerned" . $i}) !=3D "")
+				{
+					if (strpos(${"e_concerned" . $i}, ',') !=3D 0)
+					{
+						$aRapt =3D explode(',', ${"e_concerned" . $i});
+						foreach ($aRapt as $rRapt)
+						{
+							// Add a "concerned operation to bound these op.together
+							//
+                            $rec =3D new Acc_Reconciliation($this->db);
+							$rec->set_jr_id($jr_id);
=20
-                if ( trim(${"e_concerned".$i}) !=3D "" )
-                {
-                    if ( strpos(${"e_concerned".$i},',') !=3D 0 )
-                    {
-                        $aRapt=3Dexplode(',',${"e_concerned".$i});
-                        foreach ($aRapt as $rRapt)
-                        {
-                            // Add a "concerned operation to bound these=
 op.together
-                            //
-                            $rec=3Dnew Acc_Reconciliation ($this->db);
-                            $rec->set_jr_id($jr_id);
+							if (isNumber($rRapt) =3D=3D 1)
+							{
+								$rec->insert($rRapt);
+							}
+						}
+					}
+					else
+					if (isNumber(${"e_concerned" . $i}) =3D=3D 1)
+					{
+						$rec =3D new Acc_Reconciliation($this->db);
+						$rec->set_jr_id($jr_id);
+						$rec->insert(${"e_concerned$i"});
+					}
+				}
=20
-                            if ( isNumber($rRapt) =3D=3D 1 )
-                            {
-                                $rec->insert($rRapt);
-                            }
-                        }
-                    }
-                    else
-                        if ( isNumber(${"e_concerned".$i}) =3D=3D 1 )
-                        {
-                            $rec=3Dnew Acc_Reconciliation ($this->db);
-                            $rec->set_jr_id($jr_id);
-                            $rec->insert(${"e_concerned$i"});
-                        }
-                }
+				// Set Internal code
+				$this->grpt_id =3D $seq;
+				/**
+				 * save also into quant_fin
+				 */
+				$this->insert_quant_fin($fBank->id, $jr_id, $fPoste->id, ${"e_other$=
i" . "_amount"});
=20
-                // Set Internal code
-                $this->grpt_id=3D$seq;
-                /**
-                 * save also into quant_fin
-                 */
-		$this->insert_quant_fin($fBank->id,$jr_id,$fPoste->id,${"e_other$i"."_=
amount"});
+				if ($g_parameter->MY_ANALYTIC !=3D "nu")
+				{
+					// for each item, insert into operation_analytique */
+					$op =3D new Anc_Operation($this->db);
+					$op->oa_group =3D $this->db->get_next_seq("s_oa_group"); /* for ana=
lytic */
+					$op->j_id =3D $j_id;
+					$op->oa_date =3D $e_date;
+					$op->oa_debit =3D ($amount < 0 ) ? 't' : 'f';
+					$op->oa_description =3D sql_string($comment);
+					$op->save_form_plan($_POST, $i, $j_id);
+				}
=20
-                if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
-                {
-                    // for each item, insert into operation_analytique *=
/
-                    $op=3Dnew Anc_Operation($this->db);
-					$op->oa_group=3D$this->db->get_next_seq("s_oa_group"); /* for analy=
tic */
-                    $op->j_id=3D$j_id;
-                    $op->oa_date=3D$e_date;
-                    $op->oa_debit=3D($amount < 0 )?'t':'f';
-                    $op->oa_description=3Dsql_string($comment);
-                    $op->save_form_plan($_POST,$i,$j_id);
-                }
=20
+				$this->update_internal_code($internal);
=20
-                $this->update_internal_code($internal);
-
-				$js_detail=3D  HtmlInput::detail_op($jr_id, $internal);
+				$js_detail =3D HtmlInput::detail_op($jr_id, $internal);
 				// Compute display
-                $row=3Dtd($js_detail).td(${"e_other$i"}).td($fPoste->str=
Attribut(ATTR_DEF_NAME)).td(${"e_other".$i."_comment"}).td(nbm(${"e_other=
$i"."_amount"}),'class=3D"num"');
+				$row =3D td($js_detail) . td(${"e_other$i"}) . td($fPoste->strAttrib=
ut(ATTR_DEF_NAME)) . td(${"e_other" . $i . "_comment"}) . td(nbm(${"e_oth=
er$i" . "_amount"}), 'class=3D"num"');
=20
-                $ret.=3Dtr($row);
+				$ret.=3Dtr($row);
=20
=20
-                if ( $i =3D=3D 0 )
-                {
-                    // first record we upload the files and
-                    // keep variable to update other row of jrn
-                    if ( isset ($_FILES))
-                        $oid=3D$this->db->save_upload_document($seq);
+				if ($i =3D=3D 0)
+				{
+					// first record we upload the files and
+					// keep variable to update other row of jrn
+					if (isset($_FILES))
+						$oid =3D $this->db->save_upload_document($seq);
+				}
+				else
+				{
+					if ($oid !=3D 0)
+					{
+						$this->db->exec_sql("update jrn set jr_pj=3D" . $oid . ", jr_pj_na=
me=3D'" . $_FILES['pj']['name'] . "', " .
+								"jr_pj_type=3D'" . $_FILES['pj']['type'] . "'  where jr_grpt_id=3D=
$seq");
+					}
+				}
+			} // for nbitem
+			// increment pj
+			if (strlen(trim($e_pj)) !=3D 0)
+			{
+				$this->inc_seq_pj();
+			}
+			$ret.=3D'</table>';
+		}
+		catch (Exception $e)
+		{
+			echo '<span class=3D"error">' .
+			'Erreur dans l\'enregistrement ' .
+			__FILE__ . ':' . __LINE__ . ' ' .
+			$e->getMessage();
+			$this->db->rollback();
+			exit();
+		}
+		$this->db->commit();
+		$r =3D "";
+		$r.=3D"<br>Ancien solde " . nbm($solde);
+		$new_solde =3D bcadd($new_solde, $amount);
+		$r.=3D"<br>Nouveau solde " . nbm($new_solde);
+		$ret.=3D$r;
+		return $ret;
+	}
=20
-                }
-                else
-                {
-                    if ( $oid  !=3D 0 )
-                    {
-                        $this->db->exec_sql("update jrn set jr_pj=3D".$o=
id.", jr_pj_name=3D'".$_FILES['pj']['name']."', ".
-                                            "jr_pj_type=3D'".$_FILES['pj=
']['type']."'  where jr_grpt_id=3D$seq");
-                    }
-                }
+	/* !\brief display operation of a FIN ledger
+	 * \return html code into a string
+	 */
=20
-            } // for nbitem
-            // increment pj
-            if ( strlen(trim($e_pj)) !=3D0 )
-            {
-                $this->inc_seq_pj();
-            }
-            $ret.=3D'</table>';
-        }
-        catch (Exception $e)
-        {
-            echo '<span class=3D"error">'.
-            'Erreur dans l\'enregistrement '.
-            __FILE__.':'.__LINE__.' '.
-            $e->getMessage();
-            $this->db->rollback();
-            exit();
+	function show_ledger()
+	{
+		global $g_user;
+		echo dossier::hidden();
+		$hid =3D new IHidden();
=20
-        }
-        $this->db->commit();
-        $r=3D"";
-        $r.=3D"<br>Ancien solde ".nbm($solde);
-        $new_solde=3Dbcadd($new_solde,$amount);
-        $r.=3D"<br>Nouveau solde ".nbm($new_solde);
-        $ret.=3D$r;
-        return $ret;
-    }
-    /*!\brief display operation of a FIN ledger
-     *\return html code into a string
-     */
-    function show_ledger()
-    {
-        global $g_user;
-        echo dossier::hidden();
-        $hid=3Dnew IHidden();
+		$hid->name =3D "p_action";
+		$hid->value =3D "bank";
+		echo $hid->input();
=20
-        $hid->name=3D"p_action";
-        $hid->value=3D"bank";
-        echo $hid->input();
=20
+		$hid->name =3D "sa";
+		$hid->value =3D "l";
+		echo $hid->input();
=20
-        $hid->name=3D"sa";
-        $hid->value=3D"l";
-        echo $hid->input();
=20
+		$w =3D new ISelect();
+		// filter on the current year
+		$filter_year =3D " where p_exercice=3D'" . $g_user->get_exercice() . "=
'";
=20
-        $w=3Dnew ISelect();
-        // filter on the current year
-        $filter_year=3D" where p_exercice=3D'".$g_user->get_exercice()."=
'";
+		$periode_start =3D $this->db->make_array("select p_id,to_char(p_start,=
'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end", 1);
+		// User is already set User=3Dnew User($this->db);
+		$current =3D (isset($_GET['p_periode'])) ? $_GET['p_periode'] : -1;
+		$w->selected =3D $current;
=20
-        $periode_start=3D$this->db->make_array("select p_id,to_char(p_st=
art,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",=
1);
-        // User is already set User=3Dnew User($this->db);
-        $current=3D(isset($_GET['p_periode']))?$_GET['p_periode']:-1;
-        $w->selected=3D$current;
+		echo '<form>';
+		echo 'P=C3=A9riode  ' . $w->input("p_periode", $periode_start);
+		$wLedger =3D $this->select_ledger('fin', 3);
=20
-        echo '<form>';
-        echo 'P=C3=A9riode  '.$w->input("p_periode",$periode_start);
-        $wLedger=3D$this->select_ledger('fin',3);
+		if ($wLedger =3D=3D null)
+			exit(_('Pas de journal disponible'));
=20
-        if ($wLedger =3D=3D null) exit (_('Pas de journal disponible'));
+		if (count($wLedger->value) > 1)
+		{
+			$aValue =3D $wLedger->value;
+			$wLedger->value[0] =3D array('value' =3D> -1, 'label' =3D> _('Tous le=
s journaux financiers'));
+			$idx =3D 1;
+			foreach ($aValue as $a)
+			{
+				$wLedger->value[$idx] =3D $a;
+				$idx++;
+			}
+		}
=20
-        if ( count($wLedger->value) > 1)
-        {
-            $aValue=3D$wLedger->value;
-            $wLedger->value[0]=3Darray('value'=3D>-1,'label'=3D>_('Tous =
les journaux financiers'));
-            $idx=3D1;
-            foreach ($aValue as $a)
-            {
-                $wLedger->value[$idx]=3D$a;
-                $idx++;
-            }
-        }
=20
=20
+		echo 'Journal ' . $wLedger->input();
+		$w =3D new ICard();
+		$w->noadd =3D 'no';
+		$w->jrn =3D $this->id;
+		$qcode =3D (isset($_GET['qcode'])) ? $_GET['qcode'] : "";
+		echo dossier::hidden();
+		echo HtmlInput::hidden('p_action', 'bank');
+		echo HtmlInput::hidden('sa', 'l');
+		$w->name =3D 'qcode';
+		$w->value =3D $qcode;
+		$w->label =3D '';
+		$this->type =3D 'FIN';
+		$all =3D $this->get_all_fiche_def();
+		$w->extra =3D $all;
+		$w->extra2 =3D 'QuickCode';
+		$sp =3D new ISpan();
+		echo $sp->input("qcode_label", "", $qcode);
+		echo $w->input();
=20
-        echo 'Journal '.$wLedger->input();
-        $w=3Dnew ICard();
-        $w->noadd=3D'no';
-        $w->jrn=3D$this->id;
-        $qcode=3D(isset($_GET['qcode']))?$_GET['qcode']:"";
-        echo dossier::hidden();
-        echo HtmlInput::hidden('p_action','bank');
-        echo HtmlInput::hidden('sa','l');
-        $w->name=3D'qcode';
-        $w->value=3D$qcode;
-        $w->label=3D'';
-        $this->type=3D'FIN';
-        $all=3D$this->get_all_fiche_def();
-        $w->extra=3D$all;
-        $w->extra2=3D'QuickCode';
-        $sp=3Dnew ISpan();
-        echo $sp->input("qcode_label","",$qcode);
-        echo $w->input();
+		echo HtmlInput::submit('gl_submit', _('Rechercher'));
+		echo '</form>';
=20
-        echo HtmlInput::submit('gl_submit',_('Rechercher'));
-        echo '</form>';
+		// Show list of sell
+		// Date - date of payment - Customer - amount
+		if ($current !=3D -1)
+		{
+			$filter_per =3D " and jr_tech_per=3D" . $current;
+		}
+		else
+		{
+			$filter_per =3D " and jr_tech_per in (select p_id from parm_periode w=
here p_exercice::integer=3D" .
+					$g_user->get_exercice() . ")";
+		}
+		/* security  */
+		if ($this->id !=3D -1)
+			$available_ledger =3D " and jr_def_id=3D " . $this->id . " and " . $g=
_user->get_ledger_sql();
+		else
+			$available_ledger =3D " and " . $g_user->get_ledger_sql();
+		// Show list of sell
+		// Date - date of payment - Customer - amount
+		$sql =3D SQL_LIST_ALL_INVOICE . $filter_per . " and jr_def_type=3D'FIN=
'" .
+				" $available_ledger";
+		$step =3D $_SESSION['g_pagesize'];
+		$page =3D (isset($_GET['offset'])) ? $_GET['page'] : 1;
+		$offset =3D (isset($_GET['offset'])) ? $_GET['offset'] : 0;
=20
-        // Show list of sell
-        // Date - date of payment - Customer - amount
-        if ( $current !=3D -1 )
-        {
-            $filter_per=3D" and jr_tech_per=3D".$current;
-        }
-        else
-        {
-            $filter_per=3D" and jr_tech_per in (select p_id from parm_pe=
riode where p_exercice::integer=3D".
-                        $g_user->get_exercice().")";
-        }
-        /* security  */
-        if( $this->id !=3D -1)
-            $available_ledger=3D" and jr_def_id=3D ".$this->id." and ".$=
g_user->get_ledger_sql();
-        else
-            $available_ledger=3D" and ".$g_user->get_ledger_sql();
-        // Show list of sell
-        // Date - date of payment - Customer - amount
-        $sql=3DSQL_LIST_ALL_INVOICE.$filter_per." and jr_def_type=3D'FIN=
'".
-             " $available_ledger" ;
-        $step=3D$_SESSION['g_pagesize'];
-        $page=3D(isset($_GET['offset']))?$_GET['page']:1;
-        $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
+		$l =3D "";
=20
-        $l=3D"";
+		// check if qcode contains something
+		if ($qcode !=3D "")
+		{
+			// add a condition to filter on the quick code
+			$l =3D " and jr_grpt_id in (select j_grpt from jrnx where j_qcode=3Du=
pper('$qcode')) ";
+		}
=20
-        // check if qcode contains something
-        if ( $qcode !=3D "" )
-        {
-            // add a condition to filter on the quick code
-            $l=3D" and jr_grpt_id in (select j_grpt from jrnx where j_qc=
ode=3Dupper('$qcode')) ";
-        }
+		list($max_line, $list) =3D ListJrn($this->db, "where jrn_def_type=3D'F=
IN' $filter_per $l $available_ledger "
+				, null, $offset, 0);
+		$bar =3D jrn_navigation_bar($offset, $max_line, $step, $page);
=20
-        list($max_line,$list)=3DListJrn($this->db,"where jrn_def_type=3D=
'FIN' $filter_per $l $available_ledger "
-                                      ,null,$offset,0);
-        $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+		echo "<hr> $bar";
+		echo $list;
+		echo "$bar <hr>";
+	}
=20
-        echo "<hr> $bar";
-        echo $list;
-        echo "$bar <hr>";
-    }
-    /**
-     * return a string with the bank account, name and quick_code
-     */
-    function get_bank_name()
-    {
-		$this->bank_id=3D$this->db->get_value('select jrn_def_bank from jrn_de=
f where jrn_def_id=3D$1',
-                                      array($this->id));
-        $fBank=3Dnew Fiche($this->db,$this->bank_id);
-        $e_bank_account=3D" : ".$fBank->strAttribut(ATTR_DEF_BQ_NO);
-        $e_bank_name=3D" : ".$fBank->strAttribut(ATTR_DEF_NAME);
-        $e_bank_qcode=3D": ".$fBank->strAttribut(ATTR_DEF_QUICKCODE);
-        return $e_bank_qcode.$e_bank_name.$e_bank_account;
-    }
-    /**
-     *return the fiche_id of the bank
-     */
-    function get_bank()
-    {
-        $bank_id=3D$this->db->get_value('select jrn_def_bank from jrn_de=
f where jrn_def_id=3D$1',
-                                      array($this->id));
-        return $bank_id;
-    }
-    /**
-     *return true is we numbere each operation
-     */
-    function numb_operation()
-    {
-        $a=3D$this->db->get_value('select jrn_def_num_op from jrn_def wh=
ere jrn_def_id=3D$1',
-                                array($this->id));
-        if ($a=3D=3D1) return true;
-        return false;
-    }
-  /**
-   * insert into the quant_fin table
-   *@param $bank_id is the f_id of the bank
-   *@param $jr_id is the jrn.jr_id of the operation
-   *@param $other is the f_id of the benefit
-   *@param $amount is the amount
-   */
-  function insert_quant_fin($p_bankid,$p_jrid,$p_otherid,$p_amount)
-  {
-    $sql=3D"INSERT INTO quant_fin(qf_bank, jr_id, qf_other, qf_amount)
+	/**
+	 * return a string with the bank account, name and quick_code
+	 */
+	function get_bank_name()
+	{
+		$this->bank_id =3D $this->db->get_value('select jrn_def_bank from jrn_=
def where jrn_def_id=3D$1', array($this->id));
+		$fBank =3D new Fiche($this->db, $this->bank_id);
+		$e_bank_account =3D " : " . $fBank->strAttribut(ATTR_DEF_BQ_NO);
+		$e_bank_name =3D " : " . $fBank->strAttribut(ATTR_DEF_NAME);
+		$e_bank_qcode =3D ": " . $fBank->strAttribut(ATTR_DEF_QUICKCODE);
+		return $e_bank_qcode . $e_bank_name . $e_bank_account;
+	}
+
+	/**
+	 * return the fiche_id of the bank
+	 */
+	function get_bank()
+	{
+		$bank_id =3D $this->db->get_value('select jrn_def_bank from jrn_def wh=
ere jrn_def_id=3D$1', array($this->id));
+		return $bank_id;
+	}
+
+	/**
+	 * return true is we numbere each operation
+	 */
+	function numb_operation()
+	{
+		$a =3D $this->db->get_value('select jrn_def_num_op from jrn_def where =
jrn_def_id=3D$1', array($this->id));
+		if ($a =3D=3D 1)
+			return true;
+		return false;
+	}
+
+	/**
+	 * insert into the quant_fin table
+	 * @param $bank_id is the f_id of the bank
+	 * @param $jr_id is the jrn.jr_id of the operation
+	 * @param $other is the f_id of the benefit
+	 * @param $amount is the amount
+	 */
+	function insert_quant_fin($p_bankid, $p_jrid, $p_otherid, $p_amount)
+	{
+		$sql =3D "INSERT INTO quant_fin(qf_bank, jr_id, qf_other, qf_amount)
                    VALUES ($1, $2, $3, $4);";
=20
-    $this->db->exec_sql($sql,array($p_bankid,$p_jrid,$p_otherid,round($p=
_amount,2)));
-  }
+		$this->db->exec_sql($sql, array($p_bankid, $p_jrid, $p_otherid, round(=
$p_amount, 2)));
+	}
+
 }



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 09:09:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sgbhz-0007k8-T0
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 09:09:31 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 15:00:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203241.1340024970.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4930 - in phpcompta/trunk: html/js include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 13:09:30 -0000

Author: danydb
Date: 2012-06-18 15:00:28 +0200 (Mon, 18 Jun 2012)
New Revision: 4930

Modified:
   phpcompta/trunk/html/js/acc_ledger.js
   phpcompta/trunk/html/js/infobulle.js
   phpcompta/trunk/include/class_acc_ledger_fin.php
Log:
0000530: Ajouter la possibilit?\195?\169 d'entrer une date par op?\195?\1=
69ration dans la saisie du journal de banque

Prep. code comment?\195?\169, probl?\195?\168me avec Acc_Ledger_Fin

Modified: phpcompta/trunk/html/js/acc_ledger.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/acc_ledger.js	2012-06-18 12:37:13 UTC (rev 49=
29)
+++ phpcompta/trunk/html/js/acc_ledger.js	2012-06-18 13:00:28 UTC (rev 49=
30)
@@ -252,6 +252,7 @@
         new_tt=3Dnew_tt.replace(/e_other0_amount/g,"e_other"+nb.value+'_=
amount');
         new_tt=3Dnew_tt.replace(/e_concerned0/g,"e_concerned"+nb.value);
         new_tt=3Dnew_tt.replace(/e_other0_label/g,"e_other"+nb.value+'_l=
abel');
+        // new_tt=3Dnew_tt.replace(/dateop0/g,"date"+nb.value);
         newCell.innerHTML=3Dnew_tt;
         new_tt.evalScripts();
     }

Modified: phpcompta/trunk/html/js/infobulle.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/infobulle.js	2012-06-18 12:37:13 UTC (rev 492=
9)
+++ phpcompta/trunk/html/js/infobulle.js	2012-06-18 13:00:28 UTC (rev 493=
0)
@@ -43,6 +43,7 @@
 content[13]=3D"Vous pouvez utiliser le % pour indiquer le poste parent";
 content[14]=3D"Attention, le poste comptable doit exister, il ne sera pa=
s v=C3=A9rifi=C3=A9";
 content[15]=3D"Laissez =C3=A0 0 pour ne rien changer";
+content[16]=3D"Si vous ne remplissez pas la date d'op=C3=A9ration, ce se=
ra la date de l'extrait qui sera utilis=C3=A9e";
=20
 function showBulle(p_ctl)
 {

Modified: phpcompta/trunk/include/class_acc_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-18 12:37:13 =
UTC (rev 4929)
+++ phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-18 13:00:28 =
UTC (rev 4930)
@@ -311,12 +311,15 @@
 		// Parse each " tiers"
 		for ($i =3D 0; $i < $max; $i++)
 		{
-			$tiers =3D (isset(${"e_other" . $i})) ? ${"e_other" . $i} : ""
-			;
+			$tiers =3D (isset(${"e_other" . $i})) ? ${"e_other" . $i} : "";
+
 			$tiers_amount =3D (isset(${"e_other$i" . "_amount"})) ? round(${"e_ot=
her$i" . "_amount"}, 2) : 0;
=20
-			$tiers_comment =3D (isset(${"e_other$i" . "_comment"})) ? ${"e_other$=
i" . "_comment"} : ""
-			;
+			$tiers_comment =3D (isset(${"e_other$i" . "_comment"})) ? ${"e_other$=
i" . "_comment"} : "";
+
+			$operation_date=3Dnew IDate("dateop".$i);
+			$operation_date->value=3D(isset(${'dateop'.$i}))?${'dateop'.$i}:"";
+			$array[$i]['dateop']=3D$operation_date->input();
 			${"e_other$i" . "_amount"} =3D (isset(${"e_other$i" . "_amount"})) ? =
${"e_other$i" . "_amount"} : 0;
=20
 			$W1 =3D new ICard();
@@ -342,7 +345,7 @@
=20
 			// Card name
 			//
-	    $card_name =3D "";
+			 $card_name =3D "";
 			if ($tiers !=3D "")
 			{
 				$fiche =3D new Fiche($this->db);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 11:52:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgeFy-00055V-9J
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 11:52:46 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 17:43:43 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203569.1340034765.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4931 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 15:52:45 -0000

Author: danydb
Date: 2012-06-18 17:43:42 +0200 (Mon, 18 Jun 2012)
New Revision: 4931

Modified:
   phpcompta/trunk/html/ajax_misc.php
Log:
Indent properly

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-18 13:00:28 UTC (rev 4930)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-18 15:43:42 UTC (rev 4931)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -57,7 +58,7 @@
 	exit();
 extract($_REQUEST);
 set_language();
-global $g_user,$cn,$g_parameter;
+global $g_user, $cn, $g_parameter;
 $cn =3D new Database($gDossier);
 $g_user =3D new User($cn);
 $g_user->check(true);
@@ -67,11 +68,13 @@
 switch ($op)
 {
 	case "remove_anc":
-	  if ($g_user->check_module('ANCODS') =3D=3D 0) exit();
-			$cn->exec_sql("delete from operation_analytique where oa_group=3D$1",=
 array($_GET['oa']));
+		if ($g_user->check_module('ANCODS') =3D=3D 0)
+			exit();
+		$cn->exec_sql("delete from operation_analytique where oa_group=3D$1", =
array($_GET['oa']));
 		break;
 	case "rm_stock":
-	  if ($g_user->check_module('STOCK') =3D=3D 0) exit();
+		if ($g_user->check_module('STOCK') =3D=3D 0)
+			exit();
 		require_once('constant.security.php');
 		$cn->exec_sql('delete from stock_goods where sg_id=3D$1', array($s_id)=
);
 		$html =3D escape_xml($s_id);
@@ -171,9 +174,9 @@
 EOF;
 		return;
 		break;
-        case 'mod_cat_doc':
-	  require_once 'template/document_mod_change.php';
-	  break;
+	case 'mod_cat_doc':
+		require_once 'template/document_mod_change.php';
+		break;
 	case 'dsp_tva':
 		$cn =3D new Database($gDossier);
 		$Res =3D $cn->exec_sql("select * from tva_rate order by tva_rate desc"=
);
@@ -264,7 +267,8 @@
 	case 'dl':
 		require_once('class_lettering.php');
 		$exercice =3D $g_user->get_exercice();
-        if ($g_user->check_module("LETCARD") =3D=3D 0 && $g_user->check_=
module("LETACC") =3D=3D 0) exit();
+		if ($g_user->check_module("LETCARD") =3D=3D 0 && $g_user->check_module=
("LETACC") =3D=3D 0)
+			exit();
 		$periode =3D new Periode($cn);
 		list($first_per, $last_per) =3D $periode->get_limit($exercice);
=20
@@ -497,59 +501,59 @@
 		require_once 'ajax_add_menu.php';
 		break;
 	case 'add_plugin':
-		$me_code=3Dnew IText('me_code');
-		$me_file=3Dnew IText('me_file');
-		$me_menu=3Dnew IText('me_menu');
-		$me_description=3Dnew IText("me_description");
-		$me_parameter=3Dnew IText("me_parameter");
-		$new=3Dtrue;
+		$me_code =3D new IText('me_code');
+		$me_file =3D new IText('me_file');
+		$me_menu =3D new IText('me_menu');
+		$me_description =3D new IText("me_description");
+		$me_parameter =3D new IText("me_parameter");
+		$new =3D true;
 		require_once 'ajax_plugin_detail.php';
 		break;
 	case 'mod_plugin':
-		$m=3D$cn->get_array("select me_code,me_file,me_menu,me_description,me_=
parameter
-			from menu_ref where me_code=3D$1",array($me_code));
-		if ( empty($m))
+		$m =3D $cn->get_array("select me_code,me_file,me_menu,me_description,m=
e_parameter
+			from menu_ref where me_code=3D$1", array($me_code));
+		if (empty($m))
 		{
 			echo HtmlInput::title_box("Ce plugin n'existe pas ", $ctl);
 			echo "<p>Il y a une erreur, ce plugin n'existe pas";
 			exit;
 		}
-		$me_code=3Dnew IText('me_code',$m[0] ['me_code']);
-		$me_file=3Dnew IText('me_file',$m[0] ['me_file']);
-		$me_menu=3Dnew IText('me_menu',$m[0] ['me_menu']);
-		$me_description=3Dnew IText("me_description",$m[0] ['me_description'])=
;
-		$me_parameter=3Dnew IText("me_parameter",$m[0] ['me_parameter']);
-		$new=3Dfalse;
+		$me_code =3D new IText('me_code', $m[0] ['me_code']);
+		$me_file =3D new IText('me_file', $m[0] ['me_file']);
+		$me_menu =3D new IText('me_menu', $m[0] ['me_menu']);
+		$me_description =3D new IText("me_description", $m[0] ['me_description=
']);
+		$me_parameter =3D new IText("me_parameter", $m[0] ['me_parameter']);
+		$new =3D false;
 		require_once 'ajax_plugin_detail.php';
 		break;
-	 case 'saldo':
-		 require_once 'ajax_bank_saldo.php';
-		 break;
-	 case 'up_predef':
-		 require_once 'ajax_update_predef.php';
-		 break;
-	 case 'upd_receipt':
-		 require_once 'ajax_get_receipt.php';
-		 break;
-	 case 'up_pay_method':
-		 require_once 'ajax_update_payment.php';
+	case 'saldo':
+		require_once 'ajax_bank_saldo.php';
 		break;
+	case 'up_predef':
+		require_once 'ajax_update_predef.php';
+		break;
+	case 'upd_receipt':
+		require_once 'ajax_get_receipt.php';
+		break;
+	case 'up_pay_method':
+		require_once 'ajax_update_payment.php';
+		break;
 	case 'openancsearch':
 	case 'resultancsearch':
 		require_once('ajax_anc_search.php');
 		break;
 	case 'autoanc':
-		require_once 'ajax_auto_anc_card.php' ;
+		require_once 'ajax_auto_anc_card.php';
 		break;
-        case 'create_menu';
-            require_once 'ajax_create_menu.php';
-            break;
-        case 'modify_menu';
-            require_once 'ajax_mod_menu.php';
-            break;
-		case 'mod_stock_repo':
+	case 'create_menu';
+		require_once 'ajax_create_menu.php';
+		break;
+	case 'modify_menu';
+		require_once 'ajax_mod_menu.php';
+		break;
+	case 'mod_stock_repo':
 		require_once 'ajax_mod_stock_repo.php';
 		break;
-        default:
-            var_dump($_GET);
+	default:
+		var_dump($_GET);
 }



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 12:15:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgebZ-00065V-5j
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 12:15:05 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 18:06:00 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203955.1340036104.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4932 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 16:15:04 -0000

Author: danydb
Date: 2012-06-18 18:06:00 +0200 (Mon, 18 Jun 2012)
New Revision: 4932

Modified:
   phpcompta/trunk/include/template/form_ledger_fin.php
Log:
0000530: Ajouter la possibilit?\195?\169 d'entrer une date par op?\195?\1=
69ration dans la saisie du journal de banque

Prep. code comment?\195?\169, probl?\195?\168me avec Acc_Ledger_Fin

Modified: phpcompta/trunk/include/template/form_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/form_ledger_fin.php	2012-06-18 15:43=
:42 UTC (rev 4931)
+++ phpcompta/trunk/include/template/form_ledger_fin.php	2012-06-18 16:06=
:00 UTC (rev 4932)
@@ -21,6 +21,7 @@
    <fieldset><legend><?=3D_('Op=C3=A9rations')?></legend>
 <table id=3D"fin_item" width=3D"100%" border=3D"0">
 <tr>
+<!--<th style=3D"text-align: left"><?=3D_('Date')?><?=3DHtmlInput::infob=
ulle(16)?></TH> -->
 <th style=3D"text-align: left;width: auto">code<?HtmlInput::infobulle(0)=
?></TH>
    <th style=3D"text-align: left"><?=3D_('Fiche')?></TH>
    <th style=3D"text-align: left"><?=3D_('Commentaire')?></TH>
@@ -30,6 +31,7 @@
=20
 <? foreach ($array as $item) {
 echo '<tr>';
+// echo td($item['dateop']);
 echo td($item['qcode'].$item['search']);
 echo td($item['cname']);
 echo td($item['comment']);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 12:18:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sgeef-0006Nk-N1
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 12:18:17 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 18:09:02 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203964.1340036296.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4933 - in phpcompta/trunk: html html/js include
	include/template sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 16:18:16 -0000

Author: danydb
Date: 2012-06-18 18:09:01 +0200 (Mon, 18 Jun 2012)
New Revision: 4933

Added:
   phpcompta/trunk/include/ajax_view_mod_stock.php
   phpcompta/trunk/include/class_stock_goods.php
   phpcompta/trunk/include/class_stock_goods_sql.php
   phpcompta/trunk/include/stock_inv.inc.php
   phpcompta/trunk/include/stock_inv_histo.inc.php
   phpcompta/trunk/include/template/stock_inv.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000635: Historique des changements manuels de stock

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-18 16:06:00 UTC (rev 4932)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-18 16:09:01 UTC (rev 4933)
@@ -554,6 +554,9 @@
 	case 'mod_stock_repo':
 		require_once 'ajax_mod_stock_repo.php';
 		break;
+	case 'view_mod_stock':
+		require_once 'ajax_view_mod_stock.php';
+		break;
 	default:
 		var_dump($_GET);
 }

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-18 16:06:00 UTC (rev 4932)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-18 16:09:01 UTC (rev 4933)
@@ -1539,3 +1539,26 @@
 				  }
 				  );
 }
+function stock_inv_detail(p_dossier,p_id)
+{
+	var queryString=3D"gDossier=3D"+p_dossier+"&op=3Dview_mod_stock"+"&c_id=
=3D"+p_id+"&ctl=3Dview_mod_stock_div";
+    var nTop=3Dcalcy(posY);
+    var nLeft=3D"200px";
+    var str_style=3D"top:"+nTop+"px;left:"+nLeft+";width:75%;";
+
+    removeDiv('view_mod_stock_div');
+    waiting_box();
+    var action =3D new Ajax.Request(
+				  "ajax_misc.php" ,
+				  {
+				      method:'get', parameters:queryString,
+				      onFailure:ajax_misc_failure,
+				      onSuccess:function(req){
+					  remove_waiting_box();
+					  add_div({id:'view_mod_stock_div',style:str_style,cssclass:'inner_=
box',drag:"1"});
+					  $('view_mod_stock_div').innerHTML=3Dreq.responseText;
+					  req.responseText.evalScripts();
+				      }
+				  }
+				  );
+}
\ No newline at end of file

Added: phpcompta/trunk/include/ajax_view_mod_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_view_mod_stock.php	                     =
   (rev 0)
+++ phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-18 16:09:01 U=
TC (rev 4933)
@@ -0,0 +1,45 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show detail of inv.
+ *
+ */
+require_once 'class_stock_goods.php';
+
+$st=3Dnew Stock_Goods();
+$array=3D$cn->get_array("select * from stock_goods where c_id=3D$1",arra=
y($_GET['c_id']));
+echo HtmlInput::title_box("D=C3=A9tail changement",$_GET['ctl']);
+$p_array=3Darray();
+$p_array['p_date']=3D$cn->get_value("select to_char(c_date,'DD.MM.YYYY')=
 from stock_change where c_id=3D$1",array($_GET['c_id']));
+$p_array['p_motif']=3D$cn->get_value("select c_comment from stock_change=
 where c_id=3D$1",array($_GET['c_id']));
+$p_array['p_depot']=3D$cn->get_value("select r_id from stock_change wher=
e c_id=3D$1",array($_GET['c_id']));
+for ($i=3D0;$i<count($array);$i++)
+{
+	$p_array['sg_code'.$i]=3D$array[$i]['sg_code'];
+	$p_array['sg_quantity'.$i]=3D$array[$i]['sg_quantity'];
+
+}
+echo $st->input($p_array,true);
+?>

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-18 16:06:00 UTC (rev =
4932)
+++ phpcompta/trunk/include/class_stock.php	2012-06-18 16:09:01 UTC (rev =
4933)
@@ -31,41 +31,7 @@
=20
 class Stock extends Stock_Sql
 {
-	/*	 * *
-	 * @brief  return an array of f_id and f_name
-	 *
-	 *
-	 * @param _sg_code stock_goods.sg_code
-	 * @return - array (f_id, f_label) or null if nothing is found
-	 */
=20
-	function getCardNameCode($p_sg_code)
-	{
-		// Sql stmt
-		$sql =3D "select distinct f_id,ad_value
-         from stock_goods
-         join fiche_detail using(f_id)
-         where
-         ad_id=3D$1
-         and sg_code=3Dupper($2)
-         ";
-// Execute
-		$Res =3D $this->cn->exec_sql($sql, array(ATTR_DEF_STOCK, $p_sg_code));
-		if (( $M =3D Database::num_row($Res)) =3D=3D 0)
-			return null;
-
-// Store in an array
-		for ($i =3D 0; $i < $M; $i++)
-		{
-			$r =3D Database::fetch_array($Res, $i);
-			$a['f_id'] =3D $r['f_id'];
-			$a['av_text'] =3D $this->cn->get_value("select ad_value from fiche_de=
tail where ad_id=3D1 and f_id=3D$2", array($r['f_id']));
-			$result[$i] =3D $a;
-		}
-
-		return $result;
-	}
-
 	function view_detail_stock($p_sg_code, $p_year)
 	{
 		$sql =3D "select sg_id,
@@ -343,6 +309,8 @@
=20
 	function create_query_histo($p_array)
 	{
+		global $cn,$g_user;
+		$profile=3D$g_user->get_profile();
 		$sql =3D "
 			select sg_id,
 				sg.f_id,
@@ -364,36 +332,29 @@
 			from stock_goods as sg
 			join stock_repository as sr on (sg.r_id=3Dsr.r_id)
 			left join jrnx as jx on (sg.j_id=3Djx.j_id)
-			left join jrn as j on (j.jr_grpt_id=3Djx.j_grpt)";
-		$where =3D "";
-		$and =3D "";
+			left join jrn as j on (j.jr_grpt_id=3Djx.j_grpt)
+			where
+			sg.r_id in (select r_id from user_sec_repository where p_id =3D $prof=
ile)";
+		$and =3D " and ";
 		$clause =3D "";
 		if (isset($p_array['wdate_start']) && $p_array['wdate_start'] !=3D '')
 		{
-			$where =3D "where ";
-			$clause =3D " to_date('" . sql_string($p_array['wdate_start']) . "','=
DD.MM.YYYY')<=3Dcoalesce(sg_date,jr_date) ";
-			$and =3D " and ";
+			$clause =3D $and." to_date('" . sql_string($p_array['wdate_start']) .=
 "','DD.MM.YYYY')<=3Dcoalesce(sg_date,jr_date) ";
 		}
 		if (isset($p_array['wdate_end']) && $p_array['wdate_end'] !=3D '')
 		{
-			$where =3D "where ";
 			$clause.=3D$and . " to_date('" . sql_string($p_array['wdate_end']) . =
"','DD.MM.YYYY')>=3Dcoalesce(sg_date,jr_date) ";
-			$and =3D " and ";
 		}
 		if (isset($p_array['wamount_start']) && $p_array['wamount_start'] !=3D=
 '' && isNumber($p_array['wamount_start']) =3D=3D 1)
 		{
-			$where =3D "where ";
 			$clause.=3D$and . " j_montant >=3D " . sql_string($p_array['wamount_s=
tart']);
-			$and =3D " and ";
 		}
 		if (isset($p_array['wamount_end'])
 				&& $p_array['wamount_end'] !=3D ''
 				&& $p_array['wamount_end'] !=3D 0
 				&& isNumber($p_array['wamount_end']) =3D=3D 1)
 		{
-			$where =3D "where ";
 			$clause.=3D$and . " j_montant <=3D " . sql_string($p_array['wamount_e=
nd']);
-			$and =3D " and ";
 		}
 		if (isset($p_array['wcard']) && $p_array['wcard'] !=3D '')
 		{
@@ -401,30 +362,22 @@
 			$f->get_by_qcode($p_array['wcard'], false);
 			if ($f->id !=3D 0)
 			{
-				$where =3D "where ";
 				$clause.=3D$and . " sg.f_id =3D  " . sql_string($f->id);
-				$and =3D " and ";
 			}
 		}
 		if (isset($p_array['wcode_stock']) && $p_array['wcode_stock'] !=3D "")
 		{
-			$where =3D "where ";
 			$clause.=3D$and . " upper(sg_code) =3D  upper('" . sql_string($p_arra=
y['wcode_stock']) . "')";
-			$and =3D " and ";
 		}
 		if (isset($p_array['wrepo']) && $p_array['wrepo'] !=3D -1)
 		{
-			$where =3D "where ";
 			$clause.=3D$and . " sg.r_id =3D " . sql_string($p_array['wrepo']);
-			$and =3D " and ";
 		}
 		if (isset($p_array['wdirection']) && $p_array['wdirection'] !=3D -1)
 		{
-			$where =3D "where ";
 			$clause.=3D$and . " sg.sg_type =3D '" . sql_string($p_array['wdirecti=
on']) . "'";
-			$and =3D " and ";
 		}
-		return $sql . $where . $clause;
+		return $sql . $clause;
 	}
=20
 	function summary($p_array)
@@ -493,7 +446,7 @@
 					left join stock_in as si on ( sg.r_id=3Dsi.r_id)
 					full join stock_out as so on (si.sg_code=3Dso.sg_code and sg.r_id=3D=
so.r_id)
 				where
-				si.sg_code is not null or so.sg_code is not null
+				(si.sg_code is not null or so.sg_code is not null)
 				 and sg.r_id  in (select r_id from user_sec_repository where p_id=3D=
$1)
=20
 			";

Added: phpcompta/trunk/include/class_stock_goods.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods.php	                       =
 (rev 0)
+++ phpcompta/trunk/include/class_stock_goods.php	2012-06-18 16:09:01 UTC=
 (rev 4933)
@@ -0,0 +1,127 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief Manage the goods
+ *
+ */
+require_once 'class_stock_goods_sql.php';
+
+class Stock_Goods extends Stock_Goods_Sql
+{
+
+	function input($p_array =3D null, $p_readonly =3D false)
+	{
+		global $cn;
+
+		if ($p_array !=3D null)
+		{
+			extract($p_array);
+		}
+		else
+		{
+			$p_date =3D '';
+			$p_motif =3D '';
+			$p_depot =3D 0;
+		}
+		$date =3D new IDate('p_date', $p_date);
+		$date->setReadOnly($p_readonly);
+		$motif =3D new IText('p_motif', $p_motif);
+		$motif->setReadOnly($p_readonly);
+		$motif->size =3D 80;
+		$idepo =3D HtmlInput::select_stock($cn, "p_depot", "W");
+		$idepo->setReadOnly($p_readonly);
+		if (count($idepo->value) =3D=3D 0)
+		{
+			NoAccess();
+			exit();
+		}
+		$idepo->selected =3D $p_depot;
+		for ($e =3D 0; $e < MAX_ARTICLE; $e++)
+		{
+			$sg_code[$e] =3D new ICard('sg_code' . $e);
+			$sg_code[$e]->extra =3D '[sql] fd_id =3D 500000';
+			$sg_code[$e]->set_attribute("typecard", $sg_code[$e]->extra);
+			$sg_code[$e]->set_attribute("label", "label" . $e);
+			$sg_code[$e]->value =3D (isset(${'sg_code' . $e})) ? ${'sg_code' . $e=
} : '';
+			$sg_quantity[$e] =3D new INum('sg_quantity' . $e);
+			$sg_quantity[$e]->value =3D (isset(${'sg_quantity' . $e})) ? ${'sg_qu=
antity' . $e} : '';
+			$label[$e] =3D new ISpan("label$e");
+			if (trim($sg_code[$e]->value) !=3D '')
+			{
+				$label[$e]->value =3D $cn->get_value("select vw_name from vw_fiche_a=
ttr where quick_code=3D$1", array($sg_code[$e]->value));
+			}
+			$sg_code[$e]->setReadOnly($p_readonly);
+			$sg_quantity[$e]->setReadOnly($p_readonly);
+		}
+		require_once 'template/stock_inv.php';
+	}
+
+	function save($p_array)
+	{
+		global $cn;
+		try
+		{
+			if (isDate($p_array['p_date']) =3D=3D null)
+				throw new Exception('Date invalide');
+			$cn->start();
+			$ch =3D new Stock_Change_Sql();
+			$ch->setp("c_comment", $p_array['p_motif']);
+			$ch->setp("r_id", $p_array['p_depot']);
+			$ch->setp("c_date", $p_array['p_date']);
+			$ch->setp('tech_user', $_SESSION['g_user']);
+			$ch->insert();
+			$per =3D new Periode($cn);
+			$periode =3D $per->find_periode($p_array['p_date']);
+			$exercice =3D $per->get_exercice($periode);
+
+			for ($i =3D 0; $i < MAX_ARTICLE; $i++)
+			{
+				$a =3D new Stock_Goods_Sql();
+				if ($p_array['sg_quantity' . $i] !=3D 0 &&
+						trim($p_array['sg_code' . $i]) !=3D '')
+				{
+					$a->sg_code =3D $p_array['sg_code' . $i];
+					$a->sg_quantity =3D $p_array['sg_quantity' . $i];
+					$a->sg_type =3D ($p_array['sg_quantity' . $i] > 0) ? 'd' : 'c';
+					$a->sg_comment =3D $p_array['p_motif'];
+					$a->tech_user =3D $_SESSION['g_user'];
+					$a->r_id =3D $p_array['p_depot'];
+					$a->sg_exercice =3D $exercice;
+					$a->c_id =3D $ch->c_id;
+					$a->insert();
+				}
+			}
+			$cn->commit();
+		}
+		catch (Exception $exc)
+		{
+			echo $exc->getTraceAsString();
+			throw $exc;
+		}
+	}
+
+}
+
+?>

Added: phpcompta/trunk/include/class_stock_goods_sql.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods_sql.php	                   =
     (rev 0)
+++ phpcompta/trunk/include/class_stock_goods_sql.php	2012-06-18 16:09:01=
 UTC (rev 4933)
@@ -0,0 +1,121 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief
+ *
+ */
+require_once 'class_phpcompta_sql.php';
+
+class Stock_Goods_Sql extends PhpCompta_Sql
+{
+
+	function __construct($p_id =3D -1)
+	{
+		$this->table =3D "public.stock_goods";
+		$this->primary_key =3D "sg_id";
+		$this->date_format=3D"DD.MM.YYYY";
+
+		$this->name =3D array(
+			"sg_id" =3D> "sg_id",
+			"j_id" =3D> "j_id",
+			"f_id" =3D> "f_id",
+			"sg_code" =3D> "sg_code",
+			"sg_quantity" =3D> "sg_quantity",
+			"sg_type" =3D> "sg_type",
+			"sg_date" =3D> "sg_date",
+			"sg_tech_date" =3D> "sg_tech_date",
+			"sg_tech_user" =3D> "sg_tech_user",
+			"sg_comment" =3D> "sg_comment",
+			"sg_exercice" =3D> "sg_exercice",
+			"r_id" =3D> "r_id",
+			"c_id"=3D>"c_id"
+		);
+
+		$this->type =3D array(
+			"sg_id" =3D> "numeric",
+			"j_id" =3D> "numeric",
+			"f_id" =3D> "numeric",
+			"sg_code" =3D> "text",
+			"sg_quantity" =3D> "text",
+			"sg_type" =3D> "text",
+			"sg_date" =3D> "date",
+			"sg_tech_date" =3D> "date",
+			"sg_tech_user" =3D> "text",
+			"sg_comment" =3D> "text",
+			"sg_exercice" =3D> "sg_exercice",
+			"r_id" =3D> "numeric",
+			"c_id" =3D> "numeric"
+
+		);
+
+		$this->default =3D array(
+			"sg_id" =3D> "auto",
+			"sg_tech_date" =3D> "auto",
+			"sg_user" =3D> "auto"
+		);
+		global $cn;
+
+		parent::__construct($cn, $p_id);
+	}
+
+}
+
+class Stock_Change_Sql extends PhpCompta_Sql
+{
+
+	function __construct($p_id =3D -1)
+	{
+		$this->date_format=3D"DD.MM.YYYY";
+		$this->table =3D "public.stock_change";
+		$this->primary_key =3D "c_id";
+
+		$this->name =3D array(
+			"id" =3D> "c_id",
+			"c_comment" =3D> "c_comment",
+			"c_date" =3D> "c_date",
+			"tech_date"=3D>"tech_date",
+			"tech_user"=3D>"tech_user",
+			"r_id"=3D>"r_id"
+		);
+
+		$this->type =3D array(
+			"c_id" =3D> "numeric",
+			"c_comment" =3D> "text",
+			"c_date" =3D> "date",
+			"tech_date"=3D>"date",
+			"tech_user"=3D>"text",
+			"r_id"=3D>"numeric"
+		);
+
+		$this->default =3D array(
+			"c_id" =3D> "auto",
+			"tech_date" =3D> "auto"
+		);
+		global $cn;
+
+		parent::__construct($cn, $p_id);
+	}
+}
+?>

Added: phpcompta/trunk/include/stock_inv.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_inv.inc.php	                        (re=
v 0)
+++ phpcompta/trunk/include/stock_inv.inc.php	2012-06-18 16:09:01 UTC (re=
v 4933)
@@ -0,0 +1,49 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder dany@alchimerys.be
+
+/**
+ * @file
+ * @brief Inventory : add manuel change
+ *
+ */
+require_once 'class_stock_goods.php';
+global $cn;
+
+$inv=3Dnew Stock_Goods();
+if ( isset ($_POST['save']))
+{
+	try
+	{
+		$inv->save($_POST);
+		echo h2info("Op=C3=A9ration sauv=C3=A9e");
+		$inv->input($_POST,true);
+
+	}catch(Exception $e)
+	{
+		 alert($e->getMessage());
+		 $inv->input($_POST);
+	}
+}
+echo $inv->input();
+
+?>

Added: phpcompta/trunk/include/stock_inv_histo.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_inv_histo.inc.php	                     =
   (rev 0)
+++ phpcompta/trunk/include/stock_inv_histo.inc.php	2012-06-18 16:09:01 U=
TC (rev 4933)
@@ -0,0 +1,78 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+/**
+ * @file
+ * @brief history of manuel change
+ *
+ */
+$profile=3D$g_user->get_profile();
+$a_change=3D$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_d=
ate from stock_change as sc
+			join stock_repository as sr on (sc.r_id=3Dsr.r_id)
+			where sc.r_id in (select r_id from user_sec_repository where p_id=3D$=
profile)
+		order by c_date");
+$gDossier=3Ddossier::id();
+?>
+<div class=3D"content">
+<table class=3D"result">
+	<tr>
+
+		<th>
+			Date
+		</th>
+		<th>
+			Commentaire
+		</th>
+		<th>
+			D=C3=A9pot
+		</th>
+		<th>
+			Utilisateur
+		</th>
+			<th>
+
+		</th>
+	</tr>
+	<? for ($e=3D0;$e<count($a_change);$e++): ?>
+	<? $class=3D($e%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" '; ?>
+	<tr <?=3D$class?>>
+
+		<td>
+			<?=3D  $a_change[$e]['str_date']?>
+		</td>
+		<td>
+			<?=3Dh($a_change[$e]['c_comment'])?>
+		</td>
+		<td>
+			<?=3Dh($a_change[$e]['r_name'])?>
+		</td>
+		<td>
+			<?=3D$a_change[$e]['tech_user']?>
+		</td>
+		<td>
+			<?=3DHtmlInput::button_action("D=C3=A9tail",sprintf("stock_inv_detail=
('%s','%s')",$gDossier,$a_change[$e]['c_id']));?>
+		</td>
+
+	</tr>
+	<? endfor; ?>
+</table>
+</div>

Added: phpcompta/trunk/include/template/stock_inv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_inv.php	                      =
  (rev 0)
+++ phpcompta/trunk/include/template/stock_inv.php	2012-06-18 16:09:01 UT=
C (rev 4933)
@@ -0,0 +1,85 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show the input
+ *
+ */
+?>
+<div class=3D"content">
+	<form method=3D"POST" onsubmit=3D"return confirm('Vous confirmez ?')">
+<table>
+	<tr><td>
+			Date
+		</td>
+		<td>
+			<?=3D$date->input()?>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			D=C3=A9pot
+		</td>
+		<td>
+			<?=3D$idepo->input()?>
+		</td>
+	</tr>
+	<tr>
+		<td>
+			Motif de changement
+		</td>
+		<td>
+			<?=3D$motif->input()?>
+		</td>
+	</tr>
+</table>
+<table style=3D"width: 80%">
+	<tr>
+		<th >
+			Code Stock
+		</th>
+		<th style=3D"text-align:right">
+			Quantit=C3=A9
+		</th>
+	</tr>
+<? for($i=3D0;$i<MAX_ARTICLE;$i++): ?>
+	<tr>
+		<td>
+			<?=3D$sg_code[$i]->input()?>
+			<?=3D$sg_code[$i]->search()?>
+			<?=3D$label[$i]->input()?>
+		</td>
+		<TD class=3D"num"">
+			<? if ($sg_quantity[$i]->value=3D=3D0 && $p_readonly=3D=3Dtrue):?>
+
+			<? else : ?>
+			<?=3D$sg_quantity[$i]->input()?>
+			<? endif;?>
+		</td>
+	</tr>
+<? endfor; ?>
+</table>
+<? if ($p_readonly =3D=3D false) echo HtmlInput::submit('save','Sauver')=
?>
+	</form>
+</div>
\ No newline at end of file

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-18 16:06:00 UTC (rev 4932)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-18 16:09:01 UTC (rev 4933)
@@ -278,6 +278,7 @@
=20
 insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_HISTO','stock_histo.inc.php','Historique stock','Historique =
des mouvement de stock','ME');
 insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_STATE','stock_state.inc.php','Etat des stock','Etat des stoc=
k','ME');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_INVHISTO','stock_inv_histo.inc.php','Histo. Changement','Lis=
te des changements manuels des stocks','ME');
 insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockHisto',=
'Export Historique mouvement stock','PR');
 insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockResmLis=
t','Export R=C3=A9sum=C3=A9 list stock','PR');
=20
@@ -285,11 +286,17 @@
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',1,20,'E');
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',2,10,'E');
 insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',2,20,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INVHISTO','STOCK',1,30,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INVHISTO','STOCK',2,30,'E');
 insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',1,'P');
 insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',1,'P');
 insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',2,'P');
 insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',2,'P');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_INV','stock_inv.inc.php','Modification Stocks','Modification=
 des stocks (inventaire)','ME');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INV','STOCK',1,30,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INV','STOCK',2,30,'E');
=20
+
 -- clean stock_goods
 delete from stock_goods where  sg_code is null or sg_code=3D'' or sg_cod=
e not in (select ad_value from fiche_detail as fd where ad_id=3D19 and ad=
_value is not null);
=20
@@ -361,4 +368,17 @@
   LANGUAGE plpgsql VOLATILE;
=20
=20
-CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   =
FOR EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
\ No newline at end of file
+CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   =
FOR EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
+
+update menu_ref set me_description=3D'Gestion des attributs de fiches ' =
where me_code=3D'CFGATCARD';
+
+ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE;
+
+CREATE TABLE stock_change
+(
+  c_id bigserial NOT NULL,
+  c_comment text,
+  c_date date,
+  CONSTRAINT stock_change_pkey PRIMARY KEY (c_id )
+);
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 12:32:43 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sgesd-00080Q-FL
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 12:32:43 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 18:23:37 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203989.1340037162.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4934 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 16:32:42 -0000

Author: danydb
Date: 2012-06-18 18:23:36 +0200 (Mon, 18 Jun 2012)
New Revision: 4934

Modified:
   phpcompta/trunk/include/ajax_view_mod_stock.php
   phpcompta/trunk/include/stock_inv_histo.inc.php
Log:
0000635: Historique des changements manuels de stock

Modified: phpcompta/trunk/include/ajax_view_mod_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-18 16:09:01 U=
TC (rev 4933)
+++ phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-18 16:23:36 U=
TC (rev 4934)
@@ -43,3 +43,14 @@
 }
 echo $st->input($p_array,true);
 ?>
+<form method=3D"POST">
+	<?=3DHtmlInput::hidden('c_id',$_GET['c_id']);?>
+	<p>
+	<? $ck=3Dnew ICheckBox("ok"," 1");
+			$ck->label=3D "Cochez pour confirmer effacement ";
+			echo $ck->input();?>
+	</p>
+	<?=3DHtmlInput::submit("del", "Effacer");?>
+	<?=3DHtmlInput::button_close($_GET['ctl'])?>
+	<?=3DHtmlInput::hidden('r_id',$p_array['p_depot'])?>
+</form>
\ No newline at end of file

Modified: phpcompta/trunk/include/stock_inv_histo.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_inv_histo.inc.php	2012-06-18 16:09:01 U=
TC (rev 4933)
+++ phpcompta/trunk/include/stock_inv_histo.inc.php	2012-06-18 16:23:36 U=
TC (rev 4934)
@@ -25,6 +25,24 @@
  * @brief history of manuel change
  *
  */
+if ( isset($_POST['del']))
+{
+	if (isset($_POST['ok']))
+	{
+		if ($g_user->can_write_repo($_POST['r_id']))
+		{
+			$cn->exec_sql('delete from stock_change where c_id=3D$1',array($_POST=
['c_id']));
+		}
+		else
+		{
+			alert("Vous ne pouvez pas modifier ce d=C3=A9p=C3=B4t");
+		}
+	}
+	else
+	{
+		alert("Op=C3=A9ration non effac=C3=A9e: vous n'avez pas confirm=C3=A9"=
);
+	}
+}
 $profile=3D$g_user->get_profile();
 $a_change=3D$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_d=
ate from stock_change as sc
 			join stock_repository as sr on (sc.r_id=3Dsr.r_id)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 12:35:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgevZ-0000Z9-OB
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 12:35:45 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 18:26:43 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.203994.1340037345.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4935 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 16:35:45 -0000

Author: danydb
Date: 2012-06-18 18:26:43 +0200 (Mon, 18 Jun 2012)
New Revision: 4935

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
upgrade create table stock_change and add column to stock_goods

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-18 16:23:36 UTC (rev 4934)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-18 16:26:43 UTC (rev 4935)
@@ -377,8 +377,16 @@
=20
 CREATE TABLE stock_change
 (
-  c_id bigserial NOT NULL,
+   c_id bigserial NOT NULL,
   c_comment text,
   c_date date,
-  CONSTRAINT stock_change_pkey PRIMARY KEY (c_id )
-);
\ No newline at end of file
+  tech_user text,
+  r_id bigint,
+  tech_date time with time zone NOT NULL DEFAULT now(),
+  CONSTRAINT stock_change_pkey PRIMARY KEY (c_id ),
+  CONSTRAINT stock_change_r_id_fkey FOREIGN KEY (r_id)
+      REFERENCES stock_repository (r_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE
+);
+
+ALTER TABLE stock_goods ADD COLUMN c_id bigint;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 15:24:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SghYX-0000Fy-V7
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 15:24:09 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 21:15:07 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.204375.1340047449.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4936 - in phpcompta/trunk: html/js include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 19:24:08 -0000

Author: danydb
Date: 2012-06-18 21:15:06 +0200 (Mon, 18 Jun 2012)
New Revision: 4936

Modified:
   phpcompta/trunk/html/js/acc_ledger.js
   phpcompta/trunk/html/js/infobulle.js
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/ajax_bank_saldo.php
   phpcompta/trunk/include/class_acc_ledger_fin.php
   phpcompta/trunk/include/template/form_ledger_fin.php
Log:
0000530: Ajouter la possibilit?\195?\169 d'entrer une date par op?\195?\1=
69ration dans la saisie du journal de banque

Modified: phpcompta/trunk/html/js/acc_ledger.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/acc_ledger.js	2012-06-18 16:26:43 UTC (rev 49=
35)
+++ phpcompta/trunk/html/js/acc_ledger.js	2012-06-18 19:15:06 UTC (rev 49=
36)
@@ -252,7 +252,7 @@
         new_tt=3Dnew_tt.replace(/e_other0_amount/g,"e_other"+nb.value+'_=
amount');
         new_tt=3Dnew_tt.replace(/e_concerned0/g,"e_concerned"+nb.value);
         new_tt=3Dnew_tt.replace(/e_other0_label/g,"e_other"+nb.value+'_l=
abel');
-        // new_tt=3Dnew_tt.replace(/dateop0/g,"date"+nb.value);
+        new_tt=3Dnew_tt.replace(/dateop0/g,"date"+nb.value);
         newCell.innerHTML=3Dnew_tt;
         new_tt.evalScripts();
     }

Modified: phpcompta/trunk/html/js/infobulle.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/infobulle.js	2012-06-18 16:26:43 UTC (rev 493=
5)
+++ phpcompta/trunk/html/js/infobulle.js	2012-06-18 19:15:06 UTC (rev 493=
6)
@@ -43,7 +43,7 @@
 content[13]=3D"Vous pouvez utiliser le % pour indiquer le poste parent";
 content[14]=3D"Attention, le poste comptable doit exister, il ne sera pa=
s v=C3=A9rifi=C3=A9";
 content[15]=3D"Laissez =C3=A0 0 pour ne rien changer";
-content[16]=3D"Si vous ne remplissez pas la date d'op=C3=A9ration, ce se=
ra la date de l'extrait qui sera utilis=C3=A9e";
+content[16]=3D"Vous devez donner la date par op=C3=A9ration";
=20
 function showBulle(p_ctl)
 {

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-18 16:26:43 UTC (rev 4935)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-18 19:15:06 UTC (rev 4936)
@@ -1561,4 +1561,33 @@
 				      }
 				  }
 				  );
+}
+function show_fin_chdate(obj_id)
+{
+	try
+	{
+		var ch=3D$(obj_id).options[$(obj_id).selectedIndex].value;
+		if (ch =3D=3D 2 ) {
+			$('chdate_ext').hide();
+			$('thdate').show();
+		}
+		if (ch =3D=3D 1 ) {
+			$('chdate_ext').show();
+			$('thdate').hide();
+		}
+		var nb=3D$('nb_item').value;
+		for (i=3D0;i<nb;i++) {
+			if ( $('tdchdate'+i)) {
+				if (ch =3D=3D 2) {
+					$('tdchdate'+i).show();
+				}
+				if (ch =3D=3D 1 ) {
+					$('tdchdate'+i).hide();
+
+				}
+			}
+		}
+	}catch (e) {
+		alert(e.message);
+	}
 }
\ No newline at end of file

Modified: phpcompta/trunk/include/ajax_bank_saldo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_bank_saldo.php	2012-06-18 16:26:43 UTC (=
rev 4935)
+++ phpcompta/trunk/include/ajax_bank_saldo.php	2012-06-18 19:15:06 UTC (=
rev 4936)
@@ -53,7 +53,7 @@
 /*  make a filter on the exercice */
=20
 $filter_year=3D"  j_tech_per in (select p_id from parm_periode ".
-             "where p_exercice=3D'".$user->get_exercice()."')";
+             "where p_exercice=3D'".$g_user->get_exercice()."')";
=20
=20
 $id=3D$cn->get_value('select jrn_def_bank from jrn_def where jrn_def_id=3D=
$1',array($_GET['j']));

Modified: phpcompta/trunk/include/class_acc_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-18 16:26:43 =
UTC (rev 4935)
+++ phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-18 19:15:06 =
UTC (rev 4936)
@@ -79,41 +79,44 @@
 		$poste =3D new Acc_Account_Ledger($this->db, $bank_accounting);
 		if ($poste->load() =3D=3D false)
 			throw new Exception('Le poste comptable du compte en banque de ce jou=
rnal est invalide');
-
-		/*  check if the date is valid */
-		if (isDate($e_date) =3D=3D null)
+		if ($chdate !=3D 1 && $chdate !=3D 2) throw new Exception ('Le choix d=
e date est invalide');
+		if ( $chdate =3D=3D 1 )
 		{
-			throw new Exception('Date invalide', 2);
-		}
-		$oPeriode =3D new Periode($this->db);
-		if ($this->check_periode() =3D=3D false)
-		{
-			$periode =3D $oPeriode->find_periode($e_date);
-		}
-		else
-		{
-			$oPeriode->p_id =3D $periode;
-			list ($min, $max) =3D $oPeriode->get_date_limit();
-			if (cmpDate($e_date, $min) < 0 ||
-					cmpDate($e_date, $max) > 0)
-				throw new Exception(_('Date et periode ne correspondent pas'), 6);
-		}
+			/*  check if the date is valid */
+			if (isDate($e_date) =3D=3D null)
+			{
+				throw new Exception('Date invalide', 2);
+			}
+			$oPeriode =3D new Periode($this->db);
+			if ($this->check_periode() =3D=3D false)
+			{
+				$periode =3D $oPeriode->find_periode($e_date);
+			}
+			else
+			{
+				$oPeriode->p_id =3D $periode;
+				list ($min, $max) =3D $oPeriode->get_date_limit();
+				if (cmpDate($e_date, $min) < 0 ||
+						cmpDate($e_date, $max) > 0)
+					throw new Exception(_('Date et periode ne correspondent pas'), 6);
+			}
=20
-		/* check if the periode is closed */
-		if ($this->is_closed($periode) =3D=3D 1)
-		{
-			throw new Exception(_('Periode fermee'), 6);
-		}
+			/* check if the periode is closed */
+			if ($this->is_closed($periode) =3D=3D 1)
+			{
+				throw new Exception(_('Periode fermee'), 6);
+			}
=20
-		/* check if we are using the strict mode */
-		if ($this->check_strict() =3D=3D true)
-		{
-			/* if we use the strict mode, we get the date of the last
-			  operation */
-			$last_date =3D $this->get_last_date();
-			if ($last_date !=3D null && cmpDate($e_date, $last_date) < 0)
-				throw new Exception(_('Vous utilisez le mode strict la derni=C3=A8re=
 operation est =C3=A0 la date du ')
-						. $last_date . _(' vous ne pouvez pas encoder =C3=A0 une date ant=C3=
=A9rieure'), 15);
+			/* check if we are using the strict mode */
+			if ($this->check_strict() =3D=3D true)
+			{
+				/* if we use the strict mode, we get the date of the last
+				operation */
+				$last_date =3D $this->get_last_date();
+				if ($last_date !=3D null && cmpDate($e_date, $last_date) < 0)
+					throw new Exception(_('Vous utilisez le mode strict la derni=C3=A8r=
e operation est =C3=A0 la date du ')
+							. $last_date . _(' vous ne pouvez pas encoder =C3=A0 une date ant=
=C3=A9rieure'), 15);
+			}
 		}
=20
 		$acc_pay =3D new Acc_Operation($this->db);
@@ -161,6 +164,45 @@
 			$fiche->get_by_qcode(${'e_other' . $i});
 			if ($fiche->belong_ledger($p_jrn, 'deb') !=3D 1)
 				throw new Exception('La fiche ' . ${'e_other' . $i} . 'n\'est pas ac=
cessible =C3=A0 ce journal', 10);
+			if ($chdate =3D=3D 2)
+			{
+				{/*  check if the date is valid */
+					if (isDate(${'dateop' . $i}) =3D=3D null)
+					{
+						throw new Exception('Date invalide', 2);
+					}
+					$oPeriode =3D new Periode($this->db);
+					if ($this->check_periode() =3D=3D false)
+					{
+						$periode =3D $oPeriode->find_periode(${'dateop' . $i});
+					}
+					else
+					{
+						$oPeriode->p_id =3D $periode;
+						list ($min, $max) =3D $oPeriode->get_date_limit();
+						if (cmpDate(${'dateop' . $i}, $min) < 0 ||
+								cmpDate(${'dateop' . $i}, $max) > 0)
+							throw new Exception(_('Date et periode ne correspondent pas'), 6)=
;
+					}
+
+					/* check if the periode is closed */
+					if ($this->is_closed($periode) =3D=3D 1)
+					{
+						throw new Exception(_('Periode fermee'), 6);
+					}
+
+					/* check if we are using the strict mode */
+					if ($this->check_strict() =3D=3D true)
+					{
+						/* if we use the strict mode, we get the date of the last
+						  operation */
+						$last_date =3D $this->get_last_date();
+						if ($last_date !=3D null && cmpDate(${'dateop' . $i}, $last_date) =
< 0)
+							throw new Exception(_('Vous utilisez le mode strict la derni=C3=A8=
re operation est =C3=A0 la date du ')
+									. $last_date . _(' vous ne pouvez pas encoder =C3=A0 une date a=
nt=C3=A9rieure'), 15);
+					}
+				}
+			}
 			$nb++;
 		}
 		if ($nb =3D=3D 0)
@@ -423,7 +465,7 @@
 		//  Date
 		//--
 		$r.=3D"<tr>";
-		$r.=3D'<td> Date : </td><td>' . $e_date;
+		if ( $chdate =3D=3D 1 ) $r.=3D'<td> Date : </td><td>' . $e_date;
 		// Periode
 		//--
 		$r.=3D"<td>";
@@ -482,6 +524,7 @@
 		//-------------------------------------------------
 		$r.=3D'<TABLE style=3D"width:100%" id=3D"fin_item">';
 		$r.=3D"<TR>";
+		if ($chdate=3D=3D2) $r.=3D'<th>Date</th>';
 		$r.=3D"<th style=3D\"width:auto;text-align:left\" colspan=3D\"2\">Nom<=
/TH>";
 		$r.=3D"<th style=3D\"text-align:left\" >Commentaire</TH>";
 		$r.=3D"<th style=3D\"text-align:right\">Montant</TH>";
@@ -523,7 +566,9 @@
=20
 			$tiers_label =3D $fTiers->strAttribut(ATTR_DEF_NAME);
=20
-			$r.=3D"<TR><td>" . ${'e_other' . $i} . "</TD>";
+			$r.=3D"<TR>";
+			if ($chdate=3D=3D2) $r.=3Dtd(${"dateop".$i});
+			$r.=3D"<td>" . ${'e_other' . $i} . "</TD>";
 			// label
 			$r.=3D'<TD style=3D"width:25%;border-bottom:1px dotted grey;">';
 			$r.=3D$fTiers->strAttribut(ATTR_DEF_NAME);
@@ -591,15 +636,17 @@
 		if (isset($periode))
 			$r.=3DHtmlInput::hidden('periode', $periode);
 		$r.=3Ddossier::hidden();
-		$r.=3DHtmlInput::hidden('sa', 'n');
+		$r.=3DHtmlInput::hidden('sa', 'n','chdate');
 		for ($i =3D 0; $i < $nb_item; $i++)
 		{
-			$tiers =3D (isset(${"e_other" . $i})) ? ${"e_other" . $i} : ""
-			;
+			$tiers =3D (isset(${"e_other" . $i})) ? ${"e_other" . $i} : ""			;
 			$r.=3DHtmlInput::hidden('e_other' . $i, $tiers);
+			$r.=3DHtmlInput::hidden('e_other' . $i, $tiers);
 			$r.=3DHtmlInput::hidden('e_other' . $i . '_comment', ${'e_other' . $i=
 . '_comment'});
 			$r.=3DHtmlInput::hidden('e_other' . $i . '_amount', ${'e_other' . $i =
. '_amount'});
 			$r.=3DHtmlInput::hidden('e_concerned' . $i, ${'e_concerned' . $i});
+			$r.=3DHtmlInput::hidden('dateop' . $i, ${'dateop' . $i});
+			$r.=3DHtmlInput::hidden('chdate' , $chdate);
 		}
=20
 		return $r;
@@ -625,17 +672,6 @@
 		$e_bank_account =3D $fBank->strAttribut(ATTR_DEF_QUICKCODE);
 		// Get the saldo
 		$pPeriode =3D new Periode($this->db);
-		if ($this->check_periode() =3D=3D true)
-		{
-			$pPeriode->p_id =3D $periode;
-		}
-		else
-		{
-			$pPeriode->find_periode($e_date);
-		}
-		$exercice =3D $pPeriode->get_exercice();
-
-		$filter_year =3D "  j_tech_per in (select p_id from parm_periode where=
  p_exercice=3D'" . $exercice . "')";
 		$sposte =3D $fBank->strAttribut(ATTR_DEF_ACCOUNT);
 		// if 2 accounts, take only the debit one for customer
 		if (strpos($sposte, ',') !=3D 0)
@@ -649,23 +685,62 @@
 		}
=20
 		$acc_account =3D new Acc_Account_Ledger($this->db, $poste_val);
-		$solde =3D $acc_account->get_solde($filter_year);
-		$new_solde =3D $solde;
=20
+		// If date =3D deposit date
+		if ($chdate =3D=3D 1 )
+		{
+			if ($this->check_periode() =3D=3D true)
+			{
+				$pPeriode->p_id =3D $periode;
+			}
+			else
+			{
+				$pPeriode->find_periode($e_date);
+			}
+			$exercice =3D $pPeriode->get_exercice();
+			$filter_year =3D "  j_tech_per in (select p_id from parm_periode wher=
e  p_exercice=3D'" . $exercice . "')";
+			$solde =3D $acc_account->get_solde($filter_year);
+			$new_solde =3D $solde;
+		}
+
+
+
+
+
 		try
 		{
 			$this->db->start();
 			$amount =3D 0.0;
 			$idx_operation =3D 0;
 			$ret =3D '<table class=3D"result" style=3D"width:75%">';
-			$ret.=3Dtr(th('n=C2=B0 interne') . th('Quick Code') . th('Nom') . th(=
'Libell=C3=A9') . th('Montant', ' style=3D"text-align:right"'));
+			$ret.=3Dtr(th('Date').th('n=C2=B0 interne') . th('Quick Code') . th('=
Nom') . th('Libell=C3=A9') . th('Montant', ' style=3D"text-align:right"')=
);
 			// Credit =3D goods
+			$get_solde=3Dtrue;
 			for ($i =3D 0; $i < $nb_item; $i++)
 			{
 				// if tiers is set and amount !=3D 0 insert it into the database
 				// and quit the loop ?
 				if (strlen(trim(${"e_other$i"})) =3D=3D 0)
 					continue;
+
+				if ( $chdate =3D=3D 2 ) $e_date=3D${'dateop'.$i};
+				// if date is date of operation
+				if ($chdate =3D=3D 2 && $get_solde )
+				{
+					$get_solde=3Dfalse;
+					if ($this->check_periode() =3D=3D true)
+					{
+						$pPeriode->p_id =3D $periode;
+					}
+					else
+					{
+						$pPeriode->find_periode($e_date);
+					}
+					$exercice =3D $pPeriode->get_exercice();
+					$filter_year =3D "  j_tech_per in (select p_id from parm_periode wh=
ere  p_exercice=3D'" . $exercice . "')";
+					$solde =3D $acc_account->get_solde($filter_year);
+					$new_solde =3D $solde;
+				}
 				$fPoste =3D new Fiche($this->db);
 				$fPoste->get_by_qcode(${"e_other$i"});
=20
@@ -828,7 +903,7 @@
=20
 				$js_detail =3D HtmlInput::detail_op($jr_id, $internal);
 				// Compute display
-				$row =3D td($js_detail) . td(${"e_other$i"}) . td($fPoste->strAttrib=
ut(ATTR_DEF_NAME)) . td(${"e_other" . $i . "_comment"}) . td(nbm(${"e_oth=
er$i" . "_amount"}), 'class=3D"num"');
+				$row =3D td($e_date).td($js_detail) . td(${"e_other$i"}) . td($fPost=
e->strAttribut(ATTR_DEF_NAME)) . td(${"e_other" . $i . "_comment"}) . td(=
nbm(${"e_other$i" . "_amount"}), 'class=3D"num"');
=20
 				$ret.=3Dtr($row);
=20

Modified: phpcompta/trunk/include/template/form_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/form_ledger_fin.php	2012-06-18 16:26=
:43 UTC (rev 4935)
+++ phpcompta/trunk/include/template/form_ledger_fin.php	2012-06-18 19:15=
:06 UTC (rev 4936)
@@ -3,7 +3,20 @@
 	<h2 id=3D"jrn_name"> <?=3D$this->get_name()?></h2>
 </div>
 <legend><?=3D$f_legend ?> </legend>
+<?
+	$wchdate=3Dnew ISelect('chdate');
+	$wchdate->value=3Darray(
+			array('value'=3D>1,'label'=3D>"Avec date d'extrait"),
+			array('value'=3D>2,'label'=3D>"Avec date op=C3=A9rations")
+	);
+	$wchdate->selected=3D(isset($chdate))?$chdate:1;
+	$wchdate->javascript=3D'onchange=3D"show_fin_chdate(\'chdate\')"';
+?>
+<?=3D$wchdate->input();?>
+<span id=3D"chdate_ext">
    <?=3D_('Date').' '.$f_date ?>
+</span>
+
 <?=3D$f_period?><br>
 <?=3D$f_jrn?><br>
 <?=3D_('Banque')?><?=3D$f_bank ?>
@@ -21,7 +34,7 @@
    <fieldset><legend><?=3D_('Op=C3=A9rations')?></legend>
 <table id=3D"fin_item" width=3D"100%" border=3D"0">
 <tr>
-<!--<th style=3D"text-align: left"><?=3D_('Date')?><?=3DHtmlInput::infob=
ulle(16)?></TH> -->
+<th id=3D"thdate" style=3D"display:none;text-align: left"><?=3D_('Date')=
?><?=3DHtmlInput::infobulle(16)?></TH>
 <th style=3D"text-align: left;width: auto">code<?HtmlInput::infobulle(0)=
?></TH>
    <th style=3D"text-align: left"><?=3D_('Fiche')?></TH>
    <th style=3D"text-align: left"><?=3D_('Commentaire')?></TH>
@@ -29,19 +42,27 @@
    <th style=3D"text-align: left;width:auto"colspan=3D"2"> <?=3D_('Op. C=
oncern=C3=A9e(s)')?></th>
 </tr>
=20
-<? foreach ($array as $item) {
+<?
+$i=3D0;
+foreach ($array as $item) {
+
 echo '<tr>';
 // echo td($item['dateop']);
+echo td($item['dateop'],' style=3D"display:none" id=3D"tdchdate'.$i.'"')=
;
 echo td($item['qcode'].$item['search']);
 echo td($item['cname']);
 echo td($item['comment']);
 echo td($item['amount']);
 echo td($item['concerned']);
 echo '</tr>';
+$i++;
+
 }
 ?>
 </table>
 </fieldset>
 </fieldset>
+<script>
+	show_fin_chdate('chdate');
+</script>
=20
-



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 15:24:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SghYj-0000GX-3B
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 15:24:21 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 21:15:20 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.204376.1340047460.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4937 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 19:24:19 -0000

Author: danydb
Date: 2012-06-18 21:15:20 +0200 (Mon, 18 Jun 2012)
New Revision: 4937

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
ajout contrainte FK

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-18 19:15:06 UTC (rev 4936)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-18 19:15:20 UTC (rev 4937)
@@ -390,3 +390,5 @@
 );
=20
 ALTER TABLE stock_goods ADD COLUMN c_id bigint;
+ALTER TABLE stock_goods   ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN K=
EY (c_id)        REFERENCES stock_change (c_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 18 15:40:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sghoa-0005r6-6x
	for mharc-phpcompta-dev@gnu.org; Mon, 18 Jun 2012 15:40:44 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Jun 2012 21:31:46 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.204391.1340048443.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4938 - phpcompta/trunk/html/js
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jun 2012 19:40:43 -0000

Author: danydb
Date: 2012-06-18 21:31:45 +0200 (Mon, 18 Jun 2012)
New Revision: 4938

Modified:
   phpcompta/trunk/html/js/acc_ledger.js
Log:
0000530: Ajouter la possibilit?\195?\169 d'entrer une date par op?\195?\1=
69ration dans la saisie du journal de banque

Modified: phpcompta/trunk/html/js/acc_ledger.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/acc_ledger.js	2012-06-18 19:15:20 UTC (rev 49=
37)
+++ phpcompta/trunk/html/js/acc_ledger.js	2012-06-18 19:31:45 UTC (rev 49=
38)
@@ -245,6 +245,9 @@
     for ( var e=3D0;e < nNumberCell;e++)
     {
         var newCell=3Drow.insertCell(e);
+		if ( e=3D=3D0) {
+			newCell.id=3D'tdchdate'+nb.value;
+		}
         var tt=3DrowToCopy.cells[e].innerHTML;
         var new_tt=3Dtt.replace(/e_other0/g,"e_other"+nb.value);
         new_tt=3Dnew_tt.replace(/e_other0_comment/g,"e_other"+nb.value+'=
_comment');
@@ -252,7 +255,7 @@
         new_tt=3Dnew_tt.replace(/e_other0_amount/g,"e_other"+nb.value+'_=
amount');
         new_tt=3Dnew_tt.replace(/e_concerned0/g,"e_concerned"+nb.value);
         new_tt=3Dnew_tt.replace(/e_other0_label/g,"e_other"+nb.value+'_l=
abel');
-        new_tt=3Dnew_tt.replace(/dateop0/g,"date"+nb.value);
+        new_tt=3Dnew_tt.replace(/dateop0/g,"dateop"+nb.value);
         newCell.innerHTML=3Dnew_tt;
         new_tt.evalScripts();
     }
@@ -261,7 +264,12 @@
     g("e_other"+nb.value+'_amount').value=3D"0";
     g("e_other"+nb.value+'_comment').value=3D"";
     g("e_concerned"+nb.value).value=3D"";
-    nb.value++;
+
+	var ch=3D$('chdate').options[$('chdate').selectedIndex].value;
+	if (ch =3D=3D 1 ) {
+			$('tdchdate'+nb.value).hide();
+	}
+	nb.value++;
 }
 /**
  * @brief add a line in the form for the purchase ledger



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 09:10:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgyCs-0000VS-B0
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 09:10:54 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 15:01:34 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.207594.1340111453.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4939 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 13:10:52 -0000

Author: danydb
Date: 2012-06-19 15:01:33 +0200 (Tue, 19 Jun 2012)
New Revision: 4939

Removed:
   phpcompta/trunk/include/stock.inc.php
   phpcompta/trunk/include/stock_inc.php
Modified:
   phpcompta/trunk/include/class_stock.php
Log:
0000641: Nettoyage fichier

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-18 19:31:45 UTC (rev =
4938)
+++ phpcompta/trunk/include/class_stock.php	2012-06-19 13:01:33 UTC (rev =
4939)
@@ -32,159 +32,6 @@
 class Stock extends Stock_Sql
 {
=20
-	function view_detail_stock($p_sg_code, $p_year)
-	{
-		$sql =3D "select sg_id,
-              sg_code,
-         j_montant,
-         coalesce(j_date,sg_date) as j_date,
-         sg_quantity,
-         sg_type,
-         jr_id,
-         coalesce(jr_comment,sg_comment) as comment,
-         coalesce(jr_internal,'Changement manuel') as jr_internal,
-         jr_id,
-         case when sg_date is not null then sg_date else j_date end as s=
tock_date
-         from stock_goods
-         left outer join jrnx using (j_id)
-         left outer join jrn on jr_grpt_id=3Dj_grpt
-         where
-         sg_code=3D$1 and (
-         sg_exercice =3D $2
-         or j_tech_per in (select p_id from parm_periode where p_exercic=
e=3D$2)
-         )
-         order by stock_date
-         ";
-		// name
-
-		$in_quantity =3D 0;
-		$out_quantity =3D 0;
-		$in_amount =3D 0;
-		$out_amount =3D 0;
-		$r =3D "";
-		$a_name =3D getFicheNameCode($p_cn, $p_sg_code);
-		$name =3D "";
-		if ($a_name !=3D null)
-		{
-			foreach ($a_name as $key =3D> $element)
-			{
-				$name.=3D$element['av_text'] . ",";
-			}
-		}// if ( $a_name
-		// Add java script for detail
-
-
-		$r.=3D'<H2 class=3D"info">' . $p_sg_code . "  Noms : " . $name . '</H2=
>';
-
-		$Res =3D $this->cn->exec_sql($sql, array($p_sg_code, $p_year));
-		if (($M =3D Database::num_row($Res)) =3D=3D 0)
-			return "no rows";
-		$r.=3D'<table class=3D"result" >';
-		$r.=3D"<TR >";
-		$r.=3D"<th>Date </th>";
-		$r.=3D"<th>Entr=C3=A9e / Sortie </th>";
-		$r.=3D"<th>Description</th>";
-		$r.=3D"<th>Op&eacute;ration</th>";
-		$r.=3D"<th style=3D\"text-align:right\">Montant</th>";
-		$r.=3D"<th style=3D\"text-align:right\">Quantit=C3=A9</th>";
-		$r.=3D"<th style=3D\"text-align:right\">Prix/Cout Unitaire</th>";
-		$r.=3D"</TR>";
-		$tot_quantity =3D 0;
-		for ($i =3D 0; $i < $M; $i++)
-		{
-			$l =3D Database::fetch_array($Res, $i);
-			$r.=3D"<tR id=3D\"stock" . $l['sg_id'] . "\" >";
-
-			// date
-			$r.=3D"<TD>";
-			$r.=3Dformat_date($l['j_date']);
-			$r.=3D"</TD>";
-
-			//type (deb =3D out cred=3Din)
-			$r.=3D"<TD>";
-			$r.=3D($l['sg_type'] =3D=3D 'c') ? 'OUT' : 'IN';
-			$r.=3D"</TD>";
-
-			if ($l['sg_type'] =3D=3D 'c')
-			{
-				$quantity =3D (-1) * $l['sg_quantity'];
-				$out_quantity+=3D$l['sg_quantity'];
-				$out_amount+=3D$l['j_montant'];
-			}
-			else
-			{
-				$quantity =3D $l['sg_quantity'];
-				$in_quantity+=3D$l['sg_quantity'];
-				$in_amount+=3D$l['j_montant'];
-			}
-			$tot_quantity+=3D$quantity;
-			// comment
-			$r.=3D"<TD>";
-			$r.=3Dh($l['comment']);
-			$r.=3D"</TD>";
-
-			// jr_internal
-			$r.=3D"<TD>";
-			if ($l['jr_id'] !=3D "")
-				$r.=3D "<A class=3D\"detail\" style=3D\"text-decoration:underline\" =
HREF=3D\"javascript:modifyOperation('" . $l['jr_id'] . "'," . dossier::id=
() . ",0,'S')\" > " . $l['jr_internal'] . "</A>";
-			else
-				$r.=3D$l['jr_internal'];
-
-			$r.=3D"</TD>";
-
-
-
-			//amount
-			$r.=3D'<TD align=3D"right">';
-			$r.=3Dnbm($l['j_montant']);
-			$r.=3D"</TD>";
-			//quantity
-			$r.=3D'<TD align=3D"right">';
-			$r.=3Dabs($quantity);
-			$r.=3D"</TD>";
-
-			// Unit Price
-			$r.=3D'<TD align=3D"right">';
-			$up =3D "";
-			if ($l['sg_quantity'] !=3D 0)
-				$up =3D round($l['j_montant'] / $l['sg_quantity'], 4);
-			$r.=3Dnbm($up);
-			$r.=3D"</TD>";
-			$r.=3Dtd(HtmlInput::remove_stock($l['sg_id'], 'Effacer'), 'id=3D"href=
' . $l['sg_id'] . '"');
-			$r.=3D"</TR>";
-		}// for ($i
-		// write the total
-		$msg =3D ($tot_quantity < 0) ? 'Sortie / Vente ' : 'Entr=C3=A9e / Acha=
t ';
-		$row =3D td('Total ' . $msg, ' colspan=3D"4" style=3D"width:auto;text-=
align:right"');
-		$row.=3Dtd(abs($tot_quantity), 'style=3D"text-align:right"');
-		$row.=3Dtd();
-		$r.=3Dtd($row);
-		$r.=3D"</table>";
-		$r.=3D'<div style=3D"float:left">';
-		$r.=3D'<table>';
-		$row =3D td('Quantit=C3=A9 IN/Achet=C3=A9e') . td($in_quantity, 'style=
=3D"text-align:right"');
-		$r.=3Dtr($row);
-		$row =3D td('Quantit=C3=A9 OUT/Vendue') . td($out_quantity, 'style=3D"=
text-align:right"');
-		$r.=3Dtr($row);
-		$row =3D td('Quantit=C3=A9 ') . td(abs($tot_quantity), 'style=3D"text-=
align:right"');
-		$r.=3Dtr($row);
-		$r.=3D'</table>';
-		$r.=3D'</div>';
-
-		$r.=3D'<div style=3D"float:left;clear:right;margin-left:10%">';
-		$r.=3D'<table>';
-		$row =3D td('Montant IN/Achet=C3=A9') . td($in_amount, 'style=3D"text-=
align:right"');
-		$r.=3Dtr($row);
-		$row =3D td('Montant OUT/Vendu') . td($out_amount, 'style=3D"text-alig=
n:right"');
-		$r.=3Dtr($row);
-		$row =3D td('Montant ') . td($out_amount - $in_amount, 'style=3D"text-=
align:right"');
-		$r.=3Dtr($row);
-		$r.=3D'</table>';
-		$r.=3D'</div>';
-
-		return $r;
-	}
-
 	/**
 	 * show history of all the stock movement
 	 * @param $p_array usually contains $_GET

Deleted: phpcompta/trunk/include/stock.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock.inc.php	2012-06-18 19:31:45 UTC (rev 49=
38)
+++ phpcompta/trunk/include/stock.inc.php	2012-06-19 13:01:33 UTC (rev 49=
39)
@@ -1,179 +0,0 @@
-<?php
-/*
- *   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 b=
y
- *   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-130=
7  USA
-*/
-// Auteur Dany De Bontridder ddebontridder@yahoo.fr
-
-/* $Revision$ */
-
-/*!\file
- * \brief Manage the stock by year
- */
-require_once('class_dossier.php');
-include_once ("ac_common.php");
-require_once('class_database.php');
-include_once("stock_inc.php");
-require_once('class_dossier.php');
-require_once('class_periode.php');
-$gDossier=3Ddossier::id();
-
-html_page_start($_SESSION['g_theme']);
-
-require_once('class_database.php');
-
-$cn=3Dnew Database($gDossier);
-include_once ("class_user.php");
-global $g_user;
-
-$href=3Dbasename($_SERVER['PHP_SELF']);
-
-$action=3D ( isset ($_GET['action']))? $_GET['action']:"";
-include_once("stock_inc.php");
-
-// Adjust the stock
-if ( isset ($_POST['sub_change']))
-{
-    $change=3D$_POST['stock_change'];
-    $sg_code=3D$_POST['sg_code'];
-    $sg_date=3D$_POST['sg_date'];
-    $year=3D$_POST['year'];
-    $comment=3D$_POST['comment'];
-
-    if ( isDate($sg_date) =3D=3D null
-            or isNumber($change) =3D=3D 0
-            or isNumber($year) =3D=3D 0 )
-    {
-        $msg=3D"Stock donn=C3=A9es non conformes";
-        alert('$msg');
-        echo_error($msg);
-    }
-    else
-    {
-
-        // if neg the stock decrease =3D> credit
-        $type=3D( $change < 0 )?'c':'d';
-        if ( $change !=3D 0)
-        {
-            $comment=3Dsql_string($comment);
-            $Res=3D$cn->exec_sql("insert into stock_goods
-                               (  j_id,
-                               f_id,
-                               sg_code,
-                               sg_quantity,
-                               sg_type,
-                               sg_date,
-                               sg_exercice,
-                               sg_comment,
-                               sg_tech_user)
-                               values (
-                               null,
-                               null,
-                               '$sg_code',
-                               abs($change),
-                               '$type',
-                               to_date('$sg_date','DD.MM.YYYY'),
-                               '$year',
-                               '$comment',
-                               '".$_SESSION['g_user']."');
-                               ");
-        }
-        // to update the view
-        $action=3D"detail";
-    }
-}
-
-// View the summary
-
-// if year is not set then use the year of the user's periode
-if ( ! isset ($_GET['year']) )
-{
-    // get defaut periode
-    $a=3D$g_user->get_periode();
-    // get exercice of periode
-    $periode=3Dnew Periode($cn,$a);
-    $year=3D$periode->get_exercice();
-
-}
-else
-{
-    $year=3D$_GET['year'];
-}
-
-// View details
-if ( $action =3D=3D 'detail' )
-{
-    $sg_code=3D(isset ($_GET['sg_code'] ))?$_GET['sg_code']:$_POST['sg_c=
ode'];
-    $year=3D(isset($_GET['year']))?$_GET['year']:$_POST['year'];
-    $a=3DViewDetailStock($cn,$sg_code,$year);
-    $write=3D1;
-
-    $b=3D"";
-
-
-    echo '<div class=3D"redcontent" style=3D"margin-left:10%">' ;
-    echo $a;
-    echo '<div style=3D"float:left;clear:both">';
-
-    if ( $write !=3D 0)
-    {
-        echo '<fieldset><legend>';
-        echo 'Entrer la valeur qui doit augmenter ou diminuer le stock';
-        echo '</legend>';
-        echo '<form action=3D"?ac=3D'.$_GET['ac'].'" method=3D"POST">';
-        echo ChangeStock($sg_code,$year);
-        echo HtmlInput::submit("sub_change" ,"Valider");
-        echo dossier::hidden();
-        echo HtmlInput::button_anchor('Retour','?ac=3D'.$_REQUEST['ac'].=
'&'.dossier::get());
-        echo '</form>';
-        echo '</fieldset>';
-    }
-    else
-        echo HtmlInput::button_anchor('Retour','?ac=3D'.$_REQUEST['ac'].=
'&'.dossier::get());
-    echo '</div>';
-
-
-
-
-    echo '</div>';
-    exit();
-}
-
-// Show the possible years
-$sql=3D"select distinct (p_exercice) as exercice from parm_periode ";
-$Res=3D$cn->exec_sql($sql);
-$r=3D"";
-for ( $i =3D 0; $i < Database::num_row($Res);$i++)
-{
-    $l=3DDatabase::fetch_array($Res,$i);
-    $url=3Dsprintf("?ac=3D".$_REQUEST['ac']."&year=3D%d&".dossier::get()=
,
-                     $l['exercice']);
-    $r.=3DHtmlInput::button_anchor($l['exercice'],$url);
-}
-// Check if User Can see the stock
-
-
-// Show the current stock
-echo '<div class=3D"redcontent">';
-echo $r;
-$a=3DViewStock($cn,$year);
-if ( $a !=3D null )
-{
-    echo $a;
-}
-echo '</div>';
-html_page_stop();
-?>

Deleted: phpcompta/trunk/include/stock_inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_inc.php	2012-06-18 19:31:45 UTC (rev 49=
38)
+++ phpcompta/trunk/include/stock_inc.php	2012-06-19 13:01:33 UTC (rev 49=
39)
@@ -1,366 +0,0 @@
-<?php
-/*
- *   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 b=
y
- *   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-130=
7  USA
-*/
-/* $Revision$ */
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/*! \file
- * \brief Function for managing the stock
- */
-require_once('class_fiche.php');
-
-/*!
- **************************************************
- * \brief  show the listing of all goods
- *
- *
- *\param  $cn  database connection
- * \param $p_year exercice
- *	-
- * \return string containing the table
- */
-function ViewStock($p_cn,$p_year)
-{
-// build sql -- get the different merchandise sold or bought
-    // during the p_year
-    /* $sql=3D" select distinct sg_code
-        from stock_goods
-         left outer join  jrnx on (stock_goods.j_id=3Djrnx.j_id)
-        right outer join parm_periode on (parm_periode.p_id=3Djrnx.j_tec=
h_per)
-      where
-        p_exercice=3D '$p_year'
-        and sg_code is not null and sg_code !=3D '' and sg_code!=3D'null=
'";
-    */
-    $sql=3D" select distinct sg_code
-         from stock_goods
-         where
-         sg_code is not null and sg_code not in ('','null','--not found-=
-','- ERROR -')";
-
-
-
-    // send the sql
-    $Res=3D$p_cn->exec_sql($sql);
-
-
-    if ( ( $M =3D Database::num_row($Res)) =3D=3D 0 ) return null;
-    // store it in a HTLM table
-    $result=3D'<table style=3D"width:100%;border:solid blue 2px ;border-=
style:outset;">';
-    $result.=3D"<tr>";
-    $result.=3D'<th style=3D"text-align:left">Code</th>';
-    $result.=3D'<th style=3D"text-align:left">Noms</th>';
-    $result.=3D'<th style=3D"text-align:right">Entr=C3=A9e</th>';
-    $result.=3D'<th style=3D"text-align:right">Sortie</th>';
-    $result.=3D'<th style=3D"text-align:right">Solde</th>';
-    $result.=3D"</tr>";
-
-    // Sql result =3D> table
-    for ($i =3D 0; $i < $M ; $i++ )
-    {
-        $r=3DDatabase::fetch_array($Res,$i);
-        $result.=3D"<TR>";
-
-        // sg_code  and link to details
-        $result.=3D"<td>".'<a class=3D"one"
-                 HREF=3D"?ac=3D'.$_REQUEST['ac'].'&action=3Ddetail&sg_co=
de=3D'.$r['sg_code'].'&year=3D'.$p_year.
-                 '&'.dossier::get().'">'.
-                     $r['sg_code']."</A></td>";
-
-        // name
-        $a_name=3DgetFicheNameCode($p_cn,$r['sg_code']);
-        $name=3D"";
-        if ( $a_name !=3D null )
-        {
-            foreach ($a_name as $key=3D>$element)
-            {
-                $name.=3D$element['av_text'].",";
-            }
-        }// if ( $a_name
-        $result.=3D"<td> $name </td>";
-
-        // Debit (in)
-        $deb=3DGetQuantity($p_cn,$r['sg_code'],$p_year,'d');
-        $deb=3D($deb=3D=3D'')?"0.0":$deb;
-        $result.=3D'<td style=3D"text-align:right">'.$deb."</td>";
-
-        // Credit (out)
-        $cred=3DGetQuantity($p_cn,$r['sg_code'],$p_year,'c');
-        $cred=3D($cred=3D=3D'')?"0.0":$cred;
-        $result.=3D'<td style=3D"text-align:right">'.$cred."</td>";
-
-
-        // diff
-        $diff=3D$deb-$cred;
-        $msg=3D($diff < 0)?_('Sortie /Vente '):_('Entr=C3=A9e/Achat ');
-        $result.=3D'<td style=3D"text-align:right">'. $msg.(abs($diff)).=
"</td>";
-        $result.=3D"</tr>";
-
-    }
-    $result.=3D"</table>";
-
-    return $result;
-}
-/*!
- ************************************************************
- * \brief  return an array of f_id and f_name
- *
- *
- * \param $p_cn database connection
- * \param _sg_code stock_goods.sg_code
- * \return
- *      - array (f_id, f_label) or null if nothing is found
- */
-function getFicheNameCode ($p_cn,$p_sg_code)
-{
-    // Sql stmt
-    $sql=3D"select distinct f_id,ad_value
-         from stock_goods
-         join fiche_detail using(f_id)
-         where
-         ad_id=3D".ATTR_DEF_STOCK."
-         and sg_code=3D'$p_sg_code'
-         ";
-// Execute
-    $Res=3D$p_cn->exec_sql($sql);
-    if ( ( $M=3DDatabase::num_row($Res)) =3D=3D 0 ) return null;
-
-// Store in an array
-    for ( $i=3D0; $i<$M;$i++)
-    {
-        $r=3DDatabase::fetch_array($Res,$i);
-        $a['f_id']=3D$r['f_id'];
-        $fiche=3Dnew Fiche($p_cn,$r['f_id']);
-        $a['av_text']=3D$fiche->getName();
-        $result[$i]=3D$a;
-
-    }
-
-    return $result;
-
-}
-/*!
- **************************************************
- * \brief View the details of a stock
- *
- *
- *\param $p_cn database connection
- * \param$p_sg_code
- * \param $p_year
- * \return HTML code
- */
-function ViewDetailStock($p_cn,$p_sg_code,$p_year)
-{
-    $sql=3D"select sg_id,
-              sg_code,
-         j_montant,
-         coalesce(j_date,sg_date) as j_date,
-         sg_quantity,
-         sg_type,
-         jr_id,
-         coalesce(jr_comment,sg_comment) as comment,
-         coalesce(jr_internal,'Changement manuel') as jr_internal,
-         jr_id,
-         case when sg_date is not null then sg_date else j_date end as s=
tock_date
-         from stock_goods
-         left outer join jrnx using (j_id)
-         left outer join jrn on jr_grpt_id=3Dj_grpt
-         where
-         sg_code=3D'$p_sg_code' and (
-         sg_exercice =3D '$p_year'
-         or j_tech_per in (select p_id from parm_periode where p_exercic=
e=3D'$p_year')
-         )
-         order by stock_date
-         " ;
-    // name
-
-    $in_quantity=3D0;
-    $out_quantity=3D0;
-    $in_amount=3D0;
-    $out_amount=3D0;
-    $r=3D"";
-    $a_name=3DgetFicheNameCode($p_cn,$p_sg_code);
-    $name=3D"";
-    if ( $a_name !=3D null )
-    {
-        foreach ($a_name as $key=3D>$element)
-        {
-            $name.=3D$element['av_text'].",";
-        }
-    }// if ( $a_name
-    // Add java script for detail
-
-
-    $r.=3D'<H2 class=3D"info">'.$p_sg_code."  Noms : ".$name.'</H2>';
-
-    $Res=3D$p_cn->exec_sql($sql);
-    if ( ($M=3DDatabase::num_row($Res)) =3D=3D 0 ) return "no rows";
-    $r.=3D'<table class=3D"result" >';
-    $r.=3D"<TR >";
-    $r.=3D"<th>Date </th>";
-    $r.=3D"<th>Entr=C3=A9e / Sortie </th>";
-    $r.=3D"<th>Description</th>";
-    $r.=3D"<th>Op&eacute;ration</th>";
-    $r.=3D"<th style=3D\"text-align:right\">Montant</th>";
-    $r.=3D"<th style=3D\"text-align:right\">Quantit=C3=A9</th>";
-    $r.=3D"<th style=3D\"text-align:right\">Prix/Cout Unitaire</th>";
-    $r.=3D"</TR>";
-    $tot_quantity=3D0;
-    for ( $i=3D0; $i < $M;$i++)
-    {
-        $l=3DDatabase::fetch_array($Res,$i);
-        $r.=3D"<tR id=3D\"stock".$l['sg_id']."\" >";
-
-        // date
-        $r.=3D"<TD>";
-        $r.=3Dformat_date($l['j_date']);
-        $r.=3D"</TD>";
-
-        //type (deb =3D out cred=3Din)
-        $r.=3D"<TD>";
-        $r.=3D($l['sg_type']=3D=3D'c')?'OUT':'IN';
-        $r.=3D"</TD>";
-
-        if ( $l['sg_type']=3D=3D'c')
-        {
-            $quantity=3D(-1)*$l['sg_quantity'];
-            $out_quantity+=3D$l['sg_quantity'];
-            $out_amount+=3D$l['j_montant'];
-        }
-        else
-        {
-            $quantity=3D$l['sg_quantity'];
-            $in_quantity+=3D$l['sg_quantity'];
-            $in_amount+=3D$l['j_montant'];
-        }
-        $tot_quantity+=3D$quantity;
-        // comment
-        $r.=3D"<TD>";
-        $r.=3Dh($l['comment']);
-        $r.=3D"</TD>";
-
-        // jr_internal
-        $r.=3D"<TD>";
-        if ( $l['jr_id'] !=3D "")
-            $r.=3D "<A class=3D\"detail\" style=3D\"text-decoration:unde=
rline\" HREF=3D\"javascript:modifyOperation('".$l['jr_id']."',".dossier::=
id().",0,'S')\" > ".$l['jr_internal']."</A>";
-        else
-            $r.=3D$l['jr_internal'];
-
-        $r.=3D"</TD>";
-
-
-
-        //amount
-        $r.=3D'<TD align=3D"right">';
-        $r.=3Dnbm($l['j_montant']);
-        $r.=3D"</TD>";
-        //quantity
-        $r.=3D'<TD align=3D"right">';
-        $r.=3Dabs($quantity);
-        $r.=3D"</TD>";
-
-        // Unit Price
-        $r.=3D'<TD align=3D"right">';
-        $up=3D"";
-        if ( $l['sg_quantity'] !=3D 0 )
-            $up=3Dround($l['j_montant']/$l['sg_quantity'],4);
-        $r.=3Dnbm($up);
-        $r.=3D"</TD>";
-	$r.=3Dtd(HtmlInput::remove_stock($l['sg_id'],'Effacer'),'id=3D"href'.$l=
['sg_id'].'"');
-        $r.=3D"</TR>";
-    }// for ($i
-    // write the total
-    $msg=3D($tot_quantity<0)?'Sortie / Vente ':'Entr=C3=A9e / Achat ';
-    $row=3Dtd('Total '.$msg,' colspan=3D"4" style=3D"width:auto;text-ali=
gn:right"');
-    $row.=3Dtd(abs($tot_quantity), 'style=3D"text-align:right"');
-    $row.=3Dtd();
-    $r.=3Dtd($row);
-    $r.=3D"</table>";
-    $r.=3D'<div style=3D"float:left">';
-    $r.=3D'<table>';
-    $row=3Dtd('Quantit=C3=A9 IN/Achet=C3=A9e').td($in_quantity,'style=3D=
"text-align:right"');
-    $r.=3Dtr($row);
-    $row=3Dtd('Quantit=C3=A9 OUT/Vendue').td($out_quantity,'style=3D"tex=
t-align:right"');
-    $r.=3Dtr($row);
-    $row=3Dtd('Quantit=C3=A9 ').td(abs($tot_quantity),'style=3D"text-ali=
gn:right"');
-    $r.=3Dtr($row);
-    $r.=3D'</table>';
-    $r.=3D'</div>';
-
-    $r.=3D'<div style=3D"float:left;clear:right;margin-left:10%">';
-    $r.=3D'<table>';
-    $row=3Dtd('Montant IN/Achet=C3=A9').td($in_amount,'style=3D"text-ali=
gn:right"');
-    $r.=3Dtr($row);
-    $row=3Dtd('Montant OUT/Vendu').td($out_amount,'style=3D"text-align:r=
ight"');
-    $r.=3Dtr($row);
-    $row=3Dtd('Montant ').td($out_amount-$in_amount,'style=3D"text-align=
:right"');
-    $r.=3Dtr($row);
-    $r.=3D'</table>';
-    $r.=3D'</div>';
-
-    return $r;
-
-}
-/*!
- **************************************************
- * \brief
- *
- * parm :
- *	-
- * gen :
- *	-
- * return:
- */
-function ChangeStock($p_sg_code,$p_year)
-{
-    $sg_date=3Ddate("d.m.Y");
-    $r=3D'<table>';
-    $row=3Dtd('Description');
-    $row.=3Dtd(' <input type=3D"text" class=3D"input_text"  name=3D"comm=
ent" value=3D"">');
-    $r.=3Dtr($row);
-    $row=3Dtd('Valeur(positive pour IN ou n=C3=A9gative comme OUT)');
-    $row.=3Dtd(' <input type=3D"text" class=3D"input_text" name=3D"stock=
_change" value=3D"0">');
-    $r.=3Dtr($row);
-    $row=3Dtd('Date');
-    $row.=3Dtd(' <input type=3D"text" class=3D"input_text"  name=3D"sg_d=
ate" value=3D"'.$sg_date.'">');
-    $r.=3Dtr($row);
-    $r.=3D'</table>';
-    $r.=3D'<input type=3D"hidden" name=3D"sg_code" value=3D"'.$p_sg_code=
.'">
-        <input type=3D"hidden" name=3D"year" value=3D"'.$p_year.'">';
-
-    return $r;
-
-}
-/*!
- * \brief return the quantity of a sg_code for the period
- *
- * \return number or NULL
- */
-function GetQuantity($p_cn,$p_sg_code,$p_year,$p_type)
-{
-    $sql=3D"select sum(sg_quantity) as result
-         from stock_goods
-         left join jrnx on (stock_goods.j_id=3Djrnx.j_id)
-         left join parm_periode on (parm_periode.p_id=3Djrnx.j_tech_per)
-         where
-         sg_code=3D'$p_sg_code' and
-         (p_exercice =3D '$p_year' or to_char(sg_date::timestamp,'YYYY')=
=3D'$p_year') and
-         sg_type=3D'$p_type'";
-    $Res=3D$p_cn->exec_sql($sql);
-    if ( Database::num_row($Res)=3D=3D 0) return null;
-    $value=3DDatabase::fetch_array($Res,0);
-    return $value['result'];
-
-}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 09:26:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgyRw-0005br-F5
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 09:26:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 15:17:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.207632.1340112388.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4940 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 13:26:27 -0000

Author: danydb
Date: 2012-06-19 15:17:18 +0200 (Tue, 19 Jun 2012)
New Revision: 4940

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_stock_goods.php
Log:
0000641: Nettoyage fichier stock

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-19 13:0=
1:33 UTC (rev 4939)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-19 13:1=
7:18 UTC (rev 4940)
@@ -41,6 +41,7 @@
 require_once('class_itva_popup.php');
 require_once('class_acc_ledger_info.php');
 require_once('class_acc_ledger_fin.php');
+require_once 'class_stock_goods.php';
=20
 /*!\brief Handle the ledger of purchase,
  *
@@ -472,7 +473,7 @@
                 // always save quantity but in withStock we can find
                 // what card need a stock management
                 if ( $g_parameter->MY_STOCK=3D'Y')
-                    InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nN=
eg*${'e_quant'.$i},'d',$repo) ;
+                    Stock_Goods::insert_goods(array('db'=3D>$this->db,'j=
_id'=3D>$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i}=
,'dir'=3D>'d','repo'=3D>$repo)) ;
=20
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
                 {

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-19 13:01:33=
 UTC (rev 4939)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-19 13:17:18=
 UTC (rev 4940)
@@ -350,11 +350,12 @@
                        {"e_quant".$i
                        }
                        <0)?-1:1;
-
+               =20
                 // always save quantity but in withStock we can find
                 // what card need a stock management
                 if ( $g_parameter->MY_STOCK=3D'Y')
-                    InsertStockGoods($this->db,$j_id,${'e_march'.$i},$nN=
eg*${'e_quant'.$i},'c',$repo) ;
+                    Stock_Goods::insert_goods(array('db'=3D>$this->db,'j=
_id'=3D>$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i}=
,'dir'=3D>'c','repo'=3D>$repo)) ;
+                   =20
=20
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
                 {

Modified: phpcompta/trunk/include/class_stock_goods.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods.php	2012-06-19 13:01:33 UTC=
 (rev 4939)
+++ phpcompta/trunk/include/class_stock_goods.php	2012-06-19 13:17:18 UTC=
 (rev 4940)
@@ -121,7 +121,48 @@
 			throw $exc;
 		}
 	}
+        /**
+         * Insert into stock_goods from ACH and VEN
+         * @param type $p_array KEY : db =3D> database conx, j_id =3D> j=
rnx.j_id,goods=3D> f_id of the goods=20
+         * 'quant' =3D> quantity ,'dir'=3D> d or c (c for sales OUT and =
d for purchase IN),'repo'=3D>r_id of the
+         * repository (stock_repository.r_id
+         */
+        static function insert_goods(&$p_cn,$p_array)
+        {
+            global $g_user;
+            if ($g_user->can_write_repo($p_depot) =3D=3D false)
+                return false;
=20
+            // Retrieve the good account for stock
+            $code =3D new Fiche($p_cn);
+            $code->get_by_qcode($p_good);
+            $code_marchandise =3D $code->strAttribut(ATTR_DEF_STOCK);
+            if ($code_marchandise =3D=3D NOTFOUND || $code_marchandise=3D=
=3D'')
+                return false;
+
+            $exercice =3D $g_user->get_exercice();
+
+            if ($exercice =3D=3D 0)
+                throw new Exception('Annee invalide erreur');
+
+            $Res =3D $p_cn->exec_sql("insert into stock_goods (
+                            j_id,
+                            f_id,
+                            sg_code,
+                            sg_quantity,
+                            sg_type,sg_exercice,r_id ) values ($1,$2,$3,=
$4,$5,$6,$7)", array(
+                $p_array['j_id'],
+                $code->id,
+                $code_marchandise,
+                $p_array['quant'],
+                $p_array['dir'],
+                $exercice,
+                $p_array['repo']
+                    )
+            );
+           return $Res;
+    }
+
 }
=20
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 09:27:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgyTP-0006jd-Cb
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 09:27:59 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 15:18:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.207633.1340112478.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4941 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 13:27:58 -0000

Author: danydb
Date: 2012-06-19 15:18:52 +0200 (Tue, 19 Jun 2012)
New Revision: 4941

Modified:
   phpcompta/trunk/include/user_common.php
Log:
fix potentiel bug

Modified: phpcompta/trunk/include/user_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/user_common.php	2012-06-19 13:17:18 UTC (rev =
4940)
+++ phpcompta/trunk/include/user_common.php	2012-06-19 13:18:52 UTC (rev =
4941)
@@ -33,64 +33,7 @@
  * \brief Common functions
  */
=20
-
-
-
-
 /*!
- *\brief  Insert data into stock_goods,
- *
- * \param  $p_cn Database object
- * \param $p_j_id the j_id
- * \param $p_good the goods
- * \param $p_quant  quantity
- * \param $p_type c for SALE or d for PURCHASE
- *
- * \return $res of the insert or false if something gets wrong
- * \note Link to jrn gives the date
- */
-function InsertStockGoods($p_cn, $p_j_id, $p_good, $p_quant, $p_type,$p_=
depot)
-{
-	/**
-	 *@todo function insertStockGoods doit =C3=AAtre d=C3=A9plac=C3=A9e dan=
s class_stock
-	 */
-    global $g_user;
-    if ( $g_user->can_write_repo($p_depot) =3D=3D false )
-        return false;
-
-    // Retrieve the good account for stock
-    $code =3D new Fiche($p_cn);
-    $code->get_by_qcode($p_good);
-    $code_marchandise =3D $code->strAttribut(ATTR_DEF_STOCK);
-    if ( $code_marchandise =3D=3D NOTFOUND )
-        return false;
-
-    $exercice =3D $g_user->get_exercice();
-
-    if ($exercice =3D=3D 0)
-        throw new Exception('Annee invalide erreur');
-
-    $Res =3D $p_cn->exec_sql("insert into stock_goods (
-                         j_id,
-                         f_id,
-                         sg_code,
-                         sg_quantity,
-                         sg_type,sg_exercice,r_id ) values ($1,$2,$3,$4,=
$5,$6,$7)",
-            array(
-                    $p_j_id,
-                    $code->id,
-                    $code_marchandise,
-                    $p_quant,
-                    $p_type,
-                    $exercice,
-                    $p_depot
-                )
-            );
-    return $Res;
-}
-
-
-/*!
  *\brief   test if a jrn op is valid
  *
  * \param $p_cn db
@@ -99,7 +42,7 @@
  *        - 1 is valid
  *        - 0 is not valid
  */
-function isValid ($p_cn,$p_grpt_id)
+function isValid_deprecrated ($p_cn,$p_grpt_id)
 {
     $Res=3D$p_cn->exec_sql("select jr_valid from jrn where jr_grpt_id=3D=
$p_grpt_id");
=20
@@ -280,6 +223,7 @@
 {
     $p_num=3Dtrim($p_num);
     if ($p_num=3D=3D'') return 0;
+    $p_num=3Dstr_replace("'",'',$p_num);
     $p_num=3Dstr_replace(',','.',$p_num);
     return $p_num;
 }



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 09:31:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SgyWQ-0007HP-1J
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 09:31:06 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 15:21:58 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.207641.1340112665.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4942 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 13:31:05 -0000

Author: danydb
Date: 2012-06-19 15:21:58 +0200 (Tue, 19 Jun 2012)
New Revision: 4942

Modified:
   phpcompta/trunk/include/class_acc_ledger.php
   phpcompta/trunk/include/class_acc_ledger_fin.php
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_anc_operation.php
   phpcompta/trunk/include/class_contact.php
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/class_fiche_def.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/include/compta_ven.inc.php
   phpcompta/trunk/include/history_operation.inc.php
   phpcompta/trunk/include/search.inc.php
   phpcompta/trunk/include/user_common.php
Log:
rename jrn_navigation_bar to navigation_bar

Modified: phpcompta/trunk/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger.php	2012-06-19 13:18:52 UTC =
(rev 4941)
+++ phpcompta/trunk/include/class_acc_ledger.php	2012-06-19 13:21:58 UTC =
(rev 4942)
@@ -596,7 +596,7 @@
     $page=3D(isset($_GET['offset']))?$_GET['page']:1;
     $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
     // create the nav. bar
-    $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
     // show a part
     list($count,$html)=3D $Ledger->list_operation($sql,$offset,0);
     echo $html;
@@ -769,7 +769,7 @@
     $page=3D(isset($_GET['offset']))?$_GET['page']:1;
     $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
     // create the nav. bar
-    $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
     // show a part
     list($count,$html)=3D $Ledger->list_operation($sql,$offset,0);
     echo $html;

Modified: phpcompta/trunk/include/class_acc_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-19 13:18:52 =
UTC (rev 4941)
+++ phpcompta/trunk/include/class_acc_ledger_fin.php	2012-06-19 13:21:58 =
UTC (rev 4942)
@@ -1056,7 +1056,7 @@
=20
 		list($max_line, $list) =3D ListJrn($this->db, "where jrn_def_type=3D'F=
IN' $filter_per $l $available_ledger "
 				, null, $offset, 0);
-		$bar =3D jrn_navigation_bar($offset, $max_line, $step, $page);
+		$bar =3D navigation_bar($offset, $max_line, $step, $page);
=20
 		echo "<hr> $bar";
 		echo $list;

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-19 13:1=
8:52 UTC (rev 4941)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-19 13:2=
1:58 UTC (rev 4942)
@@ -1598,7 +1598,7 @@
=20
         // Get the max line
         $m=3D($max_line2>$max_line)?$max_line2:$max_line;
-        $bar2=3Djrn_navigation_bar($offset,$m,$step,$page);
+        $bar2=3Dnavigation_bar($offset,$m,$step,$page);
=20
         echo $bar2;
         echo '<h2 class=3D"info"> '._('Echeance d=C3=A9pass=C3=A9e').' <=
/h2>';

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-19 13:18:52=
 UTC (rev 4941)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-19 13:21:58=
 UTC (rev 4942)
@@ -992,7 +992,7 @@
=20
         // Get the max line
         $m=3D($max_line2>$max_line)?$max_line2:$max_line;
-        $bar2=3Djrn_navigation_bar($offset,$m,$step,$page);
+        $bar2=3Dnavigation_bar($offset,$m,$step,$page);
=20
         echo $bar2;
         echo '<h2 class=3D"info"> '._('Echeance d=C3=A9pass=C3=A9e').' <=
/h2>';

Modified: phpcompta/trunk/include/class_anc_operation.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_anc_operation.php	2012-06-19 13:18:52 U=
TC (rev 4941)
+++ phpcompta/trunk/include/class_anc_operation.php	2012-06-19 13:21:58 U=
TC (rev 4942)
@@ -181,11 +181,11 @@
         if ( empty($array)  )
             return "Pas d'enregistrement trouv&eacute;";
=20
-        // jrn_navigation_bar
+        // navigation_bar
         $step=3D$_SESSION['g_pagesize'];
         $page=3D(isset($_GET['offset']))?$_GET['page']:1;
         $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
-        $bar=3Djrn_navigation_bar($offset+1,count($array),$step,$page);
+        $bar=3Dnavigation_bar($offset+1,count($array),$step,$page);
=20
         if ( $step !=3D-1)
             $view=3Darray_splice($array,$offset,$step);

Modified: phpcompta/trunk/include/class_contact.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_contact.php	2012-06-19 13:18:52 UTC (re=
v 4941)
+++ phpcompta/trunk/include/class_contact.php	2012-06-19 13:21:58 UTC (re=
v 4942)
@@ -64,7 +64,7 @@
         // Get offset and page variable
         $offset=3D( isset ($_REQUEST['offset'] )) ?$_REQUEST['offset']:0=
;
         $page=3D(isset($_REQUEST['page']))?$_REQUEST['page']:1;
-        $bar=3Djrn_navigation_bar($offset,$all_contact,$_SESSION['g_page=
size'],$page);
+        $bar=3Dnavigation_bar($offset,$all_contact,$_SESSION['g_pagesize=
'],$page);
         // set a filter ?
         $search=3D"";
         if ( trim($p_search) !=3D "" )

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-19 13:18:52 UTC (rev =
4941)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-19 13:21:58 UTC (rev =
4942)
@@ -1556,7 +1556,7 @@
         // Get offset and page variable
         $offset=3D( isset ($_REQUEST['offset'] )) ?$_REQUEST['offset']:0=
;
         $page=3D(isset($_REQUEST['page']))?$_REQUEST['page']:1;
-        $bar=3Djrn_navigation_bar($offset,$all_tiers,$_SESSION['g_pagesi=
ze'],$page);
+        $bar=3Dnavigation_bar($offset,$all_tiers,$_SESSION['g_pagesize']=
,$page);
=20
         // set a filter ?
         $search=3D$p_sql;

Modified: phpcompta/trunk/include/class_fiche_def.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche_def.php	2012-06-19 13:18:52 UTC (=
rev 4941)
+++ phpcompta/trunk/include/class_fiche_def.php	2012-06-19 13:21:58 UTC (=
rev 4942)
@@ -299,7 +299,7 @@
              fiche join fiche_detail using(f_id)
              where ad_id=3D1 and fd_id=3D$1 order by 2";
=20
-        // we use jrn_navigation_bar
+        // we use navigation_bar
         if ($step =3D=3D 1  && $_SESSION['g_pagesize'] !=3D -1   )
         {
             $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
@@ -360,7 +360,7 @@
                                            where fd_id=3D'".$this->id."'=
 and ad_id=3D".ATTR_DEF_NAME." order by f_id");
             $sql_limit=3D" limit ".$step;
             $sql_offset=3D" offset ".$offset;
-            $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+            $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
         }
=20
         // Get all name the cards of the select category

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-19 13:18:52 UTC (=
rev 4941)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-19 13:21:58 UTC (=
rev 4942)
@@ -708,7 +708,7 @@
 			$limit =3D " LIMIT $step OFFSET $offset ";
 		else
 			$limit =3D '';
-		$bar =3D jrn_navigation_bar($offset, $max_line, $step, $page);
+		$bar =3D navigation_bar($offset, $max_line, $step, $page);
=20
 		$Res =3D $this->db->exec_sql($sql . $limit);
 		$a_row =3D Database::fetch_all($Res);

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-19 13:18:52 UTC (rev =
4941)
+++ phpcompta/trunk/include/class_stock.php	2012-06-19 13:21:58 UTC (rev =
4942)
@@ -64,7 +64,7 @@
=20
 		$max_row =3D Database::num_row($res);
=20
-		$nav_bar =3D jrn_navigation_bar($offset, $max_row, 0, $page);
+		$nav_bar =3D navigation_bar($offset, $max_row, 0, $page);
=20
 		if ($step !=3D -1)
 			$res =3D $this->cn->exec_sql($sql . " , sg_id asc limit " . $step . "=
 offset " . $offset);

Modified: phpcompta/trunk/include/compta_ven.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/compta_ven.inc.php	2012-06-19 13:18:52 UTC (r=
ev 4941)
+++ phpcompta/trunk/include/compta_ven.inc.php	2012-06-19 13:21:58 UTC (r=
ev 4942)
@@ -307,7 +307,7 @@
     $step=3D$_SESSION['g_pagesize'];
     $page=3D(isset($_GET['offset']))?$_GET['page']:1;
     $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
-    $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
=20
=20
     echo '<form method=3D"GET" id=3D"fpaidv" class=3D"print" action=3D"'=
.$href.'">';
@@ -393,7 +393,7 @@
     $step=3D$_SESSION['g_pagesize'];
     $page=3D(isset($_GET['offset']))?$_GET['page']:1;
     $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
-    $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
=20
=20
     echo '<form method=3D"GET" id=3D"fpaidv" class=3D"print" action=3D"'=
.$href.'">';

Modified: phpcompta/trunk/include/history_operation.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/history_operation.inc.php	2012-06-19 13:18:52=
 UTC (rev 4941)
+++ phpcompta/trunk/include/history_operation.inc.php	2012-06-19 13:21:58=
 UTC (rev 4942)
@@ -116,7 +116,7 @@
 $step =3D $_SESSION['g_pagesize'];
 $page =3D (isset($_GET['offset'])) ? $_GET['page'] : 1;
 $offset =3D (isset($_GET['offset'])) ? $_GET['offset'] : 0;
-$bar =3D jrn_navigation_bar($offset, $max_line, $step, $page);
+$bar =3D navigation_bar($offset, $max_line, $step, $page);
=20
 echo $msg;
 echo '<form method=3D"GET" id=3D"fpaida" class=3D"print">';

Modified: phpcompta/trunk/include/search.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/search.inc.php	2012-06-19 13:18:52 UTC (rev 4=
941)
+++ phpcompta/trunk/include/search.inc.php	2012-06-19 13:21:58 UTC (rev 4=
942)
@@ -108,7 +108,7 @@
     // Count nb of line
     $max_line=3D$cn->count_sql($sql);
     list($count,$content)=3D$ledger->list_operation_to_reconcile($sql);
-    $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
=20
    if (! $inside ) {
 	   echo $bar;

Modified: phpcompta/trunk/include/user_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/user_common.php	2012-06-19 13:18:52 UTC (rev =
4941)
+++ phpcompta/trunk/include/user_common.php	2012-06-19 13:21:58 UTC (rev =
4942)
@@ -75,11 +75,11 @@
    $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
=20
    list ($max_ligne,$list)=3DListJrn($cn,$_GET['p_jrn'],$sql,null,$offse=
t,1);
-   $bar=3Djrn_navigation_bar($offset,$max_ligne,$step,$page);
+   $bar=3Dnavigation_bar($offset,$max_ligne,$step,$page);
 \endverbatim
  * \return   string with the nav. bar
  */
-function jrn_navigation_bar($p_offset,$p_line,$p_size=3D0,$p_page=3D1,$p=
_javascript=3D"")
+function navigation_bar($p_offset,$p_line,$p_size=3D0,$p_page=3D1,$p_jav=
ascript=3D"")
 {
     // if the pagesize is unlimited return ""
     // in that case there is no nav. bar



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 09:35:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sgyaj-0000Gp-3r
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 09:35:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 15:26:24 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.207652.1340112932.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4943 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 13:35:31 -0000

Author: danydb
Date: 2012-06-19 15:26:24 +0200 (Tue, 19 Jun 2012)
New Revision: 4943

Modified:
   phpcompta/trunk/include/template/user_sec_profile.php
   phpcompta/trunk/include/template/user_sec_repository.php
Log:
0000637: Couleur dans CFGPRO

Modified: phpcompta/trunk/include/template/user_sec_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_profile.php	2012-06-19 13:2=
1:58 UTC (rev 4942)
+++ phpcompta/trunk/include/template/user_sec_profile.php	2012-06-19 13:2=
6:24 UTC (rev 4943)
@@ -41,7 +41,10 @@
 				<?=3DHtmlInput::hidden('ua_id[]',$array[$i]['ua_id'])?>
 				<?=3DHtmlInput::hidden('ap_id[]',$array[$i]['p_id'])?>
 			</td>
-			<td>
+                        <?
+                            $color=3D($array[$i]['ua_right']!=3D'')?"bor=
der:lightgreen 2px solid; ":"border:red 2px solid; ";
+                        ?>
+			<td <?=3D$color?>>
 				<?
 				$isel=3Dnew ISelect("right[]");
 				$isel->value=3D$aright_value;

Modified: phpcompta/trunk/include/template/user_sec_repository.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_repository.php	2012-06-19 1=
3:21:58 UTC (rev 4942)
+++ phpcompta/trunk/include/template/user_sec_repository.php	2012-06-19 1=
3:26:24 UTC (rev 4943)
@@ -40,7 +40,10 @@
 				<?=3DHtmlInput::hidden('ur_id[]',$array[$i]['ur_id'])?>
 				<?=3DHtmlInput::hidden('ar_id[]',$array[$i]['r_id'])?>
 			</td>
-			<td>
+                         <?
+                            $color=3D($array[$i]['ur_right']!=3D'')?"bor=
der:lightgreen 2px solid; ":"border:red 2px solid; ";
+                        ?>
+			<td <?=3D$color?>>
 				<?
 				$isel=3Dnew ISelect("right[]");
 				$isel->value=3D$aright_value;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 13:55:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sh2eU-0002gn-OB
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 13:55:42 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 19:46:31 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.208774.1340128542.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4944 - in phpcompta/trunk: . html include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 17:55:41 -0000

Author: danydb
Date: 2012-06-19 19:46:29 +0200 (Tue, 19 Jun 2012)
New Revision: 4944

Modified:
   phpcompta/trunk/
   phpcompta/trunk/html/
   phpcompta/trunk/html/backup.php
   phpcompta/trunk/include/
   phpcompta/trunk/include/class_stock_goods.php
   phpcompta/trunk/include/restore.inc.php
Log:
set properly the PG variable for restore and backup


Property changes on: phpcompta/trunk
___________________________________________________________________
Name: svn:ignore
   - cache
compile
tmp

   + cache
compile
tmp
.a.swp



Property changes on: phpcompta/trunk/html
___________________________________________________________________
Name: svn:ignore
   - *.log
ajax
.user_login.php.swp
.~lock.a.csv#
.~lock.a.ods#
.a.csv.swp
.direct.php.swp
.style-light.css.swp
.a.swp
.htaccess.swp
.b.php.swp
.style.css.swp

   + *.log
ajax
.user_login.php.swp
.~lock.a.csv#
.~lock.a.ods#
.a.csv.swp
.direct.php.swp
.style-light.css.swp
.a.swp
.htaccess.swp
.b.php.swp
.style.css.swp
.last.txt.swp
.export.php.swp


Modified: phpcompta/trunk/html/backup.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/backup.php	2012-06-19 13:26:24 UTC (rev 4943)
+++ phpcompta/trunk/html/backup.php	2012-06-19 17:46:29 UTC (rev 4944)
@@ -59,10 +59,11 @@
         putenv("PGPASSWORD=3D".phpcompta_password);
         putenv("PGUSER=3D".phpcompta_user);
 		putenv("PGHOST=3D".phpcompta_psql_host);
+		putenv("PGPORT=3D".phpcompta_psql_port);
         if ( $_REQUEST['t'] =3D=3D 'd' )
         {
             $database=3Ddomaine."dossier".$_REQUEST['d'];
-            $args=3D " -Fc -Z9 --no-owner -p ".phpcompta_psql_port." ".$=
database;
+            $args=3D " -Fc -Z9 --no-owner -h ".phpcompta_psql_host." -p =
".phpcompta_psql_port." ".$database;
             header('Content-type: application/octet');
             header('Content-Disposition:attachment;filename=3D"'.$databa=
se.'.bin"',FALSE);
=20
@@ -73,7 +74,7 @@
         if ( $_REQUEST['t'] =3D=3D 'm' )
         {
             $database=3Ddomaine."mod".$_REQUEST['d'];
-            $args=3D " -Fc -Z9 --no-owner -p ".phpcompta_psql_port." ".$=
database;
+            $args=3D " -Fc -Z9 --no-owner -h ".phpcompta_psql_host." -p =
".phpcompta_psql_port." ".$database;
             header('Content-type: bin/x-application');
             header('Content-Disposition: attachment;filename=3D"'.$datab=
ase.'.bin"',FALSE);
             $a=3Dpassthru ($cmd.$args);


Property changes on: phpcompta/trunk/include
___________________________________________________________________
Name: svn:ignore
   - .constant.php.swp

   + .constant.php.swp
.action.inc.php.swp


Modified: phpcompta/trunk/include/class_stock_goods.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods.php	2012-06-19 13:26:24 UTC=
 (rev 4943)
+++ phpcompta/trunk/include/class_stock_goods.php	2012-06-19 17:46:29 UTC=
 (rev 4944)
@@ -75,7 +75,7 @@
 			$sg_code[$e]->setReadOnly($p_readonly);
 			$sg_quantity[$e]->setReadOnly($p_readonly);
 		}
-		require_once 'template/stock_inv.php';
+//		require_once 'template/stock_inv.php';
 	}
=20
 	function save($p_array)

Modified: phpcompta/trunk/include/restore.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/restore.inc.php	2012-06-19 13:26:24 UTC (rev =
4943)
+++ phpcompta/trunk/include/restore.inc.php	2012-06-19 17:46:29 UTC (rev =
4944)
@@ -35,6 +35,8 @@
     putenv("PGPASSWORD=3D".phpcompta_password);
     putenv("PGUSER=3D".phpcompta_user);
     putenv("PGPORT=3D".phpcompta_psql_port);
+	putenv("PGHOST=3D").phpcompta_psql_host;
+=09
     $retour=3D'<hr>'.HtmlInput::button_anchor("Retour","?action=3Drestor=
e");
     if ( ! isset($_REQUEST['t']))
     {



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 13:56:37 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sh2fN-0003VC-Lv
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 13:56:37 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 19:47:27 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.208777.1340128596.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4945 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 17:56:36 -0000

Author: danydb
Date: 2012-06-19 19:47:26 +0200 (Tue, 19 Jun 2012)
New Revision: 4945

Modified:
   phpcompta/trunk/include/template/user_sec_profile.php
   phpcompta/trunk/include/template/user_sec_repository.php
Log:
Color red or green following that you have or not access

Modified: phpcompta/trunk/include/template/user_sec_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_profile.php	2012-06-19 17:4=
6:29 UTC (rev 4944)
+++ phpcompta/trunk/include/template/user_sec_profile.php	2012-06-19 17:4=
7:26 UTC (rev 4945)
@@ -42,9 +42,9 @@
 				<?=3DHtmlInput::hidden('ap_id[]',$array[$i]['p_id'])?>
 			</td>
                         <?
-                            $color=3D($array[$i]['ua_right']!=3D'')?"bor=
der:lightgreen 2px solid; ":"border:red 2px solid; ";
+                            $color=3D($array[$i]['ua_right']!=3D'X')?"bo=
rder:lightgreen 2px solid; ":"border:red 2px solid; ";
                         ?>
-			<td <?=3D$color?>>
+			<td style=3D"<?=3D$color?>">
 				<?
 				$isel=3Dnew ISelect("right[]");
 				$isel->value=3D$aright_value;

Modified: phpcompta/trunk/include/template/user_sec_repository.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_repository.php	2012-06-19 1=
7:46:29 UTC (rev 4944)
+++ phpcompta/trunk/include/template/user_sec_repository.php	2012-06-19 1=
7:47:26 UTC (rev 4945)
@@ -41,9 +41,10 @@
 				<?=3DHtmlInput::hidden('ar_id[]',$array[$i]['r_id'])?>
 			</td>
                          <?
-                            $color=3D($array[$i]['ur_right']!=3D'')?"bor=
der:lightgreen 2px solid; ":"border:red 2px solid; ";
+                            $color=3D($array[$i]['ur_right']!=3D'X')?"bo=
rder:lightgreen 2px solid; ":"border:red 2px solid; ";
                         ?>
-			<td <?=3D$color?>>
+			<td style=3D"<?=3D$color?>">
+
 				<?
 				$isel=3Dnew ISelect("right[]");
 				$isel->value=3D$aright_value;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 13:57:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sh2fw-0003YO-Qz
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 13:57:12 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 19:48:03 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.208778.1340128631.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4946 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 17:57:11 -0000

Author: danydb
Date: 2012-06-19 19:48:03 +0200 (Tue, 19 Jun 2012)
New Revision: 4946

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
Correct script SQL

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-19 17:47:26 UTC (rev 4945)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-19 17:48:03 UTC (rev 4946)
@@ -188,7 +188,7 @@
 ALTER TABLE document_type ADD COLUMN dt_prefix text;
 COMMENT ON COLUMN document_type.dt_prefix IS 'Prefix for ag_ref';
=20
-update document_type set dt_prefix=3D upper(substr(replace(dt_value,' ',=
''),0,7))||dt_id::text
+update document_type set dt_prefix=3D upper(substr(replace(dt_value,' ',=
''),0,7))||dt_id::text;
=20
 CREATE TABLE user_sec_action_profile
 (
@@ -268,7 +268,6 @@
=20
 alter table user_sec_repository add constraint user_sec_repository_r_id_=
p_id_u unique (r_id,p_id);
 alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
-ALTER TABLE stock_goods ADD COLUMN r_id bigint;
 update stock_goods set r_id=3D1;
 CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
 alter table action_gestion drop ag_cal;
@@ -371,10 +370,8 @@
 CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   =
FOR EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
=20
 update menu_ref set me_description=3D'Gestion des attributs de fiches ' =
where me_code=3D'CFGATCARD';
+ALTER TABLE stock_goods ADD COLUMN c_id bigint;
=20
-ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE;
-
 CREATE TABLE stock_change
 (
    c_id bigserial NOT NULL,
@@ -389,6 +386,5 @@
       ON UPDATE CASCADE ON DELETE CASCADE
 );
=20
-ALTER TABLE stock_goods ADD COLUMN c_id bigint;
-ALTER TABLE stock_goods   ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN K=
EY (c_id)        REFERENCES stock_change (c_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE;
\ No newline at end of file
+ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 14:02:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sh2lJ-00047Q-PE
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 14:02:45 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 19:53:31 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.208789.1340128965.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4947 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 18:02:44 -0000

Author: danydb
Date: 2012-06-19 19:53:31 +0200 (Tue, 19 Jun 2012)
New Revision: 4947

Modified:
   phpcompta/trunk/include/template/detail-action.php
Log:
cosmetic : action, if view only then hide the button to enlarge the comme=
nt

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-19 17:48:0=
3 UTC (rev 4946)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-19 17:53:3=
1 UTC (rev 4947)
@@ -244,8 +244,10 @@
 }
 echo $desc->input();
 ?>
+<? if ($p_view !=3D "READ" ): ?>
 <input type=3D"button" id=3D"bt_enlarge" <?=3D$style_enl?> value=3D"+" o=
nclick=3D"enlarge('ag_comment');return false;">
 <input type=3D"button" id=3D"bt_small"  <?=3D$style_small?> value=3D"-" =
style=3D"display:none" onclick=3D"small('ag_comment');return false;">
+<? endif; ?>
   </div>
 </fieldset>
 <input type=3D'button' class=3D"button" value=3D'Montrer articles' id=3D=
"toggleButton" onclick=3D'toggleShowDetail()'>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 14:38:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sh3K0-0006Fx-9v
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 14:38:36 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 20:29:33 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.208922.1340131115.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4948 - in phpcompta/trunk: html include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 18:38:34 -0000

Author: danydb
Date: 2012-06-19 20:29:33 +0200 (Tue, 19 Jun 2012)
New Revision: 4948

Modified:
   phpcompta/trunk/html/show_document.php
   phpcompta/trunk/include/class_fiche.php
Log:
underline qcode in action : supplier, customer , banque & administration

Modified: phpcompta/trunk/html/show_document.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/show_document.php	2012-06-19 17:53:31 UTC (rev 4=
947)
+++ phpcompta/trunk/html/show_document.php	2012-06-19 18:29:33 UTC (rev 4=
948)
@@ -65,7 +65,7 @@
 if ($action =3D=3D 'rmop')
 {
 	$json =3D '{"ago_id":"-1"}';
-	$dt_id =3D $cn->get_value("select ag_id from action_gestion_operation w=
here ago_id=3D$1", $_REQUEST['id']);
+	$dt_id =3D $cn->get_value("select ag_id from action_gestion_operation w=
here ago_id=3D$1",array( $_REQUEST['id']));
 	if ($g_user->check_action(RMDOC) =3D=3D 1 && $g_user->can_write_action(=
$dt_id) =3D=3D true)
 	{
 		$cn->exec_sql("delete from action_gestion_operation where ago_id=3D$1"=
, array($_REQUEST['id']));
@@ -78,7 +78,7 @@
 if ($action =3D=3D 'rmcomment')
 {
 	$json =3D '{"agc_id":"-1"}';
-	$dt_id =3D $cn->get_value("select ag_id from action_gestion_comment whe=
re agc_id=3D$1", $_REQUEST['id']);
+	$dt_id =3D $cn->get_value("select ag_id from action_gestion_comment whe=
re agc_id=3D$1", array($_REQUEST['id']));
 	if ($g_user->check_action(RMDOC) =3D=3D 1 && $g_user->can_write_action(=
$dt_id) =3D=3D true)
 	{
 		$cn->exec_sql("delete from action_gestion_comment where agc_id=3D$1", =
array($_REQUEST['id']));

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-19 17:53:31 UTC (rev =
4947)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-19 18:29:33 UTC (rev =
4948)
@@ -1605,7 +1605,7 @@
             if ( $p_amount && $amount['debit']=3D=3D0 && $amount['credit=
'] =3D=3D 0 && $amount['solde'] =3D=3D 0 ) continue;
=20
             $r.=3D"<TR $odd>";
-            $e=3Dsprintf('<A HREF=3D"%s?ac=3D%s&sb=3Ddetail&f_id=3D%d&%s=
&sc=3Dsv" title=3D"D=C3=A9tail"> ',
+            $e=3Dsprintf('<A HREF=3D"%s?ac=3D%s&sb=3Ddetail&f_id=3D%d&%s=
&sc=3Dsv" title=3D"D=C3=A9tail" class=3D"line"> ',
                        $script,$_REQUEST['ac'],$tiers->id,$str_dossier);
=20
             $r.=3D"<TD> $e".$tiers->strAttribut(ATTR_DEF_QUICKCODE)."</A=
></TD>";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 19 15:40:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sh4Hl-0004fi-Us
	for mharc-phpcompta-dev@gnu.org; Tue, 19 Jun 2012 15:40:21 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 19 Jun 2012 21:31:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.208995.1340134820.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4949 - in phpcompta/trunk: include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jun 2012 19:40:20 -0000

Author: danydb
Date: 2012-06-19 21:31:18 +0200 (Tue, 19 Jun 2012)
New Revision: 4949

Modified:
   phpcompta/trunk/include/balance.inc.php
   phpcompta/trunk/include/class_acc_account_ledger.php
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/impress_fiche.inc.php
   phpcompta/trunk/include/impress_jrn.inc.php
   phpcompta/trunk/sql/upgrade.sql
Log:
Add a print button to impress

Modified: phpcompta/trunk/include/balance.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/balance.inc.php	2012-06-19 18:29:33 UTC (rev =
4948)
+++ phpcompta/trunk/include/balance.inc.php	2012-06-19 19:31:18 UTC (rev =
4949)
@@ -216,7 +216,9 @@
     echo HtmlInput::get_to_hidden(array('unsold'));
=20
     echo "</form></TD>";
-
+	echo '<td style=3D"vertical-align:top">';
+	echo HtmlInput::print_window();
+	echo '</td>';
     echo "</TR>";
=20
     echo "</table>";

Modified: phpcompta/trunk/include/class_acc_account_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-19 18:29=
:33 UTC (rev 4948)
+++ phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-19 19:31=
:18 UTC (rev 4949)
@@ -531,6 +531,10 @@
         if (isset($_REQUEST['poste_id'])) echo $hid->input("poste_id",$_=
REQUEST['poste_id']);
=20
         echo "</form></TD>";
+	echo "</form></TD>";
+	echo '<td style=3D"vertical-align:top">';
+	echo HtmlInput::print_window();
+	echo '</td>';
 	echo '</tr>';
         echo "</table>";
=20

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-19 18:29:33 UTC (rev =
4948)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-19 19:31:18 UTC (rev =
4949)
@@ -1444,6 +1444,10 @@
             echo $hid->input('oper_detail','on');
=20
         echo "</form></TD>";
+		echo "</form></TD>";
+		echo '<td style=3D"vertical-align:top">';
+		echo HtmlInput::print_window();
+		echo '</td>';
         echo "</table>";
         echo '</div>';
=20

Modified: phpcompta/trunk/include/impress_fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/impress_fiche.inc.php	2012-06-19 18:29:33 UTC=
 (rev 4948)
+++ phpcompta/trunk/include/impress_fiche.inc.php	2012-06-19 19:31:18 UTC=
 (rev 4949)
@@ -130,6 +130,8 @@
 $export_pdf.=3DHtmlInput::submit('pdf','Export en PDF');
 $export_pdf.=3D'</FORM>';
=20
+$export_print=3DHtmlInput::print_window();
+
 $export_csv=3D'<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"displ=
ay:inline">';
 $export_csv.=3DHtmlInput::hidden('cat',$_GET['cat']);
 $export_csv.=3DHtmlInput::hidden('act','CSV:fiche_balance');
@@ -152,8 +154,8 @@
     }
 	echo $export_pdf;
     echo $export_csv;
+	echo $export_print;
=20
-
     $fd=3Dnew Fiche_Def($cn,$_REQUEST['cat']);
     if ( $allcard=3D=3D0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) =3D=3D f=
alse )
     {
@@ -220,6 +222,7 @@
 	}
     echo $export_pdf;
     echo $export_csv;
+    echo $export_print;
=20
     exit();
 }
@@ -244,6 +247,7 @@
 }
 echo $export_csv;
 echo $export_pdf;
+echo $export_print;
 $fiche=3Dnew Fiche($cn);
 for ($e =3D 0; $e < count($afiche); $e++)
 {
@@ -357,6 +361,7 @@
 }
 echo $export_csv;
 echo $export_pdf;
+echo $export_print;
=20
=20
 ?>

Modified: phpcompta/trunk/include/impress_jrn.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/impress_jrn.inc.php	2012-06-19 18:29:33 UTC (=
rev 4948)
+++ phpcompta/trunk/include/impress_jrn.inc.php	2012-06-19 19:31:18 UTC (=
rev 4949)
@@ -188,7 +188,9 @@
     echo $hid->input("p_simple",$_GET['p_simple']);
     echo HtmlInput::get_to_hidden(array('ac','type'));
     echo "</form></TD>";
-
+	echo '<td style=3D"vertical-align:top">';
+	echo HtmlInput::print_window();
+	echo '</td>';
     echo "</TR>";
=20
     echo "</table>";

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-19 18:29:33 UTC (rev 4948)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-19 19:31:18 UTC (rev 4949)
@@ -388,3 +388,4 @@
=20
 ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
       ON UPDATE CASCADE ON DELETE CASCADE;
+update action_gestion set ag_id=3D-1 ;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 18:09:30 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShT5e-0000sM-Je
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 18:09:30 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 00:00:22 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.212987.1340230169.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4950 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 22:09:28 -0000

Author: danydb
Date: 2012-06-21 00:00:22 +0200 (Thu, 21 Jun 2012)
New Revision: 4950

Added:
   phpcompta/trunk/include/export_stock_histo.php
Log:
Fix filename=20

Copied: phpcompta/trunk/include/export_stock_histo.php (from rev 4949, ph=
pcompta/trunk/include/export_stock_histo.csv)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_stock_histo.php	                      =
  (rev 0)
+++ phpcompta/trunk/include/export_stock_histo.php	2012-06-20 22:00:22 UT=
C (rev 4950)
@@ -0,0 +1,63 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief export in CSV the export of history
+ *
+ */
+require_once 'class_stock.php';
+
+$stock=3Dnew Stock();
+$sql =3D $stock->create_query_histo($_GET);
+$sql .=3D " order by  real_date asc";
+
+$res=3D$cn->exec_sql($sql);
+$max_row=3DDatabase::num_row($res);
+header('Pragma: public');
+header('Content-type: application/csv');
+header('Content-Disposition: attachment;filename=3D"histo-stock.csv"',FA=
LSE);
+printf('"Date";');
+	printf('"%s";','Code Stock');
+	printf('"%s";','Depot');
+	printf('"%s";','Fiche');
+	printf('"%s";','Commentaire');
+	printf('%s;','Quantit=C3=A9');
+	printf('"%s";','IN/OUT');
+		printf("\n\r");
+for ($i=3D0;$i<$max_row;$i++)
+{
+	$row=3DDatabase::fetch_array($res,$i);
+	printf('"%s";',$row['cdate']);
+	printf('"%s";',$row['sg_code']);
+	printf('"%s";',$row['r_name']);
+	printf('"%s";',$row['qcode']);
+	$row['ccomment']=3Dstr_replace('"','',$row['ccomment']);
+	printf('"%s";',$row['ccomment']);
+	printf('%s;',nbm($row['sg_quantity']));
+	printf('"%s";',$row['direction']);
+	printf("\n\r");
+
+}
+
+?>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 18:09:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShT5o-0000sj-NW
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 18:09:40 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 00:00:35 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.212988.1340230180.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4951 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 22:09:39 -0000

Author: danydb
Date: 2012-06-21 00:00:34 +0200 (Thu, 21 Jun 2012)
New Revision: 4951

Removed:
   phpcompta/trunk/include/export_stock_histo.php
Log:
Fix filename=20

Deleted: phpcompta/trunk/include/export_stock_histo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_stock_histo.php	2012-06-20 22:00:22 UT=
C (rev 4950)
+++ phpcompta/trunk/include/export_stock_histo.php	2012-06-20 22:00:34 UT=
C (rev 4951)
@@ -1,63 +0,0 @@
-<?php
-
-/*
- *   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 b=
y
- *   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-130=
7  USA
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/**
- * @file
- * @brief export in CSV the export of history
- *
- */
-require_once 'class_stock.php';
-
-$stock=3Dnew Stock();
-$sql =3D $stock->create_query_histo($_GET);
-$sql .=3D " order by  real_date asc";
-
-$res=3D$cn->exec_sql($sql);
-$max_row=3DDatabase::num_row($res);
-header('Pragma: public');
-header('Content-type: application/csv');
-header('Content-Disposition: attachment;filename=3D"histo-stock.csv"',FA=
LSE);
-printf('"Date";');
-	printf('"%s";','Code Stock');
-	printf('"%s";','Depot');
-	printf('"%s";','Fiche');
-	printf('"%s";','Commentaire');
-	printf('%s;','Quantit=C3=A9');
-	printf('"%s";','IN/OUT');
-		printf("\n\r");
-for ($i=3D0;$i<$max_row;$i++)
-{
-	$row=3DDatabase::fetch_array($res,$i);
-	printf('"%s";',$row['cdate']);
-	printf('"%s";',$row['sg_code']);
-	printf('"%s";',$row['r_name']);
-	printf('"%s";',$row['qcode']);
-	$row['ccomment']=3Dstr_replace('"','',$row['ccomment']);
-	printf('"%s";',$row['ccomment']);
-	printf('%s;',nbm($row['sg_quantity']));
-	printf('"%s";',$row['direction']);
-	printf("\n\r");
-
-}
-
-?>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 18:09:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShT5u-0000xn-02
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 18:09:46 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 00:00:39 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.212989.1340230185.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4952 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 22:09:45 -0000

Author: danydb
Date: 2012-06-21 00:00:39 +0200 (Thu, 21 Jun 2012)
New Revision: 4952

Added:
   phpcompta/trunk/include/export_stock_histo_csv.php
Log:
Fix filename=20

Copied: phpcompta/trunk/include/export_stock_histo_csv.php (from rev 4950=
, phpcompta/trunk/include/export_stock_histo.php)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_stock_histo_csv.php	                  =
      (rev 0)
+++ phpcompta/trunk/include/export_stock_histo_csv.php	2012-06-20 22:00:3=
9 UTC (rev 4952)
@@ -0,0 +1,63 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief export in CSV the export of history
+ *
+ */
+require_once 'class_stock.php';
+
+$stock=3Dnew Stock();
+$sql =3D $stock->create_query_histo($_GET);
+$sql .=3D " order by  real_date asc";
+
+$res=3D$cn->exec_sql($sql);
+$max_row=3DDatabase::num_row($res);
+header('Pragma: public');
+header('Content-type: application/csv');
+header('Content-Disposition: attachment;filename=3D"histo-stock.csv"',FA=
LSE);
+printf('"Date";');
+	printf('"%s";','Code Stock');
+	printf('"%s";','Depot');
+	printf('"%s";','Fiche');
+	printf('"%s";','Commentaire');
+	printf('%s;','Quantit=C3=A9');
+	printf('"%s";','IN/OUT');
+		printf("\n\r");
+for ($i=3D0;$i<$max_row;$i++)
+{
+	$row=3DDatabase::fetch_array($res,$i);
+	printf('"%s";',$row['cdate']);
+	printf('"%s";',$row['sg_code']);
+	printf('"%s";',$row['r_name']);
+	printf('"%s";',$row['qcode']);
+	$row['ccomment']=3Dstr_replace('"','',$row['ccomment']);
+	printf('"%s";',$row['ccomment']);
+	printf('%s;',nbm($row['sg_quantity']));
+	printf('"%s";',$row['direction']);
+	printf("\n\r");
+
+}
+
+?>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 18:51:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShTkU-0001jJ-U3
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 18:51:42 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 00:42:33 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.213498.1340232702.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4953 - in phpcompta/trunk: html include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jun 2012 22:51:42 -0000

Author: danydb
Date: 2012-06-21 00:42:33 +0200 (Thu, 21 Jun 2012)
New Revision: 4953

Removed:
   phpcompta/trunk/include/export_stock_histo.csv
Modified:
   phpcompta/trunk/html/export.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000648: Impression : d?\195?\169placer les fichiers ?\195?\160 importer =
dans la DB

Modified: phpcompta/trunk/html/export.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/export.php	2012-06-20 22:00:39 UTC (rev 4952)
+++ phpcompta/trunk/html/export.php	2012-06-20 22:42:33 UTC (rev 4953)
@@ -42,135 +42,8 @@
     redirect("do.php?".dossier::get());
     exit();
   }
+// get file and execute it
=20
-  switch( $_GET['act'])
-  {
-  case 'CSV:histo':
-    require_once('export_histo_csv.php');
-    exit();
-    break;
-  case 'CSV:ledger':
-    require_once('export_ledger_csv.php');
-    exit();
-    break;
-  case 'PDF:ledger':
-    require_once('export_ledger_pdf.php');
-    exit();
-    break;
-
-  case 'CSV:postedetail':
-    require_once('export_poste_detail_csv.php');
-    exit();
-    break;
-  case 'PDF:postedetail':
-    require_once('export_poste_detail_pdf.php');
-    exit();
-    break;
-  case 'CSV:fichedetail':
-    require_once('export_fiche_detail_csv.php');
-    exit();
-    break;
-  case 'PDF:fichedetail':
-    require_once('export_fiche_detail_pdf.php');
-    exit();
-    break;
-
-  case 'CSV:fiche_balance':
-    require_once('export_fiche_balance_csv.php');
-    exit();
-    break;
-  case 'PDF:fiche_balance':
-    require_once('export_fiche_balance_pdf.php');
-    exit();
-    break;
-  case 'CSV:report':
-    require_once('export_form_csv.php');
-    exit();
-    break;
-  case 'PDF:report':
-    require_once('export_form_pdf.php');
-    exit();
-    break;
-  case 'CSV:fiche':
-    require_once('export_fiche_csv.php');
-    exit();
-    break;
-  case 'PDF:fiche':
-    require_once('export_fiche_pdf.php');
-    exit();
-    break;
-  case 'CSV:glcompte':
-    require_once('export_gl_csv.php');
-    exit();
-    break;
-  case 'PDF:glcompte':
-    require_once('export_gl_pdf.php');
-    exit();
-    break;
-  case 'PDF:sec':
-    require_once('export_security_pdf.php');
-    exit();
-    break;
-  case 'CSV:AncList':
-    require_once('export_anc_list_csv.php');
-    exit();
-    break;
-  case 'CSV:AncBalSimple':
-    require_once('export_anc_balance_simple_csv.php');
-    exit();
-    break;
-  case 'PDF:AncBalSimple':
-    require_once('export_anc_balance_simple_pdf.php');
-    exit();
-    break;
-  case 'CSV:AncBalDouble':
-    require_once('export_anc_balance_double_csv.php');
-    exit();
-    break;
-  case 'PDF:AncBalDouble':
-    require_once('export_anc_balance_double_pdf.php');
-    exit();
-    break;
-  case 'CSV:balance':
-    require_once('export_balance_csv.php');
-    exit();
-    break;
-  case 'PDF:balance':
-    require_once('export_balance_pdf.php');
-    exit();
-    break;
-  case 'CSV:AncTable':
-    require_once('export_anc_table_csv.php');
-    exit();
-    break;
-  case 'CSV:AncAccList':
-    require_once('export_anc_acc_list_csv.php');
-    exit();
-    break;
-  case 'CSV:AncBalGroup':
-    require_once('export_anc_balance_group_csv.php');
-    exit();
-    break;
-  case 'OTH:Bilan':
-      require_once 'export_bilan_oth.php';
-      exit();
-      break;
-  case 'CSV:AncGrandLivre':
-      require_once 'export_anc_grandlivre_csv.php';
-      break;
-  case 'CSV:reportinit':
-	  require_once('export_reportinit_csv.php');
-	  break;
-  case 'CSV:ActionGestion':
-	  require_once 'export_follow_up_csv.php';
-	  break;
-	case 'CSV:StockHisto': // Export Historique mouvement stock
-		require_once 'export_stock_histo.csv';
-		break;
-	case 'CSV:StockResmList' : // 'Export R=C3=A9sum=C3=A9 list stock
-		require_once 'export_stock_resume_list.php';
-		break;
-   default:
-    alert('Action inconnue '.$_GET['act']);
-    exit();
-  }
\ No newline at end of file
+ $prfile=3D$cn->get_value("select me_file from menu_ref where me_code=3D=
$1",array($_GET['act']));
+ require_once $prfile;
+ ?>
\ No newline at end of file

Deleted: phpcompta/trunk/include/export_stock_histo.csv
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_stock_histo.csv	2012-06-20 22:00:39 UT=
C (rev 4952)
+++ phpcompta/trunk/include/export_stock_histo.csv	2012-06-20 22:42:33 UT=
C (rev 4953)
@@ -1,63 +0,0 @@
-<?php
-
-/*
- *   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 b=
y
- *   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-130=
7  USA
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/**
- * @file
- * @brief export in CSV the export of history
- *
- */
-require_once 'class_stock.php';
-
-$stock=3Dnew Stock();
-$sql =3D $stock->create_query_histo($_GET);
-$sql .=3D " order by  real_date asc";
-
-$res=3D$cn->exec_sql($sql);
-$max_row=3DDatabase::num_row($res);
-header('Pragma: public');
-header('Content-type: application/csv');
-header('Content-Disposition: attachment;filename=3D"histo-stock.csv"',FA=
LSE);
-printf('"Date";');
-	printf('"%s";','Code Stock');
-	printf('"%s";','Depot');
-	printf('"%s";','Fiche');
-	printf('"%s";','Commentaire');
-	printf('%s;','Quantit=C3=A9');
-	printf('"%s";','IN/OUT');
-		printf("\n\r");
-for ($i=3D0;$i<$max_row;$i++)
-{
-	$row=3DDatabase::fetch_array($res,$i);
-	printf('"%s";',$row['cdate']);
-	printf('"%s";',$row['sg_code']);
-	printf('"%s";',$row['r_name']);
-	printf('"%s";',$row['qcode']);
-	$row['ccomment']=3Dstr_replace('"','',$row['ccomment']);
-	printf('"%s";',$row['ccomment']);
-	printf('%s;',nbm($row['sg_quantity']));
-	printf('"%s";',$row['direction']);
-	printf("\n\r");
-
-}
-
-?>
\ No newline at end of file

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-20 22:00:39 UTC (rev 4952)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-20 22:42:33 UTC (rev 4953)
@@ -388,4 +388,38 @@
=20
 ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
       ON UPDATE CASCADE ON DELETE CASCADE;
-update action_gestion set ag_id=3D-1 ;
\ No newline at end of file
+update action_gestion set ag_id=3D-1 ;
+
+update menu_ref set me_code=3D'CSV:reportinit'  where me_code=3D'CVS:rep=
ortinit';
+ update menu_ref set me_file=3D'export_histo_csv.php' where me_code=3D'C=
SV:histo';
+ update menu_ref set me_file=3D'export_ledger_csv.php' where me_code=3D'=
CSV:ledger';
+ update menu_ref set me_file=3D'export_ledger_pdf.php' where me_code=3D'=
PDF:ledger';
+ update menu_ref set me_file=3D'export_poste_detail_csv.php' where me_co=
de=3D'CSV:postedetail';
+ update menu_ref set me_file=3D'export_poste_detail_pdf.php' where me_co=
de=3D'PDF:postedetail';
+ update menu_ref set me_file=3D'export_fiche_detail_csv.php' where me_co=
de=3D'CSV:fichedetail';
+ update menu_ref set me_file=3D'export_fiche_detail_pdf.php' where me_co=
de=3D'PDF:fichedetail';
+ update menu_ref set me_file=3D'export_fiche_balance_csv.php' where me_c=
ode=3D'CSV:fiche_balance';
+ update menu_ref set me_file=3D'export_fiche_balance_pdf.php' where me_c=
ode=3D'PDF:fiche_balance';
+ update menu_ref set me_file=3D'export_form_csv.php' where me_code=3D'CS=
V:report';
+ update menu_ref set me_file=3D'export_form_pdf.php' where me_code=3D'PD=
F:report';
+ update menu_ref set me_file=3D'export_fiche_csv.php' where me_code=3D'C=
SV:fiche';
+ update menu_ref set me_file=3D'export_fiche_pdf.php' where me_code=3D'P=
DF:fiche';
+ update menu_ref set me_file=3D'export_gl_csv.php' where me_code=3D'CSV:=
glcompte';
+ update menu_ref set me_file=3D'export_gl_pdf.php' where me_code=3D'PDF:=
glcompte';
+ update menu_ref set me_file=3D'export_security_pdf.php' where me_code=3D=
'PDF:sec';
+ update menu_ref set me_file=3D'export_anc_list_csv.php' where me_code=3D=
'CSV:AncList';
+ update menu_ref set me_file=3D'export_anc_balance_simple_csv.php' where=
 me_code=3D'CSV:AncBalSimple';
+ update menu_ref set me_file=3D'export_anc_balance_simple_pdf.php' where=
 me_code=3D'PDF:AncBalSimple';
+ update menu_ref set me_file=3D'export_anc_balance_double_csv.php' where=
 me_code=3D'CSV:AncBalDouble';
+ update menu_ref set me_file=3D'export_anc_balance_double_pdf.php' where=
 me_code=3D'PDF:AncBalDouble';
+ update menu_ref set me_file=3D'export_balance_csv.php' where me_code=3D=
'CSV:balance';
+ update menu_ref set me_file=3D'export_balance_pdf.php' where me_code=3D=
'PDF:balance';
+ update menu_ref set me_file=3D'export_anc_table_csv.php' where me_code=3D=
'CSV:AncTable';
+ update menu_ref set me_file=3D'export_anc_acc_list_csv.php' where me_co=
de=3D'CSV:AncAccList';
+ update menu_ref set me_file=3D'export_anc_balance_group_csv.php' where =
me_code=3D'CSV:AncBalGroup';
+ update menu_ref set me_file=3D'export_bilan_oth.php' where me_code=3D'O=
TH:Bilan';
+ update menu_ref set me_file=3D'export_anc_grandlivre_csv.php' where me_=
code=3D'CSV:AncGrandLivre';
+ update menu_ref set me_file=3D'export_reportinit_csv.php' where me_code=
=3D'CSV:reportinit';
+ update menu_ref set me_file=3D'export_follow_up_csv.php' where me_code=3D=
'CSV:ActionGestion';
+ update menu_ref set me_file=3D'export_stock_histo_csv.php' where me_cod=
e=3D'CSV:StockHisto';
+ update menu_ref set me_file=3D'export_stock_resume_list.php' where me_c=
ode=3D'CSV:StockResmList';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 22:25:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShX5a-0002gy-PF
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 22:25:42 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 04:16:31 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.213713.1340245542.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r377 - trunk/backup_noadmin
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 02:25:41 -0000

Author: danydb
Date: 2012-06-21 04:16:30 +0200 (Thu, 21 Jun 2012)
New Revision: 377

Modified:
   trunk/backup_noadmin/raw.php
Log:
backup : Add pghost variable

Modified: trunk/backup_noadmin/raw.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/backup_noadmin/raw.php	2012-06-15 18:45:01 UTC (rev 376)
+++ trunk/backup_noadmin/raw.php	2012-06-21 02:16:30 UTC (rev 377)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -15,21 +16,22 @@
  *   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-130=
7  USA
-*/
+ */
 /* $Revision$ */
=20
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
=20
-/*!\file
+/* !\file
  * \brief raw file for backup
  */
-$cmd=3Descapeshellcmd (PG_DUMP);
-putenv("PGPASSWORD=3D".phpcompta_password);
-putenv("PGUSER=3D".phpcompta_user);
-
-$database=3Ddomaine."dossier".Dossier::id();
-$args=3D " -Fc -Z9 --no-owner -p ".phpcompta_psql_port." ".$database;
+$cmd =3D escapeshellcmd(PG_DUMP);
+putenv("PGPASSWORD=3D" . phpcompta_password);
+putenv("PGUSER=3D" . phpcompta_user);
+putenv("PGHOST=3D" . phpcompta_psql_host);
+putenv("PGPORT=3D" . phpcompta_psql_port);
+$database =3D domaine . "dossier" . Dossier::id();
+$args =3D " -Fc -Z9 --no-owner -p " . phpcompta_psql_port . " " . $datab=
ase;
 header('Content-type: application/octet');
-header('Content-Disposition:attachment;filename=3D"'.$database.'.bin"',F=
ALSE);
+header('Content-Disposition:attachment;filename=3D"' . $database . '.bin=
"', FALSE);
=20
-passthru ($cmd.$args,$a);
\ No newline at end of file
+passthru($cmd . $args, $a);
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 22:48:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShXRi-00067g-5N
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 22:48:34 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 04:39:26 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.213785.1340246913.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r378 - trunk/tva
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 02:48:32 -0000

Author: danydb
Date: 2012-06-21 04:39:25 +0200 (Thu, 21 Jun 2012)
New Revision: 378

Modified:
   trunk/tva/class_ext_list_assujetti.php
Log:
Remove duplicate in listing assujetti

Modified: trunk/tva/class_ext_list_assujetti.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tva/class_ext_list_assujetti.php	2012-06-21 02:16:30 UTC (rev 3=
77)
+++ trunk/tva/class_ext_list_assujetti.php	2012-06-21 02:39:25 UTC (rev 3=
78)
@@ -287,9 +287,9 @@
 		$r.=3Dtd(hb('Total'));
 		$r.=3Dtd(hb(sprintf('%.02f',$amount)));
 		$r.=3Dtd(hb(sprintf('%.02f',$amount_vat)));
+		$res.=3Dtr($r);
 	}
=20
-    $res.=3Dtr($r);
     $res.=3D'</table>';
     $res.=3D'</fieldset>';
     return $res;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 22:51:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShXUD-0006y0-Mw
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 22:51:09 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 04:42:02 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.213788.1340247068.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4954 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 02:51:08 -0000

Author: danydb
Date: 2012-06-21 04:42:01 +0200 (Thu, 21 Jun 2012)
New Revision: 4954

Modified:
   phpcompta/trunk/html/ajax.php
Log:
In ajax before calling plugin set properly $cn,$g_user and $g_parameter

Modified: phpcompta/trunk/html/ajax.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax.php	2012-06-20 22:42:33 UTC (rev 4953)
+++ phpcompta/trunk/html/ajax.php	2012-06-21 02:42:01 UTC (rev 4954)
@@ -12,10 +12,12 @@
 require_once('class_extension.php');
 if ( !isset ($_REQUEST['gDossier'])) exit();
=20
+require_once 'class_own.php';
 mb_internal_encoding("UTF-8");
=20
+global $g_user,$cn,$g_parameter;
 $cn=3Dnew Database(dossier::id());
-global $g_user,$cn,$g_parameter;
+$g_parameter=3Dnew Own($cn);
 $g_user=3Dnew User($cn);
 $g_user->check(true);
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 20 22:51:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShXUM-0006yb-Qs
	for mharc-phpcompta-dev@gnu.org; Wed, 20 Jun 2012 22:51:18 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 04:42:11 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.213791.1340247077.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r379 - trunk/tva
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 02:51:17 -0000

Author: danydb
Date: 2012-06-21 04:42:11 +0200 (Thu, 21 Jun 2012)
New Revision: 379

Modified:
   trunk/tva/ajax.php
Log:
In ajax before calling plugin set properly $cn,$g_user and $g_parameter

Modified: trunk/tva/ajax.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tva/ajax.php	2012-06-21 02:39:25 UTC (rev 378)
+++ trunk/tva/ajax.php	2012-06-21 02:42:11 UTC (rev 379)
@@ -7,9 +7,7 @@
 require_once('class_acc_ledger.php');
=20
 extract($_GET);
-global $g_parameter;
-$cn=3Dnew Database($gDossier);
-$g_parameter=3Dnew Own($cn);
+global $g_parameter,$cn;
=20
 $html=3D'';$extra=3D'';$ctl=3D'';
 switch($act) {



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 07:28:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShfYt-000124-Bb
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 07:28:31 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 13:19:16 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215185.1340278110.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4955 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 11:28:30 -0000

Author: danydb
Date: 2012-06-21 13:19:16 +0200 (Thu, 21 Jun 2012)
New Revision: 4955

Modified:
   phpcompta/trunk/html/recherche.php
Log:
Change jrn_navigation_bar with navigation_bar

Modified: phpcompta/trunk/html/recherche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/recherche.php	2012-06-21 02:42:01 UTC (rev 4954)
+++ phpcompta/trunk/html/recherche.php	2012-06-21 11:19:16 UTC (rev 4955)
@@ -85,7 +85,7 @@
     $max_line=3D$cn->count_sql($sql);
=20
     list($count,$a)=3D$ledger->list_operation($sql,$offset,0);
-    $bar=3Djrn_navigation_bar($offset,$max_line,$step,$page);
+    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
=20
     echo $bar;
     echo $a;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 07:33:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shfdw-0002he-Qj
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 07:33:44 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 13:24:25 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215188.1340278423.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4956 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 11:33:42 -0000

Author: danydb
Date: 2012-06-21 13:24:25 +0200 (Thu, 21 Jun 2012)
New Revision: 4956

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/ajax_view_mod_stock.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/action_search.php
Log:
0000638: Recherche action gestion
Am?\195?\169lioration : enlever "inclure les actions ferm?\195?\169es" ca=
r double emploi avec Etat de document

Ajout de "Exclure Etat de document"=20

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-21 11:19:16 UTC=
 (rev 4955)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-21 11:24:25 UTC=
 (rev 4956)
@@ -195,7 +195,7 @@
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
 	echo HtmlInput::request_to_hidden(array("remind_date_end","remind_date"=
,"sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", =
"start_date", "end_date", "ag_id", "ag_dest_query",
-		"tdoc", "see_all", "all_action", "query"));
+		"tdoc", "hsstate", "all_action", "query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");
 	echo "</form>";

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-06-21 11:19:16 UTC (rev 4=
955)
+++ phpcompta/trunk/include/action.inc.php	2012-06-21 11:24:25 UTC (rev 4=
956)
@@ -24,7 +24,7 @@
 require_once('class_ipopup.php');
 global $g_user;
 $retour=3DHtmlInput::button_anchor(_('Retour liste'),
-		HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","q=
uery","tdoc","date_start","date_end","see_all","all_action")).'&my_action=
');
+		HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","q=
uery","tdoc","date_start","date_end","hsstate","all_action")).'&my_action=
');
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/ajax_view_mod_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-21 11:19:16 U=
TC (rev 4955)
+++ phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-21 11:24:25 U=
TC (rev 4956)
@@ -53,4 +53,4 @@
 	<?=3DHtmlInput::submit("del", "Effacer");?>
 	<?=3DHtmlInput::button_close($_GET['ctl'])?>
 	<?=3DHtmlInput::hidden('r_id',$p_array['p_depot'])?>
-</form>
\ No newline at end of file
+</form>

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-21 11:19:16=
 UTC (rev 4955)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-21 11:24:25=
 UTC (rev 4956)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc=
","date_start","date_end","see_all","all_action","sb","sc"),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc=
","date_start","date_end","hsstate","all_action","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-21 11:19:16 UTC (=
rev 4955)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-21 11:24:25 UTC (=
rev 4956)
@@ -498,7 +498,7 @@
 		/* add the number of item */
 		$Hid =3D new IHidden();
 		$r.=3D$Hid->input("nb_item", MAX_ARTICLE);
-		$r.=3DHtmlInput::request_to_hidden(array("remind_date_end","remind_dat=
e","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "=
tdoc", "date_start", "date_end", "see_all", "all_action"));
+		$r.=3DHtmlInput::request_to_hidden(array("remind_date_end","remind_dat=
e","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "=
tdoc", "date_start", "date_end", "hsstate", "all_action"));
 		/* get template */
 		ob_start();
 		require_once 'template/detail-action.php';
@@ -671,7 +671,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("remind_date_end","remind_date=
","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "t=
doc", "date_start", "date_end", "see_all", "all_action")) . '&' . $p_base=
;
+		$url =3D HtmlInput::get_to_string(array("remind_date_end","remind_date=
","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "t=
doc", "date_start", "date_end", "hsstate", "all_action")) . '&' . $p_base=
;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -743,7 +743,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("remind_date_end","remind_date","sag_ref","only_i=
nternal","state","gDossier", "qcode", "ag_dest_query", "query", "tdoc", "=
date_start", "date_end", "see_all", "ac", "all_action"),"&") . '&sa=3Ddet=
ail&ag_id=3D' . $row['ag_id'] . '">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("remind_date_end","remind_date","sag_ref","only_i=
nternal","state","gDossier", "qcode", "ag_dest_query", "query", "tdoc", "=
date_start", "date_end", "hsstate", "ac", "all_action"),"&") . '&sa=3Ddet=
ail&ag_id=3D' . $row['ag_id'] . '">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1131,14 +1131,21 @@
 		$type_state->selected =3D (isset($_GET['state'])) ? $_GET['state'] : -=
1;
=20
=20
+               =20
+                /* Except State of documents */
+		$hsExcptype_state=3D new ISelect('state');
+		$aExcpState =3D $cn->make_array('select s_id,s_value from document_sta=
te order by s_value');
+		$aExcpState[] =3D array('value' =3D> '-1', 'label' =3D> _('Aucun'));
+		$hsExcptype_state->value =3D $aState;
+		$hsExcptype_state->selected =3D (isset($_GET['hsstate'])) ? $_GET['hss=
tate'] : -1;
+
+               =20
 		// date
 		$start =3D new IDate('date_start');
 		$start->value =3D (isset($_GET['date_start'])) ? $_GET['date_start'] :=
 "";
 		$end =3D new IDate('date_end');
 		$end->value =3D (isset($_GET['date_end'])) ? $_GET['date_end'] : "";
=20
-		$see_all =3D new ICheckBox('see_all');
-		$see_all->selected =3D (isset($_GET['see_all'])) ? true : false;
 		$my_action =3D new ICheckBox('all_action');
 		$my_action->selected =3D (isset($_GET['all_action'])) ? true : false;
 		$only_internal=3D new ICheckBox('only_internal');
@@ -1229,12 +1236,15 @@
 		{
 			$query .=3D ' and ag_state=3D ' . sql_string($state);
 		}
+                if (isset($hsstate) && $hsstate!=3D -1)
+		{
+			$query .=3D ' and ag_state <> ' . sql_string($hsstate);
+		}
 		if (isset($sag_ref) && trim($sag_ref) !=3D "")
 		{
 			$query .=3D ' and ag_ref=3D \'' . sql_string($sag_ref)."'";
 		}
-		if (!isset($_GET['see_all']))
-			$query .=3D ' and ag_state in (2,3) ';
+               =20
 		if (isset($_GET['only_internal']))
 			$query .=3D ' and f_id_dest=3D0 ';
 		if ( isset($all_action))

Modified: phpcompta/trunk/include/template/action_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search.php	2012-06-21 11:19:1=
6 UTC (rev 4955)
+++ phpcompta/trunk/include/template/action_search.php	2012-06-21 11:24:2=
5 UTC (rev 4956)
@@ -82,6 +82,10 @@
 				<td style=3D"text-align:right" ><?=3D _("Etat")?></td>
 				<td><?=3D $type_state->input()?></td>
 			</tr>
+			<tr>
+				<td style=3D"text-align:right" ><?=3D _("Exclure Etat")?></td>
+				<td><?=3D $hsExcptype_state->input()?></td>
+			</tr>
 			<td style=3D"text-align:right"><? printf(_('contenant le mot'))?></td=
>
 			<td ><input class=3D"input_text" style=3D"width:100%" type=3D"text" n=
ame=3D"query" value=3D"<?=3D $a?>"></td>
 			</tr>
@@ -105,14 +109,6 @@
 			</tr>
 			</tr>
 			<tr>
-				<td style=3D"text-align:right">
-					<?=3D _('inclure les actions ferm=C3=A9es ')?>
-				</td>
-				<td>
-					<?=3D $see_all->input()?>
-				</td>
-			</tr>
-			<tr>
 				<td style=3D"text-align:right"><?=3D _('les actions  affect=C3=A9es =
=C3=A0 d\'autres')?></td>
 				<td><?=3D $my_action->input()?>
 				</td>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 07:48:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShfsU-0004mr-Gz
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 07:48:46 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 13:39:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215225.1340279325.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4957 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 11:48:44 -0000

Author: danydb
Date: 2012-06-21 13:39:28 +0200 (Thu, 21 Jun 2012)
New Revision: 4957

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/template/action_search.php
Log:
0000638: Recherche action gestion
Ajout dans profile : tous les profiles=20


Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-21 11:24:25 UTC=
 (rev 4956)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-21 11:39:28 UTC=
 (rev 4957)
@@ -195,7 +195,7 @@
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
 	echo HtmlInput::request_to_hidden(array("remind_date_end","remind_date"=
,"sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", =
"start_date", "end_date", "ag_id", "ag_dest_query",
-		"tdoc", "hsstate", "all_action", "query"));
+		"tdoc",   "query"));
 	echo HtmlInput::hidden("act", "CSV:ActionGestion");
 	echo HtmlInput::submit("follow_up_csv", "Export CSV");
 	echo "</form>";

Modified: phpcompta/trunk/include/action.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.inc.php	2012-06-21 11:24:25 UTC (rev 4=
956)
+++ phpcompta/trunk/include/action.inc.php	2012-06-21 11:39:28 UTC (rev 4=
957)
@@ -24,7 +24,7 @@
 require_once('class_ipopup.php');
 global $g_user;
 $retour=3DHtmlInput::button_anchor(_('Retour liste'),
-		HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","q=
uery","tdoc","date_start","date_end","hsstate","all_action")).'&my_action=
');
+		HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","q=
uery","tdoc","date_start","date_end","hsstate")));
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/category_followup.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_followup.inc.php	2012-06-21 11:24:25=
 UTC (rev 4956)
+++ phpcompta/trunk/include/category_followup.inc.php	2012-06-21 11:39:28=
 UTC (rev 4957)
@@ -37,7 +37,7 @@
 $sub_action=3D(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=3D(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=3D$_REQUEST['ac'];
-$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc=
","date_start","date_end","hsstate","all_action","sb","sc"),"");
+$base=3D"ac=3D$p_action&sc=3Dsv&sb=3Ddetail&f_id=3D".$_REQUEST['f_id']."=
&".HtmlInput::request_to_string(array("remind_date_end","remind_date","sa=
g_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc=
","date_start","date_end","hsstate","sb","sc"),"");
 $retour=3DHtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base=
);
 $fiche=3Dnew Fiche($cn,$_REQUEST['f_id']);
=20

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-21 11:24:25 UTC (=
rev 4956)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-21 11:39:28 UTC (=
rev 4957)
@@ -498,7 +498,7 @@
 		/* add the number of item */
 		$Hid =3D new IHidden();
 		$r.=3D$Hid->input("nb_item", MAX_ARTICLE);
-		$r.=3DHtmlInput::request_to_hidden(array("remind_date_end","remind_dat=
e","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "=
tdoc", "date_start", "date_end", "hsstate", "all_action"));
+		$r.=3DHtmlInput::request_to_hidden(array("remind_date_end","remind_dat=
e","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "=
tdoc", "date_start", "date_end", "hsstate"));
 		/* get template */
 		ob_start();
 		require_once 'template/detail-action.php';
@@ -671,7 +671,7 @@
 	function myList($p_base, $p_filter =3D "", $p_search =3D "")
 	{
 		// for the sort
-		$url =3D HtmlInput::get_to_string(array("remind_date_end","remind_date=
","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "t=
doc", "date_start", "date_end", "hsstate", "all_action")) . '&' . $p_base=
;
+		$url =3D HtmlInput::get_to_string(array("remind_date_end","remind_date=
","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "t=
doc", "date_start", "date_end", "hsstate")) . '&' . $p_base;
=20
 		$table =3D new Sort_Table();
 		$table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_ti=
mestamp desc', 'da', 'dd');
@@ -743,7 +743,7 @@
 		//show the sub_action
 		foreach ($a_row as $row)
 		{
-			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("remind_date_end","remind_date","sag_ref","only_i=
nternal","state","gDossier", "qcode", "ag_dest_query", "query", "tdoc", "=
date_start", "date_end", "hsstate", "ac", "all_action"),"&") . '&sa=3Ddet=
ail&ag_id=3D' . $row['ag_id'] . '">';
+			$href =3D '<A class=3D"document" HREF=3D"do.php?'  . $p_base .HtmlInp=
ut::get_to_string(array("remind_date_end","remind_date","sag_ref","only_i=
nternal","state","gDossier", "qcode", "ag_dest_query", "query", "tdoc", "=
date_start", "date_end", "hsstate", "ac"),"&") . '&sa=3Ddetail&ag_id=3D' =
. $row['ag_id'] . '">';
 			$i++;
 			$tr =3D ($i % 2 =3D=3D 0) ? 'even' : 'odd';
 			if ($row['ag_priority'] < 2)
@@ -1146,14 +1146,13 @@
 		$end =3D new IDate('date_end');
 		$end->value =3D (isset($_GET['date_end'])) ? $_GET['date_end'] : "";
=20
-		$my_action =3D new ICheckBox('all_action');
-		$my_action->selected =3D (isset($_GET['all_action'])) ? true : false;
 		$only_internal=3D new ICheckBox('only_internal');
 		$only_internal->selected =3D (isset($_GET['only_internal'])) ? true : =
false;
 		// select profile
 		$aAg_dest =3D $cn->make_array("select  p_id as value, " .
 				"p_name as label " .
 				" from profile order by 2");
+                $aAg_dest[] =3D array('value' =3D> '-2', 'label' =3D> _(=
'Tous les profiles'));
 		$ag_dest =3D new ISelect();
 		$ag_dest->name =3D "ag_dest_query";
 		$ag_dest->value =3D $aAg_dest;
@@ -1247,10 +1246,7 @@
                =20
 		if (isset($_GET['only_internal']))
 			$query .=3D ' and f_id_dest=3D0 ';
-		if ( isset($all_action))
-		{
-			$query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'] . "' or ".self:=
:sql_security_filter($cn, "R")." or ag_dest=3D-1 )";
-		}
+=09
 		if (isset($date_start) && isDate($date_start) !=3D null)
 		{
 			$query.=3D" and ag_timestamp >=3D to_date('$date_start','DD.MM.YYYY')=
";
@@ -1259,10 +1255,16 @@
 		{
 			$query.=3D" and ag_timestamp <=3D to_date('$date_end','DD.MM.YYYY')";
 		}
-		if (isset($ag_dest_query)&& ! isset($all_action) )
+		if (isset($ag_dest_query) && $ag_dest_query !=3D -2 )
 		{
-				$query.=3D " and ag_dest =3D " . sql_string($ag_dest_query);
-		}
+                    $query.=3D " and ag_dest =3D " . sql_string($ag_dest=
_query);
+		}=20
+                else
+                {
+                    $query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'=
] . "' or ".self::sql_security_filter($cn, "R")." or ag_dest=3D-1 )";
+                }
+                   =20
+               =20
 		if (isNumber($ag_id) =3D=3D 1 && $ag_id !=3D 0)
 		{
 			$query =3D " and ag_id=3D " . sql_string($ag_id);

Modified: phpcompta/trunk/include/template/action_search.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/action_search.php	2012-06-21 11:24:2=
5 UTC (rev 4956)
+++ phpcompta/trunk/include/template/action_search.php	2012-06-21 11:39:2=
8 UTC (rev 4957)
@@ -109,11 +109,6 @@
 			</tr>
 			</tr>
 			<tr>
-				<td style=3D"text-align:right"><?=3D _('les actions  affect=C3=A9es =
=C3=A0 d\'autres')?></td>
-				<td><?=3D $my_action->input()?>
-				</td>
-			</tr>
-			<tr>
 				<td style=3D"text-align:right"><?=3D _('Uniquement actions internes'=
)?></td>
 				<td><?=3D $only_internal->input()?>
 				</td>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 07:49:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShftA-00052P-06
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 07:49:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 13:40:14 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215226.1340279367.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4958 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 11:49:26 -0000

Author: danydb
Date: 2012-06-21 13:40:14 +0200 (Thu, 21 Jun 2012)
New Revision: 4958

Modified:
   phpcompta/trunk/include/class_follow_up.php
Log:
0000638: Recherche action gestion
Ajout dans profile : tous les profiles  par d?\195?\169faut

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-21 11:39:28 UTC (=
rev 4957)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-21 11:40:14 UTC (=
rev 4958)
@@ -1156,7 +1156,7 @@
 		$ag_dest =3D new ISelect();
 		$ag_dest->name =3D "ag_dest_query";
 		$ag_dest->value =3D $aAg_dest;
-		$ag_dest->selected =3D (isset($_GET["ag_dest_query"])) ? $_GET["ag_des=
t_query"] : 0;
+		$ag_dest->selected =3D (isset($_GET["ag_dest_query"])) ? $_GET["ag_des=
t_query"] : -2;
 		$str_ag_dest =3D $ag_dest->input();
 		$osag_ref=3Dnew IText("sag_ref");
 		$osag_ref->value=3D(isset($_GET['sag_ref']))?$_GET['sag_ref']:"";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 08:39:32 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shgfc-00086S-4b
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 08:39:32 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 14:30:13 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215832.1340282371.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4959 - in phpcompta/trunk: html/js include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 12:39:30 -0000

Author: danydb
Date: 2012-06-21 14:30:13 +0200 (Thu, 21 Jun 2012)
New Revision: 4959

Modified:
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/ajax_get_profile.php
Log:
0000649: Am?\195?\169liorer apparence de CFGPRO

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-21 11:40:14 UTC (rev 4958)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-21 12:30:13 UTC (rev 4959)
@@ -1590,4 +1590,23 @@
 	}catch (e) {
 		alert(e.message);
 	}
+}
+/**
+ * <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show=
('profile_gen_div')"><?=3D_('Nom')?></a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_menu_div')"><?=3D_('D=C3=A9tail Menus')?></a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_print_div')"><?=3D_('D=C3=A9tail Impressions')?></a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" style=3D"" onclick=3D"prof=
ile_show('profile_gestion_div')"><?=3D_('Action Gestion')?> </a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_repo_div')"><?=3D_('D=C3=A9p=C3=B4ts')?></a>&nbsp;
+ */
+function profile_show(p_div)
+{
+	try{
+		var div=3D['profile_gen_div','profile_menu_div','profile_print_div','p=
rofile_gestion_div','profile_repo_div'];
+		for (var r =3D0;r<div.length;r++ ) {$(div[r]).hide();  }
+		$(p_div).show();
+		$('tab').value=3Dp_div;
+	} catch(e)
+	{
+		alert(e.message)
+	}
 }
\ No newline at end of file

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 11:40:14 UTC =
(rev 4958)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 12:30:13 UTC =
(rev 4959)
@@ -31,9 +31,15 @@
 require_once 'class_profile_menu.php';
 $profile=3Dnew Profile_sql($cn,$p_id);
 $gDossier=3DDossier::id();
-$add_one=3DHtmlInput::button("add", "Ajout Menu","onclick=3D\"add_menu({=
dossier:$gDossier,p_id:$p_id})\"")
+$add_one=3DHtmlInput::button("add", "Ajout Menu","onclick=3D\"add_menu({=
dossier:$gDossier,p_id:$p_id})\"");
+echo HtmlInput::hidden('tab','');
 ?>
 <hr>
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_gen_div')"><?=3D_('Nom')?></a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_menu_div')"><?=3D_('D=C3=A9tail Menus')?></a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile')"><?=3D_('D=C3=A9tail Impressions')?></a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" style=3D"" onclick=3D"prof=
ile_show('profile')"><?=3D_('Action Gestion')?> </a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile')"><?=3D_('D=C3=A9p=C3=B4ts')?></a>&nbsp;
 <h1>Profil <?=3D$profile->p_name?></h1>
=20
 <?
@@ -45,7 +51,7 @@
=20
 $with_direct_form=3Dnew ICheckBox("with_direct_form","t");
 $with_direct_form->set_check($profile->with_direct_form);
-
+echo '<div style=3D"display:none" id=3D"profile_gen_div">';
 echo '<form method=3D"POST" onsubmit=3D"return confirm (\'vous confirmez=
\')">';
 echo HtmlInput::hidden('p_id',$profile->p_id);
 require_once("template/profile.php");
@@ -55,8 +61,7 @@
 {
 	echo '<form method=3D"POST" onsubmit=3D"return confirm (\'vous confirme=
z\')">';
=20
-	echo '
-Vous pouvez aussi copier ce profil et puis le corriger';
+	echo 'Vous pouvez aussi copier ce profil et puis le corriger';
=20
 	echo HtmlInput::hidden('p_id', $profile->p_id);
 	echo HtmlInput::submit("clone", "Copier");
@@ -64,28 +69,38 @@
=20
 	echo '<form method=3D"POST" onsubmit=3D"return confirm (\'vous confirme=
z\')">';
=20
-	echo '
-Effacer ce profil';
+	echo 'Effacer ce profil';
=20
 	echo HtmlInput::hidden('p_id', $profile->p_id);
 	echo HtmlInput::submit("delete_profil", "Effacer ce profil");
 	echo '</form>';
-
+        echo '</div>';
+        echo '<div style=3D"display:none" id=3D"profile_menu_div">';
 	//Menu / Module /plugin in this profile
-	echo "<h1> D=C3=A9tail du profile</h1>";
 	echo "<h2>Menu</h2>";
 	echo $add_one;
 	$profile_menu =3D new Profile_Menu($cn);
 	$profile_menu->listing_profile($p_id);
+        echo '<div>';
+        echo '<div style=3D"display:none" id=3D"profile_print_div">';
 	echo "<h2>Impression</h2>";
 	$profile_menu->printing($p_id);
 	echo $add_one;
+        echo '<div>';
+        echo '<div style=3D"display:none" id=3D"profile_gestion_div">';
 	echo "<h1>Action gestion accessible</h1>";
 	$profile_menu->available_profile($p_id);
+        echo '</div>';
+        echo '<div style=3D"display:none" id=3D"profile_repo_div">';
 	echo "<h1>D=C3=A9p=C3=B4t de stock accessible</h1>";
 	$profile_menu->available_repository($p_id);
+        echo '</div>';
=20
 }
+else
+{
+        echo '</div>';
+}
 ?>
=20
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 09:00:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShgzY-0003iZ-3e
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 09:00:08 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 14:50:47 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215927.1340283607.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4960 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 13:00:07 -0000

Author: danydb
Date: 2012-06-21 14:50:47 +0200 (Thu, 21 Jun 2012)
New Revision: 4960

Modified:
   phpcompta/trunk/include/class_follow_up.php
Log:
Exclure Etat

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-21 12:30:13 UTC (=
rev 4959)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-21 12:50:47 UTC (=
rev 4960)
@@ -1136,7 +1136,7 @@
 		$hsExcptype_state=3D new ISelect('state');
 		$aExcpState =3D $cn->make_array('select s_id,s_value from document_sta=
te order by s_value');
 		$aExcpState[] =3D array('value' =3D> '-1', 'label' =3D> _('Aucun'));
-		$hsExcptype_state->value =3D $aState;
+		$hsExcptype_state->value =3D $aExcpState;
 		$hsExcptype_state->selected =3D (isset($_GET['hsstate'])) ? $_GET['hss=
tate'] : -1;
=20
                =20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 09:02:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shh1w-0004CQ-NE
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 09:02:36 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 14:53:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215964.1340283756.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4961 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 13:02:35 -0000

Author: danydb
Date: 2012-06-21 14:53:18 +0200 (Thu, 21 Jun 2012)
New Revision: 4961

Modified:
   phpcompta/trunk/include/ajax_get_profile.php
Log:
CFGPRO : bug div are still hidden

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 12:50:47 UTC =
(rev 4960)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 12:53:18 UTC =
(rev 4961)
@@ -81,12 +81,12 @@
 	echo $add_one;
 	$profile_menu =3D new Profile_Menu($cn);
 	$profile_menu->listing_profile($p_id);
-        echo '<div>';
+        echo '</div>';
         echo '<div style=3D"display:none" id=3D"profile_print_div">';
 	echo "<h2>Impression</h2>";
 	$profile_menu->printing($p_id);
 	echo $add_one;
-        echo '<div>';
+        echo '</div>';
         echo '<div style=3D"display:none" id=3D"profile_gestion_div">';
 	echo "<h1>Action gestion accessible</h1>";
 	$profile_menu->available_profile($p_id);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 09:04:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shh3j-0004Oh-R9
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 09:04:27 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 14:55:10 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.215973.1340283867.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4962 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 13:04:26 -0000

Author: danydb
Date: 2012-06-21 14:55:10 +0200 (Thu, 21 Jun 2012)
New Revision: 4962

Modified:
   phpcompta/trunk/include/ajax_get_profile.php
Log:
CFGPRO : bug div are still hidden

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 12:53:18 UTC =
(rev 4961)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 12:55:10 UTC =
(rev 4962)
@@ -35,12 +35,12 @@
 echo HtmlInput::hidden('tab','');
 ?>
 <hr>
+<h1>Profil <?=3D$profile->p_name?></h1>
 <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_gen_div')"><?=3D_('Nom')?></a>&nbsp;
 <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_menu_div')"><?=3D_('D=C3=A9tail Menus')?></a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile')"><?=3D_('D=C3=A9tail Impressions')?></a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" style=3D"" onclick=3D"prof=
ile_show('profile')"><?=3D_('Action Gestion')?> </a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile')"><?=3D_('D=C3=A9p=C3=B4ts')?></a>&nbsp;
-<h1>Profil <?=3D$profile->p_name?></h1>
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_print_div')"><?=3D_('D=C3=A9tail Impressions')?></a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" style=3D"" onclick=3D"prof=
ile_show('profile_gestion_div')"><?=3D_('Action Gestion')?> </a>&nbsp;
+<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_repo_div')"><?=3D_('D=C3=A9p=C3=B4ts')?></a>&nbsp;
=20
 <?
 $id=3DHtmlInput::hidden('p_id',$profile->p_id);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 10:21:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShiGL-0000w8-FZ
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 10:21:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 16:06:01 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216226.1340288492.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4963 - in phpcompta/trunk: html/js include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 14:21:32 -0000

Author: danydb
Date: 2012-06-21 16:06:00 +0200 (Thu, 21 Jun 2012)
New Revision: 4963

Modified:
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/ajax_get_profile.php
   phpcompta/trunk/include/ajax_mod_menu.php
   phpcompta/trunk/include/template/user_sec_profile.php
   phpcompta/trunk/include/template/user_sec_repository.php
Log:
0000649: Am?\195?\169liorer apparence de CFGPRO
Reviens sur le bon onglet

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-21 12:55:10 UTC (rev 4962)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-21 14:06:00 UTC (rev 4963)
@@ -1604,7 +1604,6 @@
 		var div=3D['profile_gen_div','profile_menu_div','profile_print_div','p=
rofile_gestion_div','profile_repo_div'];
 		for (var r =3D0;r<div.length;r++ ) {$(div[r]).hide();  }
 		$(p_div).show();
-		$('tab').value=3Dp_div;
 	} catch(e)
 	{
 		alert(e.message)

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 12:55:10 UTC =
(rev 4962)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-21 14:06:00 UTC =
(rev 4963)
@@ -32,7 +32,6 @@
 $profile=3Dnew Profile_sql($cn,$p_id);
 $gDossier=3DDossier::id();
 $add_one=3DHtmlInput::button("add", "Ajout Menu","onclick=3D\"add_menu({=
dossier:$gDossier,p_id:$p_id})\"");
-echo HtmlInput::hidden('tab','');
 ?>
 <hr>
 <h1>Profil <?=3D$profile->p_name?></h1>
@@ -53,6 +52,7 @@
 $with_direct_form->set_check($profile->with_direct_form);
 echo '<div style=3D"display:none" id=3D"profile_gen_div">';
 echo '<form method=3D"POST" onsubmit=3D"return confirm (\'vous confirmez=
\')">';
+echo HtmlInput::hidden('tab','profile_gen_div');
 echo HtmlInput::hidden('p_id',$profile->p_id);
 require_once("template/profile.php");
 echo HtmlInput::submit("save_name","Modifier");
@@ -95,7 +95,10 @@
 	echo "<h1>D=C3=A9p=C3=B4t de stock accessible</h1>";
 	$profile_menu->available_repository($p_id);
         echo '</div>';
-
+        if ( isset ($_POST['tab']))
+        {
+            echo create_script("profile_show('".$_POST['tab']."');");
+        }
 }
 else
 {

Modified: phpcompta/trunk/include/ajax_mod_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_mod_menu.php	2012-06-21 12:55:10 UTC (re=
v 4962)
+++ phpcompta/trunk/include/ajax_mod_menu.php	2012-06-21 14:06:00 UTC (re=
v 4963)
@@ -3,6 +3,7 @@
 $m=3Dnew Menu_Ref($cn,$me_code);
 $msg=3D"Modification ".$m->me_code.' '.h($m->me_menu);
 echo '<form method=3D"POST" onsubmit=3D"return confirm(\'Vous confirmez =
?\')">';
+echo HtmlInput::hidden('tab','profile_menu_div');
 require_once 'template/menu_detail.php';
=20
 echo HtmlInput::submit('modify_menu','Sauver');

Modified: phpcompta/trunk/include/template/user_sec_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_profile.php	2012-06-21 12:5=
5:10 UTC (rev 4962)
+++ phpcompta/trunk/include/template/user_sec_profile.php	2012-06-21 14:0=
6:00 UTC (rev 4963)
@@ -28,6 +28,7 @@
  */
 ?>
 <form method=3D"POST" class=3D"print">
+    <? HtmlInput::hidden('tab','profile_gestion_div')?>
 	<?=3DHtmlInput::hidden("p_id", $p_id);?>
 	<table>
 		<tr>

Modified: phpcompta/trunk/include/template/user_sec_repository.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_repository.php	2012-06-21 1=
2:55:10 UTC (rev 4962)
+++ phpcompta/trunk/include/template/user_sec_repository.php	2012-06-21 1=
4:06:00 UTC (rev 4963)
@@ -27,6 +27,8 @@
  */
 ?>
 <form method=3D"POST" class=3D"print">
+<?=3DHtmlInput::hidden('tab','profile_repo_div')?>
+
 	<?=3DHtmlInput::hidden("p_id", $p_id);?>
 	<table>
 		<tr>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 10:27:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShiM3-0001g9-5o
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 10:27:27 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 16:18:14 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216227.1340288846.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4964 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 14:27:25 -0000

Author: danydb
Date: 2012-06-21 16:18:13 +0200 (Thu, 21 Jun 2012)
New Revision: 4964

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
Fix action_gestion add not null constraint + default =3D-1 for ag_dest

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-21 14:06:00 UTC (rev 4963)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-21 14:18:13 UTC (rev 4964)
@@ -388,8 +388,11 @@
=20
 ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
       ON UPDATE CASCADE ON DELETE CASCADE;
-update action_gestion set ag_id=3D-1 ;
=20
+update action_gestion set ag_dest=3D-1 ;
+alter table action_gestion alter ag_dest set not null;
+alter table action_gestion alter ag_dest set default -1;
+
 update menu_ref set me_code=3D'CSV:reportinit'  where me_code=3D'CVS:rep=
ortinit';
  update menu_ref set me_file=3D'export_histo_csv.php' where me_code=3D'C=
SV:histo';
  update menu_ref set me_file=3D'export_ledger_csv.php' where me_code=3D'=
CSV:ledger';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 10:32:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShiQW-0002KD-LJ
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 10:32:04 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 16:22:47 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216230.1340289123.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4965 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 14:32:03 -0000

Author: danydb
Date: 2012-06-21 16:22:47 +0200 (Thu, 21 Jun 2012)
New Revision: 4965

Modified:
   phpcompta/trunk/include/class_follow_up.php
Log:
bug missing hsstate variable

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-21 14:18:13 UTC (=
rev 4964)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-21 14:22:47 UTC (=
rev 4965)
@@ -1133,7 +1133,7 @@
=20
                =20
                 /* Except State of documents */
-		$hsExcptype_state=3D new ISelect('state');
+		$hsExcptype_state=3D new ISelect('hsstate');
 		$aExcpState =3D $cn->make_array('select s_id,s_value from document_sta=
te order by s_value');
 		$aExcpState[] =3D array('value' =3D> '-1', 'label' =3D> _('Aucun'));
 		$hsExcptype_state->value =3D $aExcpState;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 10:48:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShigZ-0006vJ-Ht
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 10:48:39 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 16:39:19 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216310.1340290119.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4966 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 14:48:39 -0000

Author: danydb
Date: 2012-06-21 16:39:19 +0200 (Thu, 21 Jun 2012)
New Revision: 4966

Modified:
   phpcompta/trunk/include/ajax_create_menu.php
   phpcompta/trunk/include/template/user_sec_profile.php
Log:
Add missing tab

Modified: phpcompta/trunk/include/ajax_create_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_create_menu.php	2012-06-21 14:22:47 UTC =
(rev 4965)
+++ phpcompta/trunk/include/ajax_create_menu.php	2012-06-21 14:39:19 UTC =
(rev 4966)
@@ -3,6 +3,7 @@
 $msg=3D"Cr=C3=A9ation";
 $m=3Dnew Menu_Ref($cn);
 echo '<form method=3D"POST" onsubmit=3D"return confirm(\'Vous confirmez =
?\')">';
+echo HtmlInput::hidden('tab','profile_menu_div');
 require_once 'template/menu_detail.php';
 echo HtmlInput::submit('create_menu','Sauver');
 echo HtmlInput::button_close('divmenu');

Modified: phpcompta/trunk/include/template/user_sec_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_profile.php	2012-06-21 14:2=
2:47 UTC (rev 4965)
+++ phpcompta/trunk/include/template/user_sec_profile.php	2012-06-21 14:3=
9:19 UTC (rev 4966)
@@ -28,7 +28,7 @@
  */
 ?>
 <form method=3D"POST" class=3D"print">
-    <? HtmlInput::hidden('tab','profile_gestion_div')?>
+    <?=3DHtmlInput::hidden('tab','profile_gestion_div')?>
 	<?=3DHtmlInput::hidden("p_id", $p_id);?>
 	<table>
 		<tr>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 12:41:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShkS5-00072R-Bw
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 12:41:49 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 18:32:29 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216528.1340296908.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4967 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 16:41:47 -0000

Author: danydb
Date: 2012-06-21 18:32:28 +0200 (Thu, 21 Jun 2012)
New Revision: 4967

Modified:
   phpcompta/trunk/include/template/dashboard.php
Log:
Cosmetic add button close

Modified: phpcompta/trunk/include/template/dashboard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/dashboard.php	2012-06-21 14:39:19 UT=
C (rev 4966)
+++ phpcompta/trunk/include/template/dashboard.php	2012-06-21 16:32:28 UT=
C (rev 4967)
@@ -176,7 +176,7 @@
 $wDesc=3Dnew ITextArea('p_desc');
 $wDesc->heigh=3D5;
 $wDesc->width=3D40;
-echo h2info("Note");
+echo HtmlInput::title_box("Note","add_todo_list","hide");
 echo _("Date")." ".$wDate->input().'<br>';
 echo _("Titre")." ".$wTitle->input().'<br>';
 echo _("Description")."<br>".$wDesc->input().'<br>';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 12:43:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShkU2-0007mJ-WE
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 12:43:51 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 18:34:41 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216531.1340297030.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4968 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 16:43:50 -0000

Author: danydb
Date: 2012-06-21 18:34:41 +0200 (Thu, 21 Jun 2012)
New Revision: 4968

Modified:
   phpcompta/trunk/include/class_user.php
Log:
User::get_ledger : can access a ledger in R if user has the W right

Modified: phpcompta/trunk/include/class_user.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_user.php	2012-06-21 16:32:28 UTC (rev 4=
967)
+++ phpcompta/trunk/include/class_user.php	2012-06-21 16:34:41 UTC (rev 4=
968)
@@ -296,7 +296,7 @@
 					break;
=20
 				case 1:
-					$sql_access =3D " and uj_priv =3D 'R'";
+					$sql_access =3D " and ( uj_priv =3D 'R' or uj_priv=3D'W') ";
 					break;
 			}
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 12:53:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shkd0-0000ue-HV
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 12:53:06 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 18:43:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216546.1340297586.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4969 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 16:53:06 -0000

Author: danydb
Date: 2012-06-21 18:43:52 +0200 (Thu, 21 Jun 2012)
New Revision: 4969

Modified:
   phpcompta/trunk/include/ajax_add_menu.php
   phpcompta/trunk/include/ajax_create_menu.php
   phpcompta/trunk/include/ajax_mod_menu.php
Log:
0000649: Am?\195?\169liorer apparence de CFGPRO

Modified: phpcompta/trunk/include/ajax_add_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_add_menu.php	2012-06-21 16:34:41 UTC (re=
v 4968)
+++ phpcompta/trunk/include/ajax_add_menu.php	2012-06-21 16:43:52 UTC (re=
v 4969)
@@ -57,6 +57,9 @@
 echo HtmlInput::title_box("Nouveau menu", $ctl);
 ?>
 <form method=3D"POST" onsubmit=3D"return confirm('Vous confirmez ?')">
+	<?
+	echo HtmlInput::hidden('tab','profile_menu_div');
+	?>
 	<?=3DHtmlInput::hidden('p_id',$p_id)?>
 <table>
 <tr>

Modified: phpcompta/trunk/include/ajax_create_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_create_menu.php	2012-06-21 16:34:41 UTC =
(rev 4968)
+++ phpcompta/trunk/include/ajax_create_menu.php	2012-06-21 16:43:52 UTC =
(rev 4969)
@@ -3,7 +3,7 @@
 $msg=3D"Cr=C3=A9ation";
 $m=3Dnew Menu_Ref($cn);
 echo '<form method=3D"POST" onsubmit=3D"return confirm(\'Vous confirmez =
?\')">';
-echo HtmlInput::hidden('tab','profile_menu_div');
+
 require_once 'template/menu_detail.php';
 echo HtmlInput::submit('create_menu','Sauver');
 echo HtmlInput::button_close('divmenu');

Modified: phpcompta/trunk/include/ajax_mod_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_mod_menu.php	2012-06-21 16:34:41 UTC (re=
v 4968)
+++ phpcompta/trunk/include/ajax_mod_menu.php	2012-06-21 16:43:52 UTC (re=
v 4969)
@@ -3,7 +3,7 @@
 $m=3Dnew Menu_Ref($cn,$me_code);
 $msg=3D"Modification ".$m->me_code.' '.h($m->me_menu);
 echo '<form method=3D"POST" onsubmit=3D"return confirm(\'Vous confirmez =
?\')">';
-echo HtmlInput::hidden('tab','profile_menu_div');
+
 require_once 'template/menu_detail.php';
=20
 echo HtmlInput::submit('modify_menu','Sauver');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 12:58:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shkih-0001gj-67
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 12:58:59 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 18:49:45 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216562.1340297939.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4970 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 16:58:58 -0000

Author: danydb
Date: 2012-06-21 18:49:45 +0200 (Thu, 21 Jun 2012)
New Revision: 4970

Modified:
   phpcompta/trunk/include/class_follow_up.php
Log:
0000638: Recherche action gestion

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-21 16:43:52 UTC (=
rev 4969)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-21 16:49:45 UTC (=
rev 4970)
@@ -1131,7 +1131,7 @@
 		$type_state->selected =3D (isset($_GET['state'])) ? $_GET['state'] : -=
1;
=20
=20
-               =20
+
                 /* Except State of documents */
 		$hsExcptype_state=3D new ISelect('hsstate');
 		$aExcpState =3D $cn->make_array('select s_id,s_value from document_sta=
te order by s_value');
@@ -1139,7 +1139,7 @@
 		$hsExcptype_state->value =3D $aExcpState;
 		$hsExcptype_state->selected =3D (isset($_GET['hsstate'])) ? $_GET['hss=
tate'] : -1;
=20
-               =20
+
 		// date
 		$start =3D new IDate('date_start');
 		$start->value =3D (isset($_GET['date_start'])) ? $_GET['date_start'] :=
 "";
@@ -1235,7 +1235,7 @@
 		{
 			$query .=3D ' and ag_state=3D ' . sql_string($state);
 		}
-                if (isset($hsstate) && $hsstate!=3D -1)
+        if (isset($hsstate) && $hsstate!=3D -1)
 		{
 			$query .=3D ' and ag_state <> ' . sql_string($hsstate);
 		}
@@ -1243,10 +1243,10 @@
 		{
 			$query .=3D ' and ag_ref=3D \'' . sql_string($sag_ref)."'";
 		}
-               =20
+
 		if (isset($_GET['only_internal']))
 			$query .=3D ' and f_id_dest=3D0 ';
-=09
+
 		if (isset($date_start) && isDate($date_start) !=3D null)
 		{
 			$query.=3D" and ag_timestamp >=3D to_date('$date_start','DD.MM.YYYY')=
";
@@ -1258,13 +1258,13 @@
 		if (isset($ag_dest_query) && $ag_dest_query !=3D -2 )
 		{
                     $query.=3D " and ag_dest =3D " . sql_string($ag_dest=
_query);
-		}=20
+		}
                 else
                 {
                     $query .=3D" and (ag_owner=3D'" . $_SESSION['g_user'=
] . "' or ".self::sql_security_filter($cn, "R")." or ag_dest=3D-1 )";
                 }
-                   =20
-               =20
+
+
 		if (isNumber($ag_id) =3D=3D 1 && $ag_id !=3D 0)
 		{
 			$query =3D " and ag_id=3D " . sql_string($ag_id);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 13:22:52 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shl5o-0005wG-9X
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 13:22:52 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 19:13:37 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216601.1340299371.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4971 - in phpcompta/trunk: include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 17:22:50 -0000

Author: danydb
Date: 2012-06-21 19:13:37 +0200 (Thu, 21 Jun 2012)
New Revision: 4971

Modified:
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000605: Ajouter interface pour les documents state

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-21 16:49:45 UTC (=
rev 4970)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-21 17:13:37 UTC (=
rev 4971)
@@ -693,12 +693,14 @@
              select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,
 			 to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,
 			 f_id_dest,
+			 s_value,
              ag_title,dt_value,ag_ref, ag_priority,ag_state,
 			coalesce((select p_name from profile where p_id=3Dag_dest),'Aucun gro=
upe') as dest,
 				(select ad_value from fiche_Detail where f_id=3Daction_gestion.f_id_=
dest and ad_id=3D1) as name,
 		     (select count(d_id) from document where document.ag_id=3Daction_g=
estion.ag_id) as cnt_doc
              from action_gestion
              join document_type on (ag_type=3Ddt_id)
+			 join document_state on (ag_state=3Ds_id)
              where $p_filter_doc $p_search $sort";
 		$max_line =3D $this->db->count_sql($sql);
 		$step =3D $_SESSION['g_pagesize'];
@@ -788,28 +790,11 @@
 				$r.=3D"<td ></td>";
=20
 			$r.=3D"<td>" . $row['dt_value'] . "</td>";
+
+			$r.=3Dtd($row['s_value']);
 			/*
 			 * State
 			 */
-			switch ($row['ag_state'])
-			{
-				case 1:
-					$state =3D 'Ferm=C3=A9';
-					break;
-				case 2:
-					$state =3D "A suivre";
-					break;
-				case 3:
-					$state =3D "A faire";
-					break;
-				case 4:
-					$state =3D "Abandonn=C3=A9";
-					break;
-			}
-			$r.=3Dtd($state);
-			/*
-			 * State
-			 */
 			switch ($row['ag_priority'])
 			{
 				case 1:

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-21 16:49:45 UTC (rev 4970)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-21 17:13:37 UTC (rev 4971)
@@ -426,3 +426,17 @@
  update menu_ref set me_file=3D'export_follow_up_csv.php' where me_code=3D=
'CSV:ActionGestion';
  update menu_ref set me_file=3D'export_stock_histo_csv.php' where me_cod=
e=3D'CSV:StockHisto';
  update menu_ref set me_file=3D'export_stock_resume_list.php' where me_c=
ode=3D'CSV:StockResmList';
+
+INSERT INTO menu_ref(
+            me_code, me_menu, me_file, me_url, me_description, me_parame=
ter,
+            me_javascript, me_type)
+    VALUES ('CFGDOCST', 'Etat des documents', 'doc_state.inc.php', null,=
 'Etat des documents', null,null,'ME');
+
+INSERT INTO profile_menu(
+             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
+    VALUES ('CFGDOCST', 'DIVPARM', 1, 9, 'E', 0);
+INSERT INTO profile_menu(
+             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
+    VALUES ('CFGDOCST', 'DIVPARM', 2,9, 'E', 0);
+
+alter sequence document_state_s_id_seq restart with 100;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 13:24:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Shl7l-00064W-Sy
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 13:24:53 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 19:14:48 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216604.1340299493.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4972 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 17:24:53 -0000

Author: danydb
Date: 2012-06-21 19:14:48 +0200 (Thu, 21 Jun 2012)
New Revision: 4972

Added:
   phpcompta/trunk/include/doc_state.inc.php
Log:
0000605: Ajouter interface pour les documents state

Added: phpcompta/trunk/include/doc_state.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/doc_state.inc.php	                        (re=
v 0)
+++ phpcompta/trunk/include/doc_state.inc.php	2012-06-21 17:14:48 UTC (re=
v 4972)
@@ -0,0 +1,54 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief Manage the status of the document (document_state)
+ *
+ */
+global $cn;
+
+if ( isset($_POST['add']))
+{
+	if (trim ($_POST['s_value'])!=3D"")
+	{
+		$cn->exec_sql('insert into document_state(s_value) values ($1)',array(=
$_POST['s_value']));
+	}
+}
+$a_stat=3D$cn->get_array("select s_value   from document_state order by =
1");
+?>
+
+<table>
+	<? for ($i=3D0;$i<count($a_stat);$i++):?>
+
+	<tr>
+		<td>
+			<?=3Dh($a_stat[$i]['s_value'])?>
+		</td>
+	</tr>
+	<?	endfor;?>
+</table>
+<form method=3D"post" onsubmit=3D"return confirm ('Vous confirmez ?'); "=
>
+	<? $value=3Dnew IText("s_value",""); echo $value->input()?>
+	<?=3DHtmlInput::submit("add", "Ajouter")?>
+</form>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 13:56:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShlcH-0002yN-02
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 13:56:25 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 19:47:14 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216647.1340301384.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r380 - trunk/tva
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 17:56:24 -0000

Author: danydb
Date: 2012-06-21 19:47:14 +0200 (Thu, 21 Jun 2012)
New Revision: 380

Modified:
   trunk/tva/class_ext_tva.php
Log:
0000515: TVA G?\195?\169n?\195?\169ration incorrecte

Modified: trunk/tva/class_ext_tva.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tva/class_ext_tva.php	2012-06-21 02:42:11 UTC (rev 379)
+++ trunk/tva/class_ext_tva.php	2012-06-21 17:47:14 UTC (rev 380)
@@ -349,7 +349,18 @@
      $r=3D'';
      /* take all the vat code */
      $array=3D$this->db->get_array("select tva_poste from tva_rate");
+
      if ( empty($array)) return 'aucun compte pour la tva';
+
+	 $str_tva=3D"";$sep=3D"";
+	 for ($i=3D0;$i<count($array);$i++) {
+		 $str_tva.=3D$sep.$array[$i]['tva_poste'];
+		 $sep=3D',';
+	 }
+
+	 $array=3Dexplode(',',$str_tva);
+	 $array=3Darray_unique($array);
+
      $max=3Dcount($array);
      $periode=3Dnew Periode($this->db);
      $per=3D$periode->limit_year($this->exercice);
@@ -361,16 +372,18 @@
      $r.=3D'<table class=3D"result">';
      for ( $i=3D0;$i<$max;$i++){
        /* for each rate explode the accounting */
-       list($deb,$cred)=3Dexplode(',',$array[$i]['tva_poste']);
-
+      // list($deb,$cred)=3Dexplode(',',$array[$i]['tva_poste']);
+		 $deb=3D$array[$i];
        /* get saldo for DEBIT*/
        $saldo=3Dnew Acc_Account_Ledger($this->db,$deb);
+
        /* get label */
        $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where p=
cm_val=3D$1',array($deb));
=20
        $cond=3Dsprintf(" j_date >=3Dto_date('%s','DD.MM.YYYY') and j_dat=
e <=3D '%s'",
 		     $first_day,
 		     $this->end_date);
+
        $result=3D$saldo->get_solde_detail($cond);
        if ( $result['solde']=3D=3D0) continue;
=20
@@ -381,42 +394,17 @@
=20
        $ICheckBox=3Dnew ICheckBox('deb['.$idx.']');
        if ( $result['debit'] < $result['credit'] ) {
-	 $amount_vat-=3D$result['solde'];	 $ICheckBox->selected=3Dtrue;}
+			 $amount_vat-=3D$result['solde'];	 $ICheckBox->selected=3Dtrue;}
        else {
-	 $amount_vat+=3D$result['solde'];	 $ICheckBox->selected=3Dfalse;
+			$amount_vat+=3D$result['solde'];	 $ICheckBox->selected=3Dfalse;
        }
        $idx++;
        /* display row */
        $r.=3Dtr(td($account->input()).td($lib).td($amount->input()).td($=
ICheckBox->input()));
=20
-       /* get saldo for CREDIT*/
-       $saldo=3Dnew Acc_Account_Ledger($this->db,$cred);
-       /* get label */
-       $lib=3D$this->db->get_value('select pcm_lib from tmp_pcmn where p=
cm_val=3D$1',array($cred));
-
-       $cond=3Dsprintf(" j_date >=3Dto_date('%s','DD.MM.YYYY') and j_dat=
e <=3D '%s'",
-		     $first_day,
-		     $this->end_date);
-       $result=3D$saldo->get_solde_detail($cond);
-       if ( $result['solde']=3D=3D0) continue;
-
-       $account=3Dnew IText('account['.$idx.']');
-       $account->value=3D$cred;
-       $amount=3Dnew INum('amount['.$idx.']');
-       $amount->value=3Dabs($result['solde']);
-
-       $ICheckBox=3Dnew ICheckBox('deb['.$idx.']');
-       if ( $result['debit'] < $result['credit'] ) {$amount_vat-=3D$resu=
lt['solde'];	 $ICheckBox->selected=3Dtrue;}
-       else {	 $ICheckBox->selected=3Dfalse;
-	 $amount_vat+=3D$result['solde'];}
-
-       /* display row */
-       $r.=3Dtr(td($account->input()).td($lib).td($amount->input()).td($=
ICheckBox->input()));
-       $idx++;
-
      }
      /* ATVA */
-     $atva=3D$this->db->get_value("select paccount from tva_belge.parame=
ter where pcode=3D'ATVA'");
+     $atva=3D$this->db->get_value("select pcm_val  from tva_belge.parame=
ter_chld where pcode=3D'ATVA'");
      if ( $atva !=3D ''  ) {
        /* get saldo */
        $saldo=3Dnew Acc_Account_Ledger($this->db,$atva);
@@ -445,7 +433,7 @@
      }
      /* creance sur tva*/
      /* CRTVA */
-     $crtva=3D$this->db->get_value("select paccount from tva_belge.param=
eter where pcode=3D'CRTVA'");
+     $crtva=3D$this->db->get_value("select pcm_val  from tva_belge.param=
eter_chld where pcode=3D'CRTVA'");
      if ( $crtva !=3D ''  ) {
        /* get saldo */
        $saldo=3Dnew Acc_Account_Ledger($this->db,$crtva);
@@ -475,7 +463,7 @@
=20
      }
      /* dette tva */
-     $dttva=3D$this->db->get_value("select paccount from tva_belge.param=
eter where pcode=3D'DTTVA'");
+     $dttva=3D$this->db->get_value("select pcm_val  from tva_belge.param=
eter_chld where pcode=3D'DTTVA'");
      if ( $dttva !=3D ''  ) {
        /* get saldo */
        $saldo=3Dnew Acc_Account_Ledger($this->db,$dttva);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 21 14:51:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ShmTp-0004KK-Su
	for mharc-phpcompta-dev@gnu.org; Thu, 21 Jun 2012 14:51:45 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 21 Jun 2012 20:42:07 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.216739.1340304705.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4973 - in phpcompta/trunk: include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Jun 2012 18:51:44 -0000

Author: danydb
Date: 2012-06-21 20:42:07 +0200 (Thu, 21 Jun 2012)
New Revision: 4973

Modified:
   phpcompta/trunk/include/class_acc_ledger.php
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/sql/upgrade.sql
Log:
Fix bug in reversing writing

Modified: phpcompta/trunk/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger.php	2012-06-21 17:14:48 UTC =
(rev 4972)
+++ phpcompta/trunk/include/class_acc_ledger.php	2012-06-21 18:42:07 UTC =
(rev 4973)
@@ -1,21 +1,22 @@
 <?php
+
 /*
-*   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
-*/
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
 /* $Revision$ */
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
 require_once("class_iselect.php");
@@ -43,205 +44,195 @@
 require_once 'class_sort_table.php';
 require_once 'class_jrn_def_sql.php';
 require_once 'class_acc_payment.php';
-/*!\file
-* \brief Class for jrn,  class acc_ledger for manipulating the ledger
-*/
+/* !\file
+ * \brief Class for jrn,  class acc_ledger for manipulating the ledger
+ */
=20
-/*!\brief Class for jrn,  class acc_ledger for manipulating the ledger
-*
-*/
+/* !\brief Class for jrn,  class acc_ledger for manipulating the ledger
+ *
+ */
+
 class Acc_Ledger extends jrn_def_sql
 {
-    var $id;			/*!< jrn_def.jrn_def_id */
-    var $name;			/*!< jrn_def.jrn_def_name */
-    var $db;			/*!< database connextion */
-    var $row;			/*!< row of the ledger */
-    var $type;			/*!< type of the ledger ACH ODS FIN
-        				  VEN or GL */
-    var $nb;			/*!< default number of rows by
-        				  default 10 */
-    /**
-     *@param $p_cn database connexion
-     *@param $p_id jrn.jrn_def_id
-     */
-    function __construct ($p_cn,$p_id)
-    {
-        $this->id=3D$p_id;
-		$this->name=3D&$this->jrn_def_name;
-        $this->jrn_def_id=3D&$this->id;
-        $this->db=3D$p_cn;
-        $this->row=3Dnull;
-        $this->nb=3D10;
-    }
=20
-    function get_last_pj()
-    {
-        if ( $this->db->exist_sequence("s_jrn_pj".$this->id) )
-        {
-            $ret=3D $this->db->get_array("select last_value,is_called fr=
om s_jrn_pj".$this->id);
-            $last=3D$ret[0]['last_value'];
-            /*!
-                 *\note  With PSQL sequence , the last_value column is 1=
 when before   AND after the first call, to make the difference between t=
hem
-                 * I have to check whether the sequence has been already=
 called or not */
-            if ($ret[0]['is_called']=3D=3D'f' ) $last--;
-            return $last;
-        }
-        else
-            $this->db->create_sequence("s_jrn_pj".$this->id);
-        return 0;
-    }
-    /*!
-     * \brief Return the type of a ledger (ACH,VEN,ODS or FIN) or GL
-     *
-     */
-    function get_type()
-    {
-        if ( $this->id=3D=3D0 )
-        {
-            $this->name=3D" Tous les journaux";
-            $this->type=3D"GL";
-            return "GL";
-        }
+	var $id;   /* !< jrn_def.jrn_def_id */
+	var $name;   /* !< jrn_def.jrn_def_name */
+	var $db;   /* !< database connextion */
+	var $row;   /* !< row of the ledger */
+	var $type;   /* !< type of the ledger ACH ODS FIN
+	  VEN or GL */
+	var $nb;   /* !< default number of rows by
+	  default 10 */
=20
-        $Res=3D$this->db->exec_sql("select jrn_def_type from ".
-                                 " jrn_def where jrn_def_id=3D".
-                                 $this->id);
-        $Max=3DDatabase::num_row($Res);
-        if ($Max=3D=3D0) return null;
-        $ret=3DDatabase::fetch_array($Res,0);
-        $this->type=3D$ret['jrn_def_type'];
-        return $ret['jrn_def_type'];
-    }
-    /**
-     *let you delete a operation
-     *@note by cascade it will delete also in
-     * - jrnx
-     * - stock
-     * - quant_purchase
-     * - quant_fin
-     * - quant_sold
-     * - operation_analytique
-     * - letter
-     * - reconciliation
-     *@bug the attached document is not deleted
-     */
-    function delete()
-    {
-        if ( $this->id =3D=3D 0 ) return;
-        $grpt_id=3D$this->db->get_value('select jr_grpt_id from jrn wher=
e jr_id=3D$1',
-                                      array($this->jr_id));
-        if ( $this->db->count()=3D=3D0) return;
-        $this->db->exec_sql('delete from jrnx where j_grpt=3D$1',
-                            array($grpt_id));
-        $this->db->exec_sql('delete from jrn where jr_id=3D$1',
-                            array($this->jr_id));
-    }
 	/**
-	 *Display warning contained in an array
+	 * @param $p_cn database connexion
+	 * @param $p_id jrn.jrn_def_id
+	 */
+	function __construct($p_cn, $p_id)
+	{
+		$this->id =3D $p_id;
+		$this->name =3D &$this->jrn_def_name;
+		$this->jrn_def_id =3D &$this->id;
+		$this->db =3D $p_cn;
+		$this->row =3D null;
+		$this->nb =3D 10;
+	}
+
+	function get_last_pj()
+	{
+		if ($this->db->exist_sequence("s_jrn_pj" . $this->id))
+		{
+			$ret =3D $this->db->get_array("select last_value,is_called from s_jrn=
_pj" . $this->id);
+			$last =3D $ret[0]['last_value'];
+			/* !
+			 * \note  With PSQL sequence , the last_value column is 1 when before=
   AND after the first call, to make the difference between them
+			 * I have to check whether the sequence has been already called or no=
t */
+			if ($ret[0]['is_called'] =3D=3D 'f')
+				$last--;
+			return $last;
+		}
+		else
+			$this->db->create_sequence("s_jrn_pj" . $this->id);
+		return 0;
+	}
+
+	/* !
+	 * \brief Return the type of a ledger (ACH,VEN,ODS or FIN) or GL
+	 *
+	 */
+
+	function get_type()
+	{
+		if ($this->id =3D=3D 0)
+		{
+			$this->name =3D " Tous les journaux";
+			$this->type =3D "GL";
+			return "GL";
+		}
+
+		$Res =3D $this->db->exec_sql("select jrn_def_type from " .
+				" jrn_def where jrn_def_id=3D" .
+				$this->id);
+		$Max =3D Database::num_row($Res);
+		if ($Max =3D=3D 0)
+			return null;
+		$ret =3D Database::fetch_array($Res, 0);
+		$this->type =3D $ret['jrn_def_type'];
+		return $ret['jrn_def_type'];
+	}
+
+	/**
+	 * let you delete a operation
+	 * @note by cascade it will delete also in
+	 * - jrnx
+	 * - stock
+	 * - quant_purchase
+	 * - quant_fin
+	 * - quant_sold
+	 * - operation_analytique
+	 * - letter
+	 * - reconciliation
+	 * @bug the attached document is not deleted
+	 */
+	function delete()
+	{
+		if ($this->id =3D=3D 0)
+			return;
+		$grpt_id =3D $this->db->get_value('select jr_grpt_id from jrn where jr=
_id=3D$1', array($this->jr_id));
+		if ($this->db->count() =3D=3D 0)
+			return;
+		$this->db->exec_sql('delete from jrnx where j_grpt=3D$1', array($grpt_=
id));
+		$this->db->exec_sql('delete from jrn where jr_id=3D$1', array($this->j=
r_id));
+	}
+
+	/**
+	 * Display warning contained in an array
 	 * @return string with error message
 	 */
-	function display_warning($pa_msg,$p_warning)
+	function display_warning($pa_msg, $p_warning)
 	{
-		$str=3D'<p class=3D"notice"> '.$p_warning;
+		$str =3D '<p class=3D"notice"> ' . $p_warning;
 		$str.=3D"<ol class=3D\"notice\">";
-		for ($i=3D0;$i<count($pa_msg);$i++)
+		for ($i =3D 0; $i < count($pa_msg); $i++)
 		{
-			$str.=3D"<li>".$pa_msg[$i]."</li>";
+			$str.=3D"<li>" . $pa_msg[$i] . "</li>";
 		}
 		$str.=3D'</ol>';
 		$str.=3D'</p>';
 		return $str;
 	}
-    /**
-     * reverse the operation by creating the opposite one,
-     * the result is to avoid it
-     * it must be done in
-     * - jrn
-     * - jrnx
-     * - quant_fin
-     * - quant_sold
-     * - quant_purchase
-     * - stock
-     * - ANC
-     *@param $p_date is the date of the reversed op
-     *@exception if date is invalid or other prob
-     *@note automatically create a reconciliation between operation
-     *You must set the ledger_id $this->jrn_def_id
-     */
-    function reverse($p_date)
-    {
-        global $g_user;
-        if ( ! isset ($this->jr_id) || $this->jr_id=3D=3D'')
-            throw new Exception ("this->jr_id is not set ou op=C3=A9rati=
on inconnue");
=20
-        /* check if the date is valid */
-        if ( isDate($p_date) =3D=3D null )
-            throw new Exception (_('Date invalide').$p_date);
+	/**
+	 * reverse the operation by creating the opposite one,
+	 * the result is to avoid it
+	 * it must be done in
+	 * - jrn
+	 * - jrnx
+	 * - quant_fin
+	 * - quant_sold
+	 * - quant_purchase
+	 * - stock
+	 * - ANC
+	 * @param $p_date is the date of the reversed op
+	 * @exception if date is invalid or other prob
+	 * @note automatically create a reconciliation between operation
+	 * You must set the ledger_id $this->jrn_def_id
+	 */
+	function reverse($p_date)
+	{
+		global $g_user;
+		try
+		{
+			$this->db->start();
+			if (!isset($this->jr_id) || $this->jr_id =3D=3D '')
+				throw new Exception("this->jr_id is not set ou op=C3=A9ration inconn=
ue");
=20
-        // if the operation is in a closed or centralized period
-        // the operation is voided thanks the opposite operation
-        $grp_new=3D$this->db->get_next_seq('s_grpt');
-        $seq=3D$this->db->get_next_seq("s_jrn");
-        $p_internal=3D$this->compute_internal_code($seq);
-        $this->jr_grpt_id=3D$this->db->get_value('select jr_grpt_id from=
 jrn where jr_id=3D$1',
-                                               array($this->jr_id));
-        if ( $this->db->count()=3D=3D0)
-            throw new Exception (_("Cette op=C3=A9ration n'existe pas"))=
;
-        $this->jr_internal=3D$this->db->get_value('select jr_internal fr=
om jrn where jr_id=3D$1',
-                                                array($this->jr_id));
-        if ( $this->db->count()=3D=3D0 || trim($this->jr_internal)=3D=3D=
'')
-            throw new Exception (_("Cette op=C3=A9ration n'existe pas"))=
;
+			/* check if the date is valid */
+			if (isDate($p_date) =3D=3D null)
+				throw new Exception(_('Date invalide') . $p_date);
=20
-        /* find the periode thanks the date */
-        $per=3Dnew Periode($this->db);
-        $per->jrn_def_id=3D$this->id;
-        $per->find_periode($p_date);
+			// if the operation is in a closed or centralized period
+			// the operation is voided thanks the opposite operation
+			$grp_new =3D $this->db->get_next_seq('s_grpt');
+			$seq =3D $this->db->get_next_seq("s_jrn");
+			$p_internal =3D $this->compute_internal_code($seq);
+			$this->jr_grpt_id =3D $this->db->get_value('select jr_grpt_id from jr=
n where jr_id=3D$1', array($this->jr_id));
+			if ($this->db->count() =3D=3D 0)
+				throw new Exception(_("Cette op=C3=A9ration n'existe pas"));
+			$this->jr_internal =3D $this->db->get_value('select jr_internal from =
jrn where jr_id=3D$1', array($this->jr_id));
+			if ($this->db->count() =3D=3D 0 || trim($this->jr_internal) =3D=3D ''=
)
+				throw new Exception(_("Cette op=C3=A9ration n'existe pas"));
=20
-        if ( $per->is_open() =3D=3D 0 )
-            throw new Exception (_('PERIODE FERMEE'));
+			/* find the periode thanks the date */
+			$per =3D new Periode($this->db);
+			$per->jrn_def_id =3D $this->id;
+			$per->find_periode($p_date);
=20
-        $sql=3D "insert into jrn (
-              jr_id,
-              jr_def_id,
-              jr_montant,
-              jr_comment,
-              jr_date,
-              jr_grpt_id,
-              jr_internal
-              ,jr_tech_per, jr_valid
-              )
-              select $1,jr_def_id,jr_montant,'Annulation '||jr_comment,
-              to_date($2,'DD.MM.YYYY'),$3,$4,
-              $5, true
-              from
-              jrn
-              where   jr_id=3D$6";
-        $Res=3D$this->db->exec_sql($sql,array($seq,$p_date,$grp_new,$p_i=
nternal,$per->p_id,$this->jr_id));
-        // Check return code
-        if ( $Res =3D=3D false)
-            throw (new Exception(__FILE__.__LINE__."sql a echoue [ $sql =
]"));
+			if ($per->is_open() =3D=3D 0)
+				throw new Exception(_('PERIODE FERMEE'));
=20
=20
=20
=20
-        // Mark the operation invalid into the ledger
-        // to avoid to nullify twice the same op.
-        $sql=3D"update jrn set jr_comment=3D'Annule : '||jr_comment wher=
e jr_id=3D$1";
-        $Res=3D$this->db->exec_sql($sql,array($this->jr_id));
=20
-        // Check return code
-        if ( $Res =3D=3D false)
-            throw (new Exception(__FILE__.__LINE__."sql a echoue [ $sql =
]"));
+			// Mark the operation invalid into the ledger
+			// to avoid to nullify twice the same op.
+			$sql =3D "update jrn set jr_comment=3D'Annule : '||jr_comment where j=
r_id=3D$1";
+			$Res =3D $this->db->exec_sql($sql, array($this->jr_id));
=20
-        //////////////////////////////////////////////////
-        // Reverse in jrnx* tables
-        //////////////////////////////////////////////////
-        $a_jid=3D$this->db->get_array("select j_id,j_debit from jrnx whe=
re j_grpt=3D$1",array($this->jr_grpt_id));
-        for ($l=3D0;$l<count($a_jid);$l++)
-        {
-            $row=3D$a_jid[$l]['j_id'];
-            // Make also the change into jrnx
-            $sql=3D "insert into jrnx (
+			// Check return code
+			if ($Res =3D=3D false)
+				throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]"))=
;
+
+			//////////////////////////////////////////////////
+			// Reverse in jrnx* tables
+			//////////////////////////////////////////////////
+			$a_jid =3D $this->db->get_array("select j_id,j_debit from jrnx where =
j_grpt=3D$1", array($this->jr_grpt_id));
+			for ($l =3D 0; $l < count($a_jid); $l++)
+			{
+				$row =3D $a_jid[$l]['j_id'];
+				// Make also the change into jrnx
+				$sql =3D "insert into jrnx (
                   j_date,j_montant,j_poste,j_grpt,
                   j_jrn_def,j_debit,j_text,j_internal,j_tech_user,j_tech=
_per,j_qcode
                   ) select to_date($1,'DD.MM.YYYY'),j_montant,j_poste,$2=
,
@@ -250,280 +241,301 @@
                   from
                   jrnx
                   where   j_id=3D$6 returning j_id";
-            $Res=3D$this->db->exec_sql($sql,array($p_date,$grp_new,$p_in=
ternal,$g_user->id,$per->p_id,$row));
-            // Check return code
-            if ( $Res =3D=3D false)
-                throw (new Exception(__FILE__.__LINE__."sql a echoue [ $=
sql ]"));
-            $aj_id=3D$this->db->fetch(0);
-            $j_id=3D$aj_id['j_id'];
+				$Res =3D $this->db->exec_sql($sql, array($p_date, $grp_new, $p_inter=
nal, $g_user->id, $per->p_id, $row));
+				// Check return code
+				if ($Res =3D=3D false)
+					throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]")=
);
+				$aj_id =3D $this->db->fetch(0);
+				$j_id =3D $aj_id['j_id'];
=20
-            /* automatic lettering */
-            $let=3Dnew Lettering($this->db);
-            $let->insert_couple($j_id,$row);
+				/* automatic lettering */
+				$let =3D new Lettering($this->db);
+				$let->insert_couple($j_id, $row);
=20
-            // reverse in QUANT_SOLD
-            $Res=3D$this->db->exec_sql("INSERT INTO quant_sold(
+				// reverse in QUANT_SOLD
+				$Res =3D $this->db->exec_sql("INSERT INTO quant_sold(
                                      qs_internal, qs_fiche, qs_quantite,=
 qs_price, qs_vat,
                                      qs_vat_code, qs_client, qs_valid, j=
_id)
                                      SELECT $1, qs_fiche, qs_quantite*(-=
1), qs_price*(-1), qs_vat*(-1),
                                      qs_vat_code, qs_client, qs_valid, $=
2
-                                     FROM quant_sold where j_id=3D$3",
-                                     array($p_internal,$j_id,$row));
+                                     FROM quant_sold where j_id=3D$3", a=
rray($p_internal, $j_id, $row));
=20
-            if ( $Res =3D=3D false)
-                throw (new Exception(__FILE__.__LINE__."sql a echoue [ $=
sql ]"));
-            $Res=3D$this->db->exec_sql("INSERT INTO quant_purchase(
+				if ($Res =3D=3D false)
+					throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]")=
);
+				$Res =3D $this->db->exec_sql("INSERT INTO quant_purchase(
                                      qp_internal, j_id, qp_fiche, qp_qua=
ntite, qp_price, qp_vat,
                                      qp_vat_code, qp_nd_amount, qp_nd_tv=
a, qp_nd_tva_recup, qp_supplier,
                                      qp_valid, qp_dep_priv)
                                      SELECT  $1, $2, qp_fiche, qp_quanti=
te*(-1), qp_price*(-1), qp_vat*(-1),
                                      qp_vat_code, qp_nd_amount*(-1), qp_=
nd_tva*(-1), qp_nd_tva_recup*(-1), qp_supplier,
                                      qp_valid, qp_dep_priv*(-1)
-                                     FROM quant_purchase where j_id=3D$3=
",
-                                     array($p_internal,$j_id,$row));
+                                     FROM quant_purchase where j_id=3D$3=
", array($p_internal, $j_id, $row));
=20
-            if ( $Res =3D=3D false)
-                throw (new Exception(__FILE__.__LINE__."sql a echoue [ $=
sql ]"));
-        }
-        // reverse in QUANT_FIN table
-        $Res=3D$this->db->exec_sql("  INSERT INTO quant_fin(
+				if ($Res =3D=3D false)
+					throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]")=
);
+			}
+			$sql =3D "insert into jrn (
+              jr_id,
+              jr_def_id,
+              jr_montant,
+              jr_comment,
+              jr_date,
+              jr_grpt_id,
+              jr_internal
+              ,jr_tech_per, jr_valid
+              )
+              select $1,jr_def_id,jr_montant,'Annulation '||jr_comment,
+              to_date($2,'DD.MM.YYYY'),$3,$4,
+              $5, true
+              from
+              jrn
+              where   jr_id=3D$6";
+				$Res =3D $this->db->exec_sql($sql, array($seq, $p_date, $grp_new, $p=
_internal, $per->p_id, $this->jr_id));
+				// Check return code
+				if ($Res =3D=3D false)
+					throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]")=
);
+			// reverse in QUANT_FIN table
+			$Res =3D $this->db->exec_sql("  INSERT INTO quant_fin(
                                  qf_bank,  qf_other, qf_amount,jr_id)
                                  SELECT  qf_bank,  qf_other, qf_amount*(=
-1),$1
-                                 FROM quant_fin where jr_id=3D$2",array(=
$seq,$this->jr_id));
-        if ( $Res =3D=3D false)
-            throw (new Exception(__FILE__.__LINE__."sql a echoue [ $sql =
]"));
+                                 FROM quant_fin where jr_id=3D$2", array=
($seq, $this->jr_id));
+			if ($Res =3D=3D false)
+				throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]"))=
;
=20
-        // Add a "concerned operation to bound these op.together
-        //
-        $rec=3Dnew Acc_Reconciliation ($this->db);
-        $rec->set_jr_id($seq);
-        $rec->insert($this->jr_id);
+			// Add a "concerned operation to bound these op.together
+			//
+        $rec =3D new Acc_Reconciliation($this->db);
+			$rec->set_jr_id($seq);
+			$rec->insert($this->jr_id);
=20
-        // Check return code
-        if ( $Res =3D=3D false )
-        {
-            throw (new Exception(__FILE__.__LINE__."sql a echoue [ $sql =
]"));
-        }
+			// Check return code
+			if ($Res =3D=3D false)
+			{
+				throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]"))=
;
+			}
=20
=20
-        // the table stock must updated
-        // also in the stock table
-        $sql=3D"delete from stock_goods where sg_id =3D any ( select sg_=
id
-             from stock_goods natural join jrnx  where j_grpt=3D".$this-=
>jr_grpt_id.")";
-        $Res=3D$this->db->exec_sql($sql);
-        /**
-         *@function
-         *@todo  remove also from ANC */
=20
-        // Check return code
-        if ( $Res =3D=3D false)
-            throw (new Exception(__FILE__.__LINE__."sql a echoue [ $sql =
]"));
+			// the table stock must updated
+			// also in the stock table
+			$sql =3D "delete from stock_goods where sg_id =3D any ( select sg_id
+             from stock_goods natural join jrnx  where j_grpt=3D" . $thi=
s->jr_grpt_id . ")";
+			$Res =3D $this->db->exec_sql($sql);
+			/**
+			 * @function
+			 * @todo  remove also from ANC */
+			// Check return code
+			if ($Res =3D=3D false)
+				throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]"))=
;
+		}
+		catch (Exception $e)
+		{
+			$this->db->rollback();
+			throw $e;
+		}
+	}
=20
-    }
-    /*!
-     * \brief Return the name of a ledger
-     *
-     */
-    function get_name()
-    {
-        if ( $this->id=3D=3D0 )
-        {
-            $this->name=3D" Grand Livre ";
-            return $this->name;
-        }
+	/* !
+	 * \brief Return the name of a ledger
+	 *
+	 */
=20
-        $Res=3D$this->db->exec_sql("select jrn_def_name from ".
-                                 " jrn_def where jrn_def_id=3D$1",
-                                 array($this->id));
-        $Max=3DDatabase::num_row($Res);
-        if ($Max=3D=3D0) return null;
-        $ret=3DDatabase::fetch_array($Res,0);
-        $this->name=3D$ret['jrn_def_name'];
-        return $ret['jrn_def_name'];
-    }
+	function get_name()
+	{
+		if ($this->id =3D=3D 0)
+		{
+			$this->name =3D " Grand Livre ";
+			return $this->name;
+		}
=20
+		$Res =3D $this->db->exec_sql("select jrn_def_name from " .
+				" jrn_def where jrn_def_id=3D$1", array($this->id));
+		$Max =3D Database::num_row($Res);
+		if ($Max =3D=3D 0)
+			return null;
+		$ret =3D Database::fetch_array($Res, 0);
+		$this->name =3D $ret['jrn_def_name'];
+		return $ret['jrn_def_name'];
+	}
=20
-    /*! \function  get_row
-     * \brief  Get The data
-     *
-     *
-     * \param p_from from periode
-     * \param p_to to periode
-     * \param p_limit starting line
-     * \param p_offset number of lines
-     * \return Array with the asked data
-     *
-     */
-    function get_row($p_from,$p_to,$p_limit=3D-1,$p_offset=3D-1)
-    {
-	global $g_user;
-        $periode=3Dsql_filter_per($this->db,$p_from,$p_to,'p_id','jr_tec=
h_per');
+	/* ! \function  get_row
+	 * \brief  Get The data
+	 *
+	 *
+	 * \param p_from from periode
+	 * \param p_to to periode
+	 * \param p_limit starting line
+	 * \param p_offset number of lines
+	 * \return Array with the asked data
+	 *
+	 */
=20
-        $cond_limite=3D($p_limit!=3D-1)?" limit ".$p_limit." offset ".$p=
_offset:"";
-        // retrieve the type
-        $this->get_type();
-        // Grand livre =3D=3D 0
-        if ( $this->id !=3D 0 )
-        {
-            $Res=3D$this->db->exec_sql("select jr_id,j_id,j_id as int_j_=
id,to_char(j_date,'DD.MM.YYYY') as j_date,
+	function get_row($p_from, $p_to, $p_limit =3D -1, $p_offset =3D -1)
+	{
+		global $g_user;
+		$periode =3D sql_filter_per($this->db, $p_from, $p_to, 'p_id', 'jr_tec=
h_per');
+
+		$cond_limite =3D ($p_limit !=3D -1) ? " limit " . $p_limit . " offset =
" . $p_offset : "";
+		// retrieve the type
+		$this->get_type();
+		// Grand livre =3D=3D 0
+		if ($this->id !=3D 0)
+		{
+			$Res =3D $this->db->exec_sql("select jr_id,j_id,j_id as int_j_id,to_c=
har(j_date,'DD.MM.YYYY') as j_date,
                                      jr_internal,
                                      case j_debit when 't' then j_montan=
t::text else '   ' end as deb_montant,
                                      case j_debit when 'f' then j_montan=
t::text else '   ' end as cred_montant,
-                                     j_debit as debit,j_poste as poste,j=
r_montant , ".
-                                     "case when j_text=3D'' or j_text is=
 null then pcm_lib else j_text end as description,j_grpt as grp,
+                                     j_debit as debit,j_poste as poste,j=
r_montant , " .
+					"case when j_text=3D'' or j_text is null then pcm_lib else j_text e=
nd as description,j_grpt as grp,
                                      jr_comment||' ('||jr_internal||')' =
 as jr_comment,
 				     jr_pj_number,
                                      j_qcode,
                                      jr_rapt as oc, j_tech_per as period=
e
-                                     from jrnx left join jrn on ".
-                                     "jr_grpt_id=3Dj_grpt ".
-                                     " left join tmp_pcmn on pcm_val=3Dj=
_poste ".
-                                     " where j_jrn_def=3D".$this->id.
-                                     " and ".$periode." order by j_date:=
:date asc,substring(jr_pj_number,'\\\\d+$')::numeric asc,j_grpt,j_debit d=
esc ".
-                                     $cond_limite);
-
-        }
-        else
-        {
-            $Res=3D$this->db->exec_sql("select jr_id,j_id,j_id as int_j_=
id,to_char(j_date,'DD.MM.YYYY') as j_date,
+                                     from jrnx left join jrn on " .
+					"jr_grpt_id=3Dj_grpt " .
+					" left join tmp_pcmn on pcm_val=3Dj_poste " .
+					" where j_jrn_def=3D" . $this->id .
+					" and " . $periode . " order by j_date::date asc,substring(jr_pj_nu=
mber,'\\\\d+$')::numeric asc,j_grpt,j_debit desc " .
+					$cond_limite);
+		}
+		else
+		{
+			$Res =3D $this->db->exec_sql("select jr_id,j_id,j_id as int_j_id,to_c=
har(j_date,'DD.MM.YYYY') as j_date,
                                      jr_internal,
                                      case j_debit when 't' then j_montan=
t::text else '   ' end as deb_montant,
                                      case j_debit when 'f' then j_montan=
t::text else '   ' end as cred_montant,
-                                     j_debit as debit,j_poste as poste,"=
.
-                                     "case when j_text=3D'' or j_text is=
 null then pcm_lib else j_text end as description,j_grpt as grp,
+                                     j_debit as debit,j_poste as poste,"=
 .
+					"case when j_text=3D'' or j_text is null then pcm_lib else j_text e=
nd as description,j_grpt as grp,
                                      jr_comment||' ('||jr_internal||')' =
as jr_comment,
 				     jr_pj_number,
                                      jr_montant,
                                      j_qcode,
-                                     jr_rapt as oc, j_tech_per as period=
e from jrnx left join jrn on ".
-                                     "jr_grpt_id=3Dj_grpt left join tmp_=
pcmn on pcm_val=3Dj_poste
+                                     jr_rapt as oc, j_tech_per as period=
e from jrnx left join jrn on " .
+					"jr_grpt_id=3Dj_grpt left join tmp_pcmn on pcm_val=3Dj_poste
 										 join jrn_def on (jr_def_id=3Djrn_def_id)
-										 where ".
-									 $g_user->get_ledger_sql()." and ".
-                                     "  ".$periode." order by j_date::da=
te,substring(jr_pj_number,'\\\\d+$') asc,j_grpt,j_debit desc   ".
-                                     $cond_limite);
+										 where " .
+					$g_user->get_ledger_sql() . " and " .
+					"  " . $periode . " order by j_date::date,substring(jr_pj_number,'\=
\\\d+$') asc,j_grpt,j_debit desc   " .
+					$cond_limite);
+		}
=20
-        }
=20
+		$array =3D array();
+		$Max =3D Database::num_row($Res);
+		if ($Max =3D=3D 0)
+			return null;
+		$case =3D "";
+		$tot_deb =3D 0;
+		$tot_cred =3D 0;
+		$row =3D Database::fetch_all($Res);
+		for ($i =3D 0; $i < $Max; $i++)
+		{
+			$fiche =3D new Fiche($this->db);
+			$line =3D $row[$i];
+			$mont_deb =3D ($line['deb_montant'] !=3D 0) ? sprintf("% 8.2f", $line=
['deb_montant']) : "";
+			$mont_cred =3D ($line['cred_montant'] !=3D 0) ? sprintf("% 8.2f", $li=
ne['cred_montant']) : "";
+			$jr_montant =3D ($line['jr_montant'] !=3D 0) ? sprintf("% 8.2f", $lin=
e['jr_montant']) : "";
+			$tot_deb+=3D$line['deb_montant'];
+			$tot_cred+=3D$line['cred_montant'];
+			$tot_op =3D $line['jr_montant'];
=20
-        $array=3Darray();
-        $Max=3DDatabase::num_row($Res);
-        if ($Max=3D=3D0) return null;
-        $case=3D"";
-        $tot_deb=3D0;
-        $tot_cred=3D0;
-        $row=3DDatabase::fetch_all($Res);
-        for ($i=3D0;$i<$Max;$i++)
-        {
-            $fiche=3Dnew Fiche($this->db);
-            $line=3D$row[$i];
-            $mont_deb=3D($line['deb_montant']!=3D0)?sprintf("% 8.2f",$li=
ne['deb_montant']):"";
-            $mont_cred=3D($line['cred_montant']!=3D0)?sprintf("% 8.2f",$=
line['cred_montant']):"";
-            $jr_montant=3D($line['jr_montant']!=3D0)?sprintf("% 8.2f",$l=
ine['jr_montant']):"";
-            $tot_deb+=3D$line['deb_montant'];
-            $tot_cred+=3D$line['cred_montant'];
-            $tot_op=3D$line['jr_montant'];
+			/* Check first if there is a quickcode */
+			if (strlen(trim($line['description'])) =3D=3D 0 && strlen(trim($line[=
'j_qcode'])) !=3D 0)
+			{
+				if ($fiche->get_by_qcode($line['j_qcode'], false) =3D=3D 0)
+				{
+					$line['description'] =3D $fiche->strAttribut(ATTR_DEF_NAME);
+				}
+			}
+			if ($case !=3D $line['grp'])
+			{
+				$case =3D $line['grp'];
+				// for financial, we show if the amount is or not in negative
+				if ($this->type =3D=3D 'FIN')
+				{
+					$amount =3D $this->db->get_value('select qf_amount from quant_fin w=
here jr_id=3D$1', array($line['jr_id']));
+					/*  if nothing is found */
+					if ($this->db->count() =3D=3D 0)
+						$tot_op =3D $jr_montant;
+					else if ($amount < 0)
+					{
+						$tot_op =3D $amount;
+					}
+				}
+				$array[] =3D array(
+					'jr_id' =3D> $line['jr_id'],
+					'int_j_id' =3D> $line['int_j_id'],
+					'j_id' =3D> $line['j_id'],
+					'j_date' =3D> $line['j_date'],
+					'internal' =3D> $line['jr_internal'],
+					'deb_montant' =3D> '',
+					'cred_montant' =3D> ' ',
+					'description' =3D> '<b><i>' . h($line['jr_comment']) . ' [' . $tot_=
op . '] </i></b>',
+					'poste' =3D> $line['oc'],
+					'qcode' =3D> $line['j_qcode'],
+					'periode' =3D> $line['periode'],
+					'jr_pj_number' =3D> $line ['jr_pj_number']);
=20
-            /* Check first if there is a quickcode */
-            if (strlen(trim($line['description']))=3D=3D0 &&  strlen(tri=
m($line['j_qcode'])) !=3D 0 )
-            {
-                if ( $fiche->get_by_qcode($line['j_qcode'],false) =3D=3D=
 0 )
-                {
-                    $line['description']=3D$fiche->strAttribut(ATTR_DEF_=
NAME);
-                }
-            }
-            if ( $case !=3D $line['grp'] )
-            {
-                $case=3D$line['grp'];
-                // for financial, we show if the amount is or not in neg=
ative
-                if ( $this->type=3D=3D'FIN')
-                {
-                    $amount=3D$this->db->get_value('select qf_amount fro=
m quant_fin where jr_id=3D$1',
-                                                 array($line['jr_id']));
-                    /*  if nothing is found */
-                    if ( $this->db->count()=3D=3D0 )
-                        $tot_op=3D$jr_montant;
-                    else if ( $amount < 0 )
-                    {
-                        $tot_op=3D$amount;
-                    }
-                }
-                $array[]=3Darray (
-                             'jr_id'=3D>$line['jr_id'],
-                             'int_j_id' =3D> $line['int_j_id'],
-                             'j_id'=3D>$line['j_id'],
-                             'j_date' =3D> $line['j_date'],
-                             'internal'=3D>$line['jr_internal'],
-                             'deb_montant'=3D>'',
-                             'cred_montant'=3D>' ',
-                             'description'=3D>'<b><i>'.h($line['jr_comme=
nt']).' ['.$tot_op.'] </i></b>',
-                             'poste' =3D> $line['oc'],
-                             'qcode' =3D> $line['j_qcode'],
-                             'periode' =3D>$line['periode'],
-			     'jr_pj_number' =3D> $line ['jr_pj_number']);
+				$array[] =3D array(
+					'jr_id' =3D> '',
+					'int_j_id' =3D> $line['int_j_id'],
+					'j_id' =3D> '',
+					'j_date' =3D> '',
+					'internal' =3D> '',
+					'deb_montant' =3D> $mont_deb,
+					'cred_montant' =3D> $mont_cred,
+					'description' =3D> $line['description'],
+					'poste' =3D> $line['poste'],
+					'qcode' =3D> $line['j_qcode'],
+					'periode' =3D> $line['periode'],
+					'jr_pj_number' =3D> ''
+				);
+			}
+			else
+			{
+				$array[] =3D array(
+					'jr_id' =3D> $line['jr_id'],
+					'int_j_id' =3D> $line['int_j_id'],
+					'j_id' =3D> '',
+					'j_date' =3D> '',
+					'internal' =3D> '',
+					'deb_montant' =3D> $mont_deb,
+					'cred_montant' =3D> $mont_cred,
+					'description' =3D> $line['description'],
+					'poste' =3D> $line['poste'],
+					'qcode' =3D> $line['j_qcode'],
+					'periode' =3D> $line['periode'],
+					'jr_pj_number' =3D> '');
+			}
+		}
+		$this->row =3D $array;
+		$a =3D array($array, $tot_deb, $tot_cred);
+		return $a;
+	}
=20
-                $array[]=3Darray (
-                             'jr_id'=3D>'',
-                             'int_j_id' =3D> $line['int_j_id'],
-                             'j_id'=3D>'',
-                             'j_date' =3D> '',
-                             'internal'=3D>'',
-                             'deb_montant'=3D>$mont_deb,
-                             'cred_montant'=3D>$mont_cred,
-                             'description'=3D>$line['description'],
-                             'poste' =3D> $line['poste'],
-                             'qcode' =3D> $line['j_qcode'],
-                             'periode' =3D> $line['periode'],
-			     'jr_pj_number' =3D> ''
-                         );
+	/* ! \brief  Get simplified row from ledger
+	 *
+	 * \param from periode
+	 * \param to periode
+	 * \param p_limit starting line
+	 * \param p_offset number of lines
+	 * \param trunc if data must be truncated (pdf export)
+	 *
+	 * \return an Array with the asked data
+	 */
=20
-            }
-            else
-            {
-                $array[]=3Darray (
-                             'jr_id'=3D>$line['jr_id'],
-                             'int_j_id' =3D> $line['int_j_id'],
-                             'j_id'=3D>'',
-                             'j_date' =3D> '',
-                             'internal'=3D>'',
-                             'deb_montant'=3D>$mont_deb,
-                             'cred_montant'=3D>$mont_cred,
-                             'description'=3D>$line['description'],
-                             'poste' =3D> $line['poste'],
-                             'qcode' =3D> $line['j_qcode'],
-                             'periode' =3D> $line['periode'],
-			     'jr_pj_number' =3D> '');
+	function get_rowSimple($p_from, $p_to, $trunc =3D 0, $p_limit =3D -1, $=
p_offset =3D -1)
+	{
+		global $g_user;
+		// Grand-livre : id=3D 0
+		//---
+		$jrn =3D ($this->id =3D=3D 0 ) ? "and " . $g_user->get_ledger_sql() : =
"and jrn_def_id =3D " . $this->id;
=20
-            }
+		$periode =3D sql_filter_per($this->db, $p_from, $p_to, 'p_id', 'jr_tec=
h_per');
=20
-
-        }
-        $this->row=3D$array;
-        $a=3Darray($array,$tot_deb,$tot_cred);
-        return $a;
-    }
-    /*! \brief  Get simplified row from ledger
-     *
-     * \param from periode
-     * \param to periode
-     * \param p_limit starting line
-     * \param p_offset number of lines
-     * \param trunc if data must be truncated (pdf export)
-     *
-     * \return an Array with the asked data
-     */
-    function get_rowSimple($p_from,$p_to,$trunc=3D0,$p_limit=3D-1,$p_off=
set=3D-1)
-    {
-	global $g_user;
-        // Grand-livre : id=3D 0
-        //---
-        $jrn=3D($this->id =3D=3D 0 )?"and ".$g_user->get_ledger_sql():"a=
nd jrn_def_id =3D ".$this->id;
-
-        $periode=3Dsql_filter_per($this->db,$p_from,$p_to,'p_id','jr_tec=
h_per');
-
-        $cond_limite=3D($p_limit!=3D-1)?" limit ".$p_limit." offset ".$p=
_offset:"";
-        //---
-        $sql=3D"
+		$cond_limite =3D ($p_limit !=3D -1) ? " limit " . $p_limit . " offset =
" . $p_offset : "";
+		//---
+		$sql =3D "
              SELECT jrn.jr_id as jr_id ,
              jrn.jr_id as num ,
              jrn.jr_def_id as jr_def_id,
@@ -539,1642 +551,1668 @@
              FROM jrn join jrn_def on (jrn_def_id=3Djr_def_id)
              WHERE $periode $jrn order by jr_date $cond_limite";
=20
-        $Res=3D$this->db->exec_sql($sql);
-        $Max=3DDatabase::num_row($Res);
-        if ( $Max =3D=3D 0 )
-        {
-            return null;
-        }
-        $type=3D$this->get_type();
-        // for type ACH and Ven we take more info
-        if (  $type =3D=3D 'ACH' ||  	  $type =3D=3D 'VEN')
-        {
-            $a_ParmCode=3D$this->db->get_array('select p_code,p_value fr=
om parm_code');
-            $a_TVA=3D$this->db->get_array('select tva_id,tva_label,tva_p=
oste
+		$Res =3D $this->db->exec_sql($sql);
+		$Max =3D Database::num_row($Res);
+		if ($Max =3D=3D 0)
+		{
+			return null;
+		}
+		$type =3D $this->get_type();
+		// for type ACH and Ven we take more info
+		if ($type =3D=3D 'ACH' || $type =3D=3D 'VEN')
+		{
+			$a_ParmCode =3D $this->db->get_array('select p_code,p_value from parm=
_code');
+			$a_TVA =3D $this->db->get_array('select tva_id,tva_label,tva_poste
                                         from tva_rate where tva_rate !=3D=
 0 order by tva_id');
-            for ( $i=3D0;$i<$Max;$i++)
-            {
-                $array[$i]=3DDatabase::fetch_array($Res,$i);
-                $p=3D$this->get_detail($array[$i],$type,$trunc,$a_TVA,$a=
_ParmCode);
-                if ( $array[$i]['dep_priv'] !=3D 0.0)
-                {
-                    $array[$i]['comment'].=3D"(priv. ".$array[$i]['dep_p=
riv'].")";
-                }
-            }
+			for ($i =3D 0; $i < $Max; $i++)
+			{
+				$array[$i] =3D Database::fetch_array($Res, $i);
+				$p =3D $this->get_detail($array[$i], $type, $trunc, $a_TVA, $a_ParmC=
ode);
+				if ($array[$i]['dep_priv'] !=3D 0.0)
+				{
+					$array[$i]['comment'].=3D"(priv. " . $array[$i]['dep_priv'] . ")";
+				}
+			}
+		}
+		else
+		{
+			$array =3D Database::fetch_all($Res);
+		}
=20
-        }
-        else
-        {
-            $array=3DDatabase::fetch_all($Res);
+		return $array;
+	}
=20
-        }
+// end function get_rowSimple
=20
-        return $array;
-    }// end function get_rowSimple
+	/* !\brief guess what  the next pj should be
+	 */
=20
-    /*!\brief guess what  the next pj should be
-     */
-    function guess_pj()
-    {
-        $prop=3D$this->get_propertie();
-        $pj_pref=3D$prop["jrn_def_pj_pref"];
-        $pj_seq=3D$this->get_last_pj()+1;
-        return $pj_pref.$pj_seq;
-    }
-/*!\brief Show all the operation
-     *\param $sql is the sql stmt, normally created by build_search_sql
-     *\param $offset the offset
-     *\param $p_paid if we want to see info about payment
-    \code
-    // Example
-    // Build the sql
-    list($sql,$where)=3D$Ledger->build_search_sql($_GET);
-    // Count nb of line
-    $max_line=3D$this->db->count_sql($sql);
+	function guess_pj()
+	{
+		$prop =3D $this->get_propertie();
+		$pj_pref =3D $prop["jrn_def_pj_pref"];
+		$pj_seq =3D $this->get_last_pj() + 1;
+		return $pj_pref . $pj_seq;
+	}
=20
-    $step=3D$_SESSION['g_pagesize'];
-    $page=3D(isset($_GET['offset']))?$_GET['page']:1;
-    $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
-    // create the nav. bar
-    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
-    // show a part
-    list($count,$html)=3D $Ledger->list_operation($sql,$offset,0);
-    echo $html;
-    // show nav bar
-    echo $bar;
+	/* !\brief Show all the operation
+	 * \param $sql is the sql stmt, normally created by build_search_sql
+	 * \param $offset the offset
+	 * \param $p_paid if we want to see info about payment
+	  \code
+	  // Example
+	  // Build the sql
+	  list($sql,$where)=3D$Ledger->build_search_sql($_GET);
+	  // Count nb of line
+	  $max_line=3D$this->db->count_sql($sql);
=20
-    \endcode
-     *\see build_search_sql
-     *\see display_search_form
-     *\see search_form
+	  $step=3D$_SESSION['g_pagesize'];
+	  $page=3D(isset($_GET['offset']))?$_GET['page']:1;
+	  $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
+	  // create the nav. bar
+	  $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
+	  // show a part
+	  list($count,$html)=3D $Ledger->list_operation($sql,$offset,0);
+	  echo $html;
+	  // show nav bar
+	  echo $bar;
=20
-     *\return HTML string
-     */
-    public function list_operation_to_reconcile($sql)
-    {
-        global $g_parameter,$g_user;
-        $gDossier=3Ddossier::id();
-        $limit=3D" LIMIT 25";
-        // Sort
+	  \endcode
+	 * \see build_search_sql
+	 * \see display_search_form
+	 * \see search_form
=20
+	 * \return HTML string
+	 */
+
+	public function list_operation_to_reconcile($sql)
+	{
+		global $g_parameter, $g_user;
+		$gDossier =3D dossier::id();
+		$limit =3D " LIMIT 25";
+		// Sort
 		// Count
-        $count=3D$this->db->count_sql($sql);
-        // Add the limit
-        $sql.=3D" order by jr_date asc ".$limit;
+		$count =3D $this->db->count_sql($sql);
+		// Add the limit
+		$sql.=3D" order by jr_date asc " . $limit;
=20
-        // Execute SQL stmt
-        $Res=3D$this->db->exec_sql($sql);
+		// Execute SQL stmt
+		$Res =3D $this->db->exec_sql($sql);
=20
-        //starting from here we can refactor, so that instead of returni=
ng the generated HTML,
-        //this function returns a tree structure.
+		//starting from here we can refactor, so that instead of returning the=
 generated HTML,
+		//this function returns a tree structure.
=20
-        $r=3D"";
+		$r =3D "";
=20
=20
-        $Max=3DDatabase::num_row($Res);
+		$Max =3D Database::num_row($Res);
=20
-        if ($Max=3D=3D0) return array(0,_("Aucun enregistrement trouv=C3=
=A9"));
+		if ($Max =3D=3D 0)
+			return array(0, _("Aucun enregistrement trouv=C3=A9"));
=20
-        $r.=3D'<table class=3D"result">';
+		$r.=3D'<table class=3D"result">';
=20
=20
-        $r.=3D"<tr >";
-	$r.=3D"<th>Selection</th>";
-        $r.=3D"<th>Internal</th>";
+		$r.=3D"<tr >";
+		$r.=3D"<th>Selection</th>";
+		$r.=3D"<th>Internal</th>";
=20
-        if ( $this->type=3D=3D'ALL')
-        {
-            $r.=3Dth('Journal');
-        }
+		if ($this->type =3D=3D 'ALL')
+		{
+			$r.=3Dth('Journal');
+		}
=20
-        $r.=3D'<th>Date</th>';
-        $r.=3D'<th>Pi=C3=A8ce</td>';
+		$r.=3D'<th>Date</th>';
+		$r.=3D'<th>Pi=C3=A8ce</td>';
 		$r.=3Dth('tiers');
-        $r.=3D'<th>Description</th>';
-		$r.=3Dth('Notes',' style=3D"width:15%"');
-        $r.=3D'<th>Montant</th>';
-        $r.=3D"<th>"._('Op. Concern=C3=A9e')."</th>";
-        $r.=3D"</tr>";
-        // Total Amount
-        $tot=3D0.0;
-        $gDossier=3Ddossier::id();
-		$str_dossier=3DDossier::id();
-        for ($i=3D0; $i < $Max;$i++)
-        {
+		$r.=3D'<th>Description</th>';
+		$r.=3Dth('Notes', ' style=3D"width:15%"');
+		$r.=3D'<th>Montant</th>';
+		$r.=3D"<th>" . _('Op. Concern=C3=A9e') . "</th>";
+		$r.=3D"</tr>";
+		// Total Amount
+		$tot =3D 0.0;
+		$gDossier =3D dossier::id();
+		$str_dossier =3D Dossier::id();
+		for ($i =3D 0; $i < $Max; $i++)
+		{
=20
=20
-            $row=3DDatabase::fetch_array($Res,$i);
+			$row =3D Database::fetch_array($Res, $i);
=20
-            if ( $i % 2 =3D=3D 0 ) $tr=3D'<TR class=3D"odd">';
-            else $tr=3D'<TR class=3D"even">';
-            $r.=3D$tr;
+			if ($i % 2 =3D=3D 0)
+				$tr =3D '<TR class=3D"odd">';
+			else
+				$tr =3D '<TR class=3D"even">';
+			$r.=3D$tr;
 			// Radiobox
 			//
=20
-			$r.=3D'<td><INPUT TYPE=3D"CHECKBOX" name=3D"jr_concerned'.$row['jr_id=
'].'" ID=3D"jr_concerned'.$row['jr_id'].'"> </td>';
-            //internal code
-            // button  modify
-            $r.=3D"<TD>";
-            // If url contains
-            //
+			$r.=3D'<td><INPUT TYPE=3D"CHECKBOX" name=3D"jr_concerned' . $row['jr_=
id'] . '" ID=3D"jr_concerned' . $row['jr_id'] . '"> </td>';
+			//internal code
+			// button  modify
+			$r.=3D"<TD>";
+			// If url contains
+			//
=20
-            $href=3Dbasename($_SERVER['PHP_SELF']);
+            $href =3D basename($_SERVER['PHP_SELF']);
=20
=20
-            $r.=3Dsprintf('<A class=3D"detail" style=3D"text-decoration:=
underline" HREF=3D"javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
-                        $row['jr_id'], $gDossier, $row['jr_internal']);
-            $r.=3D"</TD>";
-            if ( $this->type=3D=3D'ALL') $r.=3Dtd($row['jrn_def_name']);
-            // date
-            $r.=3D"<TD>";
-            $r.=3D$row['str_jr_date'];
-            $r.=3D"</TD>";
+			$r.=3Dsprintf('<A class=3D"detail" style=3D"text-decoration:underline=
" HREF=3D"javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>', $row['jr_=
id'], $gDossier, $row['jr_internal']);
+			$r.=3D"</TD>";
+			if ($this->type =3D=3D 'ALL')
+				$r.=3Dtd($row['jrn_def_name']);
+			// date
+			$r.=3D"<TD>";
+			$r.=3D$row['str_jr_date'];
+			$r.=3D"</TD>";
=20
-            // pj
-            $r.=3D"<TD>";
-            $r.=3D$row['jr_pj_number'];
-            $r.=3D"</TD>";
+			// pj
+			$r.=3D"<TD>";
+			$r.=3D$row['jr_pj_number'];
+			$r.=3D"</TD>";
=20
-	    // Tiers
-	    $other=3D($row['quick_code']!=3D'')?'['.$row['quick_code'].'] '.$ro=
w['name'].' '.$row['first_name']:'';
-	    $r.=3Dtd($other);
-            // comment
-            $r.=3D"<TD>";
-            $tmp_jr_comment=3Dh($row['jr_comment']);
-            $r.=3D$tmp_jr_comment;
-            $r.=3D"</TD>";
-	    $r.=3Dtd(h($row['n_text']),' style=3D"font-size:6"');
-            // Amount
-            // If the ledger is financial :
-            // the credit must be negative and written in red
-            $positive=3D0;
+			// Tiers
+			$other =3D ($row['quick_code'] !=3D '') ? '[' . $row['quick_code'] . =
'] ' . $row['name'] . ' ' . $row['first_name'] : '';
+			$r.=3Dtd($other);
+			// comment
+			$r.=3D"<TD>";
+			$tmp_jr_comment =3D h($row['jr_comment']);
+			$r.=3D$tmp_jr_comment;
+			$r.=3D"</TD>";
+			$r.=3Dtd(h($row['n_text']), ' style=3D"font-size:6"');
+			// Amount
+			// If the ledger is financial :
+			// the credit must be negative and written in red
+			$positive =3D 0;
=20
-            // Check ledger type :
-            if (  $row['jrn_def_type'] =3D=3D 'FIN' )
-            {
-                $positive =3D $this->db->get_value("select qf_amount fro=
m quant_fin where jr_id=3D$1",
-                                                 array($row['jr_id']));
-		if ( $this->db->count() !=3D 0)
-		  $positive=3D($positive < 0)?1:0;
-            }
-            $r.=3D"<TD align=3D\"right\">";
+			// Check ledger type :
+			if ($row['jrn_def_type'] =3D=3D 'FIN')
+			{
+				$positive =3D $this->db->get_value("select qf_amount from quant_fin =
where jr_id=3D$1", array($row['jr_id']));
+				if ($this->db->count() !=3D 0)
+					$positive =3D ($positive < 0) ? 1 : 0;
+			}
+			$r.=3D"<TD align=3D\"right\">";
=20
-            $r.=3D( $positive !=3D 0 )?"<font color=3D\"red\">  - ".nbm(=
$row['jr_montant'])."</font>":nbm($row['jr_montant']);
-            $r.=3D"</TD>";
+			$r.=3D( $positive !=3D 0 ) ? "<font color=3D\"red\">  - " . nbm($row[=
'jr_montant']) . "</font>" : nbm($row['jr_montant']);
+			$r.=3D"</TD>";
=20
=20
=20
-            // Rapprochement
-            $rec=3Dnew Acc_Reconciliation($this->db);
-            $rec->set_jr_id($row['jr_id']);
-            $a=3D$rec->get();
-            $r.=3D"<TD>";
-            if ( $a !=3D null )
-            {
+			// Rapprochement
+			$rec =3D new Acc_Reconciliation($this->db);
+			$rec->set_jr_id($row['jr_id']);
+			$a =3D $rec->get();
+			$r.=3D"<TD>";
+			if ($a !=3D null)
+			{
=20
-                foreach ($a as $key =3D> $element)
-                {
-                    $operation=3Dnew Acc_Operation($this->db);
-                    $operation->jr_id=3D$element;
-                    $l_amount=3D$this->db->get_value("select jr_montant =
from jrn ".
-                                                   " where jr_id=3D$elem=
ent");
-                    $r.=3D "<A class=3D\"detail\" HREF=3D\"javascript:mo=
difyOperation('".$element."',".$gDossier.")\" > ".$operation->get_interna=
l()."[".nbm($l_amount)."]</A>";
-                }//for
-            }// if ( $a !=3D null ) {
-            $r.=3D"</TD>";
+				foreach ($a as $key =3D> $element)
+				{
+					$operation =3D new Acc_Operation($this->db);
+					$operation->jr_id =3D $element;
+					$l_amount =3D $this->db->get_value("select jr_montant from jrn " .
+							" where jr_id=3D$element");
+					$r.=3D "<A class=3D\"detail\" HREF=3D\"javascript:modifyOperation('=
" . $element . "'," . $gDossier . ")\" > " . $operation->get_internal() .=
 "[" . nbm($l_amount) . "]</A>";
+				}//for
+			}// if ( $a !=3D null ) {
+			$r.=3D"</TD>";
=20
-            if ( $row['jr_valid'] =3D=3D 'f'  )
-            {
-                $r.=3D"<TD> Op&eacute;ration annul&eacute;e</TD>";
-            }
-            // end row
-            $r.=3D"</tr>";
+			if ($row['jr_valid'] =3D=3D 'f')
+			{
+				$r.=3D"<TD> Op&eacute;ration annul&eacute;e</TD>";
+			}
+			// end row
+			$r.=3D"</tr>";
+		}
+		$r.=3D'</table>';
+		return array($count, $r);
+	}
=20
-        }
-	$r.=3D'</table>';
-        return array ($count,$r);
-    }
-    /*!\brief Show all the operation
-     *\param $sql is the sql stmt, normally created by build_search_sql
-     *\param $offset the offset
-     *\param $p_paid if we want to see info about payment
-    \code
-    // Example
-    // Build the sql
-    list($sql,$where)=3D$Ledger->build_search_sql($_GET);
-    // Count nb of line
-    $max_line=3D$cn->count_sql($sql);
+	/* !\brief Show all the operation
+	 * \param $sql is the sql stmt, normally created by build_search_sql
+	 * \param $offset the offset
+	 * \param $p_paid if we want to see info about payment
+	  \code
+	  // Example
+	  // Build the sql
+	  list($sql,$where)=3D$Ledger->build_search_sql($_GET);
+	  // Count nb of line
+	  $max_line=3D$cn->count_sql($sql);
=20
-    $step=3D$_SESSION['g_pagesize'];
-    $page=3D(isset($_GET['offset']))?$_GET['page']:1;
-    $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
-    // create the nav. bar
-    $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
-    // show a part
-    list($count,$html)=3D $Ledger->list_operation($sql,$offset,0);
-    echo $html;
-    // show nav bar
-    echo $bar;
+	  $step=3D$_SESSION['g_pagesize'];
+	  $page=3D(isset($_GET['offset']))?$_GET['page']:1;
+	  $offset=3D(isset($_GET['offset']))?$_GET['offset']:0;
+	  // create the nav. bar
+	  $bar=3Dnavigation_bar($offset,$max_line,$step,$page);
+	  // show a part
+	  list($count,$html)=3D $Ledger->list_operation($sql,$offset,0);
+	  echo $html;
+	  // show nav bar
+	  echo $bar;
=20
-    \endcode
-     *\see build_search_sql
-     *\see display_search_form
-     *\see search_form
+	  \endcode
+	 * \see build_search_sql
+	 * \see display_search_form
+	 * \see search_form
=20
-     *\return HTML string
-     */
-    public function list_operation($sql,$offset,$p_paid=3D0)
-    {
-        global $g_parameter,$g_user;
-		$table=3Dnew Sort_Table();
-        $gDossier=3Ddossier::id();
-        $amount_paid=3D0.0;
-        $amount_unpaid=3D0.0;
-        $limit=3D($_SESSION['g_pagesize']!=3D-1)?" LIMIT ".$_SESSION['g_=
pagesize']:"";
-        $offset=3D($_SESSION['g_pagesize']!=3D-1)?" OFFSET ".Database::e=
scape_string($offset):"";
-        $order=3D"  order by jr_date_order asc,jr_internal asc";
-        // Sort
-        $url=3D"?".CleanUrl();
-        $str_dossier=3Ddossier::get();
-		$table->add("Date",$url, 'order by jr_date asc,substring(jr_pj_number,=
\'\\\d+$\')::numeric asc',
-				'order by  jr_date desc,substring(jr_pj_number,\'\\\d+$\')::numeric =
desc', "da", "dd");
-		$table->add('Echeance',$url," order by  jr_ech asc"," order by  jr_ech=
 desc",'ea','ed');
-		$table->add('PJ',$url,' order by  substring(jr_pj_number,\'\\\d+$\')::=
numeric asc ',
-				' order by  substring(jr_pj_number,\'\\\d+$\')::numeric desc ' ,
-				"pja","pjd");
-		$table->add('Tiers',$url," order by  name asc"," order by  name desc",=
'na','nd');
-		$table->add('Montant',$url," order by jr_montant asc"," order by jr_mo=
ntant desc",
-				"ma","md");
-		$table->add("Description",$url,"order by jr_comment asc",
-				"order by jr_comment desc","ca","cd");
+	 * \return HTML string
+	 */
=20
-		$ord=3D ( ! isset ($_GET['ord']))?'da':$_GET['ord'];
-		$order=3D$table->get_sql_order($ord);
+	public function list_operation($sql, $offset, $p_paid =3D 0)
+	{
+		global $g_parameter, $g_user;
+		$table =3D new Sort_Table();
+		$gDossier =3D dossier::id();
+		$amount_paid =3D 0.0;
+		$amount_unpaid =3D 0.0;
+		$limit =3D ($_SESSION['g_pagesize'] !=3D -1) ? " LIMIT " . $_SESSION['=
g_pagesize'] : "";
+		$offset =3D ($_SESSION['g_pagesize'] !=3D -1) ? " OFFSET " . Database:=
:escape_string($offset) : "";
+		$order =3D "  order by jr_date_order asc,jr_internal asc";
+		// Sort
+		$url =3D "?" . CleanUrl();
+		$str_dossier =3D dossier::get();
+		$table->add("Date", $url, 'order by jr_date asc,substring(jr_pj_number=
,\'\\\d+$\')::numeric asc', 'order by  jr_date desc,substring(jr_pj_numbe=
r,\'\\\d+$\')::numeric desc', "da", "dd");
+		$table->add('Echeance', $url, " order by  jr_ech asc", " order by  jr_=
ech desc", 'ea', 'ed');
+		$table->add('PJ', $url, ' order by  substring(jr_pj_number,\'\\\d+$\')=
::numeric asc ', ' order by  substring(jr_pj_number,\'\\\d+$\')::numeric =
desc ', "pja", "pjd");
+		$table->add('Tiers', $url, " order by  name asc", " order by  name des=
c", 'na', 'nd');
+		$table->add('Montant', $url, " order by jr_montant asc", " order by jr=
_montant desc", "ma", "md");
+		$table->add("Description", $url, "order by jr_comment asc", "order by =
jr_comment desc", "ca", "cd");
=20
+		$ord =3D (!isset($_GET['ord'])) ? 'da' : $_GET['ord'];
+		$order =3D $table->get_sql_order($ord);
+
 		// Count
-        $count=3D$this->db->count_sql($sql);
-        // Add the limit
-        $sql.=3D$order.$limit.$offset;
-        // Execute SQL stmt
-        $Res=3D$this->db->exec_sql($sql);
+		$count =3D $this->db->count_sql($sql);
+		// Add the limit
+		$sql.=3D$order . $limit . $offset;
+		// Execute SQL stmt
+		$Res =3D $this->db->exec_sql($sql);
=20
-        //starting from here we can refactor, so that instead of returni=
ng the generated HTML,
-        //this function returns a tree structure.
+		//starting from here we can refactor, so that instead of returning the=
 generated HTML,
+		//this function returns a tree structure.
=20
-        $r=3D"";
+		$r =3D "";
=20
=20
-        $Max=3DDatabase::num_row($Res);
+		$Max =3D Database::num_row($Res);
=20
-        if ($Max=3D=3D0) return array(0,_("Aucun enregistrement trouv=C3=
=A9"));
+		if ($Max =3D=3D 0)
+			return array(0, _("Aucun enregistrement trouv=C3=A9"));
=20
-        $r.=3D'<table class=3D"result">';
+		$r.=3D'<table class=3D"result">';
=20
=20
-        $r.=3D"<tr >";
-        $r.=3D"<th>Internal</th>";
-        if ( $this->type=3D=3D'ALL')
-        {
-            $r.=3Dth('Journal');
-        }
-        $r.=3D'<th>'.$table->get_header(0).'</th>';
-        $r.=3D'<th>'.$table->get_header(1).'</td>';
-        $r.=3D'<th>'.$table->get_header(2).'</th>';
-        $r.=3D'<th>'.$table->get_header(3).'</th>';
-        $r.=3D'<th>'.$table->get_header(5).'</th>';
-	$r.=3Dth('Notes',' style=3D"width:15%"');
-        $r.=3D'<th>'.$table->get_header(4).'</th>';
-        // if $p_paid is not equal to 0 then we have a paid column
-        if ( $p_paid !=3D 0 )
-        {
-            $r.=3D"<th> "._('Pay=C3=A9')."</th>";
-        }
-        $r.=3D"<th>"._('Op. Concern=C3=A9e')."</th>";
-        $r.=3D"<th>"._('Document')."</th>";
-        $r.=3D"</tr>";
-        // Total Amount
-        $tot=3D0.0;
-        $gDossier=3Ddossier::id();
-        for ($i=3D0; $i < $Max;$i++)
-        {
+		$r.=3D"<tr >";
+		$r.=3D"<th>Internal</th>";
+		if ($this->type =3D=3D 'ALL')
+		{
+			$r.=3Dth('Journal');
+		}
+		$r.=3D'<th>' . $table->get_header(0) . '</th>';
+		$r.=3D'<th>' . $table->get_header(1) . '</td>';
+		$r.=3D'<th>' . $table->get_header(2) . '</th>';
+		$r.=3D'<th>' . $table->get_header(3) . '</th>';
+		$r.=3D'<th>' . $table->get_header(5) . '</th>';
+		$r.=3Dth('Notes', ' style=3D"width:15%"');
+		$r.=3D'<th>' . $table->get_header(4) . '</th>';
+		// if $p_paid is not equal to 0 then we have a paid column
+		if ($p_paid !=3D 0)
+		{
+			$r.=3D"<th> " . _('Pay=C3=A9') . "</th>";
+		}
+		$r.=3D"<th>" . _('Op. Concern=C3=A9e') . "</th>";
+		$r.=3D"<th>" . _('Document') . "</th>";
+		$r.=3D"</tr>";
+		// Total Amount
+		$tot =3D 0.0;
+		$gDossier =3D dossier::id();
+		for ($i =3D 0; $i < $Max; $i++)
+		{
=20
=20
-            $row=3DDatabase::fetch_array($Res,$i);
+			$row =3D Database::fetch_array($Res, $i);
=20
-            if ( $i % 2 =3D=3D 0 ) $tr=3D'<TR class=3D"odd">';
-            else $tr=3D'<TR class=3D"even">';
-            $r.=3D$tr;
-            //internal code
-            // button  modify
-            $r.=3D"<TD>";
-            // If url contains
-            //
+			if ($i % 2 =3D=3D 0)
+				$tr =3D '<TR class=3D"odd">';
+			else
+				$tr =3D '<TR class=3D"even">';
+			$r.=3D$tr;
+			//internal code
+			// button  modify
+			$r.=3D"<TD>";
+			// If url contains
+			//
=20
-            $href=3Dbasename($_SERVER['PHP_SELF']);
+            $href =3D basename($_SERVER['PHP_SELF']);
=20
=20
-            $r.=3Dsprintf('<A class=3D"detail" style=3D"text-decoration:=
underline" HREF=3D"javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
-                        $row['jr_id'], $gDossier, $row['jr_internal']);
-            $r.=3D"</TD>";
-            if ( $this->type=3D=3D'ALL') $r.=3Dtd($row['jrn_def_name']);
-            // date
-            $r.=3D"<TD>";
-            $r.=3Dsmaller_date($row['str_jr_date']);
-            $r.=3D"</TD>";
-            // echeance
-            $r.=3D"<TD>";
-            $r.=3Dsmaller_date($row['str_jr_ech']);
-            $r.=3D"</TD>";
+			$r.=3Dsprintf('<A class=3D"detail" style=3D"text-decoration:underline=
" HREF=3D"javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>', $row['jr_=
id'], $gDossier, $row['jr_internal']);
+			$r.=3D"</TD>";
+			if ($this->type =3D=3D 'ALL')
+				$r.=3Dtd($row['jrn_def_name']);
+			// date
+			$r.=3D"<TD>";
+			$r.=3Dsmaller_date($row['str_jr_date']);
+			$r.=3D"</TD>";
+			// echeance
+			$r.=3D"<TD>";
+			$r.=3Dsmaller_date($row['str_jr_ech']);
+			$r.=3D"</TD>";
=20
-            // pj
-            $r.=3D"<TD>";
-            $r.=3D$row['jr_pj_number'];
-            $r.=3D"</TD>";
+			// pj
+			$r.=3D"<TD>";
+			$r.=3D$row['jr_pj_number'];
+			$r.=3D"</TD>";
=20
-	    // Tiers
-	    $other=3D($row['quick_code']!=3D'')?'['.$row['quick_code'].'] '.$ro=
w['name'].' '.$row['first_name']:'';
-	    $r.=3Dtd($other);
-            // comment
-            $r.=3D"<TD>";
-            $tmp_jr_comment=3Dh($row['jr_comment']);
-            $r.=3D$tmp_jr_comment;
-            $r.=3D"</TD>";
-	    $r.=3Dtd(h($row['n_text']),' style=3D"font-size:6"');
-            // Amount
-            // If the ledger is financial :
-            // the credit must be negative and written in red
-            $positive=3D0;
+			// Tiers
+			$other =3D ($row['quick_code'] !=3D '') ? '[' . $row['quick_code'] . =
'] ' . $row['name'] . ' ' . $row['first_name'] : '';
+			$r.=3Dtd($other);
+			// comment
+			$r.=3D"<TD>";
+			$tmp_jr_comment =3D h($row['jr_comment']);
+			$r.=3D$tmp_jr_comment;
+			$r.=3D"</TD>";
+			$r.=3Dtd(h($row['n_text']), ' style=3D"font-size:6"');
+			// Amount
+			// If the ledger is financial :
+			// the credit must be negative and written in red
+			$positive =3D 0;
=20
-            // Check ledger type :
-            if (  $row['jrn_def_type'] =3D=3D 'FIN' )
-            {
-                $positive =3D $this->db->get_value("select qf_amount fro=
m quant_fin where jr_id=3D$1",
-                                                 array($row['jr_id']));
-		if ( $this->db->count() !=3D 0)
-		  $positive=3D($positive < 0)?1:0;
-            }
-            $r.=3D"<TD align=3D\"right\">";
+			// Check ledger type :
+			if ($row['jrn_def_type'] =3D=3D 'FIN')
+			{
+				$positive =3D $this->db->get_value("select qf_amount from quant_fin =
where jr_id=3D$1", array($row['jr_id']));
+				if ($this->db->count() !=3D 0)
+					$positive =3D ($positive < 0) ? 1 : 0;
+			}
+			$r.=3D"<TD align=3D\"right\">";
=20
-            $tot=3D($positive !=3D 0)?$tot-$row['jr_montant']:$tot+$row[=
'jr_montant'];
-            //STAN $positive always =3D=3D 0
-            $r.=3D( $positive !=3D 0 )?"<font color=3D\"red\">  - ".nbm(=
$row['jr_montant'])."</font>":nbm($row['jr_montant']);
-            $r.=3D"</TD>";
+			$tot =3D ($positive !=3D 0) ? $tot - $row['jr_montant'] : $tot + $row=
['jr_montant'];
+			//STAN $positive always =3D=3D 0
+			$r.=3D( $positive !=3D 0 ) ? "<font color=3D\"red\">  - " . nbm($row[=
'jr_montant']) . "</font>" : nbm($row['jr_montant']);
+			$r.=3D"</TD>";
=20
=20
-            // Show the paid column if p_paid is not null
-            if ( $p_paid !=3D0 )
-            {
-                $w=3Dnew ICheckBox();
-                $w->name=3D"rd_paid".$row['jr_id'];
-                $w->selected=3D($row['jr_rapt']=3D=3D'paid')?true:false;
-                // if p_paid =3D=3D 2 then readonly
-                $w->readonly=3D( $p_paid =3D=3D 2)?true:false;
-                $h=3Dnew IHidden();
-                $h->name=3D"set_jr_id".$row['jr_id'];
-                $r.=3D'<TD>'.$w->input().$h->input().'</TD>';
-                if ( $row['jr_rapt']=3D=3D'paid')
-                    $amount_paid+=3D$row['jr_montant'];
-                else
-                    $amount_unpaid+=3D$row['jr_montant'];
-            }
+			// Show the paid column if p_paid is not null
+			if ($p_paid !=3D 0)
+			{
+				$w =3D new ICheckBox();
+				$w->name =3D "rd_paid" . $row['jr_id'];
+				$w->selected =3D ($row['jr_rapt'] =3D=3D 'paid') ? true : false;
+				// if p_paid =3D=3D 2 then readonly
+				$w->readonly =3D ( $p_paid =3D=3D 2) ? true : false;
+				$h =3D new IHidden();
+				$h->name =3D "set_jr_id" . $row['jr_id'];
+				$r.=3D'<TD>' . $w->input() . $h->input() . '</TD>';
+				if ($row['jr_rapt'] =3D=3D 'paid')
+					$amount_paid+=3D$row['jr_montant'];
+				else
+					$amount_unpaid+=3D$row['jr_montant'];
+			}
=20
-            // Rapprochement
-            $rec=3Dnew Acc_Reconciliation($this->db);
-            $rec->set_jr_id($row['jr_id']);
-            $a=3D$rec->get();
-            $r.=3D"<TD>";
-            if ( $a !=3D null )
-            {
+			// Rapprochement
+			$rec =3D new Acc_Reconciliation($this->db);
+			$rec->set_jr_id($row['jr_id']);
+			$a =3D $rec->get();
+			$r.=3D"<TD>";
+			if ($a !=3D null)
+			{
=20
-                foreach ($a as $key =3D> $element)
-                {
-                    $operation=3Dnew Acc_Operation($this->db);
-                    $operation->jr_id=3D$element;
-                    $l_amount=3D$this->db->get_value("select jr_montant =
from jrn ".
-                                                   " where jr_id=3D$elem=
ent");
-                    $r.=3D "<A class=3D\"detail\" HREF=3D\"javascript:mo=
difyOperation('".$element."',".$gDossier.")\" > ".$operation->get_interna=
l()."[".nbm($l_amount)."]</A>";
-                }//for
-            }// if ( $a !=3D null ) {
-            $r.=3D"</TD>";
+				foreach ($a as $key =3D> $element)
+				{
+					$operation =3D new Acc_Operation($this->db);
+					$operation->jr_id =3D $element;
+					$l_amount =3D $this->db->get_value("select jr_montant from jrn " .
+							" where jr_id=3D$element");
+					$r.=3D "<A class=3D\"detail\" HREF=3D\"javascript:modifyOperation('=
" . $element . "'," . $gDossier . ")\" > " . $operation->get_internal() .=
 "[" . nbm($l_amount) . "]</A>";
+				}//for
+			}// if ( $a !=3D null ) {
+			$r.=3D"</TD>";
=20
-            if ( $row['jr_valid'] =3D=3D 'f'  )
-            {
-                $r.=3D"<TD> Op&eacute;ration annul&eacute;e</TD>";
-            }
-            else
-            {} // else
-            //document
-            if ( $row['jr_pj_name'] !=3D "")
-            {
-                $image=3D'<IMG SRC=3D"image/insert_table.gif" title=3D"'=
.$row['jr_pj_name'].'" border=3D"0">';
-                $r.=3D"<TD>".sprintf('<A class=3D"detail" HREF=3D"show_p=
j.php?jrn=3D%s&jr_grpt_id=3D%s&%s">%s</A>',
-                                   $row['jrn_def_id'],
-                                   $row['jr_grpt_id'],
-                                   $str_dossier,
-                                   $image)
-                    ."</TD>";
-            }
-            else
-                $r.=3D"<TD></TD>";
+			if ($row['jr_valid'] =3D=3D 'f')
+			{
+				$r.=3D"<TD> Op&eacute;ration annul&eacute;e</TD>";
+			}
+			else
+			{
=20
-            // end row
-            $r.=3D"</tr>";
+			} // else
+			//document
+			if ($row['jr_pj_name'] !=3D "")
+			{
+				$image =3D '<IMG SRC=3D"image/insert_table.gif" title=3D"' . $row['j=
r_pj_name'] . '" border=3D"0">';
+				$r.=3D"<TD>" . sprintf('<A class=3D"detail" HREF=3D"show_pj.php?jrn=3D=
%s&jr_grpt_id=3D%s&%s">%s</A>', $row['jrn_def_id'], $row['jr_grpt_id'], $=
str_dossier, $image)
+						. "</TD>";
+			}
+			else
+				$r.=3D"<TD></TD>";
=20
-        }
-        $amount_paid=3Dround($amount_paid,4);
-        $amount_unpaid=3Dround($amount_unpaid,4);
-        $tot=3Dround($tot,4);
-        $r.=3D"<TR>";
-        $r.=3D'<TD COLSPAN=3D"5">Total</TD>';
-        $r.=3D'<TD ALIGN=3D"RIGHT">'.nbm($tot)."</TD>";
-        $r.=3D"</tr>";
-        if ( $p_paid !=3D 0 )
-        {
-            $r.=3D"<TR>";
-            $r.=3D'<TD COLSPAN=3D"5">Pay&eacute;</TD>';
-            $r.=3D'<TD ALIGN=3D"RIGHT">'.nbm($amount_paid)."</TD>";
-            $r.=3D"</tr>";
-            $r.=3D"<TR>";
-            $r.=3D'<TD COLSPAN=3D"5">Non pay&eacute;</TD>';
-            $r.=3D'<TD ALIGN=3D"RIGHT">'.nbm($amount_unpaid)."</TD>";
-            $r.=3D"</tr>";
-        }
-        $r.=3D"</table>";
+			// end row
+			$r.=3D"</tr>";
+		}
+		$amount_paid =3D round($amount_paid, 4);
+		$amount_unpaid =3D round($amount_unpaid, 4);
+		$tot =3D round($tot, 4);
+		$r.=3D"<TR>";
+		$r.=3D'<TD COLSPAN=3D"5">Total</TD>';
+		$r.=3D'<TD ALIGN=3D"RIGHT">' . nbm($tot) . "</TD>";
+		$r.=3D"</tr>";
+		if ($p_paid !=3D 0)
+		{
+			$r.=3D"<TR>";
+			$r.=3D'<TD COLSPAN=3D"5">Pay&eacute;</TD>';
+			$r.=3D'<TD ALIGN=3D"RIGHT">' . nbm($amount_paid) . "</TD>";
+			$r.=3D"</tr>";
+			$r.=3D"<TR>";
+			$r.=3D'<TD COLSPAN=3D"5">Non pay&eacute;</TD>';
+			$r.=3D'<TD ALIGN=3D"RIGHT">' . nbm($amount_unpaid) . "</TD>";
+			$r.=3D"</tr>";
+		}
+		$r.=3D"</table>";
=20
-        return array ($count,$r);
-    }
+		return array($count, $r);
+	}
=20
-    /*!
-     * \brief get_detail gives the detail of row
-     * this array must contains at least the field
-     *       <ul>
-     *       <li> montant</li>
-     *       <li> grpt_id
-     *       </ul>
-     * the following field will be added
-     *       <ul>
-     *       <li> HTVA
-     *       <li> TVAC
-     *       <li> TVA array with
-     *          <ul>
-     *          <li> field 0 idx
-     *          <li> array containing tva_id,tva_label and tva_amount
-     *          </ul>
-     *       </ul>
-     *
-     * \param p_array the structure is set in get_rowSimple, this array =
is
-     *        modified,
-     * \param $trunc if the data must be truncated, usefull for pdf expo=
rt
-     * \param p_jrn_type is the type of the ledger (ACH or VEN)
-     * \param $a_TVA TVA Array (default null)
-     * \param $a_ParmCode Array (default null)
-     * \return p_array
-     */
-    function get_detail(&$p_array,$p_jrn_type,$trunc=3D0,$a_TVA=3Dnull,$=
a_ParmCode=3Dnull)
-    {
-        if ( $a_TVA =3D=3D null )
-        {
-            //Load TVA array
-            $a_TVA=3D$this->db->get_array('select tva_id,tva_label,tva_p=
oste
+	/* !
+	 * \brief get_detail gives the detail of row
+	 * this array must contains at least the field
+	 *       <ul>
+	 *       <li> montant</li>
+	 *       <li> grpt_id
+	 *       </ul>
+	 * the following field will be added
+	 *       <ul>
+	 *       <li> HTVA
+	 *       <li> TVAC
+	 *       <li> TVA array with
+	 *          <ul>
+	 *          <li> field 0 idx
+	 *          <li> array containing tva_id,tva_label and tva_amount
+	 *          </ul>
+	 *       </ul>
+	 *
+	 * \param p_array the structure is set in get_rowSimple, this array is
+	 *        modified,
+	 * \param $trunc if the data must be truncated, usefull for pdf export
+	 * \param p_jrn_type is the type of the ledger (ACH or VEN)
+	 * \param $a_TVA TVA Array (default null)
+	 * \param $a_ParmCode Array (default null)
+	 * \return p_array
+	 */
+
+	function get_detail(&$p_array, $p_jrn_type, $trunc =3D 0, $a_TVA =3D nu=
ll, $a_ParmCode =3D null)
+	{
+		if ($a_TVA =3D=3D null)
+		{
+			//Load TVA array
+			$a_TVA =3D $this->db->get_array('select tva_id,tva_label,tva_poste
                                         from tva_rate where tva_rate !=3D=
 0 order by tva_id');
-        }
-        if ( $a_ParmCode =3D=3D null )
-        {
-            //Load Parm_code
-            $a_ParmCode=3D$this->db->get_array('select p_code,p_value fr=
om parm_code');
-        }
-        // init
-        $p_array['client']=3D"";
-        $p_array['TVAC']=3D0;
-        $p_array['TVA']=3Darray();
-        $p_array['AMOUNT_TVA']=3D0.0;
-        $p_array['dep_priv']=3D0;
-        $dep_priv=3D0.0;
-        //
-        // Retrieve data from jrnx
-        $sql=3D"select j_id,j_poste,j_montant, j_debit,j_qcode from jrnx=
 where ".
-             " j_grpt=3D".$p_array['grpt_id'];
-        $Res2=3D$this->db->exec_sql($sql);
-        $data_jrnx=3DDatabase::fetch_all($Res2);
-        $c=3D0;
+		}
+		if ($a_ParmCode =3D=3D null)
+		{
+			//Load Parm_code
+			$a_ParmCode =3D $this->db->get_array('select p_code,p_value from parm=
_code');
+		}
+		// init
+		$p_array['client'] =3D "";
+		$p_array['TVAC'] =3D 0;
+		$p_array['TVA'] =3D array();
+		$p_array['AMOUNT_TVA'] =3D 0.0;
+		$p_array['dep_priv'] =3D 0;
+		$dep_priv =3D 0.0;
+		//
+		// Retrieve data from jrnx
+		$sql =3D "select j_id,j_poste,j_montant, j_debit,j_qcode from jrnx whe=
re " .
+				" j_grpt=3D" . $p_array['grpt_id'];
+		$Res2 =3D $this->db->exec_sql($sql);
+		$data_jrnx =3D Database::fetch_all($Res2);
+		$c =3D 0;
=20
-        // Parse data from jrnx and fill diff. field
-        foreach ( $data_jrnx as $code )
-        {
-            $idx_tva=3D0;
-            $poste=3Dnew Acc_Account_Ledger($this->db,$code['j_poste']);
+		// Parse data from jrnx and fill diff. field
+		foreach ($data_jrnx as $code)
+		{
+			$idx_tva =3D 0;
+			$poste =3D new Acc_Account_Ledger($this->db, $code['j_poste']);
=20
-            // if card retrieve name if the account is not a VAT account
-            if ( strlen(trim($code['j_qcode'] )) !=3D 0 && $poste->isTva=
() =3D=3D 0 )
-            {
-                $fiche=3Dnew Fiche($this->db);
-                $fiche->get_by_qcode(trim($code['j_qcode']),false);
-                $fiche_def_id=3D$fiche->get_fiche_def_ref_id();
-                // Customer or supplier
-                if ( $fiche_def_id =3D=3D FICHE_TYPE_CLIENT ||
-                        $fiche_def_id =3D=3D FICHE_TYPE_FOURNISSEUR )
-                {
-                    $p_array['TVAC']=3D$code['j_montant'];
+			// if card retrieve name if the account is not a VAT account
+			if (strlen(trim($code['j_qcode'])) !=3D 0 && $poste->isTva() =3D=3D 0=
)
+			{
+				$fiche =3D new Fiche($this->db);
+				$fiche->get_by_qcode(trim($code['j_qcode']), false);
+				$fiche_def_id =3D $fiche->get_fiche_def_ref_id();
+				// Customer or supplier
+				if ($fiche_def_id =3D=3D FICHE_TYPE_CLIENT ||
+						$fiche_def_id =3D=3D FICHE_TYPE_FOURNISSEUR)
+				{
+					$p_array['TVAC'] =3D $code['j_montant'];
=20
-                    $p_array['client']=3D($trunc=3D=3D0)?$fiche->getName=
():mb_substr($fiche->getName(),0,20);
-                    $p_array['reversed']=3Dfalse;
-                    if (	$fiche_def_id =3D=3D FICHE_TYPE_CLIENT && $code=
['j_debit']=3D=3D'f')
-                    {
-                        $p_array['reversed']=3Dtrue;
-                        $p_array['TVAC']*=3D-1;
+					$p_array['client'] =3D ($trunc =3D=3D 0) ? $fiche->getName() : mb_s=
ubstr($fiche->getName(), 0, 20);
+					$p_array['reversed'] =3D false;
+					if ($fiche_def_id =3D=3D FICHE_TYPE_CLIENT && $code['j_debit'] =3D=3D=
 'f')
+					{
+						$p_array['reversed'] =3D true;
+						$p_array['TVAC']*=3D-1;
+					}
+					if ($fiche_def_id =3D=3D FICHE_TYPE_FOURNISSEUR && $code['j_debit']=
 =3D=3D 't')
+					{
+						$p_array['reversed'] =3D true;
+						$p_array['TVAC']*=3D-1;
+					}
+				}
+				else
+				{
+					// if we use the ledger ven / ach for others card than supplier and=
 customer
+					if ($fiche_def_id !=3D FICHE_TYPE_VENTE &&
+							$fiche_def_id !=3D FICHE_TYPE_ACH_MAR &&
+							$fiche_def_id !=3D FICHE_TYPE_ACH_SER)
+					{
+						$p_array['TVAC'] =3D $code['j_montant'];
=20
-                    }
-                    if (	$fiche_def_id =3D=3D FICHE_TYPE_FOURNISSEUR && =
$code['j_debit']=3D=3D't')
-                    {
-                        $p_array['reversed']=3Dtrue;
-                        $p_array['TVAC']*=3D-1;
-                    }
+						$p_array['client'] =3D ($trunc =3D=3D 0) ? $fiche->getName() : mb_=
substr($fiche->getName(), 0, 20);
+						$p_array['reversed'] =3D false;
+						if ($p_jrn_type =3D=3D 'ACH' && $code['j_debit'] =3D=3D 't')
+						{
+							$p_array['reversed'] =3D true;
+							$p_array['TVAC']*=3D-1;
+						}
+						if ($p_jrn_type =3D=3D 'VEN' && $code['j_debit'] =3D=3D 'f')
+						{
+							$p_array['reversed'] =3D true;
+							$p_array['TVAC']*=3D-1;
+						}
+					}
+				}
+			}
+			// if TVA, load amount, tva id and rate in array
+			foreach ($a_TVA as $line_tva)
+			{
+				list($tva_deb, $tva_cred) =3D explode(',', $line_tva['tva_poste']);
+				if ($code['j_poste'] =3D=3D $tva_deb ||
+						$code['j_poste'] =3D=3D $tva_cred)
+				{
=20
+					// For the reversed operation
+					if ($p_jrn_type =3D=3D 'ACH' && $code['j_debit'] =3D=3D 'f')
+					{
+						$code['j_montant'] =3D -1 * $code['j_montant'];
+					}
+					if ($p_jrn_type =3D=3D 'VEN' && $code['j_debit'] =3D=3D 't')
+					{
+						$code['j_montant'] =3D -1 * $code['j_montant'];
+					}
=20
-                }
-                else
-                {
-                    // if we use the ledger ven / ach for others card th=
an supplier and customer
-                    if ( $fiche_def_id !=3D FICHE_TYPE_VENTE &&
-                            $fiche_def_id !=3D FICHE_TYPE_ACH_MAR &&
-                            $fiche_def_id !=3D FICHE_TYPE_ACH_SER )
-                    {
-                        $p_array['TVAC']=3D$code['j_montant'];
+					$p_array['AMOUNT_TVA']+=3D$code['j_montant'];
=20
-                        $p_array['client']=3D	($trunc=3D=3D0)?$fiche->ge=
tName():mb_substr($fiche->getName(),0,20);
-                        $p_array['reversed']=3Dfalse;
-                        if ($p_jrn_type =3D=3D 'ACH' && $code['j_debit']=
=3D=3D't')
-                        {
-                            $p_array['reversed']=3Dtrue;
-                            $p_array['TVAC']*=3D-1;
+					$p_array['TVA'][$c] =3D array($idx_tva, array($line_tva['tva_id'], =
$line_tva['tva_label'], $code['j_montant']));
+					$c++;
=20
-                        }
-                        if ($p_jrn_type =3D=3D 'VEN'  && $code['j_debit'=
]=3D=3D'f')
-                        {
-                            $p_array['reversed']=3Dtrue;
-                            $p_array['TVAC']*=3D-1;
-                        }
+					$idx_tva++;
+				}
+			}
=20
+			// isDNA
+			// If operation is reversed then  amount are negatif
+			/* if ND */
+			if ($p_array['jrn_def_type'] =3D=3D 'ACH')
+			{
+				$purchase =3D new Gestion_Purchase($this->db);
+				$purchase->search_by_jid($code['j_id']);
+				$purchase->load();
+				$dep_priv+=3D$purchase->qp_dep_priv;
+				$p_array['dep_priv'] =3D $dep_priv;
+			}
+		}
+		$p_array['TVAC'] =3D sprintf('% 10.2f', $p_array['TVAC'] - $dep_priv);
+		$p_array['HTVA'] =3D sprintf('% 10.2f', $p_array['TVAC'] - $p_array['A=
MOUNT_TVA']);
+		$r =3D "";
+		$a_tva_amount =3D array();
+		// inline TVA (used for the PDF)
+		foreach ($p_array['TVA'] as $linetva)
+		{
+			foreach ($a_TVA as $tva)
+			{
+				if ($tva['tva_id'] =3D=3D $linetva[1][0])
+				{
+					$a =3D $tva['tva_id'];
+					$a_tva_amount[$a] =3D $linetva[1][2];
+				}
+			}
+		}
+		foreach ($a_TVA as $line_tva)
+		{
+			$a =3D $line_tva['tva_id'];
+			if (isset($a_tva_amount[$a]))
+			{
+				$tmp =3D sprintf("% 10.2f", $a_tva_amount[$a]);
+				$r.=3D"$tmp";
+			}
+			else
+				$r.=3Dsprintf("% 10.2f", 0);
+		}
+		$p_array['TVA_INLINE'] =3D $r;
=20
+		return $p_array;
+	}
=20
+// retrieve data from jrnx
+	/* !
+	 * \brief  Get the properties of a journal
+	 *
+	 * \return an array containing properties
+	 *
+	 */
=20
-                    }
-                }
-            }
-            // if TVA, load amount, tva id and rate in array
-            foreach ( $a_TVA as $line_tva)
-            {
-                list($tva_deb,$tva_cred)=3Dexplode(',',$line_tva['tva_po=
ste']);
-                if ( $code['j_poste'] =3D=3D $tva_deb ||
-                        $code['j_poste'] =3D=3D $tva_cred )
-                {
+	function get_propertie()
+	{
+		if ($this->id =3D=3D 0)
+			return;
=20
-                    // For the reversed operation
-                    if ( $p_jrn_type =3D=3D 'ACH' && $code['j_debit'] =3D=
=3D 'f')
-                    {
-                        $code['j_montant']=3D-1*$code['j_montant'];
-                    }
-                    if ( $p_jrn_type =3D=3D 'VEN' && $code['j_debit'] =3D=
=3D 't')
-                    {
-                        $code['j_montant']=3D-1*$code['j_montant'];
-                    }
+		$Res =3D $this->db->exec_sql("select jrn_Def_id,jrn_def_name,jrn_def_c=
lass_deb,jrn_def_class_cred,jrn_def_type,
+                                 jrn_deb_max_line,jrn_cred_max_line,jrn_=
def_ech,jrn_def_ech_lib,jrn_def_code,
+                                 jrn_def_fiche_deb,jrn_def_fiche_cred,jr=
n_def_pj_pref
+                                 from jrn_Def
+                                 where jrn_def_id=3D$1", array($this->id=
));
+		$Count =3D Database::num_row($Res);
+		if ($Count =3D=3D 0)
+		{
+			echo '<DIV=3D"redcontent"><H2 class=3D"error">' . _('Parametres journ=
aux non trouves') . '</H2> </DIV>';
+			return null;
+		}
+		return Database::fetch_array($Res, 0);
+	}
=20
-                    $p_array['AMOUNT_TVA']+=3D$code['j_montant'];
+	/* ! \function GetDefLine
+	 * \brief Get the number of lines of a journal
+	 * \param $p_cred deb or cred
+	 *
+	 * \return an integer
+	 */
=20
-                    $p_array['TVA'][$c]=3Darray($idx_tva,array($line_tva=
['tva_id'],$line_tva['tva_label'],$code['j_montant']));
-                    $c++;
+	function GetDefLine()
+	{
+		$sql_cred =3D 'jrn_deb_max_line';
+		$sql =3D "select jrn_deb_max_line as value from jrn_def where jrn_def_=
id=3D$1";
+		$r =3D $this->db->exec_sql($sql, array($this->id));
+		$Res =3D Database::fetch_all($r);
+		if (sizeof($Res) =3D=3D 0)
+			return 1;
+		return $Res[0]['value'];
+	}
=20
-                    $idx_tva++;
-                }
-            }
+	/* !\brief get the saldo of a ledger for a specific period
+	 * \param $p_from start period
+	 * \param $p_to end period
+	 */
=20
-            // isDNA
-            // If operation is reversed then  amount are negatif
-            /* if ND */
-            if ( $p_array['jrn_def_type'] =3D=3D 'ACH')
-            {
-                $purchase=3Dnew Gestion_Purchase($this->db);
-                $purchase->search_by_jid($code['j_id']);
-                $purchase->load();
-                $dep_priv+=3D$purchase->qp_dep_priv;
-                $p_array['dep_priv']=3D$dep_priv;
-            }
+	function get_solde($p_from, $p_to)
+	{
+		$ledger =3D "";
+		if ($this->id !=3D 0)
+		{
+			$ledger =3D " and j_jrn_def =3D " . $this->id;
+		}
=20
-        }
-        $p_array['TVAC']=3Dsprintf('% 10.2f',$p_array['TVAC']-$dep_priv)=
;
-        $p_array['HTVA']=3Dsprintf('% 10.2f',$p_array['TVAC']-$p_array['=
AMOUNT_TVA']);
-        $r=3D"";
-        $a_tva_amount=3Darray();
-        // inline TVA (used for the PDF)
-        foreach ($p_array['TVA'] as $linetva)
-        {
-            foreach ($a_TVA as $tva)
-            {
-                if ( $tva['tva_id'] =3D=3D $linetva[1][0] )
-                {
-                    $a=3D$tva['tva_id'];
-                    $a_tva_amount[$a]=3D$linetva[1][2];
-                }
-            }
-        }
-        foreach ($a_TVA as $line_tva)
-        {
-            $a=3D$line_tva['tva_id'];
-            if ( isset($a_tva_amount[$a]))
-            {
-                $tmp=3Dsprintf("% 10.2f",$a_tva_amount[$a]);
-                $r.=3D"$tmp";
-            }
-            else
-                $r.=3Dsprintf("% 10.2f",0);
-        }
-        $p_array['TVA_INLINE']=3D$r;
+		$periode =3D sql_filter_per($this->db, $p_from, $p_to, 'p_id', 'j_tech=
_per');
+		$sql =3D 'select j_montant as montant,j_debit as deb from jrnx where '
+				. $periode . $ledger;
=20
-        return $p_array;
-    }  // retrieve data from jrnx
-    /*!
-     * \brief  Get the properties of a journal
-     *
-     * \return an array containing properties
-     *
-     */
-    function get_propertie()
-    {
-        if ( $this->id =3D=3D 0 ) return;
+		$ret =3D $this->db->exec_sql($sql);
+		$array =3D Database::fetch_all($ret);
+		$deb =3D 0.0;
+		$cred =3D 0.0;
+		foreach ($array as $line)
+		{
=20
-        $Res=3D$this->db->exec_sql("select jrn_Def_id,jrn_def_name,jrn_d=
ef_class_deb,jrn_def_class_cred,jrn_def_type,
-                                 jrn_deb_max_line,jrn_cred_max_line,jrn_=
def_ech,jrn_def_ech_lib,jrn_def_code,
-                                 jrn_def_fiche_deb,jrn_def_fiche_cred,jr=
n_def_pj_pref
-                                 from jrn_Def
-                                 where jrn_def_id=3D$1",array($this->id)=
);
-        $Count=3DDatabase::num_row($Res);
-        if ( $Count =3D=3D 0 )
-        {
-            echo '<DIV=3D"redcontent"><H2 class=3D"error">'._('Parametre=
s journaux non trouves').'</H2> </DIV>';
-            return null;
-        }
-        return Database::fetch_array($Res,0);
-    }
+			if ($line['deb'] =3D=3D 't')
+				$deb+=3D$line['montant'];
+			else
+				$cred+=3D$line['montant'];
+		}
+		$response =3D array($deb, $cred);
+		return $response;
+	}
=20
-    /*! \function GetDefLine
-     * \brief Get the number of lines of a journal
-     * \param $p_cred deb or cred
-     *
-     * \return an integer
-     */
-    function GetDefLine()
-    {
-        $sql_cred=3D'jrn_deb_max_line';
-        $sql=3D"select jrn_deb_max_line as value from jrn_def where jrn_=
def_id=3D$1";
-        $r=3D$this->db->exec_sql($sql,array($this->id));
-        $Res=3DDatabase::fetch_all($r);
-        if ( sizeof($Res) =3D=3D 0 ) return 1;
-        return $Res[0]['value'];
-    }
-    /*!\brief get the saldo of a ledger for a specific period
-     * \param $p_from start period
-     * \param $p_to end period
-     */
-    function get_solde($p_from,$p_to)
-    {
-        $ledger=3D"";
-        if ( $this->id !=3D 0 )
-        {
-            $ledger=3D" and j_jrn_def =3D ".$this->id;
-        }
+	/* !
+	 * \brief Show a select list   of the ledgers you can access in
+	 * writing, reading or simply accessing.
+	 * \param $p_type =3D ALL or the type of the ledger (ACH,VEN,FIN,ODS)
+	 * \param $p_access =3D3 for READ and WRITE, 2 for write and 1 for read=
only
+	 * \return     object HtmlInput select
+	 */
=20
-        $periode=3Dsql_filter_per($this->db,$p_from,$p_to,'p_id','j_tech=
_per');
-        $sql=3D'select j_montant as montant,j_debit as deb from jrnx whe=
re '
-             .$periode.$ledger;
+	function select_ledger($p_type =3D "ALL", $p_access =3D 3)
+	{
+		global $g_user;
+		$array =3D $g_user->get_ledger($p_type, $p_access);
=20
-        $ret=3D$this->db->exec_sql($sql);
-        $array=3DDatabase::fetch_all($ret);
-        $deb=3D0.0;
-        $cred=3D0.0;
-        foreach ($array as $line)
-        {
+		if ($array =3D=3D null)
+			return null;
+		$idx =3D 0;
+		$ret =3D array();
=20
-            if ( $line['deb']=3D=3D't' )
-                $deb+=3D$line['montant'];
-            else
-                $cred+=3D$line['montant'];
-        }
-        $response=3Darray($deb,$cred);
-        return $response;
-    }
-    /*!
-     * \brief Show a select list   of the ledgers you can access in
-     * writing, reading or simply accessing.
-     * \param $p_type =3D ALL or the type of the ledger (ACH,VEN,FIN,ODS=
)
-     * \param $p_access =3D3 for READ and WRITE, 2 for write and 1 for r=
eadonly
-     * \return     object HtmlInput select
-     */
-    function select_ledger($p_type=3D"ALL",$p_access=3D3)
-    {
-        global $g_user;
-        $array=3D$g_user->get_ledger($p_type,$p_access);
+		foreach ($array as $value)
+		{
+			$ret[$idx]['value'] =3D $value['jrn_def_id'];
+			$ret[$idx]['label'] =3D h($value['jrn_def_name']);
+			$idx++;
+		}
=20
-        if ( $array =3D=3D null ) return null;
-        $idx=3D0;
-        $ret=3Darray();
+		$select =3D new ISelect();
+		$select->name =3D 'p_jrn';
+		$select->value =3D $ret;
+		$select->selected =3D $this->id;
+		return $select;
+	}
=20
-        foreach ( $array as $value)
-        {
-            $ret[$idx]['value']=3D$value['jrn_def_id'];
-            $ret[$idx]['label']=3Dh($value['jrn_def_name']);
-            $idx++;
-        }
+	/* !
+	 * \brief retrieve the jrn_def_fiche and return them into a array
+	 *        index deb, cred
+	 * \param
+	 * \param
+	 * \param
+	 *
+	 *
+	 * \return return an array ('deb'=3D> ,'cred'=3D>)
+	 */
=20
-        $select=3Dnew ISelect();
-        $select->name=3D'p_jrn';
-        $select->value=3D$ret;
-        $select->selected=3D$this->id;
-        return $select;
-    }
-    /*!
-     * \brief retrieve the jrn_def_fiche and return them into a array
-     *        index deb, cred
-     * \param
-     * \param
-     * \param
-     *
-     *
-     * \return return an array ('deb'=3D> ,'cred'=3D>)
-     */
-    function get_fiche_def()
-    {
-        $sql=3D"select jrn_def_fiche_deb as deb,jrn_def_fiche_cred as cr=
ed ".
-             " from jrn_def where ".
-             " jrn_def_id =3D $1 ";
+	function get_fiche_def()
+	{
+		$sql =3D "select jrn_def_fiche_deb as deb,jrn_def_fiche_cred as cred "=
 .
+				" from jrn_def where " .
+				" jrn_def_id =3D $1 ";
=20
-        $r=3D$this->db->exec_sql($sql,array($this->id));
+		$r =3D $this->db->exec_sql($sql, array($this->id));
=20
-        $res=3DDatabase::fetch_all($r);
-        if ( empty($res) ) return null;
+		$res =3D Database::fetch_all($r);
+		if (empty($res))
+			return null;
=20
-        return $res[0];
-    }
-    /*!
-     * \brief retrieve the jrn_def_class_deb and return it
-     *
-     *
-     * \return return an string
-     */
-    function get_class_def()
-    {
-        $sql=3D"select jrn_def_class_deb  ".
-             " from jrn_def where ".
-             " jrn_def_id =3D $1";
+		return $res[0];
+	}
=20
-        $r=3D$this->db->exec_sql($sql,array($this->id));
+	/* !
+	 * \brief retrieve the jrn_def_class_deb and return it
+	 *
+	 *
+	 * \return return an string
+	 */
=20
-        $res=3DDatabase::fetch_all($r);
+	function get_class_def()
+	{
+		$sql =3D "select jrn_def_class_deb  " .
+				" from jrn_def where " .
+				" jrn_def_id =3D $1";
=20
-        if ( empty($res) ) return null;
+		$r =3D $this->db->exec_sql($sql, array($this->id));
=20
-        return $res[0];
-    }
+		$res =3D Database::fetch_all($r);
=20
-    /*!
-     * \brief show the result of the array to confirm
-     * before inserting
-     * \param $p_array array from the form
-     * \return string
-     */
-    function confirm($p_array,$p_readonly=3Dfalse)
-    {
-        global $g_parameter;
-		$msg=3Darray();
-		if (! $p_readonly ) $msg=3D$this->verify($p_array);
-		$this->id=3D$p_array['p_jrn'];
-        if ( empty($p_array)) return 'Aucun r&eacute;sultat';
-        $anc=3Dnull;
-        extract($p_array);
-        $lPeriode=3Dnew Periode($this->db);
-        if ($this->check_periode() =3D=3D true)
-        {
-            $lPeriode->p_id=3D$period;
-        }
-        else
-        {
-            $lPeriode->find_periode($e_date);
-        }
-	$total_deb=3D0;$total_cred=3D0;
-	bcscale(2);
+		if (empty($res))
+			return null;
=20
-        $ret=3D"";
-		if ( ! empty ($msg))
+		return $res[0];
+	}
+
+	/* !
+	 * \brief show the result of the array to confirm
+	 * before inserting
+	 * \param $p_array array from the form
+	 * \return string
+	 */
+
+	function confirm($p_array, $p_readonly =3D false)
+	{
+		global $g_parameter;
+		$msg =3D array();
+		if (!$p_readonly)
+			$msg =3D $this->verify($p_array);
+		$this->id =3D $p_array['p_jrn'];
+		if (empty($p_array))
+			return 'Aucun r&eacute;sultat';
+		$anc =3D null;
+		extract($p_array);
+		$lPeriode =3D new Periode($this->db);
+		if ($this->check_periode() =3D=3D true)
 		{
-			$ret.=3D$this->display_warning($msg,"Attention : il vaut mieux utilis=
er les fiches que les postes comptables pour");
+			$lPeriode->p_id =3D $period;
 		}
-        $ret.=3D"<table >";
-        $ret.=3D"<tr><td>"._('Date')." : </td><td>$e_date</td></tr>";
-        /* display periode */
-        $date_limit=3D$lPeriode->get_date_limit();
-        $ret.=3D'<tr> '.td(_('P=C3=A9riode Comptable')).td($date_limit['=
p_start'].'-'.$date_limit['p_end']).'</tr>';
-        $ret.=3D"<tr><td>"._('Libell=C3=A9')." </td><td>".h($desc)."</td=
></tr>";
-        $ret.=3D"<tr><td>"._('PJ Num')." </td><td>".h($e_pj)."</td></tr>=
";
-        $ret.=3D'</table>';
-        $ret.=3D"<table class=3D\"result\">";
-        $ret.=3D"<tr>";
-        $ret.=3D"<th>"._('Quick Code ou ');
-        $ret.=3D_("Poste")." </th>";
-        $ret.=3D"<th style=3D\"text-align:left\"> "._("Libell=C3=A9")." =
</th>";
-        $ret.=3D"<th style=3D\"text-align:right\">"._("D=C3=A9bit")."</t=
h>";
-        $ret.=3D"<th style=3D\"text-align:right\">"._("Cr=C3=A9dit")."</=
th>";
-        /* if we use the AC */
-        if ($g_parameter->MY_ANALYTIC!=3D'nu')
-        {
-            $anc=3Dnew Anc_Plan($this->db);
-            $a_anc=3D$anc->get_list();
-            $x=3Dcount($a_anc);
-            /* set the width of the col */
-            $ret.=3D'<th colspan=3D"'.$x.'" style=3D"width:auto;text-ali=
gn:center" >'._('Compt. Analytique').'</th>';
+		else
+		{
+			$lPeriode->find_periode($e_date);
+		}
+		$total_deb =3D 0;
+		$total_cred =3D 0;
+		bcscale(2);
=20
-            /* add hidden variables pa[] to hold the value of pa_id */
-            $ret.=3DAnc_Plan::hidden($a_anc);
-        }
-        $ret.=3D"</tr>";
+		$ret =3D "";
+		if (!empty($msg))
+		{
+			$ret.=3D$this->display_warning($msg, "Attention : il vaut mieux utili=
ser les fiches que les postes comptables pour");
+		}
+		$ret.=3D"<table >";
+		$ret.=3D"<tr><td>" . _('Date') . " : </td><td>$e_date</td></tr>";
+		/* display periode */
+		$date_limit =3D $lPeriode->get_date_limit();
+		$ret.=3D'<tr> ' . td(_('P=C3=A9riode Comptable')) . td($date_limit['p_=
start'] . '-' . $date_limit['p_end']) . '</tr>';
+		$ret.=3D"<tr><td>" . _('Libell=C3=A9') . " </td><td>" . h($desc) . "</=
td></tr>";
+		$ret.=3D"<tr><td>" . _('PJ Num') . " </td><td>" . h($e_pj) . "</td></t=
r>";
+		$ret.=3D'</table>';
+		$ret.=3D"<table class=3D\"result\">";
+		$ret.=3D"<tr>";
+		$ret.=3D"<th>" . _('Quick Code ou ');
+		$ret.=3D_("Poste") . " </th>";
+		$ret.=3D"<th style=3D\"text-align:left\"> " . _("Libell=C3=A9") . " </=
th>";
+		$ret.=3D"<th style=3D\"text-align:right\">" . _("D=C3=A9bit") . "</th>=
";
+		$ret.=3D"<th style=3D\"text-align:right\">" . _("Cr=C3=A9dit") . "</th=
>";
+		/* if we use the AC */
+		if ($g_parameter->MY_ANALYTIC !=3D 'nu')
+		{
+			$anc =3D new Anc_Plan($this->db);
+			$a_anc =3D $anc->get_list();
+			$x =3D count($a_anc);
+			/* set the width of the col */
+			$ret.=3D'<th colspan=3D"' . $x . '" style=3D"width:auto;text-align:ce=
nter" >' . _('Compt. Analytique') . '</th>';
=20
-        $ret.=3DHtmlInput::hidden('e_date',$e_date);
-        $ret.=3DHtmlInput::hidden('desc',$desc);
-        $ret.=3DHtmlInput::hidden('period',$lPeriode->p_id);
-        $ret.=3DHtmlInput::hidden('e_pj',$e_pj);
-        $ret.=3DHtmlInput::hidden('e_pj_suggest',$e_pj_suggest);
-        $mt=3Dmicrotime(true);
-        $ret.=3DHtmlInput::hidden('mt',$mt);
-        // For predefined operation
-        $ret.=3DHtmlInput::hidden('e_comm',$desc);
-        $ret.=3DHtmlInput::hidden('jrn_type',$this->get_type());
-        $ret.=3DHtmlInput::hidden('p_jrn',$this->id);
-        $ret.=3DHtmlInput::hidden('nb_item',$nb_item);
-        if ( $this->with_concerned=3D=3Dtrue)
-        {
-            $ret.=3DHtmlInput::hidden('jrn_concerned',$jrn_concerned);
-        }
-        $ret.=3Ddossier::hidden();
-        $count=3D0;
-        for ($i=3D0;$i<$nb_item;$i++)
-        {
-			if ( $p_readonly =3D=3D true )
+			/* add hidden variables pa[] to hold the value of pa_id */
+			$ret.=3DAnc_Plan::hidden($a_anc);
+		}
+		$ret.=3D"</tr>";
+
+		$ret.=3DHtmlInput::hidden('e_date', $e_date);
+		$ret.=3DHtmlInput::hidden('desc', $desc);
+		$ret.=3DHtmlInput::hidden('period', $lPeriode->p_id);
+		$ret.=3DHtmlInput::hidden('e_pj', $e_pj);
+		$ret.=3DHtmlInput::hidden('e_pj_suggest', $e_pj_suggest);
+		$mt =3D microtime(true);
+		$ret.=3DHtmlInput::hidden('mt', $mt);
+		// For predefined operation
+		$ret.=3DHtmlInput::hidden('e_comm', $desc);
+		$ret.=3DHtmlInput::hidden('jrn_type', $this->get_type());
+		$ret.=3DHtmlInput::hidden('p_jrn', $this->id);
+		$ret.=3DHtmlInput::hidden('nb_item', $nb_item);
+		if ($this->with_concerned =3D=3D true)
+		{
+			$ret.=3DHtmlInput::hidden('jrn_concerned', $jrn_concerned);
+		}
+		$ret.=3Ddossier::hidden();
+		$count =3D 0;
+		for ($i =3D 0; $i < $nb_item; $i++)
+		{
+			if ($p_readonly =3D=3D true)
 			{
-				if ( ! isset (${'qc_'.$i})) ${'qc_'.$i}=3D'';
-				if ( ! isset (${'poste'.$i})) ${'poste'.$i}=3D'';
-				if ( ! isset (${'amount'.$i})) ${'amount'.$i}=3D'';
+				if (!isset(${'qc_' . $i}))
+					${'qc_' . $i} =3D '';
+				if (!isset(${'poste' . $i}))
+					${'poste' . $i} =3D '';
+				if (!isset(${'amount' . $i}))
+					${'amount' . $i} =3D '';
 			}
-            $ret.=3D"<tr>";
-            if ( trim(${'qc_'.$i})!=3D"")
-            {
-                $oqc=3Dnew Fiche($this->db);
-                $oqc->get_by_qcode(${'qc_'.$i},false);
-                $strPoste=3D$oqc->strAttribut(ATTR_DEF_ACCOUNT);
-                $ret.=3D"<td>".
-                      ${'qc_'.$i}.' - '.
-                      $oqc->strAttribut(ATTR_DEF_NAME).HtmlInput::hidden=
('qc_'.$i,${'qc_'.$i}).
-                      '</td>';
+			$ret.=3D"<tr>";
+			if (trim(${'qc_' . $i}) !=3D "")
+			{
+				$oqc =3D new Fiche($this->db);
+				$oqc->get_by_qcode(${'qc_' . $i}, false);
+				$strPoste =3D $oqc->strAttribut(ATTR_DEF_ACCOUNT);
+				$ret.=3D"<td>" .
+						${'qc_' . $i} . ' - ' .
+						$oqc->strAttribut(ATTR_DEF_NAME) . HtmlInput::hidden('qc_' . $i, $=
{'qc_' . $i}) .
+						'</td>';
+			}
=20
-            }
+			if (trim(${'qc_' . $i}) =3D=3D "" && trim(${'poste' . $i}) !=3D "")
+			{
+				$oposte =3D new Acc_Account_Ledger($this->db, ${'poste' . $i});
+				$strPoste =3D $oposte->id;
+				$ret.=3D"<td>" . h(${"poste" . $i} . " - " .
+								$oposte->get_name()) . HtmlInput::hidden('poste' . $i, ${'poste'=
 . $i}) .
+						'</td>';
+			}
=20
-            if ( trim(${'qc_'.$i})=3D=3D"" && trim(${'poste'.$i}) !=3D "=
")
-            {
-                $oposte=3Dnew Acc_Account_Ledger($this->db,${'poste'.$i}=
);
-                $strPoste=3D$oposte->id;
-                $ret.=3D"<td>".h(${"poste".$i}." - ".
-                               $oposte->get_name()).HtmlInput::hidden('p=
oste'.$i,${'poste'.$i}).
-                      '</td>';
-            }
+			if (trim(${'qc_' . $i}) =3D=3D "" && trim(${'poste' . $i}) =3D=3D "")
+				continue;
+			$ret.=3D"<td>" . h(${"ld" . $i}) . HtmlInput::hidden('ld' . $i, ${'ld=
' . $i}) . "</td>";
+			if (isset(${"ck$i"}))
+			{
+				$ret.=3D"<td class=3D\"num\">" . nbm(${"amount" . $i}) . HtmlInput::=
hidden('amount' . $i, ${'amount' . $i}) . "</td>" . td("");
+				$total_deb =3D bcadd($total_deb, ${'amount' . $i});
+			}
+			else
+			{
+				$ret.=3Dtd("") . "<td class=3D\"num\">" . nbm(${"amount" . $i}) . Ht=
mlInput::hidden('amount' . $i, ${'amount' . $i}) . "</td>";
+				$total_cred =3D bcadd($total_cred, ${"amount" . $i});
+			}
+			$ret.=3D"<td>";
+			$ret.=3D(isset(${"ck$i"})) ? HtmlInput::hidden('ck' . $i, ${'ck' . $i=
}) : "";
+			$ret.=3D"</td>";
+			// CA
=20
-            if ( trim(${'qc_'.$i})=3D=3D"" && trim(${'poste'.$i}) =3D=3D=
 "")
-                continue;
-            $ret.=3D"<td>".h(${"ld".$i}).HtmlInput::hidden('ld'.$i,${'ld=
'.$i})."</td>";
-            if ( isset(${"ck$i"}))
-	      {
-		$ret.=3D"<td class=3D\"num\">".nbm(${"amount".$i}).HtmlInput::hidden('=
amount'.$i,${'amount'.$i})."</td>".td("");
-		$total_deb=3Dbcadd($total_deb,${'amount'.$i});
-	      }
-	    else
-	      {
-		$ret.=3Dtd("")."<td class=3D\"num\">".nbm(${"amount".$i}).HtmlInput::h=
idden('amount'.$i,${'amount'.$i})."</td>";
-		$total_cred=3Dbcadd($total_cred,${"amount".$i});
-	      }
-            $ret.=3D"<td>";
-            $ret.=3D(isset(${"ck$i"}))?HtmlInput::hidden('ck'.$i,${'ck'.=
$i}):"";
-            $ret.=3D"</td>";
-            // CA
+			if ($g_parameter->MY_ANALYTIC !=3D 'nu') // use of AA
+			{
+				if (preg_match("/^[6,7]+/", $strPoste) =3D=3D 1)
+				{
+					// show form
+					$op =3D new Anc_Operation($this->db);
+					$null =3D ($g_parameter->MY_ANALYTIC =3D=3D 'op') ? 1 : 0;
+					$p_array['pa_id'] =3D $a_anc;
+					/* op is the operation it contains either a sequence or a jrnx.j_id=
 */
+					$ret.=3DHtmlInput::hidden('op[]=3D', $i);
=20
-            if (  $g_parameter->MY_ANALYTIC!=3D'nu') // use of AA
-            {
-                if ( preg_match("/^[6,7]+/",$strPoste)=3D=3D1)
-                {
-                    // show form
-                    $op=3Dnew Anc_Operation($this->db);
-                    $null=3D($g_parameter->MY_ANALYTIC=3D=3D'op')?1:0;
-                    $p_array['pa_id']=3D$a_anc;
-                    /* op is the operation it contains either a sequence=
 or a jrnx.j_id */
-                    $ret.=3DHtmlInput::hidden('op[]=3D',$i);
+					$ret.=3D'<td style=3D"text-align:center">';
+					$read =3D ($p_readonly =3D=3D true) ? 0 : 1;
+					$ret.=3D$op->display_form_plan($p_array, $null, $read, $count, roun=
d(${'amount' . $i}, 2));
+					$ret.=3D'</td>';
+					$count++;
+				}
+			}
=20
-                    $ret.=3D'<td style=3D"text-align:center">';
-					$read=3D($p_readonly=3D=3Dtrue)?0:1;
-                    $ret.=3D$op->display_form_plan($p_array,$null,$read,=
$count,round(${'amount'.$i},2));
-                    $ret.=3D'</td>';
-                    $count++;
-                }
=20
=20
-            }
+			$ret.=3D"</tr>";
+		}
+		$ret.=3Dtr(td('') . td(_('Totaux')) . td($total_deb, 'class=3D"num"') =
. td($total_cred, 'class=3D"num"'), 'class=3D"footer"');
+		$ret.=3D"</table>";
+		if ($g_parameter->MY_ANALYTIC !=3D 'nu' && $p_readonly =3D=3D false)
+			$ret.=3D'<input type=3D"button" class=3D"button" value=3D"' . _('veri=
fie Imputation Analytique') . '" onClick=3D"verify_ca(\'\');">';
+		return $ret;
+	}
=20
+	/* !
+	 * \brief Show the form to encode your operation
+	 * \param $p_array if you correct or use a predef operation (default =3D=
 null)
+	 * \param $p_readonly 1 for readonly 0 for writable (default 0)
+	 *
+	 * \return a string containing the form
+	 */
=20
+	function input($p_array =3D null, $p_readonly =3D 0)
+	{
+		global $g_parameter, $g_user;
=20
-            $ret.=3D"</tr>";
-        }
-		$ret.=3Dtr(td('').td(_('Totaux')).td($total_deb,'class=3D"num"').td($t=
otal_cred,'class=3D"num"'),'class=3D"footer"');
-        $ret.=3D"</table>";
-		if ( $g_parameter->MY_ANALYTIC!=3D'nu'  && $p_readonly=3D=3Dfalse)
-			$ret.=3D'<input type=3D"button" class=3D"button" value=3D"'._('verifi=
e Imputation Analytique').'" onClick=3D"verify_ca(\'\');">';
-        return $ret;
-    }
+		if ($p_readonly =3D=3D 1)
+			return $this->confirm($p_array);
=20
-    /*!
-     * \brief Show the form to encode your operation
-     * \param $p_array if you correct or use a predef operation (default=
 =3D null)
-     * \param $p_readonly 1 for readonly 0 for writable (default 0)
-     *
-     * \return a string containing the form
-     */
-    function input($p_array=3Dnull,$p_readonly=3D0)
-    {
-        global $g_parameter,$g_user;
+		if ($p_array !=3D null)
+			extract($p_array);
+		$add_js =3D "";
+		if ($g_parameter->MY_PJ_SUGGEST =3D=3D 'Y')
+		{
+			$add_js =3D "update_pj();";
+		}
+		$add_js.=3D'get_last_date();';
=20
-        if ( $p_readonly =3D=3D 1 )
-            return $this->confirm($p_array);
-
-        if ( $p_array !=3D null )
-            extract($p_array);
-        $add_js=3D"";
-        if ( $g_parameter->MY_PJ_SUGGEST=3D=3D'Y')
-        {
-            $add_js=3D"update_pj();";
-        }
-        $add_js.=3D'get_last_date();';
-
-        $ret=3D"";
-		if ( $g_user->check_action(FICADD) =3D=3D 1)
+		$ret =3D "";
+		if ($g_user->check_action(FICADD) =3D=3D 1)
 		{
 			/* Add button */
-			$f_add_button=3Dnew IButton('add_card');
-			$f_add_button->label=3D_('Cr=C3=A9er une nouvelle fiche');
-			$f_add_button->set_attribute('ipopup','ipop_newcard');
-			$f_add_button->set_attribute('jrn',$this->id);
-			$f_add_button->javascript=3D" this.jrn=3D\$('p_jrn').value;select_car=
d_type(this);";
+			$f_add_button =3D new IButton('add_card');
+			$f_add_button->label =3D _('Cr=C3=A9er une nouvelle fiche');
+			$f_add_button->set_attribute('ipopup', 'ipop_newcard');
+			$f_add_button->set_attribute('jrn', $this->id);
+			$f_add_button->javascript =3D " this.jrn=3D\$('p_jrn').value;select_c=
ard_type(this);";
 			$f_add_button->input();
 		}
-		$wLedger=3D$this->select_ledger('ODS',2);
-        if ($wLedger =3D=3D null) exit (_('Pas de journal disponible'));
-        $wLedger->javascript=3D"onChange=3D'update_name();update_predef(=
\"ods\",\"t\");$add_js'";
-        $label=3D" Journal ".HtmlInput::infobulle(2) ;
+		$wLedger =3D $this->select_ledger('ODS', 2);
+		if ($wLedger =3D=3D null)
+			exit(_('Pas de journal disponible'));
+		$wLedger->javascript =3D "onChange=3D'update_name();update_predef(\"od=
s\",\"t\");$add_js'";
+		$label =3D " Journal " . HtmlInput::infobulle(2);
=20
-        $ret.=3D$label.$wLedger->input();
+		$ret.=3D$label . $wLedger->input();
=20
=20
-        // Load the javascript
-        //
+		// Load the javascript
+		//
         $ret.=3D"<table>";
-        $ret.=3D '<tr ><td colspan=3D"2" style=3D"width:auto">';
-        $wDate=3Dnew IDate('e_date');
-        $wDate->readonly=3D$p_readonly;
-        $e_date=3D(isset($e_date)&&trim($e_date)!=3D'')?$e_date:'';
-        $wDate->value=3D$e_date;
+		$ret.=3D '<tr ><td colspan=3D"2" style=3D"width:auto">';
+		$wDate =3D new IDate('e_date');
+		$wDate->readonly =3D $p_readonly;
+		$e_date =3D (isset($e_date) && trim($e_date) !=3D '') ? $e_date : '';
+		$wDate->value =3D $e_date;
=20
-        $ret.=3D_("Date").' : '.$wDate->input();
-        $ret.=3D '</td>';
-        /* insert periode if needed */
-        // Periode
-        //--
-        if ($this->check_periode() =3D=3D true)
-        {
-            $l_user_per=3D$g_user->get_periode();
-            $def=3D(isset($periode))?$periode:$l_user_per;
+		$ret.=3D_("Date") . ' : ' . $wDate->input();
+		$ret.=3D '</td>';
+		/* insert periode if needed */
+		// Periode
+		//--
+		if ($this->check_periode() =3D=3D true)
+		{
+			$l_user_per =3D $g_user->get_periode();
+			$def =3D (isset($periode)) ? $periode : $l_user_per;
=20
-            $period=3Dnew IPeriod("period");
-            $period->user=3D$g_user;
-            $period->cn=3D$this->db;
-            $period->value=3D$def;
-            $period->type=3DOPEN;
-            try
-            {
-                $l_form_per=3D$period->input();
-            }
-            catch (Exception $e)
-            {
-                if ($e->getCode() =3D=3D 1 )
-                {
-                    echo _("Aucune p=C3=A9riode ouverte");
-                    exit();
-                }
-            }
-            $label=3DHtmlInput::infobulle(3);
-            $f_periode=3D_("P=C3=A9riode comptable")." $label ".$l_form_=
per;
-            $ret.=3Dtd($f_periode);
-        }
-        $wPJ=3Dnew IText('e_pj');
-        $wPJ->readonly=3Dfalse;
-        $wPJ->size=3D10;
+			$period =3D new IPeriod("period");
+			$period->user =3D $g_user;
+			$period->cn =3D $this->db;
+			$period->value =3D $def;
+			$period->type =3D OPEN;
+			try
+			{
+				$l_form_per =3D $period->input();
+			}
+			catch (Exception $e)
+			{
+				if ($e->getCode() =3D=3D 1)
+				{
+					echo _("Aucune p=C3=A9riode ouverte");
+					exit();
+				}
+			}
+			$label =3D HtmlInput::infobulle(3);
+			$f_periode =3D _("P=C3=A9riode comptable") . " $label " . $l_form_per=
;
+			$ret.=3Dtd($f_periode);
+		}
+		$wPJ =3D new IText('e_pj');
+		$wPJ->readonly =3D false;
+		$wPJ->size =3D 10;
=20
-        /* suggest PJ ? */
-        $default_pj=3D'';
-        if ( $g_parameter->MY_PJ_SUGGEST=3D=3D'Y')
-        {
-            $default_pj=3D$this->guess_pj();
-        }
-        $wPJ->value=3D(isset($e_pj))?$e_pj:$default_pj;
-        $ret.=3D '</tr>';
+		/* suggest PJ ? */
+		$default_pj =3D '';
+		if ($g_parameter->MY_PJ_SUGGEST =3D=3D 'Y')
+		{
+			$default_pj =3D $this->guess_pj();
+		}
+		$wPJ->value =3D (isset($e_pj)) ? $e_pj : $default_pj;
+		$ret.=3D '</tr>';
 		$ret.=3D'<tr >';
-        $ret.=3D'<td colspan=3D"2" style=3D"width:auto"> '._('Pi=C3=A8ce=
').' : '.$wPJ->input();
-        $ret.=3DHtmlInput::hidden('e_pj_suggest',$default_pj);
-        $ret.=3D '</tr>';
-        $ret.=3D '</td>';
+		$ret.=3D'<td colspan=3D"2" style=3D"width:auto"> ' . _('Pi=C3=A8ce') .=
 ' : ' . $wPJ->input();
+		$ret.=3DHtmlInput::hidden('e_pj_suggest', $default_pj);
+		$ret.=3D '</tr>';
+		$ret.=3D '</td>';
=20
-        $ret.=3D '<tr>';
-        $ret.=3D'<td colspan=3D"2" style=3D"width:auto">';
-	$ret.=3D_('Libell=C3=A9');
-        $wDescription=3Dnew IText('desc');
-        $wDescription->readonly=3D$p_readonly;
-        $wDescription->size=3D"50";
-        $wDescription->value=3D(isset($desc))?$desc:'';
+		$ret.=3D '<tr>';
+		$ret.=3D'<td colspan=3D"2" style=3D"width:auto">';
+		$ret.=3D_('Libell=C3=A9');
+		$wDescription =3D new IText('desc');
+		$wDescription->readonly =3D $p_readonly;
+		$wDescription->size =3D "50";
+		$wDescription->value =3D (isset($desc)) ? $desc : '';
=20
-        $ret.=3D$wDescription->input();
-        $ret.=3D '</td>';
-        $ret.=3D'</tr>';
+		$ret.=3D$wDescription->input();
+		$ret.=3D '</td>';
+		$ret.=3D'</tr>';
=20
-        $ret.=3D '</table>';
-        $nb_row=3D(isset($nb_item) )?$nb_item:$this->nb;
+		$ret.=3D '</table>';
+		$nb_row =3D (isset($nb_item) ) ? $nb_item : $this->nb;
=20
-        $ret.=3DHtmlInput::hidden('nb_item',$nb_row);
-        $ret.=3Ddossier::hidden();
+		$ret.=3DHtmlInput::hidden('nb_item', $nb_row);
+		$ret.=3Ddossier::hidden();
=20
-        $ret.=3Ddossier::hidden();
+		$ret.=3Ddossier::hidden();
=20
-        $ret.=3DHtmlInput::hidden('jrn_type',$this->get_type());
-        $info=3D HtmlInput::infobulle(0);
-        $info_poste=3DHtmlInput::infobulle(9);
-	if  ($g_user->check_action(FICADD)=3D=3D1)	$ret.=3D$f_add_button->input=
();
-        $ret.=3D'<table id=3D"quick_item" style=3D"width:100%">';
-        $ret.=3D'<tr>'.
-              '<th style=3D"text-align:left">Quickcode'.$info.'</th>'.
-              '<th style=3D"text-align:left">'._('Poste').$info_poste.'<=
/th>'.
-              '<th style=3D"text-align:left">'._('Libell=C3=A9').'</th>'=
.
-              '<th style=3D"text-align:left">'._('Montant').'</th>'.
-              '<th style=3D"text-align:left">'._('D=C3=A9bit').'</th>'.
-              '</tr>';
+		$ret.=3DHtmlInput::hidden('jrn_type', $this->get_type());
+		$info =3D HtmlInput::infobulle(0);
+		$info_poste =3D HtmlInput::infobulle(9);
+		if ($g_user->check_action(FICADD) =3D=3D 1)
+			$ret.=3D$f_add_button->input();
+		$ret.=3D'<table id=3D"quick_item" style=3D"width:100%">';
+		$ret.=3D'<tr>' .
+				'<th style=3D"text-align:left">Quickcode' . $info . '</th>' .
+				'<th style=3D"text-align:left">' . _('Poste') . $info_poste . '</th>=
' .
+				'<th style=3D"text-align:left">' . _('Libell=C3=A9') . '</th>' .
+				'<th style=3D"text-align:left">' . _('Montant') . '</th>' .
+				'<th style=3D"text-align:left">' . _('D=C3=A9bit') . '</th>' .
+				'</tr>';
=20
=20
-        for ($i =3D 0 ;$i<$nb_row;$i++)
-        {
-            // Quick Code
-            $quick_code=3Dnew ICard('qc_'.$i);
-            $quick_code->set_dblclick("fill_ipopcard(this);");
-            $quick_code->set_attribute('ipopup','ipopcard');
+		for ($i =3D 0; $i < $nb_row; $i++)
+		{
+			// Quick Code
+			$quick_code =3D new ICard('qc_' . $i);
+			$quick_code->set_dblclick("fill_ipopcard(this);");
+			$quick_code->set_attribute('ipopup', 'ipopcard');
=20
-            // name of the field to update with the name of the card
-            $quick_code->set_attribute('label',"ld".$i);
-            $quick_code->set_attribute('jrn',$this->id);
+			// name of the field to update with the name of the card
+			$quick_code->set_attribute('label', "ld" . $i);
+			$quick_code->set_attribute('jrn', $this->id);
=20
-            // name of the field to update with the name of the card
-            $quick_code->set_attribute('typecard','filter');
+			// name of the field to update with the name of the card
+			$quick_code->set_attribute('typecard', 'filter');
=20
-            // Add the callback function to filter the card on the jrn
-            $quick_code->set_callback('filter_card');
-            $quick_code->set_function('fill_data');
-            $quick_code->javascript=3Dsprintf(' onchange=3D"fill_data_on=
change(\'%s\');" ',
-                                            $quick_code->name);
+			// Add the callback function to filter the card on the jrn
+			$quick_code->set_callback('filter_card');
+			$quick_code->set_function('fill_data');
+			$quick_code->javascript =3D sprintf(' onchange=3D"fill_data_onchange(=
\'%s\');" ', $quick_code->name);
=20
-            $quick_code->jrn=3D$this->id;
-            $quick_code->value=3D(isset(${'qc_'.$i}))?${'qc_'.$i}:"";
-            $quick_code->readonly=3D$p_readonly;
+			$quick_code->jrn =3D $this->id;
+			$quick_code->value =3D (isset(${'qc_' . $i})) ? ${'qc_' . $i} : "";
+			$quick_code->readonly =3D $p_readonly;
=20
-            $label=3D'';
-            if ( $quick_code->value !=3D '' )
-            {
-                $Fiche=3Dnew Fiche($this->db);
-                $Fiche->get_by_qcode($quick_code->value);
-                $label=3D$Fiche->strAttribut(ATTR_DEF_NAME);
-            }
+			$label =3D '';
+			if ($quick_code->value !=3D '')
+			{
+				$Fiche =3D new Fiche($this->db);
+				$Fiche->get_by_qcode($quick_code->value);
+				$label =3D $Fiche->strAttribut(ATTR_DEF_NAME);
+			}
=20
=20
-            // Account
-            $poste=3Dnew IPoste();
-            $poste->name=3D'poste'.$i;
-            $poste->set_attribute('jrn',$this->id);
-            $poste->set_attribute('ipopup','ipop_account');
-            $poste->set_attribute('label','ld'.$i);
-            $poste->set_attribute('account','poste'.$i);
-            $poste->set_attribute('dossier',  Dossier::id());
+			// Account
+			$poste =3D new IPoste();
+			$poste->name =3D 'poste' . $i;
+			$poste->set_attribute('jrn', $this->id);
+			$poste->set_attribute('ipopup', 'ipop_account');
+			$poste->set_attribute('label', 'ld' . $i);
+			$poste->set_attribute('account', 'poste' . $i);
+			$poste->set_attribute('dossier', Dossier::id());
=20
-            $poste->value=3D(isset(${'poste'.$i}))?${"poste".$i}:''
-						     ;
+			$poste->value =3D (isset(${'poste' . $i})) ? ${"poste" . $i} : ''
+			;
 			$poste->dbl_click_history();
=20
-            $poste->readonly=3D$p_readonly;
+			$poste->readonly =3D $p_readonly;
=20
-            if ( $poste->value !=3D '' )
-            {
-                $Poste=3Dnew Acc_Account($this->db);
-                $Poste->set_parameter('value',$poste->value);
-                $label=3D$Poste->get_lib();
-            }
+			if ($poste->value !=3D '')
+			{
+				$Poste =3D new Acc_Account($this->db);
+				$Poste->set_parameter('value', $poste->value);
+				$label =3D $Poste->get_lib();
+			}
=20
-            // Description of the line
-            $line_desc=3Dnew IText();
-            $line_desc->name=3D'ld'.$i;
-            $line_desc->size=3D30;
-            $line_desc->value=3D(isset(${"ld".$i}))?${"ld".$i}:
-                              $label;
+			// Description of the line
+			$line_desc =3D new IText();
+			$line_desc->name =3D 'ld' . $i;
+			$line_desc->size =3D 30;
+			$line_desc->value =3D (isset(${"ld" . $i})) ? ${"ld" . $i} :
+					$label;
=20
-            // Amount
-            $amount=3Dnew INum();
-            $amount->size=3D10;
-            $amount->name=3D'amount'.$i;
-            $amount->value=3D(isset(${'amount'.$i}))?${"amount".$i}:''
-                           ;
-            $amount->readonly=3D$p_readonly;
-            $amount->javascript=3D' onChange=3D"format_number(this);chec=
kTotalDirect()"';
-            // D/C
-            $deb=3Dnew ICheckBox();
-            $deb->name=3D'ck'.$i;
-            $deb->selected=3D(isset(${'ck'.$i}))?true:false;
-            $deb->readonly=3D$p_readonly;
-            $deb->javascript=3D' onChange=3D"checkTotalDirect()"';
+			// Amount
+			$amount =3D new INum();
+			$amount->size =3D 10;
+			$amount->name =3D 'amount' . $i;
+			$amount->value =3D (isset(${'amount' . $i})) ? ${"amount" . $i} : ''
+			;
+			$amount->readonly =3D $p_readonly;
+			$amount->javascript =3D ' onChange=3D"format_number(this);checkTotalD=
irect()"';
+			// D/C
+			$deb =3D new ICheckBox();
+			$deb->name =3D 'ck' . $i;
+			$deb->selected =3D (isset(${'ck' . $i})) ? true : false;
+			$deb->readonly =3D $p_readonly;
+			$deb->javascript =3D ' onChange=3D"checkTotalDirect()"';
=20
-            $ret.=3D'<tr>';
-            $ret.=3D'<td>'.$quick_code->input().$quick_code->search().'<=
/td>';
-            $ret.=3D'<td>'.$poste->input().
-                  '<script> document.getElementById(\'poste'.$i.'\').onb=
lur=3Dfunction(){ if (trim(this.value) !=3D\'\') {document.getElementById=
(\'qc_'.$i.'\').value=3D"";}}</script>'.
-                  '</td>';
-            $ret.=3D'<td>'.$line_desc->input().'</td>';
-            $ret.=3D'<td>'.$amount->input().'</td>';
-            $ret.=3D'<td>'.$deb->input().'</td>';
-            $ret.=3D'</tr>';
-            // If readonly =3D=3D 1 then show CA
-        }
-        $ret.=3D'</table>';
-        if ( isset ($this->with_concerned) && $this->with_concerned=3D=3D=
true)
-        {
-            $oRapt=3Dnew Acc_Reconciliation($this->db);
-            $w=3D$oRapt->widget();
-            $w->name=3D'jrn_concerned';
-            $w->value=3D(isset($jrn_concerned))?$jrn_concerned:"";
-            $ret.=3D"R&eacute;conciliation/rapprochements : ".$w->input(=
);
-        }
-        return $ret;
-    }
+			$ret.=3D'<tr>';
+			$ret.=3D'<td>' . $quick_code->input() . $quick_code->search() . '</td=
>';
+			$ret.=3D'<td>' . $poste->input() .
+					'<script> document.getElementById(\'poste' . $i . '\').onblur=3Dfun=
ction(){ if (trim(this.value) !=3D\'\') {document.getElementById(\'qc_' .=
 $i . '\').value=3D"";}}</script>' .
+					'</td>';
+			$ret.=3D'<td>' . $line_desc->input() . '</td>';
+			$ret.=3D'<td>' . $amount->input() . '</td>';
+			$ret.=3D'<td>' . $deb->input() . '</td>';
+			$ret.=3D'</tr>';
+			// If readonly =3D=3D 1 then show CA
+		}
+		$ret.=3D'</table>';
+		if (isset($this->with_concerned) && $this->with_concerned =3D=3D true)
+		{
+			$oRapt =3D new Acc_Reconciliation($this->db);
+			$w =3D $oRapt->widget();
+			$w->name =3D 'jrn_concerned';
+			$w->value =3D (isset($jrn_concerned)) ? $jrn_concerned : "";
+			$ret.=3D"R&eacute;conciliation/rapprochements : " . $w->input();
+		}
+		return $ret;
+	}
=20
-    /*!\brief
-     * check if the current ledger is closed
-     *\return 1 for yes, otherwise 0
-     *\see Periode::is_closed
-     */
-    function is_closed($p_periode)
-    {
-        $per=3Dnew Periode($this->db);
-        $per->set_jrn($this->id);
-        $per->set_periode($p_periode);
-        $ret=3D$per->is_closed();
-        return $ret;
+	/* !\brief
+	 * check if the current ledger is closed
+	 * \return 1 for yes, otherwise 0
+	 * \see Periode::is_closed
+	 */
=20
-    }
-    /*!
-     * \brief verify that the operation can be saved
-     * \param $p_array array of data same layout that the $_POST from sh=
ow_form
-     *
-     *
-     * \throw  the getcode  value is 1 incorrect balance,  2 date
-     * invalid, 3 invalid amount,  4 the card is not in the range of
-     * permitted card, 5 not in the user's period, 6 closed period
-     *
-     */
-    function verify($p_array)
-    {
-        extract ($p_array);
-        global $g_user;
-        $tot_cred=3D0;
-        $tot_deb=3D0;
-		$msg=3Darray();
+	function is_closed($p_periode)
+	{
+		$per =3D new Periode($this->db);
+		$per->set_jrn($this->id);
+		$per->set_periode($p_periode);
+		$ret =3D $per->is_closed();
+		return $ret;
+	}
=20
-        /* check if we can write into this ledger */
-        if ( $g_user->check_jrn($p_jrn) !=3D 'W' )
-            throw new Exception (_('Acc=C3=A8s interdit'),20);
+	/* !
+	 * \brief verify that the operation can be saved
+	 * \param $p_array array of data same layout that the $_POST from show_=
form
+	 *
+	 *
+	 * \throw  the getcode  value is 1 incorrect balance,  2 date
+	 * invalid, 3 invalid amount,  4 the card is not in the range of
+	 * permitted card, 5 not in the user's period, 6 closed period
+	 *
+	 */
=20
-        /* check for a double reload */
-        if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn w=
here jr_mt=3D$1',array($mt)) !=3D 0 )
-            throw new Exception ('Double Encodage',5);
+	function verify($p_array)
+	{
+		extract($p_array);
+		global $g_user;
+		$tot_cred =3D 0;
+		$tot_deb =3D 0;
+		$msg =3D array();
=20
-        // Check the periode and the date
-        if ( isDate($e_date) =3D=3D null )
-        {
-            throw new Exception('Date invalide', 2);
-        }
-        $periode=3Dnew Periode($this->db);
-        /* find the periode  if we have enabled the check_periode*/
-        if ($this->check_periode()=3D=3Dfalse)
-        {
-            $periode->find_periode($e_date);
-        }
-        else
-        {
-            $periode->p_id=3D$period;
-            list ($min,$max)=3D$periode->get_date_limit();
-            if ( cmpDate($e_date,$min) < 0 ||
-                    cmpDate($e_date,$max) > 0)
-                throw new Exception(_('Date et periode ne correspondent =
pas'),6);
+		/* check if we can write into this ledger */
+		if ($g_user->check_jrn($p_jrn) !=3D 'W')
+			throw new Exception(_('Acc=C3=A8s interdit'), 20);
=20
-        }
+		/* check for a double reload */
+		if (isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr=
_mt=3D$1', array($mt)) !=3D 0)
+			throw new Exception('Double Encodage', 5);
=20
+		// Check the periode and the date
+		if (isDate($e_date) =3D=3D null)
+		{
+			throw new Exception('Date invalide', 2);
+		}
+		$periode =3D new Periode($this->db);
+		/* find the periode  if we have enabled the check_periode */
+		if ($this->check_periode() =3D=3D false)
+		{
+			$periode->find_periode($e_date);
+		}
+		else
+		{
+			$periode->p_id =3D $period;
+			list ($min, $max) =3D $periode->get_date_limit();
+			if (cmpDate($e_date, $min) < 0 ||
+					cmpDate($e_date, $max) > 0)
+				throw new Exception(_('Date et periode ne correspondent pas'), 6);
+		}
=20
=20
-        // Periode ferme
-        if ( $this->is_closed($periode->p_id)=3D=3D1 )
-        {
-            throw new Exception('Periode fermee',6);
-        }
-        /* check if we are using the strict mode */
-        if( $this->check_strict() =3D=3D true)
-        {
-            /* if we use the strict mode, we get the date of the last
-            operation */
-            $last_date=3D$this->get_last_date();
-            if ( $last_date !=3Dnull && cmpDate($e_date,$last_date) < 0 =
)
-                throw new Exception(_('Vous utilisez le mode strict la d=
erni=C3=A8re operation est la date du ')
-                                    .$last_date.' '._('vous ne pouvez pa=
s encoder =C3=A0 une date ant=C3=A9rieure'),15);
=20
-        }
+		// Periode ferme
+		if ($this->is_closed($periode->p_id) =3D=3D 1)
+		{
+			throw new Exception('Periode fermee', 6);
+		}
+		/* check if we are using the strict mode */
+		if ($this->check_strict() =3D=3D true)
+		{
+			/* if we use the strict mode, we get the date of the last
+			  operation */
+			$last_date =3D $this->get_last_date();
+			if ($last_date !=3D null && cmpDate($e_date, $last_date) < 0)
+				throw new Exception(_('Vous utilisez le mode strict la derni=C3=A8re=
 operation est la date du ')
+						. $last_date . ' ' . _('vous ne pouvez pas encoder =C3=A0 une date=
 ant=C3=A9rieure'), 15);
+		}
=20
-        for ($i=3D0;$i<$nb_item;$i++)
-        {
-            $err=3D0;
+		for ($i =3D 0; $i < $nb_item; $i++)
+		{
+			$err =3D 0;
=20
-            // Check the balance
-            if ( ! isset (${'amount'.$i}))
-                continue;
+			// Check the balance
+			if (!isset(${'amount' . $i}))
+				continue;
=20
-            $amount=3Dround(${'amount'.$i},2);
-            $tot_deb+=3D(isset(${'ck'.$i}))?$amount:0;
-            $tot_cred+=3D(! isset(${'ck'.$i}))?$amount:0;
+			$amount =3D round(${'amount' . $i}, 2);
+			$tot_deb+=3D(isset(${'ck' . $i})) ? $amount : 0;
+			$tot_cred+=3D(!isset(${'ck' . $i})) ? $amount : 0;
=20
-            // Check if the card is permitted
-            if ( isset (${'qc_'.$i}) && trim(${'qc_'.$i}) !=3D"")
-            {
-                $f=3Dnew Fiche($this->db);
-                $f->quick_code=3D${'qc_'.$i};
-                if ( $f->belong_ledger($p_jrn) < 0 )
-                    throw new Exception("La fiche quick_code =3D ".
-                                        $f->quick_code." n\'est pas dans=
 ce journal",4);
-                if ( strlen(trim(${'qc_'.$i}))!=3D0 &&  isNumber(${'amou=
nt'.$i} ) =3D=3D 0 )
-                    throw new Exception('Montant invalide',3);
+			// Check if the card is permitted
+			if (isset(${'qc_' . $i}) && trim(${'qc_' . $i}) !=3D "")
+			{
+				$f =3D new Fiche($this->db);
+				$f->quick_code =3D ${'qc_' . $i};
+				if ($f->belong_ledger($p_jrn) < 0)
+					throw new Exception("La fiche quick_code =3D " .
+							$f->quick_code . " n\'est pas dans ce journal", 4);
+				if (strlen(trim(${'qc_' . $i})) !=3D 0 && isNumber(${'amount' . $i})=
 =3D=3D 0)
+					throw new Exception('Montant invalide', 3);
=20
-		$strPoste=3D$f->strAttribut(ATTR_DEF_ACCOUNT);
-		if ($strPoste=3D=3D'') throw new Exception(sprintf(_("La fiche %s n'a =
pas de poste comptable"),${"qc_".$i}));
+				$strPoste =3D $f->strAttribut(ATTR_DEF_ACCOUNT);
+				if ($strPoste =3D=3D '')
+					throw new Exception(sprintf(_("La fiche %s n'a pas de poste comptab=
le"), ${"qc_" . $i}));
=20
-		$p=3Dnew Acc_Account_Ledger($this->db,$strPoste);
-		if ($p->do_exist() =3D=3D 0 )
-		  throw new Exception(_('Poste Inexistant pour la fiche ['.${'qc_'.$i}=
.']'),4);
-            }
+				$p =3D new Acc_Account_Ledger($this->db, $strPoste);
+				if ($p->do_exist() =3D=3D 0)
+					throw new Exception(_('Poste Inexistant pour la fiche [' . ${'qc_' =
. $i} . ']'), 4);
+			}
=20
-            // Check if the account is permitted
-            if ( isset (${'poste'.$i}) && strlen (trim(${'poste'.$i})) !=
=3D 0 )
-            {
-                $p=3Dnew Acc_Account_Ledger($this->db,${'poste'.$i});
-                if ( $p->belong_ledger ($p_jrn) < 0 )
-                    throw new Exception(_("Le poste")." ".$p->id." "._("=
n'est pas dans ce journal"),5);
-                if ( strlen(trim(${'poste'.$i}))!=3D0 &&  isNumber(${'am=
ount'.$i} ) =3D=3D 0 )
-                    throw new Exception(_('Poste invalide ['.${'poste'.$=
i}.']'),3);
-                if ( $p->do_exist() =3D=3D 0 )
-                    throw new Exception(_('Poste Inexistant ['.${'poste'=
.$i}.']'),4);
-				$card_id=3D$p->find_card() ;
-				if (! empty($card_id) )
+			// Check if the account is permitted
+			if (isset(${'poste' . $i}) && strlen(trim(${'poste' . $i})) !=3D 0)
+			{
+				$p =3D new Acc_Account_Ledger($this->db, ${'poste' . $i});
+				if ($p->belong_ledger($p_jrn) < 0)
+					throw new Exception(_("Le poste") . " " . $p->id . " " . _("n'est p=
as dans ce journal"), 5);
+				if (strlen(trim(${'poste' . $i})) !=3D 0 && isNumber(${'amount' . $i=
}) =3D=3D 0)
+					throw new Exception(_('Poste invalide [' . ${'poste' . $i} . ']'), =
3);
+				if ($p->do_exist() =3D=3D 0)
+					throw new Exception(_('Poste Inexistant [' . ${'poste' . $i} . ']')=
, 4);
+				$card_id =3D $p->find_card();
+				if (!empty($card_id))
 				{
-					$str_msg=3D" Le poste ".$p->id." appartient =C3=A0 ".count($card_id=
)." fiche(s) dont :";
-					$max=3D(count($card_id)>MAX_COMPTE_CARD)?MAX_COMPTE_CARD:count($car=
d_id);
-					for ($x=3D0;$x < $max;$x++)
+					$str_msg =3D " Le poste " . $p->id . " appartient =C3=A0 " . count(=
$card_id) . " fiche(s) dont :";
+					$max =3D (count($card_id) > MAX_COMPTE_CARD) ? MAX_COMPTE_CARD : co=
unt($card_id);
+					for ($x =3D 0; $x < $max; $x++)
 					{
-						$card=3Dnew Fiche($this->db,$card_id[$x]['f_id']);
-						$str_msg.=3DHtmlInput::card_detail($card->strAttribut(ATTR_DEF_QUI=
CKCODE),$card->strAttribut(ATTR_DEF_NAME),'style=3D"color:red;display:inl=
ine;text-decoration:underline"');
+						$card =3D new Fiche($this->db, $card_id[$x]['f_id']);
+						$str_msg.=3DHtmlInput::card_detail($card->strAttribut(ATTR_DEF_QUI=
CKCODE), $card->strAttribut(ATTR_DEF_NAME), 'style=3D"color:red;display:i=
nline;text-decoration:underline"');
 						$str_msg.=3D" ";
 					}
-					$msg[]=3D$str_msg;
+					$msg[] =3D $str_msg;
 				}
-            }
+			}
+		}
+		$tot_deb =3D round($tot_deb, 4);
+		$tot_cred =3D round($tot_cred, 4);
+		if ($tot_deb !=3D $tot_cred)
+		{
+			throw new Exception(_("Balance incorrecte ") . " debit =3D $tot_deb c=
redit=3D$tot_cred ", 1);
+		}
=20
+		return $msg;
+	}
=20
-        }
-        $tot_deb=3Dround($tot_deb,4);
-        $tot_cred=3Dround($tot_cred,4);
-        if ( $tot_deb !=3D $tot_cred )
-        {
-            throw new Exception(_("Balance incorrecte ")." debit =3D $to=
t_deb credit=3D$tot_cred ",1);
-        }
+	/* !
+	 * \brief compute the internal code of the saved operation and set the =
$this->jr_internal to
+	 *  the computed value
+	 *
+	 * \param $p_grpt id in jr_grpt_
+	 *
+	 * \return string internal_code
+	 *      -
+	 *
+	 */
=20
-		return $msg;
-    }
-    /*!
-     * \brief compute the internal code of the saved operation and set t=
he $this->jr_internal to
-     *  the computed value
-     *
-     * \param $p_grpt id in jr_grpt_
-     *
-     * \return string internal_code
-     *      -
-     *
-     */
-    function compute_internal_code($p_grpt)
-    {
-        if ( $this->id=3D=3D0) return;
-        $num =3D$this->db->get_next_seq('s_internal');
-        $atype=3D$this->get_propertie();
-        $type=3Dsubstr($atype['jrn_def_code'],0,1);
-        $internal_code=3Dsprintf("%s%06X",$type,$num);
-        $this->jr_internal=3D$internal_code;
-        return $internal_code;
-    }
+	function compute_internal_code($p_grpt)
+	{
+		if ($this->id =3D=3D 0)
+			return;
+		$num =3D $this->db->get_next_seq('s_internal');
+		$atype =3D $this->get_propertie();
+		$type =3D substr($atype['jrn_def_code'], 0, 1);
+		$internal_code =3D sprintf("%s%06X", $type, $num);
+		$this->jr_internal =3D $internal_code;
+		return $internal_code;
+	}
=20
-    /*!
-     * \brief save the operation into the jrnx,jrn, ,
-     *  CA and pre_def
-     * \param $p_array
-     *
-     * \return array with [0] =3D false if failed otherwise true, [1] er=
ror
-     * code
-     */
-    function save ($p_array=3Dnull)
-    {
-      if ($p_array =3D=3D null) throw new Exception ('save cannot use a =
empty array');
-        global $g_parameter;
-        extract ($p_array);
-        try
-        {
-            $msg=3D$this->verify($p_array);
-			if ( ! empty ($msg))
+	/* !
+	 * \brief save the operation into the jrnx,jrn, ,
+	 *  CA and pre_def
+	 * \param $p_array
+	 *
+	 * \return array with [0] =3D false if failed otherwise true, [1] error
+	 * code
+	 */
+
+	function save($p_array =3D null)
+	{
+		if ($p_array =3D=3D null)
+			throw new Exception('save cannot use a empty array');
+		global $g_parameter;
+		extract($p_array);
+		try
+		{
+			$msg =3D $this->verify($p_array);
+			if (!empty($msg))
 			{
-				echo $this->display_warning($msg,"Attention : il vaut mieux utiliser=
 les fiches que les postes comptables pour");
+				echo $this->display_warning($msg, "Attention : il vaut mieux utilise=
r les fiches que les postes comptables pour");
 			}
-            $this->db->start() ;
+			$this->db->start();
=20
-            $seq=3D$this->db->get_next_seq('s_grpt');
-            $internal=3D$this->compute_internal_code($seq);
+			$seq =3D $this->db->get_next_seq('s_grpt');
+			$internal =3D $this->compute_internal_code($seq);
=20
-            $group=3D$this->db->get_next_seq("s_oa_group");
-            $tot_amount=3D0;
-            $tot_deb=3D0;
-            $tot_cred=3D0;
-            $oPeriode=3Dnew Periode($this->db);
-            $check_periode=3D$this->check_periode();
-            if ( $check_periode =3D=3D false)
-            {
-                $oPeriode->find_periode($e_date);
-            }
-            else
-            {
-                $oPeriode->id=3D$period;
-            }
+			$group =3D $this->db->get_next_seq("s_oa_group");
+			$tot_amount =3D 0;
+			$tot_deb =3D 0;
+			$tot_cred =3D 0;
+			$oPeriode =3D new Periode($this->db);
+			$check_periode =3D $this->check_periode();
+			if ($check_periode =3D=3D false)
+			{
+				$oPeriode->find_periode($e_date);
+			}
+			else
+			{
+				$oPeriode->id =3D $period;
+			}
=20
-            $count=3D0;
-            for ($i=3D0;$i<$nb_item;$i++)
-            {
-                if ( ! isset (${'qc_'.$i}) && ! isset(${'poste'.$i}))
-                    continue;
-                $acc_op=3Dnew Acc_Operation($this->db);
-                $quick_code=3D"";
-                // First we save the jrnx
-                if ( isset(${'qc_'.$i}))
-                {
-                    $qc=3Dnew Fiche($this->db);
-                    $qc->get_by_qcode(${'qc_'.$i},false);
-                    $sposte=3D$qc->strAttribut(ATTR_DEF_ACCOUNT);
-                    /*  if there are 2 accounts take following the deb o=
r cred */
-                    if (strpos($sposte,',') !=3D 0 )
-                    {
-                        $array=3Dexplode(",",$sposte);
-                        $poste=3D(isset(${'ck'.$i}))?$array[0]:$array[1]=
;
-                    }
-                    else
-                    {
-                        $poste=3D$sposte;
-			if ($poste=3D=3D'') throw new Exception(sprintf(_("La fiche %s n'a pa=
s de poste comptable"),${"qc_".$i}));
-                    }
-                    $quick_code=3D${'qc_'.$i};
-                }
-                else
-                {
-                    $poste=3D${'poste'.$i};
-                }
+			$count =3D 0;
+			for ($i =3D 0; $i < $nb_item; $i++)
+			{
+				if (!isset(${'qc_' . $i}) && !isset(${'poste' . $i}))
+					continue;
+				$acc_op =3D new Acc_Operation($this->db);
+				$quick_code =3D "";
+				// First we save the jrnx
+				if (isset(${'qc_' . $i}))
+				{
+					$qc =3D new Fiche($this->db);
+					$qc->get_by_qcode(${'qc_' . $i}, false);
+					$sposte =3D $qc->strAttribut(ATTR_DEF_ACCOUNT);
+					/*  if there are 2 accounts take following the deb or cred */
+					if (strpos($sposte, ',') !=3D 0)
+					{
+						$array =3D explode(",", $sposte);
+						$poste =3D (isset(${'ck' . $i})) ? $array[0] : $array[1];
+					}
+					else
+					{
+						$poste =3D $sposte;
+						if ($poste =3D=3D '')
+							throw new Exception(sprintf(_("La fiche %s n'a pas de poste compt=
able"), ${"qc_" . $i}));
+					}
+					$quick_code =3D ${'qc_' . $i};
+				}
+				else
+				{
+					$poste =3D ${'poste' . $i};
+				}
=20
-                $acc_op->date=3D$e_date;
-                // compute the periode is do not check it
-                if ($check_periode =3D=3D false ) $acc_op->periode=3D$oP=
eriode->p_id;
-                $acc_op->desc=3Dnull;
-                if ( strlen(trim(${'ld'.$i})) !=3D 0 )
-                    $acc_op->desc=3D${'ld'.$i};
-                $acc_op->amount=3Dround(${'amount'.$i},2);
-                $acc_op->grpt=3D$seq;
-                $acc_op->poste=3D$poste;
-                $acc_op->jrn=3D$this->id;
-                $acc_op->type=3D(isset (${'ck'.$i}))?'d':'c';
-                $acc_op->qcode=3D$quick_code;
-                $j_id=3D$acc_op->insert_jrnx();
-                $tot_amount+=3Dround($acc_op->amount,2);
-                $tot_deb+=3D($acc_op->type=3D=3D'd')?$acc_op->amount:0;
-                $tot_cred+=3D($acc_op->type=3D=3D'c')?$acc_op->amount:0;
-                if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
-                {
-                    if ( preg_match("/^[6,7]+/",$poste)=3D=3D1)
-                    {
+				$acc_op->date =3D $e_date;
+				// compute the periode is do not check it
+				if ($check_periode =3D=3D false)
+					$acc_op->periode =3D $oPeriode->p_id;
+				$acc_op->desc =3D null;
+				if (strlen(trim(${'ld' . $i})) !=3D 0)
+					$acc_op->desc =3D ${'ld' . $i};
+				$acc_op->amount =3D round(${'amount' . $i}, 2);
+				$acc_op->grpt =3D $seq;
+				$acc_op->poste =3D $poste;
+				$acc_op->jrn =3D $this->id;
+				$acc_op->type =3D (isset(${'ck' . $i})) ? 'd' : 'c';
+				$acc_op->qcode =3D $quick_code;
+				$j_id =3D $acc_op->insert_jrnx();
+				$tot_amount+=3Dround($acc_op->amount, 2);
+				$tot_deb+=3D($acc_op->type =3D=3D 'd') ? $acc_op->amount : 0;
+				$tot_cred+=3D($acc_op->type =3D=3D 'c') ? $acc_op->amount : 0;
+				if ($g_parameter->MY_ANALYTIC !=3D "nu")
+				{
+					if (preg_match("/^[6,7]+/", $poste) =3D=3D 1)
+					{
=20
-                        // for each item, insert into operation_analytiq=
ue */
-                        $op=3Dnew Anc_Operation($this->db);
-                        $op->oa_group=3D$group;
-                        $op->j_id=3D$j_id;
-                        $op->oa_date=3D$e_date;
-                        $op->oa_debit=3D($acc_op->type=3D=3D'd' )?'t':'f=
';
-                        $op->oa_description=3D$desc;
-                        $op->save_form_plan($p_array,$count,$j_id);
-                        $count++;
-                    }
-                }
-            }// loop for each item
-            $acc_end=3Dnew Acc_Operation($this->db);
-            $acc_end->amount=3D$tot_deb;
-            if ($check_periode =3D=3D false ) $acc_end->periode=3D$oPeri=
ode->p_id;
-            $acc_end->date=3D$e_date;
-            $acc_end->desc=3D$desc;
-            $acc_end->grpt=3D$seq;
-            $acc_end->jrn=3D$this->id;
-            $acc_end->mt=3D$mt;
-            $jr_id=3D $acc_end->insert_jrn();
-            $this->jr_id=3D$jr_id;
-            if ($jr_id =3D=3D false )
-                throw new Exception('Balance incorrecte');
-            $acc_end->pj=3D$e_pj;
+						// for each item, insert into operation_analytique */
+						$op =3D new Anc_Operation($this->db);
+						$op->oa_group =3D $group;
+						$op->j_id =3D $j_id;
+						$op->oa_date =3D $e_date;
+						$op->oa_debit =3D ($acc_op->type =3D=3D 'd' ) ? 't' : 'f';
+						$op->oa_description =3D $desc;
+						$op->save_form_plan($p_array, $count, $j_id);
+						$count++;
+					}
+				}
+			}// loop for each item
+			$acc_end =3D new Acc_Operation($this->db);
+			$acc_end->amount =3D $tot_deb;
+			if ($check_periode =3D=3D false)
+				$acc_end->periode =3D $oPeriode->p_id;
+			$acc_end->date =3D $e_date;
+			$acc_end->desc =3D $desc;
+			$acc_end->grpt =3D $seq;
+			$acc_end->jrn =3D $this->id;
+			$acc_end->mt =3D $mt;
+			$jr_id =3D $acc_end->insert_jrn();
+			$this->jr_id =3D $jr_id;
+			if ($jr_id =3D=3D false)
+				throw new Exception('Balance incorrecte');
+			$acc_end->pj =3D $e_pj;
=20
-            /* if e_suggest !=3D e_pj then do not increment sequence */
-            if ( strcmp($e_pj,$e_pj_suggest) =3D=3D 0 && strlen(trim($e_=
pj)) !=3D0)
-            {
-                $this->inc_seq_pj();
-            }
+			/* if e_suggest !=3D e_pj then do not increment sequence */
+			if (strcmp($e_pj, $e_pj_suggest) =3D=3D 0 && strlen(trim($e_pj)) !=3D=
 0)
+			{
+				$this->inc_seq_pj();
+			}
=20
-            $this->pj=3D$acc_end->set_pj();
+			$this->pj =3D $acc_end->set_pj();
=20
-            $this->db->exec_sql("update jrn set jr_internal=3D'".$intern=
al."' where ".
-                                " jr_grpt_id =3D ".$seq);
-            $this->internal=3D$internal;
-            // Save now the predef op
-            //------------------------
-            if ( isset($opd_save))
-            {
-                $opd=3Dnew Pre_Op_Advanced($this->db);
-                $opd->get_post();
-                $opd->save();
-            }
+			$this->db->exec_sql("update jrn set jr_internal=3D'" . $internal . "'=
 where " .
+					" jr_grpt_id =3D " . $seq);
+			$this->internal =3D $internal;
+			// Save now the predef op
+			//------------------------
+			if (isset($opd_save))
+			{
+				$opd =3D new Pre_Op_Advanced($this->db);
+				$opd->get_post();
+				$opd->save();
+			}
=20
-            if ( isset($this->with_concerned) && $this->with_concerned=3D=
=3Dtrue)
-            {
-                $orap=3Dnew acc_reconciliation($this->db);
-                $orap->jr_id=3D$jr_id;
+			if (isset($this->with_concerned) && $this->with_concerned =3D=3D true=
)
+			{
+				$orap =3D new acc_reconciliation($this->db);
+				$orap->jr_id =3D $jr_id;
=20
-                $orap->insert($jrn_concerned);
-            }
+				$orap->insert($jrn_concerned);
+			}
+		}
+		catch (Exception $a)
+		{
+			throw $a;
+		}
+		catch (Exception $e)
+		{
+			$this->db->rollback();
+			echo 'OPERATION ANNULEE ';
+			echo '<hr>';
+			echo __FILE__ . __LINE__ . $e->getMessage();
+			exit();
+		}
+		$this->db->commit();
+		return true;
+	}
=20
-        }
+	/* !
+	 * \brief get all the data from request and build the object
+	 */
=20
-        catch (Exception $a)
-        {
-            throw $a;
-        }
-        catch (Exception $e)
-        {
-            $this->db->rollback();
-            echo 'OPERATION ANNULEE ';
-            echo '<hr>';
-            echo __FILE__.__LINE__.$e->getMessage();
-            exit();
-        }
-        $this->db->commit();
-        return true;
-    }
+	function get_request()
+	{
+		$this->id =3D $_REQUEST['p_jrn'];
+	}
=20
-    /*!
-     * \brief get all the data from request and build the object
-     */
-    function get_request()
-    {
-        $this->id=3D$_REQUEST['p_jrn'];
+	/* !
+	 * \brief retrieve the next number for this type of ledger
+	 * \param p_cn connx
+	 * \param p_type ledger type
+	 *
+	 * \return the number
+	 *
+	 *
+	 */
=20
-    }
+	static function next_number($p_cn, $p_type)
+	{
=20
-    /*!
-     * \brief retrieve the next number for this type of ledger
-     * \param p_cn connx
-     * \param p_type ledger type
-     *
-     * \return the number
-     *
-     *
-     */
-    static function next_number($p_cn,$p_type)
-    {
+		$Ret =3D $p_cn->count_sql("select * from jrn_def where jrn_def_type=3D=
'" . $p_type . "'");
+		return $Ret + 1;
+	}
=20
-        $Ret=3D$p_cn->count_sql("select * from jrn_def where jrn_def_typ=
e=3D'".$p_type."'");
-        return $Ret+1;
-    }
-    /*!\brief get the first ledger
-     *\param the type
-     *\return the j_id
-     */
-    public function get_first($p_type,$p_access=3D3)
-    {
-        global $g_user;
-        $all=3D$g_user->get_ledger($p_type,$p_access);
-        return $all[0];
-    }
+	/* !\brief get the first ledger
+	 * \param the type
+	 * \return the j_id
+	 */
=20
+	public function get_first($p_type, $p_access =3D 3)
+	{
+		global $g_user;
+		$all =3D $g_user->get_ledger($p_type, $p_access);
+		return $all[0];
+	}
=20
-    /*!\brief Update the paiment  in the list of operation
-     *\param $p_array is normally $_GET
-     */
-    function update_paid($p_array)
-    {
-        // reset all the paid flag because the checkbox is post only
-        // when checked
-        foreach ($p_array as $name=3D>$paid)
-        {
-            list($ad) =3D sscanf($name,"set_jr_id%d");
-            if ( $ad =3D=3D null ) continue;
-            $sql=3D"update jrn set jr_rapt=3D'' where jr_id=3D$ad";
-            $Res=3D$this->db->exec_sql($sql);
+	/* !\brief Update the paiment  in the list of operation
+	 * \param $p_array is normally $_GET
+	 */
=20
-        }
-        // set a paid flag for the checked box
-        foreach ($p_array as $name=3D>$paid)
-        {
-            list ($id) =3D sscanf ($name,"rd_paid%d");
-            if ( $id =3D=3D null ) continue;
+	function update_paid($p_array)
+	{
+		// reset all the paid flag because the checkbox is post only
+		// when checked
+		foreach ($p_array as $name =3D> $paid)
+		{
+			list($ad) =3D sscanf($name, "set_jr_id%d");
+			if ($ad =3D=3D null)
+				continue;
+			$sql =3D "update jrn set jr_rapt=3D'' where jr_id=3D$ad";
+			$Res =3D $this->db->exec_sql($sql);
+		}
+		// set a paid flag for the checked box
+		foreach ($p_array as $name =3D> $paid)
+		{
+			list ($id) =3D sscanf($name, "rd_paid%d");
+			if ($id =3D=3D null)
+				continue;
=20
-            $sql=3D"update jrn set jr_rapt=3D'paid' where jr_id=3D$id";
-            $Res=3D$this->db->exec_sql($sql);
-        }
+			$sql =3D "update jrn set jr_rapt=3D'paid' where jr_id=3D$id";
+			$Res =3D $this->db->exec_sql($sql);
+		}
+	}
=20
-    }
-    function update_internal_code($p_internal)
-    {
-        if ( ! isset($this->grpt_id) )
-            exit( 'ERREUR '.__FILE__.":".__LINE__);
-        $Res=3D$this->db->exec_sql("update jrn set jr_internal=3D'".$p_i=
nternal."' where ".
-                                 " jr_grpt_id =3D ".$this->grpt_id);
+	function update_internal_code($p_internal)
+	{
+		if (!isset($this->grpt_id))
+			exit('ERREUR ' . __FILE__ . ":" . __LINE__);
+		$Res =3D $this->db->exec_sql("update jrn set jr_internal=3D'" . $p_int=
ernal . "' where " .
+				" jr_grpt_id =3D " . $this->grpt_id);
+	}
=20
-    }
-    /*!\brief retrieve all the card for this type of ledger, make them
-     *into a string separated by comma
-     *\param none
-     *\return all the card or null is nothing is found
-     */
-    function get_all_fiche_def()
-    {
-        $sql=3D"select jrn_def_fiche_deb as deb,jrn_def_fiche_cred as cr=
ed ".
-             " from jrn_def where ".
-             " jrn_def_id =3D $1 ";
+	/* !\brief retrieve all the card for this type of ledger, make them
+	 * into a string separated by comma
+	 * \param none
+	 * \return all the card or null is nothing is found
+	 */
=20
-        $r=3D$this->db->exec_sql($sql,array($this->id));
+	function get_all_fiche_def()
+	{
+		$sql =3D "select jrn_def_fiche_deb as deb,jrn_def_fiche_cred as cred "=
 .
+				" from jrn_def where " .
+				" jrn_def_id =3D $1 ";
=20
-        $res=3DDatabase::fetch_all($r);
-        if ( empty($res) ) return null;
-        $card=3D"";
-        $comma=3D'';
-        foreach ($res as $item )
-        {
-            if ( strlen(trim($item['deb'])) !=3D 0 )
-            {
-                $card.=3D$comma.$item['deb'];
-                $comma=3D',';
-            }
-            if ( strlen(trim($item['cred'])) !=3D '')
-            {
-                $card.=3D$comma.$item['cred'];
-                $comma=3D',';
-            }
+		$r =3D $this->db->exec_sql($sql, array($this->id));
=20
-        }
+		$res =3D Database::fetch_all($r);
+		if (empty($res))
+			return null;
+		$card =3D "";
+		$comma =3D '';
+		foreach ($res as $item)
+		{
+			if (strlen(trim($item['deb'])) !=3D 0)
+			{
+				$card.=3D$comma . $item['deb'];
+				$comma =3D ',';
+			}
+			if (strlen(trim($item['cred'])) !=3D '')
+			{
+				$card.=3D$comma . $item['cred'];
+				$comma =3D ',';
+			}
+		}
=20
-        return $card;
-    }
-    /*!\brief get the saldo of an exercice, used for the opening of a fo=
lder
-     *\param $p_exercice is the exercice we want
-     *\return an array
-     * index =3D
-     * - solde (debit > 0 ; credit < 0)
-     * - j_poste
-     * - j_qcode
-     */
-    function get_saldo_exercice($p_exercice)
-    {
-        $sql=3D"select sum(a.montant) as solde, j_poste, j_qcode
+		return $card;
+	}
+
+	/* !\brief get the saldo of an exercice, used for the opening of a fold=
er
+	 * \param $p_exercice is the exercice we want
+	 * \return an array
+	 * index =3D
+	 * - solde (debit > 0 ; credit < 0)
+	 * - j_poste
+	 * - j_qcode
+	 */
+
+	function get_saldo_exercice($p_exercice)
+	{
+		$sql =3D "select sum(a.montant) as solde, j_poste, j_qcode
              from
              (select j_id, case when j_debit=3D't' then j_montant
              else j_montant * (-1) end  as montant
@@ -2187,262 +2225,281 @@
              and j_poste::text not like '6%'
              group by j_poste,j_qcode
              having (sum(a.montant) !=3D 0 )";
-        $res=3D$this->db->get_array($sql,array($p_exercice));
-        return $res;
-    }
-    /*!
-     *\brief Check if a Dossier is using the strict mode or not
-     * \return true if we are using the strict_mode
-     */
-    function check_strict()
-    {
-        global $g_parameter;
-        if ( $g_parameter->MY_STRICT=3D=3D'Y') return true;
-        if ( $g_parameter->MY_STRICT=3D=3D'N') return false;
-        exit("Valeur invalid ".__FILE__.':'.__LINE__);
-    }
-    /*!
-     *\brief Check if a Dossier is using the check on the periode, if tr=
ue than the user has to enter the date
-     * and the periode, it is a security check
-     * \return true if we are using the double encoding (date+periode)
-     */
-    function check_periode()
-    {
-        global $g_parameter;
-        if ( $g_parameter->MY_CHECK_PERIODE=3D=3D'Y') return true;
-        if ( $g_parameter->MY_CHECK_PERIODE=3D=3D'N') return false;
-        exit("Valeur invalid ".__FILE__.':'.__LINE__);
-    }
+		$res =3D $this->db->get_array($sql, array($p_exercice));
+		return $res;
+	}
=20
-    /*!\brief get the date of the last operation
-    */
-    function get_last_date()
-    {
-        if ( $this->id=3D=3D0) throw new Exception (__FILE__.":".__LINE_=
_."Journal incorrect ");
-        $sql=3D"select to_char(max(jr_date),'DD.MM.YYYY') from jrn where=
 jr_def_id=3D$1";
-        $date=3D$this->db->get_value($sql,array($this->id));
-        return $date;
-    }
-    /*!\brief retrieve the jr_id thanks the internal code, do not change
-     *anything to the current object
-     *\param the internal code
-     *\return the jr_id or 0 if not found
-     */
-    function get_id($p_internal)
-    {
-        $sql=3D'select jr_id from jrn where jr_internal=3D$1';
-        $value=3D$this->db->get_value($sql,array($p_internal));
-        if ($value=3D=3D'') $value=3D0;
-        return $value;
-    }
-    /*!\brief create the invoice and saved it as attachment to the
-     *operation,
-     *\param $internal is the internal code
-     *\param $p_array is normally the $_POST
-     *\return a string
-     */
-    function create_document($internal,$p_array)
-    {
-        extract ($p_array);
-        $doc=3Dnew Document($this->db);
-        $doc->f_id=3D$e_client;
-        $doc->md_id=3D$gen_doc;
-        $doc->ag_id=3D0;
-        $doc->Generate($p_array);
-        // Move the document to the jrn
-        $doc->MoveDocumentPj($internal);
-        // Update the comment with invoice number, if the comment is emp=
ty
-        if ( ! isset ($e_comm) || strlen(trim($e_comm))=3D=3D 0 )
-        {
-            $sql=3D"update jrn set jr_comment=3D' document ".$doc->d_num=
ber."' where jr_internal=3D'$internal'";
-            $this->db->exec_sql($sql);
-        }
-        return h($doc->d_name.' ('.$doc->d_filename.')');
+	/* !
+	 * \brief Check if a Dossier is using the strict mode or not
+	 * \return true if we are using the strict_mode
+	 */
=20
-    }
-    /*!\brief check if the payment method is valid
-     *\param $e_mp is the value and $e_mp_qcode is the quickcode
-     *\return nothing throw an Exception
-     */
-    public function check_payment($e_mp,$e_mp_qcode)
-    {
-        /*   Check if the "paid by" is empty, */
-        if (  $e_mp !=3D 0)
-        {
-            /* the paid by is not empty then check if valid */
-            $empl=3Dnew Fiche($this->db);
-            $empl->get_by_qcode($e_mp_qcode);
-            if ( $empl->empty_attribute(ATTR_DEF_ACCOUNT)=3D=3D true)
-            {
-                throw new Exception('Celui qui paie n\' a pas de poste c=
omptable',20);
-            }
-            /* get the account and explode if necessary */
-            $sposte=3D$empl->strAttribut(ATTR_DEF_ACCOUNT);
-            // if 2 accounts, take only the debit one for customer
-            if ( strpos($sposte,',') !=3D 0 )
-            {
-                $array=3Dexplode(',',$sposte);
-                $poste_val=3D$array[0];
-            }
-            else
-            {
-                $poste_val=3D$sposte;
-            }
-            $poste=3Dnew Acc_Account_Ledger($this->db,$poste_val);
-            if ( $poste->load() =3D=3D false )
-            {
-                throw new Exception('Pour la fiche'.$empl->quick_code.' =
 le poste comptable ['.$poste->id.'n\'existe pas',9);
+	function check_strict()
+	{
+		global $g_parameter;
+		if ($g_parameter->MY_STRICT =3D=3D 'Y')
+			return true;
+		if ($g_parameter->MY_STRICT =3D=3D 'N')
+			return false;
+		exit("Valeur invalid " . __FILE__ . ':' . __LINE__);
+	}
=20
-            }
-        }
-    }
+	/* !
+	 * \brief Check if a Dossier is using the check on the periode, if true=
 than the user has to enter the date
+	 * and the periode, it is a security check
+	 * \return true if we are using the double encoding (date+periode)
+	 */
=20
+	function check_periode()
+	{
+		global $g_parameter;
+		if ($g_parameter->MY_CHECK_PERIODE =3D=3D 'Y')
+			return true;
+		if ($g_parameter->MY_CHECK_PERIODE =3D=3D 'N')
+			return false;
+		exit("Valeur invalid " . __FILE__ . ':' . __LINE__);
+	}
=20
-    /*!\brief increment the sequence for the pj */
-    function inc_seq_pj()
-    {
-        $sql=3D"select nextval('s_jrn_pj".$this->id."')";
-        $this->db->exec_sql($sql);
-    }
-    /*!@brief return a HTML string with the form for the search
-     *@param $p_type if the type of ledger possible values=3DALL,VEN,ACH=
,ODS,FIN
-     *@param $all_type_ledger
-     *       values :
-     *         - 1 means all the ledger of this type
-     *         - 0 No have the "Tous les journaux" availables
-	 *@param $div is the div (for reconciliation)
-     *@return a HTML String without the tag FORM or DIV
+	/* !\brief get the date of the last operation
+	 */
+
+	function get_last_date()
+	{
+		if ($this->id =3D=3D 0)
+			throw new Exception(__FILE__ . ":" . __LINE__ . "Journal incorrect ")=
;
+		$sql =3D "select to_char(max(jr_date),'DD.MM.YYYY') from jrn where jr_=
def_id=3D$1";
+		$date =3D $this->db->get_value($sql, array($this->id));
+		return $date;
+	}
+
+	/* !\brief retrieve the jr_id thanks the internal code, do not change
+	 * anything to the current object
+	 * \param the internal code
+	 * \return the jr_id or 0 if not found
+	 */
+
+	function get_id($p_internal)
+	{
+		$sql =3D 'select jr_id from jrn where jr_internal=3D$1';
+		$value =3D $this->db->get_value($sql, array($p_internal));
+		if ($value =3D=3D '')
+			$value =3D 0;
+		return $value;
+	}
+
+	/* !\brief create the invoice and saved it as attachment to the
+	 * operation,
+	 * \param $internal is the internal code
+	 * \param $p_array is normally the $_POST
+	 * \return a string
+	 */
+
+	function create_document($internal, $p_array)
+	{
+		extract($p_array);
+		$doc =3D new Document($this->db);
+		$doc->f_id =3D $e_client;
+		$doc->md_id =3D $gen_doc;
+		$doc->ag_id =3D 0;
+		$doc->Generate($p_array);
+		// Move the document to the jrn
+		$doc->MoveDocumentPj($internal);
+		// Update the comment with invoice number, if the comment is empty
+		if (!isset($e_comm) || strlen(trim($e_comm)) =3D=3D 0)
+		{
+			$sql =3D "update jrn set jr_comment=3D' document " . $doc->d_number .=
 "' where jr_internal=3D'$internal'";
+			$this->db->exec_sql($sql);
+		}
+		return h($doc->d_name . ' (' . $doc->d_filename . ')');
+	}
+
+	/* !\brief check if the payment method is valid
+	 * \param $e_mp is the value and $e_mp_qcode is the quickcode
+	 * \return nothing throw an Exception
+	 */
+
+	public function check_payment($e_mp, $e_mp_qcode)
+	{
+		/*   Check if the "paid by" is empty, */
+		if ($e_mp !=3D 0)
+		{
+			/* the paid by is not empty then check if valid */
+			$empl =3D new Fiche($this->db);
+			$empl->get_by_qcode($e_mp_qcode);
+			if ($empl->empty_attribute(ATTR_DEF_ACCOUNT) =3D=3D true)
+			{
+				throw new Exception('Celui qui paie n\' a pas de poste comptable', 2=
0);
+			}
+			/* get the account and explode if necessary */
+			$sposte =3D $empl->strAttribut(ATTR_DEF_ACCOUNT);
+			// if 2 accounts, take only the debit one for customer
+			if (strpos($sposte, ',') !=3D 0)
+			{
+				$array =3D explode(',', $sposte);
+				$poste_val =3D $array[0];
+			}
+			else
+			{
+				$poste_val =3D $sposte;
+			}
+			$poste =3D new Acc_Account_Ledger($this->db, $poste_val);
+			if ($poste->load() =3D=3D false)
+			{
+				throw new Exception('Pour la fiche' . $empl->quick_code . '  le post=
e comptable [' . $poste->id . 'n\'existe pas', 9);
+			}
+		}
+	}
+
+	/* !\brief increment the sequence for the pj */
+
+	function inc_seq_pj()
+	{
+		$sql =3D "select nextval('s_jrn_pj" . $this->id . "')";
+		$this->db->exec_sql($sql);
+	}
+
+	/* !@brief return a HTML string with the form for the search
+	 * @param $p_type if the type of ledger possible values=3DALL,VEN,ACH,O=
DS,FIN
+	 * @param $all_type_ledger
+	 *       values :
+	 *         - 1 means all the ledger of this type
+	 *         - 0 No have the "Tous les journaux" availables
+	 * @param $div is the div (for reconciliation)
+	 * @return a HTML String without the tag FORM or DIV
 	 *
-     *@see build_search_sql
-     *@see display_search_form
-     *@see list_operation
-     */
-    function  search_form($p_type,$all_type_ledger=3D1,$div=3D"")
-    {
-        global $g_user;
-        $r=3D'';
-        /* security : filter ledger on user */
-        $filter_ledger=3D$g_user->get_ledger($p_type,3);
+	 * @see build_search_sql
+	 * @see display_search_form
+	 * @see list_operation
+	 */
=20
-        $selected=3D(isset($_REQUEST['r_jrn'.$div]))?$_REQUEST['r_jrn'.$=
div]:null;
-        $f_ledger=3DHtmlInput::select_ledger($filter_ledger,$selected,$d=
iv);
+	function search_form($p_type, $all_type_ledger =3D 1, $div =3D "")
+	{
+		global $g_user;
+		$r =3D '';
+		/* security : filter ledger on user */
+		$filter_ledger =3D $g_user->get_ledger($p_type, 3);
=20
-        /* widget for date_start */
-        $f_date_start=3Dnew IDate('date_start');
-        /* all periode or only the selected one */
-        if ( isset($_REQUEST['date_start']))
-        {
-            $f_date_start->value=3D$_REQUEST['date_start'];
-        }
-        else
-        {
-            $period=3D$g_user->get_periode();
-            $per=3Dnew Periode($this->db,$period);
-            $exercice=3D$per->get_exercice();
-            list($per_start,$per_end)=3D$per->get_limit($exercice);
-            $f_date_start->value=3D$per_start->first_day();
-            $date_end=3D$per_end->last_day();
-        }
+		$selected =3D (isset($_REQUEST['r_jrn' . $div])) ? $_REQUEST['r_jrn' .=
 $div] : null;
+		$f_ledger =3D HtmlInput::select_ledger($filter_ledger, $selected, $div=
);
=20
-        /* widget for date_end */
-        $f_date_end=3Dnew IDate('date_end');
-        /* all date or only the selected one */
-        if ( isset($_REQUEST['date_end']))
-        {
-            $f_date_end->value=3D$_REQUEST['date_end'];
-        }
-        else
-        {
-            $f_date_end->value=3D$date_end;
-        }
+		/* widget for date_start */
+		$f_date_start =3D new IDate('date_start');
+		/* all periode or only the selected one */
+		if (isset($_REQUEST['date_start']))
+		{
+			$f_date_start->value =3D $_REQUEST['date_start'];
+		}
+		else
+		{
+			$period =3D $g_user->get_periode();
+			$per =3D new Periode($this->db, $period);
+			$exercice =3D $per->get_exercice();
+			list($per_start, $per_end) =3D $per->get_limit($exercice);
+			$f_date_start->value =3D $per_start->first_day();
+			$date_end =3D $per_end->last_day();
+		}
=20
-        /* widget for desc */
-        $f_descript=3Dnew IText('desc');
-        $f_descript->size=3D40;
-        if ( isset($_REQUEST['desc']))
-        {
-            $f_descript->value=3D$_REQUEST['desc'];
-        }
+		/* widget for date_end */
+		$f_date_end =3D new IDate('date_end');
+		/* all date or only the selected one */
+		if (isset($_REQUEST['date_end']))
+		{
+			$f_date_end->value =3D $_REQUEST['date_end'];
+		}
+		else
+		{
+			$f_date_end->value =3D $date_end;
+		}
=20
-        /* widget for amount */
-        $f_amount_min=3Dnew INum('amount_min');
-        $f_amount_min->value=3D(isset($_REQUEST['amount_min']))?abs($_RE=
QUEST['amount_min']):0;
-        $f_amount_max=3Dnew INum('amount_max');
-        $f_amount_max->value=3D(isset($_REQUEST['amount_max']))?abs($_RE=
QUEST['amount_max']):0;
+		/* widget for desc */
+		$f_descript =3D new IText('desc');
+		$f_descript->size =3D 40;
+		if (isset($_REQUEST['desc']))
+		{
+			$f_descript->value =3D $_REQUEST['desc'];
+		}
=20
-        /* input quick code */
-        $f_qcode=3Dnew ICard('qcode'.$div);
+		/* widget for amount */
+		$f_amount_min =3D new INum('amount_min');
+		$f_amount_min->value =3D (isset($_REQUEST['amount_min'])) ? abs($_REQU=
EST['amount_min']) : 0;
+		$f_amount_max =3D new INum('amount_max');
+		$f_amount_max->value =3D (isset($_REQUEST['amount_max'])) ? abs($_REQU=
EST['amount_max']) : 0;
=20
-        $f_qcode->set_attribute('typecard','all');
-	/*        $f_qcode->set_attribute('p_jrn','0');
+		/* input quick code */
+		$f_qcode =3D new ICard('qcode' . $div);
=20
-        $f_qcode->set_callback('filter_card');
-	*/
-	$f_qcode->set_dblclick("fill_ipopcard(this);");
-	// Add the callback function to filter the card on the jrn
-	//$f_qcode->set_callback('filter_card');
-	$f_qcode->set_function('fill_data');
-	$f_qcode->javascript=3Dsprintf(' onchange=3D"fill_data_onchange(%s);" '=
,
-						$f_qcode->name);
-	$f_qcode->value=3D(isset($_REQUEST['qcode'.$div]))?$_REQUEST['qcode'.$d=
iv]:'';
+		$f_qcode->set_attribute('typecard', 'all');
+		/*        $f_qcode->set_attribute('p_jrn','0');
=20
-	/*        $f_txt_qcode=3Dnew IText('qcode');
-        $f_txt_qcode->value=3D(isset($_REQUEST['qcode']))?$_REQUEST['qco=
de']:'';
-	*/
+		  $f_qcode->set_callback('filter_card');
+		 */
+		$f_qcode->set_dblclick("fill_ipopcard(this);");
+		// Add the callback function to filter the card on the jrn
+		//$f_qcode->set_callback('filter_card');
+		$f_qcode->set_function('fill_data');
+		$f_qcode->javascript =3D sprintf(' onchange=3D"fill_data_onchange(%s);=
" ', $f_qcode->name);
+		$f_qcode->value =3D (isset($_REQUEST['qcode' . $div])) ? $_REQUEST['qc=
ode' . $div] : '';
=20
-        /* input poste comptable */
-        $f_accounting=3Dnew IPoste('accounting');
-        $f_accounting->value=3D(isset($_REQUEST['accounting']))?$_REQUES=
T['accounting']:'';
-        if ( $this->id=3D=3D-1) $jrn=3D0;
-        else $jrn=3D$this->id;
-        $f_accounting->set_attribute('jrn',$jrn);
-        $f_accounting->set_attribute('ipopup','ipop_account');
-        $f_accounting->set_attribute('label','ld');
-        $f_accounting->set_attribute('account','accounting');
-        $info=3DHtmlInput::infobulle(13);
+		/*        $f_txt_qcode=3Dnew IText('qcode');
+		  $f_txt_qcode->value=3D(isset($_REQUEST['qcode']))?$_REQUEST['qcode']=
:'';
+		 */
=20
-        $f_paid=3Dnew ICheckbox('unpaid');
-        $f_paid->selected=3D(isset($_REQUEST['unpaid']))?true:false;
+		/* input poste comptable */
+		$f_accounting =3D new IPoste('accounting');
+		$f_accounting->value =3D (isset($_REQUEST['accounting'])) ? $_REQUEST[=
'accounting'] : '';
+		if ($this->id =3D=3D -1)
+			$jrn =3D 0;
+		else
+			$jrn =3D $this->id;
+		$f_accounting->set_attribute('jrn', $jrn);
+		$f_accounting->set_attribute('ipopup', 'ipop_account');
+		$f_accounting->set_attribute('label', 'ld');
+		$f_accounting->set_attribute('account', 'accounting');
+		$info =3D HtmlInput::infobulle(13);
=20
-        $r.=3Ddossier::hidden();
-        $r.=3DHtmlInput::hidden('ledger_type',$this->type);
-        $r.=3DHtmlInput::hidden('ac',$_REQUEST['ac']);
-        ob_start();
-        require_once('template/ledger_search.php');
-        $r.=3Dob_get_contents();
-        ob_clean();
-        return $r;
+		$f_paid =3D new ICheckbox('unpaid');
+		$f_paid->selected =3D (isset($_REQUEST['unpaid'])) ? true : false;
=20
-    }
-    /*!\brief this function will create a sql stmt to use to create the =
list for
-     * the ledger,
-     *\param $p_array is usually the $_GET,
-     *\param $p_order the order of the row
-     *\param $p_where is the sql condition if not null then the $p_array=
 will not be used
-     *\note the p_action will be used to filter the ledger but gl means =
ALL
-     * struct array $p_array
-    \verbatim
-    (
-      [gDossier] =3D> 13
-      [p_jrn] =3D> -1
-      [date_start] =3D>
-      [date_end] =3D>
-      [amount_min] =3D> 0
-      [amount_max] =3D> 0
-      [desc] =3D>
-      [search] =3D> Rechercher
-      [p_action] =3D> ven
-      [sa] =3D> l
-    )
-    \endverbatim
-     *\return an array with a valid sql statement, an the where clause =3D=
> array[sql] array[where]
-     *\see list_operation
-     *\see display_search_form
-     *\see search_form
-     */
-    public function build_search_sql($p_array,$p_order=3D"",$p_where=3D"=
")
-    {
-        $sql=3D"select jr_id	,
+		$r.=3Ddossier::hidden();
+		$r.=3DHtmlInput::hidden('ledger_type', $this->type);
+		$r.=3DHtmlInput::hidden('ac', $_REQUEST['ac']);
+		ob_start();
+		require_once('template/ledger_search.php');
+		$r.=3Dob_get_contents();
+		ob_clean();
+		return $r;
+	}
+
+	/* !\brief this function will create a sql stmt to use to create the li=
st for
+	 * the ledger,
+	 * \param $p_array is usually the $_GET,
+	 * \param $p_order the order of the row
+	 * \param $p_where is the sql condition if not null then the $p_array w=
ill not be used
+	 * \note the p_action will be used to filter the ledger but gl means AL=
L
+	 * struct array $p_array
+	  \verbatim
+	  (
+	  [gDossier] =3D> 13
+	  [p_jrn] =3D> -1
+	  [date_start] =3D>
+	  [date_end] =3D>
+	  [amount_min] =3D> 0
+	  [amount_max] =3D> 0
+	  [desc] =3D>
+	  [search] =3D> Rechercher
+	  [p_action] =3D> ven
+	  [sa] =3D> l
+	  )
+	  \endverbatim
+	 * \return an array with a valid sql statement, an the where clause =3D=
> array[sql] array[where]
+	 * \see list_operation
+	 * \see display_search_form
+	 * \see search_form
+	 */
+
+	public function build_search_sql($p_array, $p_order =3D "", $p_where =3D=
 "")
+	{
+		$sql =3D "select jr_id	,
              jr_montant,
              substr(jr_comment,1,60) as jr_comment,
              to_char(jr_ech,'DD.MM.YYYY') as str_jr_ech,
@@ -2489,608 +2546,617 @@
              join jrn_def on jrn_def_id=3Djr_def_id
              join parm_periode on p_id=3Djr_tech_per";
=20
-        if ( ! empty($p_array))            extract($p_array);
+		if (!empty($p_array))
+			extract($p_array);
=20
-        $r_jrn=3D(isset($r_jrn))?$r_jrn:-1;
+		$r_jrn =3D (isset($r_jrn)) ? $r_jrn : -1;
=20
-        /* if no variable are set then give them a default
-         * value */
-        if ( $p_array =3D=3D null || empty($p_array) || ! isset($amount_=
min) )
-        {
-            $amount_min=3D0;
-            $amount_max=3D0;
+		/* if no variable are set then give them a default
+		 * value */
+		if ($p_array =3D=3D null || empty($p_array) || !isset($amount_min))
+		{
+			$amount_min =3D 0;
+			$amount_max =3D 0;
=20
-            $desc=3D'';
-            $qcode=3D(isset($qcode))?$qcode:"";
-			if ( isset($qcodesearch_op)) $qcode=3D$qcodesearch_op;
-            $accounting=3D(isset($accounting))?$accounting:"";
-			$periode=3Dnew Periode($this->db);
-			$g_user=3Dnew User($this->db);
-			$p_id=3D$g_user->get_periode();
-			if ( $p_id !=3D null )
+			$desc =3D '';
+			$qcode =3D (isset($qcode)) ? $qcode : "";
+			if (isset($qcodesearch_op))
+				$qcode =3D $qcodesearch_op;
+			$accounting =3D (isset($accounting)) ? $accounting : "";
+			$periode =3D new Periode($this->db);
+			$g_user =3D new User($this->db);
+			$p_id =3D $g_user->get_periode();
+			if ($p_id !=3D null)
 			{
-				list($date_start,$date_end)=3D$periode->get_date_limit($p_id);
+				list($date_start, $date_end) =3D $periode->get_date_limit($p_id);
 			}
-        }
+		}
=20
-        /* if p_jrn : 0 if means all ledgers, if -1 means all ledger of =
this
-         *  type otherwise only one ledger*/
-        $fil_ledger=3D'';
-        $fil_amount=3D'';
-        $fil_date=3D'';
-        $fil_desc=3D'';
-        $fil_sec=3D'';
-        $fil_qcode=3D'';
-        $fil_account=3D'';
-        $fil_paid=3D'';
+		/* if p_jrn : 0 if means all ledgers, if -1 means all ledger of this
+		 *  type otherwise only one ledger */
+		$fil_ledger =3D '';
+		$fil_amount =3D '';
+		$fil_date =3D '';
+		$fil_desc =3D '';
+		$fil_sec =3D '';
+		$fil_qcode =3D '';
+		$fil_account =3D '';
+		$fil_paid =3D '';
=20
-        $and=3D'';
-        $g_user=3Dnew User($this->db);
-	$p_action=3D$ledger_type;
-	if ( $p_action =3D=3D '') $p_action=3D'ALL';
-        if ( $r_jrn =3D=3D -1 )
-        {
+		$and =3D '';
+		$g_user =3D new User($this->db);
+		$p_action =3D $ledger_type;
+		if ($p_action =3D=3D '')
+			$p_action =3D 'ALL';
+		if ($r_jrn =3D=3D -1)
+		{
=20
-            /* from compta.php the p_action is quick_writing instead of =
ODS  */
-            if ( $p_action =3D=3D 'quick_writing') $p_action=3D'ODS';
+			/* from compta.php the p_action is quick_writing instead of ODS  */
+			if ($p_action =3D=3D 'quick_writing')
+				$p_action =3D 'ODS';
=20
=20
-            $fil_ledger=3D$g_user->get_ledger_sql($p_action,3);
-            $and=3D' and ';
-        }
-        else
-        {
+			$fil_ledger =3D $g_user->get_ledger_sql($p_action, 3);
+			$and =3D ' and ';
+		}
+		else
+		{
=20
-            if ( $p_action =3D=3D 'quick_writing') $p_action=3D'ODS';
+			if ($p_action =3D=3D 'quick_writing')
+				$p_action =3D 'ODS';
=20
-            $aLedger=3D$g_user->get_ledger($p_action,3);
-            $fil_ledger=3D'';
-            $sp=3D'';
-            for ($i=3D0;$i < count($aLedger) ;$i ++)
-            {
-                if ( isset($r_jrn[$i]))
-                {
-                    $fil_ledger.=3D$sp.$aLedger[$i]['jrn_def_id'];
-                    $sp=3D',';
-                }
+			$aLedger =3D $g_user->get_ledger($p_action, 3);
+			$fil_ledger =3D '';
+			$sp =3D '';
+			for ($i =3D 0; $i < count($aLedger); $i++)
+			{
+				if (isset($r_jrn[$i]))
+				{
+					$fil_ledger.=3D$sp . $aLedger[$i]['jrn_def_id'];
+					$sp =3D ',';
+				}
+			}
+			$fil_ledger =3D ' jrn_def_id in (' . $fil_ledger . ')';
+			$and =3D ' and ';
=20
-            }
-            $fil_ledger=3D' jrn_def_id in ('.$fil_ledger.')';
-            $and=3D' and ';
+			/* no ledger selected */
+			if ($sp =3D=3D '')
+			{
+				$fil_ledger =3D '';
+				$and =3D '';
+			}
+		}
=20
-            /* no ledger selected */
-            if ( $sp =3D=3D '' )
-            {
-                $fil_ledger=3D'';
-                $and=3D'';
-            }
-        }
+		/* format the number */
+		$amount_min =3D abs(toNumber($amount_min));
+		$amount_max =3D abs(toNumber($amount_max));
+		if ($amount_min > 0 && isNumber($amount_min))
+		{
+			$fil_amount =3D $and . ' jr_montant >=3D' . $amount_min;
+			$and =3D ' and ';
+		}
+		if ($amount_max > 0 && isNumber($amount_max))
+		{
+			$fil_amount.=3D$and . ' jr_montant <=3D' . $amount_max;
+			$and =3D ' and ';
+		}
+		/* -------------------------------------------------------------------=
------- *
+		 * if both amount are the same then we need to search into the detail
+		 * and we reset the fil_amount
+		 * -------------------------------------------------------------------=
------- */
+		if (isNumber($amount_min) &&
+				isNumber($amount_max) &&
+				$amount_min > 0 &&
+				bccomp($amount_min, $amount_max, 2) =3D=3D 0)
+		{
+			$fil_amount =3D $and . 'jr_grpt_id in  ( select distinct j_grpt from =
jrnx where j_montant =3D ' . $amount_min . ')';
+			$and =3D " and ";
+		}
+		// date
+		if (isset($date_start) && isDate($date_start) !=3D null)
+		{
+			$fil_date =3D $and . " jr_date >=3D to_date('" . $date_start . "','DD=
.MM.YYYY')";
+			$and =3D " and ";
+		}
+		if (isset($date_end) && isDate($date_end) !=3D null)
+		{
+			$fil_date.=3D$and . " jr_date <=3D to_date('" . $date_end . "','DD.MM=
.YYYY')";
+			$and =3D " and ";
+		}
+		// comment
+		if (isset($desc) && $desc !=3D null)
+		{
+			$desc =3D sql_string($desc);
+			$fil_desc =3D $and . " ( upper(jr_comment) like upper('%" . $desc . "=
%') or upper(jr_pj_number) like upper('%" . $desc . "%') " .
+					" or upper(jr_internal)  like upper('%" . $desc . "%')
+                          or jr_grpt_id in (select j_grpt from jrnx wher=
e j_text ~* '" . $desc . "'))";
+			$and =3D " and ";
+		}
+		//    Poste
+		if (isset($accounting) && $accounting !=3D null)
+		{
+			$fil_account =3D $and . "  jr_grpt_id in (select j_grpt
+                         from jrnx where j_poste::text like '" . sql_str=
ing($accounting) . "%' )  ";
+			$and =3D " and ";
+		}
+		// Quick Code
+		if (isset($qcodesearch_op))
+			$qcode =3D $qcodesearch_op;
+		if (isset($qcode) && $qcode !=3D null)
+		{
+			$fil_qcode =3D $and . "  jr_grpt_id in ( select j_grpt from
+                       jrnx where trim(j_qcode) =3D upper(trim('" . sql_=
string($qcode) . "')))";
+			$and =3D " and ";
+		}
=20
-        /* format the number */
-        $amount_min=3Dabs(toNumber($amount_min));
-        $amount_max=3Dabs(toNumber($amount_max));
-        if ( $amount_min > 0 && isNumber($amount_min) )
-        {
-            $fil_amount=3D$and.' jr_montant >=3D' .$amount_min;
-            $and=3D' and ';
-        }
-        if ( $amount_max > 0 && isNumber($amount_max)  )
-        {
-            $fil_amount.=3D$and.' jr_montant <=3D' .$amount_max;
-            $and=3D' and ';
-        }
-        /* -------------------------------------------------------------=
------------- *
-         * if both amount are the same then we need to search into the d=
etail
-         * and we reset the fil_amount
-         * -------------------------------------------------------------=
------------- */
-        if ( isNumber($amount_min) &&
-                isNumber($amount_max) &&
-                $amount_min > 0 &&
-                bccomp($amount_min, $amount_max,2)=3D=3D0 )
-        {
-            $fil_amount=3D $and. 'jr_grpt_id in  ( select distinct j_grp=
t from jrnx where j_montant =3D '.$amount_min.')';
-            $and=3D" and ";
-        }
-        // date
-        if (isset ($date_start) && isDate($date_start) !=3D null )
-        {
-            $fil_date=3D$and." jr_date >=3D to_date('".$date_start."','D=
D.MM.YYYY')";
-            $and=3D" and ";
-        }
-        if (isset ($date_end) &&  isDate($date_end) !=3D null )
-        {
-            $fil_date.=3D$and." jr_date <=3D to_date('".$date_end."','DD=
.MM.YYYY')";
-            $and=3D" and ";
-        }
-        // comment
-        if (isset ($desc) &&  $desc !=3D null )
-        {
-			$desc=3Dsql_string($desc);
-            $fil_desc=3D$and." ( upper(jr_comment) like upper('%".$desc.=
"%') or upper(jr_pj_number) like upper('%".$desc."%') ".
-                      " or upper(jr_internal)  like upper('%".$desc."%')
-                          or jr_grpt_id in (select j_grpt from jrnx wher=
e j_text ~* '".$desc."'))";
-            $and=3D" and ";
-        }
-        //    Poste
-        if ( isset ($accounting) && $accounting !=3D null )
-        {
-            $fil_account=3D$and."  jr_grpt_id in (select j_grpt
-                         from jrnx where j_poste::text like '".sql_strin=
g($accounting)."%' )  ";
-            $and=3D" and ";
-        }
-        // Quick Code
-		if ( isset ($qcodesearch_op)) $qcode=3D$qcodesearch_op;
-        if ( isset ($qcode)  && $qcode !=3D null )
-        {
-            $fil_qcode=3D$and."  jr_grpt_id in ( select j_grpt from
-                       jrnx where trim(j_qcode) =3D upper(trim('".sql_st=
ring($qcode)."')))";
-            $and=3D" and ";
-        }
+		// Only the unpaid
+		if (isset($unpaid))
+		{
+			$fil_paid =3D $and . SQL_LIST_UNPAID_INVOICE;
+			$and =3D " and ";
+		}
=20
-        // Only the unpaid
-        if ( isset($unpaid) )
-        {
-            $fil_paid=3D$and.SQL_LIST_UNPAID_INVOICE;
-            $and =3D" and ";
-        }
+		$g_user =3D new User(new Database());
+		$g_user->Check();
+		$g_user->check_dossier(dossier::id());
=20
-        $g_user=3Dnew User(new Database());
-        $g_user->Check();
-        $g_user->check_dossier(dossier::id());
+		if ($g_user->admin =3D=3D 0 && $g_user->is_local_admin() =3D=3D 0)
+		{
+			$fil_sec =3D $and . " jr_def_id in ( select uj_jrn_id " .
+					" from user_sec_jrn where " .
+					" uj_login=3D'" . $_SESSION['g_user'] . "'" .
+					" and uj_priv in ('R','W'))";
+		}
+		$where =3D $fil_ledger . $fil_amount . $fil_date . $fil_desc . $fil_se=
c . $fil_amount . $fil_qcode . $fil_paid . $fil_account;
+		$sql.=3D" where " . $where;
+		return array($sql, $where);
+	}
=20
-        if ( $g_user->admin =3D=3D 0 && $g_user->is_local_admin()=3D=3D0=
 )
-        {
-            $fil_sec=3D$and." jr_def_id in ( select uj_jrn_id ".
-                     " from user_sec_jrn where ".
-                     " uj_login=3D'".$_SESSION['g_user']."'".
-                     " and uj_priv in ('R','W'))";
-        }
-        $where=3D$fil_ledger.$fil_amount.$fil_date.$fil_desc.$fil_sec.$f=
il_amount.$fil_qcode.$fil_paid.$fil_account;
-        $sql.=3D" where ".$where;
-        return array($sql,$where);
-    }
-    /*!\brief return a html string with the search_form
-     *\return a HTML string with the FORM
-     *\see build_search_sql
-     *\see search_form
-     *\see list_operation
-     */
-    function display_search_form()
-    {
-        $r=3D'';
-        $type=3D$this->type;
+	/* !\brief return a html string with the search_form
+	 * \return a HTML string with the FORM
+	 * \see build_search_sql
+	 * \see search_form
+	 * \see list_operation
+	 */
=20
-        if ( $type=3D=3D"") $type=3D'ALL';
-        $r.=3D'<div id=3D"search_form" style=3D"display:none">';
-	$r.=3DHtmlInput::anchor_hide('Fermer','$(\'search_form\').style.display=
=3D\'none\';');
-	$r.=3Dh2info('Recherche');
-        $r.=3D'<FORM METHOD=3D"GET">';
-        $r.=3D$this->search_form($type);
-        $r.=3DHtmlInput::submit('search',_('Rechercher'));
-        $r.=3DHtmlInput::hidden('ac',$_REQUEST['ac']);
+	function display_search_form()
+	{
+		$r =3D '';
+		$type =3D $this->type;
=20
-        /*  when called from commercial.php some hidden values are neede=
d */
-        if (isset($_REQUEST['sa'])) $r.=3D HtmlInput::hidden("sa",$_REQU=
EST['sa']);
-        if (isset($_REQUEST['sb'])) $r.=3D HtmlInput::hidden("sb",$_REQU=
EST['sb']);
-        if (isset($_REQUEST['sc'])) $r.=3D HtmlInput::hidden("sc",$_REQU=
EST['sc']);
-        if (isset($_REQUEST['f_id'])) $r.=3DHtmlInput::hidden("f_id",$_R=
EQUEST['f_id']);
-	$r.=3DHtmlInput::button_anchor('Fermer','javascript:void(0)','fsearch_f=
orm','onclick=3D"$(\'search_form\').style.display=3D\'none\';"');
+		if ($type =3D=3D "")
+			$type =3D 'ALL';
+		$r.=3D'<div id=3D"search_form" style=3D"display:none">';
+		$r.=3DHtmlInput::anchor_hide('Fermer', '$(\'search_form\').style.displ=
ay=3D\'none\';');
+		$r.=3Dh2info('Recherche');
+		$r.=3D'<FORM METHOD=3D"GET">';
+		$r.=3D$this->search_form($type);
+		$r.=3DHtmlInput::submit('search', _('Rechercher'));
+		$r.=3DHtmlInput::hidden('ac', $_REQUEST['ac']);
=20
-        $r.=3D'</FORM>';
+		/*  when called from commercial.php some hidden values are needed */
+		if (isset($_REQUEST['sa']))
+			$r.=3D HtmlInput::hidden("sa", $_REQUEST['sa']);
+		if (isset($_REQUEST['sb']))
+			$r.=3D HtmlInput::hidden("sb", $_REQUEST['sb']);
+		if (isset($_REQUEST['sc']))
+			$r.=3D HtmlInput::hidden("sc", $_REQUEST['sc']);
+		if (isset($_REQUEST['f_id']))
+			$r.=3DHtmlInput::hidden("f_id", $_REQUEST['f_id']);
+		$r.=3DHtmlInput::button_anchor('Fermer', 'javascript:void(0)', 'fsearc=
h_form', 'onclick=3D"$(\'search_form\').style.display=3D\'none\';"');
=20
-        $r.=3D'</div>';
-        $button=3Dnew IButton('tfs');
-        $button->label=3D_("Filtrer");
-        $button->javascript=3D"toggleHideShow('search_form','tfs');";
+		$r.=3D'</FORM>';
=20
-        $r.=3D$button->input();
-	$r.=3D'<hr>';
-        return $r;
-    }
+		$r.=3D'</div>';
+		$button =3D new IButton('tfs');
+		$button->label =3D _("Filtrer");
+		$button->javascript =3D "toggleHideShow('search_form','tfs');";
=20
-    /*!\brief return the last p_limit operation into an array
-     *\param $p_limit is the max of operation to return
-     *\return $p_array of Follow_Up object
-     */
-    function get_last($p_limit)
-    {
-        global $g_user;
-        $filter_ledger=3D$g_user->get_ledger_sql('ALL',3);
-        $filter_ledger=3Dstr_replace('jrn_def_id','jr_def_id',$filter_le=
dger);
-        $sql=3D"
+		$r.=3D$button->input();
+		$r.=3D'<hr>';
+		return $r;
+	}
+
+	/* !\brief return the last p_limit operation into an array
+	 * \param $p_limit is the max of operation to return
+	 * \return $p_array of Follow_Up object
+	 */
+
+	function get_last($p_limit)
+	{
+		global $g_user;
+		$filter_ledger =3D $g_user->get_ledger_sql('ALL', 3);
+		$filter_ledger =3D str_replace('jrn_def_id', 'jr_def_id', $filter_ledg=
er);
+		$sql =3D "
 			select jr_id,jr_pj_number,jr_date,to_char(jr_date,'DD.MM.YYYY') as jr=
_date_fmt,jr_montant, jr_comment,jr_internal,jrn_def_code
 			from jrn
 			join jrn_def on (jrn_def_id=3Djr_def_id)
 			 where $filter_ledger
 			order by jr_date desc limit $p_limit";
-        $array=3D$this->db->get_array($sql);
-        return $array;
-    }
-    /**
-     *@brief retreive the jr_grpt_id from a ledger
-     *@param $p_what the column to seek
-     *    possible values are
-     *   - internal
-     *@param $p_value the value of the col.
-     */
-    function search_group($p_what,$p_value)
-    {
-        switch($p_what)
-        {
-        case 'internal':
-            return $this->db->get_value('select jr_grpt_id from jrn wher=
e jr_internal=3D$1',
-                                        array($p_value));
+		$array =3D $this->db->get_array($sql);
+		return $array;
+	}
=20
-        }
-    }
-    /**
-     *@brief retrieve operation from  jrn
-     *@param $p_from periode (id)
-     *@param $p_to periode (id)
-     *@return an array
-     */
-    function get_operation($p_from,$p_to)
-    {
+	/**
+	 * @brief retreive the jr_grpt_id from a ledger
+	 * @param $p_what the column to seek
+	 *    possible values are
+	 *   - internal
+	 * @param $p_value the value of the col.
+	 */
+	function search_group($p_what, $p_value)
+	{
+		switch ($p_what)
+		{
+			case 'internal':
+				return $this->db->get_value('select jr_grpt_id from jrn where jr_int=
ernal=3D$1', array($p_value));
+		}
+	}
+
+	/**
+	 * @brief retrieve operation from  jrn
+	 * @param $p_from periode (id)
+	 * @param $p_to periode (id)
+	 * @return an array
+	 */
+	function get_operation($p_from, $p_to)
+	{
 		global $g_user;
-        $jrn=3D($this->id=3D=3D0)?'and '.$g_user->get_ledger_sql():' and=
 jr_def_id =3D '.$this->id;
-        $sql=3D"select jr_id as id ,jr_internal as internal, ".
-             "jr_pj_number as pj,jr_grpt_id,".
-             " to_char(jr_date,'DDMMYY') as date_fmt, ".
-             " jr_comment as comment, jr_montant as montant ,".
-             " jr_grpt_id,jr_def_id".
-             " from jrn join jrn_def on (jr_def_id=3Djrn_def_id) where  =
".
-			 " jr_date >=3D (select p_start from parm_periode where p_id =3D $1)
+		$jrn =3D ($this->id =3D=3D 0) ? 'and ' . $g_user->get_ledger_sql() : '=
 and jr_def_id =3D ' . $this->id;
+		$sql =3D "select jr_id as id ,jr_internal as internal, " .
+				"jr_pj_number as pj,jr_grpt_id," .
+				" to_char(jr_date,'DDMMYY') as date_fmt, " .
+				" jr_comment as comment, jr_montant as montant ," .
+				" jr_grpt_id,jr_def_id" .
+				" from jrn join jrn_def on (jr_def_id=3Djrn_def_id) where  " .
+				" jr_date >=3D (select p_start from parm_periode where p_id =3D $1)
 				 and  jr_date <=3D (select p_end from parm_periode where p_id  =3D $=
2)" .
-             '  '.$jrn.' order by jr_date,substring(jr_pj_number,\'\\\d+=
$\')::numeric asc';
-        $ret=3D$this->db->get_array($sql,array($p_from,$p_to));
-        return $ret;
-    }
-    /**
-     *@brief return the used VAT code with a rate > 0
-     *@return an array of tva_id,tva_label,tva_poste
-     */
-    public function existing_vat()
-    {
-        if ( $this->type=3D=3D'ACH')
-        {
-            $array=3D$this->db->get_array("select tva_id,tva_label,tva_p=
oste from tva_rate where tva_rate !=3D 0.0000 ".
-                                        " and  exists (select qp_vat_cod=
e from quant_purchase
-                                        where  qp_vat_code=3Dtva_id and =
 exists (select j_id from jrnx where j_jrn_def =3D $1)) order by tva_id",
-                                        array($this->id));
-        }
-        if ( $this->type=3D=3D'VEN')
-        {
-            $array=3D$this->db->get_array("select tva_id,tva_label,tva_p=
oste from tva_rate where tva_rate !=3D 0.0000 ".
-                                        " and  exists (select qs_vat_cod=
e from quant_sold
-                                        where  qs_vat_code=3Dtva_id and =
 exists (select j_id from jrnx where j_jrn_def =3D $1)) order by tva_id",
-                                        array($this->id));
+				'  ' . $jrn . ' order by jr_date,substring(jr_pj_number,\'\\\d+$\'):=
:numeric asc';
+		$ret =3D $this->db->get_array($sql, array($p_from, $p_to));
+		return $ret;
+	}
=20
-        }
-        return $array;
-    }
-    /**
-     *@brief get the amount of vat for a given jr_grpt_id from the table
-     * quant_purchase
-     *@param the jr_grpt_id
-     *@return array price=3Dhtva, [1] =3D  vat,
-     *@note
-     *@see
-    @code
-    array
-    'price' =3D> string '91.3500' (length=3D7)
-    'vat' =3D> string '0.0000' (length=3D6)
-    'priv' =3D> string '0.0000' (length=3D6)
-    'tva_nd_recup' =3D> string '0.0000' (length=3D6)
+	/**
+	 * @brief return the used VAT code with a rate > 0
+	 * @return an array of tva_id,tva_label,tva_poste
+	 */
+	public function existing_vat()
+	{
+		if ($this->type =3D=3D 'ACH')
+		{
+			$array =3D $this->db->get_array("select tva_id,tva_label,tva_poste fr=
om tva_rate where tva_rate !=3D 0.0000 " .
+					" and  exists (select qp_vat_code from quant_purchase
+                                        where  qp_vat_code=3Dtva_id and =
 exists (select j_id from jrnx where j_jrn_def =3D $1)) order by tva_id",=
 array($this->id));
+		}
+		if ($this->type =3D=3D 'VEN')
+		{
+			$array =3D $this->db->get_array("select tva_id,tva_label,tva_poste fr=
om tva_rate where tva_rate !=3D 0.0000 " .
+					" and  exists (select qs_vat_code from quant_sold
+                                        where  qs_vat_code=3Dtva_id and =
 exists (select j_id from jrnx where j_jrn_def =3D $1)) order by tva_id",=
 array($this->id));
+		}
+		return $array;
+	}
=20
-    @endcode
-     */
-    function get_other_amount($p_jr_id)
-    {
-        if ( $this->type=3D=3D'ACH')
-        {
-            $array=3D$this->db->get_array('select sum(qp_price) as price=
,sum(qp_vat) as vat '.
-                                        ',sum(qp_dep_priv) as priv'.
-                                        ',sum(qp_nd_tva_recup)+sum(qp_nd=
_tva) as tva_nd'.
-                                        '  from quant_purchase join jrnx=
 using(j_id)
-                                        where  j_grpt=3D$1 ',
-                                        array($p_jr_id));
-            $ret=3D$array[0];
-        }
-        if ( $this->type=3D=3D'VEN')
-        {
-            $array=3D$this->db->get_array('select sum(qs_price) as price=
,sum(qs_vat) as vat '.
-                                        ',0 as priv'.
-                                        ',0 as tva_nd'.
-                                        '  from quant_sold join jrnx usi=
ng(j_id)
-                                        where  j_grpt=3D$1 ',
-                                        array($p_jr_id));
-            $ret=3D$array[0];
+	/**
+	 * @brief get the amount of vat for a given jr_grpt_id from the table
+	 * quant_purchase
+	 * @param the jr_grpt_id
+	 * @return array price=3Dhtva, [1] =3D  vat,
+	 * @note
+	 * @see
+	  @code
+	  array
+	  'price' =3D> string '91.3500' (length=3D7)
+	  'vat' =3D> string '0.0000' (length=3D6)
+	  'priv' =3D> string '0.0000' (length=3D6)
+	  'tva_nd_recup' =3D> string '0.0000' (length=3D6)
=20
-        }
-        return $ret;
-    }
+	  @endcode
+	 */
+	function get_other_amount($p_jr_id)
+	{
+		if ($this->type =3D=3D 'ACH')
+		{
+			$array =3D $this->db->get_array('select sum(qp_price) as price,sum(qp=
_vat) as vat ' .
+					',sum(qp_dep_priv) as priv' .
+					',sum(qp_nd_tva_recup)+sum(qp_nd_tva) as tva_nd' .
+					'  from quant_purchase join jrnx using(j_id)
+                                        where  j_grpt=3D$1 ', array($p_j=
r_id));
+			$ret =3D $array[0];
+		}
+		if ($this->type =3D=3D 'VEN')
+		{
+			$array =3D $this->db->get_array('select sum(qs_price) as price,sum(qs=
_vat) as vat ' .
+					',0 as priv' .
+					',0 as tva_nd' .
+					'  from quant_sold join jrnx using(j_id)
+                                        where  j_grpt=3D$1 ', array($p_j=
r_id));
+			$ret =3D $array[0];
+		}
+		return $ret;
+	}
=20
-    /**
-     *@brief get the amount of vat for a given jr_grpt_id from the table
-     * quant_purchase
-     *@param the jr_grpt_id
-     *@return array of sum_vat, tva_label
-     *@note
-     *@see
-    @code
+	/**
+	 * @brief get the amount of vat for a given jr_grpt_id from the table
+	 * quant_purchase
+	 * @param the jr_grpt_id
+	 * @return array of sum_vat, tva_label
+	 * @note
+	 * @see
+	  @code
=20
-    @endcode
-     */
-    function vat_operation($p_jr_id)
-    {
-        if ( $this->type=3D=3D'ACH')
-        {
-            $array=3D$this->db->get_array('select coalesce(sum(qp_vat),0=
) as sum_vat,tva_id
+	  @endcode
+	 */
+	function vat_operation($p_jr_id)
+	{
+		if ($this->type =3D=3D 'ACH')
+		{
+			$array =3D $this->db->get_array('select coalesce(sum(qp_vat),0) as su=
m_vat,tva_id
                                         from quant_purchase as p right j=
oin tva_rate on (qp_vat_code=3Dtva_id)  join jrnx using(j_id)
-                                        where tva_rate !=3D0.0 and j_grp=
t=3D$1 group by tva_id',
-                                        array($p_jr_id));
-        }
-        if ( $this->type=3D=3D'VEN')
-        {
-            $array=3D$this->db->get_array('select coalesce(sum(qs_vat),0=
) as sum_vat,tva_id
+                                        where tva_rate !=3D0.0 and j_grp=
t=3D$1 group by tva_id', array($p_jr_id));
+		}
+		if ($this->type =3D=3D 'VEN')
+		{
+			$array =3D $this->db->get_array('select coalesce(sum(qs_vat),0) as su=
m_vat,tva_id
                                         from quant_sold as p right join =
tva_rate on (qs_vat_code=3Dtva_id)  join jrnx using(j_id)
-                                        where tva_rate !=3D0.0 and j_grp=
t=3D$1 group by tva_id',
-                                        array($p_jr_id));
-        }
-        return $array;
-    }
-    /**
-     *@brief retrieve amount of previous periode
-     *@param $p_to frmo the start of the exercise until $p_to
-     *@return $array with vat, price,other_amount
-     *@note
-     *@see
-    @code
-    array
-    'price' =3D> string '446.1900' (length=3D8)
-    'vat' =3D> string '21.7600' (length=3D7)
-    'priv' =3D> string '0.0000' (length=3D6)
-    'tva_nd_recup' =3D> string '0.0000' (length=3D6)
-    'tva' =3D>
-      array
-        0 =3D>
-          array
-            'sum_vat' =3D> string '13.7200' (length=3D7)
-            'tva_id' =3D> string '1' (length=3D1)
-        1 =3D>
-          array
-            'sum_vat' =3D> string '8.0400' (length=3D6)
-            'tva_id' =3D> string '3' (length=3D1)
-        2 =3D>
-          array
-            'sum_vat' =3D> string '0.0000' (length=3D6)
-            'tva_id' =3D> string '4' (length=3D1)
+                                        where tva_rate !=3D0.0 and j_grp=
t=3D$1 group by tva_id', array($p_jr_id));
+		}
+		return $array;
+	}
=20
-    @endcode
-     */
-    function previous_amount($p_to)
-    {
-        /* get the first periode of exercise */
-        $periode=3Dnew Periode($this->db,$p_to);
-        $exercise=3D$periode->get_exercice();
-        list ($min,$max)=3D$periode->get_limit($exercise);
-        // min periode
-        if ($this->type=3D=3D'ACH')
-        {
-            /*  get all amount exclude vat */
-            $sql=3D"select coalesce(sum(qp_price),0) as price".
-                 " ,coalesce(sum(qp_vat),0) as vat ".
-                 ',coalesce(sum(qp_dep_priv),0) as priv'.
-                 ',coalesce(sum(qp_nd_tva_recup),0)+coalesce(sum(qp_nd_t=
va),0) as tva_nd'.
-                 '  from quant_purchase join jrnx using(j_id) '.
-                 ' where j_tech_per >=3D $1 and j_tech_per < $2';
-            $array=3D$this->db->get_array($sql,array($min->p_id,$p_to));
+	/**
+	 * @brief retrieve amount of previous periode
+	 * @param $p_to frmo the start of the exercise until $p_to
+	 * @return $array with vat, price,other_amount
+	 * @note
+	 * @see
+	  @code
+	  array
+	  'price' =3D> string '446.1900' (length=3D8)
+	  'vat' =3D> string '21.7600' (length=3D7)
+	  'priv' =3D> string '0.0000' (length=3D6)
+	  'tva_nd_recup' =3D> string '0.0000' (length=3D6)
+	  'tva' =3D>
+	  array
+	  0 =3D>
+	  array
+	  'sum_vat' =3D> string '13.7200' (length=3D7)
+	  'tva_id' =3D> string '1' (length=3D1)
+	  1 =3D>
+	  array
+	  'sum_vat' =3D> string '8.0400' (length=3D6)
+	  'tva_id' =3D> string '3' (length=3D1)
+	  2 =3D>
+	  array
+	  'sum_vat' =3D> string '0.0000' (length=3D6)
+	  'tva_id' =3D> string '4' (length=3D1)
=20
-            $ret=3D$array[0];
-            /* retrieve all vat code */
-            $array=3D$this->db->get_array('select coalesce(sum(qp_vat),0=
) as sum_vat,tva_id
+	  @endcode
+	 */
+	function previous_amount($p_to)
+	{
+		/* get the first periode of exercise */
+		$periode =3D new Periode($this->db, $p_to);
+		$exercise =3D $periode->get_exercice();
+		list ($min, $max) =3D $periode->get_limit($exercise);
+		// min periode
+		if ($this->type =3D=3D 'ACH')
+		{
+			/*  get all amount exclude vat */
+			$sql =3D "select coalesce(sum(qp_price),0) as price" .
+					" ,coalesce(sum(qp_vat),0) as vat " .
+					',coalesce(sum(qp_dep_priv),0) as priv' .
+					',coalesce(sum(qp_nd_tva_recup),0)+coalesce(sum(qp_nd_tva),0) as tv=
a_nd' .
+					'  from quant_purchase join jrnx using(j_id) ' .
+					' where j_tech_per >=3D $1 and j_tech_per < $2';
+			$array =3D $this->db->get_array($sql, array($min->p_id, $p_to));
+
+			$ret =3D $array[0];
+			/* retrieve all vat code */
+			$array =3D $this->db->get_array('select coalesce(sum(qp_vat),0) as su=
m_vat,tva_id
                                         from quant_purchase as p right j=
oin tva_rate on (qp_vat_code=3Dtva_id)  join jrnx using(j_id)
-                                        where tva_rate !=3D0 and j_tech_=
per >=3D $1 and j_tech_per < $2 group by tva_id',
-                                        array($min->p_id,$p_to));
-            $ret['tva']=3D$array;
-        }
-        if ($this->type=3D=3D'VEN')
-        {
-            /*  get all amount exclude vat */
-            $sql=3D"select coalesce(sum(qs_price),0) as price".
-                 " ,coalesce(sum(qs_vat),0) as vat ".
-                 ',0 as priv'.
-                 ',0 as tva_nd'.
-                 '  from quant_sold join jrnx using(j_id) '.
-                 ' where j_tech_per >=3D $1 and j_tech_per < $2';
-            $array=3D$this->db->get_array($sql,array($min->p_id,$p_to));
-            $ret=3D$array[0];
-            /* retrieve all vat code */
-            $array=3D$this->db->get_array('select coalesce(sum(qs_vat),0=
) as sum_vat,tva_id
+                                        where tva_rate !=3D0 and j_tech_=
per >=3D $1 and j_tech_per < $2 group by tva_id', array($min->p_id, $p_to=
));
+			$ret['tva'] =3D $array;
+		}
+		if ($this->type =3D=3D 'VEN')
+		{
+			/*  get all amount exclude vat */
+			$sql =3D "select coalesce(sum(qs_price),0) as price" .
+					" ,coalesce(sum(qs_vat),0) as vat " .
+					',0 as priv' .
+					',0 as tva_nd' .
+					'  from quant_sold join jrnx using(j_id) ' .
+					' where j_tech_per >=3D $1 and j_tech_per < $2';
+			$array =3D $this->db->get_array($sql, array($min->p_id, $p_to));
+			$ret =3D $array[0];
+			/* retrieve all vat code */
+			$array =3D $this->db->get_array('select coalesce(sum(qs_vat),0) as su=
m_vat,tva_id
                                         from quant_sold as p right join =
tva_rate on (qs_vat_code=3Dtva_id)  join jrnx using(j_id)
-                                        where tva_rate !=3D0 and j_tech_=
per >=3D $1 and j_tech_per < $2 group by tva_id',
-                                        array($min->p_id,$p_to));
-            $ret['tva']=3D$array;
-        }
-        return $ret;
-    }
-    ////////////////////////////////////////////////////////////////////=
////////////
-    // TEST MODULE
-    ////////////////////////////////////////////////////////////////////=
////////////
-    /*!
-    * \brief this function is intended to test this class
-    */
-    static function test_me($pCase=3D'')
-    {
-        if ( $pCase=3D=3D'')
-        {
-            echo Acc_Reconciliation::$javascript;
-            html_page_start();
-            $cn=3Dnew Database(dossier::id());
-            $_SESSION['g_user']=3D'phpcompta';
-            $_SESSION['g_pass']=3D'phpcompta';
+                                        where tva_rate !=3D0 and j_tech_=
per >=3D $1 and j_tech_per < $2 group by tva_id', array($min->p_id, $p_to=
));
+			$ret['tva'] =3D $array;
+		}
+		return $ret;
+	}
=20
-            $id=3D(isset ($_REQUEST['p_jrn']))?$_REQUEST['p_jrn']:-1;
-            $a=3Dnew Acc_Ledger($cn,$id);
-            $a->with_concerned=3Dtrue;
-            // Vide
-            echo '<FORM method=3D"post">';
-            echo $a->select_ledger()->input();
-            echo HtmlInput::submit('go','Test it');
-            echo '</form>';
-            if ( isset($_POST['go']))
-            {
-                echo "Ok ";
-                echo '<form method=3D"post">';
-                echo $a->show_form();
-                echo HtmlInput::submit('post_id','Try me');
-                echo '</form>';
-                // Show the predef operation
-                // Don't forget the p_jrn
-                echo '<form>';
-                echo dossier::hidden();
-                echo '<input type=3D"hidden" value=3D"'.$id.'" name=3D"p=
_jrn">';
-                $op=3Dnew Pre_operation($cn);
-                $op->p_jrn=3D$id;
-                $op->od_direct=3D't';
-                if ($op->count() !=3D 0 )
-                {
-                    echo HtmlInput::submit('use_opd','Utilisez une op=C3=
=A9ration pr&eacute;d&eacute;finie');
-                    echo $op->show_button();
-                }
-                echo '</form>';
-                exit();
-            }
+	///////////////////////////////////////////////////////////////////////=
/////////
+	// TEST MODULE
+	///////////////////////////////////////////////////////////////////////=
/////////
+	/* !
+	 * \brief this function is intended to test this class
+	 */
+	static function test_me($pCase =3D '')
+	{
+		if ($pCase =3D=3D '')
+		{
+			echo Acc_Reconciliation::$javascript;
+			html_page_start();
+			$cn =3D new Database(dossier::id());
+			$_SESSION['g_user'] =3D 'phpcompta';
+			$_SESSION['g_pass'] =3D 'phpcompta';
=20
-            if ( isset($_POST['post_id' ]))
-            {
+			$id =3D (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : -1;
+			$a =3D new Acc_Ledger($cn, $id);
+			$a->with_concerned =3D true;
+			// Vide
+			echo '<FORM method=3D"post">';
+			echo $a->select_ledger()->input();
+			echo HtmlInput::submit('go', 'Test it');
+			echo '</form>';
+			if (isset($_POST['go']))
+			{
+				echo "Ok ";
+				echo '<form method=3D"post">';
+				echo $a->show_form();
+				echo HtmlInput::submit('post_id', 'Try me');
+				echo '</form>';
+				// Show the predef operation
+				// Don't forget the p_jrn
+				echo '<form>';
+				echo dossier::hidden();
+				echo '<input type=3D"hidden" value=3D"' . $id . '" name=3D"p_jrn">';
+				$op =3D new Pre_operation($cn);
+				$op->p_jrn =3D $id;
+				$op->od_direct =3D 't';
+				if ($op->count() !=3D 0)
+				{
+					echo HtmlInput::submit('use_opd', 'Utilisez une op=C3=A9ration pr&e=
acute;d&eacute;finie');
+					echo $op->show_button();
+				}
+				echo '</form>';
+				exit();
+			}
=20
-                echo '<form method=3D"post">';
-                echo $a->show_form($_POST,1);
-                echo HtmlInput::button('add','Ajout d\'une ligne','onCli=
ck=3D"quick_writing_add_row()"');
-                echo HtmlInput::submit('save_it',"Sauver");
-                echo '</form>';
-                exit();
-            }
-            if ( isset($_POST['save_it' ]))
-            {
-                print 'saving';
-                $array=3D$_POST;
-                $array['save_opd']=3D1;
-                try
-                {
-                    $a->save($array);
-                }
-                catch (Exception $e)
-                {
-                    alert($e->getMessage());
-                    echo '<form method=3D"post">';
+			if (isset($_POST['post_id']))
+			{
=20
-                    echo $a->show_form($_POST);
-                    echo HtmlInput::submit('post_id','Try me');
-                    echo '</form>';
+				echo '<form method=3D"post">';
+				echo $a->show_form($_POST, 1);
+				echo HtmlInput::button('add', 'Ajout d\'une ligne', 'onClick=3D"quic=
k_writing_add_row()"');
+				echo HtmlInput::submit('save_it', "Sauver");
+				echo '</form>';
+				exit();
+			}
+			if (isset($_POST['save_it']))
+			{
+				print 'saving';
+				$array =3D $_POST;
+				$array['save_opd'] =3D 1;
+				try
+				{
+					$a->save($array);
+				}
+				catch (Exception $e)
+				{
+					alert($e->getMessage());
+					echo '<form method=3D"post">';
=20
-                }
-                exit();
-            }
-            // The GET at the end because automatically repost when you =
don't
-            // specify the url in the METHOD field
-            if ( isset ($_GET['use_opd']))
-            {
-                $op=3Dnew Pre_op_advanced($cn);
-                $op->set_od_id($_REQUEST['pre_def']);
-                //$op->p_jrn=3D$id;
+					echo $a->show_form($_POST);
+					echo HtmlInput::submit('post_id', 'Try me');
+					echo '</form>';
+				}
+				exit();
+			}
+			// The GET at the end because automatically repost when you don't
+			// specify the url in the METHOD field
+			if (isset($_GET['use_opd']))
+			{
+				$op =3D new Pre_op_advanced($cn);
+				$op->set_od_id($_REQUEST['pre_def']);
+				//$op->p_jrn=3D$id;
=20
-                $p_post=3D$op->compute_array();
+				$p_post =3D $op->compute_array();
=20
-                echo '<FORM method=3D"post">';
+				echo '<FORM method=3D"post">';
=20
-                echo $a->show_form($p_post);
-                echo HtmlInput::submit('post_id','Use predefined operati=
on');
-                echo '</form>';
-                exit();
+				echo $a->show_form($p_post);
+				echo HtmlInput::submit('post_id', 'Use predefined operation');
+				echo '</form>';
+				exit();
+			}
+		}// if case =3D ''
+		//////////////////////////////////////////////////////////////////////=
/////
+		// search
+		if ($pCase =3D=3D 'search')
+		{
+			html_page_start();
+			$cn =3D new Database(dossier::id());
+			$ledger =3D new Acc_Ledger($cn, 0);
+			$_SESSION['g_user'] =3D 'phpcompta';
+			$_SESSION['g_pass'] =3D 'phpcompta';
+			echo $ledger->search_form('ALL');
+		}
+		//////////////////////////////////////////////////////////////////////=
/////
+		// reverse
+		// Give yourself the var and check in your tables
+		//////////////////////////////////////////////////////////////////////=
/////
+		if ($pCase =3D=3D 'reverse')
+		{
+			$cn =3D new Database(dossier::id());
+			$jr_internal =3D 'OD-01-272';
+			try
+			{
+				$cn->start();
+				$jrn_def_id =3D $cn->get_value('select jr_def_id from jrn where jr_i=
nternal=3D$1', array($jr_internal));
+				$ledger =3D new Acc_Ledger($cn, $jrn_def_id);
+				$ledger->jr_id =3D $cn->get_value('select jr_id from jrn where jr_in=
ternal=3D$1', array($jr_internal));
=20
-            }
-        }// if case =3D ''
-        ////////////////////////////////////////////////////////////////=
///////////
-        // search
-        if ( $pCase  =3D=3D 'search')
-        {
-            html_page_start();
-            $cn=3Dnew Database(dossier::id());
-            $ledger=3Dnew Acc_Ledger($cn,0);
-            $_SESSION['g_user']=3D'phpcompta';
-            $_SESSION['g_pass']=3D'phpcompta';
-            echo $ledger->search_form('ALL');
-        }
-        ////////////////////////////////////////////////////////////////=
///////////
-        // reverse
-        // Give yourself the var and check in your tables
-        ////////////////////////////////////////////////////////////////=
///////////
-        if ( $pCase=3D=3D'reverse')
-        {
-            $cn=3Dnew Database (dossier::id());
-            $jr_internal=3D'OD-01-272';
-            try
-            {
-                $cn->start();
-                $jrn_def_id=3D$cn->get_value('select jr_def_id from jrn =
where jr_internal=3D$1',array($jr_internal));
-                $ledger=3Dnew Acc_Ledger($cn,$jrn_def_id);
-                $ledger->jr_id=3D$cn->get_value('select jr_id from jrn w=
here jr_internal=3D$1',array($jr_internal));
+				echo "Ouvrez le fichier " . __FILE__ . " =C3=A0 la ligne " . __LINE_=
_ . " pour changer jr_internal et v=C3=A9rifier le r=C3=A9sultat de l'ext=
ourne";
=20
-                echo "Ouvrez le fichier ".__FILE__." =C3=A0 la ligne "._=
_LINE__." pour changer jr_internal et v=C3=A9rifier le r=C3=A9sultat de l=
'extourne";
+				$ledger->reverse('01.07.2010');
+			}
+			catch (Exception $e)
+			{
+				$cn->rollback();
+				var_dump($e);
+			}
+			$cn->commit();
+		}
+	}
=20
-                $ledger->reverse('01.07.2010');
-            }
-            catch (Exception $e)
-            {
-                $cn->rollback();
-                var_dump($e);
-            }
-            $cn->commit();
-        }
-    }
-    /**
-     * create an array of the existing cat, to be used in a checkbox for=
m
-     *
-     */
-    static function array_cat()
-    {
-        $r=3D array(
-                array('cat'=3D>'VEN','name'=3D>'Journaux de vente'),
-                array('cat'=3D>'ACH','name'=3D>'Journaux d\'achat'),
-                array('cat'=3D>'FIN','name'=3D>'Journaux Financier'),
-                array('cat'=3D>'ODS','name'=3D>'Journaux d\'Op=C3=A9rati=
ons diverses')
-            );
-        return $r;
-    }
-    /**
-     *Retrieve the third : supplier for purchase, customer for sale, ban=
k for fin,
-     *@param $p_jrn_type type of the ledger FIN, VEN ACH or ODS
-     */
-    function get_tiers($p_jrn_type,$jr_id)
-    {
-      if ( $p_jrn_type =3D=3D 'ODS') return ' ';
-      $tiers=3D'';
-      switch ($p_jrn_type)
+	/**
+	 * create an array of the existing cat, to be used in a checkbox form
+	 *
+	 */
+	static function array_cat()
 	{
-	case 'VEN':
-	  $tiers=3D$this->db->get_value('select max(qs_client) from quant_sold =
join jrnx using (j_id) join jrn on (jr_grpt_id=3Dj_grpt) where jrn.jr_id=3D=
$1',array($jr_id));
-	  break ;
-	case 'ACH':
-	  $tiers=3D$this->db->get_value('select max(qp_supplier) from quant_pur=
chase join jrnx using (j_id) join jrn on (jr_grpt_id=3Dj_grpt) where jrn.=
jr_id=3D$1',array($jr_id));
+		$r =3D array(
+			array('cat' =3D> 'VEN', 'name' =3D> 'Journaux de vente'),
+			array('cat' =3D> 'ACH', 'name' =3D> 'Journaux d\'achat'),
+			array('cat' =3D> 'FIN', 'name' =3D> 'Journaux Financier'),
+			array('cat' =3D> 'ODS', 'name' =3D> 'Journaux d\'Op=C3=A9rations dive=
rses')
+		);
+		return $r;
+	}
=20
-	  break ;
-	case 'FIN':
-	  $tiers=3D$this->db->get_value('select qf_other from quant_fin where j=
r_id=3D$1',array($jr_id));
-	  break ;
+	/**
+	 * Retrieve the third : supplier for purchase, customer for sale, bank =
for fin,
+	 * @param $p_jrn_type type of the ledger FIN, VEN ACH or ODS
+	 */
+	function get_tiers($p_jrn_type, $jr_id)
+	{
+		if ($p_jrn_type =3D=3D 'ODS')
+			return ' ';
+		$tiers =3D '';
+		switch ($p_jrn_type)
+		{
+			case 'VEN':
+				$tiers =3D $this->db->get_value('select max(qs_client) from quant_so=
ld join jrnx using (j_id) join jrn on (jr_grpt_id=3Dj_grpt) where jrn.jr_=
id=3D$1', array($jr_id));
+				break;
+			case 'ACH':
+				$tiers =3D $this->db->get_value('select max(qp_supplier) from quant_=
purchase join jrnx using (j_id) join jrn on (jr_grpt_id=3Dj_grpt) where j=
rn.jr_id=3D$1', array($jr_id));
=20
+				break;
+			case 'FIN':
+				$tiers =3D $this->db->get_value('select qf_other from quant_fin wher=
e jr_id=3D$1', array($jr_id));
+				break;
+		}
+		if ($this->db->count() =3D=3D 0)
+			return '';
+		$name =3D $this->db->get_value('select ad_value from fiche_detail wher=
e ad_id=3D1 and f_id=3D$1', array($tiers));
+		$first_name =3D $this->db->get_value('select ad_value from fiche_detai=
l where ad_id=3D32 and f_id=3D$1', array($tiers));
+		return $name . ' ' . $first_name;
 	}
-      if ($this->db->count()=3D=3D0) return '';
-      $name=3D$this->db->get_value('select ad_value from fiche_detail wh=
ere ad_id=3D1 and f_id=3D$1',array($tiers));
-      $first_name=3D$this->db->get_value('select ad_value from fiche_det=
ail where ad_id=3D32 and f_id=3D$1',array($tiers));
-      return $name.' '.$first_name;
-    }
+
 	/**
 	 * @brief listing of all ledgers
 	 * @return HTML string
@@ -3098,11 +3164,11 @@
 	function listing()
 	{
 		$str_dossier =3D dossier::get();
-		$base_url=3D"?".dossier::get()."&ac=3D".$_REQUEST['ac'];
+		$base_url =3D "?" . dossier::get() . "&ac=3D" . $_REQUEST['ac'];
=20
-		$r=3D"";
+		$r =3D "";
 		$r.=3D'<TABLE>';
-		$r.=3D'<TR><TD class=3D"mtitle"><A class=3D"mtitle" HREF=3D"'.$base_ur=
l.'&sa=3Dadd">' . _('Cr=C3=A9ation') . ' </A></TD></TR>';
+		$r.=3D'<TR><TD class=3D"mtitle"><A class=3D"mtitle" HREF=3D"' . $base_=
url . '&sa=3Dadd">' . _('Cr=C3=A9ation') . ' </A></TD></TR>';
 		$ret =3D $this->db->exec_sql("select jrn_def_id,jrn_def_name,
                        jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,=
jrn_desc
                        from jrn_def join jrn_type on jrn_def_type=3Djrn_=
type_id order by jrn_def_name");
@@ -3112,159 +3178,169 @@
 		for ($i =3D 0; $i < $Max; $i++)
 		{
 			$l_line =3D Database::fetch_array($ret, $i);
-			$url=3D$base_url."&sa=3Ddetail&p_jrn=3D".$l_line['jrn_def_id'];
+			$url =3D $base_url . "&sa=3Ddetail&p_jrn=3D" . $l_line['jrn_def_id'];
 			$r.=3Dsprintf('<TR><TD class=3D"mtitle"><A class=3D"mtitle" HREF=3D"%=
s">%s</A></TD></TR>', $url, h($l_line['jrn_def_name']));
 		}
 		$r.=3D "</TABLE>";
 		return $r;
 	}
+
 	/**
 	 * display detail of a ledger
 	 *
 	 */
 	function display_ledger()
 	{
-		if ( $this->load() =3D=3D -1 ) {
-			throw new Exception(_("Journal n'existe pas"),-1);
+		if ($this->load() =3D=3D -1)
+		{
+			throw new Exception(_("Journal n'existe pas"), -1);
 		}
-		$type=3D$this->jrn_def_type;
-		$name=3D$this->jrn_def_name;
-		$code=3D$this->jrn_def_code;
+		$type =3D $this->jrn_def_type;
+		$name =3D $this->jrn_def_name;
+		$code =3D $this->jrn_def_code;
=20
-				/* widget for searching an account */
-		$wSearch=3Dnew IPoste();
-		$wSearch->set_attribute('ipopup','ipop_account');
-		$wSearch->set_attribute('account','p_jrn_class_deb');
-		$wSearch->set_attribute('no_overwrite','1');
-		$wSearch->set_attribute('noquery','1');
-		$wSearch->table=3D3;
-		$wSearch->name=3D"p_jrn_class_deb";
-		$wSearch->size=3D20;
-		$wSearch->value=3D$this->jrn_def_class_deb;
-		$search=3D$wSearch->input();
+		/* widget for searching an account */
+		$wSearch =3D new IPoste();
+		$wSearch->set_attribute('ipopup', 'ipop_account');
+		$wSearch->set_attribute('account', 'p_jrn_class_deb');
+		$wSearch->set_attribute('no_overwrite', '1');
+		$wSearch->set_attribute('noquery', '1');
+		$wSearch->table =3D 3;
+		$wSearch->name =3D "p_jrn_class_deb";
+		$wSearch->size =3D 20;
+		$wSearch->value =3D $this->jrn_def_class_deb;
+		$search =3D $wSearch->input();
=20
-		$wPjPref=3Dnew IText();
-		$wPjPref->name=3D'jrn_def_pj_pref';
-		$wPjPref->value=3D$this->jrn_def_pj_pref;
-		$pj_pref=3D$wPjPref->input();
+		$wPjPref =3D new IText();
+		$wPjPref->name =3D 'jrn_def_pj_pref';
+		$wPjPref->value =3D $this->jrn_def_pj_pref;
+		$pj_pref =3D $wPjPref->input();
=20
-		$wPjSeq=3Dnew INum();
-		$wPjSeq->value=3D0;
-		$wPjSeq->name=3D'jrn_def_pj_seq';
-		$pj_seq=3D$wPjSeq->input();
-		$last_seq=3D$this->get_last_pj();
-		$name=3D$this->jrn_def_name;
+		$wPjSeq =3D new INum();
+		$wPjSeq->value =3D 0;
+		$wPjSeq->name =3D 'jrn_def_pj_seq';
+		$pj_seq =3D $wPjSeq->input();
+		$last_seq =3D $this->get_last_pj();
+		$name =3D $this->jrn_def_name;
=20
-		$hidden=3D HtmlInput::hidden('p_jrn',$this->id);
-		$hidden.=3D HtmlInput::hidden('sa','detail');
+		$hidden =3D HtmlInput::hidden('p_jrn', $this->id);
+		$hidden.=3D HtmlInput::hidden('sa', 'detail');
 		$hidden.=3D dossier::hidden();
-		$hidden.=3DHtmlInput::hidden('p_jrn_deb_max_line',10);
-		$hidden.=3DHtmlInput::hidden('p_ech_lib','echeance');
-		$hidden.=3DHtmlInput::hidden('p_jrn_type',$type);
+		$hidden.=3DHtmlInput::hidden('p_jrn_deb_max_line', 10);
+		$hidden.=3DHtmlInput::hidden('p_ech_lib', 'echeance');
+		$hidden.=3DHtmlInput::hidden('p_jrn_type', $type);
=20
-				/* Load the card */
-		$card=3D$this->get_fiche_def();
-		$rdeb=3Dexplode(',',$card['deb']);
-		$rcred=3Dexplode(',',$card['cred']);
+		/* Load the card */
+		$card =3D $this->get_fiche_def();
+		$rdeb =3D explode(',', $card['deb']);
+		$rcred =3D explode(',', $card['cred']);
 		/* Numbering (only FIN) */
-		$num_op=3Dnew ICheckBox('numb_operation');
-		if ( $this->jrn_def_num_op=3D=3D1) $num_op->selected=3Dtrue;
+		$num_op =3D new ICheckBox('numb_operation');
+		if ($this->jrn_def_num_op =3D=3D 1)
+			$num_op->selected =3D true;
 		/* bank card */
-		$qcode_bank=3D'';
-		if ( $type=3D=3D'FIN')
+		$qcode_bank =3D '';
+		if ($type =3D=3D 'FIN')
 		{
-			$f_id=3D$this->jrn_def_bank;
-			if ( isNumber($f_id)=3D=3D1)
+			$f_id =3D $this->jrn_def_bank;
+			if (isNumber($f_id) =3D=3D 1)
 			{
-				$fBank=3Dnew Fiche($this->db,$f_id);
-				$qcode_bank=3D$fBank->get_quick_code();
+				$fBank =3D new Fiche($this->db, $f_id);
+				$qcode_bank =3D $fBank->get_quick_code();
 			}
 		}
-		$new=3Dfalse;
-		$cn=3D$this->db;
+		$new =3D false;
+		$cn =3D $this->db;
 		echo $hidden;
 		require_once('template/param_jrn.php');
+	}
=20
-	}
 	/**
 	 * Verify before update
 	 *
 	 * @param type $array
 	 *   'p_jrn' =3D> string '3' (length=3D1)
-		  'sa' =3D> string 'detail' (length=3D6)
-		  'gDossier' =3D> string '82' (length=3D2)
-		  'p_jrn_deb_max_line' =3D> string '10' (length=3D2)
-		  'p_ech_lib' =3D> string 'echeance' (length=3D8)
-		  'p_jrn_type' =3D> string 'ACH' (length=3D3)
-		  'p_jrn_name' =3D> string 'Achat' (length=3D5)
-		  'jrn_def_pj_pref' =3D> string 'ACH' (length=3D3)
-		  'jrn_def_pj_seq' =3D> string '0' (length=3D1)
-		  'FICHECRED' =3D>
-			array
-			  0 =3D> string '4' (length=3D1)
-		  'FICHEDEB' =3D>
-			array
-			  0 =3D> string '7' (length=3D1)
-			  1 =3D> string '5' (length=3D1)
-			  2 =3D> string '13' (length=3D2)
-		  'update' =3D> string 'Sauve' (length=3D5
-	 *@exception is throw is test are not valid
+	  'sa' =3D> string 'detail' (length=3D6)
+	  'gDossier' =3D> string '82' (length=3D2)
+	  'p_jrn_deb_max_line' =3D> string '10' (length=3D2)
+	  'p_ech_lib' =3D> string 'echeance' (length=3D8)
+	  'p_jrn_type' =3D> string 'ACH' (length=3D3)
+	  'p_jrn_name' =3D> string 'Achat' (length=3D5)
+	  'jrn_def_pj_pref' =3D> string 'ACH' (length=3D3)
+	  'jrn_def_pj_seq' =3D> string '0' (length=3D1)
+	  'FICHECRED' =3D>
+	  array
+	  0 =3D> string '4' (length=3D1)
+	  'FICHEDEB' =3D>
+	  array
+	  0 =3D> string '7' (length=3D1)
+	  1 =3D> string '5' (length=3D1)
+	  2 =3D> string '13' (length=3D2)
+	  'update' =3D> string 'Sauve' (length=3D5
+	 * @exception is throw is test are not valid
 	 */
 	function verify_ledger($array)
 	{
-		extract ($array);
+		extract($array);
 		try
 		{
-			if (isNumber($p_jrn ) =3D=3D 0)			throw new Exception("Id invalide");
-			if (isNumber($p_jrn_deb_max_line) =3D=3D 0) throw new Exception ("Nom=
bre de ligne incorrect");
-			if (trim($p_jrn_name) =3D=3D "") throw new Exception ("Nom de journal=
 invalide");
-			if ($this->db->get_value("select count(*) from jrn_def where jrn_def_=
name=3D$1 and jrn_Def_id<>$2",
-					array($p_jrn_name,$p_jrn)) > 0) throw new Exception ("Un journal av=
ec ce nom existe d=C3=A9j=C3=A0");
-			if ($p_jrn_type=3D=3D'FIN')
+			if (isNumber($p_jrn) =3D=3D 0)
+				throw new Exception("Id invalide");
+			if (isNumber($p_jrn_deb_max_line) =3D=3D 0)
+				throw new Exception("Nombre de ligne incorrect");
+			if (trim($p_jrn_name) =3D=3D "")
+				throw new Exception("Nom de journal invalide");
+			if ($this->db->get_value("select count(*) from jrn_def where jrn_def_=
name=3D$1 and jrn_Def_id<>$2", array($p_jrn_name, $p_jrn)) > 0)
+				throw new Exception("Un journal avec ce nom existe d=C3=A9j=C3=A0");
+			if ($p_jrn_type =3D=3D 'FIN')
 			{
-				$a=3Dnew Fiche($this->db);
-				$result=3D$a->get_by_qcode(trim(strtoupper($_POST['bank'])),false);
-				if	 ( $result=3D=3D1)throw new Exception ("Aucun compte en banque n'=
est donn=C3=A9");
+				$a =3D new Fiche($this->db);
+				$result =3D $a->get_by_qcode(trim(strtoupper($_POST['bank'])), false=
);
+				if ($result =3D=3D 1)
+					throw new Exception("Aucun compte en banque n'est donn=C3=A9");
 			}
-
-		} catch(Exception $e)
+		}
+		catch (Exception $e)
 		{
 			throw $e;
 		}
 	}
+
 	/**
 	 * update a ledger
 	 * @param type $array  normally post
 	 * @see verify_ledger
 	 */
-	function update($array=3D'')
+	function update($array =3D '')
 	{
-	        if ($array =3D=3D null) throw new Exception ('save cannot use a=
 empty array');
+		if ($array =3D=3D null)
+			throw new Exception('save cannot use a empty array');
=20
-		extract ($array);
-		$this->jrn_def_id=3D$p_jrn;
-		$this->jrn_def_name=3D$p_jrn_name;
-		$this->jrn_def_ech_lib=3D$p_ech_lib;
-		$this->jrn_def_max_line_deb=3D$p_jrn_deb_max_line;
-		$this->jrn_def_type=3D$p_jrn_type;
-		$this->jrn_def_pj_pref=3D$jrn_def_pj_pref;
-		$this->jrn_def_fiche_deb=3D(isset($FICHEDEB))?join($FICHEDEB,','):"";
-		switch($this->jrn_def_type)
+		extract($array);
+		$this->jrn_def_id =3D $p_jrn;
+		$this->jrn_def_name =3D $p_jrn_name;
+		$this->jrn_def_ech_lib =3D $p_ech_lib;
+		$this->jrn_def_max_line_deb =3D $p_jrn_deb_max_line;
+		$this->jrn_def_type =3D $p_jrn_type;
+		$this->jrn_def_pj_pref =3D $jrn_def_pj_pref;
+		$this->jrn_def_fiche_deb =3D (isset($FICHEDEB)) ? join($FICHEDEB, ',')=
 : "";
+		switch ($this->jrn_def_type)
 		{
 			case 'ACH':
 			case 'VEN':
-				$this->jrn_def_fiche_cred=3D(isset($FICHECRED))?join($FICHECRED,',')=
:'';
+				$this->jrn_def_fiche_cred =3D (isset($FICHECRED)) ? join($FICHECRED,=
 ',') : '';
 				break;
 			case 'ODS':
-				$this->jrn_def_class_deb=3D$p_jrn_class_deb;
+				$this->jrn_def_class_deb =3D $p_jrn_class_deb;
 				break;
 			case 'FIN':
-				$a=3Dnew Fiche($this->db);
-				$result=3D$a->get_by_qcode(trim(strtoupper($_POST['bank'])),false);
-				$bank=3D$a->id;
-				$this->jrn_def_bank=3D$bank;
-				if ( $result=3D=3D-1)throw new Exception ("Aucun compte en banque n'=
est donn=C3=A9");
-				$this->jrn_def_num_op=3D(isset($numb_operation))?1:0;
+				$a =3D new Fiche($this->db);
+				$result =3D $a->get_by_qcode(trim(strtoupper($_POST['bank'])), false=
);
+				$bank =3D $a->id;
+				$this->jrn_def_bank =3D $bank;
+				if ($result =3D=3D -1)
+					throw new Exception("Aucun compte en banque n'est donn=C3=A9");
+				$this->jrn_def_num_op =3D (isset($numb_operation)) ? 1 : 0;
 				break;
 		}
=20
@@ -3272,78 +3348,79 @@
 		//Reset sequence if needed
 		if ($jrn_def_pj_seq !=3D 0)
 		{
-			$Res=3D$this->db->alter_seq("s_jrn_pj".$p_jrn,$jrn_def_pj_seq);
+			$Res =3D $this->db->alter_seq("s_jrn_pj" . $p_jrn, $jrn_def_pj_seq);
 		}
 	}
-	function input_paid($nofieldset=3D0)
-    {
-        $r=3D'';
-		if ( $nofieldset=3D=3D0)
+
+	function input_paid($nofieldset =3D 0)
+	{
+		$r =3D '';
+		if ($nofieldset =3D=3D 0)
 		{
 			$r.=3D'<fieldset id=3D"payment"> ';
 		}
-        $r.=3D'<legend> '._('Pay=C3=A9 par').' </legend>';
-        $mp=3Dnew Acc_Payment($this->db);
-        $mp->set_parameter('ledger_source',$this->id);
-        $r.=3D$mp->select();
-        if ( $nofieldset=3D=3D0)
+		$r.=3D'<legend> ' . _('Pay=C3=A9 par') . ' </legend>';
+		$mp =3D new Acc_Payment($this->db);
+		$mp->set_parameter('ledger_source', $this->id);
+		$r.=3D$mp->select();
+		if ($nofieldset =3D=3D 0)
 			$r.=3D'</fieldset>';
-        return $r;
-    }
+		return $r;
+	}
=20
 	/**
 	 * display screen to enter a new ledger
 	 */
 	function input_new()
 	{
-			$wSearch=3Dnew IPoste();
-			$wSearch->table=3D3;
-			$wSearch->set_attribute('ipopup','ipop_account');
-			$wSearch->set_attribute('account','p_jrn_class_deb');
-			$wSearch->set_attribute('no_overwrite','1');
-			$wSearch->set_attribute('noquery','1');
+		$wSearch =3D new IPoste();
+		$wSearch->table =3D 3;
+		$wSearch->set_attribute('ipopup', 'ipop_account');
+		$wSearch->set_attribute('account', 'p_jrn_class_deb');
+		$wSearch->set_attribute('no_overwrite', '1');
+		$wSearch->set_attribute('noquery', '1');
=20
-			$wSearch->name=3D"p_jrn_class_deb";
-			$wSearch->size=3D20;
+		$wSearch->name =3D "p_jrn_class_deb";
+		$wSearch->size =3D 20;
=20
-			$search=3D$wSearch->input();
+		$search =3D $wSearch->input();
=20
-			/* construct all the hidden */
-			$hidden=3D HtmlInput::hidden('p_jrn',-1);
-			$hidden.=3D HtmlInput::hidden('p_action','jrn');
-			$hidden.=3D HtmlInput::hidden('sa','add');
-			$hidden.=3D dossier::hidden();
-			$hidden.=3DHtmlInput::hidden('p_jrn_deb_max_line',10);
-			$hidden.=3DHtmlInput::hidden('p_ech_lib','echeance');
+		/* construct all the hidden */
+		$hidden =3D HtmlInput::hidden('p_jrn', -1);
+		$hidden.=3D HtmlInput::hidden('p_action', 'jrn');
+		$hidden.=3D HtmlInput::hidden('sa', 'add');
+		$hidden.=3D dossier::hidden();
+		$hidden.=3DHtmlInput::hidden('p_jrn_deb_max_line', 10);
+		$hidden.=3DHtmlInput::hidden('p_ech_lib', 'echeance');
=20
-			/* properties of the ledger */
-			$name=3D"";
-			$code=3D"";
-			$wType=3Dnew ISelect();
-			$wType->value=3D$this->db->make_array('select jrn_type_id,jrn_desc fr=
om jrn_type');
-			$wType->name=3D"p_jrn_type";
-			$type=3D$wType->input();
-			$rcred=3D$rdeb=3Darray();
-			$wPjPref=3Dnew IText();
-			$wPjPref->name=3D'jrn_def_pj_pref';
-			$pj_pref=3D$wPjPref->input();
-			$pj_seq=3D'';
-			$last_seq=3D0;
-			$new=3Dtrue;
-			/* bank card */
-			$qcode_bank=3D'';
-			/* Numbering (only FIN) */
-			$num_op=3Dnew ICheckBox('numb_operation');
-			echo dossier::hidden();
-			echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-			echo HtmlInput::hidden('p_jrn',-1);
-			echo HtmlInput::hidden('sa','add');
+		/* properties of the ledger */
+		$name =3D "";
+		$code =3D "";
+		$wType =3D new ISelect();
+		$wType->value =3D $this->db->make_array('select jrn_type_id,jrn_desc f=
rom jrn_type');
+		$wType->name =3D "p_jrn_type";
+		$type =3D $wType->input();
+		$rcred =3D $rdeb =3D array();
+		$wPjPref =3D new IText();
+		$wPjPref->name =3D 'jrn_def_pj_pref';
+		$pj_pref =3D $wPjPref->input();
+		$pj_seq =3D '';
+		$last_seq =3D 0;
+		$new =3D true;
+		/* bank card */
+		$qcode_bank =3D '';
+		/* Numbering (only FIN) */
+		$num_op =3D new ICheckBox('numb_operation');
+		echo dossier::hidden();
+		echo HtmlInput::hidden('ac', $_REQUEST['ac']);
+		echo HtmlInput::hidden('p_jrn', -1);
+		echo HtmlInput::hidden('sa', 'add');
=20
-			$cn=3D$this->db;
+		$cn =3D $this->db;
=20
-			require_once('template/param_jrn.php');
+		require_once('template/param_jrn.php');
+	}
=20
-	}
 	/**
 	 * Insert a new ledger
 	 * @param type $array normally $_POST
@@ -3352,38 +3429,40 @@
 	function save_new($array)
 	{
 		$this->load();
-		extract ($array);
-		$this->jrn_def_id=3D-1;
-		$this->jrn_def_name=3D$p_jrn_name;
-		$this->jrn_def_ech_lib=3D$p_ech_lib;
-		$this->jrn_def_max_line_deb=3D$p_jrn_deb_max_line;
-		$this->jrn_def_type=3D$p_jrn_type;
-		$this->jrn_def_pj_pref=3D$jrn_def_pj_pref;
-		$this->jrn_def_fiche_deb=3D(isset($FICHEDEB))?join($FICHEDEB,','):"";
-		$this->jrn_def_code=3Dsprintf("%s%02d",trim(substr($this->jrn_def_type=
,0,1)),Acc_Ledger::next_number($this->db,$this->jrn_def_type));
+		extract($array);
+		$this->jrn_def_id =3D -1;
+		$this->jrn_def_name =3D $p_jrn_name;
+		$this->jrn_def_ech_lib =3D $p_ech_lib;
+		$this->jrn_def_max_line_deb =3D $p_jrn_deb_max_line;
+		$this->jrn_def_type =3D $p_jrn_type;
+		$this->jrn_def_pj_pref =3D $jrn_def_pj_pref;
+		$this->jrn_def_fiche_deb =3D (isset($FICHEDEB)) ? join($FICHEDEB, ',')=
 : "";
+		$this->jrn_def_code =3D sprintf("%s%02d", trim(substr($this->jrn_def_t=
ype, 0, 1)), Acc_Ledger::next_number($this->db, $this->jrn_def_type));
=20
-		switch($this->jrn_def_type)
+		switch ($this->jrn_def_type)
 		{
 			case 'ACH':
 			case 'VEN':
-				$this->jrn_def_fiche_cred=3D(isset($FICHECRED))?join($FICHECRED,',')=
:'';
+				$this->jrn_def_fiche_cred =3D (isset($FICHECRED)) ? join($FICHECRED,=
 ',') : '';
=20
 				break;
 			case 'ODS':
-				$this->jrn_def_class_deb=3D$p_jrn_class_deb;
+				$this->jrn_def_class_deb =3D $p_jrn_class_deb;
 				break;
 			case 'FIN':
-				$a=3Dnew Fiche($this->db);
-				$result=3D$a->get_by_qcode(trim(strtoupper($_POST['bank'])),false);
-				$bank=3D$a->id;
-				$this->jrn_def_bank=3D$bank;
-				if ( $result=3D=3D-1)throw new Exception ("Aucun compte en banque n'=
est donn=C3=A9");
-				$this->jrn_def_num_op=3D(isset($numb_operation))?1:0;
+				$a =3D new Fiche($this->db);
+				$result =3D $a->get_by_qcode(trim(strtoupper($_POST['bank'])), false=
);
+				$bank =3D $a->id;
+				$this->jrn_def_bank =3D $bank;
+				if ($result =3D=3D -1)
+					throw new Exception("Aucun compte en banque n'est donn=C3=A9");
+				$this->jrn_def_num_op =3D (isset($numb_operation)) ? 1 : 0;
 				break;
 		}
=20
 		parent::insert();
 	}
+
 	/**
 	 * delete a ledger IF is not already used
 	 * @exeption : cannot delete
@@ -3392,14 +3471,14 @@
 	{
 		try
 		{
-			if ( $this->db->get_value("select count(jr_id) from jrn where jr_def_=
id=3D$1",array($this->jrn_def_id))>0)
-					throw new Exception("Impossible d'effacer un journal qui contient d=
es op=C3=A9rations");
+			if ($this->db->get_value("select count(jr_id) from jrn where jr_def_i=
d=3D$1", array($this->jrn_def_id)) > 0)
+				throw new Exception("Impossible d'effacer un journal qui contient de=
s op=C3=A9rations");
 			parent::delete();
 		}
-		catch(Exception $e)
+		catch (Exception $e)
 		{
 			throw $e;
 		}
 	}
=20
-	}
+}

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-21 17:1=
4:48 UTC (rev 4972)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-21 18:4=
2:07 UTC (rev 4973)
@@ -472,7 +472,7 @@
=20
                 // always save quantity but in withStock we can find
                 // what card need a stock management
-                if ( $g_parameter->MY_STOCK=3D'Y')
+                if ( $g_parameter->MY_STOCK=3D'Y'&& isset ($repo))
                     Stock_Goods::insert_goods(array('db'=3D>$this->db,'j=
_id'=3D>$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i}=
,'dir'=3D>'d','repo'=3D>$repo)) ;
=20
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-21 17:14:48=
 UTC (rev 4972)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-21 18:42:07=
 UTC (rev 4973)
@@ -350,13 +350,13 @@
                        {"e_quant".$i
                        }
                        <0)?-1:1;
-               =20
+
                 // always save quantity but in withStock we can find
                 // what card need a stock management
-                if ( $g_parameter->MY_STOCK=3D'Y')
+                if ( $g_parameter->MY_STOCK=3D'Y' && isset ($repo))
                     Stock_Goods::insert_goods(array('db'=3D>$this->db,'j=
_id'=3D>$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i}=
,'dir'=3D>'c','repo'=3D>$repo)) ;
-                   =20
=20
+
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
                 {
                     // for each item, insert into operation_analytique *=
/

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-21 17:14:48 UTC (rev 4972)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-21 18:42:07 UTC (rev 4973)
@@ -439,4 +439,31 @@
              me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
     VALUES ('CFGDOCST', 'DIVPARM', 2,9, 'E', 0);
=20
-alter sequence document_state_s_id_seq restart with 100;
\ No newline at end of file
+alter sequence document_state_s_id_seq restart with 100;
+
+CREATE INDEX quant_purchase_jrn_fki
+  ON quant_purchase
+  USING btree
+  (qp_internal );
+
+
+
+ALTER TABLE quant_purchase DROP CONSTRAINT quant_purchase_qp_internal_fk=
ey;
+
+
+ALTER TABLE quant_purchase
+  ADD CONSTRAINT quant_purchase_qp_internal_fkey FOREIGN KEY (qp_interna=
l)
+      REFERENCES jrn (jr_internal) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+
+
+ALTER TABLE quant_sold DROP CONSTRAINT quant_sold_qs_internal_fkey;
+
+ALTER TABLE quant_sold
+  ADD CONSTRAINT quant_sold_qs_internal_fkey FOREIGN KEY (qs_internal)
+      REFERENCES jrn (jr_internal) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+CREATE INDEX quant_sold_jrn_fki
+  ON quant_sold
+  USING btree
+  (qs_internal );
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 07:51:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Si2OX-0000If-Rx
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 07:51:21 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 22 Jun 2012 13:42:06 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.219205.1340365880.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4974 - in phpcompta/trunk: include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2012 11:51:19 -0000

Author: danydb
Date: 2012-06-22 13:42:06 +0200 (Fri, 22 Jun 2012)
New Revision: 4974

Added:
   phpcompta/trunk/include/class_tool_uos.php
Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
0000636: Objet pour ?\195?\169viter le double encodage lors d'un recharch=
ement de la page

Added: phpcompta/trunk/include/class_tool_uos.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_tool_uos.php	                        (r=
ev 0)
+++ phpcompta/trunk/include/class_tool_uos.php	2012-06-22 11:42:06 UTC (r=
ev 4974)
@@ -0,0 +1,101 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+*/
+/* $Revision: $Revision $ */
+/**
+ * @file
+ * Objec to check a double insert into the database, this duplicate occu=
rs after=20
+ * a refresh of the web page
+ */
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+require_once 'class_database.php';
+define ('CODE_EXCP_DUPLICATE',901);
+class Tool_Uos
+{
+    /**
+     * Constructor $p_name will be set to $this->name, it is also the na=
me
+     * of the tag hidden in a form
+     * @global $cn Db connxion
+     * @param $p_name=20
+     */
+    function __construct($p_name)
+    {
+          global $cn;
+        $this->name=3D$p_name;
+        $this->id=3D$cn->get_next_seq('uos_pk_seq');
+    }
+    /**
+     * @brief return a string with a tag hidden and a uniq value=20
+     * @param $hHidden is the name of the tag hidden
+     * @return string : tag hidden
+     */
+    function hidden($hHidden)
+    {
+        return HtmlInput::hidden($hHidden,$this->id);
+    }
+    /**
+     * @brief Try to insert into the table tool_uos
+     * @global $cn Database connx
+     * @param $p_id integer is the value of hidden
+     * @throws Exception if the value $p_id is not unique
+     */
+    function save($p_id)
+    {
+        global $cn;
+        $sql=3D"insert into tool_uos(uos_value) values ($1)";
+        try {
+            $cn->exec_sql($sql,array($this->id));  =20
+        } catch (Exception $e)
+        {
+            throw new Exception('Duplicate value','CODE_EXCP_DUPLICATE',=
$e);
+        }
+    }
+    /**
+     * Count how many time we have this->id into the table tool_uos
+     * @global $cn Database connx
+     * @param $p_array is the array where to find the key name, usually =
it is
+     * $_POST. The default value is $_POST
+     * @return integer : 0 or 1
+     */
+    function get_count($p_array=3Dnull)
+    {
+        global $cn;
+        if ( $p_array =3D=3D null ) $p_array=3D$_POST;
+        $this->id=3D$p_array[$this->name];
+        $count=3D$cn->get_value('select count(*) from tool_uos where uos=
_value=3D$1',
+                array($p_id));
+        return $count;
+    }
+    function check ($p_array=3Dnull)
+    {
+        global $cn;
+        if ( $p_array =3D=3D null ) $p_array=3D$_POST;
+        $this->id=3D$p_array[$this->name];
+        try=20
+        {
+            $count=3D$cn->get_value('select count(*) from tool_uos where=
 uos_value=3D$1',
+                    array($p_id));
+            if ($count !=3D 0 ) throw new Exception ('DUPLICATE',CODE_EX=
CP_DUPLICATE);
+        }catch (Exception $e)
+        {
+            throw $e;
+        }
+    }
+}
+?>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-21 18:42:07 UTC (rev 4973)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-22 11:42:06 UTC (rev 4974)
@@ -466,4 +466,8 @@
 CREATE INDEX quant_sold_jrn_fki
   ON quant_sold
   USING btree
-  (qs_internal );
\ No newline at end of file
+  (qs_internal );
+
+
+create sequence uos_pk_seq;
+create table tool_uos (  uos_value bigint default nextval ('uos_pk_seq')=
 primary key );



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 07:51:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Si2Oo-0000JW-Vr
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 07:51:38 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 22 Jun 2012 13:42:23 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.219207.1340365897.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4975 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2012 11:51:37 -0000

Author: danydb
Date: 2012-06-22 13:42:22 +0200 (Fri, 22 Jun 2012)
New Revision: 4975

Modified:
   phpcompta/trunk/include/class_database.php
Log:
Improve Exception

Modified: phpcompta/trunk/include/class_database.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_database.php	2012-06-22 11:42:06 UTC (r=
ev 4974)
+++ phpcompta/trunk/include/class_database.php	2012-06-22 11:42:22 UTC (r=
ev 4975)
@@ -147,8 +147,8 @@
             }
             if ( ! $this->ret )
             {
-				$str_error=3Dpg_last_error($this->db);
-                throw new Exception ("  SQL ERROR $p_string ".$str_error=
,1);
+		$str_error=3Dpg_last_error($this->db). pg_result_error($this->db);
+                throw new Exception ("  SQL ERROR $p_string ".$str_error=
,1 );
             }
=20
         }



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 10:12:32 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Si4bA-0003Uk-Du
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 10:12:32 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 22 Jun 2012 16:03:09 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.219463.1340374351.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4976 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2012 14:12:30 -0000

Author: danydb
Date: 2012-06-22 16:03:08 +0200 (Fri, 22 Jun 2012)
New Revision: 4976

Modified:
   phpcompta/trunk/include/class_fiche.php
Log:
0000654: Ajout de la cat?\195?\169gorie de la fiche dans les d?\195?\169t=
ails

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-22 11:42:22 UTC (rev =
4975)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-22 14:03:08 UTC (rev =
4976)
@@ -423,7 +423,8 @@
         $f=3Dnew Fiche_Def($this->cn,$p_fiche_def);
         $f->Get();
         $array=3D$f->getAttribut();
-        $r=3D'<table style=3D"width:98%;margin:1%">';
+        $r=3Dh2($f->label,"");
+        $r.=3D'<table style=3D"width:98%;margin:1%">';
         foreach ($array as $attr)
         {
             $table=3D0;
@@ -561,8 +562,8 @@
 		/* show card type here */
 		$type_card =3D $this->cn->get_value('select fd_label from fiche_def jo=
in fiche using (fd_id) where f_id=3D$1', array($this->id));
 		$ret =3D "";
-		$ret.=3Dh2( $type_card, 'style=3D"display:inline"');
-		$ret.=3D'<span style=3D"font-weight:bolder"> id :' . $this->id . "</sp=
an>";
+		$ret.=3Dh2( "Cat=C3=A9gorie ".$type_card, 'style=3D"display:inline"');
+		$ret.=3D'<span style=3D"font-weight:bolder"> id fiche:' . $this->id . =
"</span>";
 		$ret.=3D"<table style=3D\"width:98%;margin:1%\">";
 		if (empty($attr))
 		{



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 13:11:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Si7OG-0005vG-8K
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 13:11:24 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 22 Jun 2012 19:02:09 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.219684.1340385083.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4977 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2012 17:11:22 -0000

Author: danydb
Date: 2012-06-22 19:02:08 +0200 (Fri, 22 Jun 2012)
New Revision: 4977

Modified:
   phpcompta/trunk/include/class_fiche.php
Log:
0000654: Ajout de la cat?\195?\169gorie de la fiche dans les d?\195?\169t=
ails

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-22 14:03:08 UTC (rev =
4976)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-22 17:02:08 UTC (rev =
4977)
@@ -423,7 +423,7 @@
         $f=3Dnew Fiche_Def($this->cn,$p_fiche_def);
         $f->Get();
         $array=3D$f->getAttribut();
-        $r=3Dh2($f->label,"");
+        $r=3Dh2('Cat=C3=A9gorie '.$f->label,"");
         $r.=3D'<table style=3D"width:98%;margin:1%">';
         foreach ($array as $attr)
         {
@@ -563,7 +563,7 @@
 		$type_card =3D $this->cn->get_value('select fd_label from fiche_def jo=
in fiche using (fd_id) where f_id=3D$1', array($this->id));
 		$ret =3D "";
 		$ret.=3Dh2( "Cat=C3=A9gorie ".$type_card, 'style=3D"display:inline"');
-		$ret.=3D'<span style=3D"font-weight:bolder"> id fiche:' . $this->id . =
"</span>";
+		$ret.=3D'<span style=3D"font-weight:bolder;margin-right:5px"> id fiche=
:' . $this->id . "</span>";
 		$ret.=3D"<table style=3D\"width:98%;margin:1%\">";
 		if (empty($attr))
 		{



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 13:18:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Si7Ul-0007i7-Oh
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 13:18:07 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 22 Jun 2012 19:08:51 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.219689.1340385486.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4978 - in phpcompta/trunk: include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2012 17:18:06 -0000

Author: danydb
Date: 2012-06-22 19:08:51 +0200 (Fri, 22 Jun 2012)
New Revision: 4978

Removed:
   phpcompta/trunk/include/fiche.inc.php
Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
Change CARD et PRINTCARD

Deleted: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-22 17:02:08 UTC (rev 49=
77)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-22 17:08:51 UTC (rev 49=
78)
@@ -1,505 +0,0 @@
-<?php
-/*
- *   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 b=
y
- *   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-130=
7  USA
-*/
-/* $Revision$ */
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/*! \file
- * \brief module to manage the card (removing, listing, creating, modify=
 attribut)
- */
-include_once ("ac_common.php");
-require_once("class_itext.php");
-require_once("class_ihidden.php");
-require_once('class_fiche.php');
-require_once('class_database.php');
-include_once ("user_menu.php");
-require_once('class_dossier.php');
-require_once('class_ipopup.php');
-// Necessaire ???
-/*echo IPoste::ipopup('ipop_account');
-echo ICard::ipopup('ipop_card');*/
-
-$str_dossier=3Ddossier::get();
-global $g_user,$cn;
-
-$pop_tva=3Dnew IPopup('popup_tva');
-$pop_tva->title=3D_('Choix TVA');
-$pop_tva->value=3D'';
-echo $pop_tva->input();
-
-
-// Security check
-$write=3D$g_user->check_action(FICADD);
-if ($write =3D=3D 0 )
-{
-    /* Cannot Access */
-    NoAccess();
-}
-
-function ShowRecherche()
-{
-    echo '<form method=3D"GET" action=3D"?">';
-    echo dossier::hidden();
-      echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-    $w=3Dnew IText();
-    $search_text=3D(isset($_REQUEST['search_text']))?$_REQUEST['search_t=
ext']:"";
-    $h=3Dnew IHidden();
-    echo $h->input('p_action','fiche');
-    echo $h->input('action','search');
-    echo $h->input('ac',$_REQUEST['ac']);
-
-    echo _("Recherche :").$w->input('search_text',$search_text);
-    echo HtmlInput::submit('submit',_('Rechercher'));
-    echo '</form>';
-}
-function ShowFicheDefInput($p_fiche_def)
-{
-    $r=3D"";
-    // Save the label
-
-    $p_fiche_def->Get();
-    $p_fiche_def->GetAttribut();
-
-    /*  we change the main attribute */
-    if (isset ($_REQUEST['label']) )
-    {
-        $p_fiche_def->SaveLabel($_REQUEST['label']);
-        if ( isset($_REQUEST['create']))
-        {
-            $p_fiche_def->set_autocreate(true);
-        }
-        else
-        {
-            $p_fiche_def->set_autocreate(false);
-        }
-        $p_fiche_def->save_class_base($_REQUEST['class_base']);
-    }
-    $p_fiche_def->Get();
-    $r.=3D '<H2 class=3D"info">'.$p_fiche_def->id." ".h($p_fiche_def->la=
bel).'</H2>';
-    $r.=3D'<fieldset><legend>Donn=C3=A9es g=C3=A9n=C3=A9rales</legend>';
-
-    /* show the values label class_base and create account */
-    $r.=3D'<form method=3D"post">';
-    $r.=3D HtmlInput::hidden('ac',$_REQUEST['ac']);
-    $r.=3Ddossier::hidden();
-    $r.=3DHtmlInput::hidden("fd_id",$p_fiche_def->id);
-    $r.=3DHtmlInput::hidden("ac",$_REQUEST['ac']);
-    $r.=3DHtmlInput::hidden("p_action","fiche");
-    $r.=3D $p_fiche_def->input_base();
-    $r.=3D'<hr>';
-    $r.=3DHtmlInput::submit('change_name',_('Sauver'));
-    $r.=3D'</form>';
-    $r.=3D'</fieldset>';
-    /* attributes */
-    $r.=3D'<fieldset><legend>D=C3=A9tails</legend>';
-
-    $r.=3D '<FORM action=3D"do.php" method=3D"POST">';
-    $r.=3Ddossier::hidden();
-    $r.=3D HtmlInput::hidden('ac',$_REQUEST['ac']);
-    $r.=3DHtmlInput::hidden("fd_id",$p_fiche_def->id);
-    $r.=3DHtmlInput::hidden("ac",$_REQUEST['ac']);
-    $r.=3D $p_fiche_def->DisplayAttribut("remove");
-    $r.=3D HtmlInput::submit('add_line',_('Ajoutez cet =C3=A9l=C3=A9ment=
'));
-    $r.=3D HtmlInput::submit("save_line",_("Sauvez"));
-    $r.=3DHtmlInput::submit('remove_cat',_('Effacer cette cat=C3=A9gorie=
'),'onclick=3D"return confirm(\''._('Vous confirmez ?').'\')"');
-    // if there is nothing to remove then hide the button
-    if ( strpos ($r,"chk_remove") !=3D 0 )
-    {
-        $r.=3DHtmlInput::submit('remove_line',_("Enleve les =C3=A9l=C3=A9=
ments coch=C3=A9s"),"onclick=3D\"return confirm('Vous confirmez?')\"" );
-    }
-    $r.=3D "</form>";
-    $r.=3D" <p class=3D\"notice\"> "._("Attention : il n'y aura pas de d=
emande de confirmation pour enlever les
-                                   attributs s=C3=A9lectionn=C3=A9s. Il =
ne sera pas possible de revenir en arri=C3=A8re")."</p>";
-    $r.=3D'</fieldset>';
-
-    return $r;
-}
-
-$recherche=3Dtrue;
-// Creation of a new model of card
-// in the database
-if ( isset($_POST['add_modele'])    )
-{
-    $g_user->can_request(FICCAT);
-    // insert the model of card in database
-    $fiche_def=3Dnew Fiche_Def($cn);
-    $fiche_def->Add($_POST);
-}
-$r=3D"";
-
-if ( isset ($_POST['remove_cat'] )  )
-{
-    $g_user->can_request(FICCAT);
-
-    $fd_id=3Dnew Fiche_Def($cn,$_POST['fd_id']);
-    $remains=3D$fd_id->remove();
-    if ( $remains !=3D 0 )
-        /* some card are not removed because it is used */
-        alert('Impossible d\'enlever cette cat=C3=A9gorie, certaines fic=
hes sont encore utilis=C3=A9es'."\n".
-              'Les fiches non utilis=C3=A9es ont cependant =C3=A9t=C3=A9=
 effac=C3=A9es');
-}
-// Add a line in the card model
-if ( isset ($_POST["add_line"])  )
-{
-    $g_user->can_request(FIC);
-
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-        // Insert Line
-        $fiche_def->InsertAttribut($_REQUEST['ad_id']);
-
-        $r.=3DShowFicheDefInput($fiche_def);
-
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-}
-/* ------------------------------------------------- */
-/* SAVE ORDER */
-/* ------------------------------------------------- */
-
-if ( isset($_POST['save_line']))
-{
-    $g_user->can_request(FICCAT);
-    $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-    $fiche_def->save_order($_POST);
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-        // Insert Line
-        $r.=3DShowFicheDefInput($fiche_def);
-
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-
-}
-// Remove lines from a card model
-if ( isset ($_POST['remove_line'])   )
-{
-    $g_user->can_request(FICCAT);
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        if ( isset($_REQUEST['chk_remove']))
-        {
-            $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-            // Insert Line
-            // demander confirmation
-
-            $fiche_def->RemoveAttribut($_REQUEST['chk_remove']);
-            $r.=3DShowFicheDefInput($fiche_def);
-        }
-
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-}
-// Change the name of the card  model
-if ( isset ($_POST["change_name"] )   )
-{
-    $g_user->can_request(FICCAT);
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> "._("Pas d'acc=C3=A8s")." </h2>";
-    else
-    {
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-        $r.=3DShowFicheDefInput($fiche_def);
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-    ShowMenuFiche(Dossier::id());
-    echo $r;
-    exit();
-}
-
-ShowMenuFiche(Dossier::id());
-echo $r;
-
-//----------------------------------------------------------------------=
--------
-// Get action
-if ( isset ( $_GET["action"]) )
-{
-    $action=3D$_GET["action"];
-    // View the details of the selected cat. of cards
-    if ( isset ($_GET["fiche"]) && $action=3D=3D"vue"
-            && ! isset ($_POST['add_fiche'])
-            && ! isset ($_POST['update_fiche'])
-            && ! isset ($_POST['move'])
-            && ! isset ($_POST['delete']))
-    {
-        $g_user->can_request(FICADD);
-
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-        $fiche_def->myList();
-
-        echo '</DIV>';
-
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Display the detail of a card
-    if ($action=3D=3D "detail" )
-    {
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $t=3Dfalse;
-        if ( $g_user->check_action(FICADD)=3D=3D0)
-        {
-            echo '<H2 class=3D"info"> Vos changements ne seront pas sauv=
=C3=A9s</h2>';
-            $t=3Dtrue;
-        }
-        $str=3D"&".dossier::get();
-        $fiche=3Dnew Fiche($cn,$_GET["fiche_id"]);
-        $fiche->get_categorie();
-        $fiche_def=3Dnew Fiche_Def($cn,$fiche->fd_id);
-        $fiche_def->Get();
-        echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
-
-        if ( $_SESSION['g_pagesize'] !=3D -1 )
-        {
-            // retrieve value
-            // with offet &offset=3D15&step=3D15&page=3D2&size=3D15
-            if ( isset($_GET['offset']) && $_SESSION['g_pagesize'] !=3D =
-1)
-            {
-                $str=3Dsprintf("&offset=3D%s&step=3D%s&page=3D%s&size=3D=
%s",
-                             $_GET['offset'],
-                             $_GET['step'],
-                             $_GET['page'],
-                             $_GET['size']);
-            }
-
-
-        }
-        if ( $write !=3D 0 )
-            echo '<form method=3D"post" action=3D"?p_action=3Dfiche&acti=
on=3Dvue&fiche=3D'.$_GET['fiche'].$str.'">';
-        echo dossier::hidden();
-        echo $fiche->Display($t);
-	echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-        echo HtmlInput::hidden("f_id",$_GET['fiche_id']);
-        if ( $write !=3D 0 )
-        {
-            $iselect=3Dnew ISelect('move_to');
-            $iselect->value=3D$cn->make_array('select fd_id,fd_label fro=
m fiche_def order by fd_label'); //where frd_id=3D'.$fiche->get_fiche_def=
_ref_id());
-
-            echo HtmlInput::submit("update_fiche","Mise &agrave; jour");
-            echo HtmlInput::submit("delete" ,"Effacer cette fiche","oncl=
ick=3D\"return confirm('"._('Vous confirmez ?')."');\"");
-	    echo HtmlInput::history_card_button($_GET['fiche_id'],_('Historique=
'));
-            echo HtmlInput::submit('move',_('D=C3=A9placer vers'),"oncli=
ck=3D\"return confirm('"._('Attention, certains attributs pourraient =C3=AA=
tre ajout=C3=A9s =C3=A0 la cat=C3=A9gorie de destination, vous confirmez =
?')."');\"");
-            echo $iselect->input();
-        }
-        $str=3D"";
-        echo HtmlInput::button_anchor(_('Retour'),'?p_action=3Dfiche&act=
ion=3Dvue&'.$str_dossier.'&fiche=3D'.$fiche->fiche_def.$str.
-		"&ac=3D".$_REQUEST['ac']);
-
-        if ( $write !=3D 0 ) echo '</form>';
-        echo '</DIV>';
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Display the form where you can enter
-    // the property of the card model
-    if ($action =3D=3D "add_modele" )
-    {
-        $g_user->can_request(FICCAT);
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        echo '<form method=3D"post">';
-	echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-        $oFiche_Def=3Dnew Fiche_Def($cn);
-        echo HtmlInput::hidden("p_action","fiche");
-        echo dossier::hidden();
-        echo $oFiche_Def->input(); //    CreateCategory($cn,$search);
-        echo HtmlInput::submit("add_modele" ,"Sauve");
-
-        echo '</form>';
-        echo '</DIV>';
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Modify a card Model
-    if ($action =3D=3D "modifier" )
-    {
-        $g_user->can_request(FICCAT);
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-
-        echo ShowFicheDefInput($fiche_def);
-        echo '</DIV>';
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Search a card
-    if ( $action =3D=3D "search" )
-    {
-        echo '<DIV class=3D"redcontent" style=3D"width:auto;">';
-        ShowRecherche();
-        $sql=3D"select distinct f_id,fd_id from fiche join fiche_detail =
using (f_id)
-                 where
-             upper(ad_value) like upper('%".sql_string($_GET["search_tex=
t"])."%') order by f_id";
-
-        $all=3D$cn->get_array($sql);
-        // test on the size
-        //
-        if ( sizeof($all) !=3D 0 )
-        {
-
-            echo "<b>R=C3=A9sultat : ".sizeof($all).'=C3=A9l=C3=A9ments =
trouv=C3=A9s </b><br>';
-            foreach ($all as $f_id)
-            {
-                $fiche=3Dnew Fiche($cn,$f_id['f_id']);
-                echo '<A  href=3D"?p_action=3Dfiche&'.$str_dossier.'&act=
ion=3Ddetail&fiche_id=3D'.$f_id['f_id'].
-                '&fiche=3D'.$f_id['fd_id']."&ac=3D".$_REQUEST['ac'].'">'=
.
-                $fiche->getName().'</A>';
-            }
-        }
-        else
-        {
-            echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-            echo "Aucun r=C3=A9sultat trouv=C3=A9";
-
-        }
-        echo '</div>';
-
-
-    }
-    $recherche=3Dfalse;
-}
-// Display a blank  card from the selected category
-if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) )
-{
-    $g_user->can_request(FICADD);
-
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche_def=3Dnew Fiche_Def($cn,$_POST['fiche']);
-        $fiche_def->Get();
-        echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
-        $fiche=3Dnew Fiche($cn,0);
-		var_dump($_SERVER);
-        echo '<form method=3D"post" >';
-        echo dossier::hidden();
-		echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-		echo HtmlInput::hidden('fiche',$_POST['fiche']);
-        echo $fiche->blank($_POST['fiche']);
-        echo HtmlInput::submit("add_fiche","Ajout");
-
-
-        echo '</form>';
-    }
-    echo '</DIV>';
-    $recherche=3Dfalse;
-    exit();
-}
-//----------------------------------------------------------------------=
--------
-// delete a card
-if (isset($_POST['delete']) )
-{
-    $g_user->can_request(FIC);
-    ShowRecherche();
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche=3Dnew Fiche($cn,$_POST["f_id"]);
-        $fiche->remove();
-    }
-    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-    $fiche_def->myList();
-
-    echo "</DIV>";
-    exit();
-}
-//----------------------------------------------------------------------=
--------
-// Add the data (attribute) of the card
-if ( isset ($_POST["add_fiche"]) )
-{
-    $g_user->can_request(FICADD);
-    if ( $write =3D=3D0)
-    {
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    }
-    else
-    {
-        ShowRecherche();
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $fiche=3Dnew Fiche($cn);
-        $fiche->Save($_REQUEST['fiche']);
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fiche']);
-        $fiche_def->myList();
-
-
-    }
-    echo '</DIV>';
-    $recherche=3Dfalse;
-}
-//----------------------------------------------------------------------=
--------
-// Update a card
-if ( isset ($_POST["update_fiche"])  )
-{
-    $g_user->can_request(FIC);
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche=3Dnew Fiche($cn,$_POST['f_id']);
-        $fiche->Save();
-
-    }
-    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-    $fiche_def->myList();
-
-
-
-
-
-    echo '</DIV>';
-    $recherche=3Dfalse;
-}
-//----------------------------------------------------------------------=
----------
-// Move a card to a new category
-if ( isset($_POST['move']))
-{
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    $fiche=3Dnew Fiche($cn,$_POST['f_id']);
-    $fiche->move_to($_POST['move_to']);
-    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-    $fiche_def->myList();
-    echo '</div>';
-}
-//--Search menu
-if ( $recherche=3D=3Dtrue)
-{
-    ShowRecherche();
-}
-html_page_stop();
-?>

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-22 17:02:08 UTC (rev 4977)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-22 17:08:51 UTC (rev 4978)
@@ -471,3 +471,6 @@
=20
 create sequence uos_pk_seq;
 create table tool_uos (  uos_value bigint default nextval ('uos_pk_seq')=
 primary key );
+
+update menu_ref set me_code=3D'CFGCARD',me_file=3D'cfgfiche.inc.php' whe=
re me_code=3D'CARD';
+update menu_ref set me_code=3D'CARD',me_file=3D'fiche.inc.php' where me_=
code=3D'PRINTCARD';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 13:18:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Si7VO-0008Pp-79
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 13:18:46 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 22 Jun 2012 19:09:29 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.219698.1340385524.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4979 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2012 17:18:44 -0000

Author: danydb
Date: 2012-06-22 19:09:29 +0200 (Fri, 22 Jun 2012)
New Revision: 4979

Added:
   phpcompta/trunk/include/cfgfiche.inc.php
Log:
Rename file


Copied: phpcompta/trunk/include/cfgfiche.inc.php (from rev 4976, phpcompt=
a/trunk/include/fiche.inc.php)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/cfgfiche.inc.php	                        (rev=
 0)
+++ phpcompta/trunk/include/cfgfiche.inc.php	2012-06-22 17:09:29 UTC (rev=
 4979)
@@ -0,0 +1,505 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+*/
+/* $Revision$ */
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+/*! \file
+ * \brief module to manage the card (removing, listing, creating, modify=
 attribut)
+ */
+include_once ("ac_common.php");
+require_once("class_itext.php");
+require_once("class_ihidden.php");
+require_once('class_fiche.php');
+require_once('class_database.php');
+include_once ("user_menu.php");
+require_once('class_dossier.php');
+require_once('class_ipopup.php');
+// Necessaire ???
+/*echo IPoste::ipopup('ipop_account');
+echo ICard::ipopup('ipop_card');*/
+
+$str_dossier=3Ddossier::get();
+global $g_user,$cn;
+
+$pop_tva=3Dnew IPopup('popup_tva');
+$pop_tva->title=3D_('Choix TVA');
+$pop_tva->value=3D'';
+echo $pop_tva->input();
+
+
+// Security check
+$write=3D$g_user->check_action(FICADD);
+if ($write =3D=3D 0 )
+{
+    /* Cannot Access */
+    NoAccess();
+}
+
+function ShowRecherche()
+{
+    echo '<form method=3D"GET" action=3D"?">';
+    echo dossier::hidden();
+      echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+    $w=3Dnew IText();
+    $search_text=3D(isset($_REQUEST['search_text']))?$_REQUEST['search_t=
ext']:"";
+    $h=3Dnew IHidden();
+    echo $h->input('p_action','fiche');
+    echo $h->input('action','search');
+    echo $h->input('ac',$_REQUEST['ac']);
+
+    echo _("Recherche :").$w->input('search_text',$search_text);
+    echo HtmlInput::submit('submit',_('Rechercher'));
+    echo '</form>';
+}
+function ShowFicheDefInput($p_fiche_def)
+{
+    $r=3D"";
+    // Save the label
+
+    $p_fiche_def->Get();
+    $p_fiche_def->GetAttribut();
+
+    /*  we change the main attribute */
+    if (isset ($_REQUEST['label']) )
+    {
+        $p_fiche_def->SaveLabel($_REQUEST['label']);
+        if ( isset($_REQUEST['create']))
+        {
+            $p_fiche_def->set_autocreate(true);
+        }
+        else
+        {
+            $p_fiche_def->set_autocreate(false);
+        }
+        $p_fiche_def->save_class_base($_REQUEST['class_base']);
+    }
+    $p_fiche_def->Get();
+    $r.=3D '<H2 class=3D"info">'.$p_fiche_def->id." ".h($p_fiche_def->la=
bel).'</H2>';
+    $r.=3D'<fieldset><legend>Donn=C3=A9es g=C3=A9n=C3=A9rales</legend>';
+
+    /* show the values label class_base and create account */
+    $r.=3D'<form method=3D"post">';
+    $r.=3D HtmlInput::hidden('ac',$_REQUEST['ac']);
+    $r.=3Ddossier::hidden();
+    $r.=3DHtmlInput::hidden("fd_id",$p_fiche_def->id);
+    $r.=3DHtmlInput::hidden("ac",$_REQUEST['ac']);
+    $r.=3DHtmlInput::hidden("p_action","fiche");
+    $r.=3D $p_fiche_def->input_base();
+    $r.=3D'<hr>';
+    $r.=3DHtmlInput::submit('change_name',_('Sauver'));
+    $r.=3D'</form>';
+    $r.=3D'</fieldset>';
+    /* attributes */
+    $r.=3D'<fieldset><legend>D=C3=A9tails</legend>';
+
+    $r.=3D '<FORM action=3D"do.php" method=3D"POST">';
+    $r.=3Ddossier::hidden();
+    $r.=3D HtmlInput::hidden('ac',$_REQUEST['ac']);
+    $r.=3DHtmlInput::hidden("fd_id",$p_fiche_def->id);
+    $r.=3DHtmlInput::hidden("ac",$_REQUEST['ac']);
+    $r.=3D $p_fiche_def->DisplayAttribut("remove");
+    $r.=3D HtmlInput::submit('add_line',_('Ajoutez cet =C3=A9l=C3=A9ment=
'));
+    $r.=3D HtmlInput::submit("save_line",_("Sauvez"));
+    $r.=3DHtmlInput::submit('remove_cat',_('Effacer cette cat=C3=A9gorie=
'),'onclick=3D"return confirm(\''._('Vous confirmez ?').'\')"');
+    // if there is nothing to remove then hide the button
+    if ( strpos ($r,"chk_remove") !=3D 0 )
+    {
+        $r.=3DHtmlInput::submit('remove_line',_("Enleve les =C3=A9l=C3=A9=
ments coch=C3=A9s"),"onclick=3D\"return confirm('Vous confirmez?')\"" );
+    }
+    $r.=3D "</form>";
+    $r.=3D" <p class=3D\"notice\"> "._("Attention : il n'y aura pas de d=
emande de confirmation pour enlever les
+                                   attributs s=C3=A9lectionn=C3=A9s. Il =
ne sera pas possible de revenir en arri=C3=A8re")."</p>";
+    $r.=3D'</fieldset>';
+
+    return $r;
+}
+
+$recherche=3Dtrue;
+// Creation of a new model of card
+// in the database
+if ( isset($_POST['add_modele'])    )
+{
+    $g_user->can_request(FICCAT);
+    // insert the model of card in database
+    $fiche_def=3Dnew Fiche_Def($cn);
+    $fiche_def->Add($_POST);
+}
+$r=3D"";
+
+if ( isset ($_POST['remove_cat'] )  )
+{
+    $g_user->can_request(FICCAT);
+
+    $fd_id=3Dnew Fiche_Def($cn,$_POST['fd_id']);
+    $remains=3D$fd_id->remove();
+    if ( $remains !=3D 0 )
+        /* some card are not removed because it is used */
+        alert('Impossible d\'enlever cette cat=C3=A9gorie, certaines fic=
hes sont encore utilis=C3=A9es'."\n".
+              'Les fiches non utilis=C3=A9es ont cependant =C3=A9t=C3=A9=
 effac=C3=A9es');
+}
+// Add a line in the card model
+if ( isset ($_POST["add_line"])  )
+{
+    $g_user->can_request(FIC);
+
+    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
+    if ( $write =3D=3D0)
+        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
+    else
+    {
+        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+        // Insert Line
+        $fiche_def->InsertAttribut($_REQUEST['ad_id']);
+
+        $r.=3DShowFicheDefInput($fiche_def);
+
+    }
+    $r.=3D '</DIV>';
+    $recherche=3Dfalse;
+}
+/* ------------------------------------------------- */
+/* SAVE ORDER */
+/* ------------------------------------------------- */
+
+if ( isset($_POST['save_line']))
+{
+    $g_user->can_request(FICCAT);
+    $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+    $fiche_def->save_order($_POST);
+    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
+    if ( $write =3D=3D0)
+        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
+    else
+    {
+        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+        // Insert Line
+        $r.=3DShowFicheDefInput($fiche_def);
+
+    }
+    $r.=3D '</DIV>';
+    $recherche=3Dfalse;
+
+}
+// Remove lines from a card model
+if ( isset ($_POST['remove_line'])   )
+{
+    $g_user->can_request(FICCAT);
+    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
+    if ( $write =3D=3D0)
+        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
+    else
+    {
+        if ( isset($_REQUEST['chk_remove']))
+        {
+            $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+            // Insert Line
+            // demander confirmation
+
+            $fiche_def->RemoveAttribut($_REQUEST['chk_remove']);
+            $r.=3DShowFicheDefInput($fiche_def);
+        }
+
+    }
+    $r.=3D '</DIV>';
+    $recherche=3Dfalse;
+}
+// Change the name of the card  model
+if ( isset ($_POST["change_name"] )   )
+{
+    $g_user->can_request(FICCAT);
+    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
+    if ( $write =3D=3D0)
+        $r.=3D "<h2 class=3D\"error\"> "._("Pas d'acc=C3=A8s")." </h2>";
+    else
+    {
+        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+        $r.=3DShowFicheDefInput($fiche_def);
+    }
+    $r.=3D '</DIV>';
+    $recherche=3Dfalse;
+    ShowMenuFiche(Dossier::id());
+    echo $r;
+    exit();
+}
+
+ShowMenuFiche(Dossier::id());
+echo $r;
+
+//----------------------------------------------------------------------=
--------
+// Get action
+if ( isset ( $_GET["action"]) )
+{
+    $action=3D$_GET["action"];
+    // View the details of the selected cat. of cards
+    if ( isset ($_GET["fiche"]) && $action=3D=3D"vue"
+            && ! isset ($_POST['add_fiche'])
+            && ! isset ($_POST['update_fiche'])
+            && ! isset ($_POST['move'])
+            && ! isset ($_POST['delete']))
+    {
+        $g_user->can_request(FICADD);
+
+        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+        $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
+        $fiche_def->myList();
+
+        echo '</DIV>';
+
+        $recherche=3Dfalse;
+    }
+    //__________________________________________________________________=
_______
+    // Display the detail of a card
+    if ($action=3D=3D "detail" )
+    {
+        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+        $t=3Dfalse;
+        if ( $g_user->check_action(FICADD)=3D=3D0)
+        {
+            echo '<H2 class=3D"info"> Vos changements ne seront pas sauv=
=C3=A9s</h2>';
+            $t=3Dtrue;
+        }
+        $str=3D"&".dossier::get();
+        $fiche=3Dnew Fiche($cn,$_GET["fiche_id"]);
+        $fiche->get_categorie();
+        $fiche_def=3Dnew Fiche_Def($cn,$fiche->fd_id);
+        $fiche_def->Get();
+        echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
+
+        if ( $_SESSION['g_pagesize'] !=3D -1 )
+        {
+            // retrieve value
+            // with offet &offset=3D15&step=3D15&page=3D2&size=3D15
+            if ( isset($_GET['offset']) && $_SESSION['g_pagesize'] !=3D =
-1)
+            {
+                $str=3Dsprintf("&offset=3D%s&step=3D%s&page=3D%s&size=3D=
%s",
+                             $_GET['offset'],
+                             $_GET['step'],
+                             $_GET['page'],
+                             $_GET['size']);
+            }
+
+
+        }
+        if ( $write !=3D 0 )
+            echo '<form method=3D"post" action=3D"?p_action=3Dfiche&acti=
on=3Dvue&fiche=3D'.$_GET['fiche'].$str.'">';
+        echo dossier::hidden();
+        echo $fiche->Display($t);
+	echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+        echo HtmlInput::hidden("f_id",$_GET['fiche_id']);
+        if ( $write !=3D 0 )
+        {
+            $iselect=3Dnew ISelect('move_to');
+            $iselect->value=3D$cn->make_array('select fd_id,fd_label fro=
m fiche_def order by fd_label'); //where frd_id=3D'.$fiche->get_fiche_def=
_ref_id());
+
+            echo HtmlInput::submit("update_fiche","Mise &agrave; jour");
+            echo HtmlInput::submit("delete" ,"Effacer cette fiche","oncl=
ick=3D\"return confirm('"._('Vous confirmez ?')."');\"");
+	    echo HtmlInput::history_card_button($_GET['fiche_id'],_('Historique=
'));
+            echo HtmlInput::submit('move',_('D=C3=A9placer vers'),"oncli=
ck=3D\"return confirm('"._('Attention, certains attributs pourraient =C3=AA=
tre ajout=C3=A9s =C3=A0 la cat=C3=A9gorie de destination, vous confirmez =
?')."');\"");
+            echo $iselect->input();
+        }
+        $str=3D"";
+        echo HtmlInput::button_anchor(_('Retour'),'?p_action=3Dfiche&act=
ion=3Dvue&'.$str_dossier.'&fiche=3D'.$fiche->fiche_def.$str.
+		"&ac=3D".$_REQUEST['ac']);
+
+        if ( $write !=3D 0 ) echo '</form>';
+        echo '</DIV>';
+        $recherche=3Dfalse;
+    }
+    //__________________________________________________________________=
_______
+    // Display the form where you can enter
+    // the property of the card model
+    if ($action =3D=3D "add_modele" )
+    {
+        $g_user->can_request(FICCAT);
+        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+        echo '<form method=3D"post">';
+	echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+        $oFiche_Def=3Dnew Fiche_Def($cn);
+        echo HtmlInput::hidden("p_action","fiche");
+        echo dossier::hidden();
+        echo $oFiche_Def->input(); //    CreateCategory($cn,$search);
+        echo HtmlInput::submit("add_modele" ,"Sauve");
+
+        echo '</form>';
+        echo '</DIV>';
+        $recherche=3Dfalse;
+    }
+    //__________________________________________________________________=
_______
+    // Modify a card Model
+    if ($action =3D=3D "modifier" )
+    {
+        $g_user->can_request(FICCAT);
+        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+        $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
+
+        echo ShowFicheDefInput($fiche_def);
+        echo '</DIV>';
+        $recherche=3Dfalse;
+    }
+    //__________________________________________________________________=
_______
+    // Search a card
+    if ( $action =3D=3D "search" )
+    {
+        echo '<DIV class=3D"redcontent" style=3D"width:auto;">';
+        ShowRecherche();
+        $sql=3D"select distinct f_id,fd_id from fiche join fiche_detail =
using (f_id)
+                 where
+             upper(ad_value) like upper('%".sql_string($_GET["search_tex=
t"])."%') order by f_id";
+
+        $all=3D$cn->get_array($sql);
+        // test on the size
+        //
+        if ( sizeof($all) !=3D 0 )
+        {
+
+            echo "<b>R=C3=A9sultat : ".sizeof($all).'=C3=A9l=C3=A9ments =
trouv=C3=A9s </b><br>';
+            foreach ($all as $f_id)
+            {
+                $fiche=3Dnew Fiche($cn,$f_id['f_id']);
+                echo '<A  href=3D"?p_action=3Dfiche&'.$str_dossier.'&act=
ion=3Ddetail&fiche_id=3D'.$f_id['f_id'].
+                '&fiche=3D'.$f_id['fd_id']."&ac=3D".$_REQUEST['ac'].'">'=
.
+                $fiche->getName().'</A>';
+            }
+        }
+        else
+        {
+            echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+            echo "Aucun r=C3=A9sultat trouv=C3=A9";
+
+        }
+        echo '</div>';
+
+
+    }
+    $recherche=3Dfalse;
+}
+// Display a blank  card from the selected category
+if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) )
+{
+    $g_user->can_request(FICADD);
+
+    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+    if ( $write =3D=3D0)
+        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
+    else
+    {
+        $fiche_def=3Dnew Fiche_Def($cn,$_POST['fiche']);
+        $fiche_def->Get();
+        echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
+        $fiche=3Dnew Fiche($cn,0);
+		var_dump($_SERVER);
+        echo '<form method=3D"post" >';
+        echo dossier::hidden();
+		echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+		echo HtmlInput::hidden('fiche',$_POST['fiche']);
+        echo $fiche->blank($_POST['fiche']);
+        echo HtmlInput::submit("add_fiche","Ajout");
+
+
+        echo '</form>';
+    }
+    echo '</DIV>';
+    $recherche=3Dfalse;
+    exit();
+}
+//----------------------------------------------------------------------=
--------
+// delete a card
+if (isset($_POST['delete']) )
+{
+    $g_user->can_request(FIC);
+    ShowRecherche();
+    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+    if ( $write =3D=3D0)
+        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
+    else
+    {
+        $fiche=3Dnew Fiche($cn,$_POST["f_id"]);
+        $fiche->remove();
+    }
+    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
+    $fiche_def->myList();
+
+    echo "</DIV>";
+    exit();
+}
+//----------------------------------------------------------------------=
--------
+// Add the data (attribute) of the card
+if ( isset ($_POST["add_fiche"]) )
+{
+    $g_user->can_request(FICADD);
+    if ( $write =3D=3D0)
+    {
+        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
+    }
+    else
+    {
+        ShowRecherche();
+        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+        $fiche=3Dnew Fiche($cn);
+        $fiche->Save($_REQUEST['fiche']);
+        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fiche']);
+        $fiche_def->myList();
+
+
+    }
+    echo '</DIV>';
+    $recherche=3Dfalse;
+}
+//----------------------------------------------------------------------=
--------
+// Update a card
+if ( isset ($_POST["update_fiche"])  )
+{
+    $g_user->can_request(FIC);
+    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+    if ( $write =3D=3D0)
+        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
+    else
+    {
+        $fiche=3Dnew Fiche($cn,$_POST['f_id']);
+        $fiche->Save();
+
+    }
+    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
+    $fiche_def->myList();
+
+
+
+
+
+    echo '</DIV>';
+    $recherche=3Dfalse;
+}
+//----------------------------------------------------------------------=
----------
+// Move a card to a new category
+if ( isset($_POST['move']))
+{
+    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
+    $fiche=3Dnew Fiche($cn,$_POST['f_id']);
+    $fiche->move_to($_POST['move_to']);
+    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
+    $fiche_def->myList();
+    echo '</div>';
+}
+//--Search menu
+if ( $recherche=3D=3Dtrue)
+{
+    ShowRecherche();
+}
+html_page_stop();
+?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 13:19:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Si7W0-0008RD-C6
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 13:19:24 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 22 Jun 2012 19:10:06 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.219701.1340385563.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4980 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2012 17:19:22 -0000

Author: danydb
Date: 2012-06-22 19:10:06 +0200 (Fri, 22 Jun 2012)
New Revision: 4980

Added:
   phpcompta/trunk/include/fiche.inc.php
Removed:
   phpcompta/trunk/include/impress_fiche.inc.php
Log:
rename impress_fiche.inc.php to fiche.inc.php


Copied: phpcompta/trunk/include/fiche.inc.php (from rev 4979, phpcompta/t=
runk/include/impress_fiche.inc.php)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	                        (rev 0)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-22 17:10:06 UTC (rev 49=
80)
@@ -0,0 +1,368 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+*/
+/* $Revision$ */
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+/*!\file
+ * \brief printing of category of card  : balance, historic
+ */
+include_once('class_database.php');
+include_once('class_fiche.php');
+require_once('class_lettering.php');
+
+$gDossier=3Ddossier::id();
+$cn=3Dnew Database($gDossier);
+global $g_user,$g_failed;;
+
+/**
+ * Show first the form
+ */
+/* category */
+$categorie=3Dnew ISelect('cat');
+$categorie->value=3D$cn->make_array('select fd_id,fd_label from fiche_de=
f order by fd_label');
+$categorie->selected=3D(isset($_GET['cat']))?$_GET['cat']:0;
+$str_categorie=3D$categorie->input();
+
+$icall=3Dnew ICheckBox("allcard",1);
+$icall->selected=3D(isset($_GET['allcard']))?1:0;
+$str_icall=3D$icall->input();
+/* periode */
+$exercice=3D$g_user->get_exercice();
+$iperiode=3Dnew Periode($cn);
+list ($first,$last)=3D$iperiode->get_limit($exercice);
+
+$periode_start=3Dnew IDate('start');
+$periode_end=3Dnew IDate('end');
+
+$periode_start->value=3D(isset($_GET['start']))?$_GET['start']:$first->f=
irst_day();
+$periode_end->value=3D(isset($_GET['end']))?$_GET['end']:$last->last_day=
();
+
+$str_start=3D$periode_start->input();
+$str_end=3D$periode_end->input();
+
+/* histo ou summary */
+$histo=3Dnew ISelect('histo');
+$histo->value=3Darray(
+                  array('value'=3D>0,'label'=3D>_('Historique')),
+                  array('value'=3D>1,'label'=3D>_('Historique Lettr=C3=A9=
')),
+                  array('value'=3D>6,'label'=3D>_('Historique Lettr=C3=A9=
 et montants diff=C3=A9rents')),
+                  array('value'=3D>2,'label'=3D>_('Historique non Lettr=C3=
=A9')),
+                  array('value'=3D>3,'label'=3D>_('R=C3=A9sum=C3=A9')),
+                  array('value'=3D>4,'label'=3D>_('Balance')),
+                  array('value'=3D>5,'label'=3D>_('Balance non sold=C3=A9=
e' ))
+              );
+$histo->javascript=3D'onchange=3D"if (this.value=3D=3D3) {
+                   g(&quot;trstart&quot;).style.display=3D&quot;none&quo=
t;;g(&quot;trend&quot;).style.display=3D&quot;none&quot;;g(&quot;allcard&=
quot;).style.display=3D&quot;none&quot;;}
+                   else  {g(&quot;trstart&quot;).style.display=3D&quot;&=
quot;;g(&quot;trend&quot;).style.display=3D&quot;&quot;;g(&quot;allcard&q=
uot;).style.display=3D&quot;&quot;;}"';
+
+$histo->selected=3D(isset($_GET['histo']))?$_GET['histo']:3;
+$str_histo=3D$histo->input();
+echo '<div class=3D"content">';
+echo '<FORM method=3D"GET">';
+echo dossier::hidden();
+echo HtmlInput::hidden('ac',$_GET['ac']);
+require_once('template/impress_cat_card.php');
+echo HtmlInput::submit('cat_display',_('Recherche'));
+echo '</FORM>';
+$str=3D"if (g('histo').value=3D=3D3) {
+     g('trstart').style.display=3D'none';g('trend').style.display=3D'non=
e';g('allcard').style.display=3D'none';}
+     else  {g('trstart').style.display=3D'';g('trend').style.display=3D'=
';g('allcard').style.display=3D'';}";
+echo create_script($str);
+echo '<hr>';
+//-----------------------------------------------------
+if ( ! isset($_GET['cat_display']))
+    exit();
+
+$array=3DFiche::get_fiche_def($cn,$_GET['cat'],'name_asc');
+
+/*
+ * You show now the result
+ */
+if ($array =3D=3D null  )
+{
+    echo '<h2 class=3D"info2"> Aucune fiche trouv=C3=A9e</h2>';
+    exit();
+}
+
+$allcard=3D(isset($_GET['allcard']))?1:0;
+// summary
+if ( $_GET['histo'] =3D=3D 3 )
+{
+    $cat_card=3Dnew Fiche_Def($cn);
+    $cat_card->id=3D$_GET['cat'];
+    $aHeading=3D$cat_card->getAttribut();
+    require_once('template/result_cat_card_summary.php');
+
+    $hid=3Dnew IHidden();
+    echo '<form method=3D"GET" ACTION=3D"export.php">'.dossier::hidden()=
.
+    HtmlInput::submit('bt_csv',"Export CSV").
+    HtmlInput::hidden('act',"CSV:fiche").
+    $hid->input("type","fiche").
+    $hid->input("ac",$_REQUEST['ac']).
+    $hid->input("fd_id",$_REQUEST['cat']);
+    echo "</form>";
+
+    exit();
+}
+$export_pdf=3D'<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"displ=
ay:inline">';
+$export_pdf.=3DHtmlInput::hidden('cat',$_GET['cat']);
+$export_pdf.=3DHtmlInput::hidden('act',"PDF:fiche_balance").
+$export_pdf.=3DHtmlInput::hidden('start',$_GET['start']);
+$export_pdf.=3DHtmlInput::hidden('end',$_GET['end']);
+$export_pdf.=3DHtmlInput::hidden('histo',$_GET['histo']);
+$export_pdf.=3DHtmlInput::request_to_hidden(array('allcard'));
+$export_pdf.=3Ddossier::hidden();
+$export_pdf.=3DHtmlInput::submit('pdf','Export en PDF');
+$export_pdf.=3D'</FORM>';
+
+$export_print=3DHtmlInput::print_window();
+
+$export_csv=3D'<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"displ=
ay:inline">';
+$export_csv.=3DHtmlInput::hidden('cat',$_GET['cat']);
+$export_csv.=3DHtmlInput::hidden('act','CSV:fiche_balance');
+$export_csv.=3DHtmlInput::hidden('start',$_GET['start']);
+$export_csv.=3DHtmlInput::hidden('end',$_GET['end']);
+$export_csv.=3DHtmlInput::hidden('histo',$_GET['histo']);
+$export_csv.=3DHtmlInput::request_to_hidden(array('allcard'));
+$export_csv.=3Ddossier::hidden();
+$export_csv.=3DHtmlInput::submit('CSV','Export en CSV');
+$export_csv.=3D'</FORM>';
+
+// Balance
+if ( $_GET['histo'] =3D=3D 4 || $_GET['histo']=3D=3D5 )
+{
+    if ( isDate($_REQUEST['start']) =3D=3D null || isDate ($_REQUEST['en=
d']) =3D=3D null )
+    {
+        echo h2('Date invalide !','class=3D"error"');
+        alert('Date invalide !');
+        exit;
+    }
+	echo $export_pdf;
+    echo $export_csv;
+	echo $export_print;
+
+    $fd=3Dnew Fiche_Def($cn,$_REQUEST['cat']);
+    if ( $allcard=3D=3D0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) =3D=3D f=
alse )
+    {
+      echo alert("Cette cat=C3=A9gorie n'ayant pas de poste comptable n'=
a pas de balance");
+      exit;
+    }
+	// all card
+	if ($allcard=3D=3D1)
+	{
+		$afiche=3D$cn->get_array("select fd_id from vw_fiche_def where ad_id=3D=
".ATTR_DEF_ACCOUNT." order by fd_label asc");
+	}
+	else
+	{
+		$afiche[0]=3Darray('fd_id'=3D>$_REQUEST['cat']);
+	}
+
+	for ($e=3D0;$e<count($afiche);$e++)
+	{
+		$ret=3D$cn->exec_sql("select f_id,ad_value from fiche join fiche_detai=
l using(f_id) where fd_id=3D$1 and ad_id=3D1 order by 2 ",array($afiche[$=
e]['fd_id']));
+		if ( $cn->count()=3D=3D0 )
+		{
+			if ( $allcard=3D=3D0) {
+				echo "Aucune fiche trouv=C3=A9e";
+				exit;
+			} else
+				continue;
+		}
+		echo '<h2>'.$cn->get_value("select fd_label from fiche_def where fd_id=
=3D$1",array($afiche[$e]['fd_id'])).'</h2>';
+		echo '<table class=3D"result" style=3D"width:80%;margin-left:10%">';
+		echo tr(
+			th('Quick Code').
+			th('Libell=C3=A9').
+			th('D=C3=A9bit','style=3D"text-align:right"').
+			th('Cr=C3=A9dit','style=3D"text-align:right"').
+			th('Solde','style=3D"text-align:right"').
+			th('D/C','style=3D"text-align:right"')
+		);
+		$idx=3D0;
+		for ($i=3D0;$i < Database::num_row($ret);$i++)
+		{
+			$filter=3D " (j_date >=3D to_date('".$_REQUEST['start']."','DD.MM.YYY=
Y') ".
+					 " and  j_date <=3D to_date('".$_REQUEST['end']."','DD.MM.YYYY')) "=
;
+			$aCard=3DDatabase::fetch_array($ret,$i);
+			$oCard=3Dnew Fiche($cn,$aCard['f_id']);
+			$solde=3D$oCard->get_solde_detail($filter);
+			if ( $solde['debit'] =3D=3D 0 && $solde['credit']=3D=3D0) continue;
+		/* only not purged card */
+		if ($_GET['histo'] =3D=3D 5 && $solde['debit'] =3D=3D $solde['credit']=
) continue;
+			$class=3D'';
+			if ( $idx%2 =3D=3D 0) $class=3D'class=3D"odd"';
+			$idx++;
+			echo tr(
+				td(HtmlInput::history_card($oCard->id,$oCard->strAttribut(ATTR_DEF_Q=
UICKCODE))).
+				td($oCard->strAttribut(ATTR_DEF_NAME)).
+				td(nbm($solde['debit']),'style=3D"text-align:right"').
+				td(nbm($solde['credit']),'style=3D"text-align:right"').
+				td(nbm(abs($solde['solde'])),'style=3D"text-align:right"').
+				td((($solde['debit']<$solde['credit'])?'CRED':'DEB'),'style=3D"text-=
align:right"'),
+				$class
+			);
+
+		}
+		echo '</table>';
+	}
+    echo $export_pdf;
+    echo $export_csv;
+    echo $export_print;
+
+    exit();
+}
+if ( isDate($_REQUEST['start']) =3D=3D null || isDate ($_REQUEST['end'])=
 =3D=3D null )
+{
+	echo h2('Date invalide !','class=3D"error"');
+    alert('Date invalide !');
+    exit;
+}
+//----------------------------------------------------------------------=
------
+// for the lettering / history
+//----------------------------------------------------------------------=
------
+
+// all card
+if ($allcard=3D=3D1)
+{
+	$afiche=3D$cn->get_array("select fd_id from vw_fiche_def where ad_id=3D=
".ATTR_DEF_ACCOUNT." order by fd_label asc");
+}
+else
+{
+	$afiche[0]=3Darray('fd_id'=3D>$_REQUEST['cat']);
+}
+echo $export_csv;
+echo $export_pdf;
+echo $export_print;
+$fiche=3Dnew Fiche($cn);
+for ($e =3D 0; $e < count($afiche); $e++)
+{
+	$array =3D Fiche::get_fiche_def($cn, $afiche[$e]['fd_id'], 'name_asc');
+
+	foreach ($array as $card)
+	{
+		$row =3D new Fiche($cn, $card['f_id']);
+		$letter =3D new Lettering_Card($cn);
+		$letter->set_parameter('quick_code', $row->strAttribut(ATTR_DEF_QUICKC=
ODE));
+		$letter->set_parameter('start', $_GET['start']);
+		$letter->set_parameter('end', $_GET['end']);
+		// all
+		if ($_GET['histo'] =3D=3D 0)
+		{
+			$letter->get_all();
+		}
+
+		// lettered
+		if ($_GET['histo'] =3D=3D 1)
+		{
+			$letter->get_letter();
+		}
+		// unlettered
+		if ($_GET['histo'] =3D=3D 2)
+		{
+			$letter->get_unletter();
+		}
+		if ( $_GET['histo'] =3D=3D 6 )
+		{
+			$letter->get_letter_diff();
+		}
+		/* skip if nothing to display */
+		if (count($letter->content) =3D=3D 0)
+			continue;
+		$detail_card =3D HtmlInput::card_detail($row->strAttribut(ATTR_DEF_QUI=
CKCODE), $row->strAttribut(ATTR_DEF_NAME));
+
+		echo '<h2 style=3D"font-size:14px;text-align:left;margin-left:10;paddi=
ng-left:50;border:solid 1px blue;width:25%;text-decoration:underline">' .=
 $detail_card . '</h2>';
+
+		echo '<table style=3D"width:80%;padding-left:10%;padding-right:10%">';
+		echo '<tr>';
+		echo th(_('Date'));
+		echo th(_('ref'));
+		echo th(_('Interne'));
+		echo th(_('Comm'));
+		echo th(_('Montant'), 'style=3D"width:auto" colspan=3D"2"');
+		echo th(_('Prog.'));
+		echo th(_('Let.'));
+		echo '</tr>';
+		$amount_deb =3D 0;
+		$amount_cred =3D 0;
+		$prog =3D 0;
+		bcscale(2);
+		for ($i =3D 0; $i < count($letter->content); $i++)
+		{
+			if ($i % 2 =3D=3D 0)
+				echo '<tr class=3D"even">';
+			else
+				echo '<tr class=3D"odd">';
+			$row =3D $letter->content[$i];
+			echo td($row['j_date_fmt']);
+			echo td(h($row['jr_pj_number']));
+			echo td(HtmlInput::detail_op($row['jr_id'], $row['jr_internal']));
+			echo td(h($row['jr_comment']));
+			if ($row['j_debit'] =3D=3D 't')
+			{
+				echo td(nbm($row['j_montant']), ' style=3D"text-align:right"');
+				$amount_deb+=3D$row['j_montant'];
+				$prog =3D bcadd($prog, $row['j_montant']);
+				echo td("");
+			}
+			else
+			{
+				echo td("");
+				echo td(nbm($row['j_montant']), ' style=3D"text-align:right"');
+				$amount_cred+=3D$row['j_montant'];
+				$prog =3D bcsub($prog, $row['j_montant']);
+			}
+			$side=3D"&nbsp;".$fiche->get_amount_side($prog);
+			echo td(nbm($prog).$side, 'style=3D"text-align:right"');
+			if ($row['letter'] !=3D -1)
+				{
+				$span_error=3D"";
+				if ( $row['letter_diff'] !=3D 0 ) $span_error=3D$g_failed;
+				echo td($row['letter'].$span_error);
+				}
+			else
+				echo td('');
+			echo '</tr>';
+		}
+		echo '</table>';
+		echo '<table>';
+		echo '<tr>';
+		echo td(_('Debit'));
+		echo td(nbm($amount_deb), ' style=3D"font-weight:bold;text-align:right=
"');
+		echo '</tr>';
+		echo '<tr>';
+		echo td(_('Credit'));
+		echo td(nbm($amount_cred), ' style=3D"font-weight:bold;text-align:righ=
t"');
+		echo '</tr>';
+		echo '<tr>';
+		if ($amount_deb > $amount_cred)
+			$s =3D 'solde d=C3=A9biteur';
+		else
+			$s =3D 'solde crediteur';
+		echo td($s);
+		echo td(nbm(abs(round($amount_cred - $amount_deb, 2))), ' style=3D"fon=
t-weight:bold;text-align:right"');
+		echo '</tr>';
+		echo '</table>';
+	}
+}
+echo $export_csv;
+echo $export_pdf;
+echo $export_print;
+
+
+?>
+

Deleted: phpcompta/trunk/include/impress_fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/impress_fiche.inc.php	2012-06-22 17:09:29 UTC=
 (rev 4979)
+++ phpcompta/trunk/include/impress_fiche.inc.php	2012-06-22 17:10:06 UTC=
 (rev 4980)
@@ -1,368 +0,0 @@
-<?php
-/*
- *   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 b=
y
- *   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-130=
7  USA
-*/
-/* $Revision$ */
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/*!\file
- * \brief printing of category of card  : balance, historic
- */
-include_once('class_database.php');
-include_once('class_fiche.php');
-require_once('class_lettering.php');
-
-$gDossier=3Ddossier::id();
-$cn=3Dnew Database($gDossier);
-global $g_user,$g_failed;;
-
-/**
- * Show first the form
- */
-/* category */
-$categorie=3Dnew ISelect('cat');
-$categorie->value=3D$cn->make_array('select fd_id,fd_label from fiche_de=
f order by fd_label');
-$categorie->selected=3D(isset($_GET['cat']))?$_GET['cat']:0;
-$str_categorie=3D$categorie->input();
-
-$icall=3Dnew ICheckBox("allcard",1);
-$icall->selected=3D(isset($_GET['allcard']))?1:0;
-$str_icall=3D$icall->input();
-/* periode */
-$exercice=3D$g_user->get_exercice();
-$iperiode=3Dnew Periode($cn);
-list ($first,$last)=3D$iperiode->get_limit($exercice);
-
-$periode_start=3Dnew IDate('start');
-$periode_end=3Dnew IDate('end');
-
-$periode_start->value=3D(isset($_GET['start']))?$_GET['start']:$first->f=
irst_day();
-$periode_end->value=3D(isset($_GET['end']))?$_GET['end']:$last->last_day=
();
-
-$str_start=3D$periode_start->input();
-$str_end=3D$periode_end->input();
-
-/* histo ou summary */
-$histo=3Dnew ISelect('histo');
-$histo->value=3Darray(
-                  array('value'=3D>0,'label'=3D>_('Historique')),
-                  array('value'=3D>1,'label'=3D>_('Historique Lettr=C3=A9=
')),
-                  array('value'=3D>6,'label'=3D>_('Historique Lettr=C3=A9=
 et montants diff=C3=A9rents')),
-                  array('value'=3D>2,'label'=3D>_('Historique non Lettr=C3=
=A9')),
-                  array('value'=3D>3,'label'=3D>_('R=C3=A9sum=C3=A9')),
-                  array('value'=3D>4,'label'=3D>_('Balance')),
-                  array('value'=3D>5,'label'=3D>_('Balance non sold=C3=A9=
e' ))
-              );
-$histo->javascript=3D'onchange=3D"if (this.value=3D=3D3) {
-                   g(&quot;trstart&quot;).style.display=3D&quot;none&quo=
t;;g(&quot;trend&quot;).style.display=3D&quot;none&quot;;g(&quot;allcard&=
quot;).style.display=3D&quot;none&quot;;}
-                   else  {g(&quot;trstart&quot;).style.display=3D&quot;&=
quot;;g(&quot;trend&quot;).style.display=3D&quot;&quot;;g(&quot;allcard&q=
uot;).style.display=3D&quot;&quot;;}"';
-
-$histo->selected=3D(isset($_GET['histo']))?$_GET['histo']:3;
-$str_histo=3D$histo->input();
-echo '<div class=3D"content">';
-echo '<FORM method=3D"GET">';
-echo dossier::hidden();
-echo HtmlInput::hidden('ac',$_GET['ac']);
-require_once('template/impress_cat_card.php');
-echo HtmlInput::submit('cat_display',_('Recherche'));
-echo '</FORM>';
-$str=3D"if (g('histo').value=3D=3D3) {
-     g('trstart').style.display=3D'none';g('trend').style.display=3D'non=
e';g('allcard').style.display=3D'none';}
-     else  {g('trstart').style.display=3D'';g('trend').style.display=3D'=
';g('allcard').style.display=3D'';}";
-echo create_script($str);
-echo '<hr>';
-//-----------------------------------------------------
-if ( ! isset($_GET['cat_display']))
-    exit();
-
-$array=3DFiche::get_fiche_def($cn,$_GET['cat'],'name_asc');
-
-/*
- * You show now the result
- */
-if ($array =3D=3D null  )
-{
-    echo '<h2 class=3D"info2"> Aucune fiche trouv=C3=A9e</h2>';
-    exit();
-}
-
-$allcard=3D(isset($_GET['allcard']))?1:0;
-// summary
-if ( $_GET['histo'] =3D=3D 3 )
-{
-    $cat_card=3Dnew Fiche_Def($cn);
-    $cat_card->id=3D$_GET['cat'];
-    $aHeading=3D$cat_card->getAttribut();
-    require_once('template/result_cat_card_summary.php');
-
-    $hid=3Dnew IHidden();
-    echo '<form method=3D"GET" ACTION=3D"export.php">'.dossier::hidden()=
.
-    HtmlInput::submit('bt_csv',"Export CSV").
-    HtmlInput::hidden('act',"CSV:fiche").
-    $hid->input("type","fiche").
-    $hid->input("ac",$_REQUEST['ac']).
-    $hid->input("fd_id",$_REQUEST['cat']);
-    echo "</form>";
-
-    exit();
-}
-$export_pdf=3D'<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"displ=
ay:inline">';
-$export_pdf.=3DHtmlInput::hidden('cat',$_GET['cat']);
-$export_pdf.=3DHtmlInput::hidden('act',"PDF:fiche_balance").
-$export_pdf.=3DHtmlInput::hidden('start',$_GET['start']);
-$export_pdf.=3DHtmlInput::hidden('end',$_GET['end']);
-$export_pdf.=3DHtmlInput::hidden('histo',$_GET['histo']);
-$export_pdf.=3DHtmlInput::request_to_hidden(array('allcard'));
-$export_pdf.=3Ddossier::hidden();
-$export_pdf.=3DHtmlInput::submit('pdf','Export en PDF');
-$export_pdf.=3D'</FORM>';
-
-$export_print=3DHtmlInput::print_window();
-
-$export_csv=3D'<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"displ=
ay:inline">';
-$export_csv.=3DHtmlInput::hidden('cat',$_GET['cat']);
-$export_csv.=3DHtmlInput::hidden('act','CSV:fiche_balance');
-$export_csv.=3DHtmlInput::hidden('start',$_GET['start']);
-$export_csv.=3DHtmlInput::hidden('end',$_GET['end']);
-$export_csv.=3DHtmlInput::hidden('histo',$_GET['histo']);
-$export_csv.=3DHtmlInput::request_to_hidden(array('allcard'));
-$export_csv.=3Ddossier::hidden();
-$export_csv.=3DHtmlInput::submit('CSV','Export en CSV');
-$export_csv.=3D'</FORM>';
-
-// Balance
-if ( $_GET['histo'] =3D=3D 4 || $_GET['histo']=3D=3D5 )
-{
-    if ( isDate($_REQUEST['start']) =3D=3D null || isDate ($_REQUEST['en=
d']) =3D=3D null )
-    {
-        echo h2('Date invalide !','class=3D"error"');
-        alert('Date invalide !');
-        exit;
-    }
-	echo $export_pdf;
-    echo $export_csv;
-	echo $export_print;
-
-    $fd=3Dnew Fiche_Def($cn,$_REQUEST['cat']);
-    if ( $allcard=3D=3D0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) =3D=3D f=
alse )
-    {
-      echo alert("Cette cat=C3=A9gorie n'ayant pas de poste comptable n'=
a pas de balance");
-      exit;
-    }
-	// all card
-	if ($allcard=3D=3D1)
-	{
-		$afiche=3D$cn->get_array("select fd_id from vw_fiche_def where ad_id=3D=
".ATTR_DEF_ACCOUNT." order by fd_label asc");
-	}
-	else
-	{
-		$afiche[0]=3Darray('fd_id'=3D>$_REQUEST['cat']);
-	}
-
-	for ($e=3D0;$e<count($afiche);$e++)
-	{
-		$ret=3D$cn->exec_sql("select f_id,ad_value from fiche join fiche_detai=
l using(f_id) where fd_id=3D$1 and ad_id=3D1 order by 2 ",array($afiche[$=
e]['fd_id']));
-		if ( $cn->count()=3D=3D0 )
-		{
-			if ( $allcard=3D=3D0) {
-				echo "Aucune fiche trouv=C3=A9e";
-				exit;
-			} else
-				continue;
-		}
-		echo '<h2>'.$cn->get_value("select fd_label from fiche_def where fd_id=
=3D$1",array($afiche[$e]['fd_id'])).'</h2>';
-		echo '<table class=3D"result" style=3D"width:80%;margin-left:10%">';
-		echo tr(
-			th('Quick Code').
-			th('Libell=C3=A9').
-			th('D=C3=A9bit','style=3D"text-align:right"').
-			th('Cr=C3=A9dit','style=3D"text-align:right"').
-			th('Solde','style=3D"text-align:right"').
-			th('D/C','style=3D"text-align:right"')
-		);
-		$idx=3D0;
-		for ($i=3D0;$i < Database::num_row($ret);$i++)
-		{
-			$filter=3D " (j_date >=3D to_date('".$_REQUEST['start']."','DD.MM.YYY=
Y') ".
-					 " and  j_date <=3D to_date('".$_REQUEST['end']."','DD.MM.YYYY')) "=
;
-			$aCard=3DDatabase::fetch_array($ret,$i);
-			$oCard=3Dnew Fiche($cn,$aCard['f_id']);
-			$solde=3D$oCard->get_solde_detail($filter);
-			if ( $solde['debit'] =3D=3D 0 && $solde['credit']=3D=3D0) continue;
-		/* only not purged card */
-		if ($_GET['histo'] =3D=3D 5 && $solde['debit'] =3D=3D $solde['credit']=
) continue;
-			$class=3D'';
-			if ( $idx%2 =3D=3D 0) $class=3D'class=3D"odd"';
-			$idx++;
-			echo tr(
-				td(HtmlInput::history_card($oCard->id,$oCard->strAttribut(ATTR_DEF_Q=
UICKCODE))).
-				td($oCard->strAttribut(ATTR_DEF_NAME)).
-				td(nbm($solde['debit']),'style=3D"text-align:right"').
-				td(nbm($solde['credit']),'style=3D"text-align:right"').
-				td(nbm(abs($solde['solde'])),'style=3D"text-align:right"').
-				td((($solde['debit']<$solde['credit'])?'CRED':'DEB'),'style=3D"text-=
align:right"'),
-				$class
-			);
-
-		}
-		echo '</table>';
-	}
-    echo $export_pdf;
-    echo $export_csv;
-    echo $export_print;
-
-    exit();
-}
-if ( isDate($_REQUEST['start']) =3D=3D null || isDate ($_REQUEST['end'])=
 =3D=3D null )
-{
-	echo h2('Date invalide !','class=3D"error"');
-    alert('Date invalide !');
-    exit;
-}
-//----------------------------------------------------------------------=
------
-// for the lettering / history
-//----------------------------------------------------------------------=
------
-
-// all card
-if ($allcard=3D=3D1)
-{
-	$afiche=3D$cn->get_array("select fd_id from vw_fiche_def where ad_id=3D=
".ATTR_DEF_ACCOUNT." order by fd_label asc");
-}
-else
-{
-	$afiche[0]=3Darray('fd_id'=3D>$_REQUEST['cat']);
-}
-echo $export_csv;
-echo $export_pdf;
-echo $export_print;
-$fiche=3Dnew Fiche($cn);
-for ($e =3D 0; $e < count($afiche); $e++)
-{
-	$array =3D Fiche::get_fiche_def($cn, $afiche[$e]['fd_id'], 'name_asc');
-
-	foreach ($array as $card)
-	{
-		$row =3D new Fiche($cn, $card['f_id']);
-		$letter =3D new Lettering_Card($cn);
-		$letter->set_parameter('quick_code', $row->strAttribut(ATTR_DEF_QUICKC=
ODE));
-		$letter->set_parameter('start', $_GET['start']);
-		$letter->set_parameter('end', $_GET['end']);
-		// all
-		if ($_GET['histo'] =3D=3D 0)
-		{
-			$letter->get_all();
-		}
-
-		// lettered
-		if ($_GET['histo'] =3D=3D 1)
-		{
-			$letter->get_letter();
-		}
-		// unlettered
-		if ($_GET['histo'] =3D=3D 2)
-		{
-			$letter->get_unletter();
-		}
-		if ( $_GET['histo'] =3D=3D 6 )
-		{
-			$letter->get_letter_diff();
-		}
-		/* skip if nothing to display */
-		if (count($letter->content) =3D=3D 0)
-			continue;
-		$detail_card =3D HtmlInput::card_detail($row->strAttribut(ATTR_DEF_QUI=
CKCODE), $row->strAttribut(ATTR_DEF_NAME));
-
-		echo '<h2 style=3D"font-size:14px;text-align:left;margin-left:10;paddi=
ng-left:50;border:solid 1px blue;width:25%;text-decoration:underline">' .=
 $detail_card . '</h2>';
-
-		echo '<table style=3D"width:80%;padding-left:10%;padding-right:10%">';
-		echo '<tr>';
-		echo th(_('Date'));
-		echo th(_('ref'));
-		echo th(_('Interne'));
-		echo th(_('Comm'));
-		echo th(_('Montant'), 'style=3D"width:auto" colspan=3D"2"');
-		echo th(_('Prog.'));
-		echo th(_('Let.'));
-		echo '</tr>';
-		$amount_deb =3D 0;
-		$amount_cred =3D 0;
-		$prog =3D 0;
-		bcscale(2);
-		for ($i =3D 0; $i < count($letter->content); $i++)
-		{
-			if ($i % 2 =3D=3D 0)
-				echo '<tr class=3D"even">';
-			else
-				echo '<tr class=3D"odd">';
-			$row =3D $letter->content[$i];
-			echo td($row['j_date_fmt']);
-			echo td(h($row['jr_pj_number']));
-			echo td(HtmlInput::detail_op($row['jr_id'], $row['jr_internal']));
-			echo td(h($row['jr_comment']));
-			if ($row['j_debit'] =3D=3D 't')
-			{
-				echo td(nbm($row['j_montant']), ' style=3D"text-align:right"');
-				$amount_deb+=3D$row['j_montant'];
-				$prog =3D bcadd($prog, $row['j_montant']);
-				echo td("");
-			}
-			else
-			{
-				echo td("");
-				echo td(nbm($row['j_montant']), ' style=3D"text-align:right"');
-				$amount_cred+=3D$row['j_montant'];
-				$prog =3D bcsub($prog, $row['j_montant']);
-			}
-			$side=3D"&nbsp;".$fiche->get_amount_side($prog);
-			echo td(nbm($prog).$side, 'style=3D"text-align:right"');
-			if ($row['letter'] !=3D -1)
-				{
-				$span_error=3D"";
-				if ( $row['letter_diff'] !=3D 0 ) $span_error=3D$g_failed;
-				echo td($row['letter'].$span_error);
-				}
-			else
-				echo td('');
-			echo '</tr>';
-		}
-		echo '</table>';
-		echo '<table>';
-		echo '<tr>';
-		echo td(_('Debit'));
-		echo td(nbm($amount_deb), ' style=3D"font-weight:bold;text-align:right=
"');
-		echo '</tr>';
-		echo '<tr>';
-		echo td(_('Credit'));
-		echo td(nbm($amount_cred), ' style=3D"font-weight:bold;text-align:righ=
t"');
-		echo '</tr>';
-		echo '<tr>';
-		if ($amount_deb > $amount_cred)
-			$s =3D 'solde d=C3=A9biteur';
-		else
-			$s =3D 'solde crediteur';
-		echo td($s);
-		echo td(nbm(abs(round($amount_cred - $amount_deb, 2))), ' style=3D"fon=
t-weight:bold;text-align:right"');
-		echo '</tr>';
-		echo '</table>';
-	}
-}
-echo $export_csv;
-echo $export_pdf;
-echo $export_print;
-
-
-?>
-



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 20:41:43 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiEQ3-0001As-4e
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 20:41:43 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 23 Jun 2012 02:32:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.220447.1340412102.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4981 - in phpcompta/trunk: html html/js include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Jun 2012 00:41:42 -0000

Author: danydb
Date: 2012-06-23 02:32:15 +0200 (Sat, 23 Jun 2012)
New Revision: 4981

Modified:
   phpcompta/trunk/html/js/card.js
   phpcompta/trunk/html/style-print.css
   phpcompta/trunk/include/cfgfiche.inc.php
   phpcompta/trunk/include/class_database.php
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/fiche.inc.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000577: Remplacer FICHE par PRINTCARD

Modified: phpcompta/trunk/html/js/card.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/card.js	2012-06-22 17:10:06 UTC (rev 4980)
+++ phpcompta/trunk/html/js/card.js	2012-06-23 00:32:15 UTC (rev 4981)
@@ -452,18 +452,22 @@
 }
 /**
  *@brief Show a blank card
- *@param Form object (obj) it must have the attribute ipopup
+ *@param Form object (obj)
  *       possible attribute :
  *        - filter is the filter but with a  fd_id list, -1 means there =
 is no filter
  *        - ref : reload the window after adding card
+ *        - content : name of the div
+ *@example dis_blank_card({gDossier:15,fd_id:12,ref:1});
  *@see ajax_card.php
  */
 function dis_blank_card(obj)
 {
     // first we have to take the form elt we need
-    var fd_id=3D$F('fd_id');
+    if ( obj.fd_id =3D=3D undefined ) { var fd_id=3D$F('fd_id'); }
+	else {fd_id=3Dobj.fd_id;}
+
     var ref=3D"";
-    if ( obj.elements['ref'] )
+    if ( obj.elements &&  obj.elements['ref'] )
     {
         ref=3D'&ref';
     }
@@ -476,13 +480,45 @@
     if ( $(content)) {removeDiv(content);}
     add_div(popup);
=20
+	if ( obj.gDossier =3D=3D undefined ) {
+    var dossier=3D$('gDossier').value;} else {
+	var dossier=3Dobj.gDossier;
+	}
=20
+    var queryString=3D'gDossier=3D'+dossier;
+    queryString+=3D'&ctl=3D'+content;
+    queryString+=3D'&fd_id=3D'+fd_id;
+    queryString+=3Dref;
+    queryString+=3D'&op=3Dbc'; 	// bc for blank card
+
+    var action=3Dnew Ajax.Request ( 'ajax_card.php',
+                                  {
+                                  method:'get',
+                                  parameters:queryString,
+                                  onFailure:errorFid,
+                                  onSuccess:successFill_ipopcard
+                                  }
+                                );
+}
+function form_blank_card(obj)
+{
+    // first we have to take the form elt we need
+    var fd_id=3Dobj.fd_id;
+    var content=3D'div_new_card';
+    var nTop=3DposY-40;
+    var nLeft=3DposX-20;
+    var str_style=3D"top:"+nTop+";left:"+nLeft+";width:60em;height:auto"=
;
+
+    var popup=3D{'id':  content,'cssclass':'inner_box','style':str_style=
,'html':loading(),'drag':true};
+    if ( $(content)) {removeDiv(content);}
+    add_div(popup);
+
+
     var dossier=3D$('gDossier').value;
=20
     var queryString=3D'gDossier=3D'+dossier;
     queryString+=3D'&ctl=3D'+content;
     queryString+=3D'&fd_id=3D'+fd_id;
-    queryString+=3Dref;
     queryString+=3D'&op=3Dbc'; 	// bc for blank card
=20
     var action=3Dnew Ajax.Request ( 'ajax_card.php',
@@ -494,6 +530,7 @@
                                   }
                                 );
 }
+
 /**
  *@brief save the data contained into the form 'save_card'
  *@param input field (obj) it must have the attribute ipopup

Modified: phpcompta/trunk/html/style-print.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-print.css	2012-06-22 17:10:06 UTC (rev 498=
0)
+++ phpcompta/trunk/html/style-print.css	2012-06-23 00:32:15 UTC (rev 498=
1)
@@ -1,5 +1,5 @@
 body {
-	font-size:7pt
+	font-size:7px;
 	}
 select ,.input_text{
 border:1px solid #FFFFFF;
@@ -21,27 +21,29 @@
 	display:none;
 	}
 table.result {
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 	width:100%
   }
=20
 table.result th {
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
=20
 h2 {
-	font-size:12pt;
+	font-size:12px;
 	font-weight:bold;
 	font-family:sans-serif;
 }
 div.info {
 	display:none;
 }
-
-h1,h2.info {
-	font-size:14pt;
+.content  {
+	font-size:7px;
+}
+h1.content,h1,h2.info {
+	font-size:14px;
 	font-weight:bold;
 	font-family:sans-serif;
 }
@@ -89,20 +91,20 @@
 	display:none;
 }
 div.recherche{
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
 div.redcontent{
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
=20
 }
 div.redcontent{
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
 div.ccontent{
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
 div.rmenu {
@@ -138,24 +140,24 @@
  }
=20
 tr.odd {
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
 tr {
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 	}
 tr.even {
=20
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
 td.odd{
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
 td.even{
-	font-size:7pt;
+	font-size:7px;
 	font-family:sans-serif;
 }
 td.cell{
@@ -226,7 +228,7 @@
 }
 a.detail
 {
-font-size:8pt;
+font-size:8px;
 font-family:sans-serif;
 }
=20

Modified: phpcompta/trunk/include/cfgfiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/cfgfiche.inc.php	2012-06-22 17:10:06 UTC (rev=
 4980)
+++ phpcompta/trunk/include/cfgfiche.inc.php	2012-06-23 00:32:15 UTC (rev=
 4981)
@@ -402,7 +402,6 @@
         $fiche_def->Get();
         echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
         $fiche=3Dnew Fiche($cn,0);
-		var_dump($_SERVER);
         echo '<form method=3D"post" >';
         echo dossier::hidden();
 		echo HtmlInput::hidden('ac',$_REQUEST['ac']);
@@ -421,7 +420,7 @@
 // delete a card
 if (isset($_POST['delete']) )
 {
-    $g_user->can_request(FIC);
+    $g_user->can_request(FICADD);
     ShowRecherche();
     echo '<DIV class=3D"redcontent" style=3D"width:auto">';
     if ( $write =3D=3D0)

Modified: phpcompta/trunk/include/class_database.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_database.php	2012-06-22 17:10:06 UTC (r=
ev 4980)
+++ phpcompta/trunk/include/class_database.php	2012-06-23 00:32:15 UTC (r=
ev 4981)
@@ -147,7 +147,7 @@
             }
             if ( ! $this->ret )
             {
-		$str_error=3Dpg_last_error($this->db). pg_result_error($this->db);
+				$str_error=3Dpg_last_error($this->db). pg_result_error($this->ret);
                 throw new Exception ("  SQL ERROR $p_string ".$str_error=
,1 );
             }
=20

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-22 17:10:06 UTC (rev =
4980)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-23 00:32:15 UTC (rev =
4981)
@@ -563,7 +563,7 @@
 		$type_card =3D $this->cn->get_value('select fd_label from fiche_def jo=
in fiche using (fd_id) where f_id=3D$1', array($this->id));
 		$ret =3D "";
 		$ret.=3Dh2( "Cat=C3=A9gorie ".$type_card, 'style=3D"display:inline"');
-		$ret.=3D'<span style=3D"font-weight:bolder;margin-right:5px"> id fiche=
:' . $this->id . "</span>";
+		$ret.=3D'<span style=3D"font-weight:bolder;margin-right:5px;float:righ=
t"> id fiche:' . $this->id . "</span>";
 		$ret.=3D"<table style=3D\"width:98%;margin:1%\">";
 		if (empty($attr))
 		{
@@ -1019,7 +1019,7 @@
     }
     /*!\brief  remove a card
     */
-    function remove()
+    function remove($silent=3Dfalse)
     {
         if ( $this->id=3D=3D0 ) return;
         // verify if that card has not been used is a ledger
@@ -1034,11 +1034,14 @@
=20
         if ( $this->cn->count_sql("select * from jrnx where j_qcode=3D'"=
.Database::escape_string($qcode)."'") !=3D 0)
         {
-            alert('Impossible cette fiche est utilis=C3=A9e dans un jour=
nal');
-            return;
+            if ( ! $silent ) {
+					alert('Impossible cette fiche est utilis=C3=A9e dans un journal');
+			}
+            return 1;
         }
=20
         $this->delete();
+		return 0;
     }
=20
=20

Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-22 17:10:06 UTC (rev 49=
80)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-23 00:32:15 UTC (rev 49=
81)
@@ -1,4 +1,5 @@
 <?php
+
 /*
  *   This file is part of PhpCompta.
  *
@@ -15,240 +16,345 @@
  *   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-130=
7  USA
-*/
+ */
 /* $Revision$ */
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/*!\file
+/* !\file
  * \brief printing of category of card  : balance, historic
  */
 include_once('class_database.php');
 include_once('class_fiche.php');
 require_once('class_lettering.php');
=20
-$gDossier=3Ddossier::id();
-$cn=3Dnew Database($gDossier);
-global $g_user,$g_failed;;
+$gDossier =3D dossier::id();
+$cn =3D new Database($gDossier);
+global $g_user, $g_failed;
+;
=20
 /**
  * Show first the form
  */
 /* category */
-$categorie=3Dnew ISelect('cat');
-$categorie->value=3D$cn->make_array('select fd_id,fd_label from fiche_de=
f order by fd_label');
-$categorie->selected=3D(isset($_GET['cat']))?$_GET['cat']:0;
-$str_categorie=3D$categorie->input();
+$categorie =3D new ISelect('cat');
+$categorie->value =3D $cn->make_array('select fd_id,fd_label from fiche_=
def order by fd_label');
+$categorie->selected =3D (isset($_GET['cat'])) ? $_GET['cat'] : 0;
+$str_categorie =3D $categorie->input();
=20
-$icall=3Dnew ICheckBox("allcard",1);
-$icall->selected=3D(isset($_GET['allcard']))?1:0;
-$str_icall=3D$icall->input();
+$icall =3D new ICheckBox("allcard", 1);
+$icall->selected =3D (isset($_GET['allcard'])) ? 1 : 0;
+$str_icall =3D $icall->input();
 /* periode */
-$exercice=3D$g_user->get_exercice();
-$iperiode=3Dnew Periode($cn);
-list ($first,$last)=3D$iperiode->get_limit($exercice);
+$exercice =3D $g_user->get_exercice();
+$iperiode =3D new Periode($cn);
+list ($first, $last) =3D $iperiode->get_limit($exercice);
=20
-$periode_start=3Dnew IDate('start');
-$periode_end=3Dnew IDate('end');
+$periode_start =3D new IDate('start');
+$periode_end =3D new IDate('end');
=20
-$periode_start->value=3D(isset($_GET['start']))?$_GET['start']:$first->f=
irst_day();
-$periode_end->value=3D(isset($_GET['end']))?$_GET['end']:$last->last_day=
();
+$periode_start->value =3D (isset($_GET['start'])) ? $_GET['start'] : $fi=
rst->first_day();
+$periode_end->value =3D (isset($_GET['end'])) ? $_GET['end'] : $last->la=
st_day();
=20
-$str_start=3D$periode_start->input();
-$str_end=3D$periode_end->input();
+$str_start =3D $periode_start->input();
+$str_end =3D $periode_end->input();
=20
 /* histo ou summary */
-$histo=3Dnew ISelect('histo');
-$histo->value=3Darray(
-                  array('value'=3D>0,'label'=3D>_('Historique')),
-                  array('value'=3D>1,'label'=3D>_('Historique Lettr=C3=A9=
')),
-                  array('value'=3D>6,'label'=3D>_('Historique Lettr=C3=A9=
 et montants diff=C3=A9rents')),
-                  array('value'=3D>2,'label'=3D>_('Historique non Lettr=C3=
=A9')),
-                  array('value'=3D>3,'label'=3D>_('R=C3=A9sum=C3=A9')),
-                  array('value'=3D>4,'label'=3D>_('Balance')),
-                  array('value'=3D>5,'label'=3D>_('Balance non sold=C3=A9=
e' ))
-              );
-$histo->javascript=3D'onchange=3D"if (this.value=3D=3D3) {
+$histo =3D new ISelect('histo');
+$histo->value =3D array(
+	array('value' =3D> -1, 'label' =3D> _('Liste')),
+	array('value' =3D> 0, 'label' =3D> _('Historique')),
+	array('value' =3D> 1, 'label' =3D> _('Historique Lettr=C3=A9')),
+	array('value' =3D> 6, 'label' =3D> _('Historique Lettr=C3=A9 et montant=
s diff=C3=A9rents')),
+	array('value' =3D> 2, 'label' =3D> _('Historique non Lettr=C3=A9')),
+	array('value' =3D> 3, 'label' =3D> _('R=C3=A9sum=C3=A9')),
+	array('value' =3D> 4, 'label' =3D> _('Balance')),
+	array('value' =3D> 5, 'label' =3D> _('Balance non sold=C3=A9e'))
+);
+$histo->javascript =3D 'onchange=3D"if (this.value=3D=3D3 || this.value=3D=
=3D-1) {
                    g(&quot;trstart&quot;).style.display=3D&quot;none&quo=
t;;g(&quot;trend&quot;).style.display=3D&quot;none&quot;;g(&quot;allcard&=
quot;).style.display=3D&quot;none&quot;;}
                    else  {g(&quot;trstart&quot;).style.display=3D&quot;&=
quot;;g(&quot;trend&quot;).style.display=3D&quot;&quot;;g(&quot;allcard&q=
uot;).style.display=3D&quot;&quot;;}"';
=20
-$histo->selected=3D(isset($_GET['histo']))?$_GET['histo']:3;
-$str_histo=3D$histo->input();
+$histo->selected =3D (isset($_GET['histo'])) ? $_GET['histo'] : -1;
+$str_histo =3D $histo->input();
 echo '<div class=3D"content">';
 echo '<FORM method=3D"GET">';
 echo dossier::hidden();
-echo HtmlInput::hidden('ac',$_GET['ac']);
+echo HtmlInput::hidden('ac', $_GET['ac']);
 require_once('template/impress_cat_card.php');
-echo HtmlInput::submit('cat_display',_('Recherche'));
+echo HtmlInput::submit('cat_display', _('Recherche'));
 echo '</FORM>';
-$str=3D"if (g('histo').value=3D=3D3) {
+$str =3D "if (g('histo').value=3D=3D3 || g('histo').value=3D=3D -1 ) {
      g('trstart').style.display=3D'none';g('trend').style.display=3D'non=
e';g('allcard').style.display=3D'none';}
-     else  {g('trstart').style.display=3D'';g('trend').style.display=3D'=
';g('allcard').style.display=3D'';}";
+     else  {g('trstart').style.display=3D'';g('trend').style.display=3D'=
';g('allcard').style.display=3D'';}
+	 if (  g('histo').value=3D=3D -1 ) { g('allcard').style.display=3D'';}
+
+	";
 echo create_script($str);
 echo '<hr>';
 //-----------------------------------------------------
-if ( ! isset($_GET['cat_display']))
-    exit();
+if (!isset($_GET['cat_display']))
+	exit();
=20
-$array=3DFiche::get_fiche_def($cn,$_GET['cat'],'name_asc');
+$fd_id =3D $_GET['cat'];
+$array =3D Fiche::get_fiche_def($cn, $_GET['cat'], 'name_asc');
=20
+$h_add_card_b =3D new IButton('add_card');
+$h_add_card_b->label =3D _('Cr=C3=A9er une nouvelle fiche');
+$h_add_card_b->javascript =3D "dis_blank_card({gDossier:$gDossier,fd_id:=
$fd_id})";
+$str_add_card =3D ($g_user->check_action(FICADD) =3D=3D 1) ? $h_add_card=
_b->input() : "";
+
 /*
  * You show now the result
  */
-if ($array =3D=3D null  )
+if ($array =3D=3D null)
 {
-    echo '<h2 class=3D"info2"> Aucune fiche trouv=C3=A9e</h2>';
-    exit();
+	echo '<h2 class=3D"info2"> Aucune fiche trouv=C3=A9e</h2>';
+	echo $str_add_card;
+	exit();
 }
=20
-$allcard=3D(isset($_GET['allcard']))?1:0;
-// summary
-if ( $_GET['histo'] =3D=3D 3 )
+$allcard =3D (isset($_GET['allcard'])) ? 1 : 0;
+/* * *******************************************************************=
**************************************************************
+ * Liste
+ *
+ * *********************************************************************=
*********************************************************** */
+if ($_GET['histo'] =3D=3D -1)
 {
-    $cat_card=3Dnew Fiche_Def($cn);
-    $cat_card->id=3D$_GET['cat'];
-    $aHeading=3D$cat_card->getAttribut();
-    require_once('template/result_cat_card_summary.php');
+	$write =3D $g_user->check_action(FICADD);
+	/**
+	 * If ask for move or delete
+	 */
+	if (isset($_POST['action']))
+	{
+		if ($write =3D=3D 1)
+		{
+			$ack =3D $_POST['f_id'];
+			/**
+			 * Move
+			 */
+			if (isset($_POST['move']))
+			{
+				for ($i =3D 0; $i < count($ack); $i++)
+				{
+					$fiche =3D new Fiche($cn, $ack[$i]);
+					$fiche->move_to($_POST['move_to']);
+				}
+			}
+			/**
+			 * Delete
+			 */
+			if (isset($_POST['delete']))
+			{
+				$msg=3D"";
+				for ($i =3D 0; $i < count($ack); $i++)
+				{
+					$fiche =3D new Fiche($cn, $ack[$i]);
+					if ( $fiche->remove(true) =3D=3D 1 )
+					{
+						$msg.=3D"\n ".$fiche->strAttribut(ATTR_DEF_QUICKCODE);
+					}
+				}
+				if ($msg !=3D "")
+				{
+					echo h2("Fiche non effac=C3=A9es", ' class=3D"error"  ');
+					echo '<p class=3D"error">'." Ces fiches n'ont pas =C3=A9t=C3=A9 eff=
ac=C3=A9es  ".$msg;
+				}
+			}
+		}
+		else
+		{
+			echo NoAccess();
+		}
+	}
+	$sql =3D "select f_id from fiche ";
+	if ($allcard =3D=3D 1)
+	{
+		$cond =3D "";
+	}
+	else
+	{
+		$cond =3D " where fd_id =3D " . sql_string($_GET['cat']);
+	}
+	// Create nav bar
+	$max =3D $cn->get_value("select count(*) from fiche " . $cond);
=20
-    $hid=3Dnew IHidden();
-    echo '<form method=3D"GET" ACTION=3D"export.php">'.dossier::hidden()=
.
-    HtmlInput::submit('bt_csv',"Export CSV").
-    HtmlInput::hidden('act',"CSV:fiche").
-    $hid->input("type","fiche").
-    $hid->input("ac",$_REQUEST['ac']).
-    $hid->input("fd_id",$_REQUEST['cat']);
-    echo "</form>";
+	$step =3D $_SESSION['g_pagesize'];
+	$page =3D (isset($_GET['offset'])) ? $_GET['page'] : 1;
+	$offset =3D (isset($_GET['offset'])) ? $_GET['offset'] : 0;
+	$bar =3D navigation_bar($offset, $max, $step, $page);
+	$limit =3D ($step =3D=3D -1 ) ? "" : " limit " . $step;
+	$res =3D $cn->exec_sql("
+		select f_id,
+			(select ad_value from fiche_detail as fd1 where ad_id=3D1 and fd1.f_i=
d=3Df.f_id) as name,
+			(select ad_value from fiche_detail as fd1 where ad_id=3D23 and fd1.f_=
id=3Df.f_id) as qcode
+		from fiche as f
+		$cond   order by 1 offset $offset $limit
+	");
+	$nb_line =3D Database::num_row($res);
+	require_once 'template/fiche_list.php';
+	if ($write =3D=3D 1 ) echo $str_add_card;
+	exit();
+}
+/* * *******************************************************************=
**************************************************************
+ * Summary
+ *
+ * *********************************************************************=
*********************************************************** */
+if ($_GET['histo'] =3D=3D 3)
+{
+	$cat_card =3D new Fiche_Def($cn);
+	$cat_card->id =3D $_GET['cat'];
+	$aHeading =3D $cat_card->getAttribut();
+	echo $str_add_card;
+	require_once('template/result_cat_card_summary.php');
=20
-    exit();
+	$hid =3D new IHidden();
+	echo '<form method=3D"GET" ACTION=3D"export.php">' . dossier::hidden() =
.
+	HtmlInput::submit('bt_csv', "Export CSV") .
+	HtmlInput::hidden('act', "CSV:fiche") .
+	$hid->input("type", "fiche") .
+	$hid->input("ac", $_REQUEST['ac']) .
+	$hid->input("fd_id", $_REQUEST['cat']);
+	echo "</form>";
+
+	exit();
 }
-$export_pdf=3D'<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"displ=
ay:inline">';
-$export_pdf.=3DHtmlInput::hidden('cat',$_GET['cat']);
-$export_pdf.=3DHtmlInput::hidden('act',"PDF:fiche_balance").
-$export_pdf.=3DHtmlInput::hidden('start',$_GET['start']);
-$export_pdf.=3DHtmlInput::hidden('end',$_GET['end']);
-$export_pdf.=3DHtmlInput::hidden('histo',$_GET['histo']);
+$export_pdf =3D '<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"dis=
play:inline">';
+$export_pdf.=3DHtmlInput::hidden('cat', $_GET['cat']);
+$export_pdf.=3DHtmlInput::hidden('act', "PDF:fiche_balance") .
+		$export_pdf.=3DHtmlInput::hidden('start', $_GET['start']);
+$export_pdf.=3DHtmlInput::hidden('end', $_GET['end']);
+$export_pdf.=3DHtmlInput::hidden('histo', $_GET['histo']);
 $export_pdf.=3DHtmlInput::request_to_hidden(array('allcard'));
 $export_pdf.=3Ddossier::hidden();
-$export_pdf.=3DHtmlInput::submit('pdf','Export en PDF');
+$export_pdf.=3DHtmlInput::submit('pdf', 'Export en PDF');
 $export_pdf.=3D'</FORM>';
=20
-$export_print=3DHtmlInput::print_window();
+$export_print =3D HtmlInput::print_window();
=20
-$export_csv=3D'<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"displ=
ay:inline">';
-$export_csv.=3DHtmlInput::hidden('cat',$_GET['cat']);
-$export_csv.=3DHtmlInput::hidden('act','CSV:fiche_balance');
-$export_csv.=3DHtmlInput::hidden('start',$_GET['start']);
-$export_csv.=3DHtmlInput::hidden('end',$_GET['end']);
-$export_csv.=3DHtmlInput::hidden('histo',$_GET['histo']);
+$export_csv =3D '<FORM METHOD=3D"get" ACTION=3D"export.php" style=3D"dis=
play:inline">';
+$export_csv.=3DHtmlInput::hidden('cat', $_GET['cat']);
+$export_csv.=3DHtmlInput::hidden('act', 'CSV:fiche_balance');
+$export_csv.=3DHtmlInput::hidden('start', $_GET['start']);
+$export_csv.=3DHtmlInput::hidden('end', $_GET['end']);
+$export_csv.=3DHtmlInput::hidden('histo', $_GET['histo']);
 $export_csv.=3DHtmlInput::request_to_hidden(array('allcard'));
 $export_csv.=3Ddossier::hidden();
-$export_csv.=3DHtmlInput::submit('CSV','Export en CSV');
+$export_csv.=3DHtmlInput::submit('CSV', 'Export en CSV');
 $export_csv.=3D'</FORM>';
=20
-// Balance
-if ( $_GET['histo'] =3D=3D 4 || $_GET['histo']=3D=3D5 )
+/***********************************************************************=
*********************************************************
+ * Balance
+ *
+ ***********************************************************************=
***********************************************************/
+if ($_GET['histo'] =3D=3D 4 || $_GET['histo'] =3D=3D 5)
 {
-    if ( isDate($_REQUEST['start']) =3D=3D null || isDate ($_REQUEST['en=
d']) =3D=3D null )
-    {
-        echo h2('Date invalide !','class=3D"error"');
-        alert('Date invalide !');
-        exit;
-    }
+	if (isDate($_REQUEST['start']) =3D=3D null || isDate($_REQUEST['end']) =
=3D=3D null)
+	{
+		echo h2('Date invalide !', 'class=3D"error"');
+		alert('Date invalide !');
+		exit;
+	}
+	echo $str_add_card;
 	echo $export_pdf;
-    echo $export_csv;
+	echo $export_csv;
 	echo $export_print;
=20
-    $fd=3Dnew Fiche_Def($cn,$_REQUEST['cat']);
-    if ( $allcard=3D=3D0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) =3D=3D f=
alse )
-    {
-      echo alert("Cette cat=C3=A9gorie n'ayant pas de poste comptable n'=
a pas de balance");
-      exit;
-    }
+	$fd =3D new Fiche_Def($cn, $_REQUEST['cat']);
+	if ($allcard =3D=3D 0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) =3D=3D fal=
se)
+	{
+		echo alert("Cette cat=C3=A9gorie n'ayant pas de poste comptable n'a pa=
s de balance");
+		exit;
+	}
 	// all card
-	if ($allcard=3D=3D1)
+	if ($allcard =3D=3D 1)
 	{
-		$afiche=3D$cn->get_array("select fd_id from vw_fiche_def where ad_id=3D=
".ATTR_DEF_ACCOUNT." order by fd_label asc");
+		$afiche =3D $cn->get_array("select fd_id from vw_fiche_def where ad_id=
=3D" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
 	}
 	else
 	{
-		$afiche[0]=3Darray('fd_id'=3D>$_REQUEST['cat']);
+		$afiche[0] =3D array('fd_id' =3D> $_REQUEST['cat']);
 	}
=20
-	for ($e=3D0;$e<count($afiche);$e++)
+	for ($e =3D 0; $e < count($afiche); $e++)
 	{
-		$ret=3D$cn->exec_sql("select f_id,ad_value from fiche join fiche_detai=
l using(f_id) where fd_id=3D$1 and ad_id=3D1 order by 2 ",array($afiche[$=
e]['fd_id']));
-		if ( $cn->count()=3D=3D0 )
+		$ret =3D $cn->exec_sql("select f_id,ad_value from fiche join fiche_det=
ail using(f_id) where fd_id=3D$1 and ad_id=3D1 order by 2 ", array($afich=
e[$e]['fd_id']));
+		if ($cn->count() =3D=3D 0)
 		{
-			if ( $allcard=3D=3D0) {
+			if ($allcard =3D=3D 0)
+			{
 				echo "Aucune fiche trouv=C3=A9e";
 				exit;
 			} else
 				continue;
 		}
-		echo '<h2>'.$cn->get_value("select fd_label from fiche_def where fd_id=
=3D$1",array($afiche[$e]['fd_id'])).'</h2>';
+		echo '<h2>' . $cn->get_value("select fd_label from fiche_def where fd_=
id=3D$1", array($afiche[$e]['fd_id'])) . '</h2>';
 		echo '<table class=3D"result" style=3D"width:80%;margin-left:10%">';
 		echo tr(
-			th('Quick Code').
-			th('Libell=C3=A9').
-			th('D=C3=A9bit','style=3D"text-align:right"').
-			th('Cr=C3=A9dit','style=3D"text-align:right"').
-			th('Solde','style=3D"text-align:right"').
-			th('D/C','style=3D"text-align:right"')
+				th('Quick Code') .
+				th('Libell=C3=A9') .
+				th('D=C3=A9bit', 'style=3D"text-align:right"') .
+				th('Cr=C3=A9dit', 'style=3D"text-align:right"') .
+				th('Solde', 'style=3D"text-align:right"') .
+				th('D/C', 'style=3D"text-align:right"')
 		);
-		$idx=3D0;
-		for ($i=3D0;$i < Database::num_row($ret);$i++)
+		$idx =3D 0;
+		for ($i =3D 0; $i < Database::num_row($ret); $i++)
 		{
-			$filter=3D " (j_date >=3D to_date('".$_REQUEST['start']."','DD.MM.YYY=
Y') ".
-					 " and  j_date <=3D to_date('".$_REQUEST['end']."','DD.MM.YYYY')) "=
;
-			$aCard=3DDatabase::fetch_array($ret,$i);
-			$oCard=3Dnew Fiche($cn,$aCard['f_id']);
-			$solde=3D$oCard->get_solde_detail($filter);
-			if ( $solde['debit'] =3D=3D 0 && $solde['credit']=3D=3D0) continue;
-		/* only not purged card */
-		if ($_GET['histo'] =3D=3D 5 && $solde['debit'] =3D=3D $solde['credit']=
) continue;
-			$class=3D'';
-			if ( $idx%2 =3D=3D 0) $class=3D'class=3D"odd"';
+			$filter =3D " (j_date >=3D to_date('" . $_REQUEST['start'] . "','DD.M=
M.YYYY') " .
+					" and  j_date <=3D to_date('" . $_REQUEST['end'] . "','DD.MM.YYYY')=
) ";
+			$aCard =3D Database::fetch_array($ret, $i);
+			$oCard =3D new Fiche($cn, $aCard['f_id']);
+			$solde =3D $oCard->get_solde_detail($filter);
+			if ($solde['debit'] =3D=3D 0 && $solde['credit'] =3D=3D 0)
+				continue;
+			/* only not purged card */
+			if ($_GET['histo'] =3D=3D 5 && $solde['debit'] =3D=3D $solde['credit'=
])
+				continue;
+			$class =3D '';
+			if ($idx % 2 =3D=3D 0)
+				$class =3D 'class=3D"odd"';
 			$idx++;
 			echo tr(
-				td(HtmlInput::history_card($oCard->id,$oCard->strAttribut(ATTR_DEF_Q=
UICKCODE))).
-				td($oCard->strAttribut(ATTR_DEF_NAME)).
-				td(nbm($solde['debit']),'style=3D"text-align:right"').
-				td(nbm($solde['credit']),'style=3D"text-align:right"').
-				td(nbm(abs($solde['solde'])),'style=3D"text-align:right"').
-				td((($solde['debit']<$solde['credit'])?'CRED':'DEB'),'style=3D"text-=
align:right"'),
-				$class
+					td(HtmlInput::history_card($oCard->id, $oCard->strAttribut(ATTR_DEF=
_QUICKCODE))) .
+					td($oCard->strAttribut(ATTR_DEF_NAME)) .
+					td(nbm($solde['debit']), 'style=3D"text-align:right"') .
+					td(nbm($solde['credit']), 'style=3D"text-align:right"') .
+					td(nbm(abs($solde['solde'])), 'style=3D"text-align:right"') .
+					td((($solde['debit'] < $solde['credit']) ? 'CRED' : 'DEB'), 'style=3D=
"text-align:right"'), $class
 			);
-
 		}
 		echo '</table>';
 	}
-    echo $export_pdf;
-    echo $export_csv;
-    echo $export_print;
+	echo $str_add_card;
+	echo $export_pdf;
+	echo $export_csv;
+	echo $export_print;
=20
-    exit();
+	exit();
 }
-if ( isDate($_REQUEST['start']) =3D=3D null || isDate ($_REQUEST['end'])=
 =3D=3D null )
+if (isDate($_REQUEST['start']) =3D=3D null || isDate($_REQUEST['end']) =3D=
=3D null)
 {
-	echo h2('Date invalide !','class=3D"error"');
-    alert('Date invalide !');
-    exit;
+	echo h2('Date invalide !', 'class=3D"error"');
+	alert('Date invalide !');
+	exit;
 }
-//----------------------------------------------------------------------=
------
-// for the lettering / history
-//----------------------------------------------------------------------=
------
-
+/***********************************************************************=
************************************************************
+ * Lettering
+ *
+ ***********************************************************************=
***********************************************************/
 // all card
-if ($allcard=3D=3D1)
+if ($allcard =3D=3D 1)
 {
-	$afiche=3D$cn->get_array("select fd_id from vw_fiche_def where ad_id=3D=
".ATTR_DEF_ACCOUNT." order by fd_label asc");
+	$afiche =3D $cn->get_array("select fd_id from vw_fiche_def where ad_id=3D=
" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
 }
 else
 {
-	$afiche[0]=3Darray('fd_id'=3D>$_REQUEST['cat']);
+	$afiche[0] =3D array('fd_id' =3D> $_REQUEST['cat']);
 }
+echo $str_add_card;
 echo $export_csv;
 echo $export_pdf;
 echo $export_print;
-$fiche=3Dnew Fiche($cn);
+$fiche =3D new Fiche($cn);
 for ($e =3D 0; $e < count($afiche); $e++)
 {
 	$array =3D Fiche::get_fiche_def($cn, $afiche[$e]['fd_id'], 'name_asc');
@@ -276,7 +382,7 @@
 		{
 			$letter->get_unletter();
 		}
-		if ( $_GET['histo'] =3D=3D 6 )
+		if ($_GET['histo'] =3D=3D 6)
 		{
 			$letter->get_letter_diff();
 		}
@@ -285,7 +391,7 @@
 			continue;
 		$detail_card =3D HtmlInput::card_detail($row->strAttribut(ATTR_DEF_QUI=
CKCODE), $row->strAttribut(ATTR_DEF_NAME));
=20
-		echo '<h2 style=3D"font-size:14px;text-align:left;margin-left:10;paddi=
ng-left:50;border:solid 1px blue;width:25%;text-decoration:underline">' .=
 $detail_card . '</h2>';
+		echo '<h2 style=3D"font-size:14px;text-align:left;margin-left:10;paddi=
ng-left:50;border:solid 1px blue;width:50%;text-decoration:underline">' .=
 $detail_card . '</h2>';
=20
 		echo '<table style=3D"width:80%;padding-left:10%;padding-right:10%">';
 		echo '<tr>';
@@ -326,14 +432,15 @@
 				$amount_cred+=3D$row['j_montant'];
 				$prog =3D bcsub($prog, $row['j_montant']);
 			}
-			$side=3D"&nbsp;".$fiche->get_amount_side($prog);
-			echo td(nbm($prog).$side, 'style=3D"text-align:right"');
+			$side =3D "&nbsp;" . $fiche->get_amount_side($prog);
+			echo td(nbm($prog) . $side, 'style=3D"text-align:right"');
 			if ($row['letter'] !=3D -1)
-				{
-				$span_error=3D"";
-				if ( $row['letter_diff'] !=3D 0 ) $span_error=3D$g_failed;
-				echo td($row['letter'].$span_error);
-				}
+			{
+				$span_error =3D "";
+				if ($row['letter_diff'] !=3D 0)
+					$span_error =3D $g_failed;
+				echo td($row['letter'] . $span_error);
+			}
 			else
 				echo td('');
 			echo '</tr>';
@@ -359,10 +466,9 @@
 		echo '</table>';
 	}
 }
+echo $str_add_card;
 echo $export_csv;
 echo $export_pdf;
 echo $export_print;
-
-
 ?>
=20

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-22 17:10:06 UTC (rev 4980)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-23 00:32:15 UTC (rev 4981)
@@ -472,5 +472,8 @@
 create sequence uos_pk_seq;
 create table tool_uos (  uos_value bigint default nextval ('uos_pk_seq')=
 primary key );
=20
-update menu_ref set me_code=3D'CFGCARD',me_file=3D'cfgfiche.inc.php' whe=
re me_code=3D'CARD';
-update menu_ref set me_code=3D'CARD',me_file=3D'fiche.inc.php' where me_=
code=3D'PRINTCARD';
+-- update menu_ref set me_code=3D'CFGCARD',me_file=3D'cfgfiche.inc.php' =
where me_code=3D'CARD';
+-- update menu_ref set me_code=3D'CARD',me_file=3D'fiche.inc.php' where =
me_code=3D'PRINTCARD';
+-- update profile_menu set me_code=3D'CARD' where me_code=3D'CFGCARD';
+-- update profile_menu set me_code=3D'CFGCARD' , me_code_dep=3D'PARAM' w=
here me_code=3D'CARD' and me_code_dep=3D'PRINT';
+-- update menu_ref set me_menu=3D'Fiche',me_description=3D'Liste,Balance=
,Historique par fiche' where me_code=3D'CARD'



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 22 20:54:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiEcU-0003uA-Jd
	for mharc-phpcompta-dev@gnu.org; Fri, 22 Jun 2012 20:54:34 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 23 Jun 2012 02:45:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.220450.1340412874.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4982 - in phpcompta/trunk: html html/js include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Jun 2012 00:54:33 -0000

Author: danydb
Date: 2012-06-23 02:45:16 +0200 (Sat, 23 Jun 2012)
New Revision: 4982

Modified:
   phpcompta/trunk/html/js/card.js
   phpcompta/trunk/html/style.css
   phpcompta/trunk/include/ajax_get_profile.php
   phpcompta/trunk/include/fiche.inc.php
   phpcompta/trunk/sql/upgrade.sql
Log:
0000577: Remplacer FICHE par PRINTCARD

Modified: phpcompta/trunk/html/js/card.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/card.js	2012-06-23 00:32:15 UTC (rev 4981)
+++ phpcompta/trunk/html/js/card.js	2012-06-23 00:45:16 UTC (rev 4982)
@@ -470,7 +470,7 @@
     if ( obj.elements &&  obj.elements['ref'] )
     {
         ref=3D'&ref';
-    }
+    }=20
     var content=3D'div_new_card';
     var nTop=3DposY-40;
     var nLeft=3DposX-20;

Modified: phpcompta/trunk/html/style.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style.css	2012-06-23 00:32:15 UTC (rev 4981)
+++ phpcompta/trunk/html/style.css	2012-06-23 00:45:16 UTC (rev 4982)
@@ -125,7 +125,7 @@
 div.u_tool {
 	float:left;
 	width:  100%;
-	padding-bottom: 7px;
+	padding-bottom: 20px;
 	}
 div.u_tool div.name {
        float:left;
@@ -834,7 +834,7 @@
 	border-style:  inset ;
 	color:red;
 	margin:1 2 1 2;
-       =20
+
 	}
 	td.tool {
 	border: solid 1px gray;

Modified: phpcompta/trunk/include/ajax_get_profile.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_get_profile.php	2012-06-23 00:32:15 UTC =
(rev 4981)
+++ phpcompta/trunk/include/ajax_get_profile.php	2012-06-23 00:45:16 UTC =
(rev 4982)
@@ -35,11 +35,13 @@
 ?>
 <hr>
 <h1>Profil <?=3D$profile->p_name?></h1>
+<? if ($p_id > 0 ) : ?>
 <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_gen_div')"><?=3D_('Nom')?></a>&nbsp;
 <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_menu_div')"><?=3D_('D=C3=A9tail Menus')?></a>&nbsp;
 <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_print_div')"><?=3D_('D=C3=A9tail Impressions')?></a>&nbsp;
 <a href=3D"javascript:void(0)" class=3D"line" style=3D"" onclick=3D"prof=
ile_show('profile_gestion_div')"><?=3D_('Action Gestion')?> </a>&nbsp;
 <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_repo_div')"><?=3D_('D=C3=A9p=C3=B4ts')?></a>&nbsp;
+<? endif; ?>
=20
 <?
 $id=3DHtmlInput::hidden('p_id',$profile->p_id);
@@ -50,7 +52,16 @@
=20
 $with_direct_form=3Dnew ICheckBox("with_direct_form","t");
 $with_direct_form->set_check($profile->with_direct_form);
-echo '<div style=3D"display:none" id=3D"profile_gen_div">';
+
+// If $p_id =3D=3D -1 it is a new profile
+if ( $p_id > 0 )
+{
+	echo '<div style=3D"display:none" id=3D"profile_gen_div">';
+}
+else
+{
+	echo '<div  id=3D"profile_gen_div">';
+}
 echo '<form method=3D"POST" onsubmit=3D"return confirm (\'vous confirmez=
\')">';
 echo HtmlInput::hidden('tab','profile_gen_div');
 echo HtmlInput::hidden('p_id',$profile->p_id);

Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-23 00:32:15 UTC (rev 49=
81)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-23 00:45:16 UTC (rev 49=
82)
@@ -99,7 +99,7 @@
=20
 $h_add_card_b =3D new IButton('add_card');
 $h_add_card_b->label =3D _('Cr=C3=A9er une nouvelle fiche');
-$h_add_card_b->javascript =3D "dis_blank_card({gDossier:$gDossier,fd_id:=
$fd_id})";
+$h_add_card_b->javascript =3D "dis_blank_card({gDossier:$gDossier,fd_id:=
$fd_id,ref:2})";
 $str_add_card =3D ($g_user->check_action(FICADD) =3D=3D 1) ? $h_add_card=
_b->input() : "";
=20
 /*

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-23 00:32:15 UTC (rev 4981)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-23 00:45:16 UTC (rev 4982)
@@ -472,8 +472,9 @@
 create sequence uos_pk_seq;
 create table tool_uos (  uos_value bigint default nextval ('uos_pk_seq')=
 primary key );
=20
--- update menu_ref set me_code=3D'CFGCARD',me_file=3D'cfgfiche.inc.php' =
where me_code=3D'CARD';
--- update menu_ref set me_code=3D'CARD',me_file=3D'fiche.inc.php' where =
me_code=3D'PRINTCARD';
--- update profile_menu set me_code=3D'CARD' where me_code=3D'CFGCARD';
--- update profile_menu set me_code=3D'CFGCARD' , me_code_dep=3D'PARAM' w=
here me_code=3D'CARD' and me_code_dep=3D'PRINT';
--- update menu_ref set me_menu=3D'Fiche',me_description=3D'Liste,Balance=
,Historique par fiche' where me_code=3D'CARD'
+update menu_ref set me_code=3D'CFGCARD',me_file=3D'cfgfiche.inc.php' whe=
re me_code=3D'CARD';
+update menu_ref set me_code=3D'CARD',me_file=3D'fiche.inc.php' where me_=
code=3D'PRINTCARD';
+update profile_menu set me_code=3D'CARD' where me_code=3D'CFGCARD';
+update profile_menu set me_code=3D'CFGCARD' , me_code_dep=3D'PARAM' wher=
e me_code=3D'CARD' and me_code_dep=3D'PRINT';
+update menu_ref set me_menu=3D'Fiche',me_description=3D'Liste,Balance,Hi=
storique par fiche' where me_code=3D'CARD';
+update menu_ref set me_menu=3D'Fiche',me_description=3D'Configuration de=
 cat=C3=A9gorie de fiches' where me_code=3D'CFGCARD';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 11:56:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SipAa-0001AV-LQ
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 11:56:12 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 17:46:44 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223312.1340553371.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4983 - in phpcompta/trunk: html html/js include
	include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 15:56:11 -0000

Author: danydb
Date: 2012-06-24 17:46:43 +0200 (Sun, 24 Jun 2012)
New Revision: 4983

Added:
   phpcompta/trunk/include/ajax_fiche_def_detail.php
   phpcompta/trunk/include/template/fiche_def_list.php
   phpcompta/trunk/include/template/fiche_list.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/cfgfiche.inc.php
   phpcompta/trunk/include/class_fiche_def.php
   phpcompta/trunk/include/class_tool_uos.php
Log:
0000577: Remplacer FICHE par PRINTCARD

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-23 00:45:16 UTC (rev 4982)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-24 15:46:43 UTC (rev 4983)
@@ -557,6 +557,9 @@
 	case 'view_mod_stock':
 		require_once 'ajax_view_mod_stock.php';
 		break;
+	case 'fddetail':
+		require_once 'ajax_fiche_def_detail.php';
+		break;
 	default:
 		var_dump($_GET);
 }

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-23 00:45:16 UTC (rev 4982)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-24 15:46:43 UTC (rev 4983)
@@ -1592,20 +1592,36 @@
 	}
 }
 /**
- * <a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show=
('profile_gen_div')"><?=3D_('Nom')?></a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_menu_div')"><?=3D_('D=C3=A9tail Menus')?></a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_print_div')"><?=3D_('D=C3=A9tail Impressions')?></a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" style=3D"" onclick=3D"prof=
ile_show('profile_gestion_div')"><?=3D_('Action Gestion')?> </a>&nbsp;
-<a href=3D"javascript:void(0)" class=3D"line" onclick=3D"profile_show('p=
rofile_repo_div')"><?=3D_('D=C3=A9p=C3=B4ts')?></a>&nbsp;
+ * tab menu for the profile parameter
  */
 function profile_show(p_div)
 {
 	try{
 		var div=3D['profile_gen_div','profile_menu_div','profile_print_div','p=
rofile_gestion_div','profile_repo_div'];
-		for (var r =3D0;r<div.length;r++ ) {$(div[r]).hide();  }
+		for (var r =3D0;r<div.length;r++ ) {$(div[r]).hide();}
 		$(p_div).show();
 	} catch(e)
 	{
 		alert(e.message)
 	}
+}
+function detail_category_show(p_div,p_dossier,p_id)
+{
+	$(p_div).show();
+	waiting_box();
+	var queryString=3D"gDossier=3D"+p_dossier+"&id=3D"+p_id+"&op=3Dfddetail=
";
+	var action =3D new Ajax.Request(
+				  "ajax_misc.php" ,
+				  {
+				      method:'get', parameters:queryString,
+				      onFailure:ajax_misc_failure,
+				      onSuccess:function(req){
+						remove_waiting_box();
+						$('list_cat_div').hide();
+						$('detail_category_div').innerHTML=3Dreq.responseText;
+						$('detail_category_div').show();
+						req.responseText.evalScripts();
+				      }
+				  }
+				  );
 }
\ No newline at end of file

Added: phpcompta/trunk/include/ajax_fiche_def_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_fiche_def_detail.php	                   =
     (rev 0)
+++ phpcompta/trunk/include/ajax_fiche_def_detail.php	2012-06-24 15:46:43=
 UTC (rev 4983)
@@ -0,0 +1,43 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show detail of a fiche_def (category of card) + Attribut
+ *
+ */
+require_once('class_fiche_def.php');
+require_once 'class_tool_uos.php';
+$fd=3Dnew Fiche_Def($cn,$_GET['id']);
+if ( $_GET['id'] > 0 )
+{
+
+	echo $fd->input_detail();
+	echo HtmlInput::button("retour_b", "Retour =C3=A0 la liste", "onclick=3D=
\"$('detail_category_div').hide();$('list_cat_div').show()\"");
+}
+else
+{
+	$fd->input_new();
+=09
+}
+?>

Modified: phpcompta/trunk/include/cfgfiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/cfgfiche.inc.php	2012-06-23 00:45:16 UTC (rev=
 4982)
+++ phpcompta/trunk/include/cfgfiche.inc.php	2012-06-24 15:46:43 UTC (rev=
 4983)
@@ -28,477 +28,112 @@
 require_once('class_database.php');
 include_once ("user_menu.php");
 require_once('class_dossier.php');
-require_once('class_ipopup.php');
-// Necessaire ???
-/*echo IPoste::ipopup('ipop_account');
-echo ICard::ipopup('ipop_card');*/
+require_once 'class_sort_table.php';
+require_once 'class_fiche_def.php';
+require_once 'class_tool_uos.php';
=20
-$str_dossier=3Ddossier::get();
-global $g_user,$cn;
+$retour=3DHtmlInput::button_anchor("Retour =C3=A0 la liste", HtmlInput::=
get_to_string(array("gDossier","ac")));
=20
-$pop_tva=3Dnew IPopup('popup_tva');
-$pop_tva->title=3D_('Choix TVA');
-$pop_tva->value=3D'';
-echo $pop_tva->input();
-
-
-// Security check
-$write=3D$g_user->check_action(FICADD);
-if ($write =3D=3D 0 )
+/***********************************************************************=
********************/
+// Add an attribut
+/***********************************************************************=
********************/
+if ( isset($_POST['add_line']))
 {
-    /* Cannot Access */
-    NoAccess();
+	 $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+     $fiche_def->InsertAttribut($_REQUEST['ad_id']);
+     echo $fiche_def->input_detail();
+	 echo $retour;
+	 exit();
 }
-
-function ShowRecherche()
+/***********************************************************************=
********************/
+// Remove an attribut
+/***********************************************************************=
********************/
+if ( isset ($_POST['remove_line']))
 {
-    echo '<form method=3D"GET" action=3D"?">';
-    echo dossier::hidden();
-      echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-    $w=3Dnew IText();
-    $search_text=3D(isset($_REQUEST['search_text']))?$_REQUEST['search_t=
ext']:"";
-    $h=3Dnew IHidden();
-    echo $h->input('p_action','fiche');
-    echo $h->input('action','search');
-    echo $h->input('ac',$_REQUEST['ac']);
-
-    echo _("Recherche :").$w->input('search_text',$search_text);
-    echo HtmlInput::submit('submit',_('Rechercher'));
-    echo '</form>';
+	$fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+	$fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+	$fiche_def->RemoveAttribut($_REQUEST['chk_remove']);
+    echo $fiche_def->input_detail();
+	echo $retour;
+	exit();
 }
-function ShowFicheDefInput($p_fiche_def)
+/***********************************************************************=
********************/
+// Try to remove a category
+/***********************************************************************=
********************/
+if ( isset ($_POST['remove_cat']))
 {
-    $r=3D"";
-    // Save the label
-
-    $p_fiche_def->Get();
-    $p_fiche_def->GetAttribut();
-
-    /*  we change the main attribute */
-    if (isset ($_REQUEST['label']) )
-    {
-        $p_fiche_def->SaveLabel($_REQUEST['label']);
-        if ( isset($_REQUEST['create']))
-        {
-            $p_fiche_def->set_autocreate(true);
-        }
-        else
-        {
-            $p_fiche_def->set_autocreate(false);
-        }
-        $p_fiche_def->save_class_base($_REQUEST['class_base']);
-    }
-    $p_fiche_def->Get();
-    $r.=3D '<H2 class=3D"info">'.$p_fiche_def->id." ".h($p_fiche_def->la=
bel).'</H2>';
-    $r.=3D'<fieldset><legend>Donn=C3=A9es g=C3=A9n=C3=A9rales</legend>';
-
-    /* show the values label class_base and create account */
-    $r.=3D'<form method=3D"post">';
-    $r.=3D HtmlInput::hidden('ac',$_REQUEST['ac']);
-    $r.=3Ddossier::hidden();
-    $r.=3DHtmlInput::hidden("fd_id",$p_fiche_def->id);
-    $r.=3DHtmlInput::hidden("ac",$_REQUEST['ac']);
-    $r.=3DHtmlInput::hidden("p_action","fiche");
-    $r.=3D $p_fiche_def->input_base();
-    $r.=3D'<hr>';
-    $r.=3DHtmlInput::submit('change_name',_('Sauver'));
-    $r.=3D'</form>';
-    $r.=3D'</fieldset>';
-    /* attributes */
-    $r.=3D'<fieldset><legend>D=C3=A9tails</legend>';
-
-    $r.=3D '<FORM action=3D"do.php" method=3D"POST">';
-    $r.=3Ddossier::hidden();
-    $r.=3D HtmlInput::hidden('ac',$_REQUEST['ac']);
-    $r.=3DHtmlInput::hidden("fd_id",$p_fiche_def->id);
-    $r.=3DHtmlInput::hidden("ac",$_REQUEST['ac']);
-    $r.=3D $p_fiche_def->DisplayAttribut("remove");
-    $r.=3D HtmlInput::submit('add_line',_('Ajoutez cet =C3=A9l=C3=A9ment=
'));
-    $r.=3D HtmlInput::submit("save_line",_("Sauvez"));
-    $r.=3DHtmlInput::submit('remove_cat',_('Effacer cette cat=C3=A9gorie=
'),'onclick=3D"return confirm(\''._('Vous confirmez ?').'\')"');
-    // if there is nothing to remove then hide the button
-    if ( strpos ($r,"chk_remove") !=3D 0 )
-    {
-        $r.=3DHtmlInput::submit('remove_line',_("Enleve les =C3=A9l=C3=A9=
ments coch=C3=A9s"),"onclick=3D\"return confirm('Vous confirmez?')\"" );
-    }
-    $r.=3D "</form>";
-    $r.=3D" <p class=3D\"notice\"> "._("Attention : il n'y aura pas de d=
emande de confirmation pour enlever les
-                                   attributs s=C3=A9lectionn=C3=A9s. Il =
ne sera pas possible de revenir en arri=C3=A8re")."</p>";
-    $r.=3D'</fieldset>';
-
-    return $r;
-}
-
-$recherche=3Dtrue;
-// Creation of a new model of card
-// in the database
-if ( isset($_POST['add_modele'])    )
-{
-    $g_user->can_request(FICCAT);
-    // insert the model of card in database
-    $fiche_def=3Dnew Fiche_Def($cn);
-    $fiche_def->Add($_POST);
-}
-$r=3D"";
-
-if ( isset ($_POST['remove_cat'] )  )
-{
-    $g_user->can_request(FICCAT);
-
-    $fd_id=3Dnew Fiche_Def($cn,$_POST['fd_id']);
+	$fd_id=3Dnew Fiche_Def($cn,$_POST['fd_id']);
     $remains=3D$fd_id->remove();
     if ( $remains !=3D 0 )
         /* some card are not removed because it is used */
         alert('Impossible d\'enlever cette cat=C3=A9gorie, certaines fic=
hes sont encore utilis=C3=A9es'."\n".
               'Les fiches non utilis=C3=A9es ont cependant =C3=A9t=C3=A9=
 effac=C3=A9es');
 }
-// Add a line in the card model
-if ( isset ($_POST["add_line"])  )
+/***********************************************************************=
********************/
+// Change some basis info
+/***********************************************************************=
********************/
+if ( isset ($_POST['change_name']))
 {
-    $g_user->can_request(FIC);
-
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
+	 if (isset ($_REQUEST['label']) )
     {
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-        // Insert Line
-        $fiche_def->InsertAttribut($_REQUEST['ad_id']);
-
-        $r.=3DShowFicheDefInput($fiche_def);
-
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-}
-/* ------------------------------------------------- */
-/* SAVE ORDER */
-/* ------------------------------------------------- */
-
-if ( isset($_POST['save_line']))
-{
-    $g_user->can_request(FICCAT);
-    $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-    $fiche_def->save_order($_POST);
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-        // Insert Line
-        $r.=3DShowFicheDefInput($fiche_def);
-
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-
-}
-// Remove lines from a card model
-if ( isset ($_POST['remove_line'])   )
-{
-    $g_user->can_request(FICCAT);
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        if ( isset($_REQUEST['chk_remove']))
+		 $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+        $fiche_def->SaveLabel($_REQUEST['label']);
+        if ( isset($_REQUEST['create']))
         {
-            $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-            // Insert Line
-            // demander confirmation
-
-            $fiche_def->RemoveAttribut($_REQUEST['chk_remove']);
-            $r.=3DShowFicheDefInput($fiche_def);
+            $fiche_def->set_autocreate(true);
         }
-
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-}
-// Change the name of the card  model
-if ( isset ($_POST["change_name"] )   )
-{
-    $g_user->can_request(FICCAT);
-    $r=3D '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        $r.=3D "<h2 class=3D\"error\"> "._("Pas d'acc=C3=A8s")." </h2>";
-    else
-    {
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
-        $r.=3DShowFicheDefInput($fiche_def);
-    }
-    $r.=3D '</DIV>';
-    $recherche=3Dfalse;
-    ShowMenuFiche(Dossier::id());
-    echo $r;
-    exit();
-}
-
-ShowMenuFiche(Dossier::id());
-echo $r;
-
-//----------------------------------------------------------------------=
--------
-// Get action
-if ( isset ( $_GET["action"]) )
-{
-    $action=3D$_GET["action"];
-    // View the details of the selected cat. of cards
-    if ( isset ($_GET["fiche"]) && $action=3D=3D"vue"
-            && ! isset ($_POST['add_fiche'])
-            && ! isset ($_POST['update_fiche'])
-            && ! isset ($_POST['move'])
-            && ! isset ($_POST['delete']))
-    {
-        $g_user->can_request(FICADD);
-
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-        $fiche_def->myList();
-
-        echo '</DIV>';
-
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Display the detail of a card
-    if ($action=3D=3D "detail" )
-    {
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $t=3Dfalse;
-        if ( $g_user->check_action(FICADD)=3D=3D0)
-        {
-            echo '<H2 class=3D"info"> Vos changements ne seront pas sauv=
=C3=A9s</h2>';
-            $t=3Dtrue;
-        }
-        $str=3D"&".dossier::get();
-        $fiche=3Dnew Fiche($cn,$_GET["fiche_id"]);
-        $fiche->get_categorie();
-        $fiche_def=3Dnew Fiche_Def($cn,$fiche->fd_id);
-        $fiche_def->Get();
-        echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
-
-        if ( $_SESSION['g_pagesize'] !=3D -1 )
-        {
-            // retrieve value
-            // with offet &offset=3D15&step=3D15&page=3D2&size=3D15
-            if ( isset($_GET['offset']) && $_SESSION['g_pagesize'] !=3D =
-1)
-            {
-                $str=3Dsprintf("&offset=3D%s&step=3D%s&page=3D%s&size=3D=
%s",
-                             $_GET['offset'],
-                             $_GET['step'],
-                             $_GET['page'],
-                             $_GET['size']);
-            }
-
-
-        }
-        if ( $write !=3D 0 )
-            echo '<form method=3D"post" action=3D"?p_action=3Dfiche&acti=
on=3Dvue&fiche=3D'.$_GET['fiche'].$str.'">';
-        echo dossier::hidden();
-        echo $fiche->Display($t);
-	echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-        echo HtmlInput::hidden("f_id",$_GET['fiche_id']);
-        if ( $write !=3D 0 )
-        {
-            $iselect=3Dnew ISelect('move_to');
-            $iselect->value=3D$cn->make_array('select fd_id,fd_label fro=
m fiche_def order by fd_label'); //where frd_id=3D'.$fiche->get_fiche_def=
_ref_id());
-
-            echo HtmlInput::submit("update_fiche","Mise &agrave; jour");
-            echo HtmlInput::submit("delete" ,"Effacer cette fiche","oncl=
ick=3D\"return confirm('"._('Vous confirmez ?')."');\"");
-	    echo HtmlInput::history_card_button($_GET['fiche_id'],_('Historique=
'));
-            echo HtmlInput::submit('move',_('D=C3=A9placer vers'),"oncli=
ck=3D\"return confirm('"._('Attention, certains attributs pourraient =C3=AA=
tre ajout=C3=A9s =C3=A0 la cat=C3=A9gorie de destination, vous confirmez =
?')."');\"");
-            echo $iselect->input();
-        }
-        $str=3D"";
-        echo HtmlInput::button_anchor(_('Retour'),'?p_action=3Dfiche&act=
ion=3Dvue&'.$str_dossier.'&fiche=3D'.$fiche->fiche_def.$str.
-		"&ac=3D".$_REQUEST['ac']);
-
-        if ( $write !=3D 0 ) echo '</form>';
-        echo '</DIV>';
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Display the form where you can enter
-    // the property of the card model
-    if ($action =3D=3D "add_modele" )
-    {
-        $g_user->can_request(FICCAT);
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        echo '<form method=3D"post">';
-	echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-        $oFiche_Def=3Dnew Fiche_Def($cn);
-        echo HtmlInput::hidden("p_action","fiche");
-        echo dossier::hidden();
-        echo $oFiche_Def->input(); //    CreateCategory($cn,$search);
-        echo HtmlInput::submit("add_modele" ,"Sauve");
-
-        echo '</form>';
-        echo '</DIV>';
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Modify a card Model
-    if ($action =3D=3D "modifier" )
-    {
-        $g_user->can_request(FICCAT);
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-
-        echo ShowFicheDefInput($fiche_def);
-        echo '</DIV>';
-        $recherche=3Dfalse;
-    }
-    //__________________________________________________________________=
_______
-    // Search a card
-    if ( $action =3D=3D "search" )
-    {
-        echo '<DIV class=3D"redcontent" style=3D"width:auto;">';
-        ShowRecherche();
-        $sql=3D"select distinct f_id,fd_id from fiche join fiche_detail =
using (f_id)
-                 where
-             upper(ad_value) like upper('%".sql_string($_GET["search_tex=
t"])."%') order by f_id";
-
-        $all=3D$cn->get_array($sql);
-        // test on the size
-        //
-        if ( sizeof($all) !=3D 0 )
-        {
-
-            echo "<b>R=C3=A9sultat : ".sizeof($all).'=C3=A9l=C3=A9ments =
trouv=C3=A9s </b><br>';
-            foreach ($all as $f_id)
-            {
-                $fiche=3Dnew Fiche($cn,$f_id['f_id']);
-                echo '<A  href=3D"?p_action=3Dfiche&'.$str_dossier.'&act=
ion=3Ddetail&fiche_id=3D'.$f_id['f_id'].
-                '&fiche=3D'.$f_id['fd_id']."&ac=3D".$_REQUEST['ac'].'">'=
.
-                $fiche->getName().'</A>';
-            }
-        }
         else
         {
-            echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-            echo "Aucun r=C3=A9sultat trouv=C3=A9";
-
+            $fiche_def->set_autocreate(false);
         }
-        echo '</div>';
+        $fiche_def->save_class_base($_REQUEST['class_base']);
=20
-
     }
-    $recherche=3Dfalse;
+	echo $fiche_def->input_detail();
+	echo $retour;
+	exit();
 }
-// Display a blank  card from the selected category
-if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) )
+/***********************************************************************=
********************/
+// Save order of the attributes
+/***********************************************************************=
********************/
+if ( isset($_POST['save_line']))
 {
-    $g_user->can_request(FICADD);
-
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche_def=3Dnew Fiche_Def($cn,$_POST['fiche']);
-        $fiche_def->Get();
-        echo '<h2 class=3D"info">'.$fiche_def->label.'</h2>';
-        $fiche=3Dnew Fiche($cn,0);
-        echo '<form method=3D"post" >';
-        echo dossier::hidden();
-		echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-		echo HtmlInput::hidden('fiche',$_POST['fiche']);
-        echo $fiche->blank($_POST['fiche']);
-        echo HtmlInput::submit("add_fiche","Ajout");
-
-
-        echo '</form>';
-    }
-    echo '</DIV>';
-    $recherche=3Dfalse;
-    exit();
+    $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fd_id']);
+    $fiche_def->save_order($_POST);
+	echo $fiche_def->input_detail();
+	echo $retour;
+	exit();
 }
-//----------------------------------------------------------------------=
--------
-// delete a card
-if (isset($_POST['delete']) )
+/***********************************************************************=
********************/
+// Save a new category of card
+/***********************************************************************=
********************/
+if ( isset($_POST['add_modele']))
 {
-    $g_user->can_request(FICADD);
-    ShowRecherche();
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche=3Dnew Fiche($cn,$_POST["f_id"]);
-        $fiche->remove();
-    }
-    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-    $fiche_def->myList();
-
-    echo "</DIV>";
-    exit();
+	$single=3Dnew Tool_Uos("dup");
+	if ($single->get_count()=3D=3D0)
+	{
+		$single->save();
+		$fiche_def=3Dnew Fiche_Def($cn);
+		if ( $fiche_def->Add($_POST) =3D=3D 0 )
+		{
+			echo $fiche_def->input_detail();
+			echo $retour;
+			exit();
+		}
+		else
+		{
+			$fiche_def->input_new();
+			echo $retour;
+			exit();
+		}
+	}
+	else
+	{
+		alert('Doublon');
+	}
 }
-//----------------------------------------------------------------------=
--------
-// Add the data (attribute) of the card
-if ( isset ($_POST["add_fiche"]) )
-{
-    $g_user->can_request(FICADD);
-    if ( $write =3D=3D0)
-    {
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    }
-    else
-    {
-        ShowRecherche();
-        echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-        $fiche=3Dnew Fiche($cn);
-        $fiche->Save($_REQUEST['fiche']);
-        $fiche_def=3Dnew Fiche_Def($cn,$_REQUEST['fiche']);
-        $fiche_def->myList();
+$fiche_def=3Dnew Fiche_def($cn);
=20
-
-    }
-    echo '</DIV>';
-    $recherche=3Dfalse;
-}
-//----------------------------------------------------------------------=
--------
-// Update a card
-if ( isset ($_POST["update_fiche"])  )
-{
-    $g_user->can_request(FIC);
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    if ( $write =3D=3D0)
-        echo "<h2 class=3D\"error\"> Pas d'acc=C3=A8s </h2>";
-    else
-    {
-        $fiche=3Dnew Fiche($cn,$_POST['f_id']);
-        $fiche->Save();
-
-    }
-    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-    $fiche_def->myList();
-
-
-
-
-
-    echo '</DIV>';
-    $recherche=3Dfalse;
-}
-//----------------------------------------------------------------------=
----------
-// Move a card to a new category
-if ( isset($_POST['move']))
-{
-    echo '<DIV class=3D"redcontent" style=3D"width:auto">';
-    $fiche=3Dnew Fiche($cn,$_POST['f_id']);
-    $fiche->move_to($_POST['move_to']);
-    $fiche_def=3Dnew Fiche_Def($cn,$_GET['fiche']);
-    $fiche_def->myList();
-    echo '</div>';
-}
-//--Search menu
-if ( $recherche=3D=3Dtrue)
-{
-    ShowRecherche();
-}
-html_page_stop();
+$fiche_def->Display();
+$dossier=3DDossier::id();
 ?>

Modified: phpcompta/trunk/include/class_fiche_def.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche_def.php	2012-06-23 00:45:16 UTC (=
rev 4982)
+++ phpcompta/trunk/include/class_fiche_def.php	2012-06-24 15:46:43 UTC (=
rev 4983)
@@ -156,19 +156,30 @@
     }
     /*!
      **************************************************
-     * \brief  Display a fiche_def object into a table
+     * \brief  Display category into a table
      *
      * \return HTML row
      */
     function Display()
     {
+		$tab =3D new Sort_Table();
=20
-        $r=3Dsprintf("<TD>%s</TD>",$this->id);
-        $r.=3Dsprintf("<TD>%s</TD>",$this->label);
-        $r.=3Dsprintf("<TD>%s</TD>",$this->class_base);
-        $r.=3Dsprintf("<TD>%s</TD>",$this->fiche_def);
-        return $r;
-    }
+		$url =3D HtmlInput::get_to_string(array('ac', 'gDossier'));
+		$tab->add("Nom de fiche", $url, "order by fd_label asc", "order by fd_=
label desc", "na", "nd");
+		$tab->add("Bas=C3=A9 sur le poste comptable", $url, "order by fd_class=
_base asc", "order by fd_class_base desc", "pa", "pd");
+		$tab->add("Calcul automatique du poste comptable", $url, "order by fd_=
create_account asc", "order by fd_create_account desc", "ca", "cd");
+		$tab->add("Bas=C3=A9 sur le mod=C3=A8le", $url, "order by frd_text asc=
", "order by frd_text  desc", "ma", "md");
+
+		$order =3D (isset($_GET['ord'])) ? $tab->get_sql_order($_GET["ord"]) :=
 $tab->get_sql_order("na");
+
+
+		$res =3D $this->cn->exec_sql("SELECT fd_id, fd_class_base, fd_label, f=
d_create_account, fiche_def_ref.frd_id,
+frd_text  FROM fiche_def join fiche_def_ref on (fiche_def.frd_id=3Dfiche=
_def_ref.frd_id)
+$order
+");
+
+		require_once 'template/fiche_def_list.php';
+	}
     /*!\brief Add a fiche category thanks the element from the array
      * you cannot add twice the same cat. name
      * table : insert into fiche_def
@@ -191,13 +202,15 @@
=20
         // Name can't be empty
         if ( strlen(trim($p_nom_mod)) =3D=3D 0 )
-            return;
-
+		{
+			alert (_('Le nom de la cat=C3=A9gorie ne peut pas =C3=AAtre vide'));
+            return 1;
+		}
         // $p_FICHE_REF cannot be null !!! (=3D=3D fiche_def_ref.frd_id
         if (! isset ($p_FICHE_REF) || strlen($p_FICHE_REF) =3D=3D 0 )
         {
             echo alert (_('Vous devez choisir une categorie'));
-            return;
+            return 1;
         }
         $fiche_Def_ref=3Dnew Fiche_Def_Ref($this->cn,$p_FICHE_REF);
         $fiche_Def_ref->Get();
@@ -215,7 +228,10 @@
         $sql=3D"select count(*) from fiche_Def where upper(fd_label)=3Du=
pper($1)";
         $count=3D$this->cn->get_value($sql,array(trim($p_nom_mod)));
=20
-        if ($count !=3D 0 ) return -1;
+        if ($count !=3D 0 ) {
+			 echo alert (_('Cat=C3=A9gorie existante'));
+			return 1;
+		}
         // Set the value of fiche_def.fd_create_account
         // automatic creation for 'poste comptable'
         if ( isset($p_create) && strlen(trim($p_class_base)) !=3D 0)
@@ -269,15 +285,17 @@
         if (sizeof($def_attr) !=3D 0 )
         {
             // insert all the mandatory fields into jnt_fiche_attr
+            $jnt_order=3D10;
             foreach ( $def_attr as $i=3D>$v)
             {
-                $jnt_order=3D10;
+				$order=3D$jnt_order;
                 if ( $v['ad_id'] =3D=3D ATTR_DEF_NAME )
-                    $jnt_order=3D0;
+                    $order=3D0;
                 $sql=3Dsprintf("insert into jnt_fic_Attr(fd_id,ad_id,jnt=
_order)
                              values (%d,%s,%d)",
-                             $fd_id,$v['ad_id'],$jnt_order);
+                             $fd_id,$v['ad_id'],$order);
                 $this->cn->exec_sql($sql);
+				$jnt_order+=3D10;
             }
         }
         $this->id=3D$fd_id;
@@ -717,8 +735,58 @@
         $ret=3D$this->cn->count_sql("select fd_id from fiche_def where f=
rd_id=3D$1",array($p_frd_id));
         return $ret;
     }
+	function input_detail()
+	{
+		$r =3D "";
+		// Save the label
=20
+		$this->Get();
+		$this->GetAttribut();
+		$r.=3D '<H2 class=3D"info">' . $this->id . " " . h($this->label) . '</=
H2>';
+		$r.=3D'<fieldset><legend>Donn=C3=A9es g=C3=A9n=C3=A9rales</legend>';
=20
+		/* show the values label class_base and create account */
+		$r.=3D'<form method=3D"post">';
+		$r.=3Ddossier::hidden();
+		$r.=3DHtmlInput::hidden("fd_id", $this->id);
+		$r.=3DHtmlInput::hidden("p_action", "fiche");
+		$r.=3D $this->input_base();
+		$r.=3D'<hr>';
+		$r.=3DHtmlInput::submit('change_name', _('Sauver'));
+		$r.=3D'</form>';
+		$r.=3D'</fieldset>';
+		/* attributes */
+		$r.=3D'<fieldset><legend>D=C3=A9tails</legend>';
=20
+		$r.=3D '<FORM  method=3D"POST">';
+		$r.=3Ddossier::hidden();
+		$r.=3DHtmlInput::hidden("fd_id", $this->id);
+		$r.=3D $this->DisplayAttribut("remove");
+		$r.=3D HtmlInput::submit('add_line', _('Ajoutez cet =C3=A9l=C3=A9ment'=
));
+		$r.=3D HtmlInput::submit("save_line", _("Sauvez"));
+		$r.=3DHtmlInput::submit('remove_cat', _('Effacer cette cat=C3=A9gorie'=
), 'onclick=3D"return confirm(\'' . _('Vous confirmez ?') . '\')"');
+		// if there is nothing to remove then hide the button
+		if (strpos($r, "chk_remove") !=3D 0)
+		{
+			$r.=3DHtmlInput::submit('remove_line', _("Enleve les =C3=A9l=C3=A9men=
ts coch=C3=A9s"), "onclick=3D\"return confirm('Vous confirmez?')\"");
+		}
+		$r.=3D "</form>";
+		$r.=3D" <p class=3D\"notice\"> " . _("Attention : il n'y aura pas de d=
emande de confirmation pour enlever les
+                                   attributs s=C3=A9lectionn=C3=A9s. Il =
ne sera pas possible de revenir en arri=C3=A8re") . "</p>";
+		$r.=3D'</fieldset>';
+		return $r;
+	}
+	function input_new()
+	{
+		$single=3Dnew Tool_Uos("dup");
+		echo '<form method=3D"post" style=3D"display:inline">';
+		echo $single->hidden();
+		echo HtmlInput::hidden("p_action","fiche");
+		echo dossier::hidden();
+		echo $this->input(); //    CreateCategory($cn,$search);
+		echo HtmlInput::submit("add_modele" ,"Sauve");
+		echo '</FORM>';
+	}
+
 }
 ?>

Modified: phpcompta/trunk/include/class_tool_uos.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_tool_uos.php	2012-06-23 00:45:16 UTC (r=
ev 4982)
+++ phpcompta/trunk/include/class_tool_uos.php	2012-06-24 15:46:43 UTC (r=
ev 4983)
@@ -19,7 +19,7 @@
 /* $Revision: $Revision $ */
 /**
  * @file
- * Objec to check a double insert into the database, this duplicate occu=
rs after=20
+ * Objec to check a double insert into the database, this duplicate occu=
rs after
  * a refresh of the web page
  */
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
@@ -32,35 +32,34 @@
      * Constructor $p_name will be set to $this->name, it is also the na=
me
      * of the tag hidden in a form
      * @global $cn Db connxion
-     * @param $p_name=20
+     * @param $p_name
      */
     function __construct($p_name)
     {
-          global $cn;
         $this->name=3D$p_name;
-        $this->id=3D$cn->get_next_seq('uos_pk_seq');
     }
     /**
-     * @brief return a string with a tag hidden and a uniq value=20
+     * @brief return a string with a tag hidden and a uniq value
      * @param $hHidden is the name of the tag hidden
      * @return string : tag hidden
      */
-    function hidden($hHidden)
+    function hidden()
     {
-        return HtmlInput::hidden($hHidden,$this->id);
+		global $cn;
+        $this->id=3D$cn->get_next_seq('uos_pk_seq');
+        return HtmlInput::hidden($this->name,$this->id);
     }
     /**
      * @brief Try to insert into the table tool_uos
      * @global $cn Database connx
-     * @param $p_id integer is the value of hidden
      * @throws Exception if the value $p_id is not unique
      */
-    function save($p_id)
+    function save()
     {
         global $cn;
         $sql=3D"insert into tool_uos(uos_value) values ($1)";
         try {
-            $cn->exec_sql($sql,array($this->id));  =20
+            $cn->exec_sql($sql,array($this->id));
         } catch (Exception $e)
         {
             throw new Exception('Duplicate value','CODE_EXCP_DUPLICATE',=
$e);
@@ -79,7 +78,7 @@
         if ( $p_array =3D=3D null ) $p_array=3D$_POST;
         $this->id=3D$p_array[$this->name];
         $count=3D$cn->get_value('select count(*) from tool_uos where uos=
_value=3D$1',
-                array($p_id));
+                array($this->id));
         return $count;
     }
     function check ($p_array=3Dnull)
@@ -87,7 +86,7 @@
         global $cn;
         if ( $p_array =3D=3D null ) $p_array=3D$_POST;
         $this->id=3D$p_array[$this->name];
-        try=20
+        try
         {
             $count=3D$cn->get_value('select count(*) from tool_uos where=
 uos_value=3D$1',
                     array($p_id));

Added: phpcompta/trunk/include/template/fiche_def_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/fiche_def_list.php	                 =
       (rev 0)
+++ phpcompta/trunk/include/template/fiche_def_list.php	2012-06-24 15:46:=
43 UTC (rev 4983)
@@ -0,0 +1,81 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief show all the categories of card fiche_def
+ *
+ */
+$max=3DDatabase::num_row($res);
+?>
+<div id=3D"list_cat_div" class=3D"content">
+<table class=3D"result">
+	<tR>
+		<th>
+			<?=3D$tab->get_header(0)?>
+		</th>
+		<th>
+			<?=3D$tab->get_header(1)?>
+		</th>
+		<th>
+			<?=3D$tab->get_header(2)?>
+		</th>
+		<th>
+			<?=3D$tab->get_header(3)?>
+		</th>
+	</tR>
+<?
+$dossier=3DDossier::id();
+for ($i=3D0;$i<$max;$i++):
+	$row=3DDatabase::fetch_array($res, $i);
+?>
+	<tr>
+		<td>
+		<?=3DHtmlInput::anchor(h($row['fd_label']), "javascript:void(0)", "onc=
lick=3D\"detail_category_show('detail_category_div','".$dossier."','".$ro=
w['fd_id']."')\"")?>
+		</td>
+		<td>
+			<?=3Dh($row['fd_class_base'])?>
+		</td>
+		<td>
+			<?
+			 $v=3D($row['fd_create_account']=3D=3D't')?"Automatique":"Manuel";
+			 echo $v;
+			?>
+		</td>
+		<td>
+			<?=3D$row['frd_text']?>
+		</td>
+	</tr>
+
+
+<?
+endfor;
+?>
+</table>
+<?
+echo HtmlInput::button("cat_fiche_def_add","Ajout d'une nouvelle cat=C3=A9=
gorie", "onclick=3D\"detail_category_show('detail_category_div','".$dossi=
er."','-1')\"");
+?>
+</div>
+<div id=3D"detail_category_div" style=3D"display:none"">
+
+</div>
\ No newline at end of file

Added: phpcompta/trunk/include/template/fiche_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/fiche_list.php	                     =
   (rev 0)
+++ phpcompta/trunk/include/template/fiche_list.php	2012-06-24 15:46:43 U=
TC (rev 4983)
@@ -0,0 +1,77 @@
+<?php
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+
+/**
+ * @file
+ * @brief Show a list of card
+ *
+ */
+?>
+<?=3D $bar?>
+<form method=3D"POST" class=3D"print" style=3D"display:inline" onsubmit=3D=
"return confirm('Vous confirmez ?')">
+	<table>
+		<tr>
+			<th>
+				Quick Code
+			</th>
+			<th>
+				Nom
+
+			</th>
+			<th>
+				Selection
+			</th>
+		</tr>
+		<? for ($i =3D 0; $i < $nb_line; $i++) :?>
+			<? $row =3D Database::fetch_array($res, $i);?>
+			<tr>
+				<td>
+					<?=3D HtmlInput::card_detail($row['qcode'], "", ' class=3D"line" ')=
?>
+
+				</td>
+				<td>
+					<?=3D h($row['name'])?>
+				</td>
+				<td>
+					<?
+					if ($write =3D=3D 1)
+					{
+						$ck =3D new ICheckBox('f_id[]', $row['f_id']);
+						echo $ck->input();
+					}
+					?>
+				</td>
+			</tr>
+		<? endfor;?>
+
+
+	</table>
+<?=3DHtmlInput::hidden('action',"1");?>
+<?=3DHtmlInput::submit('delete','Effacer la s=C3=A9lection ')?>
+<?=3DHtmlInput::submit('move','D=C3=A9placer la s=C3=A9lection  vers')?>
+<?
+$iselect=3Dnew ISelect('move_to');
+$iselect->value=3D$cn->make_array("select fd_id,fd_label from fiche_def =
order by 2");
+echo $iselect->input();
+?>
+</form>
+<?=3D $bar?>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 11:57:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SipCH-0001GZ-WF
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 11:57:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 17:48:37 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223319.1340553477.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4984 - phpcompta/trunk/html/js
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 15:57:57 -0000

Author: danydb
Date: 2012-06-24 17:48:36 +0200 (Sun, 24 Jun 2012)
New Revision: 4984

Modified:
   phpcompta/trunk/html/js/scripts.js
Log:
0000577: Remplacer FICHE par PRINTCARD
Cosmetic, get empty the hidden div before filling it with info. from ajax=
 script

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-24 15:46:43 UTC (rev 4983)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-24 15:48:36 UTC (rev 4984)
@@ -1609,6 +1609,7 @@
 {
 	$(p_div).show();
 	waiting_box();
+	$('detail_category_div').innerHTML=3D"";
 	var queryString=3D"gDossier=3D"+p_dossier+"&id=3D"+p_id+"&op=3Dfddetail=
";
 	var action =3D new Ajax.Request(
 				  "ajax_misc.php" ,



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 12:03:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SipHc-0003zG-Ak
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 12:03:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 17:54:06 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223362.1340553807.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4985 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 16:03:26 -0000

Author: danydb
Date: 2012-06-24 17:54:06 +0200 (Sun, 24 Jun 2012)
New Revision: 4985

Modified:
   phpcompta/trunk/include/ajax_fiche_def_detail.php
Log:
0000577: Remplacer FICHE par PRINTCARD
Security : check if user can modify category of card

Modified: phpcompta/trunk/include/ajax_fiche_def_detail.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_fiche_def_detail.php	2012-06-24 15:48:36=
 UTC (rev 4984)
+++ phpcompta/trunk/include/ajax_fiche_def_detail.php	2012-06-24 15:54:06=
 UTC (rev 4985)
@@ -28,6 +28,10 @@
  */
 require_once('class_fiche_def.php');
 require_once 'class_tool_uos.php';
+global $g_user;
+
+$g_user->can_request(FICCAT,0);
+
 $fd=3Dnew Fiche_Def($cn,$_GET['id']);
 if ( $_GET['id'] > 0 )
 {
@@ -38,6 +42,6 @@
 else
 {
 	$fd->input_new();
-=09
+
 }
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 12:38:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SippB-0002oy-DW
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 12:38:09 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 18:28:48 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223472.1340555888.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4986 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 16:38:08 -0000

Author: danydb
Date: 2012-06-24 18:28:47 +0200 (Sun, 24 Jun 2012)
New Revision: 4986

Modified:
   phpcompta/trunk/include/config_file.php
Log:
ajout explication sur locale

Modified: phpcompta/trunk/include/config_file.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/config_file.php	2012-06-24 15:54:06 UTC (rev =
4985)
+++ phpcompta/trunk/include/config_file.php	2012-06-24 16:28:47 UTC (rev =
4986)
@@ -43,7 +43,7 @@
=20
 /*!\brief
  *\param array with the index
- *  - ctmp temporary folder=20
+ *  - ctmp temporary folder
  *  - cpath path to postgresql
  *  - cuser postgresql user
  *  - cpasswd password of cuser
@@ -77,12 +77,12 @@
     $r.=3D'<A href=3D"#" title=3D"'.$text->title.'" onclick=3D"alert(\''=
.$text->title.'\')">(?)</a>';
     $r.=3D'<br>';
=20
-    $r.=3D'D&eacute;sactivation changement de langue: ';
+    $r.=3D'D&eacute;sactivation changement de langue: 1 activ=C3=A9, 0 d=
=C3=A9sactiv=C3=A9 ';
     $text->title=3D'D&eacute;sactiver le changement de langue (requis po=
ur MacOSX';
     $r.=3D$text->input('clocale',$clocale);
     $r.=3D'<A href=3D"#" title=3D"'.$text->title.'" onclick=3D"alert(\''=
.$text->title.'\')">(?)</a>';
     $r.=3D'<br>';
-   =20
+
     $r.=3D'Chemin complet vers les executable de Postgresql : ';
     $text->title=3D'Le chemin vers le repertoire contenant psql, pg_dump=
...';
     $r.=3D$text->input('cpath',$cpath);
@@ -149,7 +149,7 @@
=20
     fputs($hFile, 'define ("locale",'.$clocale.');');
     fputs($hFile,"\r\n");
-   =20
+
     fputs($hFile, 'define ("domaine","");');
     fputs($hFile,"\r\n");
     fputs($hFile,'?>');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 13:13:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiqNX-0005ry-EA
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 13:13:39 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 19:04:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223493.1340558019.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4987 - phpcompta/trunk/html/js
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 17:13:39 -0000

Author: danydb
Date: 2012-06-24 19:04:18 +0200 (Sun, 24 Jun 2012)
New Revision: 4987

Modified:
   phpcompta/trunk/html/js/card.js
Log:
Fix bug when create new card

Modified: phpcompta/trunk/html/js/card.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/card.js	2012-06-24 16:28:47 UTC (rev 4986)
+++ phpcompta/trunk/html/js/card.js	2012-06-24 17:04:18 UTC (rev 4987)
@@ -463,14 +463,15 @@
 function dis_blank_card(obj)
 {
     // first we have to take the form elt we need
-    if ( obj.fd_id =3D=3D undefined ) { var fd_id=3D$F('fd_id'); }
+    if ( obj.fd_id.value !=3D undefined )
+		{ var fd_id=3D$F('fd_id'); }
 	else {fd_id=3Dobj.fd_id;}
=20
     var ref=3D"";
     if ( obj.elements &&  obj.elements['ref'] )
     {
         ref=3D'&ref';
-    }=20
+    }
     var content=3D'div_new_card';
     var nTop=3DposY-40;
     var nLeft=3DposX-20;
@@ -480,7 +481,7 @@
     if ( $(content)) {removeDiv(content);}
     add_div(popup);
=20
-	if ( obj.gDossier =3D=3D undefined ) {
+	if ( obj.gDossier.value !=3D undefined ) {
     var dossier=3D$('gDossier').value;} else {
 	var dossier=3Dobj.gDossier;
 	}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 13:14:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiqOP-0005to-Js
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 13:14:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 19:05:12 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223496.1340558073.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4988 - phpcompta/trunk/html/js
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 17:14:32 -0000

Author: danydb
Date: 2012-06-24 19:05:12 +0200 (Sun, 24 Jun 2012)
New Revision: 4988

Modified:
   phpcompta/trunk/html/js/scripts.js
Log:
CFGPRO set the first screen to display

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-24 17:04:18 UTC (rev 4987)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-24 17:05:12 UTC (rev 4988)
@@ -1184,6 +1184,7 @@
 						  $('detail_profile').innerHTML=3Dreq.responseText;
 						  req.responseText.evalScripts();
 						  $('detail_profile').show();
+						  profile_show('profile_gen_div');
 					  }
 				  }
 				);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 13:21:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiqV5-0000sC-H3
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 13:21:27 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 19:12:04 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223503.1340558486.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4989 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 17:21:26 -0000

Author: danydb
Date: 2012-06-24 19:12:04 +0200 (Sun, 24 Jun 2012)
New Revision: 4989

Modified:
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/class_profile_menu.php
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/include/class_user.php
   phpcompta/trunk/include/profile.inc.php
   phpcompta/trunk/include/stock_inv_histo.inc.php
Log:
Change user_sec_repository by profile_sec_repository

Modified: phpcompta/trunk/include/class_html_input.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_html_input.php	2012-06-24 17:05:12 UTC =
(rev 4988)
+++ phpcompta/trunk/include/class_html_input.php	2012-06-24 17:12:04 UTC =
(rev 4989)
@@ -640,7 +640,7 @@
 			{
 			  $sel->value=3D$p_cn->make_array("
                 select r_id,r_name
-				  from stock_repository join user_sec_repository using (r_id)
+				  from stock_repository join profile_sec_repository using (r_id)
                 where
                  ur_right=3D'W' and  p_id=3D".sql_string($profile).
                 " order by 2" );
@@ -650,7 +650,7 @@
 			{
 			  $sel->value=3D$p_cn->make_array("
                 select r_id,r_name
-				  from stock_repository join user_sec_repository using (r_id)
+				  from stock_repository join profile_sec_repository using (r_id)
                 where
                   p_id=3D".sql_string($profile).
                 " order by 2" );

Modified: phpcompta/trunk/include/class_profile_menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_profile_menu.php	2012-06-24 17:05:12 UT=
C (rev 4988)
+++ phpcompta/trunk/include/class_profile_menu.php	2012-06-24 17:12:04 UT=
C (rev 4989)
@@ -241,20 +241,20 @@
 			$array=3D$this->cn->get_array("
 					select p.r_id,p.r_name,s.ur_id,s.ur_right
 						from stock_repository as p
-						join user_sec_repository as s on (s.r_id=3Dp.r_id)
+						join profile_sec_repository as s on (s.r_id=3Dp.r_id)
 						where s.p_id=3D$1
 					union
 						select p2.r_id, p2.r_name,null,'X'
 						from stock_repository as p2
 						where
-						p2.r_id not in (select r_id from user_sec_repository where p_id =3D=
 $1) order by r_name;
+						p2.r_id not in (select r_id from profile_sec_repository where p_id=
 =3D $1) order by r_name;
 				",array($p_id));
 			$aright_value=3Darray(
 								array('value'=3D>'R','label'=3D>_('Lecture')),
 								array('value'=3D>'W','label'=3D>_('Ecriture')),
 								array('value'=3D>'X','label'=3D>_('Aucun acc=C3=A8s'))
 					);
-			require_once 'template/user_sec_repository.php';
+			require_once 'template/profile_sec_repository.php';
 		}
 	}
 	//end class

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-24 17:05:12 UTC (rev =
4988)
+++ phpcompta/trunk/include/class_stock.php	2012-06-24 17:12:04 UTC (rev =
4989)
@@ -181,7 +181,7 @@
 			left join jrnx as jx on (sg.j_id=3Djx.j_id)
 			left join jrn as j on (j.jr_grpt_id=3Djx.j_grpt)
 			where
-			sg.r_id in (select r_id from user_sec_repository where p_id =3D $prof=
ile)";
+			sg.r_id in (select r_id from profile_sec_repository where p_id =3D $p=
rofile)";
 		$and =3D " and ";
 		$clause =3D "";
 		if (isset($p_array['wdate_start']) && $p_array['wdate_start'] !=3D '')
@@ -294,7 +294,7 @@
 					full join stock_out as so on (si.sg_code=3Dso.sg_code and sg.r_id=3D=
so.r_id)
 				where
 				(si.sg_code is not null or so.sg_code is not null)
-				 and sg.r_id  in (select r_id from user_sec_repository where p_id=3D=
$1)
+				 and sg.r_id  in (select r_id from profile_sec_repository where p_id=
=3D$1)
=20
 			";
 		$end_date =3D $cn->get_value("select to_char(max(p_end),'DD.MM.YYYY') =
from parm_periode");

Modified: phpcompta/trunk/include/class_user.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_user.php	2012-06-24 17:05:12 UTC (rev 4=
988)
+++ phpcompta/trunk/include/class_user.php	2012-06-24 17:12:04 UTC (rev 4=
989)
@@ -802,7 +802,7 @@
 		{
 			$r=3D$this->db->get_array("select u.r_id,r_name
                 from
-					user_sec_repository as u
+					profile_sec_repository as u
 					join stock_repository as s on(u.r_id=3Ds.r_id)
                 where
                 p_id =3D$1
@@ -814,7 +814,7 @@
 		{
 			 $r=3D$this->db->get_array("select u.r_id,r_name
                 from
-					user_sec_repository as u
+					profile_sec_repository as u
 					join stock_repository as s on(u.r_id=3Ds.r_id)
                 where
                 p_id =3D$1 order by 2
@@ -1105,7 +1105,7 @@
         {
             $profile=3D$this->get_profile();
             $r=3D$this->db->get_value("select count(*)
-                from user_sec_repository
+                from profile_sec_repository
                 where
                 r_id=3D$1
                 and p_id =3D$2
@@ -1123,7 +1123,7 @@
         {
             $profile=3D$this->get_profile();
             $r=3D$this->db->get_value("select count(*)
-                from user_sec_repository
+                from profile_sec_repository
                 where
                 r_id=3D$1
                 and p_id =3D$2

Modified: phpcompta/trunk/include/profile.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/profile.inc.php	2012-06-24 17:05:12 UTC (rev =
4988)
+++ phpcompta/trunk/include/profile.inc.php	2012-06-24 17:12:04 UTC (rev =
4989)
@@ -71,17 +71,17 @@
 				continue;
 			if ($right[$e] =3D=3D 'X' && $ur_id[$e]!=3D'')
 			{
-				$cn->exec_sql("delete from user_sec_repository where p_id=3D$1 and r=
_id=3D$2", array($p_id, $ar_id[$e]));
+				$cn->exec_sql("delete from profile_sec_repository where p_id=3D$1 an=
d r_id=3D$2", array($p_id, $ar_id[$e]));
 				continue;
 			}
 			if ($ur_id[$e] =3D=3D "")
 			{
-				$cn->exec_sql("insert into user_sec_repository (p_id,r_id,ur_right) =
values($1,$2,$3)", array($p_id, $ar_id[$e], $right[$e]));
+				$cn->exec_sql("insert into profile_sec_repository (p_id,r_id,ur_righ=
t) values($1,$2,$3)", array($p_id, $ar_id[$e], $right[$e]));
 				continue;
 			}
 			if ($ur_id[$e] !=3D '')
 			{
-				$cn->exec_sql("update user_sec_repository set ur_right=3D$3 where  p=
_id=3D$1 and r_id=3D$2 ", array($p_id, $ar_id[$e], $right[$e]));
+				$cn->exec_sql("update profile_sec_repository set ur_right=3D$3 where=
  p_id=3D$1 and r_id=3D$2 ", array($p_id, $ar_id[$e], $right[$e]));
 				continue;
 			}
 		}

Modified: phpcompta/trunk/include/stock_inv_histo.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/stock_inv_histo.inc.php	2012-06-24 17:05:12 U=
TC (rev 4988)
+++ phpcompta/trunk/include/stock_inv_histo.inc.php	2012-06-24 17:12:04 U=
TC (rev 4989)
@@ -46,7 +46,7 @@
 $profile=3D$g_user->get_profile();
 $a_change=3D$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_d=
ate from stock_change as sc
 			join stock_repository as sr on (sc.r_id=3Dsr.r_id)
-			where sc.r_id in (select r_id from user_sec_repository where p_id=3D$=
profile)
+			where sc.r_id in (select r_id from profile_sec_repository where p_id=3D=
$profile)
 		order by c_date");
 $gDossier=3Ddossier::id();
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 13:26:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiqZo-0001FL-C7
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 13:26:20 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 19:16:58 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223504.1340558779.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4990 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 17:26:19 -0000

Author: danydb
Date: 2012-06-24 19:16:58 +0200 (Sun, 24 Jun 2012)
New Revision: 4990

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
Change user_sec_repository by profile_sec_repository

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-24 17:12:04 UTC (rev 4989)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-24 17:16:58 UTC (rev 4990)
@@ -244,29 +244,29 @@
=20
 insert into stock_repository(r_name) values ('D=C3=A9p=C3=B4t par d=C3=A9=
faut');
=20
-CREATE TABLE user_sec_repository
+CREATE TABLE profile_sec_repository
 (
   ur_id bigserial NOT NULL, -- pk
   p_id bigint, -- fk to profile
   r_id bigint,
   ur_right character(1), -- Type of right : R for readonly W for write
-  CONSTRAINT user_sec_repository_pkey PRIMARY KEY (ur_id ),
-  CONSTRAINT user_sec_repository_p_id_fkey FOREIGN KEY (p_id)
+  CONSTRAINT profile_sec_repository_pkey PRIMARY KEY (ur_id ),
+  CONSTRAINT profile_sec_repository_p_id_fkey FOREIGN KEY (p_id)
       REFERENCES profile (p_id) MATCH SIMPLE
       ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT user_sec_repository_r_id_fkey FOREIGN KEY (r_id)
+  CONSTRAINT profile_sec_repository_r_id_fkey FOREIGN KEY (r_id)
       REFERENCES stock_repository (r_id) MATCH SIMPLE
       ON UPDATE CASCADE ON DELETE CASCADE,
   CONSTRAINT user_sec_profile_ur_right_check CHECK (ur_right =3D ANY (AR=
RAY['R'::bpchar, 'W'::bpchar]))
 );
-COMMENT ON TABLE user_sec_repository  IS 'Available profile for user';
-COMMENT ON COLUMN user_sec_repository.ur_id IS 'pk';
-COMMENT ON COLUMN user_sec_repository.p_id IS 'fk to profile';
-COMMENT ON COLUMN user_sec_repository.r_id IS 'fk to stock_repository';
-COMMENT ON COLUMN user_sec_repository.ur_right IS 'Type of right : R for=
 readonly W for write';
+COMMENT ON TABLE profile_sec_repository  IS 'Available profile for user'=
;
+COMMENT ON COLUMN profile_sec_repository.ur_id IS 'pk';
+COMMENT ON COLUMN profile_sec_repository.p_id IS 'fk to profile';
+COMMENT ON COLUMN profile_sec_repository.r_id IS 'fk to stock_repository=
';
+COMMENT ON COLUMN profile_sec_repository.ur_right IS 'Type of right : R =
for readonly W for write';
 alter table stock_goods add r_id bigint;
=20
-alter table user_sec_repository add constraint user_sec_repository_r_id_=
p_id_u unique (r_id,p_id);
+alter table profile_sec_repository add constraint profile_sec_repository=
_r_id_p_id_u unique (r_id,p_id);
 alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
 update stock_goods set r_id=3D1;
 CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
@@ -478,3 +478,5 @@
 update profile_menu set me_code=3D'CFGCARD' , me_code_dep=3D'PARAM' wher=
e me_code=3D'CARD' and me_code_dep=3D'PRINT';
 update menu_ref set me_menu=3D'Fiche',me_description=3D'Liste,Balance,Hi=
storique par fiche' where me_code=3D'CARD';
 update menu_ref set me_menu=3D'Fiche',me_description=3D'Configuration de=
 cat=C3=A9gorie de fiches' where me_code=3D'CFGCARD';
+
+drop table user_sec_extension;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 13:30:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiqdZ-0001ZI-Q1
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 13:30:13 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 19:20:11 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223507.1340559012.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4991 - phpcompta/trunk/sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 17:30:12 -0000

Author: danydb
Date: 2012-06-24 19:20:10 +0200 (Sun, 24 Jun 2012)
New Revision: 4991

Modified:
   phpcompta/trunk/sql/upgrade.sql
Log:
Lors de l'upgrade les profiles existants ont acc?\195?\168s au d?\195?\16=
9p?\195?\180t par d?\195?\169faut

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-24 17:16:58 UTC (rev 4990)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-24 17:20:10 UTC (rev 4991)
@@ -244,6 +244,7 @@
=20
 insert into stock_repository(r_name) values ('D=C3=A9p=C3=B4t par d=C3=A9=
faut');
=20
+
 CREATE TABLE profile_sec_repository
 (
   ur_id bigserial NOT NULL, -- pk
@@ -269,6 +270,9 @@
 alter table profile_sec_repository add constraint profile_sec_repository=
_r_id_p_id_u unique (r_id,p_id);
 alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
 update stock_goods set r_id=3D1;
+
+insert into profile_sec_repository (p_id,r_id,ur_right) select p_id,1,'W=
' from profile where p_id > 0;
+
 CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
 alter table action_gestion drop ag_cal;
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 13:35:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SiqiW-0001qz-Az
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 13:35:20 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 19:25:58 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223508.1340559319.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4992 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 17:35:19 -0000

Author: danydb
Date: 2012-06-24 19:25:57 +0200 (Sun, 24 Jun 2012)
New Revision: 4992

Added:
   phpcompta/trunk/include/template/profile_sec_repository.php
Removed:
   phpcompta/trunk/include/template/user_sec_repository.php
Log:
change name user_sec_repository.php by profile_sec_repository.php

Copied: phpcompta/trunk/include/template/profile_sec_repository.php (from=
 rev 4986, phpcompta/trunk/include/template/user_sec_repository.php)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/profile_sec_repository.php	         =
               (rev 0)
+++ phpcompta/trunk/include/template/profile_sec_repository.php	2012-06-2=
4 17:25:57 UTC (rev 4992)
@@ -0,0 +1,59 @@
+<?php
+
+/*
+ *   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 b=
y
+ *   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-130=
7  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+/**
+ * @file
+ * @brief show the available profiles for action-management
+ *
+ */
+?>
+<form method=3D"POST" class=3D"print">
+<?=3DHtmlInput::hidden('tab','profile_repo_div')?>
+
+	<?=3DHtmlInput::hidden("p_id", $p_id);?>
+	<table>
+		<tr>
+			<th><?=3D_("D=C3=A9pot")?></th>
+			<th><?=3D_("Acc=C3=A8s")?></th>
+		</tr>
+		<? for ($i=3D0;$i<count($array);$i++): ?>
+		<tr>
+			<td>
+				<?=3D$array[$i]['r_name']?>
+				<?=3DHtmlInput::hidden('ur_id[]',$array[$i]['ur_id'])?>
+				<?=3DHtmlInput::hidden('ar_id[]',$array[$i]['r_id'])?>
+			</td>
+                         <?
+                            $color=3D($array[$i]['ur_right']!=3D'X')?"bo=
rder:lightgreen 2px solid; ":"border:red 2px solid; ";
+                        ?>
+			<td style=3D"<?=3D$color?>">
+
+				<?
+				$isel=3Dnew ISelect("right[]");
+				$isel->value=3D$aright_value;
+				$isel->selected=3D$array[$i]['ur_right'];
+				echo $isel->input();?>
+			</td>
+		</tr>
+		<?endfor;?>
+	</table>
+<?=3DHtmlInput::submit("change_stock", "Sauver")?>

Deleted: phpcompta/trunk/include/template/user_sec_repository.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/user_sec_repository.php	2012-06-24 1=
7:20:10 UTC (rev 4991)
+++ phpcompta/trunk/include/template/user_sec_repository.php	2012-06-24 1=
7:25:57 UTC (rev 4992)
@@ -1,59 +0,0 @@
-<?php
-
-/*
- *   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 b=
y
- *   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-130=
7  USA
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/**
- * @file
- * @brief show the available profiles for action-management
- *
- */
-?>
-<form method=3D"POST" class=3D"print">
-<?=3DHtmlInput::hidden('tab','profile_repo_div')?>
-
-	<?=3DHtmlInput::hidden("p_id", $p_id);?>
-	<table>
-		<tr>
-			<th><?=3D_("D=C3=A9pot")?></th>
-			<th><?=3D_("Acc=C3=A8s")?></th>
-		</tr>
-		<? for ($i=3D0;$i<count($array);$i++): ?>
-		<tr>
-			<td>
-				<?=3D$array[$i]['r_name']?>
-				<?=3DHtmlInput::hidden('ur_id[]',$array[$i]['ur_id'])?>
-				<?=3DHtmlInput::hidden('ar_id[]',$array[$i]['r_id'])?>
-			</td>
-                         <?
-                            $color=3D($array[$i]['ur_right']!=3D'X')?"bo=
rder:lightgreen 2px solid; ":"border:red 2px solid; ";
-                        ?>
-			<td style=3D"<?=3D$color?>">
-
-				<?
-				$isel=3Dnew ISelect("right[]");
-				$isel->value=3D$aright_value;
-				$isel->selected=3D$array[$i]['ur_right'];
-				echo $isel->input();?>
-			</td>
-		</tr>
-		<?endfor;?>
-	</table>
-<?=3DHtmlInput::submit("change_stock", "Sauver")?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 13:41:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Siqoi-0003ph-Pa
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 13:41:44 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 19:32:23 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223513.1340559703.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4993 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 17:41:43 -0000

Author: danydb
Date: 2012-06-24 19:32:22 +0200 (Sun, 24 Jun 2012)
New Revision: 4993

Modified:
   phpcompta/trunk/include/profile.inc.php
Log:
when profile delete do not show the detail

Modified: phpcompta/trunk/include/profile.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/profile.inc.php	2012-06-24 17:25:57 UTC (rev =
4992)
+++ phpcompta/trunk/include/profile.inc.php	2012-06-24 17:32:22 UTC (rev =
4993)
@@ -167,16 +167,16 @@
 		$cn->start();
 		if ($p_id =3D=3D 1)
 		{
-			throw new Exception('On ne peut effacer le profil par d=C3=A9faut');
+			throw new Exception('On ne peut pas effacer le profil par d=C3=A9faut=
');
 		}
 		$new_id =3D $cn->get_value("delete from profile
 			where p_id=3D$1 ", array($p_id));
 		$cn->commit();
+
 	}
 	catch (Exception $exc)
 	{
 		echo alert($exc->getMessage());
-		;
 		$cn->rollback();
 	}
 }
@@ -346,4 +346,8 @@
 	require_once 'ajax_get_profile.php';
 }
 echo '</div>';
+if ( isset($_POST['delete_profil'] ))
+{
+	echo create_script(" $('detail_profile').hide()");
+}
 ?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 14:20:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SirQ4-0002dV-9C
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 14:20:20 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 20:10:58 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223532.1340562019.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4994 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 18:20:19 -0000

Author: danydb
Date: 2012-06-24 20:10:58 +0200 (Sun, 24 Jun 2012)
New Revision: 4994

Modified:
   phpcompta/trunk/include/export_fiche_balance_pdf.php
Log:
column internal number was wrapped

Modified: phpcompta/trunk/include/export_fiche_balance_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-24 17:32=
:22 UTC (rev 4993)
+++ phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-24 18:10=
:58 UTC (rev 4994)
@@ -153,7 +153,7 @@
 		{
 			continue;
 		}
-		$tab =3D array(12, 20, 10,78, 20, 20, 10, 20);
+		$tab =3D array(12, 20, 20,68, 20, 20, 10, 20);
 		$align =3D array('L', 'C', 'L', 'L', 'R','R', 'R', 'R');
=20
 		foreach ($array as $row_fiche)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 14:21:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SirQu-0002es-Ef
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 14:21:12 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 20:11:51 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223533.1340562072.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4995 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 18:21:11 -0000

Author: danydb
Date: 2012-06-24 20:11:51 +0200 (Sun, 24 Jun 2012)
New Revision: 4995

Modified:
   phpcompta/trunk/include/export_fiche_balance_pdf.php
Log:
change int to internal

Modified: phpcompta/trunk/include/export_fiche_balance_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-24 18:10=
:58 UTC (rev 4994)
+++ phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-24 18:11=
:51 UTC (rev 4995)
@@ -194,7 +194,7 @@
=20
 			$pdf->Cell($tab[0], 7, 'Date');
 			$pdf->Cell($tab[1], 7, 'ref');
-			$pdf->Cell($tab[2], 7, 'Int.');
+			$pdf->Cell($tab[2], 7, 'Internal');
 			$pdf->Cell($tab[3], 7, 'Comm');
 			$pdf->Cell($tab[4], 7, 'Montant', 0, 0, 'C');
 			$pdf->Cell($tab[5], 7, 'Prog.', 0, 0, 'R');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 14:46:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sirp2-00056f-GR
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 14:46:08 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 20:36:44 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223546.1340563567.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4996 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 18:46:07 -0000

Author: danydb
Date: 2012-06-24 20:36:44 +0200 (Sun, 24 Jun 2012)
New Revision: 4996

Modified:
   phpcompta/trunk/include/class_acc_ledger_purchase.php
   phpcompta/trunk/include/class_acc_ledger_sold.php
   phpcompta/trunk/include/class_stock_goods.php
Log:
Bug dans les stock : insert_stock

Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-24 18:1=
1:51 UTC (rev 4995)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php	2012-06-24 18:3=
6:44 UTC (rev 4996)
@@ -473,7 +473,7 @@
                 // always save quantity but in withStock we can find
                 // what card need a stock management
                 if ( $g_parameter->MY_STOCK=3D'Y'&& isset ($repo))
-                    Stock_Goods::insert_goods(array('db'=3D>$this->db,'j=
_id'=3D>$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i}=
,'dir'=3D>'d','repo'=3D>$repo)) ;
+                    Stock_Goods::insert_goods($this->db,array('j_id'=3D>=
$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i},'dir'=3D=
>'d','repo'=3D>$repo)) ;
=20
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )
                 {

Modified: phpcompta/trunk/include/class_acc_ledger_sold.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-24 18:11:51=
 UTC (rev 4995)
+++ phpcompta/trunk/include/class_acc_ledger_sold.php	2012-06-24 18:36:44=
 UTC (rev 4996)
@@ -39,6 +39,7 @@
 require_once('class_own.php');
 require_once('class_itva_popup.php');
 require_once('class_acc_ledger_fin.php');
+require_once 'class_stock_goods.php';
=20
 /*!\brief Handle the ledger of sold,
  *
@@ -354,7 +355,7 @@
                 // always save quantity but in withStock we can find
                 // what card need a stock management
                 if ( $g_parameter->MY_STOCK=3D'Y' && isset ($repo))
-                    Stock_Goods::insert_goods(array('db'=3D>$this->db,'j=
_id'=3D>$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i}=
,'dir'=3D>'c','repo'=3D>$repo)) ;
+                    Stock_Goods::insert_goods($this->db,array('j_id'=3D>=
$j_id,'goods'=3D>${'e_march'.$i},'quant'=3D>$nNeg*${'e_quant'.$i},'dir'=3D=
>'c','repo'=3D>$repo)) ;
=20
=20
                 if ( $g_parameter->MY_ANALYTIC !=3D "nu" )

Modified: phpcompta/trunk/include/class_stock_goods.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods.php	2012-06-24 18:11:51 UTC=
 (rev 4995)
+++ phpcompta/trunk/include/class_stock_goods.php	2012-06-24 18:36:44 UTC=
 (rev 4996)
@@ -75,7 +75,7 @@
 			$sg_code[$e]->setReadOnly($p_readonly);
 			$sg_quantity[$e]->setReadOnly($p_readonly);
 		}
-//		require_once 'template/stock_inv.php';
+		require_once 'template/stock_inv.php';
 	}
=20
 	function save($p_array)
@@ -123,19 +123,20 @@
 	}
         /**
          * Insert into stock_goods from ACH and VEN
-         * @param type $p_array KEY : db =3D> database conx, j_id =3D> j=
rnx.j_id,goods=3D> f_id of the goods=20
+         * @param type $p_array KEY : db =3D> database conx, j_id =3D> j=
rnx.j_id,goods=3D> f_id of the goods
          * 'quant' =3D> quantity ,'dir'=3D> d or c (c for sales OUT and =
d for purchase IN),'repo'=3D>r_id of the
          * repository (stock_repository.r_id
          */
         static function insert_goods(&$p_cn,$p_array)
         {
             global $g_user;
-            if ($g_user->can_write_repo($p_depot) =3D=3D false)
+			extract ($p_array);
+            if ($g_user->can_write_repo($repo) =3D=3D false)
                 return false;
=20
             // Retrieve the good account for stock
             $code =3D new Fiche($p_cn);
-            $code->get_by_qcode($p_good);
+            $code->get_by_qcode($goods);
             $code_marchandise =3D $code->strAttribut(ATTR_DEF_STOCK);
             if ($code_marchandise =3D=3D NOTFOUND || $code_marchandise=3D=
=3D'')
                 return false;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 14:54:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sirx7-0005rN-SA
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 14:54:29 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 20:45:07 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223548.1340564068.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4997 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 18:54:28 -0000

Author: danydb
Date: 2012-06-24 20:45:07 +0200 (Sun, 24 Jun 2012)
New Revision: 4997

Modified:
   phpcompta/trunk/include/category_card.inc.php
Log:
Fix tips in menu

Modified: phpcompta/trunk/include/category_card.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/category_card.inc.php	2012-06-24 18:36:44 UTC=
 (rev 4996)
+++ phpcompta/trunk/include/category_card.inc.php	2012-06-24 18:45:07 UTC=
 (rev 4997)
@@ -62,8 +62,8 @@
 echo '<div class=3D"content">';
 echo ShowItem(array(
                   array($root."&sc=3Ddc",_('Fiche'),_('D=C3=A9tail de la=
 fiche'),1),
-                  array($root.'&sc=3Dsv',_('Suivi'),_('Suivi Fournisseur=
, devis, bon de commande, courrier'),2),
-                  array($root.'&sc=3Dcn',_('Contact'),_('Liste de contac=
ts de ce fournisseur'),3),
+                  array($root.'&sc=3Dsv',_('Suivi'),_('Suivi Fournisseur=
, client, banque, devis, bon de commande, courrier'),2),
+                  array($root.'&sc=3Dcn',_('Contact'),_('Liste de contac=
ts'),3),
                   array($root.'&sc=3Dop',_('Op=C3=A9rations'),_('Toutes =
les op=C3=A9rations'),4),
                   array($root.'&sc=3Dbal',_('Balance'),_('Balance du fou=
rnisseur'),7),
                   array($root.'&sc=3Dlet',_('Lettrage'),_('Op=C3=A9ratio=
ns & Lettrages'),6)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 15:31:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SisWi-0002Kf-Ih
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 15:31:16 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 21:21:47 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223572.1340566275.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4998 - in phpcompta/trunk: html/admin/sql/patch
	include sql
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 19:31:14 -0000

Author: danydb
Date: 2012-06-24 21:21:47 +0200 (Sun, 24 Jun 2012)
New Revision: 4998

Added:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
Modified:
   phpcompta/trunk/include/constant.php
   phpcompta/trunk/sql/upgrade.sql
Log:
Upgrade is now a patch

Added: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	                 =
       (rev 0)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-24 19:21:=
47 UTC (rev 4998)
@@ -0,0 +1,493 @@
+begin;
+CREATE OR REPLACE FUNCTION comptaproc.check_balance(p_grpt integer)
+  RETURNS numeric AS
+$BODY$
+declare
+	amount_jrnx_debit numeric;
+	amount_jrnx_credit numeric;
+	amount_jrn numeric;
+begin
+	select coalesce(sum (j_montant),0) into amount_jrnx_credit
+	from jrnx
+		where
+	j_grpt=3Dp_grpt
+	and j_debit=3Dfalse;
+
+	select coalesce(sum (j_montant),0) into amount_jrnx_debit
+	from jrnx
+		where
+	j_grpt=3Dp_grpt
+	and j_debit=3Dtrue;
+
+	select coalesce(jr_montant,0) into amount_jrn
+	from jrn
+	where
+	jr_grpt_id=3Dp_grpt;
+
+	if ( amount_jrnx_debit !=3D amount_jrnx_credit )
+		then
+		return abs(amount_jrnx_debit-amount_jrnx_credit);
+		end if;
+	if ( amount_jrn !=3D amount_jrnx_credit)
+		then
+		return -1*abs(amount_jrn - amount_jrnx_credit);
+		end if;
+	return 0;
+end;
+$BODY$
+  LANGUAGE plpgsql;
+
+update op_predef set od_direct=3D't' where od_jrn_type=3D'ODS';
+
+
+
+INSERT INTO menu_ref(
+            me_code, me_menu, me_file, me_url, me_description, me_parame=
ter,
+            me_javascript, me_type)
+    VALUES ('BK', 'Banque', 'bank.inc.php', null, 'Information Banque', =
null,null,'ME');
+
+INSERT INTO profile_menu(
+             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
+    VALUES ('BK', 'GESTION', 1, 4, 'E', 0);
+INSERT INTO profile_menu(
+             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
+    VALUES ('BK', 'GESTION', 2, 4, 'E', 0);
+
+update menu_ref set me_description=3D'Grand livre analytique' where me_c=
ode=3D'ANCGL';
+
+alter table action_gestion add ag_remind_date date;
+
+drop table jrn_action;
+
+update action_gestion set ag_dest=3Dnull;
+ alter table action_gestion alter ag_dest type bigint using ag_dest::num=
eric;
+ alter table action_gestion alter ag_dest set default null;
+COMMENT ON COLUMN action_gestion.ag_dest IS ' is the profile which has t=
o take care of this action ';
+ALTER TABLE action_gestion
+  ADD CONSTRAINT profile_fkey FOREIGN KEY (ag_dest)
+      REFERENCES profile (p_id) MATCH SIMPLE
+      ON UPDATE SET NULL ON DELETE SET NULL;
+
+CREATE TABLE action_gestion_comment
+(
+  agc_id bigserial NOT NULL, -- PK
+  ag_id bigint, -- FK to action_gestion
+  agc_date timestamp with time zone,
+  agc_comment text, -- comment
+  tech_user text, -- user_login
+  CONSTRAINT action_gestion_comment_pkey PRIMARY KEY (agc_id ),
+  CONSTRAINT action_gestion_comment_ag_id_fkey FOREIGN KEY (ag_id)
+      REFERENCES action_gestion (ag_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE
+);
+ALTER TABLE action_gestion_comment ALTER COLUMN agc_date SET DEFAULT now=
();
+COMMENT ON COLUMN action_gestion_comment.agc_id IS 'PK';
+COMMENT ON COLUMN action_gestion_comment.ag_id IS 'FK to action_gestion'=
;
+COMMENT ON COLUMN action_gestion_comment.agc_comment IS 'comment';
+COMMENT ON COLUMN action_gestion_comment.tech_user IS 'user_login';
+
+
+insert into action_gestion_comment (ag_id,agc_date,agc_comment,tech_user=
) select ag_id,ag_timestamp,ag_comment,ag_owner from action_gestion;
+ALTER TABLE action_gestion drop COLUMN ag_comment;
+
+CREATE TABLE action_gestion_operation
+(
+  ago_id bigserial NOT NULL, -- pk
+  ag_id bigint, -- fk to action_gestion
+  jr_id bigint, -- fk to jrn
+  CONSTRAINT action_comment_operation_pkey PRIMARY KEY (ago_id ),
+  CONSTRAINT action_comment_operation_ag_id_fkey FOREIGN KEY (ag_id)
+      REFERENCES action_gestion (ag_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT action_comment_operation_jr_id_fkey FOREIGN KEY (jr_id)
+      REFERENCES jrn (jr_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE
+);
+COMMENT ON COLUMN action_gestion_operation.ago_id IS 'pk';
+COMMENT ON COLUMN action_gestion_operation.ag_id IS 'fk to action_gestio=
n';
+COMMENT ON COLUMN action_gestion_operation.jr_id IS 'fk to jrn';
+
+CREATE TABLE link_action_type
+(
+  l_id bigserial NOT NULL, -- PK
+  l_desc character varying,
+  CONSTRAINT link_action_type_pkey PRIMARY KEY (l_id )
+);
+
+
+CREATE TABLE action_gestion_related
+(
+  aga_id bigserial NOT NULL, -- pk
+  aga_least bigint NOT NULL, -- fk to action_gestion, smallest ag_id
+  aga_greatest bigint NOT NULL, -- fk to action_gestion greatest ag_id
+  aga_type bigint, -- Type de liens
+  CONSTRAINT action_gestion_related_pkey PRIMARY KEY (aga_id ),
+  CONSTRAINT action_gestion_related_aga_greatest_fkey FOREIGN KEY (aga_g=
reatest)
+      REFERENCES action_gestion (ag_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT action_gestion_related_aga_least_fkey FOREIGN KEY (aga_leas=
t)
+      REFERENCES action_gestion (ag_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT action_gestion_related_aga_type_fkey FOREIGN KEY (aga_type)
+      REFERENCES link_action_type (l_id) MATCH SIMPLE
+      ON UPDATE NO ACTION ON DELETE NO ACTION,
+  CONSTRAINT ux_aga_least_aga_greatest UNIQUE (aga_least , aga_greatest =
)
+);
+
+COMMENT ON COLUMN action_gestion_related.aga_id IS 'pk';
+COMMENT ON COLUMN action_gestion_related.aga_least IS 'fk to action_gest=
ion, smallest ag_id';
+COMMENT ON COLUMN action_gestion_related.aga_greatest IS 'fk to action_g=
estion greatest ag_id';
+COMMENT ON COLUMN action_gestion_related.aga_type IS 'Type de liens';
+
+CREATE INDEX link_action_type_fki
+  ON action_gestion_related
+  USING btree
+  (aga_type );
+
+-- Trigger: trg_action_gestion_related on action_gestion_related
+CREATE OR REPLACE FUNCTION comptaproc.action_gestion_related_ins_up()
+  RETURNS trigger AS
+$BODY$
+declare
+	nTmp bigint;
+begin
+
+if NEW.aga_least > NEW.aga_greatest then
+	nTmp :=3D NEW.aga_least;
+	NEW.aga_least :=3D NEW.aga_greatest;
+	NEW.aga_greatest :=3D nTmp;
+end if;
+
+if NEW.aga_least =3D NEW.aga_greatest then
+	return NULL;
+end if;
+
+return NEW;
+
+end;
+$BODY$
+  LANGUAGE plpgsql ;
+-- DROP TRIGGER trg_action_gestion_related ON action_gestion_related;
+
+CREATE TRIGGER trg_action_gestion_related
+  BEFORE INSERT OR UPDATE
+  ON action_gestion_related
+  FOR EACH ROW
+  EXECUTE PROCEDURE comptaproc.action_gestion_related_ins_up();
+
+
+insert into action_gestion_related(aga_least,aga_greatest) select ag_id,=
ag_ref_ag_id from action_gestion where ag_ref_ag_id<>0;
+
+update menu_ref set me_menu=3D'Action Gestion' where me_code=3D'FOLLOW';
+
+DROP FUNCTION comptaproc.action_get_tree(bigint);
+
+insert into menu_ref(me_code,me_menu,me_type) values ('CSV:ActionGestion=
','Export Action Gestion','PR');
+insert into profile_menu(me_code,p_id,p_type_display,pm_default) values =
('CSV:ActionGestion',1,'P',0);
+
+
+ALTER TABLE document_type ADD COLUMN dt_prefix text;
+COMMENT ON COLUMN document_type.dt_prefix IS 'Prefix for ag_ref';
+
+update document_type set dt_prefix=3D upper(substr(replace(dt_value,' ',=
''),0,7))||dt_id::text;
+
+CREATE TABLE user_sec_action_profile
+(
+  ua_id bigserial NOT NULL, -- pk
+  p_id bigint, -- fk to profile
+  p_granted bigint, -- fk to profile
+  ua_right character(1), -- Type of right : R for readonly W for write
+  CONSTRAINT user_sec_action_profile_pkey PRIMARY KEY (ua_id ),
+  CONSTRAINT user_sec_action_profile_p_id_fkey FOREIGN KEY (p_id)
+   REFERENCES profile (p_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT user_sec_action_profile_p_granted_fkey FOREIGN KEY (p_grant=
ed)
+      REFERENCES profile (p_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT user_sec_action_profile_ua_right_check CHECK (ua_right =3D =
ANY (ARRAY['R'::bpchar, 'W'::bpchar]))
+);
+COMMENT ON TABLE user_sec_action_profile  IS 'Available profile for user=
';
+COMMENT ON COLUMN user_sec_action_profile.ua_id IS 'pk';
+COMMENT ON COLUMN user_sec_action_profile.p_id IS 'fk to profile';
+COMMENT ON COLUMN user_sec_action_profile.ua_right IS 'Type of right : R=
 for readonly W for write';
+INSERT INTO profile (p_name, p_id, p_desc, with_calc, with_direct_form) =
VALUES ('Public', -1, 'faux groupe', NULL, NULL);
+insert into user_sec_action_profile(p_id,p_granted,ua_right) select 1,p_=
id,'W' from profile;
+insert into user_sec_action_profile(p_id,p_granted ,ua_right) select 2,p=
_id,'W' from profile;
+insert into parameter values('MY_STOCK','N');
+
+INSERT INTO menu_ref(me_code, me_menu, me_file, me_url, me_description, =
me_parameter,
+            me_javascript, me_type)
+    VALUES ('CFGSTOCK', 'Configuration des d=C3=A9p=C3=B4ts', 'stock_cfg=
.inc.php', null, 'Configuration d=C3=A9p=C3=B4ts', null,null,'ME');
+
+INSERT INTO profile_menu(me_code, me_code_dep, p_id, p_order, p_type_dis=
play, pm_default)
+    VALUES ('CFGSTOCK', 'PARAM', 1, 40, 'E', 0);
+update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
+update profile_menu set me_code_dep=3D'COMPTA',p_order=3D15 where me_cod=
e=3D'STOCK' and me_code_dep=3D'ADV';
+
+CREATE TABLE stock_repository
+(
+  r_id bigserial NOT NULL, -- pk
+  r_name text, -- name of the stock
+  r_adress text, -- adress of the stock
+  r_country text, -- country of the stock
+  r_city text, -- City of the stock
+  r_phone text, -- City of the stock
+  CONSTRAINT stock_repository_pkey PRIMARY KEY (r_id )
+);
+
+COMMENT ON TABLE stock_repository  IS 'stock repository';
+COMMENT ON COLUMN stock_repository.r_id IS 'pk';
+COMMENT ON COLUMN stock_repository.r_name IS 'name of the stock';
+COMMENT ON COLUMN stock_repository.r_adress IS 'adress of the stock';
+COMMENT ON COLUMN stock_repository.r_country IS 'country of the stock';
+COMMENT ON COLUMN stock_repository.r_city IS 'City of the stock';
+COMMENT ON COLUMN stock_repository.r_phone  IS 'Phone number';
+
+insert into stock_repository(r_name) values ('D=C3=A9p=C3=B4t par d=C3=A9=
faut');
+
+
+CREATE TABLE profile_sec_repository
+(
+  ur_id bigserial NOT NULL, -- pk
+  p_id bigint, -- fk to profile
+  r_id bigint,
+  ur_right character(1), -- Type of right : R for readonly W for write
+  CONSTRAINT profile_sec_repository_pkey PRIMARY KEY (ur_id ),
+  CONSTRAINT profile_sec_repository_p_id_fkey FOREIGN KEY (p_id)
+      REFERENCES profile (p_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT profile_sec_repository_r_id_fkey FOREIGN KEY (r_id)
+      REFERENCES stock_repository (r_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE,
+  CONSTRAINT user_sec_profile_ur_right_check CHECK (ur_right =3D ANY (AR=
RAY['R'::bpchar, 'W'::bpchar]))
+);
+COMMENT ON TABLE profile_sec_repository  IS 'Available profile for user'=
;
+COMMENT ON COLUMN profile_sec_repository.ur_id IS 'pk';
+COMMENT ON COLUMN profile_sec_repository.p_id IS 'fk to profile';
+COMMENT ON COLUMN profile_sec_repository.r_id IS 'fk to stock_repository=
';
+COMMENT ON COLUMN profile_sec_repository.ur_right IS 'Type of right : R =
for readonly W for write';
+alter table stock_goods add r_id bigint;
+
+alter table profile_sec_repository add constraint profile_sec_repository=
_r_id_p_id_u unique (r_id,p_id);
+alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
+update stock_goods set r_id=3D1;
+
+insert into profile_sec_repository (p_id,r_id,ur_right) select p_id,1,'W=
' from profile where p_id > 0;
+
+CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
+alter table action_gestion drop ag_cal;
+
+
+update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
+
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_HISTO','stock_histo.inc.php','Historique stock','Historique =
des mouvement de stock','ME');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_STATE','stock_state.inc.php','Etat des stock','Etat des stoc=
k','ME');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_INVHISTO','stock_inv_histo.inc.php','Histo. Changement','Lis=
te des changements manuels des stocks','ME');
+insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockHisto',=
'Export Historique mouvement stock','PR');
+insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockResmLis=
t','Export R=C3=A9sum=C3=A9 list stock','PR');
+
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',1,10,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',1,20,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',2,10,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',2,20,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INVHISTO','STOCK',1,30,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INVHISTO','STOCK',2,30,'E');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',1,'P');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',1,'P');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',2,'P');
+insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',2,'P');
+insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_INV','stock_inv.inc.php','Modification Stocks','Modification=
 des stocks (inventaire)','ME');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INV','STOCK',1,30,'E');
+insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INV','STOCK',2,30,'E');
+
+
+-- clean stock_goods
+delete from stock_goods where  sg_code is null or sg_code=3D'' or sg_cod=
e not in (select ad_value from fiche_detail as fd where ad_id=3D19 and ad=
_value is not null);
+
+CREATE INDEX fki_jrnx_j_grpt ON jrnx  (j_grpt );
+CREATE INDEX fki_jrn_jr_grpt_id ON jrn  (jr_grpt_id );
+
+--
+insert into fiche_def (fd_id,frd_id,fd_label) values (500000,15,'Stock')=
;
+insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,1,10);
+insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,9,20);
+insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,23,30);
+
+create or replace function migrate_stock() returns void
+as
+$body$
+declare
+	rt_row text;
+	n_fid bigint;
+begin
+	for rt_row in select distinct ad_value from fiche_Detail where ad_id=3D=
19 and ad_value is not null and ad_Value <> ''
+	loop
+		insert into fiche (fd_id) values(500000) returning f_id into n_fid;
+		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,1,rt_row)=
;
+		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,9,'Code s=
tock '||rt_row);
+		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,23,'STOCK=
'||n_fid::text);
+		update fiche_detail set ad_value=3D'STOCK'||n_fid::text where ad_id=3D=
19 and ad_value=3Drt_row;
+		update stock_goods set sg_code=3D'STOCK'||n_fid::text where sg_code=3D=
rt_row;
+	end loop;
+
+end;
+$body$ language plpgsql;
+
+select migrate_stock();
+
+select migrate_stock();
+
+drop function migrate_stock();
+
+update attr_def set ad_type=3D'card', ad_extra=3D'[sql] fd_id =3D 500000=
 ' where ad_id=3D19;
+
+create table tmp_stockgood (s_id bigserial primary key,s_date timestamp =
default now());
+create table tmp_stockgood_detail(d_id bigserial primary key,s_id bigint=
 references tmp_stockgood(s_id) on delete cascade,
+sg_code text,s_qin numeric(20,4),s_qout numeric(20,4),r_id bigint);
+
+
+
+CREATE OR REPLACE FUNCTION comptaproc.fiche_detail_qcode_upd()
+  RETURNS trigger AS
+$BODY$
+declare
+	i record;
+begin
+	if NEW.ad_id=3D23 and NEW.ad_value !=3D OLD.ad_value then
+		RAISE NOTICE 'new qcode [%] old qcode [%]',NEW.ad_value,OLD.ad_value;
+
+		for i in select ad_id from attr_def where ad_type =3D 'card' loop
+			update fiche_detail set ad_value=3DNEW.ad_value where ad_value=3DOLD.=
ad_value and ad_id=3Di.ad_id;
+			RAISE NOTICE 'change for ad_id [%] ',i.ad_id;
+			if i.ad_id=3D19 then
+				RAISE NOTICE 'Change in stock_goods OLD[%] by NEW[%]',OLD.ad_value,N=
EW.ad_value;
+				update stock_goods set sg_code=3DNEW.ad_value where sg_code=3DOLD.ad=
_value;
+			end if;
+
+		end loop;
+	end if;
+return NEW;
+end;
+$BODY$
+  LANGUAGE plpgsql VOLATILE;
+
+
+CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   =
FOR EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
+
+update menu_ref set me_description=3D'Gestion des attributs de fiches ' =
where me_code=3D'CFGATCARD';
+ALTER TABLE stock_goods ADD COLUMN c_id bigint;
+
+CREATE TABLE stock_change
+(
+   c_id bigserial NOT NULL,
+  c_comment text,
+  c_date date,
+  tech_user text,
+  r_id bigint,
+  tech_date time with time zone NOT NULL DEFAULT now(),
+  CONSTRAINT stock_change_pkey PRIMARY KEY (c_id ),
+  CONSTRAINT stock_change_r_id_fkey FOREIGN KEY (r_id)
+      REFERENCES stock_repository (r_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE
+);
+
+ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE;
+
+update action_gestion set ag_dest=3D-1 ;
+alter table action_gestion alter ag_dest set not null;
+alter table action_gestion alter ag_dest set default -1;
+
+update menu_ref set me_code=3D'CSV:reportinit'  where me_code=3D'CVS:rep=
ortinit';
+ update menu_ref set me_file=3D'export_histo_csv.php' where me_code=3D'C=
SV:histo';
+ update menu_ref set me_file=3D'export_ledger_csv.php' where me_code=3D'=
CSV:ledger';
+ update menu_ref set me_file=3D'export_ledger_pdf.php' where me_code=3D'=
PDF:ledger';
+ update menu_ref set me_file=3D'export_poste_detail_csv.php' where me_co=
de=3D'CSV:postedetail';
+ update menu_ref set me_file=3D'export_poste_detail_pdf.php' where me_co=
de=3D'PDF:postedetail';
+ update menu_ref set me_file=3D'export_fiche_detail_csv.php' where me_co=
de=3D'CSV:fichedetail';
+ update menu_ref set me_file=3D'export_fiche_detail_pdf.php' where me_co=
de=3D'PDF:fichedetail';
+ update menu_ref set me_file=3D'export_fiche_balance_csv.php' where me_c=
ode=3D'CSV:fiche_balance';
+ update menu_ref set me_file=3D'export_fiche_balance_pdf.php' where me_c=
ode=3D'PDF:fiche_balance';
+ update menu_ref set me_file=3D'export_form_csv.php' where me_code=3D'CS=
V:report';
+ update menu_ref set me_file=3D'export_form_pdf.php' where me_code=3D'PD=
F:report';
+ update menu_ref set me_file=3D'export_fiche_csv.php' where me_code=3D'C=
SV:fiche';
+ update menu_ref set me_file=3D'export_fiche_pdf.php' where me_code=3D'P=
DF:fiche';
+ update menu_ref set me_file=3D'export_gl_csv.php' where me_code=3D'CSV:=
glcompte';
+ update menu_ref set me_file=3D'export_gl_pdf.php' where me_code=3D'PDF:=
glcompte';
+ update menu_ref set me_file=3D'export_security_pdf.php' where me_code=3D=
'PDF:sec';
+ update menu_ref set me_file=3D'export_anc_list_csv.php' where me_code=3D=
'CSV:AncList';
+ update menu_ref set me_file=3D'export_anc_balance_simple_csv.php' where=
 me_code=3D'CSV:AncBalSimple';
+ update menu_ref set me_file=3D'export_anc_balance_simple_pdf.php' where=
 me_code=3D'PDF:AncBalSimple';
+ update menu_ref set me_file=3D'export_anc_balance_double_csv.php' where=
 me_code=3D'CSV:AncBalDouble';
+ update menu_ref set me_file=3D'export_anc_balance_double_pdf.php' where=
 me_code=3D'PDF:AncBalDouble';
+ update menu_ref set me_file=3D'export_balance_csv.php' where me_code=3D=
'CSV:balance';
+ update menu_ref set me_file=3D'export_balance_pdf.php' where me_code=3D=
'PDF:balance';
+ update menu_ref set me_file=3D'export_anc_table_csv.php' where me_code=3D=
'CSV:AncTable';
+ update menu_ref set me_file=3D'export_anc_acc_list_csv.php' where me_co=
de=3D'CSV:AncAccList';
+ update menu_ref set me_file=3D'export_anc_balance_group_csv.php' where =
me_code=3D'CSV:AncBalGroup';
+ update menu_ref set me_file=3D'export_bilan_oth.php' where me_code=3D'O=
TH:Bilan';
+ update menu_ref set me_file=3D'export_anc_grandlivre_csv.php' where me_=
code=3D'CSV:AncGrandLivre';
+ update menu_ref set me_file=3D'export_reportinit_csv.php' where me_code=
=3D'CSV:reportinit';
+ update menu_ref set me_file=3D'export_follow_up_csv.php' where me_code=3D=
'CSV:ActionGestion';
+ update menu_ref set me_file=3D'export_stock_histo_csv.php' where me_cod=
e=3D'CSV:StockHisto';
+ update menu_ref set me_file=3D'export_stock_resume_list.php' where me_c=
ode=3D'CSV:StockResmList';
+
+INSERT INTO menu_ref(
+            me_code, me_menu, me_file, me_url, me_description, me_parame=
ter,
+            me_javascript, me_type)
+    VALUES ('CFGDOCST', 'Etat des documents', 'doc_state.inc.php', null,=
 'Etat des documents', null,null,'ME');
+
+INSERT INTO profile_menu(
+             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
+    VALUES ('CFGDOCST', 'DIVPARM', 1, 9, 'E', 0);
+INSERT INTO profile_menu(
+             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
+    VALUES ('CFGDOCST', 'DIVPARM', 2,9, 'E', 0);
+
+alter sequence document_state_s_id_seq restart with 100;
+
+CREATE INDEX quant_purchase_jrn_fki
+  ON quant_purchase
+  USING btree
+  (qp_internal );
+
+
+
+ALTER TABLE quant_purchase DROP CONSTRAINT quant_purchase_qp_internal_fk=
ey;
+
+
+ALTER TABLE quant_purchase
+  ADD CONSTRAINT quant_purchase_qp_internal_fkey FOREIGN KEY (qp_interna=
l)
+      REFERENCES jrn (jr_internal) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+
+
+ALTER TABLE quant_sold DROP CONSTRAINT quant_sold_qs_internal_fkey;
+
+ALTER TABLE quant_sold
+  ADD CONSTRAINT quant_sold_qs_internal_fkey FOREIGN KEY (qs_internal)
+      REFERENCES jrn (jr_internal) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+CREATE INDEX quant_sold_jrn_fki
+  ON quant_sold
+  USING btree
+  (qs_internal );
+
+
+create sequence uos_pk_seq;
+create table tool_uos (  uos_value bigint default nextval ('uos_pk_seq')=
 primary key );
+
+update menu_ref set me_code=3D'CFGCARD',me_file=3D'cfgfiche.inc.php' whe=
re me_code=3D'CARD';
+update menu_ref set me_code=3D'CARD',me_file=3D'fiche.inc.php' where me_=
code=3D'PRINTCARD';
+update profile_menu set me_code=3D'CARD' where me_code=3D'CFGCARD';
+update profile_menu set me_code=3D'CFGCARD' , me_code_dep=3D'PARAM' wher=
e me_code=3D'CARD' and me_code_dep=3D'PRINT';
+update menu_ref set me_menu=3D'Fiche',me_description=3D'Liste,Balance,Hi=
storique par fiche' where me_code=3D'CARD';
+update menu_ref set me_menu=3D'Fiche',me_description=3D'Configuration de=
 cat=C3=A9gorie de fiches' where me_code=3D'CFGCARD';
+
+drop table user_sec_extension;
+
+
+
+update version set val=3D103;
+
+commit;
\ No newline at end of file

Modified: phpcompta/trunk/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/constant.php	2012-06-24 18:45:07 UTC (rev 499=
7)
+++ phpcompta/trunk/include/constant.php	2012-06-24 19:21:47 UTC (rev 499=
8)
@@ -35,18 +35,18 @@
 $g_succeed=3D"<span style=3D\"font-size:18px;color:green\">&#x2713;</spa=
n>";
 /*set to none for production */
 /* uncomment for production */
-//$version_phpcompta=3DSVNINFO;
-//define ("DEBUG",false);
+$version_phpcompta=3DSVNINFO;
+define ("DEBUG",true);
=20
 // If you don't want to be notified of the update
 // define ("SITE_UPDATE",'');
 define ("SITE_UPDATE",'http://www.phpcompta.eu/last_version.txt');
=20
=20
-$version_phpcompta=3D4800;
-define ("DEBUG",true);
+//$version_phpcompta=3D4985;
+//define ("DEBUG",true);
=20
-define ("DBVERSION",102);
+define ("DBVERSION",103);
=20
 define ("DBVERSIONREPO",14);
 define ('NOTFOUND','--not found--');

Modified: phpcompta/trunk/sql/upgrade.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/sql/upgrade.sql	2012-06-24 18:45:07 UTC (rev 4997)
+++ phpcompta/trunk/sql/upgrade.sql	2012-06-24 19:21:47 UTC (rev 4998)
@@ -1,486 +0,0 @@
-CREATE OR REPLACE FUNCTION comptaproc.check_balance(p_grpt integer)
-  RETURNS numeric AS
-$BODY$
-declare
-	amount_jrnx_debit numeric;
-	amount_jrnx_credit numeric;
-	amount_jrn numeric;
-begin
-	select coalesce(sum (j_montant),0) into amount_jrnx_credit
-	from jrnx
-		where
-	j_grpt=3Dp_grpt
-	and j_debit=3Dfalse;
-
-	select coalesce(sum (j_montant),0) into amount_jrnx_debit
-	from jrnx
-		where
-	j_grpt=3Dp_grpt
-	and j_debit=3Dtrue;
-
-	select coalesce(jr_montant,0) into amount_jrn
-	from jrn
-	where
-	jr_grpt_id=3Dp_grpt;
-
-	if ( amount_jrnx_debit !=3D amount_jrnx_credit )
-		then
-		return abs(amount_jrnx_debit-amount_jrnx_credit);
-		end if;
-	if ( amount_jrn !=3D amount_jrnx_credit)
-		then
-		return -1*abs(amount_jrn - amount_jrnx_credit);
-		end if;
-	return 0;
-end;
-$BODY$
-  LANGUAGE plpgsql;
-
-update op_predef set od_direct=3D't' where od_jrn_type=3D'ODS';
-
-
-
-INSERT INTO menu_ref(
-            me_code, me_menu, me_file, me_url, me_description, me_parame=
ter,
-            me_javascript, me_type)
-    VALUES ('BK', 'Banque', 'bank.inc.php', null, 'Information Banque', =
null,null,'ME');
-
-INSERT INTO profile_menu(
-             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
-    VALUES ('BK', 'GESTION', 1, 4, 'E', 0);
-INSERT INTO profile_menu(
-             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
-    VALUES ('BK', 'GESTION', 2, 4, 'E', 0);
-
-update menu_ref set me_description=3D'Grand livre analytique' where me_c=
ode=3D'ANCGL';
-
-alter table action_gestion add ag_remind_date date;
-
-drop table jrn_action;
-
-update action_gestion set ag_dest=3Dnull;
- alter table action_gestion alter ag_dest type bigint using ag_dest::num=
eric;
- alter table action_gestion alter ag_dest set default null;
-COMMENT ON COLUMN action_gestion.ag_dest IS ' is the profile which has t=
o take care of this action ';
-ALTER TABLE action_gestion
-  ADD CONSTRAINT profile_fkey FOREIGN KEY (ag_dest)
-      REFERENCES profile (p_id) MATCH SIMPLE
-      ON UPDATE SET NULL ON DELETE SET NULL;
-
-CREATE TABLE action_gestion_comment
-(
-  agc_id bigserial NOT NULL, -- PK
-  ag_id bigint, -- FK to action_gestion
-  agc_date timestamp with time zone,
-  agc_comment text, -- comment
-  tech_user text, -- user_login
-  CONSTRAINT action_gestion_comment_pkey PRIMARY KEY (agc_id ),
-  CONSTRAINT action_gestion_comment_ag_id_fkey FOREIGN KEY (ag_id)
-      REFERENCES action_gestion (ag_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE
-);
-ALTER TABLE action_gestion_comment ALTER COLUMN agc_date SET DEFAULT now=
();
-COMMENT ON COLUMN action_gestion_comment.agc_id IS 'PK';
-COMMENT ON COLUMN action_gestion_comment.ag_id IS 'FK to action_gestion'=
;
-COMMENT ON COLUMN action_gestion_comment.agc_comment IS 'comment';
-COMMENT ON COLUMN action_gestion_comment.tech_user IS 'user_login';
-
-
-insert into action_gestion_comment (ag_id,agc_date,agc_comment,tech_user=
) select ag_id,ag_timestamp,ag_comment,ag_owner from action_gestion;
-ALTER TABLE action_gestion drop COLUMN ag_comment;
-
-CREATE TABLE action_gestion_operation
-(
-  ago_id bigserial NOT NULL, -- pk
-  ag_id bigint, -- fk to action_gestion
-  jr_id bigint, -- fk to jrn
-  CONSTRAINT action_comment_operation_pkey PRIMARY KEY (ago_id ),
-  CONSTRAINT action_comment_operation_ag_id_fkey FOREIGN KEY (ag_id)
-      REFERENCES action_gestion (ag_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT action_comment_operation_jr_id_fkey FOREIGN KEY (jr_id)
-      REFERENCES jrn (jr_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE
-);
-COMMENT ON COLUMN action_gestion_operation.ago_id IS 'pk';
-COMMENT ON COLUMN action_gestion_operation.ag_id IS 'fk to action_gestio=
n';
-COMMENT ON COLUMN action_gestion_operation.jr_id IS 'fk to jrn';
-
-CREATE TABLE link_action_type
-(
-  l_id bigserial NOT NULL, -- PK
-  l_desc character varying,
-  CONSTRAINT link_action_type_pkey PRIMARY KEY (l_id )
-);
-
-
-CREATE TABLE action_gestion_related
-(
-  aga_id bigserial NOT NULL, -- pk
-  aga_least bigint NOT NULL, -- fk to action_gestion, smallest ag_id
-  aga_greatest bigint NOT NULL, -- fk to action_gestion greatest ag_id
-  aga_type bigint, -- Type de liens
-  CONSTRAINT action_gestion_related_pkey PRIMARY KEY (aga_id ),
-  CONSTRAINT action_gestion_related_aga_greatest_fkey FOREIGN KEY (aga_g=
reatest)
-      REFERENCES action_gestion (ag_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT action_gestion_related_aga_least_fkey FOREIGN KEY (aga_leas=
t)
-      REFERENCES action_gestion (ag_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT action_gestion_related_aga_type_fkey FOREIGN KEY (aga_type)
-      REFERENCES link_action_type (l_id) MATCH SIMPLE
-      ON UPDATE NO ACTION ON DELETE NO ACTION,
-  CONSTRAINT ux_aga_least_aga_greatest UNIQUE (aga_least , aga_greatest =
)
-);
-
-COMMENT ON COLUMN action_gestion_related.aga_id IS 'pk';
-COMMENT ON COLUMN action_gestion_related.aga_least IS 'fk to action_gest=
ion, smallest ag_id';
-COMMENT ON COLUMN action_gestion_related.aga_greatest IS 'fk to action_g=
estion greatest ag_id';
-COMMENT ON COLUMN action_gestion_related.aga_type IS 'Type de liens';
-
-CREATE INDEX link_action_type_fki
-  ON action_gestion_related
-  USING btree
-  (aga_type );
-
--- Trigger: trg_action_gestion_related on action_gestion_related
-CREATE OR REPLACE FUNCTION comptaproc.action_gestion_related_ins_up()
-  RETURNS trigger AS
-$BODY$
-declare
-	nTmp bigint;
-begin
-
-if NEW.aga_least > NEW.aga_greatest then
-	nTmp :=3D NEW.aga_least;
-	NEW.aga_least :=3D NEW.aga_greatest;
-	NEW.aga_greatest :=3D nTmp;
-end if;
-
-if NEW.aga_least =3D NEW.aga_greatest then
-	return NULL;
-end if;
-
-return NEW;
-
-end;
-$BODY$
-  LANGUAGE plpgsql ;
--- DROP TRIGGER trg_action_gestion_related ON action_gestion_related;
-
-CREATE TRIGGER trg_action_gestion_related
-  BEFORE INSERT OR UPDATE
-  ON action_gestion_related
-  FOR EACH ROW
-  EXECUTE PROCEDURE comptaproc.action_gestion_related_ins_up();
-
-
-insert into action_gestion_related(aga_least,aga_greatest) select ag_id,=
ag_ref_ag_id from action_gestion where ag_ref_ag_id<>0;
-
-update menu_ref set me_menu=3D'Action Gestion' where me_code=3D'FOLLOW';
-
-DROP FUNCTION comptaproc.action_get_tree(bigint);
-
-insert into menu_ref(me_code,me_menu,me_type) values ('CSV:ActionGestion=
','Export Action Gestion','PR');
-insert into profile_menu(me_code,p_id,p_type_display,pm_default) values =
('CSV:ActionGestion',1,'P',0);
-
-
-ALTER TABLE document_type ADD COLUMN dt_prefix text;
-COMMENT ON COLUMN document_type.dt_prefix IS 'Prefix for ag_ref';
-
-update document_type set dt_prefix=3D upper(substr(replace(dt_value,' ',=
''),0,7))||dt_id::text;
-
-CREATE TABLE user_sec_action_profile
-(
-  ua_id bigserial NOT NULL, -- pk
-  p_id bigint, -- fk to profile
-  p_granted bigint, -- fk to profile
-  ua_right character(1), -- Type of right : R for readonly W for write
-  CONSTRAINT user_sec_action_profile_pkey PRIMARY KEY (ua_id ),
-  CONSTRAINT user_sec_action_profile_p_id_fkey FOREIGN KEY (p_id)
-   REFERENCES profile (p_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT user_sec_action_profile_p_granted_fkey FOREIGN KEY (p_grant=
ed)
-      REFERENCES profile (p_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT user_sec_action_profile_ua_right_check CHECK (ua_right =3D =
ANY (ARRAY['R'::bpchar, 'W'::bpchar]))
-);
-COMMENT ON TABLE user_sec_action_profile  IS 'Available profile for user=
';
-COMMENT ON COLUMN user_sec_action_profile.ua_id IS 'pk';
-COMMENT ON COLUMN user_sec_action_profile.p_id IS 'fk to profile';
-COMMENT ON COLUMN user_sec_action_profile.ua_right IS 'Type of right : R=
 for readonly W for write';
-INSERT INTO profile (p_name, p_id, p_desc, with_calc, with_direct_form) =
VALUES ('Public', -1, 'faux groupe', NULL, NULL);
-insert into user_sec_action_profile(p_id,p_granted,ua_right) select 1,p_=
id,'W' from profile;
-insert into user_sec_action_profile(p_id,p_granted ,ua_right) select 2,p=
_id,'W' from profile;
-insert into parameter values('MY_STOCK','N');
-
-INSERT INTO menu_ref(me_code, me_menu, me_file, me_url, me_description, =
me_parameter,
-            me_javascript, me_type)
-    VALUES ('CFGSTOCK', 'Configuration des d=C3=A9p=C3=B4ts', 'stock_cfg=
.inc.php', null, 'Configuration d=C3=A9p=C3=B4ts', null,null,'ME');
-
-INSERT INTO profile_menu(me_code, me_code_dep, p_id, p_order, p_type_dis=
play, pm_default)
-    VALUES ('CFGSTOCK', 'PARAM', 1, 40, 'E', 0);
-update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
-update profile_menu set me_code_dep=3D'COMPTA',p_order=3D15 where me_cod=
e=3D'STOCK' and me_code_dep=3D'ADV';
-
-CREATE TABLE stock_repository
-(
-  r_id bigserial NOT NULL, -- pk
-  r_name text, -- name of the stock
-  r_adress text, -- adress of the stock
-  r_country text, -- country of the stock
-  r_city text, -- City of the stock
-  r_phone text, -- City of the stock
-  CONSTRAINT stock_repository_pkey PRIMARY KEY (r_id )
-);
-
-COMMENT ON TABLE stock_repository  IS 'stock repository';
-COMMENT ON COLUMN stock_repository.r_id IS 'pk';
-COMMENT ON COLUMN stock_repository.r_name IS 'name of the stock';
-COMMENT ON COLUMN stock_repository.r_adress IS 'adress of the stock';
-COMMENT ON COLUMN stock_repository.r_country IS 'country of the stock';
-COMMENT ON COLUMN stock_repository.r_city IS 'City of the stock';
-COMMENT ON COLUMN stock_repository.r_phone  IS 'Phone number';
-
-insert into stock_repository(r_name) values ('D=C3=A9p=C3=B4t par d=C3=A9=
faut');
-
-
-CREATE TABLE profile_sec_repository
-(
-  ur_id bigserial NOT NULL, -- pk
-  p_id bigint, -- fk to profile
-  r_id bigint,
-  ur_right character(1), -- Type of right : R for readonly W for write
-  CONSTRAINT profile_sec_repository_pkey PRIMARY KEY (ur_id ),
-  CONSTRAINT profile_sec_repository_p_id_fkey FOREIGN KEY (p_id)
-      REFERENCES profile (p_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT profile_sec_repository_r_id_fkey FOREIGN KEY (r_id)
-      REFERENCES stock_repository (r_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE,
-  CONSTRAINT user_sec_profile_ur_right_check CHECK (ur_right =3D ANY (AR=
RAY['R'::bpchar, 'W'::bpchar]))
-);
-COMMENT ON TABLE profile_sec_repository  IS 'Available profile for user'=
;
-COMMENT ON COLUMN profile_sec_repository.ur_id IS 'pk';
-COMMENT ON COLUMN profile_sec_repository.p_id IS 'fk to profile';
-COMMENT ON COLUMN profile_sec_repository.r_id IS 'fk to stock_repository=
';
-COMMENT ON COLUMN profile_sec_repository.ur_right IS 'Type of right : R =
for readonly W for write';
-alter table stock_goods add r_id bigint;
-
-alter table profile_sec_repository add constraint profile_sec_repository=
_r_id_p_id_u unique (r_id,p_id);
-alter table user_sec_action_profile add constraint user_sec_action_profi=
le_p_id_p_granted_u unique (p_id,p_granted);
-update stock_goods set r_id=3D1;
-
-insert into profile_sec_repository (p_id,r_id,ur_right) select p_id,1,'W=
' from profile where p_id > 0;
-
-CREATE INDEX fk_stock_good_repository_r_id  ON stock_goods  (r_id );
-alter table action_gestion drop ag_cal;
-
-
-update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
-
-insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_HISTO','stock_histo.inc.php','Historique stock','Historique =
des mouvement de stock','ME');
-insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_STATE','stock_state.inc.php','Etat des stock','Etat des stoc=
k','ME');
-insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_INVHISTO','stock_inv_histo.inc.php','Histo. Changement','Lis=
te des changements manuels des stocks','ME');
-insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockHisto',=
'Export Historique mouvement stock','PR');
-insert into menu_ref (me_code,me_menu,me_type) values ('CSV:StockResmLis=
t','Export R=C3=A9sum=C3=A9 list stock','PR');
-
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',1,10,'E');
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',1,20,'E');
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_HISTO','STOCK',2,10,'E');
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_STATE','STOCK',2,20,'E');
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INVHISTO','STOCK',1,30,'E');
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INVHISTO','STOCK',2,30,'E');
-insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',1,'P');
-insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',1,'P');
-insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
Histo',2,'P');
-insert into profile_menu(me_code,p_id,p_type_display) values ('CSV:Stock=
ResmList',2,'P');
-insert into menu_ref (me_code,me_file,me_menu,me_description,me_type) va=
lues ('STOCK_INV','stock_inv.inc.php','Modification Stocks','Modification=
 des stocks (inventaire)','ME');
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INV','STOCK',1,30,'E');
-insert into profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display=
) values ('STOCK_INV','STOCK',2,30,'E');
-
-
--- clean stock_goods
-delete from stock_goods where  sg_code is null or sg_code=3D'' or sg_cod=
e not in (select ad_value from fiche_detail as fd where ad_id=3D19 and ad=
_value is not null);
-
-CREATE INDEX fki_jrnx_j_grpt ON jrnx  (j_grpt );
-CREATE INDEX fki_jrn_jr_grpt_id ON jrn  (jr_grpt_id );
-
---
-insert into fiche_def (fd_id,frd_id,fd_label) values (500000,15,'Stock')=
;
-insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,1,10);
-insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,9,20);
-insert into jnt_fic_attr  (fd_id,ad_id,jnt_order) values (500000,23,30);
-
-create or replace function migrate_stock() returns void
-as
-$body$
-declare
-	rt_row text;
-	n_fid bigint;
-begin
-	for rt_row in select distinct ad_value from fiche_Detail where ad_id=3D=
19 and ad_value is not null and ad_Value <> ''
-	loop
-		insert into fiche (fd_id) values(500000) returning f_id into n_fid;
-		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,1,rt_row)=
;
-		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,9,'Code s=
tock '||rt_row);
-		insert into fiche_detail (f_id,ad_id,ad_value) values (n_fid,23,'STOCK=
'||n_fid::text);
-		update fiche_detail set ad_value=3D'STOCK'||n_fid::text where ad_id=3D=
19 and ad_value=3Drt_row;
-		update stock_goods set sg_code=3D'STOCK'||n_fid::text where sg_code=3D=
rt_row;
-	end loop;
-
-end;
-$body$ language plpgsql;
-
-select migrate_stock();
-
-select migrate_stock();
-
-drop function migrate_stock();
-
-update attr_def set ad_type=3D'card', ad_extra=3D'[sql] fd_id =3D 500000=
 ' where ad_id=3D19;
-
-create table tmp_stockgood (s_id bigserial primary key,s_date timestamp =
default now());
-create table tmp_stockgood_detail(d_id bigserial primary key,s_id bigint=
 references tmp_stockgood(s_id) on delete cascade,
-sg_code text,s_qin numeric(20,4),s_qout numeric(20,4),r_id bigint);
-
-
-
-CREATE OR REPLACE FUNCTION comptaproc.fiche_detail_qcode_upd()
-  RETURNS trigger AS
-$BODY$
-declare
-	i record;
-begin
-	if NEW.ad_id=3D23 and NEW.ad_value !=3D OLD.ad_value then
-		RAISE NOTICE 'new qcode [%] old qcode [%]',NEW.ad_value,OLD.ad_value;
-
-		for i in select ad_id from attr_def where ad_type =3D 'card' loop
-			update fiche_detail set ad_value=3DNEW.ad_value where ad_value=3DOLD.=
ad_value and ad_id=3Di.ad_id;
-			RAISE NOTICE 'change for ad_id [%] ',i.ad_id;
-			if i.ad_id=3D19 then
-				RAISE NOTICE 'Change in stock_goods OLD[%] by NEW[%]',OLD.ad_value,N=
EW.ad_value;
-				update stock_goods set sg_code=3DNEW.ad_value where sg_code=3DOLD.ad=
_value;
-			end if;
-
-		end loop;
-	end if;
-return NEW;
-end;
-$BODY$
-  LANGUAGE plpgsql VOLATILE;
-
-
-CREATE TRIGGER fiche_detail_upd_trg   BEFORE UPDATE   ON fiche_detail   =
FOR EACH ROW   EXECUTE PROCEDURE comptaproc.fiche_detail_qcode_upd();
-
-update menu_ref set me_description=3D'Gestion des attributs de fiches ' =
where me_code=3D'CFGATCARD';
-ALTER TABLE stock_goods ADD COLUMN c_id bigint;
-
-CREATE TABLE stock_change
-(
-   c_id bigserial NOT NULL,
-  c_comment text,
-  c_date date,
-  tech_user text,
-  r_id bigint,
-  tech_date time with time zone NOT NULL DEFAULT now(),
-  CONSTRAINT stock_change_pkey PRIMARY KEY (c_id ),
-  CONSTRAINT stock_change_r_id_fkey FOREIGN KEY (r_id)
-      REFERENCES stock_repository (r_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE
-);
-
-ALTER TABLE stock_goods ADD CONSTRAINT stock_goods_c_id_fkey FOREIGN KEY=
 (c_id) REFERENCES stock_change (c_id) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE;
-
-update action_gestion set ag_dest=3D-1 ;
-alter table action_gestion alter ag_dest set not null;
-alter table action_gestion alter ag_dest set default -1;
-
-update menu_ref set me_code=3D'CSV:reportinit'  where me_code=3D'CVS:rep=
ortinit';
- update menu_ref set me_file=3D'export_histo_csv.php' where me_code=3D'C=
SV:histo';
- update menu_ref set me_file=3D'export_ledger_csv.php' where me_code=3D'=
CSV:ledger';
- update menu_ref set me_file=3D'export_ledger_pdf.php' where me_code=3D'=
PDF:ledger';
- update menu_ref set me_file=3D'export_poste_detail_csv.php' where me_co=
de=3D'CSV:postedetail';
- update menu_ref set me_file=3D'export_poste_detail_pdf.php' where me_co=
de=3D'PDF:postedetail';
- update menu_ref set me_file=3D'export_fiche_detail_csv.php' where me_co=
de=3D'CSV:fichedetail';
- update menu_ref set me_file=3D'export_fiche_detail_pdf.php' where me_co=
de=3D'PDF:fichedetail';
- update menu_ref set me_file=3D'export_fiche_balance_csv.php' where me_c=
ode=3D'CSV:fiche_balance';
- update menu_ref set me_file=3D'export_fiche_balance_pdf.php' where me_c=
ode=3D'PDF:fiche_balance';
- update menu_ref set me_file=3D'export_form_csv.php' where me_code=3D'CS=
V:report';
- update menu_ref set me_file=3D'export_form_pdf.php' where me_code=3D'PD=
F:report';
- update menu_ref set me_file=3D'export_fiche_csv.php' where me_code=3D'C=
SV:fiche';
- update menu_ref set me_file=3D'export_fiche_pdf.php' where me_code=3D'P=
DF:fiche';
- update menu_ref set me_file=3D'export_gl_csv.php' where me_code=3D'CSV:=
glcompte';
- update menu_ref set me_file=3D'export_gl_pdf.php' where me_code=3D'PDF:=
glcompte';
- update menu_ref set me_file=3D'export_security_pdf.php' where me_code=3D=
'PDF:sec';
- update menu_ref set me_file=3D'export_anc_list_csv.php' where me_code=3D=
'CSV:AncList';
- update menu_ref set me_file=3D'export_anc_balance_simple_csv.php' where=
 me_code=3D'CSV:AncBalSimple';
- update menu_ref set me_file=3D'export_anc_balance_simple_pdf.php' where=
 me_code=3D'PDF:AncBalSimple';
- update menu_ref set me_file=3D'export_anc_balance_double_csv.php' where=
 me_code=3D'CSV:AncBalDouble';
- update menu_ref set me_file=3D'export_anc_balance_double_pdf.php' where=
 me_code=3D'PDF:AncBalDouble';
- update menu_ref set me_file=3D'export_balance_csv.php' where me_code=3D=
'CSV:balance';
- update menu_ref set me_file=3D'export_balance_pdf.php' where me_code=3D=
'PDF:balance';
- update menu_ref set me_file=3D'export_anc_table_csv.php' where me_code=3D=
'CSV:AncTable';
- update menu_ref set me_file=3D'export_anc_acc_list_csv.php' where me_co=
de=3D'CSV:AncAccList';
- update menu_ref set me_file=3D'export_anc_balance_group_csv.php' where =
me_code=3D'CSV:AncBalGroup';
- update menu_ref set me_file=3D'export_bilan_oth.php' where me_code=3D'O=
TH:Bilan';
- update menu_ref set me_file=3D'export_anc_grandlivre_csv.php' where me_=
code=3D'CSV:AncGrandLivre';
- update menu_ref set me_file=3D'export_reportinit_csv.php' where me_code=
=3D'CSV:reportinit';
- update menu_ref set me_file=3D'export_follow_up_csv.php' where me_code=3D=
'CSV:ActionGestion';
- update menu_ref set me_file=3D'export_stock_histo_csv.php' where me_cod=
e=3D'CSV:StockHisto';
- update menu_ref set me_file=3D'export_stock_resume_list.php' where me_c=
ode=3D'CSV:StockResmList';
-
-INSERT INTO menu_ref(
-            me_code, me_menu, me_file, me_url, me_description, me_parame=
ter,
-            me_javascript, me_type)
-    VALUES ('CFGDOCST', 'Etat des documents', 'doc_state.inc.php', null,=
 'Etat des documents', null,null,'ME');
-
-INSERT INTO profile_menu(
-             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
-    VALUES ('CFGDOCST', 'DIVPARM', 1, 9, 'E', 0);
-INSERT INTO profile_menu(
-             me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
-    VALUES ('CFGDOCST', 'DIVPARM', 2,9, 'E', 0);
-
-alter sequence document_state_s_id_seq restart with 100;
-
-CREATE INDEX quant_purchase_jrn_fki
-  ON quant_purchase
-  USING btree
-  (qp_internal );
-
-
-
-ALTER TABLE quant_purchase DROP CONSTRAINT quant_purchase_qp_internal_fk=
ey;
-
-
-ALTER TABLE quant_purchase
-  ADD CONSTRAINT quant_purchase_qp_internal_fkey FOREIGN KEY (qp_interna=
l)
-      REFERENCES jrn (jr_internal) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-
-
-ALTER TABLE quant_sold DROP CONSTRAINT quant_sold_qs_internal_fkey;
-
-ALTER TABLE quant_sold
-  ADD CONSTRAINT quant_sold_qs_internal_fkey FOREIGN KEY (qs_internal)
-      REFERENCES jrn (jr_internal) MATCH SIMPLE
-      ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
-CREATE INDEX quant_sold_jrn_fki
-  ON quant_sold
-  USING btree
-  (qs_internal );
-
-
-create sequence uos_pk_seq;
-create table tool_uos (  uos_value bigint default nextval ('uos_pk_seq')=
 primary key );
-
-update menu_ref set me_code=3D'CFGCARD',me_file=3D'cfgfiche.inc.php' whe=
re me_code=3D'CARD';
-update menu_ref set me_code=3D'CARD',me_file=3D'fiche.inc.php' where me_=
code=3D'PRINTCARD';
-update profile_menu set me_code=3D'CARD' where me_code=3D'CFGCARD';
-update profile_menu set me_code=3D'CFGCARD' , me_code_dep=3D'PARAM' wher=
e me_code=3D'CARD' and me_code_dep=3D'PRINT';
-update menu_ref set me_menu=3D'Fiche',me_description=3D'Liste,Balance,Hi=
storique par fiche' where me_code=3D'CARD';
-update menu_ref set me_menu=3D'Fiche',me_description=3D'Configuration de=
 cat=C3=A9gorie de fiches' where me_code=3D'CFGCARD';
-
-drop table user_sec_extension;
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 15:31:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SisWu-0002LS-Mc
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 15:31:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 21:22:06 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223575.1340566287.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4999 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 19:31:27 -0000

Author: danydb
Date: 2012-06-24 21:22:06 +0200 (Sun, 24 Jun 2012)
New Revision: 4999

Modified:
   phpcompta/trunk/include/class_print_ledger_fin.php
   phpcompta/trunk/include/export_ledger_pdf.php
Log:
Fix long line in PDF

Modified: phpcompta/trunk/include/class_print_ledger_fin.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_print_ledger_fin.php	2012-06-24 19:21:4=
7 UTC (rev 4998)
+++ phpcompta/trunk/include/class_print_ledger_fin.php	2012-06-24 19:22:0=
6 UTC (rev 4999)
@@ -85,7 +85,7 @@
             $this->Cell(20,5,$row['internal']);
=20
             $name=3D$this->ledger->get_tiers($this->jrn_type,$row['id'])=
;
-            $this->Cell(40,5,$name,0,0);
+            $this->LongLine(40,5,$name,0,'L');
=20
=20
             $this->LongLine(105,5,$row['comment'],0,'L');

Modified: phpcompta/trunk/include/export_ledger_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_ledger_pdf.php	2012-06-24 19:21:47 UTC=
 (rev 4998)
+++ phpcompta/trunk/include/export_ledger_pdf.php	2012-06-24 19:22:06 UTC=
 (rev 4999)
@@ -56,7 +56,7 @@
 $g_user->check_dossier($gDossier);
=20
 // Security
-if ( $_GET['jrn_id']!=3D0 &&  $User->check_jrn($_GET['jrn_id']) =3D=3D '=
X' )
+if ( $_GET['jrn_id']!=3D0 &&  $g_user->check_jrn($_GET['jrn_id']) =3D=3D=
 'X' )
 {
     /* Cannot Access */
     NoAccess();



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sun Jun 24 15:52:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sisrd-0004ob-RN
	for mharc-phpcompta-dev@gnu.org; Sun, 24 Jun 2012 15:52:53 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sun, 24 Jun 2012 21:43:30 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.223609.1340567572.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r381 - trunk/tva
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Jun 2012 19:52:52 -0000

Author: danydb
Date: 2012-06-24 21:43:30 +0200 (Sun, 24 Jun 2012)
New Revision: 381

Modified:
   trunk/tva/index.php
Log:
Warning because plugin has been updated, ask to check parameters

Modified: trunk/tva/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tva/index.php	2012-06-21 17:47:14 UTC (rev 380)
+++ trunk/tva/index.php	2012-06-24 19:43:30 UTC (rev 381)
@@ -23,7 +23,7 @@
 /*!\file
  * \brief main file for tva
  */
-Extension::check_version(4400);
+Extension::check_version(4900);
=20
 $url=3D'?'.dossier::get().'&plugin_code=3D'.$_REQUEST['plugin_code']."&a=
c=3D".$_REQUEST['ac'];
 $array=3Darray (
@@ -57,11 +57,11 @@
   break;
=20
 }
-
+$install=3D0;
 $cn=3Dnew Database(dossier::id());
 if ( $cn->exist_schema('tva_belge') =3D=3D false) {
   require_once('class_install_plugin.php');
-
+  $install=3D1;
   $iplugn=3Dnew Install_Plugin($cn);
   $iplugn->install();
   echo_warning(_("L'extension est install=C3=A9e, pourriez-vous en v=C3=A9=
rifier le param=C3=A8trage ?"));
@@ -92,6 +92,8 @@
 {
 		$file=3D__DIR__."/sql/patch2.sql";
 		$cn->execute_script($file);
+		if ( $install =3D=3D 0 ) echo_warning(_("Mise =C3=A0 jour du plugin, p=
ourriez-vous en v=C3=A9rifier le param=C3=A8trage ?"));
+		$def=3D5;
 }
 echo '<div style=3D"float:right"><a class=3D"mtitle" style=3D"font-size:=
140%" href=3D"http://wiki.phpcompta.eu/doku.php?id=3Dtva" target=3D"_blan=
k">Aide</a>'.
 '<span style=3D"font-size:0.8em;color:red;display:inline">vers:SVNINFO</=
span>'.



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 05:23:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sj5W0-0006kx-3V
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 05:23:24 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 11:13:47 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.224420.1340616202.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5000 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 09:23:22 -0000

Author: danydb
Date: 2012-06-25 11:13:47 +0200 (Mon, 25 Jun 2012)
New Revision: 5000

Modified:
   phpcompta/trunk/include/bank.inc.php
Log:
Bug 0000656: Fournisseur : impossible d'ajouter une cat?\195?\169gorie

Modified: phpcompta/trunk/include/bank.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/bank.inc.php	2012-06-24 19:22:06 UTC (rev 499=
9)
+++ phpcompta/trunk/include/bank.inc.php	2012-06-25 09:13:47 UTC (rev 500=
0)
@@ -119,6 +119,7 @@
=20
 		$f_cat_button=3Dnew IButton('add_cat');
 		$f_cat_button->set_attribute('type_cat',FICHE_TYPE_FIN);
+                $f_cat_button->set_attribute('ipopup','ipop_cat');
 		$f_cat_button->label=3D_('Ajout d\'une cat=C3=A9gorie');
 		$f_cat_button->javascript=3D'add_category(this)';
 		echo $f_cat_button->input();



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 05:27:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sj5Zb-00086A-OB
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 05:27:07 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 11:17:36 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.224429.1340616427.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5001 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 09:27:06 -0000

Author: danydb
Date: 2012-06-25 11:17:36 +0200 (Mon, 25 Jun 2012)
New Revision: 5001

Modified:
   phpcompta/trunk/include/supplier.inc.php
Log:
Bug 0000656: Fournisseur : impossible d'ajouter une cat?\195?\169gorie

Modified: phpcompta/trunk/include/supplier.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/supplier.inc.php	2012-06-25 09:13:47 UTC (rev=
 5000)
+++ phpcompta/trunk/include/supplier.inc.php	2012-06-25 09:17:36 UTC (rev=
 5001)
@@ -123,6 +123,7 @@
=20
 		$f_cat_button=3Dnew IButton('add_cat');
 		$f_cat_button->set_attribute('type_cat',FICHE_TYPE_FOURNISSEUR);
+                $f_cat_button->set_attribute('ipopup','ipop_cat');
 		$f_cat_button->label=3D_('Ajout d\'une cat=C3=A9gorie');
 		$f_cat_button->javascript=3D'add_category(this)';
 		echo $f_cat_button->input();



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 05:31:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sj5eI-0000Qf-Vo
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 05:31:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 11:22:25 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.224448.1340616718.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5002 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 09:31:58 -0000

Author: danydb
Date: 2012-06-25 11:22:25 +0200 (Mon, 25 Jun 2012)
New Revision: 5002

Modified:
   phpcompta/trunk/include/fiche.inc.php
Log:
0000655: CARD : enlever d?\195?\169placer
Si toutes les fiches demand?\195?\169es alors on ne propose pas l'ajout

Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-25 09:17:36 UTC (rev 50=
01)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-25 09:22:25 UTC (rev 50=
02)
@@ -191,7 +191,7 @@
 	");
 	$nb_line =3D Database::num_row($res);
 	require_once 'template/fiche_list.php';
-	if ($write =3D=3D 1 ) echo $str_add_card;
+	if ($write =3D=3D 1 && $allcard =3D=3D 0 ) echo $str_add_card;
 	exit();
 }
 /* * *******************************************************************=
**************************************************************
@@ -203,7 +203,7 @@
 	$cat_card =3D new Fiche_Def($cn);
 	$cat_card->id =3D $_GET['cat'];
 	$aHeading =3D $cat_card->getAttribut();
-	echo $str_add_card;
+	if ( $allcard =3D=3D 0) echo $str_add_card;
 	require_once('template/result_cat_card_summary.php');
=20
 	$hid =3D new IHidden();
@@ -253,7 +253,7 @@
 		alert('Date invalide !');
 		exit;
 	}
-	echo $str_add_card;
+	if ( $allcard =3D=3D 0 ) echo $str_add_card;
 	echo $export_pdf;
 	echo $export_csv;
 	echo $export_print;
@@ -324,7 +324,7 @@
 		}
 		echo '</table>';
 	}
-	echo $str_add_card;
+	if ( $allcard =3D=3D 0 ) echo $str_add_card;
 	echo $export_pdf;
 	echo $export_csv;
 	echo $export_print;
@@ -350,7 +350,7 @@
 {
 	$afiche[0] =3D array('fd_id' =3D> $_REQUEST['cat']);
 }
-echo $str_add_card;
+if ( $allcard =3D=3D 0) echo $str_add_card;
 echo $export_csv;
 echo $export_pdf;
 echo $export_print;
@@ -466,7 +466,7 @@
 		echo '</table>';
 	}
 }
-echo $str_add_card;
+if ( $allcard =3D=3D 0) echo $str_add_card;
 echo $export_csv;
 echo $export_pdf;
 echo $export_print;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 05:33:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sj5gE-0000Wb-8a
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 05:33:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 11:24:25 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.224452.1340616837.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5003 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 09:33:57 -0000

Author: danydb
Date: 2012-06-25 11:24:25 +0200 (Mon, 25 Jun 2012)
New Revision: 5003

Modified:
   phpcompta/trunk/include/template/fiche_list.php
Log:
0000655: CARD : enlever d?\195?\169placer si toutes les fiches sont deman=
d?\195?\169es


Modified: phpcompta/trunk/include/template/fiche_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/fiche_list.php	2012-06-25 09:22:25 U=
TC (rev 5002)
+++ phpcompta/trunk/include/template/fiche_list.php	2012-06-25 09:24:25 U=
TC (rev 5003)
@@ -67,11 +67,14 @@
 	</table>
 <?=3DHtmlInput::hidden('action',"1");?>
 <?=3DHtmlInput::submit('delete','Effacer la s=C3=A9lection ')?>
+<? if ( $allcard =3D=3D  0  ): ?>
 <?=3DHtmlInput::submit('move','D=C3=A9placer la s=C3=A9lection  vers')?>
 <?
 $iselect=3Dnew ISelect('move_to');
 $iselect->value=3D$cn->make_array("select fd_id,fd_label from fiche_def =
order by 2");
 echo $iselect->input();
 ?>
+   =20
+<? endif ; ?>
 </form>
 <?=3D $bar?>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 05:41:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sj5nZ-0002ay-Dd
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 05:41:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 11:31:57 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.224461.1340617291.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5004 - phpcompta/trunk/html/admin/sql/patch
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 09:41:31 -0000

Author: danydb
Date: 2012-06-25 11:31:57 +0200 (Mon, 25 Jun 2012)
New Revision: 5004

Modified:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
Log:
0000657: GESTION/BK doit ?\195?\170tre avant GESTION/PRINT

Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 09:24:=
25 UTC (rev 5003)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 09:31:=
57 UTC (rev 5004)
@@ -40,6 +40,7 @@
 update op_predef set od_direct=3D't' where od_jrn_type=3D'ODS';
=20
=20
+update profile_menu set p_order=3Dp_order*10;
=20
 INSERT INTO menu_ref(
             me_code, me_menu, me_file, me_url, me_description, me_parame=
ter,
@@ -48,11 +49,13 @@
=20
 INSERT INTO profile_menu(
              me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
-    VALUES ('BK', 'GESTION', 1, 4, 'E', 0);
+    VALUES ('BK', 'GESTION', 1, 35, 'E', 0);
 INSERT INTO profile_menu(
              me_code, me_code_dep, p_id, p_order, p_type_display, pm_def=
ault)
-    VALUES ('BK', 'GESTION', 2, 4, 'E', 0);
+    VALUES ('BK', 'GESTION', 2, 35, 'E', 0);
=20
+
+=20
 update menu_ref set me_description=3D'Grand livre analytique' where me_c=
ode=3D'ANCGL';
=20
 alter table action_gestion add ag_remind_date date;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 08:24:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sj8Li-0005ba-E0
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 08:24:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 14:15:19 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.224781.1340627097.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5005 - in phpcompta/trunk: html/admin/sql/patch
	include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 12:24:56 -0000

Author: danydb
Date: 2012-06-25 14:15:18 +0200 (Mon, 25 Jun 2012)
New Revision: 5005

Modified:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
   phpcompta/trunk/include/class_fiche.php
Log:
Replace ATTR_DEF_COMPANY by a type card with  ad_extra=3D'[sql] frd_id in=
 (4,8,9,14)'=20

Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 09:31:=
57 UTC (rev 5004)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 12:15:=
18 UTC (rev 5005)
@@ -359,7 +359,7 @@
 	if NEW.ad_id=3D23 and NEW.ad_value !=3D OLD.ad_value then
 		RAISE NOTICE 'new qcode [%] old qcode [%]',NEW.ad_value,OLD.ad_value;
=20
-		for i in select ad_id from attr_def where ad_type =3D 'card' loop
+		for i in select ad_id from attr_def where ad_type =3D 'card' or ad_id=3D=
25 loop
 			update fiche_detail set ad_value=3DNEW.ad_value where ad_value=3DOLD.=
ad_value and ad_id=3Di.ad_id;
 			RAISE NOTICE 'change for ad_id [%] ',i.ad_id;
 			if i.ad_id=3D19 then
@@ -489,6 +489,7 @@
=20
 drop table user_sec_extension;
=20
+update attr_def set ad_type=3D'card', ad_extra=3D'[sql] frd_id in (4,8,9=
,14)' where ad_id=3D25;
=20
=20
 update version set val=3D103;

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-25 09:31:57 UTC (rev =
5004)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-25 12:15:18 UTC (rev =
5005)
@@ -467,25 +467,7 @@
                 $w=3Dnew ITva_Popup('popup_tva');
                 $w->table=3D1;
             }
-            elseif ( $attr->ad_id =3D=3D ATTR_DEF_COMPANY )
-            {
-                $w=3Dnew ICard("av_text".$attr->ad_id);
-                // filter on frd_id
-                $sql=3D' select fd_id from fiche_def where frd_id in ('.=
FICHE_TYPE_CLIENT.','.FICHE_TYPE_FOURNISSEUR.','.FICHE_TYPE_ADM_TAX.','.F=
ICHE_TYPE_FIN.')';
-                $filter=3D$this->cn->make_list($sql);
-                $w->set_attribute('ipopup','ipopcard');
-                $w->set_attribute('typecard',$filter);
-                $w->set_attribute('inp',"av_text".$attr->ad_id);
-                $w->set_attribute('label',"av_text".$attr->ad_id."_label=
");
-
-                $w->extra=3D$filter;
-                $w->extra2=3D0;
-                $label=3Dnew ISpan();
-                $label->name=3D"av_text".$attr->ad_id."_label";
-                $msg.=3Dtd($w->search().$label->input());
-
-
-            }
+       =20
             else
             {
 	      switch ($attr->ad_type)
@@ -609,25 +591,6 @@
 					$w->table =3D 1;
                                         $w->value =3D $r->av_text;
 				}
-				elseif ($r->ad_id =3D=3D ATTR_DEF_COMPANY)
-				{
-					$w =3D new ICard("av_text" . $r->ad_id);
-					// filter on frd_id
-					$sql =3D ' select fd_id from fiche_def where frd_id in (' . FICHE_T=
YPE_CLIENT . ',' . FICHE_TYPE_FOURNISSEUR . ',' . FICHE_TYPE_ADM_TAX . '
-						,'.FICHE_TYPE_FIN.')';
-					$filter =3D $this->cn->make_list($sql);
-					$w->extra =3D $filter;
-					$w->extra2 =3D 0;
-					$label =3D new ISpan();
-					$label->name =3D "av_text" . $r->ad_id . "_label";
-					$w->set_attribute('ipopup', 'ipopcard');
-					$w->set_attribute('typecard', $filter);
-					$w->set_attribute('inp', "av_text" . $r->ad_id);
-					$w->set_attribute('label', "av_text" . $r->ad_id . "_label");
-                                        $w->value =3D $r->av_text;
-					$msg =3D $w->search();
-					$msg.=3D$label->input();
-				}
 				else
 				{
 					switch ($r->ad_type)
@@ -840,18 +803,6 @@
                         }
                     }
                 }
-                // The contact has a company attribut
-                if ( $id =3D=3D ATTR_DEF_COMPANY )
-                {
-                    $exist=3D$this->cn->count_sql("select f_id from fich=
e join fiche_def using (fd_id) ".
-                                                " join fiche_detail usin=
g(f_id) ".
-                                                " where frd_id in (4,8,9=
,14) and ad_id=3D".ATTR_DEF_QUICKCODE.
-                                                " and ad_value=3D'".sql_=
string($value)."'");
-                    if ( $exist =3D=3D 0 && sql_string($value) !=3D null=
 )
-                    {
-                        $value=3D"";
-                    }
-                }
                 // Normal traitement
                 $value2=3Dsql_string($value);
=20
@@ -985,21 +936,6 @@
                         }
                     }
                 }
-                if ( $id =3D=3D ATTR_DEF_COMPANY )
-                {
-                    $exist=3D$this->cn->exec_sql("select f_id from fiche=
 join fiche_def using (fd_id) ".
-                                                " join fiche_detail usin=
g (f_id)  ".
-                                                " where frd_id in (4,8,9=
,14) and ad_id=3D$1 ".
-                                                " and ad_value=3Dupper($=
2)",
-					       array(ATTR_DEF_QUICKCODE,$value));
-
-
-                    if ( Database::num_row($exist) =3D=3D 0  && sql_stri=
ng($value) !=3D null )
-                    {
-                        $value=3D"Attention : pas de soci=C3=A9t=C3=A9 "=
;
-                    }
-                }
-
                 // Normal traitement
                 $sql=3D"update fiche_detail set ad_value=3D$1 where jft_=
id=3D$2";
 				$this->cn->exec_sql($sql,array(strip_tags($value),$jft_id));



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 08:30:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sj8RA-0006Ev-0n
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 08:30:36 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 14:20:55 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.224795.1340627435.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5006 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 12:30:35 -0000

Author: danydb
Date: 2012-06-25 14:20:55 +0200 (Mon, 25 Jun 2012)
New Revision: 5006

Modified:
   phpcompta/trunk/html/do.php
Log:
Remove space in ac

Modified: phpcompta/trunk/html/do.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/do.php	2012-06-25 12:15:18 UTC (rev 5005)
+++ phpcompta/trunk/html/do.php	2012-06-25 12:20:55 UTC (rev 5006)
@@ -129,7 +129,7 @@
=20
 if (isset($_REQUEST['ac']))
 {
-	$_REQUEST['ac']=3D  strtoupper($_REQUEST['ac']);
+	$_REQUEST['ac']=3D  trim(strtoupper($_REQUEST['ac']));
     $all =3D explode('/', $_REQUEST['ac']);
     $module_selected =3D $all[0];
 	$g_user->audit();



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 13:37:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjDEL-0000II-0k
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 13:37:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 19:28:13 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.226041.1340645860.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5007 - phpcompta/trunk/html/admin/sql/patch
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 17:37:40 -0000

Author: danydb
Date: 2012-06-25 19:28:13 +0200 (Mon, 25 Jun 2012)
New Revision: 5007

Modified:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
Log:
Change SOCIETE (ad_id=3D25) , type =3D card

Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 12:20:=
55 UTC (rev 5006)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 17:28:=
13 UTC (rev 5007)
@@ -494,4 +494,4 @@
=20
 update version set val=3D103;
=20
-commit;
\ No newline at end of file
+commit;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 16:25:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjFqY-0000N5-I2
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 16:25:18 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 22:15:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.226457.1340655918.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5008 - phpcompta/trunk/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 20:25:17 -0000

Author: danydb
Date: 2012-06-25 22:15:51 +0200 (Mon, 25 Jun 2012)
New Revision: 5008

Modified:
   phpcompta/trunk/doc/manuel-fr.odt
Log:
Update documentation

Modified: phpcompta/trunk/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 16:53:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjGI1-0006zS-0u
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 16:53:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 22:44:12 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.226516.1340657620.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5009 - in phpcompta/trunk: html/admin/sql/patch
	include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 20:53:39 -0000

Author: danydb
Date: 2012-06-25 22:44:12 +0200 (Mon, 25 Jun 2012)
New Revision: 5009

Modified:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/class_fiche_attr.php
   phpcompta/trunk/include/class_inum.php
Log:
0000658: Pr?\195?\169cision d?\195?\169cimale est dans les attributs de f=
iche

Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 20:15:=
51 UTC (rev 5008)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 20:44:=
12 UTC (rev 5009)
@@ -55,7 +55,7 @@
     VALUES ('BK', 'GESTION', 2, 35, 'E', 0);
=20
=20
-=20
+
 update menu_ref set me_description=3D'Grand livre analytique' where me_c=
ode=3D'ANCGL';
=20
 alter table action_gestion add ag_remind_date date;
@@ -491,6 +491,8 @@
=20
 update attr_def set ad_type=3D'card', ad_extra=3D'[sql] frd_id in (4,8,9=
,14)' where ad_id=3D25;
=20
+update attr_Def set ad_extra=3D'2' where ad_type=3D'numeric';
+update attr_Def set ad_extra=3D'4' where ad_id=3D31;
=20
 update version set val=3D103;
=20

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-25 20:15:51 UTC (rev =
5008)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-25 20:44:12 UTC (rev =
5009)
@@ -467,7 +467,7 @@
                 $w=3Dnew ITva_Popup('popup_tva');
                 $w->table=3D1;
             }
-       =20
+
             else
             {
 	      switch ($attr->ad_type)
@@ -478,7 +478,7 @@
 						break;
 					case 'numeric':
 						$w =3D new INum();
-                                                $w->javascript=3D'onchan=
ge=3D"format_number(this,4);"';
+						$w->prec=3D($attr->ad_extra=3D=3D"")?2:$attr->ad_extra;
 						$w->size =3D $attr->ad_size;
 						break;
 					case 'date':
@@ -603,7 +603,7 @@
 						case 'numeric':
 							$w =3D new INum('av_text' . $r->ad_id);
 							$w->size =3D $r->ad_size;
-                                                        $w->javascript=3D=
'onchange=3D"format_number(this,4);"';
+							$w->prec=3D($attr->ad_extra=3D=3D"")?2:$attr->ad_extra;
 							$w->value =3D $r->av_text;
 							break;
 						case 'date':

Modified: phpcompta/trunk/include/class_fiche_attr.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche_attr.php	2012-06-25 20:15:51 UTC =
(rev 5008)
+++ phpcompta/trunk/include/class_fiche_attr.php	2012-06-25 20:44:12 UTC =
(rev 5009)
@@ -87,7 +87,11 @@
                 $this->ad_size=3D22;
             }
         }
+		if ( $this->ad_type =3D=3D 'numeric' ) {
+			$this->ad_extra=3D(trim($this->ad_extra)=3D=3D'')?'2':$this->ad_extra=
;
+			if (isNumber($this->ad_extra) =3D=3D 0) throw new Exception ("La pr=C3=
=A9cision doit =C3=AAtre un chiffre");
=20
+		}
 		if ( $this->ad_type =3D=3D 'select')
         {
                 if (trim($this->ad_extra)=3D=3D"") throw new Exception (=
"La requ=C3=AAte SQL est vide ");

Modified: phpcompta/trunk/include/class_inum.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_inum.php	2012-06-25 20:15:51 UTC (rev 5=
008)
+++ phpcompta/trunk/include/class_inum.php	2012-06-25 20:44:12 UTC (rev 5=
009)
@@ -35,13 +35,15 @@
     function __construct($name=3D'',$value=3D'')
     {
         parent::__construct($name,$value);
-        $this->javascript=3D'onchange=3D"format_number(this);"';
+
         $this->size=3D9;
         $this->style=3D'style=3D"text-align:right;border:1px solid blue;=
margin:2px"';
+		$this->javascript=3D 'onchange=3D"format_number(this,2);"';
     }
     /*!\brief print in html the readonly value of the widget*/
     public function display()
     {
+
         $readonly=3D" readonly ";
         $style=3D'style=3D"border:solid 1px blue;color:black;background:=
#EDEDED;text-align:right"';
         $this->value=3Dstr_replace('"','',$this->value);
@@ -56,7 +58,42 @@
         return $r;
=20
     }
+	 /*!\brief show the html  input of the widget*/
+    public function input($p_name=3Dnull,$p_value=3Dnull)
+    {
+		if ( isset ($this->prec)) {
+			$this->javascript=3D 'onchange=3D"format_number(this,'.$this->prec.')=
;"';
+		}
+        $this->name=3D($p_name=3D=3Dnull)?$this->name:$p_name;
+        $this->value=3D($p_value=3D=3Dnull)?$this->value:$p_value;
+        if ( $this->readOnly=3D=3Dtrue) return $this->display();
=20
+        $t=3D ((isset($this->title)))?'title=3D"'.$this->title.'"   ':' =
';
+
+        $extra=3D(isset($this->extra))?$this->extra:"";
+
+        $this->value=3Dstr_replace('"','',$this->value);
+        if ( ! isset ($this->css_size))
+        {
+        $r=3D'<INPUT '.$this->style.' TYPE=3D"TEXT" id=3D"'.
+           $this->name.'"'.$t.
+           'NAME=3D"'.$this->name.'" VALUE=3D"'.$this->value.'"  '.
+           'SIZE=3D"'.$this->size.'" '.$this->javascript."  $this->extra=
 >";
+        /* add tag for column if inside a table */
+        } else {
+           $r=3D'<INPUT '.$this->style.' TYPE=3D"TEXT" id=3D"'.
+           $this->name.'"'.$t.
+           'NAME=3D"'.$this->name.'" VALUE=3D"'.$this->value.'"  '.
+           ' style=3D"width:'.$this->css_size.';" '.$this->javascript." =
 $this->extra >";
+
+        }
+
+        if ( $this->table =3D=3D 1 )		  $r=3D'<td>'.$r.'</td>';
+
+        return $r;
+
+    }
+
 }
=20
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Mon Jun 25 17:18:42 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjGgE-0001p2-R4
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Jun 2012 17:18:42 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Jun 2012 23:09:17 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.226540.1340659122.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5010 - phpcompta/trunk/html/admin/sql/patch
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Jun 2012 21:18:42 -0000

Author: danydb
Date: 2012-06-25 23:09:16 +0200 (Mon, 25 Jun 2012)
New Revision: 5010

Modified:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
Log:
set order STOCK in compta

Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 20:44:=
12 UTC (rev 5009)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-25 21:09:=
16 UTC (rev 5010)
@@ -225,7 +225,7 @@
 INSERT INTO profile_menu(me_code, me_code_dep, p_id, p_order, p_type_dis=
play, pm_default)
     VALUES ('CFGSTOCK', 'PARAM', 1, 40, 'E', 0);
 update menu_ref set me_file=3Dnull where me_code=3D'STOCK';
-update profile_menu set me_code_dep=3D'COMPTA',p_order=3D15 where me_cod=
e=3D'STOCK' and me_code_dep=3D'ADV';
+update profile_menu set me_code_dep=3D'COMPTA',p_order=3D90 where me_cod=
e=3D'STOCK' and me_code_dep=3D'ADV';
=20
 CREATE TABLE stock_repository
 (



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 26 04:48:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjRRW-0007V4-H9
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Jun 2012 04:48:14 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Jun 2012 10:38:35 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.228019.1340700494.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5011 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Jun 2012 08:48:13 -0000

Author: danydb
Date: 2012-06-26 10:38:35 +0200 (Tue, 26 Jun 2012)
New Revision: 5011

Modified:
   phpcompta/trunk/include/template/detail-action.php
Log:
0000659: Document Gestion : si aucun document ?\195?\160 g?\195?\169n?\19=
5?\169rer, pas de zone document ?\195?\160 g?\195?\169n?\195?\169rer

Modified: phpcompta/trunk/include/template/detail-action.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/detail-action.php	2012-06-25 21:09:1=
6 UTC (rev 5010)
+++ phpcompta/trunk/include/template/detail-action.php	2012-06-26 08:38:3=
5 UTC (rev 5011)
@@ -315,7 +315,7 @@
=20
 </fieldset>
=20
-<? if ($p_view !=3D 'READ') : ?>
+<? if ($p_view !=3D 'READ' && $str_select_doc !=3D '') : ?>
 <fieldset >
   <legend>
      <?=3D_('Document =C3=A0 g=C3=A9n=C3=A9rer')?>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 26 04:49:00 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjRSG-0007XC-NU
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Jun 2012 04:49:00 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Jun 2012 10:39:24 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.228021.1340700539.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5012 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Jun 2012 08:48:59 -0000

Author: danydb
Date: 2012-06-26 10:39:24 +0200 (Tue, 26 Jun 2012)
New Revision: 5012

Modified:
   phpcompta/trunk/include/class_follow_up.php
Log:
By default ag_dest is the user's profile

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-26 08:38:35 UTC (=
rev 5011)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-26 08:39:24 UTC (=
rev 5012)
@@ -617,10 +617,6 @@
 					" ag_hour, ag_priority,ag_owner,ag_contact,ag_state,ag_remind_date)=
 " .
 					" values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,=
$12,$13)";
 		}
-		if ($this->ag_dest =3D=3D 0)
-		{
-			$this->ag_dest =3D null;
-		}
 		$this->db->exec_sql($sql, array($this->ag_id, /* 1 */
 			$this->ag_timestamp, /* 2 */
 			$this->dt_id, /* 3 */
@@ -827,6 +823,7 @@
 	 */
 	function Update()
 	{
+           =20
 		// if ag_id =3D=3D 0 nothing to do
 		if ($this->ag_id =3D=3D 0)
 			return;
@@ -851,10 +848,6 @@
 			$contact->id =3D 0;
=20
=20
-		if ($this->ag_dest =3D=3D 0)
-		{
-			$this->ag_dest =3D null;
-		}
 		if ($this->ag_remind_date !=3D null)
 		{
 			$this->db->exec_sql("update action_gestion set " .
@@ -961,6 +954,7 @@
=20
 	function fromArray($p_array)
 	{
+                global $g_user;
 		$this->ag_id =3D (isset($p_array['ag_id'])) ? $p_array['ag_id'] : "";
 		$this->ag_ref =3D (isset($p_array['ag_ref'])) ? $p_array['ag_ref'] : "=
";
 		$this->qcode_dest =3D (isset($p_array['qcode_dest'])) ? $p_array['qcod=
e_dest'] : "";
@@ -972,7 +966,7 @@
 		$this->ag_ref =3D (isset($p_array['ag_ref'])) ? $p_array['ag_ref'] : "=
";
 		$this->ag_title =3D (isset($p_array['ag_title'])) ? $p_array['ag_title=
'] : "";
 		$this->ag_hour =3D (isset($p_array['ag_hour'])) ? $p_array['ag_hour'] =
: "";
-		$this->ag_dest =3D (isset($p_array['ag_dest'])) ? $p_array['ag_dest'] =
: "";
+		$this->ag_dest =3D (isset($p_array['ag_dest'])) ? $p_array['ag_dest'] =
: $g_user->get_profile();
 		$this->ag_priority =3D (isset($p_array['ag_priority'])) ? $p_array['ag=
_priority'] : 2;
 		$this->ag_contact =3D (isset($p_array['ag_contact'])) ? $p_array['ag_c=
ontact'] : "";
 		$this->ag_comment =3D (isset($p_array['ag_comment'])) ? $p_array['ag_c=
omment'] : "";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 26 05:47:37 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjSMz-0001iJ-KM
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Jun 2012 05:47:37 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Jun 2012 11:38:02 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.228140.1340704055.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r382 - in trunk: amortis coprop import_card
	import_doli importbank modop skel tool_pcmn tools tva
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Jun 2012 09:47:35 -0000

Author: danydb
Date: 2012-06-26 11:38:01 +0200 (Tue, 26 Jun 2012)
New Revision: 382

Modified:
   trunk/amortis/index.php
   trunk/coprop/index.php
   trunk/import_card/index.php
   trunk/import_doli/index.php
   trunk/importbank/index.php
   trunk/modop/index.php
   trunk/skel/index.php
   trunk/tool_pcmn/index.php
   trunk/tools/index.php
   trunk/tva/index.php
Log:
Add check_version for the plugin, based on SVNINFO which is changed by sc=
ript=20

Modified: trunk/amortis/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/amortis/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/amortis/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -19,6 +19,8 @@
 /* $Revision$ */
=20
 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
+global $version_plugin;
+$version_plugin=3DSVNINFO;
 Extension::check_version(4400);
 /*!\file
  * \brief main entry

Modified: trunk/coprop/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coprop/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/coprop/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -29,6 +29,8 @@
  */
=20
 require_once 'class_acc_ledger.php';
+global $version_plugin;
+$version_plugin=3DSVNINFO;
 Extension::check_version(4600);
 ob_start();
 require_once('coprop-javascript.js');

Modified: trunk/import_card/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/import_card/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/import_card/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -23,10 +23,13 @@
 /*!\file
  * \brief main file for importing card
  */
-
+global $version_plugin;
+$version_plugin=3DSVNINFO;
+Extension::check_version(4400);
 /*
  * load javascript
  */
+
 require_once('include/class_import_card.php');
 global $cn;
 echo '<div style=3D"float:right"><a class=3D"mtitle" style=3D"font-size:=
140%" href=3D"http://wiki.phpcompta.eu/doku.php?id=3Dimportation_de_fiche=
" target=3D"_blank">Aide</a>'.

Modified: trunk/import_doli/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/import_doli/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/import_doli/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -37,8 +37,9 @@
 '<span style=3D"font-size:0.8em;color:red;display:inline">vers:SVNINFO</=
span>'.
 '</div>';
 $cn=3Dnew Database(dossier::id());
+global $version_plugin;
+$version_plugin=3DSVNINFO;
=20
-
 Extension::check_version(4802);
=20
 // Javascript

Modified: trunk/importbank/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/importbank/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/importbank/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -30,6 +30,8 @@
 require_once('include/class_import_bank.php');
 require_once('bank_constant.php');
 require_once('class_html_table.php');
+global $version_plugin;
+$version_plugin=3DSVNINFO;
 Extension::check_version(4400);
 global $cn;
 echo '<div style=3D"float:right"><a class=3D"mtitle" style=3D"font-size:=
140%" href=3D"http://wiki.phpcompta.eu/doku.php?id=3Dimportation_de_banqu=
e" target=3D"_blank">Aide</a>'.

Modified: trunk/modop/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/modop/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/modop/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -23,6 +23,8 @@
 /*!\file
  * \brief modify a operation
  */
+global $version_plugin;
+$version_plugin=3DSVNINFO;
 Extension::check_version(4400);
 $str=3Dnew IConcerned("jr_id");
 $str->value=3D(isset($_GET['jr_id']))?strtoupper($_GET['jr_id']):'';

Modified: trunk/skel/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/skel/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/skel/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -27,11 +27,15 @@
 /*
  * load javascript
  */
+
 ob_start();
 require_once('skel_javascript.js');
 $j=3Dob_get_contents();
 ob_clean();
 echo create_script($j);
+global $version_plugin;
+$version_plugin=3DSVNINFO;
+Extension::check_version(4400);
=20
 $url=3D'?'.dossier::get().'&plugin_code=3D'.$_REQUEST['plugin_code'].'&a=
c=3D'.$_REQUEST['ac'];
=20

Modified: trunk/tool_pcmn/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tool_pcmn/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/tool_pcmn/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -27,6 +27,8 @@
 /*
  * load javascript
  */
+global $version_plugin;
+$version_plugin=3DSVNINFO;
 Extension::check_version(4400);
 global $cn;
 echo '<div style=3D"float:right"><a class=3D"mtitle" style=3D"font-size:=
140%" href=3D"http://wiki.phpcompta.eu/doku.php?id=3Dimportation_de_plan_=
comptable" target=3D"_blank">Aide</a>'.

Modified: trunk/tools/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tools/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/tools/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -23,6 +23,8 @@
 /*!\file
  * \brief main file for tools
  */
+global $version_plugin;
+$version_plugin=3DSVNINFO;
 Extension::check_version(4400);
=20
 /*

Modified: trunk/tva/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tva/index.php	2012-06-24 19:43:30 UTC (rev 381)
+++ trunk/tva/index.php	2012-06-26 09:38:01 UTC (rev 382)
@@ -23,6 +23,8 @@
 /*!\file
  * \brief main file for tva
  */
+global $version_plugin;
+$version_plugin=3DSVNINFO;
 Extension::check_version(4900);
=20
 $url=3D'?'.dossier::get().'&plugin_code=3D'.$_REQUEST['plugin_code']."&a=
c=3D".$_REQUEST['ac'];



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 26 09:50:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjWAU-00067P-6R
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Jun 2012 09:50:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Jun 2012 15:41:18 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.228923.1340718657.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5013 - in phpcompta/trunk: html include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Jun 2012 13:50:56 -0000

Author: danydb
Date: 2012-06-26 15:41:17 +0200 (Tue, 26 Jun 2012)
New Revision: 5013

Modified:
   phpcompta/trunk/html/style-color.css
   phpcompta/trunk/html/style-epad.css
   phpcompta/trunk/html/style-light.css
   phpcompta/trunk/html/style.css
   phpcompta/trunk/include/template/dashboard.php
Log:
Cosmetic bug for IE8

Modified: phpcompta/trunk/html/style-color.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-color.css	2012-06-26 08:39:24 UTC (rev 501=
2)
+++ phpcompta/trunk/html/style-color.css	2012-06-26 13:41:17 UTC (rev 501=
3)
@@ -870,7 +870,9 @@
 	position:absolute;
 	text-align:left;
 	line-height:3em;
-	z-index:1}
+	z-index:1;
+        width:345px;
+}
 div.welcome {
=20
 }

Modified: phpcompta/trunk/html/style-epad.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-epad.css	2012-06-26 08:39:24 UTC (rev 5012=
)
+++ phpcompta/trunk/html/style-epad.css	2012-06-26 13:41:17 UTC (rev 5013=
)
@@ -865,7 +865,9 @@
 	position:absolute;
 	text-align:left;
 	line-height:3em;
-	z-index:1}
+	z-index:1;
+        width:345px;
+}
 div.welcome {
=20
 }

Modified: phpcompta/trunk/html/style-light.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style-light.css	2012-06-26 08:39:24 UTC (rev 501=
2)
+++ phpcompta/trunk/html/style-light.css	2012-06-26 13:41:17 UTC (rev 501=
3)
@@ -865,7 +865,9 @@
 	position:absolute;
 	text-align:left;
 	line-height:3em;
-	z-index:1}
+	z-index:1;
+        width:345px;
+}
 div.welcome {
=20
 }

Modified: phpcompta/trunk/html/style.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/style.css	2012-06-26 08:39:24 UTC (rev 5012)
+++ phpcompta/trunk/html/style.css	2012-06-26 13:41:17 UTC (rev 5013)
@@ -863,7 +863,9 @@
                     position:absolute;
                     text-align:left;
                     line-height:3em;
-                    z-index:1}
+                    z-index:1;
+                    width:345px;
+                }
 div.welcome {
=20
 }

Modified: phpcompta/trunk/include/template/dashboard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/dashboard.php	2012-06-26 08:39:24 UT=
C (rev 5012)
+++ phpcompta/trunk/include/template/dashboard.php	2012-06-26 13:41:17 UT=
C (rev 5013)
@@ -93,7 +93,7 @@
 for($i=3D0;$i<count($last_ledger);$i++):
 	$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
 ?>
-<tr <?=3D$class?> >
+<tr <?=3D$class ?>>=20
 	<td><?=3D  smaller_date($last_ledger[$i]['jr_date_fmt'])?>
 	</td>
 	<td>
@@ -144,7 +144,7 @@
     foreach ($result as $row) {
       $ix++;
 	  $class=3D($ix%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
-      echo '<tr'.$class.'">';
+      echo '<tr '.$class.'>';
=20
       echo '<td> '.$row['desc'].'</td>'.
 	'<td style=3D"text-align:right">'.nbm($row['montant'])." &euro;</td>";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 26 09:51:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjWAl-000698-B2
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Jun 2012 09:51:15 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Jun 2012 15:41:34 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.228928.1340718675.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5014 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Jun 2012 13:51:14 -0000

Author: danydb
Date: 2012-06-26 15:41:33 +0200 (Tue, 26 Jun 2012)
New Revision: 5014

Modified:
   phpcompta/trunk/include/class_extension.php
   phpcompta/trunk/include/constant.php
Log:
check_plugin_version

Modified: phpcompta/trunk/include/class_extension.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_extension.php	2012-06-26 13:41:17 UTC (=
rev 5013)
+++ phpcompta/trunk/include/class_extension.php	2012-06-26 13:41:33 UTC (=
rev 5014)
@@ -95,6 +95,7 @@
                   ' Veuillez mettre votre programme a jour. Version mini=
mum '.$i);
             exit();
         }
+        Extension::check_plugin_version();
     }
 	function insert_plugin()
 	{
@@ -162,5 +163,24 @@
 			}
 		}
 	}
+        static function check_plugin_version()
+        {
+            global $g_user,$version_plugin;
+            if ($g_user->Admin() =3D=3D 1)
+            {
+                if (SITE_UPDATE_PLUGIN !=3D "")
+                {
+                    $update =3D @file_get_contents(SITE_UPDATE_PLUGIN);
+                    if ($update > $version_plugin)
+                    {
+                        echo '<div class=3D"inner_box" style=3D"margin-l=
eft:0px;margin-top:3px;left:3px">';
+                        echo '<p class=3D"notice">';
+                        echo "Mise =C3=A0 jour disponible des plugin Php=
Compta version actuelle : $update votre version $version_plugin";
+                        echo '</p>';
+                        echo '</div>';
+                    }
+                }
+            }
+        }
 }
=20

Modified: phpcompta/trunk/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/constant.php	2012-06-26 13:41:17 UTC (rev 501=
3)
+++ phpcompta/trunk/include/constant.php	2012-06-26 13:41:33 UTC (rev 501=
4)
@@ -41,6 +41,7 @@
 // If you don't want to be notified of the update
 // define ("SITE_UPDATE",'');
 define ("SITE_UPDATE",'http://www.phpcompta.eu/last_version.txt');
+define ("SITE_UPDATE_PLUGIN",'http://www.phpcompta.eu/last_version.txt')=
;
=20
=20
 //$version_phpcompta=3D4985;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Tue Jun 26 09:57:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjWHD-0000u9-86
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Jun 2012 09:57:55 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Jun 2012 15:48:17 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.229049.1340719074.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5015 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Jun 2012 13:57:53 -0000

Author: danydb
Date: 2012-06-26 15:48:17 +0200 (Tue, 26 Jun 2012)
New Revision: 5015

Modified:
   phpcompta/trunk/include/fiche.inc.php
Log:
Appearance History card

Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-26 13:41:33 UTC (rev 50=
14)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-26 13:48:17 UTC (rev 50=
15)
@@ -391,9 +391,9 @@
 			continue;
 		$detail_card =3D HtmlInput::card_detail($row->strAttribut(ATTR_DEF_QUI=
CKCODE), $row->strAttribut(ATTR_DEF_NAME));
=20
-		echo '<h2 style=3D"font-size:14px;text-align:left;margin-left:10;paddi=
ng-left:50;border:solid 1px blue;width:50%;text-decoration:underline">' .=
 $detail_card . '</h2>';
+		echo '<h2 style=3D"font-size:14px;text-align:left;margin-left:10px;pad=
ding-left:50px;border:solid 1px blue;width:70%;text-decoration:underline"=
>' . $detail_card . '</h2>';
=20
-		echo '<table style=3D"width:80%;padding-left:10%;padding-right:10%">';
+		echo '<table style=3D"width:90%;padding-left:5%;padding-right:5%">';
 		echo '<tr>';
 		echo th(_('Date'));
 		echo th(_('ref'));



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 07:14:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjqCM-00017Y-6y
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 07:14:14 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 13:04:31 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.232908.1340795653.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5016 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 11:14:12 -0000

Author: danydb
Date: 2012-06-27 13:04:30 +0200 (Wed, 27 Jun 2012)
New Revision: 5016

Modified:
   phpcompta/trunk/include/class_acc_account_ledger.php
Log:
Bug due to PSQL 9.0 data must be casted

Modified: phpcompta/trunk/include/class_acc_account_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-26 13:48=
:17 UTC (rev 5015)
+++ phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-27 11:04=
:30 UTC (rev 5016)
@@ -574,7 +574,7 @@
                 $SqlFilter=3D$SqlFilter.$SqlItem;
             }
         }//foreach
-        $sql.=3D$SqlFilter.' and pcm_val=3D'.$this->id;
+        $sql.=3D$SqlFilter.' and pcm_val::text=3D'.$this->id;
         $max=3D$this->db->get_value($sql);
         if ($max > 0 )
             return 0;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 07:20:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjqIO-0004Ks-2R
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 07:20:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 13:10:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.232998.1340796027.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5017 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 11:20:27 -0000

Author: danydb
Date: 2012-06-27 13:10:52 +0200 (Wed, 27 Jun 2012)
New Revision: 5017

Modified:
   phpcompta/trunk/include/class_acc_account_ledger.php
Log:
Bug due to PSQL 9.0 data must be casted

Modified: phpcompta/trunk/include/class_acc_account_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-27 11:04=
:30 UTC (rev 5016)
+++ phpcompta/trunk/include/class_acc_account_ledger.php	2012-06-27 11:10=
:52 UTC (rev 5017)
@@ -563,18 +563,18 @@
                 if ( strstr($item_cred,"*") =3D=3D true )
                 {
                     $item_cred=3Dstrtr($item_cred,"*","%");
-                    $SqlItem=3D"$or pcm_val::text like '$item_cred'";
+                    $SqlItem=3D"$or pcm_val::text like '".sql_string($it=
em_cred)."'";
                     $or=3D"  or ";
                 }
                 else
                 {
-                    $SqlItem=3D"$or pcm_val::text =3D '$item_cred' ";
+                    $SqlItem=3D"$or pcm_val::text =3D '".sql_string($ite=
m_cred)."' ";
                     $or=3D"  or ";
                 }
                 $SqlFilter=3D$SqlFilter.$SqlItem;
             }
         }//foreach
-        $sql.=3D$SqlFilter.' and pcm_val::text=3D'.$this->id;
+        $sql.=3D$SqlFilter." and pcm_val::text=3D'".sql_string($this->id=
)."'";
         $max=3D$this->db->get_value($sql);
         if ($max > 0 )
             return 0;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 12:53:26 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjvUc-0005NG-4K
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 12:53:26 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 18:43:46 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234139.1340816005.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5018 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 16:53:24 -0000

Author: danydb
Date: 2012-06-27 18:43:45 +0200 (Wed, 27 Jun 2012)
New Revision: 5018

Modified:
   phpcompta/trunk/include/constant.php
Log:
put debug value for SVNINFO

Modified: phpcompta/trunk/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/constant.php	2012-06-27 11:10:52 UTC (rev 501=
7)
+++ phpcompta/trunk/include/constant.php	2012-06-27 16:43:45 UTC (rev 501=
8)
@@ -27,24 +27,24 @@
 require_once('constant.security.php');
 // SVNVERSION
 global $version_phpcompta;
+define ('SVNINFO',5015');
=20
-
 global $g_captcha,$g_failed,$g_succeed;
 $g_captcha=3Dfalse;
 $g_failed=3D"<span style=3D\"font-size:18px;color:red\">&#x2716;</span>"=
;
 $g_succeed=3D"<span style=3D\"font-size:18px;color:green\">&#x2713;</spa=
n>";
 /*set to none for production */
 /* uncomment for production */
-$version_phpcompta=3DSVNINFO;
+//$version_phpcompta=3DSVNINFO;
 define ("DEBUG",true);
=20
 // If you don't want to be notified of the update
 // define ("SITE_UPDATE",'');
 define ("SITE_UPDATE",'http://www.phpcompta.eu/last_version.txt');
-define ("SITE_UPDATE_PLUGIN",'http://www.phpcompta.eu/last_version.txt')=
;
+define ("SITE_UPDATE_PLUGIN",'http://www.phpcompta.eu/plugin_last_versio=
n.txt');
=20
=20
-//$version_phpcompta=3D4985;
+$version_phpcompta=3D4985;
 //define ("DEBUG",true);
=20
 define ("DBVERSION",103);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 12:58:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SjvZJ-00008p-CI
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 12:58:17 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 18:48:37 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234146.1340816296.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5019 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 16:58:16 -0000

Author: danydb
Date: 2012-06-27 18:48:37 +0200 (Wed, 27 Jun 2012)
New Revision: 5019

Modified:
   phpcompta/trunk/include/constant.php
Log:
remove trailing quote

Modified: phpcompta/trunk/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/constant.php	2012-06-27 16:43:45 UTC (rev 501=
8)
+++ phpcompta/trunk/include/constant.php	2012-06-27 16:48:37 UTC (rev 501=
9)
@@ -27,7 +27,7 @@
 require_once('constant.security.php');
 // SVNVERSION
 global $version_phpcompta;
-define ('SVNINFO',5015');
+define ('SVNINFO',5015);
=20
 global $g_captcha,$g_failed,$g_succeed;
 $g_captcha=3Dfalse;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 12:59:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sjvao-0000mP-V6
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 12:59:50 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 18:50:04 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234147.1340816390.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r383 - trunk/tva
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 16:59:49 -0000

Author: danydb
Date: 2012-06-27 18:50:04 +0200 (Wed, 27 Jun 2012)
New Revision: 383

Modified:
   trunk/tva/index.php
Log:
fix bug with __DIR__

Modified: trunk/tva/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tva/index.php	2012-06-26 09:38:01 UTC (rev 382)
+++ trunk/tva/index.php	2012-06-27 16:50:04 UTC (rev 383)
@@ -92,7 +92,8 @@
   $cn->exec_sql("alter table tva_belge.assujetti add exercice text");
 if ( $cn->exist_table("version","tva_belge")=3D=3Dfalse)
 {
-		$file=3D__DIR__."/sql/patch2.sql";
+
+  $file=3Ddirname(__FILE__)."/sql/patch2.sql";
 		$cn->execute_script($file);
 		if ( $install =3D=3D 0 ) echo_warning(_("Mise =C3=A0 jour du plugin, p=
ourriez-vous en v=C3=A9rifier le param=C3=A8trage ?"));
 		$def=3D5;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 13:23:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sjvy5-0006bH-BB
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 13:23:53 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 19:14:14 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234192.1340817832.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5020 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 17:23:51 -0000

Author: danydb
Date: 2012-06-27 19:14:14 +0200 (Wed, 27 Jun 2012)
New Revision: 5020

Modified:
   phpcompta/trunk/include/class_extension.php
Log:
Position mise ?\195?\160 jour

Modified: phpcompta/trunk/include/class_extension.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_extension.php	2012-06-27 16:48:37 UTC (=
rev 5019)
+++ phpcompta/trunk/include/class_extension.php	2012-06-27 17:14:14 UTC (=
rev 5020)
@@ -173,7 +173,7 @@
                     $update =3D @file_get_contents(SITE_UPDATE_PLUGIN);
                     if ($update > $version_plugin)
                     {
-                        echo '<div class=3D"inner_box" style=3D"margin-l=
eft:0px;margin-top:3px;left:3px">';
+                        echo '<div class=3D"inner_box" style=3D"position=
:absolute;margin-left:0px;margin-top:-90px;left:360px">';
                         echo '<p class=3D"notice">';
                         echo "Mise =C3=A0 jour disponible des plugin Php=
Compta version actuelle : $update votre version $version_plugin";
                         echo '</p>';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 13:24:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sjvyd-00070h-2q
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 13:24:27 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 19:14:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234193.1340817866.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5021 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 17:24:26 -0000

Author: danydb
Date: 2012-06-27 19:14:52 +0200 (Wed, 27 Jun 2012)
New Revision: 5021

Modified:
   phpcompta/trunk/include/constant.php
Log:
Info de debug

Modified: phpcompta/trunk/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/constant.php	2012-06-27 17:14:14 UTC (rev 502=
0)
+++ phpcompta/trunk/include/constant.php	2012-06-27 17:14:52 UTC (rev 502=
1)
@@ -36,6 +36,8 @@
 /*set to none for production */
 /* uncomment for production */
 //$version_phpcompta=3DSVNINFO;
+//define ("DEBUG",true);
+$version_phpcompta=3DSVNINFO;
 define ("DEBUG",true);
=20
 // If you don't want to be notified of the update
@@ -44,9 +46,6 @@
 define ("SITE_UPDATE_PLUGIN",'http://www.phpcompta.eu/plugin_last_versio=
n.txt');
=20
=20
-$version_phpcompta=3D4985;
-//define ("DEBUG",true);
-
 define ("DBVERSION",103);
=20
 define ("DBVERSIONREPO",14);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 13:24:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sjvyz-0007cm-6g
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 13:24:49 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 19:15:11 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234194.1340817888.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5022 - phpcompta/trunk/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 17:24:48 -0000

Author: danydb
Date: 2012-06-27 19:15:11 +0200 (Wed, 27 Jun 2012)
New Revision: 5022

Modified:
   phpcompta/trunk/doc/manuel-fr.odt
Log:
Manuel Documentation

Modified: phpcompta/trunk/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 13:27:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sjw20-0001qx-5W
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 13:27:56 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 19:18:21 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234197.1340818075.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5023 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 17:27:54 -0000

Author: danydb
Date: 2012-06-27 19:18:20 +0200 (Wed, 27 Jun 2012)
New Revision: 5023

Modified:
   phpcompta/trunk/include/class_extension.php
Log:
Position mise ?\195?\160 jour version plugin

Modified: phpcompta/trunk/include/class_extension.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_extension.php	2012-06-27 17:15:11 UTC (=
rev 5022)
+++ phpcompta/trunk/include/class_extension.php	2012-06-27 17:18:20 UTC (=
rev 5023)
@@ -173,7 +173,7 @@
                     $update =3D @file_get_contents(SITE_UPDATE_PLUGIN);
                     if ($update > $version_plugin)
                     {
-                        echo '<div class=3D"inner_box" style=3D"position=
:absolute;margin-left:0px;margin-top:-90px;left:360px">';
+                        echo '<div class=3D"inner_box" style=3D"position=
:absolute;zindex:2;top:5px;left:360px">';
                         echo '<p class=3D"notice">';
                         echo "Mise =C3=A0 jour disponible des plugin Php=
Compta version actuelle : $update votre version $version_plugin";
                         echo '</p>';



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Wed Jun 27 13:28:30 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sjw2Y-0002zU-RG
	for mharc-phpcompta-dev@gnu.org; Wed, 27 Jun 2012 13:28:30 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Wed, 27 Jun 2012 19:18:56 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.234200.1340818110.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5024 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jun 2012 17:28:29 -0000

Author: danydb
Date: 2012-06-27 19:18:56 +0200 (Wed, 27 Jun 2012)
New Revision: 5024

Modified:
   phpcompta/trunk/include/class_extension.php
Log:
Position mise ?\195?\160 jour version plugin, typo

Modified: phpcompta/trunk/include/class_extension.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_extension.php	2012-06-27 17:18:20 UTC (=
rev 5023)
+++ phpcompta/trunk/include/class_extension.php	2012-06-27 17:18:56 UTC (=
rev 5024)
@@ -175,7 +175,7 @@
                     {
                         echo '<div class=3D"inner_box" style=3D"position=
:absolute;zindex:2;top:5px;left:360px">';
                         echo '<p class=3D"notice">';
-                        echo "Mise =C3=A0 jour disponible des plugin Php=
Compta version actuelle : $update votre version $version_plugin";
+                        echo "Mise =C3=A0 jour disponible des plugins po=
ur PhpCompta, version actuelle : $update votre version $version_plugin";
                         echo '</p>';
                         echo '</div>';
                     }



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 03:54:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sk9Ya-0003fv-Hu
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 03:54:28 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 28 Jun 2012 09:44:44 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.236305.1340870067.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5025 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 07:54:27 -0000

Author: danydb
Date: 2012-06-28 09:44:43 +0200 (Thu, 28 Jun 2012)
New Revision: 5025

Modified:
   phpcompta/trunk/include/fiche.inc.php
Log:
0000662: CARD : avoir les totaux dans les balances


Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-27 17:18:56 UTC (rev 50=
24)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-28 07:44:43 UTC (rev 50=
25)
@@ -296,7 +296,7 @@
 				th('Solde', 'style=3D"text-align:right"') .
 				th('D/C', 'style=3D"text-align:right"')
 		);
-		$idx =3D 0;
+		$idx =3D 0;$sum_deb=3D0;$sum_cred=3D0;bcscale(4);
 		for ($i =3D 0; $i < Database::num_row($ret); $i++)
 		{
 			$filter =3D " (j_date >=3D to_date('" . $_REQUEST['start'] . "','DD.M=
M.YYYY') " .
@@ -313,6 +313,9 @@
 			if ($idx % 2 =3D=3D 0)
 				$class =3D 'class=3D"odd"';
 			$idx++;
+                        $sum_cred=3Dbcadd($sum_cred,$solde['credit']);
+                        $sum_deb=3Dbcadd($sum_deb,$solde['debit']);
+                        $sum_solde=3Dbcsub($sum_deb,$sum_cred);
 			echo tr(
 					td(HtmlInput::history_card($oCard->id, $oCard->strAttribut(ATTR_DEF=
_QUICKCODE))) .
 					td($oCard->strAttribut(ATTR_DEF_NAME)) .
@@ -321,6 +324,15 @@
 					td(nbm(abs($solde['solde'])), 'style=3D"text-align:right"') .
 					td((($solde['debit'] < $solde['credit']) ? 'CRED' : 'DEB'), 'style=3D=
"text-align:right"'), $class
 			);
+                        echo tr(
+                                td('').
+                                td(_('Totaux')).
+                                td(nbm($sum_deb)).
+                                td(nbm($sum_cred)).
+                                td(nbm(abs($sum_solde))).
+                                td((($sum_deb < $sum_cred) ? 'CRED' : 'D=
EB'), 'style=3D"text-align:right"'),"");
+                               =20
+                               =20
 		}
 		echo '</table>';
 	}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 04:16:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sk9tY-0005pC-BS
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 04:16:08 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 28 Jun 2012 10:06:22 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.236347.1340871367.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5026 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 08:16:06 -0000

Author: danydb
Date: 2012-06-28 10:06:22 +0200 (Thu, 28 Jun 2012)
New Revision: 5026

Modified:
   phpcompta/trunk/include/fiche.inc.php
Log:
0000662: CARD : avoir les totaux dans les balances
Bug totaux ne sont pas ?\195?\160 la fin


Modified: phpcompta/trunk/include/fiche.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/fiche.inc.php	2012-06-28 07:44:43 UTC (rev 50=
25)
+++ phpcompta/trunk/include/fiche.inc.php	2012-06-28 08:06:22 UTC (rev 50=
26)
@@ -324,16 +324,17 @@
 					td(nbm(abs($solde['solde'])), 'style=3D"text-align:right"') .
 					td((($solde['debit'] < $solde['credit']) ? 'CRED' : 'DEB'), 'style=3D=
"text-align:right"'), $class
 			);
-                        echo tr(
+                     =20
+                               =20
+                               =20
+		}
+                echo tr(
                                 td('').
                                 td(_('Totaux')).
-                                td(nbm($sum_deb)).
-                                td(nbm($sum_cred)).
-                                td(nbm(abs($sum_solde))).
+                                td(nbm($sum_deb), 'style=3D"text-align:r=
ight"').
+                                td(nbm($sum_cred), 'style=3D"text-align:=
right"').
+                                td(nbm(abs($sum_solde)), 'style=3D"text-=
align:right"').
                                 td((($sum_deb < $sum_cred) ? 'CRED' : 'D=
EB'), 'style=3D"text-align:right"'),"");
-                               =20
-                               =20
-		}
 		echo '</table>';
 	}
 	if ( $allcard =3D=3D 0 ) echo $str_add_card;



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 04:24:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkA26-00077C-Cq
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 04:24:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 28 Jun 2012 10:15:16 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.236384.1340871897.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5027 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 08:24:56 -0000

Author: danydb
Date: 2012-06-28 10:15:16 +0200 (Thu, 28 Jun 2012)
New Revision: 5027

Modified:
   phpcompta/trunk/include/export_fiche_balance_pdf.php
Log:
0000662: CARD : avoir les totaux dans les balances
Idem dans PDF


Modified: phpcompta/trunk/include/export_fiche_balance_pdf.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-28 08:06=
:22 UTC (rev 5026)
+++ phpcompta/trunk/include/export_fiche_balance_pdf.php	2012-06-28 08:15=
:16 UTC (rev 5027)
@@ -94,7 +94,7 @@
 	if (empty($aCard)) continue;
=20
=20
-    $idx=3D0;
+    $idx=3D0;$sum_deb=3D0;$sum_cred=3D0;bcscale(4);
     for ($i=3D0;$i < count($aCard);$i++)
     {
         if ( isDate($_REQUEST['start']) =3D=3D null || isDate ($_REQUEST=
['end']) =3D=3D null ) 	 exit;
@@ -120,15 +120,37 @@
 	$side=3D'';
 	if(bcsub($solde['credit'],$solde['debit']) < 0) $side=3D'Deb.';
 	if(bcsub($solde['credit'],$solde['debit']) > 0) $side=3D'Cred.';
-
+       =20
+        $sum_cred=3Dbcadd($sum_cred,$solde['credit']);
+        $sum_deb=3Dbcadd($sum_deb,$solde['debit']);
+        $sum_solde=3Dbcsub($sum_deb,$sum_cred);
+       =20
         $pdf->Cell(30,7,$oCard->strAttribut(ATTR_DEF_QUICKCODE),0,0,'L',=
$fill);
         $pdf->Cell(80,7,$oCard->strAttribut(ATTR_DEF_NAME),0,0,'L',$fill=
);
-        $pdf->Cell(20,7,sprintf('%.02f',$solde['debit']),0,0,'R',$fill);
-        $pdf->Cell(20,7,sprintf('%.02f',$solde['credit']),0,0,'R',$fill)=
;
-        $pdf->Cell(20,7,sprintf('%.02f',abs($solde['solde'])),0,0,'R',$f=
ill);
+        $pdf->Cell(20,7,nbm($solde['debit']),0,0,'R',$fill);
+        $pdf->Cell(20,7,nbm($solde['credit']),0,0,'R',$fill);
+        $pdf->Cell(20,7,nbm(abs($solde['solde'])),0,0,'R',$fill);
         $pdf->Cell(20,7,$side,0,0,'C',$fill);
         $pdf->Ln();
-    }
+        }
+        // Sum by category
+        $pdf->Cell(30,7,"",0,0,'L',$fill);
+        $pdf->Cell(80,7,_("Totaux"),0,0,'L',$fill);
+        $pdf->Cell(20,7,nbm($sum_deb),0,0,'R',$fill);
+        $pdf->Cell(20,7,nbm($sum_cred),0,0,'R',$fill);
+        $pdf->Cell(20,7,nbm(abs($sum_solde)),0,0,'R',$fill);
+        $side=3D" =3D ";
+        if ( $sum_solde > 0 )=20
+        {
+            $side=3D'Deb.';
+        }
+        else if ( $sum_solde < 0)
+        {
+            $side=3D'Cred.';
+        }
+       =20
+        $pdf->Cell(20,7,$side,0,0,'C',$fill);
+        $pdf->Ln();
 	}
 }
 else



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 09:56:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkFCb-0004Ha-4t
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 09:56:09 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 28 Jun 2012 15:46:26 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.238876.1340891768.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5028 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 13:56:08 -0000

Author: danydb
Date: 2012-06-28 15:46:25 +0200 (Thu, 28 Jun 2012)
New Revision: 5028

Modified:
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/class_acc_ledger.php
   phpcompta/trunk/include/class_follow_up.php
Log:
Improve comment, remove todo

Modified: phpcompta/trunk/include/action.common.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/action.common.inc.php	2012-06-28 08:15:16 UTC=
 (rev 5027)
+++ phpcompta/trunk/include/action.common.inc.php	2012-06-28 13:46:25 UTC=
 (rev 5028)
@@ -181,7 +181,7 @@
 	if ($g_user->can_write_action($_REQUEST['ag_id'])=3D=3Dtrue)	$act->remo=
ve();
 	$sub_action =3D "list";
 	$cn->commit();
-	Follow_Up::ShowActionList($cn, $base);
+	Follow_Up::show_action_list($cn, $base);
 	if (isset($act->ag_ref))
 		echo hb(_('Action ') . $act->ag_ref . _(' effac=C3=A9e'));
 	exit();
@@ -191,7 +191,7 @@
 // Show a list of the action
 if ($sub_action =3D=3D "list")
 {
-	Follow_Up::ShowActionList($cn, $base);
+	Follow_Up::show_action_list($cn, $base);
 	// Add a button to export to Csv
 	echo '<form method=3D"GET" ACTION=3D"export.php">';
 	echo HtmlInput::request_to_hidden(array("remind_date_end","remind_date"=
,"sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", =
"start_date", "end_date", "ag_id", "ag_dest_query",
@@ -244,7 +244,7 @@
 	$url =3D "?$base&sa=3Ddetail&ag_id=3D" . $act->ag_id . '&' . dossier::g=
et();
 	echo '<p><a class=3D"mtitle" href=3D"' . $url . '">' . hb('Action Sauv=C3=
=A9e  : ' . $act->ag_ref) . '</a></p>';
=20
-	Follow_Up::ShowActionList($cn,$base);
+	Follow_Up::show_action_list($cn,$base);
 	$url =3D "?$base&sa=3Ddetail&ag_id=3D" . $act->ag_id . '&' . dossier::g=
et();
 	echo '<p><a class=3D"mtitle" href=3D"' . $url . '">' . hb('Action Sauv=C3=
=A9e  : ' . $act->ag_ref) . '</a></p>';
 }

Modified: phpcompta/trunk/include/class_acc_ledger.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_acc_ledger.php	2012-06-28 08:15:16 UTC =
(rev 5027)
+++ phpcompta/trunk/include/class_acc_ledger.php	2012-06-28 13:46:25 UTC =
(rev 5028)
@@ -321,10 +321,6 @@
 			$sql =3D "delete from stock_goods where sg_id =3D any ( select sg_id
              from stock_goods natural join jrnx  where j_grpt=3D" . $thi=
s->jr_grpt_id . ")";
 			$Res =3D $this->db->exec_sql($sql);
-			/**
-			 * @function
-			 * @todo  remove also from ANC */
-			// Check return code
 			if ($Res =3D=3D false)
 				throw (new Exception(__FILE__ . __LINE__ . "sql a echoue [ $sql ]"))=
;
 		}

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-28 08:15:16 UTC (=
rev 5027)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-28 13:46:25 UTC (=
rev 5028)
@@ -1013,7 +1013,10 @@
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}
-
+        /**
+         * get the action where the remind day is today
+         * @return array
+         */
 	function get_today()
 	{
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
@@ -1146,8 +1149,12 @@
 		// show the  action in
 		require_once 'template/action_search.php';
 	}
-
-	static function ShowActionList($cn, $p_base)
+        /**
+        *@brief show a list of actions
+        * @param $cn database connextion
+        * @param $p_base base URL=20
+        */
+	static function show_action_list($cn, $p_base)
 	{
=20
 		Follow_Up::display_search($cn);
@@ -1177,11 +1184,9 @@
=20
 		extract($p_array);
 		$query =3D "";
-		/**
-		 *@todo check why we need to use $_REQUEST['query']
-		 * instead of $_GET['query']
-		 */
-		if (isset($_REQUEST['query']))
+
+               =20
+                if (isset($_REQUEST['query']))
 		{
 			// if a query is request build the sql stmt
 			$query =3D "and (ag_title ~* '" . sql_string($_REQUEST['query']) . "'=
 " .



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 10:15:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkFV4-0008Lk-FR
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 10:15:14 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Thu, 28 Jun 2012 16:05:22 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.238929.1340892913.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5029 - phpcompta/trunk/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 14:15:13 -0000

Author: danydb
Date: 2012-06-28 16:05:22 +0200 (Thu, 28 Jun 2012)
New Revision: 5029

Modified:
   phpcompta/trunk/doc/manuel-fr.odt
Log:
update documentation

Modified: phpcompta/trunk/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 19:03:10 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkNjy-0004HP-1K
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 19:03:10 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 00:53:30 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.240311.1340924589.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5030 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 23:03:09 -0000

Author: danydb
Date: 2012-06-29 00:53:29 +0200 (Fri, 29 Jun 2012)
New Revision: 5030

Modified:
   phpcompta/trunk/include/class_fiche.php
Log:
Correction bug fiche, precision d?\195?\169cimale

Modified: phpcompta/trunk/include/class_fiche.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_fiche.php	2012-06-28 14:05:22 UTC (rev =
5029)
+++ phpcompta/trunk/include/class_fiche.php	2012-06-28 22:53:29 UTC (rev =
5030)
@@ -603,7 +603,7 @@
 						case 'numeric':
 							$w =3D new INum('av_text' . $r->ad_id);
 							$w->size =3D $r->ad_size;
-							$w->prec=3D($attr->ad_extra=3D=3D"")?2:$attr->ad_extra;
+							$w->prec=3D($r->ad_extra=3D=3D"")?2:$r->ad_extra;
 							$w->value =3D $r->av_text;
 							break;
 						case 'date':



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 19:04:32 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkNlI-0004JB-Ig
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 19:04:32 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 00:54:49 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.240314.1340924671.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5031 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 23:04:31 -0000

Author: danydb
Date: 2012-06-29 00:54:49 +0200 (Fri, 29 Jun 2012)
New Revision: 5031

Modified:
   phpcompta/trunk/include/class_stock.php
   phpcompta/trunk/include/template/stock_histo.php
   phpcompta/trunk/include/template/stock_summary_list.php
   phpcompta/trunk/include/template/stock_summary_table.php
Log:
Correction stock : calcul r?\195?\169sum?\195?\169 table + liste


Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-28 22:53:29 UTC (rev =
5030)
+++ phpcompta/trunk/include/class_stock.php	2012-06-28 22:54:49 UTC (rev =
5031)
@@ -192,7 +192,8 @@
 		{
 			$clause.=3D$and . " to_date('" . sql_string($p_array['wdate_end']) . =
"','DD.MM.YYYY')>=3Dcoalesce(sg_date,jr_date) ";
 		}
-		if (isset($p_array['wamount_start']) && $p_array['wamount_start'] !=3D=
 '' && isNumber($p_array['wamount_start']) =3D=3D 1)
+		if (isset($p_array['wamount_start']) && $p_array['wamount_start'] !=3D=
 '' && isNumber($p_array['wamount_start']) =3D=3D 1
+				 && $p_array['wamount_start'] !=3D 0 )
 		{
 			$clause.=3D$and . " j_montant >=3D " . sql_string($p_array['wamount_s=
tart']);
 		}
@@ -214,7 +215,7 @@
 		}
 		if (isset($p_array['wcode_stock']) && $p_array['wcode_stock'] !=3D "")
 		{
-			$clause.=3D$and . " upper(sg_code) =3D  upper('" . sql_string($p_arra=
y['wcode_stock']) . "')";
+			$clause.=3D$and . " upper(sg_code) =3D  upper('" . sql_string(trim($p=
_array['wcode_stock'])) . "')";
 		}
 		if (isset($p_array['wrepo']) && $p_array['wrepo'] !=3D -1)
 		{
@@ -224,6 +225,7 @@
 		{
 			$clause.=3D$and . " sg.sg_type =3D '" . sql_string($p_array['wdirecti=
on']) . "'";
 		}
+
 		return $sql . $clause;
 	}
=20
@@ -264,39 +266,7 @@
 		// get all readable repository
 		$a_repository =3D $g_user->get_available_repository('R');
=20
-		// All the stock card
-		$sql_repo_detail =3D "
-			insert into tmp_stockgood_detail(s_id,sg_code,s_qin,s_qout,r_id)
=20
-		with fiche_stock as (select distinct ad_value from fiche_detail where =
ad_id=3D19 and coalesce(ad_value,'') !=3D '') ,
-				stock_in as (select coalesce(sum(sg_quantity),0) as qin,r_id,sg_code=
 from stock_goods where sg_type=3D'c'
-				and (
-					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D to_date($2,'DD.MM.YYYY'))
-					or sg_tech_date <=3D to_date($2,'DD.MM.YYYY'))
-				)
-				group by r_id,sg_code) ,
-				stock_out as	(select coalesce(sum(sg_quantity),0) as qout ,r_id,sg_c=
ode from stock_goods
-				where sg_type=3D'd'
-				and (
-					(j_id is not null and j_id in (select j_id from jrnx where  j_date =
<=3D to_date($2,'DD.MM.YYYY'))
-					or sg_tech_date <=3D to_date($2,'DD.MM.YYYY'))
-				)
-				group by r_id,sg_code)
-				select distinct
-					$tmp_id,
-					coalesce(si.sg_code,so.sg_code),
-					coalesce(qin,0) as qin,
-					coalesce(qout,0) as qout,
-					sg.r_id
-					from
-					stock_goods as sg
-					left join stock_in as si on ( sg.r_id=3Dsi.r_id)
-					full join stock_out as so on (si.sg_code=3Dso.sg_code and sg.r_id=3D=
so.r_id)
-				where
-				(si.sg_code is not null or so.sg_code is not null)
-				 and sg.r_id  in (select r_id from profile_sec_repository where p_id=
=3D$1)
-
-			";
 		$end_date =3D $cn->get_value("select to_char(max(p_end),'DD.MM.YYYY') =
from parm_periode");
 		if (isset($p_array['state_exercice']))
 		{
@@ -305,8 +275,61 @@
 				$end_date =3D $p_array['state_exercice'];
 			}
 		}
+		// From ACH : IN
+		$sql_repo_detail =3D "
+			insert into tmp_stockgood_detail(s_id,sg_code,s_qin,r_id,f_id)
+				select $tmp_id,trim(sg_code), coalesce(sum(sg_quantity),0) as qin,r_=
id,f_id
+				from stock_goods
+				where
+					sg_type=3D'd'
+					and j_id is not null
+					and j_id in (select j_id from jrnx where  j_date <=3D to_date($2,'D=
D.MM.YYYY'))
+					and r_id  in (select r_id from profile_sec_repository where p_id=3D=
$1)
+					group by r_id,trim(sg_code),f_id
+			";
+
+		// From VEN : out
 		$cn->exec_sql($sql_repo_detail, array($g_user->get_profile(), $end_dat=
e));
+		$sql_repo_detail =3D "
+				insert into tmp_stockgood_detail(s_id,sg_code,s_qout,r_id,f_id)
+				select $tmp_id,trim(sg_code) , coalesce(sum(sg_quantity),0) as qout,=
r_id,f_id
+				from stock_goods as sg
+				where
+					sg_type=3D'c'
+					and sg.j_id is not null
+					and sg.j_id in (select j_id from jrnx where  j_date <=3D to_date($2=
,'DD.MM.YYYY'))
+					and sg.r_id  in (select r_id from profile_sec_repository where p_id=
=3D$1)
+					group by r_id,trim(sg_code),f_id
+			";
+		$cn->exec_sql($sql_repo_detail, array($g_user->get_profile(), $end_dat=
e));
=20
+		// From INV  IN
+		$sql_repo_detail =3D "
+			insert into tmp_stockgood_detail(s_id,sg_code,s_qin,r_id,f_id)
+				select $tmp_id,trim(sg_code) , coalesce(sum(sg_quantity),0) as qin,r=
_id,f_id
+				from stock_goods as sg
+				where
+					sg_type=3D'd'
+					and j_id is null
+					and sg_tech_date <=3D to_date($2,'DD.MM.YYYY')
+					 and sg.r_id  in (select r_id from profile_sec_repository where p_i=
d=3D$1)
+					group by r_id,trim(sg_code),f_id
+			";
+
+		// From INV: OUT
+		$cn->exec_sql($sql_repo_detail, array($g_user->get_profile(), $end_dat=
e));
+		$sql_repo_detail =3D "
+				insert into tmp_stockgood_detail(s_id,sg_code,s_qout,r_id,f_id)
+				select $tmp_id,trim(sg_code), coalesce(sum(sg_quantity),0) as qout,r=
_id,f_id
+				from stock_goods
+				where
+					sg_type=3D'c'
+					and j_id is null
+					 and r_id  in (select r_id from profile_sec_repository where p_id=3D=
$1)
+					and sg_tech_date  <=3D to_date($2,'DD.MM.YYYY')
+					group by r_id,trim(sg_code),f_id
+			";
+		$cn->exec_sql($sql_repo_detail, array($g_user->get_profile(), $end_dat=
e));
 		return $tmp_id;
 	}
=20

Modified: phpcompta/trunk/include/template/stock_histo.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_histo.php	2012-06-28 22:53:29 =
UTC (rev 5030)
+++ phpcompta/trunk/include/template/stock_histo.php	2012-06-28 22:54:49 =
UTC (rev 5031)
@@ -59,10 +59,14 @@
 			<?=3D$row['r_name']?>
 		</td>
 		<td>
+			<? if (trim($row['qcode'])!=3D'') : ?>
 			<?=3DHtmlInput::card_detail($row['qcode'],$row['fname'],' class=3D"li=
ne" ')?>
+			<? endif; ?>
 		</td>
 		<td>
+			<? if (trim($row['jr_internal'])!=3D'') : ?>
 			<?=3DHtmlInput::detail_op($row['jr_id'],$row['jr_internal'])?>
+			<? endif; ?>
 		</td>
 		<td>
 			<?=3D$row['ccomment']?>

Modified: phpcompta/trunk/include/template/stock_summary_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary_list.php	2012-06-28 22=
:53:29 UTC (rev 5030)
+++ phpcompta/trunk/include/template/stock_summary_list.php	2012-06-28 22=
:54:49 UTC (rev 5031)
@@ -64,12 +64,14 @@
 						from vw_fiche_attr
 						where
 					 f_id in (
-						select distinct f_id from fiche_detail
+							select distinct f_id
+							from 				tmp_stockgood_detail
 							where
-							ad_id=3D19 and
-							ad_value=3D$1)
+							r_id=3D$1
+							and s_id=3D$2
+							and sg_code=3D$3)
 						order by vw_name,quick_code
-					",array($a_stock[$s]['sg_code']));
+					",array($a_repo[$r]['r_id'],$tmp_id,$a_stock[$s]['sg_code']));
 	?>
 	<tr>
 		<td>
@@ -82,7 +84,7 @@
 					echo $sep.HtmlInput::card_detail($a_card[$c]['quick_code'], $a_card=
[$c]['vw_name'], ' class=3D"line" ');
 					$sep=3D"  ,";
 				endfor;
-				if ( count($a_card)=3D=3D 0 ) echo '<span class=3D"notice"> Erreur C=
ode non utilis=C3=A9 </span>';
+				if ( count($a_card)=3D=3D 0 ) echo '<span class=3D"notice">Changemen=
t manuel</span>';
 			?>
 		</td>
 		<td class=3D"num">

Modified: phpcompta/trunk/include/template/stock_summary_table.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_summary_table.php	2012-06-28 2=
2:53:29 UTC (rev 5030)
+++ phpcompta/trunk/include/template/stock_summary_table.php	2012-06-28 2=
2:54:49 UTC (rev 5031)
@@ -54,7 +54,9 @@
 			$n_in=3D0;$n_out=3D0;
 			for ($e =3D 0; $e < count($a_repository); $e++):
=20
-				$array =3D $cn->get_array("select * from tmp_stockgood_detail where =
r_id=3D$1 and sg_code=3D$2 and s_id=3D$3"
+				$array =3D $cn->get_array("select coalesce(sum(s_qin)) as s_qin,coal=
esce(sum(s_qout)) as s_qout
+											from tmp_stockgood_detail
+										 where r_id=3D$1 and sg_code=3D$2 and s_id=3D$3"
 						, array($a_repository[$e]['r_id'], $a_code[$x]['sg_code'],$tmp_id)=
);
 				?>
 			<td>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 19:04:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkNli-0004KH-N4
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 19:04:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 00:55:19 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.240315.1340924697.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5032 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 23:04:57 -0000

Author: danydb
Date: 2012-06-29 00:55:19 +0200 (Fri, 29 Jun 2012)
New Revision: 5032

Modified:
   phpcompta/trunk/include/class_stock_goods.php
Log:
sauve date + montant en absolu

Modified: phpcompta/trunk/include/class_stock_goods.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods.php	2012-06-28 22:54:49 UTC=
 (rev 5031)
+++ phpcompta/trunk/include/class_stock_goods.php	2012-06-28 22:55:19 UTC=
 (rev 5032)
@@ -103,13 +103,14 @@
 						trim($p_array['sg_code' . $i]) !=3D '')
 				{
 					$a->sg_code =3D $p_array['sg_code' . $i];
-					$a->sg_quantity =3D $p_array['sg_quantity' . $i];
+					$a->sg_quantity =3D abs($p_array['sg_quantity' . $i]);
 					$a->sg_type =3D ($p_array['sg_quantity' . $i] > 0) ? 'd' : 'c';
 					$a->sg_comment =3D $p_array['p_motif'];
 					$a->tech_user =3D $_SESSION['g_user'];
 					$a->r_id =3D $p_array['p_depot'];
 					$a->sg_exercice =3D $exercice;
 					$a->c_id =3D $ch->c_id;
+					$a->sg_date=3D$p_array['p_date'];
 					$a->insert();
 				}
 			}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 19:05:22 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkNm6-0004Pf-RX
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 19:05:22 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 00:55:44 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.240316.1340924721.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5033 - phpcompta/trunk/html/admin/sql/patch
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 23:05:21 -0000

Author: danydb
Date: 2012-06-29 00:55:44 +0200 (Fri, 29 Jun 2012)
New Revision: 5033

Modified:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
Log:
Change table tmp_stockgoods_detail ajout col. f_id

Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-28 22:55:=
19 UTC (rev 5032)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql	2012-06-28 22:55:=
44 UTC (rev 5033)
@@ -346,7 +346,7 @@
=20
 create table tmp_stockgood (s_id bigserial primary key,s_date timestamp =
default now());
 create table tmp_stockgood_detail(d_id bigserial primary key,s_id bigint=
 references tmp_stockgood(s_id) on delete cascade,
-sg_code text,s_qin numeric(20,4),s_qout numeric(20,4),r_id bigint);
+sg_code text,s_qin numeric(20,4),s_qout numeric(20,4),r_id bigint,f_id b=
igint);
=20
=20
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Thu Jun 28 19:05:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkNmS-0004QZ-VK
	for mharc-phpcompta-dev@gnu.org; Thu, 28 Jun 2012 19:05:44 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 00:56:05 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.240317.1340924743.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5034 - phpcompta/trunk/include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Jun 2012 23:05:43 -0000

Author: danydb
Date: 2012-06-29 00:56:05 +0200 (Fri, 29 Jun 2012)
New Revision: 5034

Modified:
   phpcompta/trunk/include/template/fiche_def_list.php
Log:
Cosmetic : couleur ligne impaire

Modified: phpcompta/trunk/include/template/fiche_def_list.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/fiche_def_list.php	2012-06-28 22:55:=
44 UTC (rev 5033)
+++ phpcompta/trunk/include/template/fiche_def_list.php	2012-06-28 22:56:=
05 UTC (rev 5034)
@@ -47,9 +47,10 @@
 <?
 $dossier=3DDossier::id();
 for ($i=3D0;$i<$max;$i++):
+	$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
 	$row=3DDatabase::fetch_array($res, $i);
 ?>
-	<tr>
+	<tr <?=3D$class?> >
 		<td>
 		<?=3DHtmlInput::anchor(h($row['fd_label']), "javascript:void(0)", "onc=
lick=3D\"detail_category_show('detail_category_div','".$dossier."','".$ro=
w['fd_id']."')\"")?>
 		</td>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 09:41:26 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkbRu-0004bx-73
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 09:41:26 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 15:31:35 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.241641.1340977285.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5035 - phpcompta/trunk/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 13:41:25 -0000

Author: danydb
Date: 2012-06-29 15:31:34 +0200 (Fri, 29 Jun 2012)
New Revision: 5035

Modified:
   phpcompta/trunk/doc/manuel-fr.odt
Log:
Mise ?\195?\160 jour manuel

Modified: phpcompta/trunk/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 09:43:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkbUJ-0004va-OC
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 09:43:55 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 15:34:07 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.241644.1340977435.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5036 - phpcompta/trunk/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 13:43:55 -0000

Author: danydb
Date: 2012-06-29 15:34:06 +0200 (Fri, 29 Jun 2012)
New Revision: 5036

Modified:
   phpcompta/trunk/doc/manuel-fr.odt
Log:
Mise ?\195?\160 jour manuel


Modified: phpcompta/trunk/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 09:56:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skbga-00088R-0E
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 09:56:36 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 15:46:41 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.241660.1340978195.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5037 - phpcompta/trunk/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 13:56:35 -0000

Author: danydb
Date: 2012-06-29 15:46:40 +0200 (Fri, 29 Jun 2012)
New Revision: 5037

Modified:
   phpcompta/trunk/doc/manuel-fr.odt
Log:
Mise ?\195?\160 jour manuel


Modified: phpcompta/trunk/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 16:03:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkhPd-00009v-3t
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 16:03:29 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 21:53:43 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243236.1341000208.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5038 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 20:03:27 -0000

Author: danydb
Date: 2012-06-29 21:53:42 +0200 (Fri, 29 Jun 2012)
New Revision: 5038

Removed:
   phpcompta/trunk/include/class_ibox_deprecated.php
Modified:
   phpcompta/trunk/include/constant.php
Log:
Remove obsolete file + debug

Deleted: phpcompta/trunk/include/class_ibox_deprecated.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_ibox_deprecated.php	2012-06-29 13:46:40=
 UTC (rev 5037)
+++ phpcompta/trunk/include/class_ibox_deprecated.php	2012-06-29 19:53:42=
 UTC (rev 5038)
@@ -1,140 +0,0 @@
-<?php
-/*
- *   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 b=
y
- *   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-130=
7  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-
-/*!\file
- * \brief create a popup in html above the current layer
- * the html inside the popup cannot contain any floating elt as div..
- *
- */
-require_once('function_javascript.php');
-require_once('class_html_input.php');
-/**
- *@brief create a DIV and call an ajax function
-\verbatim
-=20
-exemple d'utilisation
-=20
-$ibox=3Dnew ibox('id')
-$ibox->html=3D'loading';
-$ibox->callback=3D'ajax.php'; // uniquement fichier PHP (1)
-$ibox->queryString=3D'?gDossier=3D15&id=3D5';
-$ibox->style=3D'style_css',
-$ibox->cssclass=3D'width:80%';
-$ibox->label=3D'Cliquez moi';
-$ibox->onclick=3D'add_div'; // if you click  the function must take only=
 one parameter : an object
-$ibox->ajax_success=3D'autre'; // fonction qui affiche traite le callbac=
k, par d=C3=A9fault, il s'agit de la fonction refresh_box qui afficher se=
ulement  le contenu dans le div
-$ibox->ajax_error=3D'ajax_error' // fonction pour traiter les erreurs aj=
ax
-\endverbatim
-*/
-
-class IBox extends HtmlInput
-{
-    var $name;			/*!< name name and id of the div */
-    function __construct($p_name,$label)
-    {
-        $this->name=3D$p_name;
-        $this->parameter=3D'';
-        $this->attribute=3Darray();
-        $this->drag=3Dfalse;
-        $this->blocking=3Dtrue;
-        $this->queryString=3D'';
-        $this->html=3D'Un instant...<img src=3D"image/loading.gif">';
-        $this->callback=3D'';
-        $this->label=3D$label;
-        $this->handle_callback=3D'refresh_box';
-        $this->cssclass=3D'';
-        $this->style=3D'';
-        $this->ajax_success=3D'success_box';
-        $this->ajax_error=3D'error_box';
-        $this->onclick=3D'show_box';
-
-    }
-    /*!\brief set the attribute thanks javascript as the width, the posi=
tion ...
-     *\param $p_name attribute name valid value are id, cssclass and htm=
l
-     *\param $p_val val of the attribute
-     *\note add to  the this->attribut, it will be used in input()
-     */
-    /*  function set_attribute($p_name,$p_val) {
-      $this->attribute[]=3Darray($p_name,$p_val);
-      }*/
-    function set_dragguable($p_value)
-    {
-        $this->drag=3D$p_value;
-    }
-
-    function input()
-    {
-        $r=3D"";
-        $this->set_attribute('id',$this->name);
-        $this->set_attribute('html',$this->html);
-        $this->set_attribute('cssclass',$this->cssclass);
-        $this->set_attribute('style',$this->style);
-        $this->set_attribute('js_success',$this->ajax_success);
-        $this->set_attribute('js_error',$this->ajax_error);
-        $this->set_attribute('qs',$this->queryString);
-        $this->set_attribute('callback',$this->callback);
-        $this->set_attribute('drag',$this->drag);
-        $obj=3D$this->make_object();
-        $obj=3Dstr_replace('"',"&quot;",$obj);
-        $r=3D'<a class=3D"button" style=3D"display:inline" href=3D"javas=
cript:void(0)" onclick=3D"'.$this->onclick.'('.$obj.')">'.$this->label.'<=
/a>';
-
-        return $r;
-    }
-
-    static function test_me()
-    {
-        require_once('class_idate.php');
-        echo js_include('prototype.js');
-        echo js_include('scriptaculous.js');
-        echo js_include('effects.js');
-        echo js_include('dragdrop.js');
-        echo js_include('scripts.js');
-
-        // Simple box no ajax
-        $simple=3Dnew IBox('alert1','click-moi');
-        $simple->html=3D"Attention !!!";
-        $simple->style=3D"background:red;border:1px solid rose;width:200=
;height:50px;";
-        $simple->drag=3Dfalse;
-        echo $simple->input();
-
-        // Dragguable
-        echo '<div id=3D"drag_content"></div>';
-        $drag=3Dnew IBox('drag','drag');
-        $drag->cssclass=3D"popup_border_title";
-        $drag->html=3D" Drag me ";
-        $drag->drag=3Dtrue;
-        echo $drag->input();
-        // with ajax
-        $ajax=3Dnew IBox('ajax','ajax');
-        $ajax->cssclass=3D"popup_content";
-        $ajax->style=3D"width:1;left:1";
-        $ajax->queryString=3D"?gDossier=3D48&op=3Dsf&c=3Dav_text5&q=3D58=
&ctl=3Ddrag";
-        $ajax->callback=3D"ajax_poste.php";
-        echo $ajax->input();
-        $reverse=3Dnew IBox('Extourne','Extourne');
-        $reverse->set_attribute('drag',1);
-        $reverse->style=3D"padding:20;height:300;width:250;position:abso=
lute;background:red;display:none";
-
-        echo $reverse->input();
-        var_dump($reverse);
-    }
-}

Modified: phpcompta/trunk/include/constant.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/constant.php	2012-06-29 13:46:40 UTC (rev 503=
7)
+++ phpcompta/trunk/include/constant.php	2012-06-29 19:53:42 UTC (rev 503=
8)
@@ -27,19 +27,20 @@
 require_once('constant.security.php');
 // SVNVERSION
 global $version_phpcompta;
-define ('SVNINFO',5015);
=20
+
 global $g_captcha,$g_failed,$g_succeed;
 $g_captcha=3Dfalse;
 $g_failed=3D"<span style=3D\"font-size:18px;color:red\">&#x2716;</span>"=
;
 $g_succeed=3D"<span style=3D\"font-size:18px;color:green\">&#x2713;</spa=
n>";
 /*set to none for production */
 /* uncomment for production */
-//$version_phpcompta=3DSVNINFO;
-//define ("DEBUG",true);
 $version_phpcompta=3DSVNINFO;
-define ("DEBUG",true);
-
+define ("DEBUG",false);
+/* define ('SVNINFO',5015);
+ * $version_phpcompta=3DSVNINFO;
+ * define ("DEBUG",true);
+*/
 // If you don't want to be notified of the update
 // define ("SITE_UPDATE",'');
 define ("SITE_UPDATE",'http://www.phpcompta.eu/last_version.txt');



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 16:35:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skhug-00053P-VU
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 16:35:34 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 22:25:51 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243277.1341002134.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5039 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 20:35:33 -0000

Author: danydb
Date: 2012-06-29 22:25:50 +0200 (Fri, 29 Jun 2012)
New Revision: 5039

Modified:
   phpcompta/trunk/include/ajax_view_mod_stock.php
   phpcompta/trunk/include/class_stock_goods.php
   phpcompta/trunk/include/template/stock_inv.php
Log:
Add detail to stock

Modified: phpcompta/trunk/include/ajax_view_mod_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-29 19:53:42 U=
TC (rev 5038)
+++ phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-29 20:25:50 U=
TC (rev 5039)
@@ -39,6 +39,7 @@
 {
 	$p_array['sg_code'.$i]=3D$array[$i]['sg_code'];
 	$p_array['sg_quantity'.$i]=3D$array[$i]['sg_quantity'];
+	$p_array['sg_type'.$i]=3D$array[$i]['sg_type'];
=20
 }
 echo $st->input($p_array,true);

Modified: phpcompta/trunk/include/class_stock_goods.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods.php	2012-06-29 19:53:42 UTC=
 (rev 5038)
+++ phpcompta/trunk/include/class_stock_goods.php	2012-06-29 20:25:50 UTC=
 (rev 5039)
@@ -74,6 +74,9 @@
 			}
 			$sg_code[$e]->setReadOnly($p_readonly);
 			$sg_quantity[$e]->setReadOnly($p_readonly);
+			if ( isset (${'sg_type'.$e})) {
+				$sg_type[$e]=3D(${'sg_type'.$e}=3D=3D'c')?'OUT':'IN';
+			}
 		}
 		require_once 'template/stock_inv.php';
 	}

Modified: phpcompta/trunk/include/template/stock_inv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_inv.php	2012-06-29 19:53:42 UT=
C (rev 5038)
+++ phpcompta/trunk/include/template/stock_inv.php	2012-06-29 20:25:50 UT=
C (rev 5039)
@@ -77,6 +77,11 @@
 			<?=3D$sg_quantity[$i]->input()?>
 			<? endif;?>
 		</td>
+		<TD class=3D"num"">
+			<? if (isset ($sg_type[$i])):?>
+			<?=3D$sg_type[$i]?>
+			<? endif;?>
+		</td>
 	</tr>
 <? endfor; ?>
 </table>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 17:02:24 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkiKe-0004T2-NT
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 17:02:24 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 22:52:40 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243349.1341003743.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5040 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 21:02:22 -0000

Author: danydb
Date: 2012-06-29 22:52:39 +0200 (Fri, 29 Jun 2012)
New Revision: 5040

Modified:
   phpcompta/trunk/include/ajax_view_mod_stock.php
   phpcompta/trunk/include/class_stock_goods.php
   phpcompta/trunk/include/template/stock_inv.php
Log:
Add detail to stock

Modified: phpcompta/trunk/include/ajax_view_mod_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-29 20:25:50 U=
TC (rev 5039)
+++ phpcompta/trunk/include/ajax_view_mod_stock.php	2012-06-29 20:52:39 U=
TC (rev 5040)
@@ -37,6 +37,7 @@
 $p_array['p_depot']=3D$cn->get_value("select r_id from stock_change wher=
e c_id=3D$1",array($_GET['c_id']));
 for ($i=3D0;$i<count($array);$i++)
 {
+	$p_array['f_id'.$i]=3D$array[$i]['f_id'];
 	$p_array['sg_code'.$i]=3D$array[$i]['sg_code'];
 	$p_array['sg_quantity'.$i]=3D$array[$i]['sg_quantity'];
 	$p_array['sg_type'.$i]=3D$array[$i]['sg_type'];

Modified: phpcompta/trunk/include/class_stock_goods.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock_goods.php	2012-06-29 20:25:50 UTC=
 (rev 5039)
+++ phpcompta/trunk/include/class_stock_goods.php	2012-06-29 20:52:39 UTC=
 (rev 5040)
@@ -30,7 +30,24 @@
=20
 class Stock_Goods extends Stock_Goods_Sql
 {
-
+/**
+ * if an array if receive the keys are
+ *  p_date
+ *  p_depot
+ *  f_idX f_id
+ *  sg_codeX
+ *  sg_type0
+ *
+ * @global $cn database connx
+ * @param $p_array
+ * if an array if receive the keys are
+ *  p_date
+ *  p_depot
+ *  f_idX f_id
+ *  sg_codeX
+ *  sg_type0
+ * @param $p_readonly true or false
+ */
 	function input($p_array =3D null, $p_readonly =3D false)
 	{
 		global $cn;
@@ -59,9 +76,9 @@
 		}
 		$idepo->selected =3D $p_depot;
 		for ($e =3D 0; $e < MAX_ARTICLE; $e++)
-		{
+		{//ATTR_DEF_STOCKfiche_
 			$sg_code[$e] =3D new ICard('sg_code' . $e);
-			$sg_code[$e]->extra =3D '[sql] fd_id =3D 500000';
+			$sg_code[$e]->extra =3D "[sql]  f_id in (select distinct f_id from fi=
che_Detail where ad_id=3D19 and coalesce(ad_value,\'\') <> \'\')";
 			$sg_code[$e]->set_attribute("typecard", $sg_code[$e]->extra);
 			$sg_code[$e]->set_attribute("label", "label" . $e);
 			$sg_code[$e]->value =3D (isset(${'sg_code' . $e})) ? ${'sg_code' . $e=
} : '';
@@ -77,6 +94,9 @@
 			if ( isset (${'sg_type'.$e})) {
 				$sg_type[$e]=3D(${'sg_type'.$e}=3D=3D'c')?'OUT':'IN';
 			}
+			if ( isset (${'f_id'.$e})) {
+				$fiche[$e]=3Dnew Fiche($this->cn,${'f_id'.$e});
+			}
 		}
 		require_once 'template/stock_inv.php';
 	}
@@ -105,7 +125,11 @@
 				if ($p_array['sg_quantity' . $i] !=3D 0 &&
 						trim($p_array['sg_code' . $i]) !=3D '')
 				{
-					$a->sg_code =3D $p_array['sg_code' . $i];
+					$fiche=3Dnew Fiche($cn);
+					$fiche->get_by_qcode($p_array['sg_code' . $i]);
+					$stock=3D$fiche->strAttribut(ATTR_DEF_STOCK);
+					$a->f_id=3D$fiche->id;
+					$a->sg_code =3D $stock;
 					$a->sg_quantity =3D abs($p_array['sg_quantity' . $i]);
 					$a->sg_type =3D ($p_array['sg_quantity' . $i] > 0) ? 'd' : 'c';
 					$a->sg_comment =3D $p_array['p_motif'];

Modified: phpcompta/trunk/include/template/stock_inv.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/stock_inv.php	2012-06-29 20:25:50 UT=
C (rev 5039)
+++ phpcompta/trunk/include/template/stock_inv.php	2012-06-29 20:52:39 UT=
C (rev 5040)
@@ -56,9 +56,14 @@
 </table>
 <table style=3D"width: 80%">
 	<tr>
-		<th >
+		<th style=3D"text-align: left">
 			Code Stock
 		</th>
+<? if ( $p_readonly =3D=3D true ) :?>
+		<th style=3D"text-align: left">
+			Fiche
+		</th>
+<? endif;?>
 		<th style=3D"text-align:right">
 			Quantit=C3=A9
 		</th>
@@ -66,10 +71,20 @@
 <? for($i=3D0;$i<MAX_ARTICLE;$i++): ?>
 	<tr>
 		<td>
+<? if ( $p_readonly =3D=3D false) : ?>
 			<?=3D$sg_code[$i]->input()?>
 			<?=3D$sg_code[$i]->search()?>
 			<?=3D$label[$i]->input()?>
+<? else: ?>
+			<? if ( trim($sg_code[$i]->value) !=3D "")  echo HtmlInput::card_deta=
il($sg_code[$i]->value,h($sg_code[$i]->value),' class=3D"line"')?>
+<? endif ?>
+
 		</td>
+<? if ( $p_readonly =3D=3D true && isset ($fiche[$i])) :?>
+		<td>
+			<?=3DHtmlInput::card_detail($fiche[$i]->get_quick_code(),h($fiche[$i]=
->getName()),' class=3D"line"');?>
+		</td>
+<? endif;?>
 		<TD class=3D"num"">
 			<? if ($sg_quantity[$i]->value=3D=3D0 && $p_readonly=3D=3Dtrue):?>
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 17:49:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skj4H-0004vL-U6
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 17:49:33 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 23:39:51 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243385.1341006573.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5041 - phpcompta/trunk/html
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 21:49:33 -0000

Author: danydb
Date: 2012-06-29 23:39:50 +0200 (Fri, 29 Jun 2012)
New Revision: 5041

Modified:
   phpcompta/trunk/html/index.php
Log:
update version

Modified: phpcompta/trunk/html/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/index.php	2012-06-29 20:52:39 UTC (rev 5040)
+++ phpcompta/trunk/html/index.php	2012-06-29 21:39:50 UTC (rev 5041)
@@ -187,7 +187,7 @@
=20
 echo '
 <span style=3D"background-color:#879ed4;color:white;padding-left:4px;pad=
ding-right:4px;">
-version  6.0.SVNINFO - '.$my_domain.'
+version  6.5.SVNINFO - '.$my_domain.'
 </span>
 <BR>
 <BR>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:08:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkjN4-0006B6-Hz
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:08:58 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Fri, 29 Jun 2012 23:59:12 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243396.1341007737.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5042 - phpcompta/trunk/html/admin
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:08:57 -0000

Author: danydb
Date: 2012-06-29 23:59:12 +0200 (Fri, 29 Jun 2012)
New Revision: 5042

Modified:
   phpcompta/trunk/html/admin/setup.php
Log:
New false paramater : register_globals

Modified: phpcompta/trunk/html/admin/setup.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/admin/setup.php	2012-06-29 21:39:50 UTC (rev 504=
1)
+++ phpcompta/trunk/html/admin/setup.php	2012-06-29 21:59:12 UTC (rev 504=
2)
@@ -141,6 +141,7 @@
 	       "php_value max_execution_time 240",
 	       "php_value memory_limit 20M",
 	       "AddDefaultCharset utf-8",
+		   "php_flag  register_globals off",
 	       "php_value error_reporting 10239",
 	       "php_value post_max_size 20M",
 	       "php_flag short_open_tag on",
@@ -191,7 +192,7 @@
   echo '</form>';
   exit();
 }
-=20
+
 //----------------------------------------------------------------------
 // End functions
 //
@@ -279,6 +280,13 @@
         echo "</li>";
 	$flag_php++;
 }
+if ( ini_get("register_globals") =3D=3D true)  {
+        echo "<li>";
+        echo 'Avertissement : '.$failed;
+	print '<span class=3D"warning"> register_globals doit =C3=AAtre =C3=A0 =
off</span>';
+        echo "</li>";
+	$flag_php++;
+}
=20
 if ( ini_get("session.use_trans_sid") =3D=3D false )  {
         echo "<li>";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:20:11 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkjXu-00074B-WB
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:20:10 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:10:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243411.1341008410.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5043 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:20:09 -0000

Author: danydb
Date: 2012-06-30 00:10:28 +0200 (Sat, 30 Jun 2012)
New Revision: 5043

Modified:
   phpcompta/trunk/include/class_stock.php
Log:
bug stock : date malformed

Modified: phpcompta/trunk/include/class_stock.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_stock.php	2012-06-29 21:59:12 UTC (rev =
5042)
+++ phpcompta/trunk/include/class_stock.php	2012-06-29 22:10:28 UTC (rev =
5043)
@@ -270,9 +270,10 @@
 		$end_date =3D $cn->get_value("select to_char(max(p_end),'DD.MM.YYYY') =
from parm_periode");
 		if (isset($p_array['state_exercice']))
 		{
-			if (isDate($p_array['state_exercice']) =3D=3D $p_array['state_exercic=
e'])
+			$tmp_date=3D  format_date($p_array['state_exercice'],'YYYY-MM-DD','DD=
.MM.YYYY');
+			if (isDate($tmp_date) =3D=3D $tmp_date)
 			{
-				$end_date =3D $p_array['state_exercice'];
+				$end_date =3D $tmp_date;
 			}
 		}
 		// From ACH : IN



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:35:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skjmb-000111-Sk
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:35:21 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:25:36 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243429.1341009321.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5045 - phpcompta/tags
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:35:20 -0000

Author: danydb
Date: 2012-06-30 00:25:36 +0200 (Sat, 30 Jun 2012)
New Revision: 5045

Added:
   phpcompta/tags/rel650/
Log:
New release version 6.5


Copied: phpcompta/tags/rel650 (from rev 5044, phpcompta/trunk)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:38:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkjpQ-00017u-P9
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:38:16 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:28:34 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243430.1341009495.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5046 - phpcompta/trunk
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:38:15 -0000

Author: danydb
Date: 2012-06-30 00:28:34 +0200 (Sat, 30 Jun 2012)
New Revision: 5046

Modified:
   phpcompta/trunk/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-5045" from=20
svn+ssh://danydb@ns352270.ovh.net/svn/phpcompta/tags/rel650



Property changes on: phpcompta/trunk
___________________________________________________________________
Name: svnmerge-integrated
   + /phpcompta/tags/rel650:1-5045



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:40:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skjrq-0001K3-Cu
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:40:46 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:31:03 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243433.1341009645.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r384 - trunk
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:40:44 -0000

Author: danydb
Date: 2012-06-30 00:31:02 +0200 (Sat, 30 Jun 2012)
New Revision: 384

Modified:
   trunk/
Log:
Removed merge tracking for "svnmerge" for=20
svn+ssh://danydb@ns352270.ovh.net/svn_extension/tag/rel605



Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /tag/rel605:1-365



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:41:10 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkjsE-0001WD-Ls
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:41:10 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:31:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243434.1341009670.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r385 - tag
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:41:09 -0000

Author: danydb
Date: 2012-06-30 00:31:28 +0200 (Sat, 30 Jun 2012)
New Revision: 385

Added:
   tag/rel650/
Log:
create new version


Copied: tag/rel650 (from rev 384, trunk)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:42:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkjtA-0001cA-S0
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:42:08 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:32:26 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243447.1341009728.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r386 - trunk
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:42:07 -0000

Author: danydb
Date: 2012-06-30 00:32:26 +0200 (Sat, 30 Jun 2012)
New Revision: 386

Modified:
   trunk/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-385" from=20
svn+ssh://danydb@ns352270.ovh.net/svn_extension/tag/rel650



Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
   + /tag/rel650:1-385



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:43:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skjui-0001f1-Ii
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:43:44 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:24:42 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243452.1341009823.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5044 - phpcompta/trunk
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:43:43 -0000

Author: danydb
Date: 2012-06-30 00:24:42 +0200 (Sat, 30 Jun 2012)
New Revision: 5044

Modified:
   phpcompta/trunk/
Log:
Removed merge tracking for "svnmerge" for=20
svn+ssh://ns352270.ovh.net/svn/phpcompta/tags/rel601



Property changes on: phpcompta/trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /phpcompta/tags/rel601:1-4835



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Fri Jun 29 18:58:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skk8j-0002o6-7h
	for mharc-phpcompta-dev@gnu.org; Fri, 29 Jun 2012 18:58:13 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 00:47:46 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.243489.1341010692.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5047 - phpcompta/tags/rel650/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2012 22:58:12 -0000

Author: danydb
Date: 2012-06-30 00:47:45 +0200 (Sat, 30 Jun 2012)
New Revision: 5047

Modified:
   phpcompta/tags/rel650/doc/manuel-fr.pdf
Log:
Update doc PDF

Modified: phpcompta/tags/rel650/doc/manuel-fr.pdf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 00:19:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skp9O-00034j-HY
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 00:19:14 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 06:09:29 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244139.1341029953.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5048 - in phpcompta/trunk/html: . js
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 04:19:13 -0000

Author: danydb
Date: 2012-06-30 06:09:28 +0200 (Sat, 30 Jun 2012)
New Revision: 5048

Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
Log:
Cosmetic : select tva=20

Modified: phpcompta/trunk/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/ajax_misc.php	2012-06-29 22:47:45 UTC (rev 5047)
+++ phpcompta/trunk/html/ajax_misc.php	2012-06-30 04:09:28 UTC (rev 5048)
@@ -185,7 +185,7 @@
 		$r =3D HtmlInput::anchor_close('tva_select');
 		$r.=3Dh2info('Choississez la TVA ');
 		$r.=3D'<div >';
-		$r.=3D '<TABLE style=3D"padding-left:10%;padding-right:10%;width:80%">=
';
+		$r.=3D '<TABLE style=3D"width:100%">';
 		$r.=3Dth('');
 		$r.=3Dth(_('code'));
 		$r.=3Dth(_('Taux'));
@@ -218,7 +218,8 @@
 				}
 			}
 			$set =3D '<INPUT TYPE=3D"BUTTON" class=3D"button" Value=3D"select" ' =
. $script . '>';
-			$r.=3D'<tr>';
+			$class=3D($i%2 =3D=3D 0)?' class=3D"odd" ':' class=3D"even" ';
+			$r.=3D'<tr'.$class. '>';
 			$r.=3Dtd($set);
 			$r.=3Dtd($row['tva_id']);
 			$r.=3Dtd($row['tva_rate']);

Modified: phpcompta/trunk/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/html/js/scripts.js	2012-06-29 22:47:45 UTC (rev 5047)
+++ phpcompta/trunk/html/js/scripts.js	2012-06-30 04:09:28 UTC (rev 5048)
@@ -473,7 +473,7 @@
=20
 	var nTop=3DposY-50;
 	var nLeft=3D"35%";
-	var str_style=3D"top:"+nTop+";left:"+nLeft+";width:50em;height:auto";
+	var str_style=3D"top:"+nTop+";left:"+nLeft+";width:55em;height:auto";
=20
 	var popup=3D{'id': 'tva_select','cssclass':'inner_box','style':str_styl=
e,'html':loading(),'drag':true};
 	add_div(popup);



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 00:41:10 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkpUa-0004VY-AI
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 00:41:08 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 06:31:22 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244154.1341031267.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5049 - in phpcompta/trunk/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 04:41:07 -0000

Author: danydb
Date: 2012-06-30 06:31:21 +0200 (Sat, 30 Jun 2012)
New Revision: 5049

Modified:
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/dashboard.inc.php
   phpcompta/trunk/include/template/dashboard.php
Log:
Cosmetic: ajout action - retard

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-30 04:09:28 UTC (=
rev 5048)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-30 04:31:21 UTC (=
rev 5049)
@@ -823,7 +823,7 @@
 	 */
 	function Update()
 	{
-           =20
+
 		// if ag_id =3D=3D 0 nothing to do
 		if ($this->ag_id =3D=3D 0)
 			return;
@@ -1021,11 +1021,24 @@
 	{
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
 				" from action_gestion join document_type " .
-				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state in (2,3)
+				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in (1,4)
 				and to_char(ag_remind_date,'DDMMYYYY')=3Dto_char(now(),'DDMMYYYY') "=
;
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}
+	       /**
+         * get the action where the remind day is today
+         * @return array
+         */
+	function get_late()
+	{
+		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
+				" from action_gestion join document_type " .
+				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in  (1,4)
+				and to_char(ag_remind_date,'DDMMYYYY')<=3Dto_char(now(),'DDMMYYYY') =
";
+		$array =3D $this->db->get_array($sql);
+		return $array;
+	}
 	/**
 	 * insert a related operation
 	 */
@@ -1152,7 +1165,7 @@
         /**
         *@brief show a list of actions
         * @param $cn database connextion
-        * @param $p_base base URL=20
+        * @param $p_base base URL
         */
 	static function show_action_list($cn, $p_base)
 	{
@@ -1185,7 +1198,7 @@
 		extract($p_array);
 		$query =3D "";
=20
-               =20
+
                 if (isset($_REQUEST['query']))
 		{
 			// if a query is request build the sql stmt

Modified: phpcompta/trunk/include/dashboard.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/dashboard.inc.php	2012-06-30 04:09:28 UTC (re=
v 5048)
+++ phpcompta/trunk/include/dashboard.inc.php	2012-06-30 04:31:21 UTC (re=
v 5049)
@@ -21,6 +21,7 @@
 $cal->get_preference();
 $Operation=3Dnew Follow_Up($cn);
 $last_operation=3D$Operation->get_today();
+$late_operation=3D$Operation->get_late();
 $Ledger=3Dnew Acc_Ledger($cn,0);
 $last_ledger=3Darray();
 $last_ledger=3D$Ledger->get_last(20);

Modified: phpcompta/trunk/include/template/dashboard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/template/dashboard.php	2012-06-30 04:09:28 UT=
C (rev 5048)
+++ phpcompta/trunk/include/template/dashboard.php	2012-06-30 04:31:21 UT=
C (rev 5049)
@@ -1,5 +1,5 @@
-<div style=3D"float:left;width:50%">
-<fieldset style=3D"width:100%">
+<div style=3D"float:left;width: 45%">
+<fieldset >
 <legend><?=3D_('Calendrier')?>
 </legend>
 <?php echo $cal->display(); ?>
@@ -24,7 +24,7 @@
 $array=3D$todo->load_all();
 ?>
=20
-<div style=3D"float:right;width:45%">
+<div style=3D"float:right;width: 45%">
 <fieldset> <legend><?=3D_('Pense-B=C3=AAte')?></legend>
=20
 <?php
@@ -57,65 +57,63 @@
 ?>
 </fieldset>
 </div>
-<div style=3D"float:right;width:45%">
-<fieldset>
-<legend><?=3D_('Action pour aujourd\'hui')?>
-</legend>
-<ol>
-<?php
-for($i=3D0;$i<count($last_operation);$i++):
-?>
-<li>
-<span>
-<?=3Dsmaller_date($last_operation[$i]['ag_timestamp_fmt'])?>
-</span>
-	<span  style=3D"font-weight: bolder ">
-		<?=3Dh($last_operation[$i]['vw_name'])?>
+<div style=3D"float:left;clear:both"></div>
+<div style=3D"float:right;width: 45%">
+<? if (count($last_operation)> 0) : ?>
+	<fieldset>
+	<legend><?=3D_('Action pour aujourd\'hui')?>
+	</legend>
+	<ol>
+	<?php
+	for($i=3D0;$i<count($last_operation);$i++):
+	?>
+	<li>
+	<span>
+	<?=3Dsmaller_date($last_operation[$i]['ag_timestamp_fmt'])?>
 	</span>
-<span>
-   <?=3Dh(mb_substr($last_operation[$i]['ag_title'],0,40,'UTF-8'))?>
-</span>
-<span style=3D"font-style: italic">
-<?=3D$last_operation[$i]['dt_value']?>
-</span>
-</li>
-<? endfor;?>
-</ol>
-</fieldset>
-</div>
+		<span  style=3D"font-weight: bolder ">
+			<?=3Dh($last_operation[$i]['vw_name'])?>
+		</span>
+	<span>
+	<?=3Dh(mb_substr($last_operation[$i]['ag_title'],0,60,'UTF-8'))?>
+	</span>
+	<span style=3D"font-style: italic">
+	<?=3D$last_operation[$i]['dt_value']?>
+	</span>
+	</li>
+	<? endfor;?>
+	</ol>
+	</fieldset>
+<? endif; ?>
=20
-<div style=3D"float:right;width:45%">
-<fieldset>
-<legend><?=3D_('Derni=C3=A8res op=C3=A9rations')?>
-</legend>
-<table style=3D"width: 100%">
-<?php
-for($i=3D0;$i<count($last_ledger);$i++):
-	$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
-?>
-<tr <?=3D$class ?>>=20
-	<td><?=3D  smaller_date($last_ledger[$i]['jr_date_fmt'])?>
-	</td>
-	<td>
-		<?=3D$last_ledger[$i]['jrn_def_code']?>
-	</td>
-<td>
-   <?=3Dh(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
-</td>
-<td>
-<?=3DHtmlInput::detail_op($last_ledger[$i]['jr_id'], $last_ledger[$i]['j=
r_internal'])?>
-</td>
-<td class=3D"num">
-<?=3Dnbm($last_ledger[$i]['jr_montant'])?>
-</td>
-
-</tr>
-<? endfor;?>
-</ul></table>
-</fieldset>
+<? if (count($late_operation)> 0) : ?>
+		<fieldset>
+	<legend><?=3D_('Action en retard ')?>
+	</legend>
+	<ol>
+	<?php
+	for($i=3D0;$i<count($late_operation);$i++):
+	?>
+	<li>
+	<span>
+	<?=3Dsmaller_date($late_operation[$i]['ag_timestamp_fmt'])?>
+	</span>
+		<span  style=3D"font-weight: bolder ">
+			<?=3Dh($late_operation[$i]['vw_name'])?>
+		</span>
+	<span>
+	<?=3Dh(mb_substr($late_operation[$i]['ag_title'],0,60,'UTF-8'))?>
+	</span>
+	<span style=3D"font-style: italic">
+	<?=3D$late_operation[$i]['dt_value']?>
+	</span>
+	</li>
+	<? endfor;?>
+	</ol>
+	</fieldset>
+<? endif; ?>
 </div>
-
-	<div style=3D"float:left;width:50%;clear:left">
+	<div style=3D"float:left;width: 45%">
 <?php
 /*
  * Mini Report
@@ -162,8 +160,40 @@
=20
 ?>
 </div>
+
+<div style=3D"float:right;width: 45%">
+<fieldset>
+<legend><?=3D_('Derni=C3=A8res op=C3=A9rations')?>
+</legend>
+<table style=3D"width: 100%">
+<?php
+for($i=3D0;$i<count($last_ledger);$i++):
+	$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
+?>
+<tr <?=3D$class ?>>
+	<td><?=3D  smaller_date($last_ledger[$i]['jr_date_fmt'])?>
+	</td>
+	<td>
+		<?=3D$last_ledger[$i]['jrn_def_code']?>
+	</td>
+<td>
+   <?=3Dh(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
+</td>
+<td>
+<?=3DHtmlInput::detail_op($last_ledger[$i]['jr_id'], $last_ledger[$i]['j=
r_internal'])?>
+</td>
+<td class=3D"num">
+<?=3Dnbm($last_ledger[$i]['jr_montant'])?>
+</td>
+
+</tr>
+<? endfor;?>
+</ul></table>
+</fieldset>
 </div>
=20
+
+
 <div id=3D"add_todo_list" class=3D"add_todo_list">
 	<script charset=3D"utf8" type=3D"text/javascript" language=3D"javascrip=
t">
 		new Draggable($('add_todo_list'),{});



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 01:17:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skq3w-0007Nq-29
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 01:17:40 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 07:07:54 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244179.1341033459.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5050 - in phpcompta/tags/rel650: html html/js
	include include/template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 05:17:39 -0000

Author: danydb
Date: 2012-06-30 07:07:54 +0200 (Sat, 30 Jun 2012)
New Revision: 5050

Modified:
   phpcompta/tags/rel650/html/ajax_misc.php
   phpcompta/tags/rel650/html/js/scripts.js
   phpcompta/tags/rel650/include/class_follow_up.php
   phpcompta/tags/rel650/include/dashboard.inc.php
   phpcompta/tags/rel650/include/template/dashboard.php
Log:
------------------------------------------------------------------------
r5048 | danydb | 2012-06-30 06:09:28 +0200 (Sat, 30 Jun 2012) | 1 line

Cosmetic : select tva=20
------------------------------------------------------------------------
r5049 | danydb | 2012-06-30 06:31:21 +0200 (Sat, 30 Jun 2012) | 1 line

Cosmetic: ajout action - retard
------------------------------------------------------------------------


Modified: phpcompta/tags/rel650/html/ajax_misc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/html/ajax_misc.php	2012-06-30 04:31:21 UTC (rev=
 5049)
+++ phpcompta/tags/rel650/html/ajax_misc.php	2012-06-30 05:07:54 UTC (rev=
 5050)
@@ -185,7 +185,7 @@
 		$r =3D HtmlInput::anchor_close('tva_select');
 		$r.=3Dh2info('Choississez la TVA ');
 		$r.=3D'<div >';
-		$r.=3D '<TABLE style=3D"padding-left:10%;padding-right:10%;width:80%">=
';
+		$r.=3D '<TABLE style=3D"width:100%">';
 		$r.=3Dth('');
 		$r.=3Dth(_('code'));
 		$r.=3Dth(_('Taux'));
@@ -218,7 +218,8 @@
 				}
 			}
 			$set =3D '<INPUT TYPE=3D"BUTTON" class=3D"button" Value=3D"select" ' =
. $script . '>';
-			$r.=3D'<tr>';
+			$class=3D($i%2 =3D=3D 0)?' class=3D"odd" ':' class=3D"even" ';
+			$r.=3D'<tr'.$class. '>';
 			$r.=3Dtd($set);
 			$r.=3Dtd($row['tva_id']);
 			$r.=3Dtd($row['tva_rate']);

Modified: phpcompta/tags/rel650/html/js/scripts.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/html/js/scripts.js	2012-06-30 04:31:21 UTC (rev=
 5049)
+++ phpcompta/tags/rel650/html/js/scripts.js	2012-06-30 05:07:54 UTC (rev=
 5050)
@@ -473,7 +473,7 @@
=20
 	var nTop=3DposY-50;
 	var nLeft=3D"35%";
-	var str_style=3D"top:"+nTop+";left:"+nLeft+";width:50em;height:auto";
+	var str_style=3D"top:"+nTop+";left:"+nLeft+";width:55em;height:auto";
=20
 	var popup=3D{'id': 'tva_select','cssclass':'inner_box','style':str_styl=
e,'html':loading(),'drag':true};
 	add_div(popup);

Modified: phpcompta/tags/rel650/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 04:31:21=
 UTC (rev 5049)
+++ phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 05:07:54=
 UTC (rev 5050)
@@ -823,7 +823,7 @@
 	 */
 	function Update()
 	{
-           =20
+
 		// if ag_id =3D=3D 0 nothing to do
 		if ($this->ag_id =3D=3D 0)
 			return;
@@ -1021,11 +1021,24 @@
 	{
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
 				" from action_gestion join document_type " .
-				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state in (2,3)
+				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in (1,4)
 				and to_char(ag_remind_date,'DDMMYYYY')=3Dto_char(now(),'DDMMYYYY') "=
;
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}
+	       /**
+         * get the action where the remind day is today
+         * @return array
+         */
+	function get_late()
+	{
+		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
+				" from action_gestion join document_type " .
+				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in  (1,4)
+				and to_char(ag_remind_date,'DDMMYYYY')<=3Dto_char(now(),'DDMMYYYY') =
";
+		$array =3D $this->db->get_array($sql);
+		return $array;
+	}
 	/**
 	 * insert a related operation
 	 */
@@ -1152,7 +1165,7 @@
         /**
         *@brief show a list of actions
         * @param $cn database connextion
-        * @param $p_base base URL=20
+        * @param $p_base base URL
         */
 	static function show_action_list($cn, $p_base)
 	{
@@ -1185,7 +1198,7 @@
 		extract($p_array);
 		$query =3D "";
=20
-               =20
+
                 if (isset($_REQUEST['query']))
 		{
 			// if a query is request build the sql stmt

Modified: phpcompta/tags/rel650/include/dashboard.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/dashboard.inc.php	2012-06-30 04:31:21 U=
TC (rev 5049)
+++ phpcompta/tags/rel650/include/dashboard.inc.php	2012-06-30 05:07:54 U=
TC (rev 5050)
@@ -21,6 +21,7 @@
 $cal->get_preference();
 $Operation=3Dnew Follow_Up($cn);
 $last_operation=3D$Operation->get_today();
+$late_operation=3D$Operation->get_late();
 $Ledger=3Dnew Acc_Ledger($cn,0);
 $last_ledger=3Darray();
 $last_ledger=3D$Ledger->get_last(20);

Modified: phpcompta/tags/rel650/include/template/dashboard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/dashboard.php	2012-06-30 04:31=
:21 UTC (rev 5049)
+++ phpcompta/tags/rel650/include/template/dashboard.php	2012-06-30 05:07=
:54 UTC (rev 5050)
@@ -1,5 +1,5 @@
-<div style=3D"float:left;width:50%">
-<fieldset style=3D"width:100%">
+<div style=3D"float:left;width: 45%">
+<fieldset >
 <legend><?=3D_('Calendrier')?>
 </legend>
 <?php echo $cal->display(); ?>
@@ -24,7 +24,7 @@
 $array=3D$todo->load_all();
 ?>
=20
-<div style=3D"float:right;width:45%">
+<div style=3D"float:right;width: 45%">
 <fieldset> <legend><?=3D_('Pense-B=C3=AAte')?></legend>
=20
 <?php
@@ -57,65 +57,63 @@
 ?>
 </fieldset>
 </div>
-<div style=3D"float:right;width:45%">
-<fieldset>
-<legend><?=3D_('Action pour aujourd\'hui')?>
-</legend>
-<ol>
-<?php
-for($i=3D0;$i<count($last_operation);$i++):
-?>
-<li>
-<span>
-<?=3Dsmaller_date($last_operation[$i]['ag_timestamp_fmt'])?>
-</span>
-	<span  style=3D"font-weight: bolder ">
-		<?=3Dh($last_operation[$i]['vw_name'])?>
+<div style=3D"float:left;clear:both"></div>
+<div style=3D"float:right;width: 45%">
+<? if (count($last_operation)> 0) : ?>
+	<fieldset>
+	<legend><?=3D_('Action pour aujourd\'hui')?>
+	</legend>
+	<ol>
+	<?php
+	for($i=3D0;$i<count($last_operation);$i++):
+	?>
+	<li>
+	<span>
+	<?=3Dsmaller_date($last_operation[$i]['ag_timestamp_fmt'])?>
 	</span>
-<span>
-   <?=3Dh(mb_substr($last_operation[$i]['ag_title'],0,40,'UTF-8'))?>
-</span>
-<span style=3D"font-style: italic">
-<?=3D$last_operation[$i]['dt_value']?>
-</span>
-</li>
-<? endfor;?>
-</ol>
-</fieldset>
-</div>
+		<span  style=3D"font-weight: bolder ">
+			<?=3Dh($last_operation[$i]['vw_name'])?>
+		</span>
+	<span>
+	<?=3Dh(mb_substr($last_operation[$i]['ag_title'],0,60,'UTF-8'))?>
+	</span>
+	<span style=3D"font-style: italic">
+	<?=3D$last_operation[$i]['dt_value']?>
+	</span>
+	</li>
+	<? endfor;?>
+	</ol>
+	</fieldset>
+<? endif; ?>
=20
-<div style=3D"float:right;width:45%">
-<fieldset>
-<legend><?=3D_('Derni=C3=A8res op=C3=A9rations')?>
-</legend>
-<table style=3D"width: 100%">
-<?php
-for($i=3D0;$i<count($last_ledger);$i++):
-	$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
-?>
-<tr <?=3D$class ?>>=20
-	<td><?=3D  smaller_date($last_ledger[$i]['jr_date_fmt'])?>
-	</td>
-	<td>
-		<?=3D$last_ledger[$i]['jrn_def_code']?>
-	</td>
-<td>
-   <?=3Dh(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
-</td>
-<td>
-<?=3DHtmlInput::detail_op($last_ledger[$i]['jr_id'], $last_ledger[$i]['j=
r_internal'])?>
-</td>
-<td class=3D"num">
-<?=3Dnbm($last_ledger[$i]['jr_montant'])?>
-</td>
-
-</tr>
-<? endfor;?>
-</ul></table>
-</fieldset>
+<? if (count($late_operation)> 0) : ?>
+		<fieldset>
+	<legend><?=3D_('Action en retard ')?>
+	</legend>
+	<ol>
+	<?php
+	for($i=3D0;$i<count($late_operation);$i++):
+	?>
+	<li>
+	<span>
+	<?=3Dsmaller_date($late_operation[$i]['ag_timestamp_fmt'])?>
+	</span>
+		<span  style=3D"font-weight: bolder ">
+			<?=3Dh($late_operation[$i]['vw_name'])?>
+		</span>
+	<span>
+	<?=3Dh(mb_substr($late_operation[$i]['ag_title'],0,60,'UTF-8'))?>
+	</span>
+	<span style=3D"font-style: italic">
+	<?=3D$late_operation[$i]['dt_value']?>
+	</span>
+	</li>
+	<? endfor;?>
+	</ol>
+	</fieldset>
+<? endif; ?>
 </div>
-
-	<div style=3D"float:left;width:50%;clear:left">
+	<div style=3D"float:left;width: 45%">
 <?php
 /*
  * Mini Report
@@ -162,8 +160,40 @@
=20
 ?>
 </div>
+
+<div style=3D"float:right;width: 45%">
+<fieldset>
+<legend><?=3D_('Derni=C3=A8res op=C3=A9rations')?>
+</legend>
+<table style=3D"width: 100%">
+<?php
+for($i=3D0;$i<count($last_ledger);$i++):
+	$class=3D($i%2=3D=3D0)?' class=3D"even" ':' class=3D"odd" ';
+?>
+<tr <?=3D$class ?>>
+	<td><?=3D  smaller_date($last_ledger[$i]['jr_date_fmt'])?>
+	</td>
+	<td>
+		<?=3D$last_ledger[$i]['jrn_def_code']?>
+	</td>
+<td>
+   <?=3Dh(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
+</td>
+<td>
+<?=3DHtmlInput::detail_op($last_ledger[$i]['jr_id'], $last_ledger[$i]['j=
r_internal'])?>
+</td>
+<td class=3D"num">
+<?=3Dnbm($last_ledger[$i]['jr_montant'])?>
+</td>
+
+</tr>
+<? endfor;?>
+</ul></table>
+</fieldset>
 </div>
=20
+
+
 <div id=3D"add_todo_list" class=3D"add_todo_list">
 	<script charset=3D"utf8" type=3D"text/javascript" language=3D"javascrip=
t">
 		new Draggable($('add_todo_list'),{});



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 08:18:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skwcv-0001BI-NP
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 08:18:13 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 14:08:27 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244950.1341058693.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5051 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 12:18:12 -0000

Author: danydb
Date: 2012-06-30 14:08:26 +0200 (Sat, 30 Jun 2012)
New Revision: 5051

Modified:
   phpcompta/tags/rel650/include/ac_common.php
Log:
update comment

Modified: phpcompta/tags/rel650/include/ac_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/ac_common.php	2012-06-30 05:07:54 UTC (=
rev 5050)
+++ phpcompta/tags/rel650/include/ac_common.php	2012-06-30 12:08:26 UTC (=
rev 5051)
@@ -239,7 +239,7 @@
 	{
 	    return null;
 	}
-    }// !ereg
+    }
     return $p_date;
 }
=20



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 08:23:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SkwiS-0001S4-8u
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 08:23:56 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 14:14:10 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244951.1341059035.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5052 - phpcompta/tags/rel650/doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 12:23:55 -0000

Author: danydb
Date: 2012-06-30 14:14:10 +0200 (Sat, 30 Jun 2012)
New Revision: 5052

Modified:
   phpcompta/tags/rel650/doc/manuel-fr.odt
   phpcompta/tags/rel650/doc/manuel-fr.pdf
Log:
Manuel Documentation : syntaxe rapport

Modified: phpcompta/tags/rel650/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)

Modified: phpcompta/tags/rel650/doc/manuel-fr.pdf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 08:26:26 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skwks-0001b4-Mw
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 08:26:26 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 14:16:40 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244956.1341059186.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5053 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 12:26:25 -0000

Author: danydb
Date: 2012-06-30 14:16:40 +0200 (Sat, 30 Jun 2012)
New Revision: 5053

Modified:
   phpcompta/tags/rel650/include/class_impress.php
   phpcompta/tags/rel650/include/impress_rapport.inc.php
Log:
Rapport BUG avec les postes comptables alphanum?\195?\169riques

Modified: phpcompta/tags/rel650/include/class_impress.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_impress.php	2012-06-30 12:14:10 U=
TC (rev 5052)
+++ phpcompta/tags/rel650/include/class_impress.php	2012-06-30 12:16:40 U=
TC (rev 5053)
@@ -60,8 +60,7 @@
=20
         include_once("class_acc_account_ledger.php");
=20
-        //    while (@ereg("(\[[0-9]*%*D*C*S*\])",$p_formula,$e) =3D=3D =
true)
-        while (preg_match_all("(\[[0-9]*%*D*C*S*\])",$p_formula,$e) =3D=3D=
 true)
+        while (preg_match_all("(\[[0-9]*[A-Z]*%*c*d*s*\])",$p_formula,$e=
) =3D=3D true)
           {
=20
             // remove the [ ]
@@ -69,17 +68,17 @@
             foreach ($x as $line)
               {
                 $compute=3D'all';
-                if ( strpos($line,'D') !=3D 0 )
+                if ( strpos($line,'d') !=3D 0 )
                   $compute=3D'deb';
-                if ( strpos($line,'C') !=3D 0 )
+                if ( strpos($line,'c') !=3D 0 )
                   $compute=3D'cred';
-                if ( strpos($line,'S') !=3D 0 )
+                if ( strpos($line,'s') !=3D 0 )
                   $compute=3D'signed';
                 $line=3Dstr_replace ("[","",$line);
                 $line=3Dstr_replace ("]","",$line);
-                $line=3Dstr_replace ("D","",$line);
-                $line=3Dstr_replace ("C","",$line);
-                $line=3Dstr_replace ("S","",$line);
+                $line=3Dstr_replace ("d","",$line);
+                $line=3Dstr_replace ("c","",$line);
+                $line=3Dstr_replace ("s","",$line);
                 // If there is a FROM clause we must recompute
                 // the time cond
=20
@@ -159,7 +158,6 @@
         if ( $p_eval =3D=3D true)
         {
             $p_formula=3D"\$result=3D".$p_formula.";";
-
             eval("$p_formula");
=20
             while (preg_match("/\[([0-9]+)([Tt]*)\]/",trim($p_label),$e)=
 =3D=3D 1)
@@ -213,20 +211,30 @@
         // eat Space
         $p_string=3Dstr_replace(" ","",$p_string);
         // Remove D/C/S
-        $p_string=3Dstr_replace("C","",$p_string);
-        $p_string=3Dstr_replace("D","",$p_string);
-        $p_string=3Dstr_replace("S","",$p_string);
+        $p_string=3Dstr_replace("c","",$p_string);
+        $p_string=3Dstr_replace("d","",$p_string);
+        $p_string=3Dstr_replace("s","",$p_string);
         // Remove T,t
-        $p_string=3Dstr_replace("T","",$p_string);
         $p_string=3Dstr_replace("t","",$p_string);
=20
-        if ( @ereg ("^(\\$[a-zA-Z]*[0-9]*=3D){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=3D[0-9][0-0].20[0-9][0=
-9]){0,1}$",$p_string) =3D=3D false)
+		// remove date
+		$p_string=3D  preg_replace("/FROM*=3D*[0-9]+/", "", $p_string);
+
+		// remove account
+		$p_string=3D  preg_replace("/\[[0-9]*[A-Z]*%*\]/", "", $p_string);
+
+		$p_string=3D  preg_replace("/\+|-|\/\*/", "", $p_string);
+		//********************************************************************=
************************************************
+		// If the string is empty then formula should be good
+		//
+		//********************************************************************=
************************************************
+		if ($p_string =3D=3D '')
         {
-            return false;
+            return true;
         }
         else
         {
-            return true;
+            return false;
         }
     }
      /**

Modified: phpcompta/tags/rel650/include/impress_rapport.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/impress_rapport.inc.php	2012-06-30 12:1=
4:10 UTC (rev 5052)
+++ phpcompta/tags/rel650/include/impress_rapport.inc.php	2012-06-30 12:1=
6:40 UTC (rev 5053)
@@ -273,7 +273,7 @@
=20
         echo "<TR $class>".
         "<TD>".h($op['desc'])."</TD>".
-        "<TD align=3D\"right\">".sprintf("% 8.2f",$op['montant'])."</TD>=
".
+        "<TD align=3D\"right\">".nbm($op['montant'])."</TD>".
         "</TR>";
     }
     echo "</table>";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 08:32:22 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skwqb-0002Fi-Vh
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 08:32:21 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 14:22:36 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244964.1341059540.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5054 - in phpcompta/trunk: . doc
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 12:32:20 -0000

Author: danydb
Date: 2012-06-30 14:22:35 +0200 (Sat, 30 Jun 2012)
New Revision: 5054

Modified:
   phpcompta/trunk/
   phpcompta/trunk/doc/manuel-fr.pdf
Log:
Merged revisions 5047 via svnmerge from=20
svn+ssh://ns352270.ovh.net/svn/phpcompta/tags/rel650

........
  r5047 | danydb | 2012-06-30 00:47:45 +0200 (Sat, 30 Jun 2012) | 1 line
 =20
  Update doc PDF
........



Property changes on: phpcompta/trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /phpcompta/tags/rel650:1-5045
   + /phpcompta/tags/rel650:1-5045,5047

Modified: phpcompta/trunk/doc/manuel-fr.pdf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 08:33:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skwrj-0002Ij-5Y
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 08:33:31 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 14:23:45 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.244967.1341059610.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5055 - in phpcompta/trunk: . doc include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 12:33:30 -0000

Author: danydb
Date: 2012-06-30 14:23:44 +0200 (Sat, 30 Jun 2012)
New Revision: 5055

Modified:
   phpcompta/trunk/
   phpcompta/trunk/doc/manuel-fr.odt
   phpcompta/trunk/doc/manuel-fr.pdf
   phpcompta/trunk/include/ac_common.php
   phpcompta/trunk/include/class_impress.php
   phpcompta/trunk/include/impress_rapport.inc.php
Log:
Merged revisions 5050-5053 via svnmerge from=20
svn+ssh://ns352270.ovh.net/svn/phpcompta/tags/rel650

........
  r5050 | danydb | 2012-06-30 07:07:54 +0200 (Sat, 30 Jun 2012) | 10 line=
s
 =20
  -----------------------------------------------------------------------=
-
  r5048 | danydb | 2012-06-30 06:09:28 +0200 (Sat, 30 Jun 2012) | 1 line
 =20
  Cosmetic : select tva=20
  -----------------------------------------------------------------------=
-
  r5049 | danydb | 2012-06-30 06:31:21 +0200 (Sat, 30 Jun 2012) | 1 line
 =20
  Cosmetic: ajout action - retard
  -----------------------------------------------------------------------=
-
........
  r5051 | danydb | 2012-06-30 14:08:26 +0200 (Sat, 30 Jun 2012) | 1 line
 =20
  update comment
........
  r5052 | danydb | 2012-06-30 14:14:10 +0200 (Sat, 30 Jun 2012) | 1 line
 =20
  Manuel Documentation : syntaxe rapport
........
  r5053 | danydb | 2012-06-30 14:16:40 +0200 (Sat, 30 Jun 2012) | 1 line
 =20
  Rapport BUG avec les postes comptables alphanum?\195?\169riques
........



Property changes on: phpcompta/trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /phpcompta/tags/rel650:1-5045,5047
   + /phpcompta/tags/rel650:1-5054

Modified: phpcompta/trunk/doc/manuel-fr.odt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)

Modified: phpcompta/trunk/doc/manuel-fr.pdf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)

Modified: phpcompta/trunk/include/ac_common.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/ac_common.php	2012-06-30 12:22:35 UTC (rev 50=
54)
+++ phpcompta/trunk/include/ac_common.php	2012-06-30 12:23:44 UTC (rev 50=
55)
@@ -239,7 +239,7 @@
 	{
 	    return null;
 	}
-    }// !ereg
+    }
     return $p_date;
 }
=20

Modified: phpcompta/trunk/include/class_impress.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_impress.php	2012-06-30 12:22:35 UTC (re=
v 5054)
+++ phpcompta/trunk/include/class_impress.php	2012-06-30 12:23:44 UTC (re=
v 5055)
@@ -60,8 +60,7 @@
=20
         include_once("class_acc_account_ledger.php");
=20
-        //    while (@ereg("(\[[0-9]*%*D*C*S*\])",$p_formula,$e) =3D=3D =
true)
-        while (preg_match_all("(\[[0-9]*%*D*C*S*\])",$p_formula,$e) =3D=3D=
 true)
+        while (preg_match_all("(\[[0-9]*[A-Z]*%*c*d*s*\])",$p_formula,$e=
) =3D=3D true)
           {
=20
             // remove the [ ]
@@ -69,17 +68,17 @@
             foreach ($x as $line)
               {
                 $compute=3D'all';
-                if ( strpos($line,'D') !=3D 0 )
+                if ( strpos($line,'d') !=3D 0 )
                   $compute=3D'deb';
-                if ( strpos($line,'C') !=3D 0 )
+                if ( strpos($line,'c') !=3D 0 )
                   $compute=3D'cred';
-                if ( strpos($line,'S') !=3D 0 )
+                if ( strpos($line,'s') !=3D 0 )
                   $compute=3D'signed';
                 $line=3Dstr_replace ("[","",$line);
                 $line=3Dstr_replace ("]","",$line);
-                $line=3Dstr_replace ("D","",$line);
-                $line=3Dstr_replace ("C","",$line);
-                $line=3Dstr_replace ("S","",$line);
+                $line=3Dstr_replace ("d","",$line);
+                $line=3Dstr_replace ("c","",$line);
+                $line=3Dstr_replace ("s","",$line);
                 // If there is a FROM clause we must recompute
                 // the time cond
=20
@@ -159,7 +158,6 @@
         if ( $p_eval =3D=3D true)
         {
             $p_formula=3D"\$result=3D".$p_formula.";";
-
             eval("$p_formula");
=20
             while (preg_match("/\[([0-9]+)([Tt]*)\]/",trim($p_label),$e)=
 =3D=3D 1)
@@ -213,20 +211,30 @@
         // eat Space
         $p_string=3Dstr_replace(" ","",$p_string);
         // Remove D/C/S
-        $p_string=3Dstr_replace("C","",$p_string);
-        $p_string=3Dstr_replace("D","",$p_string);
-        $p_string=3Dstr_replace("S","",$p_string);
+        $p_string=3Dstr_replace("c","",$p_string);
+        $p_string=3Dstr_replace("d","",$p_string);
+        $p_string=3Dstr_replace("s","",$p_string);
         // Remove T,t
-        $p_string=3Dstr_replace("T","",$p_string);
         $p_string=3Dstr_replace("t","",$p_string);
=20
-        if ( @ereg ("^(\\$[a-zA-Z]*[0-9]*=3D){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=3D[0-9][0-0].20[0-9][0=
-9]){0,1}$",$p_string) =3D=3D false)
+		// remove date
+		$p_string=3D  preg_replace("/FROM*=3D*[0-9]+/", "", $p_string);
+
+		// remove account
+		$p_string=3D  preg_replace("/\[[0-9]*[A-Z]*%*\]/", "", $p_string);
+
+		$p_string=3D  preg_replace("/\+|-|\/\*/", "", $p_string);
+		//********************************************************************=
************************************************
+		// If the string is empty then formula should be good
+		//
+		//********************************************************************=
************************************************
+		if ($p_string =3D=3D '')
         {
-            return false;
+            return true;
         }
         else
         {
-            return true;
+            return false;
         }
     }
      /**

Modified: phpcompta/trunk/include/impress_rapport.inc.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/impress_rapport.inc.php	2012-06-30 12:22:35 U=
TC (rev 5054)
+++ phpcompta/trunk/include/impress_rapport.inc.php	2012-06-30 12:23:44 U=
TC (rev 5055)
@@ -273,7 +273,7 @@
=20
         echo "<TR $class>".
         "<TD>".h($op['desc'])."</TD>".
-        "<TD align=3D\"right\">".sprintf("% 8.2f",$op['montant'])."</TD>=
".
+        "<TD align=3D\"right\">".nbm($op['montant'])."</TD>".
         "</TR>";
     }
     echo "</table>";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 08:49:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Skx6v-0004sd-Q0
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 08:49:13 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 14:39:28 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.245318.1341060553.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5056 - in phpcompta/tags/rel650/include: . template
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 12:49:13 -0000

Author: danydb
Date: 2012-06-30 14:39:28 +0200 (Sat, 30 Jun 2012)
New Revision: 5056

Modified:
   phpcompta/tags/rel650/include/class_calendar.php
   phpcompta/tags/rel650/include/template/dashboard.php
Log:
0000666: Limiter dans le tableau accueil, le calendrier ?\195?\160 exerci=
ce courant=20
0000667: DASHBOAD : agrandir les ?\195?\169l?\195?\169ments

Modified: phpcompta/tags/rel650/include/class_calendar.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_calendar.php	2012-06-30 12:23:44 =
UTC (rev 5055)
+++ phpcompta/tags/rel650/include/class_calendar.php	2012-06-30 12:39:28 =
UTC (rev 5056)
@@ -90,6 +90,8 @@
      */
     function display()
     {
+        global $g_user;
+        $exercice_user=3D$g_user->get_exercice();
         /* day */
         $cell=3Darray();
         for ($i=3D0;$i<42;$i++)
@@ -104,7 +106,7 @@
         $this->fill_from_todo($cell);
         $wMonth=3Dnew ISelect('per');
         $cn=3Dnew Database(dossier::id());
-        $wMonth->value=3D$cn->make_array("select p_id,to_char(p_start,'M=
M/YYYY') from parm_periode order by p_start");
+        $wMonth->value=3D$cn->make_array("select p_id,to_char(p_start,'M=
M/YYYY') from parm_periode where p_exercice =3D '$exercice_user' order by=
 p_start");
         $wMonth->selected=3D$this->default_periode;
         $wMonth->javascript=3D"onchange=3Dchange_month(this)";
         $wMonth->set_attribute('gDossier',dossier::id());

Modified: phpcompta/tags/rel650/include/template/dashboard.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/template/dashboard.php	2012-06-30 12:23=
:44 UTC (rev 5055)
+++ phpcompta/tags/rel650/include/template/dashboard.php	2012-06-30 12:39=
:28 UTC (rev 5056)
@@ -1,4 +1,4 @@
-<div style=3D"float:left;width: 45%">
+<div style=3D"float:left;width: 49%">
 <fieldset >
 <legend><?=3D_('Calendrier')?>
 </legend>
@@ -24,7 +24,7 @@
 $array=3D$todo->load_all();
 ?>
=20
-<div style=3D"float:right;width: 45%">
+<div style=3D"float:right;width: 49%">
 <fieldset> <legend><?=3D_('Pense-B=C3=AAte')?></legend>
=20
 <?php
@@ -58,7 +58,7 @@
 </fieldset>
 </div>
 <div style=3D"float:left;clear:both"></div>
-<div style=3D"float:right;width: 45%">
+<div style=3D"float:right;width: 49%">
 <? if (count($last_operation)> 0) : ?>
 	<fieldset>
 	<legend><?=3D_('Action pour aujourd\'hui')?>
@@ -113,7 +113,7 @@
 	</fieldset>
 <? endif; ?>
 </div>
-	<div style=3D"float:left;width: 45%">
+	<div style=3D"float:left;width: 49%">
 <?php
 /*
  * Mini Report
@@ -161,7 +161,7 @@
 ?>
 </div>
=20
-<div style=3D"float:right;width: 45%">
+<div style=3D"float:right;width: 49%">
 <fieldset>
 <legend><?=3D_('Derni=C3=A8res op=C3=A9rations')?>
 </legend>



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 12:49:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sl0rv-0008Uo-K2
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 12:49:59 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 18:40:13 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.245817.1341074999.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5057 - phpcompta/trunk/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 16:49:59 -0000

Author: danydb
Date: 2012-06-30 18:40:12 +0200 (Sat, 30 Jun 2012)
New Revision: 5057

Modified:
   phpcompta/trunk/include/class_follow_up.php
Log:
bug follow_up::get_late

Modified: phpcompta/trunk/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/trunk/include/class_follow_up.php	2012-06-30 12:39:28 UTC (=
rev 5056)
+++ phpcompta/trunk/include/class_follow_up.php	2012-06-30 16:40:12 UTC (=
rev 5057)
@@ -1035,7 +1035,7 @@
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in  (1,4)
-				and to_char(ag_remind_date,'DDMMYYYY')<=3Dto_char(now(),'DDMMYYYY') =
";
+				and ag_remind_date > trunc (now()) ";
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 12:53:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sl0vB-0000Fn-5O
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 12:53:21 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 18:43:34 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.245820.1341075200.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5058 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 16:53:19 -0000

Author: danydb
Date: 2012-06-30 18:43:34 +0200 (Sat, 30 Jun 2012)
New Revision: 5058

Modified:
   phpcompta/tags/rel650/include/class_follow_up.php
Log:
------------------------------------------------------------------------
r5057 | danydb | 2012-06-30 18:40:12 +0200 (Sat, 30 Jun 2012) | 1 line

bug follow_up::get_late
------------------------------------------------------------------------


Modified: phpcompta/tags/rel650/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 16:40:12=
 UTC (rev 5057)
+++ phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 16:43:34=
 UTC (rev 5058)
@@ -1035,7 +1035,7 @@
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in  (1,4)
-				and to_char(ag_remind_date,'DDMMYYYY')<=3Dto_char(now(),'DDMMYYYY') =
";
+				and ag_remind_date > trunc (now()) ";
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 13:07:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sl18S-0000uQ-N9
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 13:07:04 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 18:57:19 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.245827.1341076024.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5059 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 17:07:04 -0000

Author: danydb
Date: 2012-06-30 18:57:18 +0200 (Sat, 30 Jun 2012)
New Revision: 5059

Modified:
   phpcompta/tags/rel650/include/class_follow_up.php
Log:
bug follow_up::get_late

Modified: phpcompta/tags/rel650/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 16:43:34=
 UTC (rev 5058)
+++ phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 16:57:18=
 UTC (rev 5059)
@@ -1022,7 +1022,7 @@
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in (1,4)
-				and to_char(ag_remind_date,'DDMMYYYY')=3Dto_char(now(),'DDMMYYYY') "=
;
+				and ag_remind_date > now() ";
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 13:08:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sl1A1-0000xy-Ui
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 13:08:41 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 18:58:56 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.245828.1341076121.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5060 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 17:08:40 -0000

Author: danydb
Date: 2012-06-30 18:58:55 +0200 (Sat, 30 Jun 2012)
New Revision: 5060

Modified:
   phpcompta/tags/rel650/include/class_follow_up.php
Log:
bug follow_up::get_late

Modified: phpcompta/tags/rel650/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 16:57:18=
 UTC (rev 5059)
+++ phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 16:58:55=
 UTC (rev 5060)
@@ -1022,7 +1022,7 @@
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in (1,4)
-				and ag_remind_date > now() ";
+					and to_char(ag_remind_date,'DDMMYYYY')=3Dto_char(now(),'DDMMYYYY') =
";
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}
@@ -1035,7 +1035,7 @@
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in  (1,4)
-				and ag_remind_date > trunc (now()) ";
+				and ag_remind_date > now() ";
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 13:13:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sl1ET-0001Gn-5A
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 13:13:17 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 19:03:30 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.245832.1341076396.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5061 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 17:13:15 -0000

Author: danydb
Date: 2012-06-30 19:03:29 +0200 (Sat, 30 Jun 2012)
New Revision: 5061

Modified:
   phpcompta/tags/rel650/include/class_follow_up.php
Log:
bug follow_up::get_late

Modified: phpcompta/tags/rel650/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 16:58:55=
 UTC (rev 5060)
+++ phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 17:03:29=
 UTC (rev 5061)
@@ -1019,7 +1019,7 @@
          */
 	function get_today()
 	{
-		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
+		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_remind_date,'DD.MM.YYYY') as ag_timestamp_fm=
t,ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in (1,4)
 					and to_char(ag_remind_date,'DDMMYYYY')=3Dto_char(now(),'DDMMYYYY') =
";
@@ -1032,7 +1032,7 @@
          */
 	function get_late()
 	{
-		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,=
ag_timestamp " .
+		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_remind_date,'DD.MM.YYYY') as ag_timestamp_fm=
t,ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in  (1,4)
 				and ag_remind_date > now() ";



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


From MAILER-DAEMON Sat Jun 30 13:46:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sl1kk-0004FN-Jj
	for mharc-phpcompta-dev@gnu.org; Sat, 30 Jun 2012 13:46:38 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Sat, 30 Jun 2012 19:36:52 +0200 (CEST)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 91.121.80.190
Message-ID: <mailman.245855.1341078397.854.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r5062 - phpcompta/tags/rel650/include
X-BeenThere: phpcompta-dev@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: phpcompta-dev@nongnu.org
List-Id: <phpcompta-dev.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/phpcompta-dev>
List-Post: <mailto:phpcompta-dev@nongnu.org>
List-Help: <mailto:phpcompta-dev-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/phpcompta-dev>,
	<mailto:phpcompta-dev-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Sat, 30 Jun 2012 17:46:37 -0000

Author: danydb
Date: 2012-06-30 19:36:51 +0200 (Sat, 30 Jun 2012)
New Revision: 5062

Modified:
   phpcompta/tags/rel650/include/class_follow_up.php
Log:
bug follow_up::get_late

Modified: phpcompta/tags/rel650/include/class_follow_up.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 17:03:29=
 UTC (rev 5061)
+++ phpcompta/tags/rel650/include/class_follow_up.php	2012-06-30 17:36:51=
 UTC (rev 5062)
@@ -1035,7 +1035,7 @@
 		$sql =3D "select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title=
,ag_ref, dt_value,to_char(ag_remind_date,'DD.MM.YYYY') as ag_timestamp_fm=
t,ag_timestamp " .
 				" from action_gestion join document_type " .
 				" on (ag_type=3Ddt_id) left join vw_fiche_attr on (f_id=3Df_id_dest)=
 where ag_state not in  (1,4)
-				and ag_remind_date > now() ";
+				and ag_remind_date < now() ";
 		$array =3D $this->db->get_array($sql);
 		return $array;
 	}



---
PhpCompta est un logiciel de comptabilit=C3=A9 libre en ligne (full web)
Projet opensource http://www.phpcompta.eu


