fix info tab on customer invoice record not found

This commit is contained in:
atm-gregr 2021-12-16 10:19:42 +01:00
parent e85289777c
commit cc12baed57

View File

@ -43,6 +43,12 @@ $ref = GETPOST("ref", 'alpha');
* View
*/
$object = new Facture($db);
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$object->info($object->id);
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
@ -57,12 +63,6 @@ $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);
$object = new Facture($db);
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$object->info($object->id);
$head = facture_prepare_head($object);
print dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill');