diff --git a/app/partials/updateFuelManager/updateFuelManager.controller.js b/app/partials/updateFuelManager/updateFuelManager.controller.js index dedf132..06b8a5c 100644 --- a/app/partials/updateFuelManager/updateFuelManager.controller.js +++ b/app/partials/updateFuelManager/updateFuelManager.controller.js @@ -594,9 +594,10 @@ $scope.showLoader = true; for (var i = 0; i<$scope.newFuelPricing.length; i++) { //console.log(parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin)); + console.log('-----',$scope.newFuelPricing[i].futureFuelPricing); if ($scope.newFuelPricing[i].futureFuelPricing != null) { if ($scope.newFuelPricing[i].futureFuelPricing.cost != null || $scope.newFuelPricing[i].futureFuelPricing.cost != '' || $scope.newFuelPricing[i].futureFuelPricing.cost != undefined) { - $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].fuelPricing.papMargin); + $scope.newFuelPricing[i].futureFuelPricing.papTotal = parseFloat($scope.newFuelPricing[i].futureFuelPricing.cost) + parseFloat($scope.newFuelPricing[i].futureFuelPricing.papMargin); if ($scope.newFuelPricing[i].futureFuelPricing.cost == null) { $scope.newFuelPricing[i].futureFuelPricing.cost = ''; } @@ -870,6 +871,34 @@ $('#deleteVtypeMargin').css('display', 'none'); } + $scope.resetFutureFuelPricingClick = function(){ + $('#resetPricing').css('display', 'block'); + } + + $scope.confirmReset = function(){ + $('#resetPricing').css('display', 'none'); + $scope.showLoader = true; + updateFuelManagerService.resetPricing().then(function(result) { + toastr.success(''+result.success+'', { + closeButton: true + }) + $scope.showLoader = false; + }) + } + + $scope.cancelReset = function(){ + $('#resetPricing').css('display', 'none'); + } + $scope.noPrices = true; + $scope.disableButtons = function(value){ + if(value.length != 0){ + $scope.noPrices = false; + } + else{ + $scope.noPrices = true; + } + } + diff --git a/app/partials/updateFuelManager/updateFuelManager.html b/app/partials/updateFuelManager/updateFuelManager.html index e5c0b01..738fb35 100644 --- a/app/partials/updateFuelManager/updateFuelManager.html +++ b/app/partials/updateFuelManager/updateFuelManager.html @@ -43,7 +43,7 @@ {{fuelPricing.nameavgasrest}}
Are you sure that you want to delete this Tier ?
+Are you sure that you want to delete this Tier?
Are you sure that you want to delete this Tier ?
+Are you sure that you want to delete this Tier?
Are you sure that you want to delete this Margin Template ?
+Are you sure that you want to delete this Margin Template?
Are you sure that you want to delete this Margin Template ?
+Are you sure that you want to delete this Margin Template?