mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-09-01 10:54:00 +00:00
update wallets exports
This commit is contained in:
@@ -150,14 +150,22 @@ class ExportCustomersToExcelController
|
||||
}
|
||||
}
|
||||
|
||||
public function walletTransactions(Request $request){
|
||||
public function walletTransactions(Request $request)
|
||||
{
|
||||
$exportsTransactions = new ExportsWalletTransactions($request);
|
||||
$exportFileName = 'wallet-transactions.xls';
|
||||
|
||||
$type = $request->get('type');
|
||||
$exportFileName = match ($type) {
|
||||
'payment' => 'wallet-payment-transactions.xls',
|
||||
'credit_note' => 'wallet-credit-note-transactions.xls',
|
||||
'debit_note' => 'wallet-debit-note-transactions.xls',
|
||||
default => 'wallet-topup-transactions.xls',
|
||||
};
|
||||
|
||||
$filesystemDriver = Storage::getDefaultDriver();
|
||||
if($filesystemDriver === 's3'){
|
||||
return response([ 'src' => AWSS3Helper::S3Exportable($exportFileName, $exportsTransactions) ]);
|
||||
}
|
||||
else{
|
||||
if ($filesystemDriver === 's3') {
|
||||
return response(['src' => AWSS3Helper::S3Exportable($exportFileName, $exportsTransactions)]);
|
||||
} else {
|
||||
$response = $exportsTransactions->download($exportFileName, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user