mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Force primary contact on importing of client
This commit is contained in:
parent
76dfbddca3
commit
4af753230f
@ -106,6 +106,24 @@ class CSVIngest implements ShouldQueue
|
||||
$new_contact->is_primary = true;
|
||||
$new_contact->save();
|
||||
}
|
||||
|
||||
Client::with('contacts')->where('company_id', $this->company->id)->cursor()->each(function ($client){
|
||||
|
||||
$contact = $client->contacts()->first();
|
||||
$contact->is_primary = true;
|
||||
$contact->save();
|
||||
|
||||
});
|
||||
|
||||
Vendor::with('contacts')->where('company_id', $this->company->id)->cursor()->each(function ($vendor){
|
||||
|
||||
$contact = $vendor->contacts()->first();
|
||||
$contact->is_primary = true;
|
||||
$contact->save();
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function bootEngine()
|
||||
|
Loading…
Reference in New Issue
Block a user