1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Merge pull request #7417 from turbo124/v5-develop

Fixes for converting company gateway ids for client gateway tokens
This commit is contained in:
David Bomba 2022-05-04 15:10:58 +10:00 committed by GitHub
commit 96509ec9a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -149,7 +149,7 @@ class CompanyExport implements ShouldQueue
$this->export_data['client_gateway_tokens'] = $this->company->client_gateway_tokens->map(function ($client_gateway_token){ $this->export_data['client_gateway_tokens'] = $this->company->client_gateway_tokens->map(function ($client_gateway_token){
$client_gateway_token = $this->transformArrayOfKeys($client_gateway_token, ['company_id', 'client_id']); $client_gateway_token = $this->transformArrayOfKeys($client_gateway_token, ['company_id', 'client_id', 'company_gateway_id']);
return $client_gateway_token->makeVisible(['id']); return $client_gateway_token->makeVisible(['id']);

View File

@ -688,7 +688,7 @@ class CompanyImport implements ShouldQueue
$this->genericNewClassImport(ClientGatewayToken::class, $this->genericNewClassImport(ClientGatewayToken::class,
['company_id', 'id', 'hashed_id','client_id'], ['company_id', 'id', 'hashed_id','client_id'],
[['clients' => 'client_id']], [['clients' => 'client_id', 'company_gateways' => 'company_gateway_id']],
'client_gateway_tokens'); 'client_gateway_tokens');
return $this; return $this;
@ -1235,7 +1235,6 @@ class CompanyImport implements ShouldQueue
$class::unguard(); $class::unguard();
// foreach($this->backup_file->{$object_property} as $obj)
foreach((object)$this->getObject($object_property) as $obj) foreach((object)$this->getObject($object_property) as $obj)
{ {
/* Remove unwanted keys*/ /* Remove unwanted keys*/
@ -1270,7 +1269,7 @@ class CompanyImport implements ShouldQueue
$activity_invitation_key = 'invoice_invitations'; $activity_invitation_key = 'invoice_invitations';
elseif(isset($obj->quote_id)) elseif(isset($obj->quote_id))
$activity_invitation_key = 'quote_invitations'; $activity_invitation_key = 'quote_invitations';
elseif($isset($obj->credit_id)) elseif(isset($obj->credit_id))
$activity_invitation_key = 'credit_invitations'; $activity_invitation_key = 'credit_invitations';
} }