Commit 0173d74ad393b69b7f4dfbe43c818c5a6717b19d

Authored by Kuldeep Arora
1 parent 0a364e561c
Exists in master

source autopopulate in fuel order screens

app/partials/customers/customers.controller.js
... ... @@ -441,7 +441,7 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
441 441 $scope.fuelData.fuelOn = $scope.order.fuelOn;
442 442 $scope.fuelData.invoiced = $scope.order.invoiced;
443 443 $scope.fuelData.volume = $scope.order.volume;
444   - $scope.fuelData.source = $scope.order.source;
  444 + // $scope.fuelData.source = $scope.order.source;
445 445  
446 446 $scope.fuelData.total = $scope.order.total;
447 447 //tier no use
... ... @@ -480,9 +480,18 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
480 480  
481 481 $scope.fuelData.status = $scope.order.status;
482 482 }
483   -
  483 +
  484 + if($scope.baseTenant && $scope.contractFuelVendor ){
  485 + $scope.fuelData.source = "Tenant/Base Customer CAA Member" ;
  486 + }else if($scope.baseTenant)
  487 + {
  488 + $scope.fuelData.source = "Tenant/Base Customer";
  489 + }else if($scope.contractFuelVendor){
  490 + $scope.fuelData.source = "CAA Member";
  491 + }
  492 +
484 493 $scope.dispatchOrder.fuelOrderList.push($scope.fuelData);
485   - // console.log("=====$scope.fueldata======",$scope.fuelData)
  494 + //console.log("=====$scope.fueldata======",$scope.fuelData)
