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; } }