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) {
$download_file = file_get_contents($credit->pdf_file_path($invitation, 'url', true));
$zipFile->addFromString(basename($credit->pdf_file_path($invitation)), $download_file);
$file = $credit->service()->getCreditPdf($credit->invitations()->first());
$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) {
$download_file = file_get_contents($invoice->pdf_file_path($invitation, 'url', true));
$zipFile->addFromString(basename($invoice->pdf_file_path($invitation)), $download_file);
$file = $invoice->service()->getInvoicePdf();
$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) {
$download_file = file_get_contents($quote->pdf_file_path($invitation, 'url', true));
$zipFile->addFromString(basename($quote->pdf_file_path($invitation)), $download_file);
$file = $quote->service()->getQuotePdf();
$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);
}