dolibarr 19.0.3
mod_facture_terre Class Reference

Class of numbering module Terre for invoices. More...

Inheritance diagram for mod_facture_terre:
Collaboration diagram for mod_facture_terre:

Public Member Functions

 __construct ()
 Constructor.
 
 info ($langs)
 Returns the description of the numbering model.
 
 getExample ()
 Return an example of numbering.
 
 canBeActivated ($object)
 Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.
 
 getNextValue ($objsoc, $invoice, $mode='next')
 Return next value not used or last value used.
 
 getNumRef ($objsoc, $objforref, $mode='next')
 Return next free value.
 
- Public Member Functions inherited from CommonNumRefGenerator
 getNom ($langs)
 Return model name TODO Replace with getName()
 
 getName ($langs)
 Return model name.
 
 isEnabled ()
 Return if a module can be used or not.
 
 getVersion ()
 Returns version of numbering module.
 

Detailed Description

Class of numbering module Terre for invoices.

Definition at line 31 of file mod_facture_terre.php.

Member Function Documentation

◆ canBeActivated()

mod_facture_terre::canBeActivated ( $object)

Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.

Parameters
Object$objectObject we need next value for
Returns
boolean false if conflict, true if ok

Reimplemented from CommonNumRefGenerator.

Definition at line 118 of file mod_facture_terre.php.

◆ getExample()

mod_facture_terre::getExample ( )

Return an example of numbering.

Returns
string Example

Definition at line 106 of file mod_facture_terre.php.

◆ getNextValue()

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

Return next value not used or last value used.

Note to increase perf of this numbering engine, you can create a calculated column and modify request to use this field instead for select: ALTER TABLE llx_facture ADD COLUMN calculated_numrefonly INTEGER AS (CASE SUBSTRING(ref FROM 1 FOR 2) WHEN 'FA' 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 Next ref value or last ref if $mode is 'last', <= 0 if KO

Definition at line 206 of file mod_facture_terre.php.

References dol_print_error(), and dol_syslog().

Referenced by getNumRef().

◆ getNumRef()

mod_facture_terre::getNumRef ( $objsoc,
$objforref,
$mode = 'next' )

Return next free value.

Parameters
Societe$objsocObject third party
string$objforrefObject for number to search
string$mode'next' for next value or 'last' for last value
Returns
string Next free value

Definition at line 290 of file mod_facture_terre.php.

References getNextValue().

◆ info()

mod_facture_terre::info ( $langs)

Returns the description of the numbering model.

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

Reimplemented from CommonNumRefGenerator.

Definition at line 94 of file mod_facture_terre.php.


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