1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Fix to show all clients when cloning

This commit is contained in:
Hillel Coren 2016-03-09 13:35:46 +02:00
parent b5784f2137
commit 4912c40650

View File

@ -99,6 +99,8 @@ class InvoiceController extends BaseController
->where('invitations.deleted_at', '=', null)
->select('contacts.public_id')->lists('public_id');
$clients = Client::scope()->withTrashed()->with('contacts', 'country');
if ($clone) {
$invoice->id = $invoice->public_id = null;
$invoice->invoice_number = $account->getNextInvoiceNumber($invoice);
@ -111,6 +113,7 @@ class InvoiceController extends BaseController
Utils::trackViewed($invoice->getDisplayName().' - '.$invoice->client->getDisplayName(), $invoice->getEntityType());
$method = 'PUT';
$url = "{$entityType}s/{$publicId}";
$clients->whereId($invoice->client_id);
}
$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;
$data = array(
'clients' => Client::scope()->withTrashed()->with('contacts', 'country')->whereId($invoice->client_id)->get(),
'clients' => $clients->get(),
'entityType' => $entityType,
'showBreadcrumbs' => $clone,
'invoice' => $invoice,