invoice
This commit is contained in:
parent
b04880d896
commit
ef7a7ec345
@ -102,7 +102,7 @@ class EnquiryController extends ResourceController
|
||||
}
|
||||
|
||||
//Get enquiry details
|
||||
$enquiry = $this->enquiryModel->select('partner_enquiry.* , I.name as insurer_name , I.short_name , VT.vehicle_type as vehicle_type,PB.name as broker_name ,PA.name as agent_name')
|
||||
$enquiry = $this->enquiryModel->select('partner_enquiry.* , I.name as insurer_name , I.short_name , VT.vehicle_type as vehicle_type,pe.broker_id ,PB.name as broker_name ,PA.name as agent_name')
|
||||
->join('insurers I', 'I.id = partner_enquiry.insurer_id', 'left')
|
||||
->join('vehicle_type VT', 'VT.id = partner_enquiry.vehicle_type_id', 'left')
|
||||
->join('partner_brokers PB', 'PB.id = partner_enquiry.broker_id', 'left')
|
||||
@ -116,7 +116,7 @@ class EnquiryController extends ResourceController
|
||||
}
|
||||
|
||||
//Get related quotations
|
||||
$quotations = $this->QuotationModel->select('partner_quotation.*, pe.reg_no , I.name as insurer_name, I.short_name , ipti.insurance_plan_type,PB.name as broker_name,PA.name as agent_name' )
|
||||
$quotations = $this->QuotationModel->select('partner_quotation.*, pe.reg_no , I.name as insurer_name, I.short_name , ipti.insurance_plan_type,pe.broker_id ,PB.name as broker_name,PA.name as agent_name' )
|
||||
->join('partner_enquiry pe', 'pe.id = partner_quotation.enquiry_id', 'left')
|
||||
->join('insurers I', 'I.id = partner_quotation.insurer_id', 'left')
|
||||
->join('partner_insurance_plan_type_master ipti', 'ipti.id = partner_quotation.insurance_plan_type_id', 'left')
|
||||
|
||||
@ -59,7 +59,15 @@ class InvoiceController extends ResourceController
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => 'Invoice not found'], 404);
|
||||
}
|
||||
|
||||
$items = $this->InvoiceItemModel->where('invoice_id', $id)->where('is_active', 1)->findAll();
|
||||
$items = $this->InvoiceItemModel->select('partner_invoice_items.* , pp.issued_date , pe.name as customer_name , pq.premium_amount')
|
||||
->join('partner_policy pp','pp.id = partner_invoice_items.policy_id ', 'left')
|
||||
->join('partner_enquiry pe','pe.id = pp.enquiry_id ', 'left')
|
||||
->join('partner_quotation pq','pq.id = pp.quotation_id ', 'left')
|
||||
->where('partner_invoice_items.invoice_id', $id)
|
||||
->where('partner_invoice_items.is_active', 1)
|
||||
->findAll();
|
||||
|
||||
|
||||
|
||||
return $this->respond([
|
||||
'status' => 'success',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user