1
0
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:
= 2020-11-08 21:53:47 +11:00
parent b174334263
commit cd0bbbe096
19 changed files with 5 additions and 35 deletions

View File

@ -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()));
}

View File

@ -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()));
}

View File

@ -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()));
}

View File

@ -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));
}
}

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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);
});

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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}");

View File

@ -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}");
});

View File

@ -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']);

View File

@ -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(

View File

@ -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);

View File

@ -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;

View File

@ -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;