2
0
forked from Wavyzz/dolibarr

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 <eldy@destailleur.fr>
This commit is contained in:
Noé Cendrier
2024-04-28 01:49:05 +02:00
committed by GitHub
parent 743374eb2c
commit decf04d15c

View File

@@ -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}', '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?id='.urlencode((string) ($lastid)).'">'.$lastref.'</a>', $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');
}