Merge pull request #19634 from atm-gregr/FIX_Info_Tab_returns_Record_not_found
FIX : info tab on customer invoice record not found
This commit is contained in:
commit
15b85258e8
@ -38,29 +38,30 @@ $langs->loadLangs(array('companies', 'bills'));
|
||||
$id = GETPOST("facid", "int");
|
||||
$ref = GETPOST("ref", 'alpha');
|
||||
|
||||
$object = new Facture($db);
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$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();
|
||||
if (empty($object->id)) {
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$object->fetch_thirdparty();
|
||||
$object->info($object->id);
|
||||
|
||||
$head = facture_prepare_head($object);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user