1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Set company as a reference for Company Export

This commit is contained in:
David Bomba 2021-09-18 17:55:34 +10:00
parent 85f2b6a5df
commit 617703b405
2 changed files with 5 additions and 3 deletions

View File

@ -506,10 +506,12 @@ class CompanyExport implements ShouldQueue
$t = app('translator');
$t->replace(Ninja::transformTranslations($this->company->settings));
$company_reference = Company::find($this->company->id);;
$nmo = new NinjaMailerObject;
$nmo->mailable = new DownloadBackup($storage_file_path, $this->company);
$nmo->mailable = new DownloadBackup($storage_file_path, $company_reference);
$nmo->to_user = $this->user;
$nmo->company = $this->company;
$nmo->company = $company_reference;
$nmo->settings = $this->company->settings;
NinjaMailerJob::dispatch($nmo);

View File

@ -67,7 +67,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::resource('designs', 'DesignController'); // name = (payments. index / create / show / update / destroy / edit
Route::post('designs/bulk', 'DesignController@bulk')->name('designs.bulk');
Route::post('designs/default', 'DesignController@default')->name('designs.default');
Route::post('designs/set/default', 'DesignController@default')->name('designs.default');
Route::resource('documents', 'DocumentController'); // name = (documents. index / create / show / update / destroy / edit
Route::get('documents/{document}/download', 'DocumentController@download')->name('documents.download');