mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Remove redundant classes
This commit is contained in:
parent
b174334263
commit
cd0bbbe096
@ -340,10 +340,6 @@ class CreateSingleAccount extends Command
|
||||
|
||||
$this->invoice_repo->markSent($invoice);
|
||||
|
||||
// if (rand(0, 1)) {
|
||||
// $invoice = $invoice->service()->markPaid()->save();
|
||||
// }
|
||||
//@todo this slow things down, but gives us PDFs of the invoices for inspection whilst debugging.
|
||||
event(new InvoiceWasCreated($invoice, $invoice->company, Ninja::eventVars()));
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,7 @@ class CreateTestData extends Command
|
||||
if (rand(0, 1)) {
|
||||
$invoice = $invoice->service()->markPaid()->save();
|
||||
}
|
||||
//@todo this slow things down, but gives us PDFs of the invoices for inspection whilst debugging.
|
||||
|
||||
event(new InvoiceWasCreated($invoice, $invoice->company, Ninja::eventVars()));
|
||||
}
|
||||
|
||||
|
@ -431,7 +431,7 @@ class DemoMode extends Command
|
||||
$payment->save();
|
||||
});
|
||||
}
|
||||
//@todo this slow things down, but gives us PDFs of the invoices for inspection whilst debugging.
|
||||
|
||||
event(new InvoiceWasCreated($invoice, $invoice->company, Ninja::eventVars()));
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ use App\Factory\ClientFactory;
|
||||
use App\Factory\CompanyUserFactory;
|
||||
use App\Factory\InvoiceFactory;
|
||||
use App\Factory\InvoiceInvitationFactory;
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Invoice\CreateEntityPdf;
|
||||
use App\Mail\TemplateEmail;
|
||||
use App\Models\Account;
|
||||
@ -155,7 +154,6 @@ class SendTestEmails extends Command
|
||||
$cc_emails = [config('ninja.testvars.test_email')];
|
||||
$bcc_emails = [config('ninja.testvars.test_email')];
|
||||
|
||||
$email_builder = (new InvoiceEmail())->build($ii, 'invoice');
|
||||
|
||||
$email_builder->setFooter($message['footer'])
|
||||
->setSubject($message['subject'])
|
||||
@ -165,6 +163,6 @@ class SendTestEmails extends Command
|
||||
->cc($cc_emails)
|
||||
->bcc($bcc_emails)
|
||||
//->replyTo(also_available_if_needed)
|
||||
->send(new TemplateEmail($email_builder, $user, $client));
|
||||
//->send(new TemplateEmail($email_builder, $user, $client));
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ class CreditFilters extends QueryFilters
|
||||
* Filter based on client status.
|
||||
*
|
||||
* Statuses we need to handle
|
||||
* //todo ?partials as a status?
|
||||
* - all
|
||||
* - paid
|
||||
* - unpaid
|
||||
|
@ -26,7 +26,6 @@ class InvoiceFilters extends QueryFilters
|
||||
* Filter based on client status.
|
||||
*
|
||||
* Statuses we need to handle
|
||||
* //todo ?partials as a status?
|
||||
* - all
|
||||
* - paid
|
||||
* - unpaid
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Http\Requests\Email\SendEmailRequest;
|
||||
use App\Jobs\Entity\EmailEntity;
|
||||
use App\Jobs\Invoice\EmailInvoice;
|
||||
|
@ -20,7 +20,6 @@ use App\Factory\CloneInvoiceFactory;
|
||||
use App\Factory\CloneInvoiceToQuoteFactory;
|
||||
use App\Factory\InvoiceFactory;
|
||||
use App\Filters\InvoiceFilters;
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Http\Requests\Invoice\ActionInvoiceRequest;
|
||||
use App\Http\Requests\Invoice\CreateInvoiceRequest;
|
||||
use App\Http\Requests\Invoice\DestroyInvoiceRequest;
|
||||
@ -723,8 +722,6 @@ class InvoiceController extends BaseController
|
||||
$invoice->service()->touchReminder($this->reminder_template)->save();
|
||||
|
||||
$invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($invoice) {
|
||||
$email_builder = (new InvoiceEmail())->build($invitation, $this->reminder_template);
|
||||
|
||||
EmailEntity::dispatch($invitation, $invoice->company, $this->reminder_template);
|
||||
|
||||
});
|
||||
|
@ -14,7 +14,6 @@ namespace App\Jobs\Entity;
|
||||
use App\DataMapper\Analytics\EmailInvoiceFailure;
|
||||
use App\Events\Invoice\InvoiceWasEmailed;
|
||||
use App\Events\Invoice\InvoiceWasEmailedAndFailed;
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Mail\BaseMailerJob;
|
||||
use App\Jobs\Utils\SystemLogger;
|
||||
use App\Libraries\MultiDB;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace App\Jobs\Ninja;
|
||||
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Invoice\EmailInvoice;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Account;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace App\Jobs\Ninja;
|
||||
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Invoice\EmailInvoice;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Account;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace App\Jobs\Ninja;
|
||||
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Invoice\EmailInvoice;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Account;
|
||||
|
@ -14,7 +14,6 @@ namespace App\Jobs\RecurringInvoice;
|
||||
use App\DataMapper\Analytics\SendRecurringFailure;
|
||||
use App\Events\Invoice\InvoiceWasEmailed;
|
||||
use App\Factory\RecurringInvoiceToInvoiceFactory;
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Entity\EmailEntity;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\RecurringInvoice;
|
||||
@ -74,8 +73,6 @@ class SendRecurring implements ShouldQueue
|
||||
|
||||
$invoice->invitations->each(function ($invitation) use ($invoice) {
|
||||
|
||||
$email_builder = (new InvoiceEmail())->build($invitation);
|
||||
|
||||
if($invitation->contact && strlen($invitation->contact->email) >=1){
|
||||
EmailEntity::dispatch($invitation, $invoice->company);
|
||||
info("Firing email for invoice {$invoice->number}");
|
||||
|
@ -69,11 +69,9 @@ class ReminderJob implements ShouldQueue
|
||||
$reminder_template = $invoice->calculateTemplate('invoice');
|
||||
$invoice->service()->touchReminder($this->reminder_template)->save();
|
||||
|
||||
$invoice->invitations->each(function ($invitation) use ($invoice) {
|
||||
$email_builder = (new InvoiceEmail())->build($invitation);
|
||||
|
||||
EmailInvoice::dispatch($email_builder, $invitation, $invoice->company);
|
||||
$invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) {
|
||||
|
||||
EmailEntity::dispatch($invitation, $invitation->company, $reminder_template);
|
||||
info("Firing email for invoice {$invoice->number}");
|
||||
});
|
||||
|
||||
|
@ -13,7 +13,6 @@ namespace App\Jobs\Util;
|
||||
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Entity\EmailEntity;
|
||||
use App\Jobs\Invoice\EmailInvoice;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\SystemLog;
|
||||
use Illuminate\Bus\Queueable;
|
||||
@ -66,7 +65,6 @@ class SendFailedEmails implements ShouldQueue
|
||||
$invitation = $job_meta_array['entity_name']::where('key', $job_meta_array['invitation_key'])->with('contact')->first();
|
||||
|
||||
if ($invitation->invoice) {
|
||||
$email_builder = (new InvoiceEmail())->build($invitation, $job_meta_array['reminder_template']);
|
||||
|
||||
if ($invitation->contact->send_email && $invitation->contact->email) {
|
||||
EmailEntity::dispatch($invitation, $invitation->company, $job_meta_array['reminder_template']);
|
||||
|
@ -47,11 +47,9 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
||||
elseif(strlen($this->client->getSetting('email_template_'.$this->reminder_template)) > 0)
|
||||
$body_template = $this->client->getSetting('email_template_'.$this->reminder_template);
|
||||
else{
|
||||
//$body_template = $this->client->getSetting('email_template_'.$this->reminder_template);
|
||||
$body_template = EmailTemplateDefaults::getDefaultTemplate('email_template_'.$this->reminder_template, $this->client->locale());
|
||||
}
|
||||
|
||||
|
||||
/* Use default translations if a custom message has not been set*/
|
||||
if (iconv_strlen($body_template) == 0) {
|
||||
$body_template = trans(
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace App\Services\Invoice;
|
||||
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Entity\EmailEntity;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Invoice;
|
||||
@ -46,8 +45,6 @@ class SendEmail extends AbstractService
|
||||
}
|
||||
|
||||
$this->invoice->invitations->each(function ($invitation) {
|
||||
$email_builder = (new InvoiceEmail())->build($invitation, $this->reminder_template);
|
||||
|
||||
if ($invitation->contact->send_email && $invitation->contact->email) {
|
||||
EmailEntity::dispatchNow($invitation, $invitation->company, $this->reminder_template);
|
||||
|
||||
|
@ -14,7 +14,6 @@ namespace App\Services\Invoice;
|
||||
use App\Events\Invoice\InvoiceWasEmailed;
|
||||
use App\Events\Payment\PaymentWasCreated;
|
||||
use App\Factory\PaymentFactory;
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Invoice\EmailEntity;
|
||||
use App\Models\Client;
|
||||
use App\Models\Invoice;
|
||||
|
@ -10,7 +10,6 @@
|
||||
*/
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Entity\EmailEntity;
|
||||
use App\Mail\TemplateEmail;
|
||||
use App\Models\ClientContact;
|
||||
|
Loading…
Reference in New Issue
Block a user