fees changes done
This commit is contained in:
parent
581ccd4cc5
commit
48c66c67da
@ -17,7 +17,7 @@ class Fees_status_model extends CI_Model
|
||||
public function getStudentList($search=null)
|
||||
{
|
||||
if($search['MobileNumber']!='' OR $search['Firstname']!='' OR $search['UniversityID']!='' OR $search['CourseID']!=''){
|
||||
$this->db->select('ST.StudentID,ST.MobileNumber,ST.Firstname,ST.Fathername,ST.EmailID,STC.ID,US.UniversityID,US.UniversityName,CU.CourseID,CU.CourseName,BA.BatchCode,BA.BatchName');
|
||||
$this->db->select('ST.StudentID,ST.MobileNumber,ST.Firstname,ST.Fathername,ST.EmailID,STC.ID,US.UniversityID,US.UniversityName,CU.CourseID,CU.CourseName,BA.BatchCode,BA.BatchName,BA.BatchDate');
|
||||
$this->db->from(STUDENTS.' as ST');
|
||||
$this->db->join(STUDENTCOURSE.' as STC', 'STC.StudentID = ST.StudentID');
|
||||
$this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID');
|
||||
@ -408,12 +408,14 @@ class Fees_status_model extends CI_Model
|
||||
} else {
|
||||
$this->db->insert(STUDENTS_FEES_PAID, $feesPaidDetails);
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
|
||||
$result['paidStatus'] = true;
|
||||
$result['message'] = "Successfully fees details added";
|
||||
$feesPayedID = $this->db->insert_id();
|
||||
// $entryOfCallTrack = $this->updateInCallTrack($trackDetails);
|
||||
// day book entry
|
||||
if($feesPaidDetails['ModeOfPayment']=='CASH' AND $feesPaidDetails['BillAmount']!='0'){
|
||||
$dayBookEntry = $this->insertDayBookMaster($feesPaidDetails);
|
||||
if($feesPaidDetails['BillAmount']!='0'){
|
||||
$dayBookEntry = $this->insertDayBookMaster($feesPaidDetails,$feesPayedID);
|
||||
}
|
||||
|
||||
|
||||
@ -632,6 +634,7 @@ class Fees_status_model extends CI_Model
|
||||
* created by kms
|
||||
* */
|
||||
public function getFeesStructureAssign($student=null){
|
||||
|
||||
$this->db->select('ID,CourseID,ProgramType,FeesAmount,Sem_Year');
|
||||
$this->db->where('CourseID',$student['CourseID']);
|
||||
$this->db->order_by('ProgramType');
|
||||
@ -640,7 +643,8 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
$result_array['feesStatus']=true;
|
||||
foreach ($feesDetails->result() as $row){
|
||||
$this->db->select('FeesID,CourseFees, STFOrWR,Waiver,Others,SessionName,RollNo');
|
||||
$this->db->select('FeesID,CourseFees, STFOrWR,Waiver,Others,SessionName,RollNo,BatchCode');
|
||||
|
||||
$this->db->where('StudentID',$student['StudentID']);
|
||||
$this->db->where('CourseID',$student['CourseID']);
|
||||
$this->db->where('FeesType',$row->ID);
|
||||
@ -651,6 +655,7 @@ class Fees_status_model extends CI_Model
|
||||
$fetchData['CourseID']=$row->CourseID;
|
||||
$fetchData['Sem_Year']=$row->Sem_Year;
|
||||
$fetchData['ActualFees']=$existData[0]->CourseFees;
|
||||
$fetchData['BatchCode']=$existData[0]->BatchCode;
|
||||
$fetchData['STFOrWR']=$existData[0]->STFOrWR;
|
||||
$fetchData['Waiver']=$existData[0]->Waiver;
|
||||
$fetchData['Others']=$existData[0]->Others;
|
||||
@ -659,6 +664,7 @@ class Fees_status_model extends CI_Model
|
||||
$fetchData['PayableFees']=$existData[0]->CourseFees+$existData[0]->STFOrWR+$existData[0]->Others-$existData[0]->Waiver;
|
||||
// for installment details
|
||||
$InstallemtResult = $this->getInstallmentDetails($existData[0]->FeesID);
|
||||
|
||||
if($InstallemtResult != false){
|
||||
$fetchData['InstallmentDetails']=$InstallemtResult;
|
||||
}
|
||||
@ -668,6 +674,13 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
|
||||
}
|
||||
$batchDetails = $this->getBatchDetails($existData[0]->BatchCode,$student['CourseID'],$student['StudentID'],$row->ID);
|
||||
if($batchDetails!=false){
|
||||
$fetchData['batchDetails']=$batchDetails;
|
||||
}
|
||||
else{
|
||||
$fetchData['batchDetails']="";
|
||||
}
|
||||
|
||||
$CourseFeesArray[]=$fetchData;
|
||||
|
||||
@ -676,8 +689,10 @@ class Fees_status_model extends CI_Model
|
||||
$fetchData['ExistValue']=0;
|
||||
$fetchData['ID']=$row->ID;
|
||||
$fetchData['CourseID']=$row->CourseID;
|
||||
|
||||
$fetchData['Sem_Year']=$row->Sem_Year;
|
||||
$fetchData['ActualFees']=$row->FeesAmount;
|
||||
$fetchData['BatchCode']="";
|
||||
$fetchData['STFOrWR']="";
|
||||
$fetchData['Waiver']="";
|
||||
$fetchData['Others']="";
|
||||
@ -686,6 +701,13 @@ class Fees_status_model extends CI_Model
|
||||
$fetchData['PayableFees']=$row->FeesAmount;
|
||||
// for installment details
|
||||
$fetchData['InstallmentDetails']="";
|
||||
$batchDetails = $this->getBatchDetails('',$student['CourseID'],$student['StudentID'],'');
|
||||
if($batchDetails!=false){
|
||||
$fetchData['batchDetails']=$batchDetails;
|
||||
}
|
||||
else{
|
||||
$fetchData['batchDetails']="";
|
||||
}
|
||||
|
||||
$CourseFeesArray[]=$fetchData;
|
||||
|
||||
@ -708,6 +730,7 @@ class Fees_status_model extends CI_Model
|
||||
else{
|
||||
$result_array['feesStatus']=false;
|
||||
}
|
||||
|
||||
return $result_array;
|
||||
|
||||
}
|
||||
@ -729,6 +752,68 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* get batch details
|
||||
* created by kms
|
||||
* */
|
||||
public function getBatchDetails($batchCode=null,$courseID=null,$studentID=null,$feesType=null){
|
||||
if($batchCode=='' OR $batchCode==null){
|
||||
$this->db->select('BA.BatchCode,BA.BatchName,BA.BatchDate,US.UniversityID,US.UniversityName,BA.IsActive');
|
||||
$this->db->from(COURSE.' as CU');
|
||||
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = CU.UniversityID');
|
||||
$this->db->join(BATCH.' as BA', 'BA.UniversityID = US.UniversityID');
|
||||
$this->db->order_by('BA.CreatedOn','DESC');
|
||||
$this->db->where('CU.CourseID',$courseID);
|
||||
$this->db->where('BA.IsActive','1');
|
||||
$batchDetails = $this->db->get();
|
||||
if($batchDetails->result()){
|
||||
|
||||
return $batchDetails->result();
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
|
||||
$this->db->distinct();
|
||||
$this->db->select('BA.BatchCode,BA.BatchName,BA.BatchDate,US.UniversityID,US.UniversityName,BA.IsActive');
|
||||
$this->db->from(COURSE.' as CU');
|
||||
$this->db->join(STUDENTS_FEES_STATUS.' as STF', 'STF.CourseID = CU.CourseID');
|
||||
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = CU.UniversityID');
|
||||
$this->db->join(BATCH.' as BA', 'BA.UniversityID = US.UniversityID');
|
||||
$this->db->order_by('BA.CreatedOn','DESC');
|
||||
$this->db->where('CU.CourseID',$courseID);
|
||||
$this->db->where('STF.StudentID',$studentID);
|
||||
$this->db->where('STF.FeesType',$feesType);
|
||||
$batchDetails = array();
|
||||
|
||||
/* $this->db->or_where('BA.IsActive','1');
|
||||
$this->db->or_where('STF.BatchCode =',$batchCode);*/
|
||||
$existDetails = $this->db->get();
|
||||
if($existDetails->result()){
|
||||
foreach ($existDetails->result() as $row){
|
||||
if($row->IsActive=='1' || $row->BatchCode==$batchCode){
|
||||
array_push($batchDetails,$row);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($batchDetails){
|
||||
|
||||
return $batchDetails;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* get default pc,tc,dc,mc,other fees
|
||||
* created by kms
|
||||
@ -803,6 +888,7 @@ class Fees_status_model extends CI_Model
|
||||
|
||||
|
||||
}
|
||||
|
||||
$CourseFeesArray1[]=$fetchData;
|
||||
|
||||
}
|
||||
@ -948,31 +1034,92 @@ class Fees_status_model extends CI_Model
|
||||
* insert day book master while fees update
|
||||
* created by kms
|
||||
* */
|
||||
public function insertDayBookMaster($data=null){
|
||||
$insertArray['Date'] = $data['BillDate'];
|
||||
$insertArray['CreatedBy'] = $data['CreatedBy'];
|
||||
$insertArray['CreatedOn'] = $data['CreatedOn'];
|
||||
$insertArray['Description'] = $data['InternalComments'];
|
||||
$insertArray['Amount'] = $data['BillAmount'];
|
||||
$insertArray['Status'] = 'Approved';
|
||||
public function insertDayBookMaster($data=null,$paymentID){
|
||||
if($data['ModeOfPayment']=='CASH'){
|
||||
$insertArray['Date'] = $data['BillDate'];
|
||||
$insertArray['CreatedBy'] = $data['CreatedBy'];
|
||||
$insertArray['CreatedOn'] = $data['CreatedOn'];
|
||||
$insertArray['Description'] = $data['InternalComments'];
|
||||
$insertArray['Amount'] = $data['BillAmount'];
|
||||
$insertArray['Status'] = 'Approved';
|
||||
$insertArray['PaymentStatus'] = false;
|
||||
$insertArray['FeesPaymentID'] = $paymentID;
|
||||
|
||||
$insertArray['BranchCode'] = $data['UpdatedBy'];
|
||||
$insertArray['BranchCode'] = $data['UpdatedBy'];
|
||||
|
||||
$this->db->select('ID,TypeID');
|
||||
$this->db->where('TypeID', 'I002');
|
||||
$this->db->where('TypeName', 'FEES');
|
||||
$getIncome=$this->db->get(INCOMEOUTCOMEMASTER)->last_row();
|
||||
$this->db->select('ID,TypeID');
|
||||
$this->db->where('TypeID', 'I002');
|
||||
$this->db->where('TypeName', 'FEES');
|
||||
$getIncome=$this->db->get(INCOMEOUTCOMEMASTER)->last_row();
|
||||
|
||||
if($getIncome){
|
||||
$insertArray['Name'] = $getIncome->TypeID;
|
||||
$insertArray['Type'] = $getIncome->ID;
|
||||
$this->db->insert(DAYBOOKMASTER, $insertArray);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return true;
|
||||
}
|
||||
|
||||
if($getIncome){
|
||||
$insertArray['Name'] = $getIncome->TypeID;
|
||||
$insertArray['Type'] = $getIncome->ID;
|
||||
$this->db->insert(DAYBOOKMASTER, $insertArray);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
// this is for income entry
|
||||
$insertArray['Date'] = $data['BillDate'];
|
||||
$insertArray['CreatedBy'] = $data['CreatedBy'];
|
||||
$insertArray['CreatedOn'] = $data['CreatedOn'];
|
||||
$insertArray['Description'] = $data['InternalComments'];
|
||||
$insertArray['Amount'] = $data['BillAmount'];
|
||||
$insertArray['Status'] = 'Approved';
|
||||
$insertArray['PaymentStatus'] = false;
|
||||
$insertArray['FeesPaymentID'] = $paymentID;
|
||||
|
||||
$insertArray['BranchCode'] = $data['UpdatedBy'];
|
||||
|
||||
$this->db->select('ID,TypeID');
|
||||
$this->db->where('TypeID', 'I002');
|
||||
$this->db->where('TypeName', 'FEES');
|
||||
$getIncome=$this->db->get(INCOMEOUTCOMEMASTER)->last_row();
|
||||
|
||||
if($getIncome){
|
||||
$insertArray['Name'] = $getIncome->TypeID;
|
||||
$insertArray['Type'] = $getIncome->ID;
|
||||
$this->db->insert(DAYBOOKMASTER, $insertArray);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// this is for expense come entry
|
||||
|
||||
$expenseArray['Date'] = $data['BillDate'];
|
||||
$expenseArray['CreatedBy'] = $data['CreatedBy'];
|
||||
$expenseArray['CreatedOn'] = $data['CreatedOn'];
|
||||
$expenseArray['Description'] = $data['InternalComments'];
|
||||
$expenseArray['Amount'] = $data['BillAmount'];
|
||||
$expenseArray['Status'] = 'Approved';
|
||||
$expenseArray['PaymentStatus'] = false;
|
||||
$expenseArray['FeesPaymentID'] = $paymentID;
|
||||
|
||||
$expenseArray['BranchCode'] = $data['UpdatedBy'];
|
||||
|
||||
$this->db->select('ID,TypeID');
|
||||
$this->db->where('TypeID', 'I001');
|
||||
$this->db->where('TypeName', 'FEES');
|
||||
$getOutcome=$this->db->get(INCOMEOUTCOMEMASTER)->last_row();
|
||||
|
||||
if($getOutcome){
|
||||
$expenseArray['Name'] = $getOutcome->TypeID;
|
||||
$expenseArray['Type'] = $getOutcome->ID;
|
||||
$this->db->insert(DAYBOOKMASTER, $expenseArray);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
* send notification for student
|
||||
|
||||
Loading…
Reference in New Issue
Block a user