Bug 417513

Summary: Report: organize by payees doesn't filter split transactions correctly
Product: [Applications] kmymoney Reporter: mau <b-misc>
Component: reportsAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: REPORTED ---    
Severity: normal CC: b-misc
Priority: NOR    
Version: 5.0.8   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Test file with one transaction and two reports

Description mau 2020-02-12 19:32:50 UTC
SUMMARY
If I create a report on transactions and select Organize by: Payees in the Rows/Columns tab, transaction splits are not filtered correctly, i.e. all parts of the split are shown and used to calculate the balance, so it is incorrect.


STEPS TO REPRODUCE
In my case, I have a kmy file with lots of transactions and accounts in it (which I cannot share). But the main steps (in my case) are:
1. Create a liability account (shouldn't matter at all), called Nebenkostenabrechnung
2. Create a transaction from Cash to that account with two splits: one is against category Mieteinnahmen with e.g. 100.-, one is against this liability account with e.g. 200.-

OBSERVED RESULT
1. Create a transaction report, filter for only the liability account and select Organize by Payees: the report will show both parts of the transaction which is wrong
2. Select Organize by Month instead: filtering is now correct.


SOFTWARE/OS VERSIONS
Latest AppImage (5.0.8, as of 2020-02-11)
Comment 1 mau 2020-02-12 19:35:36 UTC
Additional info: I selected "Include transfers"; if I don't, there is only the "wrong" transaction shown (at least in my case, i.e. the Mieteinnahmen transaction).
Comment 2 mau 2020-02-18 07:59:27 UTC
Created attachment 126118 [details]
Test file with one transaction and two reports
Comment 3 mau 2020-02-18 08:08:09 UTC
I created an attachment showing the problem:

1. I created two accounts: Cash and Incidental Costs (Miet-Nebenkosten)
2. I added the category Rental Income
3. I added the transaction: 1000.- Cash against Rental Income, 200.- Cash against Incidental costs, paid by the tenant to us (we are the landlord in this case)
4. I modified the report Transactions by Payee (comment: REPORT 1): Filters: deselect the cash account
5. I duplicated the report and changed it to Transactions by Month (comment: REPORT 2).

Observed result
Report 1 shows a total of 800 for Tenant, which is 1000.- - 200.-, which is wrong, since we filtered for only Incidental Costs. As Account, both splits show Incidental Costs, which is also not correct, since only the 200.- split is booked against Incidental Costs.
Report 2 shows a total of 200.-, which is correct.