diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 7907a74d..8cb78217 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -916,46 +916,42 @@ $query = $this->db->query($subQuery,array(NEWREGISTRATION_CONST,'%d-%m-%Y',$from //echo $det['university'];die() ; - $this->db->select('T_Student_CourseDetails.UniversityID,UniversityName, - SUM(IF(ModeOfPayment ="CASH", BillAmount, 0)) AS Cash, - SUM(IF(ModeOfPayment ="CHEQUE",BillAmount, 0)) AS Cheque, - SUM(IF(ModeOfPayment ="REFERRAL", BillAmount, 0)) AS Referal, - SUM(IF(ModeOfPayment ="ONLINE TRANSACTION",BillAmount, 0)) AS Onlinec, - SUM(IF(ModeOfPayment ="WAIVER",BillAmount, 0)) AS WAIVER, - SUM(IF(ModeOfPayment ="Credit/Debit Card",BillAmount, 0)) AS Card, - SUM(T_Students_Fees_PaidDetails.BillAmount) AS Total'); - $this->db->from('T_Students_Fees_PaidDetails'); - $this->db->join('T_Student_CourseDetails','T_Student_CourseDetails.StudentID=T_Students_Fees_PaidDetails.StudentID'); - $this->db->join('T_UniversityMaster','T_UniversityMaster.UniversityID=T_Student_CourseDetails.UniversityID'); + $this->db->select('d.UniversityID,UniversityName, + sum(IF(ModeOfPayment ="CASH", BillAmount, 0)) AS Cash, + sum(IF(ModeOfPayment ="CHEQUE", BillAmount, 0)) AS Cheque, + sum(IF(ModeOfPayment ="REFERRAL", BillAmount, 0)) AS Referal, + sum(IF(ModeOfPayment ="ONLINE TRANSACTION", BillAmount, 0)) AS Onlinec, + sum(IF(ModeOfPayment ="WAIVER",BillAmount, 0)) AS WAIVER, + sum(IF(ModeOfPayment ="Credit/Debit Card",BillAmount, 0)) AS Card, + sum(a.BillAmount) AS Total,a.CreatedOn'); + $this->db->from('T_Students_Fees_PaidDetails a'); + $this->db->join('T_Students_Fees_Status b','b.FeesId = a.FeesID','left'); + $this->db->join('T_CourseMaster c','c.CourseID = b.CourseID','left'); + $this->db->join('T_UniversityMaster d','d.UniversityID=c.UniversityID','left'); + // $this->db->where('T_Students_Fees_PaidDetails.CreatedOn BETWEEN "'.date('Y-m-d', strtotime($start_date)). '" and "'. date('Y-m-d', strtotime($end_date)).'"'); - $this->db->where("date_format(T_Students_Fees_PaidDetails.CreatedOn,'%Y-%m-%d')>=",date('Y-m-d', strtotime($start_date))); + $this->db->where("date_format(a.CreatedOn,'%Y-%m-%d')>=",date('Y-m-d', strtotime($start_date))); - $this->db->where("date_format(T_Students_Fees_PaidDetails.CreatedOn,'%Y-%m-%d')<=",date('Y-m-d', strtotime($end_date))); + $this->db->where("date_format(a.CreatedOn,'%Y-%m-%d')<=",date('Y-m-d', strtotime($end_date))); - - // $this->db->where(' BillDate <= str_to_date("'.$end_date.'",%d-%m-%Y)'); - - + - $this->db->where('T_Students_Fees_PaidDetails.IsActive','1'); + $this->db->where('a.IsActive','1'); if($det['university']!='') { - $this->db->where('T_Student_CourseDetails.UniversityID',$det['university']); + $this->db->where('d.UniversityID',$det['university']); } $this->db->group_by('UniversityID'); $feeDetails = $this->db->get()->result(); - // print_r( $this->db->last_query()); - // die(); - - // print_r($feeDetails); + if($feeDetails) { diff --git a/Apollo/assets/views/feecollected.html b/Apollo/assets/views/feecollected.html index e2c12846..783e7ec4 100644 --- a/Apollo/assets/views/feecollected.html +++ b/Apollo/assets/views/feecollected.html @@ -112,7 +112,7 @@