diff --git a/app/partials/enterFuelOrder/enterFuelOrder.controller.js b/app/partials/enterFuelOrder/enterFuelOrder.controller.js index 8d91152..3b3119d 100644 --- a/app/partials/enterFuelOrder/enterFuelOrder.controller.js +++ b/app/partials/enterFuelOrder/enterFuelOrder.controller.js @@ -115,7 +115,7 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http, $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; $scope.order.upliftDate = new Date($scope.order.upliftDate); $scope.order.upliftDate = $scope.order.upliftDate.getTime(); - console.log("---date---",$scope.order.upliftDate) + // console.log("---date---",$scope.order.upliftDate) } /*if ($scope.order.departingDate != '') { $scope.order.departingDate = new Date($scope.order.departingDate); @@ -124,11 +124,10 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http, $scope.order.status = 'pending'; - //console.log($scope.order.quotePrice); var obj =JSON.parse($scope.order.priceQuote); - //console.log('obj.papMargin',obj.papMargin); $scope.order.priceQuote = obj.papTotal; $scope.order.fboCost = obj.cost; + $scope.order.productName = obj.productName; $scope.order.total = obj.papTotal * $scope.order.volume; var aircraftObj =JSON.parse($scope.order.aircraftName); $scope.order.aircraftName = aircraftObj.tail; diff --git a/app/partials/fuelOrders/fuelOrders.controller.js b/app/partials/fuelOrders/fuelOrders.controller.js index 9731c85..8d98624 100644 --- a/app/partials/fuelOrders/fuelOrders.controller.js +++ b/app/partials/fuelOrders/fuelOrders.controller.js @@ -110,16 +110,16 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.getOrders = function() { fuelOrdersService.getOrders().then(function(result) { - + //console.log("==kd===",result); $scope.orderdata = result; - for(var i=0;i<$scope.orderdata.length;i++){ + for(var i=0 ; i < $scope.orderdata.length ; i++){ $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); + $scope.orderdata[i].departingDateS = new Date($scope.orderdata[i].departingDate); - // var str = "" + $scope.orderdata[i].upliftDateS.getDate() + "/" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getFullYear() - var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear() - // str = str.slice(4,16) - $scope.orderdata[i].upliftDateString = str - // console.log(str); + var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear(); + var departingStr = "" + ($scope.orderdata[i].departingDateS.getMonth() + 1) + "/" + $scope.orderdata[i].departingDateS.getDate() + "/" + $scope.orderdata[i].departingDateS.getFullYear(); + $scope.orderdata[i].upliftDateString = str; + $scope.orderdata[i].departingDateString = departingStr; } @@ -140,10 +140,8 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT for (var i = 0; i < myselect.length; i++) { var colourIndex = $(myselect[i]).prop('selectedIndex'); colourIndex = colourIndex + 1; - // console.log(colourIndex); var getColor = $('.colorfulSelectbox option:nth-child('+colourIndex+')').css('color'); $(myselect[i]).css('background-color', getColor); - // console.log('colour', getColor); myselect[i].blur(); } } @@ -190,9 +188,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.attachment = function(id, value, url) { - // console.log(id, value) $scope.attachmentrowid = id - // $scope.attachmentdeleteid = attachdeleteid if(value == 'uploadAttachment'){ $('#demo-modal-6').css('display', 'block'); }else if(value == 'viewAttachment'){ @@ -210,7 +206,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.deleteAttachment = function() { $scope.showLoader = true; fuelOrdersService.deleteAttachment($scope.attachmentrowid).then(function(result) { - // console.log(result, $scope.attachmentrowid) if(result.success){ toastr.success(''+result.success+'', { @@ -227,9 +222,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.data.media = attachmentData $scope.data.id = $scope.attachmentrowid fuelOrdersService.uploadAttachment($scope.data).then(function(result) { - // console.log(result) if(result){ - // console.log(result.success) toastr.success(''+"Upload Successful"+'', { closeButton: true }) @@ -273,7 +266,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.showLoader = true; if ($scope.order.priceQuote === null || $scope.order.priceQuote == '') { - // console.log("valid"); $scope.showLoader = false; toastr.error('Please select Company and Price Quote.', { closeButton: true @@ -288,9 +280,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.order.departingDate = new Date($scope.order.departingDate); $scope.order.departingDate = $scope.order.departingDate.getTime(); } - // console.log($scope.order.quotePrice); var obj =JSON.parse($scope.order.priceQuote); - // console.log('obj.papMargin',obj.papMargin); $scope.order.priceQuote = obj.papMargin; $scope.fuelData = {}; @@ -312,11 +302,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); - // console.log('$scope.order', $scope.dispatchOrder); fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { - //console.log("fuel data---",$scope.fuelData) - //console.log("oder data",$scope.dispatchOrder) - //console.log('result', result); $scope.showLoader = false; $scope.order = {}; $scope.dispatchOrder.fuelOrderList = []; @@ -350,7 +336,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { - // console.log('result', result); $scope.showLoader = false; $scope.editdata = {}; $scope.fuelData = {}; @@ -365,51 +350,67 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT } $scope.updateData = function() { - $scope.showLoader = true; - $scope.fuelData = {}; - $scope.fuelData.aircraftName = $scope.editdata.aircraftName - $scope.fuelData.companyName = $scope.editdata.companyName - $scope.fuelData.departingDate = $scope.editdata.departingDate - $scope.fuelData.fboCost = $scope.editdata.fboCost - $scope.fuelData.id = $scope.editdata.id - $scope.fuelData.invoiced = $scope.editdata.invoiced - $scope.fuelData.priceQuote = $scope.editdata.priceQuote - $scope.fuelData.volume = $scope.editdata.requestedVolume - $scope.fuelData.source = $scope.editdata.source - $scope.fuelData.status = $scope.editdata.status - $scope.fuelData.tierBreak = $scope.editdata.tierBreak - $scope.fuelData.total = $scope.editdata.total - - $scope.editdata.upliftDateString = new Date($scope.editdata.upliftDateString); - $scope.editdata.upliftDateString = $scope.editdata.upliftDateString.getTime(); - - $scope.fuelData.upliftDate = $scope.editdata.upliftDateString - $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); - console.log("click-====",$scope.dispatchOrder) - fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { - console.log('result', result); - $scope.showLoader = false; - $scope.editdata = {}; - $('#demo-modal-5').css('display', ''); - $scope.getOrders(); - toastr.success('Fuel Order Updated Successfully', { - closeButton: true - }) - }) + if($scope.etaTimeList.length == 8 && $scope.etdTimeList.length ==8){ + $scope.showLoader = true; + $scope.fuelData = {}; + $scope.fuelData.aircraftName = $scope.editdata.aircraftName; + $scope.fuelData.companyName = $scope.editdata.companyName; + $scope.fuelData.fboCost = $scope.editdata.fboCost; + $scope.fuelData.id = $scope.editdata.id; + $scope.fuelData.invoiced = $scope.editdata.invoiced; + $scope.fuelData.priceQuote = $scope.editdata.priceQuote; + $scope.fuelData.volume = $scope.editdata.requestedVolume; + $scope.fuelData.source = $scope.editdata.source; + $scope.fuelData.status = $scope.editdata.status; + $scope.fuelData.tierBreak = $scope.editdata.tierBreak; + $scope.fuelData.total = $scope.editdata.total; + + $scope.editdata.upliftDateString = new Date($scope.editdata.upliftDateString); + $scope.editdata.upliftDateString = $scope.editdata.upliftDateString.getTime(); + + $scope.editdata.departingDateString = new Date($scope.editdata.departingDateString); + $scope.editdata.departingDateString = $scope.editdata.departingDateString.getTime(); + + $scope.fuelData.upliftDate = $scope.editdata.upliftDateString; + $scope.fuelData.departingDate = $scope.editdata.departingDateString; + $scope.fuelData.productName = $scope.editdata.productName; + $scope.fuelData.etaTime = $scope.etaTimeList; + $scope.fuelData.etdTime = $scope.etdTimeList; + $scope.fuelData.certificateType = $scope.editdata.certificateType; + + $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); + + //Disable below api code for temporary + fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { + console.log('result', result); + $scope.showLoader = false; + $scope.editdata = {}; + $('#demo-modal-5').css('display', ''); + $scope.getOrders(); + toastr.success('Fuel Order Updated Successfully', { + closeButton: true + }) + }) + + }else + { + toastr.error('Please select Arrival Time and Departure time both.', { + closeButton: true + }) + } + } $scope.getAircraft = function(company){ $scope.selectedCompanyName = company; //$scope.showLoader = true; - // console.log("id",company) for (var i = 0; i < $scope.companyList.length; i++) { if ($scope.companyList[i].companyName == company) { if($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null){ fuelOrdersService.getFuelCost($scope.companyList[i].id).then(function(margins) { $scope.marginList = margins; - //console.log('$scope.marginList', $scope.marginList); }) } else if ($scope.companyList[i].margin != null || $scope.companyList[i].marginAVGAS == null) { fuelOrdersService.getATypeFuelPricing($scope.companyList[i].id).then(function(margins) { @@ -440,10 +441,8 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT } $scope.setCost = function(cost){ - console.log(cost); if(cost != null) { var obj =JSON.parse(cost); - console.log("0bj",obj) $scope.order.fboCost = obj.cost; } @@ -473,7 +472,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT CustomersService.getCompanyName().then(function(result) { $scope.showLoader = true; $scope.compNameList = result; - //console.log("kd",result) $scope.showLoader = false; }) } @@ -482,7 +480,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT CustomersService.getJetMargin($scope.userProfileId).then(function(result) { $scope.showLoader = true; $scope.jetMarginList = result; - //console.log("jet margin",result,$scope.userProfileId) $scope.marginFilterOptions.push({ 'id': '', 'title': 'Show All' }); @@ -497,7 +494,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { $scope.avgsMarginList = result; - // console.log('avgsMarginList',result) }) $scope.showCompanyError = false; @@ -521,7 +517,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT function getData(){ $scope.showLoader = true; CustomersService.getAircraftMake().then(function(result) { - console.log("adadadsd==========") $scope.aircraftMakeList = result; $scope.showLoader = false; }) @@ -566,9 +561,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT $scope.aircraft = {}; $scope.getModal = function(makeId, index){ $scope.showLoader = true; - //console.log(makeId) $scope.aircraft.make = makeId; - //var makeId = makeId; CustomersService.getModal($scope.aircraft.make).then(function(result) { $scope.showLoader = false; $scope.aircraftDetails[index].aircraftModalList = result; @@ -633,7 +626,6 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT //console.log("tail==============",tail, index) ViewCompanyService.checkJetType(tail).then(function(result) { - //console.log("result",result) if(result.jetA == "true"){ $scope.jetShow[index] = false; $scope.marginShow[index] = true; @@ -644,7 +636,23 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT }) } + // $scope.etaTimeList=[]; + // $scope.etdTimeList =[]; + $scope.sourceList = [{source:"Direct Jet-A"},{source:"Direct AVGAS 100LL"}]; + $scope.etaTimeList = [{time:"12:00 AM","id":1},{time:"12:30 AM","id":2},{time:"01:00 AM","id":3},{time:"01:30 AM","id":4},{time:"02:00 AM","id":5},{time:"02:30 AM","id":6},{time:"03:00 AM","id":7},{time:"03:30 AM","id":8}, + {time:"04:00 AM","id":9},{time:"04:30 AM","id":10},{time:"05:00 AM","id":11},{time:"05:30 AM","id":12},{time:"06:00 AM","id":13},{time:"06:30 AM","id":14},{time:"07:00 AM","id":15},{time:"07:30 AM","id":16}, + {time:"08:00 AM","id":17},{time:"08:30 AM","id":18},{time:"09:00 AM","id":19},{time:"09:30 AM","id":20},{time:"10:00 AM","id":21},{time:"10:30 AM","id":22},{time:"11:00 AM","id":23},{time:"11:30 AM","id":24}, + {time:"12:00 PM","id":25},{time:"12:30 PM","id":26},{time:"01:00 PM","id":27},{time:"01:30 PM","id":28},{time:"02:00 PM","id":29},{time:"02:30 PM","id":30},{time:"03:00 PM","id":31},{time:"03:30 PM","id":32}, + {time:"04:00 PM","id":33},{time:"04:30 PM","id":34},{time:"05:00 PM","id":35},{time:"05:30 PM","id":36},{time:"06:00 PM","id":37},{time:"06:30 PM","id":38},{time:"07:00 PM","id":39},{time:"07:30 PM","id":40}, + {time:"08:00 PM","id":41},{time:"08:30 PM","id":42},{time:"9:00 PM","id":43},{time:"09:30 PM","id":44},{time:"10:00 PM","id":45},{time:"10:30 PM","id":46},{time:"11:00 PM","id":47},{time:"11:30 PM","id":48},] + + $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"}, + {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"}, + {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"}, + {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"}, + {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"}, + {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"},] $scope.data = {}; diff --git a/app/partials/fuelOrders/fuelOrders.html b/app/partials/fuelOrders/fuelOrders.html index d31956b..16ee99e 100644 --- a/app/partials/fuelOrders/fuelOrders.html +++ b/app/partials/fuelOrders/fuelOrders.html @@ -737,15 +737,24 @@
- +
-
- +
+
+ Date + +
+
+ Time + +
-
+
@@ -754,7 +763,36 @@
- +
+

+ +
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
Arrival + +
+
+

@@ -769,7 +807,7 @@ --> - {{editdata.companyName}} + {{editdata.companyName}}
@@ -805,8 +843,8 @@
- - + +
@@ -834,19 +872,19 @@
- +
- {{editdata.fboCost}} + {{editdata.productName}}

-
+
@@ -865,12 +903,25 @@
+
+
+ +
+
+ +
+

- -

@@ -978,3 +1029,15 @@ sendEvent = function(sel, step) { $(sel).trigger('next.m.' + step); } + + \ No newline at end of file