FIX: invoice: inpossible to create an invoice because of very bad check + warnings when trying to print tabs for invoice with no ID
This commit is contained in:
parent
e1af439a6d
commit
eb8d7f92c3
@ -2756,15 +2756,6 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
@ -3679,6 +3670,15 @@ if ($action == 'create')
|
||||
}
|
||||
elseif ($id > 0 || !empty($ref))
|
||||
{
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
|
||||
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Show object in view mode
|
||||
*/
|
||||
|
||||
@ -120,10 +120,9 @@ elseif ($action == 'deletecontact' && $user->rights->facture->creer)
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
|
||||
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -87,10 +87,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
|
||||
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -45,10 +45,9 @@ $ref = GETPOST("ref", 'alpha');
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
|
||||
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -66,10 +66,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
|
||||
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user