Skip to content

Commit

Permalink
Debug feature draft
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Fedurtsya <anton@fedurtsya.com>
  • Loading branch information
Sieg committed Feb 16, 2025
1 parent 41cea7c commit d21b199
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Transition/Controller/Admin/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace FreshAdvance\Invoice\Transition\Controller\Admin;

use FreshAdvance\Invoice\Document\InvoiceGeneratorInterface;
use FreshAdvance\Invoice\Document\Service\DocumentRendererInterface;
use FreshAdvance\Invoice\Service\Invoice;
use FreshAdvance\Invoice\Service\InvoiceServiceInterface;
use FreshAdvance\Invoice\Settings\ModuleSettingsInterface;
Expand Down Expand Up @@ -69,4 +70,15 @@ public function downloadOrderInvoice(): void
$invoiceData->getInvoicePath()
);
}

public function debug(): void
{
$request = $this->getServiceFromContainer(RequestInterface::class);
$invoiceDataService = $this->getServiceFromContainer(Invoice::class);
$invoiceData = $invoiceDataService->getInvoiceDataByOrderId($request->getInvoiceIdFromRequest());

$documentRendering = $this->getServiceFromContainer(DocumentRendererInterface::class);

die($documentRendering->render($invoiceData));
}
}
1 change: 1 addition & 0 deletions views/twig/admin/invoice.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

<div style="margin-top: 20px;">
<input type="submit" name="downloadDocument" value="{{ translate({ ident: "FA_INVOICE_FORM_DOWNLOAD" }) }}">
<a style="display:none;" target="_blank" href="{{ oViewConf.getSelfLink()|raw }}&cl=fa_invoice_admin&fnc=debug&oxid={{ oxid }}">Debug</a>
</div>
</form>
</div>
Expand Down

0 comments on commit d21b199

Please sign in to comment.