Update getUserByCustomerNumber references to getCustomerByIdOrCustomerNumber and enhance null-checking in requireSelected.
This commit is contained in:
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user