Pilot Hours not updating

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.

Which phpVMS version are you using?

Which phpVMS version are you using?

simpilot 5.5.2

Could you please paste here the ChangePIREPStatus function which can be found on your core/common/PIREPData.class.php file?

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

*/

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

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.

Ok, can you please do the same with updatePilotStats which can be found in your core/common/PilotData.class.php_?_

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.

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

I have this same problem.