diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3af8477f3ec..86d3abedd2b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2822,15 +2822,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'), - '
' . $langs->trans("ErrorRecordNotFound") . '
'; - llxFooter(); - exit; -} $form = new Form($db); $formother = new FormOther($db); @@ -3759,6 +3750,15 @@ if ($action == 'create') } elseif ($id > 0 || !empty($ref)) { + if (empty($object->id)) { + llxHeader(); + $langs->load('errors'); + echo '
'.$langs->trans("ErrorRecordNotFound"); + echo ' '.$langs->trans('GoBack').'
'; + llxFooter(); + exit; + } + /* * Show object in view mode */ diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index e16cca840c7..70b37429eff 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -120,10 +120,8 @@ 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'), - '
' . $langs->trans("ErrorRecordNotFound") . '
'; + echo '
'.$langs->trans("ErrorRecordNotFound").'
'; llxFooter(); exit; } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 153eff9f1f3..8f664bfaed3 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -88,10 +88,8 @@ 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'), - '
' . $langs->trans("ErrorRecordNotFound") . '
'; + echo '
'.$langs->trans("ErrorRecordNotFound").'
'; llxFooter(); exit; } diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 955c41693c0..820793c14d7 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -45,10 +45,8 @@ $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'), - '
' . $langs->trans("ErrorRecordNotFound") . '
'; + echo '
'.$langs->trans("ErrorRecordNotFound").'
'; llxFooter(); exit; } diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 16b4944b144..a3ef2b7c5c2 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -66,10 +66,8 @@ 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'), - '
' . $langs->trans("ErrorRecordNotFound") . '
'; + echo '
'.$langs->trans("ErrorRecordNotFound").'
'; llxFooter(); exit; }