diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 2618e688698..9b92e9e018e 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -1420,13 +1420,13 @@ if ($resql) {
// Payment mode
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
print '
';
- print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10, 1, '', 1);
+ print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1);
print ' | ';
}
// Payment terms
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
print '';
- print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1);
+ print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100');
print ' | ';
}
// Module source
@@ -2129,8 +2129,9 @@ if ($resql) {
// Payment mode
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
- print '';
- $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
+ $s = $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1, 0, '', 1);
+ print ' | ';
+ print $s;
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2139,8 +2140,9 @@ if ($resql) {
// Payment terms
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
- print '';
- $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none');
+ $s = $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 0, '', -1, -1, 1);
+ print ' | ';
+ print $s;
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index f7aa1990f13..daff55c7615 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5439,22 +5439,26 @@ class Form
* @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
* 0 : use default deposit percentage from entry
* > 0 : force deposit percentage (for example, from company object)
+ * @param int $nooutput No print is done. String is returned.
* @return void
*/
- public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1)
+ public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1, $nooutput = 0)
{
// phpcs:enable
global $langs;
+
+ $out = '';
+
if ($htmlname != "none") {
- print '';
+ $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
+ $out .= '';
+ $out .= '';
} else {
if ($selected) {
$this->load_cache_conditions_paiements();
@@ -5465,15 +5469,21 @@ class Form
$label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $this->cache_conditions_paiements[$selected]['deposit_percent'], $label);
}
- print $label;
+ $out .= $label;
} else {
$langs->load('errors');
- print $langs->trans('ErrorNotInDictionaryPaymentConditions');
+ $out .= $langs->trans('ErrorNotInDictionaryPaymentConditions');
}
} else {
- print " ";
+ $out .= ' ';
}
}
+
+ if (empty($nooutput)) {
+ print $out;
+ return '';
+ }
+ return $out;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps