mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for emailing archived invoices
This commit is contained in:
parent
445a17cf94
commit
1163dba723
@ -114,7 +114,7 @@ class EmailController extends BaseController
|
||||
public function send(SendEmailRequest $request)
|
||||
{
|
||||
$entity = $request->input('entity');
|
||||
$entity_obj = $entity::find($request->input('entity_id'));
|
||||
$entity_obj = $entity::withTrashed()->with('invitations')->find($request->input('entity_id'));
|
||||
$subject = $request->has('subject') ? $request->input('subject') : '';
|
||||
$body = $request->has('body') ? $request->input('body') : '';
|
||||
$entity_string = strtolower(class_basename($entity_obj));
|
||||
|
@ -82,7 +82,7 @@ class SendEmailRequest extends Request
|
||||
$entity = $input['entity'];
|
||||
|
||||
/* Harvest the entity*/
|
||||
$entity_obj = $entity::whereId($input['entity_id'])->company()->first();
|
||||
$entity_obj = $entity::whereId($input['entity_id'])->withTrashed()->company()->first();
|
||||
|
||||
/* Check object, check user and company id is same as users, and check user can edit the object */
|
||||
if ($entity_obj && ($company->id == $entity_obj->company_id) && auth()->user()->can('edit', $entity_obj)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user