mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
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:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user