Commit 87660da6c92cf73436909d8a3fe2f15343d4fe50

Authored by Kuldeep Arora
1 parent 91d8ce8f46
Exists in master

testing

app/partials/customers/customers.controller.js
... ... @@ -80,7 +80,7 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
80 80  
81 81 function getAllCompanies() {
82 82 CustomersService.getAllCompanies().then(function(result) {
83   - //console.log('log', result);
  83 + console.log('company list', result);
84 84 $scope.companyList = result;
85 85 for (var i = 0; i < $scope.companyList.length; i++) {
86 86 if ($scope.companyList[i].companyContact != null) {
... ... @@ -141,6 +141,7 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
141 141 function getData() {
142 142 $scope.showLoader = true;
143 143 CustomersService.getAircraftMake().then(function(result) {
  144 + //console.log("==aircrafts===",result)
144 145 $scope.aircraftMakeList = result;
145 146 $scope.showLoader = false;
146 147 })
... ... @@ -249,6 +250,7 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
249 250 $scope.aircraftListData = {};
250 251 $scope.addData = [];
251 252 $scope.saveCompanyData = function() {
  253 + console.log("company data --",$scope.data)
252 254 CustomersService.addCompany($scope.data).then(function(result) {
253 255 $scope.accountId = result;
254 256 $scope.aircraft.accountId = $scope.accountId;
... ... @@ -276,7 +278,8 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
276 278 toastr.success('' + result.success + '', {
277 279 closeButton : true
278 280 })
279   - $('#demo-modal-3').modal('hide');
  281 + $('#demo-modal-3').css('display', 'none');
  282 + $('.modal-backdrop').css('display', 'none');
280 283 getAllCompanies();
281 284 } else {
282 285 toastr.error('' + result.statusText + '', {
... ... @@ -291,7 +294,7 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
291 294 /*add a fuel order*/
292 295 $scope.getOrders = function() {
293 296 fuelOrdersService.getOrders().then(function(result) {
294   -
  297 + console.log("==get orders===",result)
295 298 $scope.orderdata = result;
296 299 for (var i = 0; i < $scope.orderdata.length; i++) {
297 300 $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate);
... ... @@ -411,10 +414,9 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
411 414 }
412 415  
413 416 $scope.addTotal = function(value, valueOf) {
414   - if (valueOf == 'v') {
415   - $scope.order.total = value * $scope.order.invoiced
416   - } else if (valueOf == 'i') {
417   - $scope.order.total = $scope.order.volume * value
  417 + if (value != undefined && valueOf != undefined) {
  418 + value = JSON.parse(value)
  419 + $scope.order.total = value.cost * valueOf;
418 420 }
419 421 }
420 422  
... ... @@ -443,6 +445,7 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
443 445 if ($scope.selectedCompanyId != '') {
444 446 fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) {
445 447 $scope.aircraftList = aircraft;
  448 + console.log("===tail search====",aircraft);
446 449 })
447 450 }
448 451 if ($scope.marginId != '') {
... ... @@ -468,9 +471,10 @@ function customersController($scope, $rootScope, $uibModal, $filter, $http, $sta
468 471 $('#demo-modal-4').css('display', '');
469 472 }
470 473  
471   - $scope.setFuel = function(companyName) {
  474 + $scope.setFuel = function(companyName,certificateType) {
472 475 $('#demo-modal-4').css('display', 'block');
473 476 $scope.order.defaultCompanyName = companyName;
  477 + $scope.order.certificateType = certificateType;
474 478 $scope.getAircraft(companyName);
475 479 // event.stopPropagation();
476 480 // $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)">Setup Fuel</button>
  133 + <button type="button" class="btn btn-info btn-xs" ng-click="setFuel(row.companyName,row.certificateType)">Setup Fuel</button>
134 134 </td>
135 135 </tr>
136 136 </table>
... ... @@ -543,7 +543,7 @@
543 543 <label class="new-input-label"><b>Product</b></label>
544 544 </div>
545 545 <div class="pull-left" style="width: calc(100% - 110px);">
546   - <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote)" required>
  546 + <select class="form-control" ng-model="order.priceQuote" ng-change="setCost(order.priceQuote); addTotal(order.priceQuote, order.volume)" required>
547 547 <option value="" selected disabled>Select Product</option>
548 548 <option ng-repeat="margin in marginList" value="{{margin}}">${{margin.papTotal | number : 4}} {{margin.productName}}</option>
549 549 </select>
... ... @@ -575,7 +575,7 @@
575 575 <label class="new-input-label"><b>Volume</b></label>
576 576 </div>
577 577 <div class="pull-left" style="width: calc(100% - 110px);">
578   - <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.volume,'v')" class="form-control" placeholder="" required>
  578 + <input type="text" ng-model="order.volume" ng-keyup="addTotal(order.priceQuote, order.volume)" class="form-control" placeholder="" required>
579 579 </div>
580 580 <div class="clearfix"></div>
581 581 </div>
... ... @@ -606,13 +606,13 @@
606 606 <div class="clearfix"></div>
607 607 </div>
608 608  
609   - <div class="col-md-6" style="margin-top: 22px;">
  609 + <div class="col-md-6" style="margin-top: 22px;" ng-if ="order.status === 'invoiced'">
610 610 <div class="pull-left" style="width: 110px;">
611 611 <label class="new-input-label"><b>Invoiced</b></label>
612 612 <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span>
613 613 </div>
614 614 <div class="pull-left" style="width: calc(100% - 110px);">
615   - <input type="text" ng-model="order.invoiced" ng-keyup="addTotal(order.invoiced,'i')" class="form-control" placeholder="">
  615 + <input type="text" ng-model="order.invoiced" class="form-control" placeholder="">
616 616 </div>
617 617 <div class="clearfix"></div>
618 618 </div>
... ... @@ -677,7 +677,7 @@
677 677 <span style="margin-top: 6px; margin-right: 3px; float: right;">$</span>
678 678 </div>
679 679 <div class="pull-left" style="width: calc(100% - 110px);">
680   - <input type="text" disabled ng-model="order.fboCost" class="form-control" placeholder="0.0000" valid-number />
  680 + <input type="text" disabled ng-model="order.fboCost | number : 4" class="form-control" placeholder="0.0000" />
681 681 </div>
682 682 <div class="clearfix"></div>
683 683 </div>
... ... @@ -710,7 +710,7 @@
710 710 <label class="new-input-label"><b>Certificate Type</b></label>
711 711 </div>
712 712 <div class="pull-left" style="width: calc(100% - 110px);">
713   - <select class="form-control" ng-model="order.certificateType" style="width: 100%;">
  713 + <select class="form-control" disabled ng-model="order.certificateType" style="width: 100%;">
714 714 <option value="" disabled selected hidden>Select...</option>
715 715 <option value="corporate">Part 91 (Corporate)</option>
716 716 <option value="charter">Part 135 (Charter)</option>
... ... @@ -728,11 +728,11 @@
728 728 <div class="pull-left" style="width: calc(100% - 110px);">
729 729 <select class="form-control" ng-model="order.status" style="width: 100%;">
730 730 <option value="" disabled selected hidden>pending</option>
731   - <!-- <option value="pending">pending</option> -->
  731 + <option value="pending">pending</option>
732 732 <option value="invoiced">invoiced</option>
733 733 <option value="paid">paid</option>
734   - <option value="cancelled">cancelled</option>
735   - <option value="archived">archived</option>
  734 + <!-- <option value="cancelled">cancelled</option>
  735 + <option value="archived">archived</option> -->
736 736 </select>
737 737 </div>
738 738 <div class="clearfix"></div>
... ...