Commit 0f34b879815e734bcc3d4d4f5c96e82c8f5ae921

Authored by Anchit Jindal
1 parent ac6104d510
Exists in master

desing and implementation for fulerlinx fboinsights preffered

app/partials/analytics/analytics.controller.js
... ... @@ -3,289 +3,321 @@ angular.module('acufuel')
3 3 .controller('analyticsController', ['$scope', 'analyticsService', function($scope, analyticsService) {
4 4  
5 5  
6   - // Sand Signika Overview without drill down -KD
7   - /* $scope.getAllRegionalPap = function() {
8   - $scope.flag=true;
9   - $scope.stateList = [{region:'Alabama',code:'AL'},{region:'Alaska',code:'AK'},{region:'Arizona',code:'AZ'},{region:'Arkansas',code:'AR'},
10   - {region:'California',code:'CA' },{region:'Colorado',code:'CO'},{region:'Connecticut',code:'CT'},{region:'Delaware',code:'DE'},
11   - {region:'Florida' ,code:'FL'},{region:'Georgia' ,code:'GA'},{region:'Hawaii' ,code:'HI'},{region:'Idaho' ,code:'ID'},
12   - {region:'Illinois',code:'IL'},{region:'Indiana' ,code:'IN'},{region:'Iowa' ,code:'IA'},{region:'Kansas' ,code:'KS'},
13   - {region:'Kentucky' ,code:'KY'},{region:'Louisiana' ,code:'LA'},{region:'Maine' ,code:'ME'},{region:'Maryland' ,code:'MD'},
14   - {region:'Massachusetts' ,code:'MA'},{region:'Michigan' ,code:'MI'},{region:'Minnesota' ,code:'MN'},
15   - {region:'Mississippi' ,code:'MS'},{region:'Missouri' ,code:'MO'},{region:'Montana',code:'MT'},{region:'Nebraska' ,code:'NE'},
16   - {region:'Nevada' ,code:'NV'},{region:'New Hampshire' ,code:'NH'},{region:'New Jersey' ,code:'NJ'},{region:'New Mexico' ,code:'NM'},
17   - {region:'New York' ,code:'NY'},{region:'North Carolina' ,code:'NC'},{region:'North Dakota' ,code:'ND'},{region:'Ohio' ,code:'OH'},
18   - {region:'Oklahoma' ,code:'OK'},{region:'Oregon' ,code:'OR'},{region:'Pennsylvania',code:'PA'},{region:'Rhode Island' ,code:'RI'},
19   - {region:'South Carolina' ,code:'SC'},{region:'South Dakota' ,code:'SD'},{region:'Tennessee' ,code:'TN'},{region:'Texas' ,code:'TX'},
20   - {region:'Utah' ,code:'UT'},{region:'Vermont' ,code:'VT'},{region:'Virginia' ,code:'VA'},{region:'Washington' ,code:'WA'},
21   - {region:'West Virginia' ,code:'WV'},{region:'Wisconsin' ,code:'WI'},{region:'Wyoming',code:'WY'}]
22   -
23   - analyticsService.getAllRPP().then(function(result) {
24   - for (var i = 0; i < $scope.stateList.length; i++) {
25   - for (var j = 0; j<result.length; j++){
26   - if ($scope.stateList[i].region === result[j].region) {
27   - result[j].code = $scope.stateList[i].code;
28   - result[j].averagePAP = result[j].averagePAP.toFixed(2);
29   - }
30   - }
31   - }
32   - $scope.flag=false;
33   - // Instantiate the map
34   - Highcharts.mapChart('regional-pap', {
35   -
36   - chart: {
37   - map: 'countries/us/us-all',
38   - borderWidth: 1,
39   - },
40   -
41   - title: {
42   - text: 'Regional PAP'
43   - },
44   -
45   - exporting: {
46   - sourceWidth: 600,
47   - sourceHeight: 500
48   - },
49   -
50   - legend: {
51   - layout: 'vertical',
52   - borderWidth: 0,
53   - backgroundColor: 'rgba(255,255,255,0.85)',
54   - floating: true,
55   - width:'12px',
56   - height:'200px',
57   - verticalAlign: 'bottom',
58   - y: 0,
59   - x: -230,
60   - },
61   -
62   - mapNavigation: {
63   - enabled: true
64   - },
  6 + // Sand Signika Overview without drill down -KD
  7 + /* $scope.getAllRegionalPap = function() {
  8 + $scope.flag=true;
  9 + $scope.stateList = [{region:'Alabama',code:'AL'},{region:'Alaska',code:'AK'},{region:'Arizona',code:'AZ'},{region:'Arkansas',code:'AR'},
  10 + {region:'California',code:'CA' },{region:'Colorado',code:'CO'},{region:'Connecticut',code:'CT'},{region:'Delaware',code:'DE'},
  11 + {region:'Florida' ,code:'FL'},{region:'Georgia' ,code:'GA'},{region:'Hawaii' ,code:'HI'},{region:'Idaho' ,code:'ID'},
  12 + {region:'Illinois',code:'IL'},{region:'Indiana' ,code:'IN'},{region:'Iowa' ,code:'IA'},{region:'Kansas' ,code:'KS'},
  13 + {region:'Kentucky' ,code:'KY'},{region:'Louisiana' ,code:'LA'},{region:'Maine' ,code:'ME'},{region:'Maryland' ,code:'MD'},
  14 + {region:'Massachusetts' ,code:'MA'},{region:'Michigan' ,code:'MI'},{region:'Minnesota' ,code:'MN'},
  15 + {region:'Mississippi' ,code:'MS'},{region:'Missouri' ,code:'MO'},{region:'Montana',code:'MT'},{region:'Nebraska' ,code:'NE'},
  16 + {region:'Nevada' ,code:'NV'},{region:'New Hampshire' ,code:'NH'},{region:'New Jersey' ,code:'NJ'},{region:'New Mexico' ,code:'NM'},
  17 + {region:'New York' ,code:'NY'},{region:'North Carolina' ,code:'NC'},{region:'North Dakota' ,code:'ND'},{region:'Ohio' ,code:'OH'},
  18 + {region:'Oklahoma' ,code:'OK'},{region:'Oregon' ,code:'OR'},{region:'Pennsylvania',code:'PA'},{region:'Rhode Island' ,code:'RI'},
  19 + {region:'South Carolina' ,code:'SC'},{region:'South Dakota' ,code:'SD'},{region:'Tennessee' ,code:'TN'},{region:'Texas' ,code:'TX'},
  20 + {region:'Utah' ,code:'UT'},{region:'Vermont' ,code:'VT'},{region:'Virginia' ,code:'VA'},{region:'Washington' ,code:'WA'},
  21 + {region:'West Virginia' ,code:'WV'},{region:'Wisconsin' ,code:'WI'},{region:'Wyoming',code:'WY'}]
  22 +
  23 + analyticsService.getAllRPP().then(function(result) {
  24 + for (var i = 0; i < $scope.stateList.length; i++) {
  25 + for (var j = 0; j<result.length; j++){
  26 + if ($scope.stateList[i].region === result[j].region) {
  27 + result[j].code = $scope.stateList[i].code;
  28 + result[j].averagePAP = result[j].averagePAP.toFixed(2);
  29 + }
  30 + }
  31 + }
  32 + $scope.flag=false;
  33 + // Instantiate the map
  34 + Highcharts.mapChart('regional-pap', {
  35 +
  36 + chart: {
  37 + map: 'countries/us/us-all',
  38 + borderWidth: 1,
  39 + },
65 40  
66   - colorAxis: {
67   - min: 1,
68   - type: 'logarithmic',
69   - minColor: '#2b908f',
70   - maxColor: '#000022',
71   - stops: [
72   - [0, '#EFEFFF'],
73   - [5, '#f45b5b'],
74   - [10, 'rgb(117,0,0)']
75   - ]
  41 + title: {
  42 + text: 'Regional PAP'
76 43 },
77 44  
78   - series: [{
79   - animation: {
80   - duration: 1000
81   - },
82   - data: result,
83   - joinBy: ['postal-code', 'code'],
84   - dataLabels: {
85   - enabled: true,
86   - color: '#FFFFFF',
87   - format: '{point.code}'
88   - },
89   - name: 'Data' ,
90   - tooltip: {
91   - pointFormat: '{point.region} : {point.averagePAP}'
92   - },
93   - }]
94   - });
95   - })
96   - }
  45 + exporting: {
  46 + sourceWidth: 600,
  47 + sourceHeight: 500
  48 + },
97 49  
98   - $scope.getAllRegionalPap();*/
  50 + legend: {
  51 + layout: 'vertical',
  52 + borderWidth: 0,
  53 + backgroundColor: 'rgba(255,255,255,0.85)',
  54 + floating: true,
  55 + width:'12px',
  56 + height:'200px',
  57 + verticalAlign: 'bottom',
  58 + y: 0,
  59 + x: -230,
  60 + },
99 61  
100   -
101   - //Implemented drill down chart and Now used this on 07 Sep 2018 -KD
  62 + mapNavigation: {
  63 + enabled: true
  64 + },
102 65  
103   - /*
104   - TODO:
105   - - Check data labels after drilling. Label rank? New positions?
106   - */
107   - $scope.getAllRegionalPapDrilldown = function() {
108   - $scope.flag=true;//for spinner
  66 + colorAxis: {
  67 + min: 1,
  68 + type: 'logarithmic',
  69 + minColor: '#2b908f',
  70 + maxColor: '#000022',
  71 + stops: [
  72 + [0, '#EFEFFF'],
  73 + [5, '#f45b5b'],
  74 + [10, 'rgb(117,0,0)']
  75 + ]
  76 + },
  77 +
  78 + series: [{
  79 + animation: {
  80 + duration: 1000
  81 + },
  82 + data: result,
  83 + joinBy: ['postal-code', 'code'],
  84 + dataLabels: {
  85 + enabled: true,
  86 + color: '#FFFFFF',
  87 + format: '{point.code}'
  88 + },
  89 + name: 'Data' ,
  90 + tooltip: {
  91 + pointFormat: '{point.region} : {point.averagePAP}'
  92 + },
  93 + }]
  94 + });
  95 + })
  96 + }
  97 +
  98 + $scope.getAllRegionalPap();*/
  99 +
  100 +
  101 + //Implemented drill down chart and Now used this on 07 Sep 2018 -KD
  102 +
  103 + /*
  104 + TODO:
  105 + - Check data labels after drilling. Label rank? New positions?
  106 + */
  107 + $scope.getAllRegionalPapDrilldown = function() {
  108 + $scope.flag = true; //for spinner
109 109 var data = Highcharts.geojson(Highcharts.maps['countries/us/us-all']);
110   - var separators = Highcharts.geojson(Highcharts.maps['countries/us/us-all'], 'mapline');
111   - // Some responsiveness
112   - //var small = $('#container').width() < 400;
  110 + var separators = Highcharts.geojson(Highcharts.maps['countries/us/us-all'], 'mapline');
  111 + // Some responsiveness
  112 + //var small = $('#container').width() < 400;
113 113  
114 114 analyticsService.getAllRPP().then(function(result) {
115   - for (var i = 0; i < data.length; i++) {
116   - for (var j = 0; j<result.length; j++){
117   - if (data[i].name === result[j].region) {
118   -
119   - data[i].value = result[j].averagePAP.toFixed(2);
120   -
121   - }
122   - }
123   -
124   - }
  115 + for (var i = 0; i < data.length; i++) {
  116 + for (var j = 0; j < result.length; j++) {
  117 + if (data[i].name === result[j].region) {
125 118  
126   - $.each(data, function (i) {
127   - this.drilldown = this.properties['hc-key'];
128   - this.value = this.value;
129   - });
130   -
131   - $scope.flag=false;
132   - // Instantiate the map
133   - Highcharts.mapChart('container', {
134   - chart: {
135   - events: {
136   - drilldown: function (e) {
137   - if (!e.seriesOptions) {
138   - var chart = this,
139   - mapKey = 'countries/us/' + e.point.drilldown + '-all',
140   -
141   - // Handle error, the timeout is cleared on success
142   - fail = setTimeout(function () {
143   - if (!Highcharts.maps[mapKey]) {
144   - chart.showLoading('<i class="icon-frown"></i> Failed loading ' + e.point.name);
145   - fail = setTimeout(function () {
146   - chart.hideLoading();
147   - }, 1000);
148   - }
149   - }, 3000);
150   -
151   - // Show the spinner
152   - chart.showLoading('<i class="icon-spinner icon-spin icon-3x"></i>'); // Font Awesome spinner
153   -
154   - // Load the drilldown map
155   - $.getScript('https://code.highcharts.com/mapdata/' + mapKey + '.js', function () {
  119 + data[i].value = result[j].averagePAP.toFixed(2);
156 120  
157   - var region = e.point.name;
158   - //called the get api region wise
159   - analyticsService.getRPP(region).then(function(result) {
  121 + }
  122 + }
160 123  
161   - console.log("===region====",region,"====result====",result)
162   - data = Highcharts.geojson(Highcharts.maps[mapKey]);
  124 + }
163 125  
164   - for (var i = 0; i < data.length; i++) {
165   - for (var j = 0; j<result.length; j++){
166   -
167   - //delete the County word from api result to match with map data
168   - result[j].region = result[j].region.replace("County","");
  126 + $.each(data, function(i) {
  127 + this.drilldown = this.properties['hc-key'];
  128 + this.value = this.value;
  129 + });
169 130  
170   - if (data[i].name.trim() === result[j].region.trim()) {
171   -
  131 + $scope.flag = false;
  132 + // Instantiate the map
  133 + Highcharts.mapChart('container', {
  134 + chart: {
  135 + events: {
  136 + drilldown: function(e) {
  137 + if (!e.seriesOptions) {
  138 + var chart = this,
  139 + mapKey = 'countries/us/' + e.point.drilldown + '-all',
  140 +
  141 + // Handle error, the timeout is cleared on success
  142 + fail = setTimeout(function() {
  143 + if (!Highcharts.maps[mapKey]) {
  144 + chart.showLoading('<i class="icon-frown"></i> Failed loading ' + e.point.name);
  145 + fail = setTimeout(function() {
  146 + chart.hideLoading();
  147 + }, 10000);
  148 + }
  149 + }, 3000);
  150 +
  151 + // Show the spinner
  152 + chart.showLoading('<i class="icon-spinner icon-spin icon-3x"></i>'); // Font Awesome spinner
  153 +
  154 + // Load the drilldown map
  155 + var region = e.point.name;
  156 + analyticsService.getRPP(region).then(function(result) {
  157 + $.getScript('https://code.highcharts.com/mapdata/' + mapKey + '.js', function() {
  158 + //called the get api region wise
  159 + data = Highcharts.geojson(Highcharts.maps[mapKey]);
  160 + for (var i = 0; i < data.length; i++) {
  161 + for (var j = 0; j < result.length; j++) {
  162 +
  163 + //delete the County word from api result to match with map data
  164 + result[j].region = result[j].region.replace("County", "");
  165 +
  166 + if (data[i].name.trim() === result[j].region.trim()) {
  167 +
172 168 data[i].value = result[j].averagePAP.toFixed(2);
173   -
174   - }
175   - }
176   -
177   - }
178   - })
179   -
180   - // Set a non-random bogus value
181   -
182   - $.each(data, function (i) {
183   - this.value = this.value;
184   - });
185   -
186   - // Hide loading and add series
187   - chart.hideLoading();
188   - clearTimeout(fail);
189   - chart.addSeriesAsDrilldown(e.point, {
190   - name: e.point.name,
191   - data: data,
192   - dataLabels: {
193   - enabled: true,
194   - format: '{point.name}'
195   - }
196   - });
  169 +
  170 + }
  171 + }
  172 +
  173 + }
  174 + // Set a non-random bogus value
  175 + $.each(data, function(i) {
  176 + this.value = this.value;
  177 + });
  178 + // Hide loading and add series
  179 + chart.hideLoading();
  180 + clearTimeout(fail);
  181 + chart.addSeriesAsDrilldown(e.point, {
  182 + name: e.point.name,
  183 + data: data,
  184 + dataLabels: {
  185 + enabled: true,
  186 + format: '{point.name}'
  187 + }
  188 + });
  189 + });
  190 + })
  191 + }
  192 +
  193 + this.setTitle(null, {
  194 + text: e.point.name
  195 + });
  196 + },
  197 + drillup: function() {
  198 + this.setTitle(null, {
  199 + text: ''
197 200 });
198 201 }
199   -
200   - this.setTitle(null, { text: e.point.name });
201   - },
202   - drillup: function () {
203   - this.setTitle(null, { text: '' });
204 202 }
205   - }
206   - },
207   -
208   - title: {
209   - text: 'USA Map-Drilldown for Regional Pricing'
210   - },
211   -
212   - subtitle: {
213   - text: '',
214   - floating: true,
215   - align: 'right',
216   - y: 50,
217   - style: {
218   - fontSize: '16px'
219   - }
220   - },
221   -
222   - /* legend: small ? {} : {
223   - layout: 'vertical',
224   - align: 'right',
225   - verticalAlign: 'middle'
226   - },
227   -
228   - colorAxis: {
229   - min: 0,
230   - minColor: '#E6E7E8',
231   - maxColor: '#005645'
232   - },*/
233   -
234   - mapNavigation: {
235   - enabled: true,
236   - buttonOptions: {
237   - verticalAlign: 'bottom'
238   - }
239   - },
  203 + },
240 204  
241   - plotOptions: {
242   - map: {
243   - states: {
244   - hover: {
245   - color: '#EEDD66'
246   - }
  205 + title: {
  206 + text: 'USA Map-Drilldown for Regional Pricing'
  207 + },
  208 +
  209 + subtitle: {
  210 + text: '',
  211 + floating: true,
  212 + align: 'right',
  213 + y: 50,
  214 + style: {
  215 + fontSize: '16px'
247 216 }
248   - }
249   - },
  217 + },
  218 +
  219 + /* legend: small ? {} : {
  220 + layout: 'vertical',
  221 + align: 'right',
  222 + verticalAlign: 'middle'
  223 + },
  224 +
  225 + colorAxis: {
  226 + min: 0,
  227 + minColor: '#E6E7E8',
  228 + maxColor: '#005645'
  229 + },*/
250 230  
251   - series: [{
252   - data: data,
253   - name: 'USA',
254   - dataLabels: {
  231 + mapNavigation: {
255 232 enabled: true,
256   - format: '{point.properties.postal-code}'
257   - }
258   - }, {
259   - type: 'mapline',
260   - data: separators,
261   - color: 'silver',
262   - enableMouseTracking: false,
263   - animation: {
264   - duration: 500
265   - }
266   - }],
  233 + buttonOptions: {
  234 + verticalAlign: 'bottom'
  235 + }
  236 + },
267 237  
268   - drilldown: {
269   - activeDataLabelStyle: {
270   - color: '#FFFFFF',
271   - textDecoration: 'none',
272   - textOutline: '1px #000000'
  238 + plotOptions: {
  239 + map: {
  240 + states: {
  241 + hover: {
  242 + color: '#EEDD66'
  243 + }
  244 + }
  245 + }
273 246 },
274   - drillUpButton: {
275   - relativeTo: 'spacingBox',
276   - position: {
277   - x: 0,
278   - y: 60
  247 +
  248 + series: [{
  249 + data: data,
  250 + name: 'USA',
  251 + dataLabels: {
  252 + enabled: true,
  253 + format: '{point.properties.postal-code}'
  254 + }
  255 + }, {
  256 + type: 'mapline',
  257 + data: separators,
  258 + color: 'silver',
  259 + enableMouseTracking: false,
  260 + animation: {
  261 + duration: 500
  262 + }
  263 + }],
  264 +
  265 + drilldown: {
  266 + activeDataLabelStyle: {
  267 + color: '#FFFFFF',
  268 + textDecoration: 'none',
  269 + textOutline: '1px #000000'
  270 + },
  271 + drillUpButton: {
  272 + relativeTo: 'spacingBox',
  273 + position: {
  274 + x: 0,
  275 + y: 60
  276 + }
279 277 }
280 278 }
281   - }
  279 + });
  280 + })
  281 + }
  282 +
  283 + $scope.getAllRegionalPapDrilldown();
  284 +
  285 +
  286 + /*$(document).ready(function() {
  287 + $(function() {
  288 + jQuery('#map').vectorMap({
  289 + map: 'us_lcc',
  290 + backgroundColor: '#ffce99',
  291 + color: '#dfdfdd',
  292 + hoverOpacity: 0,
  293 + selectedColor: '#5f8b98',
  294 + hoverColor: '#5f8b98',
  295 + enableZoom: true,
  296 + showTooltip: true,
  297 + scaleColors: ['#dfdfdd'],
  298 + //values: sample_data
  299 + onRegionClick: function(event, code) {
  300 + var map = $('#map').vectorMap('get', 'mapObject');
  301 + var name = map.getRegionName(code);
  302 + getRegionPap(name);
  303 + },
  304 + normalizeFunction: 'polynomial'
  305 + });
282 306 });
283 307 })
284   - }
285 308  
286   - $scope.getAllRegionalPapDrilldown();
287 309  
288   -
  310 +
  311 + function getRegionPap(code) {
  312 + $scope.showLoader = true;
  313 + analyticsService.getRPP(code).then(function(result) {
  314 + $scope.rppData = result;
  315 + $scope.showLoader = false;
  316 + $('#popup1').css('display', 'block');
  317 + })
  318 + }*/
  319 +
  320 +
289 321 $scope.cancelStatus = function() {
290 322 $('#popup1').css('display', 'none');
291 323 }
... ... @@ -312,7 +344,6 @@ angular.module(&#39;acufuel&#39;)
312 344 chart: {
313 345 type: 'multiBarChart',
314 346 height: 450,
315   - reduceXTicks: false,
316 347 margin: {
317 348 top: 45,
318 349 right: 20,
... ... @@ -323,8 +354,7 @@ angular.module(&#39;acufuel&#39;)
323 354 //staggerLabels: true,
324 355 duration: 500,
325 356 stacked: false,
326   - /*color: ["#FEDFC3", "#990000", "#000099", "#009900"],*/
327   - color: ["#A9A9A9", "#000099", "#990000", "#009900"],
  357 + color: ["#FEDFC3", "#990000", "#000099", "#009900"],
328 358 xAxis: {
329 359 axisLabel: 'Months',
330 360 showMaxMin: false,
... ... @@ -336,7 +366,6 @@ angular.module(&#39;acufuel&#39;)
336 366 return d3.format(',.1f')(d);
337 367 }
338 368 }
339   -
340 369 }
341 370 };
342 371 $scope.datamfs = $scope.mfsValues;
... ... @@ -349,7 +378,6 @@ angular.module(&#39;acufuel&#39;)
349 378 $scope.getCS = function() {
350 379 //var makeId = makeId;
351 380 analyticsService.getCS().then(function(result) {
352   - //console.log("===customersupports===",result)
353 381 $scope.csValues = result;
354 382 $scope.optionscs = {
355 383 chart: {
... ... @@ -387,203 +415,122 @@ angular.module(&#39;acufuel&#39;)
387 415 $scope.getCS();
388 416  
389 417  
390   - $scope.hfpValuesOne = {};
391   - $scope.hfpValuesOne.key = "JET-A Full Service";
392   - $scope.hfpValuesOne.values = [];
393   -
394   - $scope.hfpValuesTwo = {};
395   - $scope.hfpValuesTwo.key = "100LL Full Service";
396   - $scope.hfpValuesTwo.values = [];
397   -
398   - $scope.hfpFinalData = [];
399   -
  418 + $scope.hfpValues = [];
400 419 $scope.getHfpChartData = function() {
  420 + //var makeId = makeId;
401 421 analyticsService.gethfpChart().then(function(result) {
402   - for(var i=0; i<result.length; i++) {
403   - if(result[i].includes("JET-A Full Service") ){
404   - let datePusha = result[i][0];
405   - let tempValue = result[i][1].toFixed(2);
406   - let valePusha = parseFloat(tempValue);
407   - $scope.hfpValuesOne.values.push([datePusha, valePusha])
408   - }else if(result[i].includes("100LL Full Service") ) {
409   - let datePushb = result[i][0];
410   - let tempvalePushb = result[i][1].toFixed(2);
411   - let valePushb = parseFloat(tempvalePushb);
412   - $scope.hfpValuesTwo.values.push([datePushb, valePushb])
413   - }
414   - }
415   - $scope.hfpFinalData.push($scope.hfpValuesOne, $scope.hfpValuesTwo);
416   - // console.log('$scope.hfpFinalData', $scope.hfpFinalData);
417   -
418   - var chart = nv.models.lineChart()
419   - .x(function(d) { return d[0] })
420   - //adjusting, 100% is 1.00, not 100 as it is in the data
421   - .y(function(d) { return d[1]})
422   - .color(d3.scale.category10().range())
423   - .useInteractiveGuideline(true)
424   - ;
425   -
426   - chart.xAxis
427   - .tickFormat(function(d) {
428   - return d3.time.format('%x')(new Date(d))
429   - });
430   -
431   - chart.yAxis
432   - .axisLabel("PaP / Retail Price")
433   - .axisLabelDistance(-5)
434   - .tickFormat(d3.format(',.2f')).showMaxMin(false);
435   -
436   - d3.select('#chart svg')
437   - .datum($scope.hfpFinalData)
438   - .transition().duration(500)
439   - .call(chart)
440   - ;
441   -
442   - nv.utils.windowResize(chart.update);
443   -
444   - return chart;
445   - });
446   - }
447   - $scope.getHfpChartData();
  422 + $scope.hfpValues = result;
  423 + //console.log('---kd result--',$scope.hfpValues);
448 424  
449   - /*Date Range Filter for Historic fuel Price*/
450   - $scope.submitDateHfp = function() {
  425 + /*Historic Fuel Price */
  426 +
  427 + $scope.optionshfp = {
  428 + chart: {
  429 + type: 'cumulativeLineChart',
  430 + height: 450,
  431 + margin: {
  432 + top: 40,
  433 + right: 20,
  434 + bottom: 50,
  435 + left: 65
  436 + },
  437 + x: function(d) {
  438 + return d[0];
  439 + },
  440 + y: function(d) {
  441 + return d[1] / 100;
  442 + },
  443 + average: function(d) {
  444 + return d.mean / 100;
  445 + },
  446 +
  447 + color: ["#FEDFC3"],
  448 + duration: 300,
  449 + useInteractiveGuideline: true,
  450 + clipVoronoi: false,
  451 +
  452 + xAxis: {
  453 + axisLabel: '',
  454 +
  455 + tickFormat: function(d) {
  456 + return d3.time.format('%m/%d/%y')(new Date(d))
  457 + //return d3.time.format('%b \-%y')(new Date(d))
  458 + },
  459 + showMaxMin: false,
  460 + staggerLabels: true
  461 + },
451 462  
452   - $scope.hfpValuesFirst = {};
453   - $scope.hfpValuesFirst.key = "JET-A Full Service";
454   - $scope.hfpValuesFirst.values = [];
  463 + yAxis: {
  464 + axisLabel: 'PaP/Retail Price',
455 465  
456   - $scope.hfpValuesSecond = {};
457   - $scope.hfpValuesSecond.key = "100LL Full Service";
458   - $scope.hfpValuesSecond.values = [];
  466 + tickFormat: function(d) {
  467 + //return d3.format('')(d).toFixed(2);
  468 + return '$ ' + d.toFixed(2)
  469 + },
  470 + axisLabelDistance: 5
  471 + }
  472 + }
  473 + };
  474 + $scope.datahfp = [{
  475 + key: "Long",
  476 + values: $scope.hfpValues,
  477 + mean: 0
  478 + }];
459 479  
460   - $scope.hfpRangeData = [];
  480 + })
  481 + }
461 482  
462   - if ($scope.hfp.fromDate === undefined) {
  483 + $scope.getHfpChartData();
463 484  
  485 +
  486 + /*Date Range Filter for Monthly fuel Sales*/
  487 + $scope.submitDate = function() {
  488 + if ($scope.drf.fromDate === undefined) {
464 489 $scope.fillForm = true;
465   - } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate === undefined || $scope.hfp.toDate === '') {
  490 + } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate === undefined || $scope.drf.toDate === '') {
466 491 $scope.fillForm = false;
467 492 var today = new Date();
468   - var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2) + " " + '23:59:59';
  493 + var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2);
469 494 //from date format
470   - $scope.dat1 = $scope.hfp.fromDate;
  495 + $scope.dat1 = $scope.drf.fromDate;
471 496 $scope.fd1 = $scope.dat1.split("/").reverse();
472 497 $scope.tmp = $scope.fd1[2];
473 498 $scope.fd1[2] = $scope.fd1[1];
474 499 $scope.fd1[1] = $scope.tmp;
475 500 $scope.fd = $scope.fd1.join("-");
476   - // console.log("===date====",$scope.fd,"===dad====",DefaultToDate)
477   - analyticsService.getDRFHfpChart($scope.fd, DefaultToDate).then(function(result) {
478   - // console.log("===date range===",$scope.fd,DefaultToDate)
479   - for(var i=0; i<result.length; i++) {
480   - if(result[i].includes("JET-A Full Service") ){
481   - let datePusha = result[i][0];
482   - let tempValue = result[i][1].toFixed(2);
483   - let valePusha = parseFloat(tempValue);
484   - $scope.hfpValuesFirst.values.push([datePusha, valePusha])
485   - }else if(result[i].includes("100LL Full Service") ) {
486   - let datePushb = result[i][0];
487   - let tempvalePushb = result[i][1].toFixed(2);
488   - let valePushb = parseFloat(tempvalePushb);
489   - $scope.hfpValuesSecond.values.push([datePushb, valePushb])
490   - }
491   - }
492   - $scope.hfpRangeData.push($scope.hfpValuesFirst, $scope.hfpValuesSecond);
493   - //console.log('$scope.hfpRangeData', $scope.hfpRangeData);
494   -
495   - var chart = nv.models.lineChart()
496   - .x(function(d) { if(d.length >0){return d[0]}})
497   - //adjusting, 100% is 1.00, not 100 as it is in the data
498   - .y(function(d) { return d[1]})
499   - .color(d3.scale.category10().range())
500   - .useInteractiveGuideline(true)
501   - ;
502   -
503   - chart.xAxis
504   - .tickFormat(function(d) {
505   - return d3.time.format('%x')(new Date(d))
506   - });
507   -
508   - chart.yAxis
509   - .axisLabel("PaP / Retail Price")
510   - .axisLabelDistance(-5)
511   - .tickFormat(d3.format(',.2f')).showMaxMin(false);
512   -
513   - d3.select('#chart svg')
514   - .datum($scope.hfpRangeData)
515   - .transition().duration(500)
516   - .call(chart)
517   - ;
518   -
519   - nv.utils.windowResize(chart.update);
520   -
521   - return chart;
  501 + analyticsService.getDRFChart($scope.fd, DefaultToDate).then(function(result) {
  502 + $scope.datamfs = [];
  503 + $scope.datamfs = result;
522 504 })
523 505  
524   -
525   - } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate != undefined) {
  506 + analyticsService.orderCostAndCountByDate($scope.fd, DefaultToDate).then(function(result) {
  507 + $scope.ordersCost = result.cost;
  508 + $scope.ordersCount = result.count;
  509 + })
  510 + } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate != undefined) {
526 511 $scope.fillForm = false;
527 512 //from date format
528   - $scope.dat1 = $scope.hfp.fromDate;
  513 + $scope.dat1 = $scope.drf.fromDate;
529 514 $scope.fd1 = $scope.dat1.split("/").reverse();
530 515 $scope.tmp = $scope.fd1[2];
531 516 $scope.fd1[2] = $scope.fd1[1];
532 517 $scope.fd1[1] = $scope.tmp;
533 518 $scope.fd = $scope.fd1.join("-");
534   - //to date format
535   - $scope.dat2 = $scope.hfp.toDate;
  519 + $scope.dat2 = $scope.drf.toDate;
536 520 $scope.td1 = $scope.dat2.split("/").reverse();
537 521 $scope.tmp1 = $scope.td1[2];
538 522 $scope.td1[2] = $scope.td1[1];
539 523 $scope.td1[1] = $scope.tmp1;
540   - $scope.td = $scope.td1.join("-") + " " + '23:59:59';
541   - // console.log("===both dates==",$scope.td)
542   - analyticsService.getDRFHfpChart($scope.fd, $scope.td).then(function(result) {
543   - //console.log("===date range22===",result);
544   - for(var i=0; i<result.length; i++) {
545   - if(result[i].includes("JET-A Full Service") ){
546   - let datePusha = result[i][0];
547   - let tempValue = result[i][1].toFixed(2);
548   - let valePusha = parseFloat(tempValue);
549   - $scope.hfpValuesFirst.values.push([datePusha, valePusha])
550   - }else if(result[i].includes("100LL Full Service") ) {
551   - let datePushb = result[i][0];
552   - let tempvalePushb = result[i][1].toFixed(2);
553   - let valePushb = parseFloat(tempvalePushb);
554   - $scope.hfpValuesSecond.values.push([datePushb, valePushb])
555   - }
556   - }
557   - $scope.hfpRangeData.push($scope.hfpValuesFirst, $scope.hfpValuesSecond);
558   - // console.log('$scope.hfpRangeData', $scope.hfpRangeData);
559   -
560   - var chart = nv.models.lineChart()
561   - .x(function(d) { if(d.length >0){return d[0] }})
562   - //adjusting, 100% is 1.00, not 100 as it is in the data
563   - .y(function(d) { return d[1]})
564   - .color(d3.scale.category10().range())
565   - .useInteractiveGuideline(true)
566   - ;
567   -
568   - chart.xAxis
569   - .tickFormat(function(d) {
570   - return d3.time.format('%x')(new Date(d))
571   - });
572   -
573   - chart.yAxis
574   - .axisLabel("PaP / Retail Price")
575   - .axisLabelDistance(-5)
576   - .tickFormat(d3.format(',.2f')).showMaxMin(false);
577   -
578   - d3.select('#chart svg')
579   - .datum($scope.hfpRangeData)
580   - .transition().duration(500)
581   - .call(chart)
582   - ;
583   -
584   - nv.utils.windowResize(chart.update);
585   -
586   - return chart;
  524 + $scope.td = $scope.td1.join("-");
  525 +
  526 + analyticsService.getDRFChart($scope.fd, $scope.td).then(function(result) {
  527 + $scope.datamfs = [];
  528 + $scope.datamfs = result;
  529 + })
  530 +
  531 + analyticsService.orderCostAndCountByDate($scope.fd, $scope.td).then(function(result) {
  532 + $scope.ordersCost = result.cost;
  533 + $scope.ordersCount = result.count;
587 534 })
588 535  
589 536 } else {
... ... @@ -593,55 +540,152 @@ angular.module(&#39;acufuel&#39;)
593 540  
594 541 }
595 542  
596   -
597   - /*Date Range Filter for Monthly fuel Sales*/
598   - $scope.submitDate = function() {
599   - if ($scope.drf.fromDate === undefined) {
  543 + /*Date Range Filter for Historic fuel Price*/
  544 + $scope.submitDateHfp = function() {
  545 +
  546 + if ($scope.hfp.fromDate === undefined) {
  547 +
600 548 $scope.fillForm = true;
601   - } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate === undefined || $scope.drf.toDate === '') {
  549 + } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate === undefined || $scope.hfp.toDate === '') {
602 550 $scope.fillForm = false;
603 551 var today = new Date();
604 552 var DefaultToDate = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2) + '-' + ("0" + today.getDate()).slice(-2);
605 553 //from date format
606   - $scope.dat1 = $scope.drf.fromDate;
  554 + $scope.dat1 = $scope.hfp.fromDate;
607 555 $scope.fd1 = $scope.dat1.split("/").reverse();
608 556 $scope.tmp = $scope.fd1[2];
609 557 $scope.fd1[2] = $scope.fd1[1];
610 558 $scope.fd1[1] = $scope.tmp;
611 559 $scope.fd = $scope.fd1.join("-");
612   - analyticsService.getDRFChart($scope.fd, DefaultToDate).then(function(result) {
613   - $scope.datamfs = [];
614   - $scope.datamfs = result;
615   - })
616   -
617   - analyticsService.orderCostAndCountByDate($scope.fd, DefaultToDate).then(function(result) {
618   - $scope.ordersCost = result.cost;
619   - $scope.ordersCount = result.count;
  560 + analyticsService.getDRFHfpChart($scope.fd, DefaultToDate).then(function(result) {
  561 + $scope.hfpValues = result;
  562 + $scope.optionshfp = {
  563 + chart: {
  564 + type: 'cumulativeLineChart',
  565 + height: 450,
  566 + margin: {
  567 + top: 40,
  568 + right: 20,
  569 + bottom: 50,
  570 + left: 65
  571 + },
  572 + x: function(d) {
  573 + return d[0];
  574 + },
  575 + y: function(d) {
  576 + return d[1] / 100;
  577 + },
  578 + average: function(d) {
  579 + return d.mean / 100;
  580 + },
  581 +
  582 + color: ["#FEDFC3"],
  583 + duration: 300,
  584 + useInteractiveGuideline: true,
  585 + clipVoronoi: false,
  586 +
  587 + xAxis: {
  588 + axisLabel: '',
  589 +
  590 + tickFormat: function(d) {
  591 + return d3.time.format('%d / %m / %y')(new Date(d))
  592 + // return d3.time.format('%b \-%y')(new Date(d))
  593 + },
  594 + showMaxMin: false,
  595 + staggerLabels: true
  596 + },
  597 +
  598 + yAxis: {
  599 + axisLabel: 'PaP/Retail Price',
  600 +
  601 + tickFormat: function(d) {
  602 + //return d3.format('')(d).toFixed(2);
  603 + return '$ ' + d.toFixed(2)
  604 + },
  605 + axisLabelDistance: 5
  606 + }
  607 + }
  608 + };
  609 + $scope.datahfp = [{
  610 + key: "Long",
  611 + values: $scope.hfpValues,
  612 + mean: 0
  613 + }];
620 614 })
621   - } else if ($scope.drf.fromDate != undefined && $scope.drf.toDate != undefined) {
  615 +
  616 +
  617 + } else if ($scope.hfp.fromDate != undefined && $scope.hfp.toDate != undefined) {
622 618 $scope.fillForm = false;
623 619 //from date format
624   - $scope.dat1 = $scope.drf.fromDate;
  620 + $scope.dat1 = $scope.hfp.fromDate;
625 621 $scope.fd1 = $scope.dat1.split("/").reverse();
626 622 $scope.tmp = $scope.fd1[2];
627 623 $scope.fd1[2] = $scope.fd1[1];
628 624 $scope.fd1[1] = $scope.tmp;
629 625 $scope.fd = $scope.fd1.join("-");
630   - $scope.dat2 = $scope.drf.toDate;
  626 + //to date format
  627 + $scope.dat2 = $scope.hfp.toDate;
631 628 $scope.td1 = $scope.dat2.split("/").reverse();
632 629 $scope.tmp1 = $scope.td1[2];
633 630 $scope.td1[2] = $scope.td1[1];
634 631 $scope.td1[1] = $scope.tmp1;
635 632 $scope.td = $scope.td1.join("-");
636 633  
637   - analyticsService.getDRFChart($scope.fd, $scope.td).then(function(result) {
638   - $scope.datamfs = [];
639   - $scope.datamfs = result;
640   - })
641   -
642   - analyticsService.orderCostAndCountByDate($scope.fd, $scope.td).then(function(result) {
643   - $scope.ordersCost = result.cost;
644   - $scope.ordersCount = result.count;
  634 + analyticsService.getDRFHfpChart($scope.fd, $scope.td).then(function(result) {
  635 + console.log("===DRF HPF====", result)
  636 + $scope.hfpValues = result;
  637 + $scope.optionshfp = {
  638 + chart: {
  639 + type: 'cumulativeLineChart',
  640 + height: 450,
  641 + margin: {
  642 + top: 40,
  643 + right: 20,
  644 + bottom: 50,
  645 + left: 65
  646 + },
  647 + x: function(d) {
  648 + return d[0];
  649 + },
  650 + y: function(d) {
  651 + return d[1] / 100;
  652 + },
  653 + average: function(d) {
  654 + return d.mean / 100;
  655 + },
  656 +
  657 + color: ["#FEDFC3"],
  658 + duration: 300,
  659 + useInteractiveGuideline: true,
  660 + clipVoronoi: false,
  661 +
  662 + xAxis: {
  663 + axisLabel: '',
  664 +
  665 + tickFormat: function(d) {
  666 + return d3.time.format('%d / %m / %y')(new Date(d))
  667 + //return d3.time.format('%b \-%y')(new Date(d))
  668 + },
  669 + showMaxMin: false,
  670 + staggerLabels: true
  671 + },
  672 +
  673 + yAxis: {
  674 + axisLabel: 'PaP/Retail Price',
  675 +
  676 + tickFormat: function(d) {
  677 + //return d3.format('')(d).toFixed(2);
  678 + return '$ ' + d.toFixed(2)
  679 + },
  680 + axisLabelDistance: 5
  681 + }
  682 + }
  683 + };
  684 + $scope.datahfp = [{
  685 + key: "Long",
  686 + values: $scope.hfpValues,
  687 + mean: 0
  688 + }];
645 689 })
646 690  
647 691 } else {
... ... @@ -651,9 +695,6 @@ angular.module(&#39;acufuel&#39;)
651 695  
652 696 }
653 697  
654   -
655   -
656   -
657 698 /*Date Range Filter for Customer Sources*/
658 699 $scope.submitDateCs = function() {
659 700 if ($scope.cs.fromDate === undefined) {
... ...
app/partials/analytics/analytics.service.js
... ... @@ -56,26 +56,11 @@
56 56 }
57 57  
58 58 /* With region Code */
59   - /*this.getRPP = function(code){
60   - var deferred = $q.defer();
61   - $http({
62   - method : 'GET',
63   - url : BASE_URL.url +'/fuelerlinx/getAircrafts/'+code
64   - })
65   - .then(function (result){
66   - deferred.resolve(result.data);
67   - },function (result){
68   - console.log(result)
69   - deferred.resolve(result.data);
70   - })
71   - return deferred.promise;
72   - }*/
73   -
74 59 this.getRPP = function(code){
75 60 var deferred = $q.defer();
76 61 $http({
77 62 method : 'GET',
78   - url : BASE_URL.url +'/fuelerlinx/getCompleteRegionalPap/'+code
  63 + url : BASE_URL.url +'/fuelerlinx/getAircrafts/'+code
79 64 })
80 65 .then(function (result){
81 66 deferred.resolve(result.data);
... ... @@ -85,6 +70,21 @@
85 70 })
86 71 return deferred.promise;
87 72 }
  73 +
  74 + // this.getRPP = function(code){
  75 + // var deferred = $q.defer();
  76 + // $http({
  77 + // method : 'GET',
  78 + // url : BASE_URL.url +'/fuelerlinx/getCompleteRegionalPap/'+code
  79 + // })
  80 + // .then(function (result){
  81 + // deferred.resolve(result.data);
  82 + // },function (result){
  83 + // console.log(result)
  84 + // deferred.resolve(result.data);
  85 + // })
  86 + // return deferred.promise;
  87 + // }
88 88  
89 89  
90 90 /* without region code */
... ...
app/partials/customers/customers.html
... ... @@ -105,7 +105,7 @@
105 105 <table ng-table="displayCompanyList" class="table table-striped table-condensed" show-filter="true">
106 106 <tr style="text-align: center;" ng-repeat="row in $data | filter:searchText:strict"" style="cursor: pointer;">
107 107 <td style="text-align: left;" data-title="'Company Name'" filter="{companyName: 'text'}" sortable="'companyName'" ui-sref="app.viewCompany({id : row.id})">
108   - {{row.companyName}}
  108 + <i class="fa fa-search-plus" style="color:red" ng-if="row.fboPreferred == true"></i> {{row.companyName}}
109 109 </td>
110 110 <td data-title="'Fleet'" filter="{companyAircraftSize: 'text'}" sortable="'companyAircraftSize'" ui-sref="app.viewCompany({id : row.id})">
111 111 {{row.companyAircraftSize}}
... ...
app/partials/viewCompany/viewCompany.controller.js
... ... @@ -149,6 +149,7 @@ angular.module(&#39;acufuel&#39;)
149 149 $scope.multipleMsg = false;
150 150 $scope.companyData.masterMargin = "";
151 151 $scope.isGlobal = false;
  152 + $scope.fboPreffered = false;
152 153 getCompanyDetail();
153 154  
154 155 function getCompanyDetail() {
... ... @@ -157,6 +158,7 @@ angular.module(&#39;acufuel&#39;)
157 158 console.log("===getCompanyDetail====",result)
158 159 $scope.companyData = result;
159 160 $scope.isGlobal = result.global;
  161 + $scope.fboPreffered = result.fboPreferred;
160 162 if (result.global == true) {
161 163 $scope.companyData.global = true;
162 164 }
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -129,7 +129,7 @@
129 129 <div class="widget">
130 130 <div class="widget-header">
131 131 <i class="fa fa-building-o" aria-hidden="true"></i>
132   - <h3>{{companyData.companyName}} <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteComp(companyData.id)" aria-hidden="true"></i></h3>
  132 + <h3>{{companyData.companyName}} <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteComp(companyData.id)" aria-hidden="true" ng-show="!fboPreffered"></i></h3>
133 133 <i class="fa fa-times timess" ui-sref="app.customers" aria-hidden="true"></i>
134 134 </div>
135 135 <!-- /widget-header -->
... ... @@ -234,7 +234,7 @@
234 234 <div class="row" style="margin-left:0px;">
235 235 <div class="col-md-7" style="padding-left: 0;">
236 236 <h4 ng-show="showCompanyName">
237   - <b style="color:#F90;">{{companyData.companyName}}</b> &nbsp;<i class="fa fa-pencil-square-o" ng-click="company()" style="font-size: 14px;" aria-hidden="true"></i>
  237 + <b style="color:#F90;">{{companyData.companyName}}</b> &nbsp;<i class="fa fa-pencil-square-o" ng-click="company()" style="font-size: 14px;" aria-hidden="true" ng-show="!fboPreffered"></i>
238 238 </h4>
239 239 <input type="tel" ng-hide="showCompanyName" ng-model="companyData.companyName" class="form-control"/>
240 240 </div>
... ... @@ -270,6 +270,9 @@
270 270 <div class="clearfix"></div>
271 271 </p>
272 272 </div>
  273 + <div class="row" style="margin-left:0px;" ng-show="fboPreffered">
  274 + <p style="color:red"> <i class="fa fa-search-plus" ></i> FBOInsights Preffered</p>
  275 + </div>
273 276 <div class="row" style="margin-left:0px;">
274 277 <div class="col-md-5" style="padding-left: 0;">
275 278 <input type="checkbox" name="" ng-model="companyData.baseTenant" ng-change="checkboxStatus(companyData.baseTenant)"> Tenant/Base Customer
... ... @@ -282,12 +285,13 @@
282 285 <div>
283 286 <input type="checkbox" name="" ng-model="companyData.contractFuelVendor" ng-change="checkboxStatus(companyData.contractFuelVendor)"> CAA Member
284 287 </div>
  288 +
285 289 </div>
286 290 </br>
287 291 <div class="new-address">
288 292 <p ng-show="showAddress"><i class="fa fa-map-marker"></i>
289 293 <span ng-hide="companyData.addressOne == 'null'">{{companyData.addressOne}}</span><span ng-hide="companyData.addressTwo == 'null'">,
290   - {{companyData.addressTwo}}</span> <span ng-hide="companyData.city == 'null'"><br/>{{companyData.city}},</span> <span ng-hide="companyData.state == 'null'">{{companyData.state}}</span> <span ng-hide="companyData.zipcode == 'null'">{{companyData.zipcode}}</span> <span ng-hide="companyData.country == 'null'"></br>{{companyData.country}}</span> &nbsp;<i class="fa fa-pencil-square-o" ng-click="addressChange()" aria-hidden="true"></i> </p>
  294 + {{companyData.addressTwo}}</span> <span ng-hide="companyData.city == 'null'"><br/>{{companyData.city}},</span> <span ng-hide="companyData.state == 'null'">{{companyData.state}}</span> <span ng-hide="companyData.zipcode == 'null'">{{companyData.zipcode}}</span> <span ng-hide="companyData.country == 'null'"></br>{{companyData.country}}</span> &nbsp;<i class="fa fa-pencil-square-o" ng-click="addressChange()" aria-hidden="true" ng-show="!fboPreffered"></i> </p>
291 295  
292 296 <div ng-hide="showAddress" style="margin-bottom:10px;">
293 297 <label>Address1</label>
... ... @@ -344,12 +348,12 @@
344 348 <i class="fa fa-plane"></i>
345 349 <h3>Aircraft List</h3>
346 350 <div class="pull-right">
347   - <button type="submit" class="btn btn-success btn-sm" data-toggle="modal" ng-click="clearAircrafts()" data-target="#aircraft-modal-3" style="margin-top: 4px; margin-right: 9px;"><i class="fa fa-plus" aria-hidden="true"></i>&nbsp; Add Aircraft </button>
  351 + <button type="submit" ng-show="!fboPreffered" class="btn btn-success btn-sm" data-toggle="modal" ng-click="clearAircrafts()" data-target="#aircraft-modal-3" style="margin-top: 4px; margin-right: 9px;"><i class="fa fa-plus" aria-hidden="true"></i>&nbsp; Add Aircraft </button>
348 352 </div>
349 353 </div>
350 354 <div class="widget-content" style="padding:0px;min-height: 350px;">
351 355 <div class="table-responsive">
352   - <table class="table table-bordered table-hover table-striped">
  356 + <table class="table table-bordered table-hover table-striped" ng-show="!fboPreffered">
353 357 <thead>
354 358 <tr>
355 359 <th>Tail #</th>
... ... @@ -403,6 +407,60 @@
403 407 </tr>
404 408 </tbody>
405 409 </table>
  410 + <table class="table table-bordered table-hover table-striped" ng-show="fboPreffered">
  411 + <thead>
  412 + <tr>
  413 + <th>Tail #</th>
  414 + <th>Make</th>
  415 + <th>Model</th>
  416 + <th>Fuel Type</th>
  417 + <th>Margin</th>
  418 + <th>Value</th>
  419 + <th>All In</th>
  420 + <!-- <th>AVGAS</th> -->
  421 + <!-- <th>All In</th> -->
  422 + <th></th>
  423 + </tr>
  424 + </thead>
  425 + <tbody>
  426 + <tr ng-repeat="aircraft in contactAircraftList">
  427 + <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.tail}}</td>
  428 + <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.make}}</td>
  429 + <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.model}}</td>
  430 + <td ng-style="aircraft.global && {color:'#9e9696'}">{{aircraft.fuelType}}</td>
  431 + <td>
  432 + <select ng-show="abc && aircraft.fuelType=='Jet-A'" class="form-control" style="height:31px;" ng-model="aircraft.aircraftsMargin.id" ng-change="editJetMargin(aircraft,'jet')" ng-options="margin.id as margin.marginName for margin in jetMarginList" required>
  433 + <option value="">N/A</option>
  434 + </select>
  435 + <!-- </td>
  436 + <td> -->
  437 + <select ng-show ="xyz && aircraft.fuelType=='100LL'" class="form-control" style="height:31px;" ng-model="aircraft.aircraftsAVGASMargin.id" ng-change="editJetMargin(aircraft,'avgas')">
  438 + <option value="">N/A</option>
  439 + <option ng-repeat="margin in avgsMarginList" value="{{margin.id}}">{{margin.marginName}}</option>
  440 + </select>
  441 + </td>
  442 + <td ng-style="aircraft.global">
  443 + <span ng-if="aircraft.aircraftsMargin.pricingStructure === 'equal' || aircraft.aircraftsAVGASMargin.pricingStructure === 'equal' ">
  444 + =${{aircraft.marginValue}}
  445 + </span>
  446 + <span ng-if="aircraft.aircraftsMargin.pricingStructure === 'minus' || aircraft.aircraftsAVGASMargin.pricingStructure === 'minus'" style="color: #ff0000;">-${{aircraft.marginValue}}
  447 + </span>
  448 + <span ng-if="aircraft.aircraftsMargin.pricingStructure === 'plus' || aircraft.aircraftsAVGASMargin.pricingStructure === 'plus' " style="color: green;">+${{aircraft.marginValue}}
  449 + </span>
  450 + </td>
  451 + <td>
  452 + <!-- <td ng-show="abc && aircraft.fuelType=='Jet-A'" style="color:#55AF8B;">${{aircraft.marginAllIn | number : 4}}</td>
  453 + <td ng-show="xyz && aircraft.fuelType=='100LL'" style="color:#55AF8B;">${{aircraft.marginAvgasAllIn | number : 4}}</td> -->
  454 +
  455 + <label id="l1" ng-show="abc && aircraft.fuelType=='Jet-A'" style="color:#55AF8B;">${{aircraft.marginAllIn | number : 4}}</label>
  456 + <label id="l2" ng-show="xyz && aircraft.fuelType=='100LL'" style="color:#55AF8B;">${{aircraft.marginAvgasAllIn | number : 4}}</label>
  457 + </td>
  458 + <td>
  459 + <i class="fa fa-lock" aria-hidden="true" style="font-size:24px"></i>
  460 + </td>
  461 + </tr>
  462 + </tbody>
  463 + </table>
406 464 </div>
407 465 </div>
408 466 </div>
... ...