diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index bf310d92f8d..b4b853b58bc 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1508,7 +1508,16 @@ if ($action == 'create') $langs->load('orders'); $txt=$langs->trans("SupplierOrder"); } - print ''.$txt.''.$objectsrc->getNomUrl(1).''; + print ''.$txt.''.$objectsrc->getNomUrl(1); + //We check if Origin document has already an invoice attached to it + $objectsrc->fetchObjectLinked($originid,'','','invoice_supplier'); + $cntinvoice=count($objectsrc->linkedObjects['invoice_supplier']); + if ($cntinvoice>=1) + { + setEventMessage('WarningBillExist','warnings'); + echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; + } + echo ''; print ''.$langs->trans('TotalHT').''.price($objectsrc->total_ht).''; print ''.$langs->trans('TotalVAT').''.price($objectsrc->total_tva).""; if ($mysoc->country_code=='ES')