diff --git a/src/Domains/Connectors/Zoho/Actions/SyncZohoLeadAction.php b/src/Domains/Connectors/Zoho/Actions/SyncZohoLeadAction.php index 713d4342a..49e571f82 100644 --- a/src/Domains/Connectors/Zoho/Actions/SyncZohoLeadAction.php +++ b/src/Domains/Connectors/Zoho/Actions/SyncZohoLeadAction.php @@ -129,11 +129,18 @@ public function execute(): ?Lead if ($user) { $localLead->leads_owner_id = $user->getId(); } + + if ($user) { + $localLead->leads_owner_id = $user->getId(); + $localLead->users_id = $user->getId(); + } + $localLead->people->firstname = $zohoLead->First_Name; $localLead->people->lastname = $zohoLead->Last_Name; $localLead->firstname = $zohoLead->First_Name; $localLead->lastname = $zohoLead->Last_Name; $localLead->title = $zohoLead->Full_Name; + $localLead->description = $zohoLead->Description; $localLead->leads_status_id = $leadStatus->getId(); $localLead->disableWorkflows(); $localLead->saveOrFail(); diff --git a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php index 29285b7bb..5893a99d2 100644 --- a/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php +++ b/src/Domains/Connectors/Zoho/Workflows/ZohoLeadActivity.php @@ -119,7 +119,7 @@ protected function assignAgent( $defaultLeadSource = $company->get(CustomFieldEnum::ZOHO_DEFAULT_LEAD_SOURCE->value); if (! empty($defaultLeadSource)) { - $zohoData['Lead_Source'] = $lead->receiver ? $lead->receiver->name : $defaultLeadSource; + $zohoData['Lead_Source'] = $defaultLeadSource; //$lead->receiver ? $lead->receiver->name : $defaultLeadSource; } if (is_object($agent)) { @@ -144,7 +144,9 @@ protected function assignAgent( if ($agentInfo && $agentInfo->get('over_write_owner')) { $zohoData['Owner'] = (int) $agentInfo->get('over_write_owner'); } - $zohoData['Lead_Source'] = $agent->name ?? $agent->Name; + if (empty($defaultLeadSource)) { + $zohoData['Lead_Source'] = $agent->name ?? $agent->Name; + } } elseif ($agentInfo instanceof Agent) { $zohoData['Owner'] = (int) $agentInfo->owner_linked_source_id; if (empty($defaultLeadSource)) {