diff --git a/app/css/custom.css b/app/css/custom.css index 66e2fa8..148cdc8 100644 --- a/app/css/custom.css +++ b/app/css/custom.css @@ -675,5 +675,4 @@ font-size: 10px !important; height: auto !important; min-height: 28px !important; -} - +} \ No newline at end of file diff --git a/app/partials/updateFuelManager/updateFuelManager.controller.js b/app/partials/updateFuelManager/updateFuelManager.controller.js index c895e52..d741f46 100644 --- a/app/partials/updateFuelManager/updateFuelManager.controller.js +++ b/app/partials/updateFuelManager/updateFuelManager.controller.js @@ -22,32 +22,79 @@ updateFuelManagerService.getATypeJets($scope.userProfileId).then(function(result) { $scope.aTypeJets = result; }) - $scope.toggleJestAccordian = function(id){ + updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { + $scope.vTypeJets = result; + console.log('second jets', result); + }) + $scope.toggleJestAccordian = function(id, index){ $('.'+id).slideDown(); $('#'+id).addClass('customActive'); $('#'+id+' select, #'+id+' input').prop("disabled", false); $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); $('#'+id+' .btn-default').css('display', 'none'); - + updateFuelManagerService.getJetTiers(id).then(function(tiers) { - $scope.tierList = tiers; + $scope.aTypeJets[index].tierList = tiers; }) } - $scope.tr = {}; - $scope.addNewTier = function(id){ - $scope.tr.marginTotal = '1.00'; - $scope.tr.marginTemplateId = id; + $scope.toggleVtypeJestAccordian = function(id, index){ + $('.'+id).slideDown(); + $('#'+id).addClass('customActive'); + $('#'+id+' select, #'+id+' input').prop("disabled", false); + $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); + $('#'+id+' .btn-default').css('display', 'none'); + + updateFuelManagerService.getJetTiers(id).then(function(tiers) { + $scope.vTypeJets[index].tierList = tiers; + }) + } + //$scope.trData = {}; + $scope.addNewTier = function(id, trData, index){ + $scope.tr = {}; + $scope.tr[index] = {}; + $scope.tr[index].minTierBreak = trData[index].minTierBreak; + $scope.tr[index].maxTierBreak = trData[index].maxTierBreak; + $scope.tr[index].margin = trData[index].margin; + $scope.tr[index].marginTotal = '1.00'; + $scope.tr[index].marginTemplateId = id; - var tierData = 'minTierBreak='+$scope.tr.minTierBreak+'&maxTierBreak='+$scope.tr.maxTierBreak+'&margin='+$scope.tr.margin+ - '&marginTotal='+$scope.tr.marginTotal+'&marginTemplateId='+$scope.tr.marginTemplateId; + var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ + '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; + + updateFuelManagerService.addNewTier(tierData).then(function(result) { + toastr.success('Successfully Added', { + closeButton: true + }) + trData[index].minTierBreak = ''; + trData[index].maxTierBreak = ''; + trData[index].margin = ''; + updateFuelManagerService.getJetTiers(id).then(function(tiers) { + $scope.aTypeJets[index].tierList = tiers; + }) + }) + } + $scope.addNewVtypeTier = function(id, vtrData, index){ + $scope.tr = {}; + $scope.tr[index] = {}; + $scope.tr[index].minTierBreak = vtrData[index].minTierBreak; + $scope.tr[index].maxTierBreak = vtrData[index].maxTierBreak; + $scope.tr[index].margin = vtrData[index].margin; + $scope.tr[index].marginTotal = '1.00'; + $scope.tr[index].marginTemplateId = id; + + var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ + '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; + updateFuelManagerService.addNewTier(tierData).then(function(result) { toastr.success('Successfully Added', { closeButton: true }) - $scope.tr = {}; + vtrData[index].minTierBreak = ''; + vtrData[index].maxTierBreak = ''; + vtrData[index].margin = ''; updateFuelManagerService.getJetTiers(id).then(function(tiers) { - $scope.tierList = tiers; + $scope.vTypeJets[index].tierList = tiers; }) }) } @@ -103,15 +150,42 @@ } + $scope.saveVtypeJetAccordian = function(jets){ + $scope.jetsDetail = jets; + $scope.jetsDetail.userProfileId = $scope.userProfileId; + //console.log('jets', $scope.jetsDetail); + $('.'+$scope.jetsDetail.id).slideUp(); + $('#'+$scope.jetsDetail.id).removeClass('customActive'); + $('#'+$scope.jetsDetail.id+' select, #'+$scope.jetsDetail.id+' input').prop("disabled", true); + $('#'+$scope.jetsDetail.id+' .btn-success, #'+$scope.jetsDetail.id+' .btn-danger').css('display', 'none'); + $('#'+$scope.jetsDetail.id+' .btn-default').css('display', 'inline-block'); + + var editVtypeJetData = 'productType='+$scope.jetsDetail.productType+'&marginName='+$scope.jetsDetail.marginName+'&pricingStructure='+$scope.jetsDetail.pricingStructure+'&marginValue='+$scope.jetsDetail.marginValue+'&userProfileId='+$scope.jetsDetail.userProfileId+'&marginId='+$scope.jetsDetail.id; + + updateFuelManagerService.editVtypeJetMargin(editVtypeJetData).then(function(result) { + console.log('newJet', editVtypeJetData); + toastr.success('Successfully Updated', { + closeButton: true + }) + updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { + $scope.vTypeJets = result; + console.log('second jets', result); + }) + }) + + } + + $scope.newJet = {}; + $scope.addNewMarginBtn = function(){ $('.addNewMargin').css('display', 'block'); } $scope.closeMarginPopup = function(){ $('.addNewMargin').css('display', 'none'); + $scope.newJet = {}; } - $scope.newJet = {}; - $scope.newJet.productType = ''; + //$scope.newJet.productType = ''; $scope.addNewATypeJet = function(){ $scope.newJet.productType = 'JET-A'; @@ -132,6 +206,37 @@ }) } + $scope.newVtypeJet = {}; + + $scope.addNewVtypePop = function(){ + $('.addNewVtype').css('display', 'block'); + } + $scope.closeNewVtypePop = function(){ + $('.addNewVtype').css('display', 'none'); + $scope.newVtypeJet = {}; + } + + $scope.addNewVTypeJet = function(){ + $scope.newVtypeJet.productType = 'AVGAS'; + $scope.newVtypeJet.userProfileId = $scope.userProfileId; + + var vJetData = 'productType='+$scope.newVtypeJet.productType+'&marginName='+$scope.newVtypeJet.marginName+'&pricingStructure='+$scope.newVtypeJet.pricingStructure+'&marginValue='+$scope.newVtypeJet.marginValue+'&userProfileId='+$scope.newVtypeJet.userProfileId; + + updateFuelManagerService.addNewVtypeJet(vJetData).then(function(result) { + + toastr.success('Successfully Added', { + closeButton: true + }) + $('.addNewVtype').css('display', 'none'); + updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { + $scope.vTypeJets = result; + + }) + }) + + } + + $scope.sendEmail = {}; $scope.sendEmail.pricing = ''; @@ -192,6 +297,16 @@ } + updateFuelManagerService.getFutureFuelPricing($scope.userProfileId).then(function(result) { + $scope.futureFuelPricing = result; + console.log('$scope.futureFuelPricing', $scope.futureFuelPricing); + /*for (var i = 0; i<$scope.fuelPricing.length; i++) { + if ($scope.fuelPricing[i].expirationDate != null) { + $scope.fuelPricing[i].expirationDate = new Date($scope.fuelPricing[i].expirationDate) + } + }*/ + }) + }]); diff --git a/app/partials/updateFuelManager/updateFuelManager.html b/app/partials/updateFuelManager/updateFuelManager.html index 59f1256..ca3b6d2 100644 --- a/app/partials/updateFuelManager/updateFuelManager.html +++ b/app/partials/updateFuelManager/updateFuelManager.html @@ -27,7 +27,7 @@ Cost Margin PAP(Total) - Date + Expires @@ -45,7 +45,7 @@ $ {{fuelPricing.cost -- fuelPricing.papMargin}} - + @@ -89,12 +89,12 @@
- +
 
