From ccaf8c8732572c9dd9311d8f303ded3b614ae000 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 28 Sep 2018 19:46:04 +0530 Subject: [PATCH] markcard/certificate Status report fixes --- .../api/application/models/Reports_model.php | 12 +-- .../js/controllers/report_expenseCtrl.js | 73 +++++++++---------- Apollo/assets/views/report_expense.html | 2 +- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index f434329e..78c7880e 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -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 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, - 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 from T_CertificationStatus c 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 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 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, @@ -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 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 - 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 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, @@ -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 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 - 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 ) as sms left join @@ -343,7 +343,7 @@ 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 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."' "; @@ -850,7 +850,7 @@ left join } 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.BillAmount END),0) as billamt1, ifnull(MAX(CASE WHEN Installment = 2 THEN sfp.BillNO END),'-') as billno2, diff --git a/Apollo/assets/js/controllers/report_expenseCtrl.js b/Apollo/assets/js/controllers/report_expenseCtrl.js index 35ef9eb6..5299bed3 100755 --- a/Apollo/assets/js/controllers/report_expenseCtrl.js +++ b/Apollo/assets/js/controllers/report_expenseCtrl.js @@ -153,8 +153,8 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle console.log('staff or trainee'); var value = {}; - value['SLNo'] = element.ORDER_ID; - value['Description'] = element.VoucherNumber; + value['SL_NO'] = element.ORDER_ID; + value['Expense_name'] = element.VoucherNumber; value['January'] = element.PaidTo; value['February'] = University; value['March'] = element.Ty; @@ -164,10 +164,10 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle value['July'] = element.Status || '-'; value['August'] = element.Status; value['September'] = element.Balance || '-'; - value['Balance'] = element.Balance || '-'; - value['Balance'] = element.Balance || '-'; - value['Balance'] = element.Balance || '-'; - value['Balance'] = element.Balance || '-'; + value['October'] = element.Balance || '-'; + value['November'] = element.Balance || '-'; + value['December'] = element.Balance || '-'; + value['total'] = element.Balance || '-'; o[intDate] = value; intDate++; intDataSNo++; @@ -176,22 +176,21 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle rows1 = o; var headers = { fila_1: { - col_1: { text: 'SNo', style: 'tableHeader', alignment: 'center', bold: true }, - col_2: { text: 'Voucher Number Bill Number / DATE', style: 'tableHeader', alignment: 'center', bold: true }, - col_3: { text: 'Paid To Received From', style: 'tableHeader', alignment: 'center', bold: true }, - col_4: { text: 'University / Course/ Sem', style: 'tableHeader', alignment: 'center', bold: true }, - col_5: { text: 'Type', style: 'tableHeader', alignment: 'center', bold: true }, - col_6: { text: 'Receipt No', style: 'tableHeader', alignment: 'center', bold: true }, - //col_7: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, - col_7: { text: 'Mode of Payment', style: 'tableHeader', alignment: 'center', bold: true }, - col_8: { text: 'Status', style: 'tableHeader', alignment: 'center', bold: true }, - col_9: { text: 'Amount', style: 'tableHeader', alignment: 'center', bold: true }, - col_10: { text: 'Balance', style: 'tableHeader', alignment: 'center', bold: true }, - col_11: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, - col_12: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, - col_13: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, - col_14: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, - col_15: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true }, + col_1: { text: 'SLNO', style: 'tableHeader', alignment: 'center', bold: true }, + col_2: { text: 'Description', style: 'tableHeader', alignment: 'center', bold: true }, + col_3: { text: 'January', style: 'tableHeader', alignment: 'center', bold: true }, + col_4: { text: 'February', style: 'tableHeader', alignment: 'center', bold: true }, + col_5: { text: 'March', style: 'tableHeader', alignment: 'center', bold: true }, + col_6: { text: 'April', style: 'tableHeader', alignment: 'center', bold: true }, + col_7: { text: 'May', style: 'tableHeader', alignment: 'center', bold: true }, + col_8: { text: 'June', style: 'tableHeader', alignment: 'center', bold: true }, + col_9: { text: 'July', style: 'tableHeader', alignment: 'center', bold: true }, + col_10: { text: 'August', style: 'tableHeader', alignment: 'center', bold: true }, + col_11: { text: 'September', style: 'tableHeader', alignment: 'center', bold: true }, + col_12: { text: 'October', style: 'tableHeader', alignment: 'center', bold: true }, + col_13: { text: 'November', style: 'tableHeader', alignment: 'center', bold: true }, + col_14: { text: 'December', style: 'tableHeader', alignment: 'center', bold: true }, + col_15: { text: 'Total Amount', style: 'tableHeader', alignment: 'center', bold: true }, } } var body = []; @@ -222,21 +221,21 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle if (rows1.hasOwnProperty(key)) { var data = rows1[key]; var row = new Array(); - row.push(data.SNo.toString()); - row.push(data.Date.toString()); - row.push(data.PaidReceivedToFrom.toString()); - row.push(data.UnivCourseSem.toString()); - row.push(data.Type.toString()); - row.push(data.ReceiptNo.toString()); - row.push(data.ModeofPayment.toString()); - row.push(data.Status.toString()); - row.push(data.Amount.toString()); - row.push(data.Balance.toString()); - row.push(data.Comments.toString()); - row.push(data.Comments.toString()); - row.push(data.Comments.toString()); - row.push(data.Comments.toString()); - row.push(data.Comments.toString()); + row.push(data.SL_NO.toString()); + row.push(data.Expense_name.toString()); + row.push(data.January.toString()); + row.push(data.February.toString()); + row.push(data.March.toString()); + row.push(data.April.toString()); + row.push(data.May.toString()); + row.push(data.June.toString()); + row.push(data.July.toString()); + row.push(data.August.toString()); + row.push(data.September.toString()); + row.push(data.October.toString()); + row.push(data.November.toString()); + row.push(data.December.toString()); + row.push(data.total.toString()); body.push(row); } } diff --git a/Apollo/assets/views/report_expense.html b/Apollo/assets/views/report_expense.html index abdac786..28051684 100755 --- a/Apollo/assets/views/report_expense.html +++ b/Apollo/assets/views/report_expense.html @@ -90,7 +90,7 @@

Apollo Distance Education College - {{expense_data[0].branch}}

Expense Report {{filters.from_date | date : "dd-MM-yyyy"}} To {{filters.to_date | date : "dd-MM-yyyy"}}

- +