From f361a7e185fc2c659f0e0f423d0c0d8b2b5b7183 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Wed, 8 May 2024 00:24:22 +0800 Subject: [PATCH] fix MappableTransactionWithDetailsResource.php --- app/Http/Resources/MappableTransactionWithDetailsResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/MappableTransactionWithDetailsResource.php b/app/Http/Resources/MappableTransactionWithDetailsResource.php index bf1fcf1d..1b287a75 100644 --- a/app/Http/Resources/MappableTransactionWithDetailsResource.php +++ b/app/Http/Resources/MappableTransactionWithDetailsResource.php @@ -32,7 +32,7 @@ class MappableTransactionWithDetailsResource extends JsonResource if ($this->type === TransactionType::PAYMENT) { $order = $this->owner->owner->owner; - $data['order_reference'] = $order->reference; + $data['order_reference'] = $order->reference ?? ''; $data['debtor_code'] = $order->companyModule->company->debtor; $data['created_at'] = $this->owner->created_at; // invoice date } elseif (in_array($this->type, [TransactionType::GROUP_PAYMENT, TransactionType::TOP_UP])) { @@ -52,7 +52,7 @@ class MappableTransactionWithDetailsResource extends JsonResource 'id' => $payment->id, 'updated_at' => $payment->updated_at, 'debtor_code' => $order->companyModule->company->debtor, - 'order_reference' => $order->reference, + 'order_reference' => $order->reference ?? '', 'bill_no' => null, 'type' => $payment->type, 'marking' => null,