phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r4075 - phpcompta/trunk/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4075 - phpcompta/trunk/include
Date: Tue, 26 Apr 2011 23:26:01 +0200 (CEST)

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
===================================================================
--- 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="<th>$image_sel_asc Date <A class=\"mtitle\" 
HREF=\"?$url&o=dd\">$image_desc</A></th>";
             $order=" order by jr_date_order 
asc,substring(jr_pj_number,'\\d+$')::numeric asc ";
         }
-        // set a filter for the FIN
-        $a_parm_code=$this->db->get_array("select p_value from parm_code where 
p_code in ('BANQUE','COMPTE_COURANT','CAISSE')");
-        $sql_fin="(";
-        $or="";
-        foreach ($a_parm_code as $code)
-        {
-            $sql_fin.="$or j_poste::text like '".$code['p_value']."%'";
-            $or=" or ";
-        }
-        $sql_fin.=")";
 
         // Count
         $count=$this->db->count_sql($sql);
@@ -699,7 +689,6 @@
 
         $r="";
 
-        $r.=JS_LEDGER;
 
         $Max=Database::num_row($Res);
 
@@ -717,6 +706,7 @@
         $r.=$sort_date;
         $r.=$sort_echeance;
         $r.=$sort_pj;
+       $r.=th('tiers');
         $r.=$sort_description;
        $r.=th('Notes',' style="width:15%"');
         $r.=$sort_amount;
@@ -783,6 +773,9 @@
             $r.=$row['jr_pj_number'];
             $r.="</TD>";
 
+           // Tiers
+           $other=$this->get_tiers($row['jrn_def_type'],$row['jr_id']);
+           $r.=td($other);
             // comment
             $r.="<TD>";
             $tmp_jr_comment=h($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 >= $1 ".
              ' and jr_tech_per <=$2  '.$jrn.' order by 
jr_date,substring(jr_pj_number,\'\\\d+$\')::numeric asc';
         $ret=$this->db->get_array($sql,array($p_from,$p_to));
@@ -2873,7 +2866,7 @@
 
          break ;
        case 'FIN':
-         $tiers=$this->db->get_value('select qf_bank from quant_fin where 
jr_id=$1',array($jr_id));
+         $tiers=$this->db->get_value('select qf_other from quant_fin where 
jr_id=$1',array($jr_id));
          break ;
 
        }

Modified: phpcompta/trunk/include/class_print_ledger_misc.php
===================================================================
--- 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);
 
@@ -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=$this->cn->get_value("select jrn_def_type from jrn_def where 
jrn_def_id=$1",array($a_jrn[$i]['jr_def_id']));
+           
$other=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->Cell(15,5,nbm($row['montant']),0,0,'R');
             $this->Ln(5);
 

Modified: phpcompta/trunk/include/export_histo_csv.php
===================================================================
--- 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']);
 

Modified: phpcompta/trunk/include/impress_jrn.inc.php
===================================================================
--- 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'] == 'FIN' )
             {
-             $positive = $this->db->get_value("select qf_amount from quant_fin 
where jr_id=$1",
+             $positive = $cn->get_value("select qf_amount from quant_fin where 
jr_id=$1",
                                               array($line['jr_id']));
-             if ($this->db->count() != 0)
+             if ($cn->count() != 0)
                $positive = 1;
              else
                 $positive = ($positive > 0)?1:0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]