mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix to show all clients when cloning
This commit is contained in:
parent
b5784f2137
commit
4912c40650
@ -99,6 +99,8 @@ class InvoiceController extends BaseController
|
|||||||
->where('invitations.deleted_at', '=', null)
|
->where('invitations.deleted_at', '=', null)
|
||||||
->select('contacts.public_id')->lists('public_id');
|
->select('contacts.public_id')->lists('public_id');
|
||||||
|
|
||||||
|
$clients = Client::scope()->withTrashed()->with('contacts', 'country');
|
||||||
|
|
||||||
if ($clone) {
|
if ($clone) {
|
||||||
$invoice->id = $invoice->public_id = null;
|
$invoice->id = $invoice->public_id = null;
|
||||||
$invoice->invoice_number = $account->getNextInvoiceNumber($invoice);
|
$invoice->invoice_number = $account->getNextInvoiceNumber($invoice);
|
||||||
@ -111,6 +113,7 @@ class InvoiceController extends BaseController
|
|||||||
Utils::trackViewed($invoice->getDisplayName().' - '.$invoice->client->getDisplayName(), $invoice->getEntityType());
|
Utils::trackViewed($invoice->getDisplayName().' - '.$invoice->client->getDisplayName(), $invoice->getEntityType());
|
||||||
$method = 'PUT';
|
$method = 'PUT';
|
||||||
$url = "{$entityType}s/{$publicId}";
|
$url = "{$entityType}s/{$publicId}";
|
||||||
|
$clients->whereId($invoice->client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date);
|
$invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date);
|
||||||
@ -157,7 +160,7 @@ class InvoiceController extends BaseController
|
|||||||
$lastSent = ($invoice->is_recurring && $invoice->last_sent_date) ? $invoice->recurring_invoices->last() : null;
|
$lastSent = ($invoice->is_recurring && $invoice->last_sent_date) ? $invoice->recurring_invoices->last() : null;
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'clients' => Client::scope()->withTrashed()->with('contacts', 'country')->whereId($invoice->client_id)->get(),
|
'clients' => $clients->get(),
|
||||||
'entityType' => $entityType,
|
'entityType' => $entityType,
|
||||||
'showBreadcrumbs' => $clone,
|
'showBreadcrumbs' => $clone,
|
||||||
'invoice' => $invoice,
|
'invoice' => $invoice,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user