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'); 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(); 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;