--- /tmp/dsg/dolibarr/htdocs/core/modules/commande/github_19.0.3_mod_commande_marbre.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/commande/client_mod_commande_marbre.php @@ -23 +23 @@ - * \brief File of class to manage Sales Order numbering rules Marbre + * \brief File of class to manage customer order numbering rules Marbre @@ -28 +28 @@ - * Class to manage Sales Order numbering rules Marbre + * Class to manage customer order numbering rules Marbre @@ -52,12 +51,0 @@ - * Constructor - */ - public function __construct() - { - global $conf, $mysoc; - - if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 16.0 && $mysoc->country_code != 'FR') { - $this->prefix = 'SO'; // We use correct standard code "SO = Sale Order" - } - } - - /** @@ -66,2 +54 @@ - * @param Translate $langs Lang object to use for output - * @return string Descriptive text + * @return string Text with description @@ -69 +56 @@ - public function info($langs) + public function info() @@ -72 +59 @@ - return $langs->trans("SimpleNumRefModelDesc", $this->prefix); + return $langs->trans("SimpleNumRefModelDesc", $this->prefix); @@ -91,2 +78 @@ - * @param Object $object Object we need next value for - * @return boolean false if conflict, true if ok + * @return boolean false if conflict, true if ok @@ -94 +80 @@ - public function canBeActivated($object) + public function canBeActivated() @@ -98,2 +84 @@ - $coyymm = ''; - $max = ''; + $coyymm = ''; $max = ''; @@ -108 +93,2 @@ - if ($resql) { + if ($resql) + { @@ -110,4 +96 @@ - if ($row) { - $coyymm = substr($row[0], 0, 6); - $max = $row[0]; - } + if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; } @@ -115 +98,2 @@ - if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) + { @@ -143 +127,2 @@ - if ($resql) { + if ($resql) + { @@ -145,6 +130,5 @@ - if ($obj) { - $max = intval($obj->max); - } else { - $max = 0; - } - } else { + if ($obj) $max = intval($obj->max); + else $max = 0; + } + else + { @@ -157 +141 @@ - $yymm = dol_print_date($date, "%y%m"); + $yymm = strftime("%y%m", $date); @@ -159,5 +143,2 @@ - if ($max >= (pow(10, 4) - 1)) { - $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is - } else { - $num = sprintf("%04s", $max + 1); - } + if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s", $max + 1); --- /tmp/dsg/dolibarr/htdocs/core/modules/commande/github_19.0.3_mod_commande_saphir.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/commande/client_mod_commande_saphir.php @@ -26 +26 @@ - * \brief File of class to manage Sales Order numbering rules Saphir + * \brief Fichier contenant la classe du modele de numerotation de reference de commande Saphir @@ -33 +33 @@ - * Class to manage Sales Order numbering rules Saphir + * Class to manage customer order numbering rules Saphir @@ -38,3 +38,3 @@ - * Dolibarr version of the loaded document - * @var string - */ + * Dolibarr version of the loaded document + * @var string + */ @@ -54,9 +54,8 @@ - /** - * Returns the description of the numbering model - * - * @param Translate $langs Lang object to use for output - * @return string Descriptive text - */ - public function info($langs) - { - global $langs, $db; + /** + * Returns the description of the numbering model + * + * @return string Texte descripif + */ + public function info() + { + global $conf, $langs, $db; @@ -83 +82 @@ - $texte .= '