diff --git a/app/Jobs/Company/CompanyExport.php b/app/Jobs/Company/CompanyExport.php index 504c0dc599ac..239104c4102d 100644 --- a/app/Jobs/Company/CompanyExport.php +++ b/app/Jobs/Company/CompanyExport.php @@ -35,6 +35,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Storage; use ZipStream\Option\Archive; use ZipStream\ZipStream; +use Illuminate\Support\Facades\App; class CompanyExport implements ShouldQueue { @@ -478,7 +479,7 @@ class CompanyExport implements ShouldQueue private function zipAndSend() { - $file_name = date('Y-m-d').'_'.str_replace(' ', '_', $this->company->present()->name() . '_' . $this->company->company_key .'.zip'); + $file_name = date('Y-m-d').'_'.str_replace([" ", "/"],["_",""], $this->company->present()->name() . '_' . $this->company->company_key .'.zip'); $path = 'backups'; @@ -499,6 +500,10 @@ class CompanyExport implements ShouldQueue Storage::disk(config('filesystems.default'))->put('backups/'.$file_name, file_get_contents($zip_path)); } + App::forgetInstance('translator'); + $t = app('translator'); + $t->replace(Ninja::transformTranslations($this->company->settings)); + $nmo = new NinjaMailerObject; $nmo->mailable = new DownloadBackup(Storage::disk(config('filesystems.default'))->url('backups/'.$file_name), $this->company); $nmo->to_user = $this->user; diff --git a/app/Jobs/RecurringInvoice/SendRecurring.php b/app/Jobs/RecurringInvoice/SendRecurring.php index 6ee4bf3b3954..63ce5c2e030f 100644 --- a/app/Jobs/RecurringInvoice/SendRecurring.php +++ b/app/Jobs/RecurringInvoice/SendRecurring.php @@ -72,7 +72,8 @@ class SendRecurring implements ShouldQueue $invoice->date = now()->format('Y-m-d'); $invoice->due_date = $this->recurring_invoice->calculateDueDate(now()->format('Y-m-d')); - + $invoice->recurring_id = $this->recurring_invoice->id; + if($invoice->client->getSetting('auto_email_invoice')) { $invoice = $invoice->service() diff --git a/app/Services/Quote/CreateInvitations.php b/app/Services/Quote/CreateInvitations.php index c1092b10ea5d..b2e42395e088 100644 --- a/app/Services/Quote/CreateInvitations.php +++ b/app/Services/Quote/CreateInvitations.php @@ -60,7 +60,7 @@ class CreateInvitations private function createBlankContact() { - $new_contact = ClientContacstFactory::create($this->quote->company_id, $this->quote->user_id); + $new_contact = ClientContactFactory::create($this->quote->company_id, $this->quote->user_id); $new_contact->client_id = $this->quote->client_id; $new_contact->contact_key = Str::random(40); $new_contact->is_primary = true;