1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

fixes for migrations

This commit is contained in:
David Bomba 2021-02-03 23:30:05 +11:00
parent 905da88348
commit 8770f0d289
3 changed files with 5 additions and 3 deletions

View File

@ -82,7 +82,6 @@ class CheckData extends Command
} }
//$this->checkInvoices(); //$this->checkInvoices();
$this->checkTranslations();
$this->checkInvoiceBalances(); $this->checkInvoiceBalances();
$this->checkClientBalances(); $this->checkClientBalances();
$this->checkContacts(); $this->checkContacts();
@ -97,6 +96,7 @@ class CheckData extends Command
$this->checkFailedJobs(); $this->checkFailedJobs();
} }
$this->checkTranslations();
$this->logMessage('Done: ' . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE)); $this->logMessage('Done: ' . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE));
$errorEmail = env('ERROR_EMAIL'); $errorEmail = env('ERROR_EMAIL');

View File

@ -34,7 +34,8 @@ trait GenerateMigrationResources
protected function getAccount() protected function getAccount()
{ {
info("get account"); info("get account");
if($this->account->account_tokens()->exists()){ if($this->account->account_tokens()->exists()){
$this->token = $this->account->account_tokens->first()->token; $this->token = $this->account->account_tokens->first()->token;
} }
@ -72,6 +73,7 @@ info("get account");
info("get company"); info("get company");
return [ return [
'version' => NINJA_VERSION,
'referral_code' => $this->account->referral_code ?: '', 'referral_code' => $this->account->referral_code ?: '',
'account_id' => $this->account->id, 'account_id' => $this->account->id,
'google_analytics_key' => $this->account->analytics_key ?: '', 'google_analytics_key' => $this->account->analytics_key ?: '',
@ -383,7 +385,7 @@ info("get company");
$credits = []; $credits = [];
$export_credits = Invoice::where('account_id', $this->account->id) $export_credits = Invoice::where('account_id', $this->account->id)
->where('amount', '<', '0') ->where('balance', '<', '0')
->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD) ->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD)
->where('is_public', true) ->where('is_public', true)
->withTrashed() ->withTrashed()

View File