Changes

m
Line 9: Line 9:  
* Copy and paste htdocs/includes/modules/invoice/earth/terre.modules.php in htdocs/includes/modules/invoice/terrebis/terrebis.modules.php. You can use the name you want in place of terrebis while he is not already in use and contains only alphabetic characters.
 
* Copy and paste htdocs/includes/modules/invoice/earth/terre.modules.php in htdocs/includes/modules/invoice/terrebis/terrebis.modules.php. You can use the name you want in place of terrebis while he is not already in use and contains only alphabetic characters.
 
* edit the new file to make the following changes in the code:  
 
* edit the new file to make the following changes in the code:  
# Rename the class name to replace the old class name with the chosen name (keep the same naming conventions).
+
1. Rename the class name to replace the old class name with the chosen name (keep the same naming conventions).
# Modify the code for the info() method to return a text description of your module.
+
 
# Change the method code of getExemple() to return the an example of value for ra eference that might be returned by the module.
+
2. Modify the code for the info() method to return a text description of your module.
# Change the method code of canBeActivated() to just do a "return true;"
+
 
# Modify the code of the method getNextValue() to return the next available reference numbering. Within the code for this function, you can use parameters $objsoc or $facture containing the information of third parties involved in the generation and the object invoice involved in the generation (The name of these variables may differ depending on the nature of the managed entity module). You can also use the objects $langs, $conf and $db (db connection object in the database that allows SQL querying to database).
+
3.Change the method code of getExemple() to return the an example of value for ra eference that might be returned by the module.
# Save: the template 'terrebis' is available in the list of invoice templates into Dolibarr
+
 
 +
4.Change the method code of canBeActivated() to just do a "return true;"
 +
 
 +
5.Modify the code of the method getNextValue() to return the next available reference numbering. Within the code for this function, you can use parameters $objsoc or $facture containing the information of third parties involved in the generation and the object invoice involved in the generation (The name of these variables may differ depending on the nature of the managed entity module). You can also use the objects $langs, $conf and $db if you declare them first in the function with ligne
 +
global $langs, $db, $conf
 +
where
 +
$conf contains all configuration of Dolibarr.
 +
$langs is an object for translation into user language.
 +
$db is a db connection object that allows SQL querying to database).
 +
 
 +
6. Save: the template 'terrebis' is available in the list of invoice templates into Dolibarr
    
= Test this module =
 
= Test this module =
 
Test this module by activating the module from configuration page. Verify that the column description, example and next value you get reflect what you should get (referred respectively by function info(), getExample() and getNextValue()).
 
Test this module by activating the module from configuration page. Verify that the column description, example and next value you get reflect what you should get (referred respectively by function info(), getExample() and getNextValue()).