markcard/certificate Status report fixes

This commit is contained in:
gandhimathi 2018-09-28 19:46:04 +05:30
parent f23bed5fda
commit ccaf8c8732
3 changed files with 43 additions and 44 deletions

View File

@ -285,13 +285,13 @@ left join
ifnull(sms.rcvedate,'-') as rdate,ifnull(sms.rstatus,'-') as rstatus,sms.acmts,ifnull(sms.balance,0) as Balance_fee,std.name as Student_name,std.father as Father_name,std.phone as Phone_number,cm.course as Course_name,cm.uname as University,mdate,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber ifnull(sms.rcvedate,'-') as rdate,ifnull(sms.rstatus,'-') as rstatus,sms.acmts,ifnull(sms.balance,0) as Balance_fee,std.name as Student_name,std.father as Father_name,std.phone as Phone_number,cm.course as Course_name,cm.uname as University,mdate,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber
from from
(select c.ID,c.StudentID as sid,sfs.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,Sem as sem,c.CertificationType as certname,c.CertificationType as ctype,CDate as mdate,balpayable as balance, (select c.ID,c.StudentID as sid,sfs.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,Sem as sem,c.CertificationType as certname,c.CertificationType as ctype,CDate as mdate,balpayable as balance,
max(if(ListName = 'ISSUED', CDate,'-')) as issuedate,max(if(ListName = 'ISSUED', ListName,'-')) as istatus, max(if(ListName = 'ISSUED TO STUDENT', CDate,'-')) as issuedate,max(if(ListName = 'ISSUED TO STUDENT', ListName,'-')) as istatus,
max(if(ListName = 'RECEIVED', CDate,'-')) as rcvedate,max(if(ListName = 'RECEIVED', ListName,'-')) as rstatus,c.Comments as acmts max(if(ListName = 'RECEIVED', CDate,'-')) as rcvedate,max(if(ListName = 'RECEIVED', ListName,'-')) as rstatus,c.Comments as acmts
from T_CertificationStatus c from T_CertificationStatus c
left join T_Students_Fees_Status sfs on sfs.FeesType=c.CourseID and sfs.StudentID=c.StudentID left join T_Students_Fees_Status sfs on sfs.FeesType=c.CourseID and sfs.StudentID=c.StudentID
left join T_PickListDetails list on list.ListCode=c.ListCode left join T_PickListDetails list on list.ListCode=c.ListCode
left join BalFees bal on bal.student=c.StudentID and bal.course=sfs.CourseID and bal.semyr=c.Sem left join BalFees bal on bal.student=c.StudentID and bal.course=sfs.CourseID and bal.semyr=c.Sem
where CDate is not null and (list.ListName like 'ISSUED' or list.ListName like 'RECEIVED%' ) where CDate is not null and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' )
group by sid,cid,sem,ctype group by sid,cid,sem,ctype
union union
select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance, select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance,
@ -305,7 +305,7 @@ left join
left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID
where cm.CertificateName not like 'APPLICATION%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a where cm.CertificateName not like 'APPLICATION%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a
left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType
group by a.StudentID,a.CourseID,a.ListCode,cm.CertificateName) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' ) group by a.StudentID,a.CourseID,a.CertificationType,cm.CertificateName) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' )
group by sid,cid,ctype group by sid,cid,ctype
union union
select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance, select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance,
@ -319,7 +319,7 @@ left join
left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID
where a.CertificationType not like 'CERT%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a where a.CertificationType not like 'CERT%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a
left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType
group by a.StudentID,a.CourseID,a.ListCode,cm.CertificateName) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' ) group by a.StudentID,a.CourseID,a.CertificationType,cm.CertificateName) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' )
group by sid,cid,ctype group by sid,cid,ctype
) as sms ) as sms
left join left join
@ -343,7 +343,7 @@ left join
left join 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=sms.sid (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=sms.sid
left join left join
(SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid (SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid
where sms.branch = '".$br."' where sms.branch = '".$br."'
"; ";
@ -850,7 +850,7 @@ left join
} }
public function balfee($bat=null,$br=null,$u=null){ public function balfee($bat=null,$br=null,$u=null){
$sql = "SELECT ifnull(sfp.StudentID,'-') as Student_id,scd.EnrollmentID as eid,sfs.CourseID as cid,std.MobileNumber as Phone_number,concat(FirstName,' ',Lastname) as Student_name,Fathername as Father_name,PermanentAddress as address,AlternateNumber,ifnull(date_format(std.CreatedOn,'%d-%m-%Y'),'-') as regdate,cm.CourseName as Course_name,u.UniversityName as University,sfp.FeesID as fid,(sfs.CourseFees + sfs.STFOrWR + sfs.Others) as Total,ifnull((sum(sfp.BillAmount)),0) as Paid_fee,sfs.CourseFees , sfs.STFOrWR , sfs.Others,((sfs.CourseFees + sfs.STFOrWR + sfs.Others) - sfp.BillAmount) as balance,ifnull(bal.balpayable,'-') as bal,ifnull(cfd.Sem_Year,'-') as Sem_year,std.PermanentAddress as address,std.AlternateNumber as AlternateNumber, $sql = "SELECT ifnull(sfp.StudentID,'-') as Student_id,scd.EnrollmentID as eid,sfs.CourseID as cid,std.MobileNumber as Phone_number,concat(FirstName,' ',Lastname) as Student_name,Fathername as Father_name,PermanentAddress as address,AlternateNumber,ifnull(date_format(std.CreatedOn,'%d-%m-%Y'),'-') as regdate,cm.CourseName as Course_name,u.UniversityName as University,sfp.FeesID as fid,(sfs.CourseFees + sfs.STFOrWR + sfs.Others) as Total,ifnull((sum(sfp.BillAmount)),0) as Paid_fee,sfs.CourseFees , sfs.STFOrWR , sfs.Others,((sfs.CourseFees + sfs.STFOrWR + sfs.Others) - sfp.BillAmount) as balance,ifnull(bal.balpayable,0) as bal,ifnull(cfd.Sem_Year,'-') as Sem_year,std.PermanentAddress as address,std.AlternateNumber as AlternateNumber,
ifnull(MAX(CASE WHEN Installment = 1 THEN sfp.BillNO END),'-') as billno1, ifnull(MAX(CASE WHEN Installment = 1 THEN sfp.BillNO END),'-') as billno1,
ifnull(MAX(CASE WHEN Installment = 1 THEN sfp.BillAmount END),0) as billamt1, ifnull(MAX(CASE WHEN Installment = 1 THEN sfp.BillAmount END),0) as billamt1,
ifnull(MAX(CASE WHEN Installment = 2 THEN sfp.BillNO END),'-') as billno2, ifnull(MAX(CASE WHEN Installment = 2 THEN sfp.BillNO END),'-') as billno2,

View File

@ -153,8 +153,8 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle
console.log('staff or trainee'); console.log('staff or trainee');
var value = {}; var value = {};
value['SLNo'] = element.ORDER_ID; value['SL_NO'] = element.ORDER_ID;
value['Description'] = element.VoucherNumber; value['Expense_name'] = element.VoucherNumber;
value['January'] = element.PaidTo; value['January'] = element.PaidTo;
value['February'] = University; value['February'] = University;
value['March'] = element.Ty; value['March'] = element.Ty;
@ -164,10 +164,10 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle
value['July'] = element.Status || '-'; value['July'] = element.Status || '-';
value['August'] = element.Status; value['August'] = element.Status;
value['September'] = element.Balance || '-'; value['September'] = element.Balance || '-';
value['Balance'] = element.Balance || '-'; value['October'] = element.Balance || '-';
value['Balance'] = element.Balance || '-'; value['November'] = element.Balance || '-';
value['Balance'] = element.Balance || '-'; value['December'] = element.Balance || '-';
value['Balance'] = element.Balance || '-'; value['total'] = element.Balance || '-';
o[intDate] = value; o[intDate] = value;
intDate++; intDate++;
intDataSNo++; intDataSNo++;
@ -176,22 +176,21 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle
rows1 = o; rows1 = o;
var headers = { var headers = {
fila_1: { fila_1: {
col_1: { text: 'SNo', style: 'tableHeader', alignment: 'center', bold: true }, col_1: { text: 'SLNO', style: 'tableHeader', alignment: 'center', bold: true },
col_2: { text: 'Voucher Number Bill Number / DATE', style: 'tableHeader', alignment: 'center', bold: true }, col_2: { text: 'Description', style: 'tableHeader', alignment: 'center', bold: true },
col_3: { text: 'Paid To Received From', style: 'tableHeader', alignment: 'center', bold: true }, col_3: { text: 'January', style: 'tableHeader', alignment: 'center', bold: true },
col_4: { text: 'University / Course/ Sem', style: 'tableHeader', alignment: 'center', bold: true }, col_4: { text: 'February', style: 'tableHeader', alignment: 'center', bold: true },
col_5: { text: 'Type', style: 'tableHeader', alignment: 'center', bold: true }, col_5: { text: 'March', style: 'tableHeader', alignment: 'center', bold: true },
col_6: { text: 'Receipt No', style: 'tableHeader', alignment: 'center', bold: true }, col_6: { text: 'April', style: 'tableHeader', alignment: 'center', bold: true },
//col_7: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, col_7: { text: 'May', style: 'tableHeader', alignment: 'center', bold: true },
col_7: { text: 'Mode of Payment', style: 'tableHeader', alignment: 'center', bold: true }, col_8: { text: 'June', style: 'tableHeader', alignment: 'center', bold: true },
col_8: { text: 'Status', style: 'tableHeader', alignment: 'center', bold: true }, col_9: { text: 'July', style: 'tableHeader', alignment: 'center', bold: true },
col_9: { text: 'Amount', style: 'tableHeader', alignment: 'center', bold: true }, col_10: { text: 'August', style: 'tableHeader', alignment: 'center', bold: true },
col_10: { text: 'Balance', style: 'tableHeader', alignment: 'center', bold: true }, col_11: { text: 'September', style: 'tableHeader', alignment: 'center', bold: true },
col_11: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, col_12: { text: 'October', style: 'tableHeader', alignment: 'center', bold: true },
col_12: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, col_13: { text: 'November', style: 'tableHeader', alignment: 'center', bold: true },
col_13: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, col_14: { text: 'December', style: 'tableHeader', alignment: 'center', bold: true },
col_14: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, col_15: { text: 'Total Amount', style: 'tableHeader', alignment: 'center', bold: true },
col_15: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true },
} }
} }
var body = []; var body = [];
@ -222,21 +221,21 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle
if (rows1.hasOwnProperty(key)) { if (rows1.hasOwnProperty(key)) {
var data = rows1[key]; var data = rows1[key];
var row = new Array(); var row = new Array();
row.push(data.SNo.toString()); row.push(data.SL_NO.toString());
row.push(data.Date.toString()); row.push(data.Expense_name.toString());
row.push(data.PaidReceivedToFrom.toString()); row.push(data.January.toString());
row.push(data.UnivCourseSem.toString()); row.push(data.February.toString());
row.push(data.Type.toString()); row.push(data.March.toString());
row.push(data.ReceiptNo.toString()); row.push(data.April.toString());
row.push(data.ModeofPayment.toString()); row.push(data.May.toString());
row.push(data.Status.toString()); row.push(data.June.toString());
row.push(data.Amount.toString()); row.push(data.July.toString());
row.push(data.Balance.toString()); row.push(data.August.toString());
row.push(data.Comments.toString()); row.push(data.September.toString());
row.push(data.Comments.toString()); row.push(data.October.toString());
row.push(data.Comments.toString()); row.push(data.November.toString());
row.push(data.Comments.toString()); row.push(data.December.toString());
row.push(data.Comments.toString()); row.push(data.total.toString());
body.push(row); body.push(row);
} }
} }

View File

@ -90,7 +90,7 @@
<div pdf-save-content="getpdf" class="table-responsive" style="margin-top: 20px;"> <div pdf-save-content="getpdf" class="table-responsive" style="margin-top: 20px;">
<h4 style="text-align:center;">Apollo Distance Education College - {{expense_data[0].branch}}</h4> <h4 style="text-align:center;">Apollo Distance Education College - {{expense_data[0].branch}}</h4>
<h4 style="text-align:center;">Expense Report {{filters.from_date | date : "dd-MM-yyyy"}} To {{filters.to_date | date : "dd-MM-yyyy"}}</h4> <h4 style="text-align:center;">Expense Report {{filters.from_date | date : "dd-MM-yyyy"}} To {{filters.to_date | date : "dd-MM-yyyy"}}</h4>
<table id="datatable" class="table table-striped table-bordered table-hover table-condensed"> <table id="datatable" class="table table-striped table-bordered table-hover table-condensed" export-table>