mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-23 06:24:21 +00:00
Completes Order Steps on Unity
This commit is contained in:
@@ -38,7 +38,15 @@ class UpdatesOrderCurrentStepProcessor
|
||||
|
||||
$order = $this->fetchesOrder->execute(['id'=>$order_object->getId()]);
|
||||
|
||||
$order_steps = $this->fetchesOrderSteps->execute(['order_id'=>$order_object->getId(), 'status'=> OrderStatus::PROCESSING, 'order_by' => 'sequence', 'per_page' => 1]);
|
||||
//Count steps / obligations that pending
|
||||
$order_steps_processing = $this->fetchesOrderSteps->getRepository()->where(['order_id'=>$order_object->getId(), 'status'=> OrderStatus::PROCESSING])->count();
|
||||
|
||||
//If no more steps / obligations, then update Order status to complete (Contract fullfilled)
|
||||
if($order_steps_processing==0){
|
||||
$order_object->setStatus(OrderStatus::COMPLETE);
|
||||
}else{
|
||||
$order_object->setStatus($order->status);
|
||||
}
|
||||
|
||||
$order_object->setCurrentStep($currentStep);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user