From 5121a02b4d3b45aad42258c2640264d6be55b750 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 19 Feb 2022 18:48:56 +1100 Subject: [PATCH] Enforce subdomain mode when migrating --- app/Traits/GenerateMigrationResources.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index 669f2ea503..6b64b615a8 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -102,6 +102,7 @@ trait GenerateMigrationResources 'custom_surcharge_taxes1' => $this->account->custom_invoice_taxes1, 'custom_surcharge_taxes2' => $this->account->custom_invoice_taxes2, 'subdomain' => $this->account->subdomain, + 'portal_mode' => 'subdomain', 'size_id' => $this->account->size_id, 'enable_modules' => $this->account->enabled_modules, 'custom_fields' => $this->account->custom_fields, @@ -552,13 +553,14 @@ trait GenerateMigrationResources { $credits = []; + $export_credits = collect([]); - $export_credits = Invoice::where('account_id', $this->account->id) - ->where('balance', '<', '0') - ->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD) - ->where('is_public', true) - ->withTrashed() - ->get(); + // $export_credits = Invoice::where('account_id', $this->account->id) + // ->where('balance', '<', '0') + // ->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD) + // ->where('is_public', true) + // ->withTrashed() + // ->get(); info("get credit notes => " . $export_credits->count()); @@ -613,7 +615,7 @@ trait GenerateMigrationResources $invoices = []; $export_invoices = Invoice::where('account_id', $this->account->id) - ->where('amount', '>=', 0) + // ->where('amount', '>=', 0) ->where('invoice_type_id', INVOICE_TYPE_STANDARD) ->where('is_recurring', false) ->withTrashed()