phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5516 - in phpcompta/trunk/include: . template


From: phpcompta-dev
Subject: [Phpcompta-dev] r5516 - in phpcompta/trunk/include: . template
Date: Sat, 19 Oct 2013 22:22:02 +0200 (CEST)

Author: danydb
Date: 2013-10-19 22:22:02 +0200 (Sat, 19 Oct 2013)
New Revision: 5516

Modified:
   phpcompta/trunk/include/export_ledger_csv.php
   phpcompta/trunk/include/impress_rec.inc.php
   phpcompta/trunk/include/template/print_ledger_simple.php
Log:
Add reconcilied operation

Modified: phpcompta/trunk/include/export_ledger_csv.php
===================================================================
--- phpcompta/trunk/include/export_ledger_csv.php       2013-10-19 19:53:10 UTC 
(rev 5515)
+++ phpcompta/trunk/include/export_ledger_csv.php       2013-10-19 20:22:02 UTC 
(rev 5516)
@@ -135,7 +135,7 @@
     }
     exit;
 }
-else if  ($_GET['p_simple'] == 0)
+else if  ($_GET['p_simple'] == 1)
 {
     $Row=$Jrn->get_rowSimple($_GET['from_periode'],
                              $_GET['to_periode'],
@@ -183,6 +183,8 @@
 //-----------------------------------------------------
     if ( $jrn_type=='ACH' || $jrn_type=='VEN')
     {
+        $cn->prepare('reconcile_date',"select to_char(jr_date,'DD.MM.YY') as 
str_date,* from jrn where jr_id in (select jra_concerned from jrn_rapt where 
jr_id = $1 union all select jr_id from jrn_rapt where jra_concerned=$1)");
+
         $own=new Own($cn);
         $col_tva="";
 
@@ -194,7 +196,7 @@
                 $col_tva.='"Tva '.$line_tva['tva_label'].'";';
             }
         }
-        echo 
'"Date";"operation";"Client/Fourn.";"Commentaire";"inter.";"HTVA";privé;DNA;tva 
non ded.;'.$col_tva.'"TVAC"'."\n\r";
+        echo 
'"Date";"operation";"Client/Fourn.";"Commentaire";"inter.";"HTVA";privé;DNA;tva 
non ded.;opérations liées'.$col_tva.'"TVAC"'."\n\r";
         foreach ($Row as $line)
         {
             printf('"%s";"%s";"%s";"%s";"%s";%s;%s;%s;%s;',
@@ -233,6 +235,18 @@
                 }
             }
             echo nb ($line['TVAC']);
+            /**
+             * Retrieve payment if any
+             */
+             
$ret_reconcile=$cn->execute('reconcile_date',array($line['jr_id']));
+             $max=Database::num_row($ret_reconcile);
+            if ($max > 0) {
+                $sep=";";
+                for ($e=0;$e<$max;$e++) {
+                    $row=Database::fetch_array($ret_reconcile, $e);
+                    echo $sep.$row['str_date'].'; '. $row['jr_internal'];
+                }
+            }
            printf("\r\n");
 
         }

Modified: phpcompta/trunk/include/impress_rec.inc.php
===================================================================
--- phpcompta/trunk/include/impress_rec.inc.php 2013-10-19 19:53:10 UTC (rev 
5515)
+++ phpcompta/trunk/include/impress_rec.inc.php 2013-10-19 20:22:02 UTC (rev 
5516)
@@ -52,7 +52,7 @@
 $dend=new IDate('p_end');
 $dend->value=(isset($_REQUEST['p_end']))?$_REQUEST['p_end']:$end;
 
-echo "Depuis ".$dstart->input()." jusque ".$dend->input();
+echo "Opérations entre ".$dstart->input()." jusque ".$dend->input();
 echo '<ol style="list-style-type:none;">';
 
 $radio->selected=($choice==0)?true:false;

Modified: phpcompta/trunk/include/template/print_ledger_simple.php
===================================================================
--- phpcompta/trunk/include/template/print_ledger_simple.php    2013-10-19 
19:53:10 UTC (rev 5515)
+++ phpcompta/trunk/include/template/print_ledger_simple.php    2013-10-19 
20:22:02 UTC (rev 5516)
@@ -9,6 +9,7 @@
         <th style="text-align:right">Privé</th>
         <th style="text-align:right">DNA</th>
         <th style="text-align:right">TVA ND</th>
+        
 <?php
 $col_tva="";
 
@@ -23,11 +24,18 @@
 echo $col_tva;      
 ?>
         <th style="text-align:right">TVAC</th>
+        <th>Opérations rapprochées</th>
     </tr>
 <?php
 $i = 0;
+$cn->prepare('reconcile_date','select * from jrn where jr_id in (select 
jra_concerned from jrn_rapt where jr_id = $1 union all select jr_id from 
jrn_rapt where jra_concerned=$1)');
 foreach ($Row as $line) {
     $i++;
+    /*
+     * Get date of reconcile operation
+     */
+    $ret_reconcile=$cn->execute('reconcile_date',array($line['jr_id']));
+   
     $class = ($i % 2 == 0) ? ' class="even" ' : ' class="odd" ';
     echo "<tr $class>";
     echo "<TD>" . smaller_date($line['date']) . "</TD>";
@@ -68,6 +76,20 @@
                     }
     }
     echo '<td class="num">'.$line['TVAC'].'</td>';
+    /*
+     * If reconcile print them
+     */
+    echo '<td>';
+    $max=Database::num_row($ret_reconcile);
+    if ($max > 0) {
+        $sep="";
+        for ($e=0;$e<$max;$e++) {
+            $row=Database::fetch_array($ret_reconcile, $e);
+            echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. 
$row['jr_internal']);
+            $sep=' ,';
+        }
+    }
+    echo '</td>';
     echo "</tr>";
 }
 ?>



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



reply via email to

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