--- /tmp/dsg/dolibarr/htdocs/core/modules/supplier_payment/github_19.0.3_mod_supplier_payment_brodator.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/supplier_payment/client_mod_supplier_payment_brodator.php @@ -34,3 +34,3 @@ - * Dolibarr version of the loaded document - * @var string - */ + * Dolibarr version of the loaded document + * @var string + */ @@ -40,3 +40,3 @@ - * @var string Error code (or message) - */ - public $error = ''; + * @var string Error code (or message) + */ + public $error = ''; @@ -57,9 +57,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; @@ -69 +68 @@ - $form = new Form($db); + $form = new Form($this->db); @@ -86 +85 @@ - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; @@ -88 +87 @@ - $texte .= '  '; + $texte .= '  '; @@ -96 +95 @@ - } + } @@ -98,8 +97,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; @@ -107,3 +106,3 @@ - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); + $old_code_client = $mysoc->code_client; + $mysoc->code_client = 'CCCCCCCCCC'; + $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("SUPPLIER_PAYMENT_BRODATOR_MASK"); + $mask = $conf->global->SUPPLIER_PAYMENT_BRODATOR_MASK; @@ -134 +134,2 @@ - if (!$mask) { + if (!$mask) + { @@ -145 +146 @@ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -152,6 +153,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); + } --- /tmp/dsg/dolibarr/htdocs/core/modules/supplier_payment/github_19.0.3_mod_supplier_payment_bronan.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/supplier_payment/client_mod_supplier_payment_bronan.php @@ -61,2 +61 @@ - * @param Translate $langs Lang object to use for output - * @return string Descriptive text + * @return string Text with description @@ -64 +63 @@ - public function info($langs) + public function info() @@ -67 +66 @@ - return $langs->trans("SimpleNumRefModelDesc", $this->prefix); + return $langs->trans("SimpleNumRefModelDesc", $this->prefix); @@ -86,2 +85 @@ - * @param Object $object Object we need next value for - * @return boolean false if KO (there is a conflict), true if OK + * @return boolean false if conflict, true if ok @@ -89 +87 @@ - public function canBeActivated($object) + public function canBeActivated() @@ -93,2 +91 @@ - $payyymm = ''; - $max = ''; + $payyymm = ''; $max = ''; @@ -103 +100,2 @@ - if ($resql) { + if ($resql) + { @@ -105,4 +103 @@ - if ($row) { - $payyymm = substr($row[0], 0, 6); - $max = $row[0]; - } + if ($row) { $payyymm = substr($row[0], 0, 6); $max = $row[0]; } @@ -110 +105,2 @@ - if ($payyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $payyymm)) { + if ($payyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $payyymm)) + { @@ -138 +134,2 @@ - if ($resql) { + if ($resql) + { @@ -140,6 +137,5 @@ - if ($obj) { - $max = intval($obj->max); - } else { - $max = 0; - } - } else { + if ($obj) $max = intval($obj->max); + else $max = 0; + } + else + { @@ -152 +148 @@ - $yymm = dol_print_date($date, "%y%m"); + $yymm = strftime("%y%m", $date); @@ -154,5 +150,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);