diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 140ce5f06ee..af406bcf375 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3881,10 +3881,12 @@ class Form * @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 - * @param float $deposit_percent % of deposit if needed by payment conditions + * @param float $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) * @return void */ - public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = null) + public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1) { // phpcs:enable global $langs, $user, $conf; @@ -3910,7 +3912,7 @@ class Form } if ($selected == $id) { - $selectedDepositPercent = ! empty($deposit_percent) ? $deposit_percent : $arrayconditions['deposit_percent']; + $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; print '