Add support for retrieving and displaying customer details

Enhanced plate scans to include customer name and vehicle type. Introduced a method in `customer_vehicles_o` for fetching vehicle details by plate and adjusted `users_o` to manage display names more effectively.
This commit is contained in:
Jepp9350
2025-05-20 14:01:29 +02:00
parent b37499e0f0
commit d65d49b31e
3 changed files with 24 additions and 2 deletions
+4 -2
View File
@@ -294,12 +294,14 @@ class users_o extends db
$phone_country_code = $phone_country_code === null ? null : (int)$phone_country_code;
$phone = $this->phone->value();
$phone = $phone === null ? null : (int)$phone;
$display_name = $this->display_name->value();
$customer_name = $this->getCustomerName($this->customer_number->value());
// Create the array with the object properties
$array = [
'id' => (int)$this->id,
'customer_number' => (int)$this->customer_number->value(),
'customer_name' => $this->getCustomerName($this->customer_number->value()),
'display_name' => $this->display_name->value(),
'customer_name' => $customer_name,
'display_name' => $display_name === 'Unnamed' ? $customer_name : $display_name,
'group_id' => (int)$this->group_id->value(),
'phone' => [
'country_code' => $phone_country_code,