dolibarr  21.0.0-alpha
Public Member Functions | List of all members
mod_barcode_product_standard Class Reference

Class to manage barcode with standard rule. More...

Inheritance diagram for mod_barcode_product_standard:
Inheritance graph
[legend]
Collaboration diagram for mod_barcode_product_standard:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 Constructor.
 
 info ($langs)
 Return description of module. More...
 
 getExample ($langs, $objproduct=null)
 Return an example of result returned by getNextValue. More...
 
 literalBarcodeType ($db, $type=0)
 Return literal barcode type code from numerical rowid type of barcode. More...
 
 getNextValue ($objproduct=null, $type='')
 Return next value. More...
 
 verif ($db, &$code, $product, $thirdparty_type, $type)
 Check validity of code according to its rules. More...
 
 verif_dispo ($db, $code, $product)
 Return if a code is used (by other element) More...
 
 verif_syntax ($codefortest, $typefortest)
 Return if a barcode value match syntax. More...
 
- Public Member Functions inherited from ModeleNumRefBarCode
 getToolTip ($langs, $soc, $type)
 Return description of module parameters. More...
 
- Public Member Functions inherited from CommonNumRefGenerator
 getNom ($langs)
 Return model name. More...
 
 getName ($langs)
 Return model name. More...
 
 isEnabled ()
 Return if a module can be used or not. More...
 
 canBeActivated ($object)
 Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working. More...
 
 getVersion ()
 Returns version of numbering module. More...
 

Detailed Description

Class to manage barcode with standard rule.

Definition at line 36 of file mod_barcode_product_standard.php.

Member Function Documentation

◆ getExample()

mod_barcode_product_standard::getExample (   $langs,
  $objproduct = null 
)

Return an example of result returned by getNextValue.

Parameters
Translate$langsObject langs
?Product$objproduct Object product
Returns
string Return string example

Definition at line 115 of file mod_barcode_product_standard.php.

◆ getNextValue()

mod_barcode_product_standard::getNextValue (   $objproduct = null,
  $type = '' 
)

Return next value.

Parameters
?CommonObject$objproduct Object product (not used)
string$typeType of barcode (EAN, ISBN, ...)
Returns
string|int<-1,-1> Value if OK, '' if module not configured, <0 if KO

Reimplemented from ModeleNumRefBarCode.

Definition at line 166 of file mod_barcode_product_standard.php.

◆ info()

mod_barcode_product_standard::info (   $langs)

Return description of module.

Parameters
Translate$langsObject langs
Returns
string Description of module

Reimplemented from CommonNumRefGenerator.

Definition at line 69 of file mod_barcode_product_standard.php.

◆ literalBarcodeType()

mod_barcode_product_standard::literalBarcodeType (   $db,
  $type = 0 
)

Return literal barcode type code from numerical rowid type of barcode.

Parameters
DoliDB$dbDatabase
int$typeType of barcode (EAN, ISBN, ...) as rowid
Returns
string

Definition at line 135 of file mod_barcode_product_standard.php.

◆ verif()

mod_barcode_product_standard::verif (   $db,
$code,
  $product,
  $thirdparty_type,
  $type 
)

Check validity of code according to its rules.

Parameters
DoliDB$dbDatabase handler
string$codeCode to check/correct
Product$productObject product
int$thirdparty_type0 = customer/prospect , 1 = supplier
string$typetype of barcode (EAN, ISBN, ...)
Returns
int 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired

Definition at line 235 of file mod_barcode_product_standard.php.

◆ verif_dispo()

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

Return if a code is used (by other element)

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

Definition at line 281 of file mod_barcode_product_standard.php.

◆ verif_syntax()

mod_barcode_product_standard::verif_syntax (   $codefortest,
  $typefortest 
)

Return if a barcode value match syntax.

Parameters
string$codefortestCode to check syntax
string$typefortestType of barcode (ISBN, EAN, ...)
Returns
int 0 if OK, <0 if KO

Definition at line 312 of file mod_barcode_product_standard.php.


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