Working on export

This commit is contained in:
Hillel Coren 2017-08-23 11:26:00 +03:00
parent 73a164be5c
commit e899be7c55
2 changed files with 34 additions and 31 deletions

View File

@ -198,7 +198,7 @@ class ExportController extends BaseController
if ($request->input('include') === 'all' || $request->input('invoices')) { if ($request->input('include') === 'all' || $request->input('invoices')) {
$data['invoices'] = Invoice::scope() $data['invoices'] = Invoice::scope()
->invoiceType(INVOICE_TYPE_STANDARD) ->invoiceType(INVOICE_TYPE_STANDARD)
->with('user', 'client.contacts', 'invoice_status') ->with('user', 'client.contacts', 'invoice_status', 'invoice_items')
->withArchived() ->withArchived()
->where('is_recurring', '=', false) ->where('is_recurring', '=', false)
->get(); ->get();
@ -207,7 +207,7 @@ class ExportController extends BaseController
if ($request->input('include') === 'all' || $request->input('quotes')) { if ($request->input('include') === 'all' || $request->input('quotes')) {
$data['quotes'] = Invoice::scope() $data['quotes'] = Invoice::scope()
->invoiceType(INVOICE_TYPE_QUOTE) ->invoiceType(INVOICE_TYPE_QUOTE)
->with('user', 'client.contacts', 'invoice_status') ->with('user', 'client.contacts', 'invoice_status', 'invoice_items')
->withArchived() ->withArchived()
->where('is_recurring', '=', false) ->where('is_recurring', '=', false)
->get(); ->get();
@ -216,7 +216,7 @@ class ExportController extends BaseController
if ($request->input('include') === 'all' || $request->input('recurring')) { if ($request->input('include') === 'all' || $request->input('recurring')) {
$data['recurringInvoices'] = Invoice::scope() $data['recurringInvoices'] = Invoice::scope()
->invoiceType(INVOICE_TYPE_STANDARD) ->invoiceType(INVOICE_TYPE_STANDARD)
->with('user', 'client.contacts', 'invoice_status', 'frequency') ->with('user', 'client.contacts', 'invoice_status', 'frequency', 'invoice_items')
->withArchived() ->withArchived()
->where('is_recurring', '=', true) ->where('is_recurring', '=', true)
->get(); ->get();

View File

@ -25,10 +25,12 @@
@if ($account->custom_invoice_text_label2) @if ($account->custom_invoice_text_label2)
<td>{{ $account->custom_invoice_text_label2 }}</td> <td>{{ $account->custom_invoice_text_label2 }}</td>
@endif @endif
<td>{{ trans('texts.product') }}</td>
</tr> </tr>
@foreach ($invoices as $invoice) @foreach ($invoices as $invoice)
@if (!$invoice->client->is_deleted) @if (!$invoice->client->is_deleted)
@foreach ($invoice->invoice_items as $item)
<tr> <tr>
<td>{{ $invoice->present()->client }}</td> <td>{{ $invoice->present()->client }}</td>
<td>{{ $invoice->present()->email }}</td> <td>{{ $invoice->present()->email }}</td>
@ -57,5 +59,6 @@
<td>{{ $invoice->custom_text_value2 }}</td> <td>{{ $invoice->custom_text_value2 }}</td>
@endif @endif
</tr> </tr>
@endforeach
@endif @endif
@endforeach @endforeach