diff --git a/app/Models/Sale.php b/app/Models/Sale.php index a73519d52..0e5ddffe2 100644 --- a/app/Models/Sale.php +++ b/app/Models/Sale.php @@ -237,6 +237,9 @@ class Sale extends Model $builder->orLike('customer_p.first_name', $search); // Customer first name $builder->orLike('CONCAT(customer_p.first_name, " ", customer_p.last_name)', $search); // Customer first and last name $builder->orLike('customer.company_name', $search); // Customer company name + if (ctype_digit($search)) { + $builder->orWhere('sales.sale_id', $search); // Sale ID + } $builder->groupEnd(); } } @@ -1477,6 +1480,9 @@ class Sale extends Model $builder->orLike('CONCAT(customer_p.first_name, " ", customer_p.last_name)', $search); // Customer company name $builder->orLike('customer.company_name', $search); + if (ctype_digit($search)) { + $builder->orWhere('sales.sale_id', $search); // Sale ID + } $builder->groupEnd(); } }