Skip to content

Instantly share code, notes, and snippets.

@ruthgeridema ruthgeridema/GuestPrintInvoice.patch Secret
Last active Apr 17, 2019

Embed
What would you like to do?
GuestPrintInvoice.php patch | https://www.guapa.nl
Index: vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintInvoice.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintInvoice.php (date 1555328748000)
+++ vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintInvoice.php (date 1555328748000)
@@ -34,8 +34,11 @@
if ($invoiceId) {
$invoice = $this->invoiceRepository->get($invoiceId);
+ $invoiceOrder = $invoice->getOrder();
- if ($invoice) {
+ if ($invoice &&
+ $this->orderViewAuthorization->canView($invoiceOrder)
+ ) {
$document = $this->invoiceDocumentFactory->create(
['data' => ['invoice' => $invoice]]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.