Jump to content

Recommended Posts

Posted

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.

Posted (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 by DesComm
Posted (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 by DesComm
Posted

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.

PilotData.class.JPG

  • 1 year later...
Posted (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 by jb123
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...