diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 23fc14c332c..38de1e3854a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -493,6 +493,10 @@ if (empty($reshook)) { for ($i = 0; $i < $num; $i++) { $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); + // If we build one invoice for several supplier orders, append the source order reference on the invoice line. + if (!empty($createbills_onebythird)) { + $desc = dol_concatdesc($desc, $langs->trans("SupplierOrder").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day')); + } if ($lines[$i]->subprice < 0) { require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index e9aaef56d25..599567772cb 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1080,7 +1080,7 @@ class Thirdparties extends DolibarrApi } $result = $this->company->fetch($id); - if (!is_array($result)) { + if ($result <= 0) { throw new RestException(404, 'Thirdparty not found'); }