dolibarr 20.0.0
mod_codeproduct_elephant Class Reference

Class to manage product code with elephant rule. More...

Inheritance diagram for mod_codeproduct_elephant:
Collaboration diagram for mod_codeproduct_elephant:

Public Member Functions

 __construct ()
 Constructor.
 
 info ($langs)
 Return description of module.
 
 getExample ($langs, $objproduct='', $type=-1)
 Return an example of result returned by getNextValue.
 
 getNextValue ($objproduct=null, $type=-1)
 Return next value.
 
 verif_prefixIsUsed ()
 Check if mask/numbering use prefix.
 
 verif ($db, &$code, $product, $type)
 Check validity of code according to its rules.
 
 verif_dispo ($db, $code, $product)
 Indicate if the code is available or not (by another third party)
 
- Public Member Functions inherited from ModeleProductCode
 getToolTip ($langs, $product, $type)
 Return description of module parameters.
 
- 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 ModeleProductCode
static liste_modeles ($dbs, $maxfilenamelength=0)
 Renvoi la liste des modeles de numérotation.
 

Detailed Description

Class to manage product code with elephant rule.

Definition at line 36 of file mod_codeproduct_elephant.php.

Member Function Documentation

◆ getExample()

mod_codeproduct_elephant::getExample ( $langs,
$objproduct = '',
$type = -1 )

Return an example of result returned by getNextValue.

Parameters
Translate$langsObject langs
Product | string$objproductObject product
int$typeType of third party (1:customer, 2:supplier, -1:autodetect)
Returns
string Return string example

Definition at line 127 of file mod_codeproduct_elephant.php.

References getNextValue().

◆ getNextValue()

mod_codeproduct_elephant::getNextValue ( $objproduct = null,
$type = -1 )

Return next value.

Parameters
Product$objproductObject product
int$typeProduit ou service (0:product, 1:service)
Returns
string|-1 Value if OK, '' if module not configured, -1 if KO

Reimplemented from ModeleProductCode.

Definition at line 168 of file mod_codeproduct_elephant.php.

References dol_now(), dol_string_unaccent(), get_next_value(), and getDolGlobalString().

Referenced by getExample().

◆ info()

mod_codeproduct_elephant::info ( $langs)

Return description of module.

Parameters
Translate$langsObject langs
Returns
string Description of module

Reimplemented from CommonNumRefGenerator.

Definition at line 75 of file mod_codeproduct_elephant.php.

References getDolGlobalString().

◆ verif()

mod_codeproduct_elephant::verif ( $db,
& $code,
$product,
$type )

Check validity of code according to its rules.

Parameters
DoliDB$dbDatabase handler
string$codeCode to check/correct
Product$productObject product
int$type0 = product , 1 = service
Returns
int 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired -5 Other (see this->error)

Definition at line 250 of file mod_codeproduct_elephant.php.

References check_value(), dol_syslog(), and getDolGlobalString().

◆ verif_dispo()

mod_codeproduct_elephant::verif_dispo ( $db,
$code,
$product )

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

Parameters
DoliDB$dbHandler access base
string$codeCode a verifier
Product$productObject product
Returns
int 0 if available, <0 if KO

Definition at line 298 of file mod_codeproduct_elephant.php.

◆ verif_prefixIsUsed()

mod_codeproduct_elephant::verif_prefixIsUsed ( )

Check if mask/numbering use prefix.

Returns
int 0 or 1

Reimplemented from ModeleProductCode.

Definition at line 217 of file mod_codeproduct_elephant.php.

References getDolGlobalString().


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