dolibarr  13.0.2
Public Member Functions | List of all members
mod_codeclient_elephant Class Reference

Class to manage third party code with elephant rule. More...

+ Inheritance diagram for mod_codeclient_elephant:
+ Collaboration diagram for mod_codeclient_elephant:

Public Member Functions

 __construct ()
 Constructor.
 
 info ($langs)
 Return description of module. More...
 
 getExample ($langs, $objsoc=0, $type=-1)
 Return an example of result returned by getNextValue. More...
 
 getNextValue ($objsoc=0, $type=-1)
 Return next value. More...
 
 verif_prefixIsUsed ()
 Check if mask/numbering use prefix. More...
 
 verif ($db, &$code, $soc, $type)
 Check validity of code according to its rules. More...
 
 verif_dispo ($db, $code, $soc, $type=0)
 Renvoi si un code est pris ou non (par autre tiers) More...
 
- Public Member Functions inherited from ModeleThirdPartyCode
 info ($langs)
 Renvoi la description par defaut du modele de numerotation. More...
 
 getNom ($langs)
 Return name of module. More...
 
 getExample ($langs)
 Return an example of numbering. More...
 
 canBeActivated ()
 Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working. More...
 
 getNextValue ($objsoc=0, $type=-1)
 Return next value available. More...
 
 getVersion ()
 Return version of module. More...
 
 getToolTip ($langs, $soc, $type)
 Return description of module parameters. More...
 
 verif_prefixIsUsed ()
 Check if mask/numbering use prefix. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ModeleThirdPartyCode
static liste_modeles ($db, $maxfilenamelength=0)
 Renvoie la liste des modeles de numérotation. More...
 

Detailed Description

Class to manage third party code with elephant rule.

Definition at line 36 of file mod_codeclient_elephant.php.

Member Function Documentation

mod_codeclient_elephant::getExample (   $langs,
  $objsoc = 0,
  $type = -1 
)

Return an example of result returned by getNextValue.

Parameters
Translate$langsObject langs
societe$objsocObject thirdparty
int$typeType of third party (1:customer, 2:supplier, -1:autodetect)
Returns
string Return string example

Definition at line 161 of file mod_codeclient_elephant.php.

References getNextValue().

mod_codeclient_elephant::getNextValue (   $objsoc = 0,
  $type = -1 
)

Return next value.

Parameters
Societe$objsocObject third party
int$typeClient ou fournisseur (0:customer, 1:supplier)
Returns
string Value if OK, '' if module not configured, <0 if KO

Definition at line 207 of file mod_codeclient_elephant.php.

References dol_now(), and get_next_value().

Referenced by getExample().

mod_codeclient_elephant::info (   $langs)

Return description of module.

Parameters
Translate$langsObject langs
Returns
string Description of module

Definition at line 110 of file mod_codeclient_elephant.php.

mod_codeclient_elephant::verif (   $db,
$code,
  $soc,
  $type 
)

Check validity of code according to its rules.

Parameters
DoliDB$dbDatabase handler
string$codeCode to check/correct
Societe$socObject third party
int$type0 = customer/prospect , 1 = supplier
Returns
int 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired -5 NotConfigured - Setup empty so any value may be ok or not -6 Other (see this->error)

Definition at line 278 of file mod_codeclient_elephant.php.

References check_value(), and dol_syslog().

mod_codeclient_elephant::verif_dispo (   $db,
  $code,
  $soc,
  $type = 0 
)

Renvoi si un code est pris ou non (par autre tiers)

Parameters
DoliDB$dbHandler acces base
string$codeCode a verifier
Societe$socObjet societe
int$type0 = customer/prospect , 1 = supplier
Returns
int 0 if available, <0 if KO

Definition at line 326 of file mod_codeclient_elephant.php.

References $resql.

mod_codeclient_elephant::verif_prefixIsUsed ( )

Check if mask/numbering use prefix.

Returns
int 0 or 1

Definition at line 248 of file mod_codeclient_elephant.php.


The documentation for this class was generated from the following file: