From 8770f0d289411b569a765f4541b0457ae4b4119d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 3 Feb 2021 23:30:05 +1100 Subject: [PATCH] fixes for migrations --- app/Console/Commands/CheckData.php | 2 +- app/Traits/GenerateMigrationResources.php | 6 ++++-- storage/migrations/.gitignore | 0 3 files changed, 5 insertions(+), 3 deletions(-) delete mode 100755 storage/migrations/.gitignore diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index d05bfc25c8..4a20d1f23a 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -82,7 +82,6 @@ class CheckData extends Command } //$this->checkInvoices(); - $this->checkTranslations(); $this->checkInvoiceBalances(); $this->checkClientBalances(); $this->checkContacts(); @@ -97,6 +96,7 @@ class CheckData extends Command $this->checkFailedJobs(); } + $this->checkTranslations(); $this->logMessage('Done: ' . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE)); $errorEmail = env('ERROR_EMAIL'); diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index d58baa9ffa..a914d6a56f 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -34,7 +34,8 @@ trait GenerateMigrationResources protected function getAccount() { -info("get account"); + info("get account"); + if($this->account->account_tokens()->exists()){ $this->token = $this->account->account_tokens->first()->token; } @@ -72,6 +73,7 @@ info("get account"); info("get company"); return [ + 'version' => NINJA_VERSION, 'referral_code' => $this->account->referral_code ?: '', 'account_id' => $this->account->id, 'google_analytics_key' => $this->account->analytics_key ?: '', @@ -383,7 +385,7 @@ info("get company"); $credits = []; $export_credits = Invoice::where('account_id', $this->account->id) - ->where('amount', '<', '0') + ->where('balance', '<', '0') ->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD) ->where('is_public', true) ->withTrashed() diff --git a/storage/migrations/.gitignore b/storage/migrations/.gitignore deleted file mode 100755 index e69de29bb2..0000000000