phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4112 - phpcompta/trunk/include
Date: Tue, 17 May 2011 23:26:02 +0200 (CEST)

Author: danydb
Date: 2011-05-17 23:26:02 +0200 (Tue, 17 May 2011)
New Revision: 4112

Added:
   phpcompta/trunk/include/export_anc_list_csv.php
Modified:
   phpcompta/trunk/include/class_anc_listing.php
   phpcompta/trunk/include/class_anc_operation.php
Log:
change listing -> historique with more details



Modified: phpcompta/trunk/include/class_anc_listing.php
===================================================================
--- phpcompta/trunk/include/class_anc_listing.php       2011-05-17 21:22:54 UTC 
(rev 4111)
+++ phpcompta/trunk/include/class_anc_listing.php       2011-05-17 21:26:02 UTC 
(rev 4112)
@@ -77,12 +77,15 @@
             $r.= _("aucune donnée");
             return $r;
         }
-        $r.= '<table class="result">';
+        $r.= '<table class="result" style="width=100%">';
         $r.= '<tr>'.
              '<th>'._('Date').'</th>'.
-             '<th>'._('Nom').'</th>'.
-             '<th>'._('Description').'</th>'.
-         th(_('Operation')).
+             '<th>'._('Poste').'</th>'.
+             '<th>'._('Quick_code').'</th>'.
+             '<th>'._('Analytique').'</th>'.
+         th(_('Description')).
+             '<th>'._('libelle').'</th>'.
+             '<th>'._('Num.interne').'</th>'.
              '<th>'._('Montant').'</th>'.
              '<th>'._('D/C').'</th>'.
              '</tr>';
@@ -90,10 +93,16 @@
         {
             $r.= '<tr>';
            $detail=($row['jr_id'] != 
null)?HtmlInput::detail_op($row['jr_id'],$row['jr_internal']):'';
+           $post_detail=($row['j_poste'] != 
null)?HtmlInput::history_account($row['j_poste'],$row['j_poste']):'';
+           $card_detail=($row['f_id'] != 
null)?HtmlInput::history_card($row['f_id'],$row['qcode']):'';
+
             $r.=
                 '<td>'.$row['oa_date'].'</td>'.
-                '<td>'.h($row['po_name']).'</td>'.
-                '<td>'.h($row['oa_description']).'</td>'.
+             td($post_detail).
+             td($card_detail).
+             '<td>'.h($row['po_name']).'</td>'.
+             '<td>'.h($row['oa_description']).'</td>'.
+             td($row['jr_comment']).
              '<td>'.$detail.'</td>'.
              '<td class="num">'.nbm($row['oa_amount']).'</td>'.
                 '<td>'.(($row['oa_debit']=='f')?'CREDIT':'DEBIT').'</td>';
@@ -131,10 +140,14 @@
         foreach ( $array as $row)
         {
             // the name and po_id
-            $r.=sprintf("'%s',",$row['oa_date']);
-            $r.=sprintf("'%s',",$row['po_name']);
-            $r.=sprintf("'%s',",$row['oa_description']);
-            $r.=sprintf("%12.2f,",$row['oa_amount']);
+            $r.=sprintf('"%s";',$row['oa_date']);
+            $r.=sprintf('"%s";',$row['j_poste']);
+            $r.=sprintf('"%s";',$row['qcode']);
+            $r.=sprintf('"%s";',$row['po_name']);
+            $r.=sprintf('"%s";',$row['oa_description']);
+            $r.=sprintf('"%s";',$row['oa_description']);
+
+            $r.=sprintf("%12.2f;",$row['oa_amount']);
             $r.=sprintf("'%s'",(($row['oa_debit']=='f')?'CREDIT':'DEBIT'));
             $r.="\r\n";
         }

Modified: phpcompta/trunk/include/class_anc_operation.php
===================================================================
--- phpcompta/trunk/include/class_anc_operation.php     2011-05-17 21:22:54 UTC 
(rev 4111)
+++ phpcompta/trunk/include/class_anc_operation.php     2011-05-17 21:26:02 UTC 
(rev 4112)
@@ -134,15 +134,28 @@
         $pa_id_cond="";
         if ( isset ( $this->pa_id) && $this->pa_id !='')
             $pa_id_cond= "pa_id=".$this->pa_id." and";
+       $sql="
+       select oa_id,   
+       po_name,
+       oa_description,
+       po_description,
+       oa_debit,
+       to_char(oa_date,'DD.MM.YYYY') as oa_date,
+       oa_amount,
+       oa_group,
+       j_id , 
+       jr_internal,  
+       jr_id, 
+       jr_comment,
+       j_poste,
+       jrnx.f_id,
+       ( select ad_value from fiche_Detail where f_id=jrnx.f_id and ad_id=23) 
as qcode
+       from operation_analytique as B join poste_analytique using(po_id) 
+       left join jrnx using (j_id)
+       left join jrn on  (j_grpt=jr_grpt_id)
+             where $pa_id_cond oa_amount <> 0.0 $cond $cond_poste
+       order by oa_date ,oa_group,oa_debit desc,oa_id";
 
-        $sql="select oa_id,po_name,oa_description,po_description,".
-             "oa_debit,to_char(oa_date,'DD.MM.YYYY') as 
oa_date,oa_amount,oa_group,j_id ,".
-         " ( select  jr_internal from jrn join jrnx on (j_grpt=jr_grpt_id) 
where jrnx.j_id=B.j_id) as jr_internal ,".
-         " ( select  jr_id from jrn join jrnx on (j_grpt=jr_grpt_id) where 
jrnx.j_id=B.j_id) as jr_id ".
-             " from operation_analytique as B".
-             " join poste_analytique using(po_id) ".
-             "where $pa_id_cond oa_amount <> 0.0 $cond $cond_poste".
-             " order by oa_date ,oa_group,oa_debit desc,oa_id";
         $RetSql=$this->db->exec_sql($sql);
 
         $array=Database::fetch_all($RetSql);

Added: phpcompta/trunk/include/export_anc_list_csv.php
===================================================================
--- phpcompta/trunk/include/export_anc_list_csv.php                             
(rev 0)
+++ phpcompta/trunk/include/export_anc_list_csv.php     2011-05-17 21:26:02 UTC 
(rev 4112)
@@ -0,0 +1,37 @@
+<?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
+*/
+/* $Revision: 3671 $ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/*!\file
+* \brief  export the operation in pdf
+ *
+ */
+header('Pragma: public');
+header('Content-type: application/csv');
+header('Content-Disposition: attachment;filename="jrn.csv"',FALSE);
+
+require_once ('class_anc_listing.php');
+
+$cn=new Database(dossier::id());
+
+$bal=new Anc_Listing($cn);
+$bal->get_request();
+echo $bal->display_csv();




reply via email to

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