Fix: Error management. Payment date is not preselected to avoid errors.

This commit is contained in:
Laurent Destailleur 2008-07-04 10:44:54 +00:00
parent 09ae698e43
commit e3377b1e29

View File

@ -104,6 +104,12 @@ if ($_POST['action'] == 'add_paiement' || $_POST['action'] == 'confirm_paiement'
$fiche_erreur_message = '<div class="error">'.$langs->transnoentities('ErrorFieldRequired',$langs->trans('Amount')).'</div>'; $fiche_erreur_message = '<div class="error">'.$langs->transnoentities('ErrorFieldRequired',$langs->trans('Amount')).'</div>';
$error++; $error++;
} }
if (empty($datepaye))
{
$fiche_erreur_message = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Date')).'</div>';
$error++;
}
} }
/* /*
@ -214,7 +220,7 @@ if ($user->societe_id > 0)
/* /*
* Affichage * View
*/ */
llxHeader(); llxHeader();
@ -268,11 +274,7 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$facture->client->getNomUrl(4)."</td></tr>\n"; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.$facture->client->getNomUrl(4)."</td></tr>\n";
print '<tr><td>'.$langs->trans('Date').'</td><td>'; print '<tr><td>'.$langs->trans('Date').'</td><td>';
if (!empty($_POST['remonth']) && !empty($_POST['reday']) && !empty($_POST['reyear'])) $html->select_date(-1,'','','',0,"add_paiement");
$sel_date=mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
else
$sel_date='';
$html->select_date($sel_date,'','','','',"add_paiement");
print '</td>'; print '</td>';
print '<td>'.$langs->trans('Comments').'</td></tr>'; print '<td>'.$langs->trans('Comments').'</td></tr>';
@ -438,7 +440,7 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
// Message d'erreur // Message d'erreur
if ($fiche_erreur_message) if ($fiche_erreur_message)
{ {
print '<tr><td colspan="3" align="center">'.$fiche_erreur_message.'</td></tr>'; print $fiche_erreur_message;
} }
// Formulaire confirmation // Formulaire confirmation