feat(helpdesk): switch team query to PBI_FP_Tickets for richer data

FP entity provides Company_Contact_Name (full customer name),
Category_1_Description (readable category), and Last_Activity_By_Code.
Customer column shows name instead of number. Category shows readable
description instead of code. Debitor link only rendered when
customer_no is available (FP may not expose it).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 19:47:10 +02:00
parent d214f08c3f
commit 9e94456759
3 changed files with 8 additions and 7 deletions

View File

@@ -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);

View File

@@ -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,
];

View File

@@ -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);