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 class AccountancyAccount
{ {
var $db; var $db;
var $error; var $error;
var $rowid; var $rowid;
var $fk_pcg_version; var $fk_pcg_version;
var $pcg_type; var $pcg_type;
var $pcg_subtype; var $pcg_subtype;
var $label; var $label;
var $account_number; var $account_number;
var $account_parent; var $account_parent;
/** /**
* Constructor * Constructor
* *
* @param $DoliDB $DB Database handler * @param DoliDB $DB Database handler
*/ */
function AccountancyAccount($DB) function AccountancyAccount($DB)
{ {
$this->db = $DB; $this->db = $DB;
} }
/** /**
* Insert account into database * Insert account into database
* *
* @param User $user User making add * @param User $user User making add
* @return int <0 if KO, Id line added if OK * @return int <0 if KO, Id line added if OK
*/ */
function create($user) function create($user)
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
$sql.= " (date_creation, fk_user_author, numero,intitule)"; $sql.= " (date_creation, fk_user_author, numero,intitule)";
$sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')"; $sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accountingaccount"); $id = $this->db->last_insert_id(MAIN_DB_PREFIX."accountingaccount");
if ($id > 0) if ($id > 0)
{ {
$this->id = $id; $this->id = $id;
$result = $this->id; $result = $this->id;
} }
else else
{ {
$result = -2; $result = -2;
$this->error="AccountancyAccount::Create Erreur $result"; $this->error="AccountancyAccount::Create Erreur $result";
dol_syslog($this->error, LOG_ERR); dol_syslog($this->error, LOG_ERR);
} }
} }
else else
{ {
$result = -1; $result = -1;
$this->error="AccountancyAccount::Create Erreur $result"; $this->error="AccountancyAccount::Create Erreur $result";
dol_syslog($this->error, LOG_ERR); 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/>. * 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("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/date.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()); $year_current = strftime("%Y",dol_now());
$pastmonth = strftime("%m",dol_now()) - 1; $pastmonth = strftime("%m",dol_now()) - 1;
$pastmonthyear = $year_current; $pastmonthyear = $year_current;
if ($pastmonth == 0) if ($pastmonth == 0)
{ {
$pastmonth = 12; $pastmonth = 12;
$pastmonthyear--; $pastmonthyear--;

View File

@ -17,6 +17,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/date.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 $val Value
* @param string $get 1=GET, 0=POST * @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) 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 * Security: Return true if OK, false otherwise
* *
* @param string $var Variable name * @param string &$var Variable name
* @param string $get 1=GET, 0=POST * @param string $get 1=GET, 0=POST
* @return boolean true if ther is an injection * @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 * \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'); include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php');