-
-
-
Some text in the modal.
-
-
diff --git a/script.js b/script.js
index a62dd3f..1a1e80e 100644
--- a/script.js
+++ b/script.js
@@ -47,11 +47,11 @@
$scope.author = 'Swarn Singh';
$scope.data = {};
$scope.data.stage = 'Idea';
-
+ $scope.discountAmount = 0;
//$scope.data.email = '';
$scope.check = false;
$scope.numberCheck = false;
- $scope.tokencheck = false;
+ // $scope.tokencheck = false;
$scope.paymentResult = {};
var BASE_URL = "http://0.0.0.0:4001/api";
var data = {
@@ -101,6 +101,7 @@
console.log("searchResult===>", searchResult)
if (searchResult.data.length == 0) {
$scope.numberCheck = false;
+
} else {
$scope.numberCheck = true;
$('#noExist').css('display', 'block');
@@ -118,9 +119,8 @@
.then(function(searchResult) {
if (searchResult.data.length == 0) {
$scope.tokencheck = false;
- console.log("kuch ni haiga")
+ $scope.discountAmount = 0;
} else {
- console.log("haiga g haiga")
$scope.tokencheck = true;
// $('#alreadyExist').css('display', 'block');
}
@@ -177,30 +177,38 @@
}
- /*****THIS IS FOR STEP THREE FORM ******/
- $scope.create = function() {
- console.log("$scope.data.identity", $scope.data.identity)
- /*****PAYMENT WITH 18% GST*****/
- if ($scope.data.stage == "Idea") {
+
+ $scope.calculateAmount = function(){
+ if ($scope.data.stage == "Idea") {
console.log("$scope.data", $scope.data)
- $scope.payingAmnt = 59000;
+ $scope.ticketAmnt = 500;
}
if ($scope.data.stage == "Product") {
- $scope.payingAmnt = 118000;
+ $scope.ticketAmnt = 1000;
}
if ($scope.data.stage == "Growth") {
- $scope.payingAmnt = 236000;
+ $scope.ticketAmnt = 2000;
}
if($scope.tokencheck == true){
- var amount = $scope.payingAmnt
- var discountAmount = (amount * 10)/100
- $scope.payingAmnt = amount - discountAmount
+ var amount = $scope.ticketAmnt
+ $scope.discountAmount = (amount * 10)/100
console.log("finalAmount====>",$scope.payingAmnt)
}
+ var taxAmount = $scope.ticketAmnt - $scope.discountAmount
+ $scope.taxTotal = (taxAmount * 18)/100
+ $scope.payingAmnt = taxAmount + $scope.taxTotal
+ console.log("taxincludedamount----", $scope.payingAmnt)
+ }
+
+ /*****THIS IS FOR STEP THREE FORM ******/
+ $scope.create = function() {
+ console.log("$scope.data.identity", $scope.data.identity)
+ /*****PAYMENT WITH 18% GST*****/
+
if ($scope.data.name == undefined || $scope.data.email == undefined || $scope.data.number == undefined) {
var x = document.getElementById("snackbar")
@@ -210,7 +218,6 @@
}, 3000);
} else if ($scope.data.name != undefined && $scope.data.email != undefined && $scope.data.number != undefined) {
- var BASE_URL = "http://0.0.0.0:4001/api";
// if($scope.data.identity == "student"){
@@ -254,7 +261,7 @@
data.applicantId = result.data.id;
$scope.userId = result.data.id;
console.log("=====data=====", data)
- data.amount = $scope.payingAmnt / 100;
+ data.amount = $scope.payingAmnt;
if ($scope.detail != null) {
$http({
method: 'POST',
@@ -266,6 +273,7 @@
}, function myError(error) {});
}
var i = 0;
+ $scope.payingAmnt = $scope.payingAmnt * 100;
var options = {
"key": "rzp_test_YwHsVFiDIQ2WUQ",
"amount": $scope.payingAmnt,