1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Fixes for bulk download entities

This commit is contained in:
David Bomba 2022-03-06 20:41:43 +11:00
parent 5d91773651
commit a3dae762d0
3 changed files with 15 additions and 6 deletions

View File

@ -91,8 +91,9 @@ class ZipCredits implements ShouldQueue
foreach ($this->credits as $credit) { foreach ($this->credits as $credit) {
$download_file = file_get_contents($credit->pdf_file_path($invitation, 'url', true)); $file = $credit->service()->getCreditPdf($credit->invitations()->first());
$zipFile->addFromString(basename($credit->pdf_file_path($invitation)), $download_file); $zip_file_name = basename($file);
$zipFile->addFromString($zip_file_name, Storage::get($file));
} }

View File

@ -91,8 +91,12 @@ class ZipInvoices implements ShouldQueue
foreach ($this->invoices as $invoice) { foreach ($this->invoices as $invoice) {
$download_file = file_get_contents($invoice->pdf_file_path($invitation, 'url', true)); $file = $invoice->service()->getInvoicePdf();
$zipFile->addFromString(basename($invoice->pdf_file_path($invitation)), $download_file); $zip_file_name = basename($file);
$zipFile->addFromString($zip_file_name, Storage::get($file));
//$download_file = file_get_contents($invoice->pdf_file_path($invitation, 'url', true));
//$zipFile->addFromString(basename($invoice->pdf_file_path($invitation)), $download_file);
} }

View File

@ -92,8 +92,12 @@ class ZipQuotes implements ShouldQueue
foreach ($this->quotes as $quote) { foreach ($this->quotes as $quote) {
$download_file = file_get_contents($quote->pdf_file_path($invitation, 'url', true)); $file = $quote->service()->getQuotePdf();
$zipFile->addFromString(basename($quote->pdf_file_path($invitation)), $download_file); $zip_file_name = basename($file);
$zipFile->addFromString($zip_file_name, Storage::get($file));
// $download_file = file_get_contents($quote->pdf_file_path($invitation, 'url', true));
// $zipFile->addFromString(basename($quote->pdf_file_path($invitation)), $download_file);
} }