public function bulk()
{
$action = Input::get('bulk_action') ?: Input::get('action');
$ids = Input::get('bulk_public_id') ?: (Input::get('public_id') ?: Input::get('ids'));
if ($action == 'convert') {
$invoice = Invoice::with('invoice_items')->scope($ids)->firstOrFail();
$clone = $this->invoiceService->convertQuote($invoice);
Session::flash('message', trans('texts.converted_to_invoice'));
return Redirect::to('invoices/' . $clone->public_id);
}
$count = $this->invoiceService->bulk($ids, $action);
if ($count > 0) {
$key = $action == 'markSent' ? 'updated_quote' : "{$action}d_quote";
$message = Utils::pluralize($key, $count);
Session::flash('message', $message);
}
return $this->returnBulk(ENTITY_QUOTE, $action, $ids);
}