dolibarr 21.0.0-alpha
mod_codeclient_monkey Class Reference

Class permettant la gestion monkey des codes tiers. More...

Inheritance diagram for mod_codeclient_monkey:
Collaboration diagram for mod_codeclient_monkey:

Public Member Functions

 __construct ($db)
 Constructor.
 
 info ($langs)
 Return description of module.
 
 getExample ($langs=null, $objsoc='', $type=-1)
 Return an example of result returned by getNextValue.
 
 getNextValue ($objsoc='', $type=-1)
 Return next value.
 
 verif ($db, &$code, $soc, $type)
 Check validity of code according to its rules.
 
 verif_dispo ($db, $code, $soc, $type=0)
 Indicates if the code is available or not (by another third party)
 
 verif_syntax ($code)
 Renvoi si un code respecte la syntax.
 
- Public Member Functions inherited from ModeleThirdPartyCode
 getToolTip ($langs, $soc, $type)
 Return description of module parameters.
 
 verif_prefixIsUsed ()
 Check if mask/numbering use prefix.
 
- Public Member Functions inherited from CommonNumRefGenerator
 getNom ($langs)
 Return model name.
 
 getName ($langs)
 Return model name.
 
 isEnabled ()
 Return if a module can be used or not.
 
 canBeActivated ($object)
 Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.
 
 getVersion ()
 Returns version of numbering module.
 

Additional Inherited Members

- Static Public Member Functions inherited from ModeleThirdPartyCode
static liste_modeles ($dbs, $maxfilenamelength=0)
 Return list of active generation modules.
 

Detailed Description

Class permettant la gestion monkey des codes tiers.

Definition at line 35 of file mod_codeclient_monkey.php.

Constructor & Destructor Documentation

◆ __construct()

mod_codeclient_monkey::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase object

Reimplemented from ModeleThirdPartyCode.

Definition at line 51 of file mod_codeclient_monkey.php.

Member Function Documentation

◆ getExample()

mod_codeclient_monkey::getExample ( $langs = null,
$objsoc = '',
$type = -1 )

Return an example of result returned by getNextValue.

Parameters
?Translate$langsObject langs
Societe | string$objsocObject thirdparty
int<-1,2>$type Type of third party (1:customer, 2:supplier, -1:autodetect)
Returns
string Return string example

Definition at line 84 of file mod_codeclient_monkey.php.

◆ getNextValue()

mod_codeclient_monkey::getNextValue ( $objsoc = '',
$type = -1 )

Return next value.

Parameters
Societe | string$objsocObject third party
int$typeClient ou fournisseur (1:client, 2:fournisseur)
Returns
string|-1 Value if OK, '' if module not configured, -1 if KO

Reimplemented from ModeleThirdPartyCode.

Definition at line 97 of file mod_codeclient_monkey.php.

References dol_now(), dol_print_date(), and dol_syslog().

◆ info()

mod_codeclient_monkey::info ( $langs)

Return description of module.

Parameters
Translate$langsObject langs
Returns
string Description of module

Reimplemented from CommonNumRefGenerator.

Definition at line 70 of file mod_codeclient_monkey.php.

◆ verif()

mod_codeclient_monkey::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<0,1>$type 0 = customer/prospect , 1 = supplier
Returns
int<-6,0> 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)

Reimplemented from ModeleThirdPartyCode.

Definition at line 163 of file mod_codeclient_monkey.php.

References dol_strlen(), dol_syslog(), getDolGlobalString(), verif_dispo(), and verif_syntax().

◆ verif_dispo()

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

Indicates if the code is available or not (by another third party)

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

Definition at line 204 of file mod_codeclient_monkey.php.

References dol_syslog().

Referenced by verif().

◆ verif_syntax()

mod_codeclient_monkey::verif_syntax ( $code)

Renvoi si un code respecte la syntax.

Parameters
string$codeCode a verifier
Returns
int 0 si OK, <0 si KO

Definition at line 239 of file mod_codeclient_monkey.php.

References dol_strlen().

Referenced by verif().


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