diff --git a/modules/helpdesk/lib/Module/Helpdesk/Service/BcODataGateway.php b/modules/helpdesk/lib/Module/Helpdesk/Service/BcODataGateway.php index fe36541..0362d1f 100644 --- a/modules/helpdesk/lib/Module/Helpdesk/Service/BcODataGateway.php +++ b/modules/helpdesk/lib/Module/Helpdesk/Service/BcODataGateway.php @@ -597,9 +597,9 @@ class BcODataGateway */ public function getTicketsForTeam(): array { - $url = $this->settingsGateway->buildEntityUrl(self::ENTITY_TICKETS_LV) + $url = $this->settingsGateway->buildEntityUrl(self::ENTITY_TICKETS) . '?$top=500' - . '&$select=' . rawurlencode('No,Description,Customer_No,Cust_Name,Category_1_Code,Escalation_Code,Ticket_State,Last_Activity_Date,Created_On,Process_Stage,Process_Code,Support_User_Name') + . '&$select=' . rawurlencode('No,Description,Company_Contact_Name,Category_1_Description,Ticket_State,Support_User_Name,Created_On,Last_Activity_Date,Last_Activity_By_Code') . '&$orderby=' . rawurlencode('Created_On desc'); $response = $this->request('GET', $url); diff --git a/modules/helpdesk/lib/Module/Helpdesk/Service/DebitorDetailService.php b/modules/helpdesk/lib/Module/Helpdesk/Service/DebitorDetailService.php index 25fa3df..6f3a679 100644 --- a/modules/helpdesk/lib/Module/Helpdesk/Service/DebitorDetailService.php +++ b/modules/helpdesk/lib/Module/Helpdesk/Service/DebitorDetailService.php @@ -1659,10 +1659,10 @@ class DebitorDetailService $agents[$normalizedUser]['open_ticket_details'][] = [ 'no' => trim((string) ($ticket['No'] ?? '')), 'description' => trim((string) ($ticket['Description'] ?? '')), - 'category' => trim((string) ($ticket['Category_1_Code'] ?? '')), + 'category' => trim((string) ($ticket['Category_1_Description'] ?? (string) ($ticket['Category_1_Code'] ?? ''))), 'age_hours' => $ageHours, 'critical' => $isCritical, - 'customer_name' => trim((string) ($ticket['Cust_Name'] ?? (string) ($ticket['Company_Contact_Name'] ?? ''))), + 'customer_name' => trim((string) ($ticket['Company_Contact_Name'] ?? (string) ($ticket['Cust_Name'] ?? ''))), 'customer_no' => trim((string) ($ticket['Customer_No'] ?? '')), 'last_activity' => $lastActivityDisplay, ]; diff --git a/modules/helpdesk/web/js/helpdesk-team.js b/modules/helpdesk/web/js/helpdesk-team.js index de73bec..3f708df 100644 --- a/modules/helpdesk/web/js/helpdesk-team.js +++ b/modules/helpdesk/web/js/helpdesk-team.js @@ -81,14 +81,15 @@ if (container) { } tr.appendChild(noCell); - // Customer name as link to debitor (link uses customer_no) + // Customer name (link to debitor when customer_no available) const customerCell = h('td', 'helpdesk-team-ticket-customer'); + const customerDisplay = t.customer_name || t.customer_no || '—'; if (debitorBaseUrl && t.customer_no) { - const a = h('a', '', t.customer_name || t.customer_no); + const a = h('a', '', customerDisplay); a.href = debitorBaseUrl + encodeURIComponent(t.customer_no); customerCell.appendChild(a); } else { - customerCell.textContent = t.customer_name || '—'; + customerCell.textContent = customerDisplay; } tr.appendChild(customerCell);