Jump to content

Skytraveler

Members
  • Posts

    15
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Skytraveler

  1. Thanks, it worked by adding use App\Models\Expense; and also the following that was on your code above: use App\Models\Enums\ExpenseType; Thank you very much for your help once again,
  2. Hi, I'm tryng to create a new expense listener for hard landing events, by adding a new file at /app/Listeners, but it's not working. I have this Laravel error: This is the code I'm using: <?php namespace App\Listeners; use App\Contracts\Listener; use App\Events\Expenses; class ExpenseTouchdown extends Listener { public function handle(Expenses $event) { $expenses = []; $amount = 250; // Do your check here, return an empty array if it is ok/below your check limit (no expense needed) if (abs($event->pirep->landing_rate) < 500) { return $expenses; } // You can even increase the punishment here by getting a ratio // So the harder they land, the higher the punishment $amount = round($amount * (abs($event->pirep->landing_rate) / 500)); // Prepare a New Expense here $expenses[] = new Expense([ 'type' => ExpenseType::FLIGHT, // This must be FLIGHT for a pirep related pilot charged expense 'amount' => $amount, // No need to add two more digitis, 150 is 150$ or 150Eur etc. 'transaction_group' => 'Hard Landing', // This is the group name, visible at financial report 'name' => 'Hard Landing Fee For Pirep='.$event->pirep->id, // Name is visible like a memo 'multiplier' => false, // or true (to use Subfleet GH Multiplier) 'charge_to_user' => true, // true to charge pilot, false to charge company ]); // If you wish you can create another expense here like the one above... // And finally return all new expenses you prepared return $expenses; } } I believe the code is right, I adapted from an example at the forum. I cleaned the cache. The filename and the inner class name declaration are matching. Anyone can help me to find where the problem might be? Thanks.
  3. @Jbaltazar67 Hi, did you (or someone?) managed to put this to work? I have exactly the same problem (filename and inner class name declaration do match and I cleaned cache too)
  4. Hi, Is it possible for a user that flies sometimes on MSFS, and sometimes on X-Plane, to use VMSACARS to file the Pireps to the same Airline? Thank you, Joao
  5. It's now working!!! I followed your advice and slowly added all my addons. I had some code of my own added to the PIREPData.class.php, so I didn't copy this file to the new installation, I carefully looked for my customized lines of code in it, and pasted them to the existing PIREPData.class.php on the new installation. I'm not able to identify where the problem was, maybe it was on this file, maybe a bad redirection of some file from my previous http installation to my new https... Maybe both! 🙄 Anyway, your suggestion not only solved my problem, but also now my phpvms is running smoother and pages are loading faster. Thanks for your support and for being available ☺️ Best regards. Joao
  6. Will do that. Thank you very much for your help.
  7. Ok, thanks, did it and that is solved. I believe I may have found one possible problem, my installation started having problems accessing data... My site is https. At the local.config.php, if I enter my SITE_URL as https://..., the Airports and Schedules in admin area do not load (but all other admin pages do...). If I go back and change the SITE_URL to http, I get all airports and schedules correctly. I'm still using default phpvms 5.5 skin.
  8. Married the old database to the new install. No skin installed yet. Got this first error: Notice: The template file "/home/teaceo/public_html/dev//lib/skins/CURRENT_SKIN/header.php" doesn't exist in /home/teaceo/public_html/dev/core/classes/TemplateSet.class.php on line 231 I don't have a skin called "CURRENT_SKIN" and also there are 2 "//" before lib/skins/...
  9. I followed you suggestion and did a new phpVMS 5.5.2 installation on the same host in a different directory. Here, everything runs OK, hours are being updated as they should...
  10. Yes, it appears database tables were updated. I have a schedules table with columns for week1, week2, week3, week4 and a Ledger table too
  11. Hi. Thanks for your reply. - PIREP hours don't update after PIREP approval; - They do update after running maintenance script; - It's not new, I don't know what triggered it. I just have time now to try to address this; - This was a conversion from phpVMS 2.1.x; - The PHP version is 5.3 - mySQL 5.6.43
  12. Same problem here... Did you managed to solve it?
×
×
  • Create New...