1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 06:32:40 +01:00

Company Import

This commit is contained in:
= 2021-06-04 20:20:10 +10:00
parent a2e994be82
commit fe2c410ef7
2 changed files with 5 additions and 1 deletions

View File

@ -168,7 +168,7 @@ class CompanyExport implements ShouldQueue
$this->export_data['company'] = $this->company->toArray();
$this->export_data['company_gateways'] = $this->company->company_gateways->map(function ($company_gateway){
$this->export_data['company_gateways'] = $this->company->company_gateways->withTrashed()->cursor()->map(function ($company_gateway){
$company_gateway = $this->transformArrayOfKeys($company_gateway, ['company_id', 'user_id']);
$company_gateway->config = decrypt($company_gateway->config);

View File

@ -1115,10 +1115,14 @@ class CompanyImport implements ShouldQueue
return null;
if (! array_key_exists($resource, $this->ids)) {
nlog($this->ids);
nlog($this->backup_file->payments);
throw new \Exception("Resource {$resource} not available.");
}
if (! array_key_exists("{$old}", $this->ids[$resource])) {
nlog($this->ids);
nlog($this->backup_file->payments);
throw new \Exception("Missing {$resource} key: {$old}");
}