This commit is contained in:
Laurent Destailleur 2011-09-20 22:28:31 +00:00
parent 2706384ba4
commit ebb29d2097
5 changed files with 73 additions and 62 deletions

View File

@ -22,72 +22,73 @@
*/
/** \class AccountancyAccount
\brief Classe permettant la gestion des comptes
*/
/**
* \class AccountancyAccount
* \brief Classe permettant la gestion des comptes
*/
class AccountancyAccount
{
var $db;
var $error;
var $db;
var $error;
var $rowid;
var $fk_pcg_version;
var $pcg_type;
var $pcg_subtype;
var $label;
var $account_number;
var $account_parent;
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 AccountancyAccount($DB)
{
$this->db = $DB;
}
/**
* Constructor
*
* @param DoliDB $DB Database handler
*/
function AccountancyAccount($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)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
$sql.= " (date_creation, fk_user_author, numero,intitule)";
$sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')";
/**
* Insert account into database
*
* @param User $user User making add
* @return int <0 if KO, Id line added if OK
*/
function create($user)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
$sql.= " (date_creation, fk_user_author, numero,intitule)";
$sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')";
$resql = $this->db->query($sql);
if ($resql)
{
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accountingaccount");
$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);
}
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;
}
return $result;
}
}
?>

View File

@ -17,6 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/journal/purchasesjournal.php
* \ingroup societe, fournisseur, facture
* \brief Page with purchases journal
*/
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
@ -54,8 +59,8 @@ $html=new Form($db);
$year_current = strftime("%Y",dol_now());
$pastmonth = strftime("%m",dol_now()) - 1;
$pastmonthyear = $year_current;
if ($pastmonth == 0)
$pastmonthyear = $year_current;
if ($pastmonth == 0)
{
$pastmonth = 12;
$pastmonthyear--;

View File

@ -17,6 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/journal/sellsjournal.php
* \ingroup societe, facture
* \brief Page with sells journal
*/
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");

View File

@ -67,7 +67,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6
*
* @param string $val Value
* @param string $get 1=GET, 0=POST
* @return boolean true if ther is an injection
* @return boolean true if there is an injection
*/
function test_sql_and_script_inject($val, $get)
{
@ -90,7 +90,7 @@ function test_sql_and_script_inject($val, $get)
/**
* Security: Return true if OK, false otherwise
*
* @param string $var Variable name
* @param string &$var Variable name
* @param string $get 1=GET, 0=POST
* @return boolean true if ther is an injection
*/

View File

@ -17,9 +17,9 @@
*/
/**
* \file htdocs/societe/canvas/default/actions_card_company.class.php
* \file htdocs/societe/canvas/company/actions_card_company.class.php
* \ingroup thirdparty
* \brief Fichier de la classe Thirdparty card controller (default canvas)
* \brief File of Thirdparty card controller (default canvas)
*/
include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php');