Merge branch 'dillon/34.1-jenkins-vapor' into vapor/development

This commit is contained in:
Dillon Ngo
2024-04-26 16:32:14 +08:00
@@ -70,14 +70,15 @@ class BulkDownloadCustomerInvoicesLogic
if ($zip->open($zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE)) {
foreach ($invoicebookings as $booking) {
$invoice_file = $booking->documents()->where('document_type', DocumentType::INVOICE)->whereNull('deleted_at')->first()->files()->first();
$zip->addFile(Storage::disk('s3')->get('documents/'.$invoice_file->file->file_info->original->file), 'invoice-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
$fileContent = Storage::disk('s3')->get('documents/'.$invoice_file->file->file_info->original->file);
$zip->addFromString('invoice-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf', $fileContent);
}
$zip->close();
$filePath = 'bulk_invoice/'.$zipFileName;
Storage::put($filePath, file_get_contents($zip_file), 's3');
return response(['src' => Storage::disk('s3')->get($$filePath) ]);
return response(['src' => Storage::disk('s3')->get($filePath) ]);
} else {
return response()->json([