diff --git a/VERSION.txt b/VERSION.txt index 6c0a3ed796de..cc65bcfbd0d8 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.1.70 \ No newline at end of file +5.1.71 \ No newline at end of file diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 5106ca03c7ca..486b74fde904 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -20,6 +20,7 @@ use App\Libraries\MultiDB; use App\Mail\DownloadBackup; use App\Mail\DownloadInvoices; use App\Models\Activity; +use App\Models\Backup; use App\Models\Client; use App\Models\ClientContact; use App\Models\ClientGatewayToken; @@ -677,7 +678,7 @@ class CompanyImport implements ShouldQueue { $this->genericImportWithoutCompany(Backup::class, - ['activity_id','hashed_id'], + ['hashed_id','id'], [ ['activities' => 'activity_id'], ], @@ -696,7 +697,7 @@ class CompanyImport implements ShouldQueue [ ['users' => 'user_id'], ['clients' => 'client_id'], - ['activities' => 'activity_id'], + // ['activities' => 'activity_id'], ], 'company_ledger', 'created_at'); @@ -941,15 +942,14 @@ class CompanyImport implements ShouldQueue if($class == 'App\Models\Activity'){ if(isset($obj->invitation_id)){ -nlog($obj); + if(isset($obj->invoice_id)) $activity_invitation_key = 'invoice_invitations'; elseif(isset($obj->quote_id)) $activity_invitation_key = 'quote_invitations'; elseif($isset($obj->credit_id)) $activity_invitation_key = 'credit_invitations'; - else - $activity_invitation_key = false; + } } @@ -959,15 +959,10 @@ nlog($obj); { foreach($transform as $key => $value) { - if($class == 'App\Models\Activity' && $activity_invitation_key){ + if($class == 'App\Models\Activity' && $activity_invitation_key && $key == 'invitations'){ $key = $activity_invitation_key; - nlog($class); - nlog("{$value} - {$key}"); - nlog($obj->{$value}); - nlog($activity_invitation_key); } - $obj_array["{$value}"] = $this->transformId($key, $obj->{$value}); } } @@ -1106,14 +1101,13 @@ nlog($obj); return null; if (! array_key_exists($resource, $this->ids)) { - nlog($this->ids); - // nlog($this->backup_file->payments); + // nlog($this->ids); throw new \Exception("Resource {$resource} not available."); } if (! array_key_exists("{$old}", $this->ids[$resource])) { - nlog($this->ids); - // nlog($this->backup_file->company_gateways); + // nlog($this->ids[$resource]); + nlog("searching for {$old} in {$resource}"); throw new \Exception("Missing {$resource} key: {$old}"); } diff --git a/config/ninja.php b/config/ninja.php index ccc31b9721a9..3a16f4672d3c 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.70', - 'app_tag' => '5.1.70-release', + 'app_version' => '5.1.71', + 'app_tag' => '5.1.71-release', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),