From 6275a96f0a42263b8eeaaa57cfdc80760359cd62 Mon Sep 17 00:00:00 2001 From: Jaideep Singh Date: Thu, 8 Jun 2017 18:54:23 +0530 Subject: [PATCH] s --- app/partials/dashboard/dashboard.controller.js | 13 +++++++++++++ app/partials/dashboard/dashboard.html | 4 ++-- app/partials/dashboard/dashboard.service.js | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/app/partials/dashboard/dashboard.controller.js b/app/partials/dashboard/dashboard.controller.js index 94061e7..2d47f59 100644 --- a/app/partials/dashboard/dashboard.controller.js +++ b/app/partials/dashboard/dashboard.controller.js @@ -13,9 +13,16 @@ $state.reload(); } + $scope.marginList = {} + dashboardService.getMargin().then(function(result) { + $scope.marginList = result; + console.log("Margin result", result) + }) + $scope.newFuelPricing = {}; dashboardService.getFuelPricingNew().then(function(result) { $scope.newFuelPricing = result; + console.log("Fuel Pricing result", result) for (var i = 0; i<$scope.newFuelPricing.length; i++) { if ($scope.newFuelPricing[i].fuelPricing != null) { if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { @@ -49,6 +56,7 @@ } $scope.showLoader = false; }) + $scope.updateFuelPricing = {}; $scope.updateFuelPricing.fuelPricingList = []; @@ -94,6 +102,11 @@ } } + + + + + console.log('result',$scope.marginList) dashboardService.updateFuelPricing($scope.updateFuelPricing).then(function(result) { toastr.success('Successfully Updated', { closeButton: true diff --git a/app/partials/dashboard/dashboard.html b/app/partials/dashboard/dashboard.html index 6847c8d..f1612d7 100644 --- a/app/partials/dashboard/dashboard.html +++ b/app/partials/dashboard/dashboard.html @@ -140,12 +140,12 @@

Price Manager

- +
diff --git a/app/partials/dashboard/dashboard.service.js b/app/partials/dashboard/dashboard.service.js index 0dd3bb7..f5e6e1e 100644 --- a/app/partials/dashboard/dashboard.service.js +++ b/app/partials/dashboard/dashboard.service.js @@ -22,6 +22,22 @@ return deferred.promise; } + this.getMargin = function() { + + var deferred = $q.defer(); + $http({ + method : 'GET', + url : BASE_URL.url +'/user/margins', + headers : {'Content-Type': 'application/json'}, + }) + .then(function (result){ + deferred.resolve(result.data); + },function (result){ + deferred.resolve(result.data); + }) + return deferred.promise; + } + this.getFuelPricingNew = function() { var deferred = $q.defer(); -- 2.0.0