From 8ff9c923e3453fcdfeeb0e6d4a115996539a4669 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 3 Sep 2021 20:45:23 +1000 Subject: [PATCH 1/3] Minor fix for accessing account in helper --- app/Utils/Helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Utils/Helpers.php b/app/Utils/Helpers.php index b30066aa62ed..789de53e6b5d 100644 --- a/app/Utils/Helpers.php +++ b/app/Utils/Helpers.php @@ -34,7 +34,7 @@ class Helpers $elements['signature'] = $_settings->email_signature; $elements['settings'] = $_settings; - $elements['whitelabel'] = $client->user->account->isPaid() ? true : false; + $elements['whitelabel'] = $client->company->account->isPaid() ? true : false; $elements['company'] = $client->company; return $elements; From 846a966a47f153664b7255e432828cad73624c7f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 3 Sep 2021 21:20:52 +1000 Subject: [PATCH 2/3] Minor fixes for creating sample data --- app/Console/Commands/CreateSingleAccount.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/CreateSingleAccount.php b/app/Console/Commands/CreateSingleAccount.php index ca7201960326..2d3c38cc5ae2 100644 --- a/app/Console/Commands/CreateSingleAccount.php +++ b/app/Console/Commands/CreateSingleAccount.php @@ -22,6 +22,7 @@ use App\Factory\RecurringInvoiceFactory; use App\Factory\SubscriptionFactory; use App\Helpers\Invoice\InvoiceSum; use App\Jobs\Company\CreateCompanyTaskStatuses; +use App\Libraries\MultiDB; use App\Models\Account; use App\Models\Client; use App\Models\ClientContact; @@ -62,7 +63,7 @@ class CreateSingleAccount extends Command /** * @var string */ - protected $signature = 'ninja:create-single-account {gateway=all}'; + protected $signature = 'ninja:create-single-account {gateway=all} {--database=db-ninja-01}'; protected $invoice_repo; @@ -89,6 +90,8 @@ class CreateSingleAccount extends Command */ public function handle() { + MultiDB::setDb($this->option('database')); + $this->info(date('r').' Create Single Sample Account...'); $this->count = 1; $this->gateway = $this->argument('gateway'); From 55c036f640814d7326b2f96e87ec7363ffa9617a Mon Sep 17 00:00:00 2001 From: = Date: Fri, 3 Sep 2021 22:17:22 +1000 Subject: [PATCH 3/3] Fixes for send recurring --- app/Jobs/RecurringInvoice/SendRecurring.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/RecurringInvoice/SendRecurring.php b/app/Jobs/RecurringInvoice/SendRecurring.php index 56f6bbbc3cba..ba4cd3a0a717 100644 --- a/app/Jobs/RecurringInvoice/SendRecurring.php +++ b/app/Jobs/RecurringInvoice/SendRecurring.php @@ -25,6 +25,7 @@ use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Turbo124\Beacon\Facades\LightLogs; +use Carbon\Carbon; class SendRecurring implements ShouldQueue { @@ -137,7 +138,7 @@ class SendRecurring implements ShouldQueue } elseif($invoice->client->getSetting('auto_bill_date') == 'on_due_date' && $invoice->auto_bill_enabled) { - if($invoice->due_date && Carbon\Carbon::parse($invoice->due_date)->startOfDay()->lte(now()->startOfDay())) { + if($invoice->due_date && Carbon::parse($invoice->due_date)->startOfDay()->lte(now()->startOfDay())) { nlog("attempting to autobill {$invoice->number}"); $invoice->service()->autoBill()->save();