Jump to content

Finance Chart Problem


mark1million

Recommended Posts

  • Moderators

Nabeel,

In the finance and balance sheet page not all the expenses are populated on that pie chart, i used the admin url and the do as the data source but normal pilots would not be able to access that.

Example,

ex1.png

Using the admin url the pie chart is fully populated with the expense types.

ex2.png

Link to comment
Share on other sites

  • Administrators

Can you paste the outputs of:

/action.php/finances/viewexpensechart?type=m1301716800&submit=View+Report

/admin/action.php/finances/viewexpensechart?type=m1301716800&submit=View+Report

Or if you open view-source for that charts pages, and find the "data-file:" parameter of the chart, and go to that URL, can you paste the output of those two here?

Link to comment
Share on other sites

  • Moderators

This is the output,

{ "elements": [ { "type": "pie", "start-angle": 35, "animate": [ { "type": "fade" }, { "type": "bounce", "distance": 4 } ], "gradient-fill": true, "tip": "#val# of #total#
#percent# of 100%", "colours": [ "#FF6600", "#00FF00", "#1F8FA1", "#FF0000", "#333333", "#0000FF" ], "values": [ { "value": 1013663.5973206, "label": "Fuel Costs" }, { "value": 7633.7663888644, "label": "Pilot Pay" } ] } ], "title": { "text": "Expenses breakdown" }, "y_axis": { }, "x_axis": { }, "bg_colour": "#FFFFFF" }

You can see by that the only data going in is the fuel cost and pilot pay.

If i do the same in the admin side its fully populates,

{ "elements": [ { "type": "pie", "start-angle": 35, "animate": [ { "type": "fade" }, { "type": "bounce", "distance": 4 } ], "gradient-fill": true, "tip": "#val# of #total#
#percent# of 100%", "colours": [ "#FF6600", "#00FF00", "#1F8FA1", "#FF0000", "#333333", "#0000FF" ], "values": [ { "value": 1013663.5973206, "label": "Fuel Costs" }, { "value": 7633.7663888644, "label": "Pilot Pay" }, { "value": 161000, "label": "Landing Fees" }, { "value": 16100, "label": "Ramp Fees" }, { "value": 48300, "label": "Catering" }, { "value": 8050, "label": "Cleaning" }, { "value": 48300, "label": "Tug and Ground Crew" }, { "value": 114381.75, "label": "Crew Hotels" } ] } ], "title": { "text": "Expenses breakdown" }, "y_axis": { }, "x_axis": { }, "bg_colour": "#FFFFFF" }

Link to comment
Share on other sites

  • Administrators

Found the problem

modules/finances/finances.php

Around line 45 there is:

// Now expenses
	if(is_array($finances_data->expenses))
	{
		foreach($finance_data->expenses as $expense)
		{
			OFCharts::add_data_set($expense->name, floatval($expense->total));
		}
	}

Replace it with

if (!is_array($finance_data->expenses)) {
       	$finance_data->expenses = array();
   	}

   	foreach ($finance_data->expenses as $expense) {
       	OFCharts::add_data_set($expense->name, floatval($expense->total));
   	}

Fixed on beta right now

Link to comment
Share on other sites

Guest lorathon

My chart for the summary and yearly are working fine its just the monthly expense breakdown the isnt populating the pie chart.

Its the same (hope you dont mind Jeff) on Jeffs site as well, http://www.phoenixva.org/index.php/finances/viewreport?type=m1301716800&submit=View+Report

LOL.. Na I don't mind. Just looked into this thread. Never even knew there was an issue. But thanks for fixing it :D

Link to comment
Share on other sites

  • 2 weeks later...
  • Moderators

hello,

where can i locate and change the color of my financial reports and pie graphs like you did?

/core/common OFC Charts data class

I will get overwritten if you update but just change it and copy it, call it backup so when you do update you can compare differences if any and restore back.

Link to comment
Share on other sites

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