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

Class to manage ref numbering of takepos cards with rule Simple. More...

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

Public Member Functions

 info ($langs)
 Return description of numbering module. More...
 
 getExample ()
 Return an example of numbering module values. More...
 
 canBeActivated ($object)
 Test if the numbers already in the database do not cause any conflicts that will prevent this of conflicts that will prevent this numbering from working. More...
 
 getNextValue ($objsoc=null, $invoice=null, $mode='next')
 Return next value. More...
 
 getNumRef ($objsoc, $objforref)
 Return next free value. 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...
 
 getVersion ()
 Returns version of numbering module. More...
 

Detailed Description

Class to manage ref numbering of takepos cards with rule Simple.

Definition at line 35 of file mod_takepos_ref_simple.php.

Member Function Documentation

◆ canBeActivated()

mod_takepos_ref_simple::canBeActivated (   $object)

Test if the numbers already in the database do not cause any conflicts that will prevent this of conflicts that will prevent this numbering from working.

Parameters
CommonObject$objectObject we need next value for
Returns
boolean false if KO (there is a conflict), true if OK

Reimplemented from CommonNumRefGenerator.

Definition at line 93 of file mod_takepos_ref_simple.php.

◆ getExample()

mod_takepos_ref_simple::getExample ( )

Return an example of numbering module values.

Returns
string Example.

Definition at line 81 of file mod_takepos_ref_simple.php.

◆ getNextValue()

mod_takepos_ref_simple::getNextValue (   $objsoc = null,
  $invoice = null,
  $mode = 'next' 
)

Return next value.

Note to increase perf of this numbering engine: ALTER TABLE llx_facture ADD COLUMN calculated_numrefonly INTEGER AS (CASE SUBSTRING(ref FROM 1 FOR 2) WHEN 'TC' THEN CAST(SUBSTRING(ref FROM 10) AS SIGNED) ELSE 0 END) PERSISTENT; ALTER TABLE llx_facture ADD INDEX calculated_numrefonly_idx (calculated_numrefonly);

Parameters
Societe$objsocObject third party
Facture$invoiceObject invoice
string$mode'next' for next value or 'last' for last value
Returns
string|int Next ref value or last ref if $mode is 'last'

Definition at line 139 of file mod_takepos_ref_simple.php.

◆ getNumRef()

mod_takepos_ref_simple::getNumRef (   $objsoc,
  $objforref 
)

Return next free value.

Parameters
Societe$objsocObject third party
Facture$objforrefObject for number to search
Returns
string Next free value
Deprecated:
see getNextValue

Definition at line 217 of file mod_takepos_ref_simple.php.

◆ info()

mod_takepos_ref_simple::info (   $langs)

Return description of numbering module.

Parameters
Translate$langsLang object to use for output
Returns
string Descriptive text

Reimplemented from CommonNumRefGenerator.

Definition at line 66 of file mod_takepos_ref_simple.php.


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