NEW Bulk action validate on customer invoices

This commit is contained in:
Laurent Destailleur 2017-10-12 02:25:17 +02:00
parent 5fd6a27c62
commit ca0af5cddf
2 changed files with 10 additions and 2 deletions

View File

@ -233,7 +233,8 @@ if (empty($reshook))
$objectclass='Facture';
$objectlabel='Invoices';
$permtoread = $user->rights->facture->lire;
$permtodelete = $user->rights->facture->supprimer;
$permtocreate = $user->rights->facture->creer;
$permtodelete = $user->rights->facture->supprimer;
$uploaddir = $conf->facture->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -573,7 +574,8 @@ if ($resql)
}
$arrayofmassactions=array(
'presend'=>$langs->trans("SendByMail"),
'validate'=>$langs->trans("Validate"),
'presend'=>$langs->trans("SendByMail"),
'builddoc'=>$langs->trans("PDFMerge"),
);
if ($conf->prelevement->enabled)

View File

@ -663,6 +663,12 @@ if ($action == 'remove_file')
// Validate records
if (! $error && $massaction == 'validate' && $permtocreate)
{
if ($object->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
{
$langs->load("errors");
setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');
$error++;
}
if ($object->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL))
{
$langs->load("errors");