Gestion de la categorie fournisseur
This commit is contained in:
parent
84b665cd46
commit
1d36518df9
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
|
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
|
||||||
@ -81,8 +81,8 @@ class Societe
|
|||||||
var $code_compta_fournisseur;
|
var $code_compta_fournisseur;
|
||||||
|
|
||||||
var $note;
|
var $note;
|
||||||
|
//! code statut prospect
|
||||||
var $stcomm_id; // code statut prospect
|
var $stcomm_id;
|
||||||
var $statut_commercial;
|
var $statut_commercial;
|
||||||
|
|
||||||
var $price_level;
|
var $price_level;
|
||||||
@ -171,6 +171,9 @@ class Societe
|
|||||||
$this->add_commercial($user, $user->id);
|
$this->add_commercial($user, $user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// si le fournisseur est classe on l'ajoute
|
||||||
|
$this->AddFournisseurInCategory($this->fournisseur_categorie);
|
||||||
|
|
||||||
if ($ret >= 0)
|
if ($ret >= 0)
|
||||||
{
|
{
|
||||||
$this->use_webcal=($conf->global->PHPWEBCALENDAR_COMPANYCREATE=='always'?1:0);
|
$this->use_webcal=($conf->global->PHPWEBCALENDAR_COMPANYCREATE=='always'?1:0);
|
||||||
@ -193,7 +196,6 @@ class Societe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
||||||
{
|
{
|
||||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
{
|
{
|
||||||
@ -1705,6 +1707,50 @@ class Societe
|
|||||||
//print "dd".$this->pays_code;
|
//print "dd".$this->pays_code;
|
||||||
return in_array($this->pays_code,$country_code_in_EEC);
|
return in_array($this->pays_code,$country_code_in_EEC);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* \brief Charge la liste des categories fournisseurs
|
||||||
|
* \return 0 in success, <> 0 in error
|
||||||
|
*/
|
||||||
|
function LoadSupplierCateg()
|
||||||
|
{
|
||||||
|
$this->SupplierCategories = array();
|
||||||
|
$sql = "SELECT rowid, label";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."fournisseur_categorie;";
|
||||||
|
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
while ($obj = $this->db->fetch_object($resql) )
|
||||||
|
{
|
||||||
|
$this->SupplierCategories[$obj->rowid] = $obj->label;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* \brief Charge la liste des categories fournisseurs
|
||||||
|
* \return 0 in success, <> 0 in error
|
||||||
|
*/
|
||||||
|
function AddFournisseurInCategory($categorie_id)
|
||||||
|
{
|
||||||
|
if ($categorie_id > 0)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_fournisseur (fk_categorie, fk_societe) ";
|
||||||
|
$sql.= " VALUES ('".$categorie_id."','".$this->id."');";
|
||||||
|
|
||||||
|
if ($resql=$this->db->query($sql))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user