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

Total income and expenses differ greatly from website #5

Open
smiba opened this issue Jul 21, 2024 · 1 comment
Open

Total income and expenses differ greatly from website #5

smiba opened this issue Jul 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@smiba
Copy link

smiba commented Jul 21, 2024

Describe the bug
My income and expenses per month differ greatly between the website and the app, not only are both significantly (incorrectly) higher in the app (nearly double), the profit/loss calculation also does not come to the same answer.

I think this might be because of "hidden" transactions, I do a lot of account to account transfers (just sorting payments through bank accounts) and I have a specific category for this so they don't show up in the overview as the money never actually got spent, just moved around.

To Reproduce
Steps to reproduce the behavior:
Not sure, but probably making some transactions and assigning them to a "hidden" category does this

Expected behavior
The total expenses and income being exactly the same as on the desktop website.

Smartphone (please complete the following information):

  • Device: Samsung Galaxy Z Flip 5
  • OS: Android 14 (OneUI 6.1)
  • Version: 1.6.4
@smiba smiba added the bug Something isn't working label Jul 21, 2024
@Rodrigolmti
Copy link
Owner

Hello, thanks for reporting. I'll have to investigate, I do have the same use case as you, but I call them ignored, and at least for me, the income / expense is correct. At the moment, the logic that I use to calculate is as follows:

val totalIncome = transactions.filter { it.isIncome && !it.excludeFromTotals }
            .sumOf { AmountNormalizer.normalizeAmount(it.amount).toDouble() }.toFloat()
        val totalExpense = transactions.filter { !it.isIncome && !it.excludeFromTotals }
            .sumOf { AmountNormalizer.normalizeAmount(it.amount).toDouble() }.toFloat()

Which translates to:
income -> sum all transactions that are marked as income and are not excludedFromTotals
expenses -> sum all transactions that are marked as expense and are not excludedFromTotals

I suspect that your transaction may not being marked as excluded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants