From 3ede626932bcce9e7500cbf832e5aa3a6d0e0fcf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Mar 2019 22:30:52 +0100 Subject: [PATCH] FIX If we build one invoice for several orders, we must put the ref of order on the line to not lose information. Conflicts: htdocs/commande/list.php htdocs/core/actions_massactions.inc.php --- htdocs/core/actions_massactions.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 33eeda9f4b2..f7208111d7a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -519,7 +519,7 @@ if ($massaction == 'confirm_createbills') 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; @@ -577,6 +577,12 @@ if ($massaction == 'confirm_createbills') for ($i=0;$i<$num;$i++) { $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); + // If we build one invoice for several order, we must put the invoice of order on the line + if (! empty($createbills_onebythird)) + { + $desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs)); + } + if ($lines[$i]->subprice < 0) { // Negative line, we create a discount line