Fix for retrieving quote PDF

This commit is contained in:
David Bomba 2021-01-13 19:58:01 +11:00
parent c18c9e5a66
commit a6121295c2
3 changed files with 7 additions and 4 deletions

View File

@ -47,10 +47,15 @@ class InvitationController extends Controller
$entity_obj = 'App\Models\\'.ucfirst(Str::camel($entity)).'Invitation';
nlog($entity);
nlog($entity_obj);
$invitation = $entity_obj::whereRaw('BINARY `key`= ?', [$invitation_key])
->with('contact.client')
->firstOrFail();
nlog($invitation->getLink());
/* Return early if we have the correct client_hash embedded */
if (request()->has('client_hash') && request()->input('client_hash') == $invitation->contact->client->client_hash) {

View File

@ -34,7 +34,7 @@ class GetQuotePdf extends AbstractService
$invitation = $this->quote->invitations->where('client_contact_id', $this->contact->id)->first();
$path = $this->quote->client->invoice_filepath();
$path = $this->quote->client->quote_filepath();
$file_path = $path.$this->quote->number.'.pdf';

View File

@ -96,9 +96,7 @@ class QuoteService
public function markSent() :self
{
$mark_sent = new MarkSent($this->quote->client, $this->quote);
$this->quote = $mark_sent->run();
$this->quote = (new MarkSent($this->quote->client, $this->quote))->run();
return $this;
}