From e99cec81d7dd63462e33054c6fcf54dff69b8193 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 19 Oct 2022 15:44:45 +0800 Subject: [PATCH] add further description to export payments --- .../Services/ExportsPaymentTransactions.php | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php index 8365f386..b98c3ccc 100644 --- a/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php +++ b/app/Classes/Modules/Exports/Services/ExportsPaymentTransactions.php @@ -87,22 +87,16 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading $furtherDescription = ''; - dd($transaction->transactionDetails); foreach ($transaction->transactionDetails as $item){ - switch($item->reference){ - case 'SHIPPING_FEE': - $furtherDescription .= str_replace('X1 Freight Service Charge
', '', $item->name)."\n"; - break; - case 'OVER_WEIGHT_CHARGES': - case 'MIN_CBM_CHARGES': - $furtherDescription .= $item->name.' '.$item->quantity.' CBM'."\n"; - break; - default: - $furtherDescription .= $item->name.' '.$item->quantity.' X '.$item->price."\n"; - - - } + if($item->reference === 'SHIPPING_FEE') + $furtherDescription .= str_replace('X1 Freight Service Charge
', '', $item->name)."\n"; + elseif($item->reference === 'OVER_WEIGHT_CHARGES') + $furtherDescription .= $item->name.' '.$item->quantity.' CBM'."\n"; + elseif($item->reference === 'MIN_CBM_CHARGES') + $furtherDescription .= $item->name.' '.$item->quantity.' CBM'."\n"; + else + $furtherDescription .= $item->name.' '.$item->quantity.' X '.$item->price."\n"; } return [