diff --git a/app/Controllers/EnquiryController.php b/app/Controllers/EnquiryController.php index e8043aa..c3f3f4a 100644 --- a/app/Controllers/EnquiryController.php +++ b/app/Controllers/EnquiryController.php @@ -291,9 +291,11 @@ class EnquiryController extends ResourceController // trigger_email('enquiry_created', ['enquiry_id' => $enquiryId]); // QUOTATION MULTIPLE INSERT LOGIC - if ($isStaff == 1 && $isQuick == 1 && !empty($data['quotation']) && is_array($data['quotation'])) + if ($isStaff == 1 && $isQuick == 1 && !empty($data['quotation']) && is_string($data['quotation']) ) { - foreach ($data['quotation'] as $q) { + + $quotationArray = json_decode($data['quotation'], true); + foreach ($quotationArray as $q) { //get insurer_branch_id if(isset($q['insurer_id'])) @@ -317,6 +319,7 @@ class EnquiryController extends ResourceController $this->QuotationModel->insert($quotationData); } + $this->enquiryModel->update($enquiryId, [ 'status' => 'Proposal Created' ]); } else if ($isStaff == 1 && $isQuick == 0) {