From 95641177cc7648bfd88c1db7b06ab408cf2644ae Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 3 Sep 2021 12:25:41 +1000 Subject: [PATCH] minor fixes --- app/Jobs/Cron/RecurringInvoicesCron.php | 4 ++-- app/Models/Account.php | 4 ++-- app/PaymentDrivers/BaseDriver.php | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Jobs/Cron/RecurringInvoicesCron.php b/app/Jobs/Cron/RecurringInvoicesCron.php index 51b8bb874e86..14e9c1cfa56f 100644 --- a/app/Jobs/Cron/RecurringInvoicesCron.php +++ b/app/Jobs/Cron/RecurringInvoicesCron.php @@ -89,7 +89,7 @@ class RecurringInvoicesCron ->with('company') ->cursor(); - nlog(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db); + nlog(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count()); $recurring_invoices->each(function ($recurring_invoice, $key) { nlog("Current date = " . now()->format("Y-m-d") . " Recurring date = " .$recurring_invoice->next_send_date ." Recurring #id = ". $recurring_invoice->id); @@ -100,7 +100,7 @@ class RecurringInvoicesCron SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db); } catch(\Exception $e){ - nlog("Unable to sending recurring invoice {$recurring_invoice->id} on db {$db}"); + nlog("Unable to sending recurring invoice {$recurring_invoice->id}"); } } }); diff --git a/app/Models/Account.php b/app/Models/Account.php index 5301d90cbd7d..d7a9f2d6ce08 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -358,11 +358,11 @@ class Account extends BaseModel if($this->isPaid()){ $limit = $this->paid_plan_email_quota; - $limit += Carbon::createFromTimestamp($this->created_at)->diffInMonths() * 50; + $limit += Carbon::createFromTimestamp($this->created_at)->diffInMonths() * 100; } else{ $limit = $this->free_plan_email_quota; - $limit += Carbon::createFromTimestamp($this->created_at)->diffInMonths() * 100; + $limit += Carbon::createFromTimestamp($this->created_at)->diffInMonths() * 50; } return min($limit, 5000); diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 5495cb885f91..dd8a5e570179 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -205,6 +205,7 @@ class BaseDriver extends AbstractPaymentDriver $invoices->each(function ($invoice) use ($payment) { event(new InvoiceWasPaid($invoice, $payment, $payment->company, Ninja::eventVars())); + $invoice->service()->workFlow(); }); return $payment->service()->applyNumber()->save();