This commit is contained in:
Gowtham M 2025-09-30 15:00:47 +05:30
parent 89af56b8aa
commit df1c339d1d

View File

@ -168,7 +168,12 @@ class QuotationController extends ResourceController
$this->QuotationModel->update($id, ['status' => $newStatus]);
//update enquiry status
$enquiryData = $this->EnquiryModel->where('id',$quotation['enquiry_id'])->where('status','Quotation Created')->first();
$enquiryData = $this->EnquiryModel->where('id',$quotation['enquiry_id'])
->groupStart()
->where('status', 'Quotation Created')
->orWhere('status', 'Quotation Rejected')
->groupEnd()
->first();
$enqStatus = 'Quotation '.$data['status'];
if (!empty($enquiryData)){
$this->EnquiryModel->update($quotation['enquiry_id'], ['status'=> $enqStatus]);