Jump to content

ProAvia

Administrators
  • Posts

    1647
  • Joined

  • Last visited

  • Days Won

    71

Everything posted by ProAvia

  1. Have a look at this post Or maybe there is a way to open a support ticket after you log in via your 'Billing Login' on the Simpilot site????
  2. Since this is a payware module from Simpilot, you would be best served by opening a support ticket on the Simpilot site.
  3. I think I may have figured it out. Attached is my current PIREPData.class.php file and the original file as supplied with phpVMS 5.5.2 (PIREPData.class.php.ORIG) for your reference. All line references are to my current file. updateFlightReport - starts line 805, see lines 829-834 formats $flighttime_stamp and $pirepdata['flighttime'] correctly - regardless if initial flighttime contains a period or colon. In a manual PIREP submittal, the hours and minutes can be separated by a colon, a period, no separator, etc. - based on user input. used your initial edit (maybe on page one of this thread) commented out $pilot = PilotData::getPilotData($data['pilotid']); - as I don't think it's needed. And, if I edit a PIREP after a pilot's rank/pay changes, I don't know whether this line would change the pilotpay to the new rate. change 'explode' and calculate lines from $flighttime to $peices. I had changed this earlier in my latest testing to see if it changed anything, which it did not. But left it as $peices anyway. changed $pilot->payrate to $data['pilotpay'] to reflect $data array. Just a lucky guess, as I was trying all kinds other stuff here too. getPIREPRevenue - starts line 1040, see lines 1051-1063 uses $data array and $payment_type - so I tried using $data['flighttime'] and $data['pilotpay'] for the pay calculation. This was after many failed attempts using other parameters - which resulted in the pay being passed as 0 to the $revenue calculation on line 1069 (I think). calculatePIREPayment - starts line 1260 calculates $amount and passed to pireps table left this as original - as it seems to pass the correct data to the ledger table. A few things I changed/added for my specific operation changed .tpl to .php - lines 349, 360, 374, 383 - in the FSFlightKeeper section. added line 633 to display route string in upper case. changed/added 'Send an email to the admin...' after line 758 for my specific needs. I believe both options can be active at one time, but I want Admins to actually review PIREPs instead of just clicking to approve - at least for now. added notes so I remember what stuff does and what I did. In testing, both manual and ACARS PIREPs have been submitted. PIREPs have been viewed, edited, saved and accepted via the admin panel - in various combinations. After a PIREP has been accepted, it's been edited to change the Pilot Pay, saved and/or (re-)accepted. I think I've tried all possible combinations. The revenue and pilotpay appears to compute correctly. The correct $ amount now shows in the pireps table (after save and/or accept). ____________________ PayChecker Final Revenue (per PIREP Pilotpay) is showing $revenue based on $pirep->pilotpay. The $pirep->pilotpay is the hourly pay (or per schedule pay) from the pireps table, not the actual pay based on $pirep->pilotpay times the flight time (in hours and minutes, not tenths). That section can probably be deleted. admin/templates/view_pilot_pireps.php - lines 73 and 74. admin/modules/PayChecker.php - lines 264-286. Everything else in the PayChecker works as advertised - and was a GREAT help in getting the end result we were after. ____________________ I think I figured out the FUEL_DEFAULT_PRICE and FUEL_SURCHARGE stuff too - but will leave that for another time. Disclaimer: I really don't have a good handle on php - but I'm learning slowly. A lot of what I tried on my own was trial and error - along with many hours of staring at the computer screen looking for that "something" that would stand out and editing stuff, not knowing what the results would be. Glad I have a working live site and a test site to mess with. After 60+ posts and a LOT of confusion on my part, I believe it's finally working as it should. If you have the time, please check my work to see if you are getting the same results. After I hear back from you, I'll mark the thread as SOLVED - as least I hope I will. If all this pans out, maybe it will help with the version 3 development too. Thank you once again for all your time and effort! I really do appreciate all the advice and hand-holding! PIREPData.class.php.ORIG PIREPData.class.php
  4. OK, Captain Obvious! LOL - You should be looking at it from my side. I had re-read the entire thread just before doing your last edit, cause I was so confused. I'm still crunching some numbers and will report back with details soon. Basically in the original (default) PIREPData.class.php file that comes with version 5.5.2 - I did this as the only edit Line 825 in default PIREPData.class.php - the one you suggested I leave alone.... From this $pirepdata['flighttime'] = str_replace(':', ',', $pirepdata['flighttime']); To this $pirepdata['flighttime'] = str_replace(':', '.', $pirepdata['flighttime']); That pretty much fixed the major issue I was seeing. It's in the 'updateFlightReport' section. As to why it helped, I haven't a clue. The only thing I'm seeing now is the flighttime (not flighttime_stamp - or flighttime converted to hours:minutes) is still being used when computing pilotpay that is used in the revenue calculation. I need to track if it's only after initial pirp submittal or if it's after an admin uses Edit and Save.The ledger table isn't even populated until an admin takes an action on the submitted PIREP (Accept or Save, I think). As to not passing pilotpay to the ledger table as 'amount' - I think that occurred in your last edit. But it's a non-issue now as I think most of the issue was the comma vs period in link 825 of the original file. As I said, I need to do more testing and document exactly what I'm seeing before we go further - at least I think that might be best for now. Thanks! - I'll post here after I test and document the findings.
  5. Your last isn't passing the pilotpay to the ledger table as I believe it needs $amount instead of $pilotpay at start of this line $pilotpay = ($pirep->pilotpay / 60) * $flighttime_min; # Finalise the payment I changed $pilotpay to $amount without success. ___________________________________________________ Just cause I had nothing better to do ...., I decided to review the original PIREPData.class.php file again. I ran a new PIREP through using that file, went to admin Edit and Save and as expected the revenue number was incorrect. Then I changed the comma in line 825 to a period. From this $pirepdata['flighttime'] = str_replace(':', ',', $pirepdata['flighttime']); To this $pirepdata['flighttime'] = str_replace(':', '.', $pirepdata['flighttime']); Ran another new PIREP through using the edited file (comma to period was only edit), went to admin Edit and Save, checked PayChecker and it seems the results in ledger->amount are correct --- and pirep->revenue (PIREP Revenue in PayChecker) is within $0.40 of Actual Revenue in PayChecker. I went back and edited the PENDING pirep to change the pilotpay and Save -- ledger->amount and pirep->pilotpay updated accordingly, and revenue changed to reflect new amounts. Then went back and edited an older APPROVED pirep - same results. Only discrepancy is Last PIREP Pay and Last PIREP Real Pay. But I think PayChecker is taking the pilotpay rate based on rank (????) for Last PIREP RealPay. Last PIREP Pay Last PIREP Real Pay Status 0.00 160.67 New Pirep PENDING - no Edit - pilotpay @ $40/hour 241.00 160.67 New Pirep PENDING - Edit and Save - pilotpay @ $60/hour 241.00 160.67 Old Pirep APPROVED - Edit and Save - pilotpay @ $60/hour Revenue PIREP Gross: 34800 Actual Gross: 34800 Expenses: 0 Fuel Price: $ 18, 022.70 Pilot Pay: $ 241.00 Actual Revenue: $ 16, 536.30 PIREP Revenue: $ 16, 536.70 The overall function where the edit is located is public static function updateFlightReport ... , starting on line 807. Still need to do more testing - maybe tomorrow to see if the above holds true.
  6. Thanks, I'll definitely look into it after I resolve my Pilot Pay issue ( https://forum.phpvms.net/topic/24313-flight-time-separator/ ) - I've been getting some excellent help from web541 in correcting that issue and am almost there. Pagination is the next thing on the list. Now to find the time to complete it all. I will post back when I find the magic combination. I certainly hope at least basic pagination is included with version 3.
  7. Mine is like your first pic - with the hover effect. I'd provide a link, but most pages on the site require a user to be logged in (something else on my list to change a bit). So, it's a template - cool. Is there an easy way to change to the template to get a display as in your lower pic?
  8. I don't know if this is related or not - or even if it's an issue with the processing elsewhere ... line 825 in the original PIREPData.class.php file $pirepdata['flighttime'] = str_replace(':', ',', $pirepdata['flighttime']); I think that statement basically replaces the ' : ' with a ' , ' . Should the 'comma' in - str_replace(':', ',', $pirepdata be a 'period' instead str_replace(':', '.', $pirepdata Seems it's replacing the colon with a comma instead of replacing the colon with a period. I did try changing it and the results I'm seeing didn't change at all. ____________________ I believe my issue is that, when computing revenue, the pilotpay is getting the payrate from the pilot or ranks tables instead of pilotpay from the pireps table. And if I change the pilotpay when editing the PIREP, the new pilotpay isn't taken into account - because it's using pilotpay from $pilot->payrate. But I don't know what to change or where to change it.
  9. What version of phpVMS are you using - 2.1.x or 5.5.x? If the later, change the .tpl to .php in the core_htmlhead file name above and see if that helps. If that doesn't work, maybe posting the contents of your layout.php or template_start.php would help someone diagnose the issue.
  10. Yes - if I change pilot pay to a new value when editing a PIREP. The pireps table shows the updated pilot pay figure, but it's not being reflected in revenue.
  11. That corrected the SAVE issue. PayChecker results remained exactly the same. In Admin PayChecker, it's now subtracting pilotpay (based on rank $$ amount only) in PIREP Revenue. So it's subtracting pilotpay now - but the pilotpay based on rank, not the $$/hour I changed it to in EDIT. Database shows pilotpay = 60, revenue = 16616.6 - the revenue is based on pilotpay = 40, not pilotpay = 60. PIREP Gross: 34800 Actual Gross: 34800 Expenses: 0 Fuel Price: $ 18, 022.70 Pilot Pay: $ 241.00 Actual Revenue: $ 16, 536.30 PIREP Revenue: $ 16, 616.60 If I input a different Pilot Pay while editing the PIREP in admin, it doesn't take the new rate into account when recalculating. 34800 - 18022.70 - 16536.30 = 241.00 = 4:01 @ $60/hour = 241 minutes * (60 / 60) = Actual Revenue 34800 - 18022.70 - 16616.60 = 160.70 = 4:01 @ $40/hour = 241 minutes * (40 / 60) = PIREP Revenue No rush - whenever you have a chance to look it over. Always appreciate your help and insight!
  12. I messed with the width and was able to set it to 100% and to 80% with no change in the button display. Then I went to datatables.net and started playing around with their download options. I am using a NON-bootstrap skin - and I think that may have been part of my issue. I changed this: <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css"/> To this: <link rel="stylesheet"String type="text/css"String href="https://cdn.datatables.net/v/dt/jq-2.2.4/dt-1.10.13/b-1.2.4/datatables.min.css"String/> And now, while I still have the words at the bottom, they run horizontally rather than vertically. Here's the line right after closing script </script>: <table id="schedules" class="table" width="80%" align="center"> ---- aligns table center @ 80% width, which looks better then aligned left @ full width on my particular template. I'll be playing around with the other options at datatables.net to see if I can get the buttons to show.
  13. Update: Adding in the last code seems to fix it once you Accept PIREP from the Edit page - except if you change the pilot's pay rate using the Edit function. This is with a PIREP submitted and accepted AFTER the file changes. Ledger table shows correct pilotpay - as it did before. Still need to check PIREPS submitted prior to file changes - if I edit and accept again. Additionally, using the Save PIREP option does not change revenue to correct amount. This is with a newly submitted PIREP or one submitted before the file changes. Same flight - only difference was initial pilotpay @ $40/hr. Prior to accepting PIREP, changed pilot pay to $60/hr. PayChecker gave following results.
  14. The pic was using 'FrontSchedules'. But i checked via 'schedules' and it is full width, with the same issues mentioned. Thanks for the reply! I will have a closer look tomorrow and try your suggestions. Worst case, I try it on a new install with all default files and default skin. EDIT: In thinking about it a bit more, both FrontSchedules and schedules uses the same template file to display the search results. I wonder why schedules displays full width and FrontSchedules doesn't.
  15. The 'X' in the search box does seem to work for me - as long as the focus is on the box. Yeah - I've got to do a LOT more reading over there to get a better understanding of the options.
  16. I believe I am using CDN scripts - just not sure I have all the ones I need. Besides the 2 calls shown in the file contents, are there others I need? Not using a bootstrap skin. The Show and Search boxes don't line up horizontally either. Contents of schedule_results.php <?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?> <?php if(!$schedule_list) { echo '<p align="center">No routes have been found!</p>'; return; } ?> <!-- <table id="tabledlist" class="tablesorter"> --> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css"/> <script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-2.2.3/dt-1.10.12/datatables.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#schedules').dataTable({ "sPaginationType": "full_numbers", "lengthMenu": [ [5, 10, 20, 50, -1], [5, 10, 20, 50, "All"] ] }); }); </script> <table id="schedules" class="table"> <thead> <tr> <th>Flight Info</th> <th>Options</th> </tr> </thead> <tbody> <?php foreach($schedule_list as $schedule) { ?> <tr> <td> <a href="<?php echo url('/schedules/details/'.$schedule->id);?>"><?php echo $schedule->code . $schedule->flightnum?> <?php echo '('.$schedule->depicao.' - '.$schedule->arricao.')'?> </a> <br /> <strong>Departure: </strong><?php echo $schedule->deptime;?> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Arrival: </strong><?php echo $schedule->arrtime;?><br /> <strong>Equipment: </strong><?php echo $schedule->aircraft; ?> (<?php echo $schedule->registration;?>) <strong>Distance: </strong><?php echo round($schedule->distance . Config::Get('UNITS'), 1);?> <br /> <strong>Days Flown: </strong><?php echo Util::GetDaysCompact($schedule->daysofweek); ?><br /> <?php echo ($schedule->route=='') ? '' : '<strong>Route: </strong>'.$schedule->route.'<br />' ?> <?php echo ($schedule->notes=='') ? '' : '<strong>Notes: </strong>'.html_entity_decode($schedule->notes).'<br />' ?> <?php # Note: this will only show if the above code to # skip the schedule is commented out if($schedule->bidid != 0) { echo 'This route has been bid on'; } ?> </td> <td nowrap> <a href="<?php echo url('/schedules/details/'.$schedule->id);?>">View Details</a><br /> <a href="<?php echo url('/schedules/brief/'.$schedule->id);?>">Pilot Brief</a><br /> <?php # Don't allow overlapping bids and a bid exists if(Config::Get('DISABLE_SCHED_ON_BID') == true && $schedule->bidid != 0) { ?> <a id="<?php echo $schedule->id; ?>" class="addbid" href="<?php echo actionurl('/schedules/addbid/?id='.$schedule->id);?>">Add to Bid</a> <?php } else { if(Auth::LoggedIn()) { ?> <a id="<?php echo $schedule->id; ?>" class="addbid" href="<?php echo url('/schedules/addbid');?>">Add to Bid</a> <?php } } ?> </td> </tr> <?php /* END OF ONE TABLE ROW */ } ?> </tbody> </table> <hr> Thanks!
  17. That code works great! And I just started reading about all the options that are available. I have the code working in Schedules and View PIREPS. One issue I'm having is the placement of the First, Previous, Next, Last and page selection numbers. Right now they show in a vertical column on the lower right side of each paginated page. Is there a way to move them and possible style them into buttons? Thanks!
  18. And leave the first edit in or put it back to original? (see first edit below)
  19. I just tested it and you were right, entered a 5.10 value into phpmyadmin and it rejected the 0, but I'm not sure it's because it's a float value. I just tested this - in a DB table 'Type' column if set to FLOAT it drops any trailing zeros (floating-point) if set to DECIMAL and Length/Values is set to x,2 (where 'x' is a number of how many digits to left of '.' and '2' is how many digits to right of '.' you want to display) it will display 2 decimal places to the right of '.' (fixed-point). Note: there is a comma ( , ) between the two numbers in Lengths/Values. You can display more than two decimal places if desired. It's also explained in more detail in the MySQL documentation. This may be something that can be incorporated in version 3 to better display any DB entries that have to do with money (at least for those of us who use it that way). Guess there may be instances in some countries where a single decimal place works with their currency.
  20. Sorry - life got in the way of trying this. Just need an uninterrupted block of time to wrap my head around it again. Hoping to tackle over the weekend.
  21. OK - happy to know it's not just me! Also glad I figured out why my fuel cost changed - although I'm not sure the FUEL_SURCHARGE is fully implemented.... But that's for another time - or maybe I don't really want to know.
  22. Yup - correct! Confirm with another 3 PIREPS 'Reset Revenue' - PIREP Gross: 34800 Actual Gross: 34800 Expenses: 0 Fuel Price: $ 18, 022.70 Pilot Pay: $ 241.00 Actual Revenue: $ 16, 536.30 PIREP Revenue: $ 16, 536.30 So the pay isn't being subtracted "somewhere" to give the correct 'revenue' - if I understand you correctly. And 'Reset Revenue' only did the calc internally and didn't seem to change anything in the DB. I'm done for tonight - but tomorrow, I can easily blow the DB out and set it back to where it was before messing with PayChecker and Reset Revenue if needed. Computer is going off now - but will be on tablet to check forum. No, I won't even attempt to mess with the site files/DB from the tablet cause I'll fat finger something and mess it all up. Thanks again!
  23. It shows his Last PIREP Pay = $241.00, Last PIREP Real Pay = $241.00 Viewing the particular PIREP in question PIREP Gross: 34800 Actual Gross: 34800 Expenses: 0 Fuel Price: $ 18, 022.70 Pilot Pay: $ 241.00 Actual Revenue: $ 16, 536.30 PIREP Revenue: $ 16, 777.30 Why the discrepancy between the last two entries?
  24. Oh - 'Check PIREPS' under Tasks in the sidebar......, then the pilot in question, View PIREPS.
  25. PayChecker Pilot Side PIREPData => CalculatePIREPPayment 241 PilotData => resetPilotPay 11254.50 Current Pilot's Payrate (per hour) 60 New Algorithm Using Decimal Form 241 New Algorithm Using Flight Stamp Form 241 What you are getting now (I think) 240.6 Revenue For This PIREP 16536.3 PayChecker Admin Side PIREPData => CalculatePIREPPayment 241 PilotData => resetPilotPay 11254.50 Current Pilot's Payrate (per hour) 60 New Algorithm Using Decimal Form 241 New Algorithm Using Flight Stamp Form 241 What you are getting now (I think) 240.6 Revenue For This PIREP 16536.3 In admin, and view that particular pilot's pireps??? (.../admin/index.php/pilotadmin/viewpilots?action=viewoptions&pilotid=22) --- there is no revenue column. If I choose edit, it shows 'Total Revenue for flight' of 16777.30 . Adding 'Total Revenue for fligh't and 'Total fuel cost', it equals 'Gross Revenue'. 16777.30+18022.70=34800.00 While the pilotpay is showing in the ledger table (as amount), it's not being subtracted from revenue. This is after the pirep has been accepted. I even clicked EDIT and SUBMIT again to see if that changed anything. I'm going to look in PIREPData.class.php again and make sure I have that correct. EDIT: I didn't try the Reset Revenue or Reset Pay + Revenue, only the Go!..... with the correct pirepid
×
×
  • Create New...