fees status changes done
This commit is contained in:
parent
68b1177b02
commit
eefae8182c
@ -1876,26 +1876,18 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
|
||||
* created by kms
|
||||
* */
|
||||
$scope.calculateDueAmount = function (beforeTot,afterTot) {
|
||||
if(parseInt(beforeTot)<parseInt(afterTot)){
|
||||
$scope.finalTotAmt=parseInt(afterTot)-parseInt(beforeTot);
|
||||
$scope.getInsTotAmt=0;
|
||||
for(var i=0;i<$rootScope.updateMoreItems.length-1;i++){
|
||||
$scope.getInsTotAmt=parseInt($scope.getInsTotAmt) + parseInt($rootScope.updateMoreItems[i].Amount);
|
||||
}
|
||||
if(parseInt(afterTot)>0 && parseInt(afterTot)>parseInt($scope.getInsTotAmt)){
|
||||
$scope.finalTotAmt=parseInt(afterTot)-parseInt($scope.getInsTotAmt);
|
||||
$rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount = parseInt($scope.finalTotAmt);
|
||||
|
||||
}
|
||||
else{
|
||||
$scope.finalTotAmt=parseInt(afterTot)-parseInt(beforeTot);
|
||||
}
|
||||
if($rootScope.updateMoreItems.length>0){
|
||||
if(parseInt($scope.finalTotAmt)>0){
|
||||
$rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount = parseInt($rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount) + parseInt($scope.finalTotAmt);
|
||||
|
||||
}
|
||||
else{
|
||||
if(parseInt($rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount)<parseInt($scope.finalTotAmt)){
|
||||
$rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount=0;
|
||||
}
|
||||
else{
|
||||
$rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount=parseInt($rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount) + parseInt($scope.finalTotAmt);
|
||||
}
|
||||
|
||||
}
|
||||
$scope.finalTotAmt=0;
|
||||
$rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].Amount = parseInt($scope.finalTotAmt);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user