From 18f3b6522f97519134e2f42a0d94e33d91343f94 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 16 Aug 2023 22:05:35 +1000 Subject: [PATCH] Fixes for adding back xml e invoices when zipping in bulk --- app/Jobs/Invoice/ZipInvoices.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Invoice/ZipInvoices.php b/app/Jobs/Invoice/ZipInvoices.php index 25722b6f6fb2..dc5b39cf56f5 100644 --- a/app/Jobs/Invoice/ZipInvoices.php +++ b/app/Jobs/Invoice/ZipInvoices.php @@ -75,9 +75,16 @@ class ZipInvoices implements ShouldQueue try { + foreach ($this->invoices as $invoice) { + + if ($invoice->client->getSetting('enable_e_invoice')) { + $xml = $invoice->service()->getEInvoice(); + $zipFile->addFromString($invoice->getFileName("xml"), $xml); + } + $file = $invoice->service()->getRawInvoicePdf(); - $zip_file_name = $invoice->getFileName(); +$zip_file_name = $invoice->getFileName(); $zipFile->addFromString($zip_file_name, $file); }