mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
add company name to pdf
This commit is contained in:
@ -13,6 +13,7 @@ use Crater\User;
|
||||
use Crater\Item;
|
||||
use Validator;
|
||||
use Crater\CompanySetting;
|
||||
use Crater\Company;
|
||||
use Crater\Mail\EstimatePdf;
|
||||
use Crater\TaxType;
|
||||
use Crater\Tax;
|
||||
@ -145,8 +146,11 @@ class EstimatesController extends Controller
|
||||
|
||||
if ($request->has('estimateSend')) {
|
||||
$data['estimate'] = $estimate->toArray();
|
||||
$company = Company::find($data['estimate']['company_id']);
|
||||
$userId = $data['estimate']['user_id'];
|
||||
$data['user'] = User::find($userId)->toArray();
|
||||
$data['logo'] = $company->getMedia('logo')->first();
|
||||
$data['company_name'] = $company->name;
|
||||
$email = $data['user']['email'];
|
||||
$notificationEmail = CompanySetting::getSetting(
|
||||
'notification_email',
|
||||
@ -306,10 +310,14 @@ class EstimatesController extends Controller
|
||||
public function sendEstimate(Request $request)
|
||||
{
|
||||
$estimate = Estimate::findOrFail($request->id);
|
||||
$company = Company::find($estimate->company_id);
|
||||
|
||||
$data['estimate'] = $estimate->toArray();
|
||||
$userId = $data['estimate']['user_id'];
|
||||
$data['user'] = User::find($userId)->toArray();
|
||||
$data['logo'] = $company->getMedia('logo')->first();
|
||||
$data['company_name'] = $company->name;
|
||||
|
||||
$email = $data['user']['email'];
|
||||
$notificationEmail = CompanySetting::getSetting(
|
||||
'notification_email',
|
||||
|
||||
@ -3,6 +3,7 @@ namespace Crater\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Crater\CompanySetting;
|
||||
use Crater\Company;
|
||||
use Illuminate\Support\Collection;
|
||||
use Crater\Currency;
|
||||
use Crater\InvoiceTemplate;
|
||||
@ -147,7 +148,10 @@ class InvoicesController extends Controller
|
||||
|
||||
if ($request->has('invoiceSend')) {
|
||||
$data['invoice'] = Invoice::findOrFail($invoice->id)->toArray();
|
||||
$company = Company::find($invoice->company_id);
|
||||
$data['user'] = User::find($request->user_id)->toArray();
|
||||
$data['logo'] = $company->getMedia('logo')->first();
|
||||
$data['company_name'] = $company->name;
|
||||
|
||||
$notificationEmail = CompanySetting::getSetting(
|
||||
'notification_email',
|
||||
@ -370,10 +374,13 @@ class InvoicesController extends Controller
|
||||
public function sendInvoice(Request $request)
|
||||
{
|
||||
$invoice = Invoice::findOrFail($request->id);
|
||||
$company = Company::find($invoice->company_id);
|
||||
|
||||
$data['invoice'] = $invoice->toArray();
|
||||
$userId = $data['invoice']['user_id'];
|
||||
$data['user'] = User::find($userId)->toArray();
|
||||
$data['logo'] = $company->getMedia('logo')->first();
|
||||
$data['company_name'] = $company->name;
|
||||
$email = $data['user']['email'];
|
||||
$notificationEmail = CompanySetting::getSetting(
|
||||
'notification_email',
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
@component('mail::message')
|
||||
Thanks for buying.
|
||||
|
||||
@if (! empty($logo))
|
||||
# {{ $company }}
|
||||
@else
|
||||
@component('mail::button', ['url' => url('/customer/invoices/pdf/'.$data['invoice']['unique_hash'])])
|
||||
Get your invoice
|
||||
@endcomponent
|
||||
|
||||
Thanks,<br>
|
||||
{{ config('app.name') }}
|
||||
{{-- Thanks,<br>
|
||||
{{ config('app.name') }} --}}
|
||||
@endcomponent
|
||||
|
||||
Reference in New Issue
Block a user