Commit 28af27a3fe9dfafb2747fc389e3f8141d402eafe

Authored by Rishav
1 parent a4884cfe7c
Exists in master

add fuelPriceapi

app/partials/viewCompany/viewCompany.controller.js
... ... @@ -4,7 +4,7 @@
4 4 //Load controller
5 5 angular.module('acufuel')
6 6  
7   - .controller('viewCompanyController', ['$scope','$uibModal', '$stateParams', 'ViewCompanyService', 'CustomersService', function($scope , $uibModal, $stateParams, ViewCompanyService, CustomersService) {
  7 + .controller('viewCompanyController', ['$scope','$uibModal', '$stateParams', 'ViewCompanyService', 'CustomersService', 'updateFuelManagerService', function($scope , $uibModal, $stateParams, ViewCompanyService, CustomersService, updateFuelManagerService) {
8 8 $scope.data = {};
9 9 $scope.data.priceEmail = true;
10 10 $scope.aircraft = {};
... ... @@ -12,6 +12,7 @@
12 12 $scope.showLoader = false;
13 13 $scope.showLoader = true;
14 14 $scope.showUpdateBtn = false;
  15 + $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId'));
15 16  
16 17 CustomersService.getMargin().then(function(result) {
17 18 $scope.marginList = result;
... ... @@ -357,8 +358,15 @@
357 358 }
358 359 })
359 360 }
360   -
361   -
362 361 }
  362 +
  363 + updateFuelManagerService.getFuelPricing($scope.userProfileId).then(function(result) {
  364 + $scope.fuelPricing = result;
  365 + for (var i = 0; i<$scope.fuelPricing.length; i++) {
  366 + if ($scope.fuelPricing[i].expirationDate != null) {
  367 + $scope.fuelPricing[i].expirationDate = new Date($scope.fuelPricing[i].expirationDate)
  368 + }
  369 + }
  370 + })
363 371  
364 372 }]);
365 373 \ No newline at end of file
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -355,38 +355,13 @@
355 355 </tr>
356 356 </thead>
357 357 <tbody>
358   - <tr>
359   - <td><input type="checkbox"></td>
360   - <td>Jet-A Full Service</td>
361   - <td>$2.123</td>
362   - <td>$23000</td>
363   - <td style="color:#55AF8B;">$3659</td>
364   - <td style="color:#F90">3/15/2017</td>
365   - </tr>
366   - <tr>
  358 + <tr ng-repeat="fuel in fuelPricing">
367 359 <td><input type="checkbox"></td>
368   - <td>Jet-A Full Service</td>
369   - <td>$2.123</td>
370   - <td>$23000</td>
371   - <td style="color:#55AF8B;">$3659</td>
372   - <td style="color:#F90">3/15/2017</td>
373   - </tr>
374   - <tr>
375   - <tr>
376   - <td><input type="checkbox"></td>
377   - <td>Jet-A Full Service</td>
378   - <td>$2.123</td>
379   - <td>$23000</td>
380   - <td style="color:#55AF8B;">$3659</td>
381   - <td style="color:#F90">3/15/2017</td>
382   - </tr>
383   - <tr>
384   - <td><input type="checkbox"></td>
385   - <td>Jet-A Full Service</td>
386   - <td>$2.123</td>
387   - <td>$23000</td>
388   - <td style="color:#55AF8B;">$3659</td>
389   - <td style="color:#F90">3/15/2017</td>
  360 + <td>{{fuel.product.name}}</td>
  361 + <td>${{fuel.cost}}</td>
  362 + <td>${{fuel.papMargin}}</td>
  363 + <td style="color:#55AF8B;">${{fuel.papTotal}}</td>
  364 + <td style="color:#F90">{{fuel.expirationDate}}</td>
390 365 </tr>
391 366 </tbody>
392 367 </table>
... ...