From 4840207b3ba76a1985a421f585f82ccebc1633c0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 24 Apr 2023 13:04:52 +1000 Subject: [PATCH] Update payment report export --- app/Export/CSV/PaymentExport.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Export/CSV/PaymentExport.php b/app/Export/CSV/PaymentExport.php index 41e090f520f0..78592b763c86 100644 --- a/app/Export/CSV/PaymentExport.php +++ b/app/Export/CSV/PaymentExport.php @@ -49,6 +49,7 @@ class PaymentExport extends BaseExport 'transaction_reference' => 'transaction_reference', 'type' => 'type_id', 'vendor' => 'vendor_id', + 'invoices' => 'invoices', ]; private array $decorate_keys = [ @@ -59,6 +60,7 @@ class PaymentExport extends BaseExport 'currency', 'exchange_currency', 'type', + 'invoices', ]; public function __construct(Company $company, array $input) @@ -154,6 +156,8 @@ class PaymentExport extends BaseExport $entity['gateway'] = $payment->gateway_type ? $payment->gateway_type->name : 'Unknown Type'; } + $entity['invoices'] = $payment->invoices()->exists() ? $payment->invoices->pluck('number')->implode(',') : ''; + return $entity; } }