Update actions_massactions.inc.php

This commit is contained in:
Laurent Destailleur 2019-01-08 16:50:27 +01:00 committed by GitHub
parent 47448b77f0
commit a1f5ede736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);