diff --git a/app/Export/CSV/CreditExport.php b/app/Export/CSV/CreditExport.php index d0a29ea3c780..19c2383e4a28 100644 --- a/app/Export/CSV/CreditExport.php +++ b/app/Export/CSV/CreditExport.php @@ -177,6 +177,14 @@ class CreditExport extends BaseExport $entity['credit.status'] = $credit->stringStatus($credit->status_id); } + if (in_array('credit.assigned_user_id', $this->input['report_keys'])) { + $entity['credit.assigned_user_id'] = $credit->assigned_user ? $credit->assigned_user->present()->name(): ''; + } + + if (in_array('credit.user_id', $this->input['report_keys'])) { + $entity['credit.user_id'] = $credit->user ? $credit->user->present()->name(): ''; + } + return $entity; } } diff --git a/app/Export/CSV/InvoiceExport.php b/app/Export/CSV/InvoiceExport.php index 02cadb7ffe70..73afd9d4ff70 100644 --- a/app/Export/CSV/InvoiceExport.php +++ b/app/Export/CSV/InvoiceExport.php @@ -151,7 +151,15 @@ class InvoiceExport extends BaseExport $entity['invoice.auto_bill_enabled'] = $invoice->auto_bill_enabled ? ctrans('texts.yes') : ctrans('texts.no'); } - + if (in_array('invoice.assigned_user_id', $this->input['report_keys'])) { + $entity['invoice.assigned_user_id'] = $invoice->assigned_user ? $invoice->assigned_user->present()->name(): ''; + } + + if (in_array('invoice.user_id', $this->input['report_keys'])) { + $entity['invoice.user_id'] = $invoice->user ? $invoice->user->present()->name(): ''; + } + + return $entity; } } diff --git a/app/Export/CSV/InvoiceItemExport.php b/app/Export/CSV/InvoiceItemExport.php index cf1fddd26731..33924e443f58 100644 --- a/app/Export/CSV/InvoiceItemExport.php +++ b/app/Export/CSV/InvoiceItemExport.php @@ -227,6 +227,13 @@ class InvoiceItemExport extends BaseExport $entity['invoice.recurring_id'] = $invoice->recurring_invoice->number ?? ''; } + if (in_array('invoice.assigned_user_id', $this->input['report_keys'])) { + $entity['invoice.assigned_user_id'] = $invoice->assigned_user ? $invoice->assigned_user->present()->name(): ''; + } + + if (in_array('invoice.user_id', $this->input['report_keys'])) { + $entity['invoice.user_id'] = $invoice->user ? $invoice->user->present()->name(): ''; + } return $entity; } diff --git a/app/Export/CSV/QuoteExport.php b/app/Export/CSV/QuoteExport.php index eba6adbcef26..591312a0e8b9 100644 --- a/app/Export/CSV/QuoteExport.php +++ b/app/Export/CSV/QuoteExport.php @@ -149,6 +149,15 @@ class QuoteExport extends BaseExport $entity['quote.invoice'] = $quote->invoice ? $quote->invoice->number : ''; } + if (in_array('quote.assigned_user_id', $this->input['report_keys'])) { + $entity['quote.assigned_user_id'] = $quote->assigned_user ? $quote->assigned_user->present()->name(): ''; + } + + if (in_array('quote.user_id', $this->input['report_keys'])) { + $entity['quote.user_id'] = $quote->user ? $quote->user->present()->name(): ''; + } + + return $entity; } } diff --git a/app/Export/CSV/QuoteItemExport.php b/app/Export/CSV/QuoteItemExport.php index fe8cbb593a71..f41e99f58806 100644 --- a/app/Export/CSV/QuoteItemExport.php +++ b/app/Export/CSV/QuoteItemExport.php @@ -198,6 +198,16 @@ class QuoteItemExport extends BaseExport if (in_array('status_id', $this->input['report_keys'])) { $entity['status'] = $quote->stringStatus($quote->status_id); } + + if (in_array('quote.assigned_user_id', $this->input['report_keys'])) { + $entity['quote.assigned_user_id'] = $quote->assigned_user ? $quote->assigned_user->present()->name(): ''; + } + + if (in_array('quote.user_id', $this->input['report_keys'])) { + $entity['quote.user_id'] = $quote->user ? $quote->user->present()->name(): ''; + } + + return $entity; }