diff --git a/Layout/default/Device/Detail.php b/Layout/default/Device/Detail.php index 1743b711a..bb57d97bc 100644 --- a/Layout/default/Device/Detail.php +++ b/Layout/default/Device/Detail.php @@ -730,7 +730,9 @@ foreach ($devicesall as $deviceall) { allonts++; if (typeof customers[ont['serial']] !== "undefined") { customerid = customers[ont['serial']]['customer_number']; - + if (customerid == "" || customerid == null) { + customerid = "N/A"; + } if (customers[ont['serial']]['company'] != "" && customers[ont['serial']]['company'] != null) { @@ -744,14 +746,23 @@ foreach ($devicesall as $deviceall) { } else if (customers[ont['serial']]['lastname'] == null) { } - customername +=' 
'+ customers[ont['serial']]['street'] + ", " + customers[ont['serial']]['zip'] + " " + customers[ont['serial']]['city'] + customername += ' 
' + customers[ont['serial']]['street'] + ", " + customers[ont['serial']]['zip'] + " " + customers[ont['serial']]['city'] } else { customername = "N/A"; customerid = "N/A"; } + let orderPort = item['portshort'] + `/` + o; + let parts = orderPort.split('/'); + let formattedParts = parts.map(num => { + let number = parseInt(num, 10); + return number.toString().padStart(2, '0'); + }); + orderPort = formattedParts.join(''); + + $('#datatable tbody').append(` - ` + item['portshort'] + `/` + o + ` + ` + item['portshort'] + `/` + o + ` ` + customerid + ` ` + customername + ` ` + status + ` @@ -1088,12 +1099,23 @@ foreach ($devicesall as $deviceall) { var portid = button.closest('table').data('portid'); if (typeof customers[button.data('snr')] !== "undefined") { customerid = customers[button.data('snr')]['customer_number']; - if (customers[button.data('snr')]['lastname'] != "" && customers[button.data('snr')]['lastname'] != null) { - customername = customerid + " / " + customers[button.data('snr')]['lastname'] + " " + customers[button.data('snr')]['firstname']; + + if (customers[button.data('snr')]['company'] != "" && customers[button.data('snr')]['company'] != null) { + + customername = "" + customers[button.data('snr')]['company'] + " (C)"; + } else if (customers[button.data('snr')]['lastname'] != "" && customers[button.data('snr')]['lastname'] != null) { + customername = customers[button.data('snr')]['lastname'] + " " + customers[button.data('snr')]['firstname']; + } else if (customers[button.data('snr')]['TerminationContact'] != "" && customers[button.data('snr')]['TerminationContact'] != null) { + customername = customers[button.data('snr')]['TerminationContact']; + } else if (customers[button.data('snr')]['BuildingContact'] != "" && customers[button.data('snr')]['BuildingContact'] != null) { + customername = customers[button.data('snr')]['BuildingContact']; } else if (customers[button.data('snr')]['lastname'] == null) { - customername = customers[button.data('snr')]['street'] + ", " + customers[button.data('snr')]['zip'] + " " + customers[button.data('snr')]['city']; + + } + customername += '
' + customers[button.data('snr')]['street'] + ", " + customers[button.data('snr')]['zip'] + " " + customers[button.data('snr')]['city'] + if (customerid != "" && customerid != null) { + customername = customerid + " / " + customername; } else { - customername = customerid + " / " + customers[button.data('snr')]['company'] + " (C)"; } } else { customername = "N/A"; @@ -1102,7 +1124,7 @@ foreach ($devicesall as $deviceall) { $('#ont-macadresses').empty(); $('.ont-line-stat').text('N/A'); - $('#ont-detail-kd').text(customername); + $('#ont-detail-kd').html(customername); $('#ont-detail-lastofflinecause').attr('data-original-title', ''); $('#ont-detail-spinner').show();