Update getUserByCustomerNumber references to getCustomerByIdOrCustomerNumber and enhance null-checking in requireSelected.

This commit is contained in:
Jeppe Bundgaard
2026-01-06 15:40:05 +01:00
parent 19c13977ca
commit 49589de98e
6 changed files with 37 additions and 16 deletions
+2 -2
View File
@@ -88,9 +88,9 @@ class ordersRoute
];
}
// Get the customer
$tmp_customer = (new users_o())->getUserByCustomerNumber((int)$order['customer_id']);
$tmp_customer = (new users_o())->getCustomerByIdOrCustomerNumber((int)$order['customer_id']);
// Add the customer name to the order
$order['customer_name'] = (new users_o())->getCustomerName($order['customer_id']);
$order['customer_name'] = (new users_o())->getCustomerName((int)$tmp_customer->customer_number->value());
$order['user_id'] = (int)$tmp_customer->id;
// Add the cashier name to the order
$order['cashier_name'] = (new users_o())->getCashierName((int)$order['cashier_id']);