Bug 406403 - Tags within Split transaction not reporting correctly
Summary: Tags within Split transaction not reporting correctly
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: git (master)
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on: 412429
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-10 12:54 UTC by Michael Carpino
Modified: 2024-02-08 07:48 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.2
Sentry Crash Report:


Attachments
Screenshot (106.51 KB, image/png)
2020-04-20 18:15 UTC, codyregister
Details
test case from kmymoney build from master branch (5.11 KB, text/xml)
2024-01-26 13:56 UTC, Ralf Habacker
Details
test case from a kmymoney build with older major version (12.03 KB, text/xml)
2024-01-26 14:05 UTC, Ralf Habacker
Details
test case with several tag combinations (13.38 KB, text/xml)
2024-02-07 18:10 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Carpino 2019-04-10 12:54:40 UTC
SUMMARY With the latest KMM AppImage (Version 5.0.80-5b599ce) when you enter a Tag within a split transaction the output in the report shows the transaction as having (No Tag).  

STEPS TO REPRODUCE
1. Enter a split transaction in a Ledger and include appropriate Tag(s) in the split dialog.  Leave the Tag field blank in the Ledger.
2. Open the Report Transactions by Tag
3. 

OBSERVED RESULT
Transactions Tag within a split shows on the report as No Tag.

EXPECTED RESULT
Transaction by Tag report should show Tags within Splits in the appropriate
Tagged grouping as selected in the split dialog.

SOFTWARE/OS VERSIONS
 
Linux: Fedora 29
Gnome: 3.30.2 

ADDITIONAL INFORMATION
Comment 1 Michael Carpino 2019-04-10 20:18:32 UTC
fyi This problem also exists in the Stable AppImage Version 5.0.3-4f18e69
Comment 2 Ralf Habacker 2019-10-05 14:07:55 UTC
The reason for this bug is the same as with bug 412429
Comment 3 Thomas Baumgart 2019-11-25 18:43:35 UTC
A related problem might have been reported on the forum at https://forum.kde.org/viewtopic.php?f=69&t=163345
Comment 4 Ralf Habacker 2019-11-27 09:33:46 UTC
Git commit 73f0314c34aa2cbf0a532c282cc9acb28e104267 by Ralf Habacker.
Committed on 18/11/2019 at 10:44.
Pushed by habacker into tag '4.8.5'.

Fix 'Tags within Split transaction not reporting correctly'
FIXED-IN:5.0.8

M  +25   -12   kmymoney/reports/querytable.cpp

https://commits.kde.org/kmymoney/73f0314c34aa2cbf0a532c282cc9acb28e104267
Comment 5 Ralf Habacker 2019-12-13 00:01:18 UTC
Git commit 9bc5781d057b58a8a8dc465fda542d004927a513 by Ralf Habacker.
Committed on 13/12/2019 at 00:00.
Pushed by habacker into branch '4.8'.

Add support for showing tags on splits in tag report

M  +21   -35   kmymoney/reports/querytable.cpp

https://commits.kde.org/kmymoney/9bc5781d057b58a8a8dc465fda542d004927a513
Comment 6 codyregister 2020-04-20 18:15:54 UTC
Created attachment 127719 [details]
Screenshot

Here is a report of "Transactions by Tag" The transactions on 11/13/19 and 11/25/19 are parts of two split transactions with tags on the splits but not on the parent transaction.
Comment 7 codyregister 2020-04-20 18:18:21 UTC
Issue is still present in the latest AppImage 5.0.8-feb8f9e.

See attachment. The transactions on 11/13/19 and 11/25/19 are parts of two split transactions with tags on the splits, but no tag on the parent. The splits do not show up under the reports for their respective tags.
Comment 8 Ralf Habacker 2020-04-21 09:42:47 UTC
> Issue is still present in the latest AppImage 5.0.8-feb8f9e.
As can be seen from comment 5, a corresponding patch for 4.8 has been provided to the best of our knowledge. However, it is currently impossible to say whether this will not affect other reports.

For the 5.0 branch, due to the extensive changes that have been made, it is not possible to say whether the patch works at all and does not additionally break other reports.

