Commit bfbbd8668e3abec61d60f340ad464284e95b0afc
1 parent
3f7cb808d8
Exists in
master
UI service
Showing
12 changed files
with
293 additions
and
44 deletions
Show diff stats
app/partials/accountSetting/accountSetting.Controller.js
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | $scope.addArray[index].name = productlist[index].name; |
47 | 47 | $scope.addArray[index].status = productlist[index].status; |
48 | 48 | $scope.productData.productList = $scope.addArray; |
49 | - // console.log($scope.productData) | |
49 | + console.log($scope.productData) | |
50 | 50 | } |
51 | 51 | |
52 | 52 | $scope.updateUser = function(){ |
... | ... | @@ -93,6 +93,8 @@ |
93 | 93 | }) |
94 | 94 | }else{ |
95 | 95 | if (validateEmail($scope.accountdata.userName)) { |
96 | + console.log("checkbox",$scope.accountdata.allowEpd ,$scope.accountdata.allowFma | |
97 | +) | |
96 | 98 | AccountSettingService.addAdditionalAccount($scope.accountdata).then(function(result) { |
97 | 99 | getAdditionalAccounts(); |
98 | 100 | $scope.accountdata = {}; | ... | ... |
app/partials/accountSetting/accountSetting.Service.js
app/partials/login/login.service.js
... | ... | @@ -45,8 +45,9 @@ |
45 | 45 | url : BASE_URL.url+'/user/authenticate', |
46 | 46 | headers : {'Content-Type': 'application/x-www-form-urlencoded'} |
47 | 47 | }).then(function (result){ |
48 | + console.log("kd",result.data.userProfile.userType.type) | |
48 | 49 | if(result.data.userProfile.userType.type == 'ADMIN' || result.data.userProfile.userType.type == 'FBO' || result.data.userProfile.userType.type == 'ADDITIONAL'){ |
49 | - | |
50 | + console.log("usertype",result.data.userProfile.userType.type) | |
50 | 51 | authService.setUser(result.data); |
51 | 52 | $state.go('app.dashboard') |
52 | 53 | }else if(result.data.userProfile.userType.type == 'FLIGHT_DEPT' ){ |
... | ... | @@ -100,6 +101,7 @@ |
100 | 101 | window.localStorage.setItem('currentUserName', JSON.stringify(authData.userProfile.firstName +' '+ authData.userProfile.lastName)); |
101 | 102 | window.localStorage.setItem('companyName', JSON.stringify(authData.userProfile.companyName)); |
102 | 103 | if(authData.userProfile.userType.type == 'ADMIN' || authData.userProfile.userType.type == 'FBO' || authData.userProfile.userType.type == 'ADDITIONAL'){ |
104 | + console.log("setUser",authData.userProfile.userType.type) | |
103 | 105 | role = USER_ROLES.admin; |
104 | 106 | $rootScope.isAuthenticated = true; |
105 | 107 | }else if(authData.userProfile.userType.type == 'FLIGHT_DEPT'){ | ... | ... |
app/partials/updateFuelManager/updateFuelManager.controller.js
... | ... | @@ -393,16 +393,17 @@ |
393 | 393 | |
394 | 394 | } |
395 | 395 | |
396 | - $scope.emailForMargin; | |
397 | - $scope.emailPricingForMargin = function(value){ | |
396 | + /*Jet A Margin Email Send */ | |
397 | + $scope.emailForJetMargin; | |
398 | + $scope.emailPricingForJetAMargin = function(value){ | |
398 | 399 | $('#confirm2').css('display', 'block'); |
399 | - $scope.emailForMargin = value; | |
400 | + $scope.emailForJetMargin = value; | |
400 | 401 | |
401 | 402 | } |
402 | 403 | $scope.saveAndCloseForMarginConfirm = function(){ |
403 | 404 | $('#confirm2').css('display', 'none'); |
404 | - updateFuelManagerService.sendMailToMargin($scope.emailForMargin).then(function(result) { | |
405 | - console.log() | |
405 | + updateFuelManagerService.sendMailToJetAMargin($scope.emailForJetMargin).then(function(result) { | |
406 | + console.log("email margin jeta",$scope.emailForJetMargin) | |
406 | 407 | toastr.success(''+result.success+'', { |
407 | 408 | closeButton: true |
408 | 409 | }) |
... | ... | @@ -412,17 +413,45 @@ |
412 | 413 | $('#confirm2').css('display', 'none'); |
413 | 414 | } |
414 | 415 | |
416 | + /*AVGAS Margin Email Send */ | |
417 | + | |
418 | + $scope.emailForAVGASMargin; | |
419 | + $scope.emailPricingForAVGASMargin = function(value){ | |
420 | + $('#confirm3').css('display', 'block'); | |
421 | + $scope.emailForAVGASMargin = value; | |
422 | + | |
423 | + } | |
424 | + $scope.saveAndCloseForAVGASMarginConfirm = function(){ | |
425 | + $('#confirm3').css('display', 'none'); | |
426 | + updateFuelManagerService.sendMailToAVGASMargin($scope.emailForAVGASMargin).then(function(result) { | |
427 | + console.log("email margin avgas",$scope.emailForAVGASMargin) | |
428 | + toastr.success(''+result.success+'', { | |
429 | + closeButton: true | |
430 | + }) | |
431 | + }) | |
432 | + } | |
433 | + $scope.cancelAndCloseForAVGASMarginConfirm = function(){ | |
434 | + $('#confirm3').css('display', 'none'); | |
435 | + } | |
436 | + | |
437 | + | |
438 | + | |
439 | + | |
440 | + | |
415 | 441 | $scope.sendEmail = {}; |
416 | 442 | |
417 | 443 | $scope.confirmMail = function(){ |
418 | 444 | if ($scope.sendEmail.pricing != '' && $scope.sendEmail.pricing != null && $scope.sendEmail.pricing != undefined) { |
419 | 445 | $('#confirm1').css('display', 'block'); |
446 | + | |
420 | 447 | } |
421 | 448 | } |
422 | 449 | |
423 | 450 | $scope.saveAndCloseConfirm = function(){ |
424 | 451 | $('#confirm1').css('display', 'none'); |
425 | 452 | updateFuelManagerService.sendMailToGroupMargin($scope.sendEmail.pricing).then(function(result) { |
453 | + console.log("emails",$scope.sendEmail.pricing) | |
454 | + $scope.sendEmail = {}; | |
426 | 455 | toastr.success(''+result.success+'', { |
427 | 456 | closeButton: true |
428 | 457 | }) | ... | ... |
app/partials/updateFuelManager/updateFuelManager.html
... | ... | @@ -167,7 +167,7 @@ |
167 | 167 | <button class="btn btn-success" style="display: none; background-image: none; background-color: #f3f3f3; color: #333; border:0;" ng-click="closeAccordian(jets)">Close</button> |
168 | 168 | <button class="btn btn-success" style="display: none;" ng-click="saveJetAccordian(jets)">Save</button> |
169 | 169 | <button class="btn btn-danger" style="display: none;" ng-click="deleteJetAccordian(jets.id)">Delete</button> |
170 | - <button type="button" class="btn btn-primary" ng-click="emailPricingForMargin(jets.id)" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
170 | + <button type="button" class="btn btn-primary" ng-click="emailPricingForJetAMargin(jets.id)" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
171 | 171 | <button class="btn btn-default" ng-click="toggleJestAccordian(jets.id, $index)" style= "text-align: center; font-size:12px">Edit</button> |
172 | 172 | </div> |
173 | 173 | <div class="clearfix"></div> |
... | ... | @@ -273,7 +273,7 @@ |
273 | 273 | <button class="btn btn-success" style="display: none; background-image: none; background-color: #f3f3f3; color: #333; border:0;" ng-click="closeAccordianVtype(jets)">Close</button> |
274 | 274 | <button class="btn btn-success" style="display: none;" ng-click="saveVtypeJetAccordian(jets)">Save</button> |
275 | 275 | <button class="btn btn-danger" style="display: none;" ng-click="deleteVtypeJetAccordian(jets.id)">Delete</button> |
276 | - <button type="button" class="btn btn-primary" ng-click="emailPricingForMargin()" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
276 | + <button type="button" class="btn btn-primary" ng-click="emailPricingForAVGASMargin(jets.id)" style= "font-weight: normal; text-align: center; font-size:12px">Email Pricing for this Margin</button> | |
277 | 277 | <button class="btn btn-default" ng-click="toggleVtypeJestAccordian(jets.id, $index)" style= "text-align: center; font-size:12px">Edit</button> |
278 | 278 | </div> |
279 | 279 | <div class="clearfix"></div> |
... | ... | @@ -476,6 +476,27 @@ |
476 | 476 | </div> |
477 | 477 | </div> |
478 | 478 | |
479 | +<div class="customConfirmPopBackdrop" id="confirm3" style="display: none;"> | |
480 | + <div class="customModalInner"> | |
481 | + <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | |
482 | + <table> | |
483 | + <tr> | |
484 | + <td> | |
485 | + <img src="img/info.png" style="width: 50px;"> | |
486 | + </td> | |
487 | + <td> | |
488 | + <p style="padding: 5px 10px; margin-bottom: 0;">Are you sure that you want to email pricing for this margin?</p> | |
489 | + </td> | |
490 | + </tr> | |
491 | + </table> | |
492 | + </div> | |
493 | + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | |
494 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="saveAndCloseForAVGASMarginConfirm()">Yes</button> | |
495 | + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelAndCloseForAVGASMarginConfirm()">Cancel</button> | |
496 | + </div> | |
497 | + </div> | |
498 | +</div> | |
499 | + | |
479 | 500 | <div class="customConfirmPopBackdrop" id="deleteTierConfirm" style="display: none;"> |
480 | 501 | <div class="customModalInner"> |
481 | 502 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | ... | ... |
app/partials/updateFuelManager/updateFuelManager.service.js
... | ... | @@ -245,7 +245,7 @@ |
245 | 245 | return deferred.promise; |
246 | 246 | } |
247 | 247 | |
248 | - this.sendMailToMargin = function(id){ | |
248 | + this.sendMailToJetAMargin = function(id){ | |
249 | 249 | var deferred = $q.defer(); |
250 | 250 | $http({ |
251 | 251 | method : 'POST', |
... | ... | @@ -260,6 +260,23 @@ |
260 | 260 | return deferred.promise; |
261 | 261 | } |
262 | 262 | |
263 | + this.sendMailToAVGASMargin = function(id){ | |
264 | + var deferred = $q.defer(); | |
265 | + $http({ | |
266 | + method : 'POST', | |
267 | + url : BASE_URL.url +'/fuelPricing/sendAVGASPriceEmail/'+id, | |
268 | + headers : {'Content-Type': 'application/json'} | |
269 | + }) | |
270 | + .then(function (result){ | |
271 | + deferred.resolve(result.data); | |
272 | + },function (result){ | |
273 | + deferred.resolve(result.data); | |
274 | + }) | |
275 | + return deferred.promise; | |
276 | + } | |
277 | + | |
278 | + | |
279 | + | |
263 | 280 | this.sendMailToGroupMargin = function(type){ |
264 | 281 | var deferred = $q.defer(); |
265 | 282 | $http({ | ... | ... |
app/partials/viewCompany/viewCompany.controller.js
... | ... | @@ -14,7 +14,7 @@ angular.module('acufuel') |
14 | 14 | $scope.selected = []; |
15 | 15 | $scope.jetShow = []; |
16 | 16 | $scope.marginShow = []; |
17 | - | |
17 | + $scope.compId = $stateParams.id; | |
18 | 18 | $scope.jetShow[0] = true; |
19 | 19 | $scope.marginShow[0] = true; |
20 | 20 | $scope.dispatchOrder = {}; |
... | ... | @@ -100,6 +100,8 @@ angular.module('acufuel') |
100 | 100 | } |
101 | 101 | ]; |
102 | 102 | |
103 | + | |
104 | + | |
103 | 105 | $scope.changeValue = function(selected) { |
104 | 106 | $scope.showUpdateBtn = true; |
105 | 107 | // console.log("data to be true", selected); |
... | ... | @@ -140,7 +142,7 @@ angular.module('acufuel') |
140 | 142 | |
141 | 143 | var value = ""; |
142 | 144 | var companyId = $stateParams.id; |
143 | - $scope.compId = $stateParams.id; | |
145 | + | |
144 | 146 | $scope.companyData = {}; |
145 | 147 | $scope.multipleMsg = false; |
146 | 148 | $scope.companyData.masterMargin = ""; |
... | ... | @@ -350,13 +352,17 @@ angular.module('acufuel') |
350 | 352 | }) |
351 | 353 | |
352 | 354 | } |
353 | - | |
355 | + $scope.selectedOption = ''; | |
354 | 356 | $scope.getSize = function(model, index) { |
355 | 357 | $scope.showLoader = true; |
356 | 358 | CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { |
357 | 359 | $scope.showLoader = false; |
358 | 360 | $scope.aircraftDetails[index].aircraftSizeList = result; |
359 | - //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | |
361 | + // console.log("hi", result[0].aircraftSize.id) | |
362 | + // $scope.selectedOption = result[0].aircraftSize.id; | |
363 | + // console.log('$scope.selectedOption', $scope.selectedOption); | |
364 | + // $scope.aircraftData.aircraftSizeList.aircraftSize.size = result[0].aircraftSize.size; | |
365 | + // $scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; | |
360 | 366 | }) |
361 | 367 | } |
362 | 368 | |
... | ... | @@ -601,9 +607,19 @@ angular.module('acufuel') |
601 | 607 | } |
602 | 608 | } |
603 | 609 | |
610 | + /* editing */ | |
604 | 611 | updateFuelManagerService.getFuelPricingNew().then(function(result) { |
605 | 612 | $scope.fuelPricing = result; |
613 | + $scope.omitData; | |
614 | + ViewCompanyService.getOmitCompany($scope.compId).then(function(result){ | |
615 | + $scope.omitData = result; | |
616 | + console.log("omit data===", $scope.omitData); | |
617 | + }) | |
618 | + | |
619 | + console.log("$scope.fuelPricing",$scope.fuelPricing) | |
606 | 620 | for (var i = 0; i < $scope.fuelPricing.length; i++) { |
621 | + console.log('$scope.fuelPricing[i].fuelPricing', $scope.fuelPricing[i].fuelPricing); | |
622 | + //console.log("fuelid",$scope.fuelPricing[i].fuelPricing.id,"getid",$scope.omitData[j].id) | |
607 | 623 | if ($scope.fuelPricing[i].fuelPricing.expirationDate != null) { |
608 | 624 | $scope.fuelPricing[i].fuelPricing.expirationDate = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); |
609 | 625 | var newTime = new Date($scope.fuelPricing[i].fuelPricing.expirationDate); |
... | ... | @@ -612,6 +628,11 @@ angular.module('acufuel') |
612 | 628 | var dyear = newTime.getUTCFullYear(); |
613 | 629 | $scope.fuelPricing[i].fuelPricing.expirationDate = dmonth + '/' + dday + '/' + dyear; |
614 | 630 | } |
631 | + // for (var j = 0; j<$scope.omitData.length; j++) { | |
632 | + // if($scope.fuelPricing[i].fuelPricing.id === $scope.omitData[j].id){ | |
633 | + | |
634 | + // } | |
635 | + // } | |
615 | 636 | } |
616 | 637 | }) |
617 | 638 | |
... | ... | @@ -703,27 +724,51 @@ angular.module('acufuel') |
703 | 724 | }) |
704 | 725 | } |
705 | 726 | |
727 | + | |
706 | 728 | $scope.updateOmit = function(fuel, omit) { |
707 | 729 | $scope.fuelData = {}; |
708 | 730 | $scope.fuelData.expirationDate = new Date(fuel.expirationDate); |
709 | - $scope.fuelData.id = fuel.id; | |
731 | + $scope.fuelData.customMarginId = fuel.id; | |
710 | 732 | $scope.fuelData.omit = fuel.omit; |
711 | 733 | $scope.fuelData.papMargin = fuel.papMargin; |
712 | 734 | $scope.fuelData.papTotal = fuel.papTotal; |
713 | 735 | $scope.fuelData.cost = fuel.cost; |
714 | - ViewFuelVendorService.omitFuelPricing($scope.fuelData).then(function(result) { | |
715 | - if (result.success) { | |
716 | - toastr.success('' + result.success + '', { | |
717 | - closeButton: true | |
718 | - }) | |
719 | - } else { | |
720 | - toastr.error('' + result.statusText + '', { | |
721 | - closeButton: true | |
722 | - }) | |
723 | - } | |
724 | - }) | |
736 | + $scope.fuelData.companyId = $scope.compId ; | |
737 | + console.log("companyId",$scope.compId) | |
738 | + console.log("omit checked",$scope.fuelData.omit) | |
739 | + if($scope.fuelData.omit == true) | |
740 | + { | |
741 | + console.log("Insert API called",$scope.fuelData.customMarginId) | |
742 | + var customData = "companyId=" + $scope.fuelData.companyId + "&customMarginId=" + $scope.fuelData.customMarginId; | |
743 | + ViewCompanyService.omitAddCompanyFuel(customData).then(function(result) { | |
744 | + if (result.success) { | |
745 | + toastr.success('' + result.success + '', { | |
746 | + closeButton: true | |
747 | + }) | |
748 | + } else { | |
749 | + toastr.error('' + result.statusText + '', { | |
750 | + closeButton: true | |
751 | + }) | |
752 | + } | |
753 | + }) | |
754 | + }else{ | |
755 | + console.log("Delete API called",$scope.compId) | |
756 | + // var Id = "companyId=" + $scope.fuelData.companyId + "&customMarginId=" + $scope.fuelData.customMarginId; | |
757 | + ViewCompanyService.omitDeleteCompanyFuel($scope.fuelData.customMarginId).then(function(result){ | |
758 | + if (result.success) { | |
759 | + toastr.success('' + result.success + '', { | |
760 | + closeButton: true | |
761 | + }) | |
762 | + } else { | |
763 | + toastr.error('' + result.statusText + '', { | |
764 | + closeButton: true | |
765 | + }) | |
766 | + } | |
767 | + }) | |
768 | + } | |
725 | 769 | } |
726 | 770 | |
771 | + | |
727 | 772 | //--fuel type based on tail in not in use-- |
728 | 773 | // $scope.aircraftData = {} |
729 | 774 | /*$scope.checkJetWithTail = function(tail, index) { | ... | ... |
app/partials/viewCompany/viewCompany.html
... | ... | @@ -424,7 +424,8 @@ |
424 | 424 | </div> |
425 | 425 | <div class="widget-content"> |
426 | 426 | <div class="table-responsive"> |
427 | - <table class="table table-striped strikeTable" style="position: relative; margin-bottom: 0;"> | |
427 | + <!-- <table class="table table-striped strikeTable" style="position: relative; margin-bottom: 0;"> --> | |
428 | + <table class="table table-striped" style="position: relative; margin-bottom: 0;"> | |
428 | 429 | <thead> |
429 | 430 | <tr> |
430 | 431 | <th>Omit</th> |
... | ... | @@ -436,7 +437,8 @@ |
436 | 437 | </tr> |
437 | 438 | </thead> |
438 | 439 | <tbody> |
439 | - <tr ng-repeat="fuel in fuelPricing | orderBy:'name' : 'reverse' | filter:{ status: true }" ng-class="fuel.fuelPricing.omit ? 'strikeout' : ''"> | |
440 | + <!-- <tr ng-repeat="fuel in fuelPricing | orderBy:'name' : 'reverse' | filter:{ status: true }" ng-class="fuel.fuelPricing.omit ? 'strikeout' : ''"> --> | |
441 | + <tr ng-repeat="fuel in fuelPricing | orderBy:'name' : 'reverse' | filter:{ status: true }"> | |
440 | 442 | <td><input type="checkbox" ng-model="fuel.fuelPricing.omit" ng-change="updateOmit(fuel.fuelPricing, fuel.status)"></td> |
441 | 443 | <td>{{fuel.name}}</td> |
442 | 444 | <td>${{fuel.fuelPricing.cost | number :4}}</td> | ... | ... |
app/partials/viewCompany/viewCompany.service.js
... | ... | @@ -296,7 +296,55 @@ |
296 | 296 | return deferred.promise; |
297 | 297 | } |
298 | 298 | |
299 | + /* Omit Delete and Insert company fuel api */ | |
299 | 300 | |
301 | + this.getOmitCompany = function(id) { | |
302 | + | |
303 | + var deferred = $q.defer(); | |
304 | + $http({ | |
305 | + method : 'GET', | |
306 | + url : BASE_URL.url +'/company/omitData/'+id, | |
307 | + headers : {'Content-Type': 'application/json'}, | |
308 | + }) | |
309 | + .then(function (result){ | |
310 | + deferred.resolve(result.data); | |
311 | + },function (result){ | |
312 | + deferred.resolve(result.data); | |
313 | + }) | |
314 | + return deferred.promise; | |
315 | + } | |
316 | + | |
317 | + this.omitDeleteCompanyFuel = function(id) { | |
318 | + | |
319 | + var deferred = $q.defer(); | |
320 | + $http({ | |
321 | + method : 'DELETE', | |
322 | + url : BASE_URL.url +'/company/omitData/'+id, | |
323 | + headers : {'Content-Type': 'application/json'}, | |
324 | + }) | |
325 | + .then(function (result){ | |
326 | + deferred.resolve(result.data); | |
327 | + },function (result){ | |
328 | + deferred.resolve(result.data); | |
329 | + }) | |
330 | + return deferred.promise; | |
331 | + } | |
332 | + | |
333 | + this.omitAddCompanyFuel = function(data){ | |
334 | + var deferred = $q.defer(); | |
335 | + $http({ | |
336 | + method : 'POST', | |
337 | + url : BASE_URL.url +'/company/omitData/add', | |
338 | + data : data, | |
339 | + headers : {'Content-Type': 'application/json'}, | |
340 | + }) | |
341 | + .then(function (result){ | |
342 | + deferred.resolve(result.data); | |
343 | + },function (result){ | |
344 | + deferred.resolve(result.data); | |
345 | + }) | |
346 | + return deferred.promise; | |
347 | + } | |
300 | 348 | |
301 | 349 | } |
302 | 350 | ... | ... |
app/partials/viewFuelVendor/viewFuelVendor.controller.js
... | ... | @@ -34,6 +34,16 @@ |
34 | 34 | }) |
35 | 35 | } |
36 | 36 | |
37 | + $scope.omitData ={}; | |
38 | + getOmitVendorFuel(); | |
39 | + function getOmitVendorFuel() { | |
40 | + console.log("sada" ,vendorId) | |
41 | + ViewFuelVendorService.getOmitVendor(vendorId).then(function(result){ | |
42 | + $scope.omitData = result; | |
43 | + console.log("omit data===",$scope.omitData ) | |
44 | + }) | |
45 | + | |
46 | + } | |
37 | 47 | |
38 | 48 | $scope.changeCompanyStatus = function(){ |
39 | 49 | $('#deleteVendor').css('display', 'block'); |
... | ... | @@ -157,6 +167,7 @@ |
157 | 167 | $scope.sendMail = function(){ |
158 | 168 | $('#confirm2').css('display', 'none'); |
159 | 169 | ViewFuelVendorService.sendMail(vendorId).then(function(result) { |
170 | + console.log("email", vendorId) | |
160 | 171 | if(result != null && result.success){ |
161 | 172 | toastr.success(''+result.success+'', { |
162 | 173 | closeButton: true |
... | ... | @@ -340,22 +351,42 @@ |
340 | 351 | $scope.updateOmit = function(fuel, omit) { |
341 | 352 | $scope.fuelData = {}; |
342 | 353 | $scope.fuelData.expirationDate = new Date(fuel.expirationDate); |
343 | - $scope.fuelData.id = fuel.id; | |
354 | + $scope.fuelData.customMarginId = fuel.id; | |
344 | 355 | $scope.fuelData.omit = fuel.omit; |
345 | 356 | $scope.fuelData.papMargin = fuel.papMargin; |
346 | 357 | $scope.fuelData.papTotal = fuel.papTotal; |
347 | 358 | $scope.fuelData.cost = fuel.cost; |
348 | - ViewFuelVendorService.omitFuelPricing($scope.fuelData).then(function(result) { | |
349 | - if(result.success){ | |
350 | - toastr.success(''+result.success+'', { | |
351 | - closeButton: true | |
352 | - }) | |
353 | - }else{ | |
354 | - toastr.error(''+result.statusText+'', { | |
355 | - closeButton: true | |
356 | - }) | |
357 | - } | |
358 | - }) | |
359 | + if($scope.fuelData.omit == true) | |
360 | + { | |
361 | + // console.log("Insert API called",$scope.fuelData) | |
362 | + var customData = "vendorId=" + vendorId + "&customMarginId=" + $scope.fuelData.customMarginId; | |
363 | + console.log(customData) | |
364 | + ViewFuelVendorService.omitAddvendorFuel(customData).then(function(result) { | |
365 | + if (result.success) { | |
366 | + toastr.success('' + result.success + '', { | |
367 | + closeButton: true | |
368 | + }) | |
369 | + } else { | |
370 | + toastr.error('' + result.statusText + '', { | |
371 | + closeButton: true | |
372 | + }) | |
373 | + } | |
374 | + }) | |
375 | + }else{ | |
376 | + console.log("Delete API called",vendorId) | |
377 | + // var Id = "vendorId=" + vendorId + "&customMarginId=" + $scope.fuelData.customMarginId; | |
378 | + ViewFuelVendorService.omitDeleteVendorFuel(vendorId).then(function(result){ | |
379 | + if (result.success) { | |
380 | + toastr.success('' + result.success + '', { | |
381 | + closeButton: true | |
382 | + }) | |
383 | + } else { | |
384 | + toastr.error('' + result.statusText + '', { | |
385 | + closeButton: true | |
386 | + }) | |
387 | + } | |
388 | + }) | |
389 | + } | |
359 | 390 | } |
360 | 391 | |
361 | 392 | var deleteVendorId = ""; | ... | ... |
app/partials/viewFuelVendor/viewFuelVendor.html
... | ... | @@ -239,11 +239,12 @@ |
239 | 239 | <div class="widget"> |
240 | 240 | <div class="widget-header"> |
241 | 241 | <i class="fa fa-pencil"></i> |
242 | - <h3>Price Manager Reference</h3> | |
242 | + <h3>Price Manager Reference </h3> | |
243 | 243 | </div> |
244 | 244 | <div class="widget-content"> |
245 | 245 | <div class="table-responsive"> |
246 | - <table class="table table-hover table-striped strikeTable"> | |
246 | + <!-- <table class="table table-hover table-striped strikeTable"> --> | |
247 | + <table class="table table-hover table-striped"> | |
247 | 248 | <thead> |
248 | 249 | <tr> |
249 | 250 | <th>Omit</th> |
... | ... | @@ -255,7 +256,8 @@ |
255 | 256 | </tr> |
256 | 257 | </thead> |
257 | 258 | <tbody> |
258 | - <tr ng-repeat="fuel in fuelPricing | orderBy:'name' : 'reverse' | filter:{ status: true }" ng-class="fuel.fuelPricing.omit ? 'strikeout' : ''"> | |
259 | + <!-- <tr ng-repeat="fuel in fuelPricing | orderBy:'name' : 'reverse' | filter:{ status: true }" ng-class="fuel.fuelPricing.omit ? 'strikeout' : ''"> --> | |
260 | + <tr ng-repeat="fuel in fuelPricing | orderBy:'name' : 'reverse' | filter:{ status: true }"> | |
259 | 261 | <td><input type="checkbox" ng-model="fuel.fuelPricing.omit" ng-change="updateOmit(fuel.fuelPricing, fuel.status)"></td> |
260 | 262 | <td>{{fuel.name}}</td> |
261 | 263 | <td>${{fuel.fuelPricing.cost}}</td> | ... | ... |
app/partials/viewFuelVendor/viewFuelVendor.service.js
... | ... | @@ -198,6 +198,7 @@ |
198 | 198 | return deferred.promise; |
199 | 199 | } |
200 | 200 | |
201 | + /* This API is not in use for omit funtion */ | |
201 | 202 | this.omitFuelPricing = function(data) { |
202 | 203 | |
203 | 204 | var deferred = $q.defer(); |
... | ... | @@ -232,6 +233,56 @@ |
232 | 233 | return deferred.promise; |
233 | 234 | } |
234 | 235 | |
236 | + /* Omit Delete and Insert vendor fuel api */ | |
237 | + | |
238 | + this.getOmitVendor = function(id) { | |
239 | + | |
240 | + var deferred = $q.defer(); | |
241 | + $http({ | |
242 | + method : 'GET', | |
243 | + url : BASE_URL.url +'/vendor/omitData/'+id, | |
244 | + headers : {'Content-Type': 'application/json'}, | |
245 | + }) | |
246 | + .then(function (result){ | |
247 | + deferred.resolve(result.data); | |
248 | + },function (result){ | |
249 | + deferred.resolve(result.data); | |
250 | + }) | |
251 | + return deferred.promise; | |
252 | + } | |
253 | + | |
254 | + this.omitDeleteVendorFuel = function(id) { | |
255 | + | |
256 | + var deferred = $q.defer(); | |
257 | + $http({ | |
258 | + method : 'DELETE', | |
259 | + url : BASE_URL.url +'/vendor/omitData/'+id, | |
260 | + headers : {'Content-Type': 'application/json'}, | |
261 | + }) | |
262 | + .then(function (result){ | |
263 | + deferred.resolve(result.data); | |
264 | + },function (result){ | |
265 | + deferred.resolve(result.data); | |
266 | + }) | |
267 | + return deferred.promise; | |
268 | + } | |
269 | + | |
270 | + this.omitAddvendorFuel = function(data){ | |
271 | + var deferred = $q.defer(); | |
272 | + $http({ | |
273 | + method : 'POST', | |
274 | + url : BASE_URL.url +'/vendor/omitData/add', | |
275 | + data : data, | |
276 | + headers : {'Content-Type': 'application/json'}, | |
277 | + }) | |
278 | + .then(function (result){ | |
279 | + deferred.resolve(result.data); | |
280 | + },function (result){ | |
281 | + deferred.resolve(result.data); | |
282 | + }) | |
283 | + return deferred.promise; | |
284 | + } | |
285 | + | |
235 | 286 | |
236 | 287 | } |
237 | 288 | ... | ... |