Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Expenses by Segment" graph includes revenues #123

Open
deseven opened this issue Nov 15, 2017 · 1 comment
Open

"Expenses by Segment" graph includes revenues #123

deseven opened this issue Nov 15, 2017 · 1 comment

Comments

@deseven
Copy link

deseven commented Nov 15, 2017

It makes no sense (likely a bug), so i've added the type of the operation check for SQL query in controllers/DashboardController.php:

SELECT x.`year`, x.`month`, y.desc_category as seg, y.hexcolor_category as colorseg, sum( x.value) as total FROM (
                SELECT category.id_category, category.desc_category, category.parent_id , c.value AS value,
                       year(c.`date`) as `year` , month(c.`date`) AS `month`
                FROM category
                INNER JOIN cashbook AS c ON category.id_category = c.category_id WHERE c.type_id = 2 ) AS x
                INNER JOIN category AS y ON x.parent_id = y.id_category
                INNER JOIN user AS u ON y.user_id = u.id
                WHERE u.id = $user
                GROUP BY y.desc_category, x.`year`, x.`month`
                having x.`year` = year(now())  and x.`month` = month(now());

If you're ok with that i'll create a pull request or you can just change it yourself.

@gugoan
Copy link
Owner

gugoan commented Nov 17, 2017

ok buddy
I'm going to test this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants