From a1f5ede736442e7f0a643b3496a47daf100f0c76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Jan 2019 16:50:27 +0100 Subject: [PATCH] Update actions_massactions.inc.php --- htdocs/core/actions_massactions.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 2ca8a8f86c9..0a71deed66f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -516,7 +516,9 @@ if ($massaction == 'confirm_createbills') $objecttmp = new Facture($db); if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. else { - + // Load extrafields of order + $cmd->fetch_optionals(); + $objecttmp->socid = $cmd->socid; $objecttmp->type = Facture::TYPE_STANDARD; $objecttmp->cond_reglement_id = $cmd->cond_reglement_id; @@ -533,9 +535,7 @@ if ($massaction == 'confirm_createbills') $objecttmp->origin = 'commande'; $objecttmp->origin_id = $id_order; - // Replicate extrafields - $cmd->fetch_optionals($id_order); - $objecttmp->array_options = $cmd->array_options; + $objecttmp->array_options = $cmd->array_options; // Copy extrafields $res = $objecttmp->create($user);