New: If there is only one back account and value is mandatory, then value is preselected.
This commit is contained in:
parent
457990e09b
commit
4269814214
@ -266,7 +266,7 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
|
|||||||
if ($facture->type != 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>';
|
if ($facture->type != 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>';
|
||||||
if ($facture->type == 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToDebit').'</span></td>';
|
if ($facture->type == 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToDebit').'</span></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',1);
|
$html->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1655,7 +1655,7 @@ class Form
|
|||||||
* @param htmlname Name of select zone
|
* @param htmlname Name of select zone
|
||||||
* @param statut Status of searched accounts (0=open, 1=closed)
|
* @param statut Status of searched accounts (0=open, 1=closed)
|
||||||
* @param filtre To filter list
|
* @param filtre To filter list
|
||||||
* @param useempty Add an empty value in list
|
* @param useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
|
||||||
*/
|
*/
|
||||||
function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0)
|
function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0)
|
||||||
{
|
{
|
||||||
@ -1679,7 +1679,7 @@ class Form
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
print '<select id="select'.$htmlname.'" class="flat selectbankaccount" name="'.$htmlname.'">';
|
print '<select id="select'.$htmlname.'" class="flat selectbankaccount" name="'.$htmlname.'">';
|
||||||
if ($useempty)
|
if ($useempty == 1 || ($useempty == 2 && $num > 1))
|
||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'"> </option>';
|
print '<option value="'.$obj->rowid.'"> </option>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user