1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Add E-Document to ZIP-Download

This commit is contained in:
Lars Kusch 2024-03-10 15:27:37 +01:00
parent 8c06698980
commit da273d4ed5
2 changed files with 9 additions and 0 deletions

View File

@ -67,6 +67,11 @@ class ZipPurchaseOrders implements ShouldQueue
try { try {
foreach ($invitations as $invitation) { foreach ($invitations as $invitation) {
if ($invitation->purchase_order->client->getSetting('enable_e_invoice')) {
$xml = $invitation->purchase_order->service()->getEInvoice();
$zipFile->addFromString($invitation->purchase_order->getFileName("xml"), $xml);
}
$file = (new CreateRawPdf($invitation))->handle(); $file = (new CreateRawPdf($invitation))->handle();
$zipFile->addFromString($invitation->purchase_order->numberFormatter().".pdf", $file); $zipFile->addFromString($invitation->purchase_order->numberFormatter().".pdf", $file);

View File

@ -63,6 +63,10 @@ class ZipQuotes implements ShouldQueue
try { try {
foreach ($invitations as $invitation) { foreach ($invitations as $invitation) {
if ($invitation->quote->client->getSetting('enable_e_invoice')) {
$xml = $invitation->quote->service()->getEInvoice();
$zipFile->addFromString($invitation->quote->getFileName("xml"), $xml);
}
$file = (new \App\Jobs\Entity\CreateRawPdf($invitation))->handle(); $file = (new \App\Jobs\Entity\CreateRawPdf($invitation))->handle();
$zipFile->addFromString($invitation->quote->numberFormatter() . '.pdf', $file); $zipFile->addFromString($invitation->quote->numberFormatter() . '.pdf', $file);
} }