Ajout documentation

This commit is contained in:
Rodolphe Quiedeville 2005-03-23 11:56:18 +00:00
parent 23da697c74
commit 4e398b9c10

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,26 +17,31 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
* $File:$ * $File$
*/ */
/** /*!
\file htdocs/compta/export/modules/compta.export.class.php
\file htdocs/compta/export/modules/compta.export.class.php \ingroup compta
\ingroup compta \brief Fichier de la classe d'export compta
\brief Fichier de la classe d'export compta \version $Revision$
\version $Revision$
*/ */
/** \class ComptaExport /*!
\brief Classe permettant les exports comptables \class ComptaExport
\brief Classe permettant les exports comptables
*/ */
class ComptaExport class ComptaExport
{ {
/*!
\brief Createur Classe
\param DB object de base de données
\param USER object utilisateur
*/
function ComptaExport ($DB, $USER, $classe) function ComptaExport ($DB, $USER, $classe)
{ {
$this->db = $DB; $this->db = $DB;
@ -45,9 +50,9 @@ class ComptaExport
$this->error_message = ''; $this->error_message = '';
} }
/* /*!
* \brief Lecture des factures dans la base
*/ */
function ReadLines() function ReadLines()
{ {
@ -76,16 +81,19 @@ class ComptaExport
$sql .= " AND c.rowid = l.fk_code_ventilation"; $sql .= " AND c.rowid = l.fk_code_ventilation";
$sql .= " ORDER BY f.rowid ASC, l.fk_code_ventilation ASC"; $sql .= " ORDER BY f.rowid ASC, l.fk_code_ventilation ASC";
// print $sql;
if ($this->db->query($sql))
$result = $this->db->query($sql);
if ($result)
{ {
$num = $this->db->num_rows(); $num = $this->db->num_rows($result);
$i = 0; $i = 0;
$this->linec = array(); $this->linec = array();
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object(); $obj = $this->db->fetch_object($result);
$this->linec[$i][0] = $obj->datef; $this->linec[$i][0] = $obj->datef;
$this->linec[$i][1] = $obj->facid; $this->linec[$i][1] = $obj->facid;
@ -107,14 +115,16 @@ class ComptaExport
$i++; $i++;
} }
$this->db->free($result);
} }
return $error; return $error;
} }
/*
* /*!
* \brief Lecture des paiements dans la base
*/ */
function ReadLinesPayment() function ReadLinesPayment()
{ {
$error = 0; $error = 0;
@ -140,17 +150,17 @@ class ComptaExport
$sql .= " ORDER BY f.rowid ASC, p.rowid ASC"; $sql .= " ORDER BY f.rowid ASC, p.rowid ASC";
// print $sql."<br><br>"; $result = $this->db->query($sql);
if ($this->db->query($sql)) if ($result)
{ {
$num = $this->db->num_rows(); $num = $this->db->num_rows($result);
$i = 0; $i = 0;
$this->linep = array(); $this->linep = array();
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object(); $obj = $this->db->fetch_object($result);
$this->linep[$i][0] = $obj->datep; $this->linep[$i][0] = $obj->datep;
$this->linep[$i][1] = $obj->paymentid; $this->linep[$i][1] = $obj->paymentid;
@ -163,6 +173,9 @@ class ComptaExport
$i++; $i++;
} }
$this->db->free($result);
} }
else else
{ {
@ -171,11 +184,11 @@ class ComptaExport
return $error; return $error;
} }
/**
* /*!
* \brief Créé le fichier d'export
* */
*/
function Export() function Export()
{ {
$error = 0; $error = 0;
@ -198,7 +211,6 @@ class ComptaExport
$objexport->Export($this->linec, $this->linep); $objexport->Export($this->linec, $this->linep);
} }
} }
} }