mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 07:14:37 -04:00
Purchase Order Emails
This commit is contained in:
parent
ae6ae410d3
commit
80ea41568c
@ -17,6 +17,7 @@ use App\Http\Middleware\UserVerified;
|
|||||||
use App\Http\Requests\Email\SendEmailRequest;
|
use App\Http\Requests\Email\SendEmailRequest;
|
||||||
use App\Jobs\Entity\EmailEntity;
|
use App\Jobs\Entity\EmailEntity;
|
||||||
use App\Jobs\Mail\EntitySentMailer;
|
use App\Jobs\Mail\EntitySentMailer;
|
||||||
|
use App\Jobs\PurchaseOrder\PurchaseOrderEmail;
|
||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Quote;
|
use App\Models\Quote;
|
||||||
@ -125,6 +126,11 @@ class EmailController extends BaseController
|
|||||||
'body' => $body
|
'body' => $body
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if($entity == 'purchaseOrder' || $template == 'purchase_order'){
|
||||||
|
PurchaseOrderEmail::dispatch($entity, $entity->company, $data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$entity_obj->invitations->each(function ($invitation) use ($data, $entity_string, $entity_obj, $template) {
|
$entity_obj->invitations->each(function ($invitation) use ($data, $entity_string, $entity_obj, $template) {
|
||||||
|
|
||||||
if (!$invitation->contact->trashed() && $invitation->contact->email) {
|
if (!$invitation->contact->trashed() && $invitation->contact->email) {
|
||||||
|
@ -13,6 +13,7 @@ namespace App\Http\Requests\Email;
|
|||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class SendEmailRequest extends Request
|
class SendEmailRequest extends Request
|
||||||
{
|
{
|
||||||
@ -60,7 +61,7 @@ class SendEmailRequest extends Request
|
|||||||
$input['entity_id'] = $this->decodePrimaryKey($input['entity_id']);
|
$input['entity_id'] = $this->decodePrimaryKey($input['entity_id']);
|
||||||
|
|
||||||
if(array_key_exists('entity', $input))
|
if(array_key_exists('entity', $input))
|
||||||
$input['entity'] = "App\Models\\".ucfirst($input['entity']);
|
$input['entity'] = "App\Models\\".ucfirst(Str::camel($input['entity']));
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class PurchaseOrderService
|
|||||||
|
|
||||||
public function applyNumber()
|
public function applyNumber()
|
||||||
{
|
{
|
||||||
$this->invoice = (new ApplyNumber($this->purchase_order->vendor, $this->purchase_order))->run();
|
$this->purchase_order = (new ApplyNumber($this->purchase_order->vendor, $this->purchase_order))->run();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user