diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 6d3e8322337..48f5bf76155 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1144,6 +1144,10 @@ elseif (! empty($object->id)) $author = new User($db); $author->fetch($object->user_author_id); + $societe = new Fournisseur($db); + $result=$societe->fetch($object->socid); + if ($result < 0) dol_print_error($db); + $head = ordersupplier_prepare_head($object); $title=$langs->trans("SupplierOrder"); @@ -1751,7 +1755,7 @@ elseif (! empty($object->id)) $var = true; // Add free products/services - $object->formAddObjectLine(1, $mysoc, $soc); + $object->formAddObjectLine(1, $societe, $mysoc); $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index aa69e259353..a244d85b343 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1888,8 +1888,7 @@ else // Show product and description $type=(! empty($object->lines[$i]->product_type)?$object->lines[$i]->product_type:(! empty($object->lines[$i]->fk_product_type)?$object->lines[$i]->fk_product_type:0)); - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. + // Try to enhance type detection using date_start and date_end for free lines where type was not saved. $date_start=''; $date_end=''; if (! empty($object->lines[$i]->date_start)) @@ -2077,7 +2076,7 @@ else $var = true; // Add free products/services - $object->formAddObjectLine(1, $mysoc, $soc); + $object->formAddObjectLine(1, $societe, $mysoc); $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook