mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Support changing primary vendor contact
This commit is contained in:
parent
f20a096dbb
commit
43c04415ef
@ -95,6 +95,15 @@ class VendorRepository extends BaseRepository
|
||||
|
||||
$vendorcontactIds = [];
|
||||
|
||||
// If the primary is set ensure it's listed first
|
||||
usort($vendorcontacts, function ($left, $right) {
|
||||
if (isset($right['is_primary']) && isset($left['is_primary'])) {
|
||||
return $right['is_primary'] - $left['is_primary'];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
foreach ($vendorcontacts as $vendorcontact) {
|
||||
$vendorcontact = $vendor->addVendorContact($vendorcontact, $first);
|
||||
$vendorcontactIds[] = $vendorcontact->public_id;
|
||||
|
Loading…
Reference in New Issue
Block a user