This commit is contained in:
resicovenba 2018-03-10 15:48:40 +05:30
commit 97b6357f1f
3 changed files with 126 additions and 36 deletions

View File

@ -144,8 +144,7 @@ class Fees_Status_Controller extends REST_Controller {
$detailsChild['CreatedBy'] = $this->post('createdBy');
$detailsChild['CreatedOn'] = $now->format('Y-m-d H:i:s');
$detailsChild['UpdatedBy'] = $this->post('requestedBranch');
$updateDetails = $this->Fees_model->updateFees($detailsChild);// Check if the users data store contains users (in case the database result returns NULL)
$updateDetails = $this->Fees_model->updateFees($detailsChild,$this->post('courseID'));// Check if the users data store contains users (in case the database result returns NULL)
if ($updateDetails)
{
$updateDetails['status'] = REST_Controller::HTTP_OK;

View File

@ -406,10 +406,6 @@ class Fees_status_model extends CI_Model
$feesPaidDetails['UpdatedBy'] = $getStudentBranch[0]->BranchID;
}
// $this->entryForAllStatus($feesPaidDetails,$courseID);
// die();
$this->db->select('BillNO');
$this->db->where('UpdatedBy', $feesPaidDetails['UpdatedBy']);
@ -457,6 +453,7 @@ class Fees_status_model extends CI_Model
}
// Entry for all status screen except fees
$this->entryForAllStatus($feesPaidDetails,$courseID);
@ -1565,37 +1562,126 @@ class Fees_status_model extends CI_Model
* */
public function entryForAllStatus($feesDetails=null,$courseID=null){
$singleFeesDetails=["SEM1","SEM2","SEM3","SEM4","SEM5","SEM6","SEM7","SEM8"];
$this->db->select('SFS.FeesID');
$this->db->from(STUDENTS_FEES_PAID.' as SFP');
$this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.FeesID = SFP.FeesId');
$this->db->where('SFS.CourseID',$courseID);
$this->db->where('SFS.StudentID',$feesDetails['StudentID']);
$existDetails = $this->db->get();
if($existDetails->result()){
return true;
}
else{
$this->db->select('ID,FeesType,ProgramType');
$this->db->where('CourseID',$courseID);
$getFeesTypeDetails = $this->db->get(COURSE_FEES);
// get pick list expected status
$this->db->select('ListCode,ListName');
$this->db->where('ListName','EXPECTED');
$this->db->where('IsActive','1');
$existStatusDetails = $this->db->get(PICK_LIST_DETAILS)->last_row();
if($existStatusDetails){
//check if exist
$this->db->select('SFS.FeesID,SFS.FeesType');
$this->db->from(STUDENTS_FEES_PAID.' as SFP');
$this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.FeesID = SFP.FeesId');
$this->db->where('SFS.CourseID',$courseID);
$this->db->where('SFS.StudentID',$feesDetails['StudentID']);
$this->db->where('SFP.FeesId',$feesDetails['FeesId']);
$existDetails = $this->db->get();
if($existDetails->num_rows()>1){
return true;
}
else{
$fetchData = $existDetails->result();
if($fetchData[0]->FeesType!=PC AND $fetchData[0]->FeesType!=DC AND $fetchData[0]->FeesType!=TC AND $fetchData[0]->FeesType!=MC AND $fetchData[0]->FeesType!=OTHER) {
$this->db->select('SFS.FeesType,CF.Sem_Year,CF.ProgramType');
$this->db->from(STUDENTS_FEES_STATUS.' as SFS');
$this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType');
$this->db->where('SFS.CourseID',$courseID);
$this->db->where('SFS.StudentID',$feesDetails['StudentID']);
$this->db->where('SFS.FeesID',$feesDetails['FeesId']);
$getFeesTypeDetails = $this->db->get();
if($getFeesTypeDetails->result()){
$insertDetails=array();
foreach ($getFeesTypeDetails->result() as $row){
// this array for study material and answer booklet update
$insertStudyBook['StudentID']=$feesDetails['StudentID'];
$insertStudyBook['CourseID']=$row->FeesType;
$insertStudyBook['BranchCode']=$feesDetails['UpdatedBy'];
$insertStudyBook['ListCode']=$existStatusDetails->ListCode;
$insertStudyBook['Comments']=$feesDetails['CommentsForStudent'];
$insertStudyBook['Coursedetail']=$feesDetails['StudentID'];
$insertStudyBook['CreatedBy']=$feesDetails['CreatedBy'];
$insertStudyBook['CreatedOn']=$feesDetails['CreatedOn'];
// this array for mark card updates
$insertMark['StudentID']=$feesDetails['StudentID'];
$insertMark['CourseID']=$row->FeesType;
$insertMark['BranchCode']=$feesDetails['UpdatedBy'];
$insertMark['ListCode']=$existStatusDetails->ListCode;
$insertMark['Comments']=$feesDetails['CommentsForStudent'];
$insertMark['Coursedetail']=$feesDetails['StudentID'];
$insertMark['CreatedBy']=$feesDetails['CreatedBy'];
$insertMark['CreatedOn']=$feesDetails['CreatedOn'];
$insertMark['CertificationType']="MARK CARD";
if($row->ProgramType==REGULARFEES OR $row->ProgramType==LATERALFEES){
foreach ($singleFeesDetails as $Fees){
$insertStudyBook['Sem']=$Fees;
// insert study material details
$this->db->insert(STUDY_MATERIAL_STATUS, $insertStudyBook);
// insert answer booklet details
$this->db->insert(ANSWER_BOOKLET, $insertStudyBook);
// insert mark card details
$insertMark['Sem']=$Fees;
$this->db->insert(CERTIFICATION_STATUS, $insertMark);
}
}
else{
$insertStudyBook['Sem']=$row->Sem_Year;
// insert study material details
$this->db->insert(STUDY_MATERIAL_STATUS, $insertStudyBook);
// insert answer booklet details
$this->db->insert(ANSWER_BOOKLET, $insertStudyBook);
// insert mark card details
$insertMark['Sem']=$row->Sem_Year;
$this->db->insert(CERTIFICATION_STATUS, $insertMark);
}
}
}
}
else{
$this->db->select('CertificationID');
$this->db->where('CertificateName',$fetchData[0]->FeesType);
$this->db->where('IsActive','1');
$getEndFeesDetails = $this->db->get(CERTIFICATION_MASTER)->last_row();
if($getEndFeesDetails){
// this array for document update
$insertDocs['StudentID']=$feesDetails['StudentID'];
$insertDocs['CourseID']=$courseID;
$insertDocs['BranchCode']=$feesDetails['UpdatedBy'];
$insertDocs['ListCode']=$existStatusDetails->ListCode;
$insertDocs['Comments']=$feesDetails['CommentsForStudent'];
$insertDocs['CreatedBy']=$feesDetails['CreatedBy'];
$insertDocs['CreatedOn']=$feesDetails['CreatedOn'];
$insertDocs['CertificationType']=$getEndFeesDetails->CertificationID;
// insert application details
$this->db->insert(APPLICATION_STATUS,$insertDocs);
}
if($getFeesTypeDetails->result()){
foreach ($getFeesTypeDetails->result() as $row){
if($row->ProgramType==REGULARFEES OR $row->ProgramType==LATERALFEES){
$insertDetails['StudentID']=$feesDetails['StudentID'];
$insertDetails['CourseID']=$row->ID;
$insertDetails['BranchCode']="";
$insertDetails['ListCode']="";
$insertDetails['StudentID']="";
}
}
}
return true;
}
else{
return false;
}
}

View File

@ -196,7 +196,7 @@
</div>
</div>
</div>
<div class="row" ng-repeat="course in courseDetails.courseStatus">
<div class="col-md-12">
<div class="panel panel-white" id="panel2">
@ -208,7 +208,7 @@
<h4 class="panel-title text-purple">{{course.UniversityName}} / {{course.CourseName}}</h4>
-->
<a class="panel-title text-blue" tooltip="University">
<h3>{{course.UniversityName}}</h3>
<h3>{{course.UniversityName}}</h3>
</a>
</div>
</div>
@ -253,6 +253,7 @@
<thead>
<tr>
<th>Fees Name</th>
<th>Batch</th>
<th ng-if="course.feesDetails[0].ProgramType=='P001' || course.feesDetails[0].ProgramType=='P002'">Session From/Session To</th>
<th ng-if="course.feesDetails[0].ProgramType=='Y001'">Session</th>
<th>Roll Number</th>
@ -267,7 +268,11 @@
<tbody>
<tr ng-repeat="fees in course.feesDetails">
<td>
<span>{{fees.FeesName}}</span></td>
<span>{{fees.FeesName}}</span>
</td>
<td>
<span>{{fees.BatchName}}</span><span ng-if="fees.BatchDate!='' && fees.BatchDate!=null">&nbsp;({{fees.BatchDate}})</span>
</td>
<td ng-if="course.feesDetails[0].ProgramType=='P001' || course.feesDetails[0].ProgramType=='P002'">{{fees.SessionName}}/{{fees.ToSessionName}}</td>
<td ng-if="course.feesDetails[0].ProgramType=='Y001'">{{fees.SessionName}}</td>
<td>
@ -382,7 +387,7 @@
<span>{{cert.CertificateName}}</span>
</td>
<td>
<span>{{cert.ListName}} </span><span> &nbsp; ON &nbsp;</span> <span>{{cert.AppDate}}</span>
<span>{{cert.ListName}} </span><span ng-if="cert.AppDate!='' && cert.AppDate!=null">&nbsp; ON &nbsp;</span> <span>{{cert.AppDate}}</span>
</td>
<td>
<span>{{cert.Comments}}</span>
@ -428,7 +433,7 @@
<span>{{mark.CertificateName}}</span>
</td>-->
<td>
<span>{{mark.ListName}} </span><span> &nbsp; ON &nbsp;</span> <span>{{mark.CDate}}</span>
<span>{{mark.ListName}} </span><span ng-if="mark.CDate!='' && mark.CDate!=null"> &nbsp; ON &nbsp;</span> <span>{{mark.CDate}}</span>
</td>
<td>
<span>{{mark.Comments}}</span>
@ -448,7 +453,7 @@
<span>{{mark.CertificateName}}</span>
</td>-->
<td>
<span>{{mark.ListName}} </span><span> &nbsp; ON &nbsp;</span> <span>{{mark.CDate}}</span>
<span>{{mark.ListName}} </span><span ng-if="mark.CDate!='' && mark.CDate!=null">&nbsp; ON &nbsp;&nbsp;</span> <span>{{mark.CDate}}</span>
</td>
<td>
<span>{{mark.Comments}}</span>
@ -492,7 +497,7 @@
<!--<td>
<span>{{study.SDate}}</span></td>-->
<td>
<span>{{study.ListName}} </span><span> &nbsp; ON &nbsp;</span> <span>{{study.SDate}}</span>
<span>{{study.ListName}} </span><span ng-if="study.SDate!='' && study.SDate!=null">&nbsp; ON &nbsp;</span> <span>{{study.SDate}}</span>
</td>
<td>
<span>{{study.Comments}}</span></td>
@ -507,7 +512,7 @@
<!--<td>
<span>{{study.SDate}}</span></td>-->
<td>
<span>{{study.ListName}} </span><span> &nbsp; ON &nbsp;</span> <span>{{study.SDate}}</span>
<span>{{study.ListName}} </span><span ng-if="study.SDate!='' && study.SDate!=null">&nbsp; ON &nbsp;&nbsp;</span> <span>{{study.SDate}}</span>
</td>
<td>
<span>{{study.Comments}}</span></td>