FIX edition of fields on credit transfer tab
This commit is contained in:
parent
977a596500
commit
a57925b0b7
@ -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 '</td><td colspan="3">';
|
||||
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 '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
$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');
|
||||
}
|
||||
|
||||
@ -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 '<form method="post" action="'.$page.'">';
|
||||
print '<form method="POST" action="'.$page.'">';
|
||||
print '<input type="hidden" name="action" value="setconditions">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$this->select_conditions_paiements($selected, $htmlname, -1, $addempty);
|
||||
if ($type) {
|
||||
print '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
|
||||
}
|
||||
$this->select_conditions_paiements($selected, $htmlname, -1, $addempty, 0, '');
|
||||
print '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
} 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 .= '<form method="post" action="'.$page.'" name="form'.$htmlname.'">';
|
||||
$ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">';
|
||||
$ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
|
||||
$ret .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if ($type) {
|
||||
$ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
|
||||
}
|
||||
$ret .= '<table class="nobordernopadding">';
|
||||
$ret .= '<tr><td>';
|
||||
$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
|
||||
@ -5290,12 +5298,13 @@ class Form
|
||||
* @param string $page Page
|
||||
* @param int $selected Id mode pre-selectionne
|
||||
* @param string $htmlname Name of select html field
|
||||
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
|
||||
* @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
|
||||
* @param int $active Active or not, -1 = all
|
||||
* @param int $addempty 1=Add empty entry
|
||||
* @param int $addempty 1=Add empty entry
|
||||
* @param string $type Type ('direct-debit' or 'bank-transfer')
|
||||
* @return void
|
||||
*/
|
||||
public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0)
|
||||
public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
@ -5303,7 +5312,10 @@ class Form
|
||||
print '<form method="POST" action="'.$page.'">';
|
||||
print '<input type="hidden" name="action" value="setmode">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active);
|
||||
if ($type) {
|
||||
print '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
|
||||
}
|
||||
print $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1);
|
||||
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user