This also applies to other changes for the reporting engine for https://phabricator.kde.org/D13803
Comment 9 Ralf Habacker 2020-04-22 07:38:55 UTC
(In reply to Ralf Habacker from comment #8)
> As can be seen from comment 5, a corresponding patch for 4.8 has been
> provided to the best of our knowledge. However, it is currently impossible
> to say whether this will not affect other reports.
There are two reasons for this:
1. due to the large number of report settings and the many enhancements and adjustments that have been made, the implementation of reports is in a state where adjustments and bug fixes are very susceptible to create hidden interference with other report types and variants, which may lead to deviations or missing results.
Since the core of financial applications is the "correct" (in the sense of defined rules) processing and presentation of figures, errors in reports have a huge impact and reduce the reliability and usability of the application.

2. In addition, there are currently no comprehensive tests that allow a developer to quickly determine whether a change to the report implementation will cause unwanted interference.
Comment 10 antoine 2020-07-14 08:15:27 UTC
I can reproduce this issue. KMyMoney-5.1.0-74a8f0d-x86_64.AppImage, xubuntu 20.04
Comment 11 Michael Carpino 2021-08-19 12:37:24 UTC
I discovered that the issue with Tags is more than a report problem and it's likely to be related to split Tags in general.

When there is a split transaction and there is Tags associated with them the split transactions are reporting wrong when viewing them in the Tags List within KMM.

The split transactions are properly recorded as a charge in my credit card account but when I view the split transaction in the Tags List it is showing as a Deposit which also reduces the balance by this amount.

Consequently the balance figure is reporting incorrectly. 

To reproduce
Follow the steps in my post of 2019-04-10 and enter the transaction as a payment.
Then view the details of the post in the Tags List.
Comment 12 Ralf Habacker 2024-01-26 13:56:36 UTC
Created attachment 165239 [details]
test case from kmymoney build from master branch

The attached file shows what happens when you add a transaction with splits where a tag has been added to each split. The added tags are not included in the tag list.
Comment 13 Ralf Habacker 2024-01-26 14:05:59 UTC
Created attachment 165242 [details]
test case from a kmymoney build with older major version

A comparison of this file with the test case with a kmymoney build from the Git master branch shows that the splits have no tag, which indicates that a tag cannot be created in the split editor. The input of a tag is ignored and no error message is displayed. However, this is a different error than described and therefore does not belong here.
Comment 14 Ralf Habacker 2024-01-26 14:18:03 UTC
(In reply to Ralf Habacker from comment #13)
> Created attachment 165242 [details]
> test case from a kmymoney build with older major version
> 
> A comparison of this file with the test case with a kmymoney build from the
> Git master branch shows that the splits have no tag, which indicates that a
> tag cannot be created in the split editor. The input of a tag is ignored and
> no error message is displayed. However, this is a different error than
> described and therefore does not belong here.

forwared this issue to bug 480358.
Comment 15 Thomas Baumgart 2024-02-04 14:55:50 UTC
Git commit d5a82fc7ebf1fa23874c5bb87f7a719df1529528 by Thomas Baumgart.
Committed on 04/02/2024 at 12:59.
Pushed by tbaumgart into branch 'master'.

Fix reporting of tagged splits

Reporting tagged transactions did not work properly due to the
assignment of the tag to the wrong split. See commit 96a4ae27bb for a
fix to that problem.

For it to produce correct results in the report, the transactions may
have to be edited so that the tag is assigned to the correct split.
FIXED-IN: 5.2

M  +45   -46   kmymoney/plugins/views/reports/core/querytable.cpp

https://invent.kde.org/office/kmymoney/-/commit/d5a82fc7ebf1fa23874c5bb87f7a719df1529528
Comment 16 Thomas Baumgart 2024-02-04 14:56:06 UTC
Git commit 796df584ef0bada68b6c98d75cd8a1af42c4b8ca by Thomas Baumgart.
Committed on 04/02/2024 at 12:59.
Pushed by tbaumgart into branch 'master'.

Assign tag to the category split

The initial implementation of tags assigned the selected tag to the
split for the account the transaction was entered. This is not useful as
the tag needs to be assigned to the category split.

This change makes sure that the tag is assigned to the category split.
Existing simple transactions can be fixed by opening them in the
transaction editor and saving them again. Multi split transactions need
to be fixed using the split editor.

The above described fix only works for individually selected
transactions. It is not supported when multiple transactions are
selected.
Related: bug 480360

M  +11   -1    kmymoney/views/multitransactioneditor.cpp
M  +35   -4    kmymoney/views/newtransactioneditor.cpp

https://invent.kde.org/office/kmymoney/-/commit/796df584ef0bada68b6c98d75cd8a1af42c4b8ca
Comment 17 Ralf Habacker 2024-02-05 07:34:10 UTC
(In reply to Thomas Baumgart from comment #16)
> Git commit 796df584ef0bada68b6c98d75cd8a1af42c4b8ca by Thomas Baumgart.
> Committed on 04/02/2024 at 12:59.
> Pushed by tbaumgart into branch 'master'.
> 
> Existing simple transactions can be fixed by opening them in the
> transaction editor and saving them again. Multi split transactions need
> to be fixed using the split editor.
> 
> The above described fix only works for individually selected
> transactions. It is not supported when multiple transactions are
> selected.

Can this be fixed automatically when loading the file?
Comment 18 Ralf Habacker 2024-02-07 18:10:18 UTC
Created attachment 165648 [details]
test case with several tag combinations

The contained transaction with post date 2024-01-28 shows an issue: when opening split editor and pressing okay there is 'tag1' two times shown in the transaction tag line
Comment 19 Thomas Baumgart 2024-02-08 07:44:03 UTC
Git commit 62cbaeacb9ceb5a6b580c68cf217df6f6daa968f by Thomas Baumgart.
Committed on 08/02/2024 at 07:43.
Pushed by tbaumgart into branch 'master'.

Clear existing tags from tagContainer before reloading them

M  +2    -0    kmymoney/widgets/ktagcontainer.cpp

https://invent.kde.org/office/kmymoney/-/commit/62cbaeacb9ceb5a6b580c68cf217df6f6daa968f
Comment 20 Thomas Baumgart 2024-02-08 07:48:03 UTC
(In reply to Ralf Habacker from comment #17)
> (In reply to Thomas Baumgart from comment #16)
> > Git commit 796df584ef0bada68b6c98d75cd8a1af42c4b8ca by Thomas Baumgart.
:
: 
> > The above described fix only works for individually selected
> > transactions. It is not supported when multiple transactions are
> > selected.
> 
> Can this be fixed automatically when loading the file?

Unfortunately no. I have not found a rule that allows to automatically modify
existing data without possibly causing wrong results.