Commit 7f6e3b1df9414393ab94488199965e8bf37dedd0
1 parent
4f1de64cdb
Exists in
master
final code
Showing
21 changed files
with
30 additions
and
431 deletions
Show diff stats
app/partials/FuelVendors/FuelVendors.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | 5 | ||
6 | .controller('FuelVendorsController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'FuelVendorsService', 'CustomersService', 'ViewFuelVendorService', 'NgTableParams', FuelVendorsController]); | 6 | .controller('FuelVendorsController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'FuelVendorsService', 'CustomersService', 'ViewFuelVendorService', 'NgTableParams', FuelVendorsController]); |
7 | 7 | ||
8 | function FuelVendorsController($scope, $rootScope, $uibModal, $filter, $http, FuelVendorsService, CustomersService, ViewFuelVendorService, NgTableParams) { | 8 | function FuelVendorsController($scope, $rootScope, $uibModal, $filter, $http, FuelVendorsService, CustomersService, ViewFuelVendorService, NgTableParams) { |
9 | 9 | ||
10 | /*$(document).ready(function() { | 10 | |
11 | $scope.showLoader = true; | ||
12 | $('#example').DataTable(); | ||
13 | $scope.showLoader = false; | ||
14 | });*/ | ||
15 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) | 11 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) |
16 | $scope.reset = function(){ | 12 | $scope.reset = function(){ |
17 | $("input").val(""); | 13 | $("input").val(""); |
18 | $scope.removeMarginValidation(); | 14 | $scope.removeMarginValidation(); |
19 | } | 15 | } |
20 | 16 | ||
21 | $scope.data = {}; | 17 | $scope.data = {}; |
22 | $scope.data.activate = true; | 18 | $scope.data.activate = true; |
23 | $scope.showLoader = false; | 19 | $scope.showLoader = false; |
24 | 20 | ||
25 | 21 | ||
26 | getAllVendor(); | 22 | getAllVendor(); |
27 | 23 | ||
28 | function getAllVendor(){ | 24 | function getAllVendor(){ |
29 | $scope.showLoader = true; | 25 | $scope.showLoader = true; |
30 | FuelVendorsService.getAllVendor().then(function(result) { | 26 | FuelVendorsService.getAllVendor().then(function(result) { |
31 | //console.log(result) | 27 | //console.log(result) |
32 | $scope.companyList = result; | 28 | $scope.companyList = result; |
33 | for (var i = 0; i < $scope.companyList.length; i++) { | 29 | for (var i = 0; i < $scope.companyList.length; i++) { |
34 | if ($scope.companyList[i].companyContact != null) { | 30 | if ($scope.companyList[i].companyContact != null) { |
35 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { | 31 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { |
36 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; | 32 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; |
37 | } | 33 | } |
38 | } | 34 | } |
39 | if ($scope.companyList[i].primaryContact != null) { | 35 | if ($scope.companyList[i].primaryContact != null) { |
40 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { | 36 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { |
41 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; | 37 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; |
42 | } | 38 | } |
43 | } | 39 | } |
44 | if ($scope.companyList[i].margin != null) { | 40 | if ($scope.companyList[i].margin != null) { |
45 | if ($scope.companyList[i].margin.marginName != null) { | 41 | if ($scope.companyList[i].margin.marginName != null) { |
46 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 42 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
47 | } | 43 | } |
48 | } | 44 | } |
49 | $scope.companyList[i].source = "Vendor" | 45 | $scope.companyList[i].source = "Vendor" |
50 | } | 46 | } |
51 | $scope.displayVendorList = new NgTableParams({ | 47 | $scope.displayVendorList = new NgTableParams({ |
52 | page: 1, | 48 | page: 1, |
53 | count: 10, | 49 | count: 10, |
54 | }, { | 50 | }, { |
55 | data: $scope.companyList | 51 | data: $scope.companyList |
56 | }); | 52 | }); |
57 | $scope.showLoader = false; | 53 | $scope.showLoader = false; |
58 | }) | 54 | }) |
59 | } | 55 | } |
60 | 56 | ||
61 | $scope.editMargin = function(vendor){ | 57 | $scope.editMargin = function(vendor){ |
62 | $scope.showLoader = true; | 58 | $scope.showLoader = true; |
63 | var companyMargin = "vendorName=" + vendor.vendorName + "&masterMargin=" + vendor.masterMargin | 59 | var companyMargin = "vendorName=" + vendor.vendorName + "&masterMargin=" + vendor.masterMargin |
64 | + "&addressOne=" + vendor.addressOne + "&addressTwo=" + vendor.addressTwo + "&city=" + vendor.city + "&state=" | 60 | + "&addressOne=" + vendor.addressOne + "&addressTwo=" + vendor.addressTwo + "&city=" + vendor.city + "&state=" |
65 | + vendor.state + "&country=" + vendor.country + "&zipcode=" + vendor.zipcode + "&internalNote=" | 61 | + vendor.state + "&country=" + vendor.country + "&zipcode=" + vendor.zipcode + "&internalNote=" |
66 | + vendor.internalNote + "&certificateType=" + vendor.certificateType + "&baseTenant=" + vendor.baseTenant | 62 | + vendor.internalNote + "&certificateType=" + vendor.certificateType + "&baseTenant=" + vendor.baseTenant |
67 | + "&fuelerlinxvendor=" + vendor.fuelerlinxvendor + "&contractFuelVendor=" + vendor.contractFuelVendor | 63 | + "&fuelerlinxvendor=" + vendor.fuelerlinxvendor + "&contractFuelVendor=" + vendor.contractFuelVendor |
68 | + "&activate=" + vendor.activate + "&baseIcao=" + vendor.baseIcao + "&vendorId=" + vendor.id; | 64 | + "&activate=" + vendor.activate + "&baseIcao=" + vendor.baseIcao + "&vendorId=" + vendor.id; |
69 | 65 | ||
70 | ViewFuelVendorService.updateContact(companyMargin).then(function(result) { | 66 | ViewFuelVendorService.updateContact(companyMargin).then(function(result) { |
71 | if(result != null && result.success){ | 67 | if(result != null && result.success){ |
72 | $scope.showLoader = false; | 68 | $scope.showLoader = false; |
73 | toastr.success(''+result.success+'', { | 69 | toastr.success(''+result.success+'', { |
74 | closeButton: true | 70 | closeButton: true |
75 | }) | 71 | }) |
76 | }else{ | 72 | }else{ |
77 | $scope.showLoader = false; | 73 | $scope.showLoader = false; |
78 | toastr.error(''+result.statusText+'', { | 74 | toastr.error(''+result.statusText+'', { |
79 | closeButton: true | 75 | closeButton: true |
80 | }) | 76 | }) |
81 | } | 77 | } |
82 | }) | 78 | }) |
83 | } | 79 | } |
84 | 80 | ||
85 | // CustomersService.getMargin().then(function(result) { | 81 | |
86 | // $scope.marginList = result; | ||
87 | // }) | ||
88 | 82 | ||
89 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 83 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
90 | $scope.jetMarginList = result; | 84 | $scope.jetMarginList = result; |
91 | }) | 85 | }) |
92 | 86 | ||
93 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 87 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
94 | $scope.avgsMarginList = result; | 88 | $scope.avgsMarginList = result; |
95 | }) | 89 | }) |
96 | 90 | ||
97 | $scope.showCompanyError = false; | 91 | $scope.showCompanyError = false; |
98 | $scope.showMarginError = false; | 92 | $scope.showMarginError = false; |
99 | 93 | ||
100 | $scope.removeValidation = function(){ | 94 | $scope.removeValidation = function(){ |
101 | $scope.showCompanyError = false; | 95 | $scope.showCompanyError = false; |
102 | $('.companyNameInput').removeClass('customErrorInput'); | 96 | $('.companyNameInput').removeClass('customErrorInput'); |
103 | } | 97 | } |
104 | 98 | ||
105 | $scope.removeMarginValidation = function(){ | 99 | $scope.removeMarginValidation = function(){ |
106 | $scope.showMarginError = false; | 100 | $scope.showMarginError = false; |
107 | $('.marginSelectBox').removeClass('customErrorInput'); | 101 | $('.marginSelectBox').removeClass('customErrorInput'); |
108 | } | 102 | } |
109 | 103 | ||
110 | $scope.marginFilterOptions = []; | 104 | $scope.marginFilterOptions = []; |
111 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 105 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
112 | $scope.jetMarginList = result; | 106 | $scope.jetMarginList = result; |
113 | $scope.marginFilterOptions.push({ | 107 | $scope.marginFilterOptions.push({ |
114 | 'id': '', 'title': 'Show All' | 108 | 'id': '', 'title': 'Show All' |
115 | }); | 109 | }); |
116 | for (var i = 0; i < result.length; i++) { | 110 | for (var i = 0; i < result.length; i++) { |
117 | $scope.marginFilterOptions.push({ | 111 | $scope.marginFilterOptions.push({ |
118 | 'id': result[i].id, | 112 | 'id': result[i].id, |
119 | 'title': result[i].marginName | 113 | 'title': result[i].marginName |
120 | }) | 114 | }) |
121 | } | 115 | } |
122 | }) | 116 | }) |
123 | /*$scope.data.addressOne | 117 | |
124 | $scope.data.addressTwo | ||
125 | $scope.data.city*/ | ||
126 | 118 | ||
127 | $scope.addFirstData = function(sel, step){ | 119 | $scope.addFirstData = function(sel, step){ |
128 | // console.log($scope.data) | 120 | // console.log($scope.data) |
129 | if($scope.data.vendorName == undefined){ | 121 | if($scope.data.vendorName == undefined){ |
130 | $scope.showCompanyError = true; | 122 | $scope.showCompanyError = true; |
131 | $('.companyNameInput').addClass('customErrorInput'); | 123 | $('.companyNameInput').addClass('customErrorInput'); |
132 | }else if($scope.data.masterMargin == undefined){ | 124 | }else if($scope.data.masterMargin == undefined){ |
133 | $scope.showMarginError = true; | 125 | $scope.showMarginError = true; |
134 | $('.marginSelectBox').addClass('customErrorInput'); | 126 | $('.marginSelectBox').addClass('customErrorInput'); |
135 | }else{ | 127 | }else{ |
136 | var vendorData = "vendorName=" + $scope.data.vendorName + "&masterMargin=" + $scope.data.masterMargin | 128 | var vendorData = "vendorName=" + $scope.data.vendorName + "&masterMargin=" + $scope.data.masterMargin |
137 | + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" | 129 | + "&addressOne=" + $scope.data.addressOne + "&addressTwo=" + $scope.data.addressTwo + "&city=" + $scope.data.city + "&state=" |
138 | + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote=" | 130 | + $scope.data.state + "&country=" + $scope.data.country + "&zipcode=" + $scope.data.zipcode + "&internalNote=" |
139 | + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant | 131 | + $scope.data.internalNote + "&certificateType=" + $scope.data.certificateType + "&baseTenant=" + $scope.data.baseTenant |
140 | + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor | 132 | + "&fuelerlinxCustomer=" + $scope.data.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.data.contractFuelVendor |
141 | + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao; | 133 | + "&activate=" + $scope.data.activate + "&baseIcao=" + $scope.data.baseIcao; |
142 | 134 | ||
143 | FuelVendorsService.addVendor($scope.data).then(function(result) { | 135 | FuelVendorsService.addVendor($scope.data).then(function(result) { |
144 | $scope.accountId = result; | 136 | $scope.accountId = result; |
145 | $scope.data = {}; | 137 | $scope.data = {}; |
146 | $scope.data.activate = true; | 138 | $scope.data.activate = true; |
147 | $('#vendor-modal-3').modal('hide'); | 139 | $('#vendor-modal-3').modal('hide'); |
148 | getAllVendor(); | 140 | getAllVendor(); |
149 | }) | 141 | }) |
150 | } | 142 | } |
151 | 143 | ||
152 | } | 144 | } |
153 | 145 | ||
154 | $scope.exportVendors = function() { | 146 | $scope.exportVendors = function() { |
155 | $scope.showLoader = true; | 147 | $scope.showLoader = true; |
156 | var fileName = "vendors.csv"; | 148 | var fileName = "vendors.csv"; |
157 | var a = document.createElement("a"); | 149 | var a = document.createElement("a"); |
158 | document.body.appendChild(a); | 150 | document.body.appendChild(a); |
159 | FuelVendorsService.exportVendors().then(function(result) { | 151 | FuelVendorsService.exportVendors().then(function(result) { |
160 | var file = new Blob([result], {type: 'application/csv'}); | 152 | var file = new Blob([result], {type: 'application/csv'}); |
161 | var fileURL = URL.createObjectURL(file); | 153 | var fileURL = URL.createObjectURL(file); |
162 | a.href = fileURL; | 154 | a.href = fileURL; |
163 | a.download = fileName; | 155 | a.download = fileName; |
164 | a.click(); | 156 | a.click(); |
165 | $scope.showLoader = false; | 157 | $scope.showLoader = false; |
166 | }) | 158 | }) |
167 | } | 159 | } |
168 | 160 | ||
169 | } | 161 | } |
app/partials/accountSetting/accountSetting.Controller.js
1 | (function() { | 1 | (function() { |
2 | 'use strict' | 2 | 'use strict' |
3 | 3 | ||
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | .controller('AccountSettingController', [ '$scope', '$filter', '$rootScope', '$state', 'AccountSettingService', AccountSettingController]); | 5 | .controller('AccountSettingController', [ '$scope', '$filter', '$rootScope', '$state', 'AccountSettingService', AccountSettingController]); |
6 | 6 | ||
7 | function AccountSettingController($scope, $filter, $rootScope, $state, AccountSettingService) { | 7 | function AccountSettingController($scope, $filter, $rootScope, $state, AccountSettingService) { |
8 | $scope.addArray = []; | 8 | $scope.addArray = []; |
9 | $scope.userData = {}; | 9 | $scope.userData = {}; |
10 | getAdditionalAccounts(); | 10 | getAdditionalAccounts(); |
11 | 11 | ||
12 | function getAdditionalAccounts() { | 12 | function getAdditionalAccounts() { |
13 | AccountSettingService.getAdditionalAccounts().then(function(result) { | 13 | AccountSettingService.getAdditionalAccounts().then(function(result) { |
14 | $scope.additionalAccounts = result; | 14 | $scope.additionalAccounts = result; |
15 | }) | 15 | }) |
16 | } | 16 | } |
17 | 17 | ||
18 | $scope.userid = JSON.parse(localStorage.getItem('userProfileId')); | 18 | $scope.userid = JSON.parse(localStorage.getItem('userProfileId')); |
19 | 19 | ||
20 | //call this function after upload data | 20 | //call this function after upload data |
21 | function getLoginUserData(){ | 21 | function getLoginUserData(){ |
22 | if($scope.userid && $scope.userid != null && $scope.userid != undefined){ | 22 | if($scope.userid && $scope.userid != null && $scope.userid != undefined){ |
23 | var id = $scope.userid; | 23 | var id = $scope.userid; |
24 | AccountSettingService.loginUserData(id).then(function(result) { | 24 | AccountSettingService.loginUserData(id).then(function(result) { |
25 | if(result.userTimeZone != null){ | 25 | if(result.userTimeZone != null){ |
26 | 26 | ||
27 | if(result.userTimeZone.slice(0,1)==="P"){ | 27 | if(result.userTimeZone.slice(0,1)==="P"){ |
28 | 28 | ||
29 | result.userTimeZone = result.userTimeZone.replace("P","+"); | 29 | result.userTimeZone = result.userTimeZone.replace("P","+"); |
30 | 30 | ||
31 | }else if(result.userTimeZone.slice(0,1)==="M"){ | 31 | }else if(result.userTimeZone.slice(0,1)==="M"){ |
32 | 32 | ||
33 | result.userTimeZone = result.userTimeZone.replace("M","-"); | 33 | result.userTimeZone = result.userTimeZone.replace("M","-"); |
34 | } | 34 | } |
35 | 35 | ||
36 | } | 36 | } |
37 | $scope.userData = result; | 37 | $scope.userData = result; |
38 | //console.log("===userData===",$scope.userData) | 38 | //console.log("===userData===",$scope.userData) |
39 | $scope.userData.status = $scope.userData.account.user.status.toLowerCase(); | 39 | $scope.userData.status = $scope.userData.account.user.status.toLowerCase(); |
40 | $scope.userData.userType = $scope.userData.userType.type.toLowerCase(); | 40 | $scope.userData.userType = $scope.userData.userType.type.toLowerCase(); |
41 | }) | 41 | }) |
42 | } | 42 | } |
43 | } | 43 | } |
44 | 44 | ||
45 | getLoginUserData(); | 45 | getLoginUserData(); |
46 | 46 | ||
47 | 47 | ||
48 | AccountSettingService.getProducts().then(function(result) { | 48 | AccountSettingService.getProducts().then(function(result) { |
49 | $scope.productList = result; | 49 | $scope.productList = result; |
50 | for(var i=0;i<$scope.productList.length;i++){ | 50 | for(var i=0;i<$scope.productList.length;i++){ |
51 | var obj = { | 51 | var obj = { |
52 | id : $scope.productList[i].id, | 52 | id : $scope.productList[i].id, |
53 | name : $scope.productList[i].name, | 53 | name : $scope.productList[i].name, |
54 | status : $scope.productList[i].status | 54 | status : $scope.productList[i].status |
55 | } | 55 | } |
56 | $scope.addArray.push(obj); | 56 | $scope.addArray.push(obj); |
57 | } | 57 | } |
58 | }) | 58 | }) |
59 | 59 | ||
60 | $scope.productData = {}; | 60 | $scope.productData = {}; |
61 | $scope.productData.productList = []; | 61 | $scope.productData.productList = []; |
62 | 62 | ||
63 | $scope.checkProduct = function(productlist, product, index){ | 63 | $scope.checkProduct = function(productlist, product, index){ |
64 | $scope.addArray[index].id = productlist[index].id; | 64 | $scope.addArray[index].id = productlist[index].id; |
65 | $scope.addArray[index].name = productlist[index].name; | 65 | $scope.addArray[index].name = productlist[index].name; |
66 | $scope.addArray[index].status = productlist[index].status; | 66 | $scope.addArray[index].status = productlist[index].status; |
67 | $scope.productData.productList = $scope.addArray; | 67 | $scope.productData.productList = $scope.addArray; |
68 | // console.log($scope.productData) | 68 | // console.log($scope.productData) |
69 | } | 69 | } |
70 | 70 | ||
71 | $scope.updateUser = function(){ | 71 | $scope.updateUser = function(){ |
72 | 72 | ||
73 | window.localStorage.setItem('userTimeZone',JSON.stringify($scope.userData.userTimeZone)); | 73 | window.localStorage.setItem('userTimeZone',JSON.stringify($scope.userData.userTimeZone)); |
74 | //Database not save the = and - sign of timezone offset | 74 | //Database not save the = and - sign of timezone offset |
75 | if($scope.userData.userTimeZone.slice(0,1)==="+"){ | 75 | if($scope.userData.userTimeZone.slice(0,1)==="+"){ |
76 | 76 | ||
77 | $scope.userData.userTimeZone = $scope.userData.userTimeZone.replace("+","P"); | 77 | $scope.userData.userTimeZone = $scope.userData.userTimeZone.replace("+","P"); |
78 | 78 | ||
79 | }else if($scope.userData.userTimeZone.slice(0,1)==="-"){ | 79 | }else if($scope.userData.userTimeZone.slice(0,1)==="-"){ |
80 | 80 | ||
81 | $scope.userData.userTimeZone = $scope.userData.userTimeZone.replace("-","M"); | 81 | $scope.userData.userTimeZone = $scope.userData.userTimeZone.replace("-","M"); |
82 | } | 82 | } |
83 | 83 | ||
84 | var updateData = "companyName=" + $scope.userData.companyName + "&username=" + $scope.userData.username + "&firstName=" + $scope.userData.firstName | 84 | var updateData = "companyName=" + $scope.userData.companyName + "&username=" + $scope.userData.username + "&firstName=" + $scope.userData.firstName |
85 | + "&lastName=" + $scope.userData.lastName + "&phone=" + $scope.userData.phone + "&mobile=" + $scope.userData.mobile | 85 | + "&lastName=" + $scope.userData.lastName + "&phone=" + $scope.userData.phone + "&mobile=" + $scope.userData.mobile |
86 | + "&status=" + $scope.userData.status + "&userType=" + $scope.userData.userType + "&userTypeId=" + $scope.userData.userType.id + "&userProfileId=" + $scope.userid + "&userTimeZone=" + $scope.userData.userTimeZone; | 86 | + "&status=" + $scope.userData.status + "&userType=" + $scope.userData.userType + "&userTypeId=" + $scope.userData.userType.id + "&userProfileId=" + $scope.userid + "&userTimeZone=" + $scope.userData.userTimeZone + "&icao=" + $scope.userData.icao; |
87 | 87 | ||
88 | // console.log("======updateData===",updateData) | 88 | // console.log("======updateData===",updateData) |
89 | AccountSettingService.updateUserProfile(updateData).then(function(result) { | 89 | AccountSettingService.updateUserProfile(updateData).then(function(result) { |
90 | 90 | ||
91 | AccountSettingService.updateProducts($scope.productData).then(function(result) { | 91 | AccountSettingService.updateProducts($scope.productData).then(function(result) { |
92 | toastr.success(''+result.success+'', { | 92 | toastr.success(''+result.success+'', { |
93 | closeButton: true | 93 | closeButton: true |
94 | }); | 94 | }); |
95 | window.localStorage.setItem('currentUserName', JSON.stringify($scope.userData.firstName +' '+ $scope.userData.lastName)); | 95 | window.localStorage.setItem('currentUserName', JSON.stringify($scope.userData.firstName +' '+ $scope.userData.lastName)); |
96 | window.localStorage.setItem('companyName', JSON.stringify($scope.userData.companyName)); | 96 | window.localStorage.setItem('companyName', JSON.stringify($scope.userData.companyName)); |
97 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); | 97 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); |
98 | $scope.companyName= JSON.parse(localStorage.getItem('companyName')); | 98 | $scope.companyName= JSON.parse(localStorage.getItem('companyName')); |
99 | $scope.userTimeZone = JSON.parse(localStorage.getItem('userTimeZone')); | 99 | $scope.userTimeZone = JSON.parse(localStorage.getItem('userTimeZone')); |
100 | //console.log("====value after update===",$scope.userTimeZone ) | 100 | //console.log("====value after update===",$scope.userTimeZone ) |
101 | window.localStorage.removeItem('userTime'); | 101 | window.localStorage.removeItem('userTime'); |
102 | $scope.testFunction(); | 102 | $scope.testFunction(); |
103 | getLoginUserData(); | 103 | getLoginUserData(); |
104 | }) | 104 | }) |
105 | 105 | ||
106 | }) | 106 | }) |
107 | } | 107 | } |
108 | $scope.accountdata = {}; | 108 | $scope.accountdata = {}; |
109 | $scope.accountdata.userName = ''; | 109 | $scope.accountdata.userName = ''; |
110 | $scope.accountdata.status = true; | 110 | $scope.accountdata.status = true; |
111 | 111 | ||
112 | $scope.addAccount = function(){ | 112 | $scope.addAccount = function(){ |
113 | $('#demo-modal').css('display', 'block'); | 113 | $('#demo-modal').css('display', 'block'); |
114 | $scope.accountdata.status = true; | 114 | $scope.accountdata.status = true; |
115 | } | 115 | } |
116 | 116 | ||
117 | $scope.cancelAddAccount = function(){ | 117 | $scope.cancelAddAccount = function(){ |
118 | $scope.accountdata = {}; | 118 | $scope.accountdata = {}; |
119 | $('#demo-modal').css('display', ''); | 119 | $('#demo-modal').css('display', ''); |
120 | } | 120 | } |
121 | 121 | ||
122 | $scope.checkEmail = function(email, type) { | 122 | $scope.checkEmail = function(email, type) { |
123 | //console.log(type) | 123 | //console.log(type) |
124 | AccountSettingService.checkEmail(email).then(function(result) { | 124 | AccountSettingService.checkEmail(email).then(function(result) { |
125 | if(result.status == 'ACTIVE'){ | 125 | if(result.status == 'ACTIVE'){ |
126 | toastr.error('Email already exists.', { | 126 | toastr.error('Email already exists.', { |
127 | closeButton: true | 127 | closeButton: true |
128 | }) | 128 | }) |
129 | if(type == 'additional'){ | 129 | if(type == 'additional'){ |
130 | $scope.accountdata.userName = ''; | 130 | $scope.accountdata.userName = ''; |
131 | } | 131 | } |
132 | } | 132 | } |
133 | }) | 133 | }) |
134 | } | 134 | } |
135 | 135 | ||
136 | $scope.additionalAccnObj = {}; | 136 | $scope.additionalAccnObj = {}; |
137 | $scope.createAddAccount = function(){ | 137 | $scope.createAddAccount = function(){ |
138 | $scope.accountdata.status = true; | 138 | $scope.accountdata.status = true; |
139 | if ($scope.accountdata.userName === '') { | 139 | if ($scope.accountdata.userName === '') { |
140 | toastr.error('Please enter all the fields.', { | 140 | toastr.error('Please enter all the fields.', { |
141 | closeButton: true | 141 | closeButton: true |
142 | }) | 142 | }) |
143 | }else{ | 143 | }else{ |
144 | if (validateEmail($scope.accountdata.userName)) { | 144 | if (validateEmail($scope.accountdata.userName)) { |
145 | //console.log("checkbox",$scope.accountdata.allowEpd ,$scope.accountdata.allowFma) | 145 | //console.log("checkbox",$scope.accountdata.allowEpd ,$scope.accountdata.allowFma) |
146 | AccountSettingService.addAdditionalAccount($scope.accountdata).then(function(result) { | 146 | AccountSettingService.addAdditionalAccount($scope.accountdata).then(function(result) { |
147 | getAdditionalAccounts(); | 147 | getAdditionalAccounts(); |
148 | $scope.accountdata = {}; | 148 | $scope.accountdata = {}; |
149 | $('#demo-modal').css('display', ''); | 149 | $('#demo-modal').css('display', ''); |
150 | toastr.success(''+result.success+'', { | 150 | toastr.success(''+result.success+'', { |
151 | closeButton: true | 151 | closeButton: true |
152 | }) | 152 | }) |
153 | }) | 153 | }) |
154 | }else{ | 154 | }else{ |
155 | toastr.error('Please enter valid email.', { | 155 | toastr.error('Please enter valid email.', { |
156 | closeButton: true | 156 | closeButton: true |
157 | }) | 157 | }) |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | } | 161 | } |
162 | 162 | ||
163 | /*Validate Email */ | 163 | /*Validate Email */ |
164 | function validateEmail(email) { | 164 | function validateEmail(email) { |
165 | var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | 165 | var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
166 | return re.test(email); | 166 | return re.test(email); |
167 | } | 167 | } |
168 | 168 | ||
169 | $scope.changeStatus = function(id, index){ | 169 | $scope.changeStatus = function(id, index){ |
170 | event.stopPropagation(); | 170 | event.stopPropagation(); |
171 | var id = id; | 171 | var id = id; |
172 | var statusData = "status=" + $scope.additionalAccounts[index].status + "&id=" + $scope.additionalAccounts[index].id + "&firstName=" + $scope.additionalAccounts[index].firstName | 172 | var statusData = "status=" + $scope.additionalAccounts[index].status + "&id=" + $scope.additionalAccounts[index].id + "&firstName=" + $scope.additionalAccounts[index].firstName |
173 | + "&lastName=" + $scope.additionalAccounts[index].lastName + "&username=" + $scope.additionalAccounts[index].userName + "&password=" + $scope.additionalAccounts[index].password | 173 | + "&lastName=" + $scope.additionalAccounts[index].lastName + "&username=" + $scope.additionalAccounts[index].userName + "&password=" + $scope.additionalAccounts[index].password |
174 | + "&allowEpd=" + $scope.additionalAccounts[index].allowEpd + "&allowFma=" + $scope.additionalAccounts[index].allowFma; | 174 | + "&allowEpd=" + $scope.additionalAccounts[index].allowEpd + "&allowFma=" + $scope.additionalAccounts[index].allowFma; |
175 | AccountSettingService.updateStatus(statusData).then(function(result) { | 175 | AccountSettingService.updateStatus(statusData).then(function(result) { |
176 | if(result.success){ | 176 | if(result.success){ |
177 | toastr.success('Updated Successfully', { | 177 | toastr.success('Updated Successfully', { |
178 | closeButton: true | 178 | closeButton: true |
179 | }) | 179 | }) |
180 | } | 180 | } |
181 | }) | 181 | }) |
182 | } | 182 | } |
183 | var deleteAccnId = ""; | 183 | var deleteAccnId = ""; |
184 | $scope.deleteAdditionalAccount = function(id) { | 184 | $scope.deleteAdditionalAccount = function(id) { |
185 | $('#delete1').css('display', 'block'); | 185 | $('#delete1').css('display', 'block'); |
186 | deleteAccnId = id; | 186 | deleteAccnId = id; |
187 | 187 | ||
188 | } | 188 | } |
189 | 189 | ||
190 | $scope.accnDelete = function(){ | 190 | $scope.accnDelete = function(){ |
191 | AccountSettingService.deleteAccount(deleteAccnId).then(function(result) { | 191 | AccountSettingService.deleteAccount(deleteAccnId).then(function(result) { |
192 | getAdditionalAccounts(); | 192 | getAdditionalAccounts(); |
193 | $('#delete1').css('display', 'none'); | 193 | $('#delete1').css('display', 'none'); |
194 | if(result.success){ | 194 | if(result.success){ |
195 | toastr.success('Deleted Successfully', { | 195 | toastr.success('Deleted Successfully', { |
196 | closeButton: true | 196 | closeButton: true |
197 | }) | 197 | }) |
198 | } | 198 | } |
199 | }) | 199 | }) |
200 | } | 200 | } |
201 | 201 | ||
202 | 202 | ||
203 | $scope.cancelDelete = function(){ | 203 | $scope.cancelDelete = function(){ |
204 | $('#delete1').css('display', 'none'); | 204 | $('#delete1').css('display', 'none'); |
205 | } | 205 | } |
206 | 206 | ||
207 | $scope.resetPassword = function(email) { | 207 | $scope.resetPassword = function(email) { |
208 | //console.log("emailid",email) | 208 | //console.log("emailid",email) |
209 | AccountSettingService.resetPassword(email).then(function(result){ | 209 | AccountSettingService.resetPassword(email).then(function(result){ |
210 | if(typeof result == 'object') { | 210 | if(typeof result == 'object') { |
211 | toastr.info("Password generated successfully. Please check your email for new password"); | 211 | toastr.info("Password generated successfully. Please check your email for new password"); |
212 | //localStorage.setItem('requiredChangePwd', "Y"); | 212 | //localStorage.setItem('requiredChangePwd', "Y"); |
213 | //$state.go('login'); | 213 | //$state.go('login'); |
214 | } else { | 214 | } else { |
215 | toastr.info("Error in generating password"); | 215 | toastr.info("Error in generating password"); |
216 | } | 216 | } |
217 | }) | 217 | }) |
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | $scope.timeZoneList = [{name:'(GMT-12:00) International Date Line West',value:'-12.00'}, | 221 | $scope.timeZoneList = [{name:'(GMT-12:00) International Date Line West',value:'-12.00'}, |
222 | {name:'(GMT-11:00) Midway Island, Samoa',value:'-11.00'}, | 222 | {name:'(GMT-11:00) Midway Island, Samoa',value:'-11.00'}, |
223 | {name:'(GMT-10:00) Hawaii',value :'-10.00'}, | 223 | {name:'(GMT-10:00) Hawaii',value :'-10.00'}, |
224 | {name:'(GMT-09:30) Pacific/Marquesas (French Polynesia)',value :'-09.30'}, | 224 | {name:'(GMT-09:30) Pacific/Marquesas (French Polynesia)',value :'-09.30'}, |
225 | {name:'(GMT-09:00) Pacific/Gambier(French Polynesia)(US)',value :'-09.00'}, | 225 | {name:'(GMT-09:00) Pacific/Gambier(French Polynesia)(US)',value :'-09.00'}, |
226 | {name:'(GMT-08:00) Alaska',value :'-08.00'}, | 226 | {name:'(GMT-08:00) Alaska',value :'-08.00'}, |
227 | {name:'(GMT-07:00) Arizona,(US and Canada)',value :'-07.00'}, | 227 | {name:'(GMT-07:00) Arizona,(US and Canada)',value :'-07.00'}, |
228 | {name:'(GMT-06:00) (Central America),Chihuahua,Saskatchewan,Ecuador',value :'-06.00'}, | 228 | {name:'(GMT-06:00) (Central America),Chihuahua,Saskatchewan,Ecuador',value :'-06.00'}, |
229 | {name:'(GMT-05:00) Central Time (US and Canada) Bogota, Mexico City,Lima,Brazil, Quito',value :'-05.00'}, | 229 | {name:'(GMT-05:00) Central Time (US and Canada) Bogota, Mexico City,Lima,Brazil, Quito',value :'-05.00'}, |
230 | {name:'(GMT-04:00) Eastern Time (US and Canada),Caracas, La Paz,Indiana (East)',value :'-04.00'}, | 230 | {name:'(GMT-04:00) Eastern Time (US and Canada),Caracas, La Paz,Indiana (East)',value :'-04.00'}, |
231 | {name:'(GMT-03:00) Atlantic Time (Canada),Santiago,Brasilia,Buenos Aires',value :'-03.00'}, | 231 | {name:'(GMT-03:00) Atlantic Time (Canada),Santiago,Brasilia,Buenos Aires',value :'-03.00'}, |
232 | {name:'(GMT-02:30) Newfoundland and Labrador,(Canada)',value :'-02.30'}, | 232 | {name:'(GMT-02:30) Newfoundland and Labrador,(Canada)',value :'-02.30'}, |
233 | {name:'(GMT-02:00) Mid-Atlantic,Greenland',value :'-02.00'}, | 233 | {name:'(GMT-02:00) Mid-Atlantic,Greenland',value :'-02.00'}, |
234 | {name:'(GMT-01:00) Cape Verde Islands',value :'-01.00'}, | 234 | {name:'(GMT-01:00) Cape Verde Islands',value :'-01.00'}, |
235 | {name:'(GMT) Azores,Dublin, Edinburgh, Lisbon, London',value :'00.00'}, | 235 | {name:'(GMT) Azores,Dublin, Edinburgh, Lisbon, London',value :'00.00'}, |
236 | {name:'(GMT+01:00) West Central Africa,Canary Islands,Casablanca, Monrovia',value :'+01.00'}, | 236 | {name:'(GMT+01:00) West Central Africa,Canary Islands,Casablanca, Monrovia',value :'+01.00'}, |
237 | {name:'(GMT+02:00) Brussels,Amsterdam,Harare,Madrid,Paris,Cairo,Belgrade',value :'+02.00'}, | 237 | {name:'(GMT+02:00) Brussels,Amsterdam,Harare,Madrid,Paris,Cairo,Belgrade',value :'+02.00'}, |
238 | {name:'(GMT+03:00) Moscow,Jerusalem,St.Petersburg, Athens,Baghdad,Kuwait,Helsinki,Nairobi',value :'+03.00'}, | 238 | {name:'(GMT+03:00) Moscow,Jerusalem,St.Petersburg, Athens,Baghdad,Kuwait,Helsinki,Nairobi',value :'+03.00'}, |
239 | {name:'(GMT+04:00) Armenia,Azerbaijan,UAE,(Russia)',value :'+04.00'}, | 239 | {name:'(GMT+04:00) Armenia,Azerbaijan,UAE,(Russia)',value :'+04.00'}, |
240 | {name:'(GMT+04:30) Kabul,(Afghanistan)',value :'+04.30'}, | 240 | {name:'(GMT+04:30) Kabul,(Afghanistan)',value :'+04.30'}, |
241 | {name:'(GMT+05:00) Islamabad, Karachi, Tashkent (Pakistan)',value :'+05.00'}, | 241 | {name:'(GMT+05:00) Islamabad, Karachi, Tashkent (Pakistan)',value :'+05.00'}, |
242 | {name:'(GMT+05:30) Chennai,New Delhi(India),(Sri Lanka)',value :'+05.30'}, | 242 | {name:'(GMT+05:30) Chennai,New Delhi(India),(Sri Lanka)',value :'+05.30'}, |
243 | {name:'(GMT+05:45) Kathmandu (Nepal)',value :'+05.45'}, | 243 | {name:'(GMT+05:45) Kathmandu (Nepal)',value :'+05.45'}, |
244 | {name:'(GMT+06:00) Astana,Kazakhstan,Dhaka(Bangladesh),(Bhutan),(Russia)',value :'+06.00'}, | 244 | {name:'(GMT+06:00) Astana,Kazakhstan,Dhaka(Bangladesh),(Bhutan),(Russia)',value :'+06.00'}, |
245 | {name:'(GMT+06:30) Yangon Rangoon (Myanmar)',value :'+06.30'}, | 245 | {name:'(GMT+06:30) Yangon Rangoon (Myanmar)',value :'+06.30'}, |
246 | {name:'(GMT+07:00) Laos,Krasnoyarsk,Hanoi,Bangkok(Thailand),Jakarta(Indonesia)',value :'+07.00'}, | 246 | {name:'(GMT+07:00) Laos,Krasnoyarsk,Hanoi,Bangkok(Thailand),Jakarta(Indonesia)',value :'+07.00'}, |
247 | {name:'(GMT+08:00) Perth(Western Australia),Beijing(China),Kuala Lumpur(Singapore),(Malaysia)',value :'+08.00'}, | 247 | {name:'(GMT+08:00) Perth(Western Australia),Beijing(China),Kuala Lumpur(Singapore),(Malaysia)',value :'+08.00'}, |
248 | {name:'(GMT+08:45) Australia/Eucla',value :'+08.45'}, | 248 | {name:'(GMT+08:45) Australia/Eucla',value :'+08.45'}, |
249 | {name:'(GMT+09:00) Japan/North Korea/South Korea/East Timor',value :'+09.00'}, | 249 | {name:'(GMT+09:00) Japan/North Korea/South Korea/East Timor',value :'+09.00'}, |
250 | {name:'(GMT+09:30) Adelaide/Darwin(Australia)',value :'+09.30' }, | 250 | {name:'(GMT+09:30) Adelaide/Darwin(Australia)',value :'+09.30' }, |
251 | {name:'(GMT+10:00) Guam, Port Moresby,Hobart,Vladivostok,Brisbane,Melbourne(Australia),Papua New Guinea',value :'+10.00'}, | 251 | {name:'(GMT+10:00) Guam, Port Moresby,Hobart,Vladivostok,Brisbane,Melbourne(Australia),Papua New Guinea',value :'+10.00'}, |
252 | {name:'(GMT+10:30) Australia/Lord_Howe',value :'+10.30'}, | 252 | {name:'(GMT+10:30) Australia/Lord_Howe',value :'+10.30'}, |
253 | {name:'(GMT+11:00) Magadan, Solomon Islands, New Caledonia',value :'+11.00'}, | 253 | {name:'(GMT+11:00) Magadan, Solomon Islands, New Caledonia',value :'+11.00'}, |
254 | {name:'(GMT+12:00) Auckland, Wellington,Fiji Islands, Kamchatka, Marshall Islands',value :'+12.00'}, | 254 | {name:'(GMT+12:00) Auckland, Wellington,Fiji Islands, Kamchatka, Marshall Islands',value :'+12.00'}, |
255 | {name:'(GMT+12:45) Pacific/Chatham, New Zealand',value :'+12.45'}, | 255 | {name:'(GMT+12:45) Pacific/Chatham, New Zealand',value :'+12.45'}, |
256 | {name:'(GMT+13:00) Nuku alofa,Samoa,Tonga',value :'+13.00'}, | 256 | {name:'(GMT+13:00) Nuku alofa,Samoa,Tonga',value :'+13.00'}, |
257 | {name:'(GMT+14:00) Pacific/Kiritimati',value :'+14.00'}] | 257 | {name:'(GMT+14:00) Pacific/Kiritimati',value :'+14.00'}] |
258 | 258 | ||
259 | 259 | ||
260 | } | 260 | } |
261 | })(); | 261 | })(); |
262 | 262 | ||
263 | 263 |
app/partials/accountSetting/accountSetting.Service.js
1 | (function() { | 1 | (function() { |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel').service( | 3 | angular.module('acufuel').service( |
4 | 'AccountSettingService', | 4 | 'AccountSettingService', |
5 | [ '$rootScope', '$q', '$http', '$state', 'BASE_URL', | 5 | [ '$rootScope', '$q', '$http', '$state', 'BASE_URL', |
6 | AccountSettingService ]); | 6 | AccountSettingService ]); |
7 | 7 | ||
8 | function AccountSettingService($rootScope, $q, $http, $state, BASE_URL) { | 8 | function AccountSettingService($rootScope, $q, $http, $state, BASE_URL) { |
9 | 9 | ||
10 | this.getProducts = function() { | 10 | this.getProducts = function() { |
11 | 11 | ||
12 | var deferred = $q.defer(); | 12 | var deferred = $q.defer(); |
13 | $http({ | 13 | $http({ |
14 | method : 'GET', | 14 | method : 'GET', |
15 | url : BASE_URL.url + '/user/products', | 15 | url : BASE_URL.url + '/user/products', |
16 | headers : { | 16 | headers : { |
17 | 'Content-Type' : 'application/json' | 17 | 'Content-Type' : 'application/json' |
18 | }, | 18 | }, |
19 | }).then(function(result) { | 19 | }).then(function(result) { |
20 | deferred.resolve(result.data); | 20 | deferred.resolve(result.data); |
21 | }, function(result) { | 21 | }, function(result) { |
22 | //console.log(result.data) | ||
23 | deferred.resolve(result.data); | 22 | deferred.resolve(result.data); |
24 | }) | 23 | }) |
25 | return deferred.promise; | 24 | return deferred.promise; |
26 | } | 25 | } |
27 | 26 | ||
28 | this.updateProducts = function(data) { | 27 | this.updateProducts = function(data) { |
29 | 28 | ||
30 | var deferred = $q.defer(); | 29 | var deferred = $q.defer(); |
31 | $http({ | 30 | $http({ |
32 | method : 'PUT', | 31 | method : 'PUT', |
33 | url : BASE_URL.url + '/fuelPricing/product', | 32 | url : BASE_URL.url + '/fuelPricing/product', |
34 | data : data, | 33 | data : data, |
35 | headers : { | 34 | headers : { |
36 | 'Content-Type' : 'application/json' | 35 | 'Content-Type' : 'application/json' |
37 | }, | 36 | }, |
38 | }).then(function(result) { | 37 | }).then(function(result) { |
39 | deferred.resolve(result.data); | 38 | deferred.resolve(result.data); |
40 | }, function(result) { | 39 | }, function(result) { |
41 | //console.log(result.data) | 40 | //console.log(result.data) |
42 | deferred.resolve(result.data); | 41 | deferred.resolve(result.data); |
43 | }) | 42 | }) |
44 | return deferred.promise; | 43 | return deferred.promise; |
45 | } | 44 | } |
46 | 45 | ||
47 | this.loginUserData = function(id) { | 46 | this.loginUserData = function(id) { |
48 | 47 | ||
49 | var deferred = $q.defer(); | 48 | var deferred = $q.defer(); |
50 | $http({ | 49 | $http({ |
51 | method : 'GET', | 50 | method : 'GET', |
52 | url : BASE_URL.url + '/account/user/' + id, | 51 | url : BASE_URL.url + '/account/user/' + id, |
53 | headers : { | 52 | headers : { |
54 | 'Content-Type' : 'application/json' | 53 | 'Content-Type' : 'application/json' |
55 | }, | 54 | }, |
56 | }).then(function(result) { | 55 | }).then(function(result) { |
57 | deferred.resolve(result.data); | 56 | deferred.resolve(result.data); |
58 | }, function(result) { | 57 | }, function(result) { |
59 | //console.log(result.data) | ||
60 | deferred.resolve(result.data); | 58 | deferred.resolve(result.data); |
61 | }) | 59 | }) |
62 | return deferred.promise; | 60 | return deferred.promise; |
63 | } | 61 | } |
64 | 62 | ||
65 | this.checkEmail = function(email) { | 63 | this.checkEmail = function(email) { |
66 | 64 | ||
67 | var deferred = $q.defer(); | 65 | var deferred = $q.defer(); |
68 | $http({ | 66 | $http({ |
69 | method : 'GET', | 67 | method : 'GET', |
70 | url : BASE_URL.url + '/user/email/status?email=' + email, | 68 | url : BASE_URL.url + '/user/email/status?email=' + email, |
71 | headers : { | 69 | headers : { |
72 | 'Content-Type' : 'application/json' | 70 | 'Content-Type' : 'application/json' |
73 | }, | 71 | }, |
74 | }).then(function(result) { | 72 | }).then(function(result) { |
75 | deferred.resolve(result.data); | 73 | deferred.resolve(result.data); |
76 | }, function(result) { | 74 | }, function(result) { |
77 | //console.log(result.data) | ||
78 | deferred.resolve(result.data); | 75 | deferred.resolve(result.data); |
79 | }) | 76 | }) |
80 | return deferred.promise; | 77 | return deferred.promise; |
81 | } | 78 | } |
82 | 79 | ||
83 | this.updateUserProfile = function(data) { | 80 | this.updateUserProfile = function(data) { |
84 | 81 | ||
85 | var deferred = $q.defer(); | 82 | var deferred = $q.defer(); |
86 | $http({ | 83 | $http({ |
87 | method : 'PUT', | 84 | method : 'PUT', |
88 | url : BASE_URL.url + '/account/updateProfile', | 85 | url : BASE_URL.url + '/account/updateProfile', |
89 | headers : { | 86 | headers : { |
90 | 'Content-Type' : 'application/x-www-form-urlencoded' | 87 | 'Content-Type' : 'application/x-www-form-urlencoded' |
91 | }, | 88 | }, |
92 | data : data | 89 | data : data |
93 | }).then(function(result) { | 90 | }).then(function(result) { |
94 | deferred.resolve(result.data); | 91 | deferred.resolve(result.data); |
95 | }, function(result) { | 92 | }, function(result) { |
96 | //console.log(result.data) | ||
97 | deferred.resolve(result.data); | 93 | deferred.resolve(result.data); |
98 | }) | 94 | }) |
99 | return deferred.promise; | 95 | return deferred.promise; |
100 | } | 96 | } |
101 | 97 | ||
102 | this.addAdditionalAccount = function(data) { | 98 | this.addAdditionalAccount = function(data) { |
103 | console.log('----$scope.accountdata--', data); | ||
104 | var deferred = $q.defer(); | 99 | var deferred = $q.defer(); |
105 | $http({ | 100 | $http({ |
106 | method : 'POST', | 101 | method : 'POST', |
107 | url : BASE_URL.url + '/additionalAccount', | 102 | url : BASE_URL.url + '/additionalAccount', |
108 | headers : { | 103 | headers : { |
109 | 'Content-Type' : 'application/json' | 104 | 'Content-Type' : 'application/json' |
110 | }, | 105 | }, |
111 | data : data | 106 | data : data |
112 | }).then(function(result) { | 107 | }).then(function(result) { |
113 | deferred.resolve(result.data); | 108 | deferred.resolve(result.data); |
114 | }, function(result) { | 109 | }, function(result) { |
115 | deferred.resolve(result.data); | 110 | deferred.resolve(result.data); |
116 | }) | 111 | }) |
117 | return deferred.promise; | 112 | return deferred.promise; |
118 | } | 113 | } |
119 | 114 | ||
120 | 115 | ||
121 | this.getAdditionalAccounts = function() { | 116 | this.getAdditionalAccounts = function() { |
122 | var deferred = $q.defer(); | 117 | var deferred = $q.defer(); |
123 | $http({ | 118 | $http({ |
124 | method : 'GET', | 119 | method : 'GET', |
125 | url : BASE_URL.url +'/user/additionalAccount', | 120 | url : BASE_URL.url +'/user/additionalAccount', |
126 | headers : {'Content-Type': 'application/json'}, | 121 | headers : {'Content-Type': 'application/json'}, |
127 | }) | 122 | }) |
128 | .then(function (result){ | 123 | .then(function (result){ |
129 | deferred.resolve(result.data); | 124 | deferred.resolve(result.data); |
130 | },function (result){ | 125 | },function (result){ |
131 | //console.log(result.data) | ||
132 | deferred.resolve(result.data); | 126 | deferred.resolve(result.data); |
133 | }) | 127 | }) |
134 | return deferred.promise; | 128 | return deferred.promise; |
135 | } | 129 | } |
136 | 130 | ||
137 | this.updateStatus = function(data) { | 131 | this.updateStatus = function(data) { |
138 | 132 | ||
139 | var deferred = $q.defer(); | 133 | var deferred = $q.defer(); |
140 | $http({ | 134 | $http({ |
141 | method : 'PUT', | 135 | method : 'PUT', |
142 | url : BASE_URL.url + '/additionalAccount', | 136 | url : BASE_URL.url + '/additionalAccount', |
143 | headers : { | 137 | headers : { |
144 | 'Content-Type' : 'application/x-www-form-urlencoded' | 138 | 'Content-Type' : 'application/x-www-form-urlencoded' |
145 | }, | 139 | }, |
146 | data : data | 140 | data : data |
147 | }).then(function(result) { | 141 | }).then(function(result) { |
148 | deferred.resolve(result.data); | 142 | deferred.resolve(result.data); |
149 | }, function(result) { | 143 | }, function(result) { |
150 | //console.log(result.data) | ||
151 | deferred.resolve(result.data); | 144 | deferred.resolve(result.data); |
152 | }) | 145 | }) |
153 | return deferred.promise; | 146 | return deferred.promise; |
154 | } | 147 | } |
155 | 148 | ||
156 | this.deleteAccount = function(id) { | 149 | this.deleteAccount = function(id) { |
157 | 150 | ||
158 | var deferred = $q.defer(); | 151 | var deferred = $q.defer(); |
159 | $http({ | 152 | $http({ |
160 | method : 'DELETE', | 153 | method : 'DELETE', |
161 | url : BASE_URL.url + '/additionalAccount/'+id, | 154 | url : BASE_URL.url + '/additionalAccount/'+id, |
162 | headers : { | 155 | headers : { |
163 | 'Content-Type' : 'application/x-www-form-urlencoded' | 156 | 'Content-Type' : 'application/x-www-form-urlencoded' |
164 | } | 157 | } |
165 | }).then(function(result) { | 158 | }).then(function(result) { |
166 | deferred.resolve(result.data); | 159 | deferred.resolve(result.data); |
167 | }, function(result) { | 160 | }, function(result) { |
168 | //console.log(result.data) | ||
169 | deferred.resolve(result.data); | 161 | deferred.resolve(result.data); |
170 | }) | 162 | }) |
171 | return deferred.promise; | 163 | return deferred.promise; |
172 | } | 164 | } |
173 | 165 | ||
174 | this.resetPassword = function(email) { | 166 | this.resetPassword = function(email) { |
175 | var param = 'email='+ email; | 167 | var param = 'email='+ email; |
176 | var deferred = $q.defer(); | 168 | var deferred = $q.defer(); |
177 | $http({ | 169 | $http({ |
178 | method : 'PUT', | 170 | method : 'PUT', |
179 | url : BASE_URL.url +'/user/recoverpassword', | 171 | url : BASE_URL.url +'/user/recoverpassword', |
180 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, | 172 | headers : {'Content-Type': 'application/x-www-form-urlencoded'}, |
181 | data: param | 173 | data: param |
182 | }) | 174 | }) |
183 | .then(function (result){ | 175 | .then(function (result){ |
184 | deferred.resolve(result.data); | 176 | deferred.resolve(result.data); |
185 | },function (result){ | 177 | },function (result){ |
186 | deferred.resolve(result.data); | 178 | deferred.resolve(result.data); |
187 | }) | 179 | }) |
188 | return deferred.promise; | 180 | return deferred.promise; |
189 | } | 181 | } |
190 | 182 | ||
191 | } | 183 | } |
192 | 184 | ||
193 | })(); | 185 | })(); |
app/partials/accountSetting/accountSetting.html
1 | <div class="col-xs-12 col-md-11"> | 1 | <div class="col-xs-12 col-md-11"> |
2 | <div class="row" style="margin-left:0px"> | 2 | <div class="row" style="margin-left:0px"> |
3 | <div class="col-md-5"> | 3 | <div class="col-md-5"> |
4 | <div class="widget"> | 4 | <div class="widget"> |
5 | <div class="widget-header"> | 5 | <div class="widget-header"> |
6 | <i class="fa fa-user" aria-hidden="true"></i> | 6 | <i class="fa fa-user" aria-hidden="true"></i> |
7 | <h3>Account Setting</h3> | 7 | <h3>Account Setting</h3> |
8 | </div> | 8 | </div> |
9 | <!-- /widget-header --> | 9 | <!-- /widget-header --> |
10 | <div class="widget-content"> | 10 | <div class="widget-content"> |
11 | <h3 style="color: #666;margin-left: 10px; text-transform: capitalize;"><b>{{userData.companyName}}</b> </h3></br> | 11 | <h3 style="color: #666;margin-left: 10px; text-transform: capitalize;"><b>{{userData.companyName}}</b> </h3></br> |
12 | 12 | ||
13 | <form role="form"> | 13 | <form role="form"> |
14 | <div class="col-sm-6"> | 14 | <div class="col-sm-6"> |
15 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Username" ng-model="userData.email" ng-blur="checkEmail(userData.email, 'user')" class="form-control"></div> | 15 | <div class="form-group"><label>Email Username</label> <input type="email" placeholder="Username" ng-model="userData.email" ng-blur="checkEmail(userData.email, 'user')" class="form-control"></div> |
16 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="userData.firstName" class="form-control"></div> | 16 | <div class="form-group"><label>First Name</label> <input type="text" placeholder="First Name" ng-model="userData.firstName" class="form-control"></div> |
17 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="userData.lastName" class="form-control"></div> | 17 | <div class="form-group"><label>Last Name</label> <input type="text" placeholder="Last Name" ng-model="userData.lastName" class="form-control"></div> |
18 | </div> | 18 | </div> |
19 | 19 | ||
20 | <div class="col-sm-6"> | 20 | <div class="col-sm-6"> |
21 | <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="userData.password" placeholder="Password" class="form-control"></div> --> | 21 | <!-- <div class="form-group"><label>Password</label> <input type="password" ng-model="userData.password" placeholder="Password" class="form-control"></div> --> |
22 | <div class="form-group"><label>Phone</label> <input type="tel" ng-model="userData.phone" placeholder="Phone" class="form-control"></div> | 22 | <div class="form-group"><label>Phone</label> <input type="tel" ng-model="userData.phone" placeholder="Phone" class="form-control"></div> |
23 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="userData.mobile" placeholder="Mobile" class="form-control"></div> | 23 | <div class="form-group"><label>Mobile</label> <input type="tel" ng-model="userData.mobile" placeholder="Mobile" class="form-control"></div> |
24 | <div class="form-group"><label>Company Name</label> <input type="tel" ng-model="userData.companyName" placeholder="Company Name" class="form-control"></div> | 24 | <div class="form-group"><label>Company Name</label> <input type="tel" ng-model="userData.companyName" placeholder="Company Name" class="form-control"></div> |
25 | </div> | 25 | </div> |
26 | <div class="col-xs-12"> | 26 | <div class="col-sm-6"> |
27 | <div class="col-xs-12"> | ||
28 | <div class="form-group"> | ||
29 | <div class="row"> | ||
30 | <div class="col-md-6"> | ||
31 | <label class="new-input-label"><b>FBO Time Zone </b></label> | 27 | <label class="new-input-label"><b>FBO Time Zone </b></label> |
32 | 28 | <select class="form-control" ng-model="userData.userTimeZone" > | |
33 | <!-- <ds-widget-clock gmt-offset="gmtValue" data-show-digital digital-format="'HH:mm:ss'" show-gmt-info style="width: 200px"></ds-widget-clock> --> | ||
34 | <select class="form-control" ng-model="userData.userTimeZone" style="width:180px"> | ||
35 | <option value="" selected disabled>Select Timezone</option> | 29 | <option value="" selected disabled>Select Timezone</option> |
36 | <option ng-repeat="tz in timeZoneList" value="{{tz.value}}">{{tz.name}} | 30 | <option ng-repeat="tz in timeZoneList" value="{{tz.value}}">{{tz.name}} |
37 | </option> | 31 | </option> |
38 | </select> | 32 | </select> |
39 | </div> | 33 | </div> |
40 | <div class="col-sm-6"> | 34 | <div class="col-sm-6"> |
35 | <div class="form-group"><label>ICAO</label> <input type="text" ng-model="userData.icao" placeholder="ICAO" class="form-control"></div> | ||
36 | |||
37 | </div> | ||
38 | |||
39 | <div class="col-xs-12"> | ||
40 | <div class="col-xs-12"> | ||
41 | <div class="form-group"> | ||
42 | <div class="row"> | ||
43 | |||
44 | <div class="col-sm-6"> | ||
41 | <label class="new-input-label"><b>Fuel Types Offered </b></label> | 45 | <label class="new-input-label"><b>Fuel Types Offered </b></label> |
42 | <!-- </div> | ||
43 | <div class="col-md-6" > --> | ||
44 | <label ng-repeat="product in productList" style="width: 100%; font-weight: normal;"> | 46 | <label ng-repeat="product in productList" style="width: 100%; font-weight: normal;"> |
45 | <!-- <input type="checkbox" ng-model="product.status" ng-click="checkProduct(product)"> {{product.name}}<br> --> | ||
46 | <input type="checkbox" id="Weekdays" ng-model="product.status" ng-click="checkProduct(productList, product, $index)">{{product.name}} | 47 | <input type="checkbox" id="Weekdays" ng-model="product.status" ng-click="checkProduct(productList, product, $index)">{{product.name}} |
47 | </label> | 48 | </label> |
48 | 49 | ||
49 | </div> | 50 | </div> |
50 | </div> | 51 | </div> |
51 | </div> | 52 | </div> |
52 | </div> | 53 | </div> |
53 | </div> | 54 | </div> |
54 | <div class="clearfix"></div> | 55 | <div class="clearfix"></div> |
55 | <div class="row" style="text-align: center;"> | 56 | <div class="row" style="text-align: center;"> |
56 | <button type="button" class="btn btn-primary" ng-click="updateUser()">Save</button> | 57 | <button type="button" class="btn btn-primary" ng-click="updateUser()">Save</button> |
57 | <button type="button" class="btn btn-default">Cancel</button> | 58 | <button type="button" class="btn btn-default">Cancel</button> |
58 | </div> | 59 | </div> |
59 | </form> | 60 | </form> |
60 | </div> | 61 | </div> |
61 | <!-- /widget-content --> | 62 | <!-- /widget-content --> |
62 | </div> | 63 | </div> |
63 | <!-- /widget --> | 64 | <!-- /widget --> |
64 | </div> | 65 | </div> |
65 | <div class="col-md-7"> | 66 | <div class="col-md-7"> |
66 | <div class="widget"> | 67 | <div class="widget"> |
67 | <div class="widget-header"> | 68 | <div class="widget-header"> |
68 | <i class="fa fa-tasks" aria-hidden="true"></i> | 69 | <i class="fa fa-tasks" aria-hidden="true"></i> |
69 | <h3>Additional User Accounts</h3> | 70 | <h3>Additional User Accounts</h3> |
70 | <div class="pull-right"> | 71 | <div class="pull-right"> |
71 | <button type="submit" style="margin-top: 4px;margin-right: 9px;" ng-click="addAccount()" data-toggle="modal" data-target="#vendor-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Contact</button> | 72 | <button type="submit" style="margin-top: 4px;margin-right: 9px;" ng-click="addAccount()" data-toggle="modal" data-target="#vendor-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Contact</button> |
72 | </div> | 73 | </div> |
73 | <div class="clearfix"></div> | 74 | <div class="clearfix"></div> |
74 | </div> | 75 | </div> |
75 | <!-- /widget-header --> | 76 | <!-- /widget-header --> |
76 | <div class="widget-content"> | 77 | <div class="widget-content"> |
77 | <div class="table-responsive"> | 78 | <div class="table-responsive"> |
78 | <table class="table table-bordered table-hover table-striped"> | 79 | <table class="table table-bordered table-hover table-striped"> |
79 | <thead> | 80 | <thead> |
80 | <tr> | 81 | <tr> |
81 | <th></th> | 82 | <th></th> |
82 | <th>First Name</th> | 83 | <th>First Name</th> |
83 | <th>Last Name</th> | 84 | <th>Last Name</th> |
84 | <th>Email Username</th> | 85 | <th>Email Username</th> |
85 | <th>Password</th> | 86 | <th>Password</th> |
86 | <th>Control</th> | 87 | <th>Control</th> |
87 | </tr> | 88 | </tr> |
88 | </thead> | 89 | </thead> |
89 | <tbody> | 90 | <tbody> |
90 | <tr ng-repeat="additionalAccount in additionalAccounts"> | 91 | <tr ng-repeat="additionalAccount in additionalAccounts"> |
91 | <td> | 92 | <td> |
92 | <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteAdditionalAccount(additionalAccount.id)" aria-hidden="true"></i> | 93 | <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteAdditionalAccount(additionalAccount.id)" aria-hidden="true"></i> |
93 | </td> | 94 | </td> |
94 | <td>{{additionalAccount.firstName}}</td> | 95 | <td>{{additionalAccount.firstName}}</td> |
95 | <td>{{additionalAccount.lastName}}</td> | 96 | <td>{{additionalAccount.lastName}}</td> |
96 | <td>{{additionalAccount.userName}}</td> | 97 | <td>{{additionalAccount.userName}}</td> |
97 | <!-- <td>{{additionalAccount.password}}</td> --> | 98 | <!-- <td>{{additionalAccount.password}}</td> --> |
98 | <td> <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="resetPassword(additionalAccount.userName)" >Reset Password</button></td> | 99 | <td> <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="resetPassword(additionalAccount.userName)" >Reset Password</button></td> |
99 | <td> | 100 | <td> |
100 | <toggle ng-model="additionalAccount.status" ng-change="changeStatus(additionalAccount.id, $index)" size="customToogle"></toggle> | 101 | <toggle ng-model="additionalAccount.status" ng-change="changeStatus(additionalAccount.id, $index)" size="customToogle"></toggle> |
101 | </td> | 102 | </td> |
102 | </tr> | 103 | </tr> |
103 | </tbody> | 104 | </tbody> |
104 | </table> | 105 | </table> |
105 | </div> | 106 | </div> |
106 | </div> | 107 | </div> |
107 | <!-- /widget-content --> | 108 | <!-- /widget-content --> |
108 | </div> | 109 | </div> |
109 | <!-- /widget --> | 110 | <!-- /widget --> |
110 | </div> | 111 | </div> |
111 | <!-- /span6 --> | 112 | <!-- /span6 --> |
112 | </div> | 113 | </div> |
113 | <!-- /widget --> | 114 | <!-- /widget --> |
114 | </div> | 115 | </div> |
115 | <!-- /container --> | 116 | <!-- /container --> |
116 | <div class="clearfix"></div> | 117 | <div class="clearfix"></div> |
117 | 118 | ||
118 | <form class="modal multi-step" id="demo-modal" name="fuelOrderUpdateForm"> | 119 | <form class="modal multi-step" id="demo-modal" name="fuelOrderUpdateForm"> |
119 | <div class="modal-dialog modal-m"> | 120 | <div class="modal-dialog modal-m"> |
120 | <div class="modal-content"> | 121 | <div class="modal-content"> |
121 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 122 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
122 | <div> | 123 | <div> |
123 | <div class="row" style="margin: 0;"> | 124 | <div class="row" style="margin: 0;"> |
124 | <div> | 125 | <div> |
125 | <div class="widget" style="margin-bottom: 0;"> | 126 | <div class="widget" style="margin-bottom: 0;"> |
126 | <div class="widget-header"> | 127 | <div class="widget-header"> |
127 | <i class="icon-pencil"></i> | 128 | <i class="icon-pencil"></i> |
128 | <i class="fa fa-user" aria-hidden="true"></i> | 129 | <i class="fa fa-user" aria-hidden="true"></i> |
129 | <h3>Account Settings</h3> | 130 | <h3>Account Settings</h3> |
130 | <div class="pull-right" style="margin-top: 5px; margin-right: 10px;"> | 131 | <div class="pull-right" style="margin-top: 5px; margin-right: 10px;"> |
131 | <toggle ng-model="accountdata.status" ng-change="changeCompanyStatus()" size="customToogle" on="Active" off="Inactive"></toggle> | 132 | <toggle ng-model="accountdata.status" ng-change="changeCompanyStatus()" size="customToogle" on="Active" off="Inactive"></toggle> |
132 | </div> | 133 | </div> |
133 | <div class="clearfix"></div> | 134 | <div class="clearfix"></div> |
134 | </div> | 135 | </div> |
135 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 136 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
136 | <div class="col-xs-12"> | 137 | <div class="col-xs-12"> |
137 | <div class="col-xs-12"> | 138 | <div class="col-xs-12"> |
138 | <h2 style="color:#666;">Additional User Control</h2> | 139 | <h2 style="color:#666;">Additional User Control</h2> |
139 | </div> | 140 | </div> |
140 | <div class="clearfix"></div><br> | 141 | <div class="clearfix"></div><br> |
141 | 142 | ||
142 | <div class="col-xs-12"> | 143 | <div class="col-xs-12"> |
143 | 144 | ||
144 | <div class="col-md-6"> | 145 | <div class="col-md-6"> |
145 | <div class="pull-left" style="width: 110px;"> | 146 | <div class="pull-left" style="width: 110px;"> |
146 | <label class="new-input-label"><b>First Name</b></label> | 147 | <label class="new-input-label"><b>First Name</b></label> |
147 | </div> | 148 | </div> |
148 | 149 | ||
149 | 150 | ||
150 | </div> | 151 | </div> |
151 | <div class="col-md-6"> | 152 | <div class="col-md-6"> |
152 | <div class="pull-left" style="width: 110px;"> | 153 | <div class="pull-left" style="width: 110px;"> |
153 | <label class="new-input-label"><b>Last Name</b></label> | 154 | <label class="new-input-label"><b>Last Name</b></label> |
154 | </div> | 155 | </div> |
155 | 156 | ||
156 | 157 | ||
157 | </div> | 158 | </div> |
158 | 159 | ||
159 | </div> | 160 | </div> |
160 | 161 | ||
161 | <br/> | 162 | <br/> |
162 | 163 | ||
163 | 164 | ||
164 | <div class="col-xs-12"> | 165 | <div class="col-xs-12"> |
165 | 166 | ||
166 | <div class="col-md-6"> | 167 | <div class="col-md-6"> |
167 | <div class="pull-left" style="width: calc(140% - 170px);"> | 168 | <div class="pull-left" style="width: calc(140% - 170px);"> |
168 | <input type="text" ng-model="accountdata.firstName" placeholder="First Name" class="form-control" > | 169 | <input type="text" ng-model="accountdata.firstName" placeholder="First Name" class="form-control" > |
169 | </div> | 170 | </div> |
170 | 171 | ||
171 | <div class="clearfix"></div> | 172 | <div class="clearfix"></div> |
172 | </div> | 173 | </div> |
173 | <div class="col-md-6"> | 174 | <div class="col-md-6"> |
174 | <div class="pull-left" style="width: calc(140% - 170px);"> | 175 | <div class="pull-left" style="width: calc(140% - 170px);"> |
175 | <input type="text" ng-model="accountdata.lastName" placeholder="Last Name" class="form-control" > | 176 | <input type="text" ng-model="accountdata.lastName" placeholder="Last Name" class="form-control" > |
176 | </div> | 177 | </div> |
177 | 178 | ||
178 | <div class="clearfix"></div> | 179 | <div class="clearfix"></div> |
179 | </div> | 180 | </div> |
180 | </div> | 181 | </div> |
181 | <div class="clearfix"></div> | 182 | <div class="clearfix"></div> |
182 | <br/> | 183 | <br/> |
183 | 184 | ||
184 | <div class="col-xs-12"> | 185 | <div class="col-xs-12"> |
185 | 186 | ||
186 | <div class="col-md-6"> | 187 | <div class="col-md-6"> |
187 | <div class="pull-left" style="width: 110px;"> | 188 | <div class="pull-left" style="width: 110px;"> |
188 | <label class="new-input-label"><b>Email Username</b></label> | 189 | <label class="new-input-label"><b>Email Username</b></label> |
189 | </div> | 190 | </div> |
190 | 191 | ||
191 | 192 | ||
192 | </div> | 193 | </div> |
193 | <div class="col-md-6"> | 194 | <div class="col-md-6"> |
194 | <div class="pull-left" style="width: 110px;"> | 195 | <div class="pull-left" style="width: 110px;"> |
195 | <label class="new-input-label"><b>Password</b></label> | 196 | <label class="new-input-label"><b>Password</b></label> |
196 | </div> | 197 | </div> |
197 | 198 | ||
198 | 199 | ||
199 | </div> | 200 | </div> |
200 | 201 | ||
201 | </div> | 202 | </div> |
202 | 203 | ||
203 | <br/> | 204 | <br/> |
204 | <div class="col-xs-12"> | 205 | <div class="col-xs-12"> |
205 | 206 | ||
206 | <div class="col-md-6"> | 207 | <div class="col-md-6"> |
207 | <div class="pull-left" style="width: calc(140% - 170px);"> | 208 | <div class="pull-left" style="width: calc(140% - 170px);"> |
208 | <input type="email" ng-model="accountdata.userName" ng-blur="checkEmail(accountdata.userName, 'additional')" placeholder="XYZfbo@gmail.com" class="form-control" required > | 209 | <input type="email" ng-model="accountdata.userName" ng-blur="checkEmail(accountdata.userName, 'additional')" placeholder="XYZfbo@gmail.com" class="form-control" required > |
209 | </div> | 210 | </div> |
210 | 211 | ||
211 | <div class="clearfix"></div> | 212 | <div class="clearfix"></div> |
212 | </div> | 213 | </div> |
213 | <div class="col-md-6"> | 214 | <div class="col-md-6"> |
214 | <div class="pull-left" style="width: calc(140% - 170px);"> | 215 | <div class="pull-left" style="width: calc(140% - 170px);"> |
215 | <input type="text" ng-model="accountdata.password" placeholder="Password" class="form-control" > | 216 | <input type="text" ng-model="accountdata.password" placeholder="Password" class="form-control" > |
216 | </div> | 217 | </div> |
217 | 218 | ||
218 | <div class="clearfix"></div> | 219 | <div class="clearfix"></div> |
219 | </div> | 220 | </div> |
220 | </div> | 221 | </div> |
221 | <div class="clearfix"></div> | 222 | <div class="clearfix"></div> |
222 | <div class="clearfix"></div> | 223 | <div class="clearfix"></div> |
223 | <br/> | 224 | <br/> |
224 | <div class="col-xs-12"> | 225 | <div class="col-xs-12"> |
225 | <div class="col-md-6"> | 226 | <div class="col-md-6"> |
226 | <input type="checkbox" id="Weekdays" ng-model="accountdata.allowFma" >  Allow Fuel Manager Access | 227 | <input type="checkbox" id="Weekdays" ng-model="accountdata.allowFma" >  Allow Fuel Manager Access |
227 | <br> | 228 | <br> |
228 | <input type="checkbox" id="Weekdays" ng-model="accountdata.allowEpd" >  Allow Emailed Price Distribution | 229 | <input type="checkbox" id="Weekdays" ng-model="accountdata.allowEpd" >  Allow Emailed Price Distribution |
229 | </div> | 230 | </div> |
230 | </div> | 231 | </div> |
231 | <div class="clearfix"></div> | 232 | <div class="clearfix"></div> |
232 | <br/> | 233 | <br/> |
233 | <div class="col-xs-12"> | 234 | <div class="col-xs-12"> |
234 | 235 | ||
235 | </div> | 236 | </div> |
236 | 237 | ||
237 | 238 | ||
238 | </div> | 239 | </div> |
239 | </div> | 240 | </div> |
240 | 241 | ||
241 | </div> | 242 | </div> |
242 | </div> | 243 | </div> |
243 | </div> | 244 | </div> |
244 | </div> | 245 | </div> |
245 | 246 | ||
246 | <div class="modal-footer" style="border-top: 0;"> | 247 | <div class="modal-footer" style="border-top: 0;"> |
247 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="createAddAccount()" >Save</button> | 248 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="createAddAccount()" >Save</button> |
248 | <button type="button" class="btn btn-default" ng-click="cancelAddAccount()" data-dismiss="modal">Cancel</button> | 249 | <button type="button" class="btn btn-default" ng-click="cancelAddAccount()" data-dismiss="modal">Cancel</button> |
249 | </div> | 250 | </div> |
250 | </div> | 251 | </div> |
251 | </div> | 252 | </div> |
252 | </div> | 253 | </div> |
253 | </form> | 254 | </form> |
254 | <div class="customConfirmPopBackdrop" id="delete1"> | 255 | <div class="customConfirmPopBackdrop" id="delete1"> |
255 | <div class="customModalInner" style="max-width: 400px;"> | 256 | <div class="customModalInner" style="max-width: 400px;"> |
256 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 257 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
257 | <table> | 258 | <table> |
258 | <tr> | 259 | <tr> |
259 | <td> | 260 | <td> |
260 | <img src="img/info.png" style="width: 50px;"> | 261 | <img src="img/info.png" style="width: 50px;"> |
261 | </td> | 262 | </td> |
262 | <td> | 263 | <td> |
263 | <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this Account?</p> | 264 | <p style="padding: 5px 10px; margin-bottom: 0;">Please confirm! Are you sure you want to DELETE this Account?</p> |
264 | </td> | 265 | </td> |
265 | </tr> | 266 | </tr> |
266 | </table> | 267 | </table> |
267 | </div> | 268 | </div> |
app/partials/analytics/analytics.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | angular.module('acufuel') | 2 | angular.module('acufuel') |
3 | .controller('analyticsController', ['$scope', 'analyticsService', function($scope, analyticsService) { | 3 | .controller('analyticsController', ['$scope', 'analyticsService', function($scope, analyticsService) { |
4 | 4 | ||
5 | 5 | ||
6 | 6 | ||
7 | //Implemented drill down chart and Now used this on 07 Sep 2018 -KD | 7 | //Implemented drill down chart and Now used this on 07 Sep 2018 -KD |
8 | 8 | ||
9 | /* | 9 | /* |
10 | TODO: | 10 | TODO: |
11 | - Check data labels after drilling. Label rank? New positions? | 11 | - Check data labels after drilling. Label rank? New positions? |
12 | */ | 12 | */ |
13 | $scope.getAllRegionalPapDrilldown = function() { | 13 | $scope.getAllRegionalPapDrilldown = function() { |
14 | $scope.flag = true; //for spinner | 14 | $scope.flag = true; //for spinner |
15 | var data = Highcharts.geojson(Highcharts.maps['countries/us/us-all']); | 15 | var data = Highcharts.geojson(Highcharts.maps['countries/us/us-all']); |
16 | var separators = Highcharts.geojson(Highcharts.maps['countries/us/us-all'], 'mapline'); | 16 | var separators = Highcharts.geojson(Highcharts.maps['countries/us/us-all'], 'mapline'); |
17 | // Some responsiveness | ||
18 | //var small = $('#container').width() < 400; | ||
19 | 17 | ||
20 | analyticsService.getAllRPP().then(function(result) { | 18 | analyticsService.getAllRPP().then(function(result) { |
21 | for (var i = 0; i < data.length; i++) { | 19 | for (var i = 0; i < data.length; i++) { |
22 | for (var j = 0; j < result.length; j++) { | 20 | for (var j = 0; j < result.length; j++) { |
23 | if (data[i].name === result[j].region) { | 21 | if (data[i].name === result[j].region) { |
24 | 22 | ||
25 | data[i].value = result[j].averagePAP.toFixed(2); | 23 | data[i].value = result[j].averagePAP.toFixed(2); |
26 | 24 | ||
27 | } | 25 | } |
28 | } | 26 | } |
29 | 27 | ||
30 | } | 28 | } |
31 | 29 | ||
32 | $.each(data, function(i) { | 30 | $.each(data, function(i) { |
33 | this.drilldown = this.properties['hc-key']; | 31 | this.drilldown = this.properties['hc-key']; |
34 | this.value = this.value; | 32 | this.value = this.value; |
35 | }); | 33 | }); |
36 | 34 | ||
37 | $scope.flag = false; | 35 | $scope.flag = false; |
38 | // Instantiate the map | 36 | // Instantiate the map |
39 | Highcharts.mapChart('container', { | 37 | Highcharts.mapChart('container', { |
40 | chart: { | 38 | chart: { |
41 | events: { | 39 | events: { |
42 | drilldown: function(e) { | 40 | drilldown: function(e) { |
43 | if (!e.seriesOptions) { | 41 | if (!e.seriesOptions) { |
44 | var chart = this, | 42 | var chart = this, |
45 | mapKey = 'countries/us/' + e.point.drilldown + '-all', | 43 | mapKey = 'countries/us/' + e.point.drilldown + '-all', |
46 | 44 | ||
47 | // Handle error, the timeout is cleared on success | 45 | // Handle error, the timeout is cleared on success |
48 | fail = setTimeout(function() { | 46 | fail = setTimeout(function() { |
49 | if (!Highcharts.maps[mapKey]) { | 47 | if (!Highcharts.maps[mapKey]) { |
50 | // chart.showLoading('<i class="icon-frown"></i> Failed loading ' + e.point.name); | 48 | // chart.showLoading('<i class="icon-frown"></i> Failed loading ' + e.point.name); |
51 | fail = setTimeout(function() { | 49 | fail = setTimeout(function() { |
52 | chart.hideLoading(); | 50 | chart.hideLoading(); |
53 | }, 10000); | 51 | }, 10000); |
54 | } | 52 | } |
55 | }, 3000); | 53 | }, 3000); |
56 | 54 | ||
57 | // Show the spinner | 55 | // Show the spinner |
58 | chart.showLoading('<i class="icon-spinner icon-spin icon-3x"></i>'); // Font Awesome spinner | 56 | chart.showLoading('<i class="icon-spinner icon-spin icon-3x"></i>'); // Font Awesome spinner |
59 | 57 | ||
60 | // Load the drilldown map | 58 | // Load the drilldown map |
61 | var region = e.point.name; | 59 | var region = e.point.name; |
62 | analyticsService.getRPP(region).then(function(result) { | 60 | analyticsService.getRPP(region).then(function(result) { |
63 | $.getScript('https://code.highcharts.com/mapdata/' + mapKey + '.js', function() { | 61 | $.getScript('https://code.highcharts.com/mapdata/' + mapKey + '.js', function() { |
64 | //called the get api region wise | 62 | //called the get api region wise |
65 | data = Highcharts.geojson(Highcharts.maps[mapKey]); | 63 | data = Highcharts.geojson(Highcharts.maps[mapKey]); |
66 | for (var i = 0; i < data.length; i++) { | 64 | for (var i = 0; i < data.length; i++) { |
67 | for (var j = 0; j < result.length; j++) { | 65 | for (var j = 0; j < result.length; j++) { |
68 | 66 | ||
69 | //delete the County word from api result to match with map data | 67 | //delete the County word from api result to match with map data |
70 | result[j].region = result[j].region.replace("County", ""); | 68 | result[j].region = result[j].region.replace("County", ""); |
71 | 69 | ||
72 | if (data[i].name.trim() === result[j].region.trim()) { | 70 | if (data[i].name.trim() === result[j].region.trim()) { |
73 | 71 | ||
74 | data[i].value = result[j].averagePAP.toFixed(2); | 72 | data[i].value = result[j].averagePAP.toFixed(2); |
75 | 73 | ||
76 | } | 74 | } |
77 | } | 75 | } |
78 | 76 | ||
79 | } | 77 | } |
80 | 78 | ||
81 | // Set a non-random bogus value | 79 | // Set a non-random bogus value |
82 | $.each(data, function(i) { | 80 | $.each(data, function(i) { |
83 | this.value = this.value; | 81 | this.value = this.value; |
84 | }); | 82 | }); |
85 | // Hide loading and add series | 83 | // Hide loading and add series |
86 | chart.hideLoading(); | 84 | chart.hideLoading(); |
87 | clearTimeout(fail); | 85 | clearTimeout(fail); |
88 | chart.addSeriesAsDrilldown(e.point, { | 86 | chart.addSeriesAsDrilldown(e.point, { |
89 | name: e.point.name, | 87 | name: e.point.name, |
90 | data: data, | 88 | data: data, |
91 | dataLabels: { | 89 | dataLabels: { |
92 | enabled: true, | 90 | enabled: true, |
93 | format: '{point.name}' | 91 | format: '{point.name}' |
94 | } | 92 | } |
95 | }); | 93 | }); |
96 | }); | 94 | }); |
97 | }) | 95 | }) |
98 | } | 96 | } |
99 | 97 | ||
100 | this.setTitle(null, { | 98 | this.setTitle(null, { |
101 | text: e.point.name | 99 | text: e.point.name |
102 | }); | 100 | }); |
103 | }, | 101 | }, |
104 | drillup: function() { | 102 | drillup: function() { |
105 | this.setTitle(null, { | 103 | this.setTitle(null, { |
106 | text: '' | 104 | text: '' |
107 | }); | 105 | }); |
108 | } | 106 | } |
109 | } | 107 | } |
110 | }, | 108 | }, |
111 | 109 | ||
112 | title: { | 110 | title: { |
113 | text: 'USA Map-Drilldown for Regional Pricing' | 111 | text: 'USA Map-Drilldown for Regional Pricing' |
114 | }, | 112 | }, |
115 | 113 | ||
116 | subtitle: { | 114 | subtitle: { |
117 | text: '', | 115 | text: '', |
118 | floating: true, | 116 | floating: true, |
119 | align: 'right', | 117 | align: 'right', |
120 | y: 50, | 118 | y: 50, |
121 | style: { | 119 | style: { |
122 | fontSize: '16px' | 120 | fontSize: '16px' |
123 | } | 121 | } |
124 | }, | 122 | }, |
125 | 123 | ||
126 | /* legend: small ? {} : { | ||
127 | layout: 'vertical', | ||
128 | align: 'right', | ||
129 | verticalAlign: 'middle' | ||
130 | }, | ||
131 | |||
132 | colorAxis: { | ||
133 | min: 0, | ||
134 | minColor: '#E6E7E8', | ||
135 | maxColor: '#005645' | ||
136 | },*/ | ||
137 | |||
138 | mapNavigation: { | 124 | mapNavigation: { |
139 | enabled: true, | 125 | enabled: true, |
140 | buttonOptions: { | 126 | buttonOptions: { |
141 | verticalAlign: 'bottom' | 127 | verticalAlign: 'bottom' |
142 | } | 128 | } |
143 | }, | 129 | }, |
144 | 130 | ||
145 | plotOptions: { | 131 | plotOptions: { |
146 | map: { | 132 | map: { |
147 | states: { | 133 | states: { |
148 | hover: { | 134 | hover: { |
149 | color: '#EEDD66' | 135 | color: '#EEDD66' |
150 | } | 136 | } |
151 | } | 137 | } |
152 | } | 138 | } |
153 | }, | 139 | }, |
154 | 140 | ||
155 | series: [{ | 141 | series: [{ |
156 | data: data, | 142 | data: data, |
157 | name: 'USA', | 143 | name: 'USA', |
158 | dataLabels: { | 144 | dataLabels: { |
159 | enabled: true, | 145 | enabled: true, |
160 | format: '{point.properties.postal-code}' | 146 | format: '{point.properties.postal-code}' |
161 | } | 147 | } |
162 | }, { | 148 | }, { |
163 | type: 'mapline', | 149 | type: 'mapline', |
164 | data: separators, | 150 | data: separators, |
165 | color: 'silver', | 151 | color: 'silver', |
166 | enableMouseTracking: false, | 152 | enableMouseTracking: false, |
167 | animation: { | 153 | animation: { |
168 | duration: 500 | 154 | duration: 500 |
169 | } | 155 | } |
170 | }], | 156 | }], |
171 | 157 | ||
172 | drilldown: { | 158 | drilldown: { |
173 | activeDataLabelStyle: { | 159 | activeDataLabelStyle: { |
174 | color: '#FFFFFF', | 160 | color: '#FFFFFF', |
175 | textDecoration: 'none', | 161 | textDecoration: 'none', |
176 | textOutline: '1px #000000' | 162 | textOutline: '1px #000000' |
177 | }, | 163 | }, |
178 | drillUpButton: { | 164 | drillUpButton: { |
179 | relativeTo: 'spacingBox', | 165 | relativeTo: 'spacingBox', |
180 | position: { | 166 | position: { |
181 | x: 0, | 167 | x: 0, |
182 | y: 60 | 168 | y: 60 |
183 | } | 169 | } |
184 | } | 170 | } |
185 | } | 171 | } |
186 | }); | 172 | }); |
187 | }) | 173 | }) |
188 | } | 174 | } |
189 | 175 | ||
190 | $scope.getAllRegionalPapDrilldown(); | 176 | $scope.getAllRegionalPapDrilldown(); |
191 | 177 | ||
192 | 178 | ||
193 | $scope.cancelStatus = function() { | 179 | $scope.cancelStatus = function() { |
194 | $('#popup1').css('display', 'none'); | 180 | $('#popup1').css('display', 'none'); |
195 | } | 181 | } |
196 | $scope.ordersCost = 0; | 182 | $scope.ordersCost = 0; |
197 | $scope.ordersCount = 0; | 183 | $scope.ordersCount = 0; |
198 | 184 | ||
199 | $scope.orderCostAndCount = function() { | 185 | $scope.orderCostAndCount = function() { |
200 | analyticsService.orderCostAndCount().then(function(result) { | 186 | analyticsService.orderCostAndCount().then(function(result) { |
201 | $scope.ordersCost = result.cost; | 187 | $scope.ordersCost = result.cost; |
202 | $scope.ordersCount = result.count; | 188 | $scope.ordersCount = result.count; |
203 | }) | 189 | }) |
204 | } | 190 | } |
205 | 191 | ||
206 | $scope.drf = {}; | 192 | $scope.drf = {}; |
207 | $scope.hfp = {}; | 193 | $scope.hfp = {}; |
208 | $scope.cs = {}; | 194 | $scope.cs = {}; |
209 | $scope.mfsValues = []; | 195 | $scope.mfsValues = []; |
210 | $scope.msfarray = []; | 196 | $scope.msfarray = []; |
211 | $scope.getMFS = function() { | 197 | $scope.getMFS = function() { |
212 | //var makeId = makeId; | 198 | //var makeId = makeId; |
213 | analyticsService.getMFS().then(function(result) { | 199 | analyticsService.getMFS().then(function(result) { |
214 | $scope.mfsValues = result; | 200 | $scope.mfsValues = result; |
215 | $scope.optionsmfs = { | 201 | $scope.optionsmfs = { |
216 | chart: { | 202 | chart: { |
217 | type: 'multiBarChart', | 203 | type: 'multiBarChart', |
218 | height: 450, | 204 | height: 450, |
219 | margin: { | 205 | margin: { |
220 | top: 45, | 206 | top: 45, |
221 | right: 20, | 207 | right: 20, |
222 | bottom: 45, | 208 | bottom: 45, |
223 | left: 45 | 209 | left: 45 |
224 | }, | 210 | }, |
225 | clipEdge: true, | 211 | clipEdge: true, |
226 | //staggerLabels: true, | 212 | //staggerLabels: true, |
227 | duration: 500, | 213 | duration: 500, |
228 | stacked: false, | 214 | stacked: false, |
229 | color: ["#FEDFC3", "#990000", "#000099", "#009900"], | 215 | color: ["#FEDFC3", "#990000", "#000099", "#009900"], |
230 | xAxis: { | 216 | xAxis: { |
231 | axisLabel: 'Months', | 217 | axisLabel: 'Months', |
232 | showMaxMin: false, | 218 | showMaxMin: false, |
233 | }, | 219 | }, |
234 | yAxis: { | 220 | yAxis: { |
235 | axisLabel: 'Orders', | 221 | axisLabel: 'Orders', |
236 | axisLabelDistance: -20, | 222 | axisLabelDistance: -20, |
237 | tickFormat: function(d) { | 223 | tickFormat: function(d) { |
238 | return d3.format(',.1f')(d); | 224 | return d3.format(',')(d); |
239 | } | 225 | } |
240 | } | 226 | } |
241 | } | 227 | } |
242 | }; | 228 | }; |
243 | $scope.datamfs = $scope.mfsValues; | 229 | $scope.datamfs = $scope.mfsValues; |
244 | }) | 230 | }) |
245 | } | 231 | } |
246 | 232 | ||
247 | $scope.orderCostAndCount(); | 233 | $scope.orderCostAndCount(); |
248 | $scope.getMFS(); | 234 | $scope.getMFS(); |
249 | $scope.csValues = []; | 235 | $scope.csValues = []; |
250 | $scope.getCS = function() { | 236 | $scope.getCS = function() { |
251 | //var makeId = makeId; | 237 | //var makeId = makeId; |
252 | analyticsService.getCS().then(function(result) { | 238 | analyticsService.getCS().then(function(result) { |
253 | $scope.csValues = result; | 239 | $scope.csValues = result; |
240 | console.log("cs",result) | ||
254 | $scope.optionscs = { | 241 | $scope.optionscs = { |
255 | chart: { | 242 | chart: { |
256 | type: 'pieChart', | 243 | type: 'pieChart', |
257 | height: 500, | 244 | height: 500, |
258 | // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"], | ||
259 | x: function(d) { | 245 | x: function(d) { |
260 | return d.key; | 246 | return d.key; |
261 | }, | 247 | }, |
262 | y: function(d) { | 248 | y: function(d) { |
263 | return d.y; | 249 | return d.y; |
264 | }, | 250 | }, |
265 | showLabels: false, | 251 | showLabels: false, |
266 | segmentShowStroke: false, | 252 | segmentShowStroke: false, |
267 | animationSteps: 20, | 253 | animationSteps: 20, |
268 | animationEasing: "linear", | 254 | animationEasing: "linear", |
269 | animateScale: true, | 255 | animateScale: true, |
270 | duration: 500, | 256 | duration: 500, |
271 | labelThreshold: 0.01, | 257 | labelThreshold: 0.01, |
272 | labelSunbeamLayout: true, | 258 | labelSunbeamLayout: true, |
273 | legend: { | 259 | legend: { |
274 | margin: { | 260 | margin: { |
275 | top: 5, | 261 | top: 5, |
276 | right: 35, | 262 | right: 35, |
277 | bottom: 5, | 263 | bottom: 5, |
278 | left: 0 | 264 | left: 0 |
279 | } | 265 | } |
280 | } | 266 | } |
281 | } | 267 | } |
282 | }; | 268 | }; |
283 | $scope.datacs = $scope.csValues; | 269 | $scope.datacs = $scope.csValues; |
284 | }) | 270 | }) |
285 | } | 271 | } |
286 | 272 | ||
287 | $scope.getCS(); | 273 | $scope.getCS(); |
288 | 274 | ||
289 | 275 | ||
290 | $scope.hfpValuesOne = {}; | 276 | $scope.hfpValuesOne = {}; |
291 | $scope.hfpValuesOne.key = "JET-A Full Service"; | 277 | $scope.hfpValuesOne.key = "JET-A Full Service"; |
292 | $scope.hfpValuesOne.values = []; | 278 | $scope.hfpValuesOne.values = []; |
293 | 279 | ||
294 | $scope.hfpValuesTwo = {}; | 280 | $scope.hfpValuesTwo = {}; |
295 | $scope.hfpValuesTwo.key = "100LL Full Service"; | 281 | $scope.hfpValuesTwo.key = "100LL Full Service"; |
296 | $scope.hfpValuesTwo.values = []; | 282 | $scope.hfpValuesTwo.values = []; |
297 | 283 | ||
298 | $scope.hfpFinalData = []; | 284 | $scope.hfpFinalData = []; |
299 | 285 | ||
300 | $scope.getHfpChartData = function() { | 286 | $scope.getHfpChartData = function() { |
301 | analyticsService.gethfpChart().then(function(result) { | 287 | analyticsService.gethfpChart().then(function(result) { |
302 | for(var i=0; i<result.length; i++) { | 288 | for(var i=0; i<result.length; i++) { |
303 | if(result[i].includes("JET-A Full Service") ){ | 289 | if(result[i].includes("JET-A Full Service") ){ |
304 | let datePusha = result[i][0]; | 290 | let datePusha = result[i][0]; |
305 | let tempValue = result[i][1].toFixed(2); | 291 | let tempValue = result[i][1].toFixed(2); |
306 | let valePusha = parseFloat(tempValue); | 292 | let valePusha = parseFloat(tempValue); |
307 | $scope.hfpValuesOne.values.push([datePusha, valePusha]) | 293 | $scope.hfpValuesOne.values.push([datePusha, valePusha]) |
308 | }else if(result[i].includes("100LL Full Service") ) { | 294 | }else if(result[i].includes("100LL Full Service") ) { |
309 | let datePushb = result[i][0]; | 295 | let datePushb = result[i][0]; |
310 | let tempvalePushb = result[i][1].toFixed(2); | 296 | let tempvalePushb = result[i][1].toFixed(2); |
311 | let valePushb = parseFloat(tempvalePushb); | 297 | let valePushb = parseFloat(tempvalePushb); |
312 | $scope.hfpValuesTwo.values.push([datePushb, valePushb]) | 298 | $scope.hfpValuesTwo.values.push([datePushb, valePushb]) |
313 | } | 299 | } |
314 | } | 300 | } |
315 | $scope.hfpFinalData.push($scope.hfpValuesOne, $scope.hfpValuesTwo); | 301 | $scope.hfpFinalData.push($scope.hfpValuesOne, $scope.hfpValuesTwo); |
316 | // console.log('$scope.hfpFinalData', $scope.hfpFinalData); | 302 | // console.log('$scope.hfpFinalData', $scope.hfpFinalData); |
317 | 303 | ||
318 | var chart = nv.models.lineChart() | 304 | var chart = nv.models.lineChart() |
319 | .x(function(d) { return d[0] }) | 305 | .x(function(d) { return d[0] }) |
320 | //adjusting, 100% is 1.00, not 100 as it is in the data | 306 | //adjusting, 100% is 1.00, not 100 as it is in the data |
321 | .y(function(d) { return d[1]}) | 307 | .y(function(d) { return d[1]}) |
322 | .color(d3.scale.category10().range()) | 308 | .color(d3.scale.category10().range()) |
323 | .useInteractiveGuideline(true) | 309 | .useInteractiveGuideline(true) |
324 | ; | 310 | ; |
325 | 311 | ||
326 | chart.xAxis | 312 | chart.xAxis |
327 | .tickFormat(function(d) { | 313 | .tickFormat(function(d) { |
328 | return d3.time.format('%x')(new Date(d)) | 314 | return d3.time.format('%x')(new Date(d)) |
329 | }); | 315 | }); |
330 | 316 | ||
331 | chart.yAxis | 317 | chart.yAxis |
332 | .axisLabel("PaP / Retail Price") | 318 | .axisLabel("PaP / Retail Price") |
333 | .axisLabelDistance(-5) | 319 | .axisLabelDistance(-5) |
334 | .tickFormat(d3.format(',.2f')).showMaxMin(false); | 320 | .tickFormat(d3.format(',.2f')).showMaxMin(false); |
335 | 321 | ||
336 | d3.select('#chart svg') | 322 | d3.select('#chart svg') |
337 | .datum($scope.hfpFinalData) | 323 | .datum($scope.hfpFinalData) |
338 | .transition().duration(500) | 324 | .transition().duration(500) |
339 | .call(chart) | 325 | .call(chart) |
340 | ; | 326 | ; |
341 | 327 | ||
342 | nv.utils.windowResize(chart.update); | 328 | nv.utils.windowResize(chart.update); |
343 | 329 | ||
344 | return chart; | 330 | return chart; |
345 | }); | 331 | }); |
346 | } | 332 | } |
347 | $scope.getHfpChartData(); | 333 | $scope.getHfpChartData(); |
348 | 334 | ||
349 | /*Date Range Filter for Historic fuel Price*/ | 335 | /*Date Range Filter for Historic fuel Price*/ |
350 | $scope.submitDateHfp = function() { | 336 | $scope.submitDateHfp = function() { |
351 | 337 | ||
352 | $scope.hfpValuesFirst = {}; | 338 | $scope.hfpValuesFirst = {}; |
353 | $scope.hfpValuesFirst.key = "JET-A Full Service"; | 339 | $scope.hfpValuesFirst.key = "JET-A Full Service"; |
354 | $scope.hfpValuesFirst.values = []; | 340 | $scope.hfpValuesFirst.values = []; |
355 | 341 | ||
356 | $scope.hfpValuesSecond = {}; | 342 | $scope.hfpValuesSecond = {}; |
357 | $scope.hfpValuesSecond.key = "100LL Full Service"; | 343 | $scope.hfpValuesSecond.key = "100LL Full Service"; |
358 | $scope.hfpValuesSecond.values = []; | 344 | $scope.hfpValuesSecond.values = []; |
359 | 345 | ||
360 | $scope.hfpRangeData = []; | 346 | $scope.hfpRangeData = []; |
361 | 347 | ||
362 | if ($scope.hfp.fromDate === undefined) { | 348 | if ($scope.hfp.fromDate === undefined) { |
363 | 349 | ||
364 | $scope.fillForm = true; | 350 | $scope.fillForm = true; |
365 | } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate === undefined || $scope.hfp.toDate === '') { | 351 | } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate === undefined || $scope.hfp.toDate === '') { |
366 | $scope.fillForm = false; | 352 | $scope.fillForm = false; |
367 | var today = new Date(); | 353 | var today = new Date(); |
368 | var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2) + " " + '23:59:59'; | 354 | var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2) + " " + '23:59:59'; |
369 | //from date format | 355 | //from date format |
370 | $scope.dat1 = $scope.hfp.fromDate; | 356 | $scope.dat1 = $scope.hfp.fromDate; |
371 | $scope.fd1 = $scope.dat1.split("/").reverse(); | 357 | $scope.fd1 = $scope.dat1.split("/").reverse(); |
372 | $scope.tmp = $scope.fd1[2]; | 358 | $scope.tmp = $scope.fd1[2]; |
373 | $scope.fd1[2] = $scope.fd1[1]; | 359 | $scope.fd1[2] = $scope.fd1[1]; |
374 | $scope.fd1[1] = $scope.tmp; | 360 | $scope.fd1[1] = $scope.tmp; |
375 | $scope.fd = $scope.fd1.join("-"); | 361 | $scope.fd = $scope.fd1.join("-"); |
376 | // console.log("===date====",$scope.fd,"===dad====",DefaultToDate) | 362 | // console.log("===date====",$scope.fd,"===dad====",DefaultToDate) |
377 | analyticsService.getDRFHfpChart($scope.fd, DefaultToDate).then(function(result) { | 363 | analyticsService.getDRFHfpChart($scope.fd, DefaultToDate).then(function(result) { |
378 | // console.log("===date range===",$scope.fd,DefaultToDate) | 364 | // console.log("===date range===",$scope.fd,DefaultToDate) |
379 | for(var i=0; i<result.length; i++) { | 365 | for(var i=0; i<result.length; i++) { |
380 | if(result[i].includes("JET-A Full Service") ){ | 366 | if(result[i].includes("JET-A Full Service") ){ |
381 | let datePusha = result[i][0]; | 367 | let datePusha = result[i][0]; |
382 | let tempValue = result[i][1].toFixed(2); | 368 | let tempValue = result[i][1].toFixed(2); |
383 | let valePusha = parseFloat(tempValue); | 369 | let valePusha = parseFloat(tempValue); |
384 | $scope.hfpValuesFirst.values.push([datePusha, valePusha]) | 370 | $scope.hfpValuesFirst.values.push([datePusha, valePusha]) |
385 | }else if(result[i].includes("100LL Full Service") ) { | 371 | }else if(result[i].includes("100LL Full Service") ) { |
386 | let datePushb = result[i][0]; | 372 | let datePushb = result[i][0]; |
387 | let tempvalePushb = result[i][1].toFixed(2); | 373 | let tempvalePushb = result[i][1].toFixed(2); |
388 | let valePushb = parseFloat(tempvalePushb); | 374 | let valePushb = parseFloat(tempvalePushb); |
389 | $scope.hfpValuesSecond.values.push([datePushb, valePushb]) | 375 | $scope.hfpValuesSecond.values.push([datePushb, valePushb]) |
390 | } | 376 | } |
391 | } | 377 | } |
392 | $scope.hfpRangeData.push($scope.hfpValuesFirst, $scope.hfpValuesSecond); | 378 | $scope.hfpRangeData.push($scope.hfpValuesFirst, $scope.hfpValuesSecond); |
393 | //console.log('$scope.hfpRangeData', $scope.hfpRangeData); | 379 | //console.log('$scope.hfpRangeData', $scope.hfpRangeData); |
394 | 380 | ||
395 | var chart = nv.models.lineChart() | 381 | var chart = nv.models.lineChart() |
396 | .x(function(d) { if(d.length >0){return d[0]}}) | 382 | .x(function(d) { if(d.length >0){return d[0]}}) |
397 | //adjusting, 100% is 1.00, not 100 as it is in the data | 383 | //adjusting, 100% is 1.00, not 100 as it is in the data |
398 | .y(function(d) { return d[1]}) | 384 | .y(function(d) { return d[1]}) |
399 | .color(d3.scale.category10().range()) | 385 | .color(d3.scale.category10().range()) |
400 | .useInteractiveGuideline(true) | 386 | .useInteractiveGuideline(true) |
401 | ; | 387 | ; |
402 | 388 | ||
403 | chart.xAxis | 389 | chart.xAxis |
404 | .tickFormat(function(d) { | 390 | .tickFormat(function(d) { |
405 | return d3.time.format('%x')(new Date(d)) | 391 | return d3.time.format('%x')(new Date(d)) |
406 | }); | 392 | }); |
407 | 393 | ||
408 | chart.yAxis | 394 | chart.yAxis |
409 | .axisLabel("PaP / Retail Price") | 395 | .axisLabel("PaP / Retail Price") |
410 | .axisLabelDistance(-5) | 396 | .axisLabelDistance(-5) |
411 | .tickFormat(d3.format(',.2f')).showMaxMin(false); | 397 | .tickFormat(d3.format(',.2f')).showMaxMin(false); |
412 | 398 | ||
413 | d3.select('#chart svg') | 399 | d3.select('#chart svg') |
414 | .datum($scope.hfpRangeData) | 400 | .datum($scope.hfpRangeData) |
415 | .transition().duration(500) | 401 | .transition().duration(500) |
416 | .call(chart) | 402 | .call(chart) |
417 | ; | 403 | ; |
418 | 404 | ||
419 | nv.utils.windowResize(chart.update); | 405 | nv.utils.windowResize(chart.update); |
420 | 406 | ||
421 | return chart; | 407 | return chart; |
422 | }) | 408 | }) |
423 | 409 | ||
424 | 410 | ||
425 | } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate != undefined) { | 411 | } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate != undefined) { |
426 | $scope.fillForm = false; | 412 | $scope.fillForm = false; |
427 | //from date format | 413 | //from date format |
428 | $scope.dat1 = $scope.hfp.fromDate; | 414 | $scope.dat1 = $scope.hfp.fromDate; |
429 | $scope.fd1 = $scope.dat1.split("/").reverse(); | 415 | $scope.fd1 = $scope.dat1.split("/").reverse(); |
430 | $scope.tmp = $scope.fd1[2]; | 416 | $scope.tmp = $scope.fd1[2]; |
431 | $scope.fd1[2] = $scope.fd1[1]; | 417 | $scope.fd1[2] = $scope.fd1[1]; |
432 | $scope.fd1[1] = $scope.tmp; | 418 | $scope.fd1[1] = $scope.tmp; |
433 | $scope.fd = $scope.fd1.join("-"); | 419 | $scope.fd = $scope.fd1.join("-"); |
434 | //to date format | 420 | //to date format |
435 | $scope.dat2 = $scope.hfp.toDate; | 421 | $scope.dat2 = $scope.hfp.toDate; |
436 | $scope.td1 = $scope.dat2.split("/").reverse(); | 422 | $scope.td1 = $scope.dat2.split("/").reverse(); |
437 | $scope.tmp1 = $scope.td1[2]; | 423 | $scope.tmp1 = $scope.td1[2]; |
438 | $scope.td1[2] = $scope.td1[1]; | 424 | $scope.td1[2] = $scope.td1[1]; |
439 | $scope.td1[1] = $scope.tmp1; | 425 | $scope.td1[1] = $scope.tmp1; |
440 | $scope.td = $scope.td1.join("-") + " " + '23:59:59'; | 426 | $scope.td = $scope.td1.join("-") + " " + '23:59:59'; |
441 | // console.log("===both dates==",$scope.td) | 427 | // console.log("===both dates==",$scope.td) |
442 | analyticsService.getDRFHfpChart($scope.fd, $scope.td).then(function(result) { | 428 | analyticsService.getDRFHfpChart($scope.fd, $scope.td).then(function(result) { |
443 | //console.log("===date range22===",result); | 429 | //console.log("===date range22===",result); |
444 | for(var i=0; i<result.length; i++) { | 430 | for(var i=0; i<result.length; i++) { |
445 | if(result[i].includes("JET-A Full Service") ){ | 431 | if(result[i].includes("JET-A Full Service") ){ |
446 | let datePusha = result[i][0]; | 432 | let datePusha = result[i][0]; |
447 | let tempValue = result[i][1].toFixed(2); | 433 | let tempValue = result[i][1].toFixed(2); |
448 | let valePusha = parseFloat(tempValue); | 434 | let valePusha = parseFloat(tempValue); |
449 | $scope.hfpValuesFirst.values.push([datePusha, valePusha]) | 435 | $scope.hfpValuesFirst.values.push([datePusha, valePusha]) |
450 | }else if(result[i].includes("100LL Full Service") ) { | 436 | }else if(result[i].includes("100LL Full Service") ) { |
451 | let datePushb = result[i][0]; | 437 | let datePushb = result[i][0]; |
452 | let tempvalePushb = result[i][1].toFixed(2); | 438 | let tempvalePushb = result[i][1].toFixed(2); |
453 | let valePushb = parseFloat(tempvalePushb); | 439 | let valePushb = parseFloat(tempvalePushb); |
454 | $scope.hfpValuesSecond.values.push([datePushb, valePushb]) | 440 | $scope.hfpValuesSecond.values.push([datePushb, valePushb]) |
455 | } | 441 | } |
456 | } | 442 | } |
457 | $scope.hfpRangeData.push($scope.hfpValuesFirst, $scope.hfpValuesSecond); | 443 | $scope.hfpRangeData.push($scope.hfpValuesFirst, $scope.hfpValuesSecond); |
458 | // console.log('$scope.hfpRangeData', $scope.hfpRangeData); | 444 | // console.log('$scope.hfpRangeData', $scope.hfpRangeData); |
459 | 445 | ||
460 | var chart = nv.models.lineChart() | 446 | var chart = nv.models.lineChart() |
461 | .x(function(d) { if(d.length >0){return d[0] }}) | 447 | .x(function(d) { if(d.length >0){return d[0] }}) |
462 | //adjusting, 100% is 1.00, not 100 as it is in the data | 448 | //adjusting, 100% is 1.00, not 100 as it is in the data |
463 | .y(function(d) { return d[1]}) | 449 | .y(function(d) { return d[1]}) |
464 | .color(d3.scale.category10().range()) | 450 | .color(d3.scale.category10().range()) |
465 | .useInteractiveGuideline(true) | 451 | .useInteractiveGuideline(true) |
466 | ; | 452 | ; |
467 | 453 | ||
468 | chart.xAxis | 454 | chart.xAxis |
469 | .tickFormat(function(d) { | 455 | .tickFormat(function(d) { |
470 | return d3.time.format('%x')(new Date(d)) | 456 | return d3.time.format('%x')(new Date(d)) |
471 | }); | 457 | }); |
472 | 458 | ||
473 | chart.yAxis | 459 | chart.yAxis |
474 | .axisLabel("PaP / Retail Price") | 460 | .axisLabel("PaP / Retail Price") |
475 | .axisLabelDistance(-5) | 461 | .axisLabelDistance(-5) |
476 | .tickFormat(d3.format(',.2f')).showMaxMin(false); | 462 | .tickFormat(d3.format(',.2f')).showMaxMin(false); |
477 | 463 | ||
478 | d3.select('#chart svg') | 464 | d3.select('#chart svg') |
479 | .datum($scope.hfpRangeData) | 465 | .datum($scope.hfpRangeData) |
480 | .transition().duration(500) | 466 | .transition().duration(500) |
481 | .call(chart) | 467 | .call(chart) |
482 | ; | 468 | ; |
483 | 469 | ||
484 | nv.utils.windowResize(chart.update); | 470 | nv.utils.windowResize(chart.update); |
485 | 471 | ||
486 | return chart; | 472 | return chart; |
487 | }) | 473 | }) |
488 | 474 | ||
489 | } else { | 475 | } else { |
490 | $scope.fillForm = true; | 476 | $scope.fillForm = true; |
491 | } | 477 | } |
492 | 478 | ||
493 | 479 | ||
494 | } | 480 | } |
495 | 481 | ||
496 | 482 | ||
497 | /*Date Range Filter for Monthly fuel Sales*/ | 483 | /*Date Range Filter for Monthly fuel Sales*/ |
498 | $scope.submitDate = function() { | 484 | $scope.submitDate = function() { |
499 | if ($scope.drf.fromDate === undefined) { | 485 | if ($scope.drf.fromDate === undefined) { |
500 | $scope.fillForm = true; | 486 | $scope.fillForm = true; |
501 | } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate === undefined || $scope.drf.toDate === '') { | 487 | } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate === undefined || $scope.drf.toDate === '') { |
502 | $scope.fillForm = false; | 488 | $scope.fillForm = false; |
503 | var today = new Date(); | 489 | var today = new Date(); |
504 | var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2); | 490 | var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2); |
505 | //from date format | 491 | //from date format |
506 | $scope.dat1 = $scope.drf.fromDate; | 492 | $scope.dat1 = $scope.drf.fromDate; |
507 | $scope.fd1 = $scope.dat1.split("/").reverse(); | 493 | $scope.fd1 = $scope.dat1.split("/").reverse(); |
508 | $scope.tmp = $scope.fd1[2]; | 494 | $scope.tmp = $scope.fd1[2]; |
509 | $scope.fd1[2] = $scope.fd1[1]; | 495 | $scope.fd1[2] = $scope.fd1[1]; |
510 | $scope.fd1[1] = $scope.tmp; | 496 | $scope.fd1[1] = $scope.tmp; |
511 | $scope.fd = $scope.fd1.join("-"); | 497 | $scope.fd = $scope.fd1.join("-"); |
512 | analyticsService.getDRFChart($scope.fd, DefaultToDate).then(function(result) { | 498 | analyticsService.getDRFChart($scope.fd, DefaultToDate).then(function(result) { |
513 | $scope.datamfs = []; | 499 | $scope.datamfs = []; |
514 | $scope.datamfs = result; | 500 | $scope.datamfs = result; |
515 | }) | 501 | }) |
516 | 502 | ||
517 | analyticsService.orderCostAndCountByDate($scope.fd, DefaultToDate).then(function(result) { | 503 | analyticsService.orderCostAndCountByDate($scope.fd, DefaultToDate).then(function(result) { |
518 | $scope.ordersCost = result.cost; | 504 | $scope.ordersCost = result.cost; |
519 | $scope.ordersCount = result.count; | 505 | $scope.ordersCount = result.count; |
520 | }) | 506 | }) |
521 | } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate != undefined) { | 507 | } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate != undefined) { |
522 | $scope.fillForm = false; | 508 | $scope.fillForm = false; |
523 | //from date format | 509 | //from date format |
524 | $scope.dat1 = $scope.drf.fromDate; | 510 | $scope.dat1 = $scope.drf.fromDate; |
525 | $scope.fd1 = $scope.dat1.split("/").reverse(); | 511 | $scope.fd1 = $scope.dat1.split("/").reverse(); |
526 | $scope.tmp = $scope.fd1[2]; | 512 | $scope.tmp = $scope.fd1[2]; |
527 | $scope.fd1[2] = $scope.fd1[1]; | 513 | $scope.fd1[2] = $scope.fd1[1]; |
528 | $scope.fd1[1] = $scope.tmp; | 514 | $scope.fd1[1] = $scope.tmp; |
529 | $scope.fd = $scope.fd1.join("-"); | 515 | $scope.fd = $scope.fd1.join("-"); |
530 | $scope.dat2 = $scope.drf.toDate; | 516 | $scope.dat2 = $scope.drf.toDate; |
531 | $scope.td1 = $scope.dat2.split("/").reverse(); | 517 | $scope.td1 = $scope.dat2.split("/").reverse(); |
532 | $scope.tmp1 = $scope.td1[2]; | 518 | $scope.tmp1 = $scope.td1[2]; |
533 | $scope.td1[2] = $scope.td1[1]; | 519 | $scope.td1[2] = $scope.td1[1]; |
534 | $scope.td1[1] = $scope.tmp1; | 520 | $scope.td1[1] = $scope.tmp1; |
535 | $scope.td = $scope.td1.join("-"); | 521 | $scope.td = $scope.td1.join("-"); |
536 | 522 | ||
537 | analyticsService.getDRFChart($scope.fd, $scope.td).then(function(result) { | 523 | analyticsService.getDRFChart($scope.fd, $scope.td).then(function(result) { |
538 | $scope.datamfs = []; | 524 | $scope.datamfs = []; |
539 | $scope.datamfs = result; | 525 | $scope.datamfs = result; |
540 | }) | 526 | }) |
541 | 527 | ||
542 | analyticsService.orderCostAndCountByDate($scope.fd, $scope.td).then(function(result) { | 528 | analyticsService.orderCostAndCountByDate($scope.fd, $scope.td).then(function(result) { |
543 | $scope.ordersCost = result.cost; | 529 | $scope.ordersCost = result.cost; |
544 | $scope.ordersCount = result.count; | 530 | $scope.ordersCount = result.count; |
545 | }) | 531 | }) |
546 | 532 | ||
547 | } else { | 533 | } else { |
548 | $scope.fillForm = true; | 534 | $scope.fillForm = true; |
549 | } | 535 | } |
550 | 536 | ||
551 | 537 | ||
552 | } | 538 | } |
553 | 539 | ||
554 | 540 | ||
555 | 541 | ||
556 | /*Date Range Filter for Customer Sources*/ | 542 | /*Date Range Filter for Customer Sources*/ |
557 | $scope.submitDateCs = function() { | 543 | $scope.submitDateCs = function() { |
558 | if ($scope.cs.fromDate === undefined) { | 544 | if ($scope.cs.fromDate === undefined) { |
559 | 545 | ||
560 | $scope.fillForm = true; | 546 | $scope.fillForm = true; |
561 | } else if ($scope.cs.fromDate != undefined && $scope.cs.toDate === undefined || $scope.cs.toDate === '') { | 547 | } else if ($scope.cs.fromDate != undefined && $scope.cs.toDate === undefined || $scope.cs.toDate === '') { |
562 | $scope.fillForm = false; | 548 | $scope.fillForm = false; |
563 | var today = new Date(); | 549 | var today = new Date(); |
564 | var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2); | 550 | var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2); |
565 | //from date format | 551 | //from date format |
566 | $scope.dat1 = $scope.cs.fromDate; | 552 | $scope.dat1 = $scope.cs.fromDate; |
567 | $scope.fd1 = $scope.dat1.split("/").reverse(); | 553 | $scope.fd1 = $scope.dat1.split("/").reverse(); |
568 | $scope.tmp = $scope.fd1[2]; | 554 | $scope.tmp = $scope.fd1[2]; |
569 | $scope.fd1[2] = $scope.fd1[1]; | 555 | $scope.fd1[2] = $scope.fd1[1]; |
570 | $scope.fd1[1] = $scope.tmp; | 556 | $scope.fd1[1] = $scope.tmp; |
571 | $scope.fd = $scope.fd1.join("-"); | 557 | $scope.fd = $scope.fd1.join("-"); |
572 | analyticsService.getDRFCSChart($scope.fd, DefaultToDate).then(function(result) { | 558 | analyticsService.getDRFCSChart($scope.fd, DefaultToDate).then(function(result) { |
573 | $scope.csValues = result; | 559 | $scope.csValues = result; |
574 | $scope.optionscs = { | 560 | $scope.optionscs = { |
575 | chart: { | 561 | chart: { |
576 | type: 'pieChart', | 562 | type: 'pieChart', |
577 | height: 500, | 563 | height: 500, |
578 | // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"], | 564 | // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"], |
579 | x: function(d) { | 565 | x: function(d) { |
580 | return d.key; | 566 | return d.key; |
581 | }, | 567 | }, |
582 | y: function(d) { | 568 | y: function(d) { |
583 | return d.y; | 569 | return d.y; |
584 | }, | 570 | }, |
585 | showLabels: false, | 571 | showLabels: false, |
586 | segmentShowStroke: false, | 572 | segmentShowStroke: false, |
587 | animationSteps: 20, | 573 | animationSteps: 20, |
588 | animationEasing: "linear", | 574 | animationEasing: "linear", |
589 | animateScale: true, | 575 | animateScale: true, |
590 | duration: 500, | 576 | duration: 500, |
591 | labelThreshold: 0.01, | 577 | labelThreshold: 0.01, |
592 | labelSunbeamLayout: true, | 578 | labelSunbeamLayout: true, |
593 | legend: { | 579 | legend: { |
594 | margin: { | 580 | margin: { |
595 | top: 5, | 581 | top: 5, |
596 | right: 35, | 582 | right: 35, |
597 | bottom: 5, | 583 | bottom: 5, |
598 | left: 0 | 584 | left: 0 |
599 | } | 585 | } |
600 | } | 586 | } |
601 | } | 587 | } |
602 | }; | 588 | }; |
603 | $scope.datacs = $scope.csValues; | 589 | $scope.datacs = $scope.csValues; |
604 | }) | 590 | }) |
605 | 591 | ||
606 | 592 | ||
607 | } else if ($scope.cs.fromDate != undefined && $scope.cs.toDate != undefined) { | 593 | } else if ($scope.cs.fromDate != undefined && $scope.cs.toDate != undefined) { |
608 | $scope.fillForm = false; | 594 | $scope.fillForm = false; |
609 | //from date format | 595 | //from date format |
610 | $scope.dat1 = $scope.cs.fromDate; | 596 | $scope.dat1 = $scope.cs.fromDate; |
611 | $scope.fd1 = $scope.dat1.split("/").reverse(); | 597 | $scope.fd1 = $scope.dat1.split("/").reverse(); |
612 | $scope.tmp = $scope.fd1[2]; | 598 | $scope.tmp = $scope.fd1[2]; |
613 | $scope.fd1[2] = $scope.fd1[1]; | 599 | $scope.fd1[2] = $scope.fd1[1]; |
614 | $scope.fd1[1] = $scope.tmp; | 600 | $scope.fd1[1] = $scope.tmp; |
615 | $scope.fd = $scope.fd1.join("-"); | 601 | $scope.fd = $scope.fd1.join("-"); |
616 | //to date format | 602 | //to date format |
617 | $scope.dat2 = $scope.cs.toDate; | 603 | $scope.dat2 = $scope.cs.toDate; |
618 | $scope.td1 = $scope.dat2.split("/").reverse(); | 604 | $scope.td1 = $scope.dat2.split("/").reverse(); |
619 | $scope.tmp1 = $scope.td1[2]; | 605 | $scope.tmp1 = $scope.td1[2]; |
620 | $scope.td1[2] = $scope.td1[1]; | 606 | $scope.td1[2] = $scope.td1[1]; |
621 | $scope.td1[1] = $scope.tmp1; | 607 | $scope.td1[1] = $scope.tmp1; |
622 | $scope.td = $scope.td1.join("-"); | 608 | $scope.td = $scope.td1.join("-"); |
623 | 609 | ||
624 | analyticsService.getDRFCSChart($scope.fd, $scope.td).then(function(result) { | 610 | analyticsService.getDRFCSChart($scope.fd, $scope.td).then(function(result) { |
625 | $scope.csValues = result; | 611 | $scope.csValues = result; |
626 | $scope.optionscs = { | 612 | $scope.optionscs = { |
627 | chart: { | 613 | chart: { |
628 | type: 'pieChart', | 614 | type: 'pieChart', |
629 | height: 500, | 615 | height: 500, |
630 | // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"], | ||
631 | x: function(d) { | 616 | x: function(d) { |
632 | return d.key; | 617 | return d.key; |
633 | }, | 618 | }, |
634 | y: function(d) { | 619 | y: function(d) { |
635 | return d.y; | 620 | return d.y; |
636 | }, | 621 | }, |
637 | showLabels: false, | 622 | showLabels: false, |
638 | segmentShowStroke: false, | 623 | segmentShowStroke: false, |
639 | animationSteps: 20, | 624 | animationSteps: 20, |
640 | animationEasing: "linear", | 625 | animationEasing: "linear", |
641 | animateScale: true, | 626 | animateScale: true, |
642 | duration: 500, | 627 | duration: 500, |
643 | labelThreshold: 0.01, | 628 | labelThreshold: 0.01, |
644 | labelSunbeamLayout: true, | 629 | labelSunbeamLayout: true, |
645 | legend: { | 630 | legend: { |
646 | margin: { | 631 | margin: { |
647 | top: 5, | 632 | top: 5, |
648 | right: 35, | 633 | right: 35, |
649 | bottom: 5, | 634 | bottom: 5, |
650 | left: 0 | 635 | left: 0 |
651 | } | 636 | } |
652 | } | 637 | } |
653 | } | 638 | } |
654 | }; | 639 | }; |
655 | $scope.datacs = $scope.csValues; | 640 | $scope.datacs = $scope.csValues; |
656 | }) | 641 | }) |
657 | 642 | ||
658 | } else { | 643 | } else { |
659 | $scope.fillForm = true; | 644 | $scope.fillForm = true; |
660 | } | 645 | } |
661 | 646 | ||
662 | 647 | ||
663 | } | 648 | } |
664 | 649 | ||
665 | 650 |
app/partials/analytics/analytics.html
1 | <style> | 1 | <style> |
2 | .chart-holder { | 2 | .chart-holder { |
3 | height: 325px; | 3 | height: 325px; |
4 | } | 4 | } |
5 | .cirque-stats { | 5 | .cirque-stats { |
6 | text-align: center; | 6 | text-align: center; |
7 | } | 7 | } |
8 | .cirque-stats .cirque-container { | 8 | .cirque-stats .cirque-container { |
9 | margin-top: 1.5em; | 9 | margin-top: 1.5em; |
10 | margin-bottom: 1.5em; | 10 | margin-bottom: 1.5em; |
11 | margin-right: 2em; | 11 | margin-right: 2em; |
12 | margin-left: 2em; | 12 | margin-left: 2em; |
13 | } | 13 | } |
14 | .subnavbar .mainnav > li:nth-child(6) > a{ | 14 | .subnavbar .mainnav > li:nth-child(6) > a{ |
15 | color: #ca5c6a; | 15 | color: #ca5c6a; |
16 | } | 16 | } |
17 | .table { | 17 | .table { |
18 | border-collapse: separate; | 18 | border-collapse: separate; |
19 | padding: 0px; | 19 | padding: 0px; |
20 | 20 | ||
21 | } | 21 | } |
22 | 22 | ||
23 | .highcharts-button-box{ | 23 | .highcharts-button-box{ |
24 | display: none; | 24 | display: none; |
25 | } | 25 | } |
26 | 26 | ||
27 | .highcharts-button-symbol{ | 27 | .highcharts-button-symbol{ |
28 | display: none; | 28 | display: none; |
29 | } | 29 | } |
30 | 30 | ||
31 | .highcharts-map-navigation{ | 31 | .highcharts-map-navigation{ |
32 | background-color: #eee; | 32 | background-color: #eee; |
33 | border-color: grey; | 33 | border-color: grey; |
34 | } | 34 | } |
35 | 35 | ||
36 | #chart svg { | 36 | #chart svg { |
37 | height: 400px; | 37 | height: 400px; |
38 | } | 38 | } |
39 | @import 'https://code.highcharts.com/css/themes/sand-signika.css'; | 39 | @import 'https://code.highcharts.com/css/themes/sand-signika.css'; |
40 | </style> | 40 | </style> |
41 | 41 | ||
42 | <div class="main"> | 42 | <div class="main"> |
43 | <div style="padding: 0 3%; margin-left: 15px;"> | 43 | <div style="padding: 0 3%; margin-left: 15px;"> |
44 | <div class="row"> | 44 | <div class="row"> |
45 | <div class="col-md-6"> | 45 | <div class="col-md-6"> |
46 | <div class="customInputWrap"> | 46 | <div class="customInputWrap"> |
47 | <div style="margin-left: 0px;"> | 47 | <div style="margin-left: 0px;"> |
48 | <label>Date Range Filter</label> | 48 | <label>Date Range Filter</label> |
49 | <form name="myForm"> | 49 | <form name="myForm"> |
50 | <input type="text" ng-model="drf.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> | 50 | <input type="text" ng-model="drf.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> |
51 | <input type="text" ng-model="drf.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> | 51 | <input type="text" ng-model="drf.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> |
52 | <button class="btn btn-primary" ng-disabled="myForm.$invalid" ng-click="submitDate()" style="float: left; display: none;">Apply</button> | 52 | <button class="btn btn-primary" ng-disabled="myForm.$invalid" ng-click="submitDate()" style="float: left; display: none;">Apply</button> |
53 | <button class="btn btn-primary" ng-click="submitDate()" style="float: left;">Apply</button> | 53 | <button class="btn btn-primary" ng-click="submitDate()" style="float: left;">Apply</button> |
54 | <div class="clearfix"></div> | 54 | <div class="clearfix"></div> |
55 | </form> | 55 | </form> |
56 | </div> | 56 | </div> |
57 | <div class="clearfix"></div> | 57 | <div class="clearfix"></div> |
58 | </div> | 58 | </div> |
59 | <div class="widget stacked"> | 59 | <div class="widget stacked"> |
60 | <div class="widget-header"> | 60 | <div class="widget-header"> |
61 | <i class="icon-bar-chart"></i> | 61 | <i class="icon-bar-chart"></i> |
62 | <h3>${{ordersCost | number :2}}/{{ordersCount}} Fuel Sales</h3> | 62 | <h3>${{ordersCost | number :2}}/{{ordersCount}} Fuel Sales</h3> |
63 | </div> | 63 | </div> |
64 | <!-- /widget-header --> | 64 | <!-- /widget-header --> |
65 | <div class="widget-content"> | 65 | <div class="widget-content"> |
66 | <nvd3 options="optionsmfs" data="datamfs"></nvd3> | 66 | <nvd3 options="optionsmfs" data="datamfs"></nvd3> |
67 | <!-- /bar-chart --> | 67 | <!-- /bar-chart --> |
68 | </div> | 68 | </div> |
69 | <!-- /widget-content --> | 69 | <!-- /widget-content --> |
70 | </div> | 70 | </div> |
71 | <!-- /widget --> | 71 | <!-- /widget --> |
72 | </div> | 72 | </div> |
73 | <!-- /.span6 --> | 73 | <!-- /.span6 --> |
74 | <div class="col-md-6"> | 74 | <div class="col-md-6"> |
75 | <div class="customInputWrap"> | 75 | <div class="customInputWrap"> |
76 | <div style="margin-left: 0px;"> | 76 | <div style="margin-left: 0px;"> |
77 | <label>Date Range Filter</label> | 77 | <label>Date Range Filter</label> |
78 | <form name="myForm1"> | 78 | <form name="myForm1"> |
79 | <input type="text" ng-model="hfp.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> | 79 | <input type="text" ng-model="hfp.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> |
80 | <input type="text" ng-model="hfp.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> | 80 | <input type="text" ng-model="hfp.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> |
81 | <button class="btn btn-primary" ng-disabled="myForm1.$invalid" ng-click="submitDateHfp()" style="float: left; display: none;">Apply</button> | 81 | <button class="btn btn-primary" ng-disabled="myForm1.$invalid" ng-click="submitDateHfp()" style="float: left; display: none;">Apply</button> |
82 | <button class="btn btn-primary" ng-click="submitDateHfp()" style="float: left;">Apply</button> | 82 | <button class="btn btn-primary" ng-click="submitDateHfp()" style="float: left;">Apply</button> |
83 | <div class="clearfix"></div> | 83 | <div class="clearfix"></div> |
84 | </form> | 84 | </form> |
85 | </div> | 85 | </div> |
86 | <div class="clearfix"></div> | 86 | <div class="clearfix"></div> |
87 | </div> | 87 | </div> |
88 | <div class="widget stacked"> | 88 | <div class="widget stacked"> |
89 | <div class="widget-header"> | 89 | <div class="widget-header"> |
90 | <i class="icon-bar-chart"></i> | 90 | <i class="icon-bar-chart"></i> |
91 | <h3>Historic Fuel Pricing</h3> | 91 | <h3>Historic Fuel Pricing</h3> |
92 | </div> | 92 | </div> |
93 | <!-- /widget-header --> | 93 | <!-- /widget-header --> |
94 | <div class="widget-content"> | 94 | <div class="widget-content"> |
95 | <!-- <nvd3 options="optionshfp" data="datahfp"></nvd3> --> | 95 | <!-- <nvd3 options="optionshfp" data="datahfp"></nvd3> --> |
96 | <!-- /pie-chart --> | 96 | <!-- /pie-chart --> |
97 | <div id="chart"><svg></svg></div> | 97 | <div id="chart"><svg></svg></div> |
98 | </div> | 98 | </div> |
99 | <!-- /widget-content --> | 99 | <!-- /widget-content --> |
100 | </div> | 100 | </div> |
101 | <!-- /widget --> | 101 | <!-- /widget --> |
102 | </div> | 102 | </div> |
103 | <!-- /span6 --> | 103 | <!-- /span6 --> |
104 | </div> | 104 | </div> |
105 | <div class="row"></div> | 105 | <div class="row"></div> |
106 | <div class="row"> | 106 | <div class="row"> |
107 | <div class="col-md-6"> | 107 | <div class="col-md-6"> |
108 | <div class="customInputWrap"> | 108 | <div class="customInputWrap"> |
109 | <div style="margin-left: 0px;"> | 109 | <div style="margin-left: 0px;"> |
110 | <label>Date Range Filter</label> | 110 | <label>Date Range Filter</label> |
111 | <form name="myForm2"> | 111 | <form name="myForm2"> |
112 | <input type="text" ng-model="cs.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> | 112 | <input type="text" ng-model="cs.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> |
113 | <input type="text" ng-model="cs.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> | 113 | <input type="text" ng-model="cs.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> |
114 | <button class="btn btn-primary" ng-disabled="myForm2.$invalid" ng-click="submitDateCs()" style="float: left; display: none;">Apply</button> | 114 | <button class="btn btn-primary" ng-disabled="myForm2.$invalid" ng-click="submitDateCs()" style="float: left; display: none;">Apply</button> |
115 | <button class="btn btn-primary" ng-click="submitDateCs()" style="float: left;">Apply</button> | 115 | <button class="btn btn-primary" ng-click="submitDateCs()" style="float: left;">Apply</button> |
116 | <div class="clearfix"></div> | 116 | <div class="clearfix"></div> |
117 | </form> | 117 | </form> |
118 | </div> | 118 | </div> |
119 | <div class="clearfix"></div> | 119 | <div class="clearfix"></div> |
120 | </div> | 120 | </div> |
121 | <div class="widget stacked customersource"> | 121 | <div class="widget stacked customersource"> |
122 | <div class="widget-header"> | 122 | <div class="widget-header"> |
123 | <i class="icon-bar-chart"></i> | 123 | <i class="icon-bar-chart"></i> |
124 | <h3>Customer Sources</h3> | 124 | <h3>Customer Sources</h3> |
125 | </div> | 125 | </div> |
126 | <!-- /widget-header --> | 126 | <!-- /widget-header --> |
127 | <div class="widget-content"> | 127 | <div class="widget-content"> |
128 | <div style="margin-left: -15px;"> | 128 | <div style="margin-left: -15px;"> |
129 | <nvd3 options="optionscs" class="custom-graph" data="datacs"></nvd3> | 129 | <nvd3 options="optionscs" class="custom-graph" data="datacs"></nvd3> |
130 | </div> | 130 | </div> |
131 | <!-- /pie-chart --> | 131 | <!-- /pie-chart --> |
132 | </div> | 132 | </div> |
133 | <!-- /widget-content --> | 133 | <!-- /widget-content --> |
134 | </div> | 134 | </div> |
135 | <!-- /widget --> | 135 | <!-- /widget --> |
136 | </div> | 136 | </div> |
137 | <!-- /span6 --> | 137 | <!-- /span6 --> |
138 | <div class="col-md-6"> | 138 | <div class="col-md-6"> |
139 | <div class="customInputWrap"> | 139 | <div class="customInputWrap"> |
140 | <div style="margin-top: 75px"> | 140 | <div class="clearfix"></div> |
141 | <!-- <label>Date Range Filter</label> | ||
142 | <form name="myForm3"> | ||
143 | <input type="text" ng-model="rpp.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> | ||
144 | <input type="text" ng-model="rpp.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> | ||
145 | <button class="btn btn-primary" ng-disabled="myForm3.$invalid" ng-click="submitDateRpp()" style="float: left; display: none;">Apply</button> | ||
146 | <button class="btn btn-primary" ng-click="submitDateRpp()" style="float: left;">Apply</button> | ||
147 | <div class="clearfix"></div> | ||
148 | </form> --> | ||
149 | </div> | ||
150 | <div class="clearfix"></div> | ||
151 | </div> | 141 | </div> |
152 | <div class="widget stacked"> | 142 | <div class="widget stacked"> |
153 | <div class="widget-header"> | 143 | <div class="widget-header"> |
154 | <i class="icon-bar-chart"></i> | 144 | <i class="icon-bar-chart"></i> |
155 | <h3>Regional PAP Pricing</h3> | 145 | <h3>Regional PAP Pricing</h3> |
156 | </div> | 146 | </div> |
157 | <!-- /widget-header --> | 147 | <!-- /widget-header --> |
158 | <div class="widget-content"> | 148 | <div class="widget-content"> |
159 | <div ng-show="flag"> | 149 | <div ng-show="flag"> |
160 | <center><img id="spinner" src="/img/spinner.gif"/></center> | 150 | <center><img id="spinner" src="/img/spinner.gif"/></center> |
161 | </div> | 151 | </div> |
162 | <!-- <div id="map" style="width: 100%; height: 325px;"></div> --> | ||
163 | |||
164 | <!-- <div ng-hide="flag" id="regional-pap" style="height: 400px; min-width: 310px; max-width: 600px; margin: 0 auto"></div> --> | ||
165 | 152 | ||
166 | <div ng-hide="flag" id="container" style="height: 400px; min-width: 310px; max-width: 600px; margin: 0 auto"></div> | 153 | <div ng-hide="flag" id="container" style="height: 400px; min-width: 310px; max-width: 600px; margin: 0 auto"></div> |
167 | </div> | 154 | </div> |
168 | <!-- /widget-content --> | 155 | <!-- /widget-content --> |
169 | </div> | 156 | </div> |
170 | <!-- /widget --> | 157 | <!-- /widget --> |
171 | </div> | 158 | </div> |
172 | <!-- /.span6 --> | 159 | <!-- /.span6 --> |
173 | </div> | 160 | </div> |
174 | </div> | 161 | </div> |
175 | <!-- /container --> | 162 | <!-- /container --> |
176 | </div> | 163 | </div> |
177 | <!-- /main --> | 164 | <!-- /main --> |
178 | <div class="customConfirmPopBackdrop" id="popup1"> | 165 | <div class="customConfirmPopBackdrop" id="popup1"> |
179 | <div class="customModalInner" style="max-width: 400px;"> | 166 | <div class="customModalInner" style="max-width: 400px;"> |
180 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;max-height: 200px;overflow: hidden;overflow-y: auto;""> | 167 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;max-height: 200px;overflow: hidden;overflow-y: auto;""> |
181 | <table border="1"> | 168 | <table border="1"> |
182 | 169 | ||
183 | <tr> | 170 | <tr> |
184 | <th style="padding: 5px">Region</th> | 171 | <th style="padding: 5px">Region</th> |
185 | <th style="padding: 5px">Average PAP</th> | 172 | <th style="padding: 5px">Average PAP</th> |
186 | </tr> | 173 | </tr> |
187 | <tr ng-repeat="data in rppData"> | 174 | <tr ng-repeat="data in rppData"> |
188 | <td style="padding: 5px"> | 175 | <td style="padding: 5px"> |
189 | {{data.region}} | 176 | {{data.region}} |
190 | </td> | 177 | </td> |
191 | <td style="padding: 5px"> | 178 | <td style="padding: 5px"> |
192 | {{data.averagePAP | number :4 }} | 179 | {{data.averagePAP | number :4 }} |
193 | </td> | 180 | </td> |
194 | </tr> | 181 | </tr> |
195 | </table> | 182 | </table> |
196 | </div> | 183 | </div> |
197 | <div class="customModelFooter text-right" style="border-top: 0px !important"> | 184 | <div class="customModelFooter text-right" style="border-top: 0px !important"> |
198 | <button class="btn btn-primary" style="padding: 4px 0; width: 80px;" ng-click="cancelStatus()">Close</button> | 185 | <button class="btn btn-primary" style="padding: 4px 0; width: 80px;" ng-click="cancelStatus()">Close</button> |
199 | </div> | 186 | </div> |
200 | </div> | 187 | </div> |
201 | </div> | 188 | </div> |
202 | 189 | ||
203 | 190 | ||
204 | 191 | ||
205 | 192 | ||
206 | 193 | ||
207 | 194 | ||
208 | 195 | ||
209 | 196 |
app/partials/analytics/analytics.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | .service('analyticsService', ['$q', '$http', 'BASE_URL',analyticsService]); | 4 | .service('analyticsService', ['$q', '$http', 'BASE_URL',analyticsService]); |
5 | 5 | ||
6 | function analyticsService($q, $http, BASE_URL) { | 6 | function analyticsService($q, $http, BASE_URL) { |
7 | var temp = {}; | 7 | var temp = {}; |
8 | 8 | ||
9 | 9 | ||
10 | this.getMFS = function(){ | 10 | this.getMFS = function(){ |
11 | var deferred = $q.defer(); | 11 | var deferred = $q.defer(); |
12 | $http({ | 12 | $http({ |
13 | method : 'GET', | 13 | method : 'GET', |
14 | url : BASE_URL.url + '/fuelOrder/analytics' | 14 | url : BASE_URL.url + '/fuelOrder/analytics' |
15 | }) | 15 | }) |
16 | .then(function (result){ | 16 | .then(function (result){ |
17 | deferred.resolve(result.data); | 17 | deferred.resolve(result.data); |
18 | },function (result){ | 18 | },function (result){ |
19 | console.log(result) | 19 | console.log(result) |
20 | deferred.resolve(result.data); | 20 | deferred.resolve(result.data); |
21 | }) | 21 | }) |
22 | return deferred.promise; | 22 | return deferred.promise; |
23 | } | 23 | } |
24 | 24 | ||
25 | this.orderCostAndCount = function(){ | 25 | this.orderCostAndCount = function(){ |
26 | var deferred = $q.defer(); | 26 | var deferred = $q.defer(); |
27 | $http({ | 27 | $http({ |
28 | method : 'GET', | 28 | method : 'GET', |
29 | // url : BASE_URL.url +'/fuelOrder/export/mfs' | 29 | // url : BASE_URL.url +'/fuelOrder/export/mfs' |
30 | url : BASE_URL.url + '/fuelOrder/orderCostAndCount' | 30 | url : BASE_URL.url + '/fuelOrder/orderCostAndCount' |
31 | }) | 31 | }) |
32 | .then(function (result){ | 32 | .then(function (result){ |
33 | deferred.resolve(result.data); | 33 | deferred.resolve(result.data); |
34 | },function (result){ | 34 | },function (result){ |
35 | console.log(result) | 35 | console.log(result) |
36 | deferred.resolve(result.data); | 36 | deferred.resolve(result.data); |
37 | }) | 37 | }) |
38 | return deferred.promise; | 38 | return deferred.promise; |
39 | } | 39 | } |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | this.getCS = function(){ | 43 | this.getCS = function(){ |
44 | var deferred = $q.defer(); | 44 | var deferred = $q.defer(); |
45 | $http({ | 45 | $http({ |
46 | method : 'GET', | 46 | method : 'GET', |
47 | url : BASE_URL.url +'/user/sources' | 47 | url : BASE_URL.url +'/user/sources' |
48 | }) | 48 | }) |
49 | .then(function (result){ | 49 | .then(function (result){ |
50 | deferred.resolve(result.data); | 50 | deferred.resolve(result.data); |
51 | },function (result){ | 51 | },function (result){ |
52 | console.log(result) | 52 | console.log(result) |
53 | deferred.resolve(result.data); | 53 | deferred.resolve(result.data); |
54 | }) | 54 | }) |
55 | return deferred.promise; | 55 | return deferred.promise; |
56 | } | 56 | } |
57 | 57 | ||
58 | /* With region Code */ | 58 | /* With region Code */ |
59 | this.getRPP = function(code){ | 59 | this.getRPP = function(code){ |
60 | var deferred = $q.defer(); | 60 | var deferred = $q.defer(); |
61 | $http({ | 61 | $http({ |
62 | method : 'GET', | 62 | method : 'GET', |
63 | url : BASE_URL.url +'/fuelerlinx/getAircrafts/'+code | 63 | url : BASE_URL.url +'/fuelerlinx/getAircrafts/'+code |
64 | }) | 64 | }) |
65 | .then(function (result){ | 65 | .then(function (result){ |
66 | deferred.resolve(result.data); | 66 | deferred.resolve(result.data); |
67 | },function (result){ | 67 | },function (result){ |
68 | console.log(result) | 68 | console.log(result) |
69 | deferred.resolve(result.data); | 69 | deferred.resolve(result.data); |
70 | }) | 70 | }) |
71 | return deferred.promise; | 71 | return deferred.promise; |
72 | } | 72 | } |
73 | 73 | ||
74 | // this.getRPP = function(code){ | ||
75 | // var deferred = $q.defer(); | ||
76 | // $http({ | ||
77 | // method : 'GET', | ||
78 | // url : BASE_URL.url +'/fuelerlinx/getCompleteRegionalPap/'+code | ||
79 | // }) | ||
80 | // .then(function (result){ | ||
81 | // deferred.resolve(result.data); | ||
82 | // },function (result){ | ||
83 | // console.log(result) | ||
84 | // deferred.resolve(result.data); | ||
85 | // }) | ||
86 | // return deferred.promise; | ||
87 | // } | ||
88 | |||
89 | 74 | ||
90 | /* without region code */ | 75 | /* without region code */ |
91 | this.getAllRPP = function(){ | 76 | this.getAllRPP = function(){ |
92 | var deferred = $q.defer(); | 77 | var deferred = $q.defer(); |
93 | $http({ | 78 | $http({ |
94 | method : 'GET', | 79 | method : 'GET', |
95 | url : BASE_URL.url +'/fuelerlinx/getAllRegionalPap' | 80 | url : BASE_URL.url +'/fuelerlinx/getAllRegionalPap' |
96 | }) | 81 | }) |
97 | .then(function (result){ | 82 | .then(function (result){ |
98 | deferred.resolve(result.data); | 83 | deferred.resolve(result.data); |
99 | },function (result){ | 84 | },function (result){ |
100 | console.log(result) | 85 | console.log(result) |
101 | deferred.resolve(result.data); | 86 | deferred.resolve(result.data); |
102 | }) | 87 | }) |
103 | return deferred.promise; | 88 | return deferred.promise; |
104 | } | 89 | } |
105 | 90 | ||
106 | /*---date filter for Monthly fuel sales chart - dates are sending to the api */ | 91 | /*---date filter for Monthly fuel sales chart - dates are sending to the api */ |
107 | this.getDRFChart = function(fd,td){ | 92 | this.getDRFChart = function(fd,td){ |
108 | var deferred = $q.defer(); | 93 | var deferred = $q.defer(); |
109 | $http({ | 94 | $http({ |
110 | method : 'GET', | 95 | method : 'GET', |
111 | url : BASE_URL.url + '/fuelOrder/filterchart?fromDate='+fd+'&toDate='+td+'' | 96 | url : BASE_URL.url + '/fuelOrder/filterchart?fromDate='+fd+'&toDate='+td+'' |
112 | }) | 97 | }) |
113 | .then(function (result){ | 98 | .then(function (result){ |
114 | deferred.resolve(result.data); | 99 | deferred.resolve(result.data); |
115 | },function (result){ | 100 | },function (result){ |
116 | console.log(result) | 101 | console.log(result) |
117 | deferred.resolve(result.data); | 102 | deferred.resolve(result.data); |
118 | }) | 103 | }) |
119 | return deferred.promise; | 104 | return deferred.promise; |
120 | } | 105 | } |
121 | 106 | ||
122 | 107 | ||
123 | this.orderCostAndCountByDate = function(fd,td){ | 108 | this.orderCostAndCountByDate = function(fd,td){ |
124 | var deferred = $q.defer(); | 109 | var deferred = $q.defer(); |
125 | $http({ | 110 | $http({ |
126 | method : 'GET', | 111 | method : 'GET', |
127 | url : BASE_URL.url + '/fuelOrder/orderCostAndCountByDate?fromDate='+fd+'&toDate='+td+'' | 112 | url : BASE_URL.url + '/fuelOrder/orderCostAndCountByDate?fromDate='+fd+'&toDate='+td+'' |
128 | }) | 113 | }) |
129 | .then(function (result){ | 114 | .then(function (result){ |
130 | deferred.resolve(result.data); | 115 | deferred.resolve(result.data); |
131 | },function (result){ | 116 | },function (result){ |
132 | console.log(result) | 117 | console.log(result) |
133 | deferred.resolve(result.data); | 118 | deferred.resolve(result.data); |
134 | }) | 119 | }) |
135 | return deferred.promise; | 120 | return deferred.promise; |
136 | } | 121 | } |
137 | 122 | ||
138 | /*---date filter for Historic Fuel price --- DRF--Date Range Filter */ | 123 | /*---date filter for Historic Fuel price --- DRF--Date Range Filter */ |
139 | this.getDRFHfpChart = function(fd,td){ | 124 | this.getDRFHfpChart = function(fd,td){ |
140 | var deferred = $q.defer(); | 125 | var deferred = $q.defer(); |
141 | $http({ | 126 | $http({ |
142 | method : 'GET', | 127 | method : 'GET', |
143 | url : BASE_URL.url + '/fuelOrder/hfp/filterchart?fromDate='+fd+'&toDate='+td+'' | 128 | url : BASE_URL.url + '/fuelOrder/hfp/filterchart?fromDate='+fd+'&toDate='+td+'' |
144 | }) | 129 | }) |
145 | .then(function (result){ | 130 | .then(function (result){ |
146 | deferred.resolve(result.data); | 131 | deferred.resolve(result.data); |
147 | },function (result){ | 132 | },function (result){ |
148 | console.log(result) | 133 | console.log(result) |
149 | deferred.resolve(result.data); | 134 | deferred.resolve(result.data); |
150 | }) | 135 | }) |
151 | return deferred.promise; | 136 | return deferred.promise; |
152 | } | 137 | } |
153 | 138 | ||
154 | 139 | ||
155 | this.gethfpChart = function(){ | 140 | this.gethfpChart = function(){ |
156 | var deferred = $q.defer(); | 141 | var deferred = $q.defer(); |
157 | $http({ | 142 | $http({ |
158 | method : 'GET', | 143 | method : 'GET', |
159 | url : BASE_URL.url + '/fuelOrder/hfp/' | 144 | url : BASE_URL.url + '/fuelOrder/hfp/' |
160 | }) | 145 | }) |
161 | .then(function (result){ | 146 | .then(function (result){ |
162 | deferred.resolve(result.data); | 147 | deferred.resolve(result.data); |
163 | },function (result){ | 148 | },function (result){ |
164 | console.log(result) | 149 | console.log(result) |
165 | deferred.resolve(result.data); | 150 | deferred.resolve(result.data); |
166 | }) | 151 | }) |
167 | return deferred.promise; | 152 | return deferred.promise; |
168 | } | 153 | } |
169 | 154 | ||
170 | /*---date filter for Customer Sources --- DRF--Date Range Filter */ | 155 | /*---date filter for Customer Sources --- DRF--Date Range Filter */ |
171 | this.getDRFCSChart = function(fd,td){ | 156 | this.getDRFCSChart = function(fd,td){ |
172 | var deferred = $q.defer(); | 157 | var deferred = $q.defer(); |
173 | $http({ | 158 | $http({ |
174 | method : 'GET', | 159 | method : 'GET', |
175 | url : BASE_URL.url + '/user/cs/filterchart?fromDate='+fd+'&toDate='+td+'' | 160 | url : BASE_URL.url + '/user/cs/filterchart?fromDate='+fd+'&toDate='+td+'' |
176 | }) | 161 | }) |
177 | .then(function (result){ | 162 | .then(function (result){ |
178 | deferred.resolve(result.data); | 163 | deferred.resolve(result.data); |
179 | },function (result){ | 164 | },function (result){ |
180 | console.log(result) | 165 | console.log(result) |
181 | deferred.resolve(result.data); | 166 | deferred.resolve(result.data); |
182 | }) | 167 | }) |
183 | return deferred.promise; | 168 | return deferred.promise; |
184 | } | 169 | } |
185 | 170 | ||
186 | } | 171 | } |
187 | 172 | ||
188 | })(); | 173 | })(); |
app/partials/customers/customers.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | .controller('customersController', [ '$scope', '$rootScope', '$uibModal', '$filter', '$http', '$state', 'CustomersService', 'ViewCompanyService', 'NgTableParams', 'fuelOrdersService', 'enterFuelOrderService', customersController ]); | 5 | .controller('customersController', [ '$scope', '$rootScope', '$uibModal', '$filter', '$http', '$state', 'CustomersService', 'ViewCompanyService', 'NgTableParams', 'fuelOrdersService', 'enterFuelOrderService', customersController ]); |
6 | 6 | ||
7 | function customersController($scope, $rootScope, $uibModal, $filter, $http, $state, CustomersService, ViewCompanyService, NgTableParams, fuelOrdersService, enterFuelOrderService) { | 7 | function customersController($scope, $rootScope, $uibModal, $filter, $http, $state, CustomersService, ViewCompanyService, NgTableParams, fuelOrdersService, enterFuelOrderService) { |
8 | $(document).ready(function() { | 8 | $(document).ready(function() { |
9 | // $('#example').DataTable(); | 9 | // $('#example').DataTable(); |
10 | }); | 10 | }); |
11 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) | 11 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) |
12 | $scope.reset2 = function() { | 12 | $scope.reset2 = function() { |
13 | $("input").val(""); | 13 | $("input").val(""); |
14 | $scope.removeMarginValidation(); | 14 | $scope.removeMarginValidation(); |
15 | } | 15 | } |
16 | 16 | ||
17 | $scope.order = {}; | 17 | $scope.order = {}; |
18 | $scope.order.upliftDate = ''; | 18 | $scope.order.upliftDate = ''; |
19 | $scope.data = {}; | 19 | $scope.data = {}; |
20 | $scope.aircraft = {}; | 20 | $scope.aircraft = {}; |
21 | $scope.data.activate = true; | 21 | $scope.data.activate = true; |
22 | $scope.showLoader = true; | 22 | $scope.showLoader = true; |
23 | $scope.jetShow = []; | 23 | $scope.jetShow = []; |
24 | $scope.marginShow = []; | 24 | $scope.marginShow = []; |
25 | 25 | ||
26 | $scope.jetShow[0] = true; | 26 | $scope.jetShow[0] = true; |
27 | $scope.marginShow[0] = true; | 27 | $scope.marginShow[0] = true; |
28 | $scope.dispatchOrder = {}; | 28 | $scope.dispatchOrder = {}; |
29 | $scope.dispatchOrder.fuelOrderList = []; | 29 | $scope.dispatchOrder.fuelOrderList = []; |
30 | $scope.statusFilterOptions = []; | 30 | $scope.statusFilterOptions = []; |
31 | $scope.companyList = {}; | 31 | $scope.companyList = {}; |
32 | $scope.statusFilterOptions.push({ | 32 | $scope.statusFilterOptions.push({ |
33 | 'id' : '', | 33 | 'id' : '', |
34 | 'title' : 'Show All' | 34 | 'title' : 'Show All' |
35 | }, { | 35 | }, { |
36 | 'id' : 'pending', | 36 | 'id' : 'pending', |
37 | 'title' : 'Pending' | 37 | 'title' : 'Pending' |
38 | }, { | 38 | }, { |
39 | 'id' : 'invoiced', | 39 | 'id' : 'invoiced', |
40 | 'title' : 'Invoiced' | 40 | 'title' : 'Invoiced' |
41 | }, { | 41 | }, { |
42 | 'id' : 'paid', | 42 | 'id' : 'paid', |
43 | 'title' : 'Paid' | 43 | 'title' : 'Paid' |
44 | }, { | 44 | }, { |
45 | 'id' : 'cancelled', | 45 | 'id' : 'cancelled', |
46 | 'title' : 'Cancelled' | 46 | 'title' : 'Cancelled' |
47 | }, { | 47 | }, { |
48 | 'id' : 'archived', | 48 | 'id' : 'archived', |
49 | 'title' : 'Archived' | 49 | 'title' : 'Archived' |
50 | } | 50 | } |
51 | 51 | ||
52 | ); | 52 | ); |
53 | 53 | ||
54 | /*function getAllCompanies(){ | ||
55 | CustomersService.getAllCompanies().then(function(result) { | ||
56 | $scope.companyList = result; | ||
57 | for(var i=0; i<$scope.companyList.length; i++){ | ||
58 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | ||
59 | } | ||
60 | }) | ||
61 | |||
62 | }*/ | ||
63 | 54 | ||
64 | $scope.statusFilter = [ | 55 | $scope.statusFilter = [ |
65 | { | 56 | { |
66 | id : "", | 57 | id : "", |
67 | title : "Show All" | 58 | title : "Show All" |
68 | }, | 59 | }, |
69 | { | 60 | { |
70 | id : "true", | 61 | id : "true", |
71 | title : "Active" | 62 | title : "Active" |
72 | }, | 63 | }, |
73 | { | 64 | { |
74 | id : "false", | 65 | id : "false", |
75 | title : "Inactive" | 66 | title : "Inactive" |
76 | } | 67 | } |
77 | ] | 68 | ] |
78 | 69 | ||
79 | function getAllCompanies() { | 70 | function getAllCompanies() { |
80 | CustomersService.getAllCompanies().then(function(result) { | 71 | CustomersService.getAllCompanies().then(function(result) { |
81 | $scope.companyList = result; | 72 | $scope.companyList = result; |
82 | //console.log("result",result) | 73 | //console.log("result",result) |
83 | for (var i = 0; i < $scope.companyList.length; i++) { | 74 | for (var i = 0; i < $scope.companyList.length; i++) { |
84 | if ($scope.companyList[i].companyContact != null) { | 75 | if ($scope.companyList[i].companyContact != null) { |
85 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { | 76 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { |
86 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; | 77 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; |
87 | } | 78 | } |
88 | } | 79 | } |
89 | if ($scope.companyList[i].primaryContact != null) { | 80 | if ($scope.companyList[i].primaryContact != null) { |
90 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { | 81 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { |
91 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; | 82 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; |
92 | } | 83 | } |
93 | } | 84 | } |
94 | if ($scope.companyList[i].margin != null) { | 85 | if ($scope.companyList[i].margin != null) { |
95 | if ($scope.companyList[i].margin.marginName != null) { | 86 | if ($scope.companyList[i].margin.marginName != null) { |
96 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 87 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
97 | } | 88 | } |
98 | } | 89 | } |
99 | } | 90 | } |
100 | $scope.displayCompanyList = new NgTableParams({ | 91 | $scope.displayCompanyList = new NgTableParams({ |
101 | page : 1, | 92 | page : 1, |
102 | count : 10, | 93 | count : 10, |
103 | }, { | 94 | }, { |
104 | data : $scope.companyList | 95 | data : $scope.companyList |
105 | }); | 96 | }); |
106 | $scope.showLoader = false; | 97 | $scope.showLoader = false; |
107 | }) | 98 | }) |
108 | } | 99 | } |
109 | 100 | ||
110 | getAllCompanies(); | 101 | getAllCompanies(); |
111 | 102 | ||
112 | $scope.getAircraftMakeAndModel=function (data) { | 103 | $scope.getAircraftMakeAndModel=function (data) { |
113 | for(var i = 0; i < $scope.aircraftList.length; i++){ | 104 | for(var i = 0; i < $scope.aircraftList.length; i++){ |
114 | if($scope.aircraftList[i].tail === data){ | 105 | if($scope.aircraftList[i].tail === data){ |
115 | $scope.order.aircraftMake = $scope.aircraftList[i].make; | 106 | $scope.order.aircraftMake = $scope.aircraftList[i].make; |
116 | $scope.order.aircraftModel = $scope.aircraftList[i].model; | 107 | $scope.order.aircraftModel = $scope.aircraftList[i].model; |
117 | } | 108 | } |
118 | 109 | ||
119 | } | 110 | } |
120 | } | 111 | } |
121 | 112 | ||
122 | $scope.editMargin = function(customer) { | 113 | $scope.editMargin = function(customer) { |
123 | //console.log('customer', customer); | 114 | //console.log('customer', customer); |
124 | $scope.showLoader = true; | 115 | $scope.showLoader = true; |
125 | event.stopPropagation(); | 116 | event.stopPropagation(); |
126 | 117 | ||
127 | var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin | 118 | var companyMargin = "companyName=" + customer.companyName + "&masterMargin=" + customer.masterMargin |
128 | + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state=" | 119 | + "&addressOne=" + customer.addressOne + "&addressTwo=" + customer.addressTwo + "&city=" + customer.city + "&state=" |
129 | + customer.state + "&country=" + customer.country + "&zipcode=" + customer.zipcode + "&internalNote=" | 120 | + customer.state + "&country=" + customer.country + "&zipcode=" + customer.zipcode + "&internalNote=" |
130 | + customer.internalNote + "&certificateType=" + customer.certificateType + "&baseTenant=" + customer.baseTenant | 121 | + customer.internalNote + "&certificateType=" + customer.certificateType + "&baseTenant=" + customer.baseTenant |
131 | + "&fuelerlinxCustomer=" + customer.fuelerlinxCustomer + "&contractFuelVendor=" + customer.contractFuelVendor | 122 | + "&fuelerlinxCustomer=" + customer.fuelerlinxCustomer + "&contractFuelVendor=" + customer.contractFuelVendor |
132 | + "&activate=" + customer.activate + "&baseIcao=" + customer.baseIcao + "&companyId=" + customer.id; | 123 | + "&activate=" + customer.activate + "&baseIcao=" + customer.baseIcao + "&companyId=" + customer.id; |
133 | 124 | ||
134 | ViewCompanyService.updateCompany(companyMargin).then(function(result) { | 125 | ViewCompanyService.updateCompany(companyMargin).then(function(result) { |
135 | if (result != null && result.success) { | 126 | if (result != null && result.success) { |
136 | $scope.showLoader = false; | 127 | $scope.showLoader = false; |
137 | toastr.success('' + result.success + '', { | 128 | toastr.success('' + result.success + '', { |
138 | closeButton : true | 129 | closeButton : true |
139 | }) | 130 | }) |
140 | getAllCompanies(); | 131 | getAllCompanies(); |
141 | } else { | 132 | } else { |
142 | $scope.showLoader = false; | 133 | $scope.showLoader = false; |
143 | toastr.error('' + result.statusText + '', { | 134 | toastr.error('' + result.statusText + '', { |
144 | closeButton : true | 135 | closeButton : true |
145 | }) | 136 | }) |
146 | } | 137 | } |
147 | }) | 138 | }) |
148 | } | 139 | } |
149 | 140 | ||
150 | getData(); | 141 | getData(); |
151 | function getData() { | 142 | function getData() { |
152 | $scope.showLoader = true; | 143 | $scope.showLoader = true; |
153 | CustomersService.getAircraftMake().then(function(result) { | 144 | CustomersService.getAircraftMake().then(function(result) { |
154 | //console.log("==aircrafts===",result) | 145 | //console.log("==aircrafts===",result) |
155 | $scope.aircraftMakeList = result; | 146 | $scope.aircraftMakeList = result; |
156 | $scope.showLoader = false; | 147 | $scope.showLoader = false; |
157 | }) | 148 | }) |
158 | } | 149 | } |
159 | // CustomersService.getMargin().then(function(result) { | 150 | |
160 | // $scope.marginList = result; | ||
161 | // }) | ||
162 | $scope.marginFilterOptions = []; | 151 | $scope.marginFilterOptions = []; |
163 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 152 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
164 | $scope.showLoader = true; | 153 | $scope.showLoader = true; |
165 | $scope.jetMarginList = result; | 154 | $scope.jetMarginList = result; |
166 | //console.log("jet margin",result,$scope.userProfileId) | 155 | //console.log("jet margin",result,$scope.userProfileId) |
167 | $scope.marginFilterOptions.push({ | 156 | $scope.marginFilterOptions.push({ |
168 | 'id' : '', | 157 | 'id' : '', |
169 | 'title' : 'Show All' | 158 | 'title' : 'Show All' |
170 | }); | 159 | }); |
171 | for (var i = 0; i < result.length; i++) { | 160 | for (var i = 0; i < result.length; i++) { |
172 | $scope.marginFilterOptions.push({ | 161 | $scope.marginFilterOptions.push({ |
173 | 'id' : result[i].id, | 162 | 'id' : result[i].id, |
174 | 'title' : result[i].marginName | 163 | 'title' : result[i].marginName |
175 | }) | 164 | }) |
176 | } | 165 | } |
177 | $scope.showLoader = false; | 166 | $scope.showLoader = false; |
178 | }) | 167 | }) |
179 | 168 | ||
180 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 169 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
181 | $scope.avgsMarginList = result; | 170 | $scope.avgsMarginList = result; |
182 | // console.log('avgsMarginList',result) | 171 | // console.log('avgsMarginList',result) |
183 | }) | 172 | }) |
184 | 173 | ||
185 | 174 | ||
186 | $scope.showCompanyError = false; | 175 | $scope.showCompanyError = false; |
187 | $scope.showMarginError = false; | 176 | $scope.showMarginError = false; |
188 | 177 | ||
189 | $scope.removeValidation = function() { | 178 | $scope.removeValidation = function() { |
190 | $scope.showCompanyError = false; | 179 | $scope.showCompanyError = false; |
191 | $('.companyNameInput').removeClass('customErrorInput'); | 180 | $('.companyNameInput').removeClass('customErrorInput'); |
192 | if ($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { | 181 | if ($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { |
193 | $('.companyNameInput').addClass('customErrorInput'); | 182 | $('.companyNameInput').addClass('customErrorInput'); |
194 | $scope.showCompanyError = true; | 183 | $scope.showCompanyError = true; |
195 | } | 184 | } |
196 | } | 185 | } |
197 | 186 | ||
198 | $scope.removeMarginValidation = function() { | 187 | $scope.removeMarginValidation = function() { |
199 | $scope.showMarginError = false; | 188 | $scope.showMarginError = false; |
200 | $('.marginSelectBox').removeClass('customErrorInput'); | 189 | $('.marginSelectBox').removeClass('customErrorInput'); |
201 | } | 190 | } |
202 | 191 | ||
203 | var companyData; | 192 | var companyData; |
204 | $scope.addFirstData = function(sel, step) { | 193 | $scope.addFirstData = function(sel, step) { |
205 | $scope.showLoader = true; | 194 | $scope.showLoader = true; |
206 | if ($scope.data.companyName == undefined) { | 195 | if ($scope.data.companyName == undefined) { |
207 | $scope.showCompanyError = true; | 196 | $scope.showCompanyError = true; |
208 | $('.companyNameInput').addClass('customErrorInput'); | 197 | $('.companyNameInput').addClass('customErrorInput'); |
209 | } else if ($scope.data.masterMargin == undefined) { | 198 | } else if ($scope.data.masterMargin == undefined) { |
210 | $scope.showMarginError = true; | 199 | $scope.showMarginError = true; |
211 | $('.marginSelectBox').addClass('customErrorInput'); | 200 | $('.marginSelectBox').addClass('customErrorInput'); |
212 | } else { | 201 | } else { |
213 | $scope.aircraftDetails = [ { | 202 | $scope.aircraftDetails = [ { |
214 | 'tail' : '', | 203 | 'tail' : '', |
215 | 'make' : '', | 204 | 'make' : '', |
216 | 'model' : '', | 205 | 'model' : '', |
217 | 'sizeId' : '', | 206 | 'sizeId' : '', |
218 | 'marginId' : $scope.data.masterMargin, | 207 | 'marginId' : $scope.data.masterMargin, |
219 | 'avgasMarginId' : $scope.data.avgasMargin | 208 | 'avgasMarginId' : $scope.data.avgasMargin |
220 | } ]; | 209 | } ]; |
221 | 210 | ||
222 | $(sel).trigger('next.m.' + step); | 211 | $(sel).trigger('next.m.' + step); |
223 | getData(); | 212 | getData(); |
224 | } | 213 | } |
225 | $scope.showLoader = false; | 214 | $scope.showLoader = false; |
226 | } | 215 | } |
227 | 216 | ||
228 | $scope.addNew = function() { | 217 | $scope.addNew = function() { |
229 | $scope.showLoader = true; | 218 | $scope.showLoader = true; |
230 | $scope.aircraftDetails.push({ | 219 | $scope.aircraftDetails.push({ |
231 | 'tail' : '', | 220 | 'tail' : '', |
232 | 'make' : '', | 221 | 'make' : '', |
233 | 'model' : '', | 222 | 'model' : '', |
234 | 'sizeId' : '', | 223 | 'sizeId' : '', |
235 | 'marginId' : $scope.data.masterMargin, | 224 | 'marginId' : $scope.data.masterMargin, |
236 | 'avgasMarginId' : $scope.data.avgasMargin | 225 | 'avgasMarginId' : $scope.data.avgasMargin |
237 | }); | 226 | }); |
238 | $scope.showLoader = false; | 227 | $scope.showLoader = false; |
239 | }; | 228 | }; |
240 | 229 | ||
241 | $scope.aircraftIdx = ''; | 230 | $scope.aircraftIdx = ''; |
242 | $scope.checkTail = function(tail, idx){ | 231 | $scope.checkTail = function(tail, idx){ |
243 | var data = "tail=" + tail; | 232 | var data = "tail=" + tail; |
244 | $scope.aircraftIdx = idx; | 233 | $scope.aircraftIdx = idx; |
245 | CustomersService.checkTailRegistration(data).then(function(result) { | 234 | CustomersService.checkTailRegistration(data).then(function(result) { |
246 | if(result.error) { | 235 | if(result.error) { |
247 | $scope.aircraftMessage = result.error; | 236 | $scope.aircraftMessage = result.error; |
248 | $scope.openAddAirCraftError(); | 237 | $scope.openAddAirCraftError(); |
249 | } else if(result.warning) { | 238 | } else if(result.warning) { |
250 | $scope.aircraftMessage = result.warning; | 239 | $scope.aircraftMessage = result.warning; |
251 | $scope.openAddAirCraftWarning(); | 240 | $scope.openAddAirCraftWarning(); |
252 | } | 241 | } |
253 | }) | 242 | }) |
254 | } | 243 | } |
255 | 244 | ||
256 | $scope.openAddAirCraftError = function() { | 245 | $scope.openAddAirCraftError = function() { |
257 | $('#addAirCraftError').css('display', 'block'); | 246 | $('#addAirCraftError').css('display', 'block'); |
258 | } | 247 | } |
259 | 248 | ||
260 | $scope.openAddAirCraftWarning = function() { | 249 | $scope.openAddAirCraftWarning = function() { |
261 | $('#addAirCraftWarning').css('display', 'block'); | 250 | $('#addAirCraftWarning').css('display', 'block'); |
262 | } | 251 | } |
263 | $scope.acceptAirCraftError = function() { | 252 | $scope.acceptAirCraftError = function() { |
264 | $('#addAirCraftWarning').css('display', 'none'); | 253 | $('#addAirCraftWarning').css('display', 'none'); |
265 | } | 254 | } |
266 | 255 | ||
267 | $scope.cancelAirCraftError = function() { | 256 | $scope.cancelAirCraftError = function() { |
268 | $scope.aircraftDetails[$scope.aircraftIdx].tail = ''; | 257 | $scope.aircraftDetails[$scope.aircraftIdx].tail = ''; |
269 | $('#addAirCraftWarning').css('display', 'none'); | 258 | $('#addAirCraftWarning').css('display', 'none'); |
270 | $('#addAirCraftError').css('display', 'none'); | 259 | $('#addAirCraftError').css('display', 'none'); |
271 | } | 260 | } |
272 | 261 | ||
273 | 262 | ||
274 | /*$scope.getModal = function(makeId, index) { | 263 | |
275 | $scope.showLoader = true; | ||
276 | CustomersService.getModal($scope.aircraft.make).then(function(result) { | ||
277 | $scope.showLoader = false; | ||
278 | $scope.aircraftDetails[index].aircraftModalList = result; | ||
279 | }) | ||
280 | }*/ | ||
281 | $scope.getModal = function(makeId, index) { | 264 | $scope.getModal = function(makeId, index) { |
282 | $scope.showLoader = true; | 265 | $scope.showLoader = true; |
283 | $scope.aircraft.make = makeId; | 266 | $scope.aircraft.make = makeId; |
284 | CustomersService.getModal($scope.aircraft.make).then(function(result) { | 267 | CustomersService.getModal($scope.aircraft.make).then(function(result) { |
285 | $scope.showLoader = false; | 268 | $scope.showLoader = false; |
286 | $scope.aircraftDetails[index].aircraftModalList = result; | 269 | $scope.aircraftDetails[index].aircraftModalList = result; |
287 | }) | 270 | }) |
288 | } | 271 | } |
289 | 272 | ||
290 | 273 | ||
291 | $scope.selectedOption = ''; | 274 | $scope.selectedOption = ''; |
292 | $scope.getSize = function(model, index) { | 275 | $scope.getSize = function(model, index) { |
293 | $scope.showLoader = true; | 276 | $scope.showLoader = true; |
294 | $scope.aircraft.model = model; | 277 | $scope.aircraft.model = model; |
295 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 278 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
296 | $scope.showLoader = false; | 279 | $scope.showLoader = false; |
297 | $scope.aircraftDetails[index].aircraftSizeList = result; | 280 | $scope.aircraftDetails[index].aircraftSizeList = result; |
298 | $scope.getFuelType($scope.aircraftDetails[index].aircraftSizeList[0].aircraftSize.id,index); | 281 | $scope.getFuelType($scope.aircraftDetails[index].aircraftSizeList[0].aircraftSize.id,index); |
299 | 282 | ||
300 | }) | 283 | }) |
301 | } | 284 | } |
302 | 285 | ||
303 | /*$scope.getSize = function(model, index) { | ||
304 | $scope.showLoader = true; | ||
305 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | ||
306 | $scope.showLoader = false; | ||
307 | $scope.aircraftDetails[index].aircraftSizeList = result; | ||
308 | }) | ||
309 | }*/ | ||
310 | 286 | ||
311 | $scope.getFuelType = function(size, index) { | 287 | $scope.getFuelType = function(size, index) { |
312 | $scope.showLoader = true; | 288 | $scope.showLoader = true; |
313 | var data = "model="+$scope.aircraft.model+"&make="+$scope.aircraft.make+"&sizeId="+size; | 289 | var data = "model="+$scope.aircraft.model+"&make="+$scope.aircraft.make+"&sizeId="+size; |
314 | ViewCompanyService.checkFuelType(data).then(function(result){ | 290 | ViewCompanyService.checkFuelType(data).then(function(result){ |
315 | $scope.showLoader = false; | 291 | $scope.showLoader = false; |
316 | if (result.type == "JetA") { | 292 | if (result.type == "JetA") { |
317 | $scope.jetShow[index] = false; | 293 | $scope.jetShow[index] = false; |
318 | $scope.marginShow[index] = true; | 294 | $scope.marginShow[index] = true; |
319 | } else if (result.type == "Avgas") { | 295 | } else if (result.type == "Avgas") { |
320 | $scope.jetShow[index] = true; | 296 | $scope.jetShow[index] = true; |
321 | $scope.marginShow[index] = false; | 297 | $scope.marginShow[index] = false; |
322 | }else { | 298 | }else { |
323 | $scope.jetShow[index] = true; | 299 | $scope.jetShow[index] = true; |
324 | $scope.marginShow[index] = true; | 300 | $scope.marginShow[index] = true; |
325 | } | 301 | } |
326 | }) | 302 | }) |
327 | } | 303 | } |
328 | 304 | ||
329 | $scope.aircraftListData = {}; | 305 | $scope.aircraftListData = {}; |
330 | $scope.addData = []; | 306 | $scope.addData = []; |
331 | $scope.tailArray = []; | 307 | $scope.tailArray = []; |
332 | function check(array){ | 308 | function check(array){ |
333 | return (new Set(array)).size !== array.length; | 309 | return (new Set(array)).size !== array.length; |
334 | } | 310 | } |
335 | $scope.saveCompanyData = function() { | 311 | $scope.saveCompanyData = function() { |
336 | // console.log("company data --",$scope.data) | 312 | // console.log("company data --",$scope.data) |
337 | CustomersService.addCompany($scope.data).then(function(result) { | 313 | CustomersService.addCompany($scope.data).then(function(result) { |
338 | $scope.tailArray = []; | 314 | $scope.tailArray = []; |
339 | $scope.addData =[]; | 315 | $scope.addData =[]; |
340 | $scope.accountId = result; | 316 | $scope.accountId = result; |
341 | $scope.aircraft.accountId = $scope.accountId; | 317 | $scope.aircraft.accountId = $scope.accountId; |
342 | 318 | ||
343 | for (var i = 0; i < $scope.aircraftDetails.length; i++) { | 319 | for (var i = 0; i < $scope.aircraftDetails.length; i++) { |
344 | $scope.addData.push({ | 320 | $scope.addData.push({ |
345 | 'tail' : $scope.aircraftDetails[i].tail, | 321 | 'tail' : $scope.aircraftDetails[i].tail, |
346 | 'make' : $scope.aircraftDetails[i].make, | 322 | 'make' : $scope.aircraftDetails[i].make, |
347 | 'model' : $scope.aircraftDetails[i].model, | 323 | 'model' : $scope.aircraftDetails[i].model, |
348 | 'sizeId' : $scope.aircraftDetails[i].sizeId, | 324 | 'sizeId' : $scope.aircraftDetails[i].sizeId, |
349 | 'marginId' : $scope.aircraftDetails[i].marginId, | 325 | 'marginId' : $scope.aircraftDetails[i].marginId, |
350 | 'avgasMarginId' : $scope.aircraftDetails[i].avgasMarginId | 326 | 'avgasMarginId' : $scope.aircraftDetails[i].avgasMarginId |
351 | }); | 327 | }); |
352 | $scope.tailArray.push($scope.aircraftDetails[i].tail); | 328 | $scope.tailArray.push($scope.aircraftDetails[i].tail); |
353 | } | 329 | } |
354 | 330 | ||
355 | if (check($scope.tailArray)) { | 331 | if (check($scope.tailArray)) { |
356 | toastr.error('Duplicate Tail Added.', { | 332 | toastr.error('Duplicate Tail Added.', { |
357 | closeButton: true | 333 | closeButton: true |
358 | }) | 334 | }) |
359 | }else{ | 335 | }else{ |
360 | $scope.aircraftListData.aircraftList = $scope.addData; | 336 | $scope.aircraftListData.aircraftList = $scope.addData; |
361 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; | 337 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; |
362 | /*if ($scope.aircraftListData.aircraftList[0].tail == "" || $scope.aircraftListData.aircraftList[0].make == null || $scope.aircraftListData.aircraftList[0].model == null) { | 338 | /*if ($scope.aircraftListData.aircraftList[0].tail == "" || $scope.aircraftListData.aircraftList[0].make == null || $scope.aircraftListData.aircraftList[0].model == null) { |
363 | $scope.aircraftListData.aircraftList = []; | 339 | $scope.aircraftListData.aircraftList = []; |
364 | }*/ | 340 | }*/ |
365 | 341 | ||
366 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | 342 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { |
367 | 343 | ||
368 | if (result != null && result.success) { | 344 | if (result != null && result.success) { |
369 | 345 | ||
370 | toastr.success('' + result.success + '', { | 346 | toastr.success('' + result.success + '', { |
371 | closeButton : true | 347 | closeButton : true |
372 | }) | 348 | }) |
373 | $('#demo-modal-3').css('display', 'none'); | 349 | $('#demo-modal-3').css('display', 'none'); |
374 | $('.modal-backdrop').css('display', 'none'); | 350 | $('.modal-backdrop').css('display', 'none'); |
375 | getAllCompanies(); | 351 | getAllCompanies(); |
376 | location.reload(); | 352 | location.reload(); |
377 | } else { | 353 | } else { |
378 | toastr.error('' + result.statusText + '', { | 354 | toastr.error('' + result.statusText + '', { |
379 | closeButton : true | 355 | closeButton : true |
380 | }) | 356 | }) |
381 | } | 357 | } |
382 | }); | 358 | }); |
383 | } | 359 | } |
384 | }) | 360 | }) |
385 | } | 361 | } |
386 | 362 | ||
387 | /*add a fuel order*/ | 363 | /*add a fuel order*/ |
388 | $scope.getOrders = function() { | 364 | $scope.getOrders = function() { |
389 | fuelOrdersService.getOrders().then(function(result) { | 365 | fuelOrdersService.getOrders().then(function(result) { |
390 | $scope.orderdata = result; | 366 | $scope.orderdata = result; |
391 | for (var i = 0; i < $scope.orderdata.length; i++) { | 367 | for (var i = 0; i < $scope.orderdata.length; i++) { |
392 | $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); | 368 | $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); |
393 | 369 | ||
394 | // var str = "" + $scope.orderdata[i].upliftDateS.getDate() + "/" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getFullYear() | 370 | // var str = "" + $scope.orderdata[i].upliftDateS.getDate() + "/" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getFullYear() |
395 | var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear() | 371 | var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear() |
396 | // str = str.slice(4,16) | 372 | // str = str.slice(4,16) |
397 | $scope.orderdata[i].upliftDateString = str | 373 | $scope.orderdata[i].upliftDateString = str |
398 | // console.log(str); | 374 | // console.log(str); |
399 | 375 | ||
400 | } | 376 | } |
401 | 377 | ||
402 | $scope.displayFuelOrderList = new NgTableParams({ | 378 | $scope.displayFuelOrderList = new NgTableParams({ |
403 | page : 1, | 379 | page : 1, |
404 | count : 10, | 380 | count : 10, |
405 | }, { | 381 | }, { |
406 | data : $scope.orderdata | 382 | data : $scope.orderdata |
407 | }); | 383 | }); |
408 | $(document).ready(function() { | 384 | $(document).ready(function() { |
409 | var myselect = document.getElementsByClassName('colorfulSelectbox'); | 385 | var myselect = document.getElementsByClassName('colorfulSelectbox'); |
410 | 386 | ||
411 | for (var i = 0; i < myselect.length; i++) { | 387 | for (var i = 0; i < myselect.length; i++) { |
412 | var colourIndex = $(myselect[i]).prop('selectedIndex'); | 388 | var colourIndex = $(myselect[i]).prop('selectedIndex'); |
413 | colourIndex = colourIndex + 1; | 389 | colourIndex = colourIndex + 1; |
414 | // console.log(colourIndex); | 390 | // console.log(colourIndex); |
415 | var getColor = $('.colorfulSelectbox option:nth-child(' + colourIndex + ')').css('color'); | 391 | var getColor = $('.colorfulSelectbox option:nth-child(' + colourIndex + ')').css('color'); |
416 | $(myselect[i]).css('background-color', getColor); | 392 | $(myselect[i]).css('background-color', getColor); |
417 | // console.log('colour', getColor); | 393 | // console.log('colour', getColor); |
418 | myselect[i].blur(); | 394 | myselect[i].blur(); |
419 | } | 395 | } |
420 | 396 | ||
421 | }) | 397 | }) |
422 | 398 | ||
423 | }) | 399 | }) |
424 | } | 400 | } |
425 | 401 | ||
426 | $scope.getOrders(); | 402 | $scope.getOrders(); |
427 | $scope.tiervalue=function(){ | 403 | $scope.tiervalue=function(){ |
428 | $scope.order.tierBreak=$scope.selectedTier.minTierBreak+'-'+$scope.selectedTier.maxTierBreak; | 404 | $scope.order.tierBreak=$scope.selectedTier.minTierBreak+'-'+$scope.selectedTier.maxTierBreak; |
429 | } | 405 | } |
430 | 406 | ||
431 | $scope.setCost = function(cost){ | 407 | $scope.setCost = function(cost){ |
432 | if(cost != null) { | 408 | if(cost != null) { |
433 | var obj =JSON.parse(cost); | 409 | var obj =JSON.parse(cost); |
434 | $scope.order.fboCost = obj.cost; | 410 | $scope.order.fboCost = obj.cost; |
435 | } | 411 | } |
436 | } | 412 | } |
437 | 413 | ||
438 | $scope.cancelOrder = function() { | 414 | $scope.cancelOrder = function() { |
439 | $scope.order = {}; | 415 | $scope.order = {}; |
440 | } | 416 | } |
441 | 417 | ||
442 | $scope.dispatchFuel = function(){ | 418 | $scope.dispatchFuel = function(){ |
443 | $scope.showLoader = true; | 419 | $scope.showLoader = true; |
444 | $scope.fuelData = {}; | 420 | $scope.fuelData = {}; |
445 | $scope.fuelData.companyId = $scope.selectedCompanyId; | 421 | $scope.fuelData.companyId = $scope.selectedCompanyId; |
446 | $scope.fuelData.companyName =$scope.order.defaultCompanyName; | 422 | $scope.fuelData.companyName =$scope.order.defaultCompanyName; |
447 | // var aircraftObj =JSON.parse($scope.order.aircraftName); | 423 | // var aircraftObj =JSON.parse($scope.order.aircraftName); |
448 | $scope.fuelData.aircraftName = $scope.order.aircraftName; | 424 | $scope.fuelData.aircraftName = $scope.order.aircraftName; |
449 | $scope.fuelData.make = $scope.order.aircraftMake; | 425 | $scope.fuelData.make = $scope.order.aircraftMake; |
450 | $scope.fuelData.model = $scope.order.aircraftModel; | 426 | $scope.fuelData.model = $scope.order.aircraftModel; |
451 | //$scope.fuelData.fuelOn = $scope.order.fuelOn; | 427 | //$scope.fuelData.fuelOn = $scope.order.fuelOn; |
452 | $scope.fuelData.invoiced = $scope.order.invoiced; | 428 | $scope.fuelData.invoiced = $scope.order.invoiced; |
453 | $scope.fuelData.volume = $scope.order.volume; | 429 | $scope.fuelData.volume = $scope.order.volume; |
454 | // $scope.fuelData.source = $scope.order.source; | 430 | // $scope.fuelData.source = $scope.order.source; |
455 | 431 | ||
456 | $scope.fuelData.total = $scope.order.total; | 432 | $scope.fuelData.total = $scope.order.total; |
457 | //tier no use | 433 | //tier no use |
458 | $scope.fuelData.tierBreak = $scope.order.tierBreak; | 434 | $scope.fuelData.tierBreak = $scope.order.tierBreak; |
459 | 435 | ||
460 | var obj =JSON.parse($scope.order.priceQuote); | 436 | var obj =JSON.parse($scope.order.priceQuote); |
461 | $scope.fuelData.priceQuote = obj.papTotal; | 437 | $scope.fuelData.priceQuote = obj.papTotal; |
462 | $scope.fuelData.fboCost = obj.cost; | 438 | $scope.fuelData.fboCost = obj.cost; |
463 | $scope.fuelData.productName = obj.productName; | 439 | $scope.fuelData.productName = obj.productName; |
464 | 440 | ||
465 | $scope.fuelData.etaTime = $scope.order.etaTime; | 441 | $scope.fuelData.etaTime = $scope.order.etaTime; |
466 | $scope.fuelData.etdTime = $scope.order.etdTime; | 442 | $scope.fuelData.etdTime = $scope.order.etdTime; |
467 | $scope.fuelData.certificateType = $scope.order.certificateType; | 443 | $scope.fuelData.certificateType = $scope.order.certificateType; |
468 | var currentDate = new Date(); | 444 | var currentDate = new Date(); |
469 | var hours = currentDate.getHours(); | 445 | var hours = currentDate.getHours(); |
470 | var min = currentDate.getMinutes(); | 446 | var min = currentDate.getMinutes(); |
471 | var sec = currentDate.getSeconds(); | 447 | var sec = currentDate.getSeconds(); |
472 | if ($scope.order.upliftDate != '') { | 448 | if ($scope.order.upliftDate != '') { |
473 | $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; | 449 | $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; |
474 | $scope.order.upliftDate = new Date($scope.order.upliftDate); | 450 | $scope.order.upliftDate = new Date($scope.order.upliftDate); |
475 | $scope.fuelData.upliftDate = $scope.order.upliftDate.getTime(); | 451 | $scope.fuelData.upliftDate = $scope.order.upliftDate.getTime(); |
476 | } | 452 | } |
477 | 453 | ||
478 | 454 | ||
479 | if ($scope.order.departingDate != '') { | 455 | if ($scope.order.departingDate != '') { |
480 | $scope.order.departingDate = $scope.order.departingDate + ' ' + hours + ':' + min + ':' + sec; | 456 | $scope.order.departingDate = $scope.order.departingDate + ' ' + hours + ':' + min + ':' + sec; |
481 | $scope.order.departingDate = new Date($scope.order.departingDate); | 457 | $scope.order.departingDate = new Date($scope.order.departingDate); |
482 | $scope.fuelData.departingDate = $scope.order.departingDate.getTime(); | 458 | $scope.fuelData.departingDate = $scope.order.departingDate.getTime(); |
483 | } | 459 | } |
484 | 460 | ||
485 | if($scope.order.status === null || $scope.order.status === undefined){ | 461 | if($scope.order.status === null || $scope.order.status === undefined){ |
486 | 462 | ||
487 | $scope.fuelData.status = "pending"; //default status | 463 | $scope.fuelData.status = "pending"; //default status |
488 | 464 | ||
489 | }else { | 465 | }else { |
490 | 466 | ||
491 | $scope.fuelData.status = $scope.order.status; | 467 | $scope.fuelData.status = $scope.order.status; |
492 | } | 468 | } |
493 | if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ | 469 | if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ |
494 | $scope.fuelData.fuelOn = "Arrival"; //default fuelon | 470 | $scope.fuelData.fuelOn = "Arrival"; //default fuelon |
495 | }else { | 471 | }else { |
496 | $scope.fuelData.fuelOn = $scope.order.fuelOn ; | 472 | $scope.fuelData.fuelOn = $scope.order.fuelOn ; |
497 | } | 473 | } |
498 | if($scope.baseTenant && $scope.contractFuelVendor ){ | 474 | if($scope.baseTenant && $scope.contractFuelVendor ){ |
499 | $scope.fuelData.source = "Tenant/CAA" ; | 475 | $scope.fuelData.source = "Tenant/CAA" ; |
500 | }else if($scope.baseTenant) | 476 | }else if($scope.baseTenant) |
501 | { | 477 | { |
502 | $scope.fuelData.source = "Tenant/Base Customer"; | 478 | $scope.fuelData.source = "Tenant/Base Customer"; |
503 | }else if($scope.contractFuelVendor){ | 479 | }else if($scope.contractFuelVendor){ |
504 | $scope.fuelData.source = "CAA Member"; | 480 | $scope.fuelData.source = "CAA Member"; |
505 | } | 481 | } |
506 | 482 | ||
507 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); | 483 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); |
508 | fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { | 484 | fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { |
509 | $scope.showLoader = false; | 485 | $scope.showLoader = false; |
510 | $scope.order = {}; | 486 | $scope.order = {}; |
511 | $scope.dispatchOrder.fuelOrderList = []; | 487 | $scope.dispatchOrder.fuelOrderList = []; |
512 | $('#demo-modal-4').css('display', ''); | 488 | $('#demo-modal-4').css('display', ''); |
513 | $scope.getOrders(); | 489 | $scope.getOrders(); |
514 | toastr.success('Fuel Order Dispatched Successfully', { | 490 | toastr.success('Fuel Order Dispatched Successfully', { |
515 | closeButton: true | 491 | closeButton: true |
516 | }) | 492 | }) |
517 | }) | 493 | }) |
518 | } | 494 | } |
519 | 495 | ||
520 | $scope.addTotal = function(value, valueOf) { | 496 | $scope.addTotal = function(value, valueOf) { |
521 | if (value != undefined && valueOf != undefined) { | 497 | if (value != undefined && valueOf != undefined) { |
522 | value = JSON.parse(value) | 498 | value = JSON.parse(value) |
523 | $scope.order.total = Math.abs(value.papTotal) * valueOf; | 499 | $scope.order.total = Math.abs(value.papTotal) * valueOf; |
524 | } | 500 | } |
525 | } | 501 | } |
526 | 502 | ||
527 | $scope.getAircraft = function(company) { | 503 | $scope.getAircraft = function(company) { |
528 | $scope.selectedCompanyName = company; | 504 | $scope.selectedCompanyName = company; |
529 | //$scope.showLoader = true; | 505 | //$scope.showLoader = true; |
530 | // console.log("id",company) | 506 | // console.log("id",company) |
531 | for (var i = 0; i < $scope.companyList.length; i++) { | 507 | for (var i = 0; i < $scope.companyList.length; i++) { |
532 | if ($scope.companyList[i].companyName == company) { | 508 | if ($scope.companyList[i].companyName == company) { |
533 | if ($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null) { | 509 | if ($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null) { |
534 | fuelOrdersService.getFuelCost($scope.companyList[i].id).then(function(margins) { | 510 | fuelOrdersService.getFuelCost($scope.companyList[i].id).then(function(margins) { |
535 | $scope.marginList = margins; | 511 | $scope.marginList = margins; |
536 | //console.log('$scope.marginList', $scope.marginList); | 512 | //console.log('$scope.marginList', $scope.marginList); |
537 | }) | 513 | }) |
538 | } else if ($scope.companyList[i].margin != null || $scope.companyList[i].marginAVGAS == null) { | 514 | } else if ($scope.companyList[i].margin != null || $scope.companyList[i].marginAVGAS == null) { |
539 | fuelOrdersService.getATypeFuelPricing($scope.companyList[i].id).then(function(margins) { | 515 | fuelOrdersService.getATypeFuelPricing($scope.companyList[i].id).then(function(margins) { |
540 | $scope.marginList = margins; | 516 | $scope.marginList = margins; |
541 | }) | 517 | }) |
542 | } else if ($scope.companyList[i].margin == null || $scope.companyList[i].marginAVGAS != null) { | 518 | } else if ($scope.companyList[i].margin == null || $scope.companyList[i].marginAVGAS != null) { |
543 | fuelOrdersService.getVTypeFuelPricing($scope.companyList[i].id).then(function(margins) { | 519 | fuelOrdersService.getVTypeFuelPricing($scope.companyList[i].id).then(function(margins) { |
544 | $scope.marginList = margins; | 520 | $scope.marginList = margins; |
545 | }) | 521 | }) |
546 | } | 522 | } |
547 | $scope.selectedCompanyId = $scope.companyList[i].id; | 523 | $scope.selectedCompanyId = $scope.companyList[i].id; |
548 | $scope.marginId = $scope.companyList[i].margin.id; | 524 | $scope.marginId = $scope.companyList[i].margin.id; |
549 | if ($scope.selectedCompanyId != '') { | 525 | if ($scope.selectedCompanyId != '') { |
550 | fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) { | 526 | fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) { |
551 | $scope.aircraftList = aircraft; | 527 | $scope.aircraftList = aircraft; |
552 | //console.log("===tail search====",aircraft); | 528 | //console.log("===tail search====",aircraft); |
553 | }) | 529 | }) |
554 | } | 530 | } |
555 | if ($scope.marginId != '') { | 531 | if ($scope.marginId != '') { |
556 | fuelOrdersService.getJetTiers($scope.marginId).then(function(tiers) { | 532 | fuelOrdersService.getJetTiers($scope.marginId).then(function(tiers) { |
557 | $scope.tierList = tiers; | 533 | $scope.tierList = tiers; |
558 | // $scope.showLoader = false; | 534 | // $scope.showLoader = false; |
559 | }) | 535 | }) |
560 | } else { | 536 | } else { |
561 | // $scope.showLoader = false; | 537 | // $scope.showLoader = false; |
562 | } | 538 | } |
563 | } | 539 | } |
564 | } | 540 | } |
565 | 541 | ||
566 | } | 542 | } |
567 | 543 | ||
568 | $scope.sourceList = [ { | 544 | $scope.sourceList = [ { |
569 | source : "Direct Jet-A" | 545 | source : "Direct Jet-A" |
570 | }, { | 546 | }, { |
571 | source : "Direct AVGAS 100LL" | 547 | source : "Direct AVGAS 100LL" |
572 | } ]; | 548 | } ]; |
573 | $scope.cancelData = function() { | 549 | $scope.cancelData = function() { |
574 | $scope.order = {}; | 550 | $scope.order = {}; |
575 | $('#demo-modal-4').css('display', ''); | 551 | $('#demo-modal-4').css('display', ''); |
576 | } | 552 | } |
577 | 553 | ||
578 | $scope.setFuel = function(companyName,baseTenant,contractFuelVendor,fuelerlinxCustomer,certificateType) { | 554 | $scope.setFuel = function(companyName,baseTenant,contractFuelVendor,fuelerlinxCustomer,certificateType) { |
579 | $('#demo-modal-4').css('display', 'block'); | 555 | $('#demo-modal-4').css('display', 'block'); |
580 | $scope.order.defaultCompanyName = companyName; | 556 | $scope.order.defaultCompanyName = companyName; |
581 | $scope.order.certificateType = certificateType; | 557 | $scope.order.certificateType = certificateType; |
582 | $scope.baseTenant = baseTenant; | 558 | $scope.baseTenant = baseTenant; |
583 | $scope.contractFuelVendor = contractFuelVendor; | 559 | $scope.contractFuelVendor = contractFuelVendor; |
584 | $scope.fuelerlinxCustomer = fuelerlinxCustomer; | 560 | $scope.fuelerlinxCustomer = fuelerlinxCustomer; |
585 | //console.log("===values of checkbox===",baseTenant,contractFuelVendor,fuelerlinxCustomer) | 561 | //console.log("===values of checkbox===",baseTenant,contractFuelVendor,fuelerlinxCustomer) |
586 | $scope.getAircraft(companyName); | 562 | $scope.getAircraft(companyName); |
587 | // event.stopPropagation(); | 563 | // event.stopPropagation(); |
588 | // $state.go('app.updateFuelManager'); | 564 | // $state.go('app.updateFuelManager'); |
589 | } | 565 | } |
590 | 566 | ||
591 | /* ng table */ | 567 | /* ng table */ |
592 | 568 | ||
593 | $scope.exportCompany = function() { | 569 | $scope.exportCompany = function() { |
594 | $scope.showLoader = true; | 570 | $scope.showLoader = true; |
595 | var fileName = "companies.csv"; | 571 | var fileName = "companies.csv"; |
596 | var a = document.createElement("a"); | 572 | var a = document.createElement("a"); |
597 | document.body.appendChild(a); | 573 | document.body.appendChild(a); |
598 | CustomersService.exportCompany().then(function(result) { | 574 | CustomersService.exportCompany().then(function(result) { |
599 | var file = new Blob([ result ], { | 575 | var file = new Blob([ result ], { |
600 | type : 'application/csv' | 576 | type : 'application/csv' |
601 | }); | 577 | }); |
602 | var fileURL = URL.createObjectURL(file); | 578 | var fileURL = URL.createObjectURL(file); |
603 | a.href = fileURL; | 579 | a.href = fileURL; |
604 | a.download = fileName; | 580 | a.download = fileName; |
605 | a.click(); | 581 | a.click(); |
606 | $scope.showLoader = false; | 582 | $scope.showLoader = false; |
607 | }) | 583 | }) |
608 | } | 584 | } |
609 | getCompanyName(); | 585 | getCompanyName(); |
610 | function getCompanyName() { | 586 | function getCompanyName() { |
611 | CustomersService.getCompanyName().then(function(result) { | 587 | CustomersService.getCompanyName().then(function(result) { |
612 | $scope.compNameList = result; | 588 | $scope.compNameList = result; |
613 | //console.log("kd",result) | 589 | //console.log("kd",result) |
614 | }) | 590 | }) |
615 | } | 591 | } |
616 | 592 | ||
617 | // old api not use | ||
618 | /*$scope.checkJetWithTail = function(tail, index) { | ||
619 | ViewCompanyService.checkJetType(tail).then(function(result) { | ||
620 | if (result.jetA == "true") { | ||
621 | $scope.jetShow[index] = false; | ||
622 | $scope.marginShow[index] = true; | ||
623 | } else { | ||
624 | $scope.jetShow[index] = true; | ||
625 | $scope.marginShow[index] = false; | ||
626 | } | ||
627 | }) | ||
628 | }*/ | ||
629 | |||
630 | 593 | ||
631 | $scope.etaTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, | 594 | $scope.etaTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, |
632 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, | 595 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, |
633 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, | 596 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, |
634 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, | 597 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, |
635 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, | 598 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, |
636 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; | 599 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; |
637 | 600 | ||
638 | $scope.etdTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, | 601 | $scope.etdTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, |
639 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, | 602 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, |
640 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, | 603 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, |
641 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, | 604 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, |
642 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, | 605 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, |
643 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; | 606 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; |
644 | 607 | ||
645 | } | 608 | } |
app/partials/customers/customers.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(2) > a{ | 2 | .subnavbar .mainnav > li:nth-child(2) > a{ |
3 | color: #ca5c6a; | 3 | color: #ca5c6a; |
4 | } | 4 | } |
5 | 5 | ||
6 | .button1 { | 6 | .button1 { |
7 | display: inline-block; | 7 | display: inline-block; |
8 | height: 35px; | 8 | height: 35px; |
9 | line-height: 35px; | 9 | line-height: 35px; |
10 | padding-right: 15px; | 10 | padding-right: 15px; |
11 | padding-left: 50px; | 11 | padding-left: 50px; |
12 | position: relative; | 12 | position: relative; |
13 | background-color:rgb(41,127,184); | 13 | background-color:rgb(41,127,184); |
14 | color:rgb(255,255,255); | 14 | color:rgb(255,255,255); |
15 | text-decoration: none; | 15 | text-decoration: none; |
16 | text-transform: uppercase; | 16 | text-transform: uppercase; |
17 | letter-spacing: 1px; | 17 | letter-spacing: 1px; |
18 | margin-bottom: 15px; | 18 | margin-bottom: 15px; |
19 | border: 0; | 19 | border: 0; |
20 | 20 | ||
21 | 21 | ||
22 | border-radius: 5px; | 22 | border-radius: 5px; |
23 | -moz-border-radius: 5px; | 23 | -moz-border-radius: 5px; |
24 | -webkit-border-radius: 5px; | 24 | -webkit-border-radius: 5px; |
25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); |
26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | 26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; |
27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | 27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
28 | 28 | ||
29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | 32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; |
33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | 33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
34 | } | 34 | } |
35 | 35 | ||
36 | .button1 span { | 36 | .button1 span { |
37 | position: absolute; | 37 | position: absolute; |
38 | left: 0; | 38 | left: 0; |
39 | top: 0; | 39 | top: 0; |
40 | width: 35px; | 40 | width: 35px; |
41 | background-color:rgba(0,0,0,0.5); | 41 | background-color:rgba(0,0,0,0.5); |
42 | -webkit-border-top-left-radius: 5px; | 42 | -webkit-border-top-left-radius: 5px; |
43 | -webkit-border-bottom-left-radius: 5px; | 43 | -webkit-border-bottom-left-radius: 5px; |
44 | -moz-border-radius-topleft: 5px; | 44 | -moz-border-radius-topleft: 5px; |
45 | -moz-border-radius-bottomleft: 5px; | 45 | -moz-border-radius-bottomleft: 5px; |
46 | border-top-left-radius: 5px; | 46 | border-top-left-radius: 5px; |
47 | border-bottom-left-radius: 5px; | 47 | border-bottom-left-radius: 5px; |
48 | border-right: 1px solid rgba(0,0,0,0.15); | 48 | border-right: 1px solid rgba(0,0,0,0.15); |
49 | } | 49 | } |
50 | 50 | ||
51 | .button1:hover span, .button1.active span { | 51 | .button1:hover span, .button1.active span { |
52 | background-color:rgb(0,102,26); | 52 | background-color:rgb(0,102,26); |
53 | border-right: 1px solid rgba(0,0,0,0.3); | 53 | border-right: 1px solid rgba(0,0,0,0.3); |
54 | } | 54 | } |
55 | 55 | ||
56 | .button1:active { | 56 | .button1:active { |
57 | margin-top: 2px; | 57 | margin-top: 2px; |
58 | margin-bottom: 13px; | 58 | margin-bottom: 13px; |
59 | 59 | ||
60 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 60 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
61 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 61 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
62 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 62 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
63 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | 63 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; |
64 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | 64 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
65 | } | 65 | } |
66 | 66 | ||
67 | .button1.turquoise { | 67 | .button1.turquoise { |
68 | background: #449d44; | 68 | background: #449d44; |
69 | } | 69 | } |
70 | </style> | 70 | </style> |
71 | <div class="myLoader" ng-show="showLoader"> | 71 | <div class="myLoader" ng-show="showLoader"> |
72 | <img src="../img/hourglass.gif" width="50px;"> | 72 | <img src="../img/hourglass.gif" width="50px;"> |
73 | </div> | 73 | </div> |
74 | 74 | ||
75 | <div class="main"> | 75 | <div class="main"> |
76 | <div class="container"> | 76 | <div class="container"> |
77 | <div class="row"> | 77 | <div class="row"> |
78 | <div class="col-md-12"> | 78 | <div class="col-md-12"> |
79 | <div class="widget stacked "> | 79 | <div class="widget stacked "> |
80 | <div class="widget-content"> | 80 | <div class="widget-content"> |
81 | <div class="tabbable"> | 81 | <div class="tabbable"> |
82 | <ul class="nav nav-tabs"> | 82 | <ul class="nav nav-tabs"> |
83 | <li class="active"> | 83 | <li class="active"> |
84 | <a ui-sref="app.customers">Customer View | 84 | <a ui-sref="app.customers">Customer View |
85 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 85 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
86 | </a> | 86 | </a> |
87 | </li> | 87 | </li> |
88 | <li> | 88 | <li> |
89 | <a ui-sref="app.ContactView">Contact View | 89 | <a ui-sref="app.ContactView">Contact View |
90 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 90 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
91 | </a> | 91 | </a> |
92 | </li> | 92 | </li> |
93 | <li> | 93 | <li> |
94 | <a ui-sref="app.FuelVendors">Fuel Vendors | 94 | <a ui-sref="app.FuelVendors">Fuel Vendors |
95 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 95 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
96 | </a> | 96 | </a> |
97 | </li> | 97 | </li> |
98 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" ng-model="searchText" placeholder="Search In Table"></li> | 98 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" ng-model="searchText" placeholder="Search In Table"></li> |
99 | <li><button type="button" class="btn btn-default btn-sm" ng-click="displayCompanyList.filter({}); searchText=null">Clear Search And Filters</button></li> | 99 | <li><button type="button" class="btn btn-default btn-sm" ng-click="displayCompanyList.filter({}); searchText=null">Clear Search And Filters</button></li> |
100 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#demo-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Company</button></li> | 100 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#demo-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Company</button></li> |
101 | </ul> | 101 | </ul> |
102 | <br> | 102 | <br> |
103 | <div class="tab-content customer-table" style="margin:0px"> | 103 | <div class="tab-content customer-table" style="margin:0px"> |
104 | <div class="tab-pane active" id="companyView"> | 104 | <div class="tab-pane active" id="companyView"> |
105 | <table ng-table="displayCompanyList" class="table table-striped table-condensed" show-filter="true"> | 105 | <table ng-table="displayCompanyList" class="table table-striped table-condensed" show-filter="true"> |
106 | <tr style="text-align: center;" ng-repeat="row in $data | filter:searchText:strict"" style="cursor: pointer;"> | 106 | <tr style="text-align: center;" ng-repeat="row in $data | filter:searchText:strict"" style="cursor: pointer;"> |
107 | <td style="text-align: left;" data-title="'Company Name'" filter="{companyName: 'text'}" sortable="'companyName'" ui-sref="app.viewCompany({id : row.id})"> | 107 | <td style="text-align: left;" data-title="'Company Name'" filter="{companyName: 'text'}" sortable="'companyName'" ui-sref="app.viewCompany({id : row.id})"> |
108 | <i class="fa fa-search-plus" style="color:red" ng-if="row.fboPreferred == true"></i> {{row.companyName}} | 108 | <i class="fa fa-search-plus" style="color:red" ng-if="row.fboPreferred == true"></i> {{row.companyName}} |
109 | </td> | 109 | </td> |
110 | <td data-title="'Fleet'" filter="{companyAircraftSize: 'text'}" sortable="'companyAircraftSize'" ui-sref="app.viewCompany({id : row.id})"> | 110 | <td data-title="'Fleet'" filter="{companyAircraftSize: 'text'}" sortable="'companyAircraftSize'" ui-sref="app.viewCompany({id : row.id})"> |
111 | {{row.companyAircraftSize}} | 111 | {{row.companyAircraftSize}} |
112 | </td> | 112 | </td> |
113 | <td data-title="'Main Phone'" filter="{newContactNumber: 'text'}" sortable="'newContactNumber'" ui-sref="app.viewCompany({id : row.id})"> | 113 | <td data-title="'Main Phone'" filter="{newContactNumber: 'text'}" sortable="'newContactNumber'" ui-sref="app.viewCompany({id : row.id})"> |
114 | {{row.newContactNumber}} | 114 | {{row.newContactNumber}} |
115 | </td> | 115 | </td> |
116 | <td data-title="'Primary Contact'" filter="{primaryContactName: 'text'}" sortable="'primaryContactName'" ui-sref="app.viewCompany({id : row.id})"> | 116 | <td data-title="'Primary Contact'" filter="{primaryContactName: 'text'}" sortable="'primaryContactName'" ui-sref="app.viewCompany({id : row.id})"> |
117 | {{row.primaryContactName}} | 117 | {{row.primaryContactName}} |
118 | </td> | 118 | </td> |
119 | <td data-title="'Base'" filter="{baseIcao: 'text'}" sortable="'baseIcao'" ui-sref="app.viewCompany({id : row.id})"> | 119 | <td data-title="'Base'" filter="{baseIcao: 'text'}" sortable="'baseIcao'" ui-sref="app.viewCompany({id : row.id})"> |
120 | {{row.baseIcao}} | 120 | {{row.baseIcao}} |
121 | </td> | 121 | </td> |
122 | <td data-title="'Status'" filter="{activate: 'select'}" filter-data="statusFilter" sortable="'activate'" ui-sref="app.viewCompany({id : row.id})"> | 122 | <td data-title="'Status'" filter="{activate: 'select'}" filter-data="statusFilter" sortable="'activate'" ui-sref="app.viewCompany({id : row.id})"> |
123 | <button type="button" ng-if="row.activate == true" class="btn btn-success btn-xs">Active</button> | 123 | <button type="button" ng-if="row.activate == true" class="btn btn-success btn-xs">Active</button> |
124 | <button type="button" ng-if="row.activate == false" class="btn btn-warning btn-xs">InActive</button> | 124 | <button type="button" ng-if="row.activate == false" class="btn btn-warning btn-xs">InActive</button> |
125 | </td> | 125 | </td> |
126 | <td style="width: 130px;" class="margin-media" data-title="'Margin Setting'" filter="{masterMargin: 'select'}" filter-data="marginFilterOptions" sortable="'masterMargin'"> | 126 | <td style="width: 130px;" class="margin-media" data-title="'Margin Setting'" filter="{masterMargin: 'select'}" filter-data="marginFilterOptions" sortable="'masterMargin'"> |
127 | <select class="form-control" ng-change="editMargin(row)" style="height:31px;" ng-model="row.masterMargin" ng-selected="" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> | 127 | <select class="form-control" ng-change="editMargin(row)" style="height:31px;" ng-model="row.masterMargin" ng-selected="" ng-options="margin.id as margin.marginName for margin in jetMarginList" required></select> |
128 | </td> | 128 | </td> |
129 | <td data-title="'All In'" filter="{marginAllIn: 'text'}" sortable="'marginAllIn'" ui-sref="app.viewCompany({id : row.id})"> | 129 | <td data-title="'All In'" filter="{marginAllIn: 'text'}" sortable="'marginAllIn'" ui-sref="app.viewCompany({id : row.id})"> |
130 | {{row.marginAllIn | number : 4}} | 130 | {{row.marginAllIn | number : 4}} |
131 | </td> | 131 | </td> |
132 | <td data-title="''"> | 132 | <td data-title="''"> |
133 | <button type="button" class="btn btn-info btn-xs" ng-click="setFuel(row.companyName,row.baseTenant,row.contractFuelVendor,row.fuelerlinxCustomer,row.certificateType)">Setup Fuel</button> | 133 | <button type="button" class="btn btn-info btn-xs" ng-click="setFuel(row.companyName,row.baseTenant,row.contractFuelVendor,row.fuelerlinxCustomer,row.certificateType)">Setup Fuel</button> |
134 | </td> | 134 | </td> |
135 | </tr> | 135 | </tr> |
136 | </table> | 136 | </table> |
137 | 137 | ||
138 | <button type="button" ng-click="exportCompany()" class="btn btn-warning exportBtn">Export CSV</button> | 138 | <button type="button" ng-click="exportCompany()" class="btn btn-warning exportBtn">Export CSV</button> |
139 | 139 | ||
140 | </div> | 140 | </div> |
141 | </div> | 141 | </div> |
142 | </div> | 142 | </div> |
143 | </div> | 143 | </div> |
144 | <!-- /widget-content --> | 144 | <!-- /widget-content --> |
145 | </div> | 145 | </div> |
146 | <!-- /widget --> | 146 | <!-- /widget --> |
147 | </div> | 147 | </div> |
148 | <!-- /span8 --> | 148 | <!-- /span8 --> |
149 | </div> | 149 | </div> |
150 | <!-- /row --> | 150 | <!-- /row --> |
151 | </div> | 151 | </div> |
152 | <!-- /container --> | 152 | <!-- /container --> |
153 | </div> | 153 | </div> |
154 | <!-- /main --> | 154 | <!-- /main --> |
155 | <form class="modal multi-step" id="demo-modal-3" name="companyForm"> | 155 | <form class="modal multi-step" id="demo-modal-3" name="companyForm"> |
156 | <div class="modal-dialog modal-lg"> | 156 | <div class="modal-dialog modal-lg"> |
157 | <div class="modal-content"> | 157 | <div class="modal-content"> |
158 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 158 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
159 | <div> | 159 | <div> |
160 | <div class="row" style="margin: 0;"> | 160 | <div class="row" style="margin: 0;"> |
161 | <div> | 161 | <div> |
162 | <div class="widget" style="margin-bottom: 0;"> | 162 | <div class="widget" style="margin-bottom: 0;"> |
163 | <div class="widget-header"> | 163 | <div class="widget-header"> |
164 | <i class="icon-pencil"></i> | 164 | <i class="icon-pencil"></i> |
165 | <i class="fa fa-tasks" aria-hidden="true"></i> | 165 | <i class="fa fa-tasks" aria-hidden="true"></i> |
166 | <h3>Add a New Company</h3> | 166 | <h3>Add a New Company</h3> |
167 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> | 167 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> |
168 | <div style="color: #ff9a01;">Activate     | 168 | <div style="color: #ff9a01;">Activate     |
169 | <toggle ng-model="data.activate" size="customToogle"></toggle> | 169 | <toggle ng-model="data.activate" size="customToogle"></toggle> |
170 | </div> | 170 | </div> |
171 | </div> | 171 | </div> |
172 | <div class="clearfix"></div> | 172 | <div class="clearfix"></div> |
173 | </div> | 173 | </div> |
174 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 174 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
175 | <div class="col-xs-12"> | 175 | <div class="col-xs-12"> |
176 | <div class="col-md-8"> | 176 | <div class="col-md-8"> |
177 | <div class="pull-left"> | 177 | <div class="pull-left"> |
178 | <label class="new-input-label"><b>Company Name *</b></label> | 178 | <label class="new-input-label"><b>Company Name *</b></label> |
179 | </div> | 179 | </div> |
180 | <div class="pull-left" style="margin-left: 15px;"> | 180 | <div class="pull-left" style="margin-left: 15px;"> |
181 | <input type="text" ng-keyup="removeValidation()" ng-model="data.companyName" uib-typeahead="company.companyName for company in compNameList | filter:$viewValue | limitTo:8" class="form-control companyNameInput"> | 181 | <input type="text" ng-keyup="removeValidation()" ng-model="data.companyName" uib-typeahead="company.companyName for company in compNameList | filter:$viewValue | limitTo:8" class="form-control companyNameInput"> |
182 | 182 | ||
183 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> | 183 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> |
184 | </div> | 184 | </div> |
185 | <div class="clearfix"></div> | 185 | <div class="clearfix"></div> |
186 | </div> | 186 | </div> |
187 | <div class="col-md-4"> | 187 | <div class="col-md-4"> |
188 | 188 | ||
189 | <div class="pull-right"> | 189 | <div class="pull-right"> |
190 | <input type="text" ng-model="data.baseIcao" style="width: 100px;" class="form-control" placeholder=""> | 190 | <input type="text" ng-model="data.baseIcao" style="width: 100px;" class="form-control" placeholder=""> |
191 | </div> | 191 | </div> |
192 | <div class="pull-right"> | 192 | <div class="pull-right"> |
193 | <label style="margin-right: 15px;" class="new-input-label"><b>Base ICAO</b></label> | 193 | <label style="margin-right: 15px;" class="new-input-label"><b>Base ICAO</b></label> |
194 | </div> | 194 | </div> |
195 | <div class="clearfix"></div> | 195 | <div class="clearfix"></div> |
196 | </div> | 196 | </div> |
197 | </div> | 197 | </div> |
198 | <div class="clearfix"></div><br> | 198 | <div class="clearfix"></div><br> |
199 | <div class="col-xs-12"> | 199 | <div class="col-xs-12"> |
200 | <div class="col-md-7"> | 200 | <div class="col-md-7"> |
201 | <div class="pull-left"> | 201 | <div class="pull-left"> |
202 | <label class="new-input-label"><b>Relationship </b></label> | 202 | <label class="new-input-label"><b>Relationship </b></label> |
203 | </div> | 203 | </div> |
204 | <div class="pull-left" style="margin-left: 32px;"> | 204 | <div class="pull-left" style="margin-left: 32px;"> |
205 | <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Check here if this is a Base Tenant<br> | 205 | <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Check here if this is a Base Tenant<br> |
206 | <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Check here if this is a FuelerLinx Customer<br> | 206 | <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Check here if this is a FuelerLinx Customer<br> |
207 | <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Check here if this is a Contract Fuel Vendor | 207 | <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Check here if this is a Contract Fuel Vendor |
208 | </div> | 208 | </div> |
209 | <div class="clearfix"></div> | 209 | <div class="clearfix"></div> |
210 | </div> | 210 | </div> |
211 | <div class="col-md-2 Airport" style="text-align: right;"> | 211 | <div class="col-md-2 Airport" style="text-align: right;"> |
212 | <b>Certificate Type</b> | 212 | <b>Certificate Type</b> |
213 | </div> | 213 | </div> |
214 | <div class="col-md-3 Airport"> | 214 | <div class="col-md-3 Airport"> |
215 | <select required class="form-control" ng-model="data.certificateType"> | 215 | <select required class="form-control" ng-model="data.certificateType"> |
216 | <option value="" disabled selected hidden>Select...</option> | 216 | <option value="" disabled selected hidden>Select...</option> |
217 | <option value="corporate">Part 91 (Corporate)</option> | 217 | <option value="corporate">Part 91 (Corporate)</option> |
218 | <option value="charter">Part 135 (Charter)</option> | 218 | <option value="charter">Part 135 (Charter)</option> |
219 | <option value="scheduled">Part 121 (Scheduled)</option> | 219 | <option value="scheduled">Part 121 (Scheduled)</option> |
220 | <option value="military">Military</option> | 220 | <option value="military">Military</option> |
221 | <option value="government">Government</option> | 221 | <option value="government">Government</option> |
222 | </select> | 222 | </select> |
223 | </div> | 223 | </div> |
224 | <div class="clearfix"></div> | 224 | <div class="clearfix"></div> |
225 | </div> | 225 | </div> |
226 | <div class="clearfix"></div> | 226 | <div class="clearfix"></div> |
227 | <br/> | 227 | <br/> |
228 | <div class="col-xs-12"> | 228 | <div class="col-xs-12"> |
229 | <div class="col-md-6"> | 229 | <div class="col-md-6"> |
230 | <div class="pull-left" style="width: 110px;"> | 230 | <div class="pull-left" style="width: 110px;"> |
231 | <b>JET A Margin *</b> | 231 | <b>JET A Margin *</b> |
232 | </div> | 232 | </div> |
233 | <div class="pull-left"> | 233 | <div class="pull-left"> |
234 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> | 234 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> |
235 | <option value="" disabled>Select...</option> | 235 | <option value="" disabled>Select...</option> |
236 | </select> | 236 | </select> |
237 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> | 237 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> |
238 | 238 | ||
239 | <div class="clearfix"></div> | 239 | <div class="clearfix"></div> |
240 | </div> | 240 | </div> |
241 | </div> | 241 | </div> |
242 | 242 | ||
243 | <div class="col-md-3 Airport" style="text-align: right;"> | 243 | <div class="col-md-3 Airport" style="text-align: right;"> |
244 | <b>AVGAS 100LL Margin</b> | 244 | <b>AVGAS 100LL Margin</b> |
245 | </div> | 245 | </div> |
246 | <div class="col-md-3 Airport"> | 246 | <div class="col-md-3 Airport"> |
247 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | 247 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> |
248 | <option value="" disabled>Select...</option> | 248 | <option value="" disabled>Select...</option> |
249 | </select> | 249 | </select> |
250 | </div> | 250 | </div> |
251 | <div class="clearfix"></div> | 251 | <div class="clearfix"></div> |
252 | </div> | 252 | </div> |
253 | <div class="clearfix"></div> | 253 | <div class="clearfix"></div> |
254 | <br/> | 254 | <br/> |
255 | <div class="col-xs-12"> | 255 | <div class="col-xs-12"> |
256 | <div class="col-md-12"> | 256 | <div class="col-md-12"> |
257 | <div class="pull-left" style="width: 110px;"> | 257 | <div class="pull-left" style="width: 110px;"> |
258 | <label class="new-input-label"><b>Address</b></label> | 258 | <label class="new-input-label"><b>Address</b></label> |
259 | </div> | 259 | </div> |
260 | <div class="pull-left" style="width: calc(100% - 110px);"> | 260 | <div class="pull-left" style="width: calc(100% - 110px);"> |
261 | <input type="text" class="form-control" ng-model="data.addressOne" placeholder=""> | 261 | <input type="text" class="form-control" ng-model="data.addressOne" placeholder=""> |
262 | </div> | 262 | </div> |
263 | <div class="clearfix"></div> | 263 | <div class="clearfix"></div> |
264 | </div> | 264 | </div> |
265 | </div> | 265 | </div> |
266 | <div class="clearfix"></div> | 266 | <div class="clearfix"></div> |
267 | <br/> | 267 | <br/> |
268 | <div class="col-xs-12"> | 268 | <div class="col-xs-12"> |
269 | <div class="col-md-12"> | 269 | <div class="col-md-12"> |
270 | <div class="pull-left" style="width: 110px;"> | 270 | <div class="pull-left" style="width: 110px;"> |
271 | <label class="new-input-label"><b>Address2</b></label> | 271 | <label class="new-input-label"><b>Address2</b></label> |
272 | </div> | 272 | </div> |
273 | <div class="pull-left" style="width: calc(100% - 110px);"> | 273 | <div class="pull-left" style="width: calc(100% - 110px);"> |
274 | <input type="text" ng-model="data.addressTwo" class="form-control" placeholder=""> | 274 | <input type="text" ng-model="data.addressTwo" class="form-control" placeholder=""> |
275 | </div> | 275 | </div> |
276 | <div class="clearfix"></div> | 276 | <div class="clearfix"></div> |
277 | </div> | 277 | </div> |
278 | </div> | 278 | </div> |
279 | <div class="clearfix"></div> | 279 | <div class="clearfix"></div> |
280 | <br/> | 280 | <br/> |
281 | <div class="col-xs-12"> | 281 | <div class="col-xs-12"> |
282 | 282 | ||
283 | <div class="col-md-6"> | 283 | <div class="col-md-6"> |
284 | <div class="pull-left" style="width: 110px;"> | 284 | <div class="pull-left" style="width: 110px;"> |
285 | <label class="new-input-label"><b>City</b></label> | 285 | <label class="new-input-label"><b>City</b></label> |
286 | </div> | 286 | </div> |
287 | <div class="pull-left" style="width: calc(100% - 110px);"> | 287 | <div class="pull-left" style="width: calc(100% - 110px);"> |
288 | <input type="text" ng-model="data.city" class="form-control" placeholder=""> | 288 | <input type="text" ng-model="data.city" class="form-control" placeholder=""> |
289 | </div> | 289 | </div> |
290 | <div class="clearfix"></div> | 290 | <div class="clearfix"></div> |
291 | </div> | 291 | </div> |
292 | <div class="col-md-3"> | 292 | <div class="col-md-3"> |
293 | <div class="pull-left" style="width: 40px;"> | 293 | <div class="pull-left" style="width: 40px;"> |
294 | <label class="new-input-label"><b>State</b></label> | 294 | <label class="new-input-label"><b>State</b></label> |
295 | </div> | 295 | </div> |
296 | <div class="pull-left" style="width: calc(100% - 110px);"> | 296 | <div class="pull-left" style="width: calc(100% - 110px);"> |
297 | <input type="text" ng-model="data.state" class="form-control" placeholder=""> | 297 | <input type="text" ng-model="data.state" class="form-control" placeholder=""> |
298 | </div> | 298 | </div> |
299 | <div class="clearfix"></div> | 299 | <div class="clearfix"></div> |
300 | </div> | 300 | </div> |
301 | <div class="col-md-3"> | 301 | <div class="col-md-3"> |
302 | <div class="pull-left"> | 302 | <div class="pull-left"> |
303 | <label class="new-input-label"><b>Zip Code</b></label> | 303 | <label class="new-input-label"><b>Zip Code</b></label> |
304 | </div> | 304 | </div> |
305 | <div class="pull-right" style="width: calc(100% - 60px);"> | 305 | <div class="pull-right" style="width: calc(100% - 60px);"> |
306 | <input type="tel" ng-model="data.zipcode" class="form-control" placeholder=""> | 306 | <input type="tel" ng-model="data.zipcode" class="form-control" placeholder=""> |
307 | </div> | 307 | </div> |
308 | <div class="clearfix"></div> | 308 | <div class="clearfix"></div> |
309 | </div> | 309 | </div> |
310 | </div> | 310 | </div> |
311 | <div class="clearfix"></div> | 311 | <div class="clearfix"></div> |
312 | <br/> | 312 | <br/> |
313 | <div class="col-xs-12"> | 313 | <div class="col-xs-12"> |
314 | 314 | ||
315 | <div class="col-md-6"> | 315 | <div class="col-md-6"> |
316 | <div class="pull-left" style="width: 110px;"> | 316 | <div class="pull-left" style="width: 110px;"> |
317 | <label class="new-input-label"><b>Country</b></label> | 317 | <label class="new-input-label"><b>Country</b></label> |
318 | </div> | 318 | </div> |
319 | <div class="pull-left" style="width: calc(100% - 110px);"> | 319 | <div class="pull-left" style="width: calc(100% - 110px);"> |
320 | <input type="text" ng-model="data.country" class="form-control" placeholder=""> | 320 | <input type="text" ng-model="data.country" class="form-control" placeholder=""> |
321 | </div> | 321 | </div> |
322 | <div class="clearfix"></div> | 322 | <div class="clearfix"></div> |
323 | </div> | 323 | </div> |
324 | <div class="col-md-6"> | 324 | <div class="col-md-6"> |
325 | <div class="pull-left" style="width: 110px;"> | 325 | <div class="pull-left" style="width: 110px;"> |
326 | <label class="new-input-label"><b>Internal Note</b></label> | 326 | <label class="new-input-label"><b>Internal Note</b></label> |
327 | </div> | 327 | </div> |
328 | <div class="pull-left" style="width: calc(100% - 110px);"> | 328 | <div class="pull-left" style="width: calc(100% - 110px);"> |
329 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> | 329 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> |
330 | </div> | 330 | </div> |
331 | <div class="clearfix"></div> | 331 | <div class="clearfix"></div> |
332 | </div> | 332 | </div> |
333 | </div> | 333 | </div> |
334 | <div class="clearfix"></div> | 334 | <div class="clearfix"></div> |
335 | <!-- <br/> | 335 | <!-- <br/> |
336 | <div class="col-xs-12"> | 336 | <div class="col-xs-12"> |
337 | <div class="col-md-2 Airport"></div> | 337 | <div class="col-md-2 Airport"></div> |
338 | <div class="col-md-10 Airport"> | 338 | <div class="col-md-10 Airport"> |
339 | <div class="pull-right"> | 339 | <div class="pull-right"> |
340 | <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button> | 340 | <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button> |
341 | <button type="button" class="btn btn-warning" ng-click="addAircraft()">Next: Add Aircraft</button> | 341 | <button type="button" class="btn btn-warning" ng-click="addAircraft()">Next: Add Aircraft</button> |
342 | </div> | 342 | </div> |
343 | </div> | 343 | </div> |
344 | </div> --> | 344 | </div> --> |
345 | </div> | 345 | </div> |
346 | </div> | 346 | </div> |
347 | <div class="clearfix"></div> | 347 | <div class="clearfix"></div> |
348 | </div> | 348 | </div> |
349 | </div> | 349 | </div> |
350 | </div> | 350 | </div> |
351 | </div> | 351 | </div> |
352 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> | 352 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> |
353 | <div> | 353 | <div> |
354 | <div class="row" style="margin: 0;"> | 354 | <div class="row" style="margin: 0;"> |
355 | <div> | 355 | <div> |
356 | <div class="widget" style="margin-bottom: 0;"> | 356 | <div class="widget" style="margin-bottom: 0;"> |
357 | <div class="widget-header"> | 357 | <div class="widget-header"> |
358 | <i class="icon-pencil"></i> | 358 | <i class="icon-pencil"></i> |
359 | <i class="fa fa-tasks" aria-hidden="true"></i> | 359 | <i class="fa fa-tasks" aria-hidden="true"></i> |
360 | <h3>Add a New Company</h3> | 360 | <h3>Add a New Company</h3> |
361 | <div class="clearfix"></div> | 361 | <div class="clearfix"></div> |
362 | </div> | 362 | </div> |
363 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 363 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
364 | <div class="col-xs-12"> | 364 | <div class="col-xs-12"> |
365 | <div class="widget-header"> | 365 | <div class="widget-header"> |
366 | <i class="fa fa-list"></i> | 366 | <i class="fa fa-list"></i> |
367 | <h3>Aircraft List</h3> | 367 | <h3>Aircraft List</h3> |
368 | </div> | 368 | </div> |
369 | <div class="widget-content" style="padding:0px;border: 0px; "> | 369 | <div class="widget-content" style="padding:0px;border: 0px; "> |
370 | <div class="table-responsive"> | 370 | <div class="table-responsive"> |
371 | |||
372 | <!-- <table class="table table-striped table-bordered"> | ||
373 | <thead> | ||
374 | <tr> | ||
375 | <th>Tail</th> | ||
376 | <th>Make</th> | ||
377 | <th>Model</th> | ||
378 | <th>Size</th> | ||
379 | <th>JET A Margin</th> | ||
380 | <th>AVGS 100LL Margin</th> | ||
381 | </tr> | ||
382 | </thead> | ||
383 | <tbody> | ||
384 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | ||
385 | <td style="width: 15%"> | ||
386 | <input type="text" class="form-control" ng-model="aircraftData.tail" ng-blur="checkJetWithTail(aircraftData.tail, $index)" required/> | ||
387 | </td> | ||
388 | <td style="width: 17%"> | ||
389 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | ||
390 | <option ng-repeat="make in aircraftMakeList | orderBy ">{{make}}</option> | ||
391 | <option value="" disabled>Select...</option> | ||
392 | </select> | ||
393 | </td> | ||
394 | <td style="width: 17%"> | ||
395 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | ||
396 | <option ng-repeat="model in aircraftData.aircraftModalList | orderBy">{{model}}</option> | ||
397 | <option value="" disabled>Select...</option> | ||
398 | </select> | ||
399 | </td> | ||
400 | <td style="width: 17%"> | ||
401 | <select class="form-control" ng-model="aircraftData.sizeId"> | ||
402 | <option value="" disabled>Select</option> | ||
403 | <option ng-repeat="size in aircraftData.aircraftSizeList" value="{{size.aircraftSize.id}}">{{size.aircraftSize.size}}</option> | ||
404 | </select> | ||
405 | |||
406 | </td> | ||
407 | <td style="width: 17%"> | ||
408 | <select class="form-control" ng-model="aircraftData.marginId" ng-disabled="jetShow[$index]"> | ||
409 | <option value="" disabled>Select</option> | ||
410 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | ||
411 | </select> | ||
412 | |||
413 | |||
414 | </td> | ||
415 | <td style="width: 17%"> | ||
416 | <select class="form-control" ng-model="aircraftData.avgasMarginId" ng-disabled="marginShow[$index]"> | ||
417 | <option value="" disabled>Select</option> | ||
418 | <option ng-repeat="avgs in avgsMarginList" value="{{avgs.id}}">{{avgs.marginName}}</option> | ||
419 | </select> | ||
420 | |||
421 | </td> | ||
422 | </tr> | ||
423 | </tbody> | ||
424 | </table> | ||
425 | </div> | ||
426 | <div class="clearfix"></div> | ||
427 | </div> | ||
428 | </div> | ||
429 | <div class="clearfix"></div> | ||
430 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | ||
431 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | ||
432 | </div> --> | ||
433 | 371 | ||
434 | <table class="table table-striped table-bordered"> | 372 | <table class="table table-striped table-bordered"> |
435 | <thead> | 373 | <thead> |
436 | <tr> | 374 | <tr> |
437 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | ||
438 | <th>Tail</th> | 375 | <th>Tail</th> |
439 | <th>Make</th> | 376 | <th>Make</th> |
440 | <th>Model</th> | 377 | <th>Model</th> |
441 | <th>Size</th> | 378 | <th>Size</th> |
442 | <th>JET A Margin</th> | 379 | <th>JET A Margin</th> |
443 | <th>AVGS 100LL Margin</th> | 380 | <th>AVGS 100LL Margin</th> |
444 | </tr> | 381 | </tr> |
445 | </thead> | 382 | </thead> |
446 | <tbody> | 383 | <tbody> |
447 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | 384 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> |
448 | <!-- <td> | 385 | |
449 | <input type="checkbox" ng-model="aircraftData.selected"/> | ||
450 | </td> --> | ||
451 | <!-- <td style="width: 15%"> | ||
452 | <input type="tel" class="form-control" ng-model="aircraftData.tail" ng-blur="checkJetWithTail(aircraftData.tail, $index)" required/> | ||
453 | </td> --> | ||
454 | <td style="width: 15%"> | 386 | <td style="width: 15%"> |
455 | <input type="tel" class="form-control" ng-model="aircraftData.tail" ng-blur="checkTail(aircraftData.tail, $index);" required/> | 387 | <input type="tel" class="form-control" ng-model="aircraftData.tail" ng-blur="checkTail(aircraftData.tail, $index);" required/> |
456 | </td> | 388 | </td> |
457 | <td style="width: 17%"> | 389 | <td style="width: 17%"> |
458 | <select class="form-control" style="width: fit-content;" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index) "> | 390 | <select class="form-control" style="width: fit-content;" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index) "> |
459 | <option value="" disabled>Select</option> | 391 | <option value="" disabled>Select</option> |
460 | <option ng-repeat="make in aircraftMakeList | orderBy">{{make}}</option> | 392 | <option ng-repeat="make in aircraftMakeList | orderBy">{{make}}</option> |
461 | </select> | 393 | </select> |
462 | </td> | 394 | </td> |
463 | <td style="width: 17%"> | 395 | <td style="width: 17%"> |
464 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | 396 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> |
465 | <option value="" disabled>Select</option> | 397 | <option value="" disabled>Select</option> |
466 | <option ng-repeat="model in aircraftData.aircraftModalList | orderBy">{{model}}</option> | 398 | <option ng-repeat="model in aircraftData.aircraftModalList | orderBy">{{model}}</option> |
467 | </select> | 399 | </select> |
468 | </td> | 400 | </td> |
469 | <td style="width: 17%"> | 401 | <td style="width: 17%"> |
470 | <select class="form-control" ng-model="aircraftData.size" ng-change="getFuelType(aircraftData.size, $index)"> | 402 | <select class="form-control" ng-model="aircraftData.size" ng-change="getFuelType(aircraftData.size, $index)"> |
471 | <option value="" disabled>Select</option> | 403 | <option value="" disabled>Select</option> |
472 | <option ng-repeat="size in aircraftData.aircraftSizeList" value="{{size.aircraftSize.id}}" ng-selected="aircraftData.size = aircraftData.aircraftSizeList[0].aircraftSize.id">{{size.aircraftSize.size}}</option> | 404 | <option ng-repeat="size in aircraftData.aircraftSizeList" value="{{size.aircraftSize.id}}" ng-selected="aircraftData.size = aircraftData.aircraftSizeList[0].aircraftSize.id">{{size.aircraftSize.size}}</option> |
473 | </select> | 405 | </select> |
474 | 406 | ||
475 | <!-- <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"></select> --> | ||
476 | |||
477 | </td> | 407 | </td> |
478 | <td style="width: 17%"> | 408 | <td style="width: 17%"> |
479 | 409 | ||
480 | <select class="form-control" ng-model="aircraftData.marginId" ng-disabled="jetShow[$index]"> | 410 | <select class="form-control" ng-model="aircraftData.marginId" ng-disabled="jetShow[$index]"> |
481 | <option value="" disabled>Select</option> | 411 | <option value="" disabled>Select</option> |
482 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | 412 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> |
483 | </select> | 413 | </select> |
484 | 414 | ||
485 | <!-- <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList" ng-disabled="jetShow[$index]"> | ||
486 | |||
487 | <option value="" disabled>Select...</option> | ||
488 | </select> --> | ||
489 | |||
490 | </td> | 415 | </td> |
491 | <td style="width: 17%"> | 416 | <td style="width: 17%"> |
492 | <select class="form-control" ng-model="aircraftData.avgasMarginId" ng-disabled="marginShow[$index]"> | 417 | <select class="form-control" ng-model="aircraftData.avgasMarginId" ng-disabled="marginShow[$index]"> |
493 | <option value="" disabled>Select</option> | 418 | <option value="" disabled>Select</option> |
494 | <option ng-repeat="avgs in avgsMarginList" value="{{avgs.id}}">{{avgs.marginName}}</option> | 419 | <option ng-repeat="avgs in avgsMarginList" value="{{avgs.id}}">{{avgs.marginName}}</option> |
495 | </select> | 420 | </select> |
496 | |||
497 | <!-- <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList" ng-disabled="marginShow[$index]"> | ||
498 | <option value="" disabled>Select...</option> | ||
499 | </select> --> | ||
500 | </td> | 421 | </td> |
501 | </tr> | 422 | </tr> |
502 | </tbody> | 423 | </tbody> |
503 | </table> | 424 | </table> |
504 | </div> | 425 | </div> |
505 | <div class="clearfix"></div> | 426 | <div class="clearfix"></div> |
506 | </div> | 427 | </div> |
507 | </div> | 428 | </div> |
508 | <div class="clearfix"></div> | 429 | <div class="clearfix"></div> |
509 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | 430 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> |
510 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft </button> | 431 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft </button> |
511 | </div> | 432 | </div> |
512 | </div> | 433 | </div> |
513 | </div> | 434 | </div> |
514 | <div class="clearfix"></div> | 435 | <div class="clearfix"></div> |
515 | </div> | 436 | </div> |
516 | </div> | 437 | </div> |
517 | </div> | 438 | </div> |
518 | </div> | 439 | </div> |
519 | <!-- <div class="modal-body step-3" data-step="3"> | 440 | <!-- <div class="modal-body step-3" data-step="3"> |
520 | This is the final step. | 441 | This is the final step. |
521 | </div> --> | 442 | </div> --> |
522 | <div class="modal-footer" style="border-top: 0;"> | 443 | <div class="modal-footer" style="border-top: 0;"> |
523 | <button type="button" class="btn btn-default" ng-click="reset2()" data-dismiss="modal">Cancel</button> | 444 | <button type="button" class="btn btn-default" ng-click="reset2()" data-dismiss="modal">Cancel</button> |
524 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button> | 445 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button> |
525 | <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button> | 446 | <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button> |
526 | <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> --> | 447 | <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> --> |
527 | <button type="button" class="btn btn-success step step-2" data-step="2" ng-click="saveCompanyData()">Save</button> | 448 | <button type="button" class="btn btn-success step step-2" data-step="2" ng-click="saveCompanyData()">Save</button> |
528 | </div> | 449 | </div> |
529 | </div> | 450 | </div> |
530 | </div> | 451 | </div> |
531 | </form> | 452 | </form> |
532 | 453 | ||
533 | <div class="customConfirmPopBackdrop" id="addAirCraftError"> | 454 | <div class="customConfirmPopBackdrop" id="addAirCraftError"> |
534 | <div class="customModalInner" style="max-width: 400px;"> | 455 | <div class="customModalInner" style="max-width: 400px;"> |
535 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 456 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
536 | <table> | 457 | <table> |
537 | <tr> | 458 | <tr> |
538 | <td> | 459 | <td> |
539 | <p style="padding: 5px 10px; margin-bottom: 0;">{{aircraftMessage}}</p> | 460 | <p style="padding: 5px 10px; margin-bottom: 0;">{{aircraftMessage}}</p> |
540 | </td> | 461 | </td> |
541 | </tr> | 462 | </tr> |
542 | </table> | 463 | </table> |
543 | </div> | 464 | </div> |
544 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 465 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
545 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAirCraftError()">ok</button> | 466 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAirCraftError()">ok</button> |
546 | </div> | 467 | </div> |
547 | </div> | 468 | </div> |
548 | </div> | 469 | </div> |
549 | 470 | ||
550 | <div class="customConfirmPopBackdrop" id="addAirCraftWarning"> | 471 | <div class="customConfirmPopBackdrop" id="addAirCraftWarning"> |
551 | <div class="customModalInner" style="max-width: 400px;"> | 472 | <div class="customModalInner" style="max-width: 400px;"> |
552 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 473 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
553 | <table> | 474 | <table> |
554 | <tr> | 475 | <tr> |
555 | <td> | 476 | <td> |
556 | <p style="padding: 5px 10px; margin-bottom: 0;">{{aircraftMessage}}</p> | 477 | <p style="padding: 5px 10px; margin-bottom: 0;">{{aircraftMessage}}</p> |
557 | </td> | 478 | </td> |
558 | </tr> | 479 | </tr> |
559 | </table> | 480 | </table> |
560 | </div> | 481 | </div> |
561 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 482 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
562 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="acceptAirCraftError()">Yes</button> | 483 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="acceptAirCraftError()">Yes</button> |
563 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAirCraftError()">No</button> | 484 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAirCraftError()">No</button> |
564 | </div> | 485 | </div> |
565 | </div> | 486 | </div> |
566 | </div> | 487 | </div> |
567 | 488 | ||
568 | 489 | ||
569 | 490 | ||
570 | <!-- SetUp fuel order --> | 491 | <!-- SetUp fuel order --> |
571 | <form class="modal multi-step" id="demo-modal-4" name="fuelOrderForm"> | 492 | <form class="modal multi-step" id="demo-modal-4" name="fuelOrderForm"> |
572 | <div class="modal-dialog modal-lg"> | 493 | <div class="modal-dialog modal-lg"> |
573 | <div class="modal-content"> | 494 | <div class="modal-content"> |
574 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 495 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
575 | <div> | 496 | <div> |
576 | <div class="row" style="margin: 0;"> | 497 | <div class="row" style="margin: 0;"> |
577 | <div> | 498 | <div> |
578 | <div class="widget" style="margin-bottom: 0;"> | 499 | <div class="widget" style="margin-bottom: 0;"> |
579 | <div class="widget-header"> | 500 | <div class="widget-header"> |
580 | <i class="icon-pencil"></i> | 501 | <i class="icon-pencil"></i> |
581 | <i class="fa fa-tasks" aria-hidden="true"></i> | 502 | <i class="fa fa-tasks" aria-hidden="true"></i> |
582 | <h3>Add a Fuel Order</h3> | 503 | <h3>Add a Fuel Order</h3> |
583 | <div class="clearfix"></div> | 504 | <div class="clearfix"></div> |
584 | </div> | 505 | </div> |
585 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 506 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
586 | <div class="col-xs-12"> | 507 | <div class="col-xs-12"> |
587 | <div class="col-xs-12"> | 508 | <div class="col-xs-12"> |
588 | 509 | ||
589 | <div class="col-md-6"> | 510 | <div class="col-md-6"> |
590 | <div class="pull-left" style="width: 110px;"> | 511 | <div class="pull-left" style="width: 110px;"> |
591 | <label class="new-input-label"><b>Company</b></label> | 512 | <label class="new-input-label"><b>Company</b></label> |
592 | </div> | 513 | </div> |
593 | <div class="pull-left" style="width: calc(100% - 110px);"> | 514 | <div class="pull-left" style="width: calc(100% - 110px);"> |
594 | <!-- <select ui-select2 ng-model="order.companyName" ng-change="getAircraft(order.companyName)" style="width: 100%;" required> | 515 | <!-- <select ui-select2 ng-model="order.companyName" ng-change="getAircraft(order.companyName)" style="width: 100%;" required> |
595 | <option value="" selected disabled>Select Company</option> | 516 | <option value="" selected disabled>Select Company</option> |
596 | <option ng-repeat="list in companyList">{{list.companyName}}</option> | 517 | <option ng-repeat="list in companyList">{{list.companyName}}</option> |
597 | </select> --> | 518 | </select> --> |
598 | <input type="text" disabled ng-model="order.defaultCompanyName" class="form-control"/> | 519 | <input type="text" disabled ng-model="order.defaultCompanyName" class="form-control"/> |
599 | </div> | 520 | </div> |
600 | <div class="clearfix"></div> | 521 | <div class="clearfix"></div> |
601 | </div> | 522 | </div> |
602 | <div class="col-md-6"> | 523 | <div class="col-md-6"> |
603 | <div class="pull-left" style="width: 110px;"> | 524 | <div class="pull-left" style="width: 110px;"> |
604 | <label class="new-input-label"><b>Product</b></label> | 525 | <label class="new-input-label"><b>Product</b></label> |
605 | </div> | 526 | </div> |
606 | <div class="pull-left" style="width: calc(100% - 110px);"> | 527 | <div class="pull-left" style="width: calc(100% - 110px);"> |
607 | <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote); addTotal(order.priceQuote, order.volume)" required> | 528 | <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote); addTotal(order.priceQuote, order.volume)" required> |
608 | <option value="" selected disabled>Select Product</option> | 529 | <option value="" selected disabled>Select Product</option> |
609 | <option ng-repeat="margin in marginList" value="{{margin}}">${{margin.papTotal | number : 4}} {{margin.productName}}</option> | 530 | <option ng-repeat="margin in marginList" value="{{margin}}">${{margin.papTotal | number : 4}} {{margin.productName}}</option> |
610 | </select> | 531 | </select> |
611 | </div> | 532 | </div> |
612 | <div class="clearfix"></div> | 533 | <div class="clearfix"></div> |
613 | </div> | 534 | </div> |
614 | 535 | ||
615 | </div> | 536 | </div> |
616 | <div class="clearfix"></div> | 537 | <div class="clearfix"></div> |
617 | <br/> | 538 | <br/> |
618 | 539 | ||
619 | 540 | ||
620 | <div class="col-xs-12"> | 541 | <div class="col-xs-12"> |
621 | 542 | ||
622 | <div class="col-md-6"> | 543 | <div class="col-md-6"> |
623 | <div class="pull-left" style="width: 110px;"> | 544 | <div class="pull-left" style="width: 110px;"> |
624 | <label class="new-input-label"><b>Aircraft</b></label> | 545 | <label class="new-input-label"><b>Aircraft</b></label> |
625 | </div> | 546 | </div> |
626 | <div class="pull-left" style="width: calc(100% - 110px);"> | 547 | <div class="pull-left" style="width: calc(100% - 110px);"> |
627 | <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required> | 548 | <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required> |
628 | <option selected disabled value="">Select Aircraft</option> | 549 | <option selected disabled value="">Select Aircraft</option> |
629 | <option ng-repeat="list in aircraftList">{{list.tail}}</option> | 550 | <option ng-repeat="list in aircraftList">{{list.tail}}</option> |
630 | </select> | 551 | </select> |
631 | </div> | 552 | </div> |
632 | <div class="clearfix"></div> | 553 | <div class="clearfix"></div> |
633 | </div> | 554 | </div> |
634 | <div class="col-md-6"> | 555 | <div class="col-md-6"> |
635 | <div class="pull-left" style="width: 110px;"> | 556 | <div class="pull-left" style="width: 110px;"> |
636 | <label class="new-input-label"><b>Make</b></label> | 557 | <label class="new-input-label"><b>Make</b></label> |
637 | </div> | 558 | </div> |
638 | <div class="pull-left" style="width: calc(100% - 110px);"> | 559 | <div class="pull-left" style="width: calc(100% - 110px);"> |
639 | <select class="form-control" ng-model="order.aircraftMake" disabled required> | 560 | <select class="form-control" ng-model="order.aircraftMake" disabled required> |
640 | <option selected disabled value="">Select Make</option> | 561 | <option selected disabled value="">Select Make</option> |
641 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> --> | 562 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> --> |
642 | <option ng-repeat="list in aircraftList">{{list.make}}</option> | 563 | <option ng-repeat="list in aircraftList">{{list.make}}</option> |
643 | </select> | 564 | </select> |
644 | </div> | 565 | </div> |
645 | <div class="clearfix"></div> | 566 | <div class="clearfix"></div> |
646 | </div> | 567 | </div> |
647 | 568 | ||
648 | </div> | 569 | </div> |
649 | <div class="clearfix"></div> | 570 | <div class="clearfix"></div> |
650 | <br/> | 571 | <br/> |
651 | 572 | ||
652 | <div class="col-xs-12"> | 573 | <div class="col-xs-12"> |
653 | 574 | ||
654 | <div class="col-md-6"> | 575 | <div class="col-md-6"> |
655 | <div class="pull-left" style="width: 110px;"> | 576 | <div class="pull-left" style="width: 110px;"> |
656 | <label class="new-input-label"><b>Model</b></label> | 577 | <label class="new-input-label"><b>Model</b></label> |
657 | </div> | 578 | </div> |
658 | <div class="pull-left" style="width: calc(100% - 110px);"> | 579 | <div class="pull-left" style="width: calc(100% - 110px);"> |
659 | <select class="form-control" ng-model="order.aircraftModel" disabled required> | 580 | <select class="form-control" ng-model="order.aircraftModel" disabled required> |
660 | <option selected disabled value="">Select Model</option> | 581 | <option selected disabled value="">Select Model</option> |
661 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> --> | 582 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> --> |
662 | <option ng-repeat="list in aircraftList">{{list.model}}</option> | 583 | <option ng-repeat="list in aircraftList">{{list.model}}</option> |
663 | </select> | 584 | </select> |
664 | </div> | 585 | </div> |
665 | <div class="clearfix"></div> | 586 | <div class="clearfix"></div> |
666 | </div> | 587 | </div> |
667 | <div class="col-md-6"> | 588 | <div class="col-md-6"> |
668 | <div class="pull-left" style="width: 110px;"> | 589 | <div class="pull-left" style="width: 110px;"> |
669 | <label class="new-input-label"><b>Volume</b></label> | 590 | <label class="new-input-label"><b>Volume</b></label> |
670 | </div> | 591 | </div> |
671 | <div class="pull-left" style="width: calc(100% - 110px);"> | 592 | <div class="pull-left" style="width: calc(100% - 110px);"> |
672 | <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.priceQuote, order.volume)" class="form-control" placeholder="" required> | 593 | <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.priceQuote, order.volume)" class="form-control" placeholder="" required> |
673 | </div> | 594 | </div> |
674 | <div class="clearfix"></div> | 595 | <div class="clearfix"></div> |
675 | </div> | 596 | </div> |
676 | 597 | ||
677 | </div> | 598 | </div> |
678 | <div class="clearfix"></div> | 599 | <div class="clearfix"></div> |
679 | <br/> | 600 | <br/> |
680 | 601 | ||
681 | <div class="col-xs-12"> | 602 | <div class="col-xs-12"> |
682 | 603 | ||
683 | <div class="col-md-6"> | 604 | <div class="col-md-6"> |
684 | <div class="pull-left" style="width: 110px;"> | 605 | <div class="pull-left" style="width: 110px;"> |
685 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> | 606 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> |
686 | </div> | 607 | </div> |
687 | <div class="pull-left" style="width: calc(100% - 110px);"> | 608 | <div class="pull-left" style="width: calc(100% - 110px);"> |
688 | <div style="width: 50%; float: left;"> | 609 | <div style="width: 50%; float: left;"> |
689 | Date | 610 | Date |
690 | <input type="text" style="width: 90%;" ng-model="order.upliftDate" class="form-control" placeholder="" datepicker required/> | 611 | <input type="text" style="width: 90%;" ng-model="order.upliftDate" class="form-control" placeholder="" datepicker required/> |
691 | </div> | 612 | </div> |
692 | <div style="width: 50%; float: left;"> | 613 | <div style="width: 50%; float: left;"> |
693 | Time | 614 | Time |
694 | <select class="form-control" ng-model="order.etaTime" style="width: 100%;" required> | 615 | <select class="form-control" ng-model="order.etaTime" style="width: 100%;" required> |
695 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> | 616 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> |
696 | </select> | 617 | </select> |
697 | 618 | ||
698 | </div> | 619 | </div> |
699 | </div> | 620 | </div> |
700 | <div class="clearfix"></div> | 621 | <div class="clearfix"></div> |
701 | </div> | 622 | </div> |
702 | 623 | ||
703 | <div class="col-md-6" style="margin-top: 22px;" ng-if ="order.status === 'invoiced'"> | 624 | <div class="col-md-6" style="margin-top: 22px;" ng-if ="order.status === 'invoiced'"> |
704 | <div class="pull-left" style="width: 110px;"> | 625 | <div class="pull-left" style="width: 110px;"> |
705 | <label class="new-input-label"><b>Invoiced</b></label> | 626 | <label class="new-input-label"><b>Invoiced</b></label> |
706 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 627 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
707 | </div> | 628 | </div> |
708 | <div class="pull-left" style="width: calc(100% - 110px);"> | 629 | <div class="pull-left" style="width: calc(100% - 110px);"> |
709 | <input type="text" ng-model="order.invoiced" class="form-control" placeholder=""> | 630 | <input type="text" ng-model="order.invoiced" class="form-control" placeholder=""> |
710 | </div> | 631 | </div> |
711 | <div class="clearfix"></div> | 632 | <div class="clearfix"></div> |
712 | </div> | 633 | </div> |
713 | </div> | 634 | </div> |
714 | <div class="clearfix"></div><br> | 635 | <div class="clearfix"></div><br> |
715 | 636 | ||
716 | 637 | ||
717 | <div class="col-xs-12"> | 638 | <div class="col-xs-12"> |
718 | 639 | ||
719 | <div class="col-md-6"> | 640 | <div class="col-md-6"> |
720 | <div class="pull-left" style="width: 110px;"> | 641 | <div class="pull-left" style="width: 110px;"> |
721 | <label class="new-input-label" style="margin-top: 25px;"><b>ETD</b></label> | 642 | <label class="new-input-label" style="margin-top: 25px;"><b>ETD</b></label> |
722 | </div> | 643 | </div> |
723 | <div class="pull-left" style="width: calc(100% - 110px);"> | 644 | <div class="pull-left" style="width: calc(100% - 110px);"> |
724 | <div style="width: 50%; float: left;"> | 645 | <div style="width: 50%; float: left;"> |
725 | Date | 646 | Date |
726 | <input type="text" style="width: 90%;" ng-model="order.departingDate" class="form-control" placeholder="" datepicker/> | 647 | <input type="text" style="width: 90%;" ng-model="order.departingDate" class="form-control" placeholder="" datepicker/> |
727 | </div> | 648 | </div> |
728 | <div style="width: 50%; float: left;"> | 649 | <div style="width: 50%; float: left;"> |
729 | Time | 650 | Time |
730 | <select class="form-control" ng-model="order.etdTime" style="width: 100%;"> | 651 | <select class="form-control" ng-model="order.etdTime" style="width: 100%;"> |
731 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> | 652 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> |
732 | </select> | 653 | </select> |
733 | 654 | ||
734 | </div> | 655 | </div> |
735 | </div> | 656 | </div> |
736 | <div class="clearfix"></div> | 657 | <div class="clearfix"></div> |
737 | </div> | 658 | </div> |
738 | 659 | ||
739 | <div class="col-md-6" style="margin-top: 22px;"> | 660 | <div class="col-md-6" style="margin-top: 22px;"> |
740 | <div class="pull-left" style="width: 110px;"> | 661 | <div class="pull-left" style="width: 110px;"> |
741 | <label class="new-input-label"><b>Total</b></label> | 662 | <label class="new-input-label"><b>Total</b></label> |
742 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 663 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
743 | </div> | 664 | </div> |
744 | <div class="pull-left" style="width: calc(100% - 110px);"> | 665 | <div class="pull-left" style="width: calc(100% - 110px);"> |
745 | <input type="text" class="form-control" disabled ng-model="order.total | number : 4" placeholder="" ng-value="{{order.volume * order.invoiced}}"> | 666 | <input type="text" class="form-control" disabled ng-model="order.total | number : 4" placeholder="" ng-value="{{order.volume * order.invoiced}}"> |
746 | </div> | 667 | </div> |
747 | </div> | 668 | </div> |
748 | </div> | 669 | </div> |
749 | <div class="clearfix"></div><br> | 670 | <div class="clearfix"></div><br> |
750 | 671 | ||
751 | <div class="col-xs-12"> | 672 | <div class="col-xs-12"> |
752 | 673 | ||
753 | <div class="col-md-6"> | 674 | <div class="col-md-6"> |
754 | <div class="pull-left" style="width: 110px;"> | 675 | <div class="pull-left" style="width: 110px;"> |
755 | <label class="new-input-label"><b>Fuel on</b></label> | 676 | <label class="new-input-label"><b>Fuel on</b></label> |
756 | </div> | 677 | </div> |
757 | <div class="pull-left" style="width: calc(100% - 110px);"> | 678 | <div class="pull-left" style="width: calc(100% - 110px);"> |
758 | <select class="form-control" ng-model="order.fuelOn" style="width: 100%;"> | 679 | <select class="form-control" ng-model="order.fuelOn" style="width: 100%;"> |
759 | <option value="" disabled selected hidden>Arrival</option> | 680 | <option value="" disabled selected hidden>Arrival</option> |
760 | <option value="Arrival">Arrival</option> | 681 | <option value="Arrival">Arrival</option> |
761 | <option value="Departure">Departure</option> | 682 | <option value="Departure">Departure</option> |
762 | </select> | 683 | </select> |
763 | </div> | 684 | </div> |
764 | <div class="clearfix"></div> | 685 | <div class="clearfix"></div> |
765 | </div> | 686 | </div> |
766 | 687 | ||
767 | <div class="col-md-6"> | 688 | <div class="col-md-6"> |
768 | <div class="pull-left" style="width: 110px;"> | 689 | <div class="pull-left" style="width: 110px;"> |
769 | <label class="new-input-label"><b>FBO Cost</b></label> | 690 | <label class="new-input-label"><b>FBO Cost</b></label> |
770 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 691 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
771 | </div> | 692 | </div> |
772 | <div class="pull-left" style="width: calc(100% - 110px);"> | 693 | <div class="pull-left" style="width: calc(100% - 110px);"> |
773 | <input type="text" disabled ng-model="order.fboCost | number : 4" class="form-control" placeholder="0.0000" /> | 694 | <input type="text" disabled ng-model="order.fboCost | number : 4" class="form-control" placeholder="0.0000" /> |
774 | </div> | 695 | </div> |
775 | <div class="clearfix"></div> | 696 | <div class="clearfix"></div> |
776 | </div> | 697 | </div> |
777 | </div> | 698 | </div> |
778 | <div class="clearfix"></div><br> | 699 | <div class="clearfix"></div><br> |
779 | 700 | ||
780 | <div class="col-xs-12"> | 701 | <div class="col-xs-12"> |
781 | <div class="col-md-6"> | 702 | <div class="col-md-6"> |
782 | <div class="pull-left" style="width: 110px;"> | 703 | <div class="pull-left" style="width: 110px;"> |
783 | <label class="new-input-label"><b>Source</b></label> | 704 | <label class="new-input-label"><b>Source</b></label> |
784 | </div> | 705 | </div> |
785 | <div class="pull-left" style="width: calc(100% - 110px);"> | 706 | <div class="pull-left" style="width: calc(100% - 110px);"> |
786 | <div style="font-weight: normal;" ng-if="baseTenant && !contractFuelVendor">Tenant/Base Customer</br></div> | 707 | <div style="font-weight: normal;" ng-if="baseTenant && !contractFuelVendor">Tenant/Base Customer</br></div> |
787 | <div style="font-weight: normal;" ng-if="contractFuelVendor && !baseTenant">CAA Member</div> | 708 | <div style="font-weight: normal;" ng-if="contractFuelVendor && !baseTenant">CAA Member</div> |
788 | <div style="font-weight: normal;" ng-if="contractFuelVendor && baseTenant">Tenant/CAA</div> | 709 | <div style="font-weight: normal;" ng-if="contractFuelVendor && baseTenant">Tenant/CAA</div> |
789 | <!-- <select class="form-control" ng-model="order.source" style="width: 100%;"> | 710 | |
790 | <option value="" disabled selected hidden>Select Source</option> | ||
791 | <option value="Tenant">Tenant</option> | ||
792 | <option value="CAA">CAA</option> | ||
793 | <option value="Tenant/CAA">Tenant/CAA</option> | ||
794 | </select> --> | ||
795 | </div> | 711 | </div> |
796 | <div class="clearfix"></div> | 712 | <div class="clearfix"></div> |
797 | </div> | 713 | </div> |
798 | </div> | 714 | </div> |
799 | <div class="clearfix"></div> | 715 | <div class="clearfix"></div> |
800 | <br/> | 716 | <br/> |
801 | <div class="col-xs-12"> | 717 | <div class="col-xs-12"> |
802 | 718 | ||
803 | 719 | ||
804 | <div class="col-md-6"> | 720 | <div class="col-md-6"> |
805 | <div class="pull-left" style="width: 110px;"> | 721 | <div class="pull-left" style="width: 110px;"> |
806 | <label class="new-input-label"><b>Certificate Type</b></label> | 722 | <label class="new-input-label"><b>Certificate Type</b></label> |
807 | </div> | 723 | </div> |
808 | <div class="pull-left" style="width: calc(100% - 110px);"> | 724 | <div class="pull-left" style="width: calc(100% - 110px);"> |
809 | <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;"> | 725 | <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;"> |
810 | <option value="" disabled selected hidden>Select...</option> | 726 | <option value="" disabled selected hidden>Select...</option> |
811 | <option value="corporate">Part 91 (Corporate)</option> | 727 | <option value="corporate">Part 91 (Corporate)</option> |
812 | <option value="charter">Part 135 (Charter)</option> | 728 | <option value="charter">Part 135 (Charter)</option> |
813 | <option value="scheduled">Part 121 (Scheduled)</option> | 729 | <option value="scheduled">Part 121 (Scheduled)</option> |
814 | <option value="military">Military</option> | 730 | <option value="military">Military</option> |
815 | <option value="government">Government</option> | 731 | <option value="government">Government</option> |
816 | </select> | 732 | </select> |
817 | </div> | 733 | </div> |
818 | <div class="clearfix"></div> | 734 | <div class="clearfix"></div> |
819 | </div> | 735 | </div> |
820 | <div class="col-md-6"> | 736 | <div class="col-md-6"> |
821 | <div class="pull-left" style="width: 110px;"> | 737 | <div class="pull-left" style="width: 110px;"> |
822 | <label class="new-input-label"><b>Status</b></label> | 738 | <label class="new-input-label"><b>Status</b></label> |
823 | </div> | 739 | </div> |
824 | <div class="pull-left" style="width: calc(100% - 110px);"> | 740 | <div class="pull-left" style="width: calc(100% - 110px);"> |
825 | <select class="form-control" ng-model="order.status" style="width: 100%;"> | 741 | <select class="form-control" ng-model="order.status" style="width: 100%;"> |
826 | <option value="" disabled selected hidden>pending</option> | 742 | <option value="" disabled selected hidden>pending</option> |
827 | <option value="pending">pending</option> | 743 | <option value="pending">pending</option> |
828 | <option value="invoiced">invoiced</option> | 744 | <option value="invoiced">invoiced</option> |
829 | <option value="paid">paid</option> | 745 | <option value="paid">paid</option> |
830 | <!-- <option value="cancelled">cancelled</option> | 746 | <!-- <option value="cancelled">cancelled</option> |
831 | <option value="archived">archived</option> --> | 747 | <option value="archived">archived</option> --> |
832 | </select> | 748 | </select> |
833 | </div> | 749 | </div> |
834 | <div class="clearfix"></div> | 750 | <div class="clearfix"></div> |
835 | </div> | 751 | </div> |
836 | </div> | 752 | </div> |
837 | <div class="clearfix"></div><br> | 753 | <div class="clearfix"></div><br> |
838 | 754 | ||
839 | </div> | 755 | </div> |
840 | </div> | 756 | </div> |
841 | </div> | 757 | </div> |
842 | </div> | 758 | </div> |
843 | </div> | 759 | </div> |
844 | </div> | 760 | </div> |
845 | <div class="modal-footer" style="border-top: 0;"> | 761 | <div class="modal-footer" style="border-top: 0;"> |
846 | <button type="button" class="btn btn-default" ng-click="cancelData()" data-dismiss="modal">Cancel</button> | 762 | <button type="button" class="btn btn-default" ng-click="cancelData()" data-dismiss="modal">Cancel</button> |
847 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-disabled="fuelOrderForm.$invalid" ng-click="dispatchFuel()">Save</button> | 763 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-disabled="fuelOrderForm.$invalid" ng-click="dispatchFuel()">Save</button> |
848 | </div> | 764 | </div> |
849 | </div> | 765 | </div> |
850 | </div> | 766 | </div> |
851 | </div> | 767 | </div> |
852 | </form> | 768 | </form> |
853 | 769 | ||
854 | 770 | ||
855 | <div class="myLoader" ng-show="showLoader"> | 771 | <div class="myLoader" ng-show="showLoader"> |
856 | <img src="../img/hourglass.gif" width="50px;"> | 772 | <img src="../img/hourglass.gif" width="50px;"> |
857 | </div> | 773 | </div> |
858 | <script src="js/multi-step-modal.js"></script> | 774 | <script src="js/multi-step-modal.js"></script> |
859 | <script> | 775 | <script> |
860 | sendEvent = function(sel, step) { | 776 | sendEvent = function(sel, step) { |
861 | $(sel).trigger('next.m.' + step); | 777 | $(sel).trigger('next.m.' + step); |
862 | } | 778 | } |
863 | </script> | 779 | </script> |
app/partials/dashboard/dashboard.controller.js
1 | (function() { | 1 | (function() { |
2 | 'use strict' | 2 | 'use strict' |
3 | 3 | ||
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | .controller('dashboardController', [ '$scope', '$filter', '$rootScope', '$state', 'dashboardService','updateFuelManagerService', 'analyticsService', dashboardController]); | 5 | .controller('dashboardController', [ '$scope', '$filter', '$rootScope', '$state', 'dashboardService','updateFuelManagerService', 'analyticsService', dashboardController]); |
6 | 6 | ||
7 | function dashboardController($scope, $filter, $rootScope, $state, dashboardService,updateFuelManagerService,analyticsService) { | 7 | function dashboardController($scope, $filter, $rootScope, $state, dashboardService,updateFuelManagerService,analyticsService) { |
8 | 8 | ||
9 | $scope.getQuote = true; | 9 | $scope.getQuote = true; |
10 | $scope.showQuote = false; | 10 | $scope.showQuote = false; |
11 | $scope.getQuote = function () { | 11 | $scope.getQuote = function () { |
12 | $scope.getQuote = false; | 12 | $scope.getQuote = false; |
13 | $scope.showQuote = true; | 13 | $scope.showQuote = true; |
14 | } | 14 | } |
15 | 15 | ||
16 | $scope.logout = function () { | 16 | $scope.logout = function () { |
17 | localStorage.clear(); | 17 | localStorage.clear(); |
18 | localStorage.removeItem("loginStatus"); | 18 | localStorage.removeItem("loginStatus"); |
19 | $rootScope.path = false; | 19 | $rootScope.path = false; |
20 | $state.reload(); | 20 | $state.reload(); |
21 | } | 21 | } |
22 | 22 | ||
23 | $scope.marginList = {}; | 23 | $scope.marginList = {}; |
24 | dashboardService.getMargin().then(function(result) { | 24 | dashboardService.getMargin().then(function(result) { |
25 | $scope.marginList = result; | 25 | $scope.marginList = result; |
26 | // console.log("--kd Margin result--", result) | 26 | // console.log("--kd Margin result--", result) |
27 | }) | 27 | }) |
28 | 28 | ||
29 | $scope.newFuelPricing = {}; | 29 | $scope.newFuelPricing = {}; |
30 | dashboardService.getFuelPricingNew().then(function(result) { | 30 | dashboardService.getFuelPricingNew().then(function(result) { |
31 | $scope.newFuelPricing = result; | 31 | $scope.newFuelPricing = result; |
32 | // console.log("kd Fuel Pricing result", result) | 32 | // console.log("kd Fuel Pricing result", result) |
33 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 33 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
34 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 34 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
35 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { | 35 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { |
36 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 36 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
37 | var month = newTime.getUTCMonth() + 1; //months from 1-12 | 37 | var month = newTime.getUTCMonth() + 1; //months from 1-12 |
38 | var day = newTime.getUTCDate(); | 38 | var day = newTime.getUTCDate(); |
39 | var year = newTime.getUTCFullYear(); | 39 | var year = newTime.getUTCFullYear(); |
40 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; | 40 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; |
41 | } | 41 | } |
42 | } | 42 | } |
43 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 43 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
44 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 44 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
45 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { | 45 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { |
46 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 46 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
47 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 | 47 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 |
48 | var nextDay = newTime.getUTCDate(); | 48 | var nextDay = newTime.getUTCDate(); |
49 | var nextYear = newTime.getUTCFullYear(); | 49 | var nextYear = newTime.getUTCFullYear(); |
50 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; | 50 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 53 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
54 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { | 54 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { |
55 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 55 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
56 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 56 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
57 | var dday = newTime.getUTCDate(); | 57 | var dday = newTime.getUTCDate(); |
58 | var dyear = newTime.getUTCFullYear(); | 58 | var dyear = newTime.getUTCFullYear(); |
59 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 59 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
60 | } | 60 | } |
61 | } | 61 | } |
62 | } | 62 | } |
63 | var str =""+ $scope.newFuelPricing[i].name | 63 | var str =""+ $scope.newFuelPricing[i].name |
64 | if(str.startsWith("J")){ | 64 | if(str.startsWith("J")){ |
65 | $scope.newFuelPricing[i].jeta = true; | 65 | $scope.newFuelPricing[i].jeta = true; |
66 | var str1 = str.substring(0,5) | 66 | var str1 = str.substring(0,5) |
67 | var str2 = str.substring(6, str.length) | 67 | var str2 = str.substring(6, str.length) |
68 | $scope.newFuelPricing[i].name = str1 | 68 | $scope.newFuelPricing[i].name = str1 |
69 | $scope.newFuelPricing[i].namejetrest = str2 | 69 | $scope.newFuelPricing[i].namejetrest = str2 |
70 | 70 | ||
71 | 71 | ||
72 | }else if(str.startsWith("100")){ | 72 | }else if(str.startsWith("100")){ |
73 | $scope.newFuelPricing[i].avgas = true; | 73 | $scope.newFuelPricing[i].avgas = true; |
74 | var str1 = str.substring(0,5) | 74 | var str1 = str.substring(0,5) |
75 | var str2 = str.substring(6, str.length) | 75 | var str2 = str.substring(6, str.length) |
76 | $scope.newFuelPricing[i].name = str1 | 76 | $scope.newFuelPricing[i].name = str1 |
77 | $scope.newFuelPricing[i].nameavgasrest = str2 | 77 | $scope.newFuelPricing[i].nameavgasrest = str2 |
78 | } | 78 | } |
79 | } | 79 | } |
80 | $scope.showLoader = false; | 80 | $scope.showLoader = false; |
81 | }) | 81 | }) |
82 | 82 | ||
83 | 83 | ||
84 | $scope.updateFuelPricing = {}; | 84 | $scope.updateFuelPricing = {}; |
85 | $scope.updateFuelPricing.fuelPricingList = []; | 85 | $scope.updateFuelPricing.fuelPricingList = []; |
86 | $scope.updateFuelPricing.userProfileId = $scope.userProfileId; | 86 | $scope.updateFuelPricing.userProfileId = $scope.userProfileId; |
87 | $scope.updateFuelPricingClick = function(){ | 87 | $scope.updateFuelPricingClick = function(){ |
88 | $scope.showLoader = true; | 88 | $scope.showLoader = true; |
89 | 89 | ||
90 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 90 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
91 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 91 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
92 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); | 92 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); |
93 | if ($scope.newFuelPricing[i].fuelPricing.cost == null) { | 93 | if ($scope.newFuelPricing[i].fuelPricing.cost == null) { |
94 | $scope.newFuelPricing[i].fuelPricing.cost = ''; | 94 | $scope.newFuelPricing[i].fuelPricing.cost = ''; |
95 | } | 95 | } |
96 | if ($scope.newFuelPricing[i].fuelPricing.papMargin == null) { | 96 | if ($scope.newFuelPricing[i].fuelPricing.papMargin == null) { |
97 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; | 97 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; |
98 | } | 98 | } |
99 | if ($scope.newFuelPricing[i].fuelPricing.papTotal == null) { | 99 | if ($scope.newFuelPricing[i].fuelPricing.papTotal == null) { |
100 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; | 100 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; |
101 | } | 101 | } |
102 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate == null) { | 102 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate == null) { |
103 | $scope.newFuelPricing[i].fuelPricing.expirationDate = ''; | 103 | $scope.newFuelPricing[i].fuelPricing.expirationDate = ''; |
104 | }else{ | 104 | }else{ |
105 | $scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 105 | $scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
106 | // console.log('$scope.newFuelPricing[i].fuelPricing.expirationDate', $scope.newFuelPricing[i].fuelPricing.expirationDate); | 106 | // console.log('$scope.newFuelPricing[i].fuelPricing.expirationDate', $scope.newFuelPricing[i].fuelPricing.expirationDate); |
107 | $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime(); | 107 | $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime(); |
108 | } | 108 | } |
109 | 109 | ||
110 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); | 110 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); |
111 | $scope.updateFuelPricing.fuelPricingList.push({ | 111 | $scope.updateFuelPricing.fuelPricingList.push({ |
112 | 'cost': $scope.newFuelPricing[i].fuelPricing.cost, | 112 | 'cost': $scope.newFuelPricing[i].fuelPricing.cost, |
113 | 'papMargin': $scope.newFuelPricing[i].fuelPricing.papMargin, | 113 | 'papMargin': $scope.newFuelPricing[i].fuelPricing.papMargin, |
114 | 'papTotal': $scope.newFuelPricing[i].fuelPricing.papTotal, | 114 | 'papTotal': $scope.newFuelPricing[i].fuelPricing.papTotal, |
115 | 'expirationDate': $scope.newFuelPricing[i].fuelPricing.expirationDate, | 115 | 'expirationDate': $scope.newFuelPricing[i].fuelPricing.expirationDate, |
116 | 'productId': $scope.newFuelPricing[i].id, | 116 | 'productId': $scope.newFuelPricing[i].id, |
117 | 'id': $scope.newFuelPricing[i].fuelPricing.id, | 117 | 'id': $scope.newFuelPricing[i].fuelPricing.id, |
118 | }) | 118 | }) |
119 | 119 | ||
120 | }else{ | 120 | }else{ |
121 | /*$scope.newFuelPricing[i].fuelPricing.cost = ''; | 121 | /*$scope.newFuelPricing[i].fuelPricing.cost = ''; |
122 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; | 122 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; |
123 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; | 123 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; |
124 | $scope.newFuelPricing[i].fuelPricing.expirationDate = '';*/ | 124 | $scope.newFuelPricing[i].fuelPricing.expirationDate = '';*/ |
125 | } | 125 | } |
126 | 126 | ||
127 | } | 127 | } |
128 | 128 | ||
129 | // console.log('result',$scope.marginList) | 129 | // console.log('result',$scope.marginList) |
130 | dashboardService.updateFuelPricing($scope.updateFuelPricing).then(function(result) { | 130 | dashboardService.updateFuelPricing($scope.updateFuelPricing).then(function(result) { |
131 | toastr.success('Successfully Updated', { | 131 | toastr.success('Successfully Updated', { |
132 | closeButton: true | 132 | closeButton: true |
133 | }) | 133 | }) |
134 | dashboardService.getFuelPricingNew().then(function(result) { | 134 | dashboardService.getFuelPricingNew().then(function(result) { |
135 | $scope.newFuelPricing = result; | 135 | $scope.newFuelPricing = result; |
136 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 136 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
137 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 137 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
138 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { | 138 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { |
139 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 139 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
140 | var month = newTime.getUTCMonth() + 1; //months from 1-12 | 140 | var month = newTime.getUTCMonth() + 1; //months from 1-12 |
141 | var day = newTime.getUTCDate(); | 141 | var day = newTime.getUTCDate(); |
142 | var year = newTime.getUTCFullYear(); | 142 | var year = newTime.getUTCFullYear(); |
143 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; | 143 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; |
144 | } | 144 | } |
145 | } | 145 | } |
146 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 146 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
147 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 147 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
148 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { | 148 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { |
149 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 149 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
150 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 | 150 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 |
151 | var nextDay = newTime.getUTCDate(); | 151 | var nextDay = newTime.getUTCDate(); |
152 | var nextYear = newTime.getUTCFullYear(); | 152 | var nextYear = newTime.getUTCFullYear(); |
153 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; | 153 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; |
154 | } | 154 | } |
155 | } | 155 | } |
156 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 156 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
157 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { | 157 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { |
158 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 158 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
159 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 159 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
160 | var dday = newTime.getUTCDate(); | 160 | var dday = newTime.getUTCDate(); |
161 | var dyear = newTime.getUTCFullYear(); | 161 | var dyear = newTime.getUTCFullYear(); |
162 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 162 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
163 | } | 163 | } |
164 | } | 164 | } |
165 | } | 165 | } |
166 | } | 166 | } |
167 | $scope.showLoader = false; | 167 | $scope.showLoader = false; |
168 | }) | 168 | }) |
169 | }) | 169 | }) |
170 | 170 | ||
171 | } | 171 | } |
172 | 172 | ||
173 | 173 | ||
174 | |||
175 | // $scope.submitLogin = function() { | ||
176 | // LoginService.setAuth(true); | ||
177 | // toastr.info("Login successfully"); | ||
178 | // $state.go('app.dashboard'); | ||
179 | // /*LoginService.login($scope.username, $scope.password).then(function(result){ | ||
180 | // if(typeof result == 'object') { | ||
181 | // LoginService.setAuth(true); | ||
182 | // $rootScope.path = true; | ||
183 | // var reqPwdChng = localStorage.getItem("requiredChangePwd"); | ||
184 | // if (reqPwdChng && reqPwdChng == "Y") { | ||
185 | // $state.go('resetPassword'); | ||
186 | // } else { | ||
187 | // $state.go('app.upload'); | ||
188 | // } | ||
189 | // } else { | ||
190 | // toastr.info("Error in login. Please check login name and password"); | ||
191 | // } | ||
192 | // })*/ | ||
193 | // } | ||
194 | 174 | ||
195 | $scope.completeOrderCount = ''; | 175 | $scope.completeOrderCount = ''; |
196 | $scope.pendingOrderCount= ''; | 176 | $scope.pendingOrderCount= ''; |
197 | 177 | ||
198 | dashboardService.getFuelordercount().then(function(result) { | 178 | dashboardService.getFuelordercount().then(function(result) { |
199 | if(result[0].label=='Completed' && result[1].label=='Pending'){ | 179 | if(result[0].label=='Completed' && result[1].label=='Pending'){ |
200 | $scope.completeOrderCount=result[0].value; | 180 | $scope.completeOrderCount=result[0].value; |
201 | $scope.pendingOrderCount=result[1].value; | 181 | $scope.pendingOrderCount=result[1].value; |
202 | } | 182 | } |
203 | 183 | ||
204 | }) | 184 | }) |
205 | 185 | ||
206 | $scope.sendEmail = {}; | 186 | $scope.sendEmail = {}; |
207 | $scope.confirmMail = function(){ | 187 | $scope.confirmMail = function(){ |
208 | if ($scope.sendEmail.pricing != '' && $scope.sendEmail.pricing != null && $scope.sendEmail.pricing != undefined) { | 188 | if ($scope.sendEmail.pricing != '' && $scope.sendEmail.pricing != null && $scope.sendEmail.pricing != undefined) { |
209 | $('#confirm1').css('display', 'block'); | 189 | $('#confirm1').css('display', 'block'); |
210 | 190 | ||
211 | } | 191 | } |
212 | } | 192 | } |
213 | $scope.saveAndCloseConfirm = function(){ | 193 | $scope.saveAndCloseConfirm = function(){ |
214 | $('#confirm1').css('display', 'none'); | 194 | $('#confirm1').css('display', 'none'); |
215 | updateFuelManagerService.sendMailToGroupMargin($scope.sendEmail.pricing).then(function(result) { | 195 | updateFuelManagerService.sendMailToGroupMargin($scope.sendEmail.pricing).then(function(result) { |
216 | $scope.sendEmail = {}; | 196 | $scope.sendEmail = {}; |
217 | if(result.error) { | 197 | if(result.error) { |
218 | toastr.error('' + result.error + '', { | 198 | toastr.error('' + result.error + '', { |
219 | closeButton: true | 199 | closeButton: true |
220 | }) | 200 | }) |
221 | } else { | 201 | } else { |
222 | toastr.success(''+result.success+'', { | 202 | toastr.success(''+result.success+'', { |
223 | closeButton: true | 203 | closeButton: true |
224 | }) | 204 | }) |
225 | } | 205 | } |
226 | }) | 206 | }) |
227 | } | 207 | } |
228 | $scope.cancelAndCloseConfirm = function(){ | 208 | $scope.cancelAndCloseConfirm = function(){ |
229 | $scope.sendEmail = {}; | 209 | $scope.sendEmail = {}; |
230 | $scope.sendEmail.pricing = ''; | 210 | $scope.sendEmail.pricing = ''; |
231 | $('#confirm1').css('display', 'none'); | 211 | $('#confirm1').css('display', 'none'); |
232 | } | 212 | } |
233 | 213 | ||
234 | $scope.pendingMessageRecord=[]; | 214 | $scope.pendingMessageRecord=[]; |
235 | dashboardService.getPendingMessage().then(function(result) { | 215 | dashboardService.getPendingMessage().then(function(result) { |
236 | // console.log("==message===",result) | 216 | // console.log("==message===",result) |
237 | $scope.pendingMessageRecord=result; | 217 | $scope.pendingMessageRecord=result; |
238 | }) | 218 | }) |
239 | 219 | ||
240 | 220 | ||
241 | $scope.orderCostAndCount = function() { | 221 | $scope.orderCostAndCount = function() { |
242 | analyticsService.orderCostAndCount().then(function(result) { | 222 | analyticsService.orderCostAndCount().then(function(result) { |
243 | $scope.ordersCost = result.cost; | 223 | $scope.ordersCost = result.cost; |
244 | $scope.ordersCount = result.count; | 224 | $scope.ordersCount = result.count; |
245 | }) | 225 | }) |
246 | } | 226 | } |
247 | 227 | ||
248 | $scope.drf = {}; | 228 | $scope.drf = {}; |
249 | $scope.hfp = {}; | 229 | $scope.hfp = {}; |
250 | $scope.cs = {}; | 230 | $scope.cs = {}; |
251 | $scope.mfsValues = []; | 231 | $scope.mfsValues = []; |
252 | $scope.msfarray = []; | 232 | $scope.msfarray = []; |
253 | $scope.getMFS = function() { | 233 | $scope.getMFS = function() { |
254 | //var makeId = makeId; | 234 | //var makeId = makeId; |
255 | analyticsService.getMFS().then(function(result) { | 235 | analyticsService.getMFS().then(function(result) { |
256 | $scope.mfsValues = result; | 236 | $scope.mfsValues = result; |
257 | $scope.optionsmfs = { | 237 | $scope.optionsmfs = { |
258 | chart: { | 238 | chart: { |
259 | type: 'multiBarChart', | 239 | type: 'multiBarChart', |
260 | height: 450, | 240 | height: 450, |
261 | reduceXTicks: false, | 241 | reduceXTicks: false, |
262 | margin: { | 242 | margin: { |
263 | top: 45, | 243 | top: 45, |
264 | right: 20, | 244 | right: 20, |
265 | bottom: 45, | 245 | bottom: 45, |
266 | left: 45 | 246 | left: 45 |
267 | }, | 247 | }, |
268 | clipEdge: true, | 248 | clipEdge: true, |
269 | //staggerLabels: true, | 249 | //staggerLabels: true, |
270 | duration: 500, | 250 | duration: 500, |
271 | stacked: false, | 251 | stacked: false, |
272 | //color: ["#FEDFC3", "#990000", "#000099", "#009900"], | ||
273 | color: ["#A9A9A9", "#000099", "#990000", "#009900"], | 252 | color: ["#A9A9A9", "#000099", "#990000", "#009900"], |
274 | xAxis: { | 253 | xAxis: { |
275 | axisLabel: 'Months', | 254 | axisLabel: 'Months', |
276 | showMaxMin: false, | 255 | showMaxMin: false, |
277 | }, | 256 | }, |
278 | yAxis: { | 257 | yAxis: { |
279 | axisLabel: 'Orders', | 258 | axisLabel: 'Orders', |
280 | axisLabelDistance: -20, | 259 | axisLabelDistance: -20, |
281 | tickFormat: function(d) { | 260 | tickFormat: function(d) { |
282 | return d3.format(',.1f')(d); | 261 | return d3.format(',')(d); |
283 | } | 262 | } |
284 | } | 263 | } |
285 | } | 264 | } |
286 | }; | 265 | }; |
287 | $scope.datamfs = $scope.mfsValues; | 266 | $scope.datamfs = $scope.mfsValues; |
288 | }) | 267 | }) |
289 | } | 268 | } |
290 | 269 | ||
291 | $scope.orderCostAndCount(); | 270 | $scope.orderCostAndCount(); |
292 | $scope.getMFS(); | 271 | $scope.getMFS(); |
293 | 272 | ||
294 | } | 273 | } |
295 | })(); | 274 | })(); |
296 | 275 |
app/partials/dashboard/dashboard.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:first-child > a{ | 2 | .subnavbar .mainnav > li:first-child > a{ |
3 | color: #ca5c6a; | 3 | color: #ca5c6a; |
4 | } | 4 | } |
5 | 5 | ||
6 | </style> | 6 | </style> |
7 | <!-- <style> | 7 | |
8 | table, th , td { | ||
9 | border: 1px solid grey; | ||
10 | border-collapse: collapse; | ||
11 | padding: 5px; | ||
12 | } | ||
13 | table tr:nth-child(odd) { | ||
14 | background-color: #f1f1f1; | ||
15 | } | ||
16 | table tr:nth-child(even) { | ||
17 | background-color: #ffffff; | ||
18 | } | ||
19 | </style> --> | ||
20 | <div class="main"> | 8 | <div class="main"> |
21 | <div class="container" ng-if="isAuthenticated"> | 9 | <div class="container" ng-if="isAuthenticated"> |
22 | <div class="row"> | 10 | <div class="row"> |
23 | <div class="col-md-7"> | 11 | <div class="col-md-7"> |
24 | <div class="widget stacked"> | 12 | <div class="widget stacked"> |
25 | <div class="row"> | 13 | <div class="row"> |
26 | <div class="col-md-3"> | 14 | <div class="col-md-3"> |
27 | <a ui-sref="app.filterFuelOrders({status:'paid'})"> | 15 | <a ui-sref="app.filterFuelOrders({status:'paid'})"> |
28 | <div class="widget-header"> | 16 | <div class="widget-header"> |
29 | <i class="fa fa-tint"></i> Reconciled Orders | 17 | <i class="fa fa-tint"></i> Reconciled Orders |
30 | 18 | ||
31 | </div></a> | 19 | </div></a> |
32 | <div class="custom-widget-content"> | 20 | <div class="custom-widget-content"> |
33 | <div> | 21 | <div> |
34 | <div class="col-xs-12"> | 22 | <div class="col-xs-12"> |
35 | <label class="pull-left" style="font-size: 13px" >Completed</label> | 23 | <label class="pull-left" style="font-size: 13px" >Completed</label> |
36 | <span style="font-size: 11px"> Monthly</span> | 24 | <span style="font-size: 11px"> Monthly</span> |
37 | <!-- <button class="btn btn-success btn-xs pull-right" style="cursor: default"> --> | ||
38 | <!-- <label class="pull-right">Montly</label> --> | ||
39 | <!-- <span style="font-size:13px;">(Monthly)</span> --> | ||
40 | <div class="clearfix"></div> | 25 | <div class="clearfix"></div> |
41 | </div> | 26 | </div> |
42 | <div class="clearfix"></div> | 27 | <div class="clearfix"></div> |
43 | </div> | 28 | </div> |
44 | <hr class="hr"> | 29 | <hr class="hr"> |
45 | <div class="col-xs-12"> | 30 | <div class="col-xs-12"> |
46 | <h2 style="margin-bottom: 0px;">{{completeOrderCount}}</h2> | 31 | <h2 style="margin-bottom: 0px;">{{completeOrderCount}}</h2> |
47 | <span>Fuel Orders</span> | 32 | <span>Fuel Orders</span> |
48 | </div> | 33 | </div> |
49 | <div class="clearfix"></div> | 34 | <div class="clearfix"></div> |
50 | </div> | 35 | </div> |
51 | </div> | 36 | </div> |
52 | <div class="col-md-3"> | 37 | <div class="col-md-3"> |
53 | <div class="widget-header"> | 38 | <div class="widget-header"> |
54 | <i class="fa fa-tint"></i> Pending Orders | 39 | <i class="fa fa-tint"></i> Pending Orders |
55 | 40 | ||
56 | </div> | 41 | </div> |
57 | <div class="custom-widget-content"> | 42 | <div class="custom-widget-content"> |
58 | <div> | 43 | <div> |
59 | <div class="col-xs-12"> | 44 | <div class="col-xs-12"> |
60 | <label class="pull-left" style="font-size: 13px" >Pending</label> | 45 | <label class="pull-left" style="font-size: 13px" >Pending</label> |
61 | <span style="font-size: 11px"> Monthly</span> | 46 | <span style="font-size: 11px"> Monthly</span> |
62 | <!-- <span class="pull-left">Pending</span><button class="btn btn-success btn-xs pull-right pull-right-color " style="cursor: default"><span style="font-size:9px;">Monthly</span></button> --> | ||
63 | <div class="clearfix"></div> | 47 | <div class="clearfix"></div> |
64 | </div> | 48 | </div> |
65 | <div class="clearfix"></div> | 49 | <div class="clearfix"></div> |
66 | </div> | 50 | </div> |
67 | <hr class="hr"> | 51 | <hr class="hr"> |
68 | <div class="col-xs-12"> | 52 | <div class="col-xs-12"> |
69 | <h2 style="margin-bottom: 0px;">{{pendingOrderCount}}</h2> | 53 | <h2 style="margin-bottom: 0px;">{{pendingOrderCount}}</h2> |
70 | <span>Fuel Orders</span> | 54 | <span>Fuel Orders</span> |
71 | </div> | 55 | </div> |
72 | <div class="clearfix"></div> | 56 | <div class="clearfix"></div> |
73 | </div> | 57 | </div> |
74 | </div> | 58 | </div> |
75 | <div class="col-md-6"> | 59 | <div class="col-md-6"> |
76 | <div class="widget-header"> | 60 | <div class="widget-header"> |
77 | <i class="fa fa-list-alt "></i> | 61 | <i class="fa fa-list-alt "></i> |
78 | <h3>Airport Operations</h3> | 62 | <h3>Airport Operations</h3> |
79 | </div> | 63 | </div> |
80 | <div class="custom-widget-content"> | 64 | <div class="custom-widget-content"> |
81 | <div> | 65 | <div> |
82 | <div class="col-xs-12"> | 66 | <div class="col-xs-12"> |
83 | <label class="pull-left" style="font-size: 12px" >Activity : Airport Operations</label> | 67 | <label class="pull-left" style="font-size: 12px" >Activity : Airport Operations</label> |
84 | <span style="font-size: 11px"> Monthly</span> | 68 | <span style="font-size: 11px"> Monthly</span> |
85 | <!-- <span class="pull-left">Activity: Airport Operations</span><button class="btn btn-primary btn-xs pull-right" style="cursor: default"><span style="font-size:9px;">Monthly</span></button> --> | ||
86 | <div class="clearfix"></div> | 69 | <div class="clearfix"></div> |
87 | </div> | 70 | </div> |
88 | <div class="clearfix"></div> | 71 | <div class="clearfix"></div> |
89 | </div> | 72 | </div> |
90 | <hr class="hr"> | 73 | <hr class="hr"> |
91 | <div class="col-xs-6"> | 74 | <div class="col-xs-6"> |
92 | <h2 style="margin-bottom:0px;">280</h2> | 75 | <h2 style="margin-bottom:0px;">280</h2> |
93 | <span>Based-Aircraft</span> | 76 | <span>Based-Aircraft</span> |
94 | </div> | 77 | </div> |
95 | <div class="col-xs-6"> | 78 | <div class="col-xs-6"> |
96 | <h2 style="margin-bottom: 0px;">280</h2> | 79 | <h2 style="margin-bottom: 0px;">280</h2> |
97 | <span>Take-offs & Landings</span> | 80 | <span>Take-offs & Landings</span> |
98 | </div> | 81 | </div> |
99 | <div class="clearfix"></div> | 82 | <div class="clearfix"></div> |
100 | </div> | 83 | </div> |
101 | </div> | 84 | </div> |
102 | </div> | 85 | </div> |
103 | </br> | 86 | </br> |
104 | <div class="row"> | 87 | <div class="row"> |
105 | <div class="col-md-12"> | 88 | <div class="col-md-12"> |
106 | <!-- <div class="widget stacked"> --> | 89 | <!-- <div class="widget stacked"> --> |
107 | <div class="widget-header"> | 90 | <div class="widget-header"> |
108 | <i class="icon-bar-chart"></i> | 91 | <i class="icon-bar-chart"></i> |
109 | <h3>${{ordersCost | number :2}}/{{ordersCount}} Fuel Sales</h3> | 92 | <h3>${{ordersCost | number :2}}/{{ordersCount}} Fuel Sales</h3> |
110 | </div> | 93 | </div> |
111 | <!-- /widget-header --> | 94 | <!-- /widget-header --> |
112 | <div class="widget-content"> | 95 | <div class="widget-content"> |
113 | <nvd3 options="optionsmfs" data="datamfs"></nvd3> | 96 | <nvd3 options="optionsmfs" data="datamfs"></nvd3> |
114 | <!-- /bar-chart --> | 97 | <!-- /bar-chart --> |
115 | <!-- </div> --> | 98 | <!-- </div> --> |
116 | <!-- /widget-content --> | 99 | <!-- /widget-content --> |
117 | </div> | 100 | </div> |
118 | <!-- /widget-content --> | 101 | <!-- /widget-content --> |
119 | </div> | 102 | </div> |
120 | <!-- /widget --> | 103 | <!-- /widget --> |
121 | </div> | 104 | </div> |
122 | </div> | 105 | </div> |
123 | </div> | 106 | </div> |
124 | <!-- /span6 --> | 107 | <!-- /span6 --> |
125 | <div class="col-md-5"> | 108 | <div class="col-md-5"> |
126 | <div class="widget stacked"> | 109 | <div class="widget stacked"> |
127 | <div class="widget-header"> | 110 | <div class="widget-header"> |
128 | <i class="fa fa-pencil"></i> | 111 | <i class="fa fa-pencil"></i> |
129 | <h3>Price Manager Active</h3> | 112 | <h3>Price Manager Active</h3> |
130 | <select ng-show="isShowEmail" style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="btn btn-primary" class="form-control" ng-model="sendEmail.pricing" ng-click="confirmMail()"> | 113 | <select ng-show="isShowEmail" style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="btn btn-primary" class="form-control" ng-model="sendEmail.pricing" ng-click="confirmMail()"> |
131 | <option value="" disabled selected="selected">Email All Pricing</option> | 114 | <option value="" disabled selected="selected">Email All Pricing</option> |
132 | <option value="JET-A">Email JET-A pricing only</option> | 115 | <option value="JET-A">Email JET-A pricing only</option> |
133 | <option value="AVGAS">Email AVGAS pricing only</option> | 116 | <option value="AVGAS">Email AVGAS pricing only</option> |
134 | <option disabled>_______________________________</option> | 117 | <option disabled>_______________________________</option> |
135 | <option value="all">Distribute All</option> | 118 | <option value="all">Distribute All</option> |
136 | </select> | 119 | </select> |
137 | </div> | 120 | </div> |
138 | <!-- /widget-header --> | 121 | <!-- /widget-header --> |
139 | <div class="widget-content"> | 122 | <div class="widget-content"> |
140 | <h4>Deployed Fuel Prices</h4> | 123 | <h4>Deployed Fuel Prices</h4> |
141 | <table class="table vertical-center""> | 124 | <table class="table vertical-center""> |
142 | <thead> | 125 | <thead> |
143 | <tr> | 126 | <tr> |
144 | <th> Product</th> | 127 | <th> Product</th> |
145 | <th> Cost</th> | 128 | <th> Cost</th> |
146 | <th> Margin</th> | 129 | <th> Margin</th> |
147 | <th> PAP(Total)</th> | 130 | <th> PAP(Total)</th> |
148 | <th style="color: #F90;"> Expires</th> | 131 | <th style="color: #F90;"> Expires</th> |
149 | </tr> | 132 | </tr> |
150 | </thead> | 133 | </thead> |
151 | <tbody> | 134 | <tbody> |
152 | <tr ng-repeat="fuelPricing in newFuelPricing | orderBy : 'namejetrest'| filter:{ status: true }"> | 135 | <tr ng-repeat="fuelPricing in newFuelPricing | orderBy : 'namejetrest'| filter:{ status: true }"> |
153 | <td> | 136 | <td> |
154 | <span style="color: #2196f3" ng-show="fuelPricing.jeta">{{fuelPricing.name}}</span> | 137 | <span style="color: #2196f3" ng-show="fuelPricing.jeta">{{fuelPricing.name}}</span> |
155 | <span ng-show="fuelPricing.jeta">{{fuelPricing.namejetrest}}</span> | 138 | <span ng-show="fuelPricing.jeta">{{fuelPricing.namejetrest}}</span> |
156 | <span style="color: 39c" ng-show="fuelPricing.avgas">{{fuelPricing.name}}</span> | 139 | <span style="color: 39c" ng-show="fuelPricing.avgas">{{fuelPricing.name}}</span> |
157 | <span ng-show="fuelPricing.avgas">{{fuelPricing.nameavgasrest}}</span> | 140 | <span ng-show="fuelPricing.avgas">{{fuelPricing.nameavgasrest}}</span> |
158 | </td> | 141 | </td> |
159 | <td> | 142 | <td> |
160 | <span>{{fuelPricing.fuelPricing.cost | number : 4}}</span> | 143 | <span>{{fuelPricing.fuelPricing.cost | number : 4}}</span> |
161 | </td> | 144 | </td> |
162 | <td> | 145 | <td> |
163 | <span>{{fuelPricing.fuelPricing.papMargin | number : 4}}</span> | 146 | <span>{{fuelPricing.fuelPricing.papMargin | number : 4}}</span> |
164 | </td> | 147 | </td> |
165 | <td> | 148 | <td> |
166 | <span style="line-height: 31px; color: #1ab394;">$ {{fuelPricing.fuelPricing.cost -- fuelPricing.fuelPricing.papMargin | number : 4 }}</span> | 149 | <span style="line-height: 31px; color: #1ab394;">$ {{fuelPricing.fuelPricing.cost -- fuelPricing.fuelPricing.papMargin | number : 4 }}</span> |
167 | </td> | 150 | </td> |
168 | <td> | 151 | <td> |
169 | <span>{{fuelPricing.fuelPricing.expirationDate}}</span> | 152 | <span>{{fuelPricing.fuelPricing.expirationDate}}</span> |
170 | </td> | 153 | </td> |
171 | </tr> | 154 | </tr> |
172 | </tbody> | 155 | </tbody> |
173 | </table> | 156 | </table> |
174 | </div> | 157 | </div> |
175 | <!-- /widget-content --> | 158 | <!-- /widget-content --> |
176 | </div> | 159 | </div> |
177 | <!-- /widget --> | 160 | <!-- /widget --> |
178 | <div class="widget widget-nopad stacked" style="display: none;"> | 161 | <div class="widget widget-nopad stacked" style="display: none;"> |
179 | <div class="widget-header"> | 162 | <div class="widget-header"> |
180 | <i class="fa fa-comment" aria-hidden="true"></i> | 163 | <i class="fa fa-comment" aria-hidden="true"></i> |
181 | <h3>Needs Attention</h3> | 164 | <h3>Needs Attention</h3> |
182 | </div> | 165 | </div> |
183 | <div class="widget-content"> | 166 | <div class="widget-content"> |
184 | <h4 style="padding:10px">Messages</h4> | 167 | <h4 style="padding:10px">Messages</h4> |
185 | <hr class="hr"> | 168 | <hr class="hr"> |
186 | <table> | 169 | <table> |
187 | <tr ng-repeat="msg in pendingMessageRecord"> | 170 | <tr ng-repeat="msg in pendingMessageRecord"> |
188 | <td>Fuel Order is Pending for the company {{ msg[5] }} </td> | 171 | <td>Fuel Order is Pending for the company {{ msg[5] }} </td> |
189 | </tr> | 172 | </tr> |
190 | </table> | 173 | </table> |
191 | </div> | 174 | </div> |
192 | </div> | 175 | </div> |
193 | <!-- /widget --> | 176 | <!-- /widget --> |
194 | </div> | 177 | </div> |
195 | <!-- /span6 --> | 178 | <!-- /span6 --> |
196 | </div> | 179 | </div> |
197 | <!-- /row --> | 180 | <!-- /row --> |
198 | </div> | 181 | </div> |
199 | <!-- /container --> | 182 | <!-- /container --> |
200 | </div> | 183 | </div> |
201 | <!-- /main --> | 184 | <!-- /main --> |
202 | <div class="customConfirmPopBackdrop" id="confirm1" style="display: none;"> | 185 | <div class="customConfirmPopBackdrop" id="confirm1" style="display: none;"> |
203 | <div class="customModalInner"> | 186 | <div class="customModalInner"> |
204 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 187 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
205 | <table> | 188 | <table> |
206 | <tr> | 189 | <tr> |
207 | <td> | 190 | <td> |
208 | <img src="img/info.png" style="width: 50px;"> | 191 | <img src="img/info.png" style="width: 50px;"> |
209 | </td> | 192 | </td> |
210 | <td> | 193 | <td> |
211 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing to everyone in your contact list?</p> | 194 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing to everyone in your contact list?</p> |
212 | </td> | 195 | </td> |
213 | </tr> | 196 | </tr> |
214 | </table> | 197 | </table> |
215 | </div> | 198 | </div> |
216 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 199 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
217 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="saveAndCloseConfirm()">Yes</button> | 200 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="saveAndCloseConfirm()">Yes</button> |
218 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseConfirm()">Cancel</button> | 201 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseConfirm()">Cancel</button> |
219 | </div> | 202 | </div> |
220 | </div> | 203 | </div> |
221 | </div> | 204 | </div> |
222 | 205 |
app/partials/enterFuelOrder/enterFuelOrder.html
1 | <style type="text/css"> | 1 | <style type="text/css"> |
2 | .subnavbar .mainnav > li:nth-child(4) > a{ | 2 | .subnavbar .mainnav > li:nth-child(4) > a{ |
3 | color: #c44646; | 3 | color: #c44646; |
4 | } | 4 | } |
5 | .customInputWrap{ | 5 | .customInputWrap{ |
6 | margin-top: 15px; | 6 | margin-top: 15px; |
7 | } | 7 | } |
8 | .customInputWrap label{ | 8 | .customInputWrap label{ |
9 | font-weight: normal; | 9 | font-weight: normal; |
10 | margin-bottom: 0; | 10 | margin-bottom: 0; |
11 | } | 11 | } |
12 | </style> | 12 | </style> |
13 | <div class="myLoader" ng-show="showLoader"> | 13 | <div class="myLoader" ng-show="showLoader"> |
14 | <img src="../img/hourglass.gif" width="50px;"> | 14 | <img src="../img/hourglass.gif" width="50px;"> |
15 | </div> | 15 | </div> |
16 | 16 | ||
17 | <div class="container"> | 17 | <div class="container"> |
18 | <div class="row"> | 18 | <div class="row"> |
19 | <div class="col-xs-8"> | 19 | <div class="col-xs-8"> |
20 | <div class="widget stacked"> | 20 | <div class="widget stacked"> |
21 | <div class="widget-header"> | 21 | <div class="widget-header"> |
22 | <i class="fa fa-tasks" aria-hidden="true"></i> | 22 | <i class="fa fa-tasks" aria-hidden="true"></i> |
23 | <h3>Create Fuel Order</h3> | 23 | <h3>Create Fuel Order</h3> |
24 | </div> | 24 | </div> |
25 | <div class="widget-content new-widget-content"> | 25 | <div class="widget-content new-widget-content"> |
26 | <form name="orderform" novalidate> | 26 | <form name="orderform" novalidate> |
27 | 27 | ||
28 | <div class="customInputWrap"> | 28 | <div class="customInputWrap"> |
29 | <div class="col-xs-12"> | 29 | <div class="col-xs-12"> |
30 | 30 | ||
31 | <div class="col-md-6"> | 31 | <div class="col-md-6"> |
32 | <div class="pull-left" style="width: 110px;"> | 32 | <div class="pull-left" style="width: 110px;"> |
33 | <label class="new-input-label"><b>Company</b></label> | 33 | <label class="new-input-label"><b>Company</b></label> |
34 | </div> | 34 | </div> |
35 | <div class="pull-left" style="width: calc(100% - 110px);"> | 35 | <div class="pull-left" style="width: calc(100% - 110px);"> |
36 | <select class="form-control" ng-model="order.companyName" ng-change="getAircraft(order.companyName)" style="width: 100%;" required> | 36 | <select class="form-control" ng-model="order.companyName" ng-change="getAircraft(order.companyName)" style="width: 100%;" required> |
37 | <option value="" selected disabled>Select Company</option> | 37 | <option value="" selected disabled>Select Company</option> |
38 | <option ng-repeat="list in companyList">{{list.companyName}}</option> | 38 | <option ng-repeat="list in companyList">{{list.companyName}}</option> |
39 | </select> | 39 | </select> |
40 | </div> | 40 | </div> |
41 | <div class="clearfix"></div> | 41 | <div class="clearfix"></div> |
42 | </div> | 42 | </div> |
43 | <div class="col-md-6"> | 43 | <div class="col-md-6"> |
44 | <div class="pull-left" style="width: 110px;"> | 44 | <div class="pull-left" style="width: 110px;"> |
45 | <label class="new-input-label"><b>Product</b></label> | 45 | <label class="new-input-label"><b>Product</b></label> |
46 | </div> | 46 | </div> |
47 | <div class="pull-left" style="width: calc(100% - 110px);"> | 47 | <div class="pull-left" style="width: calc(100% - 110px);"> |
48 | <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote); addTotal(order.priceQuote, order.volume)" required> | 48 | <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote); addTotal(order.priceQuote, order.volume)" required> |
49 | <option value="" selected disabled>Select Product</option> | 49 | <option value="" selected disabled>Select Product</option> |
50 | <option ng-repeat="margin in marginList" value="{{margin}}">${{margin.papTotal | number : 4}} {{margin.productName}}</option> | 50 | <option ng-repeat="margin in marginList" value="{{margin}}">${{margin.papTotal | number : 4}} {{margin.productName}}</option> |
51 | </select> | 51 | </select> |
52 | </div> | 52 | </div> |
53 | <div class="clearfix"></div> | 53 | <div class="clearfix"></div> |
54 | </div> | 54 | </div> |
55 | 55 | ||
56 | </div> | 56 | </div> |
57 | <div class="clearfix"></div> | 57 | <div class="clearfix"></div> |
58 | <br/> | 58 | <br/> |
59 | 59 | ||
60 | 60 | ||
61 | <div class="col-xs-12"> | 61 | <div class="col-xs-12"> |
62 | 62 | ||
63 | <div class="col-md-6"> | 63 | <div class="col-md-6"> |
64 | <div class="pull-left" style="width: 110px;"> | 64 | <div class="pull-left" style="width: 110px;"> |
65 | <label class="new-input-label"><b>Aircraft</b></label> | 65 | <label class="new-input-label"><b>Aircraft</b></label> |
66 | </div> | 66 | </div> |
67 | <div class="pull-left" style="width: calc(100% - 110px);"> | 67 | <div class="pull-left" style="width: calc(100% - 110px);"> |
68 | <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required> | 68 | <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required> |
69 | <option selected disabled value="">Select Aircraft</option> | 69 | <option selected disabled value="">Select Aircraft</option> |
70 | <option ng-repeat="list in aircraftList">{{list.tail}}</option> | 70 | <option ng-repeat="list in aircraftList">{{list.tail}}</option> |
71 | </select> | 71 | </select> |
72 | </div> | 72 | </div> |
73 | <div class="clearfix"></div> | 73 | <div class="clearfix"></div> |
74 | </div> | 74 | </div> |
75 | <div class="col-md-6"> | 75 | <div class="col-md-6"> |
76 | <div class="pull-left" style="width: 110px;"> | 76 | <div class="pull-left" style="width: 110px;"> |
77 | <label class="new-input-label"><b>Make</b></label> | 77 | <label class="new-input-label"><b>Make</b></label> |
78 | </div> | 78 | </div> |
79 | <div class="pull-left" style="width: calc(100% - 110px);"> | 79 | <div class="pull-left" style="width: calc(100% - 110px);"> |
80 | <select class="form-control" ng-model="order.aircraftMake" disabled required> | 80 | <select class="form-control" ng-model="order.aircraftMake" disabled required> |
81 | <option selected disabled value="">Select Make</option> | 81 | <option selected disabled value="">Select Make</option> |
82 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> --> | 82 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> --> |
83 | <option ng-repeat="list in aircraftList">{{list.make}}</option> | 83 | <option ng-repeat="list in aircraftList">{{list.make}}</option> |
84 | </select> | 84 | </select> |
85 | </div> | 85 | </div> |
86 | <div class="clearfix"></div> | 86 | <div class="clearfix"></div> |
87 | </div> | 87 | </div> |
88 | 88 | ||
89 | </div> | 89 | </div> |
90 | <div class="clearfix"></div> | 90 | <div class="clearfix"></div> |
91 | <br/> | 91 | <br/> |
92 | 92 | ||
93 | <div class="col-xs-12"> | 93 | <div class="col-xs-12"> |
94 | 94 | ||
95 | <div class="col-md-6"> | 95 | <div class="col-md-6"> |
96 | <div class="pull-left" style="width: 110px;"> | 96 | <div class="pull-left" style="width: 110px;"> |
97 | <label class="new-input-label"><b>Model</b></label> | 97 | <label class="new-input-label"><b>Model</b></label> |
98 | </div> | 98 | </div> |
99 | <div class="pull-left" style="width: calc(100% - 110px);"> | 99 | <div class="pull-left" style="width: calc(100% - 110px);"> |
100 | <select class="form-control" ng-model="order.aircraftModel" disabled required> | 100 | <select class="form-control" ng-model="order.aircraftModel" disabled required> |
101 | <option selected disabled value="">Select Model</option> | 101 | <option selected disabled value="">Select Model</option> |
102 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> --> | 102 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> --> |
103 | <option ng-repeat="list in aircraftList">{{list.model}}</option> | 103 | <option ng-repeat="list in aircraftList">{{list.model}}</option> |
104 | </select> | 104 | </select> |
105 | </div> | 105 | </div> |
106 | <div class="clearfix"></div> | 106 | <div class="clearfix"></div> |
107 | </div> | 107 | </div> |
108 | <div class="col-md-6"> | 108 | <div class="col-md-6"> |
109 | <div class="pull-left" style="width: 110px;"> | 109 | <div class="pull-left" style="width: 110px;"> |
110 | <label class="new-input-label"><b>Volume</b></label> | 110 | <label class="new-input-label"><b>Volume</b></label> |
111 | </div> | 111 | </div> |
112 | <div class="pull-left" style="width: calc(100% - 110px);"> | 112 | <div class="pull-left" style="width: calc(100% - 110px);"> |
113 | <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.priceQuote, order.volume)" class="form-control" placeholder="" required> | 113 | <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.priceQuote, order.volume)" class="form-control" placeholder="" required> |
114 | </div> | 114 | </div> |
115 | <div class="clearfix"></div> | 115 | <div class="clearfix"></div> |
116 | </div> | 116 | </div> |
117 | 117 | ||
118 | </div> | 118 | </div> |
119 | <div class="clearfix"></div> | 119 | <div class="clearfix"></div> |
120 | <br/> | 120 | <br/> |
121 | 121 | ||
122 | <div class="col-xs-12"> | 122 | <div class="col-xs-12"> |
123 | 123 | ||
124 | <div class="col-md-6"> | 124 | <div class="col-md-6"> |
125 | <div class="pull-left" style="width: 110px;"> | 125 | <div class="pull-left" style="width: 110px;"> |
126 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> | 126 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> |
127 | </div> | 127 | </div> |
128 | <div class="pull-left" style="width: calc(100% - 110px);"> | 128 | <div class="pull-left" style="width: calc(100% - 110px);"> |
129 | <div style="width: 50%; float: left;"> | 129 | <div style="width: 50%; float: left;"> |
130 | Date | 130 | Date |
131 | <input type="text" style="width: 90%;" ng-model="order.upliftDate" class="form-control" placeholder="" datepicker required/> | 131 | <input type="text" style="width: 90%;" ng-model="order.upliftDate" class="form-control" placeholder="" datepicker required/> |
132 | </div> | 132 | </div> |
133 | <div style="width: 50%; float: left;"> | 133 | <div style="width: 50%; float: left;"> |
134 | Time | 134 | Time |
135 | <select class="form-control" ng-model="order.etaTime" style="width: 100%;" required> | 135 | <select class="form-control" ng-model="order.etaTime" style="width: 100%;" required> |
136 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> | 136 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> |
137 | </select> | 137 | </select> |
138 | 138 | ||
139 | </div> | 139 | </div> |
140 | </div> | 140 | </div> |
141 | <div class="clearfix"></div> | 141 | <div class="clearfix"></div> |
142 | </div> | 142 | </div> |
143 | 143 | ||
144 | <div class="col-md-6" style="margin-top: 22px;" ng-if ="order.status === 'invoiced'"> | 144 | <div class="col-md-6" style="margin-top: 22px;" ng-if ="order.status === 'invoiced'"> |
145 | <div class="pull-left" style="width: 110px;"> | 145 | <div class="pull-left" style="width: 110px;"> |
146 | <label class="new-input-label"><b>Invoiced</b></label> | 146 | <label class="new-input-label"><b>Invoiced</b></label> |
147 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 147 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
148 | </div> | 148 | </div> |
149 | <div class="pull-left" style="width: calc(100% - 110px);"> | 149 | <div class="pull-left" style="width: calc(100% - 110px);"> |
150 | <input type="text" ng-model="order.invoiced" class="form-control" placeholder=""> | 150 | <input type="text" ng-model="order.invoiced" class="form-control" placeholder=""> |
151 | </div> | 151 | </div> |
152 | <div class="clearfix"></div> | 152 | <div class="clearfix"></div> |
153 | </div> | 153 | </div> |
154 | </div> | 154 | </div> |
155 | <div class="clearfix"></div><br> | 155 | <div class="clearfix"></div><br> |
156 | 156 | ||
157 | 157 | ||
158 | <div class="col-xs-12"> | 158 | <div class="col-xs-12"> |
159 | 159 | ||
160 | <div class="col-md-6"> | 160 | <div class="col-md-6"> |
161 | <div class="pull-left" style="width: 110px;"> | 161 | <div class="pull-left" style="width: 110px;"> |
162 | <label class="new-input-label" style="margin-top: 25px;"><b>ETD</b></label> | 162 | <label class="new-input-label" style="margin-top: 25px;"><b>ETD</b></label> |
163 | </div> | 163 | </div> |
164 | <div class="pull-left" style="width: calc(100% - 110px);"> | 164 | <div class="pull-left" style="width: calc(100% - 110px);"> |
165 | <div style="width: 50%; float: left;"> | 165 | <div style="width: 50%; float: left;"> |
166 | Date | 166 | Date |
167 | <input type="text" style="width: 90%;" ng-model="order.departingDate" class="form-control" placeholder="" datepicker/> | 167 | <input type="text" style="width: 90%;" ng-model="order.departingDate" class="form-control" placeholder="" datepicker/> |
168 | </div> | 168 | </div> |
169 | <div style="width: 50%; float: left;"> | 169 | <div style="width: 50%; float: left;"> |
170 | Time | 170 | Time |
171 | <select class="form-control" ng-model="order.etdTime" style="width: 100%;"> | 171 | <select class="form-control" ng-model="order.etdTime" style="width: 100%;"> |
172 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> | 172 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> |
173 | </select> | 173 | </select> |
174 | </div> | 174 | </div> |
175 | </div> | 175 | </div> |
176 | <div class="clearfix"></div> | 176 | <div class="clearfix"></div> |
177 | </div> | 177 | </div> |
178 | 178 | ||
179 | <div class="col-md-6" style="margin-top: 22px;"> | 179 | <div class="col-md-6" style="margin-top: 22px;"> |
180 | <div class="pull-left" style="width: 110px;"> | 180 | <div class="pull-left" style="width: 110px;"> |
181 | <label class="new-input-label"><b>Total</b></label> | 181 | <label class="new-input-label"><b>Total</b></label> |
182 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 182 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
183 | </div> | 183 | </div> |
184 | <div class="pull-left" style="width: calc(100% - 110px);"> | 184 | <div class="pull-left" style="width: calc(100% - 110px);"> |
185 | <input type="text" class="form-control" disabled ng-model="order.total | number : 4" placeholder="" ng-value="{{order.volume * order.invoiced}}"> | 185 | <input type="text" class="form-control" disabled ng-model="order.total | number : 4" placeholder="" ng-value="{{order.volume * order.invoiced}}"> |
186 | </div> | 186 | </div> |
187 | </div> | 187 | </div> |
188 | </div> | 188 | </div> |
189 | <div class="clearfix"></div><br> | 189 | <div class="clearfix"></div><br> |
190 | 190 | ||
191 | 191 | ||
192 | <div class="col-xs-12"> | 192 | <div class="col-xs-12"> |
193 | 193 | ||
194 | <div class="col-md-6"> | 194 | <div class="col-md-6"> |
195 | <div class="pull-left" style="width: 110px;"> | 195 | <div class="pull-left" style="width: 110px;"> |
196 | <label class="new-input-label"><b>Fuel on</b></label> | 196 | <label class="new-input-label"><b>Fuel on</b></label> |
197 | </div> | 197 | </div> |
198 | <div class="pull-left" style="width: calc(100% - 110px);"> | 198 | <div class="pull-left" style="width: calc(100% - 110px);"> |
199 | <select class="form-control" ng-model="order.fuelOn" style="width: 100%;"> | 199 | <select class="form-control" ng-model="order.fuelOn" style="width: 100%;"> |
200 | <option value="" disabled selected hidden>Arrival</option> | 200 | <option value="" disabled selected hidden>Arrival</option> |
201 | <option value="Arrival">Arrival</option> | 201 | <option value="Arrival">Arrival</option> |
202 | <option value="Departure">Departure</option> | 202 | <option value="Departure">Departure</option> |
203 | </select> | 203 | </select> |
204 | </div> | 204 | </div> |
205 | <div class="clearfix"></div> | 205 | <div class="clearfix"></div> |
206 | </div> | 206 | </div> |
207 | 207 | ||
208 | <div class="col-md-6"> | 208 | <div class="col-md-6"> |
209 | <div class="pull-left" style="width: 110px;"> | 209 | <div class="pull-left" style="width: 110px;"> |
210 | <label class="new-input-label"><b>FBO Cost</b></label> | 210 | <label class="new-input-label"><b>FBO Cost</b></label> |
211 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 211 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
212 | </div> | 212 | </div> |
213 | <div class="pull-left" style="width: calc(100% - 110px);"> | 213 | <div class="pull-left" style="width: calc(100% - 110px);"> |
214 | <input type="text" disabled ng-model="order.fboCost" class="form-control" placeholder="0.0000" valid-number /> | 214 | <input type="text" disabled ng-model="order.fboCost" class="form-control" placeholder="0.0000" valid-number /> |
215 | </div> | 215 | </div> |
216 | <div class="clearfix"></div> | 216 | <div class="clearfix"></div> |
217 | </div> | 217 | </div> |
218 | </div> | 218 | </div> |
219 | <div class="clearfix"></div><br> | 219 | <div class="clearfix"></div><br> |
220 | 220 | ||
221 | <div class="col-xs-12"> | 221 | <div class="col-xs-12"> |
222 | <div class="col-md-6"> | 222 | <div class="col-md-6"> |
223 | <div class="pull-left" style="width: 110px;"> | 223 | <div class="pull-left" style="width: 110px;"> |
224 | <label class="new-input-label"><b>Source</b></label> | 224 | <label class="new-input-label"><b>Source</b></label> |
225 | </div> | 225 | </div> |
226 | <div class="pull-left" style="width: calc(100% - 110px);"> | 226 | <div class="pull-left" style="width: calc(100% - 110px);"> |
227 | <div style="font-weight: normal;" ng-if="baseTenant && !contractFuelVendor">Tenant/Base Customer</br></div> | 227 | <div style="font-weight: normal;" ng-if="baseTenant && !contractFuelVendor">Tenant/Base Customer</br></div> |
228 | <div style="font-weight: normal;" ng-if="contractFuelVendor && !baseTenant">CAA Member</div> | 228 | <div style="font-weight: normal;" ng-if="contractFuelVendor && !baseTenant">CAA Member</div> |
229 | <div style="font-weight: normal;" ng-if="contractFuelVendor && baseTenant">Tenant/CAA</div> | 229 | <div style="font-weight: normal;" ng-if="contractFuelVendor && baseTenant">Tenant/CAA</div> |
230 | <!-- <select class="form-control" ng-model="order.source" style="width: 100%;"> | ||
231 | <option value="" disabled selected hidden>Select Source</option> | ||
232 | <option value="Tenant">Tenant</option> | ||
233 | <option value="CAA">CAA</option> | ||
234 | <option value="Tenant/CAA">Tenant/CAA</option> | ||
235 | </select> --> | ||
236 | </div> | 230 | </div> |
237 | <div class="clearfix"></div> | 231 | <div class="clearfix"></div> |
238 | </div> | 232 | </div> |
239 | </div> | 233 | </div> |
240 | <div class="clearfix"></div> | 234 | <div class="clearfix"></div> |
241 | <br/> | 235 | <br/> |
242 | <div class="col-xs-12"> | 236 | <div class="col-xs-12"> |
243 | 237 | ||
244 | 238 | ||
245 | <div class="col-md-6"> | 239 | <div class="col-md-6"> |
246 | <div class="pull-left" style="width: 110px;"> | 240 | <div class="pull-left" style="width: 110px;"> |
247 | <label class="new-input-label"><b>Certificate Type</b></label> | 241 | <label class="new-input-label"><b>Certificate Type</b></label> |
248 | </div> | 242 | </div> |
249 | <div class="pull-left" style="width: calc(100% - 110px);"> | 243 | <div class="pull-left" style="width: calc(100% - 110px);"> |
250 | <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;"> | 244 | <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;"> |
251 | <option value="" disabled selected hidden>Select...</option> | 245 | <option value="" disabled selected hidden>Select...</option> |
252 | <option value="corporate">Part 91 (Corporate)</option> | 246 | <option value="corporate">Part 91 (Corporate)</option> |
253 | <option value="charter">Part 135 (Charter)</option> | 247 | <option value="charter">Part 135 (Charter)</option> |
254 | <option value="scheduled">Part 121 (Scheduled)</option> | 248 | <option value="scheduled">Part 121 (Scheduled)</option> |
255 | <option value="military">Military</option> | 249 | <option value="military">Military</option> |
256 | <option value="government">Government</option> | 250 | <option value="government">Government</option> |
257 | </select> | 251 | </select> |
258 | </div> | 252 | </div> |
259 | <div class="clearfix"></div> | 253 | <div class="clearfix"></div> |
260 | </div> | 254 | </div> |
261 | <div class="col-md-6"> | 255 | <div class="col-md-6"> |
262 | <div class="pull-left" style="width: 110px;"> | 256 | <div class="pull-left" style="width: 110px;"> |
263 | <label class="new-input-label"><b>Status</b></label> | 257 | <label class="new-input-label"><b>Status</b></label> |
264 | </div> | 258 | </div> |
265 | <div class="pull-left" style="width: calc(100% - 110px);"> | 259 | <div class="pull-left" style="width: calc(100% - 110px);"> |
266 | <select class="form-control" ng-model="order.status" style="width: 100%;"> | 260 | <select class="form-control" ng-model="order.status" style="width: 100%;"> |
267 | <option value="" selected disabled hidden>pending</option> | 261 | <option value="" selected disabled hidden>pending</option> |
268 | <option value="pending">pending</option> | 262 | <option value="pending">pending</option> |
269 | <option value="invoiced">invoiced</option> | 263 | <option value="invoiced">invoiced</option> |
270 | <option value="paid">paid</option> | 264 | <option value="paid">paid</option> |
271 | <!-- <option value="cancelled">cancelled</option> | 265 | <!-- <option value="cancelled">cancelled</option> |
272 | <option value="archived">archived</option> --> | 266 | <option value="archived">archived</option> --> |
273 | </select> | 267 | </select> |
274 | </div> | 268 | </div> |
275 | <div class="clearfix"></div> | 269 | <div class="clearfix"></div> |
276 | </div> | 270 | </div> |
277 | </div> | 271 | </div> |
278 | <div class="clearfix"></div><br> | 272 | <div class="clearfix"></div><br> |
279 | 273 | ||
280 | <div class="customInputWrap text-right"> | 274 | <div class="customInputWrap text-right"> |
281 | <div class="col-xs-12"> | 275 | <div class="col-xs-12"> |
282 | <input type="cancel" value="Cancel" ng-click="cancelOrder()" class="btn btn-default" style="margin-right: 15px; width: 100px;"> | 276 | <input type="cancel" value="Cancel" ng-click="cancelOrder()" class="btn btn-default" style="margin-right: 15px; width: 100px;"> |
283 | <input type="submit" value="save" ng-click="dispatchFuel()" class="btn btn-primary" ng-disabled="orderform.$invalid"> | 277 | <input type="submit" value="save" ng-click="dispatchFuel()" class="btn btn-primary" ng-disabled="orderform.$invalid"> |
284 | </div> | 278 | </div> |
285 | <div class="clearfix"></div> | 279 | <div class="clearfix"></div> |
286 | </div> | 280 | </div> |
287 | 281 | ||
288 | </form> | 282 | </form> |
289 | </div> | 283 | </div> |
290 | </div> | 284 | </div> |
291 | </div> | 285 | </div> |
292 | </div> | 286 | </div> |
293 | </div> | 287 | </div> |
294 | 288 |
app/partials/fuelManager/fuelManager.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | 5 | ||
6 | //.controller('fuelManagerController', ['$scope', 'fuelManagerService',function($scope, fuelManagerService) { | 6 | //.controller('fuelManagerController', ['$scope', 'fuelManagerService',function($scope, fuelManagerService) { |
7 | .controller('fuelManagerController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'fuelManagerService', fuelManagerController]); | 7 | .controller('fuelManagerController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'fuelManagerService', fuelManagerController]); |
8 | 8 | ||
9 | function fuelManagerController($scope, $rootScope, $uibModal, $filter, $http, fuelManagerService) { | 9 | function fuelManagerController($scope, $rootScope, $uibModal, $filter, $http, fuelManagerService) { |
10 | 10 | ||
11 | var todayDate = new Date(); | 11 | var todayDate = new Date(); |
12 | var ddn = todayDate.getDate(); | 12 | var ddn = todayDate.getDate(); |
13 | var mmn = todayDate.getMonth()+1; //January is 0! | 13 | var mmn = todayDate.getMonth()+1; //January is 0! |
14 | var yyyyn = todayDate.getFullYear(); | 14 | var yyyyn = todayDate.getFullYear(); |
15 | 15 | ||
16 | if(ddn | 16 | if(ddn < 10 ) { |
17 | <10) { | ||
18 | ddn ='0'+ddn | 17 | ddn ='0'+ddn |
19 | } | 18 | } |
20 | 19 | ||
21 | if(mmn | 20 | if(mmn < 10) { |
22 | <10) { | ||
23 | mmn ='0'+mmn | 21 | mmn ='0'+mmn |
24 | } | 22 | } |
25 | 23 | ||
26 | $scope.todayDateNew = mmn+'/'+ddn+'/'+yyyyn; | 24 | $scope.todayDateNew = mmn+'/'+ddn+'/'+yyyyn; |
27 | $scope.currentUserName = JSON.parse(window.localStorage.getItem("currentUserName")); | 25 | $scope.currentUserName = JSON.parse(window.localStorage.getItem("currentUserName")); |
28 | 26 | ||
29 | $scope.currentUserData = JSON.parse(localStorage.getItem('userProfileId')); | 27 | $scope.currentUserData = JSON.parse(localStorage.getItem('userProfileId')); |
30 | $scope.showLoader = true; | 28 | $scope.showLoader = true; |
31 | 29 | ||
32 | function getFulllistFunction(){ | 30 | function getFulllistFunction(){ |
33 | fuelManagerService.getFullList().then(function(result) { | 31 | fuelManagerService.getFullList().then(function(result) { |
34 | $scope.fullJetList = result; | 32 | $scope.fullJetList = result; |
35 | // console.log('$scope.fullJetList', $scope.fullJetList); | 33 | // console.log('$scope.fullJetList', $scope.fullJetList); |
36 | for (var i = 0; i<$scope.fullJetList.length; i++) { | 34 | for (var i = 0; i<$scope.fullJetList.length; i++) { |
37 | for (var j = 0; j<$scope.fullJetList[i].aircraftsSize.length; j++) { | 35 | for (var j = 0; j<$scope.fullJetList[i].aircraftsSize.length; j++) { |
38 | if ($scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance != null) { | 36 | if ($scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance != null) { |
39 | result[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees=parseFloat(result[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees).toFixed(2); | 37 | result[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees=parseFloat(result[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees).toFixed(2); |
40 | // console.log("kd",result[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees) | 38 | // console.log("kd",result[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees) |
41 | 39 | ||
42 | if ($scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate != null && $scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate != '') { | 40 | if ($scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate != null && $scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate != '') { |
43 | var newTime = new Date($scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate); | 41 | var newTime = new Date($scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate); |
44 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 42 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
45 | var dday = newTime.getUTCDate(); | 43 | var dday = newTime.getUTCDate(); |
46 | var dyear = newTime.getUTCFullYear(); | 44 | var dyear = newTime.getUTCFullYear(); |
47 | $scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = dmonth+'/'+dday+'/'+dyear; | 45 | $scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = dmonth+'/'+dday+'/'+dyear; |
48 | // console.log('$scope.fullJetList.aircraftsSize.rampFeesAndAvoidance.expirationDate', $scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate); | 46 | // console.log('$scope.fullJetList.aircraftsSize.rampFeesAndAvoidance.expirationDate', $scope.fullJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate); |
49 | } | 47 | } |
50 | } | 48 | } |
51 | 49 | ||
52 | } | 50 | } |
53 | } | 51 | } |
54 | $scope.showLoader = false; | 52 | $scope.showLoader = false; |
55 | }) | 53 | }) |
56 | 54 | ||
57 | } | 55 | } |
58 | getFulllistFunction(); | 56 | getFulllistFunction(); |
59 | 57 | ||
60 | 58 | ||
61 | $scope.avoidanceList = {}; | 59 | $scope.avoidanceList = {}; |
62 | 60 | ||
63 | $scope.updateList = function(fullJetList){ | 61 | $scope.updateList = function(fullJetList){ |
64 | $scope.showLoader = true; | 62 | $scope.showLoader = true; |
65 | $scope.addData = []; | 63 | $scope.addData = []; |
66 | $scope.newJetList = fullJetList; | 64 | $scope.newJetList = fullJetList; |
67 | if ($scope.currentUserData != undefined || $scope.currentUserData != null) { | 65 | if ($scope.currentUserData != undefined || $scope.currentUserData != null) { |
68 | for(var i=0; i<$scope.newJetList.length;i++){ | 66 | for(var i=0; i<$scope.newJetList.length;i++){ |
69 | for(var j = 0; j < $scope.newJetList[i].aircraftsSize.length; j++){ | 67 | for(var j = 0; j < $scope.newJetList[i].aircraftsSize.length; j++){ |
70 | if($scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance != null){ | 68 | if($scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance != null){ |
71 | if ($scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate != null) { | 69 | if ($scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate != null) { |
72 | var currentDate = new Date(); | 70 | var currentDate = new Date(); |
73 | var hours = currentDate.getHours(); | 71 | var hours = currentDate.getHours(); |
74 | var min = currentDate.getMinutes(); | 72 | var min = currentDate.getMinutes(); |
75 | var sec = currentDate.getSeconds(); | 73 | var sec = currentDate.getSeconds(); |
76 | $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate + ' ' + hours + ':' + min + ':' + sec; | 74 | $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate + ' ' + hours + ':' + min + ':' + sec; |
77 | $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = new Date($scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate); | 75 | $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = new Date($scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate); |
78 | $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate.getTime(); | 76 | $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate = $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate.getTime(); |
79 | } | 77 | } |
80 | $scope.addData.push({ | 78 | $scope.addData.push({ |
81 | //'aircraftType': $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.aircraftType, | 79 | //'aircraftType': $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.aircraftType, |
82 | 'id': $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.id, | 80 | 'id': $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.id, |
83 | 'aircraftSizeId': $scope.newJetList[i].aircraftsSize[j].id, | 81 | 'aircraftSizeId': $scope.newJetList[i].aircraftsSize[j].id, |
84 | 'rampFees': $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees, | 82 | 'rampFees': $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.rampFees, |
85 | 'avoidance' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.avoidance, | 83 | 'avoidance' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.avoidance, |
86 | 'applicable' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.applicable, | 84 | 'applicable' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.applicable, |
87 | 'expirationDate' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate, | 85 | 'expirationDate' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.expirationDate, |
88 | 'notes' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.notes, | 86 | 'notes' : $scope.newJetList[i].aircraftsSize[j].rampFeesAndAvoidance.notes, |
89 | 'reportedBy': $scope.currentUserName | 87 | 'reportedBy': $scope.currentUserName |
90 | }); | 88 | }); |
91 | } | 89 | } |
92 | } | 90 | } |
93 | } | 91 | } |
94 | $scope.avoidanceList.rampFeesAndAvoidanceList = $scope.addData; | 92 | $scope.avoidanceList.rampFeesAndAvoidanceList = $scope.addData; |
95 | $scope.avoidanceList.fboUserId = $scope.currentUserData; | 93 | $scope.avoidanceList.fboUserId = $scope.currentUserData; |
96 | 94 | ||
97 | fuelManagerService.updateFullList($scope.avoidanceList).then(function(result) { | 95 | fuelManagerService.updateFullList($scope.avoidanceList).then(function(result) { |
98 | // console.log("list",$scope.avoidanceList) | 96 | // console.log("list",$scope.avoidanceList) |
99 | // console.log("result",result) | 97 | // console.log("result",result) |
100 | toastr.success(''+result.success+'', { | 98 | toastr.success(''+result.success+'', { |
101 | closeButton: true | 99 | closeButton: true |
102 | }) | 100 | }) |
103 | 101 | ||
104 | getFulllistFunction(); | 102 | getFulllistFunction(); |
105 | 103 | ||
106 | }) | 104 | }) |
107 | 105 | ||
108 | } | 106 | } |
109 | 107 | ||
110 | } | 108 | } |
111 | 109 | ||
112 | $scope.dropOptions = {}; | 110 | $scope.dropOptions = {}; |
113 | 111 | ||
114 | fuelManagerService.getOptions().then(function(result) { | 112 | fuelManagerService.getOptions().then(function(result) { |
115 | $scope.dropOptions = result; | 113 | $scope.dropOptions = result; |
116 | // console.log('$scope.dropOptions', $scope.dropOptions); | 114 | // console.log('$scope.dropOptions', $scope.dropOptions); |
117 | }) | 115 | }) |
118 | 116 | ||
119 | fuelManagerService.getAircrafts().then(function(result) { | 117 | fuelManagerService.getAircrafts().then(function(result) { |
120 | $scope.aircrafts = result; | 118 | $scope.aircrafts = result; |
121 | }) | 119 | }) |
122 | 120 | ||
123 | $scope.customRampData = {}; | 121 | $scope.customRampData = {}; |
124 | $scope.customRampDataCraft = {}; | 122 | $scope.customRampDataCraft = {}; |
125 | $scope.customRampDataCraft.aircraftType = ''; | 123 | $scope.customRampDataCraft.aircraftType = ''; |
126 | $scope.customRampDataCraft.aircraftSizeId = ''; | 124 | $scope.customRampDataCraft.aircraftSizeId = ''; |
127 | 125 | ||
128 | $scope.openRampFeeModal = false; | 126 | $scope.openRampFeeModal = false; |
129 | $scope.showWeightForm = false; | 127 | $scope.showWeightForm = false; |
130 | $scope.showMakeModelForm = false; | 128 | $scope.showMakeModelForm = false; |
131 | $scope.showWingspanForm = false; | 129 | $scope.showWingspanForm = false; |
132 | $scope.showTailForm = false; | 130 | $scope.showTailForm = false; |
133 | 131 | ||
134 | $scope.customRampData = {}; | 132 | $scope.customRampData = {}; |
135 | $scope.customMakeData = {}; | 133 | $scope.customMakeData = {}; |
136 | $scope.customWingspanData = {}; | 134 | $scope.customWingspanData = {}; |
137 | $scope.customTailData = {}; | 135 | $scope.customTailData = {}; |
138 | 136 | ||
139 | $scope.openRampModal = function(){ | 137 | $scope.openRampModal = function(){ |
140 | $scope.showLoader = true; | 138 | $scope.showLoader = true; |
141 | $scope.openRampFeeModal = true; | 139 | $scope.openRampFeeModal = true; |
142 | if ($scope.customRampDataCraft.aircraftType != null) { | 140 | if ($scope.customRampDataCraft.aircraftType != null) { |
143 | for (var i = 0; i < $scope.dropOptions.length; i++) { | 141 | for (var i = 0; i < $scope.dropOptions.length; i++) { |
144 | if ($scope.customRampDataCraft.aircraftType === $scope.dropOptions[i].size) { | 142 | if ($scope.customRampDataCraft.aircraftType === $scope.dropOptions[i].size) { |
145 | $scope.customRampDataCraft.aircraftSizeId = $scope.dropOptions[i].id; | 143 | $scope.customRampDataCraft.aircraftSizeId = $scope.dropOptions[i].id; |
146 | } | 144 | } |
147 | } | 145 | } |
148 | $scope.OldRampData = {}; | 146 | $scope.OldRampData = {}; |
149 | fuelManagerService.getRampFeeDetail($scope.customRampDataCraft.aircraftSizeId).then(function(result) { | 147 | fuelManagerService.getRampFeeDetail($scope.customRampDataCraft.aircraftSizeId).then(function(result) { |
150 | $scope.OldRampData = result; | 148 | $scope.OldRampData = result; |
151 | if ($scope.customRampDataCraft.aircraftType === 'WEIGHT') { | 149 | if ($scope.customRampDataCraft.aircraftType === 'WEIGHT') { |
152 | $scope.showWeightForm = true; | 150 | $scope.showWeightForm = true; |
153 | $scope.showMakeModelForm = false; | 151 | $scope.showMakeModelForm = false; |
154 | $scope.showWingspanForm = false; | 152 | $scope.showWingspanForm = false; |
155 | $scope.showTailForm = false; | 153 | $scope.showTailForm = false; |
156 | $scope.customRampData = $scope.OldRampData; | 154 | $scope.customRampData = $scope.OldRampData; |
157 | }else if ($scope.customRampDataCraft.aircraftType === 'MAKE_AND_MODEL') { | 155 | }else if ($scope.customRampDataCraft.aircraftType === 'MAKE_AND_MODEL') { |
158 | $scope.showWeightForm = false; | 156 | $scope.showWeightForm = false; |
159 | $scope.showMakeModelForm = true; | 157 | $scope.showMakeModelForm = true; |
160 | $scope.showWingspanForm = false; | 158 | $scope.showWingspanForm = false; |
161 | $scope.showTailForm = false; | 159 | $scope.showTailForm = false; |
162 | $scope.customMakeData = $scope.OldRampData; | 160 | $scope.customMakeData = $scope.OldRampData; |
163 | // console.log('$scope.customMakeData', $scope.customMakeData); | 161 | // console.log('$scope.customMakeData', $scope.customMakeData); |
164 | }else if ($scope.customRampDataCraft.aircraftType === 'WINGSPAN') { | 162 | }else if ($scope.customRampDataCraft.aircraftType === 'WINGSPAN') { |
165 | $scope.showWeightForm = false; | 163 | $scope.showWeightForm = false; |
166 | $scope.showMakeModelForm = false; | 164 | $scope.showMakeModelForm = false; |
167 | $scope.showWingspanForm = true; | 165 | $scope.showWingspanForm = true; |
168 | $scope.showTailForm = false; | 166 | $scope.showTailForm = false; |
169 | $scope.customWingspanData = $scope.OldRampData; | 167 | $scope.customWingspanData = $scope.OldRampData; |
170 | }else if ($scope.customRampDataCraft.aircraftType === 'TAIL') { | 168 | }else if ($scope.customRampDataCraft.aircraftType === 'TAIL') { |
171 | $scope.showWeightForm = false; | 169 | $scope.showWeightForm = false; |
172 | $scope.showMakeModelForm = false; | 170 | $scope.showMakeModelForm = false; |
173 | $scope.showWingspanForm = false; | 171 | $scope.showWingspanForm = false; |
174 | $scope.showTailForm = true; | 172 | $scope.showTailForm = true; |
175 | $scope.customTailData = $scope.OldRampData; | 173 | $scope.customTailData = $scope.OldRampData; |
176 | }else{ | 174 | }else{ |
177 | $scope.openRampFeeModal = false; | 175 | $scope.openRampFeeModal = false; |
178 | $scope.showWeightForm = false; | 176 | $scope.showWeightForm = false; |
179 | $scope.showMakeModelForm = false; | 177 | $scope.showMakeModelForm = false; |
180 | $scope.showWingspanForm = false; | 178 | $scope.showWingspanForm = false; |
181 | $scope.showTailForm = false; | 179 | $scope.showTailForm = false; |
182 | } | 180 | } |
183 | $scope.showLoader = false; | 181 | $scope.showLoader = false; |
184 | }) | 182 | }) |
185 | }else{ | 183 | }else{ |
186 | $scope.openRampFeeModal = false; | 184 | $scope.openRampFeeModal = false; |
187 | } | 185 | } |
188 | } | 186 | } |
189 | 187 | ||
190 | /*validate number input type to 2 digit auto complete zero's*/ | 188 | /*validate number input type to 2 digit auto complete zero's*/ |
191 | 189 | ||
192 | $scope.force2decimals= function(data) { | 190 | $scope.force2decimals= function(data) { |
193 | console.log("check") | 191 | console.log("check") |
194 | event.target.value = parseFloat(event.target.value).toFixed(2); | 192 | event.target.value = parseFloat(event.target.value).toFixed(2); |
195 | } | 193 | } |
196 | 194 | ||
197 | 195 | ||
198 | $scope.addCustomRampNew = function(data){ | 196 | $scope.addCustomRampNew = function(data){ |
199 | $scope.showLoader = true; | 197 | $scope.showLoader = true; |
200 | $scope.newCustomRampData = data; | 198 | $scope.newCustomRampData = data; |
201 | $scope.newRampData = []; | 199 | $scope.newRampData = []; |
202 | if ($scope.newCustomRampData != null) { | 200 | if ($scope.newCustomRampData != null) { |
203 | if ($scope.newCustomRampData.id != null) { | 201 | if ($scope.newCustomRampData.id != null) { |
204 | $scope.newRampData.push({'id': $scope.newCustomRampData.id}); | 202 | $scope.newRampData.push({'id': $scope.newCustomRampData.id}); |
205 | } | 203 | } |
206 | $scope.newRampData.push({ | 204 | $scope.newRampData.push({ |
207 | 'aircraftSizeId': $scope.customRampDataCraft.aircraftSizeId, | 205 | 'aircraftSizeId': $scope.customRampDataCraft.aircraftSizeId, |
208 | 'rampFees': $scope.newCustomRampData.rampFees, | 206 | 'rampFees': $scope.newCustomRampData.rampFees, |
209 | 'avoidance': $scope.newCustomRampData.avoidance, | 207 | 'avoidance': $scope.newCustomRampData.avoidance, |
210 | 'applicable': $scope.newCustomRampData.applicable, | 208 | 'applicable': $scope.newCustomRampData.applicable, |
211 | 'expirationDate': $scope.newCustomRampData.expirationDate, | 209 | 'expirationDate': $scope.newCustomRampData.expirationDate, |
212 | 'notes': $scope.newCustomRampData.notes, | 210 | 'notes': $scope.newCustomRampData.notes, |
213 | 'aircraftMake': $scope.newCustomRampData.aircraftMake, | 211 | 'aircraftMake': $scope.newCustomRampData.aircraftMake, |
214 | 'wingspanMin': $scope.newCustomRampData.wingspanMin, | 212 | 'wingspanMin': $scope.newCustomRampData.wingspanMin, |
215 | 'wingspanMax': $scope.newCustomRampData.wingspanMax, | 213 | 'wingspanMax': $scope.newCustomRampData.wingspanMax, |
216 | 'weightRangeMin': $scope.newCustomRampData.weightRangeMin, | 214 | 'weightRangeMin': $scope.newCustomRampData.weightRangeMin, |
217 | 'weightRangeMax': $scope.newCustomRampData.weightRangeMax, | 215 | 'weightRangeMax': $scope.newCustomRampData.weightRangeMax, |
218 | 'tailNumber': $scope.newCustomRampData.tailNumber, | 216 | 'tailNumber': $scope.newCustomRampData.tailNumber, |
219 | }); | 217 | }); |
220 | } | 218 | } |
221 | 219 | ||
222 | $scope.avoidanceList.rampFeesAndAvoidanceList = $scope.newRampData; | 220 | $scope.avoidanceList.rampFeesAndAvoidanceList = $scope.newRampData; |
223 | $scope.avoidanceList.fboUserId = $scope.currentUserData; | 221 | $scope.avoidanceList.fboUserId = $scope.currentUserData; |
224 | //console.log('$scope.newRampData', $scope.avoidanceList); | 222 | //console.log('$scope.newRampData', $scope.avoidanceList); |
225 | fuelManagerService.updateFullList($scope.avoidanceList).then(function(result) { | 223 | fuelManagerService.updateFullList($scope.avoidanceList).then(function(result) { |
226 | toastr.success(''+result.success+'', { | 224 | toastr.success(''+result.success+'', { |
227 | closeButton: true | 225 | closeButton: true |
228 | }) | 226 | }) |
229 | $scope.openRampFeeModal = false; | 227 | $scope.openRampFeeModal = false; |
230 | 228 | ||
231 | getFulllistFunction(); | 229 | getFulllistFunction(); |
232 | }) | 230 | }) |
233 | } | 231 | } |
234 | 232 | ||
235 | $scope.deleteTemplateId = ''; | 233 | $scope.deleteTemplateId = ''; |
236 | 234 | ||
237 | $scope.deleteCustomJet = function(id){ | 235 | $scope.deleteCustomJet = function(id){ |
238 | $('#confirm1').css('display', 'block'); | 236 | $('#confirm1').css('display', 'block'); |
239 | $scope.deleteTemplateId = id; | 237 | $scope.deleteTemplateId = id; |
240 | // console.log('$scope.deleteTemplateId', id); | 238 | // console.log('$scope.deleteTemplateId', id); |
241 | } | 239 | } |
242 | 240 | ||
243 | $scope.saveAndCloseConfirm = function(){ | 241 | $scope.saveAndCloseConfirm = function(){ |
244 | $scope.showLoader = true; | 242 | $scope.showLoader = true; |
245 | $('#confirm1').css('display', 'none'); | 243 | $('#confirm1').css('display', 'none'); |
246 | fuelManagerService.deleteCustomRamp($scope.deleteTemplateId).then(function(result) { | 244 | fuelManagerService.deleteCustomRamp($scope.deleteTemplateId).then(function(result) { |
247 | 245 | ||
248 | getFulllistFunction(); | 246 | getFulllistFunction(); |
249 | }) | 247 | }) |
250 | } | 248 | } |
251 | 249 | ||
252 | $scope.cancelAndCloseConfirm = function(){ | 250 | $scope.cancelAndCloseConfirm = function(){ |
253 | $('#confirm1').css('display', 'none'); | 251 | $('#confirm1').css('display', 'none'); |
254 | $scope.deleteTemplateId = ''; | 252 | $scope.deleteTemplateId = ''; |
255 | } | 253 | } |
256 | 254 | ||
257 | $scope.closeRampFeeModel = function(){ | 255 | $scope.closeRampFeeModel = function(){ |
258 | $scope.openRampFeeModal = false; | 256 | $scope.openRampFeeModal = false; |
259 | $scope.showWeight = false; | 257 | $scope.showWeight = false; |
260 | $scope.showWingspan = false; | 258 | $scope.showWingspan = false; |
261 | $scope.showTail = false; | 259 | $scope.showTail = false; |
262 | $scope.showAircraft = false; | 260 | $scope.showAircraft = false; |
263 | $scope.customRampData.rampFeesAndAvoidanceList = {}; | 261 | $scope.customRampData.rampFeesAndAvoidanceList = {}; |
264 | $scope.customRampDataCraft.aircraftType = null; | 262 | $scope.customRampDataCraft.aircraftType = null; |
265 | } | 263 | } |
266 | 264 | ||
267 | $scope.parentOpen = function(index){ | 265 | $scope.parentOpen = function(index){ |
268 | $('#parentOpen'+index).css('display', 'none'); | 266 | $('#parentOpen'+index).css('display', 'none'); |
269 | $('#parentClose'+index).css('display', 'initial'); | 267 | $('#parentClose'+index).css('display', 'initial'); |
270 | $('#parentTogglebody'+index).slideDown(); | 268 | $('#parentTogglebody'+index).slideDown(); |
271 | } | 269 | } |
272 | $scope.parentClose = function(index){ | 270 | $scope.parentClose = function(index){ |
273 | $('#parentOpen'+index).css('display', 'initial'); | 271 | $('#parentOpen'+index).css('display', 'initial'); |
274 | $('#parentClose'+index).css('display', 'none'); | 272 | $('#parentClose'+index).css('display', 'none'); |
275 | $('#parentTogglebody'+index).slideUp(); | 273 | $('#parentTogglebody'+index).slideUp(); |
276 | } | 274 | } |
277 | 275 | ||
278 | $scope.toggleChild = function(id){ | 276 | $scope.toggleChild = function(id){ |
279 | if ($('.'+id).hasClass('fa-plus-circle')) { | 277 | if ($('.'+id).hasClass('fa-plus-circle')) { |
280 | $('.'+id).removeClass('fa-plus-circle'); | 278 | $('.'+id).removeClass('fa-plus-circle'); |
281 | $('.'+id).addClass('fa-minus-circle'); | 279 | $('.'+id).addClass('fa-minus-circle'); |
282 | }else{ | 280 | }else{ |
283 | $('.'+id).removeClass('fa-minus-circle'); | 281 | $('.'+id).removeClass('fa-minus-circle'); |
284 | $('.'+id).addClass('fa-plus-circle'); | 282 | $('.'+id).addClass('fa-plus-circle'); |
285 | } | 283 | } |
286 | $('#'+id).slideToggle(); | 284 | $('#'+id).slideToggle(); |
287 | } | 285 | } |
288 | 286 | ||
289 | $scope.dates = [{date:'01-05-2001'}, {date:'05-05-2014'}, {date:'10-11-2008'}] | 287 | $scope.dates = [{date:'01-05-2001'}, {date:'05-05-2014'}, {date:'10-11-2008'}] |
290 | 288 | ||
291 | $scope.open = function($event, dt) { | 289 | $scope.open = function($event, dt) { |
292 | $event.preventDefault(); | 290 | $event.preventDefault(); |
293 | $event.stopPropagation(); | 291 | $event.stopPropagation(); |
294 | 292 | ||
295 | dt.opened = true; | 293 | dt.opened = true; |
296 | }; | 294 | }; |
297 | 295 | ||
298 | $scope.dateOptions = { | 296 | $scope.dateOptions = { |
299 | formatYear: 'yy', | 297 | formatYear: 'yy', |
300 | startingDay: 1 | 298 | startingDay: 1 |
301 | }; | 299 | }; |
302 | 300 | ||
303 | 301 | ||
304 | $scope.format = 'dd-MMMM-yyyy' | 302 | $scope.format = 'dd-MMMM-yyyy' |
305 | 303 | ||
306 | 304 | ||
307 | $(document).ready(function(){ | 305 | $(document).ready(function(){ |
308 | 306 | ||
309 | setInterval(function(){ | 307 | setInterval(function(){ |
310 | var newHeight = $('.feeManagerLeft').height(); | 308 | var newHeight = $('.feeManagerLeft').height(); |
311 | $('.feeManagerRight').css('height', newHeight); | 309 | $('.feeManagerRight').css('height', newHeight); |
312 | }, 3); | 310 | }, 3); |
313 | 311 | ||
314 | $('#customTabToggle1').click(function(){ | 312 | $('#customTabToggle1').click(function(){ |
315 | //console.log('tab 1'); | 313 | //console.log('tab 1'); |
316 | $('#customTabsBody1').slideDown(); | 314 | $('#customTabsBody1').slideDown(); |
317 | $('#customTabsBody2').slideUp(); | 315 | $('#customTabsBody2').slideUp(); |
318 | $('#customTabsBody3').slideUp(); | 316 | $('#customTabsBody3').slideUp(); |
319 | $('#customTabsBody4').slideUp(); | 317 | $('#customTabsBody4').slideUp(); |
320 | $('#customTabs1').addClass('customActive'); | 318 | $('#customTabs1').addClass('customActive'); |
321 | $('#customTabs2').removeClass('customActive'); | 319 | $('#customTabs2').removeClass('customActive'); |
322 | $('#customTabs3').removeClass('customActive'); | 320 | $('#customTabs3').removeClass('customActive'); |
323 | $('#customTabs4').removeClass('customActive'); | 321 | $('#customTabs4').removeClass('customActive'); |
324 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); | 322 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); |
325 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); | 323 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); |
326 | 324 | ||
327 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'none'); | 325 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'none'); |
328 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'inline-block'); | 326 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'inline-block'); |
329 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'inline-block'); | 327 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'inline-block'); |
330 | 328 | ||
331 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'inline-block'); | 329 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'inline-block'); |
332 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'none'); | 330 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'none'); |
333 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'none'); | 331 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'none'); |
334 | 332 | ||
335 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'inline-block'); | 333 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'inline-block'); |
336 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'none'); | 334 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'none'); |
337 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'none'); | 335 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'none'); |
338 | 336 | ||
339 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'inline-block'); | 337 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'inline-block'); |
340 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'none'); | 338 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'none'); |
341 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'none'); | 339 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'none'); |
342 | 340 | ||
343 | }) | 341 | }) |
344 | $('#customTabToggle2').click(function(){ | 342 | $('#customTabToggle2').click(function(){ |
345 | // console.log('tab 2'); | 343 | // console.log('tab 2'); |
346 | $('#customTabsBody1').slideUp(); | 344 | $('#customTabsBody1').slideUp(); |
347 | $('#customTabsBody2').slideDown(); | 345 | $('#customTabsBody2').slideDown(); |
348 | $('#customTabsBody3').slideUp(); | 346 | $('#customTabsBody3').slideUp(); |
349 | $('#customTabsBody4').slideUp(); | 347 | $('#customTabsBody4').slideUp(); |
350 | $('#customTabs1').removeClass('customActive'); | 348 | $('#customTabs1').removeClass('customActive'); |
351 | $('#customTabs2').addClass('customActive'); | 349 | $('#customTabs2').addClass('customActive'); |
352 | $('#customTabs3').removeClass('customActive'); | 350 | $('#customTabs3').removeClass('customActive'); |
353 | $('#customTabs4').removeClass('customActive'); | 351 | $('#customTabs4').removeClass('customActive'); |
354 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); | 352 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); |
355 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); | 353 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); |
356 | 354 | ||
357 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'inline-block'); | 355 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'inline-block'); |
358 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'none'); | 356 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'none'); |
359 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'none'); | 357 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'none'); |
360 | 358 | ||
361 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'none'); | 359 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'none'); |
362 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'inline-block'); | 360 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'inline-block'); |
363 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'inline-block'); | 361 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'inline-block'); |
364 | 362 | ||
365 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'inline-block'); | 363 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'inline-block'); |
366 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'none'); | 364 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'none'); |
367 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'none'); | 365 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'none'); |
368 | 366 | ||
369 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'inline-block'); | 367 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'inline-block'); |
370 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'none'); | 368 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'none'); |
371 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'none'); | 369 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'none'); |
372 | 370 | ||
373 | }) | 371 | }) |
374 | $('#customTabToggle3').click(function(){ | 372 | $('#customTabToggle3').click(function(){ |
375 | // console.log('tab 3'); | 373 | // console.log('tab 3'); |
376 | $('#customTabsBody1').slideUp(); | 374 | $('#customTabsBody1').slideUp(); |
377 | $('#customTabsBody2').slideUp(); | 375 | $('#customTabsBody2').slideUp(); |
378 | $('#customTabsBody3').slideDown(); | 376 | $('#customTabsBody3').slideDown(); |
379 | $('#customTabsBody4').slideUp(); | 377 | $('#customTabsBody4').slideUp(); |
380 | $('#customTabs1').removeClass('customActive'); | 378 | $('#customTabs1').removeClass('customActive'); |
381 | $('#customTabs2').removeClass('customActive'); | 379 | $('#customTabs2').removeClass('customActive'); |
382 | $('#customTabs3').addClass('customActive'); | 380 | $('#customTabs3').addClass('customActive'); |
383 | $('#customTabs4').removeClass('customActive'); | 381 | $('#customTabs4').removeClass('customActive'); |
384 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); | 382 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); |
385 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); | 383 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); |
386 | 384 | ||
387 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'inline-block'); | 385 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'inline-block'); |
388 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'none'); | 386 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'none'); |
389 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'none'); | 387 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'none'); |
390 | 388 | ||
391 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'inline-block'); | 389 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'inline-block'); |
392 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'none'); | 390 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'none'); |
393 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'none'); | 391 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'none'); |
394 | 392 | ||
395 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'none'); | 393 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'none'); |
396 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'inline-block'); | 394 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'inline-block'); |
397 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'inline-block'); | 395 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'inline-block'); |
398 | 396 | ||
399 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'inline-block'); | 397 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'inline-block'); |
400 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'none'); | 398 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'none'); |
401 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'none'); | 399 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'none'); |
402 | 400 | ||
403 | }) | 401 | }) |
404 | $('#customTabToggle4').click(function(){ | 402 | $('#customTabToggle4').click(function(){ |
405 | // console.log('tab 4'); | 403 | // console.log('tab 4'); |
406 | $('#customTabsBody1').slideUp(); | 404 | $('#customTabsBody1').slideUp(); |
407 | $('#customTabsBody2').slideUp(); | 405 | $('#customTabsBody2').slideUp(); |
408 | $('#customTabsBody3').slideUp(); | 406 | $('#customTabsBody3').slideUp(); |
409 | $('#customTabsBody4').slideDown(); | 407 | $('#customTabsBody4').slideDown(); |
410 | $('#customTabs1').removeClass('customActive'); | 408 | $('#customTabs1').removeClass('customActive'); |
411 | $('#customTabs2').removeClass('customActive'); | 409 | $('#customTabs2').removeClass('customActive'); |
412 | $('#customTabs3').removeClass('customActive'); | 410 | $('#customTabs3').removeClass('customActive'); |
413 | $('#customTabs4').addClass('customActive'); | 411 | $('#customTabs4').addClass('customActive'); |
414 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); | 412 | $('.customAccordianHeader > select, .customAccordianHeader > input').prop("disabled", true); |
415 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); | 413 | $('.customAccordianHeader.customActive > select, .customAccordianHeader.customActive > input').prop("disabled", false); |
416 | 414 | ||
417 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'inline-block'); | 415 | $('#customTabs1 > .pull-right > .btn-default').css('display', 'inline-block'); |
418 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'none'); | 416 | $('#customTabs1 > .pull-right > .btn-success').css('display', 'none'); |
419 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'none'); | 417 | $('#customTabs1 > .pull-right > .btn-danger').css('display', 'none'); |
420 | 418 | ||
421 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'inline-block'); | 419 | $('#customTabs2 > .pull-right > .btn-default').css('display', 'inline-block'); |
422 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'none'); | 420 | $('#customTabs2 > .pull-right > .btn-success').css('display', 'none'); |
423 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'none'); | 421 | $('#customTabs2 > .pull-right > .btn-danger').css('display', 'none'); |
424 | 422 | ||
425 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'inline-block'); | 423 | $('#customTabs3 > .pull-right > .btn-default').css('display', 'inline-block'); |
426 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'none'); | 424 | $('#customTabs3 > .pull-right > .btn-success').css('display', 'none'); |
427 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'none'); | 425 | $('#customTabs3 > .pull-right > .btn-danger').css('display', 'none'); |
428 | 426 | ||
429 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'none'); | 427 | $('#customTabs4 > .pull-right > .btn-default').css('display', 'none'); |
430 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'inline-block'); | 428 | $('#customTabs4 > .pull-right > .btn-success').css('display', 'inline-block'); |
431 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'inline-block'); | 429 | $('#customTabs4 > .pull-right > .btn-danger').css('display', 'inline-block'); |
432 | 430 | ||
433 | }) | 431 | }) |
434 | 432 | ||
435 | }) | 433 | }) |
436 | 434 | ||
437 | } | 435 | } |
438 | 436 |
app/partials/fuelOrders/fuelOrders.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | 4 | ||
5 | .controller('fuelOrdersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'NgTableParams','$stateParams','fuelOrdersService','CustomersService','ViewCompanyService', fuelOrdersController]); | 5 | .controller('fuelOrdersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'NgTableParams','$stateParams','fuelOrdersService','CustomersService','ViewCompanyService', fuelOrdersController]); |
6 | 6 | ||
7 | function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgTableParams,$stateParams,fuelOrdersService,CustomersService,ViewCompanyService) { | 7 | function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgTableParams,$stateParams,fuelOrdersService,CustomersService,ViewCompanyService) { |
8 | 8 | ||
9 | $scope.showFuelOrderModal = false; | 9 | $scope.showFuelOrderModal = false; |
10 | $scope.optionSelected; | 10 | $scope.optionSelected; |
11 | $scope.orderdata = {}; | 11 | $scope.orderdata = {}; |
12 | $scope.showLoader = false; | 12 | $scope.showLoader = false; |
13 | $scope.jetShow = []; | 13 | $scope.jetShow = []; |
14 | $scope.marginShow = []; | 14 | $scope.marginShow = []; |
15 | 15 | ||
16 | $scope.jetShow[0] = true; | 16 | $scope.jetShow[0] = true; |
17 | $scope.marginShow[0] = true; | 17 | $scope.marginShow[0] = true; |
18 | 18 | ||
19 | $scope.data = {}; | 19 | $scope.data = {}; |
20 | $scope.order = {}; | 20 | $scope.order = {}; |
21 | $scope.dispatchOrder = {}; | 21 | $scope.dispatchOrder = {}; |
22 | $scope.dispatchOrder.fuelOrderList = []; | 22 | $scope.dispatchOrder.fuelOrderList = []; |
23 | $scope.defaultStatus = ''; | 23 | $scope.defaultStatus = ''; |
24 | $scope.statusFilterOptions = []; | 24 | $scope.statusFilterOptions = []; |
25 | $scope.statusFilterOptions.push({ | 25 | $scope.statusFilterOptions.push({ |
26 | 'id': '', 'title': 'Show All' | 26 | 'id': '', 'title': 'Show All' |
27 | },{ | 27 | },{ |
28 | 'id': 'pending', 'title': 'Pending' | 28 | 'id': 'pending', 'title': 'Pending' |
29 | },{ | 29 | },{ |
30 | 'id': 'invoiced', 'title': 'Invoiced' | 30 | 'id': 'invoiced', 'title': 'Invoiced' |
31 | },{ | 31 | },{ |
32 | 'id': 'paid', 'title': 'Paid' | 32 | 'id': 'paid', 'title': 'Paid' |
33 | },{ | 33 | },{ |
34 | 'id': 'cancelled', 'title': 'Cancelled' | 34 | 'id': 'cancelled', 'title': 'Cancelled' |
35 | },{ | 35 | },{ |
36 | 'id': 'archived', 'title': 'Archived' | 36 | 'id': 'archived', 'title': 'Archived' |
37 | } | 37 | } |
38 | 38 | ||
39 | ); | 39 | ); |
40 | 40 | ||
41 | if($stateParams.status =="paid"){ | 41 | if($stateParams.status =="paid"){ |
42 | $scope.defaultStatus = "paid"; | 42 | $scope.defaultStatus = "paid"; |
43 | } | 43 | } |
44 | 44 | ||
45 | getAllCompanies(); | 45 | getAllCompanies(); |
46 | 46 | ||
47 | function getAllCompanies(){ | 47 | function getAllCompanies(){ |
48 | fuelOrdersService.getAllCompanies().then(function(result) { | 48 | fuelOrdersService.getAllCompanies().then(function(result) { |
49 | $scope.companyList = result; | 49 | $scope.companyList = result; |
50 | for (var i = 0; i < $scope.companyList.length; i++) { | 50 | for (var i = 0; i < $scope.companyList.length; i++) { |
51 | if ($scope.companyList[i].companyContact != null) { | 51 | if ($scope.companyList[i].companyContact != null) { |
52 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { | 52 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { |
53 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; | 53 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; |
54 | } | 54 | } |
55 | } | 55 | } |
56 | if ($scope.companyList[i].primaryContact != null) { | 56 | if ($scope.companyList[i].primaryContact != null) { |
57 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { | 57 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { |
58 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; | 58 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | if ($scope.companyList[i].margin != null) { | 61 | if ($scope.companyList[i].margin != null) { |
62 | if ($scope.companyList[i].margin.marginName != null) { | 62 | if ($scope.companyList[i].margin.marginName != null) { |
63 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 63 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
64 | } | 64 | } |
65 | } | 65 | } |
66 | } | 66 | } |
67 | $scope.displayCompanyList = new NgTableParams({ | 67 | $scope.displayCompanyList = new NgTableParams({ |
68 | page: 1, | 68 | page: 1, |
69 | count: 10, | 69 | count: 10, |
70 | }, { | 70 | }, { |
71 | data: $scope.companyList | 71 | data: $scope.companyList |
72 | }); | 72 | }); |
73 | $scope.showLoader = false; | 73 | $scope.showLoader = false; |
74 | }) | 74 | }) |
75 | } | 75 | } |
76 | 76 | ||
77 | 77 | ||
78 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) | 78 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) |
79 | $scope.reset2 = function(){ | 79 | $scope.reset2 = function(){ |
80 | $("input").val(""); | 80 | $("input").val(""); |
81 | $scope.removeMarginValidation(); | 81 | $scope.removeMarginValidation(); |
82 | } | 82 | } |
83 | 83 | ||
84 | function colourFunction() { | 84 | function colourFunction() { |
85 | var myselect = document.getElementById('colorfulSelectbox'), | 85 | var myselect = document.getElementById('colorfulSelectbox'), |
86 | colour = myselect.options[myselect.selectedIndex].className; | 86 | colour = myselect.options[myselect.selectedIndex].className; |
87 | myselect.style.background = colour; | 87 | myselect.style.background = colour; |
88 | myselect.blur(); | 88 | myselect.blur(); |
89 | } | 89 | } |
90 | |||
91 | |||
92 | /*setInterval(function(){ | ||
93 | colourFunction(); | ||
94 | }, 1)*/ | ||
95 | 90 | ||
96 | 91 | ||
97 | $scope.attachmentFilterOptions = []; | 92 | $scope.attachmentFilterOptions = []; |
98 | $scope.attachmentFilterOptions.push({ | 93 | $scope.attachmentFilterOptions.push({ |
99 | 'id': '', 'title': 'Show All' | 94 | 'id': '', 'title': 'Show All' |
100 | },{ | 95 | },{ |
101 | 'id': '!null', 'title': 'Attachments' | 96 | 'id': '!null', 'title': 'Attachments' |
102 | },{ | 97 | },{ |
103 | 'id': 'null', 'title': 'No Attachments' | 98 | 'id': 'null', 'title': 'No Attachments' |
104 | } | 99 | } |
105 | ); | 100 | ); |
106 | 101 | ||
107 | // $(document).ready(function() { | ||
108 | // $scope.showLoader = true; | ||
109 | // $('#example').DataTable(); | ||
110 | // $scope.showLoader = false; | ||
111 | // }); | ||
112 | 102 | ||
113 | $scope.getOrders = function() { | 103 | $scope.getOrders = function() { |
114 | fuelOrdersService.getOrders().then(function(result) { | 104 | fuelOrdersService.getOrders().then(function(result) { |
115 | $scope.orderdata = result; | 105 | $scope.orderdata = result; |
116 | for(var i=0 ; i < $scope.orderdata.length ; i++){ | 106 | for(var i=0 ; i < $scope.orderdata.length ; i++){ |
117 | $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); | 107 | $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); |
118 | $scope.orderdata[i].departingDateS = new Date($scope.orderdata[i].departingDate); | 108 | $scope.orderdata[i].departingDateS = new Date($scope.orderdata[i].departingDate); |
119 | $scope.orderdata[i].fuelingDate = new Date($scope.orderdata[i].fuelingDate); | 109 | $scope.orderdata[i].fuelingDate = new Date($scope.orderdata[i].fuelingDate); |
120 | 110 | ||
121 | var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear(); | 111 | var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear(); |
122 | var departingStr = "" + ($scope.orderdata[i].departingDateS.getMonth() + 1) + "/" + $scope.orderdata[i].departingDateS.getDate() + "/" + $scope.orderdata[i].departingDateS.getFullYear(); | 112 | var departingStr = "" + ($scope.orderdata[i].departingDateS.getMonth() + 1) + "/" + $scope.orderdata[i].departingDateS.getDate() + "/" + $scope.orderdata[i].departingDateS.getFullYear(); |
123 | // var fuelingDateStr = "" + ($scope.orderdata[i].fuelingDate.getMonth() + 1) + "/" + $scope.orderdata[i].fuelingDate.getDate() + "/" + $scope.orderdata[i].fuelingDate.getFullYear(); | 113 | // var fuelingDateStr = "" + ($scope.orderdata[i].fuelingDate.getMonth() + 1) + "/" + $scope.orderdata[i].fuelingDate.getDate() + "/" + $scope.orderdata[i].fuelingDate.getFullYear(); |
124 | $scope.orderdata[i].upliftDateString = str; | 114 | $scope.orderdata[i].upliftDateString = str; |
125 | $scope.orderdata[i].departingDateString = departingStr; | 115 | $scope.orderdata[i].departingDateString = departingStr; |
126 | // $scope.orderdata[i].fuelingDate = fuelingDateStr; | 116 | // $scope.orderdata[i].fuelingDate = fuelingDateStr; |
127 | 117 | ||
128 | 118 | ||
129 | } | 119 | } |
130 | // console.log("==result===",$scope.orderdata) | 120 | // console.log("==result===",$scope.orderdata) |
131 | 121 | ||
132 | $scope.displayFuelOrderList = new NgTableParams({ | 122 | $scope.displayFuelOrderList = new NgTableParams({ |
133 | page: 1, | 123 | page: 1, |
134 | count: 50, | 124 | count: 50, |
135 | }, { | 125 | }, { |
136 | data: $scope.orderdata | 126 | data: $scope.orderdata |
137 | }); | 127 | }); |
138 | $(document).ready(function(){ | 128 | $(document).ready(function(){ |
139 | function changeSelectboxBg(){ | 129 | function changeSelectboxBg(){ |
140 | setInterval(function(){ | 130 | setInterval(function(){ |
141 | if ($('.table select').is(':focus')) { | 131 | if ($('.table select').is(':focus')) { |
142 | 132 | ||
143 | }else{ | 133 | }else{ |
144 | var myselect = document.getElementsByClassName('colorfulSelectbox'); | 134 | var myselect = document.getElementsByClassName('colorfulSelectbox'); |
145 | 135 | ||
146 | for (var i = 0; i < myselect.length; i++) { | 136 | for (var i = 0; i < myselect.length; i++) { |
147 | var colourIndex = $(myselect[i]).prop('selectedIndex'); | 137 | var colourIndex = $(myselect[i]).prop('selectedIndex'); |
148 | colourIndex = colourIndex + 1; | 138 | colourIndex = colourIndex + 1; |
149 | var getColor = $('.colorfulSelectbox option:nth-child('+colourIndex+')').css('color'); | 139 | var getColor = $('.colorfulSelectbox option:nth-child('+colourIndex+')').css('color'); |
150 | $(myselect[i]).css('background-color', getColor); | 140 | $(myselect[i]).css('background-color', getColor); |
151 | myselect[i].blur(); | 141 | myselect[i].blur(); |
152 | } | 142 | } |
153 | } | 143 | } |
154 | }, 1000) | 144 | }, 1000) |
155 | } | 145 | } |
156 | changeSelectboxBg(); | 146 | changeSelectboxBg(); |
157 | // console.log("=====$scope.displayFuelOrderList====",$scope.displayFuelOrderList) | 147 | // console.log("=====$scope.displayFuelOrderList====",$scope.displayFuelOrderList) |
158 | 148 | ||
159 | /*$('.pagination , .recordCountSelect').click(function(){ | 149 | /*$('.pagination , .recordCountSelect').click(function(){ |
160 | changeSelectboxBg(); | 150 | changeSelectboxBg(); |
161 | }) | 151 | }) |
162 | $('.input-filter').keydown(function(){ | 152 | $('.input-filter').keydown(function(){ |
163 | console.log('function..........'); | 153 | console.log('function..........'); |
164 | changeSelectboxBg(); | 154 | changeSelectboxBg(); |
165 | })*/ | 155 | })*/ |
166 | }) | 156 | }) |
167 | }) | 157 | }) |
168 | } | 158 | } |
169 | 159 | ||
170 | $scope.getOrders(); | 160 | $scope.getOrders(); |
171 | $scope.optionSelected=''; | 161 | $scope.optionSelected=''; |
172 | var checkFlag = 0; | 162 | var checkFlag = 0; |
173 | $scope.onFWSelect = function() { | 163 | $scope.onFWSelect = function() { |
174 | if (checkFlag != 0) { | 164 | if (checkFlag != 0) { |
175 | $(document).ready(function(){ | 165 | $(document).ready(function(){ |
176 | $('body').css('position', 'fixed'); | 166 | $('body').css('position', 'fixed'); |
177 | }) | 167 | }) |
178 | if($scope.optionSelected == 'dt'){ | 168 | if($scope.optionSelected == 'dt'){ |
179 | $('#demo-modal-4').css('display', 'block'); | 169 | $('#demo-modal-4').css('display', 'block'); |
180 | $scope.optionSelected=''; | 170 | $scope.optionSelected=''; |
181 | 171 | ||
182 | } | 172 | } |
183 | if($scope.optionSelected == 'efo'){ | 173 | if($scope.optionSelected == 'efo'){ |
184 | $scope.showLoader = true; | 174 | $scope.showLoader = true; |
185 | var fileName = "orders.csv"; | 175 | var fileName = "orders.csv"; |
186 | var a = document.createElement("a"); | 176 | var a = document.createElement("a"); |
187 | document.body.appendChild(a); | 177 | document.body.appendChild(a); |
188 | fuelOrdersService.exportCompany().then(function(result) { | 178 | fuelOrdersService.exportCompany().then(function(result) { |
189 | var file = new Blob([result], {type: 'application/csv'}); | 179 | var file = new Blob([result], {type: 'application/csv'}); |
190 | var fileURL = URL.createObjectURL(file); | 180 | var fileURL = URL.createObjectURL(file); |
191 | a.href = fileURL; | 181 | a.href = fileURL; |
192 | a.download = fileName; | 182 | a.download = fileName; |
193 | a.click(); | 183 | a.click(); |
194 | $scope.showLoader = false; | 184 | $scope.showLoader = false; |
195 | $scope.optionSelected=''; | 185 | $scope.optionSelected=''; |
196 | $(document).ready(function(){ | 186 | $(document).ready(function(){ |
197 | $('body').css('position', 'initial'); | 187 | $('body').css('position', 'initial'); |
198 | }) | 188 | }) |
199 | }) | 189 | }) |
200 | } | 190 | } |
201 | checkFlag += 1; | 191 | checkFlag += 1; |
202 | }else{ | 192 | }else{ |
203 | checkFlag += 1; | 193 | checkFlag += 1; |
204 | } | 194 | } |
205 | 195 | ||
206 | } | 196 | } |
207 | $scope.attachmentrowid = "" | 197 | $scope.attachmentrowid = "" |
208 | 198 | ||
209 | 199 | ||
210 | $scope.attachment = function(id, value, url) { | 200 | $scope.attachment = function(id, value, url) { |
211 | $scope.attachmentrowid = id | 201 | $scope.attachmentrowid = id |
212 | if(value == 'uploadAttachment'){ | 202 | if(value == 'uploadAttachment'){ |
213 | $('#demo-modal-6').css('display', 'block'); | 203 | $('#demo-modal-6').css('display', 'block'); |
214 | }else if(value == 'viewAttachment'){ | 204 | }else if(value == 'viewAttachment'){ |
215 | var win = window.open(url, '_blank'); | 205 | var win = window.open(url, '_blank'); |
216 | win.focus(); | 206 | win.focus(); |
217 | }else if(value == 'deleteAttachment'){ | 207 | }else if(value == 'deleteAttachment'){ |
218 | $('#delete1').css('display', 'block'); | 208 | $('#delete1').css('display', 'block'); |
219 | } | 209 | } |
220 | } | 210 | } |
221 | 211 | ||
222 | $scope.cancelDeleteAttachment = function() { | 212 | $scope.cancelDeleteAttachment = function() { |
223 | $('#delete1').css('display', ''); | 213 | $('#delete1').css('display', ''); |
224 | } | 214 | } |
225 | 215 | ||
226 | $scope.deleteAttachment = function() { | 216 | $scope.deleteAttachment = function() { |
227 | $scope.showLoader = true; | 217 | $scope.showLoader = true; |
228 | fuelOrdersService.deleteAttachment($scope.attachmentrowid).then(function(result) { | 218 | fuelOrdersService.deleteAttachment($scope.attachmentrowid).then(function(result) { |
229 | 219 | ||
230 | if(result.success){ | 220 | if(result.success){ |
231 | toastr.success(''+result.success+'', { | 221 | toastr.success(''+result.success+'', { |
232 | closeButton: true | 222 | closeButton: true |
233 | }) | 223 | }) |
234 | } | 224 | } |
235 | }) | 225 | }) |
236 | $scope.showLoader = false; | 226 | $scope.showLoader = false; |
237 | $('#delete1').css('display', ''); | 227 | $('#delete1').css('display', ''); |
238 | } | 228 | } |
239 | 229 | ||
240 | $scope.saveUploadAttachment = function(attachmentData) { | 230 | $scope.saveUploadAttachment = function(attachmentData) { |
241 | $scope.showLoader = true; | 231 | $scope.showLoader = true; |
242 | $scope.data.media = attachmentData | 232 | $scope.data.media = attachmentData |
243 | $scope.data.id = $scope.attachmentrowid | 233 | $scope.data.id = $scope.attachmentrowid |
244 | fuelOrdersService.uploadAttachment($scope.data).then(function(result) { | 234 | fuelOrdersService.uploadAttachment($scope.data).then(function(result) { |
245 | if(result){ | 235 | if(result){ |
246 | toastr.success(''+"Upload Successful"+'', { | 236 | toastr.success(''+"Upload Successful"+'', { |
247 | closeButton: true | 237 | closeButton: true |
248 | }) | 238 | }) |
249 | } | 239 | } |
250 | 240 | ||
251 | }) | 241 | }) |
252 | $scope.showLoader = false; | 242 | $scope.showLoader = false; |
253 | $('#demo-modal-6').css('display', 'none'); | 243 | $('#demo-modal-6').css('display', 'none'); |
254 | } | 244 | } |
255 | 245 | ||
256 | $scope.cancelUploadAttachment = function() { | 246 | $scope.cancelUploadAttachment = function() { |
257 | $('#demo-modal-6').css('display', 'none'); | 247 | $('#demo-modal-6').css('display', 'none'); |
258 | } | 248 | } |
259 | 249 | ||
260 | $scope.editdata = {}; | 250 | $scope.editdata = {}; |
261 | 251 | ||
262 | 252 | ||
263 | $scope.editTableRow = function(rowData){ | 253 | $scope.editTableRow = function(rowData){ |
264 | //console.log('row data', rowData); | 254 | //console.log('row data', rowData); |
265 | $(document).ready(function(){ | 255 | $(document).ready(function(){ |
266 | $('body').css('position', 'fixed'); | 256 | $('body').css('position', 'fixed'); |
267 | }) | 257 | }) |
268 | $scope.editdata = rowData; | 258 | $scope.editdata = rowData; |
269 | $('#demo-modal-5').css('display', 'block'); | 259 | $('#demo-modal-5').css('display', 'block'); |
270 | } | 260 | } |
271 | 261 | ||
272 | $scope.updateTotal = function(value, valueOf){ | 262 | $scope.updateTotal = function(value, valueOf){ |
273 | if(valueOf == 'v'){ | 263 | if(valueOf == 'v'){ |
274 | $scope.editdata.total = value * $scope.editdata.invoiced | 264 | $scope.editdata.total = value * $scope.editdata.invoiced |
275 | }else if(valueOf == 'i'){ | 265 | }else if(valueOf == 'i'){ |
276 | $scope.editdata.total = $scope.editdata.requestedVolume * value | 266 | $scope.editdata.total = $scope.editdata.requestedVolume * value |
277 | } | 267 | } |
278 | } | 268 | } |
279 | 269 | ||
280 | $scope.setCost = function(cost){ | 270 | $scope.setCost = function(cost){ |
281 | if(cost != null) { | 271 | if(cost != null) { |
282 | var obj =JSON.parse(cost); | 272 | var obj =JSON.parse(cost); |
283 | $scope.order.fboCost = obj.cost; | 273 | $scope.order.fboCost = obj.cost; |
284 | } | 274 | } |
285 | 275 | ||
286 | } | 276 | } |
287 | 277 | ||
288 | $scope.addTotal = function(value, valueOf) { | 278 | $scope.addTotal = function(value, valueOf) { |
289 | if (value != undefined && valueOf != undefined) { | 279 | if (value != undefined && valueOf != undefined) { |
290 | value = JSON.parse(value) | 280 | value = JSON.parse(value) |
291 | $scope.order.total = Math.abs(value.papTotal) * valueOf; | 281 | $scope.order.total = Math.abs(value.papTotal) * valueOf; |
292 | } | 282 | } |
293 | } | 283 | } |
294 | 284 | ||
295 | $scope.addFuelData = function() { | 285 | $scope.addFuelData = function() { |
296 | $scope.showLoader = true; | 286 | $scope.showLoader = true; |
297 | $scope.fuelData = {}; | 287 | $scope.fuelData = {}; |
298 | $scope.fuelData.companyId = $scope.selectedCompanyId; | 288 | $scope.fuelData.companyId = $scope.selectedCompanyId; |
299 | 289 | ||
300 | $scope.fuelData.companyName = $scope.order.companyName; | 290 | $scope.fuelData.companyName = $scope.order.companyName; |
301 | //var aircraftObj =JSON.parse($scope.order.aircraftName); | 291 | //var aircraftObj =JSON.parse($scope.order.aircraftName); |
302 | $scope.fuelData.aircraftName = $scope.order.aircraftName; | 292 | $scope.fuelData.aircraftName = $scope.order.aircraftName; |
303 | $scope.fuelData.make = $scope.order.aircraftMake; | 293 | $scope.fuelData.make = $scope.order.aircraftMake; |
304 | $scope.fuelData.model = $scope.order.aircraftModel; | 294 | $scope.fuelData.model = $scope.order.aircraftModel; |
305 | // $scope.fuelData.fuelOn = $scope.order.fuelOn; | 295 | // $scope.fuelData.fuelOn = $scope.order.fuelOn; |
306 | $scope.fuelData.invoiced = $scope.order.invoiced; | 296 | $scope.fuelData.invoiced = $scope.order.invoiced; |
307 | $scope.fuelData.volume = $scope.order.volume; | 297 | $scope.fuelData.volume = $scope.order.volume; |
308 | // $scope.fuelData.source = $scope.order.source; | 298 | // $scope.fuelData.source = $scope.order.source; |
309 | 299 | ||
310 | $scope.fuelData.total = $scope.order.total; | 300 | $scope.fuelData.total = $scope.order.total; |
311 | //tier no use | 301 | //tier no use |
312 | $scope.fuelData.tierBreak = $scope.order.tierBreak; | 302 | $scope.fuelData.tierBreak = $scope.order.tierBreak; |
313 | 303 | ||
314 | var obj =JSON.parse($scope.order.priceQuote); | 304 | var obj =JSON.parse($scope.order.priceQuote); |
315 | $scope.fuelData.priceQuote = obj.papTotal; | 305 | $scope.fuelData.priceQuote = obj.papTotal; |
316 | $scope.fuelData.fboCost = obj.cost; | 306 | $scope.fuelData.fboCost = obj.cost; |
317 | $scope.fuelData.productName = obj.productName; | 307 | $scope.fuelData.productName = obj.productName; |
318 | 308 | ||
319 | $scope.fuelData.etaTime = $scope.order.etaTime; | 309 | $scope.fuelData.etaTime = $scope.order.etaTime; |
320 | $scope.fuelData.etdTime = $scope.order.etdTime; | 310 | $scope.fuelData.etdTime = $scope.order.etdTime; |
321 | $scope.fuelData.certificateType = $scope.order.certificateType; | 311 | $scope.fuelData.certificateType = $scope.order.certificateType; |
322 | var currentDate = new Date(); | 312 | var currentDate = new Date(); |
323 | var hours = currentDate.getHours(); | 313 | var hours = currentDate.getHours(); |
324 | var min = currentDate.getMinutes(); | 314 | var min = currentDate.getMinutes(); |
325 | var sec = currentDate.getSeconds(); | 315 | var sec = currentDate.getSeconds(); |
326 | if ($scope.order.upliftDate != '') { | 316 | if ($scope.order.upliftDate != '') { |
327 | $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; | 317 | $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; |
328 | $scope.order.upliftDate = new Date($scope.order.upliftDate); | 318 | $scope.order.upliftDate = new Date($scope.order.upliftDate); |
329 | $scope.fuelData.upliftDate = $scope.order.upliftDate.getTime(); | 319 | $scope.fuelData.upliftDate = $scope.order.upliftDate.getTime(); |
330 | } | 320 | } |
331 | 321 | ||
332 | 322 | ||
333 | if ($scope.order.departingDate != '') { | 323 | if ($scope.order.departingDate != '') { |
334 | $scope.order.departingDate = $scope.order.departingDate + ' ' + hours + ':' + min + ':' + sec; | 324 | $scope.order.departingDate = $scope.order.departingDate + ' ' + hours + ':' + min + ':' + sec; |
335 | $scope.order.departingDate = new Date($scope.order.departingDate); | 325 | $scope.order.departingDate = new Date($scope.order.departingDate); |
336 | $scope.fuelData.departingDate = $scope.order.departingDate.getTime(); | 326 | $scope.fuelData.departingDate = $scope.order.departingDate.getTime(); |
337 | } | 327 | } |
338 | 328 | ||
339 | if($scope.order.status === null || $scope.order.status === undefined){ | 329 | if($scope.order.status === null || $scope.order.status === undefined){ |
340 | 330 | ||
341 | $scope.fuelData.status = "pending"; //default status | 331 | $scope.fuelData.status = "pending"; //default status |
342 | 332 | ||
343 | }else { | 333 | }else { |
344 | 334 | ||
345 | $scope.fuelData.status = $scope.order.status; | 335 | $scope.fuelData.status = $scope.order.status; |
346 | } | 336 | } |
347 | 337 | ||
348 | if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ | 338 | if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ |
349 | $scope.fuelData.fuelOn = "Arrival"; //default fuelon | 339 | $scope.fuelData.fuelOn = "Arrival"; //default fuelon |
350 | }else { | 340 | }else { |
351 | $scope.fuelData.fuelOn = $scope.order.fuelOn ; | 341 | $scope.fuelData.fuelOn = $scope.order.fuelOn ; |
352 | } | 342 | } |
353 | 343 | ||
354 | if($scope.baseTenant && $scope.contractFuelVendor ){ | 344 | if($scope.baseTenant && $scope.contractFuelVendor ){ |
355 | $scope.fuelData.source = "Tenant/CAA" ; | 345 | $scope.fuelData.source = "Tenant/CAA" ; |
356 | }else if($scope.baseTenant) | 346 | }else if($scope.baseTenant) |
357 | { | 347 | { |
358 | $scope.fuelData.source = "Tenant/Base Customer"; | 348 | $scope.fuelData.source = "Tenant/Base Customer"; |
359 | }else if($scope.contractFuelVendor){ | 349 | }else if($scope.contractFuelVendor){ |
360 | $scope.fuelData.source = "CAA Member"; | 350 | $scope.fuelData.source = "CAA Member"; |
361 | } | 351 | } |
362 | 352 | ||
363 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); | 353 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); |
364 | fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { | 354 | fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { |
365 | $scope.showLoader = false; | 355 | $scope.showLoader = false; |
366 | $scope.order = {}; | 356 | $scope.order = {}; |
367 | $scope.dispatchOrder.fuelOrderList = []; | 357 | $scope.dispatchOrder.fuelOrderList = []; |
368 | $scope.fuelData.source=''; | 358 | $scope.fuelData.source=''; |
369 | $scope.baseTenant=false; | 359 | $scope.baseTenant=false; |
370 | $scope.contractFuelVendor=false; | 360 | $scope.contractFuelVendor=false; |
371 | $('#demo-modal-4').css('display', ''); | 361 | $('#demo-modal-4').css('display', ''); |
372 | $scope.getOrders(); | 362 | $scope.getOrders(); |
373 | toastr.success('Fuel Order Dispatched Successfully', { | 363 | toastr.success('Fuel Order Dispatched Successfully', { |
374 | closeButton: true | 364 | closeButton: true |
375 | }) | 365 | }) |
376 | /*for datepicker position */ | 366 | /*for datepicker position */ |
377 | $(document).ready(function(){ | 367 | $(document).ready(function(){ |
378 | $('body').css('position', 'initial'); | 368 | $('body').css('position', 'initial'); |
379 | }) | 369 | }) |
380 | }) | 370 | }) |
381 | 371 | ||
382 | 372 | ||
383 | } | 373 | } |
384 | 374 | ||
385 | $scope.updateStatus = function(row, status) { | 375 | $scope.updateStatus = function(row, status) { |
386 | 376 | ||
387 | $scope.showLoader = true; | 377 | $scope.showLoader = true; |
388 | $scope.fuelData = {}; | 378 | $scope.fuelData = {}; |
389 | $scope.fuelData.aircraftName = row.aircraftName | 379 | $scope.fuelData.aircraftName = row.aircraftName |
390 | $scope.fuelData.companyName = row.companyName | 380 | $scope.fuelData.companyName = row.companyName |
391 | $scope.fuelData.departingDate = row.departingDate | 381 | $scope.fuelData.departingDate = row.departingDate |
392 | $scope.fuelData.fboCost = row.fboCost | 382 | $scope.fuelData.fboCost = row.fboCost |
393 | $scope.fuelData.id = row.id | 383 | $scope.fuelData.id = row.id |
394 | $scope.fuelData.invoiced = row.invoiced | 384 | $scope.fuelData.invoiced = row.invoiced |
395 | $scope.fuelData.priceQuote = row.priceQuote | 385 | $scope.fuelData.priceQuote = row.priceQuote |
396 | $scope.fuelData.volume = row.requestedVolume | 386 | $scope.fuelData.volume = row.requestedVolume |
397 | $scope.fuelData.source = row.source | 387 | $scope.fuelData.source = row.source |
398 | $scope.fuelData.status = status | 388 | $scope.fuelData.status = status |
399 | $scope.fuelData.tierBreak = row.tierBreak | 389 | $scope.fuelData.tierBreak = row.tierBreak |
400 | $scope.fuelData.total = row.total | 390 | $scope.fuelData.total = row.total |
401 | $scope.fuelData.upliftDate = row.upliftDate | 391 | $scope.fuelData.upliftDate = row.upliftDate |
402 | 392 | ||
403 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); | 393 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); |
404 | fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { | 394 | fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { |
405 | $scope.showLoader = false; | 395 | $scope.showLoader = false; |
406 | $scope.editdata = {}; | 396 | $scope.editdata = {}; |
407 | $scope.fuelData = {}; | 397 | $scope.fuelData = {}; |
408 | $scope.dispatchOrder.fuelOrderList = []; | 398 | $scope.dispatchOrder.fuelOrderList = []; |
409 | $('#demo-modal-5').css('display', ''); | 399 | $('#demo-modal-5').css('display', ''); |
410 | $scope.getOrders(); | 400 | $scope.getOrders(); |
411 | toastr.success('Fuel Order Updated Successfully', { | 401 | toastr.success('Fuel Order Updated Successfully', { |
412 | closeButton: true | 402 | closeButton: true |
413 | }); | 403 | }); |
414 | }) | 404 | }) |
415 | 405 | ||
416 | } | 406 | } |
417 | $scope.fuelData = {}; | 407 | $scope.fuelData = {}; |
418 | $scope.updateData = function() { | 408 | $scope.updateData = function() { |
419 | if($scope.editdata.etaTime != null && $scope.editdata.etdTime != null){ | 409 | if($scope.editdata.etaTime != null && $scope.editdata.etdTime != null){ |
420 | $scope.showLoader = true; | 410 | $scope.showLoader = true; |
421 | $scope.fuelData.aircraftName = $scope.editdata.aircraftName; | 411 | $scope.fuelData.aircraftName = $scope.editdata.aircraftName; |
422 | $scope.fuelData.companyName = $scope.editdata.companyName; | 412 | $scope.fuelData.companyName = $scope.editdata.companyName; |
423 | $scope.fuelData.fboCost = $scope.editdata.fboCost; | 413 | $scope.fuelData.fboCost = $scope.editdata.fboCost; |
424 | $scope.fuelData.id = $scope.editdata.id; | 414 | $scope.fuelData.id = $scope.editdata.id; |
425 | $scope.fuelData.invoiced = $scope.editdata.invoiced; | 415 | $scope.fuelData.invoiced = $scope.editdata.invoiced; |
426 | $scope.fuelData.priceQuote = $scope.editdata.priceQuote; | 416 | $scope.fuelData.priceQuote = $scope.editdata.priceQuote; |
427 | $scope.fuelData.volume = $scope.editdata.requestedVolume; | 417 | $scope.fuelData.volume = $scope.editdata.requestedVolume; |
428 | $scope.fuelData.source = $scope.editdata.source; | 418 | $scope.fuelData.source = $scope.editdata.source; |
429 | $scope.fuelData.status = $scope.editdata.status; | 419 | $scope.fuelData.status = $scope.editdata.status; |
430 | $scope.fuelData.tierBreak = $scope.editdata.tierBreak; | 420 | $scope.fuelData.tierBreak = $scope.editdata.tierBreak; |
431 | $scope.fuelData.total = $scope.editdata.total; | 421 | $scope.fuelData.total = $scope.editdata.total; |
432 | 422 | ||
433 | var currentDate = new Date(); | 423 | var currentDate = new Date(); |
434 | var hours = currentDate.getHours(); | 424 | var hours = currentDate.getHours(); |
435 | var min = currentDate.getMinutes(); | 425 | var min = currentDate.getMinutes(); |
436 | var sec = currentDate.getSeconds(); | 426 | var sec = currentDate.getSeconds(); |
437 | $scope.editdata.upliftDateString = $scope.editdata.upliftDateString + ' ' + hours + ':' + min + ':' + sec; | 427 | $scope.editdata.upliftDateString = $scope.editdata.upliftDateString + ' ' + hours + ':' + min + ':' + sec; |
438 | $scope.editdata.upliftDateString = new Date($scope.editdata.upliftDateString); | 428 | $scope.editdata.upliftDateString = new Date($scope.editdata.upliftDateString); |
439 | $scope.editdata.upliftDateString = $scope.editdata.upliftDateString.getTime(); | 429 | $scope.editdata.upliftDateString = $scope.editdata.upliftDateString.getTime(); |
440 | 430 | ||
441 | $scope.editdata.departingDateString = $scope.editdata.departingDateString + ' ' + hours + ':' + min + ':' + sec; | 431 | $scope.editdata.departingDateString = $scope.editdata.departingDateString + ' ' + hours + ':' + min + ':' + sec; |
442 | $scope.editdata.departingDateString = new Date($scope.editdata.departingDateString); | 432 | $scope.editdata.departingDateString = new Date($scope.editdata.departingDateString); |
443 | $scope.editdata.departingDateString = $scope.editdata.departingDateString.getTime(); | 433 | $scope.editdata.departingDateString = $scope.editdata.departingDateString.getTime(); |
444 | 434 | ||
445 | $scope.fuelData.upliftDate = $scope.editdata.upliftDateString; | 435 | $scope.fuelData.upliftDate = $scope.editdata.upliftDateString; |
446 | $scope.fuelData.departingDate = $scope.editdata.departingDateString; | 436 | $scope.fuelData.departingDate = $scope.editdata.departingDateString; |
447 | $scope.fuelData.productName = $scope.editdata.productName; | 437 | $scope.fuelData.productName = $scope.editdata.productName; |
448 | /*$scope.fuelData.etaTime = $scope.editdata.etaTime.toLocaleTimeString(); | 438 | /*$scope.fuelData.etaTime = $scope.editdata.etaTime.toLocaleTimeString(); |
449 | $scope.fuelData.etdTime = $scope.editdata.etdTime.toLocaleTimeString();*/ | 439 | $scope.fuelData.etdTime = $scope.editdata.etdTime.toLocaleTimeString();*/ |
450 | $scope.fuelData.etaTime = $scope.editdata.etaTime; | 440 | $scope.fuelData.etaTime = $scope.editdata.etaTime; |
451 | $scope.fuelData.etdTime = $scope.editdata.etdTime; | 441 | $scope.fuelData.etdTime = $scope.editdata.etdTime; |
452 | $scope.fuelData.certificateType = $scope.editdata.certificateType; | 442 | $scope.fuelData.certificateType = $scope.editdata.certificateType; |
453 | // $scope.fuelData.fuelOn = $scope.editdata.fuelOn; | 443 | // $scope.fuelData.fuelOn = $scope.editdata.fuelOn; |
454 | if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ | 444 | if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ |
455 | $scope.fuelData.fuelOn = "Arrival"; //default fuelon | 445 | $scope.fuelData.fuelOn = "Arrival"; //default fuelon |
456 | }else { | 446 | }else { |
457 | $scope.fuelData.fuelOn = $scope.editdata.fuelOn ; | 447 | $scope.fuelData.fuelOn = $scope.editdata.fuelOn ; |
458 | } | 448 | } |
459 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); | 449 | $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); |
460 | fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { | 450 | fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { |
461 | $scope.showLoader = false; | 451 | $scope.showLoader = false; |
462 | $scope.editdata = {}; | 452 | $scope.editdata = {}; |
463 | $('#demo-modal-5').css('display', ''); | 453 | $('#demo-modal-5').css('display', ''); |
464 | $scope.getOrders(); | 454 | $scope.getOrders(); |
465 | toastr.success('Fuel Order Updated Successfully', { | 455 | toastr.success('Fuel Order Updated Successfully', { |
466 | closeButton: true | 456 | closeButton: true |
467 | }) | 457 | }) |
468 | /*for datepicker position */ | 458 | /*for datepicker position */ |
469 | $(document).ready(function(){ | 459 | $(document).ready(function(){ |
470 | $('body').css('position', 'initial'); | 460 | $('body').css('position', 'initial'); |
471 | }) | 461 | }) |
472 | }) | 462 | }) |
473 | 463 | ||
474 | }else | 464 | }else |
475 | { | 465 | { |
476 | toastr.error('Please select Arrival Time and Departure time both.', { | 466 | toastr.error('Please select Arrival Time and Departure time both.', { |
477 | closeButton: true | 467 | closeButton: true |
478 | }) | 468 | }) |
479 | } | 469 | } |
480 | 470 | ||
481 | } | 471 | } |
482 | 472 | ||
483 | $scope.getAircraft = function(company){ | 473 | $scope.getAircraft = function(company){ |
484 | 474 | ||
485 | $scope.selectedCompanyName = company; | 475 | $scope.selectedCompanyName = company; |
486 | //$scope.showLoader = true; | 476 | //$scope.showLoader = true; |
487 | for (var i = 0; i < $scope.companyList.length; i++) { | 477 | for (var i = 0; i < $scope.companyList.length; i++) { |
488 | if ($scope.companyList[i].companyName == company) { | 478 | if ($scope.companyList[i].companyName == company) { |
489 | $scope.order.certificateType = $scope.companyList[i].certificateType; | 479 | $scope.order.certificateType = $scope.companyList[i].certificateType; |
490 | $scope.baseTenant = $scope.companyList[i].baseTenant; | 480 | $scope.baseTenant = $scope.companyList[i].baseTenant; |
491 | $scope.contractFuelVendor = $scope.companyList[i].contractFuelVendor; | 481 | $scope.contractFuelVendor = $scope.companyList[i].contractFuelVendor; |
492 | $scope.fuelerlinxCustomer = $scope.companyList[i].fuelerlinxCustomer; | 482 | $scope.fuelerlinxCustomer = $scope.companyList[i].fuelerlinxCustomer; |
493 | 483 | ||
494 | if($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null){ | 484 | if($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null){ |
495 | fuelOrdersService.getFuelCost($scope.companyList[i].id).then(function(margins) { | 485 | fuelOrdersService.getFuelCost($scope.companyList[i].id).then(function(margins) { |
496 | $scope.marginList = margins; | 486 | $scope.marginList = margins; |
497 | }) | 487 | }) |
498 | } else if ($scope.companyList[i].margin != null || $scope.companyList[i].marginAVGAS == null) { | 488 | } else if ($scope.companyList[i].margin != null || $scope.companyList[i].marginAVGAS == null) { |
499 | fuelOrdersService.getATypeFuelPricing($scope.companyList[i].id).then(function(margins) { | 489 | fuelOrdersService.getATypeFuelPricing($scope.companyList[i].id).then(function(margins) { |
500 | $scope.marginList = margins; | 490 | $scope.marginList = margins; |
501 | }) | 491 | }) |
502 | } else if ($scope.companyList[i].margin == null || $scope.companyList[i].marginAVGAS != null) { | 492 | } else if ($scope.companyList[i].margin == null || $scope.companyList[i].marginAVGAS != null) { |
503 | fuelOrdersService.getVTypeFuelPricing($scope.companyList[i].id).then(function(margins) { | 493 | fuelOrdersService.getVTypeFuelPricing($scope.companyList[i].id).then(function(margins) { |
504 | $scope.marginList = margins; | 494 | $scope.marginList = margins; |
505 | }) | 495 | }) |
506 | } | 496 | } |
507 | $scope.selectedCompanyId = $scope.companyList[i].id; | 497 | $scope.selectedCompanyId = $scope.companyList[i].id; |
508 | $scope.marginId = $scope.companyList[i].margin.id; | 498 | $scope.marginId = $scope.companyList[i].margin.id; |
509 | if ($scope.selectedCompanyId != '') { | 499 | if ($scope.selectedCompanyId != '') { |
510 | fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) { | 500 | fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) { |
511 | $scope.aircraftList = aircraft; | 501 | $scope.aircraftList = aircraft; |
512 | }) | 502 | }) |
513 | } | 503 | } |
514 | if ($scope.marginId != '') { | 504 | if ($scope.marginId != '') { |
515 | fuelOrdersService.getJetTiers($scope.marginId).then(function(tiers) { | 505 | fuelOrdersService.getJetTiers($scope.marginId).then(function(tiers) { |
516 | $scope.tierList = tiers; | 506 | $scope.tierList = tiers; |
517 | // $scope.showLoader = false; | 507 | // $scope.showLoader = false; |
518 | }) | 508 | }) |
519 | }else{ | 509 | }else{ |
520 | // $scope.showLoader = false; | 510 | // $scope.showLoader = false; |
521 | } | 511 | } |
522 | } | 512 | } |
523 | } | 513 | } |
524 | 514 | ||
525 | } | 515 | } |
526 | 516 | ||
527 | $scope.getAircraftMakeAndModel=function (data) { | 517 | $scope.getAircraftMakeAndModel=function (data) { |
528 | for(var i = 0; i < $scope.aircraftList.length; i++){ | 518 | for(var i = 0; i < $scope.aircraftList.length; i++){ |
529 | if($scope.aircraftList[i].tail === data){ | 519 | if($scope.aircraftList[i].tail === data){ |
530 | $scope.order.aircraftMake = $scope.aircraftList[i].make; | 520 | $scope.order.aircraftMake = $scope.aircraftList[i].make; |
531 | $scope.order.aircraftModel = $scope.aircraftList[i].model; | 521 | $scope.order.aircraftModel = $scope.aircraftList[i].model; |
532 | } | 522 | } |
533 | 523 | ||
534 | } | 524 | } |
535 | } | 525 | } |
536 | 526 | ||
537 | 527 | ||
538 | $scope.cancelData = function() { | 528 | $scope.cancelData = function() { |
539 | $(document).ready(function(){ | 529 | $(document).ready(function(){ |
540 | $('body').css('position', 'initial'); | 530 | $('body').css('position', 'initial'); |
541 | }) | 531 | }) |
542 | $('#demo-modal-4').css('display', ''); | 532 | $('#demo-modal-4').css('display', ''); |
543 | } | 533 | } |
544 | $scope.canceleditdata = function() { | 534 | $scope.canceleditdata = function() { |
545 | $(document).ready(function(){ | 535 | $(document).ready(function(){ |
546 | $('body').css('position', 'initial'); | 536 | $('body').css('position', 'initial'); |
547 | }) | 537 | }) |
548 | $('#demo-modal-5').css('display', ''); | 538 | $('#demo-modal-5').css('display', ''); |
549 | } | 539 | } |
550 | 540 | ||
551 | 541 | ||
552 | 542 | ||
553 | $scope.companyList = {}; | 543 | $scope.companyList = {}; |
554 | 544 | ||
555 | fuelOrdersService.getAllCompanies().then(function(result) { | 545 | fuelOrdersService.getAllCompanies().then(function(result) { |
556 | $scope.showLoader = true; | 546 | $scope.showLoader = true; |
557 | $scope.companyList = result; | 547 | $scope.companyList = result; |
558 | $scope.showLoader = false; | 548 | $scope.showLoader = false; |
559 | }) | 549 | }) |
560 | 550 | ||
561 | /*Add a company services API used from customersService */ | 551 | /*Add a company services API used from customersService */ |
562 | getCompanyName(); | 552 | getCompanyName(); |
563 | function getCompanyName(){ | 553 | function getCompanyName(){ |
564 | CustomersService.getCompanyName().then(function(result) { | 554 | CustomersService.getCompanyName().then(function(result) { |
565 | $scope.showLoader = true; | 555 | $scope.showLoader = true; |
566 | $scope.compNameList = result; | 556 | $scope.compNameList = result; |
567 | $scope.showLoader = false; | 557 | $scope.showLoader = false; |
568 | }) | 558 | }) |
569 | } | 559 | } |
570 | 560 | ||
571 | $scope.marginFilterOptions = []; | 561 | $scope.marginFilterOptions = []; |
572 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 562 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
573 | $scope.showLoader = true; | 563 | $scope.showLoader = true; |
574 | $scope.jetMarginList = result; | 564 | $scope.jetMarginList = result; |
575 | $scope.marginFilterOptions.push({ | 565 | $scope.marginFilterOptions.push({ |
576 | 'id': '', 'title': 'Show All' | 566 | 'id': '', 'title': 'Show All' |
577 | }); | 567 | }); |
578 | for (var i = 0; i < result.length; i++) { | 568 | for (var i = 0; i < result.length; i++) { |
579 | $scope.marginFilterOptions.push({ | 569 | $scope.marginFilterOptions.push({ |
580 | 'id': result[i].id, | 570 | 'id': result[i].id, |
581 | 'title': result[i].marginName | 571 | 'title': result[i].marginName |
582 | }) | 572 | }) |
583 | } | 573 | } |
584 | $scope.showLoader = false; | 574 | $scope.showLoader = false; |
585 | }) | 575 | }) |
586 | 576 | ||
587 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 577 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
588 | $scope.avgsMarginList = result; | 578 | $scope.avgsMarginList = result; |
589 | }) | 579 | }) |
590 | 580 | ||
591 | $scope.showCompanyError = false; | 581 | $scope.showCompanyError = false; |
592 | $scope.showMarginError = false; | 582 | $scope.showMarginError = false; |
593 | 583 | ||
594 | $scope.removeValidation = function(){ | 584 | $scope.removeValidation = function(){ |
595 | $scope.showCompanyError = false; | 585 | $scope.showCompanyError = false; |
596 | $('.companyNameInput').removeClass('customErrorInput'); | 586 | $('.companyNameInput').removeClass('customErrorInput'); |
597 | if($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { | 587 | if($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { |
598 | $('.companyNameInput').addClass('customErrorInput'); | 588 | $('.companyNameInput').addClass('customErrorInput'); |
599 | $scope.showCompanyError = true; | 589 | $scope.showCompanyError = true; |
600 | } | 590 | } |
601 | } | 591 | } |
602 | 592 | ||
603 | $scope.removeMarginValidation = function(){ | 593 | $scope.removeMarginValidation = function(){ |
604 | $scope.showMarginError = false; | 594 | $scope.showMarginError = false; |
605 | $('.marginSelectBox').removeClass('customErrorInput'); | 595 | $('.marginSelectBox').removeClass('customErrorInput'); |
606 | } | 596 | } |
607 | 597 | ||
608 | getData(); | 598 | getData(); |
609 | function getData(){ | 599 | function getData(){ |
610 | $scope.showLoader = true; | 600 | $scope.showLoader = true; |
611 | CustomersService.getAircraftMake().then(function(result) { | 601 | CustomersService.getAircraftMake().then(function(result) { |
612 | $scope.aircraftMakeList = result; | 602 | $scope.aircraftMakeList = result; |
613 | $scope.showLoader = false; | 603 | $scope.showLoader = false; |
614 | }) | 604 | }) |
615 | } | 605 | } |
616 | var companyData; | 606 | var companyData; |
617 | $scope.addFirstData = function(sel, step){ | 607 | $scope.addFirstData = function(sel, step){ |
618 | $scope.showLoader = true; | 608 | $scope.showLoader = true; |
619 | if($scope.data.companyName == undefined){ | 609 | if($scope.data.companyName == undefined){ |
620 | $scope.showCompanyError = true; | 610 | $scope.showCompanyError = true; |
621 | $('.companyNameInput').addClass('customErrorInput'); | 611 | $('.companyNameInput').addClass('customErrorInput'); |
622 | }else if($scope.data.masterMargin == undefined){ | 612 | }else if($scope.data.masterMargin == undefined){ |
623 | $scope.showMarginError = true; | 613 | $scope.showMarginError = true; |
624 | $('.marginSelectBox').addClass('customErrorInput'); | 614 | $('.marginSelectBox').addClass('customErrorInput'); |
625 | }else{ | 615 | }else{ |
626 | $scope.aircraftDetails = [{ | 616 | $scope.aircraftDetails = [{ |
627 | 'tail':'', | 617 | 'tail':'', |
628 | 'make': '', | 618 | 'make': '', |
629 | 'model': '', | 619 | 'model': '', |
630 | 'sizeId' : '', | 620 | 'sizeId' : '', |
631 | 'marginId': $scope.data.masterMargin, | 621 | 'marginId': $scope.data.masterMargin, |
632 | 'avgasMarginId': $scope.data.avgasMargin | 622 | 'avgasMarginId': $scope.data.avgasMargin |
633 | }]; | 623 | }]; |
634 | 624 | ||
635 | $(sel).trigger('next.m.' + step); | 625 | $(sel).trigger('next.m.' + step); |
636 | getData(); | 626 | getData(); |
637 | } | 627 | } |
638 | $scope.showLoader = false; | 628 | $scope.showLoader = false; |
639 | } | 629 | } |
640 | $scope.addNew = function(){ | 630 | $scope.addNew = function(){ |
641 | $scope.showLoader = true; | 631 | $scope.showLoader = true; |
642 | $scope.aircraftDetails.push({ | 632 | $scope.aircraftDetails.push({ |
643 | 'tail':'', | 633 | 'tail':'', |
644 | 'make': '', | 634 | 'make': '', |
645 | 'model': '', | 635 | 'model': '', |
646 | 'sizeId' : '', | 636 | 'sizeId' : '', |
647 | 'marginId': $scope.data.masterMargin, | 637 | 'marginId': $scope.data.masterMargin, |
648 | 'avgasMarginId': $scope.data.avgasMargin | 638 | 'avgasMarginId': $scope.data.avgasMargin |
649 | }); | 639 | }); |
650 | $scope.showLoader = false; | 640 | $scope.showLoader = false; |
651 | }; | 641 | }; |
652 | 642 | ||
653 | $scope.aircraft = {}; | 643 | $scope.aircraft = {}; |
654 | $scope.getModal = function(makeId, index){ | 644 | $scope.getModal = function(makeId, index){ |
655 | $scope.showLoader = true; | 645 | $scope.showLoader = true; |
656 | $scope.aircraft.make = makeId; | 646 | $scope.aircraft.make = makeId; |
657 | CustomersService.getModal($scope.aircraft.make).then(function(result) { | 647 | CustomersService.getModal($scope.aircraft.make).then(function(result) { |
658 | $scope.showLoader = false; | 648 | $scope.showLoader = false; |
659 | $scope.aircraftDetails[index].aircraftModalList = result; | 649 | $scope.aircraftDetails[index].aircraftModalList = result; |
660 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | 650 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; |
661 | }) | 651 | }) |
662 | } | 652 | } |
663 | 653 | ||
664 | $scope.getSize = function(model, index){ | 654 | $scope.getSize = function(model, index){ |
665 | $scope.showLoader = true; | 655 | $scope.showLoader = true; |
666 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 656 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
667 | $scope.showLoader = false; | 657 | $scope.showLoader = false; |
668 | $scope.aircraftDetails[index].aircraftSizeList = result; | 658 | $scope.aircraftDetails[index].aircraftSizeList = result; |
669 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | 659 | //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; |
670 | }) | 660 | }) |
671 | } | 661 | } |
672 | 662 | ||
673 | $scope.aircraftListData = {}; | 663 | $scope.aircraftListData = {}; |
674 | $scope.addData = []; | 664 | $scope.addData = []; |
675 | 665 | ||
676 | $scope.saveCompanyData = function(){ | 666 | $scope.saveCompanyData = function(){ |
677 | CustomersService.addCompany($scope.data).then(function(result) { | 667 | CustomersService.addCompany($scope.data).then(function(result) { |
678 | $scope.accountId = result; | 668 | $scope.accountId = result; |
679 | $scope.aircraft.accountId = $scope.accountId; | 669 | $scope.aircraft.accountId = $scope.accountId; |
680 | 670 | ||
681 | for(var i=0; i<$scope.aircraftDetails.length;i++){ | 671 | for(var i=0; i<$scope.aircraftDetails.length;i++){ |
682 | $scope.addData.push({ | 672 | $scope.addData.push({ |
683 | 'tail': $scope.aircraftDetails[i].tail, | 673 | 'tail': $scope.aircraftDetails[i].tail, |
684 | 'make': $scope.aircraftDetails[i].make, | 674 | 'make': $scope.aircraftDetails[i].make, |
685 | 'model': $scope.aircraftDetails[i].model, | 675 | 'model': $scope.aircraftDetails[i].model, |
686 | 'sizeId' : $scope.aircraftDetails[i].sizeId, | 676 | 'sizeId' : $scope.aircraftDetails[i].sizeId, |
687 | 'marginId': $scope.aircraftDetails[i].marginId, | 677 | 'marginId': $scope.aircraftDetails[i].marginId, |
688 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId | 678 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId |
689 | }); | 679 | }); |
690 | } | 680 | } |
691 | $scope.aircraftListData.aircraftList = $scope.addData; | 681 | $scope.aircraftListData.aircraftList = $scope.addData; |
692 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; | 682 | $scope.aircraftListData.accountId = $scope.aircraft.accountId; |
693 | 683 | ||
694 | if($scope.aircraftListData.aircraftList[0].tail == "" || $scope.aircraftListData.aircraftList[0].make == null || $scope.aircraftListData.aircraftList[0].model == null){ | 684 | if($scope.aircraftListData.aircraftList[0].tail == "" || $scope.aircraftListData.aircraftList[0].make == null || $scope.aircraftListData.aircraftList[0].model == null){ |
695 | $scope.aircraftListData.aircraftList = []; | 685 | $scope.aircraftListData.aircraftList = []; |
696 | } | 686 | } |
697 | 687 | ||
698 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | 688 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { |
699 | 689 | ||
700 | if(result != null && result.success){ | 690 | if(result != null && result.success){ |
701 | toastr.success(''+result.success+'', { | 691 | toastr.success(''+result.success+'', { |
702 | closeButton: true | 692 | closeButton: true |
703 | }) | 693 | }) |
704 | $('#demo-modal-3').modal('hide'); | 694 | $('#demo-modal-3').modal('hide'); |
705 | getAllCompanies(); | 695 | getAllCompanies(); |
706 | }else{ | 696 | }else{ |
707 | toastr.error(''+result.statusText+'', { | 697 | toastr.error(''+result.statusText+'', { |
708 | closeButton: true | 698 | closeButton: true |
709 | }) | 699 | }) |
710 | } | 700 | } |
711 | }); | 701 | }); |
712 | 702 | ||
713 | }) | 703 | }) |
714 | 704 | ||
715 | 705 | ||
716 | } | 706 | } |
717 | 707 | ||
718 | $scope.checkJetWithTail = function(tail, index){ | 708 | $scope.checkJetWithTail = function(tail, index){ |
719 | 709 | ||
720 | ViewCompanyService.checkJetType(tail).then(function(result) { | 710 | ViewCompanyService.checkJetType(tail).then(function(result) { |
721 | if(result.jetA == "true"){ | 711 | if(result.jetA == "true"){ |
722 | $scope.jetShow[index] = false; | 712 | $scope.jetShow[index] = false; |
723 | $scope.marginShow[index] = true; | 713 | $scope.marginShow[index] = true; |
724 | }else{ | 714 | }else{ |
725 | $scope.jetShow[index] = true; | 715 | $scope.jetShow[index] = true; |
726 | $scope.marginShow[index] = false; | 716 | $scope.marginShow[index] = false; |
727 | } | 717 | } |
728 | }) | 718 | }) |
729 | } | 719 | } |
730 | 720 | ||
731 | $scope.etaTimeList=[]; | 721 | $scope.etaTimeList=[]; |
732 | $scope.etdTimeList =[]; | 722 | $scope.etdTimeList =[]; |
733 | 723 | ||
734 | $scope.sourceList = [{source:"Direct Jet-A"},{source:"Direct AVGAS 100LL"}]; | 724 | $scope.sourceList = [{source:"Direct Jet-A"},{source:"Direct AVGAS 100LL"}]; |
735 | $scope.etaTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, | 725 | $scope.etaTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, |
736 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, | 726 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, |
737 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, | 727 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, |
738 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, | 728 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, |
739 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, | 729 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, |
740 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; | 730 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; |
741 | 731 | ||
742 | $scope.etdTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, | 732 | $scope.etdTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, |
743 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, | 733 | {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, |
744 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, | 734 | {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, |
745 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, | 735 | {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, |
746 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, | 736 | {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, |
747 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; | 737 | {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; |
748 | 738 | ||
749 | $scope.data = {}; | 739 | $scope.data = {}; |
750 | 740 | ||
751 | 741 | ||
752 | 742 | ||
753 | } | 743 | } |
app/partials/fuelOrders/fuelOrders.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(4) > a{ | 2 | .subnavbar .mainnav > li:nth-child(4) > a{ |
3 | color: #c44646; | 3 | color: #c44646; |
4 | } | 4 | } |
5 | 5 | ||
6 | .button1 { | 6 | .button1 { |
7 | display: inline-block; | 7 | display: inline-block; |
8 | height: 35px; | 8 | height: 35px; |
9 | line-height: 35px; | 9 | line-height: 35px; |
10 | padding-right: 15px; | 10 | padding-right: 15px; |
11 | padding-left: 50px; | 11 | padding-left: 50px; |
12 | position: relative; | 12 | position: relative; |
13 | background-color:rgb(41,127,184); | 13 | background-color:rgb(41,127,184); |
14 | color:rgb(255,255,255); | 14 | color:rgb(255,255,255); |
15 | text-decoration: none; | 15 | text-decoration: none; |
16 | text-transform: uppercase; | 16 | text-transform: uppercase; |
17 | letter-spacing: 1px; | 17 | letter-spacing: 1px; |
18 | margin-bottom: 15px; | 18 | margin-bottom: 15px; |
19 | border: 0; | 19 | border: 0; |
20 | 20 | ||
21 | 21 | ||
22 | border-radius: 5px; | 22 | border-radius: 5px; |
23 | -moz-border-radius: 5px; | 23 | -moz-border-radius: 5px; |
24 | -webkit-border-radius: 5px; | 24 | -webkit-border-radius: 5px; |
25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); | 25 | text-shadow:0px 1px 0px rgba(0,0,0,0.5); |
26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; | 26 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true)";zoom:1; |
27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); | 27 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ff123852,Positive=true); |
28 | 28 | ||
29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 29 | -moz-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 30 | -webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); | 31 | box-shadow:0px 2px 2px rgba(0,0,0,0.2); |
32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; | 32 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true)"; |
33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); | 33 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=2,Color=#33000000,Positive=true); |
34 | } | 34 | } |
35 | 35 | ||
36 | .button1 span { | 36 | .button1 span { |
37 | position: absolute; | 37 | position: absolute; |
38 | left: 0; | 38 | left: 0; |
39 | top: 0; | 39 | top: 0; |
40 | width: 35px; | 40 | width: 35px; |
41 | background-color:rgba(0,0,0,0.5); | 41 | background-color:rgba(0,0,0,0.5); |
42 | 42 | ||
43 | -webkit-border-top-left-radius: 5px; | 43 | -webkit-border-top-left-radius: 5px; |
44 | -webkit-border-bottom-left-radius: 5px; | 44 | -webkit-border-bottom-left-radius: 5px; |
45 | -moz-border-radius-topleft: 5px; | 45 | -moz-border-radius-topleft: 5px; |
46 | -moz-border-radius-bottomleft: 5px; | 46 | -moz-border-radius-bottomleft: 5px; |
47 | border-top-left-radius: 5px; | 47 | border-top-left-radius: 5px; |
48 | border-bottom-left-radius: 5px; | 48 | border-bottom-left-radius: 5px; |
49 | border-right: 1px solid rgba(0,0,0,0.15); | 49 | border-right: 1px solid rgba(0,0,0,0.15); |
50 | } | 50 | } |
51 | 51 | ||
52 | .button1:hover span, .button1.active span { | 52 | .button1:hover span, .button1.active span { |
53 | background-color:rgb(0,102,26); | 53 | background-color:rgb(0,102,26); |
54 | border-right: 1px solid rgba(0,0,0,0.3); | 54 | border-right: 1px solid rgba(0,0,0,0.3); |
55 | } | 55 | } |
56 | 56 | ||
57 | .button1:active { | 57 | .button1:active { |
58 | margin-top: 2px; | 58 | margin-top: 2px; |
59 | margin-bottom: 13px; | 59 | margin-bottom: 13px; |
60 | 60 | ||
61 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 61 | -moz-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
62 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 62 | -webkit-box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
63 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); | 63 | box-shadow:0px 1px 0px rgba(255,255,255,0.5); |
64 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; | 64 | -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true)"; |
65 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); | 65 | filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=1,Color=#ccffffff,Positive=true); |
66 | } | 66 | } |
67 | 67 | ||
68 | .button1.turquoise { | 68 | .button1.turquoise { |
69 | background: #449d44; | 69 | background: #449d44; |
70 | } | 70 | } |
71 | </style> | 71 | </style> |
72 | 72 | ||
73 | <div class="myLoader" ng-show="showLoader"> | 73 | <div class="myLoader" ng-show="showLoader"> |
74 | <img src="../img/hourglass.gif" width="50px;"> | 74 | <img src="../img/hourglass.gif" width="50px;"> |
75 | </div> | 75 | </div> |
76 | 76 | ||
77 | 77 | ||
78 | <div class="main"> | 78 | <div class="main"> |
79 | <div class="container"> | 79 | <div class="container"> |
80 | <div class="row"> | 80 | <div class="row"> |
81 | <div class="col-md-12"> | 81 | <div class="col-md-12"> |
82 | <div class="widget stacked "> | 82 | <div class="widget stacked "> |
83 | <div class="widget-content"> | 83 | <div class="widget-content"> |
84 | <div class="tabbable"> | 84 | <div class="tabbable"> |
85 | <ul class="nav nav-tabs"> | 85 | <ul class="nav nav-tabs"> |
86 | <li style="margin: 0px 10px 4px 10px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" ng-model="searchText" placeholder="Search In Table"></li> | 86 | <li style="margin: 0px 10px 4px 10px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" ng-model="searchText" placeholder="Search In Table"></li> |
87 | <li><button type="button" class="btn btn-default btn-sm " ng-click="displayFuelOrderList.filter({}); searchText=null">Clear Search And Filters</button></li> | 87 | <li><button type="button" class="btn btn-default btn-sm " ng-click="displayFuelOrderList.filter({}); searchText=null">Clear Search And Filters</button></li> |
88 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#demo-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Company</button></li> | 88 | <li style="float:right"><button type="submit" data-toggle="modal" data-target="#demo-modal-3" class="btn btn-success btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Add Company</button></li> |
89 | </ul> | 89 | </ul> |
90 | <br> | 90 | <br> |
91 | <div class="tab-content customer-table" style="margin:0px"> | 91 | <div class="tab-content customer-table" style="margin:0px"> |
92 | <div class="tab-pane active" id="companyView"> | 92 | <div class="tab-pane active" id="companyView"> |
93 | <table ng-table="displayFuelOrderList" class="table table-striped table-condensed" show-filter="true"> | 93 | <table ng-table="displayFuelOrderList" class="table table-striped table-condensed" show-filter="true"> |
94 | <tr ng-repeat="row in $data | orderBy : '-fuelingDate' | filter:searchText" style="cursor: pointer;" > | 94 | <tr ng-repeat="row in $data | orderBy : '-fuelingDate' | filter:searchText" style="cursor: pointer;" > |
95 | <td data-title="'Company Name'" filter="{companyName: 'text'}" sortable="'companyName'" ng-click="editTableRow(row)"> | 95 | <td data-title="'Company Name'" filter="{companyName: 'text'}" sortable="'companyName'" ng-click="editTableRow(row)"> |
96 | {{row.companyName}} | 96 | {{row.companyName}} |
97 | </td> | 97 | </td> |
98 | <td data-title="'Fueling Date'" filter="{fuelingDate: 'text'}" sortable="'fuelingDate'" ng-click="editTableRow(row)"> | 98 | <td data-title="'Fueling Date'" filter="{fuelingDate: 'text'}" sortable="'fuelingDate'" ng-click="editTableRow(row)"> |
99 | {{row.fuelingDate |date:'MM/dd/yyyy'}} | 99 | {{row.fuelingDate |date:'MM/dd/yyyy'}} |
100 | </td> | 100 | </td> |
101 | <td data-title="'Tail #'" filter="{aircraftName: 'text'}" sortable="'aircraftName'" ng-click="editTableRow(row)"> | 101 | <td data-title="'Tail #'" filter="{aircraftName: 'text'}" sortable="'aircraftName'" ng-click="editTableRow(row)"> |
102 | {{row.aircraftName}} | 102 | {{row.aircraftName}} |
103 | </td> | 103 | </td> |
104 | <td data-title="'Source'" filter="{source: 'text'}" sortable="'source'" ng-click="editTableRow(row)"> | 104 | <td data-title="'Source'" filter="{source: 'text'}" sortable="'source'" ng-click="editTableRow(row)"> |
105 | {{row.source}} | 105 | {{row.source}} |
106 | </td> | 106 | </td> |
107 | <td data-title="'Volume'" filter="{requestedVolume: 'text'}" sortable="'requestedVolume'" ng-click="editTableRow(row)"> | 107 | <td data-title="'Volume'" filter="{requestedVolume: 'text'}" sortable="'requestedVolume'" ng-click="editTableRow(row)"> |
108 | {{row.requestedVolume}} | 108 | {{row.requestedVolume}} |
109 | </td> | 109 | </td> |
110 | <td data-title="'FBO Cost'" filter="{fboCost: 'text'}" sortable="'fboCost'" ng-click="editTableRow(row)"> | 110 | <td data-title="'FBO Cost'" filter="{fboCost: 'text'}" sortable="'fboCost'" ng-click="editTableRow(row)"> |
111 | {{row.fboCost | number : 4}} | 111 | {{row.fboCost | number : 4}} |
112 | </td> | 112 | </td> |
113 | <td data-title="'Quoted'" filter="{priceQuote: 'text'}" sortable="'priceQuote'" ng-click="editTableRow(row)"> | 113 | <td data-title="'Quoted'" filter="{priceQuote: 'text'}" sortable="'priceQuote'" ng-click="editTableRow(row)"> |
114 | {{row.priceQuote | number : 4}} | 114 | {{row.priceQuote | number : 4}} |
115 | </td> | 115 | </td> |
116 | <td data-title="'Invoiced'" filter="{invoiced: 'text'}" sortable="'invoiced'" ng-click="editTableRow(row)"> | 116 | <td data-title="'Invoiced'" filter="{invoiced: 'text'}" sortable="'invoiced'" ng-click="editTableRow(row)"> |
117 | {{row.invoiced | number : 4}} | 117 | {{row.invoiced | number : 4}} |
118 | </td> | 118 | </td> |
119 | <td data-title="'Total'" filter="{total: 'text'}" sortable="'total'" ng-click="editTableRow(row)"> | 119 | <td data-title="'Total'" filter="{total: 'text'}" sortable="'total'" ng-click="editTableRow(row)"> |
120 | {{row.total | number : 4}} | 120 | {{row.total | number : 4}} |
121 | </td> | 121 | </td> |
122 | <td data-title="'Status'" filter="{status: 'select'}" filter-data="statusFilterOptions" sortable="'status'"> | 122 | <td data-title="'Status'" filter="{status: 'select'}" filter-data="statusFilterOptions" sortable="'status'"> |
123 | <select class="btn btn-regular colorfulSelectbox" ng-model="row.status" ng-style="abc" ng-change="updateStatus(row, row.status)" ng-init="{{defaultStatus != '' ? row.status = defaultStatus : '' }}"> | 123 | <select class="btn btn-regular colorfulSelectbox" ng-model="row.status" ng-style="abc" ng-change="updateStatus(row, row.status)" ng-init="{{defaultStatus != '' ? row.status = defaultStatus : '' }}"> |
124 | <option class="blackOption" value="pending" ng-selected="row.status == pending"> Pending</option> | 124 | <option class="blackOption" value="pending" ng-selected="row.status == pending"> Pending</option> |
125 | <option class="blueOption" value="invoiced" ng-selected="row.status == invoiced" >Invoiced</option> | 125 | <option class="blueOption" value="invoiced" ng-selected="row.status == invoiced" >Invoiced</option> |
126 | <option class="greenOption" value="paid" ng-selected="row.status == paid" >Paid</option> | 126 | <option class="greenOption" value="paid" ng-selected="row.status == paid" >Paid</option> |
127 | <option class="redOption" value="cancelled" ng-selected="row.status == cancelled" >Cancelled</option> | 127 | <option class="redOption" value="cancelled" ng-selected="row.status == cancelled" >Cancelled</option> |
128 | <option class="yellowOption" value="archived" ng-selected="row.status == archived" >Archived</option> | 128 | <option class="yellowOption" value="archived" ng-selected="row.status == archived" >Archived</option> |
129 | </select> | 129 | </select> |
130 | 130 | ||
131 | </td> | 131 | </td> |
132 | <td data-title="'Attachments'" filter="{orderInvoice : 'select'}" filter-data="attachmentFilterOptions" sortable="'orderInvoice '"> | 132 | <td data-title="'Attachments'" filter="{orderInvoice : 'select'}" filter-data="attachmentFilterOptions" sortable="'orderInvoice '"> |
133 | <select class="btn btn-regular" ng-model="attachOptionSelected" ng-change="attachment(row.id,attachOptionSelected,row.orderInvoice.link, row)" > | 133 | <select class="btn btn-regular" ng-model="attachOptionSelected" ng-change="attachment(row.id,attachOptionSelected,row.orderInvoice.link, row)" > |
134 | <option value="" disabled selected="selected" >Invoice</option> | 134 | <option value="" disabled selected="selected" >Invoice</option> |
135 | <option value="viewAttachment" ng-if="row.orderInvoice !== null" >View</option> | 135 | <option value="viewAttachment" ng-if="row.orderInvoice !== null" >View</option> |
136 | <option value="deleteAttachment" ng-if="row.orderInvoice !== null">Delete</option> | 136 | <option value="deleteAttachment" ng-if="row.orderInvoice !== null">Delete</option> |
137 | <option value="0" disabled >_____________</option> | 137 | <option value="0" disabled >_____________</option> |
138 | <option value="uploadAttachment" >Upload</option> | 138 | <option value="uploadAttachment" >Upload</option> |
139 | </select> | 139 | </select> |
140 | <i class="fa fa-paperclip" ng-if="row.orderInvoice !== null"></i> | 140 | <i class="fa fa-paperclip" ng-if="row.orderInvoice !== null"></i> |
141 | </td> | 141 | </td> |
142 | </tr> | 142 | </tr> |
143 | </table> | 143 | </table> |
144 | 144 | ||
145 | <select class="btn btn-primary exportBtn" ng-model="optionSelected" ng-change="onFWSelect()"> | 145 | <select class="btn btn-primary exportBtn" ng-model="optionSelected" ng-change="onFWSelect()"> |
146 | <option value="" disabled selected="selected">Fuel Widget</option> | 146 | <option value="" disabled selected="selected">Fuel Widget</option> |
147 | <option value="dt" >Direct Fuel Order</option> | 147 | <option value="dt" >Direct Fuel Order</option> |
148 | <option value="efo" >Export Fuel Orders</option> | 148 | <option value="efo" >Export Fuel Orders</option> |
149 | </select> | 149 | </select> |
150 | 150 | ||
151 | </div> | 151 | </div> |
152 | </div> | 152 | </div> |
153 | </div> | 153 | </div> |
154 | </div> | 154 | </div> |
155 | <!-- /widget-content --> | 155 | <!-- /widget-content --> |
156 | </div> | 156 | </div> |
157 | <!-- /widget --> | 157 | <!-- /widget --> |
158 | </div> | 158 | </div> |
159 | <!-- /span8 --> | 159 | <!-- /span8 --> |
160 | </div> | 160 | </div> |
161 | <!-- /row --> | 161 | <!-- /row --> |
162 | </div> | 162 | </div> |
163 | <!-- /container --> | 163 | <!-- /container --> |
164 | 164 | ||
165 | 165 | ||
166 | </div> | 166 | </div> |
167 | <!-- /main --> | 167 | <!-- /main --> |
168 | 168 | ||
169 | 169 | ||
170 | <form class="modal multi-step" id="demo-modal-3" name="companyForm"> | 170 | <form class="modal multi-step" id="demo-modal-3" name="companyForm"> |
171 | <div class="modal-dialog modal-lg"> | 171 | <div class="modal-dialog modal-lg"> |
172 | <div class="modal-content"> | 172 | <div class="modal-content"> |
173 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 173 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
174 | <div> | 174 | <div> |
175 | <div class="row" style="margin: 0;"> | 175 | <div class="row" style="margin: 0;"> |
176 | <div> | 176 | <div> |
177 | <div class="widget" style="margin-bottom: 0;"> | 177 | <div class="widget" style="margin-bottom: 0;"> |
178 | <div class="widget-header"> | 178 | <div class="widget-header"> |
179 | <i class="icon-pencil"></i> | 179 | <i class="icon-pencil"></i> |
180 | <i class="fa fa-tasks" aria-hidden="true"></i> | 180 | <i class="fa fa-tasks" aria-hidden="true"></i> |
181 | <h3>Add a New Company</h3> | 181 | <h3>Add a New Company</h3> |
182 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> | 182 | <div class="pull-right my-toggle-switch" style="margin-right: 30px;"> |
183 | <div style="color: #ff9a01;">Activate     | 183 | <div style="color: #ff9a01;">Activate     |
184 | <toggle ng-model="data.activate" size="customToogle"></toggle> | 184 | <toggle ng-model="data.activate" size="customToogle"></toggle> |
185 | </div> | 185 | </div> |
186 | </div> | 186 | </div> |
187 | <div class="clearfix"></div> | 187 | <div class="clearfix"></div> |
188 | </div> | 188 | </div> |
189 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 189 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
190 | <div class="col-xs-12"> | 190 | <div class="col-xs-12"> |
191 | <div class="col-md-8"> | 191 | <div class="col-md-8"> |
192 | <div class="pull-left"> | 192 | <div class="pull-left"> |
193 | <label class="new-input-label"><b>Company Name *</b></label> | 193 | <label class="new-input-label"><b>Company Name *</b></label> |
194 | </div> | 194 | </div> |
195 | <div class="pull-left" style="margin-left: 15px;"> | 195 | <div class="pull-left" style="margin-left: 15px;"> |
196 | <!-- <input type="text" ng-model="data.companyName" class="form-control companyNameInput" ng-keyup="removeValidation()" placeholder="" required> --> | 196 | <!-- <input type="text" ng-model="data.companyName" class="form-control companyNameInput" ng-keyup="removeValidation()" placeholder="" required> --> |
197 | <input type="text" ng-keyup="removeValidation()" ng-model="data.companyName" uib-typeahead="company.companyName for company in compNameList | filter:$viewValue | limitTo:8" class="form-control companyNameInput"> | 197 | <input type="text" ng-keyup="removeValidation()" ng-model="data.companyName" uib-typeahead="company.companyName for company in compNameList | filter:$viewValue | limitTo:8" class="form-control companyNameInput"> |
198 | 198 | ||
199 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> | 199 | <label class="customErrorMessage" ng-show="showCompanyError">This field is required.</label> |
200 | </div> | 200 | </div> |
201 | <div class="clearfix"></div> | 201 | <div class="clearfix"></div> |
202 | </div> | 202 | </div> |
203 | <div class="col-md-4"> | 203 | <div class="col-md-4"> |
204 | 204 | ||
205 | <div class="pull-right"> | 205 | <div class="pull-right"> |
206 | <input type="text" ng-model="data.baseIcao" style="width: 100px;" class="form-control" placeholder=""> | 206 | <input type="text" ng-model="data.baseIcao" style="width: 100px;" class="form-control" placeholder=""> |
207 | </div> | 207 | </div> |
208 | <div class="pull-right"> | 208 | <div class="pull-right"> |
209 | <label style="margin-right: 15px;" class="new-input-label"><b>Base ICAO</b></label> | 209 | <label style="margin-right: 15px;" class="new-input-label"><b>Base ICAO</b></label> |
210 | </div> | 210 | </div> |
211 | <div class="clearfix"></div> | 211 | <div class="clearfix"></div> |
212 | </div> | 212 | </div> |
213 | </div> | 213 | </div> |
214 | <div class="clearfix"></div><br> | 214 | <div class="clearfix"></div><br> |
215 | <div class="col-xs-12"> | 215 | <div class="col-xs-12"> |
216 | <div class="col-md-7"> | 216 | <div class="col-md-7"> |
217 | <div class="pull-left"> | 217 | <div class="pull-left"> |
218 | <label class="new-input-label"><b>Relationship </b></label> | 218 | <label class="new-input-label"><b>Relationship </b></label> |
219 | </div> | 219 | </div> |
220 | <div class="pull-left" style="margin-left: 32px;"> | 220 | <div class="pull-left" style="margin-left: 32px;"> |
221 | <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Check here if this is a Base Tenant<br> | 221 | <input type="checkbox" ng-model="data.baseTenant" name="vehicle" value="Bike"> Check here if this is a Base Tenant<br> |
222 | <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Check here if this is a FuelerLinx Customer<br> | 222 | <input type="checkbox" ng-model="data.fuelerlinxCustomer" name="vehicle" value="Car" checked> Check here if this is a FuelerLinx Customer<br> |
223 | <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Check here if this is a Contract Fuel Vendor | 223 | <input type="checkbox" ng-model="data.contractFuelVendor" name="vehicle" value="Car" checked> Check here if this is a Contract Fuel Vendor |
224 | </div> | 224 | </div> |
225 | <div class="clearfix"></div> | 225 | <div class="clearfix"></div> |
226 | </div> | 226 | </div> |
227 | <div class="col-md-2 Airport" style="text-align: right;"> | 227 | <div class="col-md-2 Airport" style="text-align: right;"> |
228 | <b>Certificate Type</b> | 228 | <b>Certificate Type</b> |
229 | </div> | 229 | </div> |
230 | <div class="col-md-3 Airport"> | 230 | <div class="col-md-3 Airport"> |
231 | <select required class="form-control" ng-model="data.certificateType"> | 231 | <select required class="form-control" ng-model="data.certificateType"> |
232 | <option value="" disabled selected hidden>Select...</option> | 232 | <option value="" disabled selected hidden>Select...</option> |
233 | <option value="corporate">Part 91 (Corporate)</option> | 233 | <option value="corporate">Part 91 (Corporate)</option> |
234 | <option value="charter">Part 135 (Charter)</option> | 234 | <option value="charter">Part 135 (Charter)</option> |
235 | <option value="scheduled">Part 121 (Scheduled)</option> | 235 | <option value="scheduled">Part 121 (Scheduled)</option> |
236 | <option value="military">Military</option> | 236 | <option value="military">Military</option> |
237 | <option value="government">Government</option> | 237 | <option value="government">Government</option> |
238 | </select> | 238 | </select> |
239 | </div> | 239 | </div> |
240 | <div class="clearfix"></div> | 240 | <div class="clearfix"></div> |
241 | </div> | 241 | </div> |
242 | <div class="clearfix"></div> | 242 | <div class="clearfix"></div> |
243 | <br/> | 243 | <br/> |
244 | <div class="col-xs-12"> | 244 | <div class="col-xs-12"> |
245 | <div class="col-md-6"> | 245 | <div class="col-md-6"> |
246 | <div class="pull-left" style="width: 110px;"> | 246 | <div class="pull-left" style="width: 110px;"> |
247 | <b>JET A Margin *</b> | 247 | <b>JET A Margin *</b> |
248 | </div> | 248 | </div> |
249 | <div class="pull-left"> | 249 | <div class="pull-left"> |
250 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> | 250 | <select class="form-control marginSelectBox" ng-model="data.masterMargin" ng-options="margin.id as margin.marginName for margin in jetMarginList" required ng-change="removeMarginValidation()"> |
251 | <option value="" disabled>Select...</option> | 251 | <option value="" disabled>Select...</option> |
252 | </select> | 252 | </select> |
253 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> | 253 | <label ng-show="showMarginError" class="customErrorMessage">This field is required.</label> |
254 | 254 | ||
255 | <div class="clearfix"></div> | 255 | <div class="clearfix"></div> |
256 | </div> | 256 | </div> |
257 | </div> | 257 | </div> |
258 | 258 | ||
259 | <div class="col-md-3 Airport" style="text-align: right;"> | 259 | <div class="col-md-3 Airport" style="text-align: right;"> |
260 | <b>AVGAS 100LL Margin</b> | 260 | <b>AVGAS 100LL Margin</b> |
261 | </div> | 261 | </div> |
262 | <div class="col-md-3 Airport"> | 262 | <div class="col-md-3 Airport"> |
263 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | 263 | <select class="form-control" ng-model="data.avgasMargin" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> |
264 | <option value="" disabled>Select...</option> | 264 | <option value="" disabled>Select...</option> |
265 | </select> | 265 | </select> |
266 | </div> | 266 | </div> |
267 | <div class="clearfix"></div> | 267 | <div class="clearfix"></div> |
268 | </div> | 268 | </div> |
269 | <div class="clearfix"></div> | 269 | <div class="clearfix"></div> |
270 | <br/> | 270 | <br/> |
271 | <div class="col-xs-12"> | 271 | <div class="col-xs-12"> |
272 | <div class="col-md-12"> | 272 | <div class="col-md-12"> |
273 | <div class="pull-left" style="width: 110px;"> | 273 | <div class="pull-left" style="width: 110px;"> |
274 | <label class="new-input-label"><b>Address</b></label> | 274 | <label class="new-input-label"><b>Address</b></label> |
275 | </div> | 275 | </div> |
276 | <div class="pull-left" style="width: calc(100% - 110px);"> | 276 | <div class="pull-left" style="width: calc(100% - 110px);"> |
277 | <input type="text" class="form-control" ng-model="data.addressOne" placeholder=""> | 277 | <input type="text" class="form-control" ng-model="data.addressOne" placeholder=""> |
278 | </div> | 278 | </div> |
279 | <div class="clearfix"></div> | 279 | <div class="clearfix"></div> |
280 | </div> | 280 | </div> |
281 | </div> | 281 | </div> |
282 | <div class="clearfix"></div> | 282 | <div class="clearfix"></div> |
283 | <br/> | 283 | <br/> |
284 | <div class="col-xs-12"> | 284 | <div class="col-xs-12"> |
285 | <div class="col-md-12"> | 285 | <div class="col-md-12"> |
286 | <div class="pull-left" style="width: 110px;"> | 286 | <div class="pull-left" style="width: 110px;"> |
287 | <label class="new-input-label"><b>Address2</b></label> | 287 | <label class="new-input-label"><b>Address2</b></label> |
288 | </div> | 288 | </div> |
289 | <div class="pull-left" style="width: calc(100% - 110px);"> | 289 | <div class="pull-left" style="width: calc(100% - 110px);"> |
290 | <input type="text" ng-model="data.addressTwo" class="form-control" placeholder=""> | 290 | <input type="text" ng-model="data.addressTwo" class="form-control" placeholder=""> |
291 | </div> | 291 | </div> |
292 | <div class="clearfix"></div> | 292 | <div class="clearfix"></div> |
293 | </div> | 293 | </div> |
294 | </div> | 294 | </div> |
295 | <div class="clearfix"></div> | 295 | <div class="clearfix"></div> |
296 | <br/> | 296 | <br/> |
297 | <div class="col-xs-12"> | 297 | <div class="col-xs-12"> |
298 | 298 | ||
299 | <div class="col-md-6"> | 299 | <div class="col-md-6"> |
300 | <div class="pull-left" style="width: 110px;"> | 300 | <div class="pull-left" style="width: 110px;"> |
301 | <label class="new-input-label"><b>City</b></label> | 301 | <label class="new-input-label"><b>City</b></label> |
302 | </div> | 302 | </div> |
303 | <div class="pull-left" style="width: calc(100% - 110px);"> | 303 | <div class="pull-left" style="width: calc(100% - 110px);"> |
304 | <input type="text" ng-model="data.city" class="form-control" placeholder=""> | 304 | <input type="text" ng-model="data.city" class="form-control" placeholder=""> |
305 | </div> | 305 | </div> |
306 | <div class="clearfix"></div> | 306 | <div class="clearfix"></div> |
307 | </div> | 307 | </div> |
308 | <div class="col-md-3"> | 308 | <div class="col-md-3"> |
309 | <div class="pull-left" style="width: 40px;"> | 309 | <div class="pull-left" style="width: 40px;"> |
310 | <label class="new-input-label"><b>State</b></label> | 310 | <label class="new-input-label"><b>State</b></label> |
311 | </div> | 311 | </div> |
312 | <div class="pull-left" style="width: calc(100% - 110px);"> | 312 | <div class="pull-left" style="width: calc(100% - 110px);"> |
313 | <input type="text" ng-model="data.state" class="form-control" placeholder=""> | 313 | <input type="text" ng-model="data.state" class="form-control" placeholder=""> |
314 | </div> | 314 | </div> |
315 | <div class="clearfix"></div> | 315 | <div class="clearfix"></div> |
316 | </div> | 316 | </div> |
317 | <div class="col-md-3"> | 317 | <div class="col-md-3"> |
318 | <div class="pull-left"> | 318 | <div class="pull-left"> |
319 | <label class="new-input-label"><b>Zip Code</b></label> | 319 | <label class="new-input-label"><b>Zip Code</b></label> |
320 | </div> | 320 | </div> |
321 | <div class="pull-right" style="width: calc(100% - 60px);"> | 321 | <div class="pull-right" style="width: calc(100% - 60px);"> |
322 | <input type="tel" ng-model="data.zipcode" class="form-control" placeholder=""> | 322 | <input type="tel" ng-model="data.zipcode" class="form-control" placeholder=""> |
323 | </div> | 323 | </div> |
324 | <div class="clearfix"></div> | 324 | <div class="clearfix"></div> |
325 | </div> | 325 | </div> |
326 | </div> | 326 | </div> |
327 | <div class="clearfix"></div> | 327 | <div class="clearfix"></div> |
328 | <br/> | 328 | <br/> |
329 | <div class="col-xs-12"> | 329 | <div class="col-xs-12"> |
330 | 330 | ||
331 | <div class="col-md-6"> | 331 | <div class="col-md-6"> |
332 | <div class="pull-left" style="width: 110px;"> | 332 | <div class="pull-left" style="width: 110px;"> |
333 | <label class="new-input-label"><b>Country</b></label> | 333 | <label class="new-input-label"><b>Country</b></label> |
334 | </div> | 334 | </div> |
335 | <div class="pull-left" style="width: calc(100% - 110px);"> | 335 | <div class="pull-left" style="width: calc(100% - 110px);"> |
336 | <input type="text" ng-model="data.country" class="form-control" placeholder=""> | 336 | <input type="text" ng-model="data.country" class="form-control" placeholder=""> |
337 | </div> | 337 | </div> |
338 | <div class="clearfix"></div> | 338 | <div class="clearfix"></div> |
339 | </div> | 339 | </div> |
340 | <div class="col-md-6"> | 340 | <div class="col-md-6"> |
341 | <div class="pull-left" style="width: 110px;"> | 341 | <div class="pull-left" style="width: 110px;"> |
342 | <label class="new-input-label"><b>Internal Note</b></label> | 342 | <label class="new-input-label"><b>Internal Note</b></label> |
343 | </div> | 343 | </div> |
344 | <div class="pull-left" style="width: calc(100% - 110px);"> | 344 | <div class="pull-left" style="width: calc(100% - 110px);"> |
345 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> | 345 | <textarea name="message" ng-model="data.internalNote" rows="4" cols="34"></textarea> |
346 | </div> | 346 | </div> |
347 | <div class="clearfix"></div> | 347 | <div class="clearfix"></div> |
348 | </div> | 348 | </div> |
349 | </div> | 349 | </div> |
350 | <div class="clearfix"></div> | 350 | <div class="clearfix"></div> |
351 | <!-- <br/> | 351 | <!-- <br/> |
352 | <div class="col-xs-12"> | 352 | <div class="col-xs-12"> |
353 | <div class="col-md-2 Airport"></div> | 353 | <div class="col-md-2 Airport"></div> |
354 | <div class="col-md-10 Airport"> | 354 | <div class="col-md-10 Airport"> |
355 | <div class="pull-right"> | 355 | <div class="pull-right"> |
356 | <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button> | 356 | <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button> |
357 | <button type="button" class="btn btn-warning" ng-click="addAircraft()">Next: Add Aircraft</button> | 357 | <button type="button" class="btn btn-warning" ng-click="addAircraft()">Next: Add Aircraft</button> |
358 | </div> | 358 | </div> |
359 | </div> | 359 | </div> |
360 | </div> --> | 360 | </div> --> |
361 | </div> | 361 | </div> |
362 | </div> | 362 | </div> |
363 | <div class="clearfix"></div> | 363 | <div class="clearfix"></div> |
364 | </div> | 364 | </div> |
365 | </div> | 365 | </div> |
366 | </div> | 366 | </div> |
367 | </div> | 367 | </div> |
368 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> | 368 | <div class="modal-body step-2" data-step="2" style="padding: 0;"> |
369 | <div> | 369 | <div> |
370 | <div class="row" style="margin: 0;"> | 370 | <div class="row" style="margin: 0;"> |
371 | <div> | 371 | <div> |
372 | <div class="widget" style="margin-bottom: 0;"> | 372 | <div class="widget" style="margin-bottom: 0;"> |
373 | <div class="widget-header"> | 373 | <div class="widget-header"> |
374 | <i class="icon-pencil"></i> | 374 | <i class="icon-pencil"></i> |
375 | <i class="fa fa-tasks" aria-hidden="true"></i> | 375 | <i class="fa fa-tasks" aria-hidden="true"></i> |
376 | <h3>Add a New Company</h3> | 376 | <h3>Add a New Company</h3> |
377 | <div class="clearfix"></div> | 377 | <div class="clearfix"></div> |
378 | </div> | 378 | </div> |
379 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 379 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
380 | <div class="col-xs-12"> | 380 | <div class="col-xs-12"> |
381 | <div class="widget-header"> | 381 | <div class="widget-header"> |
382 | <i class="fa fa-list"></i> | 382 | <i class="fa fa-list"></i> |
383 | <h3>Aircraft List</h3> | 383 | <h3>Aircraft List</h3> |
384 | </div> | 384 | </div> |
385 | <div class="widget-content" style="padding:0px;border: 0px; "> | 385 | <div class="widget-content" style="padding:0px;border: 0px; "> |
386 | <div class="table-responsive"> | 386 | <div class="table-responsive"> |
387 | <!-- <table class="table table-bordered table-hover table-striped addRow" style="margin-bottom: 0px;"> | ||
388 | <thead> | ||
389 | <tr> | ||
390 | <th>Tail</th> | ||
391 | <th>Make</th> | ||
392 | <th>Model</th> | ||
393 | <th>Size</th> | ||
394 | <th>Margin</th> | ||
395 | </tr> | ||
396 | </thead> | ||
397 | <tbody> | ||
398 | <tr> | ||
399 | <td> | ||
400 | <input type="text" style="width:100px;" ng-model="aircraft.tail" class="form-control"> | ||
401 | </td> | ||
402 | <td style="width: 25%;"> | ||
403 | <select class="form-control" ng-model="aircraft.make" ng-change="getModal()"> | ||
404 | <option ng-repeat="make in aircraftMakeList">{{make}}</option> | ||
405 | </select> | ||
406 | </td> | ||
407 | <td style="width: 20%;"> | ||
408 | <select class="form-control" ng-model="aircraft.model" ng-change="getSize()"> | ||
409 | <option ng-repeat="model in aircraftModalList">{{model}}</option> | ||
410 | </select> | ||
411 | </td> | ||
412 | <td style="width: 25%;"> | ||
413 | <select class="form-control" ng-model="aircraft.size"> | ||
414 | <option ng-repeat="size in aircraftSizeList">{{size}}</option> | ||
415 | </select> | ||
416 | </td> | ||
417 | <td> | ||
418 | <select class="form-control"> | ||
419 | <option>Margin1</option> | ||
420 | <option>Margin2</option> | ||
421 | </select> | ||
422 | </td> | ||
423 | </tr> | ||
424 | </tbody> | ||
425 | |||
426 | </table> --> | ||
427 | <table class="table table-striped table-bordered"> | 387 | <table class="table table-striped table-bordered"> |
428 | <thead> | 388 | <thead> |
429 | <tr> | 389 | <tr> |
430 | <!-- <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th> --> | ||
431 | <th>Tail</th> | 390 | <th>Tail</th> |
432 | <th>Make</th> | 391 | <th>Make</th> |
433 | <th>Model</th> | 392 | <th>Model</th> |
434 | <th>Size</th> | 393 | <th>Size</th> |
435 | <th>JET A Margin</th> | 394 | <th>JET A Margin</th> |
436 | <th>AVGS 100LL Margin</th> | 395 | <th>AVGS 100LL Margin</th> |
437 | </tr> | 396 | </tr> |
438 | </thead> | 397 | </thead> |
439 | <tbody> | 398 | <tbody> |
440 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> | 399 | <tr ng-repeat="aircraftData in aircraftDetails track by $index"> |
441 | <!-- <td> | ||
442 | <input type="checkbox" ng-model="aircraftData.selected"/> | ||
443 | </td> --> | ||
444 | <td style="width: 15%"> | 400 | <td style="width: 15%"> |
445 | <input type="text" class="form-control" ng-model="aircraftData.tail" ng-blur="checkJetWithTail(aircraftData.tail, $index)" required/> | 401 | <input type="text" class="form-control" ng-model="aircraftData.tail" ng-blur="checkJetWithTail(aircraftData.tail, $index)" required/> |
446 | </td> | 402 | </td> |
447 | <td style="width: 17%"> | 403 | <td style="width: 17%"> |
448 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> | 404 | <select class="form-control" ng-model="aircraftData.make" ng-change="getModal(aircraftData.make, $index)"> |
449 | <option ng-repeat="make in aircraftMakeList | orderBy">{{make}}</option> | 405 | <option ng-repeat="make in aircraftMakeList | orderBy">{{make}}</option> |
450 | <option value="" disabled>Select...</option> | 406 | <option value="" disabled>Select...</option> |
451 | </select> | 407 | </select> |
452 | </td> | 408 | </td> |
453 | <td style="width: 17%"> | 409 | <td style="width: 17%"> |
454 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> | 410 | <select class="form-control" ng-model="aircraftData.model" ng-change="getSize(aircraftData.model, $index)"> |
455 | <option ng-repeat="model in aircraftData.aircraftModalList | orderBy">{{model}}</option> | 411 | <option ng-repeat="model in aircraftData.aircraftModalList | orderBy">{{model}}</option> |
456 | <option value="" disabled>Select...</option> | 412 | <option value="" disabled>Select...</option> |
457 | </select> | 413 | </select> |
458 | </td> | 414 | </td> |
459 | <td style="width: 17%"> | 415 | <td style="width: 17%"> |
460 | <!-- <select class="form-control" ng-model="aircraftData.sizeId" ng-options="size.aircraftSize.id as size.aircraftSize.size for size in aircraftData.aircraftSizeList"> | ||
461 | <option value="" disabled>Select...</option> | ||
462 | </select> --> | ||
463 | <select class="form-control" ng-model="aircraftData.sizeId"> | 416 | <select class="form-control" ng-model="aircraftData.sizeId"> |
464 | <option value="" disabled>Select</option> | 417 | <option value="" disabled>Select</option> |
465 | <option ng-repeat="size in aircraftData.aircraftSizeList" value="{{size.aircraftSize.id}}">{{size.aircraftSize.size}}</option> | 418 | <option ng-repeat="size in aircraftData.aircraftSizeList" value="{{size.aircraftSize.id}}">{{size.aircraftSize.size}}</option> |
466 | </select> | 419 | </select> |
467 | <!-- <select class="form-control" ng-model="aircraftData.size"> | ||
468 | <option ng-repeat="size in aircraftData.aircraftSizeList">{{size}}</option> | ||
469 | </select> --> | ||
470 | </td> | 420 | </td> |
471 | <td style="width: 17%"> | 421 | <td style="width: 17%"> |
472 | <!-- <select class="form-control" ng-model="aircraftData.marginId" ng-options="margin.id as margin.marginName for margin in jetMarginList"> | ||
473 | <option value="" disabled>Select...</option> | ||
474 | </select> --> | ||
475 | <select class="form-control" ng-model="aircraftData.marginId" ng-disabled="jetShow[$index]"> | 422 | <select class="form-control" ng-model="aircraftData.marginId" ng-disabled="jetShow[$index]"> |
476 | <option value="" disabled>Select</option> | 423 | <option value="" disabled>Select</option> |
477 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> | 424 | <option ng-repeat="margin in jetMarginList" value="{{margin.id}}">{{margin.marginName}}</option> |
478 | </select> | 425 | </select> |
479 | </td> | 426 | </td> |
480 | <td style="width: 17%"> | 427 | <td style="width: 17%"> |
481 | <!-- <select class="form-control marginSelectBox" ng-model="aircraftData.avgasMarginId" ng-options="avgs.id as avgs.marginName for avgs in avgsMarginList"> | ||
482 | <option value="" disabled>Select...</option> | ||
483 | </select> --> | ||
484 | <select class="form-control" ng-model="aircraftData.avgasMarginId" ng-disabled="marginShow[$index]"> | 428 | <select class="form-control" ng-model="aircraftData.avgasMarginId" ng-disabled="marginShow[$index]"> |
485 | <option value="" disabled>Select</option> | 429 | <option value="" disabled>Select</option> |
486 | <option ng-repeat="avgs in avgsMarginList" value="{{avgs.id}}">{{avgs.marginName}}</option> | 430 | <option ng-repeat="avgs in avgsMarginList" value="{{avgs.id}}">{{avgs.marginName}}</option> |
487 | </select> | 431 | </select> |
488 | </td> | 432 | </td> |
489 | </tr> | 433 | </tr> |
490 | </tbody> | 434 | </tbody> |
491 | </table> | 435 | </table> |
492 | </div> | 436 | </div> |
493 | <div class="clearfix"></div> | 437 | <div class="clearfix"></div> |
494 | </div> | 438 | </div> |
495 | </div> | 439 | </div> |
496 | <div class="clearfix"></div> | 440 | <div class="clearfix"></div> |
497 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> | 441 | <div class="col-xs-12" style="margin-bottom: 50px;margin-top: 10px;"> |
498 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> | 442 | <button ng-click="addNew()" class="button1 turquoise pull-right"><span>+</span>Add Aircraft</button> |
499 | </div> | 443 | </div> |
500 | <!-- <div class="col-xs-12" style="margin-bottom: 20px;"> | ||
501 | <div class="pull-right"> | ||
502 | <button type="button" class="btn btn-default" ng-click="cancelCraft()">Cancel</button> | ||
503 | <button type="button" class="btn btn-warning" ng-click="goBack()">Go Back</button> | ||
504 | <button type="button" class="btn btn-success" ng-click="goBack()">Save</button> | ||
505 | </div> | ||
506 | </div> --> | ||
507 | </div> | 444 | </div> |
508 | </div> | 445 | </div> |
509 | <div class="clearfix"></div> | 446 | <div class="clearfix"></div> |
510 | </div> | 447 | </div> |
511 | </div> | 448 | </div> |
512 | </div> | 449 | </div> |
513 | </div> | 450 | </div> |
514 | <!-- <div class="modal-body step-3" data-step="3"> | ||
515 | This is the final step. | ||
516 | </div> --> | ||
517 | <div class="modal-footer" style="border-top: 0;"> | 451 | <div class="modal-footer" style="border-top: 0;"> |
518 | <button type="button" class="btn btn-default" ng-click="reset2()" data-dismiss="modal">Cancel</button> | 452 | <button type="button" class="btn btn-default" ng-click="reset2()" data-dismiss="modal">Cancel</button> |
519 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button> | 453 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addFirstData('#demo-modal-3', 2)">Next: Add Aircraft</button> |
520 | <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button> | 454 | <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 1)">Go Back</button> |
521 | <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> --> | 455 | <!-- <button type="button" class="btn btn-primary step step-2" data-step="2" onclick="sendEvent('#demo-modal-3', 3)">Continue</button> --> |
522 | <button type="button" class="btn btn-success step step-2" data-step="2" ng-click="saveCompanyData()">Save</button> | 456 | <button type="button" class="btn btn-success step step-2" data-step="2" ng-click="saveCompanyData()">Save</button> |
523 | </div> | 457 | </div> |
524 | </div> | 458 | </div> |
525 | </div> | 459 | </div> |
526 | </form> | 460 | </form> |
527 | 461 | ||
528 | 462 | ||
529 | 463 | ||
530 | <form class="modal multi-step" id="demo-modal-4" name="fuelOrderForm"> | 464 | <form class="modal multi-step" id="demo-modal-4" name="fuelOrderForm"> |
531 | <div class="modal-dialog modal-lg"> | 465 | <div class="modal-dialog modal-lg"> |
532 | <div class="modal-content"> | 466 | <div class="modal-content"> |
533 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 467 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
534 | <div> | 468 | <div> |
535 | <div class="row" style="margin: 0;"> | 469 | <div class="row" style="margin: 0;"> |
536 | <div> | 470 | <div> |
537 | <div class="widget" style="margin-bottom: 0;"> | 471 | <div class="widget" style="margin-bottom: 0;"> |
538 | <div class="widget-header"> | 472 | <div class="widget-header"> |
539 | <i class="icon-pencil"></i> | 473 | <i class="icon-pencil"></i> |
540 | <i class="fa fa-tasks" aria-hidden="true"></i> | 474 | <i class="fa fa-tasks" aria-hidden="true"></i> |
541 | <h3>Add a Fuel Order</h3> | 475 | <h3>Add a Fuel Order</h3> |
542 | <div class="clearfix"></div> | 476 | <div class="clearfix"></div> |
543 | </div> | 477 | </div> |
544 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 478 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
545 | <div class="col-xs-12"> | 479 | <div class="col-xs-12"> |
546 | <div class="col-xs-12"> | 480 | <div class="col-xs-12"> |
547 | 481 | ||
548 | <div class="col-md-6"> | 482 | <div class="col-md-6"> |
549 | <div class="pull-left" style="width: 110px;"> | 483 | <div class="pull-left" style="width: 110px;"> |
550 | <label class="new-input-label"><b>Company</b></label> | 484 | <label class="new-input-label"><b>Company</b></label> |
551 | </div> | 485 | </div> |
552 | <div class="pull-left" style="width: calc(100% - 110px);"> | 486 | <div class="pull-left" style="width: calc(100% - 110px);"> |
553 | <select ui-select2 ng-model="order.companyName" ng-change="getAircraft(order.companyName)" style="width: 100%;" required> | 487 | <select ui-select2 ng-model="order.companyName" ng-change="getAircraft(order.companyName)" style="width: 100%;" required> |
554 | <option value="" selected disabled>Select Company</option> | 488 | <option value="" selected disabled>Select Company</option> |
555 | <option ng-repeat="list in companyList">{{list.companyName}}</option> | 489 | <option ng-repeat="list in companyList">{{list.companyName}}</option> |
556 | </select> | 490 | </select> |
557 | </div> | 491 | </div> |
558 | <div class="clearfix"></div> | 492 | <div class="clearfix"></div> |
559 | </div> | 493 | </div> |
560 | <div class="col-md-6"> | 494 | <div class="col-md-6"> |
561 | <div class="pull-left" style="width: 110px;"> | 495 | <div class="pull-left" style="width: 110px;"> |
562 | <label class="new-input-label"><b>Product</b></label> | 496 | <label class="new-input-label"><b>Product</b></label> |
563 | </div> | 497 | </div> |
564 | <div class="pull-left" style="width: calc(100% - 110px);"> | 498 | <div class="pull-left" style="width: calc(100% - 110px);"> |
565 | <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote);addTotal(order.priceQuote, order.volume)" required> | 499 | <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote);addTotal(order.priceQuote, order.volume)" required> |
566 | <option value="" selected disabled>Select Product</option> | 500 | <option value="" selected disabled>Select Product</option> |
567 | <option ng-repeat="margin in marginList" value="{{margin}}">${{margin.papTotal | number : 4}} {{margin.productName}}</option> | 501 | <option ng-repeat="margin in marginList" value="{{margin}}">${{margin.papTotal | number : 4}} {{margin.productName}}</option> |
568 | </select> | 502 | </select> |
569 | </div> | 503 | </div> |
570 | <div class="clearfix"></div> | 504 | <div class="clearfix"></div> |
571 | </div> | 505 | </div> |
572 | 506 | ||
573 | </div> | 507 | </div> |
574 | <div class="clearfix"></div> | 508 | <div class="clearfix"></div> |
575 | <br/> | 509 | <br/> |
576 | 510 | ||
577 | 511 | ||
578 | <div class="col-xs-12"> | 512 | <div class="col-xs-12"> |
579 | 513 | ||
580 | <div class="col-md-6"> | 514 | <div class="col-md-6"> |
581 | <div class="pull-left" style="width: 110px;"> | 515 | <div class="pull-left" style="width: 110px;"> |
582 | <label class="new-input-label"><b>Aircraft</b></label> | 516 | <label class="new-input-label"><b>Aircraft</b></label> |
583 | </div> | 517 | </div> |
584 | <div class="pull-left" style="width: calc(100% - 110px);"> | 518 | <div class="pull-left" style="width: calc(100% - 110px);"> |
585 | <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required> | 519 | <select class="form-control" ng-model="order.aircraftName" ng-change="getAircraftMakeAndModel(order.aircraftName)" required> |
586 | <option selected disabled value="">Select Aircraft</option> | 520 | <option selected disabled value="">Select Aircraft</option> |
587 | <option ng-repeat="list in aircraftList">{{list.tail}}</option> | 521 | <option ng-repeat="list in aircraftList">{{list.tail}}</option> |
588 | </select> | 522 | </select> |
589 | </div> | 523 | </div> |
590 | <div class="clearfix"></div> | 524 | <div class="clearfix"></div> |
591 | </div> | 525 | </div> |
592 | <div class="col-md-6"> | 526 | <div class="col-md-6"> |
593 | <div class="pull-left" style="width: 110px;"> | 527 | <div class="pull-left" style="width: 110px;"> |
594 | <label class="new-input-label"><b>Make</b></label> | 528 | <label class="new-input-label"><b>Make</b></label> |
595 | </div> | 529 | </div> |
596 | <div class="pull-left" style="width: calc(100% - 110px);"> | 530 | <div class="pull-left" style="width: calc(100% - 110px);"> |
597 | <select class="form-control" ng-model="order.aircraftMake" disabled required> | 531 | <select class="form-control" ng-model="order.aircraftMake" disabled required> |
598 | <option selected disabled value="">Select Make</option> | 532 | <option selected disabled value="">Select Make</option> |
599 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> --> | 533 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.make}}</option> --> |
600 | <option ng-repeat="list in aircraftList">{{list.make}}</option> | 534 | <option ng-repeat="list in aircraftList">{{list.make}}</option> |
601 | </select> | 535 | </select> |
602 | </div> | 536 | </div> |
603 | <div class="clearfix"></div> | 537 | <div class="clearfix"></div> |
604 | </div> | 538 | </div> |
605 | 539 | ||
606 | </div> | 540 | </div> |
607 | <div class="clearfix"></div> | 541 | <div class="clearfix"></div> |
608 | <br/> | 542 | <br/> |
609 | 543 | ||
610 | <div class="col-xs-12"> | 544 | <div class="col-xs-12"> |
611 | 545 | ||
612 | <div class="col-md-6"> | 546 | <div class="col-md-6"> |
613 | <div class="pull-left" style="width: 110px;"> | 547 | <div class="pull-left" style="width: 110px;"> |
614 | <label class="new-input-label"><b>Model</b></label> | 548 | <label class="new-input-label"><b>Model</b></label> |
615 | </div> | 549 | </div> |
616 | <div class="pull-left" style="width: calc(100% - 110px);"> | 550 | <div class="pull-left" style="width: calc(100% - 110px);"> |
617 | <select class="form-control" ng-model="order.aircraftModel" disabled required> | 551 | <select class="form-control" ng-model="order.aircraftModel" disabled required> |
618 | <option selected disabled value="">Select Model</option> | 552 | <option selected disabled value="">Select Model</option> |
619 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> --> | 553 | <!-- <option ng-repeat="list in aircraftList" value="{{list}}">{{list.model}}</option> --> |
620 | <option ng-repeat="list in aircraftList">{{list.model}}</option> | 554 | <option ng-repeat="list in aircraftList">{{list.model}}</option> |
621 | </select> | 555 | </select> |
622 | </div> | 556 | </div> |
623 | <div class="clearfix"></div> | 557 | <div class="clearfix"></div> |
624 | </div> | 558 | </div> |
625 | <div class="col-md-6"> | 559 | <div class="col-md-6"> |
626 | <div class="pull-left" style="width: 110px;"> | 560 | <div class="pull-left" style="width: 110px;"> |
627 | <label class="new-input-label"><b>Volume</b></label> | 561 | <label class="new-input-label"><b>Volume</b></label> |
628 | </div> | 562 | </div> |
629 | <div class="pull-left" style="width: calc(100% - 110px);"> | 563 | <div class="pull-left" style="width: calc(100% - 110px);"> |
630 | <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.priceQuote, order.volume)" class="form-control" placeholder="" required> | 564 | <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.priceQuote, order.volume)" class="form-control" placeholder="" required> |
631 | </div> | 565 | </div> |
632 | <div class="clearfix"></div> | 566 | <div class="clearfix"></div> |
633 | </div> | 567 | </div> |
634 | 568 | ||
635 | </div> | 569 | </div> |
636 | <div class="clearfix"></div> | 570 | <div class="clearfix"></div> |
637 | <br/> | 571 | <br/> |
638 | 572 | ||
639 | <div class="col-xs-12"> | 573 | <div class="col-xs-12"> |
640 | 574 | ||
641 | <div class="col-md-6"> | 575 | <div class="col-md-6"> |
642 | <div class="pull-left" style="width: 110px;"> | 576 | <div class="pull-left" style="width: 110px;"> |
643 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> | 577 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> |
644 | </div> | 578 | </div> |
645 | <div class="pull-left" style="width: calc(100% - 110px);"> | 579 | <div class="pull-left" style="width: calc(100% - 110px);"> |
646 | <div style="width: 50%; float: left;"> | 580 | <div style="width: 50%; float: left;"> |
647 | Date | 581 | Date |
648 | <input type="text" style="width: 90%;" ng-model="order.upliftDate" class="form-control" placeholder="" datepicker required/> | 582 | <input type="text" style="width: 90%;" ng-model="order.upliftDate" class="form-control" placeholder="" datepicker required/> |
649 | </div> | 583 | </div> |
650 | <div style="width: 50%; float: left;"> | 584 | <div style="width: 50%; float: left;"> |
651 | Time | 585 | Time |
652 | <select class="form-control" ng-model="order.etaTime" style="width: 100%;" required> | 586 | <select class="form-control" ng-model="order.etaTime" style="width: 100%;" required> |
653 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> | 587 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> |
654 | </select> | 588 | </select> |
655 | 589 | ||
656 | </div> | 590 | </div> |
657 | </div> | 591 | </div> |
658 | <div class="clearfix"></div> | 592 | <div class="clearfix"></div> |
659 | </div> | 593 | </div> |
660 | 594 | ||
661 | <div class="col-md-6" style="margin-top: 22px;" ng-if ="order.status === 'invoiced'"> | 595 | <div class="col-md-6" style="margin-top: 22px;" ng-if ="order.status === 'invoiced'"> |
662 | <div class="pull-left" style="width: 110px;"> | 596 | <div class="pull-left" style="width: 110px;"> |
663 | <label class="new-input-label"><b>Invoiced</b></label> | 597 | <label class="new-input-label"><b>Invoiced</b></label> |
664 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 598 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
665 | </div> | 599 | </div> |
666 | <div class="pull-left" style="width: calc(100% - 110px);"> | 600 | <div class="pull-left" style="width: calc(100% - 110px);"> |
667 | <input type="text" ng-model="order.invoiced" class="form-control" placeholder=""> | 601 | <input type="text" ng-model="order.invoiced" class="form-control" placeholder=""> |
668 | </div> | 602 | </div> |
669 | <div class="clearfix"></div> | 603 | <div class="clearfix"></div> |
670 | </div> | 604 | </div> |
671 | </div> | 605 | </div> |
672 | <div class="clearfix"></div><br> | 606 | <div class="clearfix"></div><br> |
673 | 607 | ||
674 | 608 | ||
675 | <div class="col-xs-12"> | 609 | <div class="col-xs-12"> |
676 | 610 | ||
677 | <div class="col-md-6"> | 611 | <div class="col-md-6"> |
678 | <div class="pull-left" style="width: 110px;"> | 612 | <div class="pull-left" style="width: 110px;"> |
679 | <label class="new-input-label" style="margin-top: 25px;"><b>ETD</b></label> | 613 | <label class="new-input-label" style="margin-top: 25px;"><b>ETD</b></label> |
680 | </div> | 614 | </div> |
681 | <div class="pull-left" style="width: calc(100% - 110px);"> | 615 | <div class="pull-left" style="width: calc(100% - 110px);"> |
682 | <div style="width: 50%; float: left;"> | 616 | <div style="width: 50%; float: left;"> |
683 | Date | 617 | Date |
684 | <input type="text" style="width: 90%;" ng-model="order.departingDate" class="form-control" placeholder="" datepicker/> | 618 | <input type="text" style="width: 90%;" ng-model="order.departingDate" class="form-control" placeholder="" datepicker/> |
685 | </div> | 619 | </div> |
686 | <div style="width: 50%; float: left;"> | 620 | <div style="width: 50%; float: left;"> |
687 | Time | 621 | Time |
688 | <select class="form-control" ng-model="order.etdTime" style="width: 100%;"> | 622 | <select class="form-control" ng-model="order.etdTime" style="width: 100%;"> |
689 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> | 623 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> |
690 | </select> | 624 | </select> |
691 | 625 | ||
692 | </div> | 626 | </div> |
693 | </div> | 627 | </div> |
694 | <div class="clearfix"></div> | 628 | <div class="clearfix"></div> |
695 | </div> | 629 | </div> |
696 | 630 | ||
697 | <div class="col-md-6" style="margin-top: 22px;"> | 631 | <div class="col-md-6" style="margin-top: 22px;"> |
698 | <div class="pull-left" style="width: 110px;"> | 632 | <div class="pull-left" style="width: 110px;"> |
699 | <label class="new-input-label"><b>Total</b></label> | 633 | <label class="new-input-label"><b>Total</b></label> |
700 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 634 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
701 | </div> | 635 | </div> |
702 | <div class="pull-left" style="width: calc(100% - 110px);"> | 636 | <div class="pull-left" style="width: calc(100% - 110px);"> |
703 | <input type="text" class="form-control" disabled ng-model="order.total | number : 4" placeholder="" ng-value="{{order.volume * order.invoiced}}"> | 637 | <input type="text" class="form-control" disabled ng-model="order.total | number : 4" placeholder="" ng-value="{{order.volume * order.invoiced}}"> |
704 | </div> | 638 | </div> |
705 | </div> | 639 | </div> |
706 | </div> | 640 | </div> |
707 | <div class="clearfix"></div><br> | 641 | <div class="clearfix"></div><br> |
708 | 642 | ||
709 | 643 | ||
710 | <div class="col-xs-12"> | 644 | <div class="col-xs-12"> |
711 | 645 | ||
712 | <div class="col-md-6"> | 646 | <div class="col-md-6"> |
713 | <div class="pull-left" style="width: 110px;"> | 647 | <div class="pull-left" style="width: 110px;"> |
714 | <label class="new-input-label"><b>Fuel on</b></label> | 648 | <label class="new-input-label"><b>Fuel on</b></label> |
715 | </div> | 649 | </div> |
716 | <div class="pull-left" style="width: calc(100% - 110px);"> | 650 | <div class="pull-left" style="width: calc(100% - 110px);"> |
717 | <select class="form-control" ng-model="order.fuelOn" style="width: 100%;"> | 651 | <select class="form-control" ng-model="order.fuelOn" style="width: 100%;"> |
718 | <option value="" disabled selected hidden>Arrival</option> | 652 | <option value="" disabled selected hidden>Arrival</option> |
719 | <option value="Arrival">Arrival</option> | 653 | <option value="Arrival">Arrival</option> |
720 | <option value="Departure">Departure</option> | 654 | <option value="Departure">Departure</option> |
721 | </select> | 655 | </select> |
722 | </div> | 656 | </div> |
723 | <div class="clearfix"></div> | 657 | <div class="clearfix"></div> |
724 | </div> | 658 | </div> |
725 | 659 | ||
726 | <div class="col-md-6"> | 660 | <div class="col-md-6"> |
727 | <div class="pull-left" style="width: 110px;"> | 661 | <div class="pull-left" style="width: 110px;"> |
728 | <label class="new-input-label"><b>FBO Cost</b></label> | 662 | <label class="new-input-label"><b>FBO Cost</b></label> |
729 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 663 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
730 | </div> | 664 | </div> |
731 | <div class="pull-left" style="width: calc(100% - 110px);"> | 665 | <div class="pull-left" style="width: calc(100% - 110px);"> |
732 | <input type="text" disabled ng-model="order.fboCost" class="form-control" placeholder="0.0000" valid-number /> | 666 | <input type="text" disabled ng-model="order.fboCost" class="form-control" placeholder="0.0000" valid-number /> |
733 | </div> | 667 | </div> |
734 | <div class="clearfix"></div> | 668 | <div class="clearfix"></div> |
735 | </div> | 669 | </div> |
736 | </div> | 670 | </div> |
737 | <div class="clearfix"></div><br> | 671 | <div class="clearfix"></div><br> |
738 | 672 | ||
739 | <div class="col-xs-12"> | 673 | <div class="col-xs-12"> |
740 | <div class="col-md-6"> | 674 | <div class="col-md-6"> |
741 | <div class="pull-left" style="width: 110px;"> | 675 | <div class="pull-left" style="width: 110px;"> |
742 | <label class="new-input-label"><b>Source</b></label> | 676 | <label class="new-input-label"><b>Source</b></label> |
743 | </div> | 677 | </div> |
744 | <div class="pull-left" style="width: calc(100% - 110px);"> | 678 | <div class="pull-left" style="width: calc(100% - 110px);"> |
745 | <div style="font-weight: normal;" ng-if="baseTenant && !contractFuelVendor">Tenant/Base Customer</br></div> | 679 | <div style="font-weight: normal;" ng-if="baseTenant && !contractFuelVendor">Tenant/Base Customer</br></div> |
746 | <div style="font-weight: normal;" ng-if="contractFuelVendor && !baseTenant">CAA Member</div> | 680 | <div style="font-weight: normal;" ng-if="contractFuelVendor && !baseTenant">CAA Member</div> |
747 | <div style="font-weight: normal;" ng-if="contractFuelVendor && baseTenant">Tenant/CAA</div> | 681 | <div style="font-weight: normal;" ng-if="contractFuelVendor && baseTenant">Tenant/CAA</div> |
748 | <!-- <select class="form-control" ng-model="order.source" style="width: 100%;"> | ||
749 | <option value="" disabled selected hidden>Select Source</option> | ||
750 | <option value="Tenant">Tenant</option> | ||
751 | <option value="CAA">CAA</option> | ||
752 | <option value="Tenant/CAA">Tenant/CAA</option> | ||
753 | </select> --> | ||
754 | </div> | 682 | </div> |
755 | <div class="clearfix"></div> | 683 | <div class="clearfix"></div> |
756 | </div> | 684 | </div> |
757 | </div> | 685 | </div> |
758 | <div class="clearfix"></div> | 686 | <div class="clearfix"></div> |
759 | <br/> | 687 | <br/> |
760 | <div class="col-xs-12"> | 688 | <div class="col-xs-12"> |
761 | 689 | ||
762 | 690 | ||
763 | <div class="col-md-6"> | 691 | <div class="col-md-6"> |
764 | <div class="pull-left" style="width: 110px;"> | 692 | <div class="pull-left" style="width: 110px;"> |
765 | <label class="new-input-label"><b>Certificate Type</b></label> | 693 | <label class="new-input-label"><b>Certificate Type</b></label> |
766 | </div> | 694 | </div> |
767 | <div class="pull-left" style="width: calc(100% - 110px);"> | 695 | <div class="pull-left" style="width: calc(100% - 110px);"> |
768 | <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;"> | 696 | <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;"> |
769 | <option value="" disabled selected hidden>Select...</option> | 697 | <option value="" disabled selected hidden>Select...</option> |
770 | <option value="corporate">Part 91 (Corporate)</option> | 698 | <option value="corporate">Part 91 (Corporate)</option> |
771 | <option value="charter">Part 135 (Charter)</option> | 699 | <option value="charter">Part 135 (Charter)</option> |
772 | <option value="scheduled">Part 121 (Scheduled)</option> | 700 | <option value="scheduled">Part 121 (Scheduled)</option> |
773 | <option value="military">Military</option> | 701 | <option value="military">Military</option> |
774 | <option value="government">Government</option> | 702 | <option value="government">Government</option> |
775 | </select> | 703 | </select> |
776 | </div> | 704 | </div> |
777 | <div class="clearfix"></div> | 705 | <div class="clearfix"></div> |
778 | </div> | 706 | </div> |
779 | <div class="col-md-6"> | 707 | <div class="col-md-6"> |
780 | <div class="pull-left" style="width: 110px;"> | 708 | <div class="pull-left" style="width: 110px;"> |
781 | <label class="new-input-label"><b>Status</b></label> | 709 | <label class="new-input-label"><b>Status</b></label> |
782 | </div> | 710 | </div> |
783 | <div class="pull-left" style="width: calc(100% - 110px);"> | 711 | <div class="pull-left" style="width: calc(100% - 110px);"> |
784 | <select class="form-control" ng-model="order.status" style="width: 100%;"> | 712 | <select class="form-control" ng-model="order.status" style="width: 100%;"> |
785 | <option value="" disabled selected hidden>pending</option> | 713 | <option value="" disabled selected hidden>pending</option> |
786 | <option value="pending">pending</option> | 714 | <option value="pending">pending</option> |
787 | <option value="invoiced">invoiced</option> | 715 | <option value="invoiced">invoiced</option> |
788 | <option value="paid">paid</option> | 716 | <option value="paid">paid</option> |
789 | <!-- <option value="cancelled">cancelled</option> | 717 | <!-- <option value="cancelled">cancelled</option> |
790 | <option value="archived">archived</option> --> | 718 | <option value="archived">archived</option> --> |
791 | </select> | 719 | </select> |
792 | </div> | 720 | </div> |
793 | <div class="clearfix"></div> | 721 | <div class="clearfix"></div> |
794 | </div> | 722 | </div> |
795 | </div> | 723 | </div> |
796 | <div class="clearfix"></div><br> | 724 | <div class="clearfix"></div><br> |
797 | 725 | ||
798 | </div> | 726 | </div> |
799 | </div> | 727 | </div> |
800 | </div> | 728 | </div> |
801 | </div> | 729 | </div> |
802 | </div> | 730 | </div> |
803 | </div> | 731 | </div> |
804 | <div class="modal-footer" style="border-top: 0;"> | 732 | <div class="modal-footer" style="border-top: 0;"> |
805 | <button type="button" class="btn btn-default" ng-click="cancelData()" data-dismiss="modal">Cancel</button> | 733 | <button type="button" class="btn btn-default" ng-click="cancelData()" data-dismiss="modal">Cancel</button> |
806 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-disabled="fuelOrderForm.$invalid" ng-click="addFuelData()">Save</button> | 734 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-disabled="fuelOrderForm.$invalid" ng-click="addFuelData()">Save</button> |
807 | </div> | 735 | </div> |
808 | </div> | 736 | </div> |
809 | </div> | 737 | </div> |
810 | </div> | 738 | </div> |
811 | </form> | 739 | </form> |
812 | 740 | ||
813 | 741 | ||
814 | <form class="modal multi-step" id="demo-modal-5" name="fuelOrderUpdateForm"> | 742 | <form class="modal multi-step" id="demo-modal-5" name="fuelOrderUpdateForm"> |
815 | <div class="modal-dialog modal-lg"> | 743 | <div class="modal-dialog modal-lg"> |
816 | <div class="modal-content"> | 744 | <div class="modal-content"> |
817 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 745 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
818 | <div> | 746 | <div> |
819 | <div class="row" style="margin: 0;"> | 747 | <div class="row" style="margin: 0;"> |
820 | <div> | 748 | <div> |
821 | <div class="widget" style="margin-bottom: 0;"> | 749 | <div class="widget" style="margin-bottom: 0;"> |
822 | <div class="widget-header"> | 750 | <div class="widget-header"> |
823 | <i class="icon-pencil"></i> | 751 | <i class="icon-pencil"></i> |
824 | <i class="fa fa-tasks" aria-hidden="true"></i> | 752 | <i class="fa fa-tasks" aria-hidden="true"></i> |
825 | <h3>Update Fuel Order</h3> | 753 | <h3>Update Fuel Order</h3> |
826 | <div class="clearfix"></div> | 754 | <div class="clearfix"></div> |
827 | </div> | 755 | </div> |
828 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 756 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
829 | <div class="col-xs-12"> | 757 | <div class="col-xs-12"> |
830 | <div class="col-xs-12"> | 758 | <div class="col-xs-12"> |
831 | 759 | ||
832 | <div class="col-md-6"> | 760 | <div class="col-md-6"> |
833 | <div class="pull-left" style="width: 110px;"> | 761 | <div class="pull-left" style="width: 110px;"> |
834 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> | 762 | <label class="new-input-label" style="margin-top: 25px;"><b>ETA</b></label> |
835 | </div> | 763 | </div> |
836 | <div class="pull-left" style="width: calc(100% - 110px);"> | 764 | <div class="pull-left" style="width: calc(100% - 110px);"> |
837 | <div style="width: 50%; float: left;"> | 765 | <div style="width: 50%; float: left;"> |
838 | Date | 766 | Date |
839 | <input type="text" style="width: 90%;" ng-model="editdata.upliftDateString" class="form-control" placeholder="" datepicker/> | 767 | <input type="text" style="width: 90%;" ng-model="editdata.upliftDateString" class="form-control" placeholder="" datepicker/> |
840 | </div> | 768 | </div> |
841 | <div style="width: 50%; float: left;"> | 769 | <div style="width: 50%; float: left;"> |
842 | Time | 770 | Time |
843 | <select class="form-control" ng-model="editdata.etaTime" style="width: 90%;"> | 771 | <select class="form-control" ng-model="editdata.etaTime" style="width: 90%;"> |
844 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> | 772 | <option ng-repeat="li in etaTimeList">{{li.time}}</option> |
845 | </select> | 773 | </select> |
846 | 774 | ||
847 | </div> | 775 | </div> |
848 | </div> | 776 | </div> |
849 | <div class="clearfix"></div> | 777 | <div class="clearfix"></div> |
850 | </div> | 778 | </div> |
851 | <div class="col-md-6" style="margin-top: 25px;"> | 779 | <div class="col-md-6" style="margin-top: 25px;"> |
852 | <div class="pull-left" style="width: 110px;"> | 780 | <div class="pull-left" style="width: 110px;"> |
853 | <label class="new-input-label"><b>Volume</b></label> | 781 | <label class="new-input-label"><b>Volume</b></label> |
854 | </div> | 782 | </div> |
855 | <div class="pull-left" style="width: calc(100% - 110px);"> | 783 | <div class="pull-left" style="width: calc(100% - 110px);"> |
856 | <input type="text" ng-model="editdata.requestedVolume" ng-keyup="updateTotal(editdata.requestedVolume,'v')" class="form-control" placeholder=""> | 784 | <input type="text" ng-model="editdata.requestedVolume" ng-keyup="updateTotal(editdata.requestedVolume,'v')" class="form-control" placeholder=""> |
857 | </div> | 785 | </div> |
858 | <div class="clearfix"></div> | 786 | <div class="clearfix"></div> |
859 | </div> | 787 | </div> |
860 | </div> | 788 | </div> |
861 | <div class="clearfix"></div><br> | 789 | <div class="clearfix"></div><br> |
862 | 790 | ||
863 | <div class="col-xs-12"> | 791 | <div class="col-xs-12"> |
864 | 792 | ||
865 | <div class="col-md-6"> | 793 | <div class="col-md-6"> |
866 | <div class="pull-left" style="width: 110px;"> | 794 | <div class="pull-left" style="width: 110px;"> |
867 | <label class="new-input-label"><b>ETD</b></label> | 795 | <label class="new-input-label"><b>ETD</b></label> |
868 | </div> | 796 | </div> |
869 | <div class="pull-left" style="width: calc(100% - 110px);"> | 797 | <div class="pull-left" style="width: calc(100% - 110px);"> |
870 | <div style="width: 50%; float: left;"> | 798 | <div style="width: 50%; float: left;"> |
871 | <input type="text" style="width: 90%" ng-model="editdata.departingDateString" class="form-control" placeholder="" datepicker/> | 799 | <input type="text" style="width: 90%" ng-model="editdata.departingDateString" class="form-control" placeholder="" datepicker/> |
872 | </div> | 800 | </div> |
873 | <div style="width: 50%; float: left;"> | 801 | <div style="width: 50%; float: left;"> |
874 | <select class="form-control" ng-model="editdata.etdTime" style="width: 90%;"> | 802 | <select class="form-control" ng-model="editdata.etdTime" style="width: 90%;"> |
875 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> | 803 | <option ng-repeat="list in etdTimeList">{{list.time}}</option> |
876 | </select> | 804 | </select> |
877 | </div> | 805 | </div> |
878 | </div> | 806 | </div> |
879 | <div class="clearfix"></div> | 807 | <div class="clearfix"></div> |
880 | </div> | 808 | </div> |
881 | <div class="col-md-6"> | 809 | <div class="col-md-6"> |
882 | <div class="pull-left" style="width: 110px;"> | 810 | <div class="pull-left" style="width: 110px;"> |
883 | <label class="new-input-label"><b>Fuel on</b></label> | 811 | <label class="new-input-label"><b>Fuel on</b></label> |
884 | </div> | 812 | </div> |
885 | <div class="pull-left" style="width: calc(100% - 110px);"> | 813 | <div class="pull-left" style="width: calc(100% - 110px);"> |
886 | <select class="form-control" ng-model="editdata.fuelOn" style="width: 100%;"> | 814 | <select class="form-control" ng-model="editdata.fuelOn" style="width: 100%;"> |
887 | <option value="" disabled selected hidden>Arrival</option> | 815 | <option value="" disabled selected hidden>Arrival</option> |
888 | <option value="Arrival">Arrival</option> | 816 | <option value="Arrival">Arrival</option> |
889 | <option value="Departure">Departure</option> | 817 | <option value="Departure">Departure</option> |
890 | </select> | 818 | </select> |
891 | </div> | 819 | </div> |
892 | <div class="clearfix"></div> | 820 | <div class="clearfix"></div> |
893 | </div> | 821 | </div> |
894 | </div> | 822 | </div> |
895 | <div class="clearfix"></div><br> | 823 | <div class="clearfix"></div><br> |
896 | 824 | ||
897 | <div class="col-xs-12"> | 825 | <div class="col-xs-12"> |
898 | 826 | ||
899 | <div class="col-md-6"> | 827 | <div class="col-md-6"> |
900 | <div class="pull-left" style="width: 110px;"> | 828 | <div class="pull-left" style="width: 110px;"> |
901 | <label class="new-input-label"><b>Company</b></label> | 829 | <label class="new-input-label"><b>Company</b></label> |
902 | </div> | 830 | </div> |
903 | <div class="pull-left" style="width: calc(100% - 110px);"> | 831 | <div class="pull-left" style="width: calc(100% - 110px);"> |
904 | {{editdata.companyName}} | 832 | {{editdata.companyName}} |
905 | </div> | 833 | </div> |
906 | <div class="clearfix"></div> | 834 | <div class="clearfix"></div> |
907 | </div> | 835 | </div> |
908 | <div class="col-md-6"> | 836 | <div class="col-md-6"> |
909 | <div class="pull-left" style="width: 110px;"> | 837 | <div class="pull-left" style="width: 110px;"> |
910 | <label class="new-input-label"><b>Invoiced</b></label> | 838 | <label class="new-input-label"><b>Invoiced</b></label> |
911 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 839 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
912 | </div> | 840 | </div> |
913 | <div class="pull-left" style="width: calc(100% - 110px);"> | 841 | <div class="pull-left" style="width: calc(100% - 110px);"> |
914 | <input type="text" ng-model="editdata.invoiced" ng-keyup="updateTotal(editdata.invoiced,'i')" class="form-control" placeholder=""> | 842 | <input type="text" ng-model="editdata.invoiced" ng-keyup="updateTotal(editdata.invoiced,'i')" class="form-control" placeholder=""> |
915 | </div> | 843 | </div> |
916 | <div class="clearfix"></div> | 844 | <div class="clearfix"></div> |
917 | </div> | 845 | </div> |
918 | 846 | ||
919 | </div> | 847 | </div> |
920 | <div class="clearfix"></div> | 848 | <div class="clearfix"></div> |
921 | <br/> | 849 | <br/> |
922 | 850 | ||
923 | 851 | ||
924 | <div class="col-xs-12"> | 852 | <div class="col-xs-12"> |
925 | 853 | ||
926 | <div class="col-md-6"> | 854 | <div class="col-md-6"> |
927 | <div class="pull-left" style="width: 110px;"> | 855 | <div class="pull-left" style="width: 110px;"> |
928 | <label class="new-input-label"><b>Tail #</b></label> | 856 | <label class="new-input-label"><b>Tail #</b></label> |
929 | </div> | 857 | </div> |
930 | <div class="pull-left" style="width: calc(100% - 110px);"> | 858 | <div class="pull-left" style="width: calc(100% - 110px);"> |
931 | {{editdata.aircraftName}} | 859 | {{editdata.aircraftName}} |
932 | </div> | 860 | </div> |
933 | <div class="clearfix"></div> | 861 | <div class="clearfix"></div> |
934 | </div> | 862 | </div> |
935 | <div class="col-md-6"> | 863 | <div class="col-md-6"> |
936 | <div class="pull-left" style="width: 110px;"> | 864 | <div class="pull-left" style="width: 110px;"> |
937 | <label class="new-input-label"><b>Total</b></label> | 865 | <label class="new-input-label"><b>Total</b></label> |
938 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> | 866 | <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span> |
939 | </div> | 867 | </div> |
940 | <div class="pull-left" style="width: calc(100% - 110px);"> | 868 | <div class="pull-left" style="width: calc(100% - 110px);"> |
941 | <input type="text" class="form-control" disabled ng-model="editdata.total | number : 4" placeholder="" ng-value="{{editdata.requestedVolume * editdata.invoiced}}"> | 869 | <input type="text" class="form-control" disabled ng-model="editdata.total | number : 4" placeholder="" ng-value="{{editdata.requestedVolume * editdata.invoiced}}"> |
942 | </div> | 870 | </div> |
943 | <div class="clearfix"></div> | 871 | <div class="clearfix"></div> |
944 | </div> | 872 | </div> |
945 | </div> | 873 | </div> |
946 | <div class="clearfix"></div> | 874 | <div class="clearfix"></div> |
947 | <br/> | 875 | <br/> |
948 | <div class="col-xs-12"> | 876 | <div class="col-xs-12"> |
949 | 877 | ||
950 | 878 | ||
951 | <div class="col-md-6"> | 879 | <div class="col-md-6"> |
952 | <div class="pull-left" style="width: 110px;"> | 880 | <div class="pull-left" style="width: 110px;"> |
953 | <label class="new-input-label"><b>Source</b></label> | 881 | <label class="new-input-label"><b>Source</b></label> |
954 | </div> | 882 | </div> |
955 | <div class="pull-left" style="width: calc(100% - 110px);"> | 883 | <div class="pull-left" style="width: calc(100% - 110px);"> |
956 | <select class="form-control" ng-model="editdata.source" style="width: 100%;"> | 884 | <select class="form-control" ng-model="editdata.source" style="width: 100%;"> |
957 | <option value="" disabled selected hidden>Select Source</option> | 885 | <option value="" disabled selected hidden>Select Source</option> |
958 | <option value="Tenant">Tenant</option> | 886 | <option value="Tenant">Tenant</option> |
959 | <option value="CAA">CAA</option> | 887 | <option value="CAA">CAA</option> |
960 | <option value="Tenant/CAA">Tenant/CAA</option> | 888 | <option value="Tenant/CAA">Tenant/CAA</option> |
961 | </select> | 889 | </select> |
962 | </div> | 890 | </div> |
963 | <div class="clearfix"></div> | 891 | <div class="clearfix"></div> |
964 | </div> | 892 | </div> |
965 | <div class="col-md-6"> | 893 | <div class="col-md-6"> |
966 | <div class="pull-left" style="width: 110px;"> | 894 | <div class="pull-left" style="width: 110px;"> |
967 | <label class="new-input-label"><b>Product</b></label> | 895 | <label class="new-input-label"><b>Product</b></label> |
968 | </div> | 896 | </div> |
969 | <div class="pull-left" style="width: calc(100% - 110px);"> | 897 | <div class="pull-left" style="width: calc(100% - 110px);"> |
970 | {{editdata.productName}} | 898 | {{editdata.productName}} |
971 | </div> | 899 | </div> |
972 | <div class="clearfix"></div> | 900 | <div class="clearfix"></div> |
973 | </div> | 901 | </div> |
974 | </div> | 902 | </div> |
975 | <div class="clearfix"></div> | 903 | <div class="clearfix"></div> |
976 | <br/> | 904 | <br/> |
977 | 905 | ||
978 | <div class="col-xs-12"> | 906 | <div class="col-xs-12"> |
979 | 907 | ||
980 | <div class="col-md-6"> | 908 | <div class="col-md-6"> |
981 | <div class="pull-left" style="width: 110px;"> | 909 | <div class="pull-left" style="width: 110px;"> |
982 | <label class="new-input-label"><b>Status</b></label> | 910 | <label class="new-input-label"><b>Status</b></label> |
983 | </div> | 911 | </div> |
984 | <div class="pull-left" style="width: calc(100% - 110px);"> | 912 | <div class="pull-left" style="width: calc(100% - 110px);"> |
985 | <select class="form-control" ng-model="editdata.status" style="width: 100%;"> | 913 | <select class="form-control" ng-model="editdata.status" style="width: 100%;"> |
986 | <option value="" disabled selected hidden>Select Status</option> | 914 | <option value="" disabled selected hidden>Select Status</option> |
987 | <option value="pending">pending</option> | 915 | <option value="pending">pending</option> |
988 | <option value="invoiced">invoiced</option> | 916 | <option value="invoiced">invoiced</option> |
989 | <option value="paid">paid</option> | 917 | <option value="paid">paid</option> |
990 | <option value="cancelled">cancelled</option> | 918 | <option value="cancelled">cancelled</option> |
991 | <option value="archived">archived</option> | 919 | <option value="archived">archived</option> |
992 | </select> | 920 | </select> |
993 | </div> | 921 | </div> |
994 | <div class="clearfix"></div> | 922 | <div class="clearfix"></div> |
995 | </div> | 923 | </div> |
996 | <div class="col-md-6"> | 924 | <div class="col-md-6"> |
997 | <div class="pull-left" style="width: 110px;"> | 925 | <div class="pull-left" style="width: 110px;"> |
998 | <label class="new-input-label"><b>Certificate Type</b></label> | 926 | <label class="new-input-label"><b>Certificate Type</b></label> |
999 | </div> | 927 | </div> |
1000 | <div class="pull-left" style="width: calc(100% - 110px);"> | 928 | <div class="pull-left" style="width: calc(100% - 110px);"> |
1001 | <select class="form-control" ng-model="editdata.certificateType" style="width: 100%;" required> | 929 | <select class="form-control" ng-model="editdata.certificateType" style="width: 100%;" required> |
1002 | <option value="" disabled selected hidden>Select...</option> | 930 | <option value="" disabled selected hidden>Select...</option> |
1003 | <option value="corporate">Part 91 (Corporate)</option> | 931 | <option value="corporate">Part 91 (Corporate)</option> |
1004 | <option value="charter">Part 135 (Charter)</option> | 932 | <option value="charter">Part 135 (Charter)</option> |
1005 | <option value="scheduled">Part 121 (Scheduled)</option> | 933 | <option value="scheduled">Part 121 (Scheduled)</option> |
1006 | <option value="military">Military</option> | 934 | <option value="military">Military</option> |
1007 | <option value="government">Government</option> | 935 | <option value="government">Government</option> |
1008 | </select> | 936 | </select> |
1009 | </div> | 937 | </div> |
1010 | 938 | ||
1011 | </div> | 939 | </div> |
1012 | <div class="clearfix"></div> | 940 | <div class="clearfix"></div> |
1013 | <br/> | 941 | <br/> |
1014 | <div class="col-xs-12"> | 942 | <div class="col-xs-12"> |
1015 | </div> | 943 | </div> |
1016 | <div class="clearfix"></div> | 944 | <div class="clearfix"></div> |
1017 | <br/> | 945 | <br/> |
1018 | <div class="col-xs-12"> | 946 | <div class="col-xs-12"> |
1019 | 947 | ||
1020 | </div> | 948 | </div> |
1021 | <div class="clearfix"></div> | 949 | <div class="clearfix"></div> |
1022 | 950 | ||
1023 | </div> | 951 | </div> |
1024 | </div> | 952 | </div> |
1025 | <div class="clearfix"></div> | 953 | <div class="clearfix"></div> |
1026 | </div> | 954 | </div> |
1027 | </div> | 955 | </div> |
1028 | </div> | 956 | </div> |
1029 | </div> | 957 | </div> |
1030 | 958 | ||
1031 | <div class="modal-footer" style="border-top: 0;"> | 959 | <div class="modal-footer" style="border-top: 0;"> |
1032 | <button type="button" class="btn btn-default" ng-click="canceleditdata()" data-dismiss="modal">Cancel</button> | 960 | <button type="button" class="btn btn-default" ng-click="canceleditdata()" data-dismiss="modal">Cancel</button> |
1033 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="updateData()">Save</button> | 961 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="updateData()">Save</button> |
1034 | </div> | 962 | </div> |
1035 | </div> | 963 | </div> |
1036 | </div> | 964 | </div> |
1037 | </div> | 965 | </div> |
1038 | </form> | 966 | </form> |
1039 | 967 | ||
1040 | <form class="modal multi-step" id="demo-modal-6" name="uploadAttachmentForm"> | 968 | <form class="modal multi-step" id="demo-modal-6" name="uploadAttachmentForm"> |
1041 | <div class="modal-dialog modal-xs"> | 969 | <div class="modal-dialog modal-xs"> |
1042 | <div class="modal-content"> | 970 | <div class="modal-content"> |
1043 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 971 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
1044 | <div> | 972 | <div> |
1045 | <div class="row" style="margin: 0;"> | 973 | <div class="row" style="margin: 0;"> |
1046 | <div> | 974 | <div> |
1047 | <div class="widget" style="margin-bottom: 0;"> | 975 | <div class="widget" style="margin-bottom: 0;"> |
1048 | <div class="widget-header"> | 976 | <div class="widget-header"> |
1049 | <i class="icon-pencil"></i> | 977 | <i class="icon-pencil"></i> |
1050 | <i class="fa fa-tasks" aria-hidden="true"></i> | 978 | <i class="fa fa-tasks" aria-hidden="true"></i> |
1051 | <h3>Upload Attachment</h3> | 979 | <h3>Upload Attachment</h3> |
1052 | <div class="clearfix"></div> | 980 | <div class="clearfix"></div> |
1053 | </div> | 981 | </div> |
1054 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 982 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
1055 | <div class="col-xs-6"> | 983 | <div class="col-xs-6"> |
1056 | <div class="col-xs-6"> | 984 | <div class="col-xs-6"> |
1057 | 985 | ||
1058 | <div class="col-md-6"> | 986 | <div class="col-md-6"> |
1059 | <div class="pull-left" style="width: 110px;"> | 987 | <div class="pull-left" style="width: 110px;"> |
1060 | <label class="new-input-label"><b>Upload</b></label> | 988 | <label class="new-input-label"><b>Upload</b></label> |
1061 | <br> | 989 | <br> |
1062 | <br> | 990 | <br> |
1063 | </div> | 991 | </div> |
1064 | <div class="pull-left" style="width: calc(100% - 110px);"> | 992 | <div class="pull-left" style="width: calc(100% - 110px);"> |
1065 | <input type="file" accept=".pdf" file-model = "uploadFile.attachment"> | 993 | <input type="file" accept=".pdf" file-model = "uploadFile.attachment"> |
1066 | <!--<md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker>--> | 994 | <!--<md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker>--> |
1067 | </div> | 995 | </div> |
1068 | <div class="clearfix"></div> | 996 | <div class="clearfix"></div> |
1069 | </div> | 997 | </div> |
1070 | </div> | 998 | </div> |
1071 | <div class="clearfix"></div><br> | 999 | <div class="clearfix"></div><br> |
1072 | 1000 | ||
1073 | </div> | 1001 | </div> |
1074 | </div> | 1002 | </div> |
1075 | <div class="clearfix"></div> | 1003 | <div class="clearfix"></div> |
1076 | </div> | 1004 | </div> |
1077 | </div> | 1005 | </div> |
1078 | </div> | 1006 | </div> |
1079 | </div> | 1007 | </div> |
1080 | 1008 | ||
1081 | <div class="modal-footer" style="border-top: 0;"> | 1009 | <div class="modal-footer" style="border-top: 0;"> |
1082 | <button type="button" class="btn btn-default" ng-click="cancelUploadAttachment()" data-dismiss="modal">Cancel</button> | 1010 | <button type="button" class="btn btn-default" ng-click="cancelUploadAttachment()" data-dismiss="modal">Cancel</button> |
1083 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="saveUploadAttachment(uploadFile.attachment)">Upload</button> | 1011 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="saveUploadAttachment(uploadFile.attachment)">Upload</button> |
1084 | </div> | 1012 | </div> |
1085 | </div> | 1013 | </div> |
1086 | </div> | 1014 | </div> |
1087 | </div> | 1015 | </div> |
1088 | </form> | 1016 | </form> |
1089 | 1017 | ||
1090 | <div class="customConfirmPopBackdrop" id="delete1"> | 1018 | <div class="customConfirmPopBackdrop" id="delete1"> |
1091 | <div class="customModalInner" style="max-width: 400px;"> | 1019 | <div class="customModalInner" style="max-width: 400px;"> |
1092 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 1020 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
1093 | <table> | 1021 | <table> |
1094 | <tr> | 1022 | <tr> |
1095 | <td> | 1023 | <td> |
1096 | <img src="img/info.png" style="width: 50px;"> | 1024 | <img src="img/info.png" style="width: 50px;"> |
1097 | </td> | 1025 | </td> |
1098 | <td> | 1026 | <td> |
1099 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure you want to delete the attachment?</p> | 1027 | <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure you want to delete the attachment?</p> |
1100 | </td> | 1028 | </td> |
1101 | </tr> | 1029 | </tr> |
1102 | </table> | 1030 | </table> |
1103 | </div> | 1031 | </div> |
1104 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 1032 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
1105 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="deleteAttachment()">Yes</button> | 1033 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="deleteAttachment()">Yes</button> |
1106 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDeleteAttachment()">No</button> | 1034 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelDeleteAttachment()">No</button> |
1107 | </div> | 1035 | </div> |
1108 | </div> | 1036 | </div> |
1109 | </div> | 1037 | </div> |
1110 | 1038 | ||
1111 | 1039 | ||
1112 | 1040 | ||
1113 | <div class="myLoader" ng-show="showLoader"> | 1041 | <div class="myLoader" ng-show="showLoader"> |
1114 | <img src="../img/hourglass.gif" width="50px;"> | 1042 | <img src="../img/hourglass.gif" width="50px;"> |
1115 | </div> | 1043 | </div> |
1116 | <script src="js/multi-step-modal.js"></script> | 1044 | <script src="js/multi-step-modal.js"></script> |
1117 | <script> | 1045 | <script> |
1118 | sendEvent = function(sel, step) { | 1046 | sendEvent = function(sel, step) { |
1119 | $(sel).trigger('next.m.' + step); | 1047 | $(sel).trigger('next.m.' + step); |
1120 | } | 1048 | } |
1121 | </script> | 1049 | </script> |
1122 | 1050 | ||
1123 | <script> | 1051 | <script> |
1124 | angular.module("KendoDemos", [ "kendo.directives" ]) | 1052 | angular.module("KendoDemos", [ "kendo.directives" ]) |
1125 | .controller("MyCtrl", function($scope){ | 1053 | .controller("MyCtrl", function($scope){ |
1126 | $scope.getType = function(x) { | 1054 | $scope.getType = function(x) { |
1127 | return typeof x; | 1055 | return typeof x; |
1128 | }; | 1056 | }; |
1129 | $scope.isDate = function(x) { | 1057 | $scope.isDate = function(x) { |
1130 | return x instanceof Date; | 1058 | return x instanceof Date; |
1131 | }; | 1059 | }; |
1132 | }) | 1060 | }) |
1133 | </script> | 1061 | </script> |
1134 | <style type="text/css"> | 1062 | <style type="text/css"> |
1135 | .ui-datepicker-div{ | 1063 | .ui-datepicker-div{ |
1136 | border-bottom: 2px solid #000; | 1064 | border-bottom: 2px solid #000; |
1137 | } | 1065 | } |
1138 | </style> | 1066 | </style> |
app/partials/main/main.controller.js
1 | (function() { | 1 | (function() { |
2 | 'use strict' | 2 | 'use strict' |
3 | 3 | ||
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | .controller('MainController', [ '$scope', '$filter','$rootScope','$state', '$window', '$interval', MainController]); | 5 | .controller('MainController', [ '$scope', '$filter','$rootScope','$state', '$window', '$interval', MainController]); |
6 | 6 | ||
7 | function MainController($scope, $filter, $rootScope,$state, $window, $interval) { | 7 | function MainController($scope, $filter, $rootScope,$state, $window, $interval) { |
8 | 8 | ||
9 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); | 9 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); |
10 | $scope.companyName = JSON.parse(localStorage.getItem('companyName')); | 10 | $scope.companyName = JSON.parse(localStorage.getItem('companyName')); |
11 | var User = JSON.parse(localStorage.getItem('currentUser')); | 11 | var User = JSON.parse(localStorage.getItem('currentUser')); |
12 | 12 | ||
13 | //for login userTime from GetAPI timezone | 13 | //for login userTime from GetAPI timezone |
14 | var tempuserTime = JSON.parse(localStorage.getItem('userTime')); | 14 | var tempuserTime = JSON.parse(localStorage.getItem('userTime')); |
15 | 15 | ||
16 | if (tempuserTime != null) { | 16 | if (tempuserTime != null) { |
17 | if (tempuserTime.slice(0, 1) === "P") { | 17 | if (tempuserTime.slice(0, 1) === "P") { |
18 | $scope.userTimeZone = tempuserTime.replace("P", "+"); | 18 | $scope.userTimeZone = tempuserTime.replace("P", "+"); |
19 | // console.log("==p===",$scope.userTimeZone) | 19 | // console.log("==p===",$scope.userTimeZone) |
20 | } else if (tempuserTime.slice(0, 1) === "M") { | 20 | } else if (tempuserTime.slice(0, 1) === "M") { |
21 | $scope.userTimeZone = tempuserTime.replace("M", "-"); | 21 | $scope.userTimeZone = tempuserTime.replace("M", "-"); |
22 | //console.log("==M===",$scope.userTimeZone) | 22 | //console.log("==M===",$scope.userTimeZone) |
23 | } | 23 | } |
24 | 24 | ||
25 | } else { | 25 | } else { |
26 | 26 | ||
27 | $scope.userTimeZone = JSON.parse(localStorage.getItem('userTimeZone')); | 27 | $scope.userTimeZone = JSON.parse(localStorage.getItem('userTimeZone')); |
28 | //console.log("===$scope.userTimeZone==",$scope.userTimeZone) | 28 | //console.log("===$scope.userTimeZone==",$scope.userTimeZone) |
29 | } | 29 | } |
30 | 30 | ||
31 | 31 | ||
32 | if(User.type === 'ADDITIONAL'){ | 32 | if(User.type === 'ADDITIONAL'){ |
33 | $scope.companyName = $scope.currentUserName; | 33 | $scope.companyName = $scope.currentUserName; |
34 | } | 34 | } |
35 | 35 | ||
36 | 36 | ||
37 | $scope.testFunction = function(){ | 37 | $scope.testFunction = function(){ |
38 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); | 38 | $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); |
39 | $scope.companyName = JSON.parse(localStorage.getItem('companyName')); | 39 | $scope.companyName = JSON.parse(localStorage.getItem('companyName')); |
40 | $scope.userTimeZone = JSON.parse(localStorage.getItem('userTimeZone')); | 40 | $scope.userTimeZone = JSON.parse(localStorage.getItem('userTimeZone')); |
41 | //console.log("===$scope.userTimeZone test==",$scope.userTimeZone) | 41 | //console.log("===$scope.userTimeZone test==",$scope.userTimeZone) |
42 | 42 | ||
43 | } | 43 | } |
44 | 44 | ||
45 | $scope.logout = function(){ | 45 | $scope.logout = function(){ |
46 | $state.go('login'); | 46 | $state.go('login'); |
47 | localStorage.clear(); | 47 | localStorage.clear(); |
48 | $rootScope.isAuthenticated = false; | 48 | $rootScope.isAuthenticated = false; |
49 | 49 | ||
50 | } | 50 | } |
51 | 51 | ||
52 | /** | 52 | /** |
53 | Automatic logout session after 2 hours | 53 | Automatic logout session after 2 hours |
54 | **/ | 54 | **/ |
55 | 55 | ||
56 | var resetTime; | 56 | var resetTime; |
57 | /*function warning(){ | ||
58 | //setTimeout(function(){ | ||
59 | $('.warning-message').delay(5000).css('display', 'block'); | ||
60 | //}, 5000); | ||
61 | }*/ | ||
62 | 57 | ||
63 | resetTime = setInterval(function(){ | 58 | resetTime = setInterval(function(){ |
64 | // $('.warning-message').delay(5000).css('display', 'block'); | 59 | // $('.warning-message').delay(5000).css('display', 'block'); |
65 | //console.log('out'); | 60 | //console.log('out'); |
66 | localStorage.clear(); | 61 | localStorage.clear(); |
67 | $state.go('login'); | 62 | $state.go('login'); |
68 | }, 7200000); | 63 | }, 7200000); |
69 | 64 | ||
70 | 65 | ||
71 | $(document).mousemove(function(event){ | 66 | $(document).mousemove(function(event){ |
72 | clearInterval(resetTime); | 67 | clearInterval(resetTime); |
73 | //$('.warning-message').delay(5000).css('display', 'none'); | 68 | //$('.warning-message').delay(5000).css('display', 'none'); |
74 | // warning(); | 69 | // warning(); |
75 | //console.log('restart'); | 70 | //console.log('restart'); |
76 | resetTime = setInterval(function(){ | 71 | resetTime = setInterval(function(){ |
77 | //console.log('out'); | 72 | //console.log('out'); |
78 | //warning(); | 73 | //warning(); |
79 | localStorage.clear(); | 74 | localStorage.clear(); |
80 | $state.go('login'); | 75 | $state.go('login'); |
81 | }, 7200000); | 76 | }, 7200000); |
82 | }) | 77 | }) |
83 | 78 | ||
84 | |||
85 | |||
86 | // Flight Tracking page code | ||
87 | |||
88 | /*$scope.reloadPage = function(){ | ||
89 | console.log("if",$state) | ||
90 | console.log("=========state name",$state.current.name); | ||
91 | // $state.go('app.flightTracking', {}, {reload: 'app.flightTracking'}) | ||
92 | //$state.go($state.current, {}, {reload: true}); | ||
93 | |||
94 | if($state.current.name != "app.flightTracking"){ | ||
95 | $window.location.href = '/#!/flightTracking'; | ||
96 | setInterval(function(){ | ||
97 | console.log("come") | ||
98 | $window.location.reload() | ||
99 | },10); | ||
100 | }else{ | ||
101 | console.log("flight tracking state found====="); | ||
102 | $window.location.reload(); | ||
103 | } | ||
104 | }*/ | ||
105 | |||
106 | // Set timeout variables. | ||
107 | |||
108 | } | 79 | } |
109 | //var timoutWarning = 840000; // Display warning in 14 Mins. | 80 | |
110 | //var timoutNow = 900000; // Timeout in 15 mins. | ||
111 | |||
112 | |||
113 | 81 | ||
114 | 82 | ||
115 | })(); | 83 | })(); |
116 | 84 | ||
117 | 85 |
app/partials/scheduler/scheduler.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | 4 | ||
5 | .controller('schedulerController', ['$scope','$compile', 'uiCalendarConfig', 'schedulerService', function($scope, $compile, uiCalendarConfig, schedulerService) { | 5 | .controller('schedulerController', ['$scope','$compile', 'uiCalendarConfig', 'schedulerService', function($scope, $compile, uiCalendarConfig, schedulerService) { |
6 | 6 | ||
7 | 7 | ||
8 | $scope.showLoader = true; | 8 | $scope.showLoader = true; |
9 | getEventsList(); | 9 | getEventsList(); |
10 | 10 | ||
11 | /*---get events on calendar---*/ | 11 | /*---get events on calendar---*/ |
12 | $scope.events = []; | 12 | $scope.events = []; |
13 | function getEventsList(){ | 13 | function getEventsList(){ |
14 | schedulerService.getEvents().then(function(result) { | 14 | schedulerService.getEvents().then(function(result) { |
15 | console.log("===events==",result) | ||
15 | 16 | ||
16 | for (var i = 0; i < result.length; i++) { | 17 | for (var i = 0; i < result.length; i++) { |
17 | var newTime = new Date(result[i].deployDate); | 18 | var newTime = new Date(result[i].deployDate); |
18 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 19 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
19 | var dday = newTime.getUTCDate(); | 20 | var dday = newTime.getUTCDate(); |
20 | var dyear = newTime.getUTCFullYear(); | 21 | var dyear = newTime.getUTCFullYear(); |
21 | var hours = newTime.getHours(); | 22 | var hours = newTime.getHours(); |
22 | var min = newTime.getMinutes(); | 23 | var min = newTime.getMinutes(); |
23 | var sec = newTime.getSeconds(); | 24 | var sec = newTime.getSeconds(); |
24 | 25 | ||
25 | $scope.events.push({ | 26 | $scope.events.push({ |
26 | 'id': result[i].id, | 27 | 'id': result[i].id, |
27 | 'title': result[i].aircraft +'\n' + '(' + result[i].make +'/' + result[i].model + ')' + '\n' + 'for' + ' ' + result[i].requestedVolume + ' ' + 'gal.' + ' ' +'@' + ' ' +'$'+result[i].priceQuote, | 28 | 'title': result[i].aircraft +'\n' + '(' + result[i].make +'/' + result[i].model + ')' + '\n' + 'for' + ' ' + result[i].requestedVolume + ' ' + 'gal.' + ' ' +'@' + ' ' +'$'+result[i].priceQuote, |
28 | 'start': dyear+'-'+dmonth+'-'+dday + ' ' + hours + ':' + min + ':' + sec | 29 | 'start': dyear+'-'+dmonth+'-'+dday + ' ' + hours + ':' + min + ':' + sec |
29 | 30 | ||
30 | }) | 31 | }) |
31 | // $scope.showEventsList(); | 32 | // $scope.showEventsList(); |
32 | $scope.showLoader = false; | 33 | $scope.showLoader = false; |
33 | } | 34 | } |
34 | 35 | ||
35 | $('#my-calendar').fullCalendar('removeEvents'); | 36 | $('#my-calendar').fullCalendar('removeEvents'); |
36 | $('#my-calendar').fullCalendar('addEventSource',$scope.events); | 37 | $('#my-calendar').fullCalendar('addEventSource',$scope.events); |
37 | $('#my-calendar').fullCalendar('refetchEvents'); | 38 | $('#my-calendar').fullCalendar('refetchEvents'); |
38 | 39 | ||
39 | //$scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF]; | 40 | //$scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF]; |
40 | 41 | ||
41 | // $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 42 | // $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
42 | }) | 43 | }) |
43 | } | 44 | } |
44 | 45 | ||
45 | 46 | ||
46 | 47 | ||
47 | $scope.newEvent = {}; | 48 | $scope.newEvent = {}; |
48 | $scope.addNewEvent = function(){ | 49 | $scope.addNewEvent = function(){ |
49 | $scope.showLoader = true; | 50 | $scope.showLoader = true; |
50 | if ($scope.newEvent.deployDate != undefined) { | 51 | if ($scope.newEvent.deployDate != undefined) { |
51 | $scope.newEvent.deployDate = new Date($scope.newEvent.deployDate); | 52 | $scope.newEvent.deployDate = new Date($scope.newEvent.deployDate); |
52 | $scope.newEvent.deployDate = $scope.newEvent.deployDate.getTime(); | 53 | $scope.newEvent.deployDate = $scope.newEvent.deployDate.getTime(); |
53 | } | 54 | } |
54 | //var data = 'aircraft='+$scope.newEvent.aircraft+'&deployDate='+$scope.newEvent.deployDate; | 55 | //var data = 'aircraft='+$scope.newEvent.aircraft+'&deployDate='+$scope.newEvent.deployDate; |
55 | schedulerService.addNewEventService($scope.newEvent).then(function(response){ | 56 | schedulerService.addNewEventService($scope.newEvent).then(function(response){ |
56 | $scope.newEvent = {}; | 57 | $scope.newEvent = {}; |
57 | $('#addEvent').modal('hide'); | 58 | $('#addEvent').modal('hide'); |
58 | $scope.events = []; | 59 | $scope.events = []; |
59 | getEventsList(); | 60 | getEventsList(); |
60 | }) | 61 | }) |
61 | } | 62 | } |
62 | 63 | ||
63 | $scope.cancelAdd = function(){ | 64 | $scope.cancelAdd = function(){ |
64 | $scope.newEvent = {}; | 65 | $scope.newEvent = {}; |
65 | } | 66 | } |
66 | 67 | ||
67 | $scope.editData = {}; | 68 | $scope.editData = {}; |
68 | $scope.editEvent = function(data){ | 69 | $scope.editEvent = function(data){ |
69 | $scope.editData = data; | 70 | $scope.editData = data; |
70 | $('#editEvent').modal('show'); | 71 | $('#editEvent').modal('show'); |
71 | } | 72 | } |
72 | $scope.updateEvent = function(){ | 73 | $scope.updateEvent = function(){ |
73 | $scope.showLoader = true; | 74 | $scope.showLoader = true; |
74 | $scope.updatedData = {}; | 75 | $scope.updatedData = {}; |
75 | $scope.updatedData.id = $scope.editData.id; | 76 | $scope.updatedData.id = $scope.editData.id; |
76 | $scope.updatedData.deployDate = $scope.editData.start; | 77 | $scope.updatedData.deployDate = $scope.editData.start; |
77 | if ($scope.updatedData.deployDate != undefined) { | 78 | if ($scope.updatedData.deployDate != undefined) { |
78 | $scope.updatedData.deployDate = new Date($scope.updatedData.deployDate); | 79 | $scope.updatedData.deployDate = new Date($scope.updatedData.deployDate); |
79 | $scope.updatedData.deployDate = $scope.updatedData.deployDate.getTime(); | 80 | $scope.updatedData.deployDate = $scope.updatedData.deployDate.getTime(); |
80 | } | 81 | } |
81 | schedulerService.updateScheduledEvent($scope.updatedData).then(function(response){ | 82 | schedulerService.updateScheduledEvent($scope.updatedData).then(function(response){ |
82 | $scope.updatedData = {}; | 83 | $scope.updatedData = {}; |
83 | $('#editEvent').modal('hide'); | 84 | $('#editEvent').modal('hide'); |
84 | toastr.success('Updated Successfully', { | 85 | toastr.success('Updated Successfully', { |
85 | closeButton: true | 86 | closeButton: true |
86 | }) | 87 | }) |
87 | $scope.events = []; | 88 | $scope.events = []; |
88 | getEventsList(); | 89 | getEventsList(); |
89 | }) | 90 | }) |
90 | } | 91 | } |
91 | 92 | ||
92 | 93 | ||
93 | /* code for calendar */ | 94 | /* code for calendar */ |
94 | 95 | ||
95 | var date = new Date(); | 96 | var date = new Date(); |
96 | var d = date.getDate(); | 97 | var d = date.getDate(); |
97 | var m = date.getMonth(); | 98 | var m = date.getMonth(); |
98 | var y = date.getFullYear(); | 99 | var y = date.getFullYear(); |
99 | 100 | ||
100 | $scope.changeTo = 'Hungarian'; | 101 | $scope.changeTo = 'Hungarian'; |
101 | 102 | ||
102 | $scope.eventSource = {}; | 103 | $scope.eventSource = {}; |
103 | 104 | ||
104 | $scope.eventsF = function (start, end, timezone, callback) { | 105 | $scope.eventsF = function (start, end, timezone, callback) { |
105 | var s = new Date(start).getTime() / 1000; | 106 | var s = new Date(start).getTime() / 1000; |
106 | var e = new Date(end).getTime() / 1000; | 107 | var e = new Date(end).getTime() / 1000; |
107 | var m = new Date(start).getMonth(); | 108 | var m = new Date(start).getMonth(); |
108 | var events = [{title: 'Feed Me ' + m,start: s + (50000),end: s + (100000),allDay: false, className: ['customFeed']}]; | 109 | var events = [{title: 'Feed Me ' + m,start: s + (50000),end: s + (100000),allDay: false, className: ['customFeed']}]; |
109 | callback(events); | 110 | callback(events); |
110 | }; | 111 | }; |
111 | 112 | ||
112 | $scope.calEventsExt = { | 113 | $scope.calEventsExt = { |
113 | color: '#f00', | 114 | color: '#f00', |
114 | textColor: 'yellow', | 115 | textColor: 'yellow', |
115 | events: [] | 116 | events: [] |
116 | }; | 117 | }; |
117 | 118 | ||
118 | $scope.alertOnEventClick = function( date, jsEvent, view){ | 119 | $scope.alertOnEventClick = function( date, jsEvent, view){ |
119 | $scope.alertMessage = (date.title + ' was clicked '); | 120 | $scope.alertMessage = (date.title + ' was clicked '); |
120 | }; | 121 | }; |
121 | 122 | ||
122 | $scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){ | 123 | $scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){ |
123 | var dmonth = event.start._d.getUTCMonth() + 1; //months from 1-12 | 124 | var dmonth = event.start._d.getUTCMonth() + 1; //months from 1-12 |
124 | var dday = event.start._d.getUTCDate(); | 125 | var dday = event.start._d.getUTCDate(); |
125 | var dyear = event.start._d.getUTCFullYear(); | 126 | var dyear = event.start._d.getUTCFullYear(); |
126 | var setDeploy = new Date(); | 127 | var setDeploy = new Date(); |
127 | var hours = setDeploy.getHours(); | 128 | var hours = setDeploy.getHours(); |
128 | var min = setDeploy.getMinutes(); | 129 | var min = setDeploy.getMinutes(); |
129 | var sec = setDeploy.getSeconds(); | 130 | var sec = setDeploy.getSeconds(); |
130 | 131 | ||
131 | for (var i = 0; i < $scope.events.length; i++) { | 132 | for (var i = 0; i < $scope.events.length; i++) { |
132 | if ($scope.events[i].id == event.id) { | 133 | if ($scope.events[i].id == event.id) { |
133 | //$scope.events[i].start = dyear+'-'+dmonth+'-'+dday; | 134 | //$scope.events[i].start = dyear+'-'+dmonth+'-'+dday; |
134 | $scope.showLoader = true; | 135 | $scope.showLoader = true; |
135 | $scope.updatedDataDrop = {}; | 136 | $scope.updatedDataDrop = {}; |
136 | $scope.updatedDataDrop.id = $scope.events[i].id; | 137 | $scope.updatedDataDrop.id = $scope.events[i].id; |
137 | $scope.updatedDataDrop.aircraft = $scope.events[i].title; | 138 | $scope.updatedDataDrop.aircraft = $scope.events[i].title; |
138 | $scope.updatedDataDrop.deployDate = dyear+'-'+dmonth+'-'+dday + ' ' + hours + ':' + min + ':' + sec; | 139 | $scope.updatedDataDrop.deployDate = dyear+'-'+dmonth+'-'+dday + ' ' + hours + ':' + min + ':' + sec; |
139 | if ($scope.updatedDataDrop.deployDate != undefined) { | 140 | if ($scope.updatedDataDrop.deployDate != undefined) { |
140 | $scope.updatedDataDrop.deployDate = new Date($scope.updatedDataDrop.deployDate); | 141 | $scope.updatedDataDrop.deployDate = new Date($scope.updatedDataDrop.deployDate); |
141 | $scope.updatedDataDrop.deployDate = $scope.updatedDataDrop.deployDate.getTime(); | 142 | $scope.updatedDataDrop.deployDate = $scope.updatedDataDrop.deployDate.getTime(); |
142 | } | 143 | } |
143 | schedulerService.updateScheduledEvent($scope.updatedDataDrop).then(function(response){ | 144 | schedulerService.updateScheduledEvent($scope.updatedDataDrop).then(function(response){ |
144 | $scope.updatedDataDrop = {}; | 145 | $scope.updatedDataDrop = {}; |
145 | $('#editEvent').modal('hide'); | 146 | $('#editEvent').modal('hide'); |
146 | toastr.success('Updated Successfully', { | 147 | toastr.success('Updated Successfully', { |
147 | closeButton: true | 148 | closeButton: true |
148 | }) | 149 | }) |
149 | $scope.events = []; | 150 | $scope.events = []; |
150 | getEventsList(); | 151 | getEventsList(); |
151 | }) | 152 | }) |
152 | 153 | ||
153 | } | 154 | } |
154 | } | 155 | } |
155 | $scope.alertMessage = ('Event Droped to make dayDelta ' + delta); | 156 | $scope.alertMessage = ('Event Droped to make dayDelta ' + delta); |
156 | }; | 157 | }; |
157 | 158 | ||
158 | $scope.alertOnResize = function(event, delta, revertFunc, jsEvent, ui, view ){ | 159 | $scope.alertOnResize = function(event, delta, revertFunc, jsEvent, ui, view ){ |
159 | $scope.alertMessage = ('Event Resized to make dayDelta ' + delta); | 160 | $scope.alertMessage = ('Event Resized to make dayDelta ' + delta); |
160 | }; | 161 | }; |
161 | 162 | ||
162 | $scope.addRemoveEventSource = function(sources,source) { | 163 | $scope.addRemoveEventSource = function(sources,source) { |
163 | var canAdd = 0; | 164 | var canAdd = 0; |
164 | angular.forEach(sources,function(value, key){ | 165 | angular.forEach(sources,function(value, key){ |
165 | if(sources[key] === source){ | 166 | if(sources[key] === source){ |
166 | sources.splice(key,1); | 167 | sources.splice(key,1); |
167 | canAdd = 1; | 168 | canAdd = 1; |
168 | } | 169 | } |
169 | }); | 170 | }); |
170 | if(canAdd === 0){ | 171 | if(canAdd === 0){ |
171 | sources.push(source); | 172 | sources.push(source); |
172 | } | 173 | } |
173 | }; | 174 | }; |
174 | 175 | ||
175 | $scope.addEvent = function() { | 176 | $scope.addEvent = function() { |
176 | $scope.events.push({ | 177 | $scope.events.push({ |
177 | title: 'Open Sesame', | 178 | title: 'Open Sesame', |
178 | start: new Date(y, m, 28), | 179 | start: new Date(y, m, 28), |
179 | end: new Date(y, m, 29), | 180 | end: new Date(y, m, 29), |
180 | className: ['openSesame'] | 181 | className: ['openSesame'] |
181 | }); | 182 | }); |
182 | }; | 183 | }; |
183 | 184 | ||
184 | $scope.remove = function(index) { | 185 | $scope.remove = function(index) { |
185 | $scope.events.splice(index,1); | 186 | $scope.events.splice(index,1); |
186 | }; | 187 | }; |
187 | 188 | ||
188 | $scope.changeView = function(view,calendar) { | 189 | $scope.changeView = function(view,calendar) { |
189 | uiCalendarConfig.calendars[calendar].fullCalendar('changeView',view); | 190 | uiCalendarConfig.calendars[calendar].fullCalendar('changeView',view); |
190 | }; | 191 | }; |
191 | 192 | ||
192 | $scope.renderCalender = function(calendar) { | 193 | $scope.renderCalender = function(calendar) { |
193 | if(uiCalendarConfig.calendars[calendar]){ | 194 | if(uiCalendarConfig.calendars[calendar]){ |
194 | uiCalendarConfig.calendars[calendar].fullCalendar('render'); | 195 | uiCalendarConfig.calendars[calendar].fullCalendar('render'); |
195 | } | 196 | } |
196 | }; | 197 | }; |
197 | 198 | ||
198 | $scope.eventRender = function( event, element, view ) { | 199 | $scope.eventRender = function( event, element, view ) { |
199 | element.attr({'tooltip': event.title, | 200 | element.attr({'tooltip': event.title, |
200 | 'tooltip-append-to-body': true}); | 201 | 'tooltip-append-to-body': true}); |
201 | $compile(element)($scope); | 202 | $compile(element)($scope); |
202 | }; | 203 | }; |
203 | 204 | ||
204 | $scope.uiConfig = { | 205 | $scope.uiConfig = { |
205 | calendar:{ | 206 | calendar:{ |
206 | height: 450, | 207 | height: 450, |
207 | editable: true, | 208 | editable: true, |
208 | droppable: true, | 209 | droppable: true, |
209 | drop: function (event, delta, revertFunc, jsEvent, ui, view) { | 210 | drop: function (event, delta, revertFunc, jsEvent, ui, view) { |
210 | }, | 211 | }, |
211 | header:{ | 212 | header:{ |
212 | right: 'month basicWeek basicDay', | 213 | right: 'month basicWeek basicDay', |
213 | center: 'title', | 214 | center: 'title', |
214 | left: 'prev,next, today' | 215 | left: 'prev,next, today' |
215 | }, | 216 | }, |
216 | eventClick: $scope.alertOnEventClick, | 217 | eventClick: $scope.alertOnEventClick, |
217 | eventDrop: $scope.alertOnDrop, | 218 | eventDrop: $scope.alertOnDrop, |
218 | eventResize: $scope.alertOnResize, | 219 | eventResize: $scope.alertOnResize, |
219 | eventRender: $scope.eventRender | 220 | eventRender: $scope.eventRender |
220 | } | 221 | } |
221 | }; | 222 | }; |
222 | 223 | ||
223 | $scope.addEvent = function(index) { | 224 | $scope.addEvent = function(index) { |
224 | //console.log('INDEX', index); | 225 | //console.log('INDEX', index); |
225 | //console.log('EVENTS', $scope.eventSources); | 226 | //console.log('EVENTS', $scope.eventSources); |
226 | // $scope.events.push($scope.eventList[index]); | 227 | // $scope.events.push($scope.eventList[index]); |
227 | } | 228 | } |
228 | 229 | ||
229 | /*$scope.showEventsList = function(){ | 230 | /*$scope.showEventsList = function(){ |
230 | console.log('testing', $scope.eventsF); | 231 | console.log('testing', $scope.eventsF); |
231 | 232 | ||
232 | };*/ | 233 | };*/ |
233 | 234 | ||
234 | //$scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF]; | 235 | //$scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF]; |
235 | //$scope.eventSources2 = [$scope.calEventsExt, $scope.eventsF, $scope.events]; | 236 | //$scope.eventSources2 = [$scope.calEventsExt, $scope.eventsF, $scope.events]; |
236 | }]); | 237 | }]); |
237 | 238 | ||
238 | 239 |
app/partials/scheduler/scheduler.html
1 | <style type="text/css"> | 1 | <style type="text/css"> |
2 | .newUlView { | 2 | .newUlView { |
3 | padding: 5px; | 3 | padding: 5px; |
4 | margin: 3px; | 4 | margin: 3px; |
5 | } | 5 | } |
6 | .subnavbar .mainnav > li:nth-child(5) > a{ | 6 | .subnavbar .mainnav > li:nth-child(5) > a{ |
7 | color: #ca5c6a; | 7 | color: #ca5c6a; |
8 | } | 8 | } |
9 | .fc button, .fc-button-group, .fc-time-grid .fc-event .fc-time span{ | 9 | .fc button, .fc-button-group, .fc-time-grid .fc-event .fc-time span{ |
10 | display: block; | 10 | display: block; |
11 | } | 11 | } |
12 | .fc-state-default{ | 12 | .fc-state-default{ |
13 | background-color: #fff; | 13 | background-color: #fff; |
14 | background-image: none; | 14 | background-image: none; |
15 | } | 15 | } |
16 | .fc-state-active, .fc-state-down{ | 16 | .fc-state-active, .fc-state-down{ |
17 | box-shadow: none; | 17 | box-shadow: none; |
18 | color: #fff; | 18 | color: #fff; |
19 | background-color: #ff9900; | 19 | background-color: #ff9900; |
20 | } | 20 | } |
21 | .stacked:after, .stacked:before{ | 21 | .stacked:after, .stacked:before{ |
22 | display: none; | 22 | display: none; |
23 | } | 23 | } |
24 | .btn-white, .btn-white:hover{ | 24 | .btn-white, .btn-white:hover{ |
25 | background-color: #fff; | 25 | background-color: #fff; |
26 | background-image: none; | 26 | background-image: none; |
27 | } | 27 | } |
28 | .fc-day-grid-event .fc-time{ | 28 | .fc-day-grid-event .fc-time{ |
29 | display: none; | 29 | display: none; |
30 | } | 30 | } |
31 | 31 | ||
32 | /*#wrap { | 32 | /*#wrap { |
33 | width: 1100px; | 33 | width: 1100px; |
34 | margin: 0 auto; | 34 | margin: 0 auto; |
35 | } | 35 | } |
36 | 36 | ||
37 | #external-events { | 37 | #external-events { |
38 | float: left; | 38 | float: left; |
39 | width: 150px; | 39 | width: 150px; |
40 | padding: 0 10px; | 40 | padding: 0 10px; |
41 | border: 1px solid #ccc; | 41 | border: 1px solid #ccc; |
42 | background: #eee; | 42 | background: #eee; |
43 | text-align: left; | 43 | text-align: left; |
44 | } | 44 | } |
45 | 45 | ||
46 | #external-events h4 { | 46 | #external-events h4 { |
47 | font-size: 16px; | 47 | font-size: 16px; |
48 | margin-top: 0; | 48 | margin-top: 0; |
49 | padding-top: 1em; | 49 | padding-top: 1em; |
50 | } | 50 | } |
51 | 51 | ||
52 | #external-events .fc-event { | 52 | #external-events .fc-event { |
53 | margin: 10px 0; | 53 | margin: 10px 0; |
54 | cursor: pointer; | 54 | cursor: pointer; |
55 | } | 55 | } |
56 | 56 | ||
57 | #external-events p { | 57 | #external-events p { |
58 | margin: 1.5em 0; | 58 | margin: 1.5em 0; |
59 | font-size: 11px; | 59 | font-size: 11px; |
60 | color: #666; | 60 | color: #666; |
61 | } | 61 | } |
62 | 62 | ||
63 | #external-events p input { | 63 | #external-events p input { |
64 | margin: 0; | 64 | margin: 0; |
65 | vertical-align: middle; | 65 | vertical-align: middle; |
66 | } | 66 | } |
67 | 67 | ||
68 | #calendar { | 68 | #calendar { |
69 | float: right; | 69 | float: right; |
70 | width: 900px; | 70 | width: 900px; |
71 | }*/ | 71 | }*/ |
72 | </style> | 72 | </style> |
73 | 73 | ||
74 | <div class="myLoader" ng-show="showLoader"> | 74 | <div class="myLoader" ng-show="showLoader"> |
75 | <img src="../img/hourglass.gif" width="50px;"> | 75 | <img src="../img/hourglass.gif" width="50px;"> |
76 | </div> | 76 | </div> |
77 | 77 | ||
78 | <div class="main"> | 78 | <div class="main"> |
79 | <div class="container"> | 79 | <div class="container"> |
80 | <div class="row"> | 80 | <div class="row"> |
81 | <div class="col-xs-12"> | 81 | <div class="col-xs-12"> |
82 | <div class="col-xs-12 col-md-1"> | 82 | <div class="col-xs-12 col-md-1"> |
83 | <!--<div class="widget stacked"> | 83 | <!--<div class="widget stacked"> |
84 | <div class="widget-header"> | 84 | <div class="widget-header"> |
85 | <i class="fa fa-plane" aria-hidden="true"></i> | 85 | <i class="fa fa-plane" aria-hidden="true"></i> |
86 | <h3>Enter Support Service</h3> | 86 | <h3>Enter Support Service</h3> |
87 | </div> | 87 | </div> |
88 | <div class="widget-content"> | 88 | <div class="widget-content"> |
89 | <label ng-repeat="item in events" ng-click="editEvent(item)" style="width: 100%;"> | 89 | <label ng-repeat="item in events" ng-click="editEvent(item)" style="width: 100%;"> |
90 | <div class="fc-event" data-drag="true" data-jqyoui-options="{revert: 'invalid'}" jqyoui-draggable="{index: {{$index}},placeholder:true,animate:true}"> | 90 | <div class="fc-event" data-drag="true" data-jqyoui-options="{revert: 'invalid'}" jqyoui-draggable="{index: {{$index}},placeholder:true,animate:true}"> |
91 | {{item.title}} | 91 | {{item.title}} |
92 | </div> | 92 | </div> |
93 | <div class="fc-event"> | 93 | <div class="fc-event"> |
94 | {{item.title}} | 94 | {{item.title}} |
95 | </div> | 95 | </div> |
96 | </label> | 96 | </label> |
97 | <p> | 97 | <p> |
98 | <input type='checkbox' id='drop-remove' /> | 98 | <input type='checkbox' id='drop-remove' /> |
99 | <label for='drop-remove'>remove after drop</label> | 99 | <label for='drop-remove'>remove after drop</label> |
100 | </p> | 100 | </p> |
101 | </div> | 101 | </div> |
102 | </div> | 102 | </div> |
103 | <div class="text-right"> | 103 | <div class="text-right"> |
104 | <button class="btn btn-default btn-white" data-toggle="modal" data-target="#addEvent">Add Event</button> | 104 | <button class="btn btn-default btn-white" data-toggle="modal" data-target="#addEvent">Add Event</button> |
105 | </div> --> | 105 | </div> --> |
106 | </div> | 106 | </div> |
107 | 107 | ||
108 | <div class="col-xs-12 col-md-10"> | 108 | <div class="col-xs-12 col-md-10"> |
109 | <div class="widget stacked"> | 109 | <div class="widget stacked"> |
110 | <div class="widget-header"> | 110 | <div class="widget-header"> |
111 | <i class="fa fa-calendar" aria-hidden="true"></i> | 111 | <i class="fa fa-calendar" aria-hidden="true"></i> |
112 | <h3>Schedule</h3> | 112 | <h3>Schedule</h3> |
113 | </div> | 113 | </div> |
114 | <div class="widget-content"> | 114 | <div class="widget-content"> |
115 | <div id="my-calendar" ui-calendar="uiConfig.calendar" ng-model="eventSources" data-drop="true"></div> | 115 | <div id="my-calendar" ui-calendar="uiConfig.calendar" ng-model="eventSources" data-drop="true"></div> |
116 | 116 | ||
117 | 117 | ||
118 | </div> | 118 | </div> |
119 | </div> | 119 | </div> |
120 | </div> | 120 | </div> |
121 | <div style='clear:both'></div> | 121 | <div style='clear:both'></div> |
122 | <div class="col-xs-12 col-md-1"> | 122 | <div class="col-xs-12 col-md-1"> |
123 | </div> | 123 | </div> |
124 | 124 | ||
125 | <!-- <div ui-calendar="uiConfig.calendar" ng-model="eventSources" class="col-xs-12 col-md-9" data-drop="true" jqyoui-droppable="{multiple:true, onDrop: 'addEvent($index)'}"></div> --> | 125 | <!-- <div ui-calendar="uiConfig.calendar" ng-model="eventSources" class="col-xs-12 col-md-9" data-drop="true" jqyoui-droppable="{multiple:true, onDrop: 'addEvent($index)'}"></div> --> |
126 | 126 | ||
127 | |||
128 | |||
129 | |||
130 | |||
131 | </div> | 127 | </div> |
132 | 128 | ||
133 | |||
134 | |||
135 | </div> | 129 | </div> |
136 | 130 | ||
137 | </div> | 131 | </div> |
138 | <div> | 132 | <div> |
139 | </div> | 133 | </div> |
140 | <!-- /row --> | 134 | <!-- /row --> |
141 | </div> | 135 | </div> |
142 | <!-- /container --> | 136 | <!-- /container --> |
143 | </div> | 137 | </div> |
144 | <!-- /main --> | 138 | <!-- /main --> |
145 | 139 | ||
146 | 140 | ||
147 | <div id="addEvent" class="modal fade" role="dialog" data-backdrop="static"> | 141 | <div id="addEvent" class="modal fade" role="dialog" data-backdrop="static"> |
148 | <div class="modal-dialog"> | 142 | <div class="modal-dialog"> |
149 | <form ng-submit="addNewEvent()"> | 143 | <form ng-submit="addNewEvent()"> |
150 | <div class="modal-content"> | 144 | <div class="modal-content"> |
151 | <div class="modal-header"> | 145 | <div class="modal-header"> |
152 | <button type="button" ng-click="cancelAdd()" class="close" data-dismiss="modal">×</button> | 146 | <button type="button" ng-click="cancelAdd()" class="close" data-dismiss="modal">×</button> |
153 | <h4 class="modal-title">Schedule New Event</h4> | 147 | <h4 class="modal-title">Schedule New Event</h4> |
154 | </div> | 148 | </div> |
155 | <div class="modal-body"> | 149 | <div class="modal-body"> |
156 | <div class="col-md-6" style="padding-left: 0;"> | 150 | <div class="col-md-6" style="padding-left: 0;"> |
157 | <label>Event Name:</label> | 151 | <label>Event Name:</label> |
158 | <input type="text" ng-model="newEvent.aircraft" class="form-control"> | 152 | <input type="text" ng-model="newEvent.aircraft" class="form-control"> |
159 | </div> | 153 | </div> |
160 | <div class="col-md-6" style="padding-right: 0;"> | 154 | <div class="col-md-6" style="padding-right: 0;"> |
161 | <label>Deploy Date:</label> | 155 | <label>Deploy Date:</label> |
162 | <input type="text" datepicker ng-model="newEvent.deployDate" class="form-control"> | 156 | <input type="text" datepicker ng-model="newEvent.deployDate" class="form-control"> |
163 | </div> | 157 | </div> |
164 | <div class="clearfix"></div> | 158 | <div class="clearfix"></div> |
165 | </div> | 159 | </div> |
166 | <div class="modal-footer"> | 160 | <div class="modal-footer"> |
167 | <input type="submit" value="Add" class="btn btn-primary"> | 161 | <input type="submit" value="Add" class="btn btn-primary"> |
168 | <button type="button" class="btn btn-default" ng-click="cancelAdd()" data-dismiss="modal">Close</button> | 162 | <button type="button" class="btn btn-default" ng-click="cancelAdd()" data-dismiss="modal">Close</button> |
169 | </div> | 163 | </div> |
170 | </div> | 164 | </div> |
171 | </form> | 165 | </form> |
172 | 166 | ||
173 | </div> | 167 | </div> |
174 | </div> | 168 | </div> |
175 | 169 | ||
176 | <div id="editEvent" class="modal fade" role="dialog" data-backdrop="static"> | 170 | <div id="editEvent" class="modal fade" role="dialog" data-backdrop="static"> |
177 | <div class="modal-dialog"> | 171 | <div class="modal-dialog"> |
178 | <form ng-submit="updateEvent()"> | 172 | <form ng-submit="updateEvent()"> |
179 | <div class="modal-content"> | 173 | <div class="modal-content"> |
180 | <div class="modal-header"> | 174 | <div class="modal-header"> |
181 | <button type="button" ng-click="cancelAdd()" class="close" data-dismiss="modal">×</button> | 175 | <button type="button" ng-click="cancelAdd()" class="close" data-dismiss="modal">×</button> |
182 | <h4 class="modal-title">Update Scheduled Event</h4> | 176 | <h4 class="modal-title">Update Scheduled Event</h4> |
183 | </div> | 177 | </div> |
184 | <div class="modal-body"> | 178 | <div class="modal-body"> |
185 | <div class="col-md-6" style="padding-left: 0;"> | 179 | <div class="col-md-6" style="padding-left: 0;"> |
186 | <label>Event Name:</label> | 180 | <label>Event Name:</label> |
187 | <input type="text" ng-model="editData.title" class="form-control"> | 181 | <input type="text" ng-model="editData.title" class="form-control"> |
188 | </div> | 182 | </div> |
189 | <div class="col-md-6" style="padding-right: 0;"> | 183 | <div class="col-md-6" style="padding-right: 0;"> |
190 | <label>Deploy Date:</label> | 184 | <label>Deploy Date:</label> |
191 | <input type="text" datepicker ng-model="editData.start" class="form-control"> | 185 | <input type="text" datepicker ng-model="editData.start" class="form-control"> |
192 | </div> | 186 | </div> |
193 | <div class="clearfix"></div> | 187 | <div class="clearfix"></div> |
194 | </div> | 188 | </div> |
195 | <div class="modal-footer"> | 189 | <div class="modal-footer"> |
196 | <input type="submit" value="Update" class="btn btn-primary"> | 190 | <input type="submit" value="Update" class="btn btn-primary"> |
197 | <button type="button" class="btn btn-default" ng-click="cancelUpdate()" data-dismiss="modal">Close</button> | 191 | <button type="button" class="btn btn-default" ng-click="cancelUpdate()" data-dismiss="modal">Close</button> |
198 | </div> | 192 | </div> |
199 | </div> | 193 | </div> |
200 | </form> | 194 | </form> |
201 | 195 | ||
202 | </div> | 196 | </div> |
203 | </div> |
app/partials/updateFuelManager/updateFuelManager.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | 5 | ||
6 | 6 | ||
7 | .controller('updateFuelManagerController', ['$scope','$uibModal', 'updateFuelManagerService','$state', function($scope , $uibModal, updateFuelManagerService,$state) { | 7 | .controller('updateFuelManagerController', ['$scope','$uibModal', 'updateFuelManagerService','$state', function($scope , $uibModal, updateFuelManagerService,$state) { |
8 | $scope.showLoader = true; | 8 | $scope.showLoader = true; |
9 | $scope.yes = function(data){ | 9 | $scope.yes = function(data){ |
10 | // console.log('========'); | 10 | // console.log('========'); |
11 | //console.log('value', data); | 11 | //console.log('value', data); |
12 | $uibModal.yes({ | 12 | $uibModal.yes({ |
13 | templateUrl: 'partials/pricingcontact/pricingcontact.html', | 13 | templateUrl: 'partials/pricingcontact/pricingcontact.html', |
14 | backdrop: true, | 14 | backdrop: true, |
15 | scope: $scope, | 15 | scope: $scope, |
16 | }) | 16 | }) |
17 | } | 17 | } |
18 | 18 | ||
19 | $scope.options = { | 19 | $scope.options = { |
20 | language: 'en', | 20 | language: 'en', |
21 | allowedContent: true, | 21 | allowedContent: true, |
22 | entities: false | 22 | entities: false |
23 | }; | 23 | }; |
24 | 24 | ||
25 | // Called when the editor is completely ready. | 25 | // Called when the editor is completely ready. |
26 | $scope.onReady = function () { | 26 | $scope.onReady = function () { |
27 | // ... | 27 | // ... |
28 | }; | 28 | }; |
29 | 29 | ||
30 | 30 | ||
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')); | 34 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')); |
35 | 35 | ||
36 | function getAtypeFunction(){ | 36 | function getAtypeFunction(){ |
37 | updateFuelManagerService.getATypeJets($scope.userProfileId).then(function(result) { | 37 | updateFuelManagerService.getATypeJets($scope.userProfileId).then(function(result) { |
38 | for (var i = 0; i<result.length; i++) { | 38 | for (var i = 0; i<result.length; i++) { |
39 | result[i].marginValue = parseFloat(result[i].marginValue).toFixed(4); | 39 | result[i].marginValue = parseFloat(result[i].marginValue).toFixed(4); |
40 | } | 40 | } |
41 | $scope.aTypeJets = result; | 41 | $scope.aTypeJets = result; |
42 | $scope.showLoader = false; | 42 | $scope.showLoader = false; |
43 | }) | 43 | }) |
44 | } | 44 | } |
45 | getAtypeFunction(); | 45 | getAtypeFunction(); |
46 | 46 | ||
47 | 47 | ||
48 | function getVTypeFunction(){ | 48 | function getVTypeFunction(){ |
49 | updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { | 49 | updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { |
50 | for (var i = 0; i<result.length; i++) { | 50 | for (var i = 0; i<result.length; i++) { |
51 | result[i].marginValue = parseFloat(result[i].marginValue).toFixed(4); | 51 | result[i].marginValue = parseFloat(result[i].marginValue).toFixed(4); |
52 | } | 52 | } |
53 | //console.log("get Vtype",result) | 53 | //console.log("get Vtype",result) |
54 | 54 | ||
55 | $scope.vTypeJets = result; | 55 | $scope.vTypeJets = result; |
56 | $scope.showLoader = false; | 56 | $scope.showLoader = false; |
57 | }) | 57 | }) |
58 | } | 58 | } |
59 | 59 | ||
60 | getVTypeFunction(); | 60 | getVTypeFunction(); |
61 | 61 | ||
62 | $scope.toggleJestAccordian = function(id, index){ | 62 | $scope.toggleJestAccordian = function(id, index){ |
63 | $scope.showLoader = true; | 63 | $scope.showLoader = true; |
64 | $('.'+id).slideDown(); | 64 | $('.'+id).slideDown(); |
65 | $('#'+id).addClass('customActive'); | 65 | $('#'+id).addClass('customActive'); |
66 | $('#'+id+' select, #'+id+' input').prop("disabled", false); | 66 | $('#'+id+' select, #'+id+' input').prop("disabled", false); |
67 | $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); | 67 | $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); |
68 | $('#'+id+' .btn-default').css('display', 'none'); | 68 | $('#'+id+' .btn-default').css('display', 'none'); |
69 | $('#'+id+' .btn-primary').css('display', 'none'); | 69 | $('#'+id+' .btn-primary').css('display', 'none'); |
70 | 70 | ||
71 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { | 71 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { |
72 | $scope.aTypeJets[index].tierList = tiers; | 72 | $scope.aTypeJets[index].tierList = tiers; |
73 | $scope.showLoader = false; | 73 | $scope.showLoader = false; |
74 | }) | 74 | }) |
75 | } | 75 | } |
76 | $scope.toggleVtypeJestAccordian = function(id, index){ | 76 | $scope.toggleVtypeJestAccordian = function(id, index){ |
77 | $scope.showLoader = true; | 77 | $scope.showLoader = true; |
78 | $('.'+id).slideDown(); | 78 | $('.'+id).slideDown(); |
79 | $('#'+id).addClass('customActive'); | 79 | $('#'+id).addClass('customActive'); |
80 | $('#'+id+' select, #'+id+' input').prop("disabled", false); | 80 | $('#'+id+' select, #'+id+' input').prop("disabled", false); |
81 | $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); | 81 | $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); |
82 | $('#'+id+' .btn-default').css('display', 'none'); | 82 | $('#'+id+' .btn-default').css('display', 'none'); |
83 | $('#'+id+' .btn-primary').css('display', 'none'); | 83 | $('#'+id+' .btn-primary').css('display', 'none'); |
84 | 84 | ||
85 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { | 85 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { |
86 | $scope.vTypeJets[index].tierList = tiers; | 86 | $scope.vTypeJets[index].tierList = tiers; |
87 | $scope.showLoader = false; | 87 | $scope.showLoader = false; |
88 | }) | 88 | }) |
89 | } | 89 | } |
90 | //$scope.trData = {}; | 90 | //$scope.trData = {}; |
91 | $scope.addNewTier = function(id, trData, index){ | 91 | $scope.addNewTier = function(id, trData, index){ |
92 | $scope.showLoader = true; | 92 | $scope.showLoader = true; |
93 | $scope.tr = {}; | 93 | $scope.tr = {}; |
94 | $scope.tr[index] = {}; | 94 | $scope.tr[index] = {}; |
95 | $scope.tr[index].minTierBreak = trData[index].minTierBreak; | 95 | $scope.tr[index].minTierBreak = trData[index].minTierBreak; |
96 | $scope.tr[index].maxTierBreak = trData[index].maxTierBreak; | 96 | $scope.tr[index].maxTierBreak = trData[index].maxTierBreak; |
97 | $scope.tr[index].margin = trData[index].margin; | 97 | $scope.tr[index].margin = trData[index].margin; |
98 | $scope.tr[index].marginTotal = '1.00'; | 98 | $scope.tr[index].marginTotal = '1.00'; |
99 | $scope.tr[index].marginTemplateId = id; | 99 | $scope.tr[index].marginTemplateId = id; |
100 | 100 | ||
101 | var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ | 101 | var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ |
102 | '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; | 102 | '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; |
103 | 103 | ||
104 | updateFuelManagerService.addNewTier(tierData).then(function(result) { | 104 | updateFuelManagerService.addNewTier(tierData).then(function(result) { |
105 | toastr.success('Successfully Added', { | 105 | toastr.success('Successfully Added', { |
106 | closeButton: true | 106 | closeButton: true |
107 | }) | 107 | }) |
108 | trData[index].minTierBreak = ''; | 108 | trData[index].minTierBreak = ''; |
109 | trData[index].maxTierBreak = ''; | 109 | trData[index].maxTierBreak = ''; |
110 | trData[index].margin = ''; | 110 | trData[index].margin = ''; |
111 | 111 | ||
112 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { | 112 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { |
113 | $scope.aTypeJets[index].tierList = tiers; | 113 | $scope.aTypeJets[index].tierList = tiers; |
114 | $scope.showLoader = false; | 114 | $scope.showLoader = false; |
115 | }) | 115 | }) |
116 | }) | 116 | }) |
117 | } | 117 | } |
118 | 118 | ||
119 | $scope.addNewVtypeTier = function(id, vtrData, index){ | 119 | $scope.addNewVtypeTier = function(id, vtrData, index){ |
120 | $scope.showLoader = true; | 120 | $scope.showLoader = true; |
121 | $scope.tr = {}; | 121 | $scope.tr = {}; |
122 | $scope.tr[index] = {}; | 122 | $scope.tr[index] = {}; |
123 | $scope.tr[index].minTierBreak = vtrData[index].minTierBreak; | 123 | $scope.tr[index].minTierBreak = vtrData[index].minTierBreak; |
124 | $scope.tr[index].maxTierBreak = vtrData[index].maxTierBreak; | 124 | $scope.tr[index].maxTierBreak = vtrData[index].maxTierBreak; |
125 | $scope.tr[index].margin = vtrData[index].margin; | 125 | $scope.tr[index].margin = vtrData[index].margin; |
126 | $scope.tr[index].marginTotal = '1.00'; | 126 | $scope.tr[index].marginTotal = '1.00'; |
127 | $scope.tr[index].marginTemplateId = id; | 127 | $scope.tr[index].marginTemplateId = id; |
128 | 128 | ||
129 | var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ | 129 | var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ |
130 | '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; | 130 | '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; |
131 | 131 | ||
132 | updateFuelManagerService.addNewTier(tierData).then(function(result) { | 132 | updateFuelManagerService.addNewTier(tierData).then(function(result) { |
133 | toastr.success('Successfully Added', { | 133 | toastr.success('Successfully Added', { |
134 | closeButton: true | 134 | closeButton: true |
135 | }) | 135 | }) |
136 | vtrData[index].minTierBreak = ''; | 136 | vtrData[index].minTierBreak = ''; |
137 | vtrData[index].maxTierBreak = ''; | 137 | vtrData[index].maxTierBreak = ''; |
138 | vtrData[index].margin = ''; | 138 | vtrData[index].margin = ''; |
139 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { | 139 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { |
140 | $scope.vTypeJets[index].tierList = tiers; | 140 | $scope.vTypeJets[index].tierList = tiers; |
141 | $scope.showLoader = false; | 141 | $scope.showLoader = false; |
142 | }) | 142 | }) |
143 | }) | 143 | }) |
144 | } | 144 | } |
145 | 145 | ||
146 | $scope.editTier = function(tier, index){ | 146 | $scope.editTier = function(tier, index){ |
147 | $scope.showLoader = true; | 147 | $scope.showLoader = true; |
148 | var editTierData = 'minTierBreak='+tier.minTierBreak+'&maxTierBreak='+tier.maxTierBreak+'&margin='+tier.margin+ | 148 | var editTierData = 'minTierBreak='+tier.minTierBreak+'&maxTierBreak='+tier.maxTierBreak+'&margin='+tier.margin+ |
149 | '&marginTotal='+tier.marginTotal+'&marginTemplateId='+tier.marginTemplate.id+'&marginId='+tier.id; | 149 | '&marginTotal='+tier.marginTotal+'&marginTemplateId='+tier.marginTemplate.id+'&marginId='+tier.id; |
150 | 150 | ||
151 | updateFuelManagerService.editTier(editTierData).then(function(result) { | 151 | updateFuelManagerService.editTier(editTierData).then(function(result) { |
152 | toastr.success('Successfully Updated', { | 152 | toastr.success('Successfully Updated', { |
153 | closeButton: true | 153 | closeButton: true |
154 | }) | 154 | }) |
155 | updateFuelManagerService.getJetTiers(tier.marginTemplate.id).then(function(tiers) { | 155 | updateFuelManagerService.getJetTiers(tier.marginTemplate.id).then(function(tiers) { |
156 | $scope.aTypeJets[index].tierList = tiers; | 156 | $scope.aTypeJets[index].tierList = tiers; |
157 | $scope.showLoader = false; | 157 | $scope.showLoader = false; |
158 | }) | 158 | }) |
159 | }) | 159 | }) |
160 | 160 | ||
161 | } | 161 | } |
162 | 162 | ||
163 | $scope.editVtypeTier = function(tier, index){ | 163 | $scope.editVtypeTier = function(tier, index){ |
164 | $scope.showLoader = true; | 164 | $scope.showLoader = true; |
165 | var editTierData = 'minTierBreak='+tier.minTierBreak+'&maxTierBreak='+tier.maxTierBreak+'&margin='+tier.margin+ | 165 | var editTierData = 'minTierBreak='+tier.minTierBreak+'&maxTierBreak='+tier.maxTierBreak+'&margin='+tier.margin+ |
166 | '&marginTotal='+tier.marginTotal+'&marginTemplateId='+tier.marginTemplate.id+'&marginId='+tier.id; | 166 | '&marginTotal='+tier.marginTotal+'&marginTemplateId='+tier.marginTemplate.id+'&marginId='+tier.id; |
167 | 167 | ||
168 | updateFuelManagerService.editTier(editTierData).then(function(result) { | 168 | updateFuelManagerService.editTier(editTierData).then(function(result) { |
169 | toastr.success('Successfully Updated', { | 169 | toastr.success('Successfully Updated', { |
170 | closeButton: true | 170 | closeButton: true |
171 | }) | 171 | }) |
172 | updateFuelManagerService.getJetTiers(tier.marginTemplate.id).then(function(tiers) { | 172 | updateFuelManagerService.getJetTiers(tier.marginTemplate.id).then(function(tiers) { |
173 | $scope.vTypeJets[index].tierList = tiers; | 173 | $scope.vTypeJets[index].tierList = tiers; |
174 | $scope.showLoader = false; | 174 | $scope.showLoader = false; |
175 | }) | 175 | }) |
176 | }) | 176 | }) |
177 | 177 | ||
178 | } | 178 | } |
179 | 179 | ||
180 | $scope.deleteTierObject = {}; | 180 | $scope.deleteTierObject = {}; |
181 | $scope.deleteTier = function(id, jetid, index){ | 181 | $scope.deleteTier = function(id, jetid, index){ |
182 | $scope.deleteTierObject.id = id; | 182 | $scope.deleteTierObject.id = id; |
183 | $scope.deleteTierObject.jetId = jetid; | 183 | $scope.deleteTierObject.jetId = jetid; |
184 | $scope.deleteTierObject.index = index; | 184 | $scope.deleteTierObject.index = index; |
185 | $('#deleteTierConfirm').css('display', 'block'); | 185 | $('#deleteTierConfirm').css('display', 'block'); |
186 | } | 186 | } |
187 | 187 | ||
188 | $scope.confirmDeleteTier = function(){ | 188 | $scope.confirmDeleteTier = function(){ |
189 | $scope.showLoader = true; | 189 | $scope.showLoader = true; |
190 | updateFuelManagerService.deleteTier($scope.deleteTierObject.id).then(function(result) { | 190 | updateFuelManagerService.deleteTier($scope.deleteTierObject.id).then(function(result) { |
191 | toastr.success(''+result.success+'', { | 191 | toastr.success(''+result.success+'', { |
192 | closeButton: true | 192 | closeButton: true |
193 | }) | 193 | }) |
194 | updateFuelManagerService.getJetTiers($scope.deleteTierObject.jetId).then(function(tiers) { | 194 | updateFuelManagerService.getJetTiers($scope.deleteTierObject.jetId).then(function(tiers) { |
195 | $scope.aTypeJets[$scope.deleteTierObject.index].tierList = tiers; | 195 | $scope.aTypeJets[$scope.deleteTierObject.index].tierList = tiers; |
196 | $scope.showLoader = false; | 196 | $scope.showLoader = false; |
197 | $scope.deleteTierObject = {}; | 197 | $scope.deleteTierObject = {}; |
198 | }) | 198 | }) |
199 | }) | 199 | }) |
200 | $('#deleteTierConfirm').css('display', 'none'); | 200 | $('#deleteTierConfirm').css('display', 'none'); |
201 | } | 201 | } |
202 | 202 | ||
203 | $scope.cancelTierDelete = function(){ | 203 | $scope.cancelTierDelete = function(){ |
204 | $('#deleteTierConfirm').css('display', 'none'); | 204 | $('#deleteTierConfirm').css('display', 'none'); |
205 | $scope.deleteTierObject = {}; | 205 | $scope.deleteTierObject = {}; |
206 | } | 206 | } |
207 | 207 | ||
208 | /*$scope.deleteVtypeTier = function(id, jetid, index){ | ||
209 | $scope.showLoader = true; | ||
210 | updateFuelManagerService.deleteTier(id).then(function(result) { | ||
211 | toastr.success(''+result.success+'', { | ||
212 | closeButton: true | ||
213 | }) | ||
214 | updateFuelManagerService.getJetTiers(jetid).then(function(tiers) { | ||
215 | $scope.vTypeJets[index].tierList = tiers; | ||
216 | $scope.showLoader = false; | ||
217 | }) | ||
218 | }) | ||
219 | }*/ | ||
220 | 208 | ||
221 | $scope.deleteVtypeTierObject = {}; | 209 | $scope.deleteVtypeTierObject = {}; |
222 | $scope.deleteVtypeTier = function(id, jetid, index){ | 210 | $scope.deleteVtypeTier = function(id, jetid, index){ |
223 | $scope.deleteVtypeTierObject.id = id; | 211 | $scope.deleteVtypeTierObject.id = id; |
224 | $scope.deleteVtypeTierObject.jetId = jetid; | 212 | $scope.deleteVtypeTierObject.jetId = jetid; |
225 | $scope.deleteVtypeTierObject.index = index; | 213 | $scope.deleteVtypeTierObject.index = index; |
226 | $('#deleteVtypeTierConfirm').css('display', 'block'); | 214 | $('#deleteVtypeTierConfirm').css('display', 'block'); |
227 | } | 215 | } |
228 | 216 | ||
229 | $scope.confirmDeleteVtypeTier = function(){ | 217 | $scope.confirmDeleteVtypeTier = function(){ |
230 | $scope.showLoader = true; | 218 | $scope.showLoader = true; |
231 | updateFuelManagerService.deleteTier($scope.deleteVtypeTierObject.id).then(function(result) { | 219 | updateFuelManagerService.deleteTier($scope.deleteVtypeTierObject.id).then(function(result) { |
232 | toastr.success(''+result.success+'', { | 220 | toastr.success(''+result.success+'', { |
233 | closeButton: true | 221 | closeButton: true |
234 | }) | 222 | }) |
235 | updateFuelManagerService.getJetTiers($scope.deleteVtypeTierObject.jetId).then(function(tiers) { | 223 | updateFuelManagerService.getJetTiers($scope.deleteVtypeTierObject.jetId).then(function(tiers) { |
236 | $scope.vTypeJets[$scope.deleteVtypeTierObject.index].tierList = tiers; | 224 | $scope.vTypeJets[$scope.deleteVtypeTierObject.index].tierList = tiers; |
237 | $scope.showLoader = false; | 225 | $scope.showLoader = false; |
238 | $scope.deleteVtypeTierObject = {}; | 226 | $scope.deleteVtypeTierObject = {}; |
239 | }) | 227 | }) |
240 | }) | 228 | }) |
241 | $('#deleteVtypeTierConfirm').css('display', 'none'); | 229 | $('#deleteVtypeTierConfirm').css('display', 'none'); |
242 | } | 230 | } |
243 | 231 | ||
244 | $scope.cancelVtypeTierDelete = function(){ | 232 | $scope.cancelVtypeTierDelete = function(){ |
245 | $('#deleteVtypeTierConfirm').css('display', 'none'); | 233 | $('#deleteVtypeTierConfirm').css('display', 'none'); |
246 | $scope.deleteVtypeTierObject = {}; | 234 | $scope.deleteVtypeTierObject = {}; |
247 | } | 235 | } |
248 | 236 | ||
249 | $scope.saveJetAccordian = function(jets){ | 237 | $scope.saveJetAccordian = function(jets){ |
250 | $scope.showLoader = true; | 238 | $scope.showLoader = true; |
251 | $scope.jetsDetail = jets; | 239 | $scope.jetsDetail = jets; |
252 | $scope.jetsDetail.userProfileId = $scope.userProfileId; | 240 | $scope.jetsDetail.userProfileId = $scope.userProfileId; |
253 | $('.'+$scope.jetsDetail.id).slideUp(); | 241 | $('.'+$scope.jetsDetail.id).slideUp(); |
254 | $('#'+$scope.jetsDetail.id).removeClass('customActive'); | 242 | $('#'+$scope.jetsDetail.id).removeClass('customActive'); |
255 | $('#'+$scope.jetsDetail.id+' select, #'+$scope.jetsDetail.id+' input').prop("disabled", true); | 243 | $('#'+$scope.jetsDetail.id+' select, #'+$scope.jetsDetail.id+' input').prop("disabled", true); |
256 | $('#'+$scope.jetsDetail.id+' .btn-success, #'+$scope.jetsDetail.id+' .btn-danger').css('display', 'none'); | 244 | $('#'+$scope.jetsDetail.id+' .btn-success, #'+$scope.jetsDetail.id+' .btn-danger').css('display', 'none'); |
257 | $('#'+$scope.jetsDetail.id+' .btn-default').css('display', 'inline-block'); | 245 | $('#'+$scope.jetsDetail.id+' .btn-default').css('display', 'inline-block'); |
258 | $('#'+$scope.jetsDetail.id+' .btn-primary').css('display', 'inline-block'); | 246 | $('#'+$scope.jetsDetail.id+' .btn-primary').css('display', 'inline-block'); |
259 | 247 | ||
260 | var editJetData = 'productType='+$scope.jetsDetail.productType+'&marginName='+$scope.jetsDetail.marginName+'&pricingStructure='+$scope.jetsDetail.pricingStructure+'&marginValue='+$scope.jetsDetail.marginValue+'&userProfileId='+$scope.jetsDetail.userProfileId+'&marginId='+$scope.jetsDetail.id+'&message='+$scope.jetsDetail.message; | 248 | var editJetData = 'productType='+$scope.jetsDetail.productType+'&marginName='+$scope.jetsDetail.marginName+'&pricingStructure='+$scope.jetsDetail.pricingStructure+'&marginValue='+$scope.jetsDetail.marginValue+'&userProfileId='+$scope.jetsDetail.userProfileId+'&marginId='+$scope.jetsDetail.id+'&message='+$scope.jetsDetail.message; |
261 | 249 | ||
262 | updateFuelManagerService.editAtypeJetMargin(editJetData).then(function(result) { | 250 | updateFuelManagerService.editAtypeJetMargin(editJetData).then(function(result) { |
263 | toastr.success('Successfully Updated', { | 251 | toastr.success('Successfully Updated', { |
264 | closeButton: true | 252 | closeButton: true |
265 | }) | 253 | }) |
266 | 254 | ||
267 | getAtypeFunction(); | 255 | getAtypeFunction(); |
268 | }) | 256 | }) |
269 | 257 | ||
270 | } | 258 | } |
271 | 259 | ||
272 | $scope.closeAccordian = function(jets){ | 260 | $scope.closeAccordian = function(jets){ |
273 | $('.'+jets.id).slideUp(); | 261 | $('.'+jets.id).slideUp(); |
274 | $('#'+jets.id).removeClass('customActive'); | 262 | $('#'+jets.id).removeClass('customActive'); |
275 | $('#'+jets.id+' select, #'+jets.id+' input').prop("disabled", true); | 263 | $('#'+jets.id+' select, #'+jets.id+' input').prop("disabled", true); |
276 | $('#'+jets.id+' .btn-success, #'+jets.id+' .btn-danger').css('display', 'none'); | 264 | $('#'+jets.id+' .btn-success, #'+jets.id+' .btn-danger').css('display', 'none'); |
277 | $('#'+jets.id+' .btn-default').css('display', 'inline-block'); | 265 | $('#'+jets.id+' .btn-default').css('display', 'inline-block'); |
278 | $('#'+jets.id+' .btn-primary').css('display', 'inline-block'); | 266 | $('#'+jets.id+' .btn-primary').css('display', 'inline-block'); |
279 | } | 267 | } |
280 | 268 | ||
281 | $scope.closeAccordianVtype = function(jets){ | 269 | $scope.closeAccordianVtype = function(jets){ |
282 | $('.'+jets.id).slideUp(); | 270 | $('.'+jets.id).slideUp(); |
283 | $('#'+jets.id).removeClass('customActive'); | 271 | $('#'+jets.id).removeClass('customActive'); |
284 | $('#'+jets.id+' select, #'+jets.id+' input').prop("disabled", true); | 272 | $('#'+jets.id+' select, #'+jets.id+' input').prop("disabled", true); |
285 | $('#'+jets.id+' .btn-success, #'+jets.id+' .btn-danger').css('display', 'none'); | 273 | $('#'+jets.id+' .btn-success, #'+jets.id+' .btn-danger').css('display', 'none'); |
286 | $('#'+jets.id+' .btn-default').css('display', 'inline-block'); | 274 | $('#'+jets.id+' .btn-default').css('display', 'inline-block'); |
287 | $('#'+jets.id+' .btn-primary').css('display', 'inline-block'); | 275 | $('#'+jets.id+' .btn-primary').css('display', 'inline-block'); |
288 | } | 276 | } |
289 | 277 | ||
290 | $scope.saveVtypeJetAccordian = function(jets){ | 278 | $scope.saveVtypeJetAccordian = function(jets){ |
291 | $scope.showLoader = true; | 279 | $scope.showLoader = true; |
292 | $scope.jetsDetail = jets; | 280 | $scope.jetsDetail = jets; |
293 | $scope.jetsDetail.userProfileId = $scope.userProfileId; | 281 | $scope.jetsDetail.userProfileId = $scope.userProfileId; |
294 | //console.log('jets', $scope.jetsDetail); | 282 | //console.log('jets', $scope.jetsDetail); |
295 | $('.'+$scope.jetsDetail.id).slideUp(); | 283 | $('.'+$scope.jetsDetail.id).slideUp(); |
296 | $('#'+$scope.jetsDetail.id).removeClass('customActive'); | 284 | $('#'+$scope.jetsDetail.id).removeClass('customActive'); |
297 | $('#'+$scope.jetsDetail.id+' select, #'+$scope.jetsDetail.id+' input').prop("disabled", true); | 285 | $('#'+$scope.jetsDetail.id+' select, #'+$scope.jetsDetail.id+' input').prop("disabled", true); |
298 | $('#'+$scope.jetsDetail.id+' .btn-success, #'+$scope.jetsDetail.id+' .btn-danger').css('display', 'none'); | 286 | $('#'+$scope.jetsDetail.id+' .btn-success, #'+$scope.jetsDetail.id+' .btn-danger').css('display', 'none'); |
299 | $('#'+$scope.jetsDetail.id+' .btn-default').css('display', 'inline-block'); | 287 | $('#'+$scope.jetsDetail.id+' .btn-default').css('display', 'inline-block'); |
300 | $('#'+jets.id+' .btn-primary').css('display', 'inline-block'); | 288 | $('#'+jets.id+' .btn-primary').css('display', 'inline-block'); |
301 | 289 | ||
302 | var editVtypeJetData = 'productType='+$scope.jetsDetail.productType+'&marginName='+$scope.jetsDetail.marginName+'&pricingStructure='+$scope.jetsDetail.pricingStructure+'&marginValue='+$scope.jetsDetail.marginValue+'&userProfileId='+$scope.jetsDetail.userProfileId+'&marginId='+$scope.jetsDetail.id+'&message='+$scope.jetsDetail.message; | 290 | var editVtypeJetData = 'productType='+$scope.jetsDetail.productType+'&marginName='+$scope.jetsDetail.marginName+'&pricingStructure='+$scope.jetsDetail.pricingStructure+'&marginValue='+$scope.jetsDetail.marginValue+'&userProfileId='+$scope.jetsDetail.userProfileId+'&marginId='+$scope.jetsDetail.id+'&message='+$scope.jetsDetail.message; |
303 | 291 | ||
304 | updateFuelManagerService.editVtypeJetMargin(editVtypeJetData).then(function(result) { | 292 | updateFuelManagerService.editVtypeJetMargin(editVtypeJetData).then(function(result) { |
305 | toastr.success('Successfully Updated', { | 293 | toastr.success('Successfully Updated', { |
306 | closeButton: true | 294 | closeButton: true |
307 | }) | 295 | }) |
308 | 296 | ||
309 | getVTypeFunction(); | 297 | getVTypeFunction(); |
310 | }) | 298 | }) |
311 | 299 | ||
312 | } | 300 | } |
313 | 301 | ||
314 | $scope.newJet = {}; | 302 | $scope.newJet = {}; |
315 | 303 | ||
316 | $scope.addNewMarginBtn = function(){ | 304 | $scope.addNewMarginBtn = function(){ |
317 | $('.addNewMargin').css('display', 'block'); | 305 | $('.addNewMargin').css('display', 'block'); |
318 | } | 306 | } |
319 | $scope.closeMarginPopup = function(){ | 307 | $scope.closeMarginPopup = function(){ |
320 | $('.addNewMargin').css('display', 'none'); | 308 | $('.addNewMargin').css('display', 'none'); |
321 | $scope.newJet = {}; | 309 | $scope.newJet = {}; |
322 | } | 310 | } |
323 | 311 | ||
324 | //$scope.newJet.productType = ''; | 312 | //$scope.newJet.productType = ''; |
325 | 313 | ||
326 | $scope.addNewATypeJet = function(){ | 314 | $scope.addNewATypeJet = function(){ |
327 | $scope.showLoader = true; | 315 | $scope.showLoader = true; |
328 | $scope.newJet.productType = 'JET-A'; | 316 | $scope.newJet.productType = 'JET-A'; |
329 | $scope.newJet.userProfileId = $scope.userProfileId; | 317 | $scope.newJet.userProfileId = $scope.userProfileId; |
330 | 318 | ||
331 | var jetData = 'productType='+$scope.newJet.productType+'&marginName='+$scope.newJet.marginName+'&pricingStructure='+$scope.newJet.pricingStructure+'&marginValue='+$scope.newJet.marginValue+'&userProfileId='+$scope.newJet.userProfileId+'&message='+$scope.newJet.message; | 319 | var jetData = 'productType='+$scope.newJet.productType+'&marginName='+$scope.newJet.marginName+'&pricingStructure='+$scope.newJet.pricingStructure+'&marginValue='+$scope.newJet.marginValue+'&userProfileId='+$scope.newJet.userProfileId+'&message='+$scope.newJet.message; |
332 | 320 | ||
333 | updateFuelManagerService.addNewAtypeJetMargin(jetData).then(function(result) { | 321 | updateFuelManagerService.addNewAtypeJetMargin(jetData).then(function(result) { |
334 | toastr.success('Successfully Added', { | 322 | toastr.success('Successfully Added', { |
335 | closeButton: true | 323 | closeButton: true |
336 | }) | 324 | }) |
337 | $('.addNewMargin').css('display', 'none'); | 325 | $('.addNewMargin').css('display', 'none'); |
338 | 326 | ||
339 | getAtypeFunction(); | 327 | getAtypeFunction(); |
340 | }) | 328 | }) |
341 | } | 329 | } |
342 | 330 | ||
343 | $scope.newVtypeJet = {}; | 331 | $scope.newVtypeJet = {}; |
344 | 332 | ||
345 | $scope.addNewVtypePop = function(){ | 333 | $scope.addNewVtypePop = function(){ |
346 | $('.addNewVtype').css('display', 'block'); | 334 | $('.addNewVtype').css('display', 'block'); |
347 | } | 335 | } |
348 | $scope.closeNewVtypePop = function(){ | 336 | $scope.closeNewVtypePop = function(){ |
349 | $('.addNewVtype').css('display', 'none'); | 337 | $('.addNewVtype').css('display', 'none'); |
350 | $scope.newVtypeJet = {}; | 338 | $scope.newVtypeJet = {}; |
351 | } | 339 | } |
352 | 340 | ||
353 | $scope.addNewVTypeJet = function(){ | 341 | $scope.addNewVTypeJet = function(){ |
354 | $scope.showLoader = true; | 342 | $scope.showLoader = true; |
355 | $scope.newVtypeJet.productType = 'AVGAS'; | 343 | $scope.newVtypeJet.productType = 'AVGAS'; |
356 | $scope.newVtypeJet.userProfileId = $scope.userProfileId; | 344 | $scope.newVtypeJet.userProfileId = $scope.userProfileId; |
357 | 345 | ||
358 | var vJetData = 'productType='+$scope.newVtypeJet.productType+'&marginName='+$scope.newVtypeJet.marginName+'&pricingStructure='+$scope.newVtypeJet.pricingStructure+'&marginValue='+$scope.newVtypeJet.marginValue+'&userProfileId='+$scope.newVtypeJet.userProfileId+'&message='+$scope.newVtypeJet.message; | 346 | var vJetData = 'productType='+$scope.newVtypeJet.productType+'&marginName='+$scope.newVtypeJet.marginName+'&pricingStructure='+$scope.newVtypeJet.pricingStructure+'&marginValue='+$scope.newVtypeJet.marginValue+'&userProfileId='+$scope.newVtypeJet.userProfileId+'&message='+$scope.newVtypeJet.message; |
359 | 347 | ||
360 | updateFuelManagerService.addNewVtypeJet(vJetData).then(function(result) { | 348 | updateFuelManagerService.addNewVtypeJet(vJetData).then(function(result) { |
361 | console.log("AVGAS data",vJetData) | 349 | console.log("AVGAS data",vJetData) |
362 | 350 | ||
363 | toastr.success('Successfully Added', { | 351 | toastr.success('Successfully Added', { |
364 | closeButton: true | 352 | closeButton: true |
365 | }) | 353 | }) |
366 | $('.addNewVtype').css('display', 'none'); | 354 | $('.addNewVtype').css('display', 'none'); |
367 | 355 | ||
368 | getVTypeFunction(); | 356 | getVTypeFunction(); |
369 | }) | 357 | }) |
370 | 358 | ||
371 | } | 359 | } |
372 | 360 | ||
373 | /*Jet A Margin Email Send */ | 361 | /*Jet A Margin Email Send */ |
374 | $scope.emailForJetMargin; | 362 | $scope.emailForJetMargin; |
375 | $scope.emailPricingForJetAMargin = function(value){ | 363 | $scope.emailPricingForJetAMargin = function(value){ |
376 | $('#confirm2').css('display', 'block'); | 364 | $('#confirm2').css('display', 'block'); |
377 | $scope.emailForJetMargin = value; | 365 | $scope.emailForJetMargin = value; |
378 | 366 | ||
379 | } | 367 | } |
380 | $scope.saveAndCloseForMarginConfirm = function(){ | 368 | $scope.saveAndCloseForMarginConfirm = function(){ |
381 | $('#confirm2').css('display', 'none'); | 369 | $('#confirm2').css('display', 'none'); |
382 | updateFuelManagerService.sendMailToJetAMargin($scope.emailForJetMargin).then(function(result) { | 370 | updateFuelManagerService.sendMailToJetAMargin($scope.emailForJetMargin).then(function(result) { |
383 | console.log("email margin jeta",$scope.emailForJetMargin) | 371 | console.log("email margin jeta",$scope.emailForJetMargin) |
384 | if(result.error) { | 372 | if(result.error) { |
385 | toastr.error('' + result.error + '', { | 373 | toastr.error('' + result.error + '', { |
386 | closeButton: true | 374 | closeButton: true |
387 | }) | 375 | }) |
388 | } else { | 376 | } else { |
389 | toastr.success(''+result.success+'', { | 377 | toastr.success(''+result.success+'', { |
390 | closeButton: true | 378 | closeButton: true |
391 | }) | 379 | }) |
392 | } | 380 | } |
393 | }) | 381 | }) |
394 | } | 382 | } |
395 | $scope.cancelAndCloseForMarginConfirm = function(){ | 383 | $scope.cancelAndCloseForMarginConfirm = function(){ |
396 | $('#confirm2').css('display', 'none'); | 384 | $('#confirm2').css('display', 'none'); |
397 | } | 385 | } |
398 | 386 | ||
399 | /*AVGAS Margin Email Send */ | 387 | /*AVGAS Margin Email Send */ |
400 | 388 | ||
401 | $scope.emailForAVGASMargin; | 389 | $scope.emailForAVGASMargin; |
402 | $scope.emailPricingForAVGASMargin = function(value){ | 390 | $scope.emailPricingForAVGASMargin = function(value){ |
403 | $('#confirm3').css('display', 'block'); | 391 | $('#confirm3').css('display', 'block'); |
404 | $scope.emailForAVGASMargin = value; | 392 | $scope.emailForAVGASMargin = value; |
405 | 393 | ||
406 | } | 394 | } |
407 | $scope.saveAndCloseForAVGASMarginConfirm = function(){ | 395 | $scope.saveAndCloseForAVGASMarginConfirm = function(){ |
408 | $('#confirm3').css('display', 'none'); | 396 | $('#confirm3').css('display', 'none'); |
409 | updateFuelManagerService.sendMailToAVGASMargin($scope.emailForAVGASMargin).then(function(result) { | 397 | updateFuelManagerService.sendMailToAVGASMargin($scope.emailForAVGASMargin).then(function(result) { |
410 | console.log("email margin avgas",$scope.emailForAVGASMargin) | 398 | console.log("email margin avgas",$scope.emailForAVGASMargin) |
411 | toastr.success(''+result.success+'', { | 399 | toastr.success(''+result.success+'', { |
412 | closeButton: true | 400 | closeButton: true |
413 | }) | 401 | }) |
414 | }) | 402 | }) |
415 | } | 403 | } |
416 | $scope.cancelAndCloseForAVGASMarginConfirm = function(){ | 404 | $scope.cancelAndCloseForAVGASMarginConfirm = function(){ |
417 | $('#confirm3').css('display', 'none'); | 405 | $('#confirm3').css('display', 'none'); |
418 | } | 406 | } |
419 | 407 | ||
420 | 408 | ||
421 | 409 | ||
422 | 410 | ||
423 | 411 | ||
424 | $scope.sendEmail = {}; | 412 | $scope.sendEmail = {}; |
425 | 413 | ||
426 | $scope.confirmMail = function(){ | 414 | $scope.confirmMail = function(){ |
427 | if ($scope.sendEmail.pricing != '' && $scope.sendEmail.pricing != null && $scope.sendEmail.pricing != undefined) { | 415 | if ($scope.sendEmail.pricing != '' && $scope.sendEmail.pricing != null && $scope.sendEmail.pricing != undefined) { |
428 | $('#confirm1').css('display', 'block'); | 416 | $('#confirm1').css('display', 'block'); |
429 | 417 | ||
430 | } | 418 | } |
431 | } | 419 | } |
432 | 420 | ||
433 | $scope.saveAndCloseConfirm = function(){ | 421 | $scope.saveAndCloseConfirm = function(){ |
434 | $('#confirm1').css('display', 'none'); | 422 | $('#confirm1').css('display', 'none'); |
435 | updateFuelManagerService.sendMailToGroupMargin($scope.sendEmail.pricing).then(function(result) { | 423 | updateFuelManagerService.sendMailToGroupMargin($scope.sendEmail.pricing).then(function(result) { |
436 | $scope.sendEmail = {}; | 424 | $scope.sendEmail = {}; |
437 | if(result.error) { | 425 | if(result.error) { |
438 | toastr.error('' + result.error + '', { | 426 | toastr.error('' + result.error + '', { |
439 | closeButton: true | 427 | closeButton: true |
440 | }) | 428 | }) |
441 | } else { | 429 | } else { |
442 | toastr.success(''+result.success+'', { | 430 | toastr.success(''+result.success+'', { |
443 | closeButton: true | 431 | closeButton: true |
444 | }) | 432 | }) |
445 | } | 433 | } |
446 | }) | 434 | }) |
447 | } | 435 | } |
448 | $scope.cancelAndCloseConfirm = function(){ | 436 | $scope.cancelAndCloseConfirm = function(){ |
449 | $scope.sendEmail = {}; | 437 | $scope.sendEmail = {}; |
450 | $scope.sendEmail.pricing = ''; | 438 | $scope.sendEmail.pricing = ''; |
451 | $('#confirm1').css('display', 'none'); | 439 | $('#confirm1').css('display', 'none'); |
452 | } | 440 | } |
453 | 441 | ||
454 | $(document).ready(function(){ | 442 | $(document).ready(function(){ |
455 | $('.ui-datepicker-today a').addClass('ui-state-active'); | 443 | $('.ui-datepicker-today a').addClass('ui-state-active'); |
456 | }) | 444 | }) |
457 | 445 | ||
458 | $scope.newFuelPricing = {}; | 446 | $scope.newFuelPricing = {}; |
459 | $scope.holdFuelPricing = {}; | 447 | $scope.holdFuelPricing = {}; |
460 | 448 | ||
461 | $scope.formFunction = function(){ | 449 | $scope.formFunction = function(){ |
462 | updateFuelManagerService.getFuelPricingNew().then(function(result) { | 450 | updateFuelManagerService.getFuelPricingNew().then(function(result) { |
463 | $scope.newFuelPricing = result; | 451 | $scope.newFuelPricing = result; |
464 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 452 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
465 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 453 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
466 | /*console.log('Swarn Singh', $scope.newFuelPricing[i].fuelPricing); | 454 | /*console.log('Swarn Singh', $scope.newFuelPricing[i].fuelPricing); |
467 | console.log('Swarn Singh', new Date($scope.newFuelPricing[i].fuelPricing.expirationDate)); | 455 | console.log('Swarn Singh', new Date($scope.newFuelPricing[i].fuelPricing.expirationDate)); |
468 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { | 456 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { |
469 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 457 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
470 | var month = newTime.getUTCMonth() + 1; //months from 1-12 | 458 | var month = newTime.getUTCMonth() + 1; //months from 1-12 |
471 | var day = newTime.getUTCDate(); | 459 | var day = newTime.getUTCDate(); |
472 | var year = newTime.getUTCFullYear(); | 460 | var year = newTime.getUTCFullYear(); |
473 | 461 | ||
474 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; | 462 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; |
475 | }*/ | 463 | }*/ |
476 | } | 464 | } |
477 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 465 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
478 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 466 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
479 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { | 467 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { |
480 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 468 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
481 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 | 469 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 |
482 | var nextDay = newTime.getUTCDate(); | 470 | var nextDay = newTime.getUTCDate(); |
483 | var nextYear = newTime.getUTCFullYear(); | 471 | var nextYear = newTime.getUTCFullYear(); |
484 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; | 472 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; |
485 | }*/ | 473 | }*/ |
486 | } | 474 | } |
487 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 475 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
488 | /*if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { | 476 | /*if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { |
489 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 477 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
490 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 478 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
491 | var dday = newTime.getUTCDate(); | 479 | var dday = newTime.getUTCDate(); |
492 | var dyear = newTime.getUTCFullYear(); | 480 | var dyear = newTime.getUTCFullYear(); |
493 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 481 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
494 | }*/ | 482 | }*/ |
495 | } | 483 | } |
496 | } | 484 | } |
497 | 485 | ||
498 | var str =""+ $scope.newFuelPricing[i].name | 486 | var str =""+ $scope.newFuelPricing[i].name |
499 | if(str.startsWith("J")){ | 487 | if(str.startsWith("J")){ |
500 | $scope.newFuelPricing[i].jeta = true; | 488 | $scope.newFuelPricing[i].jeta = true; |
501 | var str1 = str.substring(0,5) | 489 | var str1 = str.substring(0,5) |
502 | var str2 = str.substring(6, str.length) | 490 | var str2 = str.substring(6, str.length) |
503 | $scope.newFuelPricing[i].name = str1 | 491 | $scope.newFuelPricing[i].name = str1 |
504 | $scope.newFuelPricing[i].namejetrest = str2 | 492 | $scope.newFuelPricing[i].namejetrest = str2 |
505 | 493 | ||
506 | 494 | ||
507 | }else if(str.startsWith("100")){ | 495 | }else if(str.startsWith("100")){ |
508 | $scope.newFuelPricing[i].avgas = true; | 496 | $scope.newFuelPricing[i].avgas = true; |
509 | var str1 = str.substring(0,5) | 497 | var str1 = str.substring(0,5) |
510 | var str2 = str.substring(6, str.length) | 498 | var str2 = str.substring(6, str.length) |
511 | $scope.newFuelPricing[i].name = str1 | 499 | $scope.newFuelPricing[i].name = str1 |
512 | $scope.newFuelPricing[i].nameavgasrest = str2 | 500 | $scope.newFuelPricing[i].nameavgasrest = str2 |
513 | } | 501 | } |
514 | } | 502 | } |
515 | 503 | ||
516 | for (var i = 0; i<result.length; i++) { | 504 | for (var i = 0; i<result.length; i++) { |
517 | if (result[i].fuelPricing != null) { | 505 | if (result[i].fuelPricing != null) { |
518 | if (result[i].fuelPricing.expirationDate != null && result[i].fuelPricing.expirationDate != '') { | 506 | if (result[i].fuelPricing.expirationDate != null && result[i].fuelPricing.expirationDate != '') { |
519 | var newTime = new Date(result[i].fuelPricing.expirationDate); | 507 | var newTime = new Date(result[i].fuelPricing.expirationDate); |
520 | var month = newTime.getUTCMonth() + 1; //months from 1-12 | 508 | var month = newTime.getUTCMonth() + 1; //months from 1-12 |
521 | var day = newTime.getUTCDate(); | 509 | var day = newTime.getUTCDate(); |
522 | var year = newTime.getUTCFullYear(); | 510 | var year = newTime.getUTCFullYear(); |
523 | result[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; | 511 | result[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; |
524 | } | 512 | } |
525 | } | 513 | } |
526 | if (result[i].futureFuelPricing != null) { | 514 | if (result[i].futureFuelPricing != null) { |
527 | if (result[i].futureFuelPricing != null) { | 515 | if (result[i].futureFuelPricing != null) { |
528 | if (result[i].futureFuelPricing.nextExpiration != null && result[i].futureFuelPricing.nextExpiration != '') { | 516 | if (result[i].futureFuelPricing.nextExpiration != null && result[i].futureFuelPricing.nextExpiration != '') { |
529 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 517 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
530 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 | 518 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 |
531 | var nextDay = newTime.getUTCDate(); | 519 | var nextDay = newTime.getUTCDate(); |
532 | var nextYear = newTime.getUTCFullYear(); | 520 | var nextYear = newTime.getUTCFullYear(); |
533 | result[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; | 521 | result[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; |
534 | } | 522 | } |
535 | } | 523 | } |
536 | if (result[i].futureFuelPricing != null) { | 524 | if (result[i].futureFuelPricing != null) { |
537 | if (result[i].futureFuelPricing.deployDate != null && result[i].futureFuelPricing.deployDate != '') { | 525 | if (result[i].futureFuelPricing.deployDate != null && result[i].futureFuelPricing.deployDate != '') { |
538 | var newTime = new Date(result[i].futureFuelPricing.deployDate); | 526 | var newTime = new Date(result[i].futureFuelPricing.deployDate); |
539 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 527 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
540 | var dday = newTime.getUTCDate(); | 528 | var dday = newTime.getUTCDate(); |
541 | var dyear = newTime.getUTCFullYear(); | 529 | var dyear = newTime.getUTCFullYear(); |
542 | result[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 530 | result[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
543 | } | 531 | } |
544 | } | 532 | } |
545 | } | 533 | } |
546 | } | 534 | } |
547 | 535 | ||
548 | $scope.holdFuelPricing = result; | 536 | $scope.holdFuelPricing = result; |
549 | $scope.showLoader = false; | 537 | $scope.showLoader = false; |
550 | 538 | ||
551 | }) | 539 | }) |
552 | }; | 540 | }; |
553 | 541 | ||
554 | $scope.formFunction(); | 542 | $scope.formFunction(); |
555 | 543 | ||
556 | $scope.$watch("fuelPricing.fuelPricing.expirationDate",function(old,newv){ | 544 | $scope.$watch("fuelPricing.fuelPricing.expirationDate",function(old,newv){ |
557 | }); | 545 | }); |
558 | $scope.updateFuelPricing = {}; | 546 | $scope.updateFuelPricing = {}; |
559 | $scope.updateFuelPricing.fuelPricingList = []; | 547 | $scope.updateFuelPricing.fuelPricingList = []; |
560 | $scope.updateFuelPricing.userProfileId = $scope.userProfileId; | 548 | $scope.updateFuelPricing.userProfileId = $scope.userProfileId; |
561 | $scope.updateFuelPricingClick = function(){ | 549 | $scope.updateFuelPricingClick = function(){ |
562 | $scope.showLoader = true; | 550 | $scope.showLoader = true; |
563 | 551 | ||
564 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 552 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
565 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 553 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
566 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); | 554 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); |
567 | if ($scope.newFuelPricing[i].fuelPricing.cost == null) { | 555 | if ($scope.newFuelPricing[i].fuelPricing.cost == null) { |
568 | $scope.newFuelPricing[i].fuelPricing.cost = ''; | 556 | $scope.newFuelPricing[i].fuelPricing.cost = ''; |
569 | } | 557 | } |
570 | if ($scope.newFuelPricing[i].fuelPricing.papMargin == null) { | 558 | if ($scope.newFuelPricing[i].fuelPricing.papMargin == null) { |
571 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; | 559 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; |
572 | } | 560 | } |
573 | if ($scope.newFuelPricing[i].fuelPricing.papTotal == null) { | 561 | if ($scope.newFuelPricing[i].fuelPricing.papTotal == null) { |
574 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; | 562 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; |
575 | } | 563 | } |
576 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate == null) { | 564 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate == null) { |
577 | $scope.newFuelPricing[i].fuelPricing.expirationDate = ''; | 565 | $scope.newFuelPricing[i].fuelPricing.expirationDate = ''; |
578 | }else{ | 566 | }else{ |
579 | //$scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 567 | //$scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
580 | //$scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime(); | 568 | //$scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime(); |
581 | //new code | 569 | //new code |
582 | var setExpiration = new Date(); | 570 | var setExpiration = new Date(); |
583 | var hours = setExpiration.getHours(); | 571 | var hours = setExpiration.getHours(); |
584 | var min = setExpiration.getMinutes(); | 572 | var min = setExpiration.getMinutes(); |
585 | var sec = setExpiration.getSeconds(); | 573 | var sec = setExpiration.getSeconds(); |
586 | $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate + ' ' + hours + ':' + min + ':' + sec; | 574 | $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate + ' ' + hours + ':' + min + ':' + sec; |
587 | $scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 575 | $scope.newFuelPricing[i].fuelPricing.expirationDate = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
588 | $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime(); | 576 | $scope.newFuelPricing[i].fuelPricing.expirationDate = $scope.newFuelPricing[i].fuelPricing.expirationDate.getTime(); |
589 | } | 577 | } |
590 | 578 | ||
591 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); | 579 | $scope.newFuelPricing[i].fuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].fuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); |
592 | $scope.updateFuelPricing.fuelPricingList.push({ | 580 | $scope.updateFuelPricing.fuelPricingList.push({ |
593 | 'cost': $scope.newFuelPricing[i].fuelPricing.cost, | 581 | 'cost': $scope.newFuelPricing[i].fuelPricing.cost, |
594 | 'papMargin': $scope.newFuelPricing[i].fuelPricing.papMargin, | 582 | 'papMargin': $scope.newFuelPricing[i].fuelPricing.papMargin, |
595 | 'papTotal': $scope.newFuelPricing[i].fuelPricing.papTotal, | 583 | 'papTotal': $scope.newFuelPricing[i].fuelPricing.papTotal, |
596 | 'expirationDate': $scope.newFuelPricing[i].fuelPricing.expirationDate, | 584 | 'expirationDate': $scope.newFuelPricing[i].fuelPricing.expirationDate, |
597 | 'productId': $scope.newFuelPricing[i].id, | 585 | 'productId': $scope.newFuelPricing[i].id, |
598 | 'id': $scope.newFuelPricing[i].fuelPricing.id, | 586 | 'id': $scope.newFuelPricing[i].fuelPricing.id, |
599 | }) | 587 | }) |
600 | 588 | ||
601 | }else{ | 589 | }else{ |
602 | /*$scope.newFuelPricing[i].fuelPricing.cost = ''; | 590 | /*$scope.newFuelPricing[i].fuelPricing.cost = ''; |
603 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; | 591 | $scope.newFuelPricing[i].fuelPricing.papMargin = ''; |
604 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; | 592 | $scope.newFuelPricing[i].fuelPricing.papTotal = ''; |
605 | $scope.newFuelPricing[i].fuelPricing.expirationDate = '';*/ | 593 | $scope.newFuelPricing[i].fuelPricing.expirationDate = '';*/ |
606 | } | 594 | } |
607 | 595 | ||
608 | } | 596 | } |
609 | updateFuelManagerService.updateFuelPricing($scope.updateFuelPricing).then(function(result) { | 597 | updateFuelManagerService.updateFuelPricing($scope.updateFuelPricing).then(function(result) { |
610 | toastr.success('Successfully Updated', { | 598 | toastr.success('Successfully Updated', { |
611 | closeButton: true | 599 | closeButton: true |
612 | }) | 600 | }) |
613 | updateFuelManagerService.getFuelPricingNew().then(function(result) { | 601 | updateFuelManagerService.getFuelPricingNew().then(function(result) { |
614 | $scope.newFuelPricing = result; | 602 | $scope.newFuelPricing = result; |
615 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 603 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
616 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 604 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
617 | /*if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { | 605 | /*if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { |
618 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 606 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
619 | var month = newTime.getUTCMonth() + 1; //months from 1-12 | 607 | var month = newTime.getUTCMonth() + 1; //months from 1-12 |
620 | var day = newTime.getUTCDate(); | 608 | var day = newTime.getUTCDate(); |
621 | var year = newTime.getUTCFullYear(); | 609 | var year = newTime.getUTCFullYear(); |
622 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; | 610 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; |
623 | }*/ | 611 | }*/ |
624 | } | 612 | } |
625 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 613 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
626 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 614 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
627 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { | 615 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { |
628 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 616 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
629 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 | 617 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 |
630 | var nextDay = newTime.getUTCDate(); | 618 | var nextDay = newTime.getUTCDate(); |
631 | var nextYear = newTime.getUTCFullYear(); | 619 | var nextYear = newTime.getUTCFullYear(); |
632 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; | 620 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; |
633 | }*/ | 621 | }*/ |
634 | } | 622 | } |
635 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 623 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
636 | /* if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { | 624 | /* if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { |
637 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 625 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
638 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 626 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
639 | var dday = newTime.getUTCDate(); | 627 | var dday = newTime.getUTCDate(); |
640 | var dyear = newTime.getUTCFullYear(); | 628 | var dyear = newTime.getUTCFullYear(); |
641 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 629 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
642 | }*/ | 630 | }*/ |
643 | 631 | ||
644 | } | 632 | } |
645 | } | 633 | } |
646 | } | 634 | } |
647 | 635 | ||
648 | $scope.showLoader = false; | 636 | $scope.showLoader = false; |
649 | }) | 637 | }) |
650 | }) | 638 | }) |
651 | 639 | ||
652 | } | 640 | } |
653 | 641 | ||
654 | /*Use for Save and Stage for Deploy */ | 642 | /*Use for Save and Stage for Deploy */ |
655 | $scope.updateFutureFuelPricing = {}; | 643 | $scope.updateFutureFuelPricing = {}; |
656 | $scope.updateFutureFuelPricing.futureFuelPricingList = []; | 644 | $scope.updateFutureFuelPricing.futureFuelPricingList = []; |
657 | $scope.updateFutureFuelPricing.userProfileId = $scope.userProfileId; | 645 | $scope.updateFutureFuelPricing.userProfileId = $scope.userProfileId; |
658 | $scope.updateFutureFuelPricingClick = function(){ | 646 | $scope.updateFutureFuelPricingClick = function(){ |
659 | $scope.showLoader = true; | 647 | $scope.showLoader = true; |
660 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 648 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
661 | //console.log(parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin)); | 649 | //console.log(parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin)); |
662 | // console.log('-----',$scope.newFuelPricing[i].futureFuelPricing); | 650 | // console.log('-----',$scope.newFuelPricing[i].futureFuelPricing); |
663 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 651 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
664 | if ($scope.newFuelPricing[i].futureFuelPricing.cost != null || $scope.newFuelPricing[i].futureFuelPricing.cost != '' || $scope.newFuelPricing[i].futureFuelPricing.cost != undefined) { | 652 | if ($scope.newFuelPricing[i].futureFuelPricing.cost != null || $scope.newFuelPricing[i].futureFuelPricing.cost != '' || $scope.newFuelPricing[i].futureFuelPricing.cost != undefined) { |
665 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); | 653 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); |
666 | if ($scope.newFuelPricing[i].futureFuelPricing.cost == null) { | 654 | if ($scope.newFuelPricing[i].futureFuelPricing.cost == null) { |
667 | $scope.newFuelPricing[i].futureFuelPricing.cost = ''; | 655 | $scope.newFuelPricing[i].futureFuelPricing.cost = ''; |
668 | } | 656 | } |
669 | if ($scope.newFuelPricing[i].futureFuelPricing.papMargin == null) { | 657 | if ($scope.newFuelPricing[i].futureFuelPricing.papMargin == null) { |
670 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; | 658 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; |
671 | } | 659 | } |
672 | if ($scope.newFuelPricing[i].futureFuelPricing.papTotal == null) { | 660 | if ($scope.newFuelPricing[i].futureFuelPricing.papTotal == null) { |
673 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; | 661 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; |
674 | } | 662 | } |
675 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration == null) { | 663 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration == null) { |
676 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = ''; | 664 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = ''; |
677 | }else{ | 665 | }else{ |
678 | //store timestamp | 666 | //store timestamp |
679 | var setExpiration = new Date(); | 667 | var setExpiration = new Date(); |
680 | var hours = setExpiration.getHours(); | 668 | var hours = setExpiration.getHours(); |
681 | var min = setExpiration.getMinutes(); | 669 | var min = setExpiration.getMinutes(); |
682 | var sec = setExpiration.getSeconds(); | 670 | var sec = setExpiration.getSeconds(); |
683 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration + ' ' + hours + ':' + min + ':' + sec; | 671 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration + ' ' + hours + ':' + min + ':' + sec; |
684 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 672 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
685 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration.getTime(); | 673 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration.getTime(); |
686 | } | 674 | } |
687 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate == null) { | 675 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate == null) { |
688 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = ''; | 676 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = ''; |
689 | }else{ | 677 | }else{ |
690 | var setDeploy = new Date(); | 678 | var setDeploy = new Date(); |
691 | var hours = setDeploy.getHours(); | 679 | var hours = setDeploy.getHours(); |
692 | var min = setDeploy.getMinutes(); | 680 | var min = setDeploy.getMinutes(); |
693 | var sec = setDeploy.getSeconds(); | 681 | var sec = setDeploy.getSeconds(); |
694 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate + ' ' + hours + ':' + min + ':' + sec; | 682 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate + ' ' + hours + ':' + min + ':' + sec; |
695 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 683 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
696 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate.getTime(); | 684 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate.getTime(); |
697 | } | 685 | } |
698 | 686 | ||
699 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); | 687 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); |
700 | //$scope.newFuelPricing[i].futureFuelPricing.papTotal; | 688 | //$scope.newFuelPricing[i].futureFuelPricing.papTotal; |
701 | $scope.updateFutureFuelPricing.futureFuelPricingList.push({ | 689 | $scope.updateFutureFuelPricing.futureFuelPricingList.push({ |
702 | 'cost': $scope.newFuelPricing[i].futureFuelPricing.cost, | 690 | 'cost': $scope.newFuelPricing[i].futureFuelPricing.cost, |
703 | 'papMargin': $scope.newFuelPricing[i].futureFuelPricing.papMargin, | 691 | 'papMargin': $scope.newFuelPricing[i].futureFuelPricing.papMargin, |
704 | //'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, | 692 | //'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, |
705 | 'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, | 693 | 'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, |
706 | 'expirationDate': $scope.newFuelPricing[i].futureFuelPricing.nextExpiration, | 694 | 'expirationDate': $scope.newFuelPricing[i].futureFuelPricing.nextExpiration, |
707 | 'deployDate': $scope.newFuelPricing[i].futureFuelPricing.deployDate, | 695 | 'deployDate': $scope.newFuelPricing[i].futureFuelPricing.deployDate, |
708 | 'productId': $scope.newFuelPricing[i].id, | 696 | 'productId': $scope.newFuelPricing[i].id, |
709 | 'id': $scope.newFuelPricing[i].futureFuelPricing.id, | 697 | 'id': $scope.newFuelPricing[i].futureFuelPricing.id, |
710 | }) | 698 | }) |
711 | } | 699 | } |
712 | }else{ | 700 | }else{ |
713 | /*$scope.newFuelPricing[i].futureFuelPricing.cost = ''; | 701 | /*$scope.newFuelPricing[i].futureFuelPricing.cost = ''; |
714 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; | 702 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; |
715 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; | 703 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; |
716 | $scope.newFuelPricing[i].futureFuelPricing.expirationDate = ''; | 704 | $scope.newFuelPricing[i].futureFuelPricing.expirationDate = ''; |
717 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = '';*/ | 705 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = '';*/ |
718 | } | 706 | } |
719 | } | 707 | } |
720 | //console.log('$scope.updateFutureFuelPricing', $scope.updateFutureFuelPricing); | 708 | //console.log('$scope.updateFutureFuelPricing', $scope.updateFutureFuelPricing); |
721 | updateFuelManagerService.updateFutureFuelPricing($scope.updateFutureFuelPricing).then(function(result) { | 709 | updateFuelManagerService.updateFutureFuelPricing($scope.updateFutureFuelPricing).then(function(result) { |
722 | toastr.success('Successfully Updated', { | 710 | toastr.success('Successfully Updated', { |
723 | closeButton: true | 711 | closeButton: true |
724 | }) | 712 | }) |
725 | updateFuelManagerService.getFuelPricingNew().then(function(result) { | 713 | updateFuelManagerService.getFuelPricingNew().then(function(result) { |
726 | $scope.newFuelPricing = result; | 714 | $scope.newFuelPricing = result; |
727 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 715 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
728 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 716 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
729 | /*if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { | 717 | /*if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { |
730 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 718 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
731 | var month = newTime.getUTCMonth() + 1; //months from 1-12 | 719 | var month = newTime.getUTCMonth() + 1; //months from 1-12 |
732 | var day = newTime.getUTCDate(); | 720 | var day = newTime.getUTCDate(); |
733 | var year = newTime.getUTCFullYear(); | 721 | var year = newTime.getUTCFullYear(); |
734 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; | 722 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; |
735 | }*/ | 723 | }*/ |
736 | } | 724 | } |
737 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 725 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
738 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 726 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
739 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { | 727 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { |
740 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 728 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
741 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 | 729 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 |
742 | var nextDay = newTime.getUTCDate(); | 730 | var nextDay = newTime.getUTCDate(); |
743 | var nextYear = newTime.getUTCFullYear(); | 731 | var nextYear = newTime.getUTCFullYear(); |
744 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; | 732 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; |
745 | }*/ | 733 | }*/ |
746 | } | 734 | } |
747 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 735 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
748 | /*if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { | 736 | /*if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { |
749 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 737 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
750 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 738 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
751 | var dday = newTime.getUTCDate(); | 739 | var dday = newTime.getUTCDate(); |
752 | var dyear = newTime.getUTCFullYear(); | 740 | var dyear = newTime.getUTCFullYear(); |
753 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 741 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
754 | }*/ | 742 | }*/ |
755 | } | 743 | } |
756 | } | 744 | } |
757 | 745 | ||
758 | var str =""+ $scope.newFuelPricing[i].name | 746 | var str =""+ $scope.newFuelPricing[i].name |
759 | if(str.startsWith("J")){ | 747 | if(str.startsWith("J")){ |
760 | $scope.newFuelPricing[i].jeta = true; | 748 | $scope.newFuelPricing[i].jeta = true; |
761 | var str1 = str.substring(0,5) | 749 | var str1 = str.substring(0,5) |
762 | var str2 = str.substring(6, str.length) | 750 | var str2 = str.substring(6, str.length) |
763 | $scope.newFuelPricing[i].name = str1 | 751 | $scope.newFuelPricing[i].name = str1 |
764 | $scope.newFuelPricing[i].namejetrest = str2 | 752 | $scope.newFuelPricing[i].namejetrest = str2 |
765 | 753 | ||
766 | 754 | ||
767 | }else if(str.startsWith("100")){ | 755 | }else if(str.startsWith("100")){ |
768 | $scope.newFuelPricing[i].avgas = true; | 756 | $scope.newFuelPricing[i].avgas = true; |
769 | var str1 = str.substring(0,5) | 757 | var str1 = str.substring(0,5) |
770 | var str2 = str.substring(6, str.length) | 758 | var str2 = str.substring(6, str.length) |
771 | $scope.newFuelPricing[i].name = str1 | 759 | $scope.newFuelPricing[i].name = str1 |
772 | $scope.newFuelPricing[i].nameavgasrest = str2 | 760 | $scope.newFuelPricing[i].nameavgasrest = str2 |
773 | } | 761 | } |
774 | 762 | ||
775 | } | 763 | } |
776 | $state.reload(); | 764 | $state.reload(); |
777 | $scope.showLoader = false; | 765 | $scope.showLoader = false; |
778 | }) | 766 | }) |
779 | }) | 767 | }) |
780 | 768 | ||
781 | 769 | ||
782 | } | 770 | } |
783 | 771 | ||
784 | /* Use for Save & Deploy Immediately */ | 772 | /* Use for Save & Deploy Immediately */ |
785 | $scope.updateFutureFuelPricingImmediatelyClick = function(){ | 773 | $scope.updateFutureFuelPricingImmediatelyClick = function(){ |
786 | $scope.showLoader = true; | 774 | $scope.showLoader = true; |
787 | // console.log('--$scope.newFuelPricing--', $scope.newFuelPricing); | 775 | // console.log('--$scope.newFuelPricing--', $scope.newFuelPricing); |
788 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 776 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
789 | //console.log(parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin)); | 777 | //console.log(parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin)); |
790 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 778 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
791 | if ($scope.newFuelPricing[i].futureFuelPricing.cost != null || $scope.newFuelPricing[i].futureFuelPricing.cost != '' || $scope.newFuelPricing[i].futureFuelPricing.cost != undefined) { | 779 | if ($scope.newFuelPricing[i].futureFuelPricing.cost != null || $scope.newFuelPricing[i].futureFuelPricing.cost != '' || $scope.newFuelPricing[i].futureFuelPricing.cost != undefined) { |
792 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); | 780 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); |
793 | if ($scope.newFuelPricing[i].futureFuelPricing.cost == null) { | 781 | if ($scope.newFuelPricing[i].futureFuelPricing.cost == null) { |
794 | $scope.newFuelPricing[i].futureFuelPricing.cost = ''; | 782 | $scope.newFuelPricing[i].futureFuelPricing.cost = ''; |
795 | } | 783 | } |
796 | if ($scope.newFuelPricing[i].futureFuelPricing.papMargin == null) { | 784 | if ($scope.newFuelPricing[i].futureFuelPricing.papMargin == null) { |
797 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; | 785 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; |
798 | } | 786 | } |
799 | if ($scope.newFuelPricing[i].futureFuelPricing.papTotal == null) { | 787 | if ($scope.newFuelPricing[i].futureFuelPricing.papTotal == null) { |
800 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; | 788 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; |
801 | } | 789 | } |
802 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration == null) { | 790 | if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration == null) { |
803 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = ''; | 791 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = ''; |
804 | }else{ | 792 | }else{ |
805 | var setExpiration = new Date(); | 793 | var setExpiration = new Date(); |
806 | var hours = setExpiration.getHours(); | 794 | var hours = setExpiration.getHours(); |
807 | var min = setExpiration.getMinutes(); | 795 | var min = setExpiration.getMinutes(); |
808 | var sec = setExpiration.getSeconds(); | 796 | var sec = setExpiration.getSeconds(); |
809 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration + ' ' + hours + ':' + min + ':' + sec; | 797 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration + ' ' + hours + ':' + min + ':' + sec; |
810 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 798 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
811 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration.getTime(); | 799 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = $scope.newFuelPricing[i].futureFuelPricing.nextExpiration.getTime(); |
812 | } | 800 | } |
813 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate == null) { | 801 | if ($scope.newFuelPricing[i].futureFuelPricing.deployDate == null) { |
814 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = ''; | 802 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = ''; |
815 | }else{ | 803 | }else{ |
816 | var setDeploy = new Date(); | 804 | var setDeploy = new Date(); |
817 | var hours = setDeploy.getHours(); | 805 | var hours = setDeploy.getHours(); |
818 | var min = setDeploy.getMinutes(); | 806 | var min = setDeploy.getMinutes(); |
819 | var sec = setDeploy.getSeconds(); | 807 | var sec = setDeploy.getSeconds(); |
820 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate + ' ' + hours + ':' + min + ':' + sec; | 808 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate + ' ' + hours + ':' + min + ':' + sec; |
821 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 809 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
822 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate.getTime(); | 810 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = $scope.newFuelPricing[i].futureFuelPricing.deployDate.getTime(); |
823 | } | 811 | } |
824 | 812 | ||
825 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); | 813 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); |
826 | //$scope.newFuelPricing[i].futureFuelPricing.papTotal; | 814 | //$scope.newFuelPricing[i].futureFuelPricing.papTotal; |
827 | $scope.updateFutureFuelPricing.futureFuelPricingList.push({ | 815 | $scope.updateFutureFuelPricing.futureFuelPricingList.push({ |
828 | 'cost': $scope.newFuelPricing[i].futureFuelPricing.cost, | 816 | 'cost': $scope.newFuelPricing[i].futureFuelPricing.cost, |
829 | 'papMargin': $scope.newFuelPricing[i].futureFuelPricing.papMargin, | 817 | 'papMargin': $scope.newFuelPricing[i].futureFuelPricing.papMargin, |
830 | //'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, | 818 | //'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, |
831 | 'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, | 819 | 'papTotal': $scope.newFuelPricing[i].futureFuelPricing.papTotal, |
832 | 'expirationDate': $scope.newFuelPricing[i].futureFuelPricing.nextExpiration, | 820 | 'expirationDate': $scope.newFuelPricing[i].futureFuelPricing.nextExpiration, |
833 | 'deployDate': $scope.newFuelPricing[i].futureFuelPricing.deployDate, | 821 | 'deployDate': $scope.newFuelPricing[i].futureFuelPricing.deployDate, |
834 | 'productId': $scope.newFuelPricing[i].id, | 822 | 'productId': $scope.newFuelPricing[i].id, |
835 | 'id': $scope.newFuelPricing[i].futureFuelPricing.id, | 823 | 'id': $scope.newFuelPricing[i].futureFuelPricing.id, |
836 | }) | 824 | }) |
837 | } | 825 | } |
838 | }else{ | 826 | }else{ |
839 | /*$scope.newFuelPricing[i].futureFuelPricing.cost = ''; | 827 | /*$scope.newFuelPricing[i].futureFuelPricing.cost = ''; |
840 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; | 828 | $scope.newFuelPricing[i].futureFuelPricing.papMargin = ''; |
841 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; | 829 | $scope.newFuelPricing[i].futureFuelPricing.papTotal = ''; |
842 | $scope.newFuelPricing[i].futureFuelPricing.expirationDate = ''; | 830 | $scope.newFuelPricing[i].futureFuelPricing.expirationDate = ''; |
843 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = '';*/ | 831 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = '';*/ |
844 | } | 832 | } |
845 | } | 833 | } |
846 | //console.log('$scope.updateFutureFuelPricing', $scope.updateFutureFuelPricing); | 834 | //console.log('$scope.updateFutureFuelPricing', $scope.updateFutureFuelPricing); |
847 | updateFuelManagerService.updateFutureFuelPricingImmediatlly($scope.updateFutureFuelPricing).then(function(result) { | 835 | updateFuelManagerService.updateFutureFuelPricingImmediatlly($scope.updateFutureFuelPricing).then(function(result) { |
848 | toastr.success('Successfully Updated', { | 836 | toastr.success('Successfully Updated', { |
849 | closeButton: true | 837 | closeButton: true |
850 | }) | 838 | }) |
851 | updateFuelManagerService.getFuelPricingNew().then(function(result) { | 839 | updateFuelManagerService.getFuelPricingNew().then(function(result) { |
852 | $scope.newFuelPricing = result; | 840 | $scope.newFuelPricing = result; |
853 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { | 841 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
854 | if ($scope.newFuelPricing[i].fuelPricing != null) { | 842 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
855 | console.log("$scope.newFuelPricing[i].fuelPricing.expirationDate",$scope.newFuelPricing[i].fuelPricing.expirationDate) | 843 | console.log("$scope.newFuelPricing[i].fuelPricing.expirationDate",$scope.newFuelPricing[i].fuelPricing.expirationDate) |
856 | /*if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { | 844 | /*if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { |
857 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); | 845 | var newTime = new Date($scope.newFuelPricing[i].fuelPricing.expirationDate); |
858 | var month = newTime.getUTCMonth() + 1; //months from 1-12 | 846 | var month = newTime.getUTCMonth() + 1; //months from 1-12 |
859 | var day = newTime.getUTCDate(); | 847 | var day = newTime.getUTCDate(); |
860 | var year = newTime.getUTCFullYear(); | 848 | var year = newTime.getUTCFullYear(); |
861 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; | 849 | $scope.newFuelPricing[i].fuelPricing.expirationDate = month+'/'+day+'/'+year; |
862 | }*/ | 850 | }*/ |
863 | } | 851 | } |
864 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 852 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
865 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 853 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
866 | console.log(" $scope.newFuelPricing[i].futureFuelPricing.nextExpiration", $scope.newFuelPricing[i].futureFuelPricing.nextExpiration) | 854 | console.log(" $scope.newFuelPricing[i].futureFuelPricing.nextExpiration", $scope.newFuelPricing[i].futureFuelPricing.nextExpiration) |
867 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { | 855 | /*if ($scope.newFuelPricing[i].futureFuelPricing.nextExpiration != null && $scope.newFuelPricing[i].futureFuelPricing.nextExpiration != '') { |
868 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); | 856 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.nextExpiration); |
869 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 | 857 | var nextMonth = newTime.getUTCMonth() + 1; //months from 1-12 |
870 | var nextDay = newTime.getUTCDate(); | 858 | var nextDay = newTime.getUTCDate(); |
871 | var nextYear = newTime.getUTCFullYear(); | 859 | var nextYear = newTime.getUTCFullYear(); |
872 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; | 860 | $scope.newFuelPricing[i].futureFuelPricing.nextExpiration = nextMonth+'/'+nextDay+'/'+nextYear; |
873 | }*/ | 861 | }*/ |
874 | } | 862 | } |
875 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { | 863 | if ($scope.newFuelPricing[i].futureFuelPricing != null) { |
876 | /*if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { | 864 | /*if ($scope.newFuelPricing[i].futureFuelPricing.deployDate != null && $scope.newFuelPricing[i].futureFuelPricing.deployDate != '') { |
877 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); | 865 | var newTime = new Date($scope.newFuelPricing[i].futureFuelPricing.deployDate); |
878 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 866 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
879 | var dday = newTime.getUTCDate(); | 867 | var dday = newTime.getUTCDate(); |
880 | var dyear = newTime.getUTCFullYear(); | 868 | var dyear = newTime.getUTCFullYear(); |
881 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; | 869 | $scope.newFuelPricing[i].futureFuelPricing.deployDate = dmonth+'/'+dday+'/'+dyear; |
882 | }*/ | 870 | }*/ |
883 | console.log(" $scope.newFuelPricing[i].futureFuelPricing.deployDate", $scope.newFuelPricing[i].futureFuelPricing.deployDate) | 871 | console.log(" $scope.newFuelPricing[i].futureFuelPricing.deployDate", $scope.newFuelPricing[i].futureFuelPricing.deployDate) |
884 | } | 872 | } |
885 | } | 873 | } |
886 | 874 | ||
887 | var str =""+ $scope.newFuelPricing[i].name | 875 | var str =""+ $scope.newFuelPricing[i].name |
888 | if(str.startsWith("J")){ | 876 | if(str.startsWith("J")){ |
889 | $scope.newFuelPricing[i].jeta = true; | 877 | $scope.newFuelPricing[i].jeta = true; |
890 | var str1 = str.substring(0,5) | 878 | var str1 = str.substring(0,5) |
891 | var str2 = str.substring(6, str.length) | 879 | var str2 = str.substring(6, str.length) |
892 | $scope.newFuelPricing[i].name = str1 | 880 | $scope.newFuelPricing[i].name = str1 |
893 | $scope.newFuelPricing[i].namejetrest = str2 | 881 | $scope.newFuelPricing[i].namejetrest = str2 |
894 | 882 | ||
895 | 883 | ||
896 | }else if(str.startsWith("100")){ | 884 | }else if(str.startsWith("100")){ |
897 | $scope.newFuelPricing[i].avgas = true; | 885 | $scope.newFuelPricing[i].avgas = true; |
898 | var str1 = str.substring(0,5) | 886 | var str1 = str.substring(0,5) |
899 | var str2 = str.substring(6, str.length) | 887 | var str2 = str.substring(6, str.length) |
900 | $scope.newFuelPricing[i].name = str1 | 888 | $scope.newFuelPricing[i].name = str1 |
901 | $scope.newFuelPricing[i].nameavgasrest = str2 | 889 | $scope.newFuelPricing[i].nameavgasrest = str2 |
902 | } | 890 | } |
903 | 891 | ||
904 | } | 892 | } |
905 | $scope.showLoader = false; | 893 | $scope.showLoader = false; |
906 | }) | 894 | }) |
907 | $state.reload(); | 895 | $state.reload(); |
908 | }) | 896 | }) |
909 | } | 897 | } |
910 | 898 | ||
911 | updateFuelManagerService.getMargin().then(function(result) { | 899 | updateFuelManagerService.getMargin().then(function(result) { |
912 | $scope.marginList = result; | 900 | $scope.marginList = result; |
913 | }) | 901 | }) |
914 | 902 | ||
915 | $scope.marginIdDelete = ''; | 903 | $scope.marginIdDelete = ''; |
916 | $scope.deleteJetAccordian = function(id){ | 904 | $scope.deleteJetAccordian = function(id){ |
917 | $scope.marginIdDelete = id; | 905 | $scope.marginIdDelete = id; |
918 | $('#deleteMargin').css('display', 'block'); | 906 | $('#deleteMargin').css('display', 'block'); |
919 | } | 907 | } |
920 | 908 | ||
921 | $scope.confirmDeleteMargin = function(){ | 909 | $scope.confirmDeleteMargin = function(){ |
922 | $('#deleteMargin').css('display', 'none'); | 910 | $('#deleteMargin').css('display', 'none'); |
923 | $scope.showLoader = true; | 911 | $scope.showLoader = true; |
924 | updateFuelManagerService.deleteMargin($scope.marginIdDelete).then(function(result) { | 912 | updateFuelManagerService.deleteMargin($scope.marginIdDelete).then(function(result) { |
925 | //console.log("--kd---",$scope.marginIdDelete) | 913 | //console.log("--kd---",$scope.marginIdDelete) |
926 | toastr.success(''+result.success+'', { | 914 | toastr.success(''+result.success+'', { |
927 | closeButton: true | 915 | closeButton: true |
928 | }) | 916 | }) |
929 | 917 | ||
930 | getAtypeFunction(); | 918 | getAtypeFunction(); |
931 | }) | 919 | }) |
932 | } | 920 | } |
933 | 921 | ||
934 | $scope.cancelMarginDelete = function(){ | 922 | $scope.cancelMarginDelete = function(){ |
935 | $scope.marginIdDelete = ''; | 923 | $scope.marginIdDelete = ''; |
936 | $('#deleteMargin').css('display', 'none'); | 924 | $('#deleteMargin').css('display', 'none'); |
937 | } | 925 | } |
938 | 926 | ||
939 | $scope.marginVtypeIdDelete = ''; | 927 | $scope.marginVtypeIdDelete = ''; |
940 | $scope.deleteVtypeJetAccordian = function(id){ | 928 | $scope.deleteVtypeJetAccordian = function(id){ |
941 | $scope.marginVtypeIdDelete = id; | 929 | $scope.marginVtypeIdDelete = id; |
942 | $('#deleteVtypeMargin').css('display', 'block'); | 930 | $('#deleteVtypeMargin').css('display', 'block'); |
943 | } | 931 | } |
944 | 932 | ||
945 | $scope.confirmDeletVtypeMargin = function(){ | 933 | $scope.confirmDeletVtypeMargin = function(){ |
946 | $('#deleteVtypeMargin').css('display', 'none'); | 934 | $('#deleteVtypeMargin').css('display', 'none'); |
947 | $scope.showLoader = true; | 935 | $scope.showLoader = true; |
948 | updateFuelManagerService.deleteMargin($scope.marginVtypeIdDelete).then(function(result) { | 936 | updateFuelManagerService.deleteMargin($scope.marginVtypeIdDelete).then(function(result) { |
949 | toastr.success(''+result.success+'', { | 937 | toastr.success(''+result.success+'', { |
950 | closeButton: true | 938 | closeButton: true |
951 | }) | 939 | }) |
952 | 940 | ||
953 | getVTypeFunction(); | 941 | getVTypeFunction(); |
954 | }) | 942 | }) |
955 | } | 943 | } |
956 | 944 | ||
957 | $scope.cancelVtypeMarginDelete = function(){ | 945 | $scope.cancelVtypeMarginDelete = function(){ |
958 | $scope.marginVtypeIdDelete = ''; | 946 | $scope.marginVtypeIdDelete = ''; |
959 | $('#deleteVtypeMargin').css('display', 'none'); | 947 | $('#deleteVtypeMargin').css('display', 'none'); |
960 | } | 948 | } |
961 | 949 | ||
962 | $scope.resetFutureFuelPricingClick = function(){ | 950 | $scope.resetFutureFuelPricingClick = function(){ |
963 | //$scope.newFuelPricing=''; | 951 | //$scope.newFuelPricing=''; |
964 | $('#resetPricing').css('display', 'block'); | 952 | $('#resetPricing').css('display', 'block'); |
965 | } | 953 | } |
966 | 954 | ||
967 | $scope.confirmReset = function(){ | 955 | $scope.confirmReset = function(){ |
968 | $('#resetPricing').css('display', 'none'); | 956 | $('#resetPricing').css('display', 'none'); |
969 | $scope.formFunction(); | 957 | $scope.formFunction(); |
970 | //$scope.showLoader = true; | 958 | //$scope.showLoader = true; |
971 | //document.getElementById("resetForm").reset(); | 959 | //document.getElementById("resetForm").reset(); |
972 | // $scope.fuelPricing.futureFuelPricing.cost=""; | 960 | // $scope.fuelPricing.futureFuelPricing.cost=""; |
973 | /*updateFuelManagerService.resetPricing().then(function(result) { | 961 | /*updateFuelManagerService.resetPricing().then(function(result) { |
974 | toastr.success(''+result.success+'', { | 962 | toastr.success(''+result.success+'', { |
975 | closeButton: true | 963 | closeButton: true |
976 | }) | 964 | }) |
977 | $scope.showLoader = false; | 965 | $scope.showLoader = false; |
978 | })*/ | 966 | })*/ |
979 | } | 967 | } |
980 | 968 | ||
981 | $scope.cancelReset = function(){ | 969 | $scope.cancelReset = function(){ |
982 | $('#resetPricing').css('display', 'none'); | 970 | $('#resetPricing').css('display', 'none'); |
983 | } | 971 | } |
984 | $scope.noPrices = true; | 972 | $scope.noPrices = true; |
985 | $scope.disableButtons = function(value){ | 973 | $scope.disableButtons = function(value){ |
986 | if(value.length != 0){ | 974 | if(value.length != 0){ |
987 | $scope.noPrices = false; | 975 | $scope.noPrices = false; |
988 | } | 976 | } |
989 | else{ | 977 | else{ |
990 | $scope.noPrices = true; | 978 | $scope.noPrices = true; |
991 | } | 979 | } |
992 | } | 980 | } |
993 | 981 | ||
994 | /*validate number input type to 4 digit auto complete zero's*/ | 982 | /*validate number input type to 4 digit auto complete zero's*/ |
995 | 983 | ||
996 | $scope.force4decimals= function(data) { | 984 | $scope.force4decimals= function(data) { |
997 | //console.log("check",data) | 985 | //console.log("check",data) |
998 | event.target.value = parseFloat(event.target.value).toFixed(4); | 986 | event.target.value = parseFloat(event.target.value).toFixed(4); |
999 | //console.log("after check",event.target.value) | 987 | //console.log("after check",event.target.value) |
1000 | } | 988 | } |
1001 | 989 | ||
1002 | }]); | 990 | }]); |
1003 | 991 | ||
1004 | 992 | ||
1005 | 993 |
app/partials/viewCompany/viewCompany.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | 5 | ||
6 | .controller('viewCompanyController', ['$scope', '$uibModal', '$stateParams', 'ViewCompanyService', 'CustomersService', 'updateFuelManagerService', 'ViewFuelVendorService', 'ViewcontactService', '$state', 'fuelOrdersService', 'enterFuelOrderService', 'NgTableParams', function($scope, $uibModal, $stateParams, ViewCompanyService, CustomersService, updateFuelManagerService, ViewFuelVendorService, ViewcontactService, $state, fuelOrdersService, enterFuelOrderService, NgTableParams) { | 6 | .controller('viewCompanyController', ['$scope', '$uibModal', '$stateParams', 'ViewCompanyService', 'CustomersService', 'updateFuelManagerService', 'ViewFuelVendorService', 'ViewcontactService', '$state', 'fuelOrdersService', 'enterFuelOrderService', 'NgTableParams', function($scope, $uibModal, $stateParams, ViewCompanyService, CustomersService, updateFuelManagerService, ViewFuelVendorService, ViewcontactService, $state, fuelOrdersService, enterFuelOrderService, NgTableParams) { |
7 | $scope.data = {}; | 7 | $scope.data = {}; |
8 | $scope.data.priceEmail = true; | 8 | $scope.data.priceEmail = true; |
9 | $scope.aircraft = {}; | 9 | $scope.aircraft = {}; |
10 | $scope.primayData = {}; | 10 | $scope.primayData = {}; |
11 | $scope.showLoader = false; | 11 | $scope.showLoader = false; |
12 | $scope.showUpdateBtn = false; | 12 | $scope.showUpdateBtn = false; |
13 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')); | 13 | $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')); |
14 | $scope.selected = []; | 14 | $scope.selected = []; |
15 | $scope.jetShow = []; | 15 | $scope.jetShow = []; |
16 | $scope.marginShow = []; | 16 | $scope.marginShow = []; |
17 | $scope.compId = $stateParams.id; | 17 | $scope.compId = $stateParams.id; |
18 | $scope.jetShow[0] = true; | 18 | $scope.jetShow[0] = true; |
19 | $scope.marginShow[0] = true; | 19 | $scope.marginShow[0] = true; |
20 | $scope.dispatchOrder = {}; | 20 | $scope.dispatchOrder = {}; |
21 | $scope.dispatchOrder.fuelOrderList = []; | 21 | $scope.dispatchOrder.fuelOrderList = []; |
22 | $scope.statusFilterOptions = []; | 22 | $scope.statusFilterOptions = []; |
23 | $scope.companyList = {}; | 23 | $scope.companyList = {}; |
24 | $scope.statusFilterOptions.push({ | 24 | $scope.statusFilterOptions.push({ |
25 | 'id': '', | 25 | 'id': '', |
26 | 'title': 'Show All' | 26 | 'title': 'Show All' |
27 | }, { | 27 | }, { |
28 | 'id': 'pending', | 28 | 'id': 'pending', |
29 | 'title': 'Pending' | 29 | 'title': 'Pending' |
30 | }, { | 30 | }, { |
31 | 'id': 'invoiced', | 31 | 'id': 'invoiced', |
32 | 'title': 'Invoiced' | 32 | 'title': 'Invoiced' |
33 | }, { | 33 | }, { |
34 | 'id': 'paid', | 34 | 'id': 'paid', |
35 | 'title': 'Paid' | 35 | 'title': 'Paid' |
36 | }, { | 36 | }, { |
37 | 'id': 'cancelled', | 37 | 'id': 'cancelled', |
38 | 'title': 'Cancelled' | 38 | 'title': 'Cancelled' |
39 | }, { | 39 | }, { |
40 | 'id': 'archived', | 40 | 'id': 'archived', |
41 | 'title': 'Archived' | 41 | 'title': 'Archived' |
42 | } | 42 | } |
43 | 43 | ||
44 | ); | 44 | ); |
45 | 45 | ||
46 | $scope.order = {}; | 46 | $scope.order = {}; |
47 | $scope.order.companyName = ''; | 47 | $scope.order.companyName = ''; |
48 | $scope.order.upliftDate = ''; | 48 | $scope.order.upliftDate = ''; |
49 | /*Get AllCompany api is used from CustomersService*/ | 49 | /*Get AllCompany api is used from CustomersService*/ |
50 | getAllCompanies(); | 50 | getAllCompanies(); |
51 | 51 | ||
52 | function getAllCompanies() { | 52 | function getAllCompanies() { |
53 | CustomersService.getAllCompanies().then(function(result) { | 53 | CustomersService.getAllCompanies().then(function(result) { |
54 | //console.log('log', result[2].id); | 54 | //console.log('log', result[2].id); |
55 | $scope.companyList = result; | 55 | $scope.companyList = result; |
56 | 56 | ||
57 | for (var i = 0; i < $scope.companyList.length; i++) { | 57 | for (var i = 0; i < $scope.companyList.length; i++) { |
58 | if ($scope.companyList[i].companyContact != null) { | 58 | if ($scope.companyList[i].companyContact != null) { |
59 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { | 59 | if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { |
60 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; | 60 | $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; |
61 | } | 61 | } |
62 | } | 62 | } |
63 | if ($scope.companyList[i].primaryContact != null) { | 63 | if ($scope.companyList[i].primaryContact != null) { |
64 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { | 64 | if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { |
65 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; | 65 | $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | if ($scope.companyList[i].margin != null) { | 68 | if ($scope.companyList[i].margin != null) { |
69 | if ($scope.companyList[i].margin.marginName != null) { | 69 | if ($scope.companyList[i].margin.marginName != null) { |
70 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; | 70 | $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | } | 73 | } |
74 | $scope.displayCompanyList = new NgTableParams({ | 74 | $scope.displayCompanyList = new NgTableParams({ |
75 | page: 1, | 75 | page: 1, |
76 | count: 10, | 76 | count: 10, |
77 | }, { | 77 | }, { |
78 | data: $scope.companyList | 78 | data: $scope.companyList |
79 | }); | 79 | }); |
80 | $scope.showLoader = false; | 80 | $scope.showLoader = false; |
81 | }) | 81 | }) |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | $(document).ready(function() { | 85 | $(document).ready(function() { |
86 | $("#reset").click(function() { | 86 | $("#reset").click(function() { |
87 | $("input").val(""); | 87 | $("input").val(""); |
88 | }); | 88 | }); |
89 | }); | 89 | }); |
90 | 90 | ||
91 | $scope.values = [{ | 91 | $scope.values = [{ |
92 | 'id': 1, | 92 | 'id': 1, |
93 | 'first': 'Tenant/Base Customer' | 93 | 'first': 'Tenant/Base Customer' |
94 | }, | 94 | }, |
95 | { | 95 | { |
96 | 'id': 2, | 96 | 'id': 2, |
97 | 'first': 'FuelerLinx Customer' | 97 | 'first': 'FuelerLinx Customer' |
98 | }, | 98 | }, |
99 | { | 99 | { |
100 | 'id': 3, | 100 | 'id': 3, |
101 | 'first': 'CAA Member' | 101 | 'first': 'CAA Member' |
102 | } | 102 | } |
103 | ]; | 103 | ]; |
104 | 104 | ||
105 | 105 | ||
106 | 106 | ||
107 | $scope.changeValue = function(selected) { | 107 | $scope.changeValue = function(selected) { |
108 | $scope.showUpdateBtn = true; | 108 | $scope.showUpdateBtn = true; |
109 | // console.log("data to be true", selected); | 109 | // console.log("data to be true", selected); |
110 | for (var i = 0; i < selected.length; i++) { | 110 | for (var i = 0; i < selected.length; i++) { |
111 | // console.log(selected[i]) | 111 | // console.log(selected[i]) |
112 | if (selected[i] == 'Tenant/Base Customer') { | 112 | if (selected[i] == 'Tenant/Base Customer') { |
113 | $scope.companyData.baseTenant = true; | 113 | $scope.companyData.baseTenant = true; |
114 | } else { | 114 | } else { |
115 | $scope.companyData.baseTenant = false; | 115 | $scope.companyData.baseTenant = false; |
116 | } | 116 | } |
117 | if (selected[i] == 'FuelerLinx Customer') { | 117 | if (selected[i] == 'FuelerLinx Customer') { |
118 | $scope.companyData.fuelerlinxCustomer = true; | 118 | $scope.companyData.fuelerlinxCustomer = true; |
119 | } else { | 119 | } else { |
120 | $scope.companyData.fuelerlinxCustomer = false; | 120 | $scope.companyData.fuelerlinxCustomer = false; |
121 | } | 121 | } |
122 | 122 | ||
123 | if (selected[i] == 'CAA Member') { | 123 | if (selected[i] == 'CAA Member') { |
124 | $scope.companyData.contractFuelVendor = true; | 124 | $scope.companyData.contractFuelVendor = true; |
125 | } else { | 125 | } else { |
126 | $scope.companyData.contractFuelVendor = false; | 126 | $scope.companyData.contractFuelVendor = false; |
127 | } | 127 | } |
128 | 128 | ||
129 | // console.log($scope.companyData) | 129 | // console.log($scope.companyData) |
130 | 130 | ||
131 | } | 131 | } |
132 | 132 | ||
133 | } | 133 | } |
134 | 134 | ||
135 | // $scope.selected =[ | ||
136 | // {'id': 1, 'first': 'Tenant/Base Customer'}, | ||
137 | // {'id': 2, 'first': 'FuelerLinx Customer'}, | ||
138 | // {'id': 3, 'first': 'CAA Member'} | ||
139 | // ]; | ||
140 | |||
141 | // CustomersService.getMargin().then(function(result) { | ||
142 | // $scope.marginList = result; | ||
143 | // }) | ||
144 | 135 | ||
145 | var value = ""; | 136 | var value = ""; |
146 | var companyId = $stateParams.id; | 137 | var companyId = $stateParams.id; |
147 | 138 | ||
148 | $scope.companyData = {}; | 139 | $scope.companyData = {}; |
149 | $scope.multipleMsg = false; | 140 | $scope.multipleMsg = false; |
150 | $scope.companyData.masterMargin = ""; | 141 | $scope.companyData.masterMargin = ""; |
151 | $scope.isGlobal = false; | 142 | $scope.isGlobal = false; |
152 | $scope.fboPreffered = false; | 143 | $scope.fboPreffered = false; |
153 | getCompanyDetail(); | 144 | getCompanyDetail(); |
154 | 145 | ||
155 | function getCompanyDetail() { | 146 | function getCompanyDetail() { |
156 | $scope.showLoader = true; | 147 | $scope.showLoader = true; |
157 | ViewCompanyService.getCompany(companyId).then(function(result) { | 148 | ViewCompanyService.getCompany(companyId).then(function(result) { |
158 | $scope.companyData = result; | 149 | $scope.companyData = result; |
159 | $scope.isGlobal = result.global; | 150 | $scope.isGlobal = result.global; |
160 | $scope.fboPreffered = result.fboPreferred; | 151 | $scope.fboPreffered = result.fboPreferred; |
161 | if (result.global == true) { | 152 | if (result.global == true) { |
162 | $scope.companyData.global = true; | 153 | $scope.companyData.global = true; |
163 | } | 154 | } |
164 | if (result.margin != null) { | 155 | if (result.margin != null) { |
165 | $scope.companyData.masterMargin = result.margin.id; | 156 | $scope.companyData.masterMargin = result.margin.id; |
166 | } | 157 | } |
167 | if (result.marginAVGAS != null) { | 158 | if (result.marginAVGAS != null) { |
168 | $scope.companyData.avgasMargin = result.marginAVGAS.id; | 159 | $scope.companyData.avgasMargin = result.marginAVGAS.id; |
169 | } | 160 | } |
170 | 161 | ||
171 | 162 | ||
172 | 163 | ||
173 | if ($scope.companyData.baseTenant) { | 164 | if ($scope.companyData.baseTenant) { |
174 | 165 | ||
175 | $scope.selected.push({ | 166 | $scope.selected.push({ |
176 | 'first': 'Tenant/Base Customer' | 167 | 'first': 'Tenant/Base Customer' |
177 | }) | 168 | }) |
178 | // console.log("$scope.selected",$scope.selected) | 169 | // console.log("$scope.selected",$scope.selected) |
179 | 170 | ||
180 | } | 171 | } |
181 | 172 | ||
182 | if ($scope.companyData.fuelerlinxCustomer) { | 173 | if ($scope.companyData.fuelerlinxCustomer) { |
183 | $scope.selected.push({ | 174 | $scope.selected.push({ |
184 | 'first': 'FuelerLinx Customer' | 175 | 'first': 'FuelerLinx Customer' |
185 | }) | 176 | }) |
186 | // console.log("$scope.selected",$scope.selected) | 177 | // console.log("$scope.selected",$scope.selected) |
187 | } | 178 | } |
188 | 179 | ||
189 | if ($scope.companyData.contractFuelVendor) { | 180 | if ($scope.companyData.contractFuelVendor) { |
190 | $scope.selected.push({ | 181 | $scope.selected.push({ |
191 | 'first': 'CAA Member' | 182 | 'first': 'CAA Member' |
192 | }) | 183 | }) |
193 | // console.log("$scope.selected",$scope.selected) | 184 | // console.log("$scope.selected",$scope.selected) |
194 | } | 185 | } |
195 | 186 | ||
196 | // console.log("$scope.companyData",$scope.companyData) | 187 | // console.log("$scope.companyData",$scope.companyData) |
197 | getAircraftList(); | 188 | getAircraftList(); |
198 | $scope.order.companyName = $scope.companyData.companyName; | 189 | $scope.order.companyName = $scope.companyData.companyName; |
199 | $scope.getAircraft(result.companyName); | 190 | $scope.getAircraft(result.companyName); |
200 | $scope.showLoader = false; | 191 | $scope.showLoader = false; |
201 | }) | 192 | }) |
202 | } | 193 | } |
203 | 194 | ||
204 | 195 | ||
205 | $scope.changeCompanyStatus = function() { | 196 | $scope.changeCompanyStatus = function() { |
206 | $('#delete3').css('display', 'block'); | 197 | $('#delete3').css('display', 'block'); |
207 | if ($scope.companyData.activate == true) { | 198 | if ($scope.companyData.activate == true) { |
208 | $scope.statusMessage = 'Please confirm! Are you sure you want to ACTIVATE this company?' | 199 | $scope.statusMessage = 'Please confirm! Are you sure you want to ACTIVATE this company?' |
209 | } else { | 200 | } else { |
210 | $scope.statusMessage = 'Please confirm! Are you sure you want to DEACTIVATE this company?' | 201 | $scope.statusMessage = 'Please confirm! Are you sure you want to DEACTIVATE this company?' |
211 | } | 202 | } |
212 | } | 203 | } |
213 | 204 | ||
214 | $scope.companyStatus = function() { | 205 | $scope.companyStatus = function() { |
215 | $scope.showLoader = true; | 206 | $scope.showLoader = true; |
216 | var statusData = "status=" + $scope.companyData.activate; | 207 | var statusData = "status=" + $scope.companyData.activate; |
217 | ViewCompanyService.changeStatus(companyId, statusData).then(function(result) { | 208 | ViewCompanyService.changeStatus(companyId, statusData).then(function(result) { |
218 | if (result.success) { | 209 | if (result.success) { |
219 | $('#delete3').css('display', 'none'); | 210 | $('#delete3').css('display', 'none'); |
220 | toastr.success('' + result.success + '', { | 211 | toastr.success('' + result.success + '', { |
221 | closeButton: true | 212 | closeButton: true |
222 | }) | 213 | }) |
223 | getContactList(); | 214 | getContactList(); |
224 | } | 215 | } |
225 | }) | 216 | }) |
226 | $scope.showLoader = false; | 217 | $scope.showLoader = false; |
227 | } | 218 | } |
228 | 219 | ||
229 | 220 | ||
230 | $scope.cancelStatus = function() { | 221 | $scope.cancelStatus = function() { |
231 | $('#delete3').css('display', 'none'); | 222 | $('#delete3').css('display', 'none'); |
232 | $scope.companyData.activate = !$scope.companyData.activate; | 223 | $scope.companyData.activate = !$scope.companyData.activate; |
233 | } | 224 | } |
234 | 225 | ||
235 | getContactList(); | 226 | getContactList(); |
236 | 227 | ||
237 | function getContactList() { | 228 | function getContactList() { |
238 | ViewCompanyService.getContact(companyId).then(function(result) { | 229 | ViewCompanyService.getContact(companyId).then(function(result) { |
239 | $scope.companyContactList = result; | 230 | $scope.companyContactList = result; |
240 | }) | 231 | }) |
241 | } | 232 | } |
242 | $scope.aircraftmargins = []; | 233 | $scope.aircraftmargins = []; |
243 | 234 | ||
244 | $scope.abc = false; | 235 | $scope.abc = false; |
245 | $scope.xyz = false; | 236 | $scope.xyz = false; |
246 | function getAircraftList() { | 237 | function getAircraftList() { |
247 | ViewCompanyService.getAircraft(companyId).then(function(result) { | 238 | ViewCompanyService.getAircraft(companyId).then(function(result) { |
248 | 239 | ||
249 | $scope.contactAircraftList = result; | 240 | $scope.contactAircraftList = result; |
250 | for (var i = 0; i < $scope.contactAircraftList.length; i++) { | 241 | for (var i = 0; i < $scope.contactAircraftList.length; i++) { |
251 | if ($scope.contactAircraftList[i].aircraftsMargin != null) { | 242 | if ($scope.contactAircraftList[i].aircraftsMargin != null) { |
252 | $scope.aircraftmargins.push({ | 243 | $scope.aircraftmargins.push({ |
253 | 'id': $scope.contactAircraftList[i].aircraftsMargin.id | 244 | 'id': $scope.contactAircraftList[i].aircraftsMargin.id |
254 | }) | 245 | }) |
255 | $scope.contactAircraftList[i].fuelType = "Jet-A"; | 246 | $scope.contactAircraftList[i].fuelType = "Jet-A"; |
256 | $scope.contactAircraftList[i].marginValue = result[i].aircraftsMargin.marginValue; | 247 | $scope.contactAircraftList[i].marginValue = result[i].aircraftsMargin.marginValue; |
257 | $scope.abc = true; | 248 | $scope.abc = true; |
258 | 249 | ||
259 | }else{ | 250 | }else{ |
260 | $scope.contactAircraftList[i].fuelType = "100LL"; | 251 | $scope.contactAircraftList[i].fuelType = "100LL"; |
261 | if (result[i].aircraftsAVGASMargin != null) { | 252 | if (result[i].aircraftsAVGASMargin != null) { |
262 | $scope.contactAircraftList[i].marginValue = result[i].aircraftsAVGASMargin.marginValue; | 253 | $scope.contactAircraftList[i].marginValue = result[i].aircraftsAVGASMargin.marginValue; |
263 | $scope.xyz = true; | 254 | $scope.xyz = true; |
264 | 255 | ||
265 | } | 256 | } |
266 | } | 257 | } |
267 | 258 | ||
268 | } | 259 | } |
269 | if ($scope.aircraftmargins.length > 0) { | 260 | if ($scope.aircraftmargins.length > 0) { |
270 | for (var i = 0; i < $scope.aircraftmargins.length; i++) { | 261 | for (var i = 0; i < $scope.aircraftmargins.length; i++) { |
271 | if ($scope.aircraftmargins[i].id != $scope.companyData.masterMargin) { | 262 | if ($scope.aircraftmargins[i].id != $scope.companyData.masterMargin) { |
272 | $scope.multiple = true; | 263 | $scope.multiple = true; |
273 | $scope.multipleMsg = true; | 264 | $scope.multipleMsg = true; |
274 | if ($scope.multiple) { | 265 | if ($scope.multiple) { |
275 | $scope.companyData.masterMargin = "multiple"; | 266 | $scope.companyData.masterMargin = "multiple"; |
276 | } | 267 | } |
277 | } | 268 | } |
278 | } | 269 | } |
279 | } | 270 | } |
280 | }) | 271 | }) |
281 | } | 272 | } |
282 | 273 | ||
283 | 274 | ||
284 | 275 | ||
285 | $scope.contactData = {}; | 276 | $scope.contactData = {}; |
286 | $scope.contactData.contactList = []; | 277 | $scope.contactData.contactList = []; |
287 | $scope.addContact = function() { | 278 | $scope.addContact = function() { |
288 | $scope.showLoader = true; | 279 | $scope.showLoader = true; |
289 | $scope.data.companyId = companyId; | 280 | $scope.data.companyId = companyId; |
290 | $scope.contactData.contactList.push($scope.data); | 281 | $scope.contactData.contactList.push($scope.data); |
291 | ViewCompanyService.addContact($scope.contactData).then(function(result) { | 282 | ViewCompanyService.addContact($scope.contactData).then(function(result) { |
292 | //console.log("data==",$scope.contactData) | 283 | //console.log("data==",$scope.contactData) |
293 | // console.log(result) | 284 | // console.log(result) |
294 | if (result.status == 200) { | 285 | if (result.status == 200) { |
295 | 286 | ||
296 | $('#contact-modal-3').modal('hide'); | 287 | $('#contact-modal-3').modal('hide'); |
297 | $scope.primayData.id = result.data; | 288 | $scope.primayData.id = result.data; |
298 | $scope.data = {}; | 289 | $scope.data = {}; |
299 | $scope.sendPrimaryContact(); | 290 | $scope.sendPrimaryContact(); |
300 | getContactList(); | 291 | getContactList(); |
301 | $scope.contactData.contactList = []; | 292 | $scope.contactData.contactList = []; |
302 | $scope.data.email = ''; | 293 | $scope.data.email = ''; |
303 | toastr.success('Created Successfully', { | 294 | toastr.success('Created Successfully', { |
304 | closeButton: true | 295 | closeButton: true |
305 | }) | 296 | }) |
306 | } else { | 297 | } else { |
307 | toastr.error('' + result.statusText + '', { | 298 | toastr.error('' + result.statusText + '', { |
308 | closeButton: true | 299 | closeButton: true |
309 | }) | 300 | }) |
310 | } | 301 | } |
311 | }) | 302 | }) |
312 | $scope.showLoader = false; | 303 | $scope.showLoader = false; |
313 | } | 304 | } |
314 | 305 | ||
315 | getData(); | 306 | getData(); |
316 | 307 | ||
317 | function getData() { | 308 | function getData() { |
318 | $scope.showLoader = true; | 309 | $scope.showLoader = true; |
319 | CustomersService.getAircraftMake().then(function(result) { | 310 | CustomersService.getAircraftMake().then(function(result) { |
320 | $scope.aircraftMakeList = result; | 311 | $scope.aircraftMakeList = result; |
321 | // console.log("make",result) | 312 | // console.log("make",result) |
322 | }) | 313 | }) |
323 | $scope.showLoader = false; | 314 | $scope.showLoader = false; |
324 | } | 315 | } |
325 | 316 | ||
326 | $scope.clearAircrafts = function() { | 317 | $scope.clearAircrafts = function() { |
327 | $scope.aircraftDetails = []; | 318 | $scope.aircraftDetails = []; |
328 | $scope.aircraftDetails = [{ | 319 | $scope.aircraftDetails = [{ |
329 | 'tail': '', | 320 | 'tail': '', |
330 | 'make': '', | 321 | 'make': '', |
331 | 'model': '', | 322 | 'model': '', |
332 | 'sizeId': '', | 323 | 'sizeId': '', |
333 | 'marginId': '', | 324 | 'marginId': '', |
334 | 'avgasMarginId': '' | 325 | 'avgasMarginId': '' |
335 | }]; | 326 | }]; |
336 | } | 327 | } |
337 | 328 | ||
338 | $scope.addNew = function() { | 329 | $scope.addNew = function() { |
339 | $scope.aircraftDetails.push({ | 330 | $scope.aircraftDetails.push({ |
340 | 'tail': '', | 331 | 'tail': '', |
341 | 'make': '', | 332 | 'make': '', |
342 | 'model': '', | 333 | 'model': '', |
343 | 'sizeId': '', | 334 | 'sizeId': '', |
344 | 'marginId': '', | 335 | 'marginId': '', |
345 | 'avgasMarginId': '' | 336 | 'avgasMarginId': '' |
346 | }); | 337 | }); |
347 | // console.log($scope.aircraftDetails) | 338 | // console.log($scope.aircraftDetails) |
348 | }; | 339 | }; |
349 | 340 | ||
350 | $scope.getModal = function(makeId, index) { | 341 | $scope.getModal = function(makeId, index) { |
351 | $scope.showLoader = true; | 342 | $scope.showLoader = true; |
352 | $scope.aircraft.make = makeId; | 343 | $scope.aircraft.make = makeId; |
353 | CustomersService.getModal($scope.aircraft.make).then(function(result) { | 344 | CustomersService.getModal($scope.aircraft.make).then(function(result) { |
354 | $scope.showLoader = false; | 345 | $scope.showLoader = false; |
355 | $scope.aircraftDetails[index].aircraftModalList = result; | 346 | $scope.aircraftDetails[index].aircraftModalList = result; |
356 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; | 347 | //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; |
357 | }) | 348 | }) |
358 | } | 349 | } |
359 | 350 | ||
360 | $scope.selectedOption = ''; | 351 | $scope.selectedOption = ''; |
361 | $scope.getSize = function(model, index) { | 352 | $scope.getSize = function(model, index) { |
362 | $scope.showLoader = true; | 353 | $scope.showLoader = true; |
363 | $scope.aircraft.model = model; | 354 | $scope.aircraft.model = model; |
364 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { | 355 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
365 | $scope.showLoader = false; | 356 | $scope.showLoader = false; |
366 | $scope.aircraftDetails[index].aircraftSizeList = result; | 357 | $scope.aircraftDetails[index].aircraftSizeList = result; |
367 | $scope.getFuelType($scope.aircraftDetails[index].aircraftSizeList[0].aircraftSize.id,index); | 358 | $scope.getFuelType($scope.aircraftDetails[index].aircraftSizeList[0].aircraftSize.id,index); |
368 | 359 | ||
369 | 360 | ||
370 | }) | 361 | }) |
371 | } | 362 | } |
372 | 363 | ||
373 | $scope.getFuelType = function(size, index) { | 364 | $scope.getFuelType = function(size, index) { |
374 | $scope.showLoader = true; | 365 | $scope.showLoader = true; |
375 | var data = "model="+$scope.aircraft.model+"&make="+$scope.aircraft.make+"&sizeId="+size; | 366 | var data = "model="+$scope.aircraft.model+"&make="+$scope.aircraft.make+"&sizeId="+size; |
376 | ViewCompanyService.checkFuelType(data).then(function(result){ | 367 | ViewCompanyService.checkFuelType(data).then(function(result){ |
377 | $scope.showLoader = false; | 368 | $scope.showLoader = false; |
378 | if (result.type == "JetA") { | 369 | if (result.type == "JetA") { |
379 | $scope.jetShow[index] = false; | 370 | $scope.jetShow[index] = false; |
380 | $scope.marginShow[index] = true; | 371 | $scope.marginShow[index] = true; |
381 | } else if (result.type == "Avgas") { | 372 | } else if (result.type == "Avgas") { |
382 | $scope.jetShow[index] = true; | 373 | $scope.jetShow[index] = true; |
383 | $scope.marginShow[index] = false; | 374 | $scope.marginShow[index] = false; |
384 | }else { | 375 | }else { |
385 | $scope.jetShow[index] = true; | 376 | $scope.jetShow[index] = true; |
386 | $scope.marginShow[index] = true; | 377 | $scope.marginShow[index] = true; |
387 | } | 378 | } |
388 | }) | 379 | }) |
389 | } | 380 | } |
390 | 381 | ||
391 | $scope.aircraftListData = {}; | 382 | $scope.aircraftListData = {}; |
392 | $scope.addData = []; | 383 | $scope.addData = []; |
393 | $scope.tailArray = []; | 384 | $scope.tailArray = []; |
394 | function check(array){ | 385 | function check(array){ |
395 | return (new Set(array)).size !== array.length; | 386 | return (new Set(array)).size !== array.length; |
396 | } | 387 | } |
397 | $scope.saveCompanyData = function() { | 388 | $scope.saveCompanyData = function() { |
398 | $scope.tailArray = []; | 389 | $scope.tailArray = []; |
399 | for (var i = 0; i < $scope.aircraftDetails.length; i++) { | 390 | for (var i = 0; i < $scope.aircraftDetails.length; i++) { |
400 | $scope.addData.push({ | 391 | $scope.addData.push({ |
401 | 'tail': $scope.aircraftDetails[i].tail, | 392 | 'tail': $scope.aircraftDetails[i].tail, |
402 | 'make': $scope.aircraftDetails[i].make, | 393 | 'make': $scope.aircraftDetails[i].make, |
403 | 'model': $scope.aircraftDetails[i].model, | 394 | 'model': $scope.aircraftDetails[i].model, |
404 | 'sizeId': $scope.aircraftDetails[i].sizeId, | 395 | 'sizeId': $scope.aircraftDetails[i].sizeId, |
405 | 'marginId': $scope.aircraftDetails[i].marginId, | 396 | 'marginId': $scope.aircraftDetails[i].marginId, |
406 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId | 397 | 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId |
407 | }); | 398 | }); |
408 | $scope.tailArray.push($scope.aircraftDetails[i].tail); | 399 | $scope.tailArray.push($scope.aircraftDetails[i].tail); |
409 | } | 400 | } |
410 | if (check($scope.tailArray)) { | 401 | if (check($scope.tailArray)) { |
411 | toastr.error('Duplicate Tail Added.', { | 402 | toastr.error('Duplicate Tail Added.', { |
412 | closeButton: true | 403 | closeButton: true |
413 | }) | 404 | }) |
414 | }else{ | 405 | }else{ |
415 | $scope.aircraftListData.aircraftList = $scope.addData; | 406 | $scope.aircraftListData.aircraftList = $scope.addData; |
416 | $scope.aircraftListData.accountId = companyId; | 407 | $scope.aircraftListData.accountId = companyId; |
417 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { | 408 | CustomersService.addAircraft($scope.aircraftListData).then(function(result) { |
418 | if (result != null && result.success) { | 409 | if (result != null && result.success) { |
419 | toastr.success('' + result.success + '', { | 410 | toastr.success('' + result.success + '', { |
420 | closeButton: true | 411 | closeButton: true |
421 | }) | 412 | }) |
422 | $scope.addData= []; | 413 | $scope.addData= []; |
423 | $scope.tailArray = []; | 414 | $scope.tailArray = []; |
424 | $scope.aircraftListData={}; | 415 | $scope.aircraftListData={}; |
425 | $('#aircraft-modal-3').css('display', 'none'); | 416 | $('#aircraft-modal-3').css('display', 'none'); |
426 | $('.modal-backdrop').css('display', 'none'); | 417 | $('.modal-backdrop').css('display', 'none'); |
427 | $('#aircraft-modal-3').modal('hide'); | 418 | $('#aircraft-modal-3').modal('hide'); |
428 | $('.modal-backdrop').modal('hide'); | 419 | $('.modal-backdrop').modal('hide'); |
429 | getAircraftList(); | 420 | getAircraftList(); |
430 | 421 | ||
431 | } else { | 422 | } else { |
432 | $('#aircraft-modal-3').css('display', 'none'); | 423 | $('#aircraft-modal-3').css('display', 'none'); |
433 | $('.modal-backdrop').css('display', 'none'); | 424 | $('.modal-backdrop').css('display', 'none'); |
434 | toastr.error('' + result.statusText + '', { | 425 | toastr.error('' + result.statusText + '', { |
435 | closeButton: true | 426 | closeButton: true |
436 | }) | 427 | }) |
437 | } | 428 | } |
438 | }); | 429 | }); |
439 | } | 430 | } |
440 | 431 | ||
441 | } | 432 | } |
442 | 433 | ||
443 | $scope.showNoteData = true; | 434 | $scope.showNoteData = true; |
444 | $scope.showCompanyName = true; | 435 | $scope.showCompanyName = true; |
445 | $scope.showAddress = true; | 436 | $scope.showAddress = true; |
446 | $scope.showNote = function() { | 437 | $scope.showNote = function() { |
447 | $scope.showNoteData = false; | 438 | $scope.showNoteData = false; |
448 | $scope.showUpdateBtn = true; | 439 | $scope.showUpdateBtn = true; |
449 | } | 440 | } |
450 | 441 | ||
451 | $scope.company = function() { | 442 | $scope.company = function() { |
452 | $scope.showCompanyName = false; | 443 | $scope.showCompanyName = false; |
453 | $scope.showUpdateBtn = true; | 444 | $scope.showUpdateBtn = true; |
454 | } | 445 | } |
455 | 446 | ||
456 | $scope.base = function() { | 447 | $scope.base = function() { |
457 | $scope.showUpdateBtn = true; | 448 | $scope.showUpdateBtn = true; |
458 | } | 449 | } |
459 | 450 | ||
460 | $scope.addressChange = function() { | 451 | $scope.addressChange = function() { |
461 | $scope.showAddress = false; | 452 | $scope.showAddress = false; |
462 | $scope.showUpdateBtn = true; | 453 | $scope.showUpdateBtn = true; |
463 | } | 454 | } |
464 | 455 | ||
465 | $scope.editData = function(inputName) { | 456 | $scope.editData = function(inputName) { |
466 | //console.log($scope.companyData) | 457 | //console.log($scope.companyData) |
467 | $scope.showLoader = true; | 458 | $scope.showLoader = true; |
468 | /*if(inputName == 'showNoteData'){ | 459 | /*if(inputName == 'showNoteData'){ |
469 | $scope.showNoteData = true; | 460 | $scope.showNoteData = true; |
470 | }else if(inputName == 'showCompanyName'){ | 461 | }else if(inputName == 'showCompanyName'){ |
471 | $scope.showCompanyName = true; | 462 | $scope.showCompanyName = true; |
472 | }else if(inputName == 'showAddress'){ | 463 | }else if(inputName == 'showAddress'){ |
473 | $scope.showAddress = true; | 464 | $scope.showAddress = true; |
474 | }*/ | 465 | }*/ |
475 | $scope.showNoteData = true; | 466 | $scope.showNoteData = true; |
476 | $scope.showCompanyName = true; | 467 | $scope.showCompanyName = true; |
477 | $scope.showAddress = true; | 468 | $scope.showAddress = true; |
478 | 469 | ||
479 | var companyData = "companyName=" + $scope.companyData.companyName + "&masterMargin=" + $scope.companyData.masterMargin + "&avgasMargin=" + $scope.companyData.avgasMargin + | 470 | var companyData = "companyName=" + $scope.companyData.companyName + "&masterMargin=" + $scope.companyData.masterMargin + "&avgasMargin=" + $scope.companyData.avgasMargin + |
480 | "&addressOne=" + $scope.companyData.addressOne + "&addressTwo=" + $scope.companyData.addressTwo + "&city=" + $scope.companyData.city + "&state=" + | 471 | "&addressOne=" + $scope.companyData.addressOne + "&addressTwo=" + $scope.companyData.addressTwo + "&city=" + $scope.companyData.city + "&state=" + |
481 | $scope.companyData.state + "&country=" + $scope.companyData.country + "&zipcode=" + $scope.companyData.zipcode + "&internalNote=" + | 472 | $scope.companyData.state + "&country=" + $scope.companyData.country + "&zipcode=" + $scope.companyData.zipcode + "&internalNote=" + |
482 | $scope.companyData.internalNote + "&certificateType=" + $scope.companyData.certificateType + "&baseTenant=" + $scope.companyData.baseTenant + | 473 | $scope.companyData.internalNote + "&certificateType=" + $scope.companyData.certificateType + "&baseTenant=" + $scope.companyData.baseTenant + |
483 | "&fuelerlinxCustomer=" + $scope.companyData.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.companyData.contractFuelVendor + | 474 | "&fuelerlinxCustomer=" + $scope.companyData.fuelerlinxCustomer + "&contractFuelVendor=" + $scope.companyData.contractFuelVendor + |
484 | "&activate=" + $scope.companyData.activate + "&baseIcao=" + $scope.companyData.baseIcao + "&companyId=" + companyId + "&global=" + $scope.companyData.global; | 475 | "&activate=" + $scope.companyData.activate + "&baseIcao=" + $scope.companyData.baseIcao + "&companyId=" + companyId + "&global=" + $scope.companyData.global; |
485 | 476 | ||
486 | ViewCompanyService.updateCompany(companyData).then(function(result) { | 477 | ViewCompanyService.updateCompany(companyData).then(function(result) { |
487 | if (result != null && result.success) { | 478 | if (result != null && result.success) { |
488 | toastr.success('' + result.success + '', { | 479 | toastr.success('' + result.success + '', { |
489 | closeButton: true | 480 | closeButton: true |
490 | }) | 481 | }) |
491 | $scope.showUpdateBtn = false; | 482 | $scope.showUpdateBtn = false; |
492 | getCompanyDetail(); | 483 | getCompanyDetail(); |
493 | } else { | 484 | } else { |
494 | toastr.error('Error Updating Company', { | 485 | toastr.error('Error Updating Company', { |
495 | closeButton: true | 486 | closeButton: true |
496 | }) | 487 | }) |
497 | $scope.showUpdateBtn = true; | 488 | $scope.showUpdateBtn = true; |
498 | } | 489 | } |
499 | $scope.showLoader = false; | 490 | $scope.showLoader = false; |
500 | }) | 491 | }) |
501 | } | 492 | } |
502 | 493 | ||
503 | $scope.cancelUpdateData = function() { | 494 | $scope.cancelUpdateData = function() { |
504 | $scope.showNoteData = true; | 495 | $scope.showNoteData = true; |
505 | $scope.showCompanyName = true; | 496 | $scope.showCompanyName = true; |
506 | $scope.showAddress = true; | 497 | $scope.showAddress = true; |
507 | $scope.showUpdateBtn = false; | 498 | $scope.showUpdateBtn = false; |
508 | } | 499 | } |
509 | 500 | ||
510 | $scope.sendMail = function() { | 501 | $scope.sendMail = function() { |
511 | $scope.showLoader = true; | 502 | $scope.showLoader = true; |
512 | $('#confirm1').css('display', 'none'); | 503 | $('#confirm1').css('display', 'none'); |
513 | ViewCompanyService.sendMail(companyId).then(function(result) { | 504 | ViewCompanyService.sendMail(companyId).then(function(result) { |
514 | if (result != null && result.success) { | 505 | if (result != null && result.success) { |
515 | toastr.success('' + result.success + '', { | 506 | toastr.success('' + result.success + '', { |
516 | closeButton: true | 507 | closeButton: true |
517 | }) | 508 | }) |
518 | } else { | 509 | } else { |
519 | toastr.error('Error Sending Email', { | 510 | toastr.error('Error Sending Email', { |
520 | closeButton: true | 511 | closeButton: true |
521 | }) | 512 | }) |
522 | } | 513 | } |
523 | $scope.showLoader = false; | 514 | $scope.showLoader = false; |
524 | }) | 515 | }) |
525 | } | 516 | } |
526 | 517 | ||
527 | $scope.openConfirmMail = function() { | 518 | $scope.openConfirmMail = function() { |
528 | $('#confirm1').css('display', 'block'); | 519 | $('#confirm1').css('display', 'block'); |
529 | } | 520 | } |
530 | 521 | ||
531 | 522 | ||
532 | $scope.cancelAndCloseConfirm = function() { | 523 | $scope.cancelAndCloseConfirm = function() { |
533 | $('#confirm1').css('display', 'none'); | 524 | $('#confirm1').css('display', 'none'); |
534 | } | 525 | } |
535 | 526 | ||
536 | $scope.primaryContact = false; | 527 | $scope.primaryContact = false; |
537 | $scope.cancelPrimaryContact = function() { | 528 | $scope.cancelPrimaryContact = function() { |
538 | $('#primaryContact').css('display', 'none'); | 529 | $('#primaryContact').css('display', 'none'); |
539 | $scope.primaryContact = false; | 530 | $scope.primaryContact = false; |
540 | } | 531 | } |
541 | 532 | ||
542 | $scope.checkPrimaryContact = function() { | 533 | $scope.checkPrimaryContact = function() { |
543 | if ($scope.primaryContact == true) { | 534 | if ($scope.primaryContact == true) { |
544 | $scope.primaryContact = true; | 535 | $scope.primaryContact = true; |
545 | ViewCompanyService.checkPrimaryContact(companyId).then(function(result) { | 536 | ViewCompanyService.checkPrimaryContact(companyId).then(function(result) { |
546 | //console.log(result) | 537 | //console.log(result) |
547 | if (result.status == 422) { | 538 | if (result.status == 422) { |
548 | $('#primaryContact').css('display', 'block'); | 539 | $('#primaryContact').css('display', 'block'); |
549 | } | 540 | } |
550 | }) | 541 | }) |
551 | } | 542 | } |
552 | } | 543 | } |
553 | 544 | ||
554 | $scope.sendPrimaryContact = function() { | 545 | $scope.sendPrimaryContact = function() { |
555 | $('#primaryContact').css('display', 'none'); | 546 | $('#primaryContact').css('display', 'none'); |
556 | if ($scope.primayData.id != null || $scope.primayData.id != undefined) { | 547 | if ($scope.primayData.id != null || $scope.primayData.id != undefined) { |
557 | var priamryContactData = "companyContactId=" + $scope.primayData.id + "&primary=" + $scope.primaryContact; | 548 | var priamryContactData = "companyContactId=" + $scope.primayData.id + "&primary=" + $scope.primaryContact; |
558 | 549 | ||
559 | ViewCompanyService.addPrimaryContact(priamryContactData).then(function(result) { | 550 | ViewCompanyService.addPrimaryContact(priamryContactData).then(function(result) { |
560 | // console.log(result) | 551 | // console.log(result) |
561 | }) | 552 | }) |
562 | } | 553 | } |
563 | 554 | ||
564 | } | 555 | } |
565 | 556 | ||
566 | $scope.updateData = "" | 557 | $scope.updateData = "" |
567 | $scope.showUpdateContact = function(data, value) { | 558 | $scope.showUpdateContact = function(data, value) { |
568 | $('#updateContact').css('display', 'block'); | 559 | $('#updateContact').css('display', 'block'); |
569 | $scope.updateData = data; | 560 | $scope.updateData = data; |
570 | // console.log($scope.updateData) | 561 | // console.log($scope.updateData) |
571 | if ($scope.updateData.email == null) { | 562 | if ($scope.updateData.email == null) { |
572 | $scope.updateData.content = data.contactNumber; | 563 | $scope.updateData.content = data.contactNumber; |
573 | } else { | 564 | } else { |
574 | $scope.updateData.content = data.email; | 565 | $scope.updateData.content = data.email; |
575 | } | 566 | } |
576 | } | 567 | } |
577 | 568 | ||
578 | $scope.showUpdateEmail = function(data, value) { | 569 | $scope.showUpdateEmail = function(data, value) { |
579 | $('#updateEmail').css('display', 'block'); | 570 | $('#updateEmail').css('display', 'block'); |
580 | $scope.updateData = data; | 571 | $scope.updateData = data; |
581 | // console.log($scope.updateData) | 572 | // console.log($scope.updateData) |
582 | if ($scope.updateData.email == null) { | 573 | if ($scope.updateData.email == null) { |
583 | $scope.updateData.content = data.contactNumber; | 574 | $scope.updateData.content = data.contactNumber; |
584 | } else { | 575 | } else { |
585 | $scope.updateData.content = data.email; | 576 | $scope.updateData.content = data.email; |
586 | } | 577 | } |
587 | } | 578 | } |
588 | 579 | ||
589 | $scope.acceptUpdateField = function(newContactName) { | 580 | $scope.acceptUpdateField = function(newContactName) { |
590 | // console.log($scope.updateData) | 581 | // console.log($scope.updateData) |
591 | if ($scope.updateData.content == undefined) { | 582 | if ($scope.updateData.content == undefined) { |
592 | toastr.error('Please add some content', { | 583 | toastr.error('Please add some content', { |
593 | closeButton: true | 584 | closeButton: true |
594 | }) | 585 | }) |
595 | } else { | 586 | } else { |
596 | if (newContactName == 'phone') { | 587 | if (newContactName == 'phone') { |
597 | var updateCustomData = "companyId=" + companyId + "&contactNumber=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id + | 588 | var updateCustomData = "companyId=" + companyId + "&contactNumber=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id + |
598 | "&title=" + $scope.updateData.title; | 589 | "&title=" + $scope.updateData.title; |
599 | } else { | 590 | } else { |
600 | var updateCustomData = "companyId=" + companyId + "&email=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id + | 591 | var updateCustomData = "companyId=" + companyId + "&email=" + $scope.updateData.content + "&contactId=" + $scope.updateData.id + |
601 | "&title=" + $scope.updateData.title; | 592 | "&title=" + $scope.updateData.title; |
602 | } | 593 | } |
603 | ViewCompanyService.updateCustomField(updateCustomData).then(function(result) { | 594 | ViewCompanyService.updateCustomField(updateCustomData).then(function(result) { |
604 | if (result != null && result.success) { | 595 | if (result != null && result.success) { |
605 | $('#updateContact').css('display', 'none'); | 596 | $('#updateContact').css('display', 'none'); |
606 | $('#updateEmail').css('display', 'none'); | 597 | $('#updateEmail').css('display', 'none'); |
607 | getCompanyDetail(); | 598 | getCompanyDetail(); |
608 | } | 599 | } |
609 | }) | 600 | }) |
610 | } | 601 | } |
611 | } | 602 | } |
612 | 603 | ||
613 | $scope.deleteContent = function(data){ | 604 | $scope.deleteContent = function(data){ |
614 | ViewCompanyService.deleteCustomContact(data.id).then(function(result) { | 605 | ViewCompanyService.deleteCustomContact(data.id).then(function(result) { |
615 | if (result != null && result.success) { | 606 | if (result != null && result.success) { |
616 | toastr.success('' + result.success + '', { | 607 | toastr.success('' + result.success + '', { |
617 | closeButton: true | 608 | closeButton: true |
618 | }) | 609 | }) |
619 | getCompanyDetail(); | 610 | getCompanyDetail(); |
620 | } | 611 | } |
621 | }) | 612 | }) |
622 | } | 613 | } |
623 | 614 | ||
624 | $scope.cancelUpdateField = function() { | 615 | $scope.cancelUpdateField = function() { |
625 | $('#updateContact').css('display', 'none'); | 616 | $('#updateContact').css('display', 'none'); |
626 | $('#updateEmail').css('display', 'none'); | 617 | $('#updateEmail').css('display', 'none'); |
627 | } | 618 | } |
628 | 619 | ||
629 | $scope.showEditTier2 = function(number) { | 620 | $scope.showEditTier2 = function(number) { |
630 | // console.log(number) | 621 | // console.log(number) |
631 | $scope.contactNumber = number; | 622 | $scope.contactNumber = number; |
632 | } | 623 | } |
633 | 624 | ||
634 | 625 | ||
635 | 626 | ||
636 | $scope.addCustomPhone = function(value) { | 627 | $scope.addCustomPhone = function(value) { |
637 | //console.log(value) | 628 | //console.log(value) |
638 | if (value != null) { | 629 | if (value != null) { |
639 | $('#customFieldPhone').css('display', 'block'); | 630 | $('#customFieldPhone').css('display', 'block'); |
640 | } | 631 | } |
641 | $scope.custom = {}; | 632 | $scope.custom = {}; |
642 | } | 633 | } |
643 | 634 | ||
644 | $scope.addCustomEmail = function(value) { | 635 | $scope.addCustomEmail = function(value) { |
645 | //console.log(value) | 636 | //console.log(value) |
646 | if (value != null) { | 637 | if (value != null) { |
647 | $('#customFieldEmail').css('display', 'block'); | 638 | $('#customFieldEmail').css('display', 'block'); |
648 | } | 639 | } |
649 | $scope.custom = {}; | 640 | $scope.custom = {}; |
650 | } | 641 | } |
651 | 642 | ||
652 | $scope.cancelCustomField = function() { | 643 | $scope.cancelCustomField = function() { |
653 | $('#customFieldEmail').css('display', 'none'); | 644 | $('#customFieldEmail').css('display', 'none'); |
654 | $('#customFieldPhone').css('display', 'none'); | 645 | $('#customFieldPhone').css('display', 'none'); |
655 | } | 646 | } |
656 | 647 | ||
657 | $scope.acceptCustomField = function(contactName) { | 648 | $scope.acceptCustomField = function(contactName) { |
658 | if ($scope.custom.content == undefined) { | 649 | if ($scope.custom.content == undefined) { |
659 | toastr.error('Please add some content', { | 650 | toastr.error('Please add some content', { |
660 | closeButton: true | 651 | closeButton: true |
661 | }) | 652 | }) |
662 | } else { | 653 | } else { |
663 | if (contactName == 'phone') { | 654 | if (contactName == 'phone') { |
664 | var customData = "companyId=" + companyId + "&contactNumber=" + $scope.custom.content + | 655 | var customData = "companyId=" + companyId + "&contactNumber=" + $scope.custom.content + |
665 | "&title=" + $scope.custom.title; | 656 | "&title=" + $scope.custom.title; |
666 | } else { | 657 | } else { |
667 | var customData = "companyId=" + companyId + "&email=" + $scope.custom.content + | 658 | var customData = "companyId=" + companyId + "&email=" + $scope.custom.content + |
668 | "&title=" + $scope.custom.title; | 659 | "&title=" + $scope.custom.title; |
669 | } | 660 | } |
670 | // console.log(customData.email) | 661 | // console.log(customData.email) |
671 | ViewCompanyService.addCustomField(customData).then(function(result) { | 662 | ViewCompanyService.addCustomField(customData).then(function(result) { |
672 | // console.log(result) | 663 | // console.log(result) |
673 | if (result != null && result.success) { | 664 | if (result != null && result.success) { |
674 | $('#customFieldEmail').css('display', 'none'); | 665 | $('#customFieldEmail').css('display', 'none'); |
675 | $('#customFieldPhone').css('display', 'none'); | 666 | $('#customFieldPhone').css('display', 'none'); |
676 | $scope.custom = {}; | 667 | $scope.custom = {}; |
677 | getCompanyDetail(); | 668 | getCompanyDetail(); |
678 | } | 669 | } |
679 | }) | 670 | }) |
680 | } | 671 | } |
681 | } | 672 | } |
682 | 673 | ||
683 | /* omit strike out*/ | 674 | /* omit strike out*/ |
684 | updateFuelManagerService.getFuelPricingNew().then(function(result) { | 675 | updateFuelManagerService.getFuelPricingNew().then(function(result) { |
685 | $scope.fuelPricing = result; | 676 | $scope.fuelPricing = result; |
686 | //console.log("==fuel pricing==",result) | 677 | //console.log("==fuel pricing==",result) |
687 | $scope.omitData; | 678 | $scope.omitData; |
688 | ViewCompanyService.getOmitCompany($scope.compId).then(function(result){ | 679 | ViewCompanyService.getOmitCompany($scope.compId).then(function(result){ |
689 | $scope.omitData = result; | 680 | $scope.omitData = result; |
690 | // console.log("omit data===", $scope.omitData); | 681 | // console.log("omit data===", $scope.omitData); |
691 | for(var i = 0 ; i< $scope.fuelPricing.length; i++){ | 682 | for(var i = 0 ; i< $scope.fuelPricing.length; i++){ |
692 | for(var j = 0; j<$scope.omitData.length; j++){ | 683 | for(var j = 0; j<$scope.omitData.length; j++){ |
693 | if($scope.omitData[j].marginId == $scope.fuelPricing[i].fuelPricing.id){ | 684 | if($scope.omitData[j].marginId == $scope.fuelPricing[i].fuelPricing.id){ |
694 | $scope.fuelPricing[i].fuelPricing.omit = $scope.omitData[j].omit; | 685 | $scope.fuelPricing[i].fuelPricing.omit = $scope.omitData[j].omit; |
695 | // console.log("fuel.pricing.omit",$scope.fuelPricing[i].fuelPricing.omit) | 686 | // console.log("fuel.pricing.omit",$scope.fuelPricing[i].fuelPricing.omit) |
696 | } | 687 | } |
697 | } | 688 | } |
698 | } | 689 | } |
699 | 690 | ||
700 | }) | 691 | }) |
701 | 692 | ||
702 | // console.log("$scope.fuelPricing",$scope.fuelPricing) | 693 | // console.log("$scope.fuelPricing",$scope.fuelPricing) |
703 | for (var i = 0; i < $scope.fuelPricing.length; i++) { | 694 | for (var i = 0; i < $scope.fuelPricing.length; i++) { |
704 | // console.log('$scope.fuelPricing[i].fuelPricing', $scope.fuelPricing[i].fuelPricing); | 695 | // console.log('$scope.fuelPricing[i].fuelPricing', $scope.fuelPricing[i].fuelPricing); |
705 | //console.log("fuelid",$scope.fuelPricing[i].fuelPricing.id,"getid",$scope.omitData[j].id) | 696 | //console.log("fuelid",$scope.fuelPricing[i].fuelPricing.id,"getid",$scope.omitData[j].id) |
706 | if ($scope.fuelPricing[i].fuelPricing.expirationDate != null) { | 697 | if ($scope.fuelPricing[i].fuelPricing.expirationDate != null) { |
707 | $scope.fuelPricing[i].fuelPricing.expirationDate = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); | 698 | $scope.fuelPricing[i].fuelPricing.expirationDate = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); |
708 | var newTime = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); | 699 | var newTime = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); |
709 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 | 700 | var dmonth = newTime.getUTCMonth() + 1; //months from 1-12 |
710 | var dday = newTime.getUTCDate(); | 701 | var dday = newTime.getUTCDate(); |
711 | var dyear = newTime.getUTCFullYear(); | 702 | var dyear = newTime.getUTCFullYear(); |
712 | $scope.fuelPricing[i].fuelPricing.expirationDate = dmonth + '/' + dday + '/' + dyear; | 703 | $scope.fuelPricing[i].fuelPricing.expirationDate = dmonth + '/' + dday + '/' + dyear; |
713 | } | 704 | } |
714 | // for (var j = 0; j<$scope.omitData.length; j++) { | 705 | // for (var j = 0; j<$scope.omitData.length; j++) { |
715 | // if($scope.fuelPricing[i].fuelPricing.id === $scope.omitData[j].id){ | 706 | // if($scope.fuelPricing[i].fuelPricing.id === $scope.omitData[j].id){ |
716 | 707 | ||
717 | // } | 708 | // } |
718 | // } | 709 | // } |
719 | } | 710 | } |
720 | }) | 711 | }) |
721 | 712 | ||
722 | var deleteAircraftId = ""; | 713 | var deleteAircraftId = ""; |
723 | $scope.deleteAircraft = function(id) { | 714 | $scope.deleteAircraft = function(id) { |
724 | $('#delete1').css('display', 'block'); | 715 | $('#delete1').css('display', 'block'); |
725 | deleteAircraftId = id; | 716 | deleteAircraftId = id; |
726 | } | 717 | } |
727 | 718 | ||
728 | $scope.aircraftDelete = function() { | 719 | $scope.aircraftDelete = function() { |
729 | ViewCompanyService.deleteAircraft(deleteAircraftId).then(function(result) { | 720 | ViewCompanyService.deleteAircraft(deleteAircraftId).then(function(result) { |
730 | // console.log(result) | 721 | // console.log(result) |
731 | getAircraftList(); | 722 | getAircraftList(); |
732 | getCompanyDetail(); | 723 | getCompanyDetail(); |
733 | $('#delete1').css('display', 'none'); | 724 | $('#delete1').css('display', 'none'); |
734 | }) | 725 | }) |
735 | } | 726 | } |
736 | 727 | ||
737 | $scope.cancelAircraft = function() { | 728 | $scope.cancelAircraft = function() { |
738 | $('#delete1').css('display', 'none'); | 729 | $('#delete1').css('display', 'none'); |
739 | } | 730 | } |
740 | 731 | ||
741 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { | 732 | CustomersService.getJetMargin($scope.userProfileId).then(function(result) { |
742 | $scope.jetMarginList = result; | 733 | $scope.jetMarginList = result; |
743 | }) | 734 | }) |
744 | 735 | ||
745 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { | 736 | CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { |
746 | $scope.avgsMarginList = result; | 737 | $scope.avgsMarginList = result; |
747 | }) | 738 | }) |
748 | 739 | ||
749 | $scope.changePriceEmail = function(id, index) { | 740 | $scope.changePriceEmail = function(id, index) { |
750 | event.stopPropagation(); | 741 | event.stopPropagation(); |
751 | var contactId = id; | 742 | var contactId = id; |
752 | var statusData = "status=" + $scope.companyContactList[index].priceEmail; | 743 | var statusData = "status=" + $scope.companyContactList[index].priceEmail; |
753 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { | 744 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { |
754 | if (result.success) { | 745 | if (result.success) { |
755 | $('#toogleMail').css('display', 'block'); | 746 | $('#toogleMail').css('display', 'block'); |
756 | if ($scope.companyContactList[index].priceEmail == true) { | 747 | if ($scope.companyContactList[index].priceEmail == true) { |
757 | $scope.messageText = 'You have enabled price distribution for this contact'; | 748 | $scope.messageText = 'You have enabled price distribution for this contact'; |
758 | } else { | 749 | } else { |
759 | $scope.messageText = 'You have disabled price distribution for this contact'; | 750 | $scope.messageText = 'You have disabled price distribution for this contact'; |
760 | } | 751 | } |
761 | } | 752 | } |
762 | }) | 753 | }) |
763 | } | 754 | } |
764 | 755 | ||
765 | $scope.cancelToogle = function() { | 756 | $scope.cancelToogle = function() { |
766 | $('#toogleMail').css('display', 'none'); | 757 | $('#toogleMail').css('display', 'none'); |
767 | } | 758 | } |
768 | 759 | ||
769 | $scope.checkboxStatus = function(value) { | 760 | $scope.checkboxStatus = function(value) { |
770 | // console.log("checkbox",value) | 761 | // console.log("checkbox",value) |
771 | $scope.showUpdateBtn = true; | 762 | $scope.showUpdateBtn = true; |
772 | } | 763 | } |
773 | 764 | ||
774 | $scope.fuelercheckboxStatus = function(value) { | 765 | $scope.fuelercheckboxStatus = function(value) { |
775 | $('#fuelerchange').css('display', 'block'); | 766 | $('#fuelerchange').css('display', 'block'); |
776 | if (value == true) { | 767 | if (value == true) { |
777 | $scope.statusMessage = 'Please confirm! Enabling FuelerLinx for this customer will enable price distribution web services and disable price emails for the contacts in this company' | 768 | $scope.statusMessage = 'Please confirm! Enabling FuelerLinx for this customer will enable price distribution web services and disable price emails for the contacts in this company' |
778 | } else { | 769 | } else { |
779 | $scope.statusMessage = 'Please confirm! Disabling FuelerLinx for this customer will disable price distribution web services into their FuelerLinx account. If you proceed then remember to enable price emails for the appropriate contacts in this company.' | 770 | $scope.statusMessage = 'Please confirm! Disabling FuelerLinx for this customer will disable price distribution web services into their FuelerLinx account. If you proceed then remember to enable price emails for the appropriate contacts in this company.' |
780 | } | 771 | } |
781 | 772 | ||
782 | 773 | ||
783 | } | 774 | } |
784 | 775 | ||
785 | $scope.fuelerCancelStatus = function() { | 776 | $scope.fuelerCancelStatus = function() { |
786 | $('#fuelerchange').css('display', 'none'); | 777 | $('#fuelerchange').css('display', 'none'); |
787 | $scope.companyData.fuelerlinxCustomer = !$scope.companyData.fuelerlinxCustomer; | 778 | $scope.companyData.fuelerlinxCustomer = !$scope.companyData.fuelerlinxCustomer; |
788 | } | 779 | } |
789 | 780 | ||
790 | $scope.fuelerAcceptStatus = function() { | 781 | $scope.fuelerAcceptStatus = function() { |
791 | $('#fuelerchange').css('display', 'none'); | 782 | $('#fuelerchange').css('display', 'none'); |
792 | $scope.showLoader = true; | 783 | $scope.showLoader = true; |
793 | var statusData; | 784 | var statusData; |
794 | if ($scope.companyData.fuelerlinxCustomer == false) { | 785 | if ($scope.companyData.fuelerlinxCustomer == false) { |
795 | statusData = "status=true"; | 786 | statusData = "status=true"; |
796 | } else { | 787 | } else { |
797 | statusData = "status=false"; | 788 | statusData = "status=false"; |
798 | } | 789 | } |
799 | ViewCompanyService.fuelerPricingChange(companyId, statusData).then(function(result) { | 790 | ViewCompanyService.fuelerPricingChange(companyId, statusData).then(function(result) { |
800 | if (result.success) { | 791 | if (result.success) { |
801 | $scope.showLoader = false; | 792 | $scope.showLoader = false; |
802 | 793 | ||
803 | $scope.editData(); | 794 | $scope.editData(); |
804 | getContactList(); | 795 | getContactList(); |
805 | 796 | ||
806 | } | 797 | } |
807 | }) | 798 | }) |
808 | } | 799 | } |
809 | 800 | ||
810 | 801 | ||
811 | $scope.updateOmit = function(fuel, omit) { | 802 | $scope.updateOmit = function(fuel, omit) { |
812 | $scope.fuelData = {}; | 803 | $scope.fuelData = {}; |
813 | $scope.fuelData.expirationDate = new Date(fuel.expirationDate); | 804 | $scope.fuelData.expirationDate = new Date(fuel.expirationDate); |
814 | $scope.fuelData.customMarginId = fuel.id; | 805 | $scope.fuelData.customMarginId = fuel.id; |
815 | $scope.fuelData.omit = fuel.omit; | 806 | $scope.fuelData.omit = fuel.omit; |
816 | $scope.fuelData.papMargin = fuel.papMargin; | 807 | $scope.fuelData.papMargin = fuel.papMargin; |
817 | $scope.fuelData.papTotal = fuel.papTotal; | 808 | $scope.fuelData.papTotal = fuel.papTotal; |
818 | $scope.fuelData.cost = fuel.cost; | 809 | $scope.fuelData.cost = fuel.cost; |
819 | $scope.fuelData.companyId = $scope.compId ; | 810 | $scope.fuelData.companyId = $scope.compId ; |
820 | if($scope.fuelData.omit == true) | 811 | if($scope.fuelData.omit == true) |
821 | { | 812 | { |
822 | var customData = "companyId=" + $scope.fuelData.companyId + "&customMarginId=" + $scope.fuelData.customMarginId; | 813 | var customData = "companyId=" + $scope.fuelData.companyId + "&customMarginId=" + $scope.fuelData.customMarginId; |
823 | // console.log(".") | 814 | // console.log(".") |
824 | ViewCompanyService.omitAddCompanyFuel(customData).then(function(result) { | 815 | ViewCompanyService.omitAddCompanyFuel(customData).then(function(result) { |
825 | if (result.success) { | 816 | if (result.success) { |
826 | toastr.success('' + result.success + '', { | 817 | toastr.success('' + result.success + '', { |
827 | closeButton: true | 818 | closeButton: true |
828 | }) | 819 | }) |
829 | } else { | 820 | } else { |
830 | toastr.error('' + result.statusText + '', { | 821 | toastr.error('' + result.statusText + '', { |
831 | closeButton: true | 822 | closeButton: true |
832 | }) | 823 | }) |
833 | } | 824 | } |
834 | }) | 825 | }) |
835 | }else{ | 826 | }else{ |
836 | var data ="companyId=" + $scope.fuelData.companyId + "&customMarginId=" + $scope.fuelData.customMarginId; | 827 | var data ="companyId=" + $scope.fuelData.companyId + "&customMarginId=" + $scope.fuelData.customMarginId; |
837 | ViewCompanyService.omitDeleteCompanyFuel(data).then(function(result){ | 828 | ViewCompanyService.omitDeleteCompanyFuel(data).then(function(result){ |
838 | if (result.success) { | 829 | if (result.success) { |
839 | toastr.success('' + result.success + '', { | 830 | toastr.success('' + result.success + '', { |
840 | closeButton: true | 831 | closeButton: true |
841 | }) | 832 | }) |
842 | } else { | 833 | } else { |
843 | toastr.error('' + result.statusText + '', { | 834 | toastr.error('' + result.statusText + '', { |
844 | closeButton: true | 835 | closeButton: true |
845 | }) | 836 | }) |
846 | } | 837 | } |
847 | }) | 838 | }) |
848 | } | 839 | } |
849 | } | 840 | } |
850 | 841 | ||
851 | |||
852 | //--fuel type based on tail is not in use-- | ||
853 | // $scope.aircraftData = {} | ||
854 | /*$scope.checkJetWithTail = function(tail, index) { | ||
855 | |||
856 | console.log("tail==============",tail, index) | ||
857 | ViewCompanyService.checkJetType(tail).then(function(result) { | ||
858 | console.log("result",result) | ||
859 | if (result.jetA == "true") { | ||
860 | $scope.jetShow[index] = false; | ||
861 | $scope.marginShow[index] = true; | ||
862 | } else { | ||
863 | $scope.jetShow[index] = true; | ||
864 | $scope.marginShow[index] = false; | ||
865 | } | ||
866 | }) | ||
867 | }*/ | ||
868 | |||
869 | |||
870 | /*add a fuel order*/ | 842 | /*add a fuel order*/ |
871 | 843 | ||
872 | |||
873 | $scope.getOrders = function() { | 844 | $scope.getOrders = function() { |
874 | fuelOrdersService.getOrders().then(function(result) { | 845 | fuelOrdersService.getOrders().then(function(result) { |
875 | 846 | ||
876 | $scope.orderdata = result; | 847 | $scope.orderdata = result; |
877 | for (var i = 0; i < $scope.orderdata.length; i++) { | 848 | for (var i = 0; i < $scope.orderdata.length; i++) { |
878 | $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); | 849 | $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); |
879 | 850 | ||
880 | // var str = "" + $scope.orderdata[i].upliftDateS.getDate() + "/" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getFullYear() | 851 | // var str = "" + $scope.orderdata[i].upliftDateS.getDate() + "/" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getFullYear() |
881 | var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear() | 852 | var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear() |
882 | // str = str.slice(4,16) | 853 | // str = str.slice(4,16) |
883 | $scope.orderdata[i].upliftDateString = str | 854 | $scope.orderdata[i].upliftDateString = str |
884 | // console.log(str); | 855 | // console.log(str); |
885 | 856 | ||
886 | } | 857 | } |
887 | 858 | ||
888 | $scope.displayFuelOrderList = new NgTableParams({ | 859 | $scope.displayFuelOrderList = new NgTableParams({ |
889 | page: 1, | 860 | page: 1, |
890 | count: 10, | 861 | count: 10, |
891 | }, { | 862 | }, { |
892 | data: $scope.orderdata | 863 | data: $scope.orderdata |
893 | }); | 864 | }); |
894 | $(document).ready(function() { | 865 | $(document).ready(function() { |
895 | var myselect = document.getElementsByClassName('colorfulSelectbox'); | 866 | var myselect = document.getElementsByClassName('colorfulSelectbox'); |
896 | 867 | ||
897 | for (var i = 0; i < myselect.length; i++) { | 868 | for (var i = 0; i < myselect.length; i++) { |
898 | var colourIndex = $(myselect[i]).prop('selectedIndex'); | 869 | var colourIndex = $(myselect[i]).prop('selectedIndex'); |
899 | colourIndex = colourIndex + 1; | 870 | colourIndex = colourIndex + 1; |
900 | // console.log(colourIndex); | 871 | // console.log(colourIndex); |
901 | var getColor = $('.colorfulSelectbox option:nth-child(' + colourIndex + ')').css('color'); | 872 | var getColor = $('.colorfulSelectbox option:nth-child(' + colourIndex + ')').css('color'); |
902 | $(myselect[i]).css('background-color', getColor); | 873 | $(myselect[i]).css('background-color', getColor); |
903 | // console.log('colour', getColor); | 874 | // console.log('colour', getColor); |
904 | myselect[i].blur(); | 875 | myselect[i].blur(); |
905 | } | 876 | } |
906 | 877 | ||
907 | }) | 878 | }) |
908 | 879 | ||
909 | }) | 880 | }) |
910 | } | 881 | } |
911 | 882 | ||
912 | $scope.getOrders(); | 883 | $scope.getOrders(); |
913 | 884 | ||
914 | $scope.tiervalue=function(){ | 885 | $scope.tiervalue=function(){ |
915 | $scope.order.tierBreak=$scope.selectedTier.minTierBreak+'-'+$scope.selectedTier.maxTierBreak; | 886 | $scope.order.tierBreak=$scope.selectedTier.minTierBreak+'-'+$scope.selectedTier.maxTierBreak; |
916 | } | 887 | } |
917 | 888 | ||
918 | $scope.setCost = function(cost){ | 889 | $scope.setCost = function(cost){ |
919 | if(cost != null) { | 890 | if(cost != null) { |
920 | var obj =JSON.parse(cost); | 891 | var obj =JSON.parse(cost); |
921 | $scope.order.fboCost = obj.cost; | 892 | $scope.order.fboCost = obj.cost; |
922 | } | 893 | } |
923 | } | 894 | } |
924 | 895 | ||
925 | $scope.cancelOrder = function() { | 896 | $scope.cancelOrder = function() { |
926 | $scope.order = {}; | 897 | $scope.order = {}; |
927 | } | 898 | } |
928 | 899 | ||
929 | $scope.dispatchFuel = function(){ | 900 | $scope.dispatchFuel = function(){ |
930 | $scope.showLoader = true; | 901 | $scope.showLoader = true; |
931 | $scope.order.companyId = $scope.compId; | 902 | $scope.order.companyId = $scope.compId; |
932 | if ($scope.order.upliftDate != '') { | 903 | if ($scope.order.upliftDate != '') { |
933 | var currentDate = new Date(); | 904 | var currentDate = new Date(); |
934 | var hours = currentDate.getHours(); | 905 | var hours = currentDate.getHours(); |
935 | var min = currentDate.getMinutes(); | 906 | var min = currentDate.getMinutes(); |
936 | var sec = currentDate.getSeconds(); | 907 | var sec = currentDate.getSeconds(); |
937 | $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; | 908 | $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; |
938 | $scope.order.upliftDate = new Date($scope.order.upliftDate); | 909 | $scope.order.upliftDate = new Date($scope.order.upliftDate); |
939 | $scope.order.upliftDate = $scope.order.upliftDate.getTime(); | 910 | $scope.order.upliftDate = $scope.order.upliftDate.getTime(); |
940 | } | 911 | } |
941 | $scope.order.status = 'pending'; | 912 | $scope.order.status = 'pending'; |
942 | var obj =JSON.parse($scope.order.priceQuote); | 913 | var obj =JSON.parse($scope.order.priceQuote); |
943 | $scope.order.priceQuote = obj.papTotal; | 914 | $scope.order.priceQuote = obj.papTotal; |
944 | $scope.order.fboCost = obj.cost; | 915 | $scope.order.fboCost = obj.cost; |
945 | $scope.order.total = obj.papTotal * $scope.order.volume; | 916 | $scope.order.total = obj.papTotal * $scope.order.volume; |
946 | var aircraftObj =JSON.parse($scope.order.aircraftName); | 917 | var aircraftObj =JSON.parse($scope.order.aircraftName); |
947 | $scope.order.aircraftName = aircraftObj.tail; | 918 | $scope.order.aircraftName = aircraftObj.tail; |
948 | $scope.order.make = aircraftObj.make; | 919 | $scope.order.make = aircraftObj.make; |
949 | $scope.order.model = aircraftObj.model; | 920 | $scope.order.model = aircraftObj.model; |
950 | $scope.dispatchOrder.fuelOrderList.push($scope.order); | 921 | $scope.dispatchOrder.fuelOrderList.push($scope.order); |
951 | enterFuelOrderService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { | 922 | enterFuelOrderService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { |
952 | $scope.showLoader = false; | 923 | $scope.showLoader = false; |
953 | $scope.order = {}; | 924 | $scope.order = {}; |
954 | $('#demo-modal-4').css('display', ''); | 925 | $('#demo-modal-4').css('display', ''); |
955 | toastr.success('Fuel Order Dispatched Successfully', { | 926 | toastr.success('Fuel Order Dispatched Successfully', { |
956 | closeButton: true | 927 | closeButton: true |
957 | }) | 928 | }) |
958 | }) | 929 | }) |
959 | } | 930 | } |
960 | 931 | ||
961 | $scope.addTotal = function(value, valueOf) { | 932 | $scope.addTotal = function(value, valueOf) { |
962 | if (valueOf == 'v') { | 933 | if (valueOf == 'v') { |
963 | $scope.order.total = value * $scope.order.invoiced | 934 | $scope.order.total = value * $scope.order.invoiced |
964 | } else if (valueOf == 'i') { | 935 | } else if (valueOf == 'i') { |
965 | $scope.order.total = $scope.order.volume * value | 936 | $scope.order.total = $scope.order.volume * value |
966 | } | 937 | } |
967 | } | 938 | } |
968 | 939 | ||
969 | $scope.getAircraft = function(company) { | 940 | $scope.getAircraft = function(company) { |
970 | $scope.selectedCompanyName = company; | 941 | $scope.selectedCompanyName = company; |
971 | 942 | ||
972 | if ($scope.companyData.margin != null && $scope.companyData.marginAVGAS != null) { | 943 | if ($scope.companyData.margin != null && $scope.companyData.marginAVGAS != null) { |
973 | fuelOrdersService.getFuelCost($scope.companyData.id).then(function(margins) { | 944 | fuelOrdersService.getFuelCost($scope.companyData.id).then(function(margins) { |
974 | $scope.marginList = margins; | 945 | $scope.marginList = margins; |
975 | //console.log('$scope.marginList', $scope.marginList); | 946 | //console.log('$scope.marginList', $scope.marginList); |
976 | }) | 947 | }) |
977 | } else if ($scope.companyData.margin != null || $scope.companyData.marginAVGAS == null) { | 948 | } else if ($scope.companyData.margin != null || $scope.companyData.marginAVGAS == null) { |
978 | fuelOrdersService.getATypeFuelPricing($scope.companyData.id).then(function(margins) { | 949 | fuelOrdersService.getATypeFuelPricing($scope.companyData.id).then(function(margins) { |
979 | $scope.marginList = margins; | 950 | $scope.marginList = margins; |
980 | }) | 951 | }) |
981 | } else if ($scope.companyData.margin == null || $scope.companyData.marginAVGAS != null) { | 952 | } else if ($scope.companyData.margin == null || $scope.companyData.marginAVGAS != null) { |
982 | fuelOrdersService.getVTypeFuelPricing($scope.companyData.id).then(function(margins) { | 953 | fuelOrdersService.getVTypeFuelPricing($scope.companyData.id).then(function(margins) { |
983 | $scope.marginList = margins; | 954 | $scope.marginList = margins; |
984 | }) | 955 | }) |
985 | } | 956 | } |
986 | 957 | ||
987 | 958 | ||
988 | $scope.selectedCompanyId = $scope.companyData.id; | 959 | $scope.selectedCompanyId = $scope.companyData.id; |
989 | $scope.marginId = $scope.companyData.margin.id; | 960 | $scope.marginId = $scope.companyData.margin.id; |
990 | if ($scope.selectedCompanyId != '') { | 961 | if ($scope.selectedCompanyId != '') { |
991 | fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) { | 962 | fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) { |
992 | $scope.aircraftList = aircraft; | 963 | $scope.aircraftList = aircraft; |
993 | }) | 964 | }) |
994 | } | 965 | } |
995 | if ($scope.marginId != '') { | 966 | if ($scope.marginId != '') { |
996 | fuelOrdersService.getJetTiers($scope.marginId).then(function(tiers) { | 967 | fuelOrdersService.getJetTiers($scope.marginId).then(function(tiers) { |
997 | $scope.tierList = tiers; | 968 | $scope.tierList = tiers; |
998 | // $scope.showLoader = false; | 969 | // $scope.showLoader = false; |
999 | }) | 970 | }) |
1000 | } | 971 | } |
1001 | 972 | ||
1002 | } | 973 | } |
1003 | 974 | ||
1004 | $scope.setCost = function(cost) { | 975 | $scope.setCost = function(cost) { |
1005 | // console.log(cost); | 976 | // console.log(cost); |
1006 | if (cost != null) { | 977 | if (cost != null) { |
1007 | var obj = JSON.parse(cost); | 978 | var obj = JSON.parse(cost); |
1008 | // console.log("0bj",obj) | 979 | // console.log("0bj",obj) |
1009 | $scope.order.fboCost = obj.cost; | 980 | $scope.order.fboCost = obj.cost; |
1010 | } | 981 | } |
1011 | 982 | ||
1012 | } | 983 | } |
1013 | 984 | ||
1014 | $scope.sourceList = [{ | 985 | $scope.sourceList = [{ |
1015 | source: "Direct Jet-A" | 986 | source: "Direct Jet-A" |
1016 | }, { | 987 | }, { |
1017 | source: "Direct AVGAS 100LL" | 988 | source: "Direct AVGAS 100LL" |
1018 | }]; | 989 | }]; |
1019 | $scope.cancelData = function() { | 990 | $scope.cancelData = function() { |
1020 | $('#demo-modal-4').css('display', ''); | 991 | $('#demo-modal-4').css('display', ''); |
1021 | } | 992 | } |
1022 | 993 | ||
1023 | $scope.setFuel = function() { | 994 | $scope.setFuel = function() { |
1024 | $('#demo-modal-4').css('display', 'block'); | 995 | $('#demo-modal-4').css('display', 'block'); |
1025 | 996 | ||
1026 | } | 997 | } |
1027 | 998 | ||
1028 | /*delete company*/ | 999 | /*delete company*/ |
1029 | var deletecompanyId = ""; | 1000 | var deletecompanyId = ""; |
1030 | $scope.deleteComp = function(companyDataid) { | 1001 | $scope.deleteComp = function(companyDataid) { |
1031 | $('#delete2').css('display', 'block'); | 1002 | $('#delete2').css('display', 'block'); |
1032 | //console.log("asda",companyDataid) | 1003 | //console.log("asda",companyDataid) |
1033 | deletecompanyId = companyDataid; | 1004 | deletecompanyId = companyDataid; |
1034 | } | 1005 | } |
1035 | $scope.aircraftIdx = ''; | 1006 | $scope.aircraftIdx = ''; |
1036 | $scope.checkTail = function(tail, idx){ | 1007 | $scope.checkTail = function(tail, idx){ |
1037 | var data = "tail=" + tail + "&id=" + companyId; | 1008 | var data = "tail=" + tail + "&id=" + companyId; |
1038 | $scope.aircraftIdx = idx; | 1009 | $scope.aircraftIdx = idx; |
1039 | ViewCompanyService.checkTail(data).then(function(result) { | 1010 | ViewCompanyService.checkTail(data).then(function(result) { |
1040 | if(result.error) { | 1011 | if(result.error) { |
1041 | $scope.aircraftMessage = result.error; | 1012 | $scope.aircraftMessage = result.error; |
1042 | $scope.openAddAirCraftError(); | 1013 | $scope.openAddAirCraftError(); |
1043 | } else if(result.warning) { | 1014 | } else if(result.warning) { |
1044 | $scope.aircraftMessage = result.warning; | 1015 | $scope.aircraftMessage = result.warning; |
1045 | $scope.openAddAirCraftWarning(); | 1016 | $scope.openAddAirCraftWarning(); |
1046 | } | 1017 | } |
1047 | }) | 1018 | }) |
1048 | } | 1019 | } |
1049 | 1020 | ||
1050 | $scope.openAddAirCraftError = function() { | 1021 | $scope.openAddAirCraftError = function() { |
1051 | $('#addAirCraftError').css('display', 'block'); | 1022 | $('#addAirCraftError').css('display', 'block'); |
1052 | } | 1023 | } |
1053 | 1024 | ||
1054 | $scope.openAddAirCraftWarning = function() { | 1025 | $scope.openAddAirCraftWarning = function() { |
1055 | $('#addAirCraftWarning').css('display', 'block'); | 1026 | $('#addAirCraftWarning').css('display', 'block'); |
1056 | } | 1027 | } |
1057 | $scope.acceptAirCraftError = function() { | 1028 | $scope.acceptAirCraftError = function() { |
1058 | $('#addAirCraftWarning').css('display', 'none'); | 1029 | $('#addAirCraftWarning').css('display', 'none'); |
1059 | } | 1030 | } |
1060 | 1031 | ||
1061 | $scope.cancelAirCraftError = function() { | 1032 | $scope.cancelAirCraftError = function() { |
1062 | $scope.aircraftDetails[$scope.aircraftIdx].tail = ''; | 1033 | $scope.aircraftDetails[$scope.aircraftIdx].tail = ''; |
1063 | $('#addAirCraftWarning').css('display', 'none'); | 1034 | $('#addAirCraftWarning').css('display', 'none'); |
1064 | $('#addAirCraftError').css('display', 'none'); | 1035 | $('#addAirCraftError').css('display', 'none'); |
1065 | } | 1036 | } |
1066 | 1037 | ||
1067 | $scope.deleteCompanyData = function() { | 1038 | $scope.deleteCompanyData = function() { |
1068 | ViewCompanyService.deleteCompany(deletecompanyId).then(function(result) { | 1039 | ViewCompanyService.deleteCompany(deletecompanyId).then(function(result) { |
1069 | 1040 | ||
1070 | $('#delete2').css('display', 'none'); | 1041 | $('#delete2').css('display', 'none'); |
1071 | if (result.success) { | 1042 | if (result.success) { |
1072 | toastr.success('' + result.success + '', { | 1043 | toastr.success('' + result.success + '', { |
1073 | closeButton: true | 1044 | closeButton: true |
1074 | 1045 | ||
1075 | }) | 1046 | }) |
1076 | } else { | 1047 | } else { |
1077 | toastr.error('' + result.statusText + '', { | 1048 | toastr.error('' + result.statusText + '', { |
1078 | closeButton: true | 1049 | closeButton: true |
1079 | 1050 | ||
1080 | }) | 1051 | }) |
1081 | } | 1052 | } |
1082 | $state.go('app.customers') | 1053 | $state.go('app.customers') |
1083 | }) | 1054 | }) |
1084 | } | 1055 | } |
1085 | $scope.cancelDelete = function() { | 1056 | $scope.cancelDelete = function() { |
1086 | $('#delete2').css('display', 'none'); | 1057 | $('#delete2').css('display', 'none'); |
1087 | } | 1058 | } |
1088 | 1059 | ||
1089 | 1060 | ||
1090 | $scope.editJetMargin = function(aircraftData, type) { | 1061 | $scope.editJetMargin = function(aircraftData, type) { |
1091 | $scope.showLoader = true; | 1062 | $scope.showLoader = true; |
1092 | if (type == 'jet') { | 1063 | if (type == 'jet') { |
1093 | 1064 | ||
1094 | var aircraftdataMargin = "marginId=" + aircraftData.aircraftsMargin.id + "&type=" + type; | 1065 | var aircraftdataMargin = "marginId=" + aircraftData.aircraftsMargin.id + "&type=" + type; |
1095 | 1066 | ||
1096 | } else { | 1067 | } else { |
1097 | var aircraftdataMargin = "marginId=" + aircraftData.aircraftsAVGASMargin.id + "&type=" + type; | 1068 | var aircraftdataMargin = "marginId=" + aircraftData.aircraftsAVGASMargin.id + "&type=" + type; |
1098 | } | 1069 | } |
1099 | 1070 | ||
1100 | var id = aircraftData.id; | 1071 | var id = aircraftData.id; |
1101 | ViewCompanyService.updateAircraftMargin(aircraftdataMargin, id).then(function(result) { | 1072 | ViewCompanyService.updateAircraftMargin(aircraftdataMargin, id).then(function(result) { |
1102 | if (result != null && result.success) { | 1073 | if (result != null && result.success) { |
1103 | $scope.showLoader = false; | 1074 | $scope.showLoader = false; |
1104 | toastr.success('' + result.success + '', { | 1075 | toastr.success('' + result.success + '', { |
1105 | closeButton: true | 1076 | closeButton: true |
1106 | }) | 1077 | }) |
1107 | // getAircraftWithMarginList(); | 1078 | // getAircraftWithMarginList(); |
1108 | getAircraftList(); | 1079 | getAircraftList(); |
1109 | } else { | 1080 | } else { |
1110 | $scope.showLoader = false; | 1081 | $scope.showLoader = false; |
1111 | toastr.error('' + result.statusText + '', { | 1082 | toastr.error('' + result.statusText + '', { |
1112 | closeButton: true | 1083 | closeButton: true |
1113 | }) | 1084 | }) |
1114 | } | 1085 | } |
1115 | }) | 1086 | }) |
1116 | } | 1087 | } |
1117 | 1088 | ||
1118 | 1089 | ||
1119 | /* //not used currently | 1090 | /* //not used currently |
1120 | function getAircraftWithMarginList() { | 1091 | function getAircraftWithMarginList() { |
1121 | ViewCompanyService.getJetAMargin(companyId).then(function(result) { | 1092 | ViewCompanyService.getJetAMargin(companyId).then(function(result) { |
1122 | $scope.contactAircraftList = result; | 1093 | $scope.contactAircraftList = result; |
1123 | for (var i = 0; i < $scope.contactAircraftList.length; i++) { | 1094 | for (var i = 0; i < $scope.contactAircraftList.length; i++) { |
1124 | if ($scope.contactAircraftList[i].aircraftsMargin != null) { | 1095 | if ($scope.contactAircraftList[i].aircraftsMargin != null) { |
1125 | $scope.aircraftmargins.push({ | 1096 | $scope.aircraftmargins.push({ |
1126 | 'id': $scope.contactAircraftList[i].aircraftsMargin.id | 1097 | 'id': $scope.contactAircraftList[i].aircraftsMargin.id |
1127 | }) | 1098 | }) |
1128 | } | 1099 | } |
1129 | } | 1100 | } |
1130 | if ($scope.aircraftmargins.length > 0) { | 1101 | if ($scope.aircraftmargins.length > 0) { |
1131 | for (var i = 0; i < $scope.aircraftmargins.length; i++) { | 1102 | for (var i = 0; i < $scope.aircraftmargins.length; i++) { |
1132 | if ($scope.aircraftmargins[i].id != $scope.companyData.masterMargin) { | 1103 | if ($scope.aircraftmargins[i].id != $scope.companyData.masterMargin) { |
1133 | $scope.multiple = true; | 1104 | $scope.multiple = true; |
1134 | $scope.multipleMsg = true; | 1105 | $scope.multipleMsg = true; |
1135 | if ($scope.multiple) { | 1106 | if ($scope.multiple) { |
1136 | $scope.companyData.masterMargin = "multiple"; | 1107 | $scope.companyData.masterMargin = "multiple"; |
1137 | } | 1108 | } |
1138 | } | 1109 | } |
1139 | } | 1110 | } |
1140 | } | 1111 | } |
1141 | }) | 1112 | }) |
1142 | }*/ | 1113 | }*/ |
1143 | 1114 | ||
1144 | 1115 | ||
1145 | }]); | 1116 | }]); |
app/partials/viewFuelVendor/viewFuelVendor.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | .service('ViewFuelVendorService', ['$q', '$http', 'BASE_URL', ViewFuelVendorService]); | 4 | .service('ViewFuelVendorService', ['$q', '$http', 'BASE_URL', ViewFuelVendorService]); |
5 | 5 | ||
6 | function ViewFuelVendorService($q, $http, BASE_URL) { | 6 | function ViewFuelVendorService($q, $http, BASE_URL) { |
7 | 7 | ||
8 | this.getFuelOrder = function(id) { | 8 | this.getFuelOrder = function(id) { |
9 | 9 | ||
10 | var deferred = $q.defer(); | 10 | var deferred = $q.defer(); |
11 | $http({ | 11 | $http({ |
12 | method : 'GET', | 12 | method : 'GET', |
13 | url : BASE_URL.url +'/vendor/'+id, | 13 | url : BASE_URL.url +'/vendor/'+id, |
14 | headers : {'Content-Type': 'application/json'}, | 14 | headers : {'Content-Type': 'application/json'}, |
15 | }) | 15 | }) |
16 | .then(function (result){ | 16 | .then(function (result){ |
17 | deferred.resolve(result.data); | 17 | deferred.resolve(result.data); |
18 | },function (result){ | 18 | },function (result){ |
19 | deferred.resolve(result.data); | 19 | deferred.resolve(result.data); |
20 | }) | 20 | }) |
21 | return deferred.promise; | 21 | return deferred.promise; |
22 | } | 22 | } |
23 | 23 | ||
24 | this.getContact = function(id) { | 24 | this.getContact = function(id) { |
25 | 25 | ||
26 | var deferred = $q.defer(); | 26 | var deferred = $q.defer(); |
27 | $http({ | 27 | $http({ |
28 | method : 'GET', | 28 | method : 'GET', |
29 | url : BASE_URL.url +'/vendor/contacts/'+id, | 29 | url : BASE_URL.url +'/vendor/contacts/'+id, |
30 | headers : {'Content-Type': 'application/json'}, | 30 | headers : {'Content-Type': 'application/json'}, |
31 | }) | 31 | }) |
32 | .then(function (result){ | 32 | .then(function (result){ |
33 | deferred.resolve(result.data); | 33 | deferred.resolve(result.data); |
34 | },function (result){ | 34 | },function (result){ |
35 | deferred.resolve(result.data); | 35 | deferred.resolve(result.data); |
36 | }) | 36 | }) |
37 | return deferred.promise; | 37 | return deferred.promise; |
38 | } | 38 | } |
39 | 39 | ||
40 | this.updateCustomField = function(data){ | 40 | this.updateCustomField = function(data){ |
41 | var deferred = $q.defer(); | 41 | var deferred = $q.defer(); |
42 | $http({ | 42 | $http({ |
43 | method : 'PUT', | 43 | method : 'PUT', |
44 | url : BASE_URL.url +'/vendor/custom/contacts', | 44 | url : BASE_URL.url +'/vendor/custom/contacts', |
45 | data : data, | 45 | data : data, |
46 | headers : {'Content-Type': 'application/json'}, | 46 | headers : {'Content-Type': 'application/json'}, |
47 | }) | 47 | }) |
48 | .then(function (result){ | 48 | .then(function (result){ |
49 | deferred.resolve(result.data); | 49 | deferred.resolve(result.data); |
50 | },function (result){ | 50 | },function (result){ |
51 | deferred.resolve(result.data); | 51 | deferred.resolve(result.data); |
52 | }) | 52 | }) |
53 | return deferred.promise; | 53 | return deferred.promise; |
54 | } | 54 | } |
55 | 55 | ||
56 | this.checkPrimaryContact = function(id){ | 56 | this.checkPrimaryContact = function(id){ |
57 | var deferred = $q.defer(); | 57 | var deferred = $q.defer(); |
58 | $http({ | 58 | $http({ |
59 | method : 'GET', | 59 | method : 'GET', |
60 | url : BASE_URL.url +'/vendor/contact/check/primaryContact/'+id, | 60 | url : BASE_URL.url +'/vendor/contact/check/primaryContact/'+id, |
61 | headers : {'Content-Type': 'application/json'}, | 61 | headers : {'Content-Type': 'application/json'}, |
62 | }) | 62 | }) |
63 | .then(function (result){ | 63 | .then(function (result){ |
64 | deferred.resolve(result); | 64 | deferred.resolve(result); |
65 | },function (result){ | 65 | },function (result){ |
66 | deferred.resolve(result); | 66 | deferred.resolve(result); |
67 | }) | 67 | }) |
68 | return deferred.promise; | 68 | return deferred.promise; |
69 | } | 69 | } |
70 | 70 | ||
71 | this.addPrimaryContact = function(data){ | 71 | this.addPrimaryContact = function(data){ |
72 | var deferred = $q.defer(); | 72 | var deferred = $q.defer(); |
73 | $http({ | 73 | $http({ |
74 | method : 'POST', | 74 | method : 'POST', |
75 | url : BASE_URL.url +'/vendor/contact/createPrimaryContact', | 75 | url : BASE_URL.url +'/vendor/contact/createPrimaryContact', |
76 | data : data, | 76 | data : data, |
77 | headers : {'Content-Type': 'application/json'}, | 77 | headers : {'Content-Type': 'application/json'}, |
78 | }) | 78 | }) |
79 | .then(function (result){ | 79 | .then(function (result){ |
80 | deferred.resolve(result.data); | 80 | deferred.resolve(result.data); |
81 | },function (result){ | 81 | },function (result){ |
82 | deferred.resolve(result.data); | 82 | deferred.resolve(result.data); |
83 | }) | 83 | }) |
84 | return deferred.promise; | 84 | return deferred.promise; |
85 | } | 85 | } |
86 | 86 | ||
87 | this.changeStatus = function(vendorId, data){ | 87 | this.changeStatus = function(vendorId, data){ |
88 | var deferred = $q.defer(); | 88 | var deferred = $q.defer(); |
89 | $http({ | 89 | $http({ |
90 | method : 'PUT', | 90 | method : 'PUT', |
91 | url : BASE_URL.url +'/vendor/status/'+vendorId, | 91 | url : BASE_URL.url +'/vendor/status/'+vendorId, |
92 | data : data, | 92 | data : data, |
93 | headers : {'Content-Type': 'application/json'}, | 93 | headers : {'Content-Type': 'application/json'}, |
94 | }) | 94 | }) |
95 | .then(function (result){ | 95 | .then(function (result){ |
96 | deferred.resolve(result.data); | 96 | deferred.resolve(result.data); |
97 | },function (result){ | 97 | },function (result){ |
98 | deferred.resolve(result.data); | 98 | deferred.resolve(result.data); |
99 | }) | 99 | }) |
100 | return deferred.promise; | 100 | return deferred.promise; |
101 | } | 101 | } |
102 | 102 | ||
103 | this.addCustomField = function(data){ | 103 | this.addCustomField = function(data){ |
104 | var deferred = $q.defer(); | 104 | var deferred = $q.defer(); |
105 | $http({ | 105 | $http({ |
106 | method : 'POST', | 106 | method : 'POST', |
107 | url : BASE_URL.url +'/vendor/custom/contacts', | 107 | url : BASE_URL.url +'/vendor/custom/contacts', |
108 | data : data, | 108 | data : data, |
109 | headers : {'Content-Type': 'application/json'}, | 109 | headers : {'Content-Type': 'application/json'}, |
110 | }) | 110 | }) |
111 | .then(function (result){ | 111 | .then(function (result){ |
112 | deferred.resolve(result); | 112 | deferred.resolve(result); |
113 | },function (result){ | 113 | },function (result){ |
114 | deferred.resolve(result); | 114 | deferred.resolve(result); |
115 | }) | 115 | }) |
116 | return deferred.promise; | 116 | return deferred.promise; |
117 | } | 117 | } |
118 | 118 | ||
119 | this.deleteCustomContact = function(id) { | 119 | this.deleteCustomContact = function(id) { |
120 | var deferred = $q.defer(); | 120 | var deferred = $q.defer(); |
121 | $http({ | 121 | $http({ |
122 | method : 'DELETE', | 122 | method : 'DELETE', |
123 | url : BASE_URL.url +'/vendor/custom/contact/'+id, | 123 | url : BASE_URL.url +'/vendor/custom/contact/'+id, |
124 | headers : {'Content-Type': 'application/json'}, | 124 | headers : {'Content-Type': 'application/json'}, |
125 | }) | 125 | }) |
126 | .then(function (result){ | 126 | .then(function (result){ |
127 | deferred.resolve(result.data); | 127 | deferred.resolve(result.data); |
128 | },function (result){ | 128 | },function (result){ |
129 | deferred.resolve(result.data); | 129 | deferred.resolve(result.data); |
130 | }) | 130 | }) |
131 | return deferred.promise; | 131 | return deferred.promise; |
132 | } | 132 | } |
133 | 133 | ||
134 | this.addContact = function(data) { | 134 | this.addContact = function(data) { |
135 | 135 | ||
136 | var deferred = $q.defer(); | 136 | var deferred = $q.defer(); |
137 | $http({ | 137 | $http({ |
138 | method : 'POST', | 138 | method : 'POST', |
139 | url : BASE_URL.url +'/vendor/contact', | 139 | url : BASE_URL.url +'/vendor/contact', |
140 | data : data, | 140 | data : data, |
141 | headers : {'Content-Type': 'application/json'}, | 141 | headers : {'Content-Type': 'application/json'}, |
142 | }) | 142 | }) |
143 | .then(function (result){ | 143 | .then(function (result){ |
144 | deferred.resolve(result); | 144 | deferred.resolve(result); |
145 | },function (result){ | 145 | },function (result){ |
146 | deferred.resolve(result); | 146 | deferred.resolve(result); |
147 | }) | 147 | }) |
148 | return deferred.promise; | 148 | return deferred.promise; |
149 | } | 149 | } |
150 | 150 | ||
151 | this.sendMail = function(id) { | 151 | this.sendMail = function(id) { |
152 | 152 | ||
153 | var deferred = $q.defer(); | 153 | var deferred = $q.defer(); |
154 | $http({ | 154 | $http({ |
155 | method : 'POST', | 155 | method : 'POST', |
156 | url : BASE_URL.url +'/vendor/mailPriceToContacts/'+id, | 156 | url : BASE_URL.url +'/vendor/mailPriceToContacts/'+id, |
157 | headers : {'Content-Type': 'application/json'}, | 157 | headers : {'Content-Type': 'application/json'}, |
158 | }) | 158 | }) |
159 | .then(function (result){ | 159 | .then(function (result){ |
160 | deferred.resolve(result.data); | 160 | deferred.resolve(result.data); |
161 | },function (result){ | 161 | },function (result){ |
162 | deferred.resolve(result.data); | 162 | deferred.resolve(result.data); |
163 | }) | 163 | }) |
164 | return deferred.promise; | 164 | return deferred.promise; |
165 | } | 165 | } |
166 | 166 | ||
167 | this.updateContact = function(data) { | 167 | this.updateContact = function(data) { |
168 | 168 | ||
169 | var deferred = $q.defer(); | 169 | var deferred = $q.defer(); |
170 | $http({ | 170 | $http({ |
171 | method : 'PUT', | 171 | method : 'PUT', |
172 | url : BASE_URL.url +'/vendor', | 172 | url : BASE_URL.url +'/vendor', |
173 | data : data, | 173 | data : data, |
174 | headers : {'Content-Type': 'application/json'}, | 174 | headers : {'Content-Type': 'application/json'}, |
175 | }) | 175 | }) |
176 | .then(function (result){ | 176 | .then(function (result){ |
177 | deferred.resolve(result.data); | 177 | deferred.resolve(result.data); |
178 | },function (result){ | 178 | },function (result){ |
179 | deferred.resolve(result.data); | 179 | deferred.resolve(result.data); |
180 | }) | 180 | }) |
181 | return deferred.promise; | 181 | return deferred.promise; |
182 | } | 182 | } |
183 | 183 | ||
184 | this.getAircraft = function(id) { | 184 | this.getAircraft = function(id) { |
185 | 185 | ||
186 | var deferred = $q.defer(); | 186 | var deferred = $q.defer(); |
187 | $http({ | 187 | $http({ |
188 | method : 'GET', | 188 | method : 'GET', |
189 | url : BASE_URL.url +'/vendor/aircrafts/'+id, | 189 | url : BASE_URL.url +'/vendor/aircrafts/'+id, |
190 | headers : {'Content-Type': 'application/json'}, | 190 | headers : {'Content-Type': 'application/json'}, |
191 | }) | 191 | }) |
192 | .then(function (result){ | 192 | .then(function (result){ |
193 | deferred.resolve(result.data); | 193 | deferred.resolve(result.data); |
194 | },function (result){ | 194 | },function (result){ |
195 | deferred.resolve(result.data); | 195 | deferred.resolve(result.data); |
196 | }) | 196 | }) |
197 | return deferred.promise; | 197 | return deferred.promise; |
198 | } | 198 | } |
199 | 199 | ||
200 | this.changePriceEmail = function(contactId, data) { | 200 | this.changePriceEmail = function(contactId, data) { |
201 | var deferred = $q.defer(); | 201 | var deferred = $q.defer(); |
202 | $http({ | 202 | $http({ |
203 | method : 'PUT', | 203 | method : 'PUT', |
204 | url : BASE_URL.url +'/vendor/contact/status/'+ contactId, | 204 | url : BASE_URL.url +'/vendor/contact/status/'+ contactId, |
205 | data : data, | 205 | data : data, |
206 | headers : {'Content-Type': 'application/json'}, | 206 | headers : {'Content-Type': 'application/json'}, |
207 | }) | 207 | }) |
208 | .then(function (result){ | 208 | .then(function (result){ |
209 | deferred.resolve(result.data); | 209 | deferred.resolve(result.data); |
210 | },function (result){ | 210 | },function (result){ |
211 | deferred.resolve(result.data); | 211 | deferred.resolve(result.data); |
212 | }) | 212 | }) |
213 | return deferred.promise; | 213 | return deferred.promise; |
214 | } | 214 | } |
215 | 215 | ||
216 | /* This API is not in use for omit funtion */ | 216 | /* This API is not in use for omit funtion */ |
217 | this.omitFuelPricing = function(data) { | 217 | this.omitFuelPricing = function(data) { |
218 | 218 | ||
219 | var deferred = $q.defer(); | 219 | var deferred = $q.defer(); |
220 | $http({ | 220 | $http({ |
221 | method : 'PUT', | 221 | method : 'PUT', |
222 | url : BASE_URL.url +'/fuelPricing/omitFuelPricing', | 222 | url : BASE_URL.url +'/fuelPricing/omitFuelPricing', |
223 | headers : {'Content-Type': 'application/json'}, | 223 | headers : {'Content-Type': 'application/json'}, |
224 | data: data | 224 | data: data |
225 | }) | 225 | }) |
226 | .then(function (result){ | 226 | .then(function (result){ |
227 | deferred.resolve(result.data); | 227 | deferred.resolve(result.data); |
228 | },function (result){ | 228 | },function (result){ |
229 | deferred.resolve(result.data); | 229 | deferred.resolve(result.data); |
230 | }) | 230 | }) |
231 | return deferred.promise; | 231 | return deferred.promise; |
232 | } | 232 | } |
233 | 233 | ||
234 | 234 | ||
235 | this.deleteFuelVendor = function(id) { | 235 | this.deleteFuelVendor = function(id) { |
236 | 236 | ||
237 | var deferred = $q.defer(); | 237 | var deferred = $q.defer(); |
238 | $http({ | 238 | $http({ |
239 | method : 'DELETE', | 239 | method : 'DELETE', |
240 | url : BASE_URL.url +'/vendor/vendorid/'+id, | 240 | url : BASE_URL.url +'/vendor/vendorid/'+id, |
241 | headers : {'Content-Type': 'application/json'}, | 241 | headers : {'Content-Type': 'application/json'}, |
242 | }) | 242 | }) |
243 | .then(function (result){ | 243 | .then(function (result){ |
244 | deferred.resolve(result.data); | 244 | deferred.resolve(result.data); |
245 | },function (result){ | 245 | },function (result){ |
246 | deferred.resolve(result.data); | 246 | deferred.resolve(result.data); |
247 | }) | 247 | }) |
248 | return deferred.promise; | 248 | return deferred.promise; |
249 | } | 249 | } |
250 | 250 | ||
251 | /* Omit Delete and Insert vendor fuel api */ | 251 | /* Omit Delete and Insert vendor fuel api */ |
252 | 252 | ||
253 | this.getOmitVendor = function(id) { | 253 | this.getOmitVendor = function(id) { |
254 | 254 | ||
255 | var deferred = $q.defer(); | 255 | var deferred = $q.defer(); |
256 | $http({ | 256 | $http({ |
257 | method : 'GET', | 257 | method : 'GET', |
258 | url : BASE_URL.url +'/vendor/omitData/'+id, | 258 | url : BASE_URL.url +'/vendor/omitData/'+id, |
259 | headers : {'Content-Type': 'application/json'}, | 259 | headers : {'Content-Type': 'application/json'}, |
260 | }) | 260 | }) |
261 | .then(function (result){ | 261 | .then(function (result){ |
262 | deferred.resolve(result.data); | 262 | deferred.resolve(result.data); |
263 | },function (result){ | 263 | },function (result){ |
264 | deferred.resolve(result.data); | 264 | deferred.resolve(result.data); |
265 | }) | 265 | }) |
266 | return deferred.promise; | 266 | return deferred.promise; |
267 | } | 267 | } |
268 | 268 | ||
269 | /*this.omitDeleteVendorFuel = function(id) { | ||
270 | |||
271 | var deferred = $q.defer(); | ||
272 | $http({ | ||
273 | method : 'DELETE', | ||
274 | url : BASE_URL.url +'/vendor/omitData/'+id, | ||
275 | headers : {'Content-Type': 'application/json'}, | ||
276 | }) | ||
277 | .then(function (result){ | ||
278 | deferred.resolve(result.data); | ||
279 | },function (result){ | ||
280 | deferred.resolve(result.data); | ||
281 | }) | ||
282 | return deferred.promise; | ||
283 | } */ | ||
284 | |||
285 | this.omitDeleteVendorFuel = function(data){ | 269 | this.omitDeleteVendorFuel = function(data){ |
286 | var deferred = $q.defer(); | 270 | var deferred = $q.defer(); |
287 | $http({ | 271 | $http({ |
288 | method : 'POST', | 272 | method : 'POST', |
289 | url : BASE_URL.url +'/vendor/omitData/delete', | 273 | url : BASE_URL.url +'/vendor/omitData/delete', |
290 | data : data, | 274 | data : data, |
291 | headers : {'Content-Type': 'application/json'}, | 275 | headers : {'Content-Type': 'application/json'}, |
292 | }) | 276 | }) |
293 | .then(function (result){ | 277 | .then(function (result){ |
294 | deferred.resolve(result.data); | 278 | deferred.resolve(result.data); |
295 | },function (result){ | 279 | },function (result){ |
296 | deferred.resolve(result.data); | 280 | deferred.resolve(result.data); |
297 | }) | 281 | }) |
298 | return deferred.promise; | 282 | return deferred.promise; |
299 | } | 283 | } |
300 | 284 | ||
301 | this.omitAddvendorFuel = function(data){ | 285 | this.omitAddvendorFuel = function(data){ |
302 | var deferred = $q.defer(); | 286 | var deferred = $q.defer(); |
303 | $http({ | 287 | $http({ |
304 | method : 'POST', | 288 | method : 'POST', |
305 | url : BASE_URL.url +'/vendor/omitData/add', | 289 | url : BASE_URL.url +'/vendor/omitData/add', |
306 | data : data, | 290 | data : data, |
307 | headers : {'Content-Type': 'application/json'}, | 291 | headers : {'Content-Type': 'application/json'}, |
308 | }) | 292 | }) |
309 | .then(function (result){ | 293 | .then(function (result){ |
310 | deferred.resolve(result.data); | 294 | deferred.resolve(result.data); |
311 | },function (result){ | 295 | },function (result){ |
312 | deferred.resolve(result.data); | 296 | deferred.resolve(result.data); |
313 | }) | 297 | }) |
314 | return deferred.promise; | 298 | return deferred.promise; |
315 | } | 299 | } |
316 | 300 | ||
317 | 301 | ||
318 | } | 302 | } |
319 | 303 | ||
320 | })(); | 304 | })(); |