close #2292 Fixed: Unable to change the customer of a duplicated invoice
This commit is contained in:
parent
d9d0e09e3a
commit
9ddbeddd2b
@ -456,8 +456,8 @@ abstract class DocumentForm extends Base
|
||||
$contacts = Contact::enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||
}
|
||||
|
||||
if (!empty($document) && ($document->contact && !$contacts->has($document->contact_id))) {
|
||||
$contacts->put($document->contact->id, $document->contact->name);
|
||||
if (!empty($document) && ($document->contact && !$contacts->contains('id', $document->contact_id))) {
|
||||
$contacts->push($document->contact);
|
||||
}
|
||||
|
||||
return $contacts;
|
||||
|
@ -71,6 +71,10 @@ class SelectContactCard extends Component
|
||||
{
|
||||
if (empty($this->contacts)) {
|
||||
$this->contacts = Contact::{$this->type}()->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||
|
||||
if (!empty($this->contact) && (!$this->contacts->contains('id', $contact->id))) {
|
||||
$this->contacts->push($this->contact);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->searchRoute)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user