From 9ad9de61c7726b5b5a466d6da79eb732e6e2fc42 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 16 Sep 2020 08:05:05 +0000 Subject: [PATCH] Set rider's active job order to null after JO completion. #495 --- src/Service/RiderAPIHandler/CMBRiderAPIHandler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php index 464b41aa..8f59fb97 100644 --- a/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php +++ b/src/Service/RiderAPIHandler/CMBRiderAPIHandler.php @@ -1160,7 +1160,7 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface $this->em->persist($event); // set rider's active JO to null - $rider->setActiveJobOrder(); + $rider->setActiveJobOrder(null); $this->em->flush(); @@ -1680,6 +1680,10 @@ class CMBRiderAPIHandler implements RiderAPIHandlerInterface // add event log $rider = $this->session->getRider(); + + // clear rider's active JO + $rider->setActiveJobOrder(null); + $event = new JOEvent(); $event->setDateHappen(new DateTime()) ->setTypeID(CMBJOEventType::FULFILL)