From MAILER-DAEMON Mon Apr 25 16:51:49 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QESl3-00085r-HZ
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Apr 2011 16:51:49 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Apr 2011 22:55: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.31528.1303764708.5390.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4072 - 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 Apr 2011 20:51:48 -0000

Author: danydb
Date: 2011-04-25 22:55:55 +0200 (Mon, 25 Apr 2011)
New Revision: 4072

Modified:
   phpcompta/trunk/include/class_acc_ledger.php
   phpcompta/trunk/include/class_print_ledger_fin.php
   phpcompta/trunk/include/class_print_ledger_simple.php
   phpcompta/trunk/include/class_print_ledger_simple_without_vat.php
   phpcompta/trunk/include/export_ledger_csv.php
   phpcompta/trunk/include/impress_jrn.inc.php
Log:
Add view for third in ACH/VEN/FIN (html+csv) pdf must be done

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	2011-04-25 20:35:36 UTC =
(rev 4071)
+++ phpcompta/trunk/include/class_acc_ledger.php	2011-04-25 20:55:55 UTC =
(rev 4072)
@@ -2855,5 +2855,31 @@
             );
         return $r;
     }
+    /**
+     *Retrieve the third : supplier for purchase, customer for sale, ban=
k for fin,=20
+     *@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_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));
=20
+	  break ;
+	case 'FIN':
+	  $tiers=3D$this->db->get_value('select qf_bank from quant_fin where jr=
_id=3D$1',array($jr_id));
+	  break ;
+
+	}
+      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;
+    }
 }

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	2011-04-25 20:35:3=
6 UTC (rev 4071)
+++ phpcompta/trunk/include/class_print_ledger_fin.php	2011-04-25 20:55:5=
5 UTC (rev 4072)
@@ -22,6 +22,7 @@
=20
 /*!\file
  * \brief print a listing of financial
+ *\todo Must add the third part
  */
 require_once('class_pdf.php');
 class Print_Ledger_Financial extends PDF

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	2011-04-25 20:3=
5:36 UTC (rev 4071)
+++ phpcompta/trunk/include/class_print_ledger_simple.php	2011-04-25 20:5=
5:55 UTC (rev 4072)
@@ -23,6 +23,7 @@
 /*!\file
  * \brief this class extends PDF and let you export the detailled printi=
ng
  *  of any ledgers
+ *\todo Must add the third part
  */
 require_once('class_pdf.php');
=20

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=
1-04-25 20:35:36 UTC (rev 4071)
+++ phpcompta/trunk/include/class_print_ledger_simple_without_vat.php	201=
1-04-25 20:55:55 UTC (rev 4072)
@@ -23,6 +23,7 @@
 /*!\file
  * \brief this class extends PDF and let you export the detailled printi=
ng
  *  of any ledgers
+ * *\todo Must add the third part
  */
 require_once('class_pdf.php');
=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	2011-04-25 20:35:36 UTC=
 (rev 4071)
+++ phpcompta/trunk/include/export_ledger_csv.php	2011-04-25 20:55:55 UTC=
 (rev 4072)
