diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index 24be588386c..55e4dcf61ca 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -398,7 +398,7 @@ if ($object->id > 0) {
if ($object->type != $object::TYPE_CREDIT_NOTE) {
if ($action == 'editinvoicedate') {
- $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate');
+ print $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate', 0, 0, 1, $type);
} else {
print dol_print_date($object->date, 'day');
}
@@ -420,7 +420,7 @@ if ($object->id > 0) {
print '
';
if ($object->type != $object::TYPE_CREDIT_NOTE) {
if ($action == 'editconditions') {
- $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
+ $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id', 0, $type);
} else {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
}
@@ -446,7 +446,7 @@ if ($object->id > 0) {
}
if ($action == 'editpaymentterm') {
- $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $duedate, 'paymentterm');
+ print $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $duedate, 'paymentterm', 0, 0, 1, $type);
} else {
print dol_print_date($duedate, 'day');
if ($object->hasDelay()) {
@@ -468,8 +468,12 @@ if ($object->id > 0) {
}
print '';
print ' | ';
+ $filtertype = 'CRDT';
+ if ($type == 'bank-transfer') {
+ $filtertype = 'DBIT';
+ }
if ($action == 'editmode') {
- $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id');
+ $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', $filtertype, 1, 0, $type);
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none');
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 37155a4566e..c69b794a011 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3884,8 +3884,8 @@ class Form
* @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
+ * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
+ * @param string $morecss Add more CSS on select tag
* @return void
*/
public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '')
@@ -5108,17 +5108,21 @@ class Form
* @param string $selected Id condition pre-selectionne
* @param string $htmlname Name of select html field
* @param int $addempty Add empty entry
+ * @param string $type Type ('direct-debit' or 'bank-transfer')
* @return void
*/
- public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0)
+ public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '')
{
// phpcs:enable
global $langs;
if ($htmlname != "none") {
- print '';
} else {
@@ -5212,10 +5216,11 @@ class Form
* @param int $displayhour Display hour selector
* @param int $displaymin Display minutes selector
* @param int $nooutput 1=No print output, return string
+ * @param string $type 'direct-debit' or 'bank-transfer'
* @return string
* @see selectDate()
*/
- public function form_date($page, $selected, $htmlname, $displayhour = 0, $displaymin = 0, $nooutput = 0)
+ public function form_date($page, $selected, $htmlname, $displayhour = 0, $displaymin = 0, $nooutput = 0, $type = '')
{
// phpcs:enable
global $langs;
@@ -5223,9 +5228,12 @@ class Form
$ret = '';
if ($htmlname != "none") {
- $ret .= ' |