This commit is contained in:
David Bomba 2023-02-18 08:36:51 +11:00
parent 7d07cfb2f7
commit e28b75e83f
22 changed files with 49 additions and 91 deletions

View File

@ -48,5 +48,4 @@ class InvoiceWasPaid
$this->company = $company;
$this->event_vars = $event_vars;
}
}

View File

@ -468,7 +468,6 @@ class BankTransactionController extends BaseController
$bank_transactions = BankTransaction::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()->get();
if ($action == 'convert_matched') { //catch this action
$this->bank_transaction_repo->convert_matched($bank_transactions);
} else {
$bank_transactions->each(function ($bank_transaction, $key) use ($action) {

View File

@ -13,7 +13,6 @@ namespace App\Jobs\Entity;
use App\Exceptions\FilePermissionsFailure;
use App\Libraries\MultiDB;
use App\Models\Account;
use App\Models\Credit;
use App\Models\CreditInvitation;
use App\Models\Design;

View File

@ -28,7 +28,8 @@ class ClientLedgerBalanceUpdate implements ShouldQueue
public $tries = 1;
public $deleteWhenMissingModels = true;
public function __construct(public Company $company, public Client $client)
{}
{
}
/**
* Execute the job.
@ -68,5 +69,4 @@ class ClientLedgerBalanceUpdate implements ShouldQueue
{
return [(new WithoutOverlapping($this->client->id))->dontRelease()];
}
}

View File

@ -227,7 +227,6 @@ class WebhookSingle implements ShouldQueue
private function resolveClient()
{
//make sure it isn't an instance of the Client Model
if (!$this->entity instanceof \App\Models\Client &&
!$this->entity instanceof \App\Models\Vendor &&
@ -238,7 +237,6 @@ class WebhookSingle implements ShouldQueue
}
return null;
}
public function failed($exception = null)

View File

@ -67,7 +67,6 @@ class CreditCreatedNotification implements ShouldQueue
$nmo->to_user = $user;
(new NinjaMailerJob($nmo))->handle();
}
/* Override the methods in the Notification Class */

View File

@ -63,9 +63,7 @@ class CreditEmailedNotification implements ShouldQueue
$nmo->to_user = $user;
(new NinjaMailerJob($nmo))->handle();
}
}
}
}
}

View File

@ -56,6 +56,5 @@ class InvoicePaidActivity implements ShouldQueue
if ($event->invoice->subscription()->exists()) {
$event->invoice->subscription->service()->planPaid($event->invoice);
}
}
}

View File

@ -16,7 +16,6 @@ use App\Jobs\Mail\NinjaMailerJob;
use App\Jobs\Mail\NinjaMailerObject;
use App\Libraries\MultiDB;
use App\Mail\Admin\EntitySentObject;
use App\Notifications\Admin\EntitySentNotification;
use App\Utils\Traits\Notifications\UserNotifies;
use Illuminate\Contracts\Queue\ShouldQueue;
@ -62,9 +61,7 @@ class QuoteEmailedNotification implements ShouldQueue
$nmo->to_user = $user;
(new NinjaMailerJob($nmo))->handle();
}
}
}
}
}

View File

@ -58,6 +58,5 @@ class AppStoreRenewSubscription implements ShouldQueue
}
$account->save();
}
}

View File

@ -11,12 +11,12 @@
namespace App\Listeners\Subscription;
use Carbon\Carbon;
use App\Libraries\MultiDB;
use App\Models\Account;
use App\Models\Company;
use App\Libraries\MultiDB;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Notifications\Ninja\RenewalFailureNotification;
use Carbon\Carbon;
use Illuminate\Contracts\Queue\ShouldQueue;
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRenewed;
class PlayStoreRenewSubscription implements ShouldQueue
@ -44,6 +44,4 @@ class PlayStoreRenewSubscription implements ShouldQueue
return;
}
}
}

View File

