noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 01/04: Amélioration : Export détail achat et


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/04: Amélioration : Export détail achat et vente, remplacement des colonnes
Date: Thu, 07 Aug 2014 19:08:40 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit e0986da57bfdd296569e3bd80f742068b6264dd0
Author: Dany De Bontridder <address@hidden>
Date:   Thu Aug 7 20:06:10 2014 +0200

    Amélioration : Export détail achat et vente, remplacement des colonnes
---
 include/class_acc_ledger_purchase.php |   35 +++++++++++++++++++++++++++++++++
 include/class_acc_ledger_sold.php     |   32 ++++++++++++++++++++++++++++++
 include/export_ledger_csv.php         |   14 +++++++-----
 include/export_ledger_pdf.php         |    2 +-
 4 files changed, 76 insertions(+), 7 deletions(-)

diff --git a/include/class_acc_ledger_purchase.php 
b/include/class_acc_ledger_purchase.php
index 0c50e41..055bbab 100644
--- a/include/class_acc_ledger_purchase.php
+++ b/include/class_acc_ledger_purchase.php
@@ -1717,6 +1717,41 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
         $ret = $this->db->exec_sql($sql, array($this->id,$p_from, $p_end));
         return $ret;
     }
+    static function heading_detail_purchase()
+    {
+        $array['jr_id'] = _('Numéro opération');
+        $array['jr_date'] = _('Date');
+        $array['jr_date_paid'] = _('Date paiement');
+        $array['jr_ech'] = _('Date échéance');
+        $array['jr_tech_per'] = _('Période');
+        $array['jr_comment'] = _('Libellé');
+        $array['jr_pj_number'] = _('Pièce');
+        $array['jr_internal'] = _('Interne');
+        $array['jr_def_id'] = _('Code journal');
+        $array['j_poste'] = _('Poste');
+        $array['j_text'] = _('Commentaire');
+        $array['j_qcode'] = _('Code Item');
+        $array['item_card'] = _('N° fiche');
+        $array['item_name'] = _('Nom fiche');
+        $array['qp_supplier'] = _('N° fiche fournisseur');
+        $array['tiers_name'] = _('Nom fournisseur');
+        $array['quick_code'] = _('Code fournisseur');
+        $array['tva_label'] = _('Nom TVA');
+        $array['tva_comment'] = _('Commentaire TVA');
+        $array['tva_both_side'] = _('TVA annulée');
+        $array['vat_sided'] = _('Retrait TVA');
+        $array['vat_code'] = _('Code TVA');
+        $array['vat'] = _('Montant TVA');
+        $array['price'] = _('Total HTVA');
+        $array['quantity'] = _('quantité');
+        $array['price_per_unit'] = _('PU');
+        $array['non_ded_amount'] = _('Montant ND');
+        $array['non_ded_tva'] = _('Montant TVA ND');
+        $array['non_ded_tva_recup'] = _('TVA récup.');
+        $array['htva'] = _('HTVA Opération');
+        $array['tot_vat'] = _('TVA Opération');
+        return $array;
+    }
 
 }
 
diff --git a/include/class_acc_ledger_sold.php 
b/include/class_acc_ledger_sold.php
index a799b31..e6a359a 100644
--- a/include/class_acc_ledger_sold.php
+++ b/include/class_acc_ledger_sold.php
@@ -1301,6 +1301,38 @@ class Acc_Ledger_Sold extends Acc_Ledger {
         $ret = $this->db->exec_sql($sql, array($this->id,$p_from, $p_end));
         return $ret;
     }
+        static function heading_detail_sale()
+    {
+        $array['jr_id'] = _('Numéro opération');
+        $array['jr_date'] = _('Date');
+        $array['jr_date_paid'] = _('Date paiement');
+        $array['jr_ech'] = _('Date échéance');
+        $array['jr_tech_per'] = _('Période');
+        $array['jr_comment'] = _('Libellé');
+        $array['jr_pj_number'] = _('Pièce');
+        $array['jr_internal'] = _('Interne');
+        $array['jr_def_id'] = _('Code journal');
+        $array['j_poste'] = _('Poste');
+        $array['j_text'] = _('Commentaire');
+        $array['j_qcode'] = _('Code Item');
+        $array['item_card'] = _('N° fiche');
+        $array['item_name'] = _('Nom fiche');
+        $array['qs_client'] = _('N° fiche fournisseur');
+        $array['tiers_name'] = _('Nom fournisseur');
+        $array['quick_code'] = _('Code fournisseur');
+        $array['tva_label'] = _('Nom TVA');
+        $array['tva_comment'] = _('Commentaire TVA');
+        $array['tva_both_side'] = _('TVA annulée');
+        $array['vat_sided'] = _('Retrait TVA');
+        $array['vat_code'] = _('Code TVA');
+        $array['vat'] = _('Montant TVA');
+        $array['price'] = _('Total HTVA');
+        $array['quantity'] = _('quantité');
+        $array['price_per_unit'] = _('PU');
+        $array['htva'] = _('HTVA Opération');
+        $array['tot_vat'] = _('TVA Opération');
+        return $array;
+    }
     /* !\brief test function
      */
 
diff --git a/include/export_ledger_csv.php b/include/export_ledger_csv.php
index d3788dc..83baf1d 100644
--- a/include/export_ledger_csv.php
+++ b/include/export_ledger_csv.php
@@ -85,11 +85,13 @@ if ($get_option == 2)
             case 'VEN':
                 $ledger = new Acc_Ledger_Sold($cn, $get_jrn);
                 $ret_detail = $ledger->get_detail_sale($get_from_periode, 
$get_to_periode);
+                $a_heading= Acc_Ledger_Sold::heading_detail_sale();
+                
                 break;
             case 'ACH':
                 $ledger = new Acc_Ledger_Purchase($cn, $get_jrn);
                 $ret_detail = $ledger->get_detail_purchase($get_from_periode, 
$get_to_periode);
-                
+                $a_heading=  Acc_Ledger_Purchase::heading_detail_purchase();
                 break;
             default:
                 die(__FILE__ . ":" . __LINE__ . 'Journal invalide');
@@ -103,10 +105,7 @@ if ($get_option == 2)
         for ($i = 0;$i < $nb ; $i++) {
             $row=Database::fetch_array($ret_detail, $i);
             if ( $i == 0 ) {
-              foreach ($row as $key=>$value) {
-                  if (isNumber($key) == 0 )$array_key[]=$key;
-              }
-              fputcsv($output,$array_key,';');
+              fputcsv($output,$a_heading,';');
             }
             $a_row=array();
             for ($j=0;$j < count($row) / 2;$j++) {
@@ -212,7 +211,10 @@ if  ($get_option == 1)
         $Row=$Jrn->get_rowSimple($get_from_periode,
                              $get_to_periode,
                              0);
-        $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)");
+        $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="";
diff --git a/include/export_ledger_pdf.php b/include/export_ledger_pdf.php
index 4271bf3..2da727a 100644
--- a/include/export_ledger_pdf.php
+++ b/include/export_ledger_pdf.php
@@ -39,7 +39,7 @@ require_once('class_periode.php');
 require_once 'class_print_ledger.php';
 
 
-        $cn = new Database($gDossier);
+$cn = new Database($gDossier);
 $periode = new Periode($cn);
 
 $l_type = "JRN";



reply via email to

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