Jump to content

Recommended Posts

Posted

Hi,

is there an option, module or stat to show the profit of the month? So all pilots have a quick view without looking in the va finances. I want to put just the profit in the sidebar to the other statistics. At the moment I make this per hand, after every flight I had to update it manually :)

thx

  • Administrators
Posted

You could use the Finance Data class to get the info in an array, something like

$month_info->timestamp = time();
$finances = FinanceData::calculateFinances($month_info);

Then you should have the $finances variable filled with;

revenue

gross

fuelprice

pilotpay

so to show total revenue for the month you could use

echo $finances->revenue

Posted

Hi,

Thank you.

I've tried it, but I get some Errors. This is the code:

<?php

$month_info->timestamp = time();

$finances = FinanceData::calculateFinances($month_info);

echo $finances->revenue

?>

The Error:

Warning: Creating default object from empty value in /var/www/web1112/html/va/core/templates/profile_main.tpl on line 334

-553500

The -553500 is the total of all monthly expenses, the right value hat to be around 300.000

Posted

Thx, but I get the same error and also the same wrong revenue:

Warning: Creating default object from empty value in /var/www/web1112/html/va/core/templates/profile_main.tpl on line 334

-553500

  • Administrators
Posted

You must be on a newer version of php, that is an error that crops up in newer versions when you have not declared a new object and you try to use it. Try adding

$finances = new stdClass();

prior to the code snippet. You may have to do the same thing for $month_info

  • Administrators
Posted

Does it show the same thing on the regular financials page? I am guessing the calculation in the data class is not right if they match.

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...