diff --git a/src/Controller/CAPI/RiderAppController.php b/src/Controller/CAPI/RiderAppController.php index e23d2350..ad99e56c 100644 --- a/src/Controller/CAPI/RiderAppController.php +++ b/src/Controller/CAPI/RiderAppController.php @@ -1204,7 +1204,7 @@ class RiderAppController extends ApiController ]); } - public function updateJobOrder(Request $req, EntityManagerInterface $em, InvoiceGeneratorInterface $ic) + public function updateJobOrder(Request $req, EntityManagerInterface $em, InvoiceGeneratorInterface $ic, PriceTierManager $pt_manager) { $items = json_decode(file_get_contents('php://input'), true); @@ -1301,7 +1301,7 @@ class RiderAppController extends ApiController // need to get the existing invoice items using jo id and invoice id $existing_ii = $this->getInvoiceItems($em, $jo); - $this->generateUpdatedInvoice($em, $ic, $jo, $existing_ii, $ti_items, $promo); + $this->generateUpdatedInvoice($em, $ic, $jo, $existing_ii, $ti_items, $promo, $pt_manager); $data = []; return new APIResponse(true, 'Job order updated.', $data); @@ -1453,8 +1453,7 @@ class RiderAppController extends ApiController return new APIResponse(true, 'Job order service changed.', $data); } - protected function generateUpdatedInvoice(EntityManagerInterface $em, InvoiceGeneratorInterface $ic, JobOrder $jo, - $existing_ii, $trade_in_items, $promo) + protected function generateUpdatedInvoice(EntityManagerInterface $em, InvoiceGeneratorInterface $ic, JobOrder $jo, $existing_ii, $trade_in_items, $promo, PriceTierManager $pt_manager) { // get the service type $stype = $jo->getServiceType(); @@ -1488,6 +1487,10 @@ class RiderAppController extends ApiController ->setHasCoolant($flag_coolant) ->setIsTaxable(); + // set price tier + $pt_id = $pt_manager->getPriceTier($jo->getCoordinates()); + $icrit->setPriceTier($pt_id); + // at this point, all information should be valid // assuming JO information is already valid since this // is in the system already