@@ -99,6 +99,7 @@
 	 printf ('" operation";'.
 		 '"Date";'.
 		 '"N=C2=B0 Pi=C3=A8ce";'.
+		 '"Tiers";'.
 		 '"commentaire";'.
 		 '"internal";'.
 		 '"montant";'.
@@ -109,6 +110,7 @@
 	     echo $line['num'].";";
 	     echo $line['date'].";";
 	     echo $line['jr_pj_number'].";";
+	     echo $Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']).";";
 	     echo $line['comment'].";";
 	     echo $line['jr_internal'].";";
 	     //	  echo "<TD>".$line['pj'].";";
@@ -151,7 +153,7 @@
             printf('"%s";"%s";"%s";"%s";"%s";%s;',
                    $line['date'],
                    $line['num'],
-                   $line['client'],
+                   $Jrn->get_tiers($line['jrn_def_type'],$line['jr_id'])=
,
                    $line['comment'],
                    $line['jr_internal'],
                    nb($line['HTVA']));

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	2011-04-25 20:35:36 UTC (=
rev 4071)
+++ phpcompta/trunk/include/impress_jrn.inc.php	2011-04-25 20:55:55 UTC (=
rev 4072)
@@ -238,6 +238,7 @@
         "<th>Date</th>".
         "<th> n=C2=B0 de pi=C3=A8ce </th>".
         "<th>internal</th>".
+	  th('Tiers').
         "<th>Commentaire</th>".
         "<th> montant</th>".
         "</TR>";
@@ -250,8 +251,11 @@
             echo "<TD>".$line['date']."</TD>";
             echo "<TD>".h($line['jr_pj_number'])."</TD>";
 	    echo "<TD>".HtmlInput::detail_op($line['jr_id'],$line['jr_internal'=
])."</TD>";
+	    $tiers=3D$Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']);
+	    echo td($tiers);
             echo "<TD>".h($line['comment'])."</TD>";
=20
+
             //	  echo "<TD>".$line['pj']."</TD>";
             // If the ledger is financial :
             // the credit must be negative and written in red



From MAILER-DAEMON Mon Apr 25 17:10:55 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QET3X-00010r-O7
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Apr 2011 17:10:55 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Apr 2011 22:35: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.31537.1303765854.5390.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4071 - 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 Apr 2011 21:10:53 -0000

Author: danydb
Date: 2011-04-25 22:35:36 +0200 (Mon, 25 Apr 2011)
New Revision: 4071

Modified:
   phpcompta/trunk/include/class_fiche.php
Log:
protect sql


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	2011-04-25 20:35:15 UTC (rev =
4070)
+++ phpcompta/trunk/include/class_fiche.php	2011-04-25 20:35:36 UTC (rev =
4071)
@@ -1031,8 +1031,8 @@
      */
     function get_quick_code()
     {
-        $sql=3D"select ad_value from fiche_detail where ad_id=3D23 and f=
_id=3D".$this->id;
-        $Res=3D$this->cn->exec_sql($sql);
+        $sql=3D"select ad_value from fiche_detail where ad_id=3D23 and f=
_id=3D$1";
+        $Res=3D$this->cn->exec_sql($sql,array($this->id));
         $r=3DDatabase::fetch_all($Res);
         if ( sizeof($r) =3D=3D 0 )
             return null;



From MAILER-DAEMON Mon Apr 25 17:10:55 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QET3X-000117-UQ
	for mharc-phpcompta-dev@gnu.org; Mon, 25 Apr 2011 17:10:55 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 Apr 2011 22: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.31538.1303765854.5390.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4070 - 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 Apr 2011 21:10:54 -0000

Author: danydb
Date: 2011-04-25 22:35:15 +0200 (Mon, 25 Apr 2011)
New Revision: 4070

Modified:
   phpcompta/trunk/include/class_fiche.php
Log:
protect sql


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	2011-04-12 20:28:53 UTC (rev =
4069)
+++ phpcompta/trunk/include/class_fiche.php	2011-04-25 20:35:15 UTC (rev =
4070)
@@ -1018,8 +1018,8 @@
     function getName()
     {
         $sql=3D"select ad_value from fiche_detail
-             where ad_id=3D1 and f_id=3D".$this->id;
-        $Res=3D$this->cn->exec_sql($sql);
+             where ad_id=3D1 and f_id=3D$1";
+        $Res=3D$this->cn->exec_sql($sql,array($this->id));
         $r=3DDatabase::fetch_all($Res);
         if ( sizeof($r) =3D=3D 0 )
             return 1;



From MAILER-DAEMON Tue Apr 26 17:20:59 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEpgp-0007Qn-TE
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Apr 2011 17:20:59 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Apr 2011 23:25: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.33602.1303852859.5390.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4073 - 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 Apr 2011 21:20:59 -0000

Author: danydb
Date: 2011-04-26 23:25:01 +0200 (Tue, 26 Apr 2011)
New Revision: 4073

Modified:
   phpcompta/trunk/include/class_html_input.php
Log:
Add doc

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	2011-04-25 20:55:55 UTC =
(rev 4072)
+++ phpcompta/trunk/include/class_html_input.php	2011-04-26 21:25:01 UTC =
(rev 4073)
@@ -496,25 +496,25 @@
       $r=3Dself::array_to_hidden($array,$_GET );
       return $r;
     }
+
     /**
      *transform $_POST  data  to hidden
      *@param $array is an of indices=20
      *@see HtmlInput::request_to_hidden
      *@return html string with the hidden data
      */
-
     static function post_to_hidden($array)
     {
       $r=3Dself::array_to_hidden($array,$_POST );
       return $r;
     }
+
     /**
      *transform $_REQUEST   data  to hidden
      *@param $array is an of indices=20
      *@see HtmlInput::request_to_hidden
      *@return html string with the hidden data
      */
-
     static function request_to_hidden($array)
     {
       $r=3Dself::array_to_hidden($array,$_REQUEST  );



From MAILER-DAEMON Tue Apr 26 17:21:35 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEphP-0007Rg-9C
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Apr 2011 17:21:35 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Apr 2011 23:25: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.33603.1303852894.5390.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4074 - 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 Apr 2011 21:21:34 -0000

Author: danydb
Date: 2011-04-26 23:25:44 +0200 (Tue, 26 Apr 2011)
New Revision: 4074

Modified:
   phpcompta/trunk/include/class_print_ledger_fin.php
Log:
Fix Bug : no header + add card

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	2011-04-26 21:25:0=
1 UTC (rev 4073)
+++ phpcompta/trunk/include/class_print_ledger_fin.php	2011-04-26 21:25:4=
4 UTC (rev 4074)
@@ -41,14 +41,13 @@
         $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
         //Line break
         $this->Ln(20);
-        $this->SetFont('DejaVu', '', 6);
-        $this->Cell(30,'Piece');
-        $this->Cell(10,'Date');
-        $this->Cell(20,'Interne');
-        $this->Cell(60,'Banque');
-        $this->Cell(60,'Dest/Orig');
-        $this->Cell(65,'Commentaire');
-        $this->Cell(15,'Montant');
+        $this->SetFont('DejaVu', 'B', 7);
+        $this->Cell(30,6,'Piece');
+        $this->Cell(10,6,'Date');
+        $this->Cell(20,6,'Interne');
+        $this->Cell(40,6,'Dest/Orig');
+        $this->Cell(105,6,'Commentaire');
+        $this->Cell(15,6,'Montant');
         $this->Ln(6);
=20
     }
@@ -85,14 +84,11 @@
             $this->Cell(10,5,$row['date_fmt']);
             $this->Cell(20,5,$row['internal']);
=20
-            list($qc,$name,$bank_qc,$bank_name)=3D$this->get_tiers($row[=
'id'],$this->jrn_type);
-            $this->Cell(20,5,$bank_qc,0,0);
-            $this->Cell(40,5,$bank_name,0,0);
-            $this->Cell(20,5,$qc,0,0);
+            $name=3D$this->ledger->get_tiers($this->jrn_type,$row['id'])=
;
             $this->Cell(40,5,$name,0,0);
=20
=20
-            $this->Cell(65,5,$row['comment'],0,0);
+            $this->Cell(105,5,$row['comment'],0,0);
             $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->Ln(5);



From MAILER-DAEMON Tue Apr 26 17:21:53 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEphh-0007SZ-JE
	for mharc-phpcompta-dev@gnu.org; Tue, 26 Apr 2011 17:21:53 -0400
To: phpcompta-dev@nongnu.org
Content-Type: text/plain; charset=UTF-8
Date: Tue, 26 Apr 2011 23:26: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.33604.1303852913.5390.phpcompta-dev@nongnu.org>
From: phpcompta-dev@nongnu.org
Subject: [Phpcompta-dev] r4075 - 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 Apr 2011 21:21:52 -0000

Author: danydb
Date: 2011-04-26 23:26:01 +0200 (Tue, 26 Apr 2011)
New Revision: 4075

Modified:
   phpcompta/trunk/include/class_acc_ledger.php
   phpcompta/trunk/include/class_print_ledger_misc.php
   phpcompta/trunk/include/export_histo_csv.php
   phpcompta/trunk/include/impress_jrn.inc.php
Log:
Add card to history

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	2011-04-26 21:25:44 UTC =
(rev 4074)
+++ phpcompta/trunk/include/class_acc_ledger.php	2011-04-26 21:26:01 UTC =
(rev 4075)
@@ -675,16 +675,6 @@
             $sort_date=3D"<th>$image_sel_asc Date <A class=3D\"mtitle\" =
HREF=3D\"?$url&o=3Ddd\">$image_desc</A></th>";
             $order=3D" order by jr_date_order asc,substring(jr_pj_number=
,'\\d+$')::numeric asc ";
         }
