Add hub selector filtering for available riders, refactor inventory filter to... #1731

Merged
arcticzero merged 42 commits from 800-automatically-reject-jo-if-no-riders-or-inventory into master 2024-07-18 08:34:03 +00:00
2 changed files with 8 additions and 0 deletions
Showing only changes of commit d52402a2ef - Show all commits

View file

@ -752,6 +752,10 @@ class JobOrderController extends ApiController
$hub_criteria->setCustomerId($customer_id);
// set filter flags for inventory and available riders
$hub_criteria->setInventoryCheck();
$hub_criteria->setRidersCheck();
// find nearest hubs
$nearest_hubs = $hub_select->find($hub_criteria);

View file

@ -239,6 +239,10 @@ class JobOrderController extends ApiController
// find nearest hubs
$nearest_hubs = $hub_select->find($hub_criteria);
// set filter flags for inventory and available riders
$hub_criteria->setInventoryCheck();
$hub_criteria->setRidersCheck();
if (!empty($nearest_hubs))
{
// go through the hub list, find the nearest hub