mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -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',
|
||||
|
||||
Reference in New Issue
Block a user