Fix: Error management missing

This commit is contained in:
Laurent Destailleur 2009-04-24 22:05:57 +00:00
parent abdabfb05e
commit e9773437d0

View File

@ -578,11 +578,18 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
} }
} }
// Predefined invoice // Standard invoice created from a predefined invoice
if ($_POST['type'] == 0 && $_POST['fac_rec'] > 0) if ($_POST['type'] == 0 && $_POST['fac_rec'] > 0)
{ {
$datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datefacture = dol_mktime(12, 0 , 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture))
{
$error=1;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Date")).'</div>';
}
if (! $error)
{
$facture->socid = $_POST['socid']; $facture->socid = $_POST['socid'];
$facture->type = $_POST['type']; $facture->type = $_POST['type'];
$facture->number = $_POST['facnumber']; $facture->number = $_POST['facnumber'];
@ -598,6 +605,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
$facid = $facture->create($user); $facid = $facture->create($user);
} }
}
// Standard or deposit or proformat invoice // Standard or deposit or proformat invoice
if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0) if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0)