Finance Chart Problem

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,

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

THanks… would you be able to send me your VAs database so I can load it up and see what’s happening locally?

PM me…

It does the same thing for me…I mentioned this months ago…it worked at one point then after one of the updates it stopped.

yes well i copied the admin code and thought yeh thats fixed lol but then i visited the site nit logged in and seen the error and realised my mistake.

But yes it was after an update probably a year ago now.

Nabeel is looking in to it.

Rock and Roll

Weird, I’m not seeing it.

Are you viewing the same month/year and all that?

Nabeel, was that to me?

Yup

What code drives that data and ill check to see if its the same.

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

That’s strange for the summary and yearly to work, since they all go back to the monthly.

It’s in core/modules/Finance.php. I can’t look in detail at the moment, but any more info would help me

The data is being pulled and displayed ok in textual form but its just the pie chart that is not graphically displaying the expenses, all that is shown is Pilot Pay and Fuel, the others are not being graphically depicted.

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?

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" }

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

Thanks Nabeel, that’s got it

hello,

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

Actually, I have seen it done on a couple of VA’s, but you need to search for it, as it is hidden real good.

My chart still isn’t working correctly. The previous month doesn’t display correctly, older months do. Weird..

My chart still isn’t working correctly. The previous month doesn’t display correctly, older months do. Weird..

Not correctly meaning… ?