diff --git a/htdocs/compta/export/modules/compta.export.poivre.class.php b/htdocs/compta/export/modules/compta.export.poivre.class.php
index 0e3ed754919..fd8659249a3 100644
--- a/htdocs/compta/export/modules/compta.export.poivre.class.php
+++ b/htdocs/compta/export/modules/compta.export.poivre.class.php
@@ -1,6 +1,6 @@
- *
+ *
* This program 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
@@ -17,343 +17,344 @@
*
* $Id$
* $Source$
- *
*/
require_once DOL_DOCUMENT_ROOT."/includes/php_writeexcel/class.writeexcel_workbook.inc.php";
require_once DOL_DOCUMENT_ROOT."/includes/php_writeexcel/class.writeexcel_worksheet.inc.php";
-class ComptaExportPoivre
+
+
+class ComptaExportPoivre extends ComptaExport
{
- function ComptaExportPoivre ($DB, $USER)
- {
- $this->db = $DB;
- $this->user = $USER;
- }
-
- /**
- * Agrégation des lignes de facture
- *
- *
- */
-
- function Agregate($line_in)
- {
- dolibarr_syslog("ComptaExportPoivre::Agregate");
- dolibarr_syslog("ComptaExportPoivre::Agregate " . sizeof($line_in) . " lignes en entrées");
- $i = 0;
- $j = 0;
- $n = sizeof($line_in);
-
- // On commence par la ligne 0
-
- $this->line_out[$j] = $line_in[$i];
-
- //print "$j ".$this->line_out[$j][8] . "
";
-
- for ( $i = 1 ; $i < $n ; $i++)
- {
- // On agrège les lignes avec le même code comptable
-
- if ( ($line_in[$i][1] == $line_in[$i-1][1]) && ($line_in[$i][4] == $line_in[$i-1][4]) )
- {
- $this->line_out[$j][8] = ($this->line_out[$j][8] + $line_in[$i][8]);
- }
- else
- {
- $j++;
- $this->line_out[$j] = $line_in[$i];
- }
-
- // print "$j ".$this->line_out[$j][8] . "
";
-
- }
-
- dolibarr_syslog("ComptaExportPoivre::Agregate " . sizeof($this->line_out) . " lignes en sorties");
-
- return 0;
- }
-
- /*
- *
- *
- */
- function Export($linec, $linep, $id=0)
- {
- $error = 0;
-
- dolibarr_syslog("ComptaExportPoivre::Export");
- dolibarr_syslog("ComptaExportPoivre::Export " . sizeof($linec) . " lignes en entrées");
-
- $this->Agregate($linec);
-
- $this->db->begin();
-
- if ($id == 0)
- {
- $dt = strftime('EC%y%m', time());
-
- $sql = "SELECT count(ref) FROM ".MAIN_DB_PREFIX."export_compta";
- $sql .= " WHERE ref like '$dt%'";
-
- if ($this->db->query($sql))
- {
- $row = $this->db->fetch_row();
- $cc = $row[0];
- }
- else
- {
- $error++;
- dolibarr_syslog("ComptaExportPoivre::Export Erreur Select");
- }
-
-
- if (!$error)
- {
- $this->ref = $dt . substr("000".$cc, -2);
-
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."export_compta (ref, date_export, fk_user)";
- $sql .= " VALUES ('".$this->ref."', now(),".$this->user->id.")";
-
- if ($this->db->query($sql))
- {
- $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."export_compta");
- }
- else
- {
- $error++;
- dolibarr_syslog("ComptaExportPoivre::Export Erreur INSERT");
- }
- }
- }
- else
- {
- $this->id = $id;
-
- $sql = "SELECT ref FROM ".MAIN_DB_PREFIX."export_compta";
- $sql .= " WHERE rowid = ".$this->id;
-
- $resql = $this->db->query($sql);
-
- if ($resql)
- {
- $row = $this->db->fetch_row($resql);
- $this->ref = $row[0];
- }
- else
- {
- $error++;
- dolibarr_syslog("ComptaExportPoivre::Export Erreur Select");
- }
- }
+ var $db;
+ var $user;
- if (!$error)
- {
- dolibarr_syslog("ComptaExportPoivre::Export ref : ".$this->ref);
+ function ComptaExportPoivre ($DB, $USER)
+ {
+ $this->db = $DB;
+ $this->user = $USER;
+ }
- $fxname = DOL_DATA_ROOT."/compta/export/".$this->ref.".xls";
+ /**
+ * Agrégation des lignes de facture
+ */
+ function Agregate($line_in)
+ {
+ dolibarr_syslog("ComptaExportPoivre::Agregate");
+ dolibarr_syslog("ComptaExportPoivre::Agregate " . sizeof($line_in) . " lignes en entrées");
+ $i = 0;
+ $j = 0;
+ $n = sizeof($line_in);
- $workbook = &new writeexcel_workbook($fxname);
+ // On commence par la ligne 0
- $page = &$workbook->addworksheet('Export');
+ $this->line_out[$j] = $line_in[$i];
- $page->set_column(0,0,8); // A
- $page->set_column(1,1,6); // B
- $page->set_column(2,2,9); // C
- $page->set_column(3,3,14); // D
- $page->set_column(4,4,44); // E
- $page->set_column(5,5,9); // F Numéro de pièce
- $page->set_column(6,6,8); // G
+ //print "$j ".$this->line_out[$j][8] . "
";
-
- // Pour les factures
+ for ( $i = 1 ; $i < $n ; $i++)
+ {
+ // On agrège les lignes avec le même code comptable
- //A 0 Date Opération 040604 pour 4 juin 2004
- //B 1 VE -> ventilation
- //C 2 code Compte général
- //D 3 code client
- //E 4 Intitulé
- //F 5 Numéro de pièce
- //G 6 Date d'échéance, = à la date d'opération si pas d'échéance
- //H 7 Montant
- //I 8 Type opération D pour Débit ou C pour Crédit
- //J 9 EUR pour Monnaie en Euros
-
- // Pour les paiements
+ if ( ($line_in[$i][1] == $line_in[$i-1][1]) && ($line_in[$i][4] == $line_in[$i-1][4]) )
+ {
+ $this->line_out[$j][8] = ($this->line_out[$j][8] + $line_in[$i][8]);
+ }
+ else
+ {
+ $j++;
+ $this->line_out[$j] = $line_in[$i];
+ }
- $i = 0;
- $j = 0;
- $n = sizeof($this->line_out);
+ // print "$j ".$this->line_out[$j][8] . "
";
- $oldfacture = 0;
+ }
- for ( $i = 0 ; $i < $n ; $i++)
- {
- if ( $oldfacture <> $this->line_out[$i][1])
- {
- // Ligne client
- $page->write_string($j, 0, strftime("%d%m%y",$this->line_out[$i][0]));
- $page->write_string($j, 1, "VI");
- $page->write_string($j, 2, "41100000");
- $page->write_string($j, 3, stripslashes($this->line_out[$i][2]));
- $page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture");
- $page->write_string($j, 5, $this->line_out[$i][5]); // Numéro de factur
- $page->write($j, 6, ereg_replace(",",".",$this->line_out[$i][7]));
- $page->write_string($j, 7, 'D' ); // D pour débit
- $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
+ dolibarr_syslog("ComptaExportPoivre::Agregate " . sizeof($this->line_out) . " lignes en sorties");
- $j++;
+ return 0;
+ }
- // Ligne TVA
- $page->write_string($j, 0, strftime("%d%m%y",$this->line_out[$i][0]));
- $page->write_string($j, 1, "VI");
- $page->write_string($j, 2, '4457119');
+ /*
+ *
+ */
+ function Export($linec, $linep, $id=0)
+ {
+ $error = 0;
- $page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture");
- $page->write_string($j, 5, $this->line_out[$i][5]); // Numéro de facture
- $page->write($j, 6, ereg_replace(",",".",$this->line_out[$i][6])); // Montant de TVA
- $page->write_string($j, 7, 'C'); // C pour crédit
- $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
+ dolibarr_syslog("ComptaExportPoivre::Export");
+ dolibarr_syslog("ComptaExportPoivre::Export " . sizeof($linec) . " lignes en entrées");
-
- $oldfacture = $this->line_out[$i][1];
- $j++;
- }
+ $this->Agregate($linec);
- $page->write_string($j, 0, strftime("%d%m%y",$this->line_out[$i][0]));
- $page->write_string($j, 1, 'VI');
- $page->write_string($j, 2, $this->line_out[$i][4]); // Code Comptable
- $page->write_string($j, 4, $this->line_out[$i][3]." Facture");
- $page->write_string($j, 5, $this->line_out[$i][5]);
- $page->write($j, 6, ereg_replace(",",".",round($this->line_out[$i][8], 2)));
- $page->write_string($j, 7, 'C'); // C pour crédit
- $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
+ $this->db->begin();
- $j++;
- }
+ if ($id == 0)
+ {
+ $dt = strftime('EC%y%m', time());
- // Tag des lignes de factures
- $n = sizeof($linec);
- for ( $i = 0 ; $i < $n ; $i++)
- {
- $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet";
- $sql .= " SET fk_export_compta=".$this->id;
- $sql .= " WHERE rowid = ".$linec[$i][10];
+ $sql = "SELECT count(ref) FROM ".MAIN_DB_PREFIX."export_compta";
+ $sql .= " WHERE ref like '$dt%'";
- if (!$this->db->query($sql))
- {
- $error++;
- }
- }
+ if ($this->db->query($sql))
+ {
+ $row = $this->db->fetch_row();
+ $cc = $row[0];
+ }
+ else
+ {
+ $error++;
+ dolibarr_syslog("ComptaExportPoivre::Export Erreur Select");
+ }
- // Pour les paiements
- // Date Opération 040604 pour 4 juin 2004
- // CE -> caisse d'epargne
- // code Compte général
- // code client
- // Intitulé
- // Numéro de pièce
- // Montant
- // Type opération D pour Débit ou C pour Crédit
- // Date d'échéance, = à la date d'opération si pas d'échéance
- // EUR pour Monnaie en Euros
-
- $i = 0;
- //$j = 0;
- $n = sizeof($linep);
+ if (!$error)
+ {
+ $this->ref = $dt . substr("000".$cc, -2);
- $oldfacture = 0;
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."export_compta (ref, date_export, fk_user)";
+ $sql .= " VALUES ('".$this->ref."', now(),".$this->user->id.")";
- for ( $i = 0 ; $i < $n ; $i++)
- {
- /*
- * En cas de rejet ou paiement en négatif on inverse debit et credit
- *
- *
- */
- if ($linep[$i][5] >= 0)
- {
- $debit = "D";
- $credit = "C";
- }
- else
- {
- $debit = "C";
- $credit = "D";
+ if ($this->db->query($sql))
+ {
+ $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."export_compta");
+ }
+ else
+ {
+ $error++;
+ dolibarr_syslog("ComptaExportPoivre::Export Erreur INSERT");
+ }
+ }
+ }
+ else
+ {
+ $this->id = $id;
- if ($linep[$i][6] == 'Prélèvement')
- {
- $linep[$i][6] = 'Rejet Prelevement';
- }
+ $sql = "SELECT ref FROM ".MAIN_DB_PREFIX."export_compta";
+ $sql .= " WHERE rowid = ".$this->id;
- }
+ $resql = $this->db->query($sql);
- $page->write_string($j,0, strftime("%d%m%y",$linep[$i][0]));
- $page->write_string($j,1, 'CE');
+ if ($resql)
+ {
+ $row = $this->db->fetch_row($resql);
+ $this->ref = $row[0];
+ }
+ else
+ {
+ $error++;
+ dolibarr_syslog("ComptaExportPoivre::Export Erreur Select");
+ }
+ }
- $page->write_string($j,2, '5122000');
- if ($linep[$i][6] == 'Prélèvement')
- {
- $linep[$i][6] = 'Prelevement';
- }
+ if (!$error)
+ {
+ dolibarr_syslog("ComptaExportPoivre::Export ref : ".$this->ref);
- $page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); //
- $page->write_string($j,5, $linep[$i][7]); // Numéro de facture
+ $fxname = DOL_DATA_ROOT."/compta/export/".$this->ref.".xls";
- $page->write($j,6, ereg_replace(",",".",round(abs($linep[$i][5]), 2))); // Montant de la ligne
- $page->write_string($j,7,$debit);
- $page->write_string($j,8, strftime("%d%m%y",$linep[$i][0]));
+ $workbook = &new writeexcel_workbook($fxname);
-
- $j++;
+ $page = &$workbook->addworksheet('Export');
- $page->write_string($j,0, strftime("%d%m%y",$linep[$i][0]));
- $page->write_string($j,1, 'CE');
+ $page->set_column(0,0,8); // A
+ $page->set_column(1,1,6); // B
+ $page->set_column(2,2,9); // C
+ $page->set_column(3,3,14); // D
+ $page->set_column(4,4,44); // E
+ $page->set_column(5,5,9); // F Numéro de pièce
+ $page->set_column(6,6,8); // G
- $page->write_string($j,2, '41100000');
- $page->write_string($j,3, $linep[$i][2]);
- $page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); //
- $page->write_string($j,5, $linep[$i][7]); // Numéro de facture
- $page->write($j,6, ereg_replace(",",".",round(abs($linep[$i][5]), 2))); // Montant de la ligne
- $page->write_string($j,7, $credit);
- $page->write_string($j,8, strftime("%d%m%y",$linep[$i][0]));
-
- $j++;
- }
- $workbook->close();
+ // Pour les factures
- // Tag des lignes de factures
- $n = sizeof($linep);
- for ( $i = 0 ; $i < $n ; $i++)
+ //A 0 Date Opération 040604 pour 4 juin 2004
+ //B 1 VE -> ventilation
+ //C 2 code Compte général
+ //D 3 code client
+ //E 4 Intitul
+ //F 5 Numéro de pièce
+ //G 6 Date d'échéance, = à la date d'opération si pas d'échéance
+ //H 7 Montant
+ //I 8 Type opération D pour Débit ou C pour Crédit
+ //J 9 EUR pour Monnaie en Euros
- {
- $sql = "UPDATE ".MAIN_DB_PREFIX."paiement";
- $sql .= " SET fk_export_compta=".$this->id;
- $sql .= " WHERE rowid = ".$linep[$i][1];
+ // Pour les paiements
- if (!$this->db->query($sql))
- {
- $error++;
- }
- }
+ $i = 0;
+ $j = 0;
+ $n = sizeof($this->line_out);
- }
+ $oldfacture = 0;
- if (!$error)
- {
- $this->db->commit();
- dolibarr_syslog("ComptaExportPoivre::Export COMMIT");
- }
- else
- {
- $this->db->rollback();
- dolibarr_syslog("ComptaExportPoivre::Export ROLLBACK");
- }
+ for ( $i = 0 ; $i < $n ; $i++)
+ {
+ if ( $oldfacture <> $this->line_out[$i][1])
+ {
+ // Ligne client
+ $page->write_string($j, 0, strftime("%d%m%y",$this->line_out[$i][0]));
+ $page->write_string($j, 1, "VI");
+ $page->write_string($j, 2, "41100000");
+ $page->write_string($j, 3, stripslashes($this->line_out[$i][2]));
+ $page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture");
+ $page->write_string($j, 5, $this->line_out[$i][5]); // Numéro de factur
+ $page->write($j, 6, ereg_replace(",",".",$this->line_out[$i][7]));
+ $page->write_string($j, 7, 'D' ); // D pour débit
+ $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
- return 0;
- }
+ $j++;
+
+ // Ligne TVA
+ $page->write_string($j, 0, strftime("%d%m%y",$this->line_out[$i][0]));
+ $page->write_string($j, 1, "VI");
+ $page->write_string($j, 2, '4457119');
+
+ $page->write_string($j, 4, stripslashes($this->line_out[$i][3])." Facture");
+ $page->write_string($j, 5, $this->line_out[$i][5]); // Numéro de facture
+ $page->write($j, 6, ereg_replace(",",".",$this->line_out[$i][6])); // Montant de TVA
+ $page->write_string($j, 7, 'C'); // C pour crédit
+ $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
+
+
+ $oldfacture = $this->line_out[$i][1];
+ $j++;
+ }
+
+ $page->write_string($j, 0, strftime("%d%m%y",$this->line_out[$i][0]));
+ $page->write_string($j, 1, 'VI');
+ $page->write_string($j, 2, $this->line_out[$i][4]); // Code Comptable
+ $page->write_string($j, 4, $this->line_out[$i][3]." Facture");
+ $page->write_string($j, 5, $this->line_out[$i][5]);
+ $page->write($j, 6, ereg_replace(",",".",round($this->line_out[$i][8], 2)));
+ $page->write_string($j, 7, 'C'); // C pour crédit
+ $page->write_string($j, 8, strftime("%d%m%y",$this->line_out[$i][0]));
+
+ $j++;
+ }
+
+ // Tag des lignes de factures
+ $n = sizeof($linec);
+ for ( $i = 0 ; $i < $n ; $i++)
+ {
+ $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet";
+ $sql .= " SET fk_export_compta=".$this->id;
+ $sql .= " WHERE rowid = ".$linec[$i][10];
+
+ if (!$this->db->query($sql))
+ {
+ $error++;
+ }
+ }
+
+ // Pour les paiements
+
+ // Date Opération 040604 pour 4 juin 2004
+ // CE -> caisse d'epargne
+ // code Compte général
+ // code client
+ // Intitul
+ // Numéro de pièce
+ // Montant
+ // Type opération D pour Débit ou C pour Crédit
+ // Date d'échéance, = à la date d'opération si pas d'échéance
+ // EUR pour Monnaie en Euros
+
+ $i = 0;
+ //$j = 0;
+ $n = sizeof($linep);
+
+ $oldfacture = 0;
+
+ for ( $i = 0 ; $i < $n ; $i++)
+ {
+ /*
+ * En cas de rejet ou paiement en négatif on inverse debit et credit
+ *
+ *
+ */
+ if ($linep[$i][5] >= 0)
+ {
+ $debit = "D";
+ $credit = "C";
+ }
+ else
+ {
+ $debit = "C";
+ $credit = "D";
+
+ if ($linep[$i][6] == 'Prélèvement')
+ {
+ $linep[$i][6] = 'Rejet Prelevement';
+ }
+
+ }
+
+ $page->write_string($j,0, strftime("%d%m%y",$linep[$i][0]));
+ $page->write_string($j,1, 'CE');
+
+ $page->write_string($j,2, '5122000');
+
+ if ($linep[$i][6] == 'Prélèvement')
+ {
+ $linep[$i][6] = 'Prelevement';
+ }
+
+ $page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); //
+ $page->write_string($j,5, $linep[$i][7]); // Numéro de facture
+
+ $page->write($j,6, ereg_replace(",",".",round(abs($linep[$i][5]), 2))); // Montant de la ligne
+ $page->write_string($j,7,$debit);
+ $page->write_string($j,8, strftime("%d%m%y",$linep[$i][0]));
+
+
+ $j++;
+
+ $page->write_string($j,0, strftime("%d%m%y",$linep[$i][0]));
+ $page->write_string($j,1, 'CE');
+
+ $page->write_string($j,2, '41100000');
+ $page->write_string($j,3, $linep[$i][2]);
+ $page->write_string($j,4, stripslashes($linep[$i][3])." ".stripslashes($linep[$i][6])); //
+ $page->write_string($j,5, $linep[$i][7]); // Numéro de facture
+ $page->write($j,6, ereg_replace(",",".",round(abs($linep[$i][5]), 2))); // Montant de la ligne
+ $page->write_string($j,7, $credit);
+ $page->write_string($j,8, strftime("%d%m%y",$linep[$i][0]));
+
+ $j++;
+
+ }
+ $workbook->close();
+
+ // Tag des lignes de factures
+ $n = sizeof($linep);
+ for ( $i = 0 ; $i < $n ; $i++)
+
+ {
+ $sql = "UPDATE ".MAIN_DB_PREFIX."paiement";
+ $sql .= " SET fk_export_compta=".$this->id;
+ $sql .= " WHERE rowid = ".$linep[$i][1];
+
+ if (!$this->db->query($sql))
+ {
+ $error++;
+ }
+ }
+
+ }
+
+ if (!$error)
+ {
+ $this->db->commit();
+ dolibarr_syslog("ComptaExportPoivre::Export COMMIT");
+ }
+ else
+ {
+ $this->db->rollback();
+ dolibarr_syslog("ComptaExportPoivre::Export ROLLBACK");
+ }
+
+ return 0;
+ }
}
diff --git a/htdocs/compta/export/modules/compta.export.safran.class.php b/htdocs/compta/export/modules/compta.export.safran.class.php
index 3e344c6b75e..2e985a4cfbf 100644
--- a/htdocs/compta/export/modules/compta.export.safran.class.php
+++ b/htdocs/compta/export/modules/compta.export.safran.class.php
@@ -1,6 +1,6 @@
- *
+ *
* This program 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
@@ -17,111 +17,112 @@
*
* $Id$
* $Source$
- *
*/
require_once DOL_DOCUMENT_ROOT."/includes/php_writeexcel/class.writeexcel_workbook.inc.php";
require_once DOL_DOCUMENT_ROOT."/includes/php_writeexcel/class.writeexcel_worksheet.inc.php";
+
class ComptaExportTableur extends ComptaExport
{
- function ComptaExportTableur ()
- {
- }
+ function ComptaExportTableur ()
+ {
- function Create()
- {
+ }
- $this->date = time();
+ function Create()
+ {
- $this->datef = "commande-".strftime("%d%b%y-%HH%M", $this->date);
+ $this->date = time();
- $fname = DOL_DATA_ROOT ."/telephonie/ligne/commande/".$this->datef.".xls";
+ $this->datef = "commande-".strftime("%d%b%y-%HH%M", $this->date);
- if (strlen(trim($this->fournisseur->email_commande)) == 0)
- {
- return -3;
- }
+ $fname = DOL_DATA_ROOT ."/telephonie/ligne/commande/".$this->datef.".xls";
- if (file_exists($fname))
- {
- return 2;
- }
- else
- {
- $res = $this->CreateFile($fname);
- $res = $res + $this->LogSql();
- $res = $res + $this->MailFile($fname);
+ if (strlen(trim($this->fournisseur->email_commande)) == 0)
+ {
+ return -3;
+ }
- return $res;
- }
- }
+ if (file_exists($fname))
+ {
+ return 2;
+ }
+ else
+ {
+ $res = $this->CreateFile($fname);
+ $res = $res + $this->LogSql();
+ $res = $res + $this->MailFile($fname);
- function Export($linec)
- {
- $fname = "/tmp/toto.xls";
+ return $res;
+ }
+ }
- $workbook = &new writeexcel_workbook($fname);
+ function Export($linec)
+ {
+ $fname = "/tmp/toto.xls";
- $worksheet = &$workbook->addworksheet();
+ $workbook = &new writeexcel_workbook($fname);
- // Pour les factures
+ $worksheet = &$workbook->addworksheet();
- // Date Opération 040604 pour 4 juin 2004
- // VE -> ventilation
- // code Compte général
- // code client
- // Intitulé
- // Numéro de pièce
- // Montant
- // Type opération D pour Débit ou C pour Crédit
- // Date d'échéance, = à la date d'opération si pas d'échéance
- // EUR pour Monnaie en Euros
-
- // Pour les paiements
+ // Pour les factures
- $worksheet->set_column('A:A', 20);
- $worksheet->set_column('B:B', 20);
- $worksheet->set_column('C:C', 15);
- $worksheet->set_column('D:D', 9);
- $worksheet->set_column('E:E', 16);
- $worksheet->set_column('F:F', 18);
- $worksheet->set_column('G:G', 20);
-
- $i = 0;
- $j = 0;
- $n = sizeof($linec);
+ // Date Opération 040604 pour 4 juin 2004
+ // VE -> ventilation
+ // code Compte général
+ // code client
+ // Intitul
+ // Numéro de pièce
+ // Montant
+ // Type opération D pour Débit ou C pour Crédit
+ // Date d'échéance, = à la date d'opération si pas d'échéance
+ // EUR pour Monnaie en Euros
- $oldfacture = 0;
+ // Pour les paiements
- for ( $i = 0 ; $i < $n ; $i++)
- {
- if ( $oldfacture <> $linec[$i][1])
- {
- $worksheet->write_string($j, 0, strftime("%d%m%y",$linec[$i][0]));
- $worksheet->write_string($j, 1, 'VE');
- $worksheet->write_string($j, 3, '411000000');
- $worksheet->write_string($j, 4, $linec[$i][3]." Facture");
-
-
- $oldfacture = $linec[$i][1];
- $j++;
- }
+ $worksheet->set_column('A:A', 20);
+ $worksheet->set_column('B:B', 20);
+ $worksheet->set_column('C:C', 15);
+ $worksheet->set_column('D:D', 9);
+ $worksheet->set_column('E:E', 16);
+ $worksheet->set_column('F:F', 18);
+ $worksheet->set_column('G:G', 20);
+
+ $i = 0;
+ $j = 0;
+ $n = sizeof($linec);
+
+ $oldfacture = 0;
+
+ for ( $i = 0 ; $i < $n ; $i++)
+ {
+ if ( $oldfacture <> $linec[$i][1])
+ {
+ $worksheet->write_string($j, 0, strftime("%d%m%y",$linec[$i][0]));
+ $worksheet->write_string($j, 1, 'VE');
+ $worksheet->write_string($j, 3, '411000000');
+ $worksheet->write_string($j, 4, $linec[$i][3]." Facture");
+
+
+ $oldfacture = $linec[$i][1];
+ $j++;
+ }
- $worksheet->write_string($j, 0, strftime("%d%m%y",$linec[$i][0]));
- $worksheet->write_string($j, 1, 'VE');
- $worksheet->write_string($j, 2, $linec[$i][4]);
- $worksheet->write_string($j, 4, $linec[$i][3]." Facture");
-
- $j++;
+ $worksheet->write_string($j, 0, strftime("%d%m%y",$linec[$i][0]));
+ $worksheet->write_string($j, 1, 'VE');
+ $worksheet->write_string($j, 2, $linec[$i][4]);
+ $worksheet->write_string($j, 4, $linec[$i][3]." Facture");
- }
-
- $workbook->close();
-
- return 0;
- }
+ $j++;
+
+ }
+
+ $workbook->close();
+
+ return 0;
+ }
}