From 5baef3f69a1aa5d603fe73b63228f27bfb901c46 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 4 Feb 2021 11:08:56 +1100 Subject: [PATCH 1/8] add start migration texts --- resources/lang/en/texts.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index df9560565a5a..b328ab27f876 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -4136,6 +4136,8 @@ $LANG = array( 'online_payments_minimum_note' => 'Note: Online payments are supported only if amount is bigger than $1 or currency equivalent.', 'payment_token_not_found' => 'Payment token not found, please try again. If an issue still persist, try with another payment method', + ////////////////////////////////////// + 'start_migration' => 'Start Migration', ); return $LANG; From c488602b740c06775ca71737dc4d744a1e58a204 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 8 Feb 2021 08:43:23 +1100 Subject: [PATCH 2/8] Add more properties for migration --- app/Traits/GenerateMigrationResources.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index 92a5deeb24ac..0c82f23a3daa 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -73,6 +73,8 @@ trait GenerateMigrationResources info("get company"); return [ + 'first_day_of_week' => $this->account->start_of_week, + 'first_month_of_year' => $this->account->financial_year_start, 'version' => NINJA_VERSION, 'referral_code' => $this->account->referral_code ?: '', 'account_id' => $this->account->id, From 7d268604b788bf439c045d01b5c63d353edc9ddc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 9 Feb 2021 07:59:40 +1100 Subject: [PATCH 3/8] Fixes for quote status --- app/Traits/GenerateMigrationResources.php | 30 ++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index 0c82f23a3daa..b1dfadaecf89 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -749,6 +749,34 @@ info("get company"); } + private function transformQuoteStatusId($quote) + { + if(!$quote->is_public) + return 1; + + if($quote->quote_invoice_id) + return 4; + + switch ($quote->invoice_status_id) { + case 1: + return 1; + break; + case 2: + return 2; + break; + case 3: + return 2; + break; + case 4: + return 3; + break; + + default: + return 2; + break; + } + } + /* define('INVOICE_STATUS_DRAFT', 1); define('INVOICE_STATUS_SENT', 2); @@ -918,7 +946,7 @@ info("get company"); 'client_id' => $quote->client_id, 'user_id' => $quote->user_id, 'company_id' => $quote->account_id, - 'status_id' => $quote->invoice_status_id, + 'status_id' => $this->transformQuoteStatusId($quote), 'design_id' => $this->getDesignId($quote->invoice_design_id), 'number' => $quote->invoice_number, 'discount' => $quote->discount, From 3efb8cf252cde3b83bff988ae7d96887cffe23a0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 10 Feb 2021 09:40:55 +1100 Subject: [PATCH 4/8] Fixes for frequenceis --- app/Console/Commands/ExportMigrations.php | 23 +++++++++++++++++------ app/Traits/GenerateMigrationResources.php | 3 ++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/Console/Commands/ExportMigrations.php b/app/Console/Commands/ExportMigrations.php index bc9f4c223699..8e8f0866899b 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 a914d6a56f5c..971ad3669057 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(); From 4c2a4fd14213fb9125f20b22d901a5f1cd4cb506 Mon Sep 17 00:00:00 2001 From: myles1729 <57610916+myles1729@users.noreply.github.com> Date: Sun, 14 Feb 2021 13:31:44 +1300 Subject: [PATCH 5/8] Update README.md Link to v5 self-host instructions broken - I think this is the correct one --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 161fd0098252..e7d7027e12af 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Just make sure to add the `invoice-ninja` tag to your question. -#### Note: v5 is now in beta. To upgrade from v4 you need to [install v5](https://invoiceninja.github.io/selfhost.html) as a separate app and then use the migration tool in the latest version of v4 on Settings > Account Management. +#### Note: v5 is now in beta. To upgrade from v4 you need to [install v5](https://invoiceninja.github.io/docs/self-host/) as a separate app and then use the migration tool in the latest version of v4 on Settings > Account Management. All Pro and Enterprise features from the hosted app are included in the open-source code. We offer a $30 per year white-label license to remove the Invoice Ninja branding from client facing parts of the app. From b31fa80b5a7633c4f666f65a4f3a3ddf20c5f966 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 15 Feb 2021 07:51:21 +1100 Subject: [PATCH 6/8] Update texts --- resources/lang/en/texts.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index dc91820cb6d2..40d3e1216932 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -4140,6 +4140,8 @@ $LANG = array( ////////////////////////////////////// 'start_migration' => 'Start Migration', + 'recurring_cancellation_request' => 'Request for recurring invoice cancellation from :contact', + ); return $LANG; From 6546b41e26935ddab260b9fe9f6c88761f672033 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 15 Feb 2021 07:52:34 +1100 Subject: [PATCH 7/8] Update texts --- resources/lang/en/texts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 40d3e1216932..f88837c5816c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -4141,7 +4141,8 @@ $LANG = array( ////////////////////////////////////// 'start_migration' => 'Start Migration', 'recurring_cancellation_request' => 'Request for recurring invoice cancellation from :contact', - + 'recurring_cancellation_request_body' => ':contact from Client :client requested to cancel Recurring Invoice :invoice', + ); return $LANG; From d5d917e3f8da6bb67292ce92d01b42d7a8175f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Tue, 16 Feb 2021 13:33:16 +0100 Subject: [PATCH 8/8] Update texts.php --- resources/lang/en/texts.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index f88837c5816c..51b41196fd6b 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -4142,7 +4142,9 @@ $LANG = array( 'start_migration' => 'Start Migration', 'recurring_cancellation_request' => 'Request for recurring invoice cancellation from :contact', 'recurring_cancellation_request_body' => ':contact from Client :client requested to cancel Recurring Invoice :invoice', - + + 'hello' => 'Hello', + 'group_documents' => 'Group documents', ); return $LANG;