fix(helpdesk): remove unavailable fields from LV ticket query

PBI_LV_Tickets does not expose Description or Company_Contact_Name —
BC returns HTTP 400 on unknown select fields. Revert to original LV
field set. Description falls back to Category_1_Code. Customer column
shows Customer_No when Company_Contact_Name is unavailable. Show API
error message in UI for debugging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 19:38:26 +02:00
parent 72d39822bc
commit bfa3f5a154
3 changed files with 11 additions and 3 deletions

View File

@@ -599,7 +599,7 @@ class BcODataGateway
{
$url = $this->settingsGateway->buildEntityUrl(self::ENTITY_TICKETS_LV)
. '?$top=500'
. '&$select=' . rawurlencode('No,Customer_No,Category_1_Code,Escalation_Code,Ticket_State,Last_Activity_Date,Created_On,Process_Stage,Process_Code,Support_User_Name,Description,Company_Contact_Name')
. '&$select=' . rawurlencode('No,Customer_No,Category_1_Code,Escalation_Code,Ticket_State,Last_Activity_Date,Created_On,Process_Stage,Process_Code,Support_User_Name')
. '&$orderby=' . rawurlencode('Created_On desc');
$response = $this->request('GET', $url);

View File

@@ -1658,7 +1658,7 @@ class DebitorDetailService
$agents[$normalizedUser]['open_ticket_details'][] = [
'no' => trim((string) ($ticket['No'] ?? '')),
'description' => trim((string) ($ticket['Description'] ?? '')),
'description' => trim((string) ($ticket['Description'] ?? (string) ($ticket['Category_1_Code'] ?? ''))),
'age_hours' => $ageHours,
'critical' => $isCritical,
'customer_name' => trim((string) ($ticket['Company_Contact_Name'] ?? '')),