diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 532067104e9..3270c3a9663 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3544,10 +3544,19 @@ if ($action == 'create') } // Other attributes - $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2'); + $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid'=>$socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { + if (!empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_INVOICE)) { + // copy from thirdparty + $tpExtrafields = new Extrafields($db); + $tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element); + if ($soc->fetch_optionals() > 0) { + $object->array_options = array_merge($object->array_options, $soc->array_options); + } + }; + print $object->showOptionals($extrafields, 'edit', $parameters); }