Skip to content

Commit f868be6

Browse files
committed
Fixed invoice in client portal
1 parent d3da233 commit f868be6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Http/Controllers/Portal/InvoiceController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ public function process(Invoice $invoice, Request $request)
7979

8080
switch ($request->action) {
8181
case "download":
82+
if ($invoice->person) {
83+
$email = $invoice->person->getPrimaryEmail();
84+
$phone = $invoice->person->getPrimaryPhone();
85+
$address = $invoice->person->getPrimaryAddress();
86+
}
87+
88+
if ($invoice->organisation) {
89+
$organisation_address = $invoice->organisation->getPrimaryAddress();
90+
}
91+
8292
return Pdf::setOption([
8393
'fontDir' => public_path('vendor/laravel-crm/fonts'),
8494
])

src/Http/Controllers/Portal/QuoteController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ public function process(Quote $quote, Request $request)
9696
break;
9797

9898
case "download":
99+
if ($quote->person) {
100+
$email = $quote->person->getPrimaryEmail();
101+
$phone = $quote->person->getPrimaryPhone();
102+
$address = $quote->person->getPrimaryAddress();
103+
}
104+
105+
if ($quote->organisation) {
106+
$organisation_address = $quote->organisation->getPrimaryAddress();
107+
}
108+
99109
return Pdf::setOption([
100110
'fontDir' => public_path('vendor/laravel-crm/fonts'),
101111
])

0 commit comments

Comments
 (0)