mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-28 04:01:10 -04:00 
			
		
		
		
	fix(attachments): Fixed language on pdf attachments (#434)
This commit is contained in:
		| @ -2,6 +2,7 @@ | ||||
|  | ||||
| namespace Crater\Models; | ||||
|  | ||||
| use App; | ||||
| use Crater\Models\EstimateTemplate; | ||||
| use Crater\Models\Company; | ||||
| use Crater\Models\Tax; | ||||
| @ -431,6 +432,10 @@ class Estimate extends Model implements HasMedia | ||||
|         $estimateTemplate = EstimateTemplate::find($this->estimate_template_id); | ||||
|  | ||||
|         $company = Company::find($this->company_id); | ||||
|         $locale = CompanySetting::getSetting('language',  $company->id); | ||||
|  | ||||
|         App::setLocale($locale); | ||||
|  | ||||
|         $logo = $company->logo_path; | ||||
|  | ||||
|         view()->share([ | ||||
|  | ||||
| @ -2,6 +2,7 @@ | ||||
|  | ||||
| namespace Crater\Models; | ||||
|  | ||||
| use App; | ||||
| use Crater\Models\Company; | ||||
| use Crater\Models\CompanySetting; | ||||
| use Crater\Models\Currency; | ||||
| @ -513,6 +514,9 @@ class Invoice extends Model implements HasMedia | ||||
|         $invoiceTemplate = InvoiceTemplate::find($this->invoice_template_id); | ||||
|  | ||||
|         $company = Company::find($this->company_id); | ||||
|         $locale = CompanySetting::getSetting('language',  $company->id); | ||||
|  | ||||
|         App::setLocale($locale); | ||||
|  | ||||
|         $logo = $company->logo_path; | ||||
|  | ||||
|  | ||||
| @ -2,6 +2,7 @@ | ||||
|  | ||||
| namespace Crater\Models; | ||||
|  | ||||
| use App; | ||||
| use Crater\Models\CompanySetting; | ||||
| use Crater\Models\User; | ||||
| use Crater\Models\Invoice; | ||||
| @ -378,6 +379,9 @@ class Payment extends Model implements HasMedia | ||||
|     public function getPDFData() | ||||
|     { | ||||
|         $company = Company::find($this->company_id); | ||||
|         $locale = CompanySetting::getSetting('language',  $company->id); | ||||
|  | ||||
|         App::setLocale($locale); | ||||
|  | ||||
|         $logo = $company->logo_path; | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user