Jump to content
Parkho

Financial Report V2.0

Recommended Posts

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');?>


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

 

5. Enjoy!

Demo:

At my website www.parkho.ir

Screenshots:

 

 

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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

Edited by TAV1702

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

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

Share this post


Link to post
Share on other sites
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');?> 
 

 

4. Enjoy!

Demo:

At my website www.parkho.ir

Screenshots:

fr1.PNG

fr2.PNG

fr3.PNG

Nice Add-on :D

There is not for phpvms 5.3? :(

Share this post


Link to post
Share on other sites
On 1/26/2017 at 8:41 PM, joooseb said:

Nice Add-on :D

There is not for phpvms 5.3? :(

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

Share this post


Link to post
Share on other sites
On 8/2/2017 at 1:10 AM, Tummi said:

thanks again for another wonderfull module.

 

currently the css is not working..

 

https://www.oneengineout.com/index.php/finance any idea how i can make it looking like yours?

 

I usually publish my modules with plain CSS so everyone can change it base on their needs. What i have as skin on my website is totally custom design and is only for showing my modules. Another issue is the javascript conflict on your website or you may have forgotten to add its relative link to your header section.

Share this post


Link to post
Share on other sites

Thanks for this mod. Quick question. For the expenses, everything is setup as currency. What do I change to make "Percent (Flight)/(Month" as a % not currency.

Sorry man. Not a coder here. :D 

Share this post


Link to post
Share on other sites
On 7/11/2018 at 9:28 PM, loganq said:

Thanks for this mod. Quick question. For the expenses, everything is setup as currency. What do I change to make "Percent (Flight)/(Month" as a % not currency.

Sorry man. Not a coder here. :D 

Not sure if I'm following you by percent flight.🤔

Share this post


Link to post
Share on other sites
Quote

Aircraft Servicing                                  $ 800.00                  Per Flight

Reservations and Sales                       $ 10.00                    Percent (Per Flight)

System Overhead                                $ 10.00                    Percent (Per Flight)

In your coding...the airline expenses all use the currency....but as you can see I have two things that are based on Percent (Per Flight), however, it still shows it in currency instead of %

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×