';
-}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 88fca7b536a..05c235f5f51 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3896,7 +3896,7 @@ class Form
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Return list of payment modes.
+ * print list of payment modes.
* Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
* See instead to force the default value by the caller.
*
@@ -3911,8 +3911,28 @@ class Form
public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '')
{
// phpcs:enable
- global $langs, $user, $conf;
+ print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss);
+ }
+
+ /**
+ * Return list of payment modes.
+ * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
+ * See instead to force the default value by the caller.
+ *
+ * @param int $selected Id of payment term to preselect by default
+ * @param string $htmlname Nom de la zone select
+ * @param int $filtertype Not used
+ * @param int $addempty Add an empty entry
+ * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
+ * @param string $morecss Add more CSS on select tag
+ * @return void
+ */
+ public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '')
+ {
+
+ global $langs, $user, $conf;
+ $out = '';
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
$this->load_cache_conditions_paiements();
@@ -3922,24 +3942,25 @@ class Form
$selected = $conf->global->MAIN_DEFAULT_PAYMENT_TERM_ID;
}
- print '';
if ($user->admin && empty($noinfoadmin)) {
- print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
+ $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
- print ajax_combobox($htmlname);
+ $out.= ajax_combobox($htmlname);
+ return $out;
}