Commit 8707ba5fd1cbdbd2a3222b9c6538fb93732a5a09
1 parent
882908c84a
Exists in
master
fuel manager done
Showing
4 changed files
with
338 additions
and
387 deletions
Show diff stats
app/css/custom.css
app/partials/updateFuelManager/updateFuelManager.controller.js
... | ... | @@ -22,32 +22,79 @@ |
22 | 22 | updateFuelManagerService.getATypeJets($scope.userProfileId).then(function(result) { |
23 | 23 | $scope.aTypeJets = result; |
24 | 24 | }) |
25 | - $scope.toggleJestAccordian = function(id){ | |
25 | + updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { | |
26 | + $scope.vTypeJets = result; | |
27 | + console.log('second jets', result); | |
28 | + }) | |
29 | + $scope.toggleJestAccordian = function(id, index){ | |
26 | 30 | $('.'+id).slideDown(); |
27 | 31 | $('#'+id).addClass('customActive'); |
28 | 32 | $('#'+id+' select, #'+id+' input').prop("disabled", false); |
29 | 33 | $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); |
30 | 34 | $('#'+id+' .btn-default').css('display', 'none'); |
31 | - | |
35 | + | |
32 | 36 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { |
33 | - $scope.tierList = tiers; | |
37 | + $scope.aTypeJets[index].tierList = tiers; | |
34 | 38 | }) |
35 | 39 | } |
36 | - $scope.tr = {}; | |
37 | - $scope.addNewTier = function(id){ | |
38 | - $scope.tr.marginTotal = '1.00'; | |
39 | - $scope.tr.marginTemplateId = id; | |
40 | + $scope.toggleVtypeJestAccordian = function(id, index){ | |
41 | + $('.'+id).slideDown(); | |
42 | + $('#'+id).addClass('customActive'); | |
43 | + $('#'+id+' select, #'+id+' input').prop("disabled", false); | |
44 | + $('#'+id+' .btn-success, #'+id+' .btn-danger').css('display', 'inline-block'); | |
45 | + $('#'+id+' .btn-default').css('display', 'none'); | |
46 | + | |
47 | + updateFuelManagerService.getJetTiers(id).then(function(tiers) { | |
48 | + $scope.vTypeJets[index].tierList = tiers; | |
49 | + }) | |
50 | + } | |
51 | + //$scope.trData = {}; | |
52 | + $scope.addNewTier = function(id, trData, index){ | |
53 | + $scope.tr = {}; | |
54 | + $scope.tr[index] = {}; | |
55 | + $scope.tr[index].minTierBreak = trData[index].minTierBreak; | |
56 | + $scope.tr[index].maxTierBreak = trData[index].maxTierBreak; | |
57 | + $scope.tr[index].margin = trData[index].margin; | |
58 | + $scope.tr[index].marginTotal = '1.00'; | |
59 | + $scope.tr[index].marginTemplateId = id; | |
40 | 60 | |
41 | - var tierData = 'minTierBreak='+$scope.tr.minTierBreak+'&maxTierBreak='+$scope.tr.maxTierBreak+'&margin='+$scope.tr.margin+ | |
42 | - '&marginTotal='+$scope.tr.marginTotal+'&marginTemplateId='+$scope.tr.marginTemplateId; | |
61 | + var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ | |
62 | + '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; | |
63 | + | |
64 | + updateFuelManagerService.addNewTier(tierData).then(function(result) { | |
65 | + toastr.success('Successfully Added', { | |
66 | + closeButton: true | |
67 | + }) | |
68 | + trData[index].minTierBreak = ''; | |
69 | + trData[index].maxTierBreak = ''; | |
70 | + trData[index].margin = ''; | |
71 | + updateFuelManagerService.getJetTiers(id).then(function(tiers) { | |
72 | + $scope.aTypeJets[index].tierList = tiers; | |
73 | + }) | |
74 | + }) | |
75 | + } | |
43 | 76 | |
77 | + $scope.addNewVtypeTier = function(id, vtrData, index){ | |
78 | + $scope.tr = {}; | |
79 | + $scope.tr[index] = {}; | |
80 | + $scope.tr[index].minTierBreak = vtrData[index].minTierBreak; | |
81 | + $scope.tr[index].maxTierBreak = vtrData[index].maxTierBreak; | |
82 | + $scope.tr[index].margin = vtrData[index].margin; | |
83 | + $scope.tr[index].marginTotal = '1.00'; | |
84 | + $scope.tr[index].marginTemplateId = id; | |
85 | + | |
86 | + var tierData = 'minTierBreak='+$scope.tr[index].minTierBreak+'&maxTierBreak='+$scope.tr[index].maxTierBreak+'&margin='+$scope.tr[index].margin+ | |
87 | + '&marginTotal='+$scope.tr[index].marginTotal+'&marginTemplateId='+$scope.tr[index].marginTemplateId; | |
88 | + | |
44 | 89 | updateFuelManagerService.addNewTier(tierData).then(function(result) { |
45 | 90 | toastr.success('Successfully Added', { |
46 | 91 | closeButton: true |
47 | 92 | }) |
48 | - $scope.tr = {}; | |
93 | + vtrData[index].minTierBreak = ''; | |
94 | + vtrData[index].maxTierBreak = ''; | |
95 | + vtrData[index].margin = ''; | |
49 | 96 | updateFuelManagerService.getJetTiers(id).then(function(tiers) { |
50 | - $scope.tierList = tiers; | |
97 | + $scope.vTypeJets[index].tierList = tiers; | |
51 | 98 | }) |
52 | 99 | }) |
53 | 100 | } |
... | ... | @@ -103,15 +150,42 @@ |
103 | 150 | |
104 | 151 | } |
105 | 152 | |
153 | + $scope.saveVtypeJetAccordian = function(jets){ | |
154 | + $scope.jetsDetail = jets; | |
155 | + $scope.jetsDetail.userProfileId = $scope.userProfileId; | |
156 | + //console.log('jets', $scope.jetsDetail); | |
157 | + $('.'+$scope.jetsDetail.id).slideUp(); | |
158 | + $('#'+$scope.jetsDetail.id).removeClass('customActive'); | |
159 | + $('#'+$scope.jetsDetail.id+' select, #'+$scope.jetsDetail.id+' input').prop("disabled", true); | |
160 | + $('#'+$scope.jetsDetail.id+' .btn-success, #'+$scope.jetsDetail.id+' .btn-danger').css('display', 'none'); | |
161 | + $('#'+$scope.jetsDetail.id+' .btn-default').css('display', 'inline-block'); | |
162 | + | |
163 | + 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; | |
164 | + | |
165 | + updateFuelManagerService.editVtypeJetMargin(editVtypeJetData).then(function(result) { | |
166 | + console.log('newJet', editVtypeJetData); | |
167 | + toastr.success('Successfully Updated', { | |
168 | + closeButton: true | |
169 | + }) | |
170 | + updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { | |
171 | + $scope.vTypeJets = result; | |
172 | + console.log('second jets', result); | |
173 | + }) | |
174 | + }) | |
175 | + | |
176 | + } | |
177 | + | |
178 | + $scope.newJet = {}; | |
179 | + | |
106 | 180 | $scope.addNewMarginBtn = function(){ |
107 | 181 | $('.addNewMargin').css('display', 'block'); |
108 | 182 | } |
109 | 183 | $scope.closeMarginPopup = function(){ |
110 | 184 | $('.addNewMargin').css('display', 'none'); |
185 | + $scope.newJet = {}; | |
111 | 186 | } |
112 | 187 | |
113 | - $scope.newJet = {}; | |
114 | - $scope.newJet.productType = ''; | |
188 | + //$scope.newJet.productType = ''; | |
115 | 189 | |
116 | 190 | $scope.addNewATypeJet = function(){ |
117 | 191 | $scope.newJet.productType = 'JET-A'; |
... | ... | @@ -132,6 +206,37 @@ |
132 | 206 | }) |
133 | 207 | } |
134 | 208 | |
209 | + $scope.newVtypeJet = {}; | |
210 | + | |
211 | + $scope.addNewVtypePop = function(){ | |
212 | + $('.addNewVtype').css('display', 'block'); | |
213 | + } | |
214 | + $scope.closeNewVtypePop = function(){ | |
215 | + $('.addNewVtype').css('display', 'none'); | |
216 | + $scope.newVtypeJet = {}; | |
217 | + } | |
218 | + | |
219 | + $scope.addNewVTypeJet = function(){ | |
220 | + $scope.newVtypeJet.productType = 'AVGAS'; | |
221 | + $scope.newVtypeJet.userProfileId = $scope.userProfileId; | |
222 | + | |
223 | + var vJetData = 'productType='+$scope.newVtypeJet.productType+'&marginName='+$scope.newVtypeJet.marginName+'&pricingStructure='+$scope.newVtypeJet.pricingStructure+'&marginValue='+$scope.newVtypeJet.marginValue+'&userProfileId='+$scope.newVtypeJet.userProfileId; | |
224 | + | |
225 | + updateFuelManagerService.addNewVtypeJet(vJetData).then(function(result) { | |
226 | + | |
227 | + toastr.success('Successfully Added', { | |
228 | + closeButton: true | |
229 | + }) | |
230 | + $('.addNewVtype').css('display', 'none'); | |
231 | + updateFuelManagerService.getVTypeJets($scope.userProfileId).then(function(result) { | |
232 | + $scope.vTypeJets = result; | |
233 | + | |
234 | + }) | |
235 | + }) | |
236 | + | |
237 | + } | |
238 | + | |
239 | + | |
135 | 240 | $scope.sendEmail = {}; |
136 | 241 | $scope.sendEmail.pricing = ''; |
137 | 242 | |
... | ... | @@ -192,6 +297,16 @@ |
192 | 297 | |
193 | 298 | } |
194 | 299 | |
300 | + updateFuelManagerService.getFutureFuelPricing($scope.userProfileId).then(function(result) { | |
301 | + $scope.futureFuelPricing = result; | |
302 | + console.log('$scope.futureFuelPricing', $scope.futureFuelPricing); | |
303 | + /*for (var i = 0; i<$scope.fuelPricing.length; i++) { | |
304 | + if ($scope.fuelPricing[i].expirationDate != null) { | |
305 | + $scope.fuelPricing[i].expirationDate = new Date($scope.fuelPricing[i].expirationDate) | |
306 | + } | |
307 | + }*/ | |
308 | + }) | |
309 | + | |
195 | 310 | |
196 | 311 | }]); |
197 | 312 | ... | ... |
app/partials/updateFuelManager/updateFuelManager.html
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | <th> Cost</th> |
28 | 28 | <th> Margin</th> |
29 | 29 | <th> PAP(Total)</th> |
30 | - <th> Date</th> | |
30 | + <th style="color: #F90;"> Expires</th> | |
31 | 31 | </tr> |
32 | 32 | </thead> |
33 | 33 | <tbody> |
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 | <span style="line-height: 31px; color: #1ab394;">$ {{fuelPricing.cost -- fuelPricing.papMargin}}</span> |
46 | 46 | </td> |
47 | 47 | <td> |
48 | - <input type="date" class="form-control" ng-model="fuelPricing.expirationDate" style="height:31px; padding: 6px 0; width: 100px;"> | |
48 | + <input type="date" class="form-control" ng-model="fuelPricing.expirationDate" style="height:31px; padding: 6px 0; width: 100px; color: #F90;"> | |
49 | 49 | </td> |
50 | 50 | </tr> |
51 | 51 | </tbody> |
... | ... | @@ -89,12 +89,12 @@ |
89 | 89 | <div class="pull-right"> |
90 | 90 | <button class="btn btn-success" style="display: none;" ng-click="saveJetAccordian(jets)">Save</button> |
91 | 91 | <button class="btn btn-danger" style="display: none;" ng-click="deleteJetAccordian(jets.id)">Delete</button> |
92 | - <button class="btn btn-default" ng-click="toggleJestAccordian(jets.id)">Edit</button> | |
92 | + <button class="btn btn-default" ng-click="toggleJestAccordian(jets.id, $index)">Edit</button> | |
93 | 93 | </div> |
94 | 94 | <div class="clearfix"></div> |
95 | 95 | </div> |
96 | 96 | <div class="customAccordianTabBody {{jets.id}}" style="display: none;"> |
97 | - <div class="tierListWrap" ng-repeat="tier in tierList"> | |
97 | + <div class="tierListWrap" ng-repeat="tier in aTypeJets[$index].tierList"> | |
98 | 98 | <div class="tierListHead" style="height: 36px;"> |
99 | 99 | <span class="pull-left tierHeadingSpan" ng-hide="showEditTier">{{tier.minTierBreak}}-{{tier.maxTierBreak}} gal. |
100 | 100 | </span> |
... | ... | @@ -121,15 +121,15 @@ |
121 | 121 | </div> |
122 | 122 | <div class="tierListWrap" style="width: 160px;"> |
123 | 123 | <div class="tierListHead" style="border-right: 1px solid #ddd;"> |
124 | - <input type="text" placeholder="min" ng-model="tr.minTierBreak"> | |
124 | + <input type="text" placeholder="min" ng-model="trData[$index].minTierBreak"> | |
125 | 125 | <span>-</span> |
126 | - <input type="text" placeholder="max" ng-model="tr.maxTierBreak"> <b>gal.</b> | |
126 | + <input type="text" placeholder="max" ng-model="trData[$index].maxTierBreak"> <b>gal.</b> | |
127 | 127 | <div class="clearfix"></div> |
128 | 128 | </div> |
129 | 129 | <div class="tierListBody" style="border-right: 1px solid #ddd;"> |
130 | 130 | <span style="color: #449d44;">$</span> |
131 | - <input type="text" placeholder="margin" ng-model="tr.margin" class="tierTextBox" style="width: 70px; height: 24px;"> | |
132 | - <button class="addTierBtn" ng-click="addNewTier(jets.id)">Add Tier</button> | |
131 | + <input type="text" placeholder="margin" ng-model="trData[$index].margin" class="tierTextBox" style="width: 70px; height: 24px;"> | |
132 | + <button class="addTierBtn" ng-click="addNewTier(jets.id, trData, $index)">Add Tier</button> | |
133 | 133 | <div class="clearfix"></div> |
134 | 134 | </div> |
135 | 135 | </div> |
... | ... | @@ -145,194 +145,6 @@ |
145 | 145 | <textarea class="form-control resizeTextarea" placeholder="Message..."></textarea> |
146 | 146 | </div> |
147 | 147 | </div> |
148 | - | |
149 | - <!-- tab 2 --> | |
150 | - | |
151 | - <!-- <div class="customAccordianHeader" id="customTabs2"> | |
152 | - <span>Jet Aircraft</span> | |
153 | - <select class="form-control" disabled="true"> | |
154 | - <option>Pricing Structure</option> | |
155 | - <option>Retail-(minus)</option> | |
156 | - <option>Cost+(plus)</option> | |
157 | - <option>Direct=(equals)</option> | |
158 | - </select> | |
159 | - <input type="text" name="" disabled="true" class="form-control" value="$1.7500"> | |
160 | - <div class="pull-right"> | |
161 | - <button class="btn btn-success" style="display: none;">Save</button> | |
162 | - <button class="btn btn-danger" style="display: none;">Delete</button> | |
163 | - <button class="btn btn-default" id="customTabToggle2">Edit</button> | |
164 | - </div> | |
165 | - <div class="clearfix"></div> | |
166 | - </div> | |
167 | - <div class="customAccordianTabBody" id="customTabsBody2" style="display: none;"> | |
168 | - <table class="customTableWithFilter"> | |
169 | - <thead> | |
170 | - <tr> | |
171 | - <th> | |
172 | - <span class="pull-left">1-250 gal.</span> | |
173 | - <i class="fa fa-pencil-square-o pull-right" aria-hidden="true"></i> | |
174 | - </th> | |
175 | - <th> | |
176 | - <span class="pull-left">1-250 gal.</span> | |
177 | - <i class="fa fa-pencil-square-o pull-right" aria-hidden="true"></i> | |
178 | - </th> | |
179 | - <th> | |
180 | - <input type="text" placeholder="min" name=""> - | |
181 | - <input type="text" placeholder="max" name=""> | |
182 | - <span>gal.</span> | |
183 | - </th> | |
184 | - <th> </th> | |
185 | - </tr> | |
186 | - </thead> | |
187 | - <tbody> | |
188 | - <tr> | |
189 | - <td> | |
190 | - <span class="pull-left">-$0.0000</span> | |
191 | - <span class="pull-right">($1.7500)</span> | |
192 | - </td> | |
193 | - <td> | |
194 | - <span class="pull-left">-$0.0000</span> | |
195 | - <span class="pull-right">($1.7500)</span> | |
196 | - </td> | |
197 | - <td> | |
198 | - <span>$</span> | |
199 | - <input type="text" placeholder="margin" class="tierTextBox" name=""> | |
200 | - <button class="addTierButton">Add Tier</button> | |
201 | - </td> | |
202 | - <td> | |
203 | - <i class="fa fa-trash-o" aria-hidden="true"></i> | |
204 | - </td> | |
205 | - </tr> | |
206 | - </tbody> | |
207 | - </table> | |
208 | - <textarea class="form-control resizeTextarea" placeholder="Message..."></textarea> | |
209 | - </div> --> | |
210 | - | |
211 | - <!-- tab 3 --> | |
212 | - | |
213 | - <!-- <div class="customAccordianHeader" id="customTabs3"> | |
214 | - <span>Jet Aircraft</span> | |
215 | - <select class="form-control" disabled="true"> | |
216 | - <option>Pricing Structure</option> | |
217 | - <option>Retail-(minus)</option> | |
218 | - <option>Cost+(plus)</option> | |
219 | - <option>Direct=(equals)</option> | |
220 | - </select> | |
221 | - <input type="text" name="" disabled="true" class="form-control" value="$1.7500"> | |
222 | - <div class="pull-right"> | |
223 | - <button class="btn btn-success" style="display: none;">Save</button> | |
224 | - <button class="btn btn-danger" style="display: none;">Delete</button> | |
225 | - <button class="btn btn-default" id="customTabToggle3">Edit</button> | |
226 | - </div> | |
227 | - <div class="clearfix"></div> | |
228 | - </div> | |
229 | - <div class="customAccordianTabBody" id="customTabsBody3" style="display: none;"> | |
230 | - <table class="customTableWithFilter"> | |
231 | - <thead> | |
232 | - <tr> | |
233 | - <th> | |
234 | - <span class="pull-left">1-250 gal.</span> | |
235 | - <i class="fa fa-pencil-square-o pull-right" aria-hidden="true"></i> | |
236 | - </th> | |
237 | - <th> | |
238 | - <span class="pull-left">1-250 gal.</span> | |
239 | - <i class="fa fa-pencil-square-o pull-right" aria-hidden="true"></i> | |
240 | - </th> | |
241 | - <th> | |
242 | - <input type="text" placeholder="min" name=""> - | |
243 | - <input type="text" placeholder="max" name=""> | |
244 | - <span>gal.</span> | |
245 | - </th> | |
246 | - <th> </th> | |
247 | - </tr> | |
248 | - </thead> | |
249 | - <tbody> | |
250 | - <tr> | |
251 | - <td> | |
252 | - <span class="pull-left">-$0.0000</span> | |
253 | - <span class="pull-right">($1.7500)</span> | |
254 | - </td> | |
255 | - <td> | |
256 | - <span class="pull-left">-$0.0000</span> | |
257 | - <span class="pull-right">($1.7500)</span> | |
258 | - </td> | |
259 | - <td> | |
260 | - <span>$</span> | |
261 | - <input type="text" placeholder="margin" class="tierTextBox" name=""> | |
262 | - <button class="addTierButton">Add Tier</button> | |
263 | - </td> | |
264 | - <td> | |
265 | - <i class="fa fa-trash-o" aria-hidden="true"></i> | |
266 | - </td> | |
267 | - </tr> | |
268 | - </tbody> | |
269 | - </table> | |
270 | - <textarea class="form-control resizeTextarea" placeholder="Message..."></textarea> | |
271 | - </div> --> | |
272 | - | |
273 | - <!-- tab 4 --> | |
274 | - | |
275 | - <!-- <div class="customAccordianHeader" id="customTabs4"> | |
276 | - <span>Jet Aircraft</span> | |
277 | - <select class="form-control" disabled="true"> | |
278 | - <option>Pricing Structure</option> | |
279 | - <option>Retail-(minus)</option> | |
280 | - <option>Cost+(plus)</option> | |
281 | - <option>Direct=(equals)</option> | |
282 | - </select> | |
283 | - <input type="text" name="" disabled="true" class="form-control" value="$1.7500"> | |
284 | - <div class="pull-right"> | |
285 | - <button class="btn btn-success" style="display: none;">Save</button> | |
286 | - <button class="btn btn-danger" style="display: none;">Delete</button> | |
287 | - <button class="btn btn-default" id="customTabToggle4">Edit</button> | |
288 | - </div> | |
289 | - <div class="clearfix"></div> | |
290 | - </div> | |
291 | - <div class="customAccordianTabBody" id="customTabsBody4" style="display: none;"> | |
292 | - <table class="customTableWithFilter"> | |
293 | - <thead> | |
294 | - <tr> | |
295 | - <th> | |
296 | - <span class="pull-left">1-250 gal.</span> | |
297 | - <i class="fa fa-pencil-square-o pull-right" aria-hidden="true"></i> | |
298 | - </th> | |
299 | - <th> | |
300 | - <span class="pull-left">1-250 gal.</span> | |
301 | - <i class="fa fa-pencil-square-o pull-right" aria-hidden="true"></i> | |
302 | - </th> | |
303 | - <th> | |
304 | - <input type="text" placeholder="min" name=""> - | |
305 | - <input type="text" placeholder="max" name=""> | |
306 | - <span>gal.</span> | |
307 | - </th> | |
308 | - <th> </th> | |
309 | - </tr> | |
310 | - </thead> | |
311 | - <tbody> | |
312 | - <tr> | |
313 | - <td> | |
314 | - <span class="pull-left">-$0.0000</span> | |
315 | - <span class="pull-right">($1.7500)</span> | |
316 | - </td> | |
317 | - <td> | |
318 | - <span class="pull-left">-$0.0000</span> | |
319 | - <span class="pull-right">($1.7500)</span> | |
320 | - </td> | |
321 | - <td> | |
322 | - <span>$</span> | |
323 | - <input type="text" placeholder="margin" class="tierTextBox" name=""> | |
324 | - <button class="addTierButton">Add Tier</button> | |
325 | - </td> | |
326 | - <td> | |
327 | - <i class="fa fa-trash-o" aria-hidden="true"></i> | |
328 | - </td> | |
329 | - </tr> | |
330 | - </tbody> | |
331 | - </table> | |
332 | - <textarea class="form-control resizeTextarea" placeholder="Message..."></textarea> | |
333 | - </div> --> | |
334 | - | |
335 | - | |
336 | 148 | </div> |
337 | 149 | </section> |
338 | 150 | <div class="row"> </div> |
... | ... | @@ -360,47 +172,44 @@ |
360 | 172 | <div class="widget stacked"> |
361 | 173 | <div class="widget-header"> |
362 | 174 | <i class="fa fa-pencil"></i> |
363 | - <h3>Queue Future Pricing </h3> | |
364 | - <!-- <select style="float: right;margin:10px;background-color:#cd7b00;"> | |
365 | - <option>Send Pricing Email</option> | |
366 | - <option>Margin 1</option> | |
367 | - <option>Margin 2</option> | |
368 | - <option>Margin Tenants</option> | |
369 | - </select> --> | |
175 | + <h3>Queue Future Pricing</h3> | |
370 | 176 | </div> |
371 | 177 | <!-- /widget-header --> |
372 | 178 | <div class="widget-content"> |
373 | - <h6>Queue Future Fuel Pricing Here</h6> | |
374 | - <table class="table table-striped"> | |
179 | + <h4>Update Queue Future Fuel Pricing Here</h4> | |
180 | + <table class="table"> | |
375 | 181 | <thead> |
376 | 182 | <tr> |
377 | 183 | <th> Product</th> |
378 | 184 | <th> Cost</th> |
379 | - <th>PAP(Total)</th> | |
380 | - <th>Deploy</th> | |
381 | - <th>Next Expiration</th> | |
185 | + <th> PAP(Total)</th> | |
186 | + <th> Deploy</th> | |
187 | + <th style="color: #F90;"> Next Expiration</th> | |
382 | 188 | </tr> |
383 | 189 | </thead> |
384 | 190 | <tbody> |
385 | - <tr> | |
386 | - <td>Name and inc.</td> | |
387 | - <td><input type="text" class="form-control" style="height:31px;" name="name" id="name"></td> | |
388 | - <td><input type="text" class="form-control" style="height:31px;" name="name" id="name"></td> | |
389 | - <td>Jemmy</td> | |
390 | - <td><input type="text" class="form-control" style="height:31px;" name="name" id="name"></td> | |
391 | - </tr> | |
392 | - <tr> | |
393 | - <td>Name and inc.</td> | |
394 | - <td><input type="text" class="form-control" style="height:31px;" name="name" id="name"></td> | |
395 | - <td><input type="text" class="form-control" style="height:31px;" name="name" id="name"></td> | |
396 | - <td>Jemmy</td> | |
397 | - <td><input type="text" class="form-control" style="height:31px;" name="name" id="name"></td> | |
191 | + <tr ng-repeat="fuelPricing in futureFuelPricing"> | |
192 | + <td> | |
193 | + <span style="line-height: 31px;">{{fuelPricing.product.name}}</span> | |
194 | + </td> | |
195 | + <td> | |
196 | + <input type="text" class="form-control" ng-model="fuelPricing.cost" style="height:31px; width: 50px; padding: 6px 0;"> | |
197 | + </td> | |
198 | + <td> | |
199 | + <span style="line-height: 31px; color: #1ab394;">$ {{fuelPricing.cost -- fuelPricing.papMargin}}</span> | |
200 | + </td> | |
201 | + <td> | |
202 | + <input type="date" class="form-control" ng-model="fuelPricing.expirationDate" style="height:31px; padding: 6px 0; width: 100px;"> | |
203 | + </td> | |
204 | + <td> | |
205 | + <input type="date" class="form-control" ng-model="fuelPricing.expirationDate" style="height:31px; padding: 6px 0; width: 100px; color: #F90;"> | |
206 | + </td> | |
398 | 207 | </tr> |
399 | 208 | </tbody> |
400 | 209 | </table> |
401 | 210 | <div class="row" style="margin-left: 0px;"> |
402 | 211 | <div class="col-md-12" style= "text-align: right;"> |
403 | - <button type="button" class="btn btn-success btn-xs">Save</button> | |
212 | + <button type="button" class="btn btn-success btn-xs" ng-click="updateFuelPricingClick()">Save</button> | |
404 | 213 | </div> |
405 | 214 | </div> |
406 | 215 | </div> |
... | ... | @@ -412,172 +221,97 @@ |
412 | 221 | <div class="widget stacked"> |
413 | 222 | <div class="widget-header"> |
414 | 223 | <i class="fa fa-pencil"></i> |
415 | - <h3><b>JET-A</b> Customer Margin Template</h3> | |
224 | + <h3><b style="color: 39c;">AVGAS 100LL </b> <i>Customer Margin Template</i></h3> | |
416 | 225 | <div class="pull-right"> |
417 | - <button type="submit" class="btn btn-success btn-sm"><i class="icon-ok"></i>+   Add Aircraft</button> | |
226 | + <button type="submit" class="btn btn-success btn-sm" ng-click="addNewVtypePop()" style="margin-top: 4px; margin-right: 10px;"><i class="icon-ok"></i>+   Add Aircraft</button> | |
418 | 227 | </div> |
419 | 228 | </div> |
420 | 229 | <!-- /widget-header --> |
421 | 230 | <div class="widget-content"> |
422 | - <!-- <section id="accordions"> | |
423 | - <div class="panel-group accordion"> | |
424 | - <div class="panel panel-default open"> | |
425 | - <div class="panel-heading"> | |
426 | - <h4 class="panel-title"> | |
427 | - <a class="accordion-toggle" style="float:left;" data-toggle="collapse" data-parent=".accordion" href="#collapseOne"> | |
428 | - Margin 1 | |
429 | - </a> | |
430 | - <span style="color:#ff9900;font-size:12px;margin-left:50px">Retail- (minus) </span><span style="font-size:12px">$1.1500</span> | |
431 | - </h4> | |
432 | - </div> | |
433 | - <div id="collapseOne" class="panel-collapse collapse in"> | |
434 | - <div class="panel-body"> | |
435 | - <div id="editor2" style="visibility: hidden;"> | |
436 | - </div> | |
231 | + <section id="accordions"> | |
232 | + <div class="newCustomAccordian"> | |
233 | + <!-- tab 1 --> | |
234 | + <div ng-repeat="jets in vTypeJets"> | |
235 | + <div class="customAccordianHeader" id="{{jets.id}}"> | |
236 | + <span>{{jets.marginName}}</span> | |
237 | + <select class="form-control" disabled="true" ng-model="jets.pricingStructure"> | |
238 | + <option value="" disabled selected>Pricing Structure</option> | |
239 | + <option value="minus">Retail-(minus)</option> | |
240 | + <option value="plus">Cost+(plus)</option> | |
241 | + <option value="equal">Direct=(equal)</option> | |
242 | + </select> | |
243 | + <span style="margin-right: 0;">$</span> | |
244 | + <input type="text" disabled="true" class="form-control" ng-model="jets.marginValue"> | |
245 | + <div class="pull-right"> | |
246 | + <button class="btn btn-success" style="display: none;" ng-click="saveVtypeJetAccordian(jets)">Save</button> | |
247 | + <button class="btn btn-danger" style="display: none;" ng-click="deleteVtypeJetAccordian(jets.id)">Delete</button> | |
248 | + <button class="btn btn-default" ng-click="toggleVtypeJestAccordian(jets.id, $index)">Edit</button> | |
437 | 249 | </div> |
250 | + <div class="clearfix"></div> | |
438 | 251 | </div> |
439 | - </div> | |
440 | - <div class="panel panel-default"> | |
441 | - <div class="panel-heading"> | |
442 | - <h4 class="panel-title"> | |
443 | - <a class="accordion-toggle" data-toggle="collapse" data-parent=".accordion" href="#collapseTwo"> | |
444 | - TurboPop AirCraft | |
445 | - </a> | |
446 | - </h4> | |
447 | - </div> | |
448 | - <div id="collapseTwo" class="panel-collapse collapse"> | |
449 | - <div class="panel-body"> | |
450 | - <div class="row" style="margin-left: 0px;"> | |
451 | - <div class="col-md-8"> | |
452 | - <div class="row" style="margin-bottom: 5px;"> | |
453 | - <div class="col-md-1" style="text-align: right;"> | |
454 | - <h5 style="color: blue;font-weight: bold;">Omit</h5> | |
455 | - </div> | |
456 | - <div class="col-md-5"> | |
457 | - <h5 style="color: blue;font-weight: bold;">AirCraft Size</h5> | |
458 | - </div> | |
459 | - <div class="col-md-3"> | |
460 | - <h5 style="color: blue;font-weight: bold;">Ramp/Facility Fee</h5> | |
461 | - </div> | |
462 | - <div class="col-md-3"> | |
463 | - <h5 style="color: blue;font-weight: bold;">Avoidance</h5> | |
464 | - </div> | |
465 | - </div> | |
466 | - <div class="row" style="margin-bottom: 5px;"> | |
467 | - <div class="col-md-1" style="text-align: right;"> | |
468 | - <input type="checkbox" name="validateCheckbox" value="1"> | |
469 | - </div> | |
470 | - <div class="col-md-5"> | |
471 | - <p>Very Light Jet | |
472 | - </p> | |
473 | - </div> | |
474 | - <div class="col-md-3"> | |
475 | - <input type="text" class="form-control" name="name" id="name"> | |
476 | - </div> | |
477 | - <div class="col-md-3"> | |
478 | - <input type="text" class="form-control" name="name" id="name"> | |
479 | - </div> | |
480 | - </div> | |
481 | - <div class="row" style="margin-bottom: 5px;"> | |
482 | - <div class="col-md-1" style="text-align: right;"> | |
483 | - <input type="checkbox" name="validateCheckbox" value="1"> | |
484 | - </div> | |
485 | - <div class="col-md-5"> | |
486 | - <p> Light Jet | |
487 | - </p> | |
488 | - </div> | |
489 | - <div class="col-md-3"> | |
490 | - <input type="text" class="form-control" name="name" id="name"> | |
491 | - </div> | |
492 | - <div class="col-md-3"> | |
493 | - <input type="text" class="form-control" name="name" id="name"> | |
494 | - </div> | |
495 | - </div> | |
496 | - </div> | |
497 | - <div class="col-md-4"> | |
498 | - </div> | |
252 | + <div class="customAccordianTabBody {{jets.id}}" style="display: none;"> | |
253 | + <div class="tierListWrap" ng-repeat="tier in vTypeJets[$index].tierList"> | |
254 | + <div class="tierListHead" style="height: 36px;"> | |
255 | + <span class="pull-left tierHeadingSpan" ng-hide="showEditTier">{{tier.minTierBreak}}-{{tier.maxTierBreak}} gal. | |
256 | + </span> | |
257 | + <i class="fa fa-pencil-square-o pull-right" ng-click="showEditTier = ! showEditTier" ng-hide="showEditTier" style="margin-top: 5px; cursor: pointer;" aria-hidden="true"></i> | |
258 | + | |
259 | + <input type="text" placeholder="min" style="width: 36px;" ng-model="tier.minTierBreak" ng-show="showEditTier"> | |
260 | + <span ng-show="showEditTier">-</span> | |
261 | + <input type="text" placeholder="max" style="width: 36px;" ng-model="tier.maxTierBreak" ng-show="showEditTier"> <b ng-show="showEditTier">gal.</b> | |
262 | + <div class="clearfix"></div> | |
499 | 263 | </div> |
500 | - </div> | |
501 | - </div> | |
502 | - </div> | |
503 | - <div class="panel panel-default"> | |
504 | - <div class="panel-heading"> | |
505 | - <h4 class="panel-title"> | |
506 | - <a class="accordion-toggle" data-toggle="collapse" data-parent=".accordion" href="#collapseThree"> | |
507 | - Collapsible Group Item #3 | |
508 | - </a> | |
509 | - </h4> | |
510 | - </div> | |
511 | - <div id="collapseThree" class="panel-collapse collapse"> | |
512 | - <div class="panel-body"> | |
513 | - 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. | |
514 | - </div> | |
515 | - </div> | |
516 | - </div> | |
517 | - </div> | |
518 | - </section> --> | |
519 | - <uib-accordion close-others="oneAtATime"> | |
520 | - <div uib-accordion-group class="panel-default" heading="Margin 1 Retail- (minus) $1.1500"> | |
521 | - <div id="editor2" style="visibility: hidden;"></div> | |
522 | - </div> | |
523 | - <div uib-accordion-group class="panel-default" heading="TurboPop AirCraft"> | |
524 | - <div class="panel-body"> | |
525 | - <div class="row" style="margin-left: 0px;"> | |
526 | - <div class="col-md-8"> | |
527 | - <div class="row" style="margin-bottom: 5px;"> | |
528 | - <div class="col-md-1" style="text-align: right;"> | |
529 | - <h5 style="color: blue;font-weight: bold;">Omit</h5> | |
530 | - </div> | |
531 | - <div class="col-md-5"> | |
532 | - <h5 style="color: blue;font-weight: bold;">AirCraft Size</h5> | |
533 | - </div> | |
534 | - <div class="col-md-3"> | |
535 | - <h5 style="color: blue;font-weight: bold;">Ramp/Facility Fee</h5> | |
536 | - </div> | |
537 | - <div class="col-md-3"> | |
538 | - <h5 style="color: blue;font-weight: bold;">Avoidance</h5> | |
539 | - </div> | |
264 | + <div class="tierListBody" style="height: 35px;"> | |
265 | + <span class="pull-left minTierSpan" ng-hide="showEditTier">-${{tier.margin}}</span> | |
266 | + | |
267 | + <input type="text" placeholder="max" style="width: 36px;" ng-model="tier.margin" ng-show="showEditTier"> | |
268 | + | |
269 | + <span class="pull-right maxTierSpan" ng-hide="showEditTier">(${{tier.marginTotal}})</span> | |
270 | + | |
271 | + <button class="addTierBtn" ng-click="editTier(tier)" ng-show="showEditTier">Save</button> | |
272 | + | |
273 | + <i class="fa fa-trash-o deleteTierIcon" ng-click="deleteTier(tier.id, jets.id)" aria-hidden="true" ng-show="showEditTier"></i> | |
274 | + | |
275 | + <div class="clearfix"></div> | |
540 | 276 | </div> |
541 | - <div class="row" style="margin-bottom: 5px;"> | |
542 | - <div class="col-md-1" style="text-align: right;"> | |
543 | - <input type="checkbox" name="validateCheckbox" value="1"> | |
544 | - </div> | |
545 | - <div class="col-md-5"> | |
546 | - <p>Very Light Jet | |
547 | - </p> | |
548 | - </div> | |
549 | - <div class="col-md-3"> | |
550 | - <input type="text" class="form-control" name="name" id="name"> | |
551 | - </div> | |
552 | - <div class="col-md-3"> | |
553 | - <input type="text" class="form-control" name="name" id="name"> | |
554 | - </div> | |
277 | + </div> | |
278 | + <div class="tierListWrap" style="width: 160px;"> | |
279 | + <div class="tierListHead" style="border-right: 1px solid #ddd;"> | |
280 | + <input type="text" placeholder="min" ng-model="vtrData[$index].minTierBreak"> | |
281 | + <span>-</span> | |
282 | + <input type="text" placeholder="max" ng-model="vtrData[$index].maxTierBreak"> <b>gal.</b> | |
283 | + <div class="clearfix"></div> | |
555 | 284 | </div> |
556 | - <div class="row" style="margin-bottom: 5px;"> | |
557 | - <div class="col-md-1" style="text-align: right;"> | |
558 | - <input type="checkbox" name="validateCheckbox" value="1"> | |
559 | - </div> | |
560 | - <div class="col-md-5"> | |
561 | - <p> Light Jet | |
562 | - </p> | |
563 | - </div> | |
564 | - <div class="col-md-3"> | |
565 | - <input type="text" class="form-control" name="name" id="name"> | |
566 | - </div> | |
567 | - <div class="col-md-3"> | |
568 | - <input type="text" class="form-control" name="name" id="name"> | |
569 | - </div> | |
285 | + <div class="tierListBody" style="border-right: 1px solid #ddd;"> | |
286 | + <span style="color: #449d44;">$</span> | |
287 | + <input type="text" placeholder="margin" ng-model="vtrData[$index].margin" class="tierTextBox" style="width: 70px; height: 24px;"> | |
288 | + <button class="addTierBtn" ng-click="addNewVtypeTier(jets.id, vtrData, $index)">Add Tier</button> | |
289 | + <div class="clearfix"></div> | |
570 | 290 | </div> |
571 | 291 | </div> |
572 | - <div class="col-md-4"> | |
573 | - </div> | |
292 | + <!-- <div class="tierListWrap" style="width: 32px;"> | |
293 | + <div class="tierListHead" style="height: 36px; border-right: 1px solid #ddd;"> | |
294 | + | |
295 | + </div> | |
296 | + <div class="tierListBody" style="height: 35px; border-right: 1px solid #ddd;"> | |
297 | + <i class="fa fa-trash-o deleteTierIcon" aria-hidden="true"></i> | |
298 | + </div> | |
299 | + </div> --> | |
300 | + <div class="clearfix"></div> | |
301 | + <textarea class="form-control resizeTextarea" placeholder="Message..."></textarea> | |
574 | 302 | </div> |
575 | 303 | </div> |
576 | 304 | </div> |
577 | - <div uib-accordion-group class="panel-default" heading="Collapsible Group Item #3"> | |
578 | - 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. | |
305 | + </section> | |
306 | + <div class="row"> </div> | |
307 | + <div class="row"> | |
308 | + <div class="form-group"> | |
309 | + <div class="col-lg-12 text-right"> | |
310 | + <button type="submit" class="btn btn-success"><i class="icon-ok"></i> Save Form</button> | |
311 | + <button type="reset" class="btn btn-default">Cancel</button> | |
312 | + </div> | |
579 | 313 | </div> |
580 | - </uib-accordion> | |
314 | + </div> | |
581 | 315 | </div> |
582 | 316 | <!-- /widget-content --> |
583 | 317 | </div> |
... | ... | @@ -630,6 +364,45 @@ |
630 | 364 | </div> |
631 | 365 | </div> |
632 | 366 | |
367 | +<div class="addNewVtype" style="display: none;"> | |
368 | + <div class="customBackdrop"> | |
369 | + <div class="customModalInner" style="max-width: 700px;"> | |
370 | + <div class="customModelHead"> | |
371 | + <p class="pull-left"> | |
372 | + <i class="fa fa-list-alt" aria-hidden="true"></i> | |
373 | + Add New AVGAS 100LL Customer Margin Template | |
374 | + </p> | |
375 | + <p class="pull-right"> | |
376 | + <i class="fa fa-times" aria-hidden="true" style="cursor: pointer;" ng-click="closeNewVtypePop()"></i> | |
377 | + </p> | |
378 | + <div class="clearfix"></div> | |
379 | + </div> | |
380 | + <div class="customModelBody"> | |
381 | + | |
382 | + <div class="customAccordianHeader customActive"> | |
383 | + <input type="text" class="form-control" style="width: 120px; margin-right: 10px;" placeholder="Margin Name" ng-model="newVtypeJet.marginName"> | |
384 | + <select class="form-control" ng-model="newVtypeJet.pricingStructure"> | |
385 | + <option value="" disabled selected>Pricing Structure</option> | |
386 | + <option value="minus">Retail-(minus)</option> | |
387 | + <option value="plus">Cost+(plus)</option> | |
388 | + <option value="equal">Direct=(equal)</option> | |
389 | + </select> | |
390 | + <span style="margin-right: 0;">$</span> | |
391 | + <input type="text" class="form-control" style="width: 120px;" placeholder="Margin Price" ng-model="newVtypeJet.marginValue"> | |
392 | + <div class="clearfix"></div> | |
393 | + </div> | |
394 | + <div class="customAccordianTabBody"> | |
395 | + <textarea class="form-control resizeTextarea" placeholder="Message..."></textarea> | |
396 | + </div> | |
397 | + | |
398 | + </div> | |
399 | + <div class="customModelFooter text-center"> | |
400 | + <input type="submit" value="Save" class="btn" ng-click="addNewVTypeJet()"> | |
401 | + <button class="btn" ng-click="closeNewVtypePop()">Cancel</button> | |
402 | + </div> | |
403 | + </div> | |
404 | + </div> | |
405 | +</div> | |
633 | 406 | |
634 | 407 | <div class="customConfirmPopBackdrop" id="confirm1" style="display: none;"> |
635 | 408 | <div class="customModalInner"> | ... | ... |
app/partials/updateFuelManager/updateFuelManager.service.js
... | ... | @@ -22,6 +22,22 @@ |
22 | 22 | return deferred.promise; |
23 | 23 | } |
24 | 24 | |
25 | + this.getVTypeJets = function(id) { | |
26 | + | |
27 | + var deferred = $q.defer(); | |
28 | + $http({ | |
29 | + method : 'GET', | |
30 | + url : BASE_URL.url +'/margin/getAVGASType/'+id, | |
31 | + headers : {'Content-Type': 'application/json'}, | |
32 | + }) | |
33 | + .then(function (result){ | |
34 | + deferred.resolve(result.data); | |
35 | + },function (result){ | |
36 | + deferred.resolve(result.data); | |
37 | + }) | |
38 | + return deferred.promise; | |
39 | + } | |
40 | + | |
25 | 41 | this.addNewAtypeJetMargin = function(data){ |
26 | 42 | var deferred = $q.defer(); |
27 | 43 | $http({ |
... | ... | @@ -38,6 +54,22 @@ |
38 | 54 | return deferred.promise; |
39 | 55 | } |
40 | 56 | |
57 | + this.addNewVtypeJet = function(data){ | |
58 | + var deferred = $q.defer(); | |
59 | + $http({ | |
60 | + method : 'POST', | |
61 | + url : BASE_URL.url +'/margin', | |
62 | + headers : {'Content-Type': 'application/json'}, | |
63 | + data: data | |
64 | + }) | |
65 | + .then(function (result){ | |
66 | + deferred.resolve(result.data); | |
67 | + },function (result){ | |
68 | + deferred.resolve(result.data); | |
69 | + }) | |
70 | + return deferred.promise; | |
71 | + } | |
72 | + | |
41 | 73 | this.editAtypeJetMargin = function(data){ |
42 | 74 | var deferred = $q.defer(); |
43 | 75 | $http({ |
... | ... | @@ -54,6 +86,22 @@ |
54 | 86 | return deferred.promise; |
55 | 87 | } |
56 | 88 | |
89 | + this.editVtypeJetMargin = function(data){ | |
90 | + var deferred = $q.defer(); | |
91 | + $http({ | |
92 | + method : 'PUT', | |
93 | + url : BASE_URL.url +'/margin', | |
94 | + headers : {'Content-Type': 'application/json'}, | |
95 | + data: data | |
96 | + }) | |
97 | + .then(function (result){ | |
98 | + deferred.resolve(result.data); | |
99 | + },function (result){ | |
100 | + deferred.resolve(result.data); | |
101 | + }) | |
102 | + return deferred.promise; | |
103 | + } | |
104 | + | |
57 | 105 | this.getJetTiers = function(id) { |
58 | 106 | |
59 | 107 | var deferred = $q.defer(); |
... | ... | @@ -150,6 +198,22 @@ |
150 | 198 | return deferred.promise; |
151 | 199 | } |
152 | 200 | |
201 | + this.getFutureFuelPricing = function(id) { | |
202 | + | |
203 | + var deferred = $q.defer(); | |
204 | + $http({ | |
205 | + method : 'GET', | |
206 | + url : BASE_URL.url +'/fuelPricing/getFuturePriceManagerProducts/'+id, | |
207 | + headers : {'Content-Type': 'application/json'}, | |
208 | + }) | |
209 | + .then(function (result){ | |
210 | + deferred.resolve(result.data); | |
211 | + },function (result){ | |
212 | + deferred.resolve(result.data); | |
213 | + }) | |
214 | + return deferred.promise; | |
215 | + } | |
216 | + | |
153 | 217 | |
154 | 218 | } |
155 | 219 | ... | ... |