bug fixes and Changes : ps

This commit is contained in:
Sanjeev 2020-12-15 22:31:26 +05:30
parent 1be9249ef4
commit 973c3cb230
8 changed files with 232 additions and 169 deletions

View File

@ -74,7 +74,7 @@ class Report extends REST_Controller {
if(!empty($result)){$getStatus['markcardstatus'] = $result; if(!empty($result)){$getStatus['markcardstatus'] = $result;
$cnt = count($getStatus['markcardstatus']); $cnt = count($getStatus['markcardstatus']);
$getStatus['markcardstatus'][$cnt+1]["ListCode"] = "blank"; $getStatus['markcardstatus'][$cnt+1]["ListCode"] = FEESUPDATE;
$getStatus['markcardstatus'][$cnt+1]["ListName"] = "BLANK"; $getStatus['markcardstatus'][$cnt+1]["ListName"] = "BLANK";
$getStatus['markcardstatus'][$cnt+1]["StudentActivityCode"]= 'C001'; $getStatus['markcardstatus'][$cnt+1]["StudentActivityCode"]= 'C001';
} }
@ -134,7 +134,7 @@ class Report extends REST_Controller {
if(!empty($result)){$getStatus['certificatestatus'] = $result; if(!empty($result)){$getStatus['certificatestatus'] = $result;
$cnt = count($getStatus['certificatestatus']); $cnt = count($getStatus['certificatestatus']);
$getStatus['certificatestatus'][$cnt+1]["StudentActivityCode"]= 'A001'; $getStatus['certificatestatus'][$cnt+1]["StudentActivityCode"]= 'A001';
$getStatus['certificatestatus'][$cnt+1]["ListCode"] = "blank"; $getStatus['certificatestatus'][$cnt+1]["ListCode"] = FEESUPDATE;
$getStatus['certificatestatus'][$cnt+1]["ListName"] = "BLANK"; $getStatus['certificatestatus'][$cnt+1]["ListName"] = "BLANK";
} }
else{ $getStatus['certificatestatus'] = array();} else{ $getStatus['certificatestatus'] = array();}

View File

@ -500,7 +500,10 @@ class Fees_status_model extends CI_Model
public function updateFees($feesPaidDetails=null,$courseID=null,$feesName=null,$smsDetails=null) public function updateFees($feesPaidDetails=null,$courseID=null,$feesName=null,$smsDetails=null)
{ {
// print_r($feesPaidDetails);
// echo $courseID;
// echo $feesName;
// die();
if($feesPaidDetails['UpdatedBy']=='All'){ if($feesPaidDetails['UpdatedBy']=='All'){
@ -797,12 +800,15 @@ class Fees_status_model extends CI_Model
* created by kms * created by kms
* */ * */
public function getFeesStructureAssign($student=null){ public function getFeesStructureAssign($student=null){
// print_r($student);die();
$this->db->select('ID,CourseID,ProgramType,FeesAmount,Sem_Year'); $this->db->select('ID,CourseID,ProgramType,FeesAmount,Sem_Year');
$this->db->where('CourseID',$student['CourseID']); $this->db->where('CourseID',$student['CourseID']);
$this->db->order_by('ProgramType'); $this->db->order_by('ProgramType');
$feesDetails = $this->db->get(COURSE_FEES); $feesDetails = $this->db->get(COURSE_FEES);
$SNoValue=0; $SNoValue=0;
// echo 'count'.count($feesDetails->result());
// print_r($this->db->last_query());die();
if($feesDetails->result()){ if($feesDetails->result()){
$result_array['feesStatus']=true; $result_array['feesStatus']=true;
@ -810,7 +816,7 @@ class Fees_status_model extends CI_Model
$SNoValue=$SNoValue+1; $SNoValue=$SNoValue+1;
$this->db->select('SFS.FeesID,SFS.CourseFees,SFS.Comments,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFS.BatchCode,SM.SessionName as MasterSessionName,SM1.SessionName as MasterToSessionName,bm.BatchName'); $this->db->select('SFS.FeesID,SFS.CourseFees,SFS.Comments,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFS.BatchCode,SM.SessionName as MasterSessionName,SM1.SessionName as MasterToSessionName,bm.BatchName');
$this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS');
$this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName'); $this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName','left');
$this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left'); $this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left');
$this->db->join(BATCH.' as bm','bm.BatchCode = SFS.BatchCode','left'); $this->db->join(BATCH.' as bm','bm.BatchCode = SFS.BatchCode','left');
// $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID','left'); // $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID','left');
@ -821,14 +827,16 @@ class Fees_status_model extends CI_Model
// $this->db->where('SFS.BatchCode',$student['BatchCode']); // $this->db->where('SFS.BatchCode',$student['BatchCode']);
// } // }
$existFeesDetails = $this->db->get(); $existFeesDetails = $this->db->get();
// print_r($this->db->last_query());die();
// print_r($this->db->last_query());die(); // echo 'check Details'.$SNoValue;
// die();
if($existData=$existFeesDetails->result()){ if($existData=$existFeesDetails->result()){
// count the total paid fees details // count the total paid fees details
$this->db->select('FeesId'); $this->db->select('FeesId');
$this->db->where('FeesId',$existData[0]->FeesID); $this->db->where('FeesId',$existData[0]->FeesID);
$this->db->where('IsActive','1'); // $this->db->where('IsActive','1');
$countExistPaid = $this->db->get(STUDENTS_FEES_PAID); $countExistPaid = $this->db->get(STUDENTS_FEES_PAID);
if($countExistPaid->num_rows()<=0){ if($countExistPaid->num_rows()<=0){
$fetchData['PaidStatus']=0; $fetchData['PaidStatus']=0;
} }
@ -921,6 +929,8 @@ class Fees_status_model extends CI_Model
} }
} }
// print_r($fetchData);
// die();
// filter data // filter data
$KilterKey = array_search(1, array_column($CourseFeesArray, 'ExistValue')); $KilterKey = array_search(1, array_column($CourseFeesArray, 'ExistValue'));
if($KilterKey=='' OR $KilterKey==null){ if($KilterKey=='' OR $KilterKey==null){
@ -928,8 +938,11 @@ class Fees_status_model extends CI_Model
} }
else{ else{
$FilterSNoValue=0; $FilterCourseArray=$CourseFeesArray;
/* // by Sanjeev Due to Requirement Need The Changes Fees for existing Deletetion
$FilterSNoValue=0;
foreach ($CourseFeesArray as $key => $FilterRow){ foreach ($CourseFeesArray as $key => $FilterRow){
if($KilterKey<=$key){ if($KilterKey<=$key){
$FilterSNoValue=$FilterSNoValue+1; $FilterSNoValue=$FilterSNoValue+1;
@ -937,6 +950,7 @@ class Fees_status_model extends CI_Model
$FilterCourseArray[]=$FilterRow; $FilterCourseArray[]=$FilterRow;
} }
} }
*/
} }
@ -955,7 +969,8 @@ class Fees_status_model extends CI_Model
else{ else{
$result_array['feesStatus']=false; $result_array['feesStatus']=false;
} }
// die();
// print_r($result_array);die();
$result_array['sessionDetails'] = $this->getSession($student); $result_array['sessionDetails'] = $this->getSession($student);
$result_array['feesetDetails'] = $this->GetFeeSetDetails($student); $result_array['feesetDetails'] = $this->GetFeeSetDetails($student);
@ -1232,7 +1247,20 @@ class Fees_status_model extends CI_Model
$this->db->where('StudentID', $details['StudentID']); $this->db->where('StudentID', $details['StudentID']);
$this->db->where('FeesType', $details['FeesType']); $this->db->where('FeesType', $details['FeesType']);
$checkExist=$this->db->get(STUDENTS_FEES_STATUS); $checkExist=$this->db->get(STUDENTS_FEES_STATUS);
$checkwithstatus = count($checkExist->result())<=0;
$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',$details['CourseID']);
$this->db->where('SFS.StudentID',$details['StudentID']);
$result = $this->db->get()->result_array();
$check = 0;// id has value means Sem1 Already Exist so NewReg Set t0 0 no value in ID(which means Empty) newreg value 1;
// echo count($result);
for($j=0;$j<count($result);$j++)
{
$a = $result[$j]['Sem_Year'];
if($a == 'Sem1'){$check++;}
}
// select cf.Sem_Year // select cf.Sem_Year
// from T_Students_Fees_Status sfs // from T_Students_Fees_Status sfs
@ -1340,20 +1368,21 @@ class Fees_status_model extends CI_Model
if(($details['FeesType']=='PPC') || ($details['FeesType']=='TC')|| ($details['FeesType']=='MC')|| ($details['FeesType'] == 'DC')) if(($details['FeesType']=='PPC') || ($details['FeesType']=='TC')|| ($details['FeesType']=='MC')|| ($details['FeesType'] == 'DC'))
{ {
$this->db->select('ListCode'); // $this->db->select('ListCode');
$this->db->from('T_PickListDetails'); // $this->db->from('T_PickListDetails');
$this->db->where('ListName','EXPECTED'); // $this->db->where('ListName','EXPECTED');
$this->db->where('BranchCode',$details['BranchCode']); // $this->db->where('BranchCode',$details['BranchCode']);
$searchDetails = $this->db->get(); // $searchDetails = $this->db->get();
$getId=$searchDetails->result(); // $getId=$searchDetails->result();
$listcode=''; // $listcode='';
foreach($getId as $ge) // foreach($getId as $ge)
{ // {
$listcode=$ge->ListCode; // $listcode=$ge->ListCode;
} // }
$listcode=FEESUPDATE;
$appstatus['StudentID'] = $details['StudentID']; $appstatus['StudentID'] = $details['StudentID'];
$appstatus['CourseID'] = $details['CourseID']; $appstatus['CourseID'] = $details['CourseID'];
@ -1370,7 +1399,7 @@ class Fees_status_model extends CI_Model
} }
// update registration details // update registration details
if($jsonData){ if($jsonData){
$this->updateRegistrationDetails($details,$installmentFeesID,$checkwithstatus); $this->updateRegistrationDetails($details,$installmentFeesID,$check);
} }
return $result; return $result;
@ -1380,9 +1409,7 @@ class Fees_status_model extends CI_Model
* insert registration details while set fees * insert registration details while set fees
* created by kms * created by kms
* */ * */
public function updateRegistrationDetails($details=null,$feesStatusID=null,$checkwithstatus=null){ public function updateRegistrationDetails($details=null,$feesStatusID=null,$check){
$regId=''; $regId='';
$this->db->select('Student_Fee_Status_Id,RegistrationMode'); $this->db->select('Student_Fee_Status_Id,RegistrationMode');
$this->db->where('CourseID', $details['CourseID']); $this->db->where('CourseID', $details['CourseID']);
@ -1435,8 +1462,8 @@ class Fees_status_model extends CI_Model
$reRegistartion['StudentID']=$details['StudentID']; $reRegistartion['StudentID']=$details['StudentID'];
$reRegistartion['CourseID']=$details['CourseID']; $reRegistartion['CourseID']=$details['CourseID'];
$reRegistartion['FeeType']=$details['FeesType']; $reRegistartion['FeeType']=$details['FeesType'];
$reRegistartion['RegistrationMode']= ($checkwithstatus!=0) ? 1 : 0; $reRegistartion['RegistrationMode']= $check > 0 ? 0 : 1;
$reRegistartion['RegistrationType']= ($checkwithstatus!=0) ? NEWREGISTRATION_CONST : RE_REGISTRATION_CONST ; $reRegistartion['RegistrationType']= $check > 0 ? RE_REGISTRATION_CONST : NEWREGISTRATION_CONST;
$reRegistartion['BranchCode']=$details['BranchCode']; $reRegistartion['BranchCode']=$details['BranchCode'];
$reRegistartion['CreatedBy']=$details['CreatedBy']; $reRegistartion['CreatedBy']=$details['CreatedBy'];
$reRegistartion['CreatedOn']=$details['CreatedOn']; $reRegistartion['CreatedOn']=$details['CreatedOn'];
@ -1465,13 +1492,13 @@ class Fees_status_model extends CI_Model
} }
$this->db->select('ListCode'); // $this->db->select('ListCode');
$this->db->from('T_PickListDetails'); // $this->db->from('T_PickListDetails');
$this->db->where('ListName','EXPECTED'); // $this->db->where('ListName','EXPECTED');
$this->db->where('BranchCode',$details['BranchCode']); // $this->db->where('BranchCode',$details['BranchCode']);
$searchDetails = $this->db->get(); // $searchDetails = $this->db->get();
$getId=$searchDetails->result(); // $getId=$searchDetails->result();
// $listcode=''; // $listcode='';
// Expected Remove because mentioned ON Apollo XL sheet(30.11.2020) // Expected Remove because mentioned ON Apollo XL sheet(30.11.2020)
@ -1479,7 +1506,8 @@ class Fees_status_model extends CI_Model
// { // {
// $listcode=$ge->ListCode; // $listcode=$ge->ListCode;
// } // }
$listcode=null;
$listcode=FEESUPDATE;
$fromd= date("d-m-Y",strtotime($details['CreatedOn'])); $fromd= date("d-m-Y",strtotime($details['CreatedOn']));
@ -1976,7 +2004,7 @@ class Fees_status_model extends CI_Model
$this->db->where('ListName','NOT APPLICABLE'); $this->db->where('ListName','NOT APPLICABLE');
} }
else{ else{
$this->db->where('ListName','EXPECTED'); $this->db->where('ListName','Fees update Status');
} }
$this->db->where('BranchCode',$feesDetails['UpdatedBy']); $this->db->where('BranchCode',$feesDetails['UpdatedBy']);

View File

@ -239,17 +239,15 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se
LEFT JOIN (SELECT StudentID AS sid,UniversityID AS uid,CourseID AS cid,EnrollmentID AS eid,BranchID AS branch,ifnull(STATUS,'-') AS coursestatus FROM T_Student_CourseDetails) AS scd LEFT JOIN (SELECT StudentID AS sid,UniversityID AS uid,CourseID AS cid,EnrollmentID AS eid,BranchID AS branch,ifnull(STATUS,'-') AS coursestatus FROM T_Student_CourseDetails) AS scd
ON scd.sid=sfs.sid ON scd.sid=sfs.sid AND scd.cid = sfs.cid
LEFT JOIN (SELECT ID,StudentID AS sid,Sem, LEFT JOIN (SELECT ID,StudentID AS sid,Sem,CourseID,
IF(ListName = 'SENT TO UNIVERSITY', AnsDate,'-') AS ansdate,CourierDetails AS courierdetails IF(ListName = 'SENT TO UNIVERSITY', AnsDate,'-') AS ansdate,CourierDetails AS courierdetails
FROM T_AnswerBookletStatus abs FROM T_AnswerBookletStatus abs
LEFT JOIN T_PickListDetails `list` ON list.ListCode=abs.ListCode LEFT JOIN T_PickListDetails `list` ON list.ListCode=abs.ListCode
WHERE AnsDate IS NOT NULL AND ID IN (SELECT max(ID) FROM T_AnswerBookletStatus WHERE AnsDate IS NOT NULL GROUP BY StudentID,Sem) WHERE AnsDate IS NOT NULL AND ID IN (SELECT max(ID) FROM T_AnswerBookletStatus WHERE AnsDate IS NOT NULL GROUP BY StudentID,Sem,CourseID)
GROUP BY sid,Sem) AS andate GROUP BY sid,Sem,CourseID) AS andate
ON andate.sid=sfs.sid AND andate.Sem=cfd.syear ON andate.sid = sfs.sid AND andate.Sem = cfd.syear AND andate.CourseID = sfs.ftype
LEFT JOIN (SELECT rd.StudentID AS sid,rd.CourseID AS cid,max(IF(list.ListName = 'SENT TO UNIVERSITY', afs.AppFormDate,'-')) AS appdate,Sem_Year AS sem LEFT JOIN (SELECT rd.StudentID AS sid,rd.CourseID AS cid,max(IF(list.ListName = 'SENT TO UNIVERSITY', afs.AppFormDate,'-')) AS appdate,Sem_Year AS sem
FROM T_Registration_Details rd FROM T_Registration_Details rd
LEFT JOIN T_ApplicationFormStatus afs ON afs.Registration_Details_ID=rd.ID LEFT JOIN T_ApplicationFormStatus afs ON afs.Registration_Details_ID=rd.ID
@ -272,7 +270,7 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se
} }
if ($st != ''){ if ($st != ''){
if ($st == 'blank'){ if ($st == FEESUPDATE){
$sql.=" and (list.lcode IS NULL OR list.lcode = '')";} $sql.=" and (list.lcode IS NULL OR list.lcode = '')";}
else{ $sql.="and list.lcode = '".$st."'";} else{ $sql.="and list.lcode = '".$st."'";}
} }
@ -384,122 +382,159 @@ LEFT JOIN
FROM T_Student_CourseDetails) AS scd ON scd.sid=sms.sid AND scd.cid=sms.cid FROM T_Student_CourseDetails) AS scd ON scd.sid=sms.sid AND scd.cid=sms.cid
where sms.branch = '".$br."'"; where sms.branch = '".$br."'";
$sql = "SELECT $sql = "SELECT
sfs.sid AS Student_id, sms.sid AS Student_id,
sfs.cid,sfs.fid, sms.cid,
if(sms.status = '','-',IFNULL(sms.status, '-')) AS STATUS, sfs.fid,sms.lcode,
IFNULL(DATE_FORMAT(sms.adate, '%d-%m-%Y'), '-') AS adate, IF(sms.status = '',
if(sms.acmts = '','-',IFNULL(sms.acmts, '-')) AS acmts, '-',
if(sfs.ftype = '','-',IFNULL(sfs.ftype, '-')) AS ctype, IFNULL(sms.status, '-')) AS STATUS,
if(sms.certname = '','-',IFNULL(sms.certname, '-')) AS certname, IFNULL(DATE_FORMAT(sms.adate, '%d-%m-%Y'), '-') AS adate,
balance,totalpaid,totalpayable, IF(sms.acmts = '',
if(sfb.bdate = '','-',IFNULL(sfb.bdate, '-')) AS initialPaid, '-',
if(scd.eid = '','-',IFNULL(scd.eid, '-')) AS Enrollment_id, IFNULL(sms.acmts, '-')) AS acmts,
if(std.name = '','-',IFNULL(std.name, '-')) AS Student_name, IF(sfs.ftype = '',
if(std.father = '','-',IFNULL(std.father, '-')) AS Father_name, '-',
if(std.phone = '','-',IFNULL(std.phone, '-')) AS Phone_number, IFNULL(sfs.ftype, '-')) AS ctype,
if(cm.course = '','-',IFNULL(cm.course, '-')) AS Course_name, IF(sms.certname = '',
if(cm.uname = '','-',IFNULL(cm.uname, '-')) AS University, '-',
if(cm.uid = '','-',cm.uid) AS univID, IFNULL(sms.certname, '-')) AS certname,
if(std.address = '','-',IFNULL(std.address, '-')) AS address, balance,
if(std.AlternateNumber = '','-',IFNULL(std.AlternateNumber, '')) AS AlternateNumber, totalpaid,
if(sfs.batch = '','-',sfs.batch) AS Batch, totalpayable,
if(sfs.batchname = '','-',IFNULL(sfs.batchname, '-')) AS Batch_Name, IF(sfb.bdate = '',
if(scd.coursestatus = '','-',scd.coursestatus) AS Course_Status, '-',
if(sms.courierdetails = '','-',IFNULL(sms.courierdetails, '-')) AS Courier_Details IFNULL(sfb.bdate, '-')) AS initialPaid,
IF(scd.eid = '',
'-',
IFNULL(scd.eid, '-')) AS Enrollment_id,
IF(std.name = '',
'-',
IFNULL(std.name, '-')) AS Student_name,
IF(std.father = '',
'-',
IFNULL(std.father, '-')) AS Father_name,
IF(std.phone = '',
'-',
IFNULL(std.phone, '-')) AS Phone_number,
IF(cm.course = '',
'-',
IFNULL(cm.course, '-')) AS Course_name,
IF(cm.uname = '',
'-',
IFNULL(cm.uname, '-')) AS University,
IF(cm.uid = '', '-', cm.uid) AS univID,
IF(std.address = '',
'-',
IFNULL(std.address, '-')) AS address,
IF(std.AlternateNumber = '',
'-',
IFNULL(std.AlternateNumber, '')) AS AlternateNumber,
IF(sfs.batch = '', '-', sfs.batch) AS Batch,
IF(sfs.batchname = '',
'-',
IFNULL(sfs.batchname, '-')) AS Batch_Name,
IF(scd.coursestatus = '',
'-',
scd.coursestatus) AS Course_Status,
IF(sms.courierdetails = '',
'-',
IFNULL(sms.courierdetails, '-')) AS Courier_Details
FROM (SELECT
app.ID,
app.StudentID AS sid,
app.CourseID AS cid,
app.BranchCode AS branch,
app.ListCode AS lcode,
p.ListName AS STATUS,
STR_TO_DATE(AppDate, '%d-%m-%Y') AS adate,
app.Comments AS acmts,
CertificationType AS ctype,
app.CertificationType AS certname,
SUM(bal.balpayable) AS balance,
bal.totalpaid,
bal.totalpayable,
app.CourierDetails AS courierdetails
FROM FROM
(SELECT T_ApplicationStatus AS app
FeesID AS fid, LEFT JOIN T_PickListDetails p ON p.ListCode = app.ListCode
T_Students_Fees_Status.BatchCode AS batch, LEFT JOIN BalFees bal ON bal.student = app.StudentID
T_BatchMaster.BatchName AS batchname, AND bal.course = app.CourseID
T_Students_Fees_Status.BranchCode AS branch, AND bal.feestype = app.CertificationType
StudentID AS sid, AND bal.totalpayable IS NOT NULL
CourseID AS cid, WHERE
FeesType AS ftype, app.CertificationType NOT LIKE 'CERT%'
SUM(CourseFees) AS cf, AND app.ID IN (SELECT
SUM(STFOrWR) AS stf, MAX(ID)
SUM(Others) AS others FROM
FROM T_ApplicationStatus
T_Students_Fees_Status GROUP BY StudentID , CourseID , BranchCode , CertificationType)
LEFT JOIN T_BatchMaster ON T_BatchMaster.BatchCode = T_Students_Fees_Status.BatchCode GROUP BY app.ID) AS sms
GROUP BY sid , cid , fid) AS sfs LEFT JOIN (SELECT
LEFT JOIN FeesID AS fid,
(SELECT T_Students_Fees_Status.BatchCode AS batch,
app.ID, T_BatchMaster.BatchName AS batchname,
app.StudentID AS sid, T_Students_Fees_Status.BranchCode AS branch,
app.CourseID AS cid, StudentID AS sid,
app.BranchCode AS branch,
app.ListCode AS lcode,
p.ListName AS STATUS,
STR_TO_DATE(AppDate, '%d-%m-%Y') AS adate,
app.Comments AS acmts,
CertificationType AS ctype,
app.CertificationType AS certname,
SUM(bal.balpayable) AS balance,bal.totalpaid,bal.totalpayable,
app.CourierDetails AS courierdetails
FROM
T_ApplicationStatus AS app
LEFT JOIN T_PickListDetails p ON p.ListCode = app.ListCode
LEFT JOIN BalFees bal ON bal.student = app.StudentID
AND bal.course = app.CourseID
AND bal.feestype = app.CertificationType AND bal.totalpayable is not null
WHERE
app.CertificationType NOT LIKE 'CERT%'
AND app.ID IN (SELECT
MAX(ID)
FROM
T_ApplicationStatus
GROUP BY StudentID , CourseID , BranchCode , CertificationType)
GROUP BY app.ID) AS sms ON sfs.sid = sms.sid AND sfs.cid = sms.cid
AND sfs.ftype = sms.ctype
LEFT JOIN
(SELECT
sfp.StudentID AS sid,
sfp.FeesId AS fid,
sfs.CourseID AS cid,
STR_TO_DATE(BillDate, '%d-%m-%Y') AS bdate,
SUM(BillAmount) AS bamount,
BillNO AS billno
FROM
T_Students_Fees_PaidDetails sfp
LEFT JOIN T_Students_Fees_Status sfs ON sfs.FeesId = sfp.FeesId
WHERE
IsActive = 1
GROUP BY sid , cid , fid) AS sfb ON sfb.sid = sfs.sid AND sfb.fid = sfs.fid
LEFT JOIN
(SELECT
CourseID AS cid, CourseID AS cid,
cm.UniversityID AS cuid, FeesType AS ftype,
u.UniversityID AS uid, SUM(CourseFees) AS cf,
CourseName AS course, SUM(STFOrWR) AS stf,
UniversityName AS uname, SUM(Others) AS others
cm.BranchCode AS branch FROM
FROM T_Students_Fees_Status
T_CourseMaster AS cm LEFT JOIN T_BatchMaster ON T_BatchMaster.BatchCode = T_Students_Fees_Status.BatchCode
LEFT JOIN T_UniversityMaster AS u ON u.UniversityID = cm.UniversityID GROUP BY sid , cid , fid) AS sfs ON sfs.sid = sms.sid AND sfs.cid = sms.cid
GROUP BY cid AND sfs.ftype = sms.ctype
ORDER BY CourseID) AS cm ON cm.cid = sfs.cid LEFT JOIN
LEFT JOIN (SELECT
(SELECT sfp.StudentID AS sid,
StudentID AS sid, sfp.FeesId AS fid,
MobileNumber AS phone, sfs.CourseID AS cid,
IsActive AS active, STR_TO_DATE(BillDate, '%d-%m-%Y') AS bdate,
CONCAT(FirstName, ' ', Lastname) AS NAME, SUM(BillAmount) AS bamount,
Fathername AS father, BillNO AS billno
PermanentAddress AS address, FROM
AlternateNumber T_Students_Fees_PaidDetails sfp
FROM LEFT JOIN T_Students_Fees_Status sfs ON sfs.FeesId = sfp.FeesId
T_StudentDetails) AS std ON std.sid = sfs.sid WHERE
LEFT JOIN IsActive = 1
(SELECT GROUP BY sid , cid , fid) AS sfb ON sfb.sid = sms.sid AND sfb.fid = sfs.fid
StudentID AS sid, LEFT JOIN
UniversityID AS uid, (SELECT
CourseID AS cid, CourseID AS cid,
EnrollmentID AS eid, cm.UniversityID AS cuid,
BranchID AS branch, u.UniversityID AS uid,
IFNULL(Status, '-') AS coursestatus CourseName AS course,
FROM UniversityName AS uname,
T_Student_CourseDetails) AS scd ON scd.sid = sfs.sid AND scd.cid = sfs.cid cm.BranchCode AS branch
where sfs.branch = '".$br."'"; FROM
T_CourseMaster AS cm
LEFT JOIN T_UniversityMaster AS u ON u.UniversityID = cm.UniversityID
GROUP BY cid
ORDER BY CourseID) AS cm ON cm.cid = sms.cid
LEFT JOIN
(SELECT
StudentID AS sid,
MobileNumber AS phone,
IsActive AS active,
CONCAT(FirstName, ' ', Lastname) AS NAME,
Fathername AS father,
PermanentAddress AS address,
AlternateNumber
FROM
T_StudentDetails) AS std ON std.sid = sfs.sid
LEFT JOIN
(SELECT
StudentID AS sid,
UniversityID AS uid,
CourseID AS cid,
EnrollmentID AS eid,
BranchID AS branch,
IFNULL(Status, '-') AS coursestatus
FROM
T_Student_CourseDetails) AS scd ON scd.sid = sfs.sid AND scd.cid = sfs.cid
WHERE
sfs.branch = '".$br."'";
$sql.=" AND (scd.coursestatus IS NULL OR (scd.coursestatus != 'Refund_issued' AND scd.coursestatus != 'Discontinued' AND scd.coursestatus != 'Cancelled'))"; $sql.=" AND (scd.coursestatus IS NULL OR (scd.coursestatus != 'Refund_issued' AND scd.coursestatus != 'Discontinued' AND scd.coursestatus != 'Cancelled'))";
if ($bat!= ''){ if ($bat!= ''){
@ -527,18 +562,17 @@ LEFT JOIN
} }
if ($st != ''){ if ($st != ''){
if($st == "blank"){ if($st == FEESUPDATE){
$sql.=" and (sms.lcode IS NULL OR sms.lcode = '')"; $sql.=" and sms.lcode = '".FEESUPDATE."'";
}else{ }else{
$sql.=" and sms.lcode = '".$st."'"; $sql.=" and sms.lcode = '".$st."'";
} }
} }
$sql.=" and sfs.fid IS not null"; $sql.=" and sfs.fid IS not null";
$sql.=" group by Student_id,cid,ctype"; $sql.=" group by Student_id,cid,fid,ctype";
$sql.=" ORDER BY sfb.bdate ASC"; $sql.=" ORDER BY sfb.bdate ASC";
//echo $sql; //echo $sql;
// print_r($sql);die();
$leadDet=$this->db->query($sql); $leadDet=$this->db->query($sql);
$cert_statusDetails = $leadDet->result(); $cert_statusDetails = $leadDet->result();
@ -964,7 +998,7 @@ APFS.ID AS id,
CFD.Sem_Year AS Sem_Year, CFD.Sem_Year AS Sem_Year,
RD.RegistrationType AS FormType, RD.RegistrationType AS FormType,
STU.StudentID AS Student_id, STU.StudentID AS Student_id,
IFNULL(sfs.RollNo, '-') AS StudentRollNo, IF(sfs.RollNo!='',sfs.RollNo,IFNULL(sfs.RollNo,'-')) AS StudentRollNo,
IFNULL(STU_COUR.Status, '-') AS StuCourStatus, IFNULL(STU_COUR.Status, '-') AS StuCourStatus,
BALFEE.totalpayable AS CourseFees, BALFEE.totalpayable AS CourseFees,
BALFEE.totalpaid AS paidAmount, BALFEE.totalpaid AS paidAmount,
@ -979,7 +1013,7 @@ LEFT JOIN T_Student_CourseDetails AS STU_COUR ON STU_COUR.StudentID = sfs.Studen
AND STU_COUR.CourseID = sfs.CourseID AND STU_COUR.CourseID = sfs.CourseID
LEFT JOIN T_Course_Fees_Details AS CFD ON CFD.ID = sfs.FeesType LEFT JOIN T_Course_Fees_Details AS CFD ON CFD.ID = sfs.FeesType
LEFT JOIN T_UniversityMaster AS UNIV ON UNIV.UniversityID = COUR.UniversityID LEFT JOIN T_UniversityMaster AS UNIV ON UNIV.UniversityID = COUR.UniversityID
LEFT JOIN BalFees AS BALFEE ON BALFEE.student = sfs.StudentID AND BALFEE.totalpayable is not null LEFT JOIN BalFees AS BALFEE ON BALFEE.student = sfs.StudentID AND BALFEE.feestype = sfs.FeesType AND BALFEE.totalpayable is not null
LEFT JOIN LEFT JOIN
(SELECT (SELECT
FeesId AS FeeID, FeesId AS FeeID,

View File

@ -1058,6 +1058,7 @@ $this->db->insert_batch('T_BroadcastStatus', $data);
// $searchTableFor = APPLICATION_FORM; // $searchTableFor = APPLICATION_FORM;
$this->db->select('t1.ID, t1.Student_Fee_Status_Id, t1.BatchCode, t1.FeeType as SemID, CFD.Sem_Year as Sem_Year, t1.RegistrationMode, t1.RegistrationType,BM.BatchName,t1.CreatedOn'); $this->db->select('t1.ID, t1.Student_Fee_Status_Id, t1.BatchCode, t1.FeeType as SemID, CFD.Sem_Year as Sem_Year, t1.RegistrationMode, t1.RegistrationType,BM.BatchName,t1.CreatedOn');
$this->db->from('T_Registration_Details as t1'); $this->db->from('T_Registration_Details as t1');
$this->db->join('T_Students_Fees_Status as SFS', 'SFS.FeesID = t1.Student_Fee_Status_Id');
$this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = t1.FeeType'); $this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = t1.FeeType');
$this->db->join('T_BatchMaster as BM', 'BM.BatchCode = t1.BatchCode'); $this->db->join('T_BatchMaster as BM', 'BM.BatchCode = t1.BatchCode');
$this->db->where('t1.StudentID', $studentId); $this->db->where('t1.StudentID', $studentId);

View File

@ -400,7 +400,7 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl
this.SDate = $scope.myStatusModel.dateOn; this.SDate = $scope.myStatusModel.dateOn;
this.Coursedetail = id; this.Coursedetail = id;
this.Comments = $scope.myStatusModel.comment; this.Comments = $scope.myStatusModel.comment;
this.CourierDetails = $scope.myStatusModel.CourierDetails; this.CourierDetails = $scope.myStatusModel.CourierDetails.replace('/\n\r?/g', '<br />');
this.CertificateType = $scope.myStatusModel.certificatetype; this.CertificateType = $scope.myStatusModel.certificatetype;
this.CertificateNumber = $scope.myStatusModel.certificateNumber; this.CertificateNumber = $scope.myStatusModel.certificateNumber;
} }

View File

@ -184,8 +184,7 @@
<!--<td><a tooltip="View Student" class="text-dark" ng-click="open(p);">{{p.Phone_number}}</a></td>--> <!--<td><a tooltip="View Student" class="text-dark" ng-click="open(p);">{{p.Phone_number}}</a></td>-->
<td>{{p.University}}</td> <td>{{p.University}}</td>
<td>{{p.FormType}}</td> <td>{{p.FormType}}</td>
<td>{{p.StatusName}}</td> <td>{{p.StatusCode === "U001" ? "-" : p.StatusName}}</td>
<td>{{p.StatusUpdationOn}}</td> <td>{{p.StatusUpdationOn}}</td>

View File

@ -183,7 +183,7 @@ td,th {
<!-- <td>{{p.Sem_year}}</td> --> <!-- <td>{{p.Sem_year}}</td> -->
<td>{{p.University}}</td> <td>{{p.University}}</td>
<td style="text-align:right;">{{p.balance || "0"}}</td> <td style="text-align:right;">{{p.balance || "0"}}</td>
<td>{{p.STATUS}}</td> <td>{{p.lcode === "U001" ? "-" : p.STATUS}}</td>
<td>{{p.certname}}</td> <td>{{p.certname}}</td>
<td>{{p.Courier_Details}}</td> <td>{{p.Courier_Details}}</td>
<td style="max-width: 120px;white-space: pre-wrap; word-wrap: break-word !important;">{{p.acmts}}</td> <td style="max-width: 120px;white-space: pre-wrap; word-wrap: break-word !important;">{{p.acmts}}</td>

View File

@ -301,6 +301,7 @@
</div> </div>
<div class="col-md-6 form-group" ng-class="{'has-error':Form.courier_details.$dirty && Form.courier_details.$invalid}"> <div class="col-md-6 form-group" ng-class="{'has-error':Form.courier_details.$dirty && Form.courier_details.$invalid}">
<label>Courier Details</label> <label>Courier Details</label>
<textarea type="text" placeholder="Enter Courier Details" tabindex="8" class="form-control" name="courier_details" ng-model="myStatusModel.CourierDetails"/> <textarea type="text" placeholder="Enter Courier Details" tabindex="8" class="form-control" name="courier_details" ng-model="myStatusModel.CourierDetails"/>
<span class="error text-small block" ng-if="Form.courier_details.$dirty && Form.courier_details.$error.pattern">Invalid Details</span> <span class="error text-small block" ng-if="Form.courier_details.$dirty && Form.courier_details.$error.pattern">Invalid Details</span>
</div> </div>