var origValue = 0 //keeping pending value in original state
$scope.GetTotalAmount = function (data) {
var popDiscAmount = $scope.DiscAmount;
var popDiscAmount1 = $scope.DiscAmount1;
if (origValue == 0) {
origValue = $scope.ReceiptsViewModel.Amount;
}
$scope.ReceiptsViewModel.Amount = (origValue - popDiscAmount);
$scope.ReceiptsViewModel.Amount = ($scope.ReceiptsViewModel.Amount popDiscAmount1);
$scope.ReceiptsViewModel.Amount = ($scope.ReceiptsViewModel.Amount - $scope.AdjustAmount );
calculations are working properly,but when i changing discAmount to10 total value showing NaN, same for discAmount1,
but when i enter AdjustAmount 20, total value adjusting 1000-(10+10+20)=960 showing total value correctly, after closing popup
discAmount changed with 10, amount should subtract by 10 from amount , same for discAmount1 also ,