dolibarr  9.0.0
Public Member Functions | Public Attributes | List of all members
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. More...
 
 getExample ($langs, $objproduct=0, $type=-1)
 Return an example of result returned by getNextValue. More...
 
 getNextValue ($objproduct=0, $type=-1)
 Return next value. More...
 
 verif_prefixIsUsed ()
 Check if mask/numbering use prefix. More...
 
 verif ($db, &$code, $product, $type)
 Check validity of code according to its rules. More...
 
 verif_dispo ($db, $code, $product)
 Renvoi si un code est pris ou non (par autre tiers) More...
 
- Public Member Functions inherited from ModeleProductCode
 info ($langs)
 Renvoi la description par defaut du modele de numerotation. More...
 
 getNom ($langs)
 Renvoi nom module. More...
 
 getExample ($langs)
 Renvoi un exemple de numerotation. More...
 
 canBeActivated ()
 Test si les numeros deja en vigueur dans la base ne provoquent pas de de conflits qui empechera cette numerotation de fonctionner. More...
 
 getNextValue ($objproduct=0, $type=-1)
 Return next value available. More...
 
 getVersion ()
 Return version of module. More...
 
 getToolTip ($langs, $product, $type)
 Return description of module parameters. More...
 
 verif_prefixIsUsed ()
 Check if mask/numbering use prefix. More...
 

Public Attributes

 $version = 'dolibarr'
 Dolibarr version of the loaded document string.
 

Additional Inherited Members

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

Detailed Description

Class to manage product code with elephant rule.

Definition at line 35 of file mod_codeproduct_elephant.php.

Member Function Documentation

◆ getExample()

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

Return an example of result returned by getNextValue.

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

Definition at line 141 of file mod_codeproduct_elephant.php.

◆ getNextValue()

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

Return next value.

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

Definition at line 182 of file mod_codeproduct_elephant.php.

◆ info()

mod_codeproduct_elephant::info (   $langs)

Return description of module.

Parameters
Translate$langsObject langs
Returns
string Description of module

Definition at line 91 of file mod_codeproduct_elephant.php.

◆ 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 = customer/prospect , 1 = supplier
Returns
int 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired -5 Other (see this->error)

Definition at line 257 of file mod_codeproduct_elephant.php.

◆ verif_dispo()

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

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

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

Definition at line 308 of file mod_codeproduct_elephant.php.

◆ verif_prefixIsUsed()

mod_codeproduct_elephant::verif_prefixIsUsed ( )

Check if mask/numbering use prefix.

Returns
int 0 or 1

Definition at line 228 of file mod_codeproduct_elephant.php.


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