Pārlūkot izejas kodu

Backend : correctif download invoice

feature/export_comptable
Guillaume pirms 4 gadiem
vecāks
revīzija
bdafe03f47
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. +5
    -1
      ShopBundle/Controller/Backend/DocumentController.php

+ 5
- 1
ShopBundle/Controller/Backend/DocumentController.php Parādīt failu

@@ -10,6 +10,8 @@ use Lc\ShopBundle\Context\OrderUtilsInterface;
use Lc\ShopBundle\Services\Utils;
use Lc\ShopBundle\Services\UtilsManager;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
@@ -36,7 +38,9 @@ class DocumentController extends AdminController
}

if($document && $orderShop) {
$this->orderUtils->generateDocumentInvoiceOrderShop($orderShop, 'download') ;
return new StreamedResponse(function () use ($orderShop) {
$this->orderUtils->generateDocumentInvoiceOrderShop($orderShop, 'download') ;
});
}
else {
throw new NotFoundHttpException('Document introuvable') ;

Notiek ielāde…
Atcelt
Saglabāt