-- OPD Revenue Report --

SELECT
	pscd.created_at,
	sr.service_item_name,
	pscd.net_amount
FROM
	opd_doctor_appointments as oda
	INNER JOIN patient_service_charges psc ON oda.id = psc.service_source_id AND psc.billing_module_id = 3
	INNER JOIN patient_service_charge_details pscd ON pscd.patient_service_charge_id = psc.id
	INNER JOIN service_items sr ON sr.id = pscd.service_id
WHERE 
	DATE(oda.doctor_appointment_date) >= '2022-02-15' 
AND
	DATE(oda.doctor_appointment_date) <= '2022-02-17'
