phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r610 - in trunk/rapport_avance: . doc include


From: phpcompta-dev
Subject: [Phpcompta-dev] r610 - in trunk/rapport_avance: . doc include
Date: Wed, 11 Dec 2013 17:22:29 +0100 (CET)

Author: danydb
Date: 2013-12-11 17:22:28 +0100 (Wed, 11 Dec 2013)
New Revision: 610

Added:
   trunk/rapport_avance/doc/test-listing.odt
Modified:
   trunk/rapport_avance/doc/
   trunk/rapport_avance/include/class_rapav.php
   trunk/rapport_avance/include/class_rapav_listing.php
   trunk/rapport_avance/include/class_rapav_listing_compute.php
   trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php
   trunk/rapport_avance/include/class_rapport_avance_sql.php
   trunk/rapport_avance/include/declaration.inc.php
   trunk/rapport_avance/raw.php
Log:
Task #939 : create document for each
Task #939 - Listing : G?\195?\169n?\195?\169ration de document


Property changes on: trunk/rapport_avance/doc
___________________________________________________________________
Name: svn:ignore
   - .~lock.rapav.odt#
.~lock.rapav-listing-code.odt#

   + .~lock.rapav.odt#
.~lock.rapav-listing-code.odt#
.~lock.test-listing.odt#


Added: trunk/rapport_avance/doc/test-listing.odt
===================================================================
(Binary files differ)


Property changes on: trunk/rapport_avance/doc/test-listing.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/rapport_avance/include/class_rapav.php
===================================================================
--- trunk/rapport_avance/include/class_rapav.php        2013-12-11 16:21:19 UTC 
(rev 609)
+++ trunk/rapport_avance/include/class_rapav.php        2013-12-11 16:22:28 UTC 
(rev 610)
@@ -99,13 +99,14 @@
      */
     static function get_sql_date($p_date,$p_prefix="")
     {
+        if ($p_prefix != "") {$p_prefix=$p_prefix.".";}
         switch ($p_date)
         {
             case 0:
-                $sql_date = "and ($p_prefix.j_date >= to_date($2,'DD.MM.YYYY') 
and jrn1.j_date <= to_date($3,'DD.MM.YYYY'))";
+                $sql_date = "and (".$p_prefix."j_date >= 
to_date($2,'DD.MM.YYYY') and ".$p_prefix."j_date <= to_date($3,'DD.MM.YYYY'))";
                 break;
             case 1:
