Skip to content

Commit

Permalink
Improved documentation of Societe and started type hinting variables
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgdf committed May 3, 2014
1 parent e1d3083 commit 4cf3857
Showing 1 changed file with 65 additions and 20 deletions.
85 changes: 65 additions & 20 deletions htdocs/societe/class/societe.class.php
Expand Up @@ -42,27 +42,52 @@ class Societe extends CommonObject
public $table_element = 'societe';
public $fk_element='fk_soc';
protected $childtables=array("propal","commande","facture","contrat","facture_fourn","commande_fournisseur"); // To test if we can delete object
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

/**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int
*/
protected $ismultientitymanaged = 1;

var $id;
var $name;
var $nom; // TODO obsolete

/**
* @deprecated Use $name instead
*/
var $nom;
var $firstname;
var $lastname;
var $particulier;
var $civility_id;
var $address;
var $zip;
var $town;
var $status; // 0=activity ceased, 1= in activity
/**
* 0=activity ceased, 1= in activity
* @var int
*/
var $status;

var $state_id; // Id of department
/**
* Id of department
*/
var $state_id;
var $state_code;
var $state;
/**
* @deprecated Use state_code instead
*/
var $departement_code; // deprecated
var $departement; // deprecated
/**
* @deprecated Use state instead
*/
var $departement;

var $pays; // deprecated
/**
* @deprecated Use country instead
*/
var $pays;
var $country_id;
var $country_code;
var $country;
Expand Down Expand Up @@ -111,16 +136,31 @@ class Societe extends CommonObject
var $mode_reglement_supplier_id;
var $cond_reglement_supplier_id;

var $client; // 0=no customer, 1=customer, 2=prospect, 3=customer and prospect
var $prospect; // 0=no prospect, 1=prospect
var $fournisseur; // 0=no supplier, 1=supplier
/**
* 0=no customer, 1=customer, 2=prospect, 3=customer and prospect
* @var int
*/
var $client;
/**
* 0=no prospect, 1=prospect
* @var int
*/
var $prospect;
/**
* 0=no supplier, 1=supplier
* @var int
*/
var $fournisseur;

var $code_client;
var $code_fournisseur;
var $code_compta;
var $code_compta_fournisseur;

var $note; //TODO deprecated
/**
* @deprecated Note is split in public and private notes
*/
var $note;
var $note_private;
var $note_public;
//! code statut prospect
Expand All @@ -133,7 +173,10 @@ class Societe extends CommonObject
var $datec;
var $date_update;

var $commercial_id; // Id of sales representative to link (used for thirdparty creation). Not filled by a fetch, because we can have several sales representatives.
/**
* Id of sales representative to link (used for thirdparty creation). Not filled by a fetch, because we can have several sales representatives.
*/
var $commercial_id;
var $parent;
var $default_lang;

Expand All @@ -146,8 +189,10 @@ class Societe extends CommonObject

var $array_options;

var $oldcopy; // To contains a clone of this when we need to save old properties of object

/**
* To contains a clone of this when we need to save old properties of object
*/
var $oldcopy;

/**
* Constructor
Expand Down Expand Up @@ -304,7 +349,7 @@ function create($user='')
* @param User $user Object user
* @return int <0 if KO, >0 if OK
*/
function create_individual($user)
function create_individual(User $user)
{
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$contact=new Contact($this->db);
Expand Down Expand Up @@ -1199,7 +1244,7 @@ function set_as_client()
* @param User $user Utilisateur qui definie la remise
* @return int <0 if KO, >0 if OK
*/
function set_remise_client($remise, $note, $user)
function set_remise_client($remise, $note, User $user)
{
global $langs;

Expand Down Expand Up @@ -1261,7 +1306,7 @@ function set_remise_client($remise, $note, $user)
* @param float $tva_tx VAT rate
* @return int <0 if KO, id of discount record if OK
*/
function set_remise_except($remise, $user, $desc, $tva_tx=0)
function set_remise_except($remise, User $user, $desc, $tva_tx=0)
{
global $langs;

Expand Down Expand Up @@ -1337,7 +1382,7 @@ function getAvailableDiscounts($user='',$filter='',$maxvalue=0)
* @param User $user Object user
* @return array Array of sales representatives of third party
*/
function getSalesRepresentatives($user='')
function getSalesRepresentatives(User $user)
{
global $conf;

Expand Down Expand Up @@ -1376,7 +1421,7 @@ function getSalesRepresentatives($user='')
* @param User $user Use making change
* @return int <0 if KO, >0 if OK
*/
function set_price_level($price_level, $user)
function set_price_level($price_level, User $user)
{
if ($this->id)
{
Expand Down Expand Up @@ -1409,7 +1454,7 @@ function set_price_level($price_level, $user)
* @param int $commid Id of user
* @return void
*/
function add_commercial($user, $commid)
function add_commercial(User $user, $commid)
{
if ($this->id > 0 && $commid > 0)
{
Expand All @@ -1436,7 +1481,7 @@ function add_commercial($user, $commid)
* @param int $commid Id of user
* @return void
*/
function del_commercial($user, $commid)
function del_commercial(User $user, $commid)
{
if ($this->id > 0 && $commid > 0)
{
Expand Down

0 comments on commit 4cf3857

Please sign in to comment.