Commit 6275a96f0a42263b8eeaaa57cfdc80760359cd62
1 parent
8670c59059
Exists in
master
s
Showing
3 changed files
with
31 additions
and
2 deletions
Show diff stats
app/partials/dashboard/dashboard.controller.js
... | ... | @@ -13,9 +13,16 @@ |
13 | 13 | $state.reload(); |
14 | 14 | } |
15 | 15 | |
16 | + $scope.marginList = {} | |
17 | + dashboardService.getMargin().then(function(result) { | |
18 | + $scope.marginList = result; | |
19 | + console.log("Margin result", result) | |
20 | + }) | |
21 | + | |
16 | 22 | $scope.newFuelPricing = {}; |
17 | 23 | dashboardService.getFuelPricingNew().then(function(result) { |
18 | 24 | $scope.newFuelPricing = result; |
25 | + console.log("Fuel Pricing result", result) | |
19 | 26 | for (var i = 0; i<$scope.newFuelPricing.length; i++) { |
20 | 27 | if ($scope.newFuelPricing[i].fuelPricing != null) { |
21 | 28 | if ($scope.newFuelPricing[i].fuelPricing.expirationDate != null && $scope.newFuelPricing[i].fuelPricing.expirationDate != '') { |
... | ... | @@ -49,6 +56,7 @@ |
49 | 56 | } |
50 | 57 | $scope.showLoader = false; |
51 | 58 | }) |
59 | + | |
52 | 60 | |
53 | 61 | $scope.updateFuelPricing = {}; |
54 | 62 | $scope.updateFuelPricing.fuelPricingList = []; |
... | ... | @@ -94,6 +102,11 @@ |
94 | 102 | } |
95 | 103 | |
96 | 104 | } |
105 | + | |
106 | + | |
107 | + | |
108 | + | |
109 | + console.log('result',$scope.marginList) | |
97 | 110 | dashboardService.updateFuelPricing($scope.updateFuelPricing).then(function(result) { |
98 | 111 | toastr.success('Successfully Updated', { |
99 | 112 | closeButton: true | ... | ... |
app/partials/dashboard/dashboard.html
... | ... | @@ -140,12 +140,12 @@ |
140 | 140 | <div class="widget-header"> |
141 | 141 | <i class="fa fa-pencil"></i> |
142 | 142 | <h3>Price Manager</h3> |
143 | - <!-- <select style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="form-control" ng-model="sendEmail.pricing" ng-change="confirmMail()"> | |
143 | + <select style="float: right; margin: 7px 10px; width: 150px; height: 26px; padding: 0 0;" class="form-control" ng-model="sendEmail.pricing" ng-change="confirmMail()"> | |
144 | 144 | <option value="" disabled selected="selected">Send Pricing Email</option> |
145 | 145 | <option ng-repeat="margins in marginList" value="{{margins.id}}">{{margins.marginName}}</option> |
146 | 146 | <option disabled>_______________</option> |
147 | 147 | <option value="all">Distribute All</option> |
148 | - </select> --> | |
148 | + </select> | |
149 | 149 | </div> |
150 | 150 | <!-- /widget-header --> |
151 | 151 | <div class="widget-content"> | ... | ... |
app/partials/dashboard/dashboard.service.js
... | ... | @@ -22,6 +22,22 @@ |
22 | 22 | return deferred.promise; |
23 | 23 | } |
24 | 24 | |
25 | + this.getMargin = function() { | |
26 | + | |
27 | + var deferred = $q.defer(); | |
28 | + $http({ | |
29 | + method : 'GET', | |
30 | + url : BASE_URL.url +'/user/margins', | |
31 | + headers : {'Content-Type': 'application/json'}, | |
32 | + }) | |
33 | + .then(function (result){ | |
34 | + deferred.resolve(result.data); | |
35 | + },function (result){ | |
36 | + deferred.resolve(result.data); | |
37 | + }) | |
38 | + return deferred.promise; | |
39 | + } | |
40 | + | |
25 | 41 | this.getFuelPricingNew = function() { |
26 | 42 | |
27 | 43 | var deferred = $q.defer(); | ... | ... |