mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 19:04:31 -04: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->is_primary = true;
|
||||||
$new_contact->save();
|
$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()
|
private function bootEngine()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user