course details changes done
This commit is contained in:
parent
8748488671
commit
f074806d17
@ -128,14 +128,78 @@ class Studentview_model extends CI_Model
|
||||
|
||||
}
|
||||
|
||||
$getStudentDefaultFees = $this->getDefaultCourseFees($studentID,$courseID);
|
||||
if($getStudentDefaultFees != false){
|
||||
return array_merge($mergeResult,$getStudentDefaultFees);
|
||||
}
|
||||
else{
|
||||
return$mergeResult;
|
||||
}
|
||||
|
||||
return $mergeResult;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* get default course details
|
||||
* created by kms
|
||||
* */
|
||||
public function getDefaultCourseFees($studentID=null,$courseID=null){
|
||||
$serachArray = ["PC","TC","DC","MC","OTHER"];
|
||||
$this->db->distinct();
|
||||
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.SessionName,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');
|
||||
$this->db->from(STUDENTS_FEES_STATUS.' as SFS');
|
||||
$this->db->join(STUDENTS_FEES_PAID.' as SFP','SFP.FeesId = SFS.FeesID','left');
|
||||
//$this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType');
|
||||
$this->db->where('SFS.CourseID', $courseID);
|
||||
$this->db->where('SFS.StudentID', $studentID);
|
||||
$this->db->where_in('SFS.FeesType', $serachArray);
|
||||
$this->db->order_by('SFS.FeesID', 'ASC');
|
||||
$getFeeDetails = $this->db->get();
|
||||
if($getFeeDetails->result()){
|
||||
foreach ($getFeeDetails->result() as $feeRow){
|
||||
$storePaidDetails['FeesID'] = $feeRow->FeesID;
|
||||
$storePaidDetails['FeesName'] = $feeRow->FeesType;
|
||||
$storePaidDetails['CourseFees'] = $feeRow->CourseFees;
|
||||
$storePaidDetails['SessionName'] = $feeRow->SessionName;
|
||||
$storePaidDetails['RollNo'] = $feeRow->RollNo;
|
||||
$storePaidDetails['STFOrWR'] = $feeRow->STFOrWR;
|
||||
$storePaidDetails['Waiver'] = $feeRow->Waiver;
|
||||
$storePaidDetails['Others'] = $feeRow->Others;
|
||||
$storePaidDetails['PayableAmount'] = $feeRow->CourseFees+$feeRow->STFOrWR+$feeRow->Others-$feeRow->Waiver;
|
||||
|
||||
$this->db->select('ifnull(SUM((BillAmount)),0) as PaidBillAmount');
|
||||
$this->db->where('FeesId',$feeRow->FeesID);
|
||||
$paidBillAmount = $this->db->get(STUDENTS_FEES_PAID)->result();
|
||||
$storePaidDetails['PaidBillAmount']=$paidBillAmount[0]->PaidBillAmount;
|
||||
if($paidBillAmount[0]->PaidBillAmount > $storePaidDetails['PayableAmount']){
|
||||
$storePaidDetails['BalanceAmount']=0;
|
||||
|
||||
}
|
||||
else{
|
||||
$storePaidDetails['BalanceAmount']=$storePaidDetails['PayableAmount'] - $paidBillAmount[0]->PaidBillAmount;
|
||||
}
|
||||
|
||||
// for get paid bill details
|
||||
$this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment');
|
||||
$this->db->where('FeesId',$feeRow->FeesID);
|
||||
$this->db->order_by('ID',"ASC");
|
||||
$this->db->group_by('BillNO');
|
||||
$storePaidDetails['paidDetails']=$this->db->get(STUDENTS_FEES_PAID)->result();
|
||||
$mergeResult[]=$storePaidDetails;
|
||||
|
||||
}
|
||||
|
||||
return $mergeResult;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* get student study material details
|
||||
* created by kms
|
||||
|
||||
Loading…
Reference in New Issue
Block a user