diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 41c13a88..d40c2e60 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -1216,47 +1216,41 @@ $query = $this->db->query($subQuery,array('%d-%m-%Y')); $end_date = $det['to']; - $fromd= date("Y-m-d",strtotime($start_date)); + $fromd= date("Y-m-d",strtotime($start_date)); $tod=date("Y-m-d",strtotime($end_date)); - //echo $det['branchId'];die() ; sum(a.BillAmount) AS Total, - - $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, - 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)).'"'); + $sql="SELECT distinct d.UniversityName,c.UniversityID, +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, a.CreatedOn +FROM T_Students_Fees_PaidDetails a +JOIN T_Students_Fees_Status b ON b.FeesId = a.FeesID and b.StudentID=a.StudentID +LEFT JOIN T_CourseMaster c ON c.CourseID = b.CourseID +left join T_UniversityMaster d on d.UniversityID=c.UniversityID and d.BranchCode = '".$det['branchId']."' - $this->db->where("date_format(a.CreatedOn,'%Y-%m-%d')>=",date('Y-m-d', strtotime($start_date))); +WHERE date_format(a.CreatedOn,'%Y-%m-%d') >= '".date('Y-m-d', strtotime($start_date))."' AND date_format(a.CreatedOn,'%Y-%m-%d') <= '".date('Y-m-d', strtotime($end_date))."' AND b.BranchCode = '".$det['branchId']."' AND a.IsActive = '1' "; - - - $this->db->where("date_format(a.CreatedOn,'%Y-%m-%d')<=",date('Y-m-d', strtotime($end_date))); - - $this->db->where('d.BranchCode',$det['branchId']); - - - - $this->db->where('a.IsActive','1'); - - if($det['university']!='') + if($det['university']!='') { - $this->db->where('d.UniversityID',$det['university']); + $sql.=" and c.UniversityID='".$det['university']."'"; + } - $this->db->group_by('UniversityID'); + $sql.=" GROUP BY c.UniversityID"; - $feeDetails = $this->db->get()->result(); +$res = $this->db->query($sql,array()); + +$result = $res->result(); + +$feeDetails = $result; + + + + // $feeDetails = $this->db->get()->result(); if($feeDetails) @@ -1273,8 +1267,8 @@ if($feeDetails) } - // print_r( $this->db->last_query()); - // die(); + //print_r( $this->db->last_query()); + //die(); return $result_array; diff --git a/Apollo/assets/js/controllers/FeeCollected_reportCtrl.js b/Apollo/assets/js/controllers/FeeCollected_reportCtrl.js index e3d18ea5..99c791cb 100644 --- a/Apollo/assets/js/controllers/FeeCollected_reportCtrl.js +++ b/Apollo/assets/js/controllers/FeeCollected_reportCtrl.js @@ -213,7 +213,9 @@ $scope.tod = to_dt; //console.log(newreglist) - $scope.Totalfee= parseFloat($scope.Totalfee)+ parseFloat(newreglist.Cash)+parseFloat(newreglist.Cheque)+parseFloat(newreglist.Onlinec)+parseFloat(newreglist.Card); + $scope.Totalfee= parseFloat($scope.Totalfee)+ parseFloat(newreglist.Cash)+ + parseFloat(newreglist.Cheque)+parseFloat(newreglist.Onlinec)+ + parseFloat(newreglist.Card)+parseFloat(newreglist.Referal)+parseFloat(newreglist.WAIVER); //console.log( $scope.Totalfee); }); diff --git a/Apollo/assets/views/feecollected.html b/Apollo/assets/views/feecollected.html index 757930ed..adb3ff8a 100644 --- a/Apollo/assets/views/feecollected.html +++ b/Apollo/assets/views/feecollected.html @@ -181,9 +181,11 @@ Online Transaction Credit/Debit Card + Waiver + Referral Total - Waiver - Referral + @@ -198,9 +200,11 @@ {{p.Onlinec}} {{p.Card}} - {{p.Card -- p.Cash -- p.Cheque -- p.Onlinec }} - {{p.WAIVER}} - {{p.Referal}} + {{p.WAIVER}} + {{p.Referal}} + {{p.Card -- p.Cash -- p.Cheque -- p.Onlinec -- p.WAIVER -- p.Referal}} + @@ -211,7 +215,7 @@ style="font-size:35px;" --> - Total + Total {{Totalfee}} diff --git a/Apollo/assets/views/login_login.html b/Apollo/assets/views/login_login.html index 20ddbce4..dece5aec 100755 --- a/Apollo/assets/views/login_login.html +++ b/Apollo/assets/views/login_login.html @@ -431,7 +431,7 @@
- Password Required