From a599586699e3125742d5aebc24021a8bbe246867 Mon Sep 17 00:00:00 2001 From: Shilpi Date: Wed, 21 Aug 2019 17:27:30 +0530 Subject: [PATCH] add total amount --- css/custom.css | 4 ++-- pages/registration.html | 4 +++- script.js | 46 ++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/css/custom.css b/css/custom.css index 5955428..3e14acf 100755 --- a/css/custom.css +++ b/css/custom.css @@ -1111,7 +1111,7 @@ input.hidden { } .apply-coupen-btn{ position: absolute; - bottom: 97px; + bottom: 117px; right: 13px; border: none; border-radius: 1px; @@ -1123,7 +1123,7 @@ input.hidden { .coupen-approved{ position: absolute; right: 86px;; - bottom: 98px; + bottom: 118px; color: rgb(66, 181, 73); font-size: 30px !important; } diff --git a/pages/registration.html b/pages/registration.html index 5f2241e..9317ac8 100644 --- a/pages/registration.html +++ b/pages/registration.html @@ -133,7 +133,9 @@
Fields marked with "*" are mandatory. - +
+
+ * Total Amount: ₹{{payingAmnt}}
diff --git a/script.js b/script.js index c0fee98..eb27984 100644 --- a/script.js +++ b/script.js @@ -750,7 +750,7 @@ $scope.ngShow = false; } } - + $scope.payingAmnt = 1180; $rootScope.tokenCall = function(val) { if (val == undefined) { $('#invalidToken').css('display', 'block'); @@ -764,11 +764,25 @@ .then(function(searchResult) { if (searchResult.data.length == 0) { $scope.tokencheck = false; - $scope.discountAmount = 0; + $scope.discountAmount = 0; + } else { $scope.discountpercentage = searchResult.data[0].discount; - $scope.tokencheck = true; - } + $scope.tokencheck = true; + } + $scope.ticketAmnt = 1180; + var amount = $scope.ticketAmnt * 100 + if($scope.tokencheck == true){ + var amount = $scope.ticketAmnt + if($scope.discountpercentage == "100") { + $scope.discountpercentage = "99.9"; + } + $scope.percDiscount = $scope.discountpercentage/100; + $scope.discountAmount = amount * $scope.percDiscount; + } + var taxAmount = $scope.ticketAmnt - $scope.discountAmount + $scope.payingAmnt = taxAmount; + $scope.payingAmnt = $scope.payingAmnt.toFixed() },function(err){ console.log(err) }); @@ -909,6 +923,26 @@ // } // }else{ + // $scope.ticketAmnt = 1180; + // var amount = $scope.ticketAmnt * 100 + // console.log("amount",amount) + // console.log("amount",$scope.tokencheck) + // if($scope.tokencheck == true){ + // var amount = $scope.ticketAmnt + // console.log("amount",amount) + // if($scope.discountpercentage == "100") { + // $scope.discountpercentage = "99.9"; + // } + // $scope.percDiscount = $scope.discountpercentage/100; + // console.log("$scope.percDiscount",$scope.percDiscount) + // $scope.discountAmount = amount * $scope.percDiscount; + // } + // console.log("$scope.discountAmount",$scope.discountAmount) + // var taxAmount = $scope.ticketAmnt - $scope.discountAmount + // console.log("taxAmount",taxAmount) + // $scope.payingAmnt = taxAmount; + // $scope.payingAmnt = $scope.payingAmnt.toFixed() + $scope.submit = function() { Analytics.trackEvent('register', 'click', 'Registration'); $scope.loading = true; @@ -983,11 +1017,11 @@ }); } var i = 0; - $scope.payingAmnt = $scope.payingAmnt * 100; + $scope.payingAmntt = $scope.payingAmnt * 100; var options = { //"key": "rzp_test_YwHsVFiDIQ2WUQ", "key": "rzp_live_mkmCb4FkstuWaS", - "amount": $scope.payingAmnt, + "amount": $scope.payingAmntt, "name": "Startup Jalsa", "description":"amount", -- 2.0.0