Merge pull request #6562 from turbo124/v5-develop

minor fixes
This commit is contained in:
David Bomba 2021-09-03 22:28:07 +10:00 committed by GitHub
commit 437b96cf9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

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

View File

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

View File

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