--- /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 .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; @@ -85 +84 @@ - $texte .= '  '; + $texte .= '  '; @@ -93 +92 @@ - } + } @@ -95,8 +94,8 @@ - /** - * Return an example of numbering - * - * @return string Example - */ - public function getExample() - { - global $conf, $langs, $mysoc; + /** + * Return an example of numbering + * + * @return string Example + */ + public function getExample() + { + global $conf, $langs, $mysoc; @@ -104,5 +103,5 @@ - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, null); + $old_code_client = $mysoc->code_client; + $old_code_type = $mysoc->typent_code; + $mysoc->code_client = 'CCCCCCCCCC'; + $mysoc->typent_code = 'TTTTTTTTTT'; + $numExample = $this->getNextValue($mysoc, ''); @@ -112 +111,2 @@ - if (!$numExample) { + if (!$numExample) + { @@ -116 +116 @@ - } + } @@ -125,2 +125,2 @@ - public function getNextValue($objsoc, $object) - { + public function getNextValue($objsoc, $object) + { @@ -132 +132 @@ - $mask = getDolGlobalString("COMMANDE_SAPHIR_MASK"); + $mask = $conf->global->COMMANDE_SAPHIR_MASK; @@ -134 +134,2 @@ - if (!$mask) { + if (!$mask) + { @@ -142,5 +143 @@ - if (is_object($object)) { - $date = ($object->date_commande ? $object->date_commande : $object->date); - } else { - $date = dol_now(); - } + $date = ($object->date_commande ? $object->date_commande : $object->date); @@ -154 +151 @@ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -161,6 +158,6 @@ - */ - public function commande_get_num($objsoc, $objforref) - { - // phpcs:enable - return $this->getNextValue($objsoc, $objforref); - } + */ + public function commande_get_num($objsoc, $objforref) + { + // phpcs:enable + return $this->getNextValue($objsoc, $objforref); + }