From cb2fa885fccc6f537c8e7fef7fa4048970edf604 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 30 Mar 2018 15:06:26 +0530 Subject: [PATCH] student view model changed for waiver and ref bill --- .../application/models/Studentview_model.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php index 9d031631..4dfa717f 100755 --- a/Apollo/api/application/models/Studentview_model.php +++ b/Apollo/api/application/models/Studentview_model.php @@ -123,6 +123,8 @@ class Studentview_model extends CI_Model * created by kms * */ public function getStudentFeesDetails($studentID=null,$courseID=null){ + $serachArray=[WAIVER,REFERRAL]; + $this->db->distinct(); $this->db->select('SFS.FeesID,SFS.FeesType,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,CF.Sem_Year,CF.FeesType as CourseFeesType,SM.SessionName,SM1.SessionName as ToSessionName,CF.ProgramType,BA.BatchName,BA.BatchDate'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); @@ -167,6 +169,22 @@ class Studentview_model extends CI_Model else{ $storePaidDetails['BalanceAmount']=$storePaidDetails['PayableAmount'] - $paidBillAmount[0]->PaidBillAmount; } + + // sepearte for student waiver and referral bill list + $this->db->select('ifnull(SUM((BillAmount)),0) as StudentWaiverRefAmount'); + $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where_in('ModeOfPayment',$serachArray); + $studentWaiverRefAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); + + $storePaidDetails['StudentWaiverRefAmount']=$studentWaiverRefAmount[0]->StudentWaiverRefAmount; + + $this->db->select('ifnull(SUM((BillAmount)),0) as StudentPaidAmount'); + $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where('ModeOfPayment !=',WAIVER); + $this->db->where('ModeOfPayment !=',REFERRAL); + $studentPaidAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); + + $storePaidDetails['StudentPaidAmount']=$studentPaidAmount[0]->StudentPaidAmount; $storePaidDetails['BatchName'] = $feeRow->BatchName; $storePaidDetails['BatchDate'] = $feeRow->BatchDate;