Jump to content

Financial Report V2.0


Parkho

Recommended Posts

  • Moderators

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:

 

 

 

Link to comment
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

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...
  • Moderators

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)

Link to comment
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
Link to comment
Share on other sites

  • 1 month later...
  • Moderators
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? :(

Link to comment
Share on other sites

  • 5 months later...
  • Moderators
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.

Link to comment
Share on other sites

  • 10 months later...
  • Moderators
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.🤔

Link to comment
Share on other sites

  • 4 months later...
On 7/22/2018 at 10:10 AM, loganq said:

Any update on this?

Thanks a million!

HI

I am trying to do the same, however sadly im not able to :(  i think its changed here:

<td><?php echo FinanceData::formatMoney($expense->cost);?></td>

However i am not sure how to remove the "£" on my page or change it to "%"

I will let you know if i make any progress :)

Regards Harry

Link to comment
Share on other sites

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