-                $sql_date = " and $p_prefix.j_id in 
+                $sql_date = " and ".$p_prefix."j_id in 
                 (select j_id from jrnx join jrn on (j_grpt = jr_grpt_id)
                     where
                     coalesce(jr_date_paid,to_date('01.01.1900','DD.MM.YYYY')) 
>= to_date($2,'DD.MM.YYYY')
@@ -114,7 +115,7 @@
                     ";
                 break;
             case 2:
-                $sql_date = " and $p_prefix.j_id in 
+                $sql_date = " and ".$p_prefix."j_id in 
                 (select j_id from jrnx join jrn on (j_grpt = jr_grpt_id)
                     where
                     coalesce(jr_ech,to_date('01.01.1900','DD.MM.YYYY')) >= 
to_date($2,'DD.MM.YYYY')

Modified: trunk/rapport_avance/include/class_rapav_listing.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing.php        2013-12-11 
16:21:19 UTC (rev 609)
+++ trunk/rapport_avance/include/class_rapav_listing.php        2013-12-11 
16:22:28 UTC (rev 610)
@@ -17,14 +17,14 @@
 class Rapav_Listing
 {
 
-    public $Data; /* !< RAPAV_Listing_SQL */
+    public $data; /* !< RAPAV_Listing_SQL */
     public $a_detail; /* !< array of RAPAV_Listing_Param corresponding to the 
listing */
 
    
 
     function __construct($p_id = -1)
     {
-        $this->Data = new RAPAV_Listing_SQL($p_id);
+        $this->data = new RAPAV_Listing_SQL($p_id);
         $this->a_detail = array();
     }
 
@@ -33,7 +33,7 @@
      */
     function to_list()
     {
-        $res = $this->Data->seek('join fiche_def using (fd_id) order by 
l_name');
+        $res = $this->data->seek('join fiche_def using (fd_id) order by 
l_name');
         require 'template/rapav_listing_to_list.php';
     }
 
@@ -70,15 +70,15 @@
         /*
          * if $this->l_id <> -1 then modification otherwise add
          */
-        if ($this->Data->l_id <> -1)
+        if ($this->data->l_id <> -1)
         {
-            $name->value = $this->Data->l_name;
-            $description->value = $this->Data->l_description;
-            $fichedef->selected = $this->Data->fd_id;
+            $name->value = $this->data->l_name;
+            $description->value = $this->data->l_description;
+            $fichedef->selected = $this->data->fd_id;
             $ck = new ICheckBox('remove');
             $str_remove = " Cochez pour effacer " . $ck->input();
             // If there is a file
-            if ($this->Data->l_filename != "")
+            if ($this->data->l_filename != "")
             {
                 $file = new ISpan('listing_mod_id');
                 // Add js for removing 
@@ -86,11 +86,11 @@
                     'gDossier' => Dossier::id(),
                     'ac' => $_REQUEST['ac'],
                     'pc' => $_REQUEST['plugin_code'],
-                    'id' => $this->Data->l_id,
+                    'id' => $this->data->l_id,
                     'cin' => '',
                     'cout' => 'listing_mod_id');
                 $json = 'listing_remove_modele(' . str_replace('"', "'", 
json_encode($arg)) . ')';
-                $file->value = $this->Data->l_filename . HtmlInput::anchor(' 
<span style="background-color:red">X </span>', "", ' onclick="' . $json . '"');
+                $file->value = $this->data->l_filename . HtmlInput::anchor(' 
<span style="background-color:red">X </span>', "", ' onclick="' . $json . '"');
             }
         }
         require 'template/rapav_listing_form_modify.php';
@@ -114,10 +114,10 @@
                 throw new Exception('Le nom ne peut pas être vide');
             }
 
-            $this->Data->setp('name', $p_array['name']);
-            $this->Data->setp('description', $p_array['description']);
-            $this->Data->setp('fiche_def_id', $p_array['fiche_def']);
-            $this->Data->save();
+            $this->data->setp('name', $p_array['name']);
+            $this->data->setp('description', $p_array['description']);
+            $this->data->setp('fiche_def_id', $p_array['fiche_def']);
+            $this->data->save();
             $this->load_file();
             $cn->commit();
         } catch (Exception $ex)
@@ -156,13 +156,13 @@
                     }
                 }
                 // the upload in the database is successfull
-                $this->Data->l_lob = $oid;
-                $this->Data->l_filename = $_FILES['listing_mod']['name'];
-                $this->Data->l_mimetype = $_FILES['listing_mod']['type'];
-                $this->Data->l_size = $_FILES['listing_mod']['size'];
+                $this->data->l_lob = $oid;
+                $this->data->l_filename = $_FILES['listing_mod']['name'];
+                $this->data->l_mimetype = $_FILES['listing_mod']['type'];
+                $this->data->l_size = $_FILES['listing_mod']['size'];
 
                 // update rapav
-                $this->Data->update();
+                $this->data->update();
             }
         } catch (Exception $ex)
         {
@@ -179,17 +179,17 @@
     function remove_modele()
     {
         global $cn;
-        if ($this->Data->l_lob == null)
+        if ($this->data->l_lob == null)
             return;
         try
         {
             $cn->start();
-            $this->Data->cn->lo_unlink($this->Data->l_lob);
-            $this->Data->l_filename = null;
-            $this->Data->l_lob = null;
-            $this->Data->l_size = null;
-            $this->Data->l_mimetype = null;
-            $this->Data->update();
+            $this->data->cn->lo_unlink($this->data->l_lob);
+            $this->data->l_filename = null;
+            $this->data->l_lob = null;
+            $this->data->l_size = null;
+            $this->data->l_mimetype = null;
+            $this->data->update();
             $cn->commit();
         } catch (Exception $e)
         {
@@ -207,7 +207,7 @@
         try
         {
             $this->remove_modele();
-            $this->Data->delete();
+            $this->data->delete();
         } catch (Exception $e)
         {
             $cn->rollback;
@@ -231,7 +231,7 @@
             'gDossier' => Dossier::id(),
             'ac' => $_REQUEST['ac'],
             'pc' => $_REQUEST['plugin_code'],
-            'id' => $this->Data->l_id,
+            'id' => $this->data->l_id,
             'cin' => 'listing_tb_id',
             'cout' => 'listing_mod_div');
         $json = 'listing_modify(' . str_replace('"', "'", json_encode($arg)) . 
')';
@@ -248,9 +248,9 @@
      */
     function load_detail()
     {
-        if ($this->Data->getp('id') == -1)
+        if ($this->data->getp('id') == -1)
             throw new Exception("Undefined objet " . __FILE__ . ':' . 
__LINE__);
-        $this->a_detail = 
RAPAV_Listing_Param::get_listing_detail($this->Data->getp('id'));
+        $this->a_detail = 
RAPAV_Listing_Param::get_listing_detail($this->data->getp('id'));
     }
 
     /**
@@ -262,7 +262,7 @@
         $arg = json_encode(array(
             'cin' => 'listing_param_input_div_id',
             'gDossier' => Dossier::id(),
-            'id' => $this->Data->getp('id'),
+            'id' => $this->data->getp('id'),
             'tb_id' => 'definition_tb_id',
             'ac' => $_REQUEST['ac'],
             'pc' => $_REQUEST['plugin_code'])
@@ -276,7 +276,7 @@
     {
         $param = new RAPAV_Listing_Param();
         $param->Param->l_id=$l_id;
-        $param->input($this->Data->getp("id"));
+        $param->input($this->data->getp("id"));
     }
 
     /**
@@ -287,9 +287,9 @@
     function get_categorie_name()
     {
         global $cn;
-        if ($this->Data->getp('id') == 0)
+        if ($this->data->getp('id') == 0)
             return;
-        $cat = $cn->get_value('select fd_label from fiche_def where fd_id=$1', 
array($this->Data->getp('fiche_def_id')));
+        $cat = $cn->get_value('select fd_label from fiche_def where fd_id=$1', 
array($this->data->getp('fiche_def_id')));
         return $cat;
     }
 
@@ -301,9 +301,9 @@
     function get_categorie_description()
     {
         global $cn;
-        if ($this->Data->getp('id') == 0)
+        if ($this->data->getp('id') == 0)
             return;
-        $cat = $cn->get_value('select fd_description from fiche_def where 
fd_id=$1', array($this->Data->getp('fiche_def_id')));
+        $cat = $cn->get_value('select fd_description from fiche_def where 
fd_id=$1', array($this->data->getp('fiche_def_id')));
         return $cat;
     }
 

Modified: trunk/rapport_avance/include/class_rapav_listing_compute.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_compute.php        
2013-12-11 16:21:19 UTC (rev 609)
+++ trunk/rapport_avance/include/class_rapav_listing_compute.php        
2013-12-11 16:22:28 UTC (rev 610)
@@ -14,7 +14,7 @@
 require_once 'class_rapav_listing.php';
 require_once 'class_rapav_listing_formula.php';
 require_once 'class_rapport_avance_sql.php';
-
+require_once 'class_rapav_listing_compute_fiche.php';
 class RAPAV_Listing_Compute
 {
 
@@ -22,6 +22,7 @@
      * < Data point to listing_compute
      */
     var $data;
+    var $listing;
 
     /**
      * Type of operation
@@ -34,12 +35,19 @@
     function __construct()
     {
         $this->data = new RAPAV_Listing_Compute_SQL();
+        $this->listing=new RAPAV_Listing();
     }
     function load($p_id)
     {
         $this->data->lc_id=$p_id;
         $this->data->load();
+        $this->load_listing($this->data->l_id);
     }
+    private function load_listing($p_id)
+    {
+        $this->listing->data->l_id=$p_id;
+        $this->listing->data->load();
+    }
     /**
      * Compute all the values and save them in the table rapav_listing_compute
      * @param RAPAV_Listing $rapav_listing
@@ -55,8 +63,9 @@
             $this->data->l_start = $p_date_start;
             $this->data->l_end = $p_date_end;
             $this->data->l_keep = 'N';
-            $this->data->l_id = $rapav_listing->Data->l_id;
+            $this->data->l_id = $rapav_listing->data->l_id;
             $this->data->insert();
+            $this->listing=clone $rapav_listing;
 
             // retrieve all the code from $rapav_listing
             $rapav_listing->load_detail();
@@ -68,7 +77,7 @@
             // ------------------------------------------------------
             // For each card
             $fiche_def = new Fiche_Def($cn);
-            $fiche_def->id = $rapav_listing->Data->getp('fiche_def_id');
+            $fiche_def->id = $rapav_listing->data->getp('fiche_def_id');
             $a_fiche = $fiche_def->get_by_type();
             $nb_fiche = count($a_fiche);
             for ($e = 0; $e < $nb_fiche; $e++)
@@ -214,7 +223,14 @@
      */
     function has_template()
     {
-        return false;
+        if ($this->listing->data->l_filename != "") 
+            {
+                return true;
+            }
+            else 
+            {
+                return false;
+            }
     }
     /**
      * Save the card selected, they are in an array with the idx selected_fiche
@@ -228,6 +244,47 @@
         $to_keep=implode(',',$p_array);
         $to_keep=sql_string($to_keep);
         $cn->exec_sql(" delete from rapport_advanced.listing_compute_fiche
-            where lf_id not in ($to_keep)");
+            where lf_id not in ($to_keep) and 
lc_id=$1",array($this->data->lc_id));
     }
+    function generate()
+    {
+        global $cn;
+        $ofiche=new RAPAV_Listing_Compute_Fiche();
+        $r_fiche=$ofiche->seek (" where lc_id = $1",array($this->data->lc_id));
+        $nb_fiche=Database::num_row($r_fiche);
+
+        /* For each card */
+        for ($i = 0;$i < $nb_fiche;$i++)
+        {
+            $fiche=$ofiche->next($r_fiche,$i);
+            $fiche->set_listing_compute($this);
+            $fiche->generate_document();
+        }
+    }
+    /**
+     * @brief display a form to generate CSV
+     */
+    function propose_CSV()
+    {
+        echo '<form method="GET" action="extension.raw.php" class="noprint" 
style="display:inline">';
+        echo 
HtmlInput::array_to_hidden(array('ac','gDossier','plugin_code','sa'), 
$_REQUEST);
+        echo HtmlInput::hidden('lc_id',$this->data->lc_id);
+        echo HtmlInput::hidden('act','export_listing_csv');
+        echo HtmlInput::submit("export_listing", "Export CSV");
+        echo '</form>';
+    }
+    /**
+     * @brief display a form to generate document
+     */
+
+    function propose_generate()
+    {
+        echo '<form method="GET" action="do.php" class="noprint" 
style="display:inline">';
+        echo 
HtmlInput::array_to_hidden(array('ac','gDossier','plugin_code','sa'), 
$_REQUEST);
+        echo HtmlInput::hidden('lc_id',$this->data->lc_id);
+        echo HtmlInput::submit("generate_document", "Génération des 
documents");
+        echo '</form>';
+        
+    }
+   
 }

Modified: trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php  
2013-12-11 16:21:19 UTC (rev 609)
+++ trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php  
2013-12-11 16:22:28 UTC (rev 610)
@@ -14,8 +14,12 @@
 class RAPAV_Listing_Compute_Fiche extends RAPAV_Listing_Compute_Fiche_SQL
 {
 
-    private function get_file_to_parse(RAPAV_Listing_Compute &$listing_compute)
+    function set_listing_compute(RAPAV_Listing_Compute &$listing_compute)
     {
+        $this->listing_compute=$listing_compute;
+    }
+    private function get_file_to_parse()
+    {
         global $cn;
         // create a temp directory in /tmp to unpack file and to parse it
         $dirname = tempnam($_ENV['TMP'], 'rapav_listing');
@@ -28,8 +32,8 @@
         $cn->start();
 
 
-        $filename = $listing->Data->l_filename;
-        $exp = $cn->lo_export($listing_compute->listing->Data->l_lob, $dirname 
. DIRECTORY_SEPARATOR . $filename);
+        $filename = $this->listing_compute->listing->data->l_filename;
+        $exp = $cn->lo_export($this->listing_compute->listing->data->l_lob, 
$dirname . DIRECTORY_SEPARATOR . $filename);
 
         if ($exp === false)
             echo_warning(__FILE__ . ":" . __LINE__ . "Export NOK $filename");
@@ -37,7 +41,7 @@
         $type = "n";
         // if the doc is a OOo, we need to unzip it first
         // and the name of the file to change is always content.xml
-        if (strpos($listing_compute->listing->Data->l_mimetype, 'vnd.oasis') 
!= 0)
+        if (strpos($this->listing_compute->listing->data->l_mimetype, 
'vnd.oasis') != 0)
         {
             ob_start();
             $zip = new Zip_Extended;
@@ -62,14 +66,14 @@
         return array($file_to_parse, $dirname, $type);
     }
 
-    private function generate_document(RAPAV_Listing_Compute &$listing_compute)
+    function generate_document()
     {
         global $cn;
 
-        if ($listing_compute->listing->Data->l_filename == "")
+        if ($this->listing_compute->listing->data->l_filename == "")
             return;
 
-        list($file_to_parse, $dirname, $type) = 
$this->get_file_to_parse($listing_compute);
+        list($file_to_parse, $dirname, $type) = $this->get_file_to_parse();
 
         // parse the document
         $this->parse_document($dirname, $file_to_parse, $type);
@@ -82,7 +86,7 @@
         {
             ob_start();
             $zip = new Zip_Extended;
-            $res = $zip->open($listing_compute->listing->Data->l_filename, 
ZipArchive::CREATE);
+            $res = 
$zip->open($this->listing_compute->listing->data->l_filename, 
ZipArchive::CREATE);
             if ($res !== TRUE)
             {
                 echo __FILE__ . ":" . __LINE__ . "cannot recreate zip";
@@ -93,7 +97,7 @@
 
             ob_end_clean();
 
-            $file_to_save = $listing_compute->listing->Data->l_filename;
+            $file_to_save = $this->listing_compute->listing->data->l_filename;
         } else
         {
             $file_to_save = $file_to_parse;
@@ -109,7 +113,7 @@
         if ($p_type == "OOo")
         {
             $array = $cn->get_array("select '&lt;&lt;'||lc_code||'&gt;&gt;' as 
code,
-                    coalesce(ld_value_numeric,ld_value_text,ld_value_date) as 
value,
+                    ld_value_numeric,ld_value_text,ld_value_date,
                     case 
                         when ld_value_numeric is not null then 1 
                         when ld_value_text is not null then 2
@@ -121,7 +125,7 @@
         } else
         {
             $array = $cn->get_array("select '<<'||lc_code||'>>' as code,
-                    coalesce(ld_value_numeric,ld_value_text,ld_value_date) as 
value  
+                   ld_value_numeric,ld_value_text,ld_value_date, 
                     case 
                         when ld_value_numeric is not null then 1 
                         when ld_value_text is not null then 2
@@ -156,13 +160,28 @@
             // for each code replace in p_filename the code surrounded by << 
>> by the amount (value) or &lt; or &gt;
             foreach ($array as $key => $value)
             {
-                if ($value['type']==1)
+                switch ($value['type'])
                 {
-                    $searched = 'office:value-type="string"><text:p>' . 
$value['code'];
-                    $replaced = 'office:value-type="float" office:value="' . 
$value['value'] . '"><text:p>' . $value['code'];
-                    $buffer = str_replace($searched, $replaced, $buffer);
+                    case 1:
+                        if ($p_type=='OOo')
+                        {
+                            $searched = 'office:value-type="string"><text:p>' 
. $value['code'];
+                            $replaced = 'office:value-type="float" 
office:value="' . $value['ld_value_numeric'] . '"><text:p>' . $value['code'];
+                            $buffer = str_replace($searched, $replaced, 
$buffer);
+                        }
+                    // everybody
+                        $buffer = str_replace($value['code'], 
$value['ld_value_numeric'], $buffer);
+                    break;
+                    case 2:
+                         $buffer = str_replace($value['code'], 
$value['ld_value_text'], $buffer);
+                        break;
+                    case 3:
+                         $buffer = str_replace($value['code'], 
$value['ld_value_date'], $buffer);
+                        break;
+                    default:
+                        throw new Exception(__FILE__.':'.__LINE__.' type 
inconnu');
+                        break;
                 }
-                $buffer = str_replace($value['code'], $value['value'], 
$buffer);
             }
             // write to output
             fwrite($ofile, $buffer);
@@ -179,12 +198,12 @@
         unlink($oname);
     }
 
-    private function special_tag($p_dir, $p_filename, 
$p_type,RAPAV_Listing_Compute &$listing_compute)
+    private function special_tag($p_dir, $p_filename, $p_type)
     {
         global $cn, $g_parameter;
         // Retrieve all the code + libelle
-        $array[] = array('code' => 'PERIODE_DECLARATION', 'value' => 
format_date($listing_compute->Data->l_start) . " - " . 
format_date($listing_compute->Data->l_end));
-        $array[] = array('code' => 'TITRE', 'value' => 
$listing_compute->listing->Data->l_name);
+        $array[] = array('code' => 'PERIODE_DECLARATION', 'value' => 
format_date($this->listing_compute->data->l_start) . " - " . 
format_date($this->listing_compute->data->l_end));
+        $array[] = array('code' => 'TITRE', 'value' => 
$this->listing_compute->listing->data->l_name);
         $array[] = array('code' => 'DOSSIER', 'value' => 
$cn->format_name($_REQUEST['gDossier'], 'dos'));
         $array[] = array('code' => 'NAME', 'value' => $g_parameter->MY_NAME);
         $array[] = array('code' => 'STREET', 'value' => 
$g_parameter->MY_STREET);
@@ -194,7 +213,7 @@
         $array[] = array('code' => 'PHONE', 'value' => $g_parameter->MY_TEL);
         $array[] = array('code' => 'CEDEX', 'value' => $g_parameter->MY_CP);
         $array[] = array('code' => 'FAX', 'value' => $g_parameter->MY_FAX);
-        $array[] = array('code' => 'NOTE', 'value' => 
$listing_compute->$Data->l_description);
+        $array[] = array('code' => 'NOTE', 'value' => 
$this->listing_compute->data->l_description);
 
         // open the files
         $ifile = fopen($p_dir . '/' . $p_filename, 'r');
@@ -251,7 +270,7 @@
         unlink($oname);
     }
 
-    private function load_document_card($p_file)
+    private function load_document($p_file)
     {
         global $cn;
         $cn->start();
@@ -263,7 +282,8 @@
         }
         $this->lf_size = filesize($p_file);
         $date = date('ymd-Hi');
-        $this->lf_filename = $date . '-' . $this->d_filename;
+        $this->lf_filename = $date . '-' . 
$this->listing_compute->listing->data->l_filename;
+        $this->lf_mimetype= $this->listing_compute->listing->data->l_mimetype;
         $this->update();
         $cn->commit();
     }

Modified: trunk/rapport_avance/include/class_rapport_avance_sql.php
===================================================================
--- trunk/rapport_avance/include/class_rapport_avance_sql.php   2013-12-11 
16:21:19 UTC (rev 609)
+++ trunk/rapport_avance/include/class_rapport_avance_sql.php   2013-12-11 
16:22:28 UTC (rev 610)
@@ -293,7 +293,15 @@
 
 class RAPAV_Listing_SQL extends Phpcompta_SQL
 {
-
+    var $l_id;
+    var $l_description;
+    var $l_name;
+    var $l_lob;
+    var $l_filename;
+    var $l_mimetype;
+    var $l_size;
+    var $fd_id;
+    
     function __construct($p_id = -1)
     {
         $this->table = "rapport_advanced.listing";
@@ -418,8 +426,6 @@
 
     function __construct($p_id = -1)
     {
-
-
         $this->table = "rapport_advanced.listing_compute";
         $this->primary_key = "lc_id";
 

Modified: trunk/rapport_avance/include/declaration.inc.php
===================================================================
--- trunk/rapport_avance/include/declaration.inc.php    2013-12-11 16:21:19 UTC 
(rev 609)
+++ trunk/rapport_avance/include/declaration.inc.php    2013-12-11 16:22:28 UTC 
(rev 610)
@@ -85,6 +85,15 @@
     }
 }
 /**
+ * Generate all the document
+ */
+if ( isset($_GET['generate_document']) )
+{
+    $listing=new RAPAV_Listing_Compute();
+    $listing->load($_GET['lc_id']);
+    $listing->generate();
+}
+/**
  * Save listing now you can export them to csv and generate file if any
  */
 if ( isset($_POST['save_listing']))
@@ -97,10 +106,15 @@
         $listing->save_selected($_POST['selected_card']);
     }
     
+   
+    $listing->display(false);
+    /**
+     * Propose generate and export CSV
+     */
+    $listing->propose_CSV();
     if ($listing->has_template() == true) {
-        $listing->generate_doc();
+        $listing->propose_generate();
     }
-    $listing->display(false);
     exit();
 }
 /*

Modified: trunk/rapport_avance/raw.php
===================================================================
--- trunk/rapport_avance/raw.php        2013-12-11 16:21:19 UTC (rev 609)
+++ trunk/rapport_avance/raw.php        2013-12-11 16:22:28 UTC (rev 610)
@@ -129,4 +129,12 @@
 
        $cn->commit();
 }
+if ($act == 'export_listing_csv')
+{
+    /**
+     * @todo
+     * to finish
+     */
+    echo 'export-listing-csv';
+}
 ?>



---
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]