DesComm Posted October 17, 2016 Report Share Posted October 17, 2016 When a Pirep is filed and accepted the hours for the pilot are not uipdating automatically, without running "Maintenance Reset Hours". However we have "TopPilot module" installed and is is being updated when the pirep is filed. What file updates the pilots hours? Only section that seems to be corrupted and not working. Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted October 18, 2016 Moderators Report Share Posted October 18, 2016 Which phpVMS version are you using? Quote Link to comment Share on other sites More sharing options...
DesComm Posted October 18, 2016 Author Report Share Posted October 18, 2016 Which phpVMS version are you using? simpilot 5.5.2 Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted October 18, 2016 Moderators Report Share Posted October 18, 2016 Could you please paste here the ChangePIREPStatus function which can be found on your core/common/PIREPData.class.php file? Quote Link to comment Share on other sites More sharing options...
DesComm Posted October 18, 2016 Author Report Share Posted October 18, 2016 (edited) Here it is public static function changePIREPStatus($pirepid, $status) { # Look up the status of the PIREP of previous $pirep_details = PIREPData::getReportDetails($pirepid); if(!$pirep_details) { return false; } if($pirep_details->accepted == $status) { return true; } $ret = self::editPIREPFields($pirepid, array('accepted' => $status)); # Do something if the PIREP was previously marked as pending if($pirep_details->accepted == PIREP_PENDING) { if($status == PIREP_ACCEPTED) { self::calculatePIREPPayment($pirepid); SchedulesData::changeFlownCount($pirep_details->code, $pirep_details->flightnum, '+1'); } elseif($status == PIREP_REJECTED) { // Do nothing, since nothing in the PIREP was actually counted } } elseif($pirep_details->accepted == PIREP_ACCEPTED) { # If already accepted if($status == PIREP_REJECTED) { LedgerData::deletePaymentByPIREP($pirep_details->pirepid); PilotData::resetPilotPay($pirep_details->pilotpay); SchedulesData::changeFlownCount($pirep_details->code, $pirep_details->flightnum, '-1'); } } PilotData::updatePilotStats($pirep_details->pilotid); RanksData::calculateUpdatePilotRank($pirep_details->pilotid); PilotData::generateSignature($pirep_details->pilotid); StatsData::updateTotalHours(); return $ret; } /** * Add a payment for a PIREP. * * @param int $pirepid PIREP ID * @return */ Edited October 18, 2016 by DesComm Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted October 18, 2016 Moderators Report Share Posted October 18, 2016 I dot no think that this is all of it. Make you that you copy the whole function until you find the next public static function Quote Link to comment Share on other sites More sharing options...
DesComm Posted October 18, 2016 Author Report Share Posted October 18, 2016 (edited) Posted I just compared the PIREPData.class php with the original. the only difference is line 703 - where we changed $pirepdata['accepted'] = PIREP_PENDING; to $pirepdata['accepted'] = PIREP_ACCEPTED; Other than that files are identical. This happened when the ISP did a restore and must have had a file corrupted. Remember that "TOPPILOT" module updates immediately just not the pilot hours. Edited October 18, 2016 by DesComm Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted October 19, 2016 Moderators Report Share Posted October 19, 2016 Ok, can you please do the same with updatePilotStats which can be found in your core/common/PilotData.class.php? Quote Link to comment Share on other sites More sharing options...
DesComm Posted October 19, 2016 Author Report Share Posted October 19, 2016 Here is a screen shot showing the difference between current system on left and original on the Right. The changes are highlighted. We use a program called "ExamDiffPro" which show differences in files. Quote Link to comment Share on other sites More sharing options...
jb123 Posted March 19, 2018 Report Share Posted March 19, 2018 (edited) Hi all, I believe I'm having a similar issue: after a pirep is approved, phpvms is not updating number of pilot flights, number of pilot hours and number of airline hours. It is however updating all the rest as it should (total airline flights, total passengers per pilot, total miles per pilot, ...)... Any idea why this is happening?? Thanks. Joao Edited March 19, 2018 by jb123 Quote Link to comment Share on other sites More sharing options...
Ither Posted December 7, 2019 Report Share Posted December 7, 2019 I have this same problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.