From 69069950bedfbccf1c0f43dd8623eec3e6c3b6c8 Mon Sep 17 00:00:00 2001 From: sriramv Date: Wed, 23 Jan 2019 17:45:43 +0530 Subject: [PATCH] 0001613: Issue in Certificate and 0001628: Total Balance --- Apollo/api/application/models/Dashboard_model.php | 6 ++++-- Apollo/api/application/models/Reports_model.php | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Apollo/api/application/models/Dashboard_model.php b/Apollo/api/application/models/Dashboard_model.php index a3ad1b3b..94b170b5 100755 --- a/Apollo/api/application/models/Dashboard_model.php +++ b/Apollo/api/application/models/Dashboard_model.php @@ -752,6 +752,8 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to GROUP BY std.AdmittedBy , bcode) b group by bcode ORDER BY BDate DESC) final"; $ltd=$this->db->query($sql); + + //print_r($sql); $tlead = $ltd->result(); if (count($tlead) > 0) { $results['lList'] = true; @@ -789,8 +791,8 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to LEFT JOIN T_StudentDetails std ON std.StudentID = a.StudentID LEFT JOIN T_StaffDetails sd ON sd.StaffID = std.AdmittedBy LEFT JOIN T_BatchMaster bm ON bm.BatchCode = a.BatchCode - where a.BranchCode = '".$branchId."' and a.BatchCode != 'Not applicable' - GROUP BY std.AdmittedBy , bcode) b where uid = '".$univ."' "; + where a.BranchCode = '".$branchId."' and bm.UniversityID = '".$univ."' and a.BatchCode != 'Not applicable' + GROUP BY std.AdmittedBy , bcode) b "; // if($univ != ''){ // $sql.= " where uid = '".$univ."' "; diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 2ec0389d..92537820 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -208,7 +208,7 @@ union SELECT app.ID,app.StudentID as sid,app.CourseID as cid,app.BranchCode as branch,app.ListCode as lcode,p.ListName as status,AppDate as adate,app.Comments as acmts,CertificationType as ctype,app.CertificationType as certname,sum(bal.balpayable) as balance FROM T_ApplicationStatus as app left join T_PickListDetails p on p.ListCode = app.ListCode - left join BalFees bal on bal.student=app.StudentID and bal.course=app.CourseID + left join BalFees bal on bal.student=app.StudentID and bal.course=app.CourseID and bal.feestype = app.CertificationType where app.CertificationType not like 'CERT%' and app.ID IN (SELECT max(ID) FROM T_ApplicationStatus group by StudentID,CourseID,BranchCode,CertificationType) group by app.ID) as sms left join @@ -267,6 +267,9 @@ left join } $sql.=" group by Student_id,cid,ctype"; // echo $sql; + + //print_r($sql); + $leadDet=$this->db->query($sql); $cert_statusDetails = $leadDet->result(); if (count($cert_statusDetails) > 0) { @@ -1059,7 +1062,8 @@ from T_Lead_Tracking_Followup as ltf $result['universityName'] = ""; $result['batchDetails']= ""; } - +// print_r( $this->db->last_query()); +// die(); return $result;