From decf04d15cf3e8aacb690711515ff56aa3e10d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= <81741011+altairis-noe@users.noreply.github.com> Date: Sun, 28 Apr 2024 01:49:05 +0200 Subject: [PATCH] NEW: new consts to redirect from massaction createbills (#29436) * NEW: new const to redirect to unique generated invoice from massaction * NEW: new const to redirect to invoice list from massaction --------- Co-authored-by: Laurent Destailleur --- htdocs/commande/list.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 43dd75d70c6..7f3b1fd401b 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -594,10 +594,20 @@ if (empty($reshook)) { $db->commit(); if ($nb_bills_created == 1) { + if (getDolGlobalInt('MAIN_MASSACTION_CREATEBILLS_REDIRECT_IF_ONE') == 1) { + // Redirect to generated invoice if unique + header('Location: '.DOL_URL_ROOT.'/compta/facture/card.php?id='.urlencode((string) $lastid)); + exit; + } $texttoshow = $langs->trans('BillXCreated', '{s1}'); $texttoshow = str_replace('{s1}', ''.$lastref.'', $texttoshow); setEventMessages($texttoshow, null, 'mesgs'); } else { + if (getDolGlobalInt('MAIN_MASSACTION_CREATEBILLS_REDIRECT_IF_MANY') == 1) { + // Redirect to invoice list + header("Location: ".DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills'); + exit; + } setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs'); }