course details changes done
This commit is contained in:
parent
124e2d9e1e
commit
dd27c3104c
@ -17,11 +17,6 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
|
|
||||||
$scope.updateModel = {
|
$scope.updateModel = {
|
||||||
"feesType": "",
|
"feesType": "",
|
||||||
"sessionName": "",
|
|
||||||
"STF_WR": "",
|
|
||||||
"others": "",
|
|
||||||
"waiver": "",
|
|
||||||
"total": "",
|
|
||||||
"date": "",
|
"date": "",
|
||||||
"billNo": "",
|
"billNo": "",
|
||||||
"billAmount": "",
|
"billAmount": "",
|
||||||
@ -30,6 +25,14 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
"studComments":"",
|
"studComments":"",
|
||||||
"statusCode":""
|
"statusCode":""
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set model
|
||||||
|
* */
|
||||||
|
$scope.setModel = {
|
||||||
|
"feesType": "",
|
||||||
|
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* get payment options
|
* get payment options
|
||||||
@ -144,81 +147,33 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
* */
|
* */
|
||||||
$scope.editId=-1;
|
$scope.editId=-1;
|
||||||
$scope.updateFees = function (p) {
|
$scope.updateFees = function (p) {
|
||||||
|
$scope.viewId=-1
|
||||||
$scope.getStudentFeesStructure(p.ID,p.CourseID,p.StudentID);
|
$scope.getStudentFeesStructure(p.ID,p.CourseID,p.StudentID);
|
||||||
$scope.editId=p.ID;
|
$scope.editId=p.ID;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set fees for student
|
||||||
|
* */
|
||||||
|
$scope.viewId=-1;
|
||||||
|
$scope.setFees = function (p) {
|
||||||
|
$scope.editId=-1;
|
||||||
|
$scope.getStudentSetFees(p.ID,p.CourseID,p.StudentID);
|
||||||
|
$scope.viewId=p.ID;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* update total fees amount after change value
|
* update total fees amount after change value
|
||||||
* created by kms
|
* created by kms
|
||||||
* */
|
* */
|
||||||
$scope.changeTotalFees = function (model,type) {
|
$scope.changeTotalFees = function (model) {
|
||||||
if(type=='0'){
|
$scope.updateModel.billAmount = model.BalanceAmount;
|
||||||
if(model.feesType.PendingFees=='' || model.feesType.PendingFees==undefined){
|
|
||||||
$scope.courseAmt=0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.courseAmt=model.feesType.PendingFees;
|
|
||||||
}
|
|
||||||
if(model.feesType.STFOrWR=='' || model.feesType.STFOrWR==undefined || model.feesType.STFOrWR=='0'){
|
|
||||||
$scope.updateModel.STF_WR="";
|
|
||||||
$scope.STFWRAmt=0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.STFWRAmt=model.feesType.STFOrWR;
|
|
||||||
$scope.updateModel.STF_WR=model.feesType.STFOrWR;
|
|
||||||
}
|
|
||||||
if(model.feesType.Others=='' || model.feesType.Others==undefined || model.feesType.Others=='0'){
|
|
||||||
|
|
||||||
$scope.otherAmt=0;
|
|
||||||
$scope.updateModel.others="";
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.otherAmt=model.feesType.Others;
|
|
||||||
$scope.updateModel.others=model.feesType.Others;
|
|
||||||
}
|
|
||||||
if(model.feesType.Waiver=='' || model.feesType.Waiver==undefined || model.feesType.Waiver=='0'){
|
|
||||||
$scope.waiverAmt=0;
|
|
||||||
$scope.updateModel.waiver="";
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.updateModel.waiver=model.feesType.Waiver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else{
|
|
||||||
if(model.feesType.PendingFees=='' || model.feesType.PendingFees==undefined){
|
|
||||||
$scope.courseAmt=0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.courseAmt=model.feesType.PendingFees;
|
|
||||||
}
|
|
||||||
if(model.STF_WR=='' || model.STF_WR==undefined){
|
|
||||||
$scope.STFWRAmt=0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.STFWRAmt=model.STF_WR;
|
|
||||||
}
|
|
||||||
if(model.others=='' || model.others==undefined){
|
|
||||||
$scope.otherAmt=0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.otherAmt=model.others;
|
|
||||||
}
|
|
||||||
if(model.waiver=='' || model.waiver==undefined){
|
|
||||||
$scope.waiverAmt=0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$scope.waiverAmt=model.waiver;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$scope.updateModel.total = (parseFloat($scope.courseAmt)+parseFloat($scope.STFWRAmt)+parseFloat($scope.otherAmt))-parseFloat($scope.waiverAmt);
|
|
||||||
$scope.updateModel.billAmount = (parseFloat($scope.courseAmt)+parseFloat($scope.STFWRAmt)+parseFloat($scope.otherAmt))-parseFloat($scope.waiverAmt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -267,12 +222,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
data: {
|
data: {
|
||||||
studID: myModel.StudentID,
|
studID: myModel.StudentID,
|
||||||
courseID:myModel.CourseID,
|
courseID:myModel.CourseID,
|
||||||
courseAmount:updateModel.feesType.PendingFees,
|
courseAmount:updateModel.feesType.ActualFees,
|
||||||
feesID: updateModel.feesType.ID,
|
feesID: updateModel.feesType.FeesID,
|
||||||
STFWR:updateModel.STF_WR,
|
|
||||||
waiver: updateModel.waiver,
|
|
||||||
other: updateModel.others,
|
|
||||||
session: updateModel.sessionName,
|
|
||||||
billNO: updateModel.billNo,
|
billNO: updateModel.billNo,
|
||||||
billDate: $scope.billDate,
|
billDate: $scope.billDate,
|
||||||
billAmount:updateModel.billAmount,
|
billAmount:updateModel.billAmount,
|
||||||
@ -293,8 +244,6 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
if (response.data.status==200 && response.data.paidStatus) {
|
if (response.data.status==200 && response.data.paidStatus) {
|
||||||
$scope.ldloading[loading.replace('-', '_')] = false;
|
$scope.ldloading[loading.replace('-', '_')] = false;
|
||||||
swal("Success!", response.data.message, "success");
|
swal("Success!", response.data.message, "success");
|
||||||
|
|
||||||
$scope.getStudentFeesStructure(myModel.ID,myModel.CourseID,myModel.StudentID);
|
|
||||||
$scope.updateModel = {
|
$scope.updateModel = {
|
||||||
"feesType": "",
|
"feesType": "",
|
||||||
"sessionName": "",
|
"sessionName": "",
|
||||||
@ -311,11 +260,82 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
"statusCode":""
|
"statusCode":""
|
||||||
|
|
||||||
};
|
};
|
||||||
|
$scope.getStudentFeesStructure(myModel.ID,myModel.CourseID,myModel.StudentID);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$scope.ldloading[loading.replace('-', '_')] = false;
|
$scope.ldloading[loading.replace('-', '_')] = false;
|
||||||
swal("Failed!", response.data.message, "error");
|
swal("Failed!", response.data.message, "error");
|
||||||
$scope.getStudentFeesStructure(myModel.ID,myModel.CourseID,myModel.StudentID);
|
//$scope.getStudentFeesStructure(myModel.ID,myModel.CourseID,myModel.StudentID);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
* set fees for student
|
||||||
|
* */
|
||||||
|
$scope.submitFeesForStudent = function (myModel, form,updateModel, loading) {
|
||||||
|
var firstError = null;
|
||||||
|
if (form.$invalid) {
|
||||||
|
var field = null, firstError = null;
|
||||||
|
for (field in form) {
|
||||||
|
if (field[0] != '$') {
|
||||||
|
if (firstError === null && !form[field].$valid) {
|
||||||
|
firstError = form[field].$stop_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (form[field].$pristine) {
|
||||||
|
form[field].$dirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||||
|
} else {
|
||||||
|
$scope.ldloading5 = {};
|
||||||
|
|
||||||
|
$scope.ldloading5[loading.replace('-', '_')] = true;
|
||||||
|
|
||||||
|
|
||||||
|
var updateFees = {
|
||||||
|
method: 'POST',
|
||||||
|
url: apiPoint.url + 'setFeesForStudent/',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
studID: myModel.StudentID,
|
||||||
|
courseID:myModel.CourseID,
|
||||||
|
courseAmount:updateModel.ActualFees,
|
||||||
|
feesID: updateModel.ID,
|
||||||
|
STFWR:updateModel.STFOrWR,
|
||||||
|
waiver: updateModel.Waiver,
|
||||||
|
other: updateModel.Others,
|
||||||
|
session: updateModel.SessionName,
|
||||||
|
rollNo: updateModel.RollNo,
|
||||||
|
|
||||||
|
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$http(updateFees).then(function (response) {
|
||||||
|
if (response.data.status==200 && response.data.setStatus) {
|
||||||
|
$scope.ldloading5[loading.replace('-', '_')] = false;
|
||||||
|
swal("Success!", response.data.message, "success");
|
||||||
|
|
||||||
|
$scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
|
||||||
|
$scope.setModel = {
|
||||||
|
"feesType": "",
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$scope.ldloading5[loading.replace('-', '_')] = false;
|
||||||
|
swal("Failed!", response.data.message, "error");
|
||||||
|
$scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -327,6 +347,10 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
* */
|
* */
|
||||||
$scope.studentFeesInfo="";
|
$scope.studentFeesInfo="";
|
||||||
$scope.getStudentFeesStructure = function(ID,courseID,studeID){
|
$scope.getStudentFeesStructure = function(ID,courseID,studeID){
|
||||||
|
$scope.updateModel = {
|
||||||
|
"feesType": "",
|
||||||
|
|
||||||
|
};
|
||||||
$scope.studentFeesInfo="";
|
$scope.studentFeesInfo="";
|
||||||
$scope.existStudentFeesDetails="";
|
$scope.existStudentFeesDetails="";
|
||||||
$scope.getFeesUpdateStatus="";
|
$scope.getFeesUpdateStatus="";
|
||||||
@ -349,21 +373,75 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
|||||||
$scope.existStudentFeesDetails = response.data.getExistStudentFeesDetails;
|
$scope.existStudentFeesDetails = response.data.getExistStudentFeesDetails;
|
||||||
$scope.getFeesUpdateStatus = response.data.getFeesUpdateStatus;
|
$scope.getFeesUpdateStatus = response.data.getFeesUpdateStatus;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$scope.studentFeesInfo="";
|
$scope.studentFeesInfo="";
|
||||||
$scope.existStudentFeesDetails="";
|
$scope.existStudentFeesDetails="";
|
||||||
$scope.getFeesUpdateStatus="";
|
$scope.getFeesUpdateStatus="";
|
||||||
|
swal("Warning!", response.data.message, "warning");
|
||||||
|
$scope.editId=-1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* get student set fees details
|
||||||
|
* */
|
||||||
|
$scope.feesStructureInfo="";
|
||||||
|
$scope.getStudentSetFees = function (ID,courseID,studeID) {
|
||||||
|
$scope.feesStructureInfo="";
|
||||||
|
var setFees = {
|
||||||
|
method: 'POST',
|
||||||
|
url: apiPoint.url + 'getStudentFeesAssign/',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
ID:ID,
|
||||||
|
courseID: courseID,
|
||||||
|
studentID: studeID,
|
||||||
|
requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$http(setFees).then(function (response) {
|
||||||
|
if (response.data.status==200 && response.data.feesStatus) {
|
||||||
|
$scope.feesStructureInfo=response.data.feesDetails;
|
||||||
|
$scope.setModel = {
|
||||||
|
"feesType": "",
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$scope.feesStructureInfo="";
|
||||||
|
$scope.setModel = {
|
||||||
|
"feesType": "",
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set course fees amount
|
||||||
|
* */
|
||||||
|
/* $scope.changeFeesValues = function (model) {
|
||||||
|
console.log(model);
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
$scope.cancel = function () {
|
$scope.cancel = function () {
|
||||||
$scope.editId=-1;
|
$scope.editId=-1;
|
||||||
$scope.studentFeesInfo="";
|
$scope.studentFeesInfo="";
|
||||||
$scope.existStudentFeesDetails="";
|
$scope.existStudentFeesDetails="";
|
||||||
$scope.getFeesUpdateStatus="";
|
$scope.getFeesUpdateStatus="";
|
||||||
|
$scope.viewId=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user