From 59ec838b889a8a9c23f55b7df2886c021f76e85d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 13 Feb 2018 09:15:14 +0200 Subject: [PATCH] Proposals --- app/Http/Controllers/ClientPortalController.php | 11 +++++++++++ app/Http/Controllers/ProposalController.php | 4 ++++ resources/views/proposals/edit.blade.php | 8 +++++--- resources/views/proposals/grapesjs.blade.php | 1 - routes/web.php | 1 + 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/ClientPortalController.php b/app/Http/Controllers/ClientPortalController.php index c5dd229a09..6b3896a84a 100644 --- a/app/Http/Controllers/ClientPortalController.php +++ b/app/Http/Controllers/ClientPortalController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Events\InvoiceInvitationWasViewed; use App\Events\QuoteInvitationWasViewed; +use App\Models\Account; use App\Models\Contact; use App\Models\Document; use App\Models\Gateway; @@ -835,6 +836,16 @@ class ClientPortalController extends BaseController }, 200); } + /* + public function getProposalDocument($accountKey, $publicId) + { + $account = Account::whereAccountKey($accountKey)->firstOrFail(); + $document = Document::whereAccountId($account->id)->wherePublicId($publicId)->firstOrFail(); + + return DocumentController::getDownloadResponse($document); + } + */ + public function getDocument($invitationKey, $publicId) { if (! $invitation = $this->invoiceRepo->findInvoiceByInvitation($invitationKey)) { diff --git a/app/Http/Controllers/ProposalController.php b/app/Http/Controllers/ProposalController.php index 5a8a931257..9b5fa1a841 100644 --- a/app/Http/Controllers/ProposalController.php +++ b/app/Http/Controllers/ProposalController.php @@ -168,7 +168,11 @@ class ProposalController extends BaseController $proposal = $request->entity(); $mpdf = new mPDF(); + $mpdf->showImageErrors = true; $mpdf->WriteHTML($proposal->present()->htmlDocument); + + //$mpdf->Output(); + $mpdf->Output($proposal->present()->filename, 'D'); } } diff --git a/resources/views/proposals/edit.blade.php b/resources/views/proposals/edit.blade.php index 6201711f4a..276222d348 100644 --- a/resources/views/proposals/edit.blade.php +++ b/resources/views/proposals/edit.blade.php @@ -239,9 +239,11 @@