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);
|
$clone = $this->invoiceRepo->cloneInvoice($invoice, $invoice->id);
|
||||||
|
|
||||||
Session::flash('message', trans('texts.converted_to_invoice'));
|
Session::flash('message', trans('texts.converted_to_invoice'));
|
||||||
|
|
||||||
return Redirect::to('invoices/'.$clone->public_id);
|
return Redirect::to('invoices/'.$clone->public_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,15 @@ class QuoteController extends \BaseController
|
|||||||
public function bulk()
|
public function bulk()
|
||||||
{
|
{
|
||||||
$action = Input::get('action');
|
$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');
|
$statusId = Input::get('statusId');
|
||||||
$ids = Input::get('id') ? Input::get('id') : Input::get('ids');
|
$ids = Input::get('id') ? Input::get('id') : Input::get('ids');
|
||||||
$count = $this->invoiceRepo->bulk($ids, $action, $statusId);
|
$count = $this->invoiceRepo->bulk($ids, $action, $statusId);
|
||||||
|
@ -162,6 +162,8 @@ class InvoiceRepository
|
|||||||
} elseif ($entityType == ENTITY_QUOTE) {
|
} elseif ($entityType == ENTITY_QUOTE) {
|
||||||
if ($model->quote_invoice_id) {
|
if ($model->quote_invoice_id) {
|
||||||
$str .= '<li><a href="'.\URL::to("invoices/{$model->quote_invoice_id}/edit").'">'.trans("texts.view_invoice").'</a></li>';
|
$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:onSaveClick()" id="saveButton">{{ trans("texts.save_{$entityType}") }}</a></li>
|
||||||
<li><a href="javascript:onCloneClick()">{{ trans("texts.clone_{$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><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)
|
@if ($invoice && $entityType == ENTITY_QUOTE)
|
||||||
<li class="divider"></li>
|
|
||||||
@if ($invoice->quote_invoice_id)
|
@if ($invoice->quote_invoice_id)
|
||||||
<li><a href="{{ URL::to("invoices/{$invoice->quote_invoice_id}/edit") }}">{{ trans("texts.view_invoice") }}</a></li>
|
<li><a href="{{ URL::to("invoices/{$invoice->quote_invoice_id}/edit") }}">{{ trans("texts.view_invoice") }}</a></li>
|
||||||
@else
|
@else
|
||||||
@ -299,16 +303,10 @@
|
|||||||
@endif
|
@endif
|
||||||
@elseif ($invoice && $entityType == ENTITY_INVOICE)
|
@elseif ($invoice && $entityType == ENTITY_INVOICE)
|
||||||
@if ($invoice->quote_id)
|
@if ($invoice->quote_id)
|
||||||
<li class="divider"></li>
|
|
||||||
<li><a href="{{ URL::to("quotes/{$invoice->quote_id}/edit") }}">{{ trans("texts.view_quote") }}</a></li>
|
<li><a href="{{ URL::to("quotes/{$invoice->quote_id}/edit") }}">{{ trans("texts.view_quote") }}</a></li>
|
||||||
@endif
|
@endif
|
||||||
@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 class="divider"></li>
|
||||||
<li><a href="javascript:onArchiveClick()">{{ trans("texts.archive_{$entityType}") }}</a></li>
|
<li><a href="javascript:onArchiveClick()">{{ trans("texts.archive_{$entityType}") }}</a></li>
|
||||||
<li><a href="javascript:onDeleteClick()">{{ trans("texts.delete_{$entityType}") }}</a></li>
|
<li><a href="javascript:onDeleteClick()">{{ trans("texts.delete_{$entityType}") }}</a></li>
|
||||||
|
@ -72,6 +72,10 @@
|
|||||||
$('#id').val(id);
|
$('#id').val(id);
|
||||||
submitForm('restore');
|
submitForm('restore');
|
||||||
}
|
}
|
||||||
|
function convertEntity(id) {
|
||||||
|
$('#id').val(id);
|
||||||
|
submitForm('convert');
|
||||||
|
}
|
||||||
|
|
||||||
function markEntity(id, statusId) {
|
function markEntity(id, statusId) {
|
||||||
$('#id').val(id);
|
$('#id').val(id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user