diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 3b5ba593..cadc7d11 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1062,6 +1062,15 @@ class PD_Controller extends REST_Controller } } + # status cancelled means pd_agency_id set to null if smc vendor officer and manager role only + if (isset($pd_details['pd_status']) && ($pd_details['pd_status'] == "CANCELLED") && ($role == 28 || $role == 29)) { + $pd_details['pd_agency_id'] = null; + } + + # status rejected/bounced means fk_pd_allocated_to set to null if smc vendor officer and manager role only + if (isset($pd_details['pd_status']) && ($pd_details['pd_status'] == "BOUNCED") && ($role == 28 || $role == 29)) { + $pd_details['fk_pd_allocated_to'] = null; + } $where_condition_array = array('pd_id' => $pd_details['pd_id'], 'random_string' => $pd_details['random_string']);