@ -12,11 +12,11 @@
namespace App\Mail\Admin;
use App\Mail\Engine\PaymentEmailEngine;
use App\Models\Payment;
use App\Utils\Ninja;
use App\Utils\Number;
use Illuminate\Support\Facades\App;
use stdClass;
use App\Models\Payment;
class EntityPaidObject
{

View File

@ -388,7 +388,6 @@ class PaymentEmailEngine extends BaseEmailEngine
*/
private function buildViewButton(string $link, string $text): string
{
return '
<!--[if (gte mso 9)|(IE)]>
<table align="center" cellspacing="0" cellpadding="0" style="width: 600px;">

View File

@ -12,7 +12,6 @@
namespace App\Models;
use App\Jobs\Entity\CreateEntityPdf;
use App\Utils\Ninja;
use App\Utils\Traits\Inviteable;
use App\Utils\Traits\MakesDates;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View File

@ -11,9 +11,7 @@
namespace App\Models;
use App\Events\Quote\QuoteWasUpdated;
use App\Jobs\Entity\CreateEntityPdf;
use App\Utils\Ninja;
use App\Utils\Traits\Inviteable;
use App\Utils\Traits\MakesDates;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View File

@ -13,7 +13,6 @@ namespace App\Models;
use App\Services\Scheduler\SchedulerService;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Carbon;
/**
* @property bool paused
@ -88,5 +87,4 @@ class Scheduler extends BaseModel
return $this->remaining_cycles - 1;
}
}
}

View File

@ -11,39 +11,34 @@
namespace App\PaymentDrivers;
use Exception;
use App\Utils\Ninja;
use App\Events\Invoice\InvoiceWasPaid;
use App\Events\Payment\PaymentWasCreated;
use App\Exceptions\PaymentFailed;
use App\Factory\PaymentFactory;
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
use App\Jobs\Mail\NinjaMailer;
use App\Jobs\Mail\NinjaMailerJob;
use App\Jobs\Mail\NinjaMailerObject;
use App\Jobs\Mail\PaymentFailedMailer;
use App\Jobs\Util\SystemLogger;
use App\Mail\Admin\ClientPaymentFailureObject;
use App\Models\Client;
use App\Utils\Helpers;
use App\Models\ClientContact;
use App\Models\ClientGatewayToken;
use App\Models\CompanyGateway;
use App\Models\GatewayType;
use App\Models\Invoice;
use App\Models\Payment;
use App\Models\SystemLog;
use App\Models\GatewayType;
use App\Models\PaymentHash;
use App\Models\PaymentType;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use App\Models\ClientContact;
use App\Jobs\Mail\NinjaMailer;
use App\Models\CompanyGateway;
use Illuminate\Support\Carbon;
use App\Factory\PaymentFactory;
use App\Jobs\Util\SystemLogger;
use App\Utils\Traits\MakesHash;
use App\Models\TransactionEvent;
use App\Exceptions\PaymentFailed;
use App\Jobs\Mail\NinjaMailerJob;
use App\Jobs\Ninja\TransactionLog;
use App\Models\ClientGatewayToken;
use App\Jobs\Mail\NinjaMailerObject;
use App\Utils\Traits\SystemLogTrait;
use App\Events\Invoice\InvoiceWasPaid;
use App\Jobs\Mail\PaymentFailedMailer;
use App\Events\Payment\PaymentWasCreated;
use App\Mail\Admin\ClientPaymentFailureObject;
use App\Models\SystemLog;
use App\Services\Subscription\SubscriptionService;
use Checkout\Library\Exceptions\CheckoutHttpException;
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
use App\Utils\Helpers;
use App\Utils\Ninja;
use App\Utils\Traits\MakesHash;
use App\Utils\Traits\SystemLogTrait;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
/**
* Class BaseDriver.
@ -154,33 +149,24 @@ class BaseDriver extends AbstractPaymentDriver
}
if ($this->company_gateway->require_custom_value1) {
$fields[] = ['name' => 'client_custom_value1', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client1'), 'type' => 'text', 'validation' => 'required'];
}
if ($this->company_gateway->require_custom_value2) {
$fields[] = ['name' => 'client_custom_value2', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client2'), 'type' => 'text', 'validation' => 'required'];
}
if ($this->company_gateway->require_custom_value3) {
$fields[] = ['name' => 'client_custom_value3', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client3'), 'type' => 'text', 'validation' => 'required'];
}
if ($this->company_gateway->require_custom_value4) {
$fields[] = ['name' => 'client_custom_value4', 'label' => $this->helpers->makeCustomField($this->client->company->custom_fields, 'client4'), 'type' => 'text', 'validation' => 'required'];
}
return $fields;
}
/**
@ -373,11 +359,11 @@ class BaseDriver extends AbstractPaymentDriver
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
if (property_exists($this->payment_hash->data, 'billing_context') && $status == Payment::STATUS_COMPLETED) {
if(is_int($this->payment_hash->data->billing_context->subscription_id))
if (is_int($this->payment_hash->data->billing_context->subscription_id)) {
$billing_subscription = \App\Models\Subscription::find($this->payment_hash->data->billing_context->subscription_id);
else
} else {
$billing_subscription = \App\Models\Subscription::find($this->decodePrimaryKey($this->payment_hash->data->billing_context->subscription_id));
}
// To access campaign hash => $this->payment_hash->data->billing_context->campaign;
// To access campaign data => Cache::get(CAMPAIGN_HASH)
@ -398,7 +384,6 @@ class BaseDriver extends AbstractPaymentDriver
*/
public function confirmGatewayFee() :void
{
/*Payment invoices*/
$payment_invoices = $this->payment_hash->invoices();
@ -412,7 +397,6 @@ class BaseDriver extends AbstractPaymentDriver
if (collect($invoice->line_items)->contains('type_id', '3')) {
$invoice->service()->toggleFeesPaid()->save();
}
});
}

View File

@ -11,11 +11,11 @@
namespace App\Services\Email;
use App\Models\User;
use App\Models\Client;
use App\Models\Vendor;
use App\Models\Company;
use App\Models\ClientContact;
use App\Models\Company;
use App\Models\User;
use App\Models\Vendor;
use App\Models\VendorContact;
use Illuminate\Mail\Mailables\Address;

View File

@ -105,7 +105,6 @@ class MailEntity implements ShouldQueue
*/
public function configureMailer(): self
{
$this->mail = Mail::mailer($this->mailer);
if ($this->client_postmark_secret) {
@ -208,7 +207,6 @@ class MailEntity implements ShouldQueue
public function trySending(): void
{
try {
$this->mail->send($this->mailable);
/* Count the amount of emails sent across all the users accounts */

View File

@ -11,12 +11,12 @@
namespace App\Services\Scheduler;
use App\Models\Client;
use App\Models\Scheduler;
use App\Utils\Traits\MakesHash;
use App\Models\RecurringInvoice;
use App\Utils\Traits\MakesDates;
use App\DataMapper\Schedule\EmailStatement;
use App\Models\Client;
use App\Models\RecurringInvoice;
use App\Models\Scheduler;
use App\Utils\Traits\MakesDates;
use App\Utils\Traits\MakesHash;
class SchedulerService
{

View File

@ -179,13 +179,10 @@ class Number
} elseif ($swapSymbol) {
return "{$value} ".trim($symbol);
} elseif ($entity->getSetting('show_currency_code') === false) {
/* Ensures we place the negative symbol ahead of the currency symbol*/
if ($_value < 0) {
$value = substr($value, 1);
$symbol = "-{$symbol}";
}
return "{$symbol}{$value}";