Fix: doxygen

This commit is contained in:
Laurent Destailleur 2014-09-03 09:45:29 +02:00
parent df70450073
commit 1375e20fe2
2 changed files with 39 additions and 123 deletions

View File

@ -1,95 +0,0 @@
<?php
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/accountancy/class/accountancyaccount.class.php
* \ingroup accounting
* \brief Fichier de la classe des comptes comptables
*/
/**
* \class AccountancyAccount
* \brief Classe permettant la gestion des comptes
*/
class AccountancyAccount
{
var $db;
var $error;
var $rowid;
var $fk_pcg_version;
var $pcg_type;
var $pcg_subtype;
var $label;
var $account_number;
var $account_parent;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db = $db;
}
/**
* Insert account into database
*
* @param User $user User making add
* @return int <0 if KO, Id line added if OK
*/
function create($user)
{
$now=dol_now();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
$sql.= " (date_creation, fk_user_author, numero,intitule)";
$sql.= " VALUES ('".$this->db->idate($now)."',".$user->id.",'".$this->numero."','".$this->intitule."')";
$resql = $this->db->query($sql);
if ($resql)
{
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accountingaccount");
if ($id > 0)
{
$this->id = $id;
$result = $this->id;
}
else
{
$result = -2;
$this->error="AccountancyAccount::Create Erreur $result";
dol_syslog($this->error, LOG_ERR);
}
}
else
{
$result = -1;
$this->error="AccountancyAccount::Create Erreur $result";
dol_syslog($this->error, LOG_ERR);
}
return $result;
}
}

View File

@ -43,21 +43,24 @@ class AccountingAccount
var $active; var $active;
/** /**
* \brief Constructeur de la classe * Constructor
* \param DB handler acces base de donnees *
* \param id id compte (0 par defaut) * @param DoliDB $db Database handle
*/ */
function __construct($db, $rowid = '') { function __construct($db)
{
$this->db = $db; $this->db = $db;
if ($rowid != '')
return $this->fetch($rowid);
} }
/** /**
* \brief Load record in memory * Load record in memory
*
* @param int $rowid Id
* @param string $account_number Account number
* @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid = null, $account_number = null) { function fetch($rowid = null, $account_number = null)
{
if ($rowid || $account_number) { if ($rowid || $account_number) {
$sql = "SELECT * FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE "; $sql = "SELECT * FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE ";
if ($rowid) { if ($rowid) {
@ -93,10 +96,14 @@ class AccountingAccount
} }
/** /**
* \brief insert line in accountingaccount * Insert line in accountingaccount
* \param user utilisateur qui effectue l'insertion *
* @param User $user Use making action
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function create($user, $notrigger = 0) { function create($user, $notrigger = 0)
{
global $conf, $langs; global $conf, $langs;
$error = 0; $error = 0;
@ -192,10 +199,11 @@ class AccountingAccount
/** /**
* Update record * Update record
* *
* @param User $user update * @param User $user Use making update
* @return int if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user) { function update($user)
{
global $langs; global $langs;
$this->db->begin(); $this->db->begin();
@ -227,10 +235,10 @@ class AccountingAccount
/** /**
* Check usage of accounting code * Check usage of accounting code
* *
* @param User $user update * @return int <0 if KO, >0 if OK
* @return int if KO, >0 if OK
*/ */
function checkUsage() { function checkUsage()
{
global $langs; global $langs;
$sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet"; $sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet";
@ -259,11 +267,12 @@ class AccountingAccount
/** /**
* Delete object in database * Delete object in database
* *
* @param User $user that deletes * @param User $user User that deletes
* @param int $notrigger triggers after, 1=disable triggers * @param int $notrigger 0=triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) { function delete($user, $notrigger = 0)
{
global $conf, $langs; global $conf, $langs;
$error = 0; $error = 0;
@ -356,10 +365,11 @@ class AccountingAccount
/** /**
* Account desactivate * Account desactivate
* *
* @param User $user update * @param int $id Id
* @return int if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function account_desactivate($id) { function account_desactivate($id)
{
global $langs; global $langs;
$result = $this->checkUsage(); $result = $this->checkUsage();
@ -390,10 +400,11 @@ class AccountingAccount
/** /**
* Account activate * Account activate
* *
* @param User $user update * @param int $id Id
* @return int if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function account_activate($id) { function account_activate($id)
{
global $langs; global $langs;
$this->db->begin(); $this->db->begin();