-        // set a filter for the FIN
-        $a_parm_code=3D$this->db->get_array("select p_value from parm_co=
de where p_code in ('BANQUE','COMPTE_COURANT','CAISSE')");
-        $sql_fin=3D"(";
-        $or=3D"";
-        foreach ($a_parm_code as $code)
-        {
-            $sql_fin.=3D"$or j_poste::text like '".$code['p_value']."%'"=
;
-            $or=3D" or ";
-        }
-        $sql_fin.=3D")";
=20
         // Count
         $count=3D$this->db->count_sql($sql);
@@ -699,7 +689,6 @@
=20
         $r=3D"";
=20
-        $r.=3DJS_LEDGER;
=20
         $Max=3DDatabase::num_row($Res);
=20
@@ -717,6 +706,7 @@
         $r.=3D$sort_date;
         $r.=3D$sort_echeance;
         $r.=3D$sort_pj;
+	$r.=3Dth('tiers');
         $r.=3D$sort_description;
 	$r.=3Dth('Notes',' style=3D"width:15%"');
         $r.=3D$sort_amount;
@@ -783,6 +773,9 @@
             $r.=3D$row['jr_pj_number'];
             $r.=3D"</TD>";
=20
+	    // Tiers
+	    $other=3D$this->get_tiers($row['jrn_def_type'],$row['jr_id']);
+	    $r.=3Dtd($other);
             // comment
             $r.=3D"<TD>";
             $tmp_jr_comment=3Dh($row['jr_comment']);
@@ -2530,7 +2523,7 @@
              "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_grpt_id,jr_def_id".
              " from jrn where jr_tech_per >=3D $1 ".
              ' and jr_tech_per <=3D$2  '.$jrn.' order by jr_date,substri=
ng(jr_pj_number,\'\\\d+$\')::numeric asc';
         $ret=3D$this->db->get_array($sql,array($p_from,$p_to));
@@ -2873,7 +2866,7 @@
=20
 	  break ;
 	case 'FIN':
-	  $tiers=3D$this->db->get_value('select qf_bank from quant_fin where jr=
_id=3D$1',array($jr_id));
+	  $tiers=3D$this->db->get_value('select qf_other from quant_fin where j=
r_id=3D$1',array($jr_id));
 	  break ;
=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	2011-04-26 21:25:=
44 UTC (rev 4074)
+++ phpcompta/trunk/include/class_print_ledger_misc.php	2011-04-26 21:26:=
01 UTC (rev 4075)
@@ -44,7 +44,8 @@
         $this->Cell(30,6,'Piece');
         $this->Cell(10,6,'Date');
         $this->Cell(20,6,'Interne');
-        $this->Cell(105,6,'Commentaire');
+        $this->Cell(25,6,'Tiers');
+        $this->Cell(80,6,'Commentaire');
         $this->Cell(15,6,'Montant');
         $this->Ln(6);
=20
@@ -80,8 +81,10 @@
             $this->Cell(30,5,$row['pj']);
             $this->Cell(10,5,$row['date_fmt']);
             $this->Cell(20,5,$row['internal']);
-
-            $this->Cell(105,5,$row['comment'],0,0);
+	    $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=3Dsubstr($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->Cell(15,5,nbm($row['montant']),0,0,'R');
             $this->Ln(5);
=20

Modified: phpcompta/trunk/include/export_histo_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_histo_csv.php	2011-04-26 21:25:44 UTC =
(rev 4074)
+++ phpcompta/trunk/include/export_histo_csv.php	2011-04-26 21:26:01 UTC =
(rev 4075)
@@ -40,6 +40,7 @@
 printf('"%s";',"Date");
 printf('"%s";',"Echeance");
 printf('"%s";',"Piece");
+printf('"%s";',"Tiers");
 printf('"%s";',"Description");
 printf('"%s";',"Note");
 printf('"%s"',"Montant");
@@ -52,6 +53,7 @@
     printf('"%s";',$res[$i]['jr_date']);
     printf('"%s";',$res[$i]['jr_ech']);
     printf('"%s";',$res[$i]['jr_pj_number']);
+    printf('"%s";',$ledger->get_tiers($res[$i]['jrn_def_type'],$res[$i][=
'jr_id']));
     printf('"%s";',$res[$i]['jr_comment']);
     printf('"%s";',$res[$i]['n_text']);
=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	2011-04-26 21:25:44 UTC (=
rev 4074)
+++ phpcompta/trunk/include/impress_jrn.inc.php	2011-04-26 21:26:01 UTC (=
rev 4075)
@@ -262,9 +262,9 @@
             // Get the jrn type
             if ( $line['jrn_def_type'] =3D=3D 'FIN' )
             {
-	      $positive =3D $this->db->get_value("select qf_amount from quant_f=
in where jr_id=3D$1",
+	      $positive =3D $cn->get_value("select qf_amount from quant_fin whe=
re jr_id=3D$1",
 					       array($line['jr_id']));
-	      if ($this->db->count() !=3D 0)
+	      if ($cn->count() !=3D 0)
 		$positive =3D 1;
 	      else
                 $positive =3D ($positive > 0)?1:0;



