mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:44:32 -04:00
Fixes for contact imports
This commit is contained in:
parent
d84af6be3a
commit
309cb5f1f7
@ -232,7 +232,7 @@ trait GenerateMigrationResources
|
|||||||
'shipping_state' => $client->shipping_state,
|
'shipping_state' => $client->shipping_state,
|
||||||
'shipping_postal_code' => $client->shipping_postal_code,
|
'shipping_postal_code' => $client->shipping_postal_code,
|
||||||
'shipping_country_id' => $client->shipping_country_id,
|
'shipping_country_id' => $client->shipping_country_id,
|
||||||
'contacts' => $this->getClientContacts($client->contacts()->withTrashed()),
|
'contacts' => $this->getClientContacts($client),
|
||||||
'settings' => $this->getClientSettings($client),
|
'settings' => $this->getClientSettings($client),
|
||||||
'created_at' => $client->created_at ? Carbon::parse($client->created_at)->toDateString() : null,
|
'created_at' => $client->created_at ? Carbon::parse($client->created_at)->toDateString() : null,
|
||||||
'updated_at' => $client->updated_at ? Carbon::parse($client->updated_at)->toDateString() : null,
|
'updated_at' => $client->updated_at ? Carbon::parse($client->updated_at)->toDateString() : null,
|
||||||
@ -255,8 +255,10 @@ trait GenerateMigrationResources
|
|||||||
return $settings;
|
return $settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getClientContacts($contacts)
|
protected function getClientContacts($client)
|
||||||
{
|
{
|
||||||
|
$contacts = Contact::where('client_id', $client->id)->withTrashed()->get();
|
||||||
|
|
||||||
$transformed = [];
|
$transformed = [];
|
||||||
|
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user