mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Added 'convert to quote' option to quote list actions
This commit is contained in:
parent
24b2e851bb
commit
276b23da95
@ -477,7 +477,6 @@ class InvoiceController extends \BaseController
|
||||
$clone = $this->invoiceRepo->cloneInvoice($invoice, $invoice->id);
|
||||
|
||||
Session::flash('message', trans('texts.converted_to_invoice'));
|
||||
|
||||
return Redirect::to('invoices/'.$clone->public_id);
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,15 @@ class QuoteController extends \BaseController
|
||||
public function bulk()
|
||||
{
|
||||
$action = Input::get('action');
|
||||
|
||||
if ($action == 'convert') {
|
||||
$invoice = Invoice::with('invoice_items')->scope(Input::get('id'))->firstOrFail();
|
||||
$clone = $this->invoiceRepo->cloneInvoice($invoice, $invoice->id);
|
||||
|
||||
Session::flash('message', trans('texts.converted_to_invoice'));
|
||||
return Redirect::to('invoices/'.$clone->public_id);
|
||||
}
|
||||
|
||||
$statusId = Input::get('statusId');
|
||||
$ids = Input::get('id') ? Input::get('id') : Input::get('ids');
|
||||
$count = $this->invoiceRepo->bulk($ids, $action, $statusId);
|
||||
|
@ -162,6 +162,8 @@ class InvoiceRepository
|
||||
} elseif ($entityType == ENTITY_QUOTE) {
|
||||
if ($model->quote_invoice_id) {
|
||||
$str .= '<li><a href="'.\URL::to("invoices/{$model->quote_invoice_id}/edit").'">'.trans("texts.view_invoice").'</a></li>';
|
||||
} else {
|
||||
$str .= '<li><a href="javascript:convertEntity('.$model->public_id.')">'.trans("texts.convert_to_invoice").'</a></li>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -289,9 +289,13 @@
|
||||
<li><a href="javascript:onSaveClick()" id="saveButton">{{ trans("texts.save_{$entityType}") }}</a></li>
|
||||
<li><a href="javascript:onCloneClick()">{{ trans("texts.clone_{$entityType}") }}</a></li>
|
||||
<li><a href="{{ URL::to("{$entityType}s/{$entityType}_history/{$invoice->public_id}") }}">{{ trans("texts.view_history") }}</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
@if ($invoice->invoice_status_id < INVOICE_STATUS_SENT)
|
||||
<li><a href="javascript:onMarkClick()">{{ trans("texts.mark_sent") }}</a></li>
|
||||
@endif
|
||||
|
||||
@if ($invoice && $entityType == ENTITY_QUOTE)
|
||||
<li class="divider"></li>
|
||||
@if ($invoice->quote_invoice_id)
|
||||
<li><a href="{{ URL::to("invoices/{$invoice->quote_invoice_id}/edit") }}">{{ trans("texts.view_invoice") }}</a></li>
|
||||
@else
|
||||
@ -299,16 +303,10 @@
|
||||
@endif
|
||||
@elseif ($invoice && $entityType == ENTITY_INVOICE)
|
||||
@if ($invoice->quote_id)
|
||||
<li class="divider"></li>
|
||||
<li><a href="{{ URL::to("quotes/{$invoice->quote_id}/edit") }}">{{ trans("texts.view_quote") }}</a></li>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if ($invoice->invoice_status_id < INVOICE_STATUS_SENT)
|
||||
<li class="divider"></li>
|
||||
<li><a href="javascript:onMarkClick()">{{ trans("texts.mark_sent") }}</a></li>
|
||||
@endif
|
||||
|
||||
<li class="divider"></li>
|
||||
<li><a href="javascript:onArchiveClick()">{{ trans("texts.archive_{$entityType}") }}</a></li>
|
||||
<li><a href="javascript:onDeleteClick()">{{ trans("texts.delete_{$entityType}") }}</a></li>
|
||||
|
@ -68,10 +68,14 @@
|
||||
submitForm('archive');
|
||||
}
|
||||
|
||||
function restoreEntity(id) {
|
||||
$('#id').val(id);
|
||||
submitForm('restore');
|
||||
}
|
||||
function restoreEntity(id) {
|
||||
$('#id').val(id);
|
||||
submitForm('restore');
|
||||
}
|
||||
function convertEntity(id) {
|
||||
$('#id').val(id);
|
||||
submitForm('convert');
|
||||
}
|
||||
|
||||
function markEntity(id, statusId) {
|
||||
$('#id').val(id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user