Financial Report V2.0

Good Day All,

Here is another module called Financial Report. This is to give your pilots statistics of your airline as well their own.

*Please note this is for phpVMS 5.5x by Simpilot*

Install:

  1. Download repository at Github
  2. Upload to your site in folder’s order
  3. Access it using:

            

 \<?php echo url('/finance');?\>
  1. Include the following paths to your skin/layout.php file in head section:
            
                

    <script type=“text/javascript” src=“<?php echo fileurl(‘lib/js/finance.js’);?>”></script>  <script type=“text/javascript” src=“<?php echo fileurl(‘lib/css/finance.css’);?>”></script>

 

  1. Enjoy!

Demo:

At my websitewww.parkho.ir

Screenshots:

 

 

 

That’s pretty sweet man. Nicely done.

Thanks for the great add-on!!! i just installed everything on my phpvms 5.5.2. Its working but i get a error.. do you have any clue?

i attached also a screenshot..

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/dd-photography.de/vas.airberlin-va.de/core/templates/finance/airline_finance.php on line 9

post-49581-0-19064900-1478185371.png

Thanks man.

Thanks for the great add-on!!! i just installed everything on my phpvms 5.5.2. Its working but i get a error.. do you have any clue?

i attached also a screenshot..

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/dd-photography.de/vas.airberlin-va.de/core/templates/finance/airline_finance.php on line 9

I have that to and have a clue what it might be. I will report back here in one moment

Ok the verdict is in, it is because we have no airport expenses setup in the admin panel of phpVMS. Once you add a expense, that error will go away.

It needs a if statement or something added like if no expense then echo message. that would fix it right up.

Nice little module. I like it.

I’ll make the change. Thanks for the tip.

Oh yeah any time man. I hope it works out. I like this module. I added soem expenses to my test airline today and all is well. It is functional and clean.

i got this error:

The template file “/home/990/217990/public_html//core/templates//finance/finance.php.tpl” doesn’t exist in /home/990/217990/public_html/core/classes/TemplateSet.class.php on line 248

i got this error:

The template file “/home/990/217990/public_html//core/templates//finance/finance.php.tpl” doesn’t exist in /home/990/217990/public_html/core/classes/TemplateSet.class.php on line 248

You need to upgrade your phpVMS version to 5.5x by Simpilot. Alternatively, you can change my module core files to match older versions of phpVMS (AKA, TPL version)

I changed the code a bit to reflect a message instead of an error when there are no expenses added to the airline.

In airline_finance.php

FIND

<?php
foreach($expenses as $expense)
{
?>
<tr>
<td><?php echo $expense->name ;?></td>
<td><?php echo FinanceData::formatMoney($expense->cost);?></td>
<td>
<?php
 if($expense->type == "M")
 {
 echo 'Monthly';
 }
 elseif($expense->type == "F")
 {
 echo 'Per Flight';
 }
 elseif($expense->type == "P")
 {
 echo 'Percent (Month)';
 }
 else
 {
 echo 'Percent (Per Flight)';
 }
?>
</td>
</tr>
<?php
}
?>

REPLACE WITH

<?php if(!$expenses) {echo '<tr><td align="center" colspan="3">There are no expenses set up at this time!</td></tr>';}
 else {
 foreach($expenses as $expense) { ?>
<tr>
<td><?php echo $expense->name ;?></td>
<td><?php echo FinanceData::formatMoney($expense->cost);?></td>
<td>
<?php
 if($expense->type == "M")
 {
 echo 'Monthly';
 }
 elseif($expense->type == "F")
 {
 echo 'Per Flight';
 }
 elseif($expense->type == "P")
 {
 echo 'Percent (Month)';
 }
 else
 {
 echo 'Percent (Per Flight)';
 }
?>
</td>
</tr>
<?php
}
}
?>

Now we get a nice message that there are no expenses setup at this time instead of a error on the page. I am more than sure this will work for an airline that has only one pilot in the setup process that has no flights yet. I am going to go look at it now as we speak and see what happens.

Thanks again for another great module Parkho. I like it. I appreciate the share with us.

Here is mine skinned with the error gone and a message given.

post-308-0-25828100-1480624608.jpg

Thanks for the addition. Glad you like it.

1 Like

I have made changes in “airline_finance.php” as per TAV1702 mentioned. Just download and replace the mentioned file at GitHub.

Hi Parkho,

how can i fix them? like make them full screen. thanks.

You need to set your table width for them like this:

<table width="100%">.........................</table>

You need to set your table width for them like this:

.........................

Thanks again.

1 Like

Thanks again.

YW.

On 2/11/2016 at 0:57 PM, Parkho said:

Good Day All,

Here is another module called Financial Report. This is to give your pilots statistics of your airline as well their own.

*Please note this is for phpVMS 5.5x by Simpilot*

Install:

  1. Download repository at Github

  2. Upload to your site in folder’s order

  3. Access it using:

<?php echo url('/finance');?>

 

 

  1. Enjoy!

Demo:

At my websitewww.parkho.ir

Screenshots:

Nice Add-on

There is not for phpvms 5.3?

On 1/26/2017 at 8:41 PM, joooseb said:

Nice Add-on

There is not for phpvms 5.3?

Sorry! This add-on is only available for 5.5x by Simpilot. 

11 hours ago, Parkho said:

Sorry! This add-on is only available for 5.5x by Simpilot. 

I edited some files and I get running in phpvm 5.3

Nice add-on!