diff --git a/VERSION.txt b/VERSION.txt index c3091f2837..64a6655a69 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.1.68 +5.1.69 diff --git a/app/Http/Controllers/ImportJsonController.php b/app/Http/Controllers/ImportJsonController.php index a26280ca7e..80bc843421 100644 --- a/app/Http/Controllers/ImportJsonController.php +++ b/app/Http/Controllers/ImportJsonController.php @@ -84,7 +84,7 @@ class ImportJsonController extends BaseController $file_location = public_path("storage/backups/$filename/backup.json"); if (! file_exists($file_location)) - throw new NonExistingMigrationFile('Backup file does not exist, or it is corrupted.'); + throw new NonExistingMigrationFile('Backup file does not exist, or is corrupted.'); $data = json_decode(file_get_contents($file_location)); diff --git a/app/Http/ViewComposers/PortalComposer.php b/app/Http/ViewComposers/PortalComposer.php index 6bb63f052d..ea201d6d3f 100644 --- a/app/Http/ViewComposers/PortalComposer.php +++ b/app/Http/ViewComposers/PortalComposer.php @@ -13,6 +13,7 @@ namespace App\Http\ViewComposers; use App\Utils\Ninja; use App\Utils\TranslationHelper; +use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Lang; use Illuminate\View\View; diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 766d7b0de2..c798224443 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -147,11 +147,24 @@ class CompanyImport implements ShouldQueue $this->backup_file = Cache::get($this->hash); - if ( empty( $this->import_object ) ) + if ( empty( $this->backup_file ) ) throw new \Exception('No import data found, has the cache expired?'); $this->backup_file = base64_decode($this->backup_file); + + if(array_key_exists('import_settings', $request) && $request['import_settings'] == 'true') { + $this->preFlightChecks()->importSettings(); + } + + if(array_key_exists('import_data', $request) && $request['import_data'] == 'true') { + + $this->preFlightChecks() + ->purgeCompanyData() + ->importData(); + + } + } @@ -191,6 +204,7 @@ class CompanyImport implements ShouldQueue $this->company->tasks()->forceDelete(); $this->company->vendors()->forceDelete(); $this->company->expenses()->forceDelete(); + $this->company->subscriptions()->forceDelete(); $this->company->save(); @@ -226,6 +240,8 @@ class CompanyImport implements ShouldQueue } + return $this; + } private function import_payment_terms() diff --git a/app/Services/Client/PaymentMethod.php b/app/Services/Client/PaymentMethod.php index 571c3dd61b..0936cabdbd 100644 --- a/app/Services/Client/PaymentMethod.php +++ b/app/Services/Client/PaymentMethod.php @@ -188,7 +188,7 @@ class PaymentMethod $fee_label = $gateway->calcGatewayFeeLabel($this->amount, $this->client, $gateway_type_id); - if(!$gateway_type_id){ + if(!$gateway_type_id || (GatewayType::CUSTOM == $gateway_type_id)){ $this->payment_urls[] = [ 'label' => $gateway->getConfigField('name') . $fee_label, diff --git a/config/ninja.php b/config/ninja.php index 1f12d05720..777c913d67 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.1.68', - 'app_tag' => '5.1.68-release', + 'app_version' => '5.1.69', + 'app_tag' => '5.1.69-release', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),