Fix: Mauvaise sauvagrde du type de paiement sur page edition ligne bancaire
This commit is contained in:
parent
2a782ff59a
commit
ed0b632eeb
@ -156,8 +156,9 @@ $var=False;
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,";
|
||||
$sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, fk_account";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=$rowid";
|
||||
$sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, b.fk_account";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= " WHERE rowid=".$rowid;
|
||||
$sql.= " ORDER BY dateo ASC";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@ -214,10 +215,11 @@ if ($result)
|
||||
|
||||
print "</form>";
|
||||
|
||||
// Type paiement
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td colspan=\"3\">";
|
||||
print "<form method=\"post\" action=\"ligne.php?rowid=$objp->rowid\">";
|
||||
print '<input type="hidden" name="action" value="type">';
|
||||
print $html->select_types_paiements($objp->fk_type,"value");
|
||||
print $html->select_types_paiements($objp->fk_type,"value",'',2);
|
||||
print '<input type="text" name="num_chq" value="'.(empty($objp->num_chq) ? '' : $objp->num_chq).'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Update").'">';
|
||||
print "</form>";
|
||||
|
||||
@ -605,7 +605,7 @@ class Form
|
||||
* \param selected Id du mode de paiement présélectionné
|
||||
* \param htmlname Nom de la zone select
|
||||
* \param filtertype Pour filtre
|
||||
* \param format 0=id+libelle, 1=code+code
|
||||
* \param format 0=id+libelle, 1=code+code, 2=code+libelle
|
||||
*/
|
||||
function select_types_paiements($selected='',$htmlname='paiementtype',$filtertype='',$format=0)
|
||||
{
|
||||
@ -624,12 +624,14 @@ class Form
|
||||
|
||||
if ($format == 0) print '<option value="'.$id.'"';
|
||||
if ($format == 1) print '<option value="'.$code.'"';
|
||||
if ($format == 2) print '<option value="'.$code.'"';
|
||||
// Si selected est text, on compare avec code, sinon avec id
|
||||
if (eregi('[a-z]', $selected) && $selected == $code) print ' selected="true"';
|
||||
elseif ($selected == $id) print ' selected="true"';
|
||||
print '>';
|
||||
if ($format == 0) print $this->cache_types_paiements_libelle[$id];
|
||||
if ($format == 1) print $code;
|
||||
if ($format == 2) print $this->cache_types_paiements_libelle[$id];
|
||||
print '</option>';
|
||||
}
|
||||
print '</select>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user