NEW cancel orders on massaction
This commit is contained in:
parent
2f2d17926d
commit
a20ec7ba1e
@ -208,6 +208,7 @@ if (empty($reshook))
|
||||
$uploaddir = $conf->commande->dir_output;
|
||||
$trigger_name='ORDER_SENTBYMAIL';
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -419,6 +420,8 @@ if ($resql)
|
||||
$arrayofmassactions = array(
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
'builddoc'=>$langs->trans("PDFMerge"),
|
||||
'cancelorders'=>$langs->trans("Cancel"),
|
||||
|
||||
);
|
||||
if($user->rights->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||
if ($user->rights->commande->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||
|
||||
@ -736,6 +736,20 @@ if ($massaction == 'confirm_createbills')
|
||||
}
|
||||
}
|
||||
|
||||
if ($massaction == 'cancelorders')
|
||||
{
|
||||
$orders = GETPOST('toselect', 'array');
|
||||
foreach ($orders as $id_order)
|
||||
{
|
||||
|
||||
$cmd = new Commande($db);
|
||||
if ($cmd->fetch($id_order) <= 0)
|
||||
continue;
|
||||
$cmd->cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_search'))
|
||||
{
|
||||
if (empty($diroutputmassaction))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user