From f721cdbe64f518350f66e229a0019986f0afdaa5 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 16 May 2021 20:04:01 +1000 Subject: [PATCH 1/3] Fixes for migration resources --- app/Traits/GenerateMigrationResources.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index f9239df278eb..543e0793f564 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -547,8 +547,12 @@ info("get company"); 'tax_name2' => $invoice->tax_name2, 'tax_rate1' => $invoice->tax_rate1, 'tax_rate2' => $invoice->tax_rate2, - 'custom_value1' => $invoice->custom_value1 ?: '', - 'custom_value2' => $invoice->custom_value2 ?: '', + 'custom_surcharge1' => $invoice->custom_value1 ?: '', + 'custom_surcharge2' => $invoice->custom_value2 ?: '', + 'custom_value1' => $invoice->custom_text_value1 ?: '', + 'custom_value2' => $invoice->custom_text_value2 ?: '', + 'custom_surcharge_tax1' => $invoice->custom_taxes1 ?: '', + 'custom_surcharge_tax2' => $invoice->custom_taxes2 ?: '', 'next_send_date' => null, 'amount' => $invoice->amount ?: 0, 'balance' => $invoice->balance ?: 0, @@ -1052,8 +1056,12 @@ info("get company"); 'tax_name2' => $quote->tax_name2, 'tax_rate1' => $quote->tax_rate1, 'tax_rate2' => $quote->tax_rate2, - 'custom_value1' => $quote->custom_value1 ?: '', - 'custom_value2' => $quote->custom_value2 ?: '', + 'custom_surcharge1' => $quote->custom_value1 ?: '', + 'custom_surcharge2' => $quote->custom_value2 ?: '', + 'custom_value1' => $quote->custom_text_value1 ?: '', + 'custom_value2' => $quote->custom_text_value2 ?: '', + 'custom_surcharge_tax1' => $quote->custom_taxes1 ?: '', + 'custom_surcharge_tax2' => $quote->custom_taxes2 ?: '', 'next_send_date' => null, 'amount' => $quote->amount ?: 0, 'balance' => $quote->balance ?: 0, From 71d047dd53718110ba8a6a69e8ffcf3a25775f38 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 18 May 2021 07:31:09 +1000 Subject: [PATCH 2/3] Fixes for product migration --- app/Traits/GenerateMigrationResources.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index 543e0793f564..22ce9fda4464 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -399,7 +399,7 @@ info("get company"); 'product_key' => $product->product_key ?: '', 'notes' => $product->notes ?: '', 'price' => $product->cost ?: 0, - 'cost' => 0, + 'cost' => $product->cost ?: 0, 'quantity' => $product->qty ?: 0, 'tax_name1' => $product->tax_name1, 'tax_name2' => $product->tax_name2, @@ -1331,7 +1331,6 @@ info("translated gateway_type = {$translated_gateway_type}"); $account_gateways = AccountGateway::where('account_id', $this->account->id)->withTrashed()->get(); - $transformed = []; foreach ($account_gateways as $account_gateway) { From 32bddeca44afe51c354a72225117077f851bf15d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 20 May 2021 14:13:07 +1000 Subject: [PATCH 3/3] Add client and contacts to ninja migration --- app/Traits/GenerateMigrationResources.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index 22ce9fda4464..fccaace26ec1 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -373,6 +373,8 @@ info("get company"); 'gateway_type_id' => $payment_method->payment_type->gateway_type_id, 'is_default' => $is_default, 'meta' => $this->convertMeta($payment_method), + 'client' => $contact->client->toArray(), + 'contacts' => $contact->client->contacts->toArray(), ]; }