486 495 fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) {
487 496 $scope.showLoader = false;
488 497 $scope.order = {};
... ... @@ -553,10 +562,14 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
553 562 $('#demo-modal-4').css('display', '');
554 563 }
555 564  
556   - $scope.setFuel = function(companyName,certificateType) {
  565 + $scope.setFuel = function(companyName,baseTenant,contractFuelVendor,fuelerlinxCustomer,certificateType) {
557 566 $('#demo-modal-4').css('display', 'block');
558 567 $scope.order.defaultCompanyName = companyName;
559   - $scope.order.certificateType = certificateType;
  568 + $scope.order.certificateType = certificateType;
  569 + $scope.baseTenant = baseTenant;
  570 + $scope.contractFuelVendor = contractFuelVendor;
  571 + $scope.fuelerlinxCustomer = fuelerlinxCustomer;
  572 + //console.log("===values of checkbox===",baseTenant,contractFuelVendor,fuelerlinxCustomer)
560 573 $scope.getAircraft(companyName);
561 574 // event.stopPropagation();
562 575 // $state.go('app.updateFuelManager');
... ...
app/partials/customers/customers.html
... ... @@ -130,7 +130,7 @@
130 130 {{row.marginAllIn | number : 4}}
131 131 </td>
132 132 <td data-title="''">
133   - <button type="button" class="btn btn-info btn-xs" ng-click="setFuel(row.companyName,row.certificateType)">Setup Fuel</button>
  133 + <button type="button" class="btn btn-info btn-xs" ng-click="setFuel(row.companyName,row.baseTenant,row.contractFuelVendor,row.fuelerlinxCustomer,row.certificateType)">Setup Fuel</button>
134 134 </td>
135 135 </tr>
136 136 </table>
... ... @@ -715,7 +715,6 @@
715 715 </div>
716 716 <div class="clearfix"></div><br>
717 717  
718   -
719 718 <div class="col-xs-12">
720 719  
721 720 <div class="col-md-6">
... ... @@ -751,12 +750,14 @@
751 750 <label class="new-input-label"><b>Source</b></label>
752 751 </div>
753 752 <div class="pull-left" style="width: calc(100% - 110px);">
754   - <select class="form-control" ng-model="order.source" style="width: 100%;">
  753 + <div style="font-weight: normal;" ng-if="baseTenant">Tenant/Base Customer</br></div>
  754 + <div style="font-weight: normal;" ng-if="contractFuelVendor">CAA Member</div>
  755 + <!-- <select class="form-control" ng-model="order.source" style="width: 100%;">
755 756 <option value="" disabled selected hidden>Select Source</option>
756 757 <option value="Tenant">Tenant</option>
757 758 <option value="CAA">CAA</option>
758 759 <option value="Tenant/CAA">Tenant/CAA</option>
759   - </select>
  760 + </select> -->
760 761 </div>
761 762 <div class="clearfix"></div>
762 763 </div>
... ...
app/partials/enterFuelOrder/enterFuelOrder.controller.js
... ... @@ -12,6 +12,7 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
12 12 enterFuelOrderService.getAllCompanies().then(function(result) {
13 13 $scope.showLoader = false;
14 14 $scope.companyList = result;
  15 + //console.log("===company====",result)
15 16 })
16 17  
17 18 $scope.order = {};
... ... @@ -26,10 +27,16 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
26 27  
27 28 $scope.getAircraft = function(company){
28 29 $scope.selectedCompanyName = company;
  30 +
29 31  
30 32 $scope.showLoader = true;
31 33 for (var i = 0; i < $scope.companyList.length; i++) {
32 34 if ($scope.companyList[i].companyName == company) {
  35 + $scope.order.certificateType = $scope.companyList[i].certificateType;
  36 + $scope.baseTenant = $scope.companyList[i].baseTenant;
  37 + $scope.contractFuelVendor = $scope.companyList[i].contractFuelVendor;
  38 + $scope.fuelerlinxCustomer = $scope.companyList[i].fuelerlinxCustomer;
  39 +
33 40 if($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null){
34 41 enterFuelOrderService.getFuelCost($scope.companyList[i].id).then(function(margins) {
35 42 $scope.marginList = margins;
... ... @@ -112,6 +119,7 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
112 119  
113 120 $scope.dispatchFuel = function(){
114 121 $scope.showLoader = true;
  122 +
115 123 $scope.order.companyId = $scope.selectedCompanyId;
116 124 $scope.order.companyName = $scope.order.companyName;
117 125 var aircraftObj =JSON.parse($scope.order.aircraftName);
... ... @@ -122,7 +130,7 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
122 130  
123 131 $scope.order.invoiced = $scope.order.invoiced;
124 132 $scope.order.volume = $scope.order.volume;
125   - $scope.order.source = $scope.order.source;
  133 + // $scope.order.source = $scope.order.source;
126 134  
127 135 $scope.order.total = $scope.order.total;
128 136  
... ... @@ -159,6 +167,16 @@ function enterFuelOrderController($scope, $rootScope, $uibModal, $filter, $http,
159 167  
160 168 $scope.order.status = $scope.order.status;
161 169 }
  170 +
  171 + if($scope.baseTenant && $scope.contractFuelVendor ){
  172 + $scope.order.source = "Tenant/Base Customer CAA Member" ;
  173 + }else if($scope.baseTenant)
  174 + {
  175 + $scope.order.source = "Tenant/Base Customer";
  176 + }else if($scope.contractFuelVendor){
  177 + $scope.order.source = "CAA Member";
  178 + }
  179 +
162 180 //console.log("===order====",$scope.order);
163 181  
164 182 $scope.dispatchOrder.fuelOrderList.push($scope.order);
... ...
app/partials/enterFuelOrder/enterFuelOrder.html
... ... @@ -191,12 +191,14 @@
191 191 <label class="new-input-label"><b>Source</b></label>
192 192 </div>
193 193 <div class="pull-left" style="width: calc(100% - 110px);">
194   - <select class="form-control" ng-model="order.source" style="width: 100%;">
  194 + <div style="font-weight: normal;" ng-if="baseTenant">Tenant/Base Customer</br></div>
  195 + <div style="font-weight: normal;" ng-if="contractFuelVendor">CAA Member</div>
  196 + <!-- <select class="form-control" ng-model="order.source" style="width: 100%;">
195 197 <option value="" disabled selected hidden>Select Source</option>
196 198 <option value="Tenant">Tenant</option>
197 199 <option value="CAA">CAA</option>
198 200 <option value="Tenant/CAA">Tenant/CAA</option>
199   - </select>
  201 + </select> -->
200 202 </div>
201 203 <div class="clearfix"></div>
202 204 </div>
... ... @@ -211,7 +213,7 @@
211 213 <label class="new-input-label"><b>Certificate Type</b></label>
212 214 </div>
213 215 <div class="pull-left" style="width: calc(100% - 110px);">
214   - <select class="form-control" ng-model="order.certificateType" style="width: 100%;">
  216 + <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;">
215 217 <option value="" disabled selected hidden>Select...</option>
216 218 <option value="corporate">Part 91 (Corporate)</option>
217 219 <option value="charter">Part 135 (Charter)</option>
... ...
app/partials/fuelOrders/fuelOrders.controller.js
... ... @@ -278,7 +278,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
278 278 }
279 279  
280 280 $scope.addFuelData = function() {
281   - $scope.showLoader = true;
  281 + // $scope.showLoader = true;
282 282 $scope.fuelData = {};
283 283 $scope.fuelData.companyId = $scope.selectedCompanyId;
284 284  
... ... @@ -290,7 +290,7 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
290 290 $scope.fuelData.fuelOn = $scope.order.fuelOn;
291 291 $scope.fuelData.invoiced = $scope.order.invoiced;
292 292 $scope.fuelData.volume = $scope.order.volume;
293   - $scope.fuelData.source = $scope.order.source;
  293 + // $scope.fuelData.source = $scope.order.source;
294 294  
295 295 $scope.fuelData.total = $scope.order.total;
296 296 //tier no use
... ... @@ -329,9 +329,18 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
329 329  
330 330 $scope.fuelData.status = $scope.order.status;
331 331 }
332   -
  332 +
  333 + if($scope.baseTenant && $scope.contractFuelVendor ){
  334 + $scope.fuelData.source = "Tenant/Base Customer CAA Member" ;
  335 + }else if($scope.baseTenant)
  336 + {
  337 + $scope.fuelData.source = "Tenant/Base Customer";
  338 + }else if($scope.contractFuelVendor){
  339 + $scope.fuelData.source = "CAA Member";
  340 + }
  341 +
333 342 $scope.dispatchOrder.fuelOrderList.push($scope.fuelData);
334   - // console.log("=====$scope.fueldata======",$scope.fuelData)
  343 + // console.log("=====$scope.fueldata======",$scope.fuelData)
335 344 fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) {
336 345 $scope.showLoader = false;
337 346 $scope.order = {};
... ... @@ -447,6 +456,11 @@ function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgT
447 456 //$scope.showLoader = true;
448 457 for (var i = 0; i < $scope.companyList.length; i++) {
449 458 if ($scope.companyList[i].companyName == company) {
  459 + $scope.order.certificateType = $scope.companyList[i].certificateType;
  460 + $scope.baseTenant = $scope.companyList[i].baseTenant;
  461 + $scope.contractFuelVendor = $scope.companyList[i].contractFuelVendor;
  462 + $scope.fuelerlinxCustomer = $scope.companyList[i].fuelerlinxCustomer;
  463 +
450 464 if($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null){
451 465 fuelOrdersService.getFuelCost($scope.companyList[i].id).then(function(margins) {
452 466 $scope.marginList = margins;
... ...
app/partials/fuelOrders/fuelOrders.html
... ... @@ -708,12 +708,14 @@
708 708 <label class="new-input-label"><b>Source</b></label>
709 709 </div>
710 710 <div class="pull-left" style="width: calc(100% - 110px);">
711   - <select class="form-control" ng-model="order.source" style="width: 100%;">
  711 + <div style="font-weight: normal;" ng-if="baseTenant">Tenant/Base Customer</br></div>
  712 + <div style="font-weight: normal;" ng-if="contractFuelVendor">CAA Member</div>
  713 + <!-- <select class="form-control" ng-model="order.source" style="width: 100%;">
712 714 <option value="" disabled selected hidden>Select Source</option>
713 715 <option value="Tenant">Tenant</option>
714 716 <option value="CAA">CAA</option>
715 717 <option value="Tenant/CAA">Tenant/CAA</option>
716   - </select>
  718 + </select> -->
717 719 </div>
718 720 <div class="clearfix"></div>
719 721 </div>
... ... @@ -728,7 +730,7 @@
728 730 <label class="new-input-label"><b>Certificate Type</b></label>
729 731 </div>
730 732 <div class="pull-left" style="width: calc(100% - 110px);">
731   - <select class="form-control" ng-model="order.certificateType" style="width: 100%;">
  733 + <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;">
732 734 <option value="" disabled selected hidden>Select...</option>
733 735 <option value="corporate">Part 91 (Corporate)</option>
734 736 <option value="charter">Part 135 (Charter)</option>
... ...
app/partials/viewCompany/viewCompany.controller.js
... ... @@ -154,6 +154,7 @@ angular.module(&#39;acufuel&#39;)
154 154 function getCompanyDetail() {
155 155 $scope.showLoader = true;
156 156 ViewCompanyService.getCompany(companyId).then(function(result) {
  157 + console.log("===getCompanyDetail====",result)
157 158 $scope.companyData = result;
158 159 $scope.isGlobal = result.global;
159 160 if (result.global == true) {
... ... @@ -451,6 +452,7 @@ angular.module(&#39;acufuel&#39;)
451 452 }
452 453  
453 454 $scope.editData = function(inputName) {
  455 + console.log("===input===",inputName)
454 456 //console.log($scope.companyData)
455 457 $scope.showLoader = true;
456 458 /*if(inputName == 'showNoteData'){
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -274,13 +274,15 @@
274 274 <div class="col-md-5" style="padding-left: 0;">
275 275 <input type="checkbox" name="" ng-model="companyData.baseTenant" ng-change="checkboxStatus(companyData.baseTenant)"> Tenant/Base Customer
276 276 </div>
277   - <div class="col-md-5" style="padding-left: 0;">
  277 + <!--fuelerlinxCustomer later use not to be deleted just hidden-->
  278 + <!-- <div class="col-md-5" style="padding-left: 0;">
278 279 <input type="checkbox" name="" ng-model="companyData.fuelerlinxCustomer" ng-change="fuelercheckboxStatus(companyData.fuelerlinxCustomer)"> FuelerLinx Customer
279   - </div>
280   - </div>
  280 + </div>
  281 + </div>-->
281 282 <div>
282 283 <input type="checkbox" name="" ng-model="companyData.contractFuelVendor" ng-change="checkboxStatus(companyData.contractFuelVendor)"> CAA Member
283 284 </div>
  285 + </div>
284 286 </br>
285 287 <div class="new-address">
286 288 <p ng-show="showAddress"><i class="fa fa-map-marker"></i>
... ...