Jump to content

Recommended Posts

  • Moderators
Posted

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

  • Moderators
Posted

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.

  • Administrators
Posted

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 :)

  • Moderators
Posted

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.

  • Administrators
Posted

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?

  • Moderators
Posted

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

  • Administrators
Posted

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

  • 2 weeks later...
  • Administrators
Posted

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

Not correctly meaning........... ?

  • Moderators
Posted

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.

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