diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index ebaaa1f6c306..c7f30b03be29 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -84,13 +84,14 @@ class ExportController extends BaseController if ($key === 'account' || $key === 'title' || $key === 'multiUser') { continue; } + if ($key === 'recurringInvoices') { + $key = 'recurring_invoices'; + } $label = trans("texts.{$key}"); $excel->sheet($label, function($sheet) use ($key, $data) { if ($key === 'quotes') { $key = 'invoices'; $data['entityType'] = ENTITY_QUOTE; - } elseif ($key === 'recurringInvoices') { - $key = 'recurring_invoices'; } $sheet->loadView("export.{$key}", $data); }); @@ -107,7 +108,7 @@ class ExportController extends BaseController 'title' => 'Invoice Ninja v' . NINJA_VERSION . ' - ' . $account->formatDateTime($account->getDateTime()), 'multiUser' => $account->users->count() > 1 ]; - + if ($request->input(ENTITY_CLIENT)) { $data['clients'] = Client::scope() ->with('user', 'contacts', 'country') @@ -123,14 +124,14 @@ class ExportController extends BaseController ->with('user', 'client.contacts') ->get(); } - + if ($request->input(ENTITY_TASK)) { $data['tasks'] = Task::scope() ->with('user', 'client.contacts') ->withArchived() ->get(); } - + if ($request->input(ENTITY_INVOICE)) { $data['invoices'] = Invoice::scope() ->with('user', 'client.contacts', 'invoice_status') @@ -138,7 +139,7 @@ class ExportController extends BaseController ->where('is_quote', '=', false) ->where('is_recurring', '=', false) ->get(); - + $data['quotes'] = Invoice::scope() ->with('user', 'client.contacts', 'invoice_status') ->withArchived() @@ -153,7 +154,7 @@ class ExportController extends BaseController ->where('is_recurring', '=', true) ->get(); } - + if ($request->input(ENTITY_PAYMENT)) { $data['payments'] = Payment::scope() ->withArchived() @@ -161,7 +162,7 @@ class ExportController extends BaseController ->get(); } - + if ($request->input(ENTITY_VENDOR)) { $data['clients'] = Vendor::scope() ->with('user', 'vendor_contacts', 'country') @@ -172,14 +173,14 @@ class ExportController extends BaseController ->with('user', 'vendor.vendor_contacts') ->withTrashed() ->get(); - + /* $data['expenses'] = Credit::scope() ->with('user', 'client.contacts') ->get(); */ } - + return $data; } -} \ No newline at end of file +} diff --git a/app/Ninja/Presenters/InvoicePresenter.php b/app/Ninja/Presenters/InvoicePresenter.php index 36a2ce2acbd6..7c67fc98110b 100644 --- a/app/Ninja/Presenters/InvoicePresenter.php +++ b/app/Ninja/Presenters/InvoicePresenter.php @@ -45,6 +45,8 @@ class InvoicePresenter extends Presenter { return trans('texts.deleted'); } elseif ($this->entity->trashed()) { return trans('texts.archived'); + } elseif ($this->entity->is_recurring) { + return trans('texts.active'); } else { $status = $this->entity->invoice_status ? $this->entity->invoice_status->name : 'draft'; $status = strtolower($status); @@ -82,4 +84,4 @@ class InvoicePresenter extends Presenter { $client = $this->entity->client; return count($client->contacts) ? $client->contacts[0]->email : ''; } -} \ No newline at end of file +}