diff --git a/app/Console/Commands/ExportMigrations.php b/app/Console/Commands/ExportMigrations.php index bc9f4c2236..8e8f086689 100644 --- a/app/Console/Commands/ExportMigrations.php +++ b/app/Console/Commands/ExportMigrations.php @@ -62,6 +62,7 @@ class ExportMigrations extends Command $users = User::all(); foreach($users as $user) { + Auth::login($user); $this->export($user); } } @@ -78,18 +79,28 @@ class ExportMigrations extends Command $fileName = "{$accountKey}-{$date}-invoiceninja"; $data['data'] = [ + 'account' => $this->getAccount(), 'company' => $this->getCompany(), 'users' => $this->getUsers(), 'tax_rates' => $this->getTaxRates(), + 'payment_terms' => $this->getPaymentTerms(), 'clients' => $this->getClients(), - 'products' => $this->getProducts(), - 'invoices' => $this->getInvoices(), - 'quotes' => $this->getQuotes(), - 'payments' => array_merge($this->getPayments(), $this->getCredits()), - 'credits' => $this->getCreditsNotes(), - 'documents' => $this->getDocuments(), 'company_gateways' => $this->getCompanyGateways(), 'client_gateway_tokens' => $this->getClientGatewayTokens(), + 'vendors' => $this->getVendors(), + 'projects' => $this->getProjects(), + 'products' => $this->getProducts(), + 'credits' => $this->getCreditsNotes(), + 'invoices' => $this->getInvoices(), + 'recurring_invoices' => $this->getRecurringInvoices(), + 'quotes' => $this->getQuotes(), + 'payments' => array_merge($this->getPayments(), $this->getCredits()), + 'documents' => $this->getDocuments(), + 'expense_categories' => $this->getExpenseCategories(), + 'task_statuses' => $this->getTaskStatuses(), + 'expenses' => $this->getExpenses(), + 'tasks' => $this->getTasks(), + 'documents' => $this->getDocuments(), ]; $file = storage_path("migrations/{$fileName}.zip"); diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index a914d6a56f..971ad36690 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -713,7 +713,7 @@ info("get company"); default: - # code... + return 5; break; } } @@ -981,6 +981,7 @@ info("get company"); $transformed = []; $payments = Payment::where('account_id', $this->account->id) + ->where('payment_status_id', '!=', PAYMENT_STATUS_VOIDED) ->withTrashed() ->get();