From 794300910673426aee10274b70650f687a197a2a Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 23 Feb 2018 10:48:30 +0530 Subject: [PATCH] course details changes done --- .../assets/js/controllers/feesStatusCtrl.js | 123 +++++++++++++----- 1 file changed, 93 insertions(+), 30 deletions(-) diff --git a/Apollo/assets/js/controllers/feesStatusCtrl.js b/Apollo/assets/js/controllers/feesStatusCtrl.js index 19b0a4a2..79e598fe 100755 --- a/Apollo/assets/js/controllers/feesStatusCtrl.js +++ b/Apollo/assets/js/controllers/feesStatusCtrl.js @@ -887,16 +887,17 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n var dayDiff = moment().diff(bDate, 'days'); var todatlFineAmt = 0; var fineAmt1 = 0; - var fineAmt2 = 0; - var fineAmt3 = 0; - var fineAmt4 = 0; - var fineAmt5 = 0; - var fineAmt6 = 0; - var fineAmt7 = 0; - var fineAmt8 = 0; - var fineAmt9 = 0; - var fineAmt10 = 0; + // var fineAmt2 = 0; + // var fineAmt3 = 0; + // var fineAmt4 = 0; + // var fineAmt5 = 0; + // var fineAmt6 = 0; + // var fineAmt7 = 0; + // var fineAmt8 = 0; + // var fineAmt9 = 0; + // var fineAmt10 = 0; var fineAmt11 = 0; + var countDays = 0; for (var k = 1; k <= dayDiff; k++) { if (k <= 90) { @@ -913,7 +914,23 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n } } - else if (k > 90) { + else { + countDays = countDays+1; + + if (countDays<30) { + if(countDays==1){ + fineAmt11 = parseInt(fineAmt11)+300; + } + + + // foo++; + } + else{ + countDays=0; + + } + } + /*else if (k > 90) { if (k > 90 && k <= 120) { fineAmt2 = 300; @@ -956,10 +973,12 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n } - } + }*/ } - todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt2) + parseInt(fineAmt3) + parseInt(fineAmt4) + parseInt(fineAmt5) + parseInt(fineAmt6) + parseInt(fineAmt7) + parseInt(fineAmt8) + parseInt(fineAmt9) + parseInt(fineAmt10) + parseInt(fineAmt11); + // todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt2) + parseInt(fineAmt3) + parseInt(fineAmt4) + parseInt(fineAmt5) + parseInt(fineAmt6) + parseInt(fineAmt7) + parseInt(fineAmt8) + parseInt(fineAmt9) + parseInt(fineAmt10) + parseInt(fineAmt11); + todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt11); + if(type=='1'){ $scope.setTotalAmount = Math.round(parseInt(totAmt) + parseInt(todatlFineAmt)-parseInt(other)); $scope.setModel.feesType.Others = Math.round(parseInt(todatlFineAmt)); @@ -1089,20 +1108,25 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n var dayDiff = exDatenew1.diff(exBatchDate, 'days'); dayDiff = dayDiff+1; + alert(dayDiff); var todatlFineAmt = 0; var fineAmt1 = 0; - var fineAmt2 = 0; - var fineAmt3 = 0; - var fineAmt4 = 0; - var fineAmt5 = 0; - var fineAmt6 = 0; - var fineAmt7 = 0; - var fineAmt8 = 0; - var fineAmt9 = 0; - var fineAmt10 = 0; + // var fineAmt2 = 0; + // var fineAmt3 = 0; + // var fineAmt4 = 0; + // var fineAmt5 = 0; + // var fineAmt6 = 0; + // var fineAmt7 = 0; + // var fineAmt8 = 0; + // var fineAmt9 = 0; + // var fineAmt10 = 0; var fineAmt11 = 0; + var countDays = 0; + for (var k = 1; k <= dayDiff; k++) { + + if (k <= 90) { if (exitPayAmt <= 10000) { @@ -1117,7 +1141,23 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n } } - else if (k > 90) { + else { + countDays = countDays+1; + + if (countDays<30) { + if(countDays==1){ + fineAmt11 = parseInt(fineAmt11)+300; + } + + + // foo++; + } + else{ + countDays=0; + + } + } + /* else if (k > 90) { if (k > 90 && k <= 120) { fineAmt2 = 300; @@ -1156,14 +1196,28 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n } else { - fineAmt11 = 300; + countDays = countDays+1; + + if (countDays<30) { + if(countDays==1){ + fineAmt11 = parseInt(fineAmt11)+300; + } + + + // foo++; + } + else{ + countDays=0; + + } } - } + }*/ } - todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt2) + parseInt(fineAmt3) + parseInt(fineAmt4) + parseInt(fineAmt5) + parseInt(fineAmt6) + parseInt(fineAmt7) + parseInt(fineAmt8) + parseInt(fineAmt9) + parseInt(fineAmt10) + parseInt(fineAmt11); + // todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt2) + parseInt(fineAmt3) + parseInt(fineAmt4) + parseInt(fineAmt5) + parseInt(fineAmt6) + parseInt(fineAmt7) + parseInt(fineAmt8) + parseInt(fineAmt9) + parseInt(fineAmt10) + parseInt(fineAmt11); + todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt11); if(type1=='2'){ $scope.setTotalAmount = Math.round(parseInt(totAmt) -parseInt(other) + parseInt(todatlFineAmt)); $scope.setModel.feesType.Others = Math.round(parseInt(todatlFineAmt)); @@ -1245,19 +1299,28 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n } - - /* $scope.$watch('updateMoreItems', function (newValue, oldValue) { +/* + $scope.$watch('updateMoreItems', function (newValue, oldValue) { for (var i = 0; i < newValue.length; i++) { if (newValue[i].Amount != oldValue[i].Amount) { + var currentValue=0; + var pastValue=0; if(newValue[i].Amount>oldValue[i].Amount){ - var currentValue = parseInt(newValue[i].Amount)-oldValue[i].Amount; + currentValue = parseInt(newValue[i].Amount)-oldValue[i].Amount; } - else{ - var currentValue = oldValue[i].Amount-parseInt(newValue[i].Amount); + else if(newValue[i].Amount