@@ -360,47 +172,44 @@
-

Queue Future Pricing

- +

Queue Future Pricing

-
Queue Future Fuel Pricing Here
- +

Update Queue Future Fuel Pricing Here

+
- - - + + + - - - - - - - - - - - - - + + + + + +
Product CostPAP(Total)DeployNext Expiration PAP(Total) Deploy Next Expiration
Name and inc.Jemmy
Name and inc.Jemmy
+ {{fuelPricing.product.name}} + + + + $ {{fuelPricing.cost -- fuelPricing.papMargin}} + + + + +
- +
@@ -412,172 +221,97 @@
-

JET-A Customer Margin Template

+

AVGAS 100LL Customer Margin Template

- +
- +
+
+ {{jets.marginName}} + + $ + +
+ + +
+
-
-
- -
-
-
-
-
-
-
Omit
-
-
-
AirCraft Size
-
-
-
Ramp/Facility Fee
-
-
-
Avoidance
-
-
-
-
- -
-
-

Very Light Jet -

-
-
- -
-
- -
-
-
-
- -
-
-

Light Jet -

-
-
- -
-
- -
-
-
-
-
+ -
-
- -
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
-
-
-
- --> - -
- -
-
-
-
-
-
-
-
Omit
-
-
-
AirCraft Size
-
-
-
Ramp/Facility Fee
-
-
-
Avoidance
-
+
+ -${{tier.margin}} + +   + + (${{tier.marginTotal}}) + + + + + +
-
-
- -
-
-

Very Light Jet -

-
-
- -
-
- -
+
+
+
+ + - + gal. +
-
-
- -
-
-

Light Jet -

-
-
- -
-
- -
+
+ $ + + +
-
-
+ +
+
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + +
 
+
+
+
+    + +
- +
@@ -630,6 +364,45 @@
+