mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6337 from turbo124/v5-develop
Invoice Activity notifications
This commit is contained in:
commit
65b7420d26
@ -164,17 +164,7 @@ class PreviewController extends BaseController
|
|||||||
DB::connection(config('database.default'))->beginTransaction();
|
DB::connection(config('database.default'))->beginTransaction();
|
||||||
|
|
||||||
$entity = ucfirst(request()->input('entity'));
|
$entity = ucfirst(request()->input('entity'));
|
||||||
|
|
||||||
// $class = "App\Models\\$entity";
|
|
||||||
|
|
||||||
// $entity_obj = $class::whereId($this->decodePrimaryKey(request()->input('entity_id')))->company()->first();
|
|
||||||
|
|
||||||
// if (! $entity_obj) {
|
|
||||||
|
|
||||||
$entity_obj = $repo->save(request()->all(), $factory);
|
$entity_obj = $repo->save(request()->all(), $factory);
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
$entity_obj->load('client');
|
$entity_obj->load('client');
|
||||||
|
|
||||||
App::forgetInstance('translator');
|
App::forgetInstance('translator');
|
||||||
@ -238,10 +228,8 @@ class PreviewController extends BaseController
|
|||||||
return (new NinjaPdf())->build($maker->getCompiledHTML(true));
|
return (new NinjaPdf())->build($maker->getCompiledHTML(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
//else
|
|
||||||
$file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
|
$file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
|
||||||
|
|
||||||
//return response()->download($file_path, basename($file_path), ['Cache-Control:' => 'no-cache'])->deleteFileAfterSend(true);
|
|
||||||
|
|
||||||
$response = Response::make($file_path, 200);
|
$response = Response::make($file_path, 200);
|
||||||
$response->header('Content-Type', 'application/pdf');
|
$response->header('Content-Type', 'application/pdf');
|
||||||
|
@ -477,19 +477,19 @@ class Invoice extends BaseModel
|
|||||||
{
|
{
|
||||||
switch ($reminder_template) {
|
switch ($reminder_template) {
|
||||||
case 'invoice':
|
case 'invoice':
|
||||||
event(new InvoiceWasEmailed($invitation, $invitation->company, Ninja::eventVars(), $template));
|
event(new InvoiceWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $template));
|
||||||
break;
|
break;
|
||||||
case 'reminder1':
|
case 'reminder1':
|
||||||
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(), Activity::INVOICE_REMINDER1_SENT));
|
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), Activity::INVOICE_REMINDER1_SENT));
|
||||||
break;
|
break;
|
||||||
case 'reminder2':
|
case 'reminder2':
|
||||||
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(), Activity::INVOICE_REMINDER2_SENT));
|
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), Activity::INVOICE_REMINDER2_SENT));
|
||||||
break;
|
break;
|
||||||
case 'reminder3':
|
case 'reminder3':
|
||||||
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(), Activity::INVOICE_REMINDER3_SENT));
|
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), Activity::INVOICE_REMINDER3_SENT));
|
||||||
break;
|
break;
|
||||||
case 'reminder_endless':
|
case 'reminder_endless':
|
||||||
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(), Activity::INVOICE_REMINDER_ENDLESS_SENT));
|
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), Activity::INVOICE_REMINDER_ENDLESS_SENT));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
# code...
|
# code...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user