diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index 6d0a8f98806e..fca7262c0ad0 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -31,6 +31,7 @@ use App\Services\PdfMaker\Design as PdfDesignModel; use App\Services\PdfMaker\Design as PdfMakerDesign; use App\Services\PdfMaker\PdfMaker as PdfMakerService; use App\Utils\HtmlEngine; +use App\Utils\Ninja; use App\Utils\PhantomJS\Phantom; use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesInvoiceHtml; @@ -42,6 +43,7 @@ use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\App; +use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Storage; use Spatie\Browsershot\Browsershot; @@ -102,6 +104,7 @@ class CreateEntityPdf implements ShouldQueue } App::setLocale($this->contact->preferredLocale()); + App::forgetInstance('translator'); $entity_design_id = ''; @@ -118,6 +121,8 @@ class CreateEntityPdf implements ShouldQueue $entity_design_id = 'credit_design_id'; } + Lang::replace(Ninja::transformTranslations($this->entity->client->getMergedSettings())); + $file_path = $path.$this->entity->number.'.pdf'; $entity_design_id = $this->entity->design_id ? $this->entity->design_id : $this->decodePrimaryKey($this->entity->client->getSetting($entity_design_id));