dolibarr 21.0.0-alpha
mod_barcode_thirdparty_standard Class Reference

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

Inheritance diagram for mod_barcode_thirdparty_standard:
Collaboration diagram for mod_barcode_thirdparty_standard:

Public Member Functions

 __construct ()
 Constructor.
 
 info ($langs)
 Return description of module.
 
 getExample ($langs=null, $objthirdparty=null)
 Return an example of result returned by getNextValue.
 
 literalBarcodeType ($db, $type=0)
 Return literal barcode type code from numerical rowid type of barcode.
 
 getNextValue ($objthirdparty=null, $type='')
 Return next value.
 
 verif ($db, &$code, $thirdparty, $thirdparty_type, $type)
 Check validity of code according to its rules.
 
 verif_dispo ($db, $code, $thirdparty)
 Return if a code is used (by other element)
 
 verif_syntax ($codefortest, $typefortest)
 Return if a barcode value match syntax.
 
- Public Member Functions inherited from ModeleNumRefBarCode
 getToolTip ($langs, $soc, $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.
 

Detailed Description

Class to manage barcode with standard rule.

Definition at line 37 of file mod_barcode_thirdparty_standard.php.

Member Function Documentation

◆ getExample()

mod_barcode_thirdparty_standard::getExample ( $langs = null,
$objthirdparty = null )

Return an example of result returned by getNextValue.

Parameters
?Translate$langsObject langs
?CommonObject$objthirdpartyObject third-party / Societe
Returns
string Return string example

Reimplemented from ModeleNumRefBarCode.

Definition at line 152 of file mod_barcode_thirdparty_standard.php.

References getNextValue().

◆ getNextValue()

mod_barcode_thirdparty_standard::getNextValue ( $objthirdparty = null,
$type = '' )

Return next value.

Parameters
?CommonObject$objthirdpartyObject third-party
string$typeType of barcode (EAN, ISBN, ...)
Returns
string Value if OK, '' if module not configured, <0 if KO

Reimplemented from ModeleNumRefBarCode.

Definition at line 206 of file mod_barcode_thirdparty_standard.php.

References barcode_gen_ean_sum(), dol_now(), get_next_value(), getDolGlobalString(), and literalBarcodeType().

Referenced by getExample().

◆ info()

mod_barcode_thirdparty_standard::info ( $langs)

Return description of module.

Parameters
Translate$langsObject langs
Returns
string Description of module

Reimplemented from CommonNumRefGenerator.

Definition at line 105 of file mod_barcode_thirdparty_standard.php.

References getDolGlobalString().

◆ literalBarcodeType()

mod_barcode_thirdparty_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 176 of file mod_barcode_thirdparty_standard.php.

References dol_print_error().

Referenced by getNextValue().

◆ verif()

mod_barcode_thirdparty_standard::verif ( $db,
& $code,
$thirdparty,
$thirdparty_type,
$type )

Check validity of code according to its rules.

Parameters
DoliDB$dbDatabase handler
string$codeCode to check/correct
Societe | Product$thirdpartyObject third party
int<0,1>$thirdparty_type 0 = customer/prospect , 1 = supplier
string$typetype of barcode (EAN, ISBN, ...)
Returns
int<-7,0> 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired -7 ErrorBadClass

Reimplemented from ModeleNumRefBarCode.

Definition at line 271 of file mod_barcode_thirdparty_standard.php.

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

◆ verif_dispo()

mod_barcode_thirdparty_standard::verif_dispo ( $db,
$code,
$thirdparty )

Return if a code is used (by other element)

Parameters
DoliDB$dbHandler access base
string$codeCode to check
Societe$thirdpartyObject third-party
Returns
int 0 if available, <0 if KO

Definition at line 318 of file mod_barcode_thirdparty_standard.php.

Referenced by verif().

◆ verif_syntax()

mod_barcode_thirdparty_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 347 of file mod_barcode_thirdparty_standard.php.

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

Referenced by verif().


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