course details changes done
This commit is contained in:
parent
320cf96104
commit
54d906b890
@ -34,6 +34,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
$scope.setModel = {
|
||||
"feesType": "",
|
||||
|
||||
|
||||
};
|
||||
/*
|
||||
* get payment options
|
||||
@ -274,7 +275,9 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
/*
|
||||
* set fees for student
|
||||
* */
|
||||
$scope.submitFeesForStudent = function (myModel, form,updateModel, loading) {
|
||||
$scope.submitFeesForStudent = function (myModel, form,updateModel, loading,installment) {
|
||||
|
||||
|
||||
var firstError = null;
|
||||
if (form.$invalid) {
|
||||
var field = null, firstError = null;
|
||||
@ -291,6 +294,32 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
}
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
} else {
|
||||
if(isNaN(installment.date)){
|
||||
$scope.pushDueDate1= $rootScope.lastInstallemtDate;
|
||||
}
|
||||
else{
|
||||
$scope.convertGetDate1=new Date(installment.date).toDateString();
|
||||
$scope.pushDueDate1 = $filter('date')(new Date($scope.convertGetDate1), 'dd-MM-yyyy');
|
||||
|
||||
}
|
||||
if(installment.ID !='' && installment.ID !==null && installment.ID !=undefined){
|
||||
$rootScope.updateMoreItems.push({
|
||||
ID: installment.ID,
|
||||
Name: installment.name,
|
||||
Amount: installment.amount,
|
||||
DueDate: $scope.pushDueDate1
|
||||
});
|
||||
}
|
||||
else{
|
||||
$rootScope.updateMoreItems.push({
|
||||
ID: "",
|
||||
Name: installment.name,
|
||||
Amount: installment.amount,
|
||||
DueDate: $scope.pushDueDate1
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$scope.ldloading5 = {};
|
||||
|
||||
$scope.ldloading5[loading.replace('-', '_')] = true;
|
||||
@ -312,9 +341,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
other: updateModel.Others,
|
||||
session: updateModel.SessionName,
|
||||
rollNo: updateModel.RollNo,
|
||||
|
||||
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
|
||||
installmentItems:$rootScope.updateMoreItems
|
||||
|
||||
}
|
||||
};
|
||||
@ -327,12 +355,18 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
/*$scope.setModel = {
|
||||
"feesType": "",
|
||||
};*/
|
||||
$scope.myModelInstallemt.ID="";
|
||||
$scope.myModelInstallemt.name="";
|
||||
$scope.myModelInstallemt.amount="";
|
||||
$scope.myModelInstallemt.date="";
|
||||
$rootScope.updateMoreItems=[];
|
||||
form.$setPristine(true);
|
||||
|
||||
} else {
|
||||
$scope.ldloading5[loading.replace('-', '_')] = false;
|
||||
swal("Failed!", response.data.message, "error");
|
||||
$scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
|
||||
$rootScope.updateMoreItems.splice($scope.updateMoreItems.length-1);
|
||||
// $scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
|
||||
}
|
||||
|
||||
});
|
||||
@ -390,6 +424,12 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
$scope.feesStructureInfo="";
|
||||
$scope.getStudentSetFees = function (ID,courseID,studeID) {
|
||||
$scope.feesStructureInfo="";
|
||||
$scope.myModelInstallemt.ID="";
|
||||
$scope.myModelInstallemt.name="";
|
||||
$scope.myModelInstallemt.amount="";
|
||||
$scope.myModelInstallemt.date="";
|
||||
$rootScope.lastInstallemtDate="";
|
||||
$rootScope.updateMoreItems=[];
|
||||
var setFees = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'getStudentFeesAssign/',
|
||||
@ -409,14 +449,12 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
$scope.setModel = {
|
||||
"feesType": "",
|
||||
|
||||
|
||||
};
|
||||
|
||||
} else {
|
||||
$scope.feesStructureInfo="";
|
||||
$scope.setModel = {
|
||||
"feesType": "",
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -424,22 +462,114 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* set course fees amount
|
||||
* */
|
||||
/* $scope.changeFeesValues = function (model) {
|
||||
console.log(model);
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
$scope.cancel = function () {
|
||||
$scope.editId=-1;
|
||||
$scope.studentFeesInfo="";
|
||||
$scope.existStudentFeesDetails="";
|
||||
$scope.getFeesUpdateStatus="";
|
||||
|
||||
$scope.viewId=-1;
|
||||
}
|
||||
/*
|
||||
* get add more installment array
|
||||
* created by kms
|
||||
* */
|
||||
|
||||
$scope.myModelInstallemt = {
|
||||
"ID":"",
|
||||
"amount":"",
|
||||
"name":"",
|
||||
"date":"",
|
||||
|
||||
|
||||
};
|
||||
$rootScope.updateMoreItems=[];
|
||||
$rootScope.clickMoreItems = function (model,form,setModel) {
|
||||
$scope.convertGetDate='';
|
||||
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 {
|
||||
|
||||
if(isNaN(model.date)){
|
||||
$scope.pushDueDate= $rootScope.lastInstallemtDate;
|
||||
}
|
||||
else{
|
||||
$scope.convertGetDate=new Date(model.date).toDateString();
|
||||
$scope.pushDueDate = $filter('date')(new Date($scope.convertGetDate), 'dd-MM-yyyy');
|
||||
|
||||
}
|
||||
if(model.ID !='' && model.ID !==null && model.ID !=undefined){
|
||||
$rootScope.updateMoreItems.push({
|
||||
ID:model.ID,
|
||||
Name: model.name,
|
||||
Amount: model.amount,
|
||||
DueDate: $scope.pushDueDate
|
||||
});
|
||||
}
|
||||
else{
|
||||
$rootScope.updateMoreItems.push({
|
||||
ID:"",
|
||||
Name: model.name,
|
||||
Amount: model.amount,
|
||||
DueDate: $scope.pushDueDate
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$scope.myModelInstallemt.ID="";
|
||||
$scope.myModelInstallemt.name="";
|
||||
$scope.myModelInstallemt.amount="";
|
||||
$scope.myModelInstallemt.date="";
|
||||
}
|
||||
}
|
||||
/*
|
||||
* change installment values
|
||||
* */
|
||||
$scope.changeInstallemt = function (model,form) {
|
||||
$rootScope.updateMoreItems=[];
|
||||
|
||||
if(model.InstallmentDetails != ''){
|
||||
$scope.myModelInstallemt.ID=model.InstallmentDetails[model.InstallmentDetails.length-1].ID;
|
||||
|
||||
$scope.myModelInstallemt.name=model.InstallmentDetails[model.InstallmentDetails.length-1].Name;
|
||||
$scope.myModelInstallemt.amount=model.InstallmentDetails[model.InstallmentDetails.length-1].Amount;
|
||||
$scope.myModelInstallemt.date=model.InstallmentDetails[model.InstallmentDetails.length-1].DueDate;
|
||||
$rootScope.lastInstallemtDate = $scope.myModelInstallemt.date;
|
||||
for(var i=0; i < model.InstallmentDetails.length-1; i++){
|
||||
$rootScope.updateMoreItems.push(model.InstallmentDetails[i]);
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
$scope.myModelInstallemt.ID="";
|
||||
$scope.myModelInstallemt.name="";
|
||||
$scope.myModelInstallemt.amount="";
|
||||
$scope.myModelInstallemt.date="";
|
||||
$rootScope.lastInstallemtDate="";
|
||||
}
|
||||
|
||||
form.$setPristine(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -476,6 +606,8 @@ app.controller('ModalDemoCtrl', ["$scope", "$modal", "$log", function ($scope, $
|
||||
$log.info('Modal dismissed at: ' + new Date());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
}]);
|
||||
|
||||
// Please note that $modalInstance represents a modal window (instance